From nobody Mon Mar 25 02:56:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V2yHR447cz5F63q; Mon, 25 Mar 2024 02:56: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 4V2yHR1ptwz476y; Mon, 25 Mar 2024 02:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711335363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OsCz10D8ygEfALjSVCKc8jnDgJp/p/Rv5AaUw+7MuU8=; b=BRRyGjLsAZXUHsCyNuUtK28l+8ETW9kYNw8qp4ZLZrsTbwkEG/GxeuLuVtq7FF9nq6ype9 wQoEzI/I8t5xis3J8aSHpNzF9F/6R5Be5xDmJeRJIpvlxUXPjQvWech0hbQrunKo+lu/LL pQB1dLf31BSGDwydWbohFviAX7yl7O9KtgVhokY0ppLDc0rlGJrCWbqivKHh2WHv4piaE6 ketd3XrFo+TzOLE859fr38E6g6nFYX8+8HAcEh0texhlfyymvHPJTxBqax4xzvh5IYbhxI 5lhScYDkRFNPo3EyGWT2io1p+wJteSBXBIi+Nc1VcpSw4Yvh1f/YilOfcYfOvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711335363; a=rsa-sha256; cv=none; b=jxyTMt7s4CXfElYKdO6mpqnyIybxh16ZCEEHK05XrykArPGKJS+m2m2Tr+Xk5l6YfdUrlM t/LF6GHNkhnf3b6LI1GA1wpzFKxcZV/uMe52vJC07UCrRzB99q6dDBQPQFQ5BSK6cH8/o0 S1qlpmNzWOKklzfEMDbHVNUdFR8B9s9EaS9G2VZV5yMq9uwVjpkKwxuA7E41YYJso8YNfd 8ltwQHDjS/NQHnhkzCWSqcSQO4/LGc5C0dHCoS1fIYWhObWjv+Ysz5cjC5giYde/c28uLM +0EyflTQmDGoz6XWgrIPAZQtr7Bz0WOETgNOsXcwv+c2Au3wiJSiKycY6H7zww== 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=1711335363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OsCz10D8ygEfALjSVCKc8jnDgJp/p/Rv5AaUw+7MuU8=; b=kpyjjqeNOc3h+AEhiwV32+0UN25dm7Wj4xbBnPX7zhzxhBosscAoMm2E5F8b+GhZdTLfsk 4PWWPo1qL4rUQu+/yugCUvJeq5NQJq3O6aEoPMoRP4vVQ+s+5aBwJsrNixS73Yf2Q4Wa9E X2KwwygJm54J+PoR7ClzGCsPrMn8nqDiYpM5ITGPOa0q9R0kYSNQnkrjS1qGrIW2K98zYC n6zHHiVZCLf1vXzlmqo+mRIDBT78D5jv6k6ldff/NQxj6DoRqkltR3puYfVNRRFXXLZp8n jG9V9dxFlzXT499HFTT/qDPFWdAXvgDTgF86N+XUQdegjjnnznnAjiWO1CBrwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V2yHR1QyZzyvl; Mon, 25 Mar 2024 02:56: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 42P2u33q061558; Mon, 25 Mar 2024 02:56:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42P2u3Ro061555; Mon, 25 Mar 2024 02:56:03 GMT (envelope-from git) Date: Mon, 25 Mar 2024 02:56:03 GMT Message-Id: <202403250256.42P2u3Ro061555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 4399e055ea61 - main - icmp: allow zero value for ICMP limits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4399e055ea610cdefa1470ad1ee614dd81ba5e56 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4399e055ea610cdefa1470ad1ee614dd81ba5e56 commit 4399e055ea610cdefa1470ad1ee614dd81ba5e56 Author: Gleb Smirnoff AuthorDate: 2024-03-25 02:52:03 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-25 02:52:03 +0000 icmp: allow zero value for ICMP limits Zero means limit is disabled, so the value doesn't need to be checked against jitter value. Fixes: ac44739fd834f51cacb26485a4140fd482e20150 Fixes: a03aff88a14448c3084a0384082ec996d7213897 --- sys/netinet/ip_icmp.c | 2 +- sys/netinet6/icmp6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index acb707b1d192..4dfbd0c525ff 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1135,7 +1135,7 @@ sysctl_icmplim_and_jitter(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr) { if (lim) { - if (new <= V_icmplim_jitter) + if (new != 0 && new <= V_icmplim_jitter) error = EINVAL; else V_icmplim = new; diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index ef4216b844b5..e56ec3bc7afd 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2804,7 +2804,7 @@ sysctl_icmp6lim_and_jitter(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr) { if (lim) { - if (new <= V_icmp6lim_jitter) + if (new != 0 && new <= V_icmp6lim_jitter) error = EINVAL; else V_icmp6errppslim = new; From nobody Mon Mar 25 02:56:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V2yHS5BqZz5F6BD; Mon, 25 Mar 2024 02:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V2yHS2nVPz4770; Mon, 25 Mar 2024 02:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711335364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0fM62WycKvs52ih0lPAhkZwlJVin+X1z4dFiX23aYo=; b=K/6RVAfcZaL5Oi9MWm/6DH2PJdoQGah8q4VN9QlWG95PLj4bRtvBBkLv/0D0JqAuVbLG/F qKEdFw/so4bu1nK5bM/VY/MXuMjobNIo1j8IZbJgxgE08fwV503WUCaF/G52opnzdsabHA gbgZOiIysUOT8hTQ8lV0IRvywriWDi+Yn03CKJz1mL6bBFHJpA7CECaSaiAOo6p2PxwWjf d6WmJJ2MIdUvP3Qb9UM6ceCzlGu44foUGRWwLiVBHiCZzbDvLXVftgOu/z6zxCNiCBSRa6 bkHsXTcntyUajkfx7loYc1b8p2kVDOIj1gDmlUKBqj2d6YHuv4sAboB2TCTN+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711335364; a=rsa-sha256; cv=none; b=dez2tYZ/jV1d6H3LghOlFSTrMh0qy4rD8A8YEm5tVOdhwTs91gq/IBLIMihJCpSaKDOXUU vdShCXsU+C8wZLbJrcyWq07xwHIH1tmDDTo5cB8FDUMKibPr89eKnzgFsio8jyo2TLnJ5Z XWPPwrY1TKicLxrVa4cZFpZniOJvsd1mnLgXlHZ5lmiu4GylRlKkoTZ5mbbGgWl7tC2oxc ND/Y6AHKxVRk1FXgPfSWVDnoesN+4RvDRAB1uJE5nXsU0F9gXq0Qwt//XzPWZuLSUsei0s 7I1DFCI1Z6R0X6WNdhEPqIxv1pVKt6LvCkiik3BBgVLFaHJaZ+p2DY34yLXXVw== 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=1711335364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0fM62WycKvs52ih0lPAhkZwlJVin+X1z4dFiX23aYo=; b=nRJxAYjAbuYEpnKWHVPR4TvvMoXhC3RJIBgOmGaLSWTj8pwdgZUFfdjPs5wU2KRtg8Fi8T RZHNMeTiPe/sDBTF0tGIL6CwSFgCtRHWlWK3g+htLuvqqouMhyTe3x7M8tGGwwwMbi4JBu NKXvX+fUL+3CMddhMgKv2gyQPEA7Ybmj5XIzDG3UuEUQK0FqwiTA60WV2VOjcG8L6lKZ6v QPu6XIlGZrLIO0B3PsPs2HmNYPI8u8DglmP15mnBztQRAdoggG0CxacbyFpqvmwxDIZj+T xfJVzn0dGczNuqr1LOvKy1n87Pi5CmXSZjrNrlPOhN9pfoq6WYSiZYvUnRUxJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V2yHS2NlYzyvm; Mon, 25 Mar 2024 02:56: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 42P2u4Z8061617; Mon, 25 Mar 2024 02:56:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42P2u4aY061614; Mon, 25 Mar 2024 02:56:04 GMT (envelope-from git) Date: Mon, 25 Mar 2024 02:56:04 GMT Message-Id: <202403250256.42P2u4aY061614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 75d15e893b14 - main - netpfil tests: disable ICMPv6 rate limiting in the test jail List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75d15e893b14188b83c5fb5e4979fa21c557934f Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=75d15e893b14188b83c5fb5e4979fa21c557934f commit 75d15e893b14188b83c5fb5e4979fa21c557934f Author: Gleb Smirnoff AuthorDate: 2024-03-25 02:54:34 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-25 02:54:34 +0000 netpfil tests: disable ICMPv6 rate limiting in the test jail The dummynet test uses flood ping as source of traffic, so the rate limiting of ICMP replies broke the test. Fixes: 32aeee8ce7e72738fff236ccd5629d55035458f8 --- tests/sys/netpfil/common/dummynet.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index e5ffd3836dfc..3c930cfe2aff 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -387,6 +387,7 @@ queue_v6_body() jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2 no_dad up jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ $(atf_get_srcdir)/../pf/echo_inetd.conf + jexec alcatraz sysctl net.inet6.icmp6.errppslimit=0 # Sanity check atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 From nobody Mon Mar 25 04:44:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V30hy4RJtz5FHtX; Mon, 25 Mar 2024 04:44: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 4V30hy33k7z4KB5; Mon, 25 Mar 2024 04:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711341890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BtoszNQxdbfBe/cPBxo/tg2+doBZr9/F5rmsV6NdTfQ=; b=R9VNjv/pXgx6+1nyY+cKlvtTfXMsa1+5S0dReR+fDFSppIsaUAZbhPeuDDfZe2y0YZVJH4 QhH+n6LSzwlv7x5gNkyl+Q6mpVlo1vdBT1qvsCXni2knrPZsLAJKWW4PZOVXxcWJbDcIcQ wVPADzECJjQsTcNEWx81D9KHZc0z3UYFEddrsRrf/jOTPWFIHfR3DNTZbPV35MTLatx3N5 Udqf5gpzLkedhpWq4igTGLHPUKik9Z6Z/4/CjGe3wOgW7CZfpKPhQMdE8yBJTRdCXlusyh KId2+WsTbQaN8JzJJyXFclOAdWX/a3eeGHj5dJ/lvceZZXSGprrlzC/ey6cRjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711341890; a=rsa-sha256; cv=none; b=e7n4M+nYuEuarRLARNa/e9ZPxlZzFzXSiYta34A0XEoVBiV8NozrU35Fax2346KYqpYmA0 rGqczdze86Q8Fmh/j6GcaTvl/13UZ7O7FhwLPxZOvlVmYFHDkDjzNSnUsZyMX2SmhsieIZ spIx8cyfxQ6HO6hOpPWUHgkQlBd6XIhGszFT2cSaTiLDfietVLEbhX6fKvUmLlx9Oia8W6 mBumXfIt9W6S6/VwaQyFGo0qgrfFtEw0Ou78mP1vauAMWuaUjjcXd2VyjdZjExzkph5hvS voJPBhlp0DLL+dWd080lv84dxEnIyZwTy/SmNtiJux5ueN47sNUTCdKz/FSXAQ== 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=1711341890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BtoszNQxdbfBe/cPBxo/tg2+doBZr9/F5rmsV6NdTfQ=; b=nZdoPu+Ik+NAnY5fcuN440JdemnLf1Ote7nXXHNmxpL7H1yYnMW2U/nsQi3E3yhQ9In2DR HMhAgMQ4kCnBIOl1P08QB/lgxgTSs/SLgXKGALw9UvFNpWK8SBSLY/66qOv86aUVrpazqF 8PqKCke53BZXqwg6mLPmJt2p/6vWTG0kLrTeu8faJRN8F2XOzQ62ZWOvptNCLDBTUYVzg6 rif9kY5LD1hBPoKXpcQy7NKtMxBK5zjszn+dKkI37jkMlNmwoQfSM2tXjmTmgjYsMGXqZw qkl7RGsNERk620mwW9SP0MJE+t+DFyqX6lJSnuUVagCVuVLnmD6+WZLDEaKQiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V30hy2YD6z12X4; Mon, 25 Mar 2024 04:44: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 42P4iocC049743; Mon, 25 Mar 2024 04:44:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42P4iooM049740; Mon, 25 Mar 2024 04:44:50 GMT (envelope-from git) Date: Mon, 25 Mar 2024 04:44:50 GMT Message-Id: <202403250444.42P4iooM049740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a1ecbc570117 - main - pf: fix use-after-free List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1ecbc57011758257b85c3e9f51efc93ac93169d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a1ecbc57011758257b85c3e9f51efc93ac93169d commit a1ecbc57011758257b85c3e9f51efc93ac93169d Author: Kristof Provost AuthorDate: 2024-03-23 16:02:50 +0000 Commit: Kristof Provost CommitDate: 2024-03-25 04:44:23 +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 --- 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 d7536e44623e..50dc67b72439 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7450,6 +7450,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 Mar 25 04:44:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V30hz459fz5FHws; Mon, 25 Mar 2024 04:44: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 4V30hz3NThz4KGr; Mon, 25 Mar 2024 04:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711341891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9StO0E4XKwA9yrTAhVGwhiOePNd5pcOemFcz1M/BTwE=; b=vD1wMMASNnt5KuewHjUwQP+I3DUxcxcZwmIUEMk5n+FGEPZLE3gZYymbQHB2qIJ4v6S3Ab ujnArrSl9ar+YNPD+UCNYhUJwsVuLxR9KOLRl16okPVDKOR+pkuCDndsbED+yr9QCmUBBB XRhStL9t5Sl4Klxll1whBVfjgAUrnT056qdIuDNSGz4QFyzCgugW5YYQPr6uWIVrWZxRMP 65DEbXfAadN5SvqKr8g1MZI8BDEWoLQFvGuc0RUO3FjDn73p96S5vsVavaCdgYqU29Wzgr 8cblR+34yCjb7lhEl5/a77wRLSqBBQbN/sTogP874EkRiExSPJfQF7z31VT4HQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711341891; a=rsa-sha256; cv=none; b=aRNiKlXPugdRa3W7tE3waPx+/Z4o7bu2qr5p0FUHOOAZEe91jxmtE9VPT74xKs7Y76+YwD /zVm0n2H1Urz9vjhn+gpDhDgMPp9Cb8FGgyG6/fZKIWghFhHyQu1skrwykaN6WAPrB6iT/ cnxrJwhNf6yfj58qHT8f7wJkbCVTtK1zJPYFdeCrZyNBTjzhUuiTBOPBmE5EVgSbkmi4kf 4KSdE2sMZ1qeptnx1C77BsrZnv9F0x1nTzyIyjORhw+que3n8pgYVZ1wRb6HiH78ikiUXT is8WZ9sq+KG/Mf52L4lvJxa9EgD4cExfXbsj5RVVJE9hCv1qnH/Ycmq1R8+nBQ== 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=1711341891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9StO0E4XKwA9yrTAhVGwhiOePNd5pcOemFcz1M/BTwE=; b=IijPuZOOaHmFjH9ODbwTxPfkZJt700Ynyy1DPlO0RPBtJCfsHrtvocGxmn9Rq7eaI3PO3P GdtkdTF2fvwnqtp/YB3Fn/ryHa18LgYlCjToUFhVFz5sz0dUs0T7r+ltHTeo9dR6w5kHfd rHaRY/pTydwa8cb1UkSsvTf90xTjNDxBHhQGkDrjkhgNOcy+9i0iBxQqe827CaY7ljJLAM 9QWON97zqy9TDUu+Dguip7uNZOZCrVDoHzPT5Tb4Eh8CSpRlSToPNqajQiVsoNHnaGKosG JaG2cUJqswmbXw6Rc5heqW6DlPnO6exxuRD9PfzlnXh3VAcNbesozengwBdhEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V30hz308xz12X5; Mon, 25 Mar 2024 04:44: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 42P4ipcg049799; Mon, 25 Mar 2024 04:44:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42P4ipuX049796; Mon, 25 Mar 2024 04:44:51 GMT (envelope-from git) Date: Mon, 25 Mar 2024 04:44:51 GMT Message-Id: <202403250444.42P4ipuX049796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 81debbd60e57 - main - pfsync: fix use of invalidated stack variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81debbd60e5773e812e9227a2003ea88699580be Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81debbd60e5773e812e9227a2003ea88699580be commit 81debbd60e5773e812e9227a2003ea88699580be Author: Kristof Provost AuthorDate: 2024-03-24 08:46:31 +0000 Commit: Kristof Provost CommitDate: 2024-03-25 04:44:24 +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 --- 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 e90bc60b85fa..6e43071e1d0d 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 Mar 25 04:44:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V30j06RvMz5FHmK; Mon, 25 Mar 2024 04:44: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 4V30j05H2fz4KYH; Mon, 25 Mar 2024 04:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711341892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Itn5hQsQyqToGY9GF5giQpEUqrUXRJlG4bTerw4nRQI=; b=ndzbJum2Idkc0l0OHFInntg4ASWDdMZ7uaQ9qD43ieN9RA8xfUbLDY/mtnBFCiOb/svu7r nogPhWpyDatlhqWIApc9TB0FvNs7sdirC9HoC2BXWn3LjT2LRKQ/glBRsZW7mlKGA6qZSl UguYxBaCcSuAtX9nQGEeQJ3YG+t+a9ryKZFh+p3NhKXkpGCslFRMDQrIOeuuZldWQlC4x0 YeKrVJg6xNhGPzexgQYqNDsmznPFxUgMSx/fAfN6gon6jSAX5zs/UOqAeqiFKM+QHKtzND PckfPzoi5vueiuUvenxsnwS2p7lM914epjCY50+3mDg9GIp0lA8sKTtMxp6PkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711341892; a=rsa-sha256; cv=none; b=F0KwnsUfPO//DwDbrCVwl8RqPSfXL5+URd5PrsA9uDYJyVKunOueV10+YQH45t5tFvRyx9 rvYqCWPy446DL7NWEG6PMswWEMbA1KyhO1Ai59jtl7tqTxFmqnOl2/8iIn7Em/02hxdDWF banrxoKeddg6YWgEcqe3cJUxMw0S8MLs8i0HSBBF4KIfjOjEr7ZJ0LUmdlAedUt3LlwCLC T0y8uWwlsBxkqzFOoynM4yKaoWvUy0p1TlJdN2zC0Ev4WRzI+u9NNRfLeyE4JKpuytWhwW BwzCuEaNC9HR52CzDneVK8PkZA8hdID4CVqkEeFKDHnRPyyxY3a6k+9O+oy6Mg== 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=1711341892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Itn5hQsQyqToGY9GF5giQpEUqrUXRJlG4bTerw4nRQI=; b=v6XIeNCk430Kekg97OBXD4oeVPJQfgrImMXZeGooNMIJFjJNlwzbo4AFum8wLY5SW+0ssS u59GcW+AsIdg27kbzRZfAv6O2sXDkltGyoRDvPK5ziwVyB7gAvlK8zaPub4aFZnV8O4uxX DlkgS8vM6spysQCIm5x/i0+cACxrTttt4nQIPa67ZnjDCb/2nH+7D11mZSxaJRyx/04qWJ wenexXebSxtqIEWFmTkYEWHy6T5HNMx6HQXkVXmXBqb1vgudn2moWMgtNNz2QgK5bXjlmu WDmYwe8l3p0DvoLhP4DXzWT7I8N5gpcwzF0S+DaYawbMVAcD92UIKhAORxjF6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V30j04cxGz124q; Mon, 25 Mar 2024 04:44:52 +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 42P4iqvO049848; Mon, 25 Mar 2024 04:44:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42P4iq44049845; Mon, 25 Mar 2024 04:44:52 GMT (envelope-from git) Date: Mon, 25 Mar 2024 04:44:52 GMT Message-Id: <202403250444.42P4iq44049845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: caccf6d3c008 - main - pfsync: cope with multiple pending plus messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: caccf6d3c008d3c778986734c2705cdae849a877 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=caccf6d3c008d3c778986734c2705cdae849a877 commit caccf6d3c008d3c778986734c2705cdae849a877 Author: Kristof Provost AuthorDate: 2024-03-24 15:08:52 +0000 Commit: Kristof Provost CommitDate: 2024-03-25 04:44:24 +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 --- 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 6e43071e1d0d..c22a6a5982a9 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 Mar 25 04:57:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V30zW3zRHz5FJMD; Mon, 25 Mar 2024 04:57:27 +0000 (UTC) (envelope-from kp@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V30zW31Frz4Lyt; Mon, 25 Mar 2024 04:57:27 +0000 (UTC) (envelope-from kp@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711342647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xztS+T3fOW1H83dtsSZMe9Z0DlBhtWdOq4nzRNOxFAc=; b=aZ9rbSk6gm5nYeh5GPi8d0VYtH0pykg+jMlH5WQC/DiheJSxs/i/xg2jZkwmuYUqDhsd6B YpXz1uGitq/ZKN5D55wBXVGSLmhT/BKmatUIbcEym+oLK/vuh20uc797u4ZwbrFJQs1+k7 Ux50yhqT/1foi1aOZ4UPOX3M+Mi3GHy87JO/pDviqqebnrc+Wp0efAX+RjL5R4yb6W5D0y CDicaJEUBeK5B5F1/VzjNGs56pjlh9JkqEo32vRCkvjDGnpNl4mlTxHq40rldNMjpBidV7 ZV/F6aKo6Ob/UgQF3nFevQHl6Nk6rMVdt49gDILD2yQzaqTpFjBn9TNkjLyWkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711342647; a=rsa-sha256; cv=none; b=QJX81xbeFAiYhfdRD7POq0xqIZxuAJHFiLmoSCoQpTpebi/zfKgG1a5HM2qd7mSQdrVA78 QMSNlUvyipSpX8ZlYAqH6IsNxsxy8l5rpR99nSooKBtkxJDVbQzKYVD6iMl9lyIdkUZ8D6 GCaRw8q7DPzDcczuFeD4CGSYIJ1Npyn5JVC37Qs1UkHtZdrsj39cyE3+au7kTx35nYPjCU edU8+77zkHDFCUf+ZThY75VNKt04i778ey+ogOgF0bsS5ozBNvBvIV/QI7x+XjjcNGv3Rq ANsyFX2fwiA0p4y3XVrjgeglITGmTGMWRyBDnmQgDKDwu6zmfvBbL8yiubwGuA== 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=1711342647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xztS+T3fOW1H83dtsSZMe9Z0DlBhtWdOq4nzRNOxFAc=; b=Kq4zWL4cRlI+vlDKJRaJ1RhWTYNqDnt5jmlvXnMAFu342wGnrg4nwS94kOyiY+5T/IA+tS q9VZMKmZ/bYE99Mu9T8pOuZ7joXG0+lEeaFPwNkpO3IvYt8o7KMNAU57JnhFEiyGtsOXUS pZTqzct0PNrR11Cc4c6AT0/wStEmdPfLDVTUHq1l0tE+eIqEySiW3e6kYLJYQSpPT3wOC6 hw92P9HiAbXjmb5xpVHyne7WAU/yMKmH+04R169arebFxhJEsZVoH3nm+3EnBNwHb6FnxC dIy4Xv01rlyx9YVEM32zhLgjzSsh4+gnE8qpmeGJLVgkk1dw5OtA5On2DgcpRg== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4V30zW1vL7zJrn; Mon, 25 Mar 2024 04:57:27 +0000 (UTC) (envelope-from kp@freebsd.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 87B9F1D392; Mon, 25 Mar 2024 05:57:25 +0100 (CET) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Kristof Provost List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: git: 75d15e893b14 - main - netpfil tests: disable ICMPv6 rate limiting in the test jail Date: Mon, 25 Mar 2024 12:57:10 +0800 Message-Id: <4E95C04E-DB0F-49CE-9B41-614D9AC3F2B5@freebsd.org> References: <202403250256.42P2u4aY061614@gitrepo.freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: <202403250256.42P2u4aY061614@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: iPhone Mail (21E236) > On 25 Mar 2024, at 10:56, Gleb Smirnoff wrote: >=20 > =EF=BB=BFThe branch main has been updated by glebius: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D75d15e893b14188b83c5fb5e497= 9fa21c557934f >=20 > commit 75d15e893b14188b83c5fb5e4979fa21c557934f > Author: Gleb Smirnoff > AuthorDate: 2024-03-25 02:54:34 +0000 > Commit: Gleb Smirnoff > CommitDate: 2024-03-25 02:54:34 +0000 >=20 > netpfil tests: disable ICMPv6 rate limiting in the test jail >=20 > The dummynet test uses flood ping as source of traffic, so the rate > limiting of ICMP replies broke the test. Thanks for fixing that. It probably would have taken me a long time to figure that out.=20 Best regards, Kristof= From nobody Mon Mar 25 09:01:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V36PH5sRLz5Fhdl; Mon, 25 Mar 2024 09:01:39 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V36PH10CZz4jTp; Mon, 25 Mar 2024 09:01:39 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1711357297; x=1711962097; i=garyj@gmx.de; bh=f4Kg/qT2uvV32uTRKu2Fx5gMmS3KMC1dUxGVFmjMcjs=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References: Reply-To; b=ddtykPbPPo41lG/tZAZOF1Z9muhO/qVJtKqcQfLagakJ6R3yKFHZ4YY6tvKedGov YCq9a+ZN4ejbEx482jInYl3fuv4OEjKVQIoxDSlN6C7GnOFeUGmElNDz+zDVtMSC1 n8lYv+TYF+Foexz5NBZkIaKIb9Ir55wnWc2cBi5rj9Lp8OvubojLK916d0fRs+ycN wEpwbntfnHdaztVfQXpyYjCgSiuv0zsPnnm9fB664o6Pv4SFxndYxPh6BhSMtYCgX Gdhp/Uwb4KiUMoJNna0o61eRuaYPU793CEJDM6NPgKknEu3WlPI4lgmByJ6IoTuGT NomCgM/66PH3yuDJiA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([91.59.224.160]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N79yQ-1sw7Ke3cZ2-017VsS; Mon, 25 Mar 2024 10:01:36 +0100 Date: Mon, 25 Mar 2024 09:01:36 +0000 From: Gary Jennejohn To: Mark Peek Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 65904399db91 - main - efibootmgr: allow -u as a valid option Message-ID: <20240325100136.2a052359@ernst.home> In-Reply-To: <202403241939.42OJdn3w018764@gitrepo.freebsd.org> References: <202403241939.42OJdn3w018764@gitrepo.freebsd.org> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:XyNvQ/ipRKIMAGurkZeWVa2dxlkxN5MVuagRbTnMdQpr0Rn8feQ f6Arj0Q/7uTKVWN4SVdrPtJDKv7H0yeSfaLtmNIzWEB4sepL769MP8G9v2KYOYYlXzAXcKl H8La/Dr2UeFWjdEKlLAHYMc6GSquYvXuOJh8PbC6GAFEcOXg7Xmf0jU9KiO4NLQj/7fn7rB hKLFQCe7qKphw6KG+nsWw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:vzKegfg42JM=;e7wZpQdjE/Oa3wpcg5B1tPapCkr 6IpKYlgr9M0k2QvlKVpkeUlMvBWGI+sUHWkYziTap+O6pvqfHv5ZXFyLL+CGegAig5bgQmrxq w8SHlxClhkW9lhJdmRfK4JxajBP7jklqVayeLYlP7ZIrpbyLo4JMBKQRL3Tr8tqdA98djNwDx zgnnlQaKfr/CTSanSnIq97VKOzYYl4g6KKs3Lwt5cMWZjNpwGSTo8PXKcJ1gbFyaBK/r+3scJ kCXyb/HRqdVPA+iIzHBcfvuLFwQJ2VHC/nsdHV9ZvbO3MNyYWKlDce4FOvnScr1SCvPLTRf9g fthS47lSu81yxLx1mJHHZUzfWmmQtXUfgX41DMfNhPkczL8UXg4viHoHs5LSgcuSsk31K3WMk 9OhfkWQLzetn//KzSHx0p1TYx99eMUAwB+aIFmxO0WG2ZYYMFBBXlq+Ovkb7GeR2DBRNsjD4F 6PFGGxn0csnI3tBJ6e808E6+snhZsS/lpll9GF8GShSkGa1DmiqPUnSqyOd14GE7+kJV5MwOA 44w3wH+yhnzbb9spouWZVfRg+4FmMEwvQoVS85iADpCWf1N6BCnjc5ekunfYv+MxQ1mJWxx2N kFlRylv7pQS+13ClS54Q+WblmZ2IsW+QrgDUggc/riRHkQNi3q1ynDqUxB0BUdfhgw4AdISOv kd2Bl8BPK9Tr6pJBbxBvlcvWM/3x3X91xDL9xSiKUKM4qV9sjpFCb1955/+FAdVGZeBovwWdg sQCV1G8TxIFOekR8tcLcfS2GK/Gt2EdXQw/ZtRNbJgAZwmfJk3FXheYCAv58ow25Ca63mwuuA 2QzPTFbL6ZwDOFtothwZAtYYNp06m7HWtV1y1YvPrufiQ= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE] X-Rspamd-Queue-Id: 4V36PH10CZz4jTp On Sun, 24 Mar 2024 19:39:49 GMT Mark Peek wrote: > The branch main has been updated by mp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D65904399db9167b0970e42e14= 642e1d6bdbf6d3a > > commit 65904399db9167b0970e42e14642e1d6bdbf6d3a > Author: Mark Peek > AuthorDate: 2024-03-24 19:37:12 +0000 > Commit: Mark Peek > CommitDate: 2024-03-24 19:37:12 +0000 > > efibootmgr: allow -u as a valid option > > PR: 277907 > Reported by: vsasjason@gmail.com > MFC after: 1 week > --- > usr.sbin/efibootmgr/efibootmgr.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efib= ootmgr.c > index 2bc79ee26f51..b919130d9c11 100644 > --- a/usr.sbin/efibootmgr/efibootmgr.c > +++ b/usr.sbin/efibootmgr/efibootmgr.c > @@ -204,8 +204,8 @@ parse_args(int argc, char *argv[]) > int ch; > const char *arg; > > - while ((ch =3D getopt_long(argc, argv, "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt= :v", > - lopts, NULL)) !=3D -1) { > + while ((ch =3D getopt_long(argc, argv, > + "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:u:v", lopts, NULL)) !=3D -1) { > switch (ch) { > case 'A': > opts.set_inactive =3D true; > -u is not documented in the man page for efibootmgr, although it was already in the source. =2D- Gary Jennejohn From nobody Mon Mar 25 14:37:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3FsW05S7z5F43Q for ; Mon, 25 Mar 2024 14:38:07 +0000 (UTC) (envelope-from mp@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3FsV6ZDxz4K1J for ; Mon, 25 Mar 2024 14:38:06 +0000 (UTC) (envelope-from mp@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711377486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ut7GaqycjGSfOrj82kCEFZqvLci38qTgA4ft9m40OVA=; b=flgO/xb4HZIMgRH8cdZzFeJ4SW6CBvoLRnMrRMa+otzVeFPm2ziA0jHVUINHZS5OVx/UwN dLIGaAux6ApLHpMxg2JKFjBsJg7ReTOZYy8/2oHsgbakT1BIqLkOnY8fHLLpzFyp0mpPad xLvTnErmrq/fAXBHLDO8KFZ4HWyufO/F8YoBjACsm5LjQZYI05EN8VpN8JwVf9hrQV7Em1 16DDTS5hKuZprlDg8TAzipQsyPAF65ux7jksbjIGjLL0a2nye4rOC21/b4r/8bXLM3cr0G qHmqXnWi4jpsXsDUApp1wgz4sjvoVedIDaRo2keD/UCneNbF0mt3j/n6lD59aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711377486; a=rsa-sha256; cv=none; b=q05AgMrCgB7KBOMT7TcSkrlcrX1/vZeLN7X3dzq2hb0cZEW6DKVOWpP7gpEdUfffoVXwIT /vgDJJFj0WdgKolO7Fm7we+EzVDsrNOseAdK8yElyz9ahHm4+sauGFbWzGMGEtAED/60dm TWMxTvvZgTl62Z2qJB/FDj9q5NCNIQZ3O42iyTU3jJZT0V7dZSM0/osEYiCkM2lv9EXeFq sgO1lkvEPHoWAXOGbs4MGumFtoOJtv94c/AVD1J2OD9OcT1J1Af8TSQNFBEkHjwmOZB4wz bq9wdGzP6qQvJPmIwDw3JhtB83SW0lZr19bGzWhe5K8yOyDBqJAKm1UW2vDYFw== 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=1711377486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ut7GaqycjGSfOrj82kCEFZqvLci38qTgA4ft9m40OVA=; b=nvw75l799nQMZJybsT6SVwt8K3KJl5ee1oNZL2XRtWmbQwrjlzAhHff9hnCQOfCQ2dji2h lIEFQUeBLiObLSQCSkBxBo2zsGHDNOX7JVAh9n8viDlH+cQkkGj9/EteIrXePP++guEFn8 9qUoiXIWEHndgoMEq37ERnUKz5taOzEr55E+53BlVqRU7NsPfGnJMOf+IWa/D61Hy+Zqf2 kXrI0iXLmOdCaOovVpy74qMWL/L7kdUhqNnNVhTAXpPhHzPXyxp2V0Yedvg3xYCDpr4bF4 PJm5jAmVOs1kH7ZBR5mqoKlgIJawuaMarXCZTvKgbVc7Kaux9mZCdyCMsXb4cQ== Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: mp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4V3FsV62pyzVKR for ; Mon, 25 Mar 2024 14:38:06 +0000 (UTC) (envelope-from mp@freebsd.org) Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-dcc4de7d901so3651076276.0 for ; Mon, 25 Mar 2024 07:38:06 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW7aZ4V8wdDgk9EYhKnZR/mSKbzn5X/2XHiV9VK4B0gdFoKPftfEb8fV8pFkbO9DFq5r+zHQcewbFmTgccn9549L8m0i+zotiKv/TaMQO5xYQ== X-Gm-Message-State: AOJu0YzL+8H9japlqm9im6FTbwNrOhZbXwLZ9zTfYDGegNvb5KpV7ToY lR2uGZQ2G/C4RgS2mn60i9QotcblnuOFim6Cu55jzUQr6puv+OsECFMT4rz6AfyUDy97e9FpprF KpCzsBzhl4eYmoOHH1obHxzZHm9sUEEupJEImng== X-Google-Smtp-Source: AGHT+IEow38ZcQENt/QsxK/I1oUESao/wZa/thKnJFgJ21GCJxwaFCnKed5E9hSfeFBI0pr5Abd0gdsdMNjieTD9bgA= X-Received: by 2002:a25:ab0e:0:b0:dc6:de64:f74 with SMTP id u14-20020a25ab0e000000b00dc6de640f74mr5532604ybi.9.1711377486008; Mon, 25 Mar 2024 07:38:06 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202403241939.42OJdn3w018764@gitrepo.freebsd.org> <20240325100136.2a052359@ernst.home> In-Reply-To: <20240325100136.2a052359@ernst.home> From: Mark Peek Date: Mon, 25 Mar 2024 07:37:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 65904399db91 - main - efibootmgr: allow -u as a valid option To: garyj@gmx.de Cc: Mark Peek , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000217ac006147d1f01" --000000000000217ac006147d1f01 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2024 at 2:01=E2=80=AFAM Gary Jennejohn wrote= : > On Sun, 24 Mar 2024 19:39:49 GMT > Mark Peek wrote: > > > The branch main has been updated by mp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D65904399db9167b0970e42e14642e1d= 6bdbf6d3a > > > > commit 65904399db9167b0970e42e14642e1d6bdbf6d3a > > Author: Mark Peek > > AuthorDate: 2024-03-24 19:37:12 +0000 > > Commit: Mark Peek > > CommitDate: 2024-03-24 19:37:12 +0000 > > > > efibootmgr: allow -u as a valid option > > > > PR: 277907 > > Reported by: vsasjason@gmail.com > > MFC after: 1 week > > --- > > usr.sbin/efibootmgr/efibootmgr.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/usr.sbin/efibootmgr/efibootmgr.c > b/usr.sbin/efibootmgr/efibootmgr.c > > index 2bc79ee26f51..b919130d9c11 100644 > > --- a/usr.sbin/efibootmgr/efibootmgr.c > > +++ b/usr.sbin/efibootmgr/efibootmgr.c > > @@ -204,8 +204,8 @@ parse_args(int argc, char *argv[]) > > int ch; > > const char *arg; > > > > - while ((ch =3D getopt_long(argc, argv, > "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:v", > > - lopts, NULL)) !=3D -1) { > > + while ((ch =3D getopt_long(argc, argv, > > + "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:u:v", lopts, NULL)) !=3D -1) = { > > switch (ch) { > > case 'A': > > opts.set_inactive =3D true; > > > > -u is not documented in the man page for efibootmgr, although it was > already in the source. > > -- > Gary Jennejohn > Gary, I'm not sure I understand your comment. The man page was updated for -u in this commit: https://github.com/freebsd/freebsd-src/commit/9a7915299484a767fbffc7234b8dc= 45c29954cca And man shows this as: efibootmgr -u unix-path ... -u --efidev unix-path Displays the UEFI device path of unix-path. Mark --000000000000217ac006147d1f01 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Mar 25, 2024 at 2:01=E2=80=AFAM G= ary Jennejohn <garyj@gmx.de> wrot= e:
On Sun, 24 Mar 2024 19:39:49 GMT
Mark Peek <mp@FreeBSD.org> wrote:

> The branch main has been updated by mp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D65904399db9167b0970e42e14642e1d6bdbf6d3a<= /a>
>
> commit 65904399db9167b0970e42e14642e1d6bdbf6d3a
> Author:=C2=A0 =C2=A0 =C2=A0Mark Peek <mp@FreeBSD.org>
> AuthorDate: 2024-03-24 19:37:12 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Mark Peek <mp@FreeBSD.org>
> CommitDate: 2024-03-24 19:37:12 +0000
>
>=C2=A0 =C2=A0 =C2=A0efibootmgr: allow -u as a valid option
>
>=C2=A0 =C2=A0 =C2=A0PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 277907
>=C2=A0 =C2=A0 =C2=A0Reported by:=C2=A0 =C2=A0
vsasjason@gmail.com
>=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 1 week
> ---
>=C2=A0 usr.sbin/efibootmgr/efibootmgr.c | 4 ++--
>=C2=A0 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/ef= ibootmgr.c
> index 2bc79ee26f51..b919130d9c11 100644
> --- a/usr.sbin/efibootmgr/efibootmgr.c
> +++ b/usr.sbin/efibootmgr/efibootmgr.c
> @@ -204,8 +204,8 @@ parse_args(int argc, char *argv[])
>=C2=A0 =C2=A0 =C2=A0 =C2=A0int ch;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0const char *arg;
>
> -=C2=A0 =C2=A0 =C2=A0while ((ch =3D getopt_long(argc, argv, "AaBb= :C:cdDe:EFfhk:L:l:NnOo:pTt:v",
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lopts, = NULL)) !=3D -1) {
> +=C2=A0 =C2=A0 =C2=A0while ((ch =3D getopt_long(argc, argv,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"AaBb:C:cdDe:EFfhk:L:l:NnOo:pT= t:u:v", lopts, NULL)) !=3D -1) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0switch (ch) { >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case 'A'= :
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0opts.set_inactive =3D true;
>

-u is not documented in the man page for efibootmgr, although it was
already in the source.

--
Gary Jennejohn

Gary,
I'm = not sure I understand your comment. The man page was updated for -u in this= commit:
=C2=A0 =C2=A0 =C2=A0efiboo= tmgr -u unix-path
=C2=A0 =C2=A0 = =C2=A0...
=C2=A0 =C2=A0 =C2=A0-u = --efidev unix-path
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Displ= ays the UEFI device path of unix-path.


= Mark
--000000000000217ac006147d1f01-- From nobody Mon Mar 25 15:47:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3HQ24LVRz5FBWF; Mon, 25 Mar 2024 15:47:54 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3HQ20674z4RhS; Mon, 25 Mar 2024 15:47:53 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1711381672; x=1711986472; i=garyj@gmx.de; bh=7zPkyomIadl44wspyIiVBy9G8gZ2O93LgZF+uUh0t7E=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References: Reply-To; b=NY0J8n2QxeG4VPhIOkst3GfPLhcR9BtIWuG2JcgNZkanB08q/7Wg2jhwdm5zpbwj 3aCE4Wu0g8QvypCp0ELUYlHEXb/eufRBQrfUuH/xY2RYpgUrdTeRsX+KgCxQb5zMe m5ktxv5iuGS8CLnyitOBtwwPJu65qoi9u+Oom00gPvqHa5qz9vLTK/9g9+ZIJ6XEx I713lgteqR7SHNdlMdwb45P4yQbi64ZUlouWPtRwDIJHCKvgY+dXtxzPVhsPlnm3Y AQcwCbPplLIGHa60d4E1H4p7UlCUoGlcv2KpDSDiSbFPOQFT799f03JPfpIyYfHdC yfaZu608F1EvUQ/9ng== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([91.59.224.160]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXd2-1sBNuc0otu-00MfWA; Mon, 25 Mar 2024 16:47:52 +0100 Date: Mon, 25 Mar 2024 15:47:51 +0000 From: Gary Jennejohn To: Mark Peek Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 65904399db91 - main - efibootmgr: allow -u as a valid option Message-ID: <20240325164751.21b85926@ernst.home> In-Reply-To: References: <202403241939.42OJdn3w018764@gitrepo.freebsd.org> <20240325100136.2a052359@ernst.home> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:acMSPFzP0n+9WhGjka2ZNwzSNLzhe/OOEhd0Kb57VbhGoLcxil6 Gd7lAzhb9abvLKl/beMe7XpesZYg/yJGz+qFeLVZbU2cqzHigN8mmgAc7s5VAwyVDjWuBsc /lkoZxTKHvq0szFXYI8xGzbf0JAKQPZUrEN9CUVNeyVOO3JIC4p1htrVCjPs5JtC9hlAw54 DezLlsvsK3lMo2K8uFGzw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:AUpnYm/cydg=;dz363fvrjrX9krPKBe3UH1JCfj8 qjjz42kicO17kpapJQOd2nW8pfS0tDglAnmyV7t4RbrlDGGicXRwU8LTV9kGJ3dpwW5v2i/64 Nn7uiuOFSplEf7GhMKwq6kMBeq0mHC55fZ/6DOYHAZB5Gdad+T6Jbt4eCY6Z/OjVcnpWWh+2l riOnjOVfkG+boM7WmpHCvrK/hN8y+d6IeNXwzuc4awsHh2L9dNZJDybT3Fzlj/rsRe+0LBhgt TbLoi95sIJHp+A/UlyrfU6ppKNNdosv8PhFyc+sJWML9D0E/mu3fI9nc3fDBcGn7nM+4jP0s+ iHUuLiXxmb7clr8rZqhEVhKjLgaFcyPdxHGS7ljJM4TfVa0NbuMsThCIm3IpPpIchEtWYs6Nh QCXxvGo5HjLNyHoO1CeyHFpxwvmXTe6rvE+7zXP3XGkRSnHg/grPvNJyRKpC7fQURw6eUcazE +Ha+R1Mbyw2W0gbAIaB49Ss5VmohqDNFQHWmSNt+Pgf7nc1YuaR5+mHWOkMgT0wqh1ePwD2Tn WShbp3bJ/Sbt2+mMu8O/QKltBDOV1+m9Vji9euWIErIELBGWdGRYM2LKDlZrIBtqZaE+VF3Yc ABU3DdcYFJM5/v++IJLnifU//yH6lN7tsFxlzcOfTePchwgzXHIcw6d9t/Wet+EjCjXgTFIhM AEgdL2INuKLgpCUmNWBwvBC4TUWNHtll0daonfaimsq2h4y+YAX3oasj1b03/HwWSXEqExlWW aTpIo6/jpxsNHEvKeKgCaS1mm5+mNwxCw/kMUuun5laTBTFZxEozXrNShd3VCYLQ2wydY35m3 FdbUWTzPMvZ5DSvDBI3yq8tqmirLnTFj9goKBxW3YdUVQ= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE] X-Rspamd-Queue-Id: 4V3HQ20674z4RhS On Mon, 25 Mar 2024 07:37:54 -0700 Mark Peek wrote: > On Mon, Mar 25, 2024 at 2:01?AM Gary Jennejohn wrote: > > > On Sun, 24 Mar 2024 19:39:49 GMT > > Mark Peek wrote: > > > > > The branch main has been updated by mp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3D65904399db9167b0970e42e14642= e1d6bdbf6d3a > > > > > > commit 65904399db9167b0970e42e14642e1d6bdbf6d3a > > > Author: Mark Peek > > > AuthorDate: 2024-03-24 19:37:12 +0000 > > > Commit: Mark Peek > > > CommitDate: 2024-03-24 19:37:12 +0000 > > > > > > efibootmgr: allow -u as a valid option > > > > > > PR: 277907 > > > Reported by: vsasjason@gmail.com > > > MFC after: 1 week > > > --- > > > usr.sbin/efibootmgr/efibootmgr.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/usr.sbin/efibootmgr/efibootmgr.c > > b/usr.sbin/efibootmgr/efibootmgr.c > > > index 2bc79ee26f51..b919130d9c11 100644 > > > --- a/usr.sbin/efibootmgr/efibootmgr.c > > > +++ b/usr.sbin/efibootmgr/efibootmgr.c > > > @@ -204,8 +204,8 @@ parse_args(int argc, char *argv[]) > > > int ch; > > > const char *arg; > > > > > > - while ((ch =3D getopt_long(argc, argv, > > "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:v", > > > - lopts, NULL)) !=3D -1) { > > > + while ((ch =3D getopt_long(argc, argv, > > > + "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:u:v", lopts, NULL)) !=3D -= 1) { > > > switch (ch) { > > > case 'A': > > > opts.set_inactive =3D true; > > > > > > > -u is not documented in the man page for efibootmgr, although it was > > already in the source. > > > > -- > > Gary Jennejohn > > > > Gary, > I'm not sure I understand your comment. The man page was updated for -u = in > this commit: > https://github.com/freebsd/freebsd-src/commit/9a7915299484a767fbffc7234b= 8dc45c29954cca > > And man shows this as: > efibootmgr -u unix-path > ... > -u --efidev unix-path > Displays the UEFI device path of unix-path. Ah yes. I looked at the man page under /usr/share/man/man8 which isn't up to date. I should have looked at /usr/src/usr.sbin/efibootmgr/efibootmgr.8 instead. Sorry for that. =2D- Gary Jennejohn From nobody Mon Mar 25 15:59:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3HgJ5DdPz5FClm; Mon, 25 Mar 2024 15:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3HgJ4kS2z4Sjs; Mon, 25 Mar 2024 15:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711382364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXxrdlkJsXmyXsElZAtrTWWkwj0C8Rgc7+jibOEfqkY=; b=xBWyhfzteNu8HPNtaPA6McxV1JpV3ZGfrhZ9Z8hhqsIeiA57+MZ6itQhROOfgEUCJd7VgS F3MmGhauz5QXQeUj9NfvIN9T+VG9Csy/0wnTifxkF8wdkXR89gSKeBnulGJvr0HueEJkDU YZmVGON/3/Uaeiq1AIYObGH3+jKvcwgMW67U1Md3WfvU/MkolzCe/uE2FJbXW/G1o61H6N wNo+YEW8sbMgmD7AHK9sorbMYSQ8baYPGq4wqi3Cd2FAmSNO2ZuAVER0OWH/rF+YT7gzx1 +ykkh/ZuD46QneS18np2jiExAoPujxXRzKZYGeFVW8PRmhFKH9yQJfaPjcTugQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711382364; a=rsa-sha256; cv=none; b=k081frFv0Y+rTqbXuAmPAQvLqijIZZASKCWt11CCLregxalPUKbtW80PP+DH4bI3Sd0k+6 6GqDH9SKS8jSphh+qiIO6IfjjILdMWQqKKxCOZtOXdlFNksuE54ZJN1cHzfV+VVuFzovkj ySm0jDZ7hJYEnqy7OvfKb5wx8teSfcpJE6WKabgbSAq/i328dz/kysloPG06F+VjfF0XPJ AqrgRA3lKI8Arpi3DKldwrITUxlyJu9KokSR9ndDqwXv4O/LD+yz/cQSCiHpdsFfJHo99f I2B+crrqTm7xCY5KMZ4QXMekNymFklRWPn3FcmNsGZjzhXSwb83SCgbXDlhnnA== 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=1711382364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXxrdlkJsXmyXsElZAtrTWWkwj0C8Rgc7+jibOEfqkY=; b=c5Hu+KPlzpOMUDYcYgJZg9UADHtoKgi7E5VAfv9OpMwHPmH28D2euJioSRSJYVI05FaAPe L4LotHh/s7TDLAtG1/r3VruZuQ3pAUJWGY41vbn8C9AlVSiwvSV9du2L7OldNgElNPcqY0 RWJFx5ooK2vY+W5LEDKi4l9H8lj7ObDjD3BmMFZc1qJQdhI1qCQQjwyBHIIbMGs/ygu8fq nlgi/DnXNQ/mCt8gpW6YTA7lktCHIrAhmB2Oqe14FmX7u5LKF/2VAaio9pBWWZsPu6LagD 5RboMrEL9udA74GwxG4PghTCSh5fjV55TxbA1XiafhNCxN7jfuniueII6zkG4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3HgJ4KsMzN2P; Mon, 25 Mar 2024 15:59:24 +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 42PFxOGO083882; Mon, 25 Mar 2024 15:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PFxOGd083880; Mon, 25 Mar 2024 15:59:24 GMT (envelope-from git) Date: Mon, 25 Mar 2024 15:59:24 GMT Message-Id: <202403251559.42PFxOGd083880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 2295cae7e606 - main - sleep: Overhaul. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2295cae7e606d75016575927c3d8729745abb17a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2295cae7e606d75016575927c3d8729745abb17a commit 2295cae7e606d75016575927c3d8729745abb17a Author: Dag-Erling Smørgrav AuthorDate: 2024-03-25 15:58:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-25 15:59:02 +0000 sleep: Overhaul. Program: * Add a dummy getopt(3) loop to handle `--`. * Move interval parsing out into a separate function. * Print a diagnostic for every invalid interval. * Check for NaN and infinity. * Improve bounds checks. Manual page: * Miscellaneous markup fixes. * Reword DESCRIPTION section. * Move text about GNU compatibility to STANDARDS section. * Convert examples from csh to sh. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44471 --- bin/sleep/sleep.1 | 77 ++++++++++++++++++------------------- bin/sleep/sleep.c | 111 +++++++++++++++++++++++++++++------------------------- 2 files changed, 98 insertions(+), 90 deletions(-) diff --git a/bin/sleep/sleep.1 b/bin/sleep/sleep.1 index b6af3a648a97..c9069a015706 100644 --- a/bin/sleep/sleep.1 +++ b/bin/sleep/sleep.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 25, 2022 +.Dd March 22, 2024 .Dt SLEEP 1 .Os .Sh NAME @@ -38,21 +38,26 @@ .Sh SYNOPSIS .Nm .Ar number Ns Op Ar unit -.Ar ... +.Op ... .Sh DESCRIPTION The .Nm command suspends execution for a minimum of .Ar number seconds (the default, or unit -.Cm s ) , +.Li s ) , minutes (unit -.Cm m ) , +.Li m ) , hours (unit -.Cm h ) , +.Li h ) , or days (unit -.Cm d ) . -If multiple arguments are passed, the delay will be the sum of all values. +.Li d ) . +Intervals can be written in any form allowed by +.Xr strtod 3 . +If multiple intervals are given, they are added together. +If the final sum is zero or negative, +.Nm +exits immediately. .Pp If the .Nm @@ -65,57 +70,49 @@ sleep is printed on the standard output. The .Dv SIGALRM signal is not handled specially by this implementation. -.Pp -The -.Nm -command supports other time units than seconds, -honors a non-integer number of time units to sleep in any form acceptable by -.Xr strtod 3 , -and accepts more than one delay value. -These are non-portable extensions, but they have also been implemented -in GNU sh-utils since version 2.0a (released in 2002). .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -To schedule the execution of a command for -.Va x -number seconds later (with -.Xr csh 1 ) : +To run a command after half an hour: .Pp -.Dl (sleep 1800; sh command_file >& errors)& +.Dl (sleep 0.5h; sh command_file >out 2>err)& .Pp -This incantation would wait a half hour before -running the script command_file. -(See the +This incantation would wait half an hour before +running the script +.Pa command_file . +See the .Xr at 1 -utility.) +utility for another way to do this. .Pp -To reiteratively run a command (with the -.Xr csh 1 ) : +To reiteratively run a command: .Pp .Bd -literal -offset indent -compact -while (1) - if (! -r zzz.rawdata) then - sleep 300 +while :; do + if ! [ -r zzz.rawdata ] ; then + sleep 5m else - foreach i (`ls *.rawdata`) + for i in *.rawdata ; do sleep 70 - awk -f collapse_data $i >> results - end + awk -f collapse_data "$i" + done >results break - endif -end + fi +done .Ed .Pp The scenario for a script such as this might be: a program currently running is taking longer than expected to process a series of files, and it would be nice to have another program start processing the files created by the first -program as soon as it is finished (when zzz.rawdata is created). -The script checks every five minutes for the file zzz.rawdata, +program as soon as it is finished (when +.Pa zzz.rawdata +is created). +The script checks every five minutes for the file +.Pa zzz.rawdata , when the file is found, then another portion processing is done courteously by sleeping for 70 seconds in between each -awk job. +.Xr awk 1 +job. .Sh SEE ALSO .Xr nanosleep 2 , .Xr sleep 3 @@ -125,6 +122,10 @@ The command is expected to be .St -p1003.2 compatible. +.Pp +Support for non-integer intervals, units other than seconds, and +multiple intervals which are added together are non-portable +extensions first introduced in GNU sh-utils 2.0a (released in 2002). .Sh HISTORY A .Nm diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c index 20e525ce093c..34d335cf4736 100644 --- a/bin/sleep/sleep.c +++ b/bin/sleep/sleep.c @@ -31,93 +31,100 @@ #include #include #include +#include #include #include #include #include - -static void usage(void) __dead2; +#include static volatile sig_atomic_t report_requested; + static void report_request(int signo __unused) { - report_requested = 1; } +static void __dead2 +usage(void) +{ + fprintf(stderr, "usage: sleep number[unit] [...]\n" + "Unit can be 's' (seconds, the default), " + "m (minutes), h (hours), or d (days).\n"); + exit(1); +} + +static double +parse_interval(const char *arg) +{ + double num; + char unit, extra; + + switch (sscanf(arg, "%lf%c%c", &num, &unit, &extra)) { + case 2: + switch (unit) { + case 'd': + num *= 24; + /* FALLTHROUGH */ + case 'h': + num *= 60; + /* FALLTHROUGH */ + case 'm': + num *= 60; + /* FALLTHROUGH */ + case 's': + if (!isnan(num)) + return (num); + } + break; + case 1: + if (!isnan(num)) + return (num); + } + warnx("invalid time interval: %s", arg); + return (INFINITY); +} + int main(int argc, char *argv[]) { struct timespec time_to_sleep; - double d, seconds; + double seconds; time_t original; - char unit; - char buf[2]; - int i, matches; if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); - if (argc < 2) + while (getopt(argc, argv, "") != -1) + usage(); + argc -= optind; + argv += optind; + if (argc < 1) usage(); seconds = 0; - for (i = 1; i < argc; i++) { - matches = sscanf(argv[i], "%lf%c%1s", &d, &unit, buf); - if (matches == 2) - switch(unit) { - case 'd': - d *= 24; - /* FALLTHROUGH */ - case 'h': - d *= 60; - /* FALLTHROUGH */ - case 'm': - d *= 60; - /* FALLTHROUGH */ - case 's': - break; - default: - usage(); - } - else - if (matches != 1) - usage(); - seconds += d; - } + while (argc--) + seconds += parse_interval(*argv++); if (seconds > INT_MAX) usage(); - if (seconds <= 0) - return (0); + if (seconds < 1e-9) + exit(0); original = time_to_sleep.tv_sec = (time_t)seconds; time_to_sleep.tv_nsec = 1e9 * (seconds - time_to_sleep.tv_sec); signal(SIGINFO, report_request); - /* - * Note: [EINTR] is supposed to happen only when a signal was handled - * but the kernel also returns it when a ptrace-based debugger - * attaches. This is a bug but it is hard to fix. - */ while (nanosleep(&time_to_sleep, &time_to_sleep) != 0) { + if (errno != EINTR) + err(1, "nanosleep"); if (report_requested) { /* Reporting does not bother with nanoseconds. */ - warnx("about %d second(s) left out of the original %d", - (int)time_to_sleep.tv_sec, (int)original); + warnx("about %ld second(s) left out of the original %ld", + (long)time_to_sleep.tv_sec, (long)original); report_requested = 0; - } else if (errno != EINTR) - err(1, "nanosleep"); + } } - return (0); -} -static void -usage(void) -{ - - fprintf(stderr, "usage: sleep number[unit] ...\n"); - fprintf(stderr, "Unit can be 's' (seconds, the default), " - "m (minutes), h (hours), or d (days).\n"); - exit(1); + exit(0); } From nobody Mon Mar 25 15:59:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3HgK6HCZz5FCpm; Mon, 25 Mar 2024 15:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3HgK5gyXz4SXf; Mon, 25 Mar 2024 15:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711382365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iePGU1cnfB8WoUFUlXbOCen9jVZ5GK9nN+KiM+l3MRc=; b=jA1BL4V+BWiKa8oEDIeFRSsM9aTH3mMpZ7lkrOnJWlaN1cjg0Jwkw9nRhYJYFTl6VKBCtf F+miaAfeHpioE3pqGJwmavwaFFaFU7kQUOZQD2CEKZr+98AhOKJwElIGQG6XXYfjXQK4as SVy1fxeD+gneP47jTCXOHDZozYaN6q7JEaCL2/9njeu4QqXssNxTs8p5JxSphb+oBCCGiP 4s0cVI1gM8nodGspa561DOqLcY097hjsl0vD57xjL7c8ZG6YEOieDepOZGJDMMUQjQKaF0 xSfDuzLcTFXzsMK2L2dCl7hZvzvL+sKeao36DLFCcnDUEA8n1afovuAScnDlxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711382365; a=rsa-sha256; cv=none; b=NC12ZFgtbFW2fBSfPGHvSNnartDaSyy4LEUCw2zvxYiGu1rhPqwoz9U5kZRyq1o219Jm6Z 36g0J1tZdzyAf7+H2bKc1AqWIo4EjGkNpIldAc7hNmWViTsjklUG/r/8kL+0UgZZLEd5se 4fhaU0GgGG3hJNFIR54v3x3r7Gg2+2GxBVzd278T1yR78vmqCqdoC4igZHCfgmDzSRX2m5 CJ3mcfX/EFkt0nt40c5yxUHltRJN7K0uO9w6EwRkMtvr264YbIPpFivHCu4SS6ERmfWrDj LTiTFG+3BJkosF/Jp0seCQsJ+sDcSazjLPLujbNHlgwQ6AYbbrrDZ3/G/zjwog== 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=1711382365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iePGU1cnfB8WoUFUlXbOCen9jVZ5GK9nN+KiM+l3MRc=; b=AWxcRlnN8OxA0HHJv/OUSFRkrfzEw12A7n7KgGBZK7/ruzdYrCpcCxTD29hYoVCLJaEdXF FfT/LO7eUZaaDvjtBR1vuihj6uHOvD6YV73/abuZ9ZFOAgmUosqcnVud3nJpOru+bmbOux M1VDGto1rzNYPZHveVOBM9gHRecKavCd6PtVHfFH/0zImeflD/qhrHUpYMy4TSdhyMUbHI U6Jsy0teQJLxBpQyVUyNWSaIYB71234NXB1Lz3wQoG+h32tBT05BwjNVKCreA5Ln7iyFot Vnlg5ak8izLCwFiucx1F7kiYKEgiW3Z+KRBycpAuCOA023+LZi4wWYPsmfDrJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3HgK5J3KzN4j; Mon, 25 Mar 2024 15:59:25 +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 42PFxPVw083926; Mon, 25 Mar 2024 15:59:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PFxP55083923; Mon, 25 Mar 2024 15:59:25 GMT (envelope-from git) Date: Mon, 25 Mar 2024 15:59:25 GMT Message-Id: <202403251559.42PFxP55083923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3fed4f0db53a - main - certctl: Revert to symlinks. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fed4f0db53a66a0135bea5c491431eb3348cf51 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3fed4f0db53a66a0135bea5c491431eb3348cf51 commit 3fed4f0db53a66a0135bea5c491431eb3348cf51 Author: Mark Peek AuthorDate: 2024-03-25 15:58:46 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-25 15:59:02 +0000 certctl: Revert to symlinks. Unfortunately tar will not be able to extract base.txz to a system where /etc and /usr are not on the same filesystem if the certificates are hard links. PR: 277828 Reviewed by: mp Differential Revision: https://reviews.freebsd.org/D44496 --- usr.sbin/certctl/certctl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/certctl/certctl.sh b/usr.sbin/certctl/certctl.sh index 997a7d835d53..f95b4561d852 100755 --- a/usr.sbin/certctl/certctl.sh +++ b/usr.sbin/certctl/certctl.sh @@ -110,7 +110,7 @@ create_trusted() { local hash certhash otherfile otherhash local suffix - local link=${2:+-lm} + local link=${2:+-lrs} hash=$(do_hash "$1") || return certhash=$(openssl x509 -sha1 -in "$1" -noout -fingerprint) @@ -159,7 +159,7 @@ resolve_certname() create_untrusted() { local srcfile filename - local link=${2:+-lm} + local link=${2:+-lrs} set -- $(resolve_certname "$1") srcfile=$1 From nobody Mon Mar 25 17:53:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3LCK6G25z5FSwN; Mon, 25 Mar 2024 17:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3LCK5nKnz4fl3; Mon, 25 Mar 2024 17:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711389229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vhaylhQAsqPSrKVyeJLEO3+BkX5fPCNsqJD3Ri4cXqg=; b=gKg2HM3ZrylLMEv5KdE4fT1dgDH9z3fQ9l+ax7oSfrHirr0OEuEaULo1snT1oXrFjBhTXa Iuy0b6+9SFQd3sHj8SMe4Jn80+4dR7Afys5OKaP6hWDpsf4FHiGOuV9T0tt5zMVDxGuZqp L7JjKcS/wVG0ZiKu1ooA8tURxQ8EF+udVdl0yALzTJ2Z49sAEfAeJTccTBNNjroJCLtafi DEYwq7sPouHoO16N+O2le29ygK1HUYZ5jWbWsJA8+sXioJdkKigUXv+sZUnaoInPKwD28X 841EQV3vyl7/RLlPbRspTtoa4uXp/bjGG76ANCFflpM7oMTsmrrGxIC1IVafVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711389229; a=rsa-sha256; cv=none; b=lJHCItQeOA/lcyJ76eFX4UX4cfSzee4cMIZeApHtnd9m04pSmNfojrYLOJkEImkNtN8m5V iod59jxcgFdEd2r9uaPBPdW7Q1nHjsRGHG6vD4xWEldDeg3IJIaFV1XiwBDt3HhWE38eOp avFyeGIxFYSB5bOX/tTWj1d190+8IRGcblPFQythqKYMJf7g7r5/+8/luHOxy8x7lKzWsh 0odOzlAxHJpmWpS0Lcr3aX0AInpZCQQZndPY6g0B4nGhEQBgG4/b9gx9hOdExodKYIQtqX o0Vm6QiqbJglrMup+Bz40o+LvKVLd3H+cT6ab8wM2CRqFRVN2I1IXnCvI4aj7A== 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=1711389229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vhaylhQAsqPSrKVyeJLEO3+BkX5fPCNsqJD3Ri4cXqg=; b=JdRfUYFw/zoEo2rDo90xR667fzS/F7qfDjirBLQYxBnbxrtg8kQovo3Hm84Z8mkzYiey1w mDv4qz6NbTgZ3mRZ88r4sriu8LYwpKBjz8xTr6MslR0UmfuEs8m07rnz4lFgrdtM9UQxSC ppUR1uPx9xOmbiyrynPtyDE25uODzc7OrMIIlM9gs7ridhQDU7HI6khWgPaRG/9QKRMHBU phbdxIqhth5f9e8GV9W0f/HJDzkGbEZtIhiujpzQVUdt5rZLdElnFEsWX7la1D15WGso2D 4MOfE38JVhCvjLs6Pef4IBKTraIVGPeeVWGR+DFELyr1761dXUV9DZ97NkYZcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3LCK5NWqzQcD; Mon, 25 Mar 2024 17:53: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 42PHrn3l085488; Mon, 25 Mar 2024 17:53:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PHrn80085484; Mon, 25 Mar 2024 17:53:49 GMT (envelope-from git) Date: Mon, 25 Mar 2024 17:53:49 GMT Message-Id: <202403251753.42PHrn80085484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: baab6b195497 - main - Remove a reference to xrpu from timetc.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: baab6b19549744adf61a38ff6c2edd9523ab1a6d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=baab6b19549744adf61a38ff6c2edd9523ab1a6d commit baab6b19549744adf61a38ff6c2edd9523ab1a6d Author: Josef 'Jeff' Sipek AuthorDate: 2024-03-25 17:50:50 +0000 Commit: Warner Losh CommitDate: 2024-03-25 17:53:13 +0000 Remove a reference to xrpu from timetc.h It was removed in 2007, so doesn't make a good example. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44462 --- sys/sys/timetc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h index fed3284e21b5..1d9b18620e96 100644 --- a/sys/sys/timetc.h +++ b/sys/sys/timetc.h @@ -49,7 +49,7 @@ struct timecounter { * This function is optional. It will be called whenever the * timecounter is rewound, and is intended to check for PPS * events. Normal hardware does not need it but timecounters - * which latch PPS in hardware (like sys/pci/xrpu.c) do. + * which latch PPS in hardware do. */ u_int tc_counter_mask; /* This mask should mask off any unimplemented bits. */ From nobody Mon Mar 25 19:43:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3NfP64R3z4nw2v; Mon, 25 Mar 2024 19:43: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 4V3NfP5X1Bz4rWD; Mon, 25 Mar 2024 19:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711395837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F/E/4a2R8mbbFFGG8KMxyjp3Mdq7WGMuRbGIf6xNA+o=; b=vQ4DDnxHNWK9GFFX0p1HkPruVzmUCNRgI5Qg60WXVNYQfwImqkYO7/JMm625uqeV8uJkJe mZOxyZTweZegjqhLVNpkFZZOSBofg1CRLpLoeJx8q9SeU3dA45YWkFHVuXWgMIkIGOHwLo vWAl4eKv429NAgpSEIhRyoShxWWa+PSBeG9pXT/lNOczNNk9qpF43GaudwV+hEIQtnru1C mvhh6XRf0ihtELa7PTGb/X4u8H2WPT32gs9vfLn7jTWE1zf3nh4EYlXeMpNMSIAZZu7VAS ymegiopkfQrlnpoUj4rKXMZ809xVIk0PeKL/vvoa+A6rowFrrVILjaxVC5/U2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711395837; a=rsa-sha256; cv=none; b=m/pjApsPuRIZeHNx26kmKiY1Uc8c30YOsDUOuoZ52/xfgUE9jKRcJXQt63n6Mm5KlSmyOe j/WR2VHJX8YUFfvy53hLu82rybOmm63AEeoSimTsBeVkDYEsYbCCSW9c272K4tEQqL3kK/ 8yFpPbXT3A8a3ehLe0muVfVWPpWzEEoEdiWefUZ8Df5INUPJbqxCcJwj+6hoTD3XY9Nk4P zi1ntcrYXS2jRqDxwo1UZjyTsXB1W3EXnDZkYQu3i4BnStm96wC1FtI9vK91wYNCEt8i1f VUZPeT0N6S23E8dyoHwlCz6d3tF43KpSnvW5VCq+1oeuiQ9HRmiol7coTcnR3Q== 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=1711395837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F/E/4a2R8mbbFFGG8KMxyjp3Mdq7WGMuRbGIf6xNA+o=; b=cefc4eGpGcPXBqFjnhp59RyJs4Mxqsk2JVpaRqF3RAe4+4RW+EgQ/jqeryMa+k7FnnzkHJ tGq8BYD5MY8JictiSF7d6WHPBtiKZZM0gIE0EeMHaBaQHhpzb5O1RWfmYpUG8mEtaz7S+C 63KCNwj822HXynXoRpF7ywgLL39s3+kM8VrT4PJHxWWS9zUQ/ZWtYuD2FcAFadoBBakoK2 cJoIZsNIXHw6hZMDEs9o7bcTdai2gcAdCH/MniPtyOO+vFS4bKUYZY/tTirhPC42p+/DUt ru9xyOuxFMCjmcIdTzlEXmBLRYy+Mp0LDi3+J9jqAYAbZf6MDbaazGL90nkbHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3NfP55zTzThg; Mon, 25 Mar 2024 19:43: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 42PJhvhI071611; Mon, 25 Mar 2024 19:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PJhvWd071608; Mon, 25 Mar 2024 19:43:57 GMT (envelope-from git) Date: Mon, 25 Mar 2024 19:43:57 GMT Message-Id: <202403251943.42PJhvWd071608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b6f3cced151f - main - bsdlabel: add deprecation notice List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6f3cced151f8b7dc3e32977e8f1b826f0654690 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b6f3cced151f8b7dc3e32977e8f1b826f0654690 commit b6f3cced151f8b7dc3e32977e8f1b826f0654690 Author: Ed Maste AuthorDate: 2024-01-23 18:04:43 +0000 Commit: Ed Maste CommitDate: 2024-03-25 19:43:34 +0000 bsdlabel: add deprecation notice gpart is the preferred tool for managing partitions of all types, including BSD disklabels. Note that this is only about bsdlabel/disklabel, the tool -- there is no current plan to remove support for MBR or BSD disk labels from the kernel or from gpart. Reviewed by: imp, olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43563 --- sbin/bsdlabel/bsdlabel.8 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index 0e5b35a0588c..dd0f52d0bfb7 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2016 +.Dd March 25, 2024 .Dt BSDLABEL 8 .Os .Sh NAME @@ -59,6 +59,22 @@ .Op Fl f .Ar disk | Fl f Ar file .Ar protofile +.Sh DEPRECATION NOTICE +.Nm +is deprecated and is not available in +.Fx 15.0 +or later. +Use +.Xr gpart 8 +instead +.Po +with the +.Cm BSD +partitioning scheme +.Pc , +or install the +.Pa freebsd-bsdlabel +port or package. .Sh DESCRIPTION The .Nm From nobody Mon Mar 25 19:59:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3P0L0Y4Bz4nx4T; Mon, 25 Mar 2024 19:59: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 4V3P0K6h5Zz4s7t; Mon, 25 Mar 2024 19:59:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711396769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMZYyvk5mumwE6PfIR9g/lLCflkOMPISUc4k1Tfj5dI=; b=TZ5cqD/5DnOJS5DISuTL8Hc5bcN1zxYcXoiThWKhTPimP+CGexwXjDmuCH7eqMlCO9bib5 76Z7Bmp+zUK+BGapWkpaAj+XnZvmbcLy/Mhn1/dDAU2Hkm+/Gal+b//dLHrWGToU0a+cTa mJkEZ427xAyUmlS7l1p1a+6/j1MZWIof1StyS2JpjfN8doFjeJt2WhPQ3yV9/XlIyqhH6h GXX0/NOxir9ob+XMynzqKhKLfwwIf9/Yvf1jr4dAy2xXJmMjiEmnRBQa3e1oBTgHGrnH/Z v6t9d7TbMadWq7qfwb4Vcz9n9DZDGzrP8IkkUIO+8dXAoGw8C9hJKOm/tZe60w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711396769; a=rsa-sha256; cv=none; b=BZwY5jdU8W/kjicaLKk0pSEYVhLQ1D+7Y7Lh8z26i1VkH4phwj0JF1Ifdf7gW6fpYDUM4I 2eRyc/lJofDG/wq71B7/xTcVByx0LT7YYq+k0IiaBHyKTbtpuSUgPCywd+eBO0HM7uEK3X M7lT5BKQE8bmX/Ur2ltmPPWRLYhMOIQV/1gs3eSsiUvTZZoRoD9uGp2436pVs5AtOp5ee5 Obqj7OkSx4imurWYhwLkUUEQVXR0aw/IWjVz9S2QllFDhnztdn3xhwAm7oyfUCGPziUXMi I0ldoBa6cO7qX7kJTaL48f9z9BGENNgXU1+Dg01W/BB4htr4wJHGNw0iLxaMBw== 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=1711396769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMZYyvk5mumwE6PfIR9g/lLCflkOMPISUc4k1Tfj5dI=; b=Tph9y5p1Gtj/a5xkBgOs+6A905NjTH1mvoCw4HmoqyJM0S3S9caT0Nh2PlGAnnslDmr1nN PkaMW3UmyJ37/MYuEdzh5VhXNHgt7vghzVrgkVQ8AH9vVKDaW1i+AQbt/UREP/VxgPKJBG 0DUmOrp/KzaxC8y4bCwBT8Ffn6bv62RyG+hazE53VNIrZuLY1RD0M0mXrW2LSnx1a6v4FG iSbjmq8AenTbJCzviL4sgp18pkW+3YTyMrf7Or5a4bUyP8yalVi4XuRlhJgUGjhRq6kIK5 h2e16xCEOOPRrK5LZ9zxrYR9abscH0Mthlitm9gN4DviGsOXt5OwqXwOoUMVzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3P0K6HLlzW3p; Mon, 25 Mar 2024 19:59: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 42PJxTmP089796; Mon, 25 Mar 2024 19:59:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PJxTvC089793; Mon, 25 Mar 2024 19:59:29 GMT (envelope-from git) Date: Mon, 25 Mar 2024 19:59:29 GMT Message-Id: <202403251959.42PJxTvC089793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3661658c76ce - main - bsdlabel: emit deprecation notice when run List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3661658c76ce028a6dcdd54b00a822159a3ae6f3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3661658c76ce028a6dcdd54b00a822159a3ae6f3 commit 3661658c76ce028a6dcdd54b00a822159a3ae6f3 Author: Ed Maste AuthorDate: 2024-01-24 19:33:35 +0000 Commit: Ed Maste CommitDate: 2024-03-25 19:59:09 +0000 bsdlabel: emit deprecation notice when run Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Reision: https://reviews.freebsd.org/D43586 --- sbin/bsdlabel/bsdlabel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index b831c8ba4ec6..a68ee377a97c 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -135,6 +135,10 @@ main(int argc, char *argv[]) error = 0; name = NULL; + fprintf(stderr, + "WARNING: bsdlabel is deprecated and is not available in FreeBSD 15 or later.\n" + "Please use gpart instead.\n\n"); + while ((ch = getopt(argc, argv, "ABb:efm:nRrw")) != -1) switch (ch) { case 'A': From nobody Mon Mar 25 19:59:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3P0M1Q2nz4nxZF; Mon, 25 Mar 2024 19:59: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 4V3P0M0YgRz4s7y; Mon, 25 Mar 2024 19:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711396771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NF1/oNKQRQh5XWBN4ufShnFvH8WpBNlFuGH2+XePbU=; b=XbnMbMnwvr0oeUtAH83btzhYWV5GCe2A4b796qoY/5yO13Ok75Gh0d6IcwJ6Rwfs/8ElXP jh+WvxFJHA69aMPuY6LwylY6phpj61LAivqc7xDC6seJdRIWWb8Cw2V58elDw6qCz2nen2 NhuYoywqcQChiFrNXzWZQJiAihK1pkm84cghCgclUxr/nPr5XQ9Qxsgm1mJwjnL9GjFvWC eNVMFiIWjJhHztYioDVaEC0H6u/iZf2c4eXDIuLO5B1nHbLJjhpkSQVK6OGr0thDE0g6TG z3Oc8ViuZOE2xv1WxU5d/EzI6Nu20uVb3M9Q1o4tU65kGtUHD/KcFmJ+iFeryw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711396771; a=rsa-sha256; cv=none; b=f+sPhx1ly1Yq/a2LVEvyk6IBwCF9qOob8hGNRIyCJGG7kAQDE25FCNxBSjNpu7BV0n/Esd V2A6wj560Ks1hH10Ctd/xQxa8VFCrAfCT1TWf+poHtYRiJiIm5kFkPfIIIBGMXOzzZBqLp Sk3dqW6/kJ/YUG9k4BXWP7v5HTxMwIE5Ol39Rct5eCGdgTYlh/gWOlTYKgiQHkM/V7rHL9 EuKrK85qO3i+3n3dUPLHQxSkalMQThADZn10hNY5/a3/VyVM491sE07XvX3vhpK64Y6tuG I9gE1aMm73psSYN0dNURSk6uvdyC6GQl56qEtZ5bLpY8r4u+qhcJr1Cns4gXSQ== 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=1711396771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NF1/oNKQRQh5XWBN4ufShnFvH8WpBNlFuGH2+XePbU=; b=txQ6SI2U/j/t8IqHL1tE3k2iiKyRiBptmzzRHbl2BZuisYUFTWuUFeDjAkVIPbe4JeA1bH k+7zO5CmU2GU1f4Ahucn2gqcTJa1gNlJMfcl/z22rXN1wiGI+2fk9NTHLfqN9C+9qKfurI MRKlMVZhKWqqy49pH13s5dNUliKWTCp12X2sfMZMJHWgFKvfvwaL8oN5V73r939WBXGN0t gPOk4BOMtajscvZHs6778sELcShGuJuHxMOhy3NpBA4KAULezhMhE9aszNUBNPCxyGAiOT oFs6nbMSHtkvJ/HaYVr4h3KTTdg5TRB3KC4w8l/Y7fRRBX8ZjSFBCr1ngES3RQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3P0M074RzVHD; Mon, 25 Mar 2024 19:59: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 42PJxUpg089843; Mon, 25 Mar 2024 19:59:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PJxUZO089840; Mon, 25 Mar 2024 19:59:30 GMT (envelope-from git) Date: Mon, 25 Mar 2024 19:59:30 GMT Message-Id: <202403251959.42PJxUZO089840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3bd637afbd68 - main - boot0: remove reference to fdisk List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bd637afbd68baaff3ae4b3d41bdbd39b1fbb63c Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3bd637afbd68baaff3ae4b3d41bdbd39b1fbb63c commit 3bd637afbd68baaff3ae4b3d41bdbd39b1fbb63c Author: Ed Maste AuthorDate: 2024-01-24 15:13:08 +0000 Commit: Ed Maste CommitDate: 2024-03-25 19:59:09 +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 --- 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 123e66fca970..80c7702840c1 100644 --- a/stand/i386/boot0/boot0.S +++ b/stand/i386/boot0/boot0.S @@ -665,7 +665,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 Mon Mar 25 20:14:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3PKZ2LWCz4nyjs; Mon, 25 Mar 2024 20:14: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 4V3PKZ1qVZz3x6P; Mon, 25 Mar 2024 20:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711397666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qF8pdhSrve0j3zZ2Z/0nb41F/LOAWBBLjdGi4wSVSyU=; b=Wm0Fg+4sA7zgOYI7EYF9KtJ5Gi5O+OyVxyh7n6LSS51kpkYhfSjqriEORQnTLtbUF3R1Vh 39IZl+WIG1IW2ye5M9p03LGetxS7/BF8ZUJpxL5wYBU3GFgVZ+v/kIInczwiC5NxmYparf AkDbkYGMtTW7JfVVvonTrKzL622rtmQtFFyNVU6Cr+fyKIj9iXSM3ak6OPPtO9n4R9S/KD vz/quVaC8Hgqqv3KZCa2RUd6s7P5K20VSII5/K7c7GbF/DnYg5pN+sujTBz+ypypGGcwUr iu3fXG9qQxBeo0rsxNagnHHs34jBecdGTG1soIwrTr5xnL9N+OyG0HCNG5W0XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711397666; a=rsa-sha256; cv=none; b=UUrTnYi89rMDzcnru8PWEoQ6wzTZQlG4WVGkF1AJlpCo6VvQzRTFn2JfPdaFySdXt34wqo N52iTncRjWRlEiZEotPHIMMFbkPjkEZHPf5guaSrQSh568rhq/0tjDtlRRlUe6c90CbqFF htfIpAv5v8sIzcsZZH+9o6ldJ3nuxHkpl3+ACM+Hq0Ae+ymOUm9DcEud6yatYyNKEQTPMi nE2I/AR1tpkc2U5ubzKDwyDc7yumYq1fHN9vJUW0GEawbDZYXr5Ede+GOnSmVo3AD/YpLb BMON+5XSA8hvOghY+MiPKpFKTpe3ny+pmlbsYhJqgnTcI0LyPEmY6eaDS4xVQQ== 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=1711397666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qF8pdhSrve0j3zZ2Z/0nb41F/LOAWBBLjdGi4wSVSyU=; b=dI4tfsNwE0XOImBWQ6DCUFeCBePguVKXbuU9nzHxlp21oC4KVjnxhKfdquE1rpQyxZYfhG 4Urypnwd1Us/PFtbqpyXP8allzf0HgYnZU+naUSWZaA30IQjliXJlSWUECHohtLAtZso1k ptc+3yKDBxhRP3Y13KgYwmzf0TSyo+x0Xd7dPMbrQj/xxs+97LbMSO//kjFx2qH2kxFGEp 7siV2Q/JmOcNheb8RYQ2OsWm51fXMkr3FopKnoY/ryRMeBtXiQw9vcf8D/BWiheNk2RmHj Ns1DrzR2+Z/O27uw3+qPuqNHGiO3eAZFrHujlHxji945Ve111vn8av2q15q08A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3PKZ1R1WzWkf; Mon, 25 Mar 2024 20:14: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 42PKEQY4023473; Mon, 25 Mar 2024 20:14:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PKEQEf023470; Mon, 25 Mar 2024 20:14:26 GMT (envelope-from git) Date: Mon, 25 Mar 2024 20:14:26 GMT Message-Id: <202403252014.42PKEQEf023470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: fb860ed0c52c - main - libfetch: parse scheme://domain:/ correctly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: fb860ed0c52c2c1e7792ef86718620a439663c7f Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=fb860ed0c52c2c1e7792ef86718620a439663c7f commit fb860ed0c52c2c1e7792ef86718620a439663c7f Author: Ka Ho Ng AuthorDate: 2024-03-25 20:10:42 +0000 Commit: Ka Ho Ng CommitDate: 2024-03-25 20:11:42 +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 --- 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 8fdcc8e8752e..df97bf486f9b 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -426,7 +426,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 Mon Mar 25 22:26:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3SGR3thsz5FRT0; Mon, 25 Mar 2024 22:26: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 4V3SGR3MRMz49Nv; Mon, 25 Mar 2024 22:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711405615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E/QT7mpf4OmDfWWGXX5plqyAHJPpPd8z75ZKzxjNia4=; b=qHySCPGLadVYx63OeMw5i6t3tv8+GOGUqexFaGV0pD6egBsGazJvdJ0eYCtpjnaY7N9JO4 r+0tvfGzJKKwclSvlzbqpQm0tgubXYC18H7KSUIihweLAC15RljLdSfsAnu84dZNwvJcpf l4ylZP1KlRRvzbVZK3vWgU62UjEusWqN2bnHuP6MANgPew4jTBOSU6I6518ut+tiZMAuAj h/8NjHM6ynTIrUjh0MqabxZ/GvAozryYgkmZnLzJT7WHhcxJsAlAOj+Wd2e7n4SfmHSvkB Xn1Y9PXcD94MJPIXsZUhji/aJoI73PhWk0AN2khcj0KvJ674DXEXu55qRWAgxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711405615; a=rsa-sha256; cv=none; b=x+xBm3gdQDmKbNuXVPVSBbMwQ0mk3L9nwl/lwCbxJSBlbHPYb4m+E89L7nCgPQ3Z/OQB43 h0341o5x1IQRHtjVSW9f/MyWSumbRSpvowEcjA5oY8bXyJ7a7IdIoiNqAkigcmQVgs4S29 JfTLfsW2pmvKxx/YGmtxpnVNQMEn3mhh/Md5H0/jXm1uRWz+PVfL4mmCUIWCfF8YpJ0+5R ZhtV2siKkE3fFe6YKg1KrOaIPPwGd2hy0/+NJlGfy2cpUDcu+sWNMJ7JXq2+HiB/6l3y/6 1wwtIgaEndIdliRYrTbEAYiKdhgumarulCOSN9Y81Esx7bjhHSIxUERuDnQq+g== 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=1711405615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E/QT7mpf4OmDfWWGXX5plqyAHJPpPd8z75ZKzxjNia4=; b=NEM/hHJkpAdrSYGW6Tvd2GuE0011g4V0CzzpsyMGQuxelIYSswbplsr4CIygDTk+2OzVlk kKJHisNf4gZgOx1Z21UDh8iRPJ3zSfx14W3nHpBktVEVdwT84SnDtAXSDJr+Csklls195l pq89vZAdQa9rFTcd4VPVTzojFnwnRjLg0FbgVuCxI1E8Egih8/l8PtQkkJkgPhhuJlPdpI N1pIwqzt8twBcW5sMWRsTTolRdSC8ZhXtdVpoTdvxXcNNJp5ShdsbnvwJPg+Ow3HSE1KVc zaqL6NQ6C0FBRQw9CwAFaxeZ7i5QyFzbi7jeS7h7HUA7BPE4FA62tJ3oVUWMWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3SGR2r3hzZhy; Mon, 25 Mar 2024 22:26: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 42PMQtHH043067; Mon, 25 Mar 2024 22:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PMQtcO043064; Mon, 25 Mar 2024 22:26:55 GMT (envelope-from git) Date: Mon, 25 Mar 2024 22:26:55 GMT Message-Id: <202403252226.42PMQtcO043064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7dc5c6c4120e - main - bsdlabel: add BUGS section documenting 8 partition limit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7dc5c6c4120ee6d5a028a1e01cdc1bfbe9499634 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7dc5c6c4120ee6d5a028a1e01cdc1bfbe9499634 commit 7dc5c6c4120ee6d5a028a1e01cdc1bfbe9499634 Author: Ed Maste AuthorDate: 2024-03-25 22:25:05 +0000 Commit: Ed Maste CommitDate: 2024-03-25 22:26:29 +0000 bsdlabel: add BUGS section documenting 8 partition limit PR: 276517 --- sbin/bsdlabel/bsdlabel.8 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index dd0f52d0bfb7..dcf8c7ccace7 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -518,3 +518,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 Mar 26 02:09:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3YCB5Cfnz5Fnmp; Tue, 26 Mar 2024 02:09: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 4V3YCB4h6tz4Z9g; Tue, 26 Mar 2024 02:09:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711418966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MdiFaFxXMP4PmDt6o4r+LSOeYMiNmh0dGc5uKEoNljk=; b=cJGSruzRvQMIvNGBZ0FapGs1IgeifkDaxtP1IO8ivWBDKCRY+4S0WdiCnk7/JH52E6JLfl zRUVclAFmbwlnBGn6A9DLL1QniFP0xDOZoJDAgsN2ubsdmX3z406QrbsnLmn9Zx0N2KFur 7lsfKn5JCSRullgBXtPzTIf5Ikve2+5O70pvyMVK0tW0NuYpKcCVGEEGy3uUhJl4Jkwnch heNw+PSPuivdovwS+s3zlQFYSyA4mqZU4mZ6hSQlgpOOIaFzU+v2w4GaOdqmcWf4TKGxLp XrZ5XrM+AjKke1w9L6RSWBTQ5hl0Djwrkcuplk3Mtv/28irsgH2qvUebQgEMww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711418966; a=rsa-sha256; cv=none; b=ku0uM5bYyMOvP350hQVdiF6Cft81wJ5h4mR8X6ErAugfWfRcoUygMYjNiDJ3SdhH6Wfm+o Mx2sJDJJ0BU3Tag8c/X2ClkUkxkQ8s1sKEDpxr4dLX++LUhw0g3q6qALIbB9x3UZEjSSDr bqs2NVsNKumaJBNfUhVAu1kecd2jFtvOChS6JF73GupArIzAFMfBFLX9SWhbZwMHG9fXcX 87YSQ4XkNuIn0sJW5Wo7PAuv3e9Do+u1OWHKpziIY4G4EqQkt4K+bG/KBkLTtdyg3R1q2s nkAKANAQ6ULNhEi9y/1k3FpC4pUMJKNrHRbF9weNV6kPPWyfphJc5K3nbLqbkA== 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=1711418966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MdiFaFxXMP4PmDt6o4r+LSOeYMiNmh0dGc5uKEoNljk=; b=nvKNHFE1cTCUIFxFdq6nNU+4nJTf6YZBbdDx7gCqizOFPbTEgemJKzDuc5qj+49j6mtT64 cgOJmnite8L8oCYdrgSdFanQHZhy/OjGxUmNuliVPi/DNKUmGFQTe1HIMo2qALb20WgPcM RF7AWrLFVl7ijuc/nUu5QeirXj6uwrTH9gZ26wbTQFb/orsbTTAHhlm/JSdhnI10z3ySkV qrJfnMQrqGrjsUFOs93+OITV/GUnB6qq0tY4Ee5yz8vW2N29RZkJ/T3ICHxXh/GnF/fLdd 3LevTzr9MGsdGIMP7XAWXZ0sGNsxtNeBAmU7VMJqCAb86IpJ1xdh8t2W3wBiCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3YCB4HMrzhMS; Tue, 26 Mar 2024 02:09: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 42Q29QGJ013820; Tue, 26 Mar 2024 02:09:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42Q29QLU013817; Tue, 26 Mar 2024 02:09:26 GMT (envelope-from git) Date: Tue, 26 Mar 2024 02:09:26 GMT Message-Id: <202403260209.42Q29QLU013817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 960d151eaa1e - main - x86: test the right CPUID bit when checking for XSAVEOPT support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 960d151eaa1ecde109accc30ca0c3306551d8e58 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=960d151eaa1ecde109accc30ca0c3306551d8e58 commit 960d151eaa1ecde109accc30ca0c3306551d8e58 Author: Konstantin Belousov AuthorDate: 2024-03-25 10:34:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-26 02:01:30 +0000 x86: test the right CPUID bit when checking for XSAVEOPT support Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44497 --- 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 83bcc8f0776d..dcc6ff1a03a8 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -233,9 +233,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 25c760ca55e7..16ad7a96ab35 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -315,9 +315,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 Mar 26 02:09:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3YCC62tXz5FnfF; Tue, 26 Mar 2024 02:09: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 4V3YCC5dR2z4Z74; Tue, 26 Mar 2024 02:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711418967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8y/Comi2w4qxan6lBYVEtRfR8GRstWonj0UGt6kumI=; b=PGk/43Qf2UyqvVaU3KHP6LJcY3tagWKpFuF2Gj33JX2vKbTlboNc+qZ95PZcG04FYKQdBq qjfjkMi3cr1gtptFCwCr8ZKcSpgpciNFjirypLd5UdgGa+VHQpnFJvOKRhDQCyqazmGNg0 ksBx+DhU0bEsDhOlp0pU6SuaKVufb1iuB8yYLo7cLQjOd9jLROw5R+FRnCFXEa4lXiwAYx FxUVofOSgzJhyk9MwpDKWrLqdgXqRMq5++GlhJoJhXtE/Tork1t2e/ROma2fnxVGHv16N7 GOPUNotIrvnMoafm4HL20OLzKGmRBMcLy/GbYbUSw9eP7Uoujp05qxBSQ4cFgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711418967; a=rsa-sha256; cv=none; b=AilSvdEso8jhanQa6f07XWVu9UHmSJ32PtInes/mVYnBUkTF0kTaZJBCcg/JHI12mONiVE rRZeKWAoPkCvZAdus0s6hIyNMiMfVsfXf9Zdf858GbNKze8p2GfiKcTKtHoIK81g08ShhC hcsJXikBx3hRaJ/w4t0/mYt/DRgEBOddiF18iffoywQKcfNQXivmWjPkuQCAoAPaspnONF 5tW/0FP5xvP6yhoWEkPSpg/UgWKPnmelZNIGdilMGT++VlCbAqyvF8rP24bQ+laU+YMe5G VamxfaQ7K3uclKylnuCqgzGp2pPrUz+FVN0A2kRzfx8w1wxo+r5ynNpUXvBdwg== 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=1711418967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8y/Comi2w4qxan6lBYVEtRfR8GRstWonj0UGt6kumI=; b=GJFossWNWw/9eVzs0vL+CbtgY9l5aEYFFQDeC8ljTs2dxEXo54eBOpfF0oqAGSt7XRtSKC 8MJB6frgtaq0RPjWN93kMfka9vpXr8GpoSr4fad7QGCxAiL99Eh1RrfYpaNeMM9HiCyNFy X2IwTMhXEaqgiN19OjxfUo5zyYEV9aik6A938k9VOW39ve9uR7ZaDcfFN3rSNwLFosrR6n VZNukPvoGR7NE1E8hZf4FIriKP+L9i+q9O5fKQrUky60K1HCdEoE/TTf3OUUvubBRNPfzA HBYZBAJCKu4UEvS70jni6FZITzlrQkaI42TEm97hkqyHl8Qw+mtUOHO8uIpLew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3YCC5FLHzh2W; Tue, 26 Mar 2024 02:09: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 42Q29RWp013879; Tue, 26 Mar 2024 02:09:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42Q29RLt013876; Tue, 26 Mar 2024 02:09:27 GMT (envelope-from git) Date: Tue, 26 Mar 2024 02:09:27 GMT Message-Id: <202403260209.42Q29RLt013876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e0c92dd2b7e6 - main - amd64: initialize td_frame stack area for init(8) main thread List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b commit e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b Author: Konstantin Belousov AuthorDate: 2024-03-25 12:10:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-26 02:01:38 +0000 amd64: initialize td_frame stack area for init(8) main thread Unitialized td_frame mostly does not matter since all registers are overwritten on exec to activate init(8). Except PSL_T bit from the %rflags which might leak into fresh init as garbage, causing spurious SIGTRAPs delivered to init until first syscall is executed. Reviewed by: emaste, jhb, jhibbits Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44498 --- 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 3df4b1edf4a2..3e4f19d655e6 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -784,6 +784,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 Mar 26 03:56:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3bbC0xZSz5Fy1J; Tue, 26 Mar 2024 03:56: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 4V3bbB71ZQz4lMj; Tue, 26 Mar 2024 03:56:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711425415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S1D/yNXlrs9wmU/h7AKAtLLEzMHI934J2Aid3e4IChA=; b=yWfOeBH9i/DVDKeVRjTYs3FQrw6PTMSPERUjEoUdAwZaCv5XhCvrpV2LpkLbtqupbR8BOE 1QhMuk0oF1Cbtf29awNRfyiou63vXTJ0P4cabtyaUK6MzS+6fD5Dd4LAV+UUgKssegmDbM oK+qRFCeanbyp9kivxAR/F+ud1/c48wcgfC26M2BdmizKvgQQkNR0UQHKXqWF4LgztymiA OGEwJsrCLHMBcHCxPpIQ5ZoUVmKLQQ9zKPTnIgrT1EMExvg9tvGvKMyvnshUNujswRW7BE A830SoXqaBS2toQ1tNNmvoMeNFRnywSZ3dwsdAuIjZ5CyIC1D//foKhWccVYGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711425415; a=rsa-sha256; cv=none; b=v0iVyoCfvdApsDHy3O+GA2krxSZf6f6tOAblPjoTbPTIxASo6ltw1EJ4VsmXG7yfbZjVI3 Q2AFbl9ChEQF0gnWKCfMyWGIseh9utkRbPwxKa+6ynUAKuuNHKHJ3YGyXkT7Y99UW37kZL wiDbpQ6ZV0KXTVjgSAUVXa1Caxt+pBPxnUA7/3heTmGcGugvG5cx4qCT8GF2P7yO0j1D6B 11Wiwr/9hQ19pcRCo1IBdyzLf+OzMUxFjIuV333dcPv/+THXYstEUxcFjjqAajMsGYlkHm w7MfiAyWY++W9+MaxPJUGe+1oDc6nR6Dt+5xTH1mCH52Ixzcf7HlxOwTG1i/1Q== 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=1711425415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S1D/yNXlrs9wmU/h7AKAtLLEzMHI934J2Aid3e4IChA=; b=JYBoqZBeOu0jwhEaURUDIg8KxykOuNwX2zt1jSzzuns1c/sSo9d98gSoL2Zyb44oQeVXdv buAioLtaithTjS1KuFb47ydX+eob7zoJeFYRpW7T8XQq3Ruwna7bFXKlPUJWfsURDWbk71 oxf7OAlA9zH4WL0/MtVeSv0PnJ/Ne3Rj3L+Rf7q8ioDmvcredoQIpjxrBFzdBUATOHkHMr CiNbMgg/u+pnHe/TBSqoP2d635bRRahBll9P9pdZ/pLwYnulDTBMoPv5xedjKgaZqOIgQh LOaFGvWexXzDAP8QPI/XifWHNlqF+7VIslvIWa05DZsLbvZmITM/tnewyt6+mA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3bbB6dqWzkrZ; Tue, 26 Mar 2024 03:56: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 42Q3uslE099666; Tue, 26 Mar 2024 03:56:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42Q3usJT099664; Tue, 26 Mar 2024 03:56:54 GMT (envelope-from git) Date: Tue, 26 Mar 2024 03:56:54 GMT Message-Id: <202403260356.42Q3usJT099664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f43ff3e15c8b - main - kern linker: Do not unload a module if it has dependants List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f43ff3e15c8b4b161ce09c8ab008abc4222db26b Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f43ff3e15c8b4b161ce09c8ab008abc4222db26b commit f43ff3e15c8b4b161ce09c8ab008abc4222db26b Author: Zhenlei Huang AuthorDate: 2024-03-26 03:55:45 +0000 Commit: Zhenlei Huang CommitDate: 2024-03-26 03:55:45 +0000 kern linker: Do not unload a module if it has dependants Despite the name, linker_file_unload() will drop a reference and return success when the module file has dependants, i.e. it has more than one reference. When user request to unload such modules then the kernel should reject unambiguously and immediately. PR: 274986 Reviewed by: dfr, dab, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42527 --- sys/kern/kern_linker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 1126bf967966..325dffbfedee 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1280,6 +1280,8 @@ kern_kldunload(struct thread *td, int fileid, int flags) printf("kldunload: attempt to unload file that was" " loaded by the kernel\n"); error = EBUSY; + } else if (lf->refs > 1) { + error = EBUSY; } else { lf->userrefs--; error = linker_file_unload(lf, flags); From nobody Tue Mar 26 08:48:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3k3L1x4gz5F8hf; Tue, 26 Mar 2024 08:48: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 4V3k3L01MSz4D41; Tue, 26 Mar 2024 08:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711442894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DD7vmOaKz2/Ya9kqd/AxHxBU9ieKGoXJWRvqF6795dE=; b=I+S1gc4Rl3tdS4Z1Xle9VGKn8BhPeFlJAEfMugT1mte6K/7McugRTmL87159P2ROYsfpOH /6m674kTdspqkWtPxwQFdGo7Tcz0XtwE9ji+2C006YeTRZvKor232ocfjuHAX+mB7zb71O 6ZEtwR0+nNNMGfvFSZm/fCuVs+ghzbL58Sf/RAquYZ1UnvNKVp2IlOj8cOgfhwtutjdhRB K74qdr8kutcPT2QpwJDi+/wRwoatiHuvBsL0JQgCnYPYCJvLMCiuXuoRLMEedBE7i0dynM rQKCKq3GWZ0V6mzla3L4zSUe6dpoyQ0XWQkwfC+051WaFF8+n4LN06QejBbtAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711442894; a=rsa-sha256; cv=none; b=pJrRaIRUeJLVOiVSOqugRpwlh7cG3xcymoFWS4n4r09gGjEEFnP1bRn3TbgI8fOW2dLDn0 V5aCwIc9GW2ZO7AMuuaTnTDrYeEdXgw8KBOLaQT8TKBoNRgCfLIxOEgC/iEx/cHKdaQ0LM oZ2RjOEN1GURgMDOMZnFl7S3KnfCFOURpr3lf9PMJdAYn4uTD2yzVH7DU0BoPbCWwFkHA1 h5ftz0hztDtskDPdxWSZ37uJTXtuvP7QtJdNOyQXhac7ibFmhiBbnSrkPvZqY0IqT0cxMj QJEbl6SiEEjTnSdihRzXpf1hH3JuxFW5DkMIUHg8a8NpHnM+XkJIj18R/iqOLQ== 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=1711442894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DD7vmOaKz2/Ya9kqd/AxHxBU9ieKGoXJWRvqF6795dE=; b=j6kh5KHa6y5jb2XmutGygwi2vZqJm7YoqmAJqXzr/jU3KGZs9iX4dswhKrB+wbFYf8HWly 41S0nMNCEUtV0688AR+Z7yODbtbJGgaJN/V8eWQ982q4EoRKZ3ujz7Bji0A/uLbynP4xbX vRG2Bqy9v2Brmt44DW2r/SUlQk2h0R2Ilb8dofgVk15ofr2Vf/E8YSW7MSjMJ/OKl/gYdZ ofoybJrQleiyPhW9UrQnbGPd1FAwPBFZ9XE0dVX0BlLtRueRB6cQSlCiBd9j7sOEV0Q8NT H6EvpfIBlaORaMOU5ki2tgYjMqpMYRdnKXvxfbRoEyF03dTX6lkmhLtp9x0y1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3k3K6WV8ztVH; Tue, 26 Mar 2024 08:48: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 42Q8mDDt091361; Tue, 26 Mar 2024 08:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42Q8mD3M091358; Tue, 26 Mar 2024 08:48:13 GMT (envelope-from git) Date: Tue, 26 Mar 2024 08:48:13 GMT Message-Id: <202403260848.42Q8mD3M091358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 39450eba8e6c - main - kern linker: Do not touch userrefs of the kernel file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39450eba8e6cd5b83def724481127b58ecc1fcc1 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=39450eba8e6cd5b83def724481127b58ecc1fcc1 commit 39450eba8e6cd5b83def724481127b58ecc1fcc1 Author: Zhenlei Huang AuthorDate: 2024-03-26 08:47:02 +0000 Commit: Zhenlei Huang CommitDate: 2024-03-26 08:47:02 +0000 kern linker: Do not touch userrefs of the kernel file A nonzero `userrefs` of a linker file indicates that the file, either loaded from kldload(2) or preloaded, can be unloaded via kldunload(2). As for the kernel file, it can be unloaded by the loader but should not be after initialization. This change fixes regression from d9ce8a41eac9 which incidentally increases `userrefs` of the kernel file. Reviewed by: dfr, dab, jhb Fixes: d9ce8a41eac9 kern_linker: Handle module-loading failures in preloaded .ko files MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42530 --- sys/kern/kern_linker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 325dffbfedee..9d3cb9b7bd63 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1862,6 +1862,9 @@ linker_preload_finish(void *arg) sx_xlock(&kld_sx); TAILQ_FOREACH_SAFE(lf, &linker_files, link, nlf) { + if (lf == linker_kernel_file) + continue; + /* * If all of the modules in this file failed to load, unload * the file and return an error of ENOEXEC. (Parity with From nobody Tue Mar 26 09:56:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3lZ55q2tz5FGd5; Tue, 26 Mar 2024 09:56: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 4V3lZ55HmRz4JnV; Tue, 26 Mar 2024 09:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711446989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O+ARetHKdSR/6RlnYxG5BWWyRQvGRIUFp5NsYmdYPVM=; b=RY2X2QGvRUEfojiYdIBgXMbVyq7TyjSsSSyk8NnjFIXD+VjKbEy7XHAM6LB3yf0zbmZjxK uoquG3/YkhoRakL731ABhWmhzHdU1GjfbFn2H+I5VlpmUI54lcqHBgjdlxHPfU7PWiRfNZ gQghZ2IDTGkL2MPEHMHWs8/glmnXN0ekBEXc+Yx1kwSYymqEuMMQqUVCMn1JhAoKWwofHC ma7rUoAl7USClGlHkvrZKGbTd2AjgtNQ0usRawjsDgyEzfnQRW2kP8HrQx6sW41SKD6iR9 2A17gse2owCGuuOn2c5M4zgCyI/ZTUjtKl5Vq+f6J21Nsx4VsiH2R+Wjoid+bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711446989; a=rsa-sha256; cv=none; b=kaHCoNwrk9J5x2pgoRWu08Lw/zVhB6rRORfoyPSjlbIWmDBDiihFH27hFCpis6POGpEWPO a5Wl1eQrsohJ9KEtOhCqJMduiAMtLgFf95KvEuRmDza6ILC2VgoVmnqOn17FnSWkpD5a4l 6cP30Pt/6qU1pPowQQSdHdWp1Juekk9Vo6rEypR9Pv6Df9hkSMdLJo1r6DeyKb7QX+NB+x EaZ+ZtNWg3WUm3pFCmZLPwA0vVT6S2NDN7rsZcfe5VuVREW+jgjKEtrKKpFRZ5qkefIc/e HotET9Ouz4K8qM80bJl2rQQvAHW5lL/JOnvp7l2Js5vTB47yS0AoPGGPzBZfZg== 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=1711446989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O+ARetHKdSR/6RlnYxG5BWWyRQvGRIUFp5NsYmdYPVM=; b=Q/yurEHSFpSPcMwQ9oRNbBbfh2Y3lJKyqDxO0nuM3W7okMkR8gn8sp3407TUw6CiHZP1Sv R6wI+KyUtk1lKLqzJ3Og8onEa1MXelA3yUHSxk1/m5mHA0D3Vt2NA3PJtIMG1O3EodYNIJ Fp6/DEbwwmh+ncV2LzMP5DxVuS5Gk+0lnBixnxLj/tpEMO9Z3N0tkTsMDQx5WBYG/rgUPu G1SPgwr2A3nNfKzVlMK6Pdvy7Pb4t5wi9q9kJPl394c2VFUkJd2DKIDrkmT0VtN0Oce8/h GvN08zhHVLktZLkDqS0GZUYnXNE+tFlydSluRvULQhb3TKQZJroZyzZZTO5O3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3lZ54tsvzw2P; Tue, 26 Mar 2024 09:56: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 42Q9uTiC009663; Tue, 26 Mar 2024 09:56:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42Q9uTFG009661; Tue, 26 Mar 2024 09:56:29 GMT (envelope-from git) Date: Tue, 26 Mar 2024 09:56:29 GMT Message-Id: <202403260956.42Q9uTFG009661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 73fdbfb91121 - main - netmap: Address errors on memory free in netmap_generic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73fdbfb911215795c55c89870ebc5d9197bf2a23 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=73fdbfb911215795c55c89870ebc5d9197bf2a23 commit 73fdbfb911215795c55c89870ebc5d9197bf2a23 Author: Tom Jones AuthorDate: 2024-03-26 09:52:07 +0000 Commit: Tom Jones CommitDate: 2024-03-26 09:55:55 +0000 netmap: Address errors on memory free in netmap_generic netmap_generic keeps a pool of mbufs for handling transfers, these mbufs have an external buffer attached to them. If some cases other parts of the network stack can chain these mbufs, when this happens the normal pool destructor function can end up free'ing the pool mbufs twice: - A first time if a pool mbuf has been chained with another mbuf when its chain is freed - A second time when its entry in the pool is freed Additionally, if other parts of the stack demote a pool mbuf its interface reference will be cleared. In this case we deference a NULL pointer when trying to free the mbuf through the destructor. Store a reference to the adapter in ext_arg1 with the destructor callback so we can find the correct adapter when free'ing a pool mbuf. This change enables using netmap with epair interfaces. Reviewed By: vmaffione MFC after: 1 week Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44371 --- sys/dev/netmap/netmap_generic.c | 29 ++++++++++++++++++++++------- sys/dev/netmap/netmap_kern.h | 4 +++- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/sys/dev/netmap/netmap_generic.c b/sys/dev/netmap/netmap_generic.c index 83210ae755c7..9b1218043a88 100644 --- a/sys/dev/netmap/netmap_generic.c +++ b/sys/dev/netmap/netmap_generic.c @@ -256,7 +256,7 @@ generic_netmap_unregister(struct netmap_adapter *na) * TX event is consumed. */ mtx_lock_spin(&kring->tx_event_lock); if (kring->tx_event) { - SET_MBUF_DESTRUCTOR(kring->tx_event, NULL); + SET_MBUF_DESTRUCTOR(kring->tx_event, NULL, NULL); } kring->tx_event = NULL; mtx_unlock_spin(&kring->tx_event_lock); @@ -271,16 +271,18 @@ generic_netmap_unregister(struct netmap_adapter *na) for_each_tx_kring(r, kring, na) { callout_drain(&kring->tx_event_callout); - mtx_destroy(&kring->tx_event_lock); + if (kring->tx_pool == NULL) { continue; } for (i=0; inum_tx_desc; i++) { if (kring->tx_pool[i]) { - m_freem(kring->tx_pool[i]); + m_free(kring->tx_pool[i]); + kring->tx_pool[i] = NULL; } } + mtx_destroy(&kring->tx_event_lock); nm_os_free(kring->tx_pool); kring->tx_pool = NULL; } @@ -434,7 +436,7 @@ out: static void generic_mbuf_dtor(struct mbuf *m) { - struct netmap_adapter *na = NA(GEN_TX_MBUF_IFP(m)); + struct netmap_adapter *na = GEN_TX_MBUF_NA(m); struct netmap_kring *kring; unsigned int r = MBUF_TXQ(m); unsigned int r_orig = r; @@ -458,6 +460,18 @@ generic_mbuf_dtor(struct mbuf *m) kring = na->tx_rings[r]; mtx_lock_spin(&kring->tx_event_lock); + + /* + * The netmap destructor can be called between us getting the + * reference and taking the lock, in that case the ring + * reference won't be valid. The destructor will free this mbuf + * so we can stop here. + */ + if (GEN_TX_MBUF_NA(m) == NULL) { + mtx_unlock_spin(&kring->tx_event_lock); + return; + } + if (kring->tx_event == m) { kring->tx_event = NULL; match = true; @@ -525,7 +539,7 @@ generic_netmap_tx_clean(struct netmap_kring *kring, int txqdisc) /* This mbuf has been dequeued but is still busy * (refcount is 2). * Leave it to the driver and replenish. */ - m_freem(m); + m_free(m); tx_pool[nm_i] = NULL; } @@ -638,7 +652,8 @@ generic_set_tx_event(struct netmap_kring *kring, u_int hwcur) return; } - SET_MBUF_DESTRUCTOR(m, generic_mbuf_dtor); + SET_MBUF_DESTRUCTOR(m, generic_mbuf_dtor, kring->na); + kring->tx_event = m; #ifdef __FreeBSD__ /* @@ -664,7 +679,7 @@ generic_set_tx_event(struct netmap_kring *kring, u_int hwcur) /* Decrement the refcount. This will free it if we lose the race * with the driver. */ - m_freem(m); + m_free(m); } /* diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 8618aaf82299..dd736b46ae70 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -102,6 +102,7 @@ #define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) #define MBUF_TRANSMIT(na, ifp, m) ((na)->if_transmit(ifp, m)) #define GEN_TX_MBUF_IFP(m) ((m)->m_pkthdr.rcvif) +#define GEN_TX_MBUF_NA(m) ((struct netmap_adapter *)(m)->m_ext.ext_arg1) #define NM_ATOMIC_T volatile int /* required by atomic/bitops.h */ /* atomic operations */ @@ -2395,9 +2396,10 @@ nm_generic_mbuf_dtor(struct mbuf *m) uma_zfree(zone_clust, m->m_ext.ext_buf); } -#define SET_MBUF_DESTRUCTOR(m, fn) do { \ +#define SET_MBUF_DESTRUCTOR(m, fn, na) do { \ (m)->m_ext.ext_free = (fn != NULL) ? \ (void *)fn : (void *)nm_generic_mbuf_dtor; \ + (m)->m_ext.ext_arg1 = na; \ } while (0) static inline struct mbuf * From nobody Tue Mar 26 14:42:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3svc5Rp8z5Fjqg; Tue, 26 Mar 2024 14:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3svc4yjMz4lHy; Tue, 26 Mar 2024 14:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711464124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLqAbqtmqzserPWd0MXh7a3D/mBObFJ8FqA3kr+PtlE=; b=IffsdTHB/OAizUw/mCqowNMLJnNIY/9wWXbj9pGOt1ZlhgG/bx/KbvOwFIuPRFtuBzVzOb 3wwHsT/CUDLJTRiOIBVMentnAZGBb/5fW44YeZ9pTR7r1WZkLFZkMmtjhqbM49d6WfhCqE nITX+h9IDd5sA836IecmqEXhFWKfO/bT+9sA/2p/anAfj+/9MLY6VP1dZJZN5VjDIFskhF fFD0GvG9uJ+lMlSs+04YLPQfmQVq5FbU/3bt653yBdhX0Ck1sLv1AYI08DJ06AKgEyaykX V+EBbqw1V6R8LT8NLR4+RN46XFpJDvhHNeAsxF/Amau5VNCygmkaqXVL/8Lwfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711464124; a=rsa-sha256; cv=none; b=UYfq+FAqIwqy5B1v54hesZAc1ty3SZuXDR85Ra9NOZEPP0Uw7G9RXOQbpH6ht29LPBiHIq RLKGTBQ7neJqcaB+mykijQkWPTp4eBSnhuIYSyqXRmIqEFoaOaPEj0ppOd9KW2l6FfVLUy CtqP9TSk60nre9ri0RTXKu6AyFnvaA+MMPBJDuSgEHV4Y98p3L7TA20lTdxRD3wGexdHpZ u2LbtCyqw3eQ96r+GQfGny8zcPr+XUWq08Il9iFkDuOZ4MDhv69bFCc6Hlk7axb+C6Jz4W yntWnLbLGjaqARc8NFOcX17eMjojO51BBORJgJArzJi1peJVG5AKBRpdwYPeiw== 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=1711464124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLqAbqtmqzserPWd0MXh7a3D/mBObFJ8FqA3kr+PtlE=; b=gv5xTLaFEBKbKbLg/EhbKTITDzujfgoshEFNneTWls1+a4CtU30vU6JTOoTRVjoF/y5Lpp Y0X8u57PVaCPmmXJwHYGaxsM3iAbmZ/eTSjQEC31CW1NgubrUo91vQvAyhk0u5ijsgkmO5 mJy5X/uOU8W3D1IZvTFgveSrPt3eCweweK+icnhTzglaFqsUVQoe+V0Q8yYPJ3xEWFbsHH 3HqixSRMUh/I93RwvQeZnA7feEKsYYhE9b06ST95DMR3ihPkowccTxv69su8BXBz3RQZiV 0IxnKS1wMudoDMgUz90TlcLNO0QuuD+ZruJimoy/6SyV2dLhd1t/3RChZECJQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3svc4VzWz13mf; Tue, 26 Mar 2024 14:42: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 42QEg4uM098402; Tue, 26 Mar 2024 14:42:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42QEg45k098399; Tue, 26 Mar 2024 14:42:04 GMT (envelope-from git) Date: Tue, 26 Mar 2024 14:42:04 GMT Message-Id: <202403261442.42QEg45k098399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 04b90ac0f9e8 - main - epoch(9): Remove the under-development note List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 04b90ac0f9e883a485bad4b0edf516395596d17f Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=04b90ac0f9e883a485bad4b0edf516395596d17f commit 04b90ac0f9e883a485bad4b0edf516395596d17f Author: Ka Ho Ng AuthorDate: 2024-03-26 14:38:41 +0000 Commit: Ka Ho Ng CommitDate: 2024-03-26 14:38:41 +0000 epoch(9): Remove the under-development note There has not been planned changes so far to the interface. Remove the section as it may not be relevant anymore. Sponsored by: Juniper Networks, Inc. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D44501 --- share/man/man9/epoch.9 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/man/man9/epoch.9 b/share/man/man9/epoch.9 index 90c8e25da3ff..826f887212e1 100644 --- a/share/man/man9/epoch.9 +++ b/share/man/man9/epoch.9 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd April 30, 2020 +.Dd March 25, 2024 .Dt EPOCH 9 .Os .Sh NAME @@ -260,10 +260,6 @@ and then defers deletion. More general mutation or a synchronous free would have to follow a call to .Fn epoch_wait . -.Sh NOTES -The -.Nm -kernel programming interface is under development and is subject to change. .Sh SEE ALSO .Xr callout 9 , .Xr locking 9 , From nobody Wed Mar 27 04:03:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4ChS40B6z5GNPx; Wed, 27 Mar 2024 04:03: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 4V4ChS3GRNz4nWk; Wed, 27 Mar 2024 04:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711512216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzemscFkfAJc5QN3m8urYp7FebHfhcOkvK4JmuzxlD8=; b=shxPloIcOCBcDh+UWFlK/9fLLhBWwJtiL1plHNW7RGizLZ1J5OLKde6SnC3dPAKknhtcBN 6eVwjy6mfWzACMDtmsqY8WEVJBw0iTshVVcW0kutCNdCCHbPLPJjvBlfa8Ln5bx/0tugxS +9yrTEb5AwowhBmwgJR6WHa1DV3TTW+HTyGJMK2LpNzdtbDZl7AX5s/cKp6zZCSIMuA3QI YnfCN4/Mm+RfOBe//h7108IPpEOI8/KfefCntsot2DgbIye9es4DwXmdLhDewldVPOYxiT mEVhruNU61jBVOQ3TiIbcSVWSO6FMKdLlWYwbC+nfFIXuQ+i6b0YtysNLVtrJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711512216; a=rsa-sha256; cv=none; b=t1iZwc/koM/7IZSqsowZwaiwlHiLpUE7ZEFDwftgDq3a+MGoQUBVuASz4p5wgr4kd8EJWI r6GTyfj74UlX77W+M2+Yms0TF9bQtbzw3jLsqGt/KljPMBG3GExFwPLTbOtaNUnNTRj4uM z+vSgAuH7+7WD0tina/L2JT2oCC/yUZxTtycVWWgZ/5fZIAY5cFWozYkwvbTL4v/teOM/6 qa1Wdr0MhY37+mFVO+1rJ7tRvE18gyDcWlh+f6uAcCUNbEBfM77jmDV9frLtb1dB/s1Ycj 5tOclKHTRJJXjp5K0VVpaQ6VFBrz2mBpcRjyco9MpHl40SP1OBBvsFsqQ0QZ4w== 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=1711512216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzemscFkfAJc5QN3m8urYp7FebHfhcOkvK4JmuzxlD8=; b=w+ul4c7LHTCWIS6P9evzulaHEdgnmUVfZJr/nBDHlQfV6r8V/s+ub+BQ68wqt8PTXVXsL+ XmZ98dGLcHTLM/xzTNeHEC1zDzapVyF8kV2BP5Z5DVBXr1unlqgXME2eBGtNMdl4xKag8+ +2gml0JedrVPVl4rW+d0ZLArZoNAeLZieZzW3UHAKPU/KFuP+3scb6bbNEEVHKuY5LNLjH UYnn4zrVNXC+Cqanm/yNs92wTQ6x0J43F4iSSHI6mZvZ/hUUkrz6cjOZXor5nuHErDnXMj 773epZzr0KDRT5d3E4JTujcXFT5oHB3UCYzssrqfK+PTjAyJWofmH1E7v7ljog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4ChS2qlSzSj5; Wed, 27 Mar 2024 04:03: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 42R43ajD055499; Wed, 27 Mar 2024 04:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42R43aeB055496; Wed, 27 Mar 2024 04:03:36 GMT (envelope-from git) Date: Wed, 27 Mar 2024 04:03:36 GMT Message-Id: <202403270403.42R43aeB055496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 1c7307cf6763 - main - kern linker: Make linker_file_add_dependency() void List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c7307cf6763a295ea9896be9f197d40511c77ed Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7307cf6763a295ea9896be9f197d40511c77ed commit 1c7307cf6763a295ea9896be9f197d40511c77ed Author: Zhenlei Huang AuthorDate: 2024-03-27 04:02:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-03-27 04:02:32 +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 --- 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 9d3cb9b7bd63..54b7466124db 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); @@ -836,7 +836,7 @@ linker_ctf_lookup_sym_ddb(const char *symname, c_linker_sym_t *sym, return (ENOENT); } -static int +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep) { linker_file_t *newdeps; @@ -849,7 +849,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); } /* @@ -1780,10 +1779,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); @@ -1805,10 +1801,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); } } /* @@ -2286,11 +2279,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); @@ -2319,9 +2309,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) @@ -2362,9 +2350,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 Mar 27 08:10:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4K8m6qPjz5GhML; Wed, 27 Mar 2024 08:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4K8m5sRxz4C8l; Wed, 27 Mar 2024 08:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711527000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UcBASEH2nYG4oMoyraC4A4JIuNFb+W+vXjLZ3mpUmEk=; b=Ac1g6SIWHpDCs063WzeFQv1pHpCJPKwRb+PMXm56s4wAQqAQ+0+y/kS9ia1axadhD5joiI /iFW9GTTSRDdDpY0gyvApWU1g/+X3xllRRXsNqryNLhY3pvplNe491fsmqhQF2Q3ESRLtw nH5x/FjNaVXRmArv3wCz1p04unn0F8kBm6YODNTDRGED9sWAF7Zrp0kiewJsEq9QTZuhTu CIzXicrmaXvRfh0kIhlP6o6iAHWHglgVIJV/KW1kspabEWdZIY6Qz5rcLz2D2Ypl3XZHSY GkS+WTY+MosfJh/54iqpq3N3azCneQ+C+6Nt73vSJunWUNIUO5+wXmHjTZ2pTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711527000; a=rsa-sha256; cv=none; b=mho81PCnVLDc5hkcCVa/m78GQeYUkLwKmkg1SugHDTIJI1WWS4ZWBt7PLkV3HPIVPMiscr dgSHSgJrvzK26BoDm/ErMFStAGAom2FuR7qwl5fVIJtrM0dYu3ykeuySPCq8QyScyk29ka SXEQvWMwv+XwCjButRFre3aEoo2X8S3+ZrrOxES7+2uw+4Cm/8YSQ4bZMVueEzNgcb8Ynh Momg2P/A3w0GVqJTjDcVqZrTKgqbmI3AiTIqoXykidLwntZ5W7mVUd+hgsobOg1Tp0KJKx 12e+1jhTwZqrmIRovBXnjUb5m8ZtvFmdihJlhgVu7FJdy6xlN62BbhhXPatHxA== 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=1711527000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UcBASEH2nYG4oMoyraC4A4JIuNFb+W+vXjLZ3mpUmEk=; b=JTeltyAVCLAmQYKqtRDk2X3O6r3HC/uS9E/xTm8lJpgV7Mh5qeMNx1JVg1SiYJzEp0f60T AL8d9qOPhfhM3sfQ+iJl7cgDNLd0f/EfGe5D5F/jjnt2RAkoP77kAN07f35Eptm0h4cLkq bNnqW51qTT/sqzYxWlw7f+Brss3wpOsJbMGClSR2I0syPdHx6b97wCrspfPI6yoV0NkMsO 3nqWL+vLKwGJVg1lRTbqz8LFNLW34VNkKy78Ht6hg/uLovbPl47cNt2qZtUaqb66pdvP72 oJ5OBKpKmJglIDKKcuwe2LQUJabRQe1lOffgQtmbHObFZTvQJOPql9cqufCRQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4K8m5Snkzb51; Wed, 27 Mar 2024 08:10: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 42R8A01q064403; Wed, 27 Mar 2024 08:10:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42R8A0Ks064384; Wed, 27 Mar 2024 08:10:00 GMT (envelope-from git) Date: Wed, 27 Mar 2024 08:10:00 GMT Message-Id: <202403270810.42R8A0Ks064384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d72a37b53538 - main - pkgbase: remove post-install script for kernel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d72a37b535386fa4551288e9b39ff45b82d6a035 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d72a37b535386fa4551288e9b39ff45b82d6a035 commit d72a37b535386fa4551288e9b39ff45b82d6a035 Author: Baptiste Daroussin AuthorDate: 2024-03-27 08:06:35 +0000 Commit: Baptiste Daroussin CommitDate: 2024-03-27 08:08:39 +0000 pkgbase: remove post-install script for kernel the hint file is now directly packages within the package itself. Reported by: jhb --- release/packages/kernel.ucl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/release/packages/kernel.ucl b/release/packages/kernel.ucl deleted file mode 100644 index 28a360f986a9..000000000000 --- a/release/packages/kernel.ucl +++ /dev/null @@ -1,5 +0,0 @@ -scripts: { - post-install = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 5fbe8912d6a2 - main - libdiff: Improve function prototype detection. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fbe8912d6a2d1178468d1994c301d4c7cd4f975 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5fbe8912d6a2d1178468d1994c301d4c7cd4f975 commit 5fbe8912d6a2d1178468d1994c301d4c7cd4f975 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:29 +0000 libdiff: Improve function prototype detection. - Recognize ObjC methods. - Start searching within the leading context. Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D44301 --- contrib/libdiff/lib/diff_internal.h | 2 +- contrib/libdiff/lib/diff_output.c | 9 +++++---- contrib/libdiff/lib/diff_output_unidiff.c | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/contrib/libdiff/lib/diff_internal.h b/contrib/libdiff/lib/diff_internal.h index 46bbadf3cb64..16ee6776a71f 100644 --- a/contrib/libdiff/lib/diff_internal.h +++ b/contrib/libdiff/lib/diff_internal.h @@ -148,7 +148,7 @@ int diff_output_trailing_newline_msg(struct diff_output_info *outinfo, int diff_output_match_function_prototype(char *prototype, size_t prototype_size, int *last_prototype_idx, const struct diff_result *result, - const struct diff_chunk_context *cc); + int chunk_start_line); struct diff_output_info *diff_output_info_alloc(void); diff --git a/contrib/libdiff/lib/diff_output.c b/contrib/libdiff/lib/diff_output.c index 7ac63bb6c433..78d9b8942077 100644 --- a/contrib/libdiff/lib/diff_output.c +++ b/contrib/libdiff/lib/diff_output.c @@ -255,7 +255,8 @@ diff_output_trailing_newline_msg(struct diff_output_info *outinfo, FILE *dest, static bool is_function_prototype(unsigned char ch) { - return (isalpha((unsigned char)ch) || ch == '_' || ch == '$'); + return (isalpha((unsigned char)ch) || ch == '_' || ch == '$' || + ch == '-' || ch == '+'); } #define begins_with(s, pre) (strncmp(s, pre, sizeof(pre)-1) == 0) @@ -263,7 +264,7 @@ is_function_prototype(unsigned char ch) int diff_output_match_function_prototype(char *prototype, size_t prototype_size, int *last_prototype_idx, const struct diff_result *result, - const struct diff_chunk_context *cc) + int chunk_start_line) { struct diff_atom *start_atom, *atom; const struct diff_data *data; @@ -271,9 +272,9 @@ diff_output_match_function_prototype(char *prototype, size_t prototype_size, const char *state = NULL; int rc, i, ch; - if (result->left->atoms.len > 0 && cc->left.start > 0) { + if (result->left->atoms.len > 0 && chunk_start_line > 0) { data = result->left; - start_atom = &data->atoms.head[cc->left.start - 1]; + start_atom = &data->atoms.head[chunk_start_line - 1]; } else return DIFF_RC_OK; diff --git a/contrib/libdiff/lib/diff_output_unidiff.c b/contrib/libdiff/lib/diff_output_unidiff.c index d480a022a9a7..88c98c663c00 100644 --- a/contrib/libdiff/lib/diff_output_unidiff.c +++ b/contrib/libdiff/lib/diff_output_unidiff.c @@ -301,10 +301,21 @@ output_unidiff_chunk(struct diff_output_info *outinfo, FILE *dest, else right_start = cc->right.start + 1; + /* Got the absolute line numbers where to start printing, and the index + * of the interesting (non-context) chunk. + * To print context lines above the interesting chunk, nipping on the + * previous chunk index may be necessary. + * It is guaranteed to be only context lines where left == right, so it + * suffices to look on the left. */ + const struct diff_chunk *first_chunk; + int chunk_start_line; + first_chunk = &result->chunks.head[cc->chunk.start]; + chunk_start_line = diff_atom_root_idx(result->left, + first_chunk->left_start); if (show_function_prototypes) { rc = diff_output_match_function_prototype(state->prototype, sizeof(state->prototype), &state->last_prototype_idx, - result, cc); + result, chunk_start_line); if (rc) return rc; } @@ -344,17 +355,6 @@ output_unidiff_chunk(struct diff_output_info *outinfo, FILE *dest, *typep = DIFF_LINE_HUNK; } - /* Got the absolute line numbers where to start printing, and the index - * of the interesting (non-context) chunk. - * To print context lines above the interesting chunk, nipping on the - * previous chunk index may be necessary. - * It is guaranteed to be only context lines where left == right, so it - * suffices to look on the left. */ - const struct diff_chunk *first_chunk; - int chunk_start_line; - first_chunk = &result->chunks.head[cc->chunk.start]; - chunk_start_line = diff_atom_root_idx(result->left, - first_chunk->left_start); if (cc->left.start < chunk_start_line) { rc = diff_output_lines(outinfo, dest, " ", &result->left->atoms.head[cc->left.start], From nobody Wed Mar 27 11:26:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWF0Pjmz5FHn9; Wed, 27 Mar 2024 11:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4PWD5ZZTz4bhZ; Wed, 27 Mar 2024 11:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iTxANtAQQgS+dT1++xK1dTb9Adzy4JXDc8lILvvs8EQ=; b=mE7iqbRmVtDHPbuN38yIdG3hCP5bAJsKUa3Vs0s12LoZm9wT3twYqVchtKW4APZCeMkofF hX10qxheH+m1JyN+8yD5ldaN1rP+UOuIBWARwkB2OzGXhJ1zvzma/UKEqR50kv4/CdVx0E Rv4VIQ8yq2csJ9C1FM0K4vJKDJQ8WBXafD7nEA7pi3e6Lz0I3EzOMqmkQ3ihYNbOMyN4Ec Whk1PFamG7YsFbdocP7A8cnzag+lwBFzXBmuh5ivyQbij011FniAJcgVWBA3bhG7DuMjsk H++ftjIZTORdAngGrwUwDPBmv4DBwRRoOGMX6irLz9qTmFgnU/zYp6mmDT+Q6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538776; a=rsa-sha256; cv=none; b=U1GK0PXwh5o4TMmF7p1eJ03huovfaJyQcWYhnYnB4X7Hj+X4DsMXSyDto+X6MSxTs/IhTe MQJHkq2eCc6BB+Dh7k6g3ueRVmJE4Bky/qUTaBL8Ko++c39QcjB2Yr8aEe0zD8UPYN7/r4 Nh1JGNnBuL66HbjziwUMWI41VLJOJeXwp/L/LfhJE8XaJZgriu7hw0XdoZ+zttgIl/9iTd f0luUpyo2R5lly8c1LqMzRLjWkxObYzJR8Wo+2+KlMvs/DgKdVgtCPTF2XdI2xJbNb6fvQ wHxqEZnm/4KujZNoWew8ERVK8oZK8ZSWC4cfoV7qLhaweREMnR/nATak5A61hQ== 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=1711538776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iTxANtAQQgS+dT1++xK1dTb9Adzy4JXDc8lILvvs8EQ=; b=gnQ6G2r80m8cwEmu/371BoaSs3G76Dn8iIDwwmBQUytL+I8tcHknBVEWvP5YnGflb5KZe0 NvEUYABC2KuV+jT0mrief8E1Z0hwjAy+WBl2cgTRuZwAUVDCt51nrsWJ8dH+uXTMD/yQ+w Z0BftMquVj0RSDM2iwcG5o+pFXg8eHM0vqjINr+3caYnKAFj2pe1qsH7Az6X9zMpK19wc+ P15yzVdoLMLJjyN2oEEG3zdweSq3sIDsfEgGxfKVbOvb+MMLPOFTR0X2bknoxu61lYYvov S86smLZf+qtVo+ttVeqDBhEkmTlKA4dipLuItYJAnynUadC6XqUzrETwTune9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWD589DzhpB; Wed, 27 Mar 2024 11:26: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 42RBQGlF003688; Wed, 27 Mar 2024 11:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQGoX003685; Wed, 27 Mar 2024 11:26:16 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:16 GMT Message-Id: <202403271126.42RBQGoX003685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d9a9f23d0b3f - main - diff: Integrate libdiff from OpenBSD GoT. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9a9f23d0b3f1676d5656b76301341c0037d15b7 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d9a9f23d0b3f1676d5656b76301341c0037d15b7 commit d9a9f23d0b3f1676d5656b76301341c0037d15b7 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:33 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:33 +0000 diff: Integrate libdiff from OpenBSD GoT. This adds support for two new diff algorithms, Myers diff and Patience diff. These algorithms perform a different form of search compared to the classic Stone algorithm and support escapes when worst case scenarios are encountered. Add the -A flag to allow selection of the algorithm, but default to using the new Myers diff implementation. The libdiff implementation currently only supports a subset of input and output options supported by diff. When these options are used, but the algorithm is not selected, automatically fallback to the classic Stone algorithm until support for these modes can be added. Based on work originally done by thj@ with contributions from kevans@. Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D44302 --- lib/Makefile | 1 + lib/libdiff/Makefile | 15 ++ share/mk/src.libnames.mk | 4 + usr.bin/diff/Makefile | 7 +- usr.bin/diff/diff.1 | 56 ++++++- usr.bin/diff/diff.c | 50 ++++++- usr.bin/diff/diff.h | 18 ++- usr.bin/diff/diffdir.c | 1 - usr.bin/diff/diffreg.c | 41 ++++- usr.bin/diff/diffreg_new.c | 325 ++++++++++++++++++++++++++++++++++++++++ usr.bin/diff/pr.c | 1 - usr.bin/diff/tests/diff_test.sh | 4 + usr.bin/diff/xmalloc.c | 1 - 13 files changed, 502 insertions(+), 22 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index a632a77e6071..a3c4dd966040 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -16,6 +16,7 @@ SUBDIR_BOOTSTRAP= \ libc++ \ libc++experimental \ libcxxrt \ + libdiff \ libelf \ libssp \ libssp_nonshared \ diff --git a/lib/libdiff/Makefile b/lib/libdiff/Makefile new file mode 100644 index 000000000000..3fa8e6b05d2d --- /dev/null +++ b/lib/libdiff/Makefile @@ -0,0 +1,15 @@ +LIB= diff +INTERNALLIB= # API not published or supported. + +.PATH: ${SRCTOP}/contrib/libdiff/compat +.PATH: ${SRCTOP}/contrib/libdiff/lib + +SRCS= diff_atomize_text.c diff_main.c diff_myers.c \ + diff_patience.c diff_output.c diff_output_plain.c \ + diff_output_unidiff.c diff_output_edscript.c recallocarray.c + +WARNS= +CFLAGS+= -I${SRCTOP}/contrib/libdiff/compat/include +CFLAGS+= -I${SRCTOP}/contrib/libdiff/include + +.include diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index d9fe88146dbe..a12c3755ea72 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -43,6 +43,7 @@ _INTERNALLIBS= \ bsnmptools \ c_nossp_pic \ cron \ + diff \ elftc \ fdt \ fifolog \ @@ -544,6 +545,9 @@ LDADD+= ${LDADD_${_l}} _LIB_OBJTOP?= ${OBJTOP} # INTERNALLIB definitions. +LIBDIFFDIR= ${_LIB_OBJTOP}/lib/libdiff +LIBDIFF?= ${LIBDIFFDIR}/libdiff${PIE_SUFFIX}.a + LIBELFTCDIR= ${_LIB_OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a diff --git a/usr.bin/diff/Makefile b/usr.bin/diff/Makefile index 198e107ec1c4..20eaaf8e1dff 100644 --- a/usr.bin/diff/Makefile +++ b/usr.bin/diff/Makefile @@ -1,9 +1,10 @@ - .include PROG= diff -SRCS= diff.c diffdir.c diffreg.c xmalloc.c pr.c -LIBADD= m +SRCS= diff.c diffdir.c diffreg.c xmalloc.c pr.c diffreg_new.c + +LIBADD= m diff +CFLAGS+= -I${.CURDIR} -I${SRCTOP}/contrib/libdiff/lib -I${SRCTOP}/contrib/libdiff/include HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index 1df2d5f8081f..9bc46d07b58a 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 26, 2024 +.Dd March 7, 2024 .Dt DIFF 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Fl c | e | f | .Fl n | q | u | y .Oc +.Op Fl A Ar algo | Fl -algorithm Ar algo .Op Fl -brief .Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT @@ -67,6 +68,7 @@ .Ar file1 file2 .Nm diff .Op Fl aBbdilpTtw +.Op Fl A Ar algo | Fl -algorithm Ar algo .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl F Ar pattern | Fl -show-function-line Ar pattern .Op Fl L Ar label | Fl -label Ar label @@ -95,6 +97,7 @@ .Ar file1 file2 .Nm diff .Op Fl aBbdiltw +.Op Fl A Ar algo | Fl -algorithm Ar algo .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl -brief .Op Fl -color Ns = Ns Ar when @@ -121,6 +124,7 @@ .Ar file1 file2 .Nm diff .Op Fl aBbdilpTtw +.Op Fl A Ar algo | Fl -algorithm Ar algo .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl F Ar pattern | Fl -show-function-line Ar pattern .Op Fl L Ar label | Fl -label Ar label @@ -153,6 +157,7 @@ .Fl c | e | f | .Fl n | q | u .Oc +.Op Fl A Ar algo | Fl -algorithm Ar algo .Op Fl -brief .Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT @@ -276,6 +281,18 @@ from their state in .Ar dir1 to their state in .Ar dir2 . +Note that when comparing directories with +.Fl e , +the resulting file may no longer be interpreted as an +.Xr ed 1 +script. +Output is added to indicate which file each set of +.Xr ed 1 +commands applies to. +These hunks can be manually extracted to produce an +.Xr ed 1 +script, which can also be applied with +.Xr patch 1 . .It Fl f -forward-ed Identical output to that of the .Fl e @@ -331,6 +348,38 @@ Files differ and only the second file contains the line. .Pp Comparison options: .Bl -tag -width Ds +.It Fl A Ar algo, Fl -algorithm Ar algo +Configure the algorithm used when comparing files. +.Nm +supports 3 algorithms: +.Pp +.Bl -tag -width Ds -compact +.It Cm myers +The Myers diff algorithm finds the shortest edit which transforms one +input into the other. +It generally runs in O(N+D\(S2) time, requiring O(N) space, where N is +the sum of the lengths of the inputs and D is the length of the +difference between them, with a theoretical O(N\(pcD) worst case. +If it encounters worst-case input, the implementation used by +.Nm +falls back to a less optimal but faster algorithm. +.It Cm patience +The Patience variant of the Myers algorithm attempts to create more +aesthetically pleasing diff output by logically grouping lines. +.It Cm stone +The Stone algorithm (commonly known as Hunt-McIlroy or Hunt-Szymanski) +looks for the longest common subsequence between compared files. +Stone encounters worst case performance when there are long common +subsequences. +In large files this can lead to a significant performance impact. +The Stone algorithm is maintained for compatibility. +.El +.Pp +The +.Nm +utility defaults to the Myers algorithm, but will fall back to the +Stone algorithm if the input or output options are not supported by +the Myers implementation. .It Fl a -text Treat all files as ASCII text. Normally @@ -741,7 +790,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl aDdIiLlNnPpqSsTtwXxy +.Op Fl AaDdIiLlNnPpqSsTtwXxy are extensions to that specification. .Sh HISTORY A @@ -759,3 +808,6 @@ This was replaced in by a BSD-licensed implementation written by .An Todd Miller . Some GNUisms were lost in the process. +.Pp +libdiff was imported from the Game of Trees version control system and default +algorithm was changed to Myers for FreeBSD 15. diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index d947c1e01705..15ebbca28bd7 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -20,7 +20,6 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#include #include #include @@ -36,11 +35,12 @@ #include "diff.h" #include "xmalloc.h" -static const char diff_version[] = "FreeBSD diff 20220309"; +static const char diff_version[] = "FreeBSD diff 20240307"; bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; bool ignore_file_case, suppress_common, color, noderef; static bool help = false; -int diff_format, diff_context, status; +int diff_format, diff_context, diff_algorithm, status; +bool diff_algorithm_set; int tabsize = 8, width = 130; static int colorflag = COLORFLAG_NEVER; char *start, *ifdefname, *diffargs, *label[2]; @@ -51,7 +51,17 @@ struct stat stb1, stb2; struct excludes *excludes_list; regex_t ignore_re, most_recent_re; -#define OPTIONS "0123456789aBbC:cdD:efF:HhI:iL:lnNPpqrS:sTtU:uwW:X:x:y" +static struct algorithm { + const char *name; + int id; +} algorithms[] = { + {"stone", D_DIFFSTONE}, + {"myers", D_DIFFMYERS}, + {"patience", D_DIFFPATIENCE}, + {NULL, D_DIFFNONE} +}; + +#define OPTIONS "0123456789A:aBbC:cdD:efF:HhI:iL:lnNPpqrS:sTtU:uwW:X:x:y" enum { OPT_TSIZE = CHAR_MAX + 1, OPT_STRIPCR, @@ -68,6 +78,7 @@ enum { }; static struct option longopts[] = { + { "algorithm", required_argument, 0, 'A' }, { "text", no_argument, 0, 'a' }, { "ignore-space-change", no_argument, 0, 'b' }, { "context", optional_argument, 0, 'C' }, @@ -139,6 +150,8 @@ main(int argc, char **argv) newarg = 1; diff_context = 3; diff_format = D_UNSET; + diff_algorithm = D_DIFFMYERS; + diff_algorithm_set = false; #define FORMAT_MISMATCHED(type) \ (diff_format != D_UNSET && diff_format != (type)) while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) { @@ -153,6 +166,21 @@ main(int argc, char **argv) usage(); diff_context = (diff_context * 10) + (ch - '0'); break; + case 'A': + diff_algorithm = D_DIFFNONE; + for (struct algorithm *a = algorithms; a->name;a++) { + if(strcasecmp(optarg, a->name) == 0) { + diff_algorithm = a->id; + diff_algorithm_set = true; + break; + } + } + + if (diff_algorithm == D_DIFFNONE) { + printf("unknown algorithm: %s\n", optarg); + usage(); + } + break; case 'a': dflags |= D_FORCEASCII; break; @@ -276,8 +304,10 @@ main(int argc, char **argv) break; case 'W': width = (int) strtonum(optarg, 1, INT_MAX, &errstr); - if (errstr) - errx(1, "width is %s: %s", errstr, optarg); + if (errstr) { + warnx("Invalid argument for width"); + usage(); + } break; case 'X': read_excludes_file(optarg); @@ -315,8 +345,10 @@ main(int argc, char **argv) break; case OPT_TSIZE: tabsize = (int) strtonum(optarg, 1, INT_MAX, &errstr); - if (errstr) - errx(1, "tabsize is %s: %s", errstr, optarg); + if (errstr) { + warnx("Invalid argument for tabsize"); + usage(); + } break; case OPT_STRIPCR: dflags |= D_STRIPCR; @@ -437,6 +469,8 @@ main(int argc, char **argv) print_status(diffreg(argv[0], argv[1], dflags, 1), argv[0], argv[1], ""); } + if (fflush(stdout) != 0) + err(2, "stdout"); exit(status); } diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 214ff77a362f..679b95e7ca94 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -51,6 +51,14 @@ #define D_UNSET -2 +/* + * Algorithms + */ + +#define D_DIFFNONE 0 +#define D_DIFFSTONE 1 /* Stone or 'old diff' algorithm */ +#define D_DIFFMYERS 2 /* Myers diff algorithm */ +#define D_DIFFPATIENCE 3 /* Patience diff algorithm */ /* * Output flags @@ -73,6 +81,9 @@ #define D_SKIPBLANKLINES 0x800 /* Skip blank lines */ #define D_MATCHLAST 0x1000 /* Display last line matching provided regex */ +/* Features supported by new algorithms */ +#define D_NEWALGO_FLAGS (D_FORCEASCII | D_PROTOTYPE | D_IGNOREBLANKS) + /* * Status values for print_status() and diffreg() return values */ @@ -98,8 +109,9 @@ struct excludes { }; extern bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; -extern bool ignore_file_case, suppress_common, color, noderef; -extern int diff_format, diff_context, status; +extern bool ignore_file_case, suppress_common, color, noderef, algorithm_set; +extern int diff_format, diff_context, diff_algorithm, status; +extern bool diff_algorithm_set; extern int tabsize, width; extern char *start, *ifdefname, *diffargs, *label[2]; extern char *ignore_pats, *most_recent_pat; @@ -110,5 +122,7 @@ extern struct excludes *excludes_list; extern regex_t ignore_re, most_recent_re; int diffreg(char *, char *, int, int); +int diffreg_new(char *, char *, int, int); +bool can_libdiff(int); void diffdir(char *, char *, int); void print_status(int, char *, char *, const char *); diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c index 798229e990df..539f537a08c3 100644 --- a/usr.bin/diff/diffdir.c +++ b/usr.bin/diff/diffdir.c @@ -20,7 +20,6 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#include #include #include diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index c67f3105290f..06d914215b11 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -166,6 +167,7 @@ struct context_vec { enum readhash { RH_BINARY, RH_OK, RH_EOF }; +static int diffreg_stone(char *, char *, int, int); static FILE *opentemp(const char *); static void output(char *, FILE *, char *, FILE *, int); static void check(FILE *, FILE *, int); @@ -205,7 +207,7 @@ static int len[2]; static int pref, suff; /* length of prefix and suffix */ static int slen[2]; static int anychange; -static int hw, lpad, rpad; /* half width and padding */ +static int hw, lpad,rpad; /* half width and padding */ static int edoffset; static long *ixnew; /* will be overlaid on file[1] */ static long *ixold; /* will be overlaid on klist */ @@ -222,6 +224,32 @@ static char lastbuf[FUNCTION_CONTEXT_SIZE]; static int lastline; static int lastmatchline; +int +diffreg(char *file1, char *file2, int flags, int capsicum) +{ + /* + * If we have set the algorithm with -A or --algorithm use that if we + * can and if not print an error. + */ + if (diff_algorithm_set) { + if (diff_algorithm == D_DIFFMYERS || + diff_algorithm == D_DIFFPATIENCE) { + if (can_libdiff(flags)) + return diffreg_new(file1, file2, flags, capsicum); + else + errx(2, "cannot use Myers algorithm with selected options"); + } else { + /* Fallback to using stone. */ + return diffreg_stone(file1, file2, flags, capsicum); + } + } else { + if (can_libdiff(flags)) + return diffreg_new(file1, file2, flags, capsicum); + else + return diffreg_stone(file1, file2, flags, capsicum); + } +} + static int clow2low(int c) { @@ -237,7 +265,7 @@ cup2low(int c) } int -diffreg(char *file1, char *file2, int flags, int capsicum) +diffreg_stone(char *file1, char *file2, int flags, int capsicum) { FILE *f1, *f2; int i, rval; @@ -726,10 +754,10 @@ check(FILE *f1, FILE *f2, int flags) * in one file for -b or -w. */ if (flags & (D_FOLDBLANKS | D_IGNOREBLANKS)) { - if (c == EOF && d == '\n') { + if (c == EOF && isspace(d)) { ctnew++; break; - } else if (c == '\n' && d == EOF) { + } else if (isspace(c) && d == EOF) { ctold++; break; } @@ -1219,6 +1247,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) edoffset = 0; nc = 0; + col = 0; /* * When doing #ifdef's, copy down to current line * if this is the first file, so that stuff makes it to output. @@ -1284,6 +1313,10 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) printf("\n\\ No newline at end of file\n"); return (col); } + /* + * when using --side-by-side, col needs to be increased + * in any case to keep the columns aligned + */ if (c == '\t') { /* * Calculate where the tab would bring us. diff --git a/usr.bin/diff/diffreg_new.c b/usr.bin/diff/diffreg_new.c new file mode 100644 index 000000000000..39b359422f39 --- /dev/null +++ b/usr.bin/diff/diffreg_new.c @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2018 Martin Pieuchot + * Copyright (c) 2020 Neels Hofmeyr + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "diff.h" +#include +#include +#include + +const char *format_label(const char *, struct stat *); + +enum diffreg_algo { + DIFFREG_ALGO_MYERS_THEN_MYERS_DIVIDE = 0, + DIFFREG_ALGO_MYERS_THEN_PATIENCE = 1, + DIFFREG_ALGO_PATIENCE = 2, + DIFFREG_ALGO_NONE = 3, +}; + +int diffreg_new(char *, char *, int, int); +FILE * openfile(const char *, char **, struct stat *); + +static const struct diff_algo_config myers_then_patience; +static const struct diff_algo_config myers_then_myers_divide; +static const struct diff_algo_config patience; +static const struct diff_algo_config myers_divide; + +static const struct diff_algo_config myers_then_patience = (struct diff_algo_config){ + .impl = diff_algo_myers, + .permitted_state_size = 1024 * 1024 * sizeof(int), + .fallback_algo = &patience, +}; + +static const struct diff_algo_config myers_then_myers_divide = + (struct diff_algo_config){ + .impl = diff_algo_myers, + .permitted_state_size = 1024 * 1024 * sizeof(int), + .fallback_algo = &myers_divide, +}; + +static const struct diff_algo_config patience = (struct diff_algo_config){ + .impl = diff_algo_patience, + /* After subdivision, do Patience again: */ + .inner_algo = &patience, + /* If subdivision failed, do Myers Divide et Impera: */ + .fallback_algo = &myers_then_myers_divide, +}; + +static const struct diff_algo_config myers_divide = (struct diff_algo_config){ + .impl = diff_algo_myers_divide, + /* When division succeeded, start from the top: */ + .inner_algo = &myers_then_myers_divide, + /* (fallback_algo = NULL implies diff_algo_none). */ +}; + +static const struct diff_algo_config no_algo = (struct diff_algo_config){ + .impl = diff_algo_none, +}; + +/* If the state for a forward-Myers is small enough, use Myers, otherwise first + * do a Myers-divide. */ +static const struct diff_config diff_config_myers_then_myers_divide = { + .atomize_func = diff_atomize_text_by_line, + .algo = &myers_then_myers_divide, +}; + +/* If the state for a forward-Myers is small enough, use Myers, otherwise first + * do a Patience. */ +static const struct diff_config diff_config_myers_then_patience = { + .atomize_func = diff_atomize_text_by_line, + .algo = &myers_then_patience, +}; + +/* Directly force Patience as a first divider of the source file. */ +static const struct diff_config diff_config_patience = { + .atomize_func = diff_atomize_text_by_line, + .algo = &patience, +}; + +/* Directly force Patience as a first divider of the source file. */ +static const struct diff_config diff_config_no_algo = { + .atomize_func = diff_atomize_text_by_line, +}; + +const char * +format_label(const char *oldlabel, struct stat *stb) +{ + const char *time_format = "%Y-%m-%d %H:%M:%S"; + char *newlabel; + char buf[256]; + char end[10]; + struct tm tm, *tm_ptr; + int nsec = stb->st_mtim.tv_nsec; + size_t newlabellen, timelen, endlen; + tm_ptr = localtime_r(&stb->st_mtime, &tm); + + timelen = strftime(buf, 256, time_format, tm_ptr); + endlen = strftime(end, 10, "%z", tm_ptr); + + /* + * The new label is the length of the time, old label, timezone, + * 9 characters for nanoseconds, and 4 characters for a period + * and for formatting. + */ + newlabellen = timelen + strlen(oldlabel) + endlen + 9 + 4; + newlabel = calloc(newlabellen, sizeof(char)); + + snprintf(newlabel, newlabellen ,"%s\t%s.%.9d %s\n", + oldlabel, buf, nsec, end); + + return newlabel; +} + +int +diffreg_new(char *file1, char *file2, int flags, int capsicum) +{ + char *str1, *str2; + FILE *f1, *f2; + struct stat st1, st2; + struct diff_input_info info; + struct diff_data left = {}, right = {}; + struct diff_result *result = NULL; + bool force_text, have_binary; + int rc, atomizer_flags, rflags, diff_flags = 0; + int context_lines = diff_context; + const struct diff_config *cfg; + enum diffreg_algo algo; + cap_rights_t rights_ro; + + algo = DIFFREG_ALGO_MYERS_THEN_MYERS_DIVIDE; + + switch (algo) { + default: + case DIFFREG_ALGO_MYERS_THEN_MYERS_DIVIDE: + cfg = &diff_config_myers_then_myers_divide; + break; + case DIFFREG_ALGO_MYERS_THEN_PATIENCE: + cfg = &diff_config_myers_then_patience; + break; + case DIFFREG_ALGO_PATIENCE: + cfg = &diff_config_patience; + break; + case DIFFREG_ALGO_NONE: + cfg = &diff_config_no_algo; + break; + } + + f1 = openfile(file1, &str1, &st1); + f2 = openfile(file2, &str2, &st2); + + if (capsicum) { + cap_rights_init(&rights_ro, CAP_READ, CAP_FSTAT, CAP_SEEK); + if (caph_rights_limit(fileno(f1), &rights_ro) < 0) + err(2, "unable to limit rights on: %s", file1); + if (caph_rights_limit(fileno(f2), &rights_ro) < 0) + err(2, "unable to limit rights on: %s", file2); + if (fileno(f1) == STDIN_FILENO || fileno(f2) == STDIN_FILENO) { + /* stdin has already been limited */ + if (caph_limit_stderr() == -1) + err(2, "unable to limit stderr"); + if (caph_limit_stdout() == -1) + err(2, "unable to limit stdout"); + } else if (caph_limit_stdio() == -1) + err(2, "unable to limit stdio"); + caph_cache_catpages(); + caph_cache_tzdata(); + if (caph_enter() < 0) + err(2, "unable to enter capability mode"); + } + /* + * If we have been given a label use that for the paths, if not format + * the path with the files modification time. + */ + info.flags = 0; + info.left_path = (label[0] != NULL) ? + label[0] : format_label(file1, &stb1); + info.right_path = (label[1] != NULL) ? + label[1] : format_label(file2, &stb2); + + if (flags & D_FORCEASCII) + diff_flags |= DIFF_FLAG_FORCE_TEXT_DATA; + if (flags & D_IGNOREBLANKS) + diff_flags |= DIFF_FLAG_IGNORE_WHITESPACE; + if (flags & D_PROTOTYPE) + diff_flags |= DIFF_FLAG_SHOW_PROTOTYPES; + + if (diff_atomize_file(&left, cfg, f1, (uint8_t *)str1, st1.st_size, diff_flags)) { + rc = D_ERROR; + goto done; + } + if (diff_atomize_file(&right, cfg, f2, (uint8_t *)str2, st2.st_size, diff_flags)) { + rc = D_ERROR; + goto done; + } + + result = diff_main(cfg, &left, &right); + if (result->rc != DIFF_RC_OK) { + rc = D_ERROR; + status |= 2; + goto done; + } + /* + * If there wasn't an error, but we don't have any printable chunks + * then the files must match. + */ + if (!diff_result_contains_printable_chunks(result)) { + rc = D_SAME; + goto done; + } + + atomizer_flags = (result->left->atomizer_flags | result->right->atomizer_flags); + rflags = (result->left->root->diff_flags | result->right->root->diff_flags); + force_text = (rflags & DIFF_FLAG_FORCE_TEXT_DATA); + have_binary = (atomizer_flags & DIFF_ATOMIZER_FOUND_BINARY_DATA); + + if (have_binary && !force_text) { + rc = D_BINARY; + status |= 1; + goto done; + } + + if (diff_format == D_NORMAL) { + rc = diff_output_plain(NULL, stdout, &info, result, false); + } else if (diff_format == D_EDIT) { + rc = diff_output_edscript(NULL, stdout, &info, result); + } else { + rc = diff_output_unidiff(NULL, stdout, &info, result, + context_lines); + } + if (rc != DIFF_RC_OK) { + rc = D_ERROR; + status |= 2; + } else { + rc = D_DIFFER; + status |= 1; + } +done: + diff_result_free(result); + diff_data_free(&left); + diff_data_free(&right); + if (str1) + munmap(str1, st1.st_size); + if (str2) + munmap(str2, st2.st_size); + fclose(f1); + fclose(f2); + + return rc; +} + +FILE * +openfile(const char *path, char **p, struct stat *st) +{ + FILE *f = NULL; + + if (strcmp(path, "-") == 0) + f = stdin; + else + f = fopen(path, "r"); + + if (f == NULL) + err(2, "%s", path); + + if (fstat(fileno(f), st) == -1) + err(2, "%s", path); + +#ifndef DIFF_NO_MMAP + *p = mmap(NULL, st->st_size, PROT_READ, MAP_PRIVATE, fileno(f), 0); + if (*p == MAP_FAILED) +#endif + *p = NULL; /* fall back on file I/O */ + + return f; +} + +bool +can_libdiff(int flags) +{ + /* We can't use fifos with libdiff yet */ + if (S_ISFIFO(stb1.st_mode) || S_ISFIFO(stb2.st_mode)) + return false; + + /* Is this one of the supported input/output modes for diffreg_new? */ + if ((flags == 0 || !(flags & ~D_NEWALGO_FLAGS)) && + ignore_pats == NULL && ( + diff_format == D_NORMAL || +#if 0 + diff_format == D_EDIT || +#endif + diff_format == D_UNIFIED) && + (diff_algorithm == D_DIFFMYERS || diff_algorithm == D_DIFFPATIENCE)) { + return true; + } + + /* Fallback to using stone. */ + return false; +} diff --git a/usr.bin/diff/pr.c b/usr.bin/diff/pr.c index 5dedf689351c..c3ea280073af 100644 --- a/usr.bin/diff/pr.c +++ b/usr.bin/diff/pr.c @@ -24,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 66596bae8a46..146c23fa303d 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -266,6 +266,10 @@ report_identical_body() { printf "\tA\n" > A printf "\tB\n" > B + atf_check -s exit:0 -o match:"are identical" \ + diff -s A A + atf_check -s exit:1 -o not-match:"are identical" \ + diff -s A B chmod -r B atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \ -o empty diff -s A B diff --git a/usr.bin/diff/xmalloc.c b/usr.bin/diff/xmalloc.c index 69ccae83cfdd..ce0f4545aee8 100644 --- a/usr.bin/diff/xmalloc.c +++ b/usr.bin/diff/xmalloc.c @@ -13,7 +13,6 @@ * called by a name other than "ssh" or "Secure Shell". */ -#include #include #include #include From nobody Wed Mar 27 11:26:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWG1FLhz5FHyb; Wed, 27 Mar 2024 11:26: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 4V4PWF6dBwz4bhj; Wed, 27 Mar 2024 11:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SRFhytp2W4E96c1FWqFp8bAHLlKSnHc1XgF7P9aY8kY=; b=NsMyM2tJSKhvJgNChgzvLNgINrFaGn0YunLvy6VvVcpGila6ByjeycUpGSOThaCAZAs6xq b6crxX3bz+XxGohs99qhixd3jg5x2shg5Z8ebFTser3560A5yebAthyWxysyslFO/vjKo0 kgIGrY1ajNrPTJY9QjWFJ08Bx9ut9H1zpYPQtf5m12NcEfilTLhUFsQvO82rm2DaGRnEI1 aAGT//g8+ITpqdVB8tTS84+4ZXtTzF4YPledN74SiY3KVGp/JqB8ly8ZKGZeKDGbXviciA h9qXJRT2SslYPJCVh2hzkSiqK/dCencLqZXExOJ6NP35FJq6AW6Kx24t6CGkqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538777; a=rsa-sha256; cv=none; b=G7nO80ZnOmSR2xfNHHMCW0TH1yLn6rJUZIM18ubIRIU37rcoAnJbyAhF83uEb/2UMkRPfh FjigBzl66frcTWJxQ/9qZ/xDaH14VuIPdLE8nloKg6BH7u5t4KjM9GpEbpJlNx/bh3NnXu NFpI+p5f2TDTIy2ICOqQr5t9et/V7d3I6iiSXdjrtLexXE3sN5VxX2vAU9Jr92qkxSSuHG rEDPEBNiOm496D2+rPmM6YBUpqqy+e56YP2g+7/HQ2SVpVg0ONtcic/PiM1wNxxY9fL6he 8FfQVqDPgDSQnQXKkNjvK6QqxUtsbH8EeZgvJcXeJeJSo1mrmF1sH3i6Bt7ioQ== 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=1711538777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SRFhytp2W4E96c1FWqFp8bAHLlKSnHc1XgF7P9aY8kY=; b=K08K4nDhPp2IhigUjoANMZs23QHzDLCGh1W7eIcmyJsGjUKtQFyepAWhfgD8s8HAIjuAWt 8AB4mltuYQlPeqS2j7w0265ewrv563Xvmmm2DEWplJu1ocTFtfuumzLwpgdoul+c36u3o8 uLaRe/xNVD8h1cBeyL0yZ20UxBJ1gEnCPvAoHlkPHlveHb62nQ+BHnjUlCryd1eCb9jJX+ DvKpZcKAOvhzu+f5azDotyGPTE3epKvLHH/AtBsWCN9aG3OTkUYZ3LdnhnOsAgADQj5WDE wEr71fooOJ9ZplOwH9/86YuZLetlGP5WgHzZ0y1zitcQXMdLJrmnjX3vt5UvaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWF6DrczhWw; Wed, 27 Mar 2024 11:26: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 42RBQHOB003739; Wed, 27 Mar 2024 11:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQHcA003736; Wed, 27 Mar 2024 11:26:17 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:17 GMT Message-Id: <202403271126.42RBQHcA003736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 7534109d13a6 - main - libc: Improve description of mktime() / timegm(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7534109d13a6cdb22e78d9d4c0a0cd5efd323c45 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7534109d13a6cdb22e78d9d4c0a0cd5efd323c45 commit 7534109d13a6cdb22e78d9d4c0a0cd5efd323c45 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:37 +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 --- 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 698a63cfa73d..96b7f775535a 100644 --- a/lib/libc/stdtime/ctime.3 +++ b/lib/libc/stdtime/ctime.3 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2023 +.Dd March 26, 2024 .Dt CTIME 3 .Os .Sh NAME @@ -241,7 +241,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 Wed Mar 27 11:26:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWH3Nhmz5FHwQ; Wed, 27 Mar 2024 11:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4PWH0JwBz4bkv; Wed, 27 Mar 2024 11:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8vjOsVo6IXjjI4m7rgwR6YDhOu2SkSMs7CTGP/kOhsg=; b=IqlLE/L0TpkR3Xvg7SBJ01+ynf2ZWGnNPxgnSeGAZKbfNOYuv4960zmSOws+/LsmnLqMDs BUEDE4a4W+dIcNYsUxXX9YLh/xA5Adp7MdOtfqZpJ1FzVM8I6Z+HylW0MH6bgZ1pWFfRvy Ueg7Q4BsBgbsdqOCLK+b0cmhvjKyJnP8UIzhLoawwzudMKuiHpetNL35GgNZmJSyvC6gzq rLoNSlEJbNt0m0f96GvQFFHshe1bizY1iNgbtZHGbLcTaiohzNelU8/d8Dy14CzKTZancL Y2P5h3E87RoaolBPETX7HPqBabc4AAKnxgeaPqE7LafbAiAacrCymUkTTS3x4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538779; a=rsa-sha256; cv=none; b=aZj3E0vhLZ22E/LC6c9kJOQRohjehU/ZP394cV8EoRrNBtKMMapUA4MV1Wfkhke9z7FlwK /PCBt3tVFH6Ct+1UDD1pX8xsB6e2LQ8bxD65qXhN5jXDzwAc1UuZp2Ub98IxtbyoEoK4lD 3rvfCLkNQutlxxTcRnL1OV0WEEqgE+bTxskDxaIrVqbU4ch+vNanFayZGpGiuGaz2gD8Q/ XsTBuhx5fUAAY9hw6XM2UOrR5R+AkuV0N9SoQ4nvX5oXQXuZfduEHTqmx9LtZ/rHa6dg0f IDYmwvJ0h+Yo5EA6JqUgTApgi7v/hurew8oGZH/sIl4jYoNize9J738IfflxRA== 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=1711538779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8vjOsVo6IXjjI4m7rgwR6YDhOu2SkSMs7CTGP/kOhsg=; b=ARSQXgvk1MCcOf9BJfIfPsX9cZIKxZ2SLn/rcjhWFKMCx+tB1kk2vMWRewU1HTYs/EFqV9 IXt2AeUTE4WFMm0RWLHKysD3auwNhsSQ8Z4nQZLjZ0OZJPigJdPGnI1gUoU6cNvWe2RGzK brn8Niwa9SEtss4F5c5xOavbmd1MaKyTNHhpZb22v/b6ltL2UAzuYS7+NW0hIKytxgo1Gy L4n4vDATyExZmIwrimuczU0eqSbcGNXqBvWMaL/C2OyUX1CYGzOMUID4jNNvpQDcjqL7pA k1ujtpQHUZtUxdFLpStl1w1JVaFbErxKnUn1dDffzDsDp3Qb0gXOWm4mNl5lig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWG710Pzj2K; Wed, 27 Mar 2024 11:26:18 +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 42RBQIEu003797; Wed, 27 Mar 2024 11:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQI1t003794; Wed, 27 Mar 2024 11:26:18 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:18 GMT Message-Id: <202403271126.42RBQI1t003794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: aa69e0f21263 - main - touch: Allow setting the timestamp to -1. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa69e0f212630bd6d4ec1c3c54e117be16653e8a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=aa69e0f212630bd6d4ec1c3c54e117be16653e8a commit aa69e0f212630bd6d4ec1c3c54e117be16653e8a Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:40 +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 --- usr.bin/touch/touch.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index b43420e4f3ef..70257e320a60 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -232,7 +232,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; @@ -263,15 +263,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 @@ -296,10 +298,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; } @@ -339,13 +342,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 Wed Mar 27 11:26:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWJ244cz5FHkw; Wed, 27 Mar 2024 11:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4PWJ1GRvz4bqb; Wed, 27 Mar 2024 11:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HeyUfO39tS9GFDU8Z/MvlU8fRCGNluAk/iRsPRZGPWQ=; b=W+99MvNGrUZxWQ1LIS8zGRju3OZcCsM/ph49tBSLdn1J2/+xBz3BIl4C7qjoasmjLNPL+t q91muj7yVfuU34jepxq5RSSGDStD2FPPwEetAnLKptAo5pWLAcLMU5dTesSscZ9Gr1HfVA jL3AD8saw8+QxQ4wFkidBzXmQaC7udZPfOKXgpdF5709tTvBKMsDxvYK+Lsg7USr6E93DE AZn0/iaY+rErJDRBHmosMNM8r6GvPdEwJtwbnnel25UShLJPsfNUjq092MDEnqSuNFeutD Avg00kyMcNR6fkpIT7HvXbeaBQYh750VaY3DCNBJC1RSHQkSSJkjbzA70jOQMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538780; a=rsa-sha256; cv=none; b=coAkrbWanfS9bdnvLRrjmLQya90qNZP9wp6h6J909UnzQnVpic/If9DiT9ms7vF37yGst6 oG8UrwL4QJbfIG8vFSm5H+vIrKztfVFxQKW+Isa7vsleEDWkPSVRbXr7DJ/VoYcrVs/BNp BkAACCN7zUxW9A/TLU9PuIGy1D+7YGTmUYhq3rWlxPc/GNUipYiKe/yRAWrbvpPU54wNdR RcFeduei36daFi1bE/8nDeThnon5jpGDQkHN56kCs9WRdBfL/rEKmBENY02fxsPOY8+VVo /iBiCs1zrsuztwW2bjtQ+ODNDbWOR3YY0Vl9GuSJMK7Q9iUOJUCswWwmIfbUvQ== 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=1711538780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HeyUfO39tS9GFDU8Z/MvlU8fRCGNluAk/iRsPRZGPWQ=; b=L6Em7ZcQkFAZDuyqPgWrg52eVjEOJXbGNfvQ6WYLeOb71PHhsbq0gpo+Xh7TzQ7IYXTsf3 xL2NNJTro49oXe9KWiNP2HErDJFCjn6+kj+JviOTAs49Sk9BuTj/dsZETvrbt/+qKk9UUE xTvO90delCSncd51edrm9eiXp1ej1y4bvsk4j+RNwFj2/SMvucroOjkSTK4hRYIXeahBB1 IqO9m9fmLcUd+6J/7J0pFYAxRVi0aNHQtAgabsz861Flg/xU+IL0w1532Cb5qotZTcJOO9 DSGluGSQP/SJR4qSnRsDJ4lLw0QAgwqE/u6Vm0M0VUKcTmvxfA1Fvjao1nXnfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWJ0tcjzj2L; Wed, 27 Mar 2024 11:26: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 42RBQKVl003839; Wed, 27 Mar 2024 11:26:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQKir003836; Wed, 27 Mar 2024 11:26:20 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:20 GMT Message-Id: <202403271126.42RBQKir003836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 74a4aa9b1517 - main - touch: Add unit tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74a4aa9b1517d92bfa85b0b1cd7d4c1262bb1ef9 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=74a4aa9b1517d92bfa85b0b1cd7d4c1262bb1ef9 commit 74a4aa9b1517d92bfa85b0b1cd7d4c1262bb1ef9 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:45 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:45 +0000 touch: Add unit tests. MFC after: 1 week Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D44505 --- etc/mtree/BSD.tests.dist | 2 + usr.bin/touch/Makefile | 3 + usr.bin/touch/tests/Makefile | 4 + usr.bin/touch/tests/touch_test.sh | 157 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 166 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 978b8910a2f4..d0451081022b 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1187,6 +1187,8 @@ .. tftp .. + touch + .. tr .. truncate diff --git a/usr.bin/touch/Makefile b/usr.bin/touch/Makefile index 421c88062c60..2e9253ddac4c 100644 --- a/usr.bin/touch/Makefile +++ b/usr.bin/touch/Makefile @@ -1,4 +1,7 @@ +.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 +} From nobody Wed Mar 27 11:26:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWK4SMmz5FHt3; Wed, 27 Mar 2024 11:26: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 4V4PWK2DD8z4cCW; Wed, 27 Mar 2024 11:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wpRbmCmVd+n62UooATlOfAUjBSurVcXl3/Ch/hYKvQ=; b=ZPOarVPV2QTo0Y9pjBjUUu0cIwL+JPsnr3y3djzSVXq2bXT/YM4qxYjt54CZKIWvm4dfs4 Bd6a3atfwU1jWZLZyAwpVUdjhAI+yweKXuji6cvID7WmrD/sqJzXbcYG9kc9rTCOdVit+l OHvBYiUOgQsrsAzZFvHRdDfttBt89l4uWqqzHfcSEFbDZb0BF8QURu2D4VQ14hEWpBHOI5 g9pp5PqkaVMJmdHoIMjLk+t0Wyj44fKUFAqOFDU3IcEkU1q/VeFNQRhDTUNgqohgkRG3LS NL3HtTxAZ9dvHrnIsSltq1Vkm5jRjHhfqMDMKVDbdBSr/xqSZ1U4BqxjOrUO0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538781; a=rsa-sha256; cv=none; b=XqGR1DEp3M8ljj5vkCZCncvi1WQl9zFVHfCgGvoDflniFT2JKX6DbHT1DomeUBOUdDc8uO U3jkKa8LIc4OVITu9WBzHXyLTyYscGOlGJ2AnA0VdurGCf6AV8B7U50LJ0MKs0EgThy2P/ c/7MhJ1TaT9ZCbYC9KA0Q2VhiWNODWhzXB4lreeYJTTit9p29GeowNs6Dwjl6oAoNQ4bcS dTomLzQbfFhdjrkgi6YPLmyvy7lcZewUkbki4bR0HxmjJHvKZwvULNleMgpXUpY5nmFQxq 3Fm4ZevxxyxAZV1rlrDN4MSbNU8/MUu9SizlUFL1K+Vf9HAywo98We9S41m+9Q== 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=1711538781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wpRbmCmVd+n62UooATlOfAUjBSurVcXl3/Ch/hYKvQ=; b=AQAzFq40cVrMFPSJrFD8Yu0+eSH7VxafWg/6jpYhYPB4s8rCSCgkLyWLVR1Vu8TkUbsECn 7sCxFfGYc5AKKyXSiooeRYOGcKaBHtr6mJJMfsXLq6Es9izpYBcH8ORoAp26KlmUAjrVlq mjMrOzihi2sy1UllcsQM7VaJLStulZ3LHW1uSYhohxU1CmHByfjcdAe6Gitd9ZUIDDreUE qKMWiZmEr4dEr8uC0sdRUPdsklTgPnDCafKVEWuVaWnJdFdqe3rrrkxhbxRPhmcTahs30v JJCbKPPHkXNxznUFkwxDO+rHdxeARjDlBLT80bJQGUshNuH6vrR6SjopUk+L2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWK1qQxzj2M; Wed, 27 Mar 2024 11:26:21 +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 42RBQLtq003888; Wed, 27 Mar 2024 11:26:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQLNh003885; Wed, 27 Mar 2024 11:26:21 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:21 GMT Message-Id: <202403271126.42RBQLNh003885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 437d53daf71a - main - ln: Use stdbool, style nits. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 437d53daf71a357aae960881ef037564736f7441 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=437d53daf71a357aae960881ef037564736f7441 commit 437d53daf71a357aae960881ef037564736f7441 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:49 +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 --- bin/ln/ln.c | 76 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index 2a4597b5fe36..31fe3b35e25e 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -37,24 +37,25 @@ #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[]) @@ -79,41 +80,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: @@ -124,21 +125,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: ; } @@ -157,7 +158,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); } @@ -208,14 +209,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. */ @@ -278,7 +280,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", From nobody Wed Mar 27 11:26:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWL51Lmz5FHyh; Wed, 27 Mar 2024 11:26: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 4V4PWL3Cvgz4c9G; Wed, 27 Mar 2024 11:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hvHn1975vmA3xTjCGsb2gQne6heWQthtLQNjDYCJW90=; b=vAqEriDkLLt6ojVYJKlT7KPcALj7MSYnZJPCGprTwJAxv8uHO+zOfg45M7RWBGr2NDf/of cqp3/W7EFwaKEIlxI41VDQzV000Js5ByHe/nIu7ZWD0Bg2oD8mKJIdai+jbMRn2o5x1Alq vbfIfI9izvgoDmxXdxg/9mc8WPpRz+EhSW3o8Chy9GqM6zxV5LCZD2DwwOC5rtT5TAEcYg LKR/vA2+t0sEt4QtrWp/11sxxzCAiRyexcjEs6E0YYO+MJ++qNstmRvXnJpLaOnUPkwvTA 3ANy+mTp7ej1PZME2IAuyI4ejCyKDkjb+bDcorqkl+CFP0XkV3VVOKrbbHF5zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538782; a=rsa-sha256; cv=none; b=Q5vxoOYNj+q3sp8wADNJ8RO95fnxwYrD0g/VGIDWEjevcmPXmHkRsa3MIv/TBy9A+OJgCE uspV3uHyWB0JHRVvFXS1xhzBTQtaqaHqNoJ4Z3CUEcB4Vw9Ik4z/yWxWjM6TlhWeozH5qu YidsKbBOiwrFmCqMkXGzTq0MF7Xt/GSYUj32G8OQQ72qezP1wbd09Ye4C9YSe8mwbgRMQR Nimn6Bp9JCeDSKaEOU56ZZUvnB5gspsL1eb22fxcq/x4/HKYeSsNIDx0mhnvZJL7dTxssu YKbe66+ThWiGmFFLhncrP8aATStEF3FDtdqcXnr3IPvbIfDtQ9hUJExdjWtytg== 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=1711538782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hvHn1975vmA3xTjCGsb2gQne6heWQthtLQNjDYCJW90=; b=hCF+mYHyvYjQjYXuMzlO1fF/y/D7OlmAgHYs1cyp7vogz4G+3FaRc9CQSBPdWhqOB9/YkA EzYQwsW9o/5+4N1fJfaFqc9q5wuj8cJSSjpr93ZGt6b3/NpBN7BCX/+5J35zHEFjaKV8Sv d9qGQt9Jkyi+mRxTEhZW96gL1we4UgCjnRoVVSwDuhq5dnwOCJXG8fUKnw57Jf2S+RwVXw HLYt7xgOine3m0Qg7fKqG9c+UZJ6LoQf4iwej+dXIjV7U6APAecIN1xThK4SLCmMWbKNKf Kg5W/Omdjz93Q1d1eaPWefqmFv18o7V4RrGA2He6VxsB1E+/vPC0RJENmYu1cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWL2YN9zhSs; Wed, 27 Mar 2024 11:26: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 42RBQM8F003937; Wed, 27 Mar 2024 11:26:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQMWh003934; Wed, 27 Mar 2024 11:26:22 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:22 GMT Message-Id: <202403271126.42RBQMWh003934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e0afcbc85690 - main - ln: Clean up and simplify tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0afcbc85690b6464706ead57103baa0493fdfb2 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e0afcbc85690b6464706ead57103baa0493fdfb2 commit e0afcbc85690b6464706ead57103baa0493fdfb2 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:52 +0000 ln: Clean up and simplify tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44512 --- bin/ln/tests/ln_test.sh | 68 +++++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 48 deletions(-) diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 75fda4ce2dd7..7daf5c5cdec0 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() +{ + atf_check_equal "$(stat -f %d,%i "$1")" "$(stat -f %d,%i "$2")" +} + +atf_check_symlink_to() { - if ! umask 022; then - atf_fail "setting umask failed" - fi + 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,11 @@ 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 s_flag @@ -187,14 +166,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 +179,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 +191,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() From nobody Wed Mar 27 11:26:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWM5CkCz5FHqy; Wed, 27 Mar 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4PWM4FNTz4c5Q; Wed, 27 Mar 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XzEBektYHRWbR+sKsGwJMylMRL2QmXhVXtHVSZK1Ql4=; b=O4IeYj8QRfozEoCBZA8zyQnrFRBxVRImfeNz/jVKTlx+ejRMfpfzFYV3M0YKkhv9kfZ+br 1QGBks+FPHVEpcuj74xCXxcxttMM4bvQ/meEjhcOwruv1SgZHRg2fcc9v1ytL5962/wZcz aPBrrGZ0J90O7Cp9MwKa5o6YaIvdQSaG0J+MZu1oQPbJekKfAZLH1yn9NWT3N9hDjPGk74 0eOjvbKc00MFf27gQ5d9ctOw2F9qnjA37XOQxcubUBtukL+SKOeczEHuqMA6v88aRJbH8W nBNa5JrgDg/fLCF1b3Ex9Nrm9fG+Cq35gNFCfYaHimGZgHJv7rMtu7Gr9e2Bsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538783; a=rsa-sha256; cv=none; b=l6/BlNEi3cK+KjIDMaSxzn054B1ehMP64XOXzfqzQTcp5k5JuTvv0Or/0m45R9byn2GZXn cKrFybSeDwlccsX0+PDXKBjKNGg/jV8Yi2mGh+l1aXMSgzOYepRhuKGZe6g3X097QTZRGI K2xsabkeOt5KXGPMz0DX3WL4mvkqWgx4WFJWUaSAyPQeWtzLPHXF+lGyXB2we7jnhSrrr3 Ai3+KlTGtVaD9IyjFHFq1v0Wx/wrkI03pZ5x4TGlntK9b51+gQdzEDHL+1KrpjUTvrjd6T CfBx7CEb1r7H0fUub8gj5HFV93M11eMqx+qSMpouRN0SmP99s/rtW6LniRV+vQ== 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=1711538783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XzEBektYHRWbR+sKsGwJMylMRL2QmXhVXtHVSZK1Ql4=; b=QVsho2pPL5QDXk6nnGvPq5L7D/BSlFCcbrRqIWKuHqAuR8T+n1OeDaQd7CRxvnFcclE5AW DCJT9ooM3HH1ssZ694XAmOtPhpTrIWjlNflsVcqn43j9QRbyzzT1Ia5h5O/M5IzA07SHrJ tLfdUlL+sue1ZC72YnGTROKJ3G1PkgYuHGyntIG68UBPxnOoqHDz7zwoKKQ04bSwt3aDWA FKjqTHiDAg/E59KgWuatUQhuVw9IqBRlwBvyhZJz1843NcZ5+TeU59pnN0+tbV/7dMn5Vp rlJlMZk4Bo7+oH40yAoC/3fDlTEu3mXcp0OPcAkw+mxRulWJz1Xwt8c21DEx1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWM3sxRzhpC; Wed, 27 Mar 2024 11:26: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 42RBQNwx003993; Wed, 27 Mar 2024 11:26:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQNKG003990; Wed, 27 Mar 2024 11:26:23 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:23 GMT Message-Id: <202403271126.42RBQNKG003990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 2ae8d34666a6 - main - ln: Add a test case for ln -sfF. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9 commit 2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:56 +0000 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 --- bin/ln/tests/ln_test.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 7daf5c5cdec0..8e5dcf81e61f 100644 --- a/bin/ln/tests/ln_test.sh +++ b/bin/ln/tests/ln_test.sh @@ -161,6 +161,22 @@ sf_flag_body() 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 s_flag_head() { @@ -209,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 Wed Mar 27 11:26:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4PWP0Vq8z5FJ2F; Wed, 27 Mar 2024 11:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4PWN5J2nz4cJb; Wed, 27 Mar 2024 11:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711538784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVmuH1zymsJYfJF4hFueBGq5IpRxMW4Ws0hSx0NwIQM=; b=fL28oFDy8ZZEvAhIR/ONdVOR2+mu2mPU0nmvnZ1yHyOYHkhrB7lyw7d/kKgkMXqjlK1Bkx bBlXFEVfVrJuWmo9O/Iy1dqfE2s9lzDcHNsviYt15z8ecCKv/+3SgMbrqJzVe/0wThDuSV lFB/7RETX4xZ86Ch8QqBcyGNL6ChgxLw+VWZwyqWo1YiKmu6rGmUcmcdY6qCvDeu3q4Wnv 3hEi1PWe4O2x1mBE8ZSkC/hPAt96l9ulxX33s5+ZBbekGWeb+QE2F3glazYyYFA/qIIocK 3KSwhgILjRkSipMvCuYTbmeWVKp2SHBQZC3bkuGrSsZ04RzMbS7ylIUkO40I4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711538784; a=rsa-sha256; cv=none; b=b61f73ecItKrzvAw3Pq6UWo72nASKZBiFbVPUXE9iH8e/vy1gvZ4+gwhMYNUOPQ/sQ4rJt bG5//Q87iAk4sKn9f5V4cKwhDRzrlO+Ig2YfoBKvIz9CtArvZn710CbZhdHbKwx1SF4KiZ S8RJ3dQFgl/C+jRR1ebgh1gbHUIT7zvqzlqxbESNgnUce8WX9t2RJhznP9k3LVhBwiufsK RL2Y2Eu13MtzgYHXIBZHLIO/bospCiNj2DBjiYPtp31AFREDzWQ48JQnBTPxLhnTlbn0bq IHwjZ/0K2J8Zx9J+qCQrH7f/Xz097FKpdUT9K3AUySmYYWuqBSJEA00nlGa3sQ== 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=1711538784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVmuH1zymsJYfJF4hFueBGq5IpRxMW4Ws0hSx0NwIQM=; b=nlq7Uwga+WZdcT6beeZPeY8d5PhbOj47+9JBctxa1hhwI06b+5smsfmy9s1GBE5nj8Hcki /sVFXQtWlaQ5+3JvLwcP9ssO+4wJ/1BB08zp70ewWuyL/ULuI20OrvwE9MRS5S/5qXzR/F 1IIW849OKVRULe8PX3fxANjweEPcbi0lEEA85xwcgfg112Zhc1AQtT8lnmiONfhPgU6b3x Gz0zC0fleQAMw74z8jHMaKjaYnZp8F0d6CX3D/pHFP08wPI63VjzWW1FYCxFgixCUDr+gL zbx3usenBBDZwdgRu+50HXaRt2y8Y9oFzsBVgNpvpzA8YazCAz7AxpEeRo3lTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4PWN4qr4zhZF; Wed, 27 Mar 2024 11:26:24 +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 42RBQOsu004044; Wed, 27 Mar 2024 11:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RBQOaA004041; Wed, 27 Mar 2024 11:26:24 GMT (envelope-from git) Date: Wed, 27 Mar 2024 11:26:24 GMT Message-Id: <202403271126.42RBQOaA004041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 2cab4be46b0e - main - install: Prefer strsnvis() to strsvis(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cab4be46b0eeb64b8ade010bc16245151af5ccd Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2cab4be46b0eeb64b8ade010bc16245151af5ccd commit 2cab4be46b0eeb64b8ade010bc16245151af5ccd Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-27 10:03:59 +0000 install: Prefer strsnvis() to strsvis(). MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44514 --- 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 1e5adadd8f49..01e5bf0b5174 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1529,15 +1529,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; } @@ -1562,7 +1565,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); @@ -1572,14 +1575,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 Wed Mar 27 13:35:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4SNP3zMGz5FV7G; Wed, 27 Mar 2024 13:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4SNP2H00z4vCG; Wed, 27 Mar 2024 13:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711546533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GzgorWJ8E6ZlbyHqCZ5yFReSr2OqnzQmzl7IJguEopo=; b=ao9uCcv+Piww5iXGvRI3WrxBbrP8T3kPpJNJm9FNgxLDF4YM6leHhpHz+AxYB2/2lmuVCx vfSkjkSMWN+jArUK/Ucufg7AmLjQLe7mUNhGyRV1ebyChoFTZxg8m+gcRcsJqpkL8sbYq2 NuQz3PxPXYA1Cw7j1eF/36rbP3MjI7Ob3qp3WRP4KqWYOKLd2Fvzzj4A3kE5k/RuqHNQ8Y l4fAi4BNfzv97hkeKQHZ1nW7Q5OP2iwrUQrkQX20I2VD5ceMZlQ/TgJuvUr+ozNigWtFdO q2LHTe6YKqL44QZ8dGLNATIDBT3NMO6gRHoXTtgm90EIYIaJJ73Q/1V3NdftTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711546533; a=rsa-sha256; cv=none; b=I4d4gonvt+ImjFyE6ofgbikItYLpKoeRJVidsF+2XGtGCJW2chFLrhlZ7/QVtZUoonXPoP 7xC2vPmDY+Ad4eOJEYEzRpBlYbzVkJEGiJ0N9dx9HHRMhTspZijg5wJk7WzOln6ZLyG9RE Oi4LyecuS8JvCovrIhP0ntHfSw/cgaul0glcWYPu0tOjHaU4cDJka13uyqdEd+BigKt2NQ LeaNbtnPhJhny7raZUZe4XYlKXTFMxAnBDOf7GuTjDRAnzWF3NXxTXZfeJ9HSLKDlXma9H EwTMp3gzqETsKV7KW82X2Rkw2YQFumr5gzwa+guuXbpNm2z5bcLs+p+gTIpQVA== 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=1711546533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GzgorWJ8E6ZlbyHqCZ5yFReSr2OqnzQmzl7IJguEopo=; b=Dm0upzq5H8wp3CUvTlVr3wQDHFNLqDuVfh/f9ZMXY+W7nPbAzckBLleR2MMC0P+fPGbweL 8NErkul4S8tFnWeN5yXqm0+LedYuikERxnDRMkxIvh0NB9S/OWRJN21fsdjTG94+xSsif4 5G4nfgK9nI7Ho5mT8f0eQGyA2dr5K11wPSwYu9Uo2jToAxiKFx4Bq771Y8+T/mBzq/mUIP awCVzKEidtw3TQGpAS8P4fQ0DjYCuXxWJeFbQjVi3vwLhs+11RDOA6MRe2SFB4TqI2bMu3 UWLjT206tapQKNk3AghRSlOVOCUIqRolJ+tS+tny/XHe9sysI53YCyPcYS9QYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4SNP1sggzlXJ; Wed, 27 Mar 2024 13:35: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 42RDZXIH023679; Wed, 27 Mar 2024 13:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RDZXRv023676; Wed, 27 Mar 2024 13:35:33 GMT (envelope-from git) Date: Wed, 27 Mar 2024 13:35:33 GMT Message-Id: <202403271335.42RDZXRv023676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ed505f893ab0 - main - tcp bblog: use correct length List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed505f893ab08aa61e2a1046ae54df357a108260 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ed505f893ab08aa61e2a1046ae54df357a108260 commit ed505f893ab08aa61e2a1046ae54df357a108260 Author: Michael Tuexen AuthorDate: 2024-03-27 13:31:48 +0000 Commit: Michael Tuexen CommitDate: 2024-03-27 13:31:48 +0000 tcp bblog: use correct length The length of tldl_reason is TCP_LOG_REASON_LEN, not TCP_LOG_ID_LEN. No functional change intended. Reported by: Coverity Scan CID: 1418074 CID: 1418276 Reviewed by: glebius, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44510 --- sys/netinet/tcp_log_buf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index 5e168c5066e4..7b937958a4fb 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -2442,7 +2442,7 @@ tcp_log_dump_tp_logbuf(struct tcpcb *tp, char *reason, int how, bool force) if (reason != NULL) strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); else - strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_ID_LEN); + strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_REASON_LEN); entry->tldl_ie = inp->inp_inc.inc_ie; if (inp->inp_inc.inc_flags & INC_ISIPV6) entry->tldl_af = AF_INET6; @@ -2532,7 +2532,7 @@ tcp_log_dump_node_logbuf(struct tcp_log_id_node *tln, char *reason, int how) if (reason != NULL) strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); else - strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_ID_LEN); + strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_REASON_LEN); entry->tldl_ie = tln->tln_ie; entry->tldl_entries = tln->tln_entries; entry->tldl_count = tln->tln_count; From nobody Wed Mar 27 13:58:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4StS3XmTz5FXgX; Wed, 27 Mar 2024 13:58: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 4V4StS1vcNz3ymr; Wed, 27 Mar 2024 13:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711547888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oH7d3Jaw0kVoZ9BG2n6fKLAOWU3J9NyECQ0LA0NUc6o=; b=Nd3Q+KCi/QvKMIklCnm/t2aRD4C6AHw8CtQL8iAEX1LKcrPhREXGc0J9JRHXLUbmUF+wDQ IvA6GoJi4Ao5Hj1jNHPKg9gKXyCiRwJ6UiLB1/YQdpU7de848ho7yZkRmIARNcy6F8Flu3 Lv3tqM0hB2INVGC7LFuxSGJa8+tZTguVFgNBeC1+wBD0Odev2Y/PTgJ1fbOj13pK5zjH/B wia5F3wKyFyitGl61GfL3/TLTsdaqUp5mcuSExxYekHRXzE4Ur9e1Nvw3cKC0PcBAjJ55p n0TaHlznDT67HlB8ncZ6I0Fv84l6SKBwn9ZORVfERh0IeVwM1oj6tz5UZSvC3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711547888; a=rsa-sha256; cv=none; b=ZPWdvRTfD4Chui44jMFqf8u9kIHBVGAx8UIeiJD/JNFIIBsbxrmUcV7HJtrtU05atcvftJ yDjx1j5rHwaqYk8+qMzLLGuEMPWvQPVTLet+0CZMxhUDYQCy7EZxC5twVLbblH1PtjIbql q3/46umfzv83Xid8iQWkprwK/anNSy/9GzBVZ5C5gfxGlf2YaqBKHFxxtCl1gLrrEVC9BO Fi9cuvHkQMlg4CtUhGw2QG5N+PAylRPOhMhMhrq4TgvMrzKgeCLaJdKvMuvyOZHOsYdawX Zdk8stVCWiimzisRIlHmqfU/n/Ex/mNPu8d6IUu5/KwrOkKbIWOp/KqfV6MQMg== 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=1711547888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oH7d3Jaw0kVoZ9BG2n6fKLAOWU3J9NyECQ0LA0NUc6o=; b=FQ1AhrjZ183ZFoHxGgLkI6lz6MdXuZcfpawXis1tHhyEwqhwMQK7Ttm6rliL5VKVSzml4w yaEb2GYViDrF8SMBXQ1dZSGv/MjryaSA7T4GXuOhRfQbGV1DLLPW31XyB19TSEf2x6mavI bl35vvqmyJyMBeSphlNZilcm5wKL4g4aQAawpdmunP988Q0jA7qavVGQhRzDYwwwHIrjzc bBuvD9Z0GCB5zClWXO8hJXHKkfsqu6W4yeQXCFXylw/uTS9KW3e7FNgihmLZwnf9myRnEc ES0fMC0rOVSPJpFVEfOtVky1v700Bf1gnJG2XardQ4zTjnaQNgbbJlQYPrF8Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4StS1VZSzmYY; Wed, 27 Mar 2024 13:58: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 42RDw8pO057850; Wed, 27 Mar 2024 13:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RDw87U057847; Wed, 27 Mar 2024 13:58:08 GMT (envelope-from git) Date: Wed, 27 Mar 2024 13:58:08 GMT Message-Id: <202403271358.42RDw87U057847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 280085ef0c9d - main - tools/git: ensure git-arc is more platform indepdendent List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 280085ef0c9d754711d68ac74ccd98b58f54c716 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=280085ef0c9d754711d68ac74ccd98b58f54c716 commit 280085ef0c9d754711d68ac74ccd98b58f54c716 Author: Mina Galić AuthorDate: 2024-03-27 13:53:39 +0000 Commit: Justin Hibbits CommitDate: 2024-03-27 13:57:01 +0000 tools/git: ensure git-arc is more platform indepdendent Summary: Linux systems' tail doesn't have `-r`. Instead, we can use git's own `--reverse` sorting for `rev-list`s. Reviewed by: markj, imp, jhibbits Differential Revision: https://reviews.freebsd.org/D39975 --- tools/tools/git/git-arc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index c74577e2d5d7..1c828f3194af 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -364,7 +364,7 @@ build_commit_list() _commits=$(git rev-parse "${chash}") if ! git cat-file -e "${chash}"'^{commit}' >/dev/null 2>&1; then # shellcheck disable=SC2086 - _commits=$(git rev-list $_commits | tail -r) + _commits=$(git rev-list --reverse $_commits) fi [ -n "$_commits" ] || err "invalid commit ID ${chash}" commits="$commits $_commits" From nobody Wed Mar 27 15:13:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4VYG69gNz5FfZj; Wed, 27 Mar 2024 15:13: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 4V4VYG5FR1z47Jk; Wed, 27 Mar 2024 15:13:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711552402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mjb1B+G+MYPwrlNx9Go+cwqZxytJmfDiEbZ9h6sRkcc=; b=YcmqFX1TrvOzb7eufDBdVA53EJlVeHvKMqNho8x9vFVoZWIY6BsNwKtzWqZSHjOdk6LSVy gB6quDwo//uAKl+qbmZlqlSqJBLULddOy8eIrwBKyf6Njn1O2gvTFLODg5ZQPDnQDHqBkD Fv8FaIJEHW7thvy3dGY2QQfkVL184GtyOKN0joU3HQhtxwuYbOaDiAWAUfLFSInUcDz/wX eO7c+wMsjXzHJ41Iys9MAOQ2zVXHbeKRoRA+Nr/QdORBYP/ZloohZ7KXOwUOUf0CLdmFnO wlpZU6HImMI48BXrwPZmW0/ngnvxlBkIUD+UR8OUtqJesa982Jrh0DMXgPA3Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711552402; a=rsa-sha256; cv=none; b=WDpOjDQvtp7sP09qewE672WbOYc3D+3VxMT0S+TyZbrFGGBct2uRgV/SODO544KyReU97v vQBB3qB2o9n5Wws1F9CUoS724QJoWqILAB+ueqjongNxzTZARSfatkiLPNAxN0Q322WSuT HsCU/K84nnRk5tutBu+a/dOd4NlCbV/47ABXqHIbrwIN22Bzr1X5M7W1IbHeSnQ49uaXgg o4G10j4+PVE9qZIpl2wFjFvf3VwbvyILdIw4k6mmQRBuNICm5oXjYyI47IHbYgaORJ33mF AH1A3hsT0Oh5ysfb21V14wq/IyLqSYtSm7SgbUOlYwJiKXjFx9Gfi4i0KZnqAA== 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=1711552402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mjb1B+G+MYPwrlNx9Go+cwqZxytJmfDiEbZ9h6sRkcc=; b=MhPPQ2SAUOIPVUxXHMxJgtfjF6S4kdXiTkwNFwsavdoq5stQiQMrBjQVYtuGOYId8lsB+o 5+I3bk6x//k/AhaKaJml3CnQ996jceHJwwCD+Le/Z8ZDBY2qBbmhRSNT4Up21xJTrdA/RW mP3d+zztkAt5MvTYOMDb96ZaXS6Jb20bUAHMxRib0CC0kmhvnV5NQSJIDGr9Y1FZeT9aYk MQqQGCPZw0BrMC5wjWJyt0SxsEaSAlD7kxNmvvuBA0WjQoSH+KKVstQHVodNuRl3Jy3WVO OVVaX3/cPv2bnd2fm0GoHpzGqbPT/f9bgFzcIzp8LykiS69QVyj2RQG96EZirg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4VYG4rPTzphk; Wed, 27 Mar 2024 15:13: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 42RFDMhC092740; Wed, 27 Mar 2024 15:13:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RFDMf6092737; Wed, 27 Mar 2024 15:13:22 GMT (envelope-from git) Date: Wed, 27 Mar 2024 15:13:22 GMT Message-Id: <202403271513.42RFDMf6092737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c92400a6f690 - main - dma.conf: Fix typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c92400a6f690a82ab84eb0b97cc8bf169e44e4e8 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c92400a6f690a82ab84eb0b97cc8bf169e44e4e8 commit c92400a6f690a82ab84eb0b97cc8bf169e44e4e8 Author: Mikael Urankar AuthorDate: 2024-03-27 09:36:33 +0000 Commit: Ed Maste CommitDate: 2024-03-27 14:37:22 +0000 dma.conf: Fix typo Pull Request: https://github.com/freebsd/freebsd-src/pull/1150 --- 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 Wed Mar 27 19:23:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4c5K5Td8z5BLPs; Wed, 27 Mar 2024 19:23: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 4V4c5K4ZVdz4dhn; Wed, 27 Mar 2024 19:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711567381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8dtpEv05/0WVh1bvQdOvExpqr6vehXShVuaTYFg1l/A=; b=OZQEAU6FG5efhEJmDqf2cZbGTYBLMoMp6HSnhPGF8ITI3EwO0MVgYizU4v0GpATrIQXwsI Ln0w+E7QfWj61HLH4KWzJc3ANQWFU8sKL8/yXou5XJcCY7slrsilI/hH41+pGW5vuRKmW2 tBBPaDKpey2Wny01WUKaIRG8yLTo11MKvDYl8oqqXo6cN0+Lfx5Zx+Lezr5BB9B3ACk4jf cEjHuX/wAx0QXKCUKfl4X1Df1w0HnjZ3lT7Nj9Jhauy5egrEPOFAF1uxvySQ6apOdfVo5+ C3SxVB4jlsQ1cawOwc91ivW9p+B4hYU882+9snaE2gfaziPf/MTjN5kp88Icpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711567381; a=rsa-sha256; cv=none; b=qPH2DYRf7LoJsxF8aMZ+sZdnXowjxUVbRte9vYI3WIZSnNQAFKkwbtpqyTMBvOsBkchhn2 0lPjqPZS0SaeNckfrqBmGK9Q/mNYuTDn09LLYvvI6FDyPZUY0n0K32a2LovRcsfjpTG5L2 hPBIryvZdWjqXUlM+LzDZST8/qbxYoT7+NK+4swnDEfqm8F/6U2VGGE8IHDX9GU9ge4AFE FQnuO26lKax+ffrC+daG/itCRHFUL6VRzSlKqOozKV3DSrx4sqORhklw2Pcz4pxtDsq5NM f/WtnKXkohsmE7qgkreDtrgxvBmZpiu/btdsBNW1FwVy6nWjQ7HVs84H56h17w== 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=1711567381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8dtpEv05/0WVh1bvQdOvExpqr6vehXShVuaTYFg1l/A=; b=fTlk7PwTWHHPgqcWIMDKdFI2za5yloXX6jD6NocBeYVQBoup39Rmc4u4p2GSTDto/cvFqc wavDbizfYBMsUOxmoLropbfcE7NyzfhUgK0vx1sw1+/ptXLck9llSRiMP14mdMLgjhjm72 r5clVg7AL09R40GqW/mQWDOVg/alQ267pZ542PEEUL5t78JuCWK+7xwnGhoyWLZbGlgetH hsHZ8OWqTtwowU64RzeE40icPMog6yIKGMxllNN4bwJTFbmcZPZZN3FIJUGmIm2X92UdRj KpQkU9Qw/sJ5gjKGtXUfXsLHDYJvvm6CVE02A432eYPhoBqhEKeSQ9oiqDAs/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4c5K49rlzwjn; Wed, 27 Mar 2024 19:23: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 42RJN1i7016709; Wed, 27 Mar 2024 19:23:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RJN1WV016706; Wed, 27 Mar 2024 19:23:01 GMT (envelope-from git) Date: Wed, 27 Mar 2024 19:23:01 GMT Message-Id: <202403271923.42RJN1WV016706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3fa957840354 - main - sockets: define shutdown(2) constants in cpp namespace List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fa957840354bb476c2f990b72cb2ee7339ac328 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3fa957840354bb476c2f990b72cb2ee7339ac328 commit 3fa957840354bb476c2f990b72cb2ee7339ac328 Author: Gleb Smirnoff AuthorDate: 2024-03-27 19:19:44 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-27 19:22:10 +0000 sockets: define shutdown(2) constants in cpp namespace There is software that uses SHUT_RD, SHUT_WR as preprocessor defines and its build was broken by enum declaration. Keep the enum, but provide defines to propagate the constants to cpp namespace. PR: 277994 PR: 277995 Fixes: c3276e02beab825824e3147b31af33af66298430 --- sys/sys/socket.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 91fafdec672a..9d46dac376d7 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -629,8 +629,11 @@ struct omsghdr { */ enum shutdown_how { SHUT_RD = 0, /* shut down the reading side */ +#define SHUT_RD SHUT_RD SHUT_WR, /* shut down the writing side */ +#define SHUT_WR SHUT_WR SHUT_RDWR /* shut down both sides */ +#define SHUT_RDWR SHUT_RDWR }; #if __BSD_VISIBLE From nobody Wed Mar 27 19:44:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4cZ52GJ3z5BNPx; Wed, 27 Mar 2024 19:44: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 4V4cZ51dfVz4gVs; Wed, 27 Mar 2024 19:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711568669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TFYFQ61ctRSFlN/bttiBB+5mugWMaRLKWRSWFpqT0P4=; b=sBDhBQ9SkBfR4SaKq8/oyEuqoPSMyFNQS7jj5acvUoMy5tTOH/trDWerzTmKyN3P59s2Yo B3BDNDgqSYU5hM1QYWapzd9QbUeg7vNM0FXHVoUZYSkYKN1YIeW4oePMEbv4ZZre/TwG/M 7DWCzl8UB17kE6SsMp+jBmagWK+dDWACwNdtDupnLqnFuqA6eW46iA/+g+S4fW06ExzE03 4gjVJDMhQq23k3kUWA5SMfMtxA9A/5By9v6UusQW65wMLvgGnSLBpLAIlfhgP+sSDCGiEe PoqERPrRJ0402RRjFaYHDjFT+oXNs3jzINoGYrynbfOTWbPlIMhQ4thhemYUiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711568669; a=rsa-sha256; cv=none; b=Ck9bUVYtZjE6ZOEM+hd/g416XwG+2fAtKrEXglLJNuI0Un3hroPKvQKNqzgGgEQYvq/iXt Om9tTMUEYddtG2+KrOJHRbEmioyLeUZVGp26oYAwjFZe8XwxSVApGbX+HfIl9WLmzslMs+ 2jKV+BacvdfdA9D1GCp3eOjKNyhHOvi4NhzMUkK/2oj0zMeY/9y1FBAxNUUu5CmH4TMPTO fu6yhcZ0evs+h8b2DGnVIPQzS6Vz7jDlf3jk0yk9mTt0ddeELhiGYTy0ro76eIwu9BgsCk 4UgZzaa++YbdYSJixeadhSxP+h6b2ekxf9gdldynuapZbjvE9zEHWmFO7AbMSw== 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=1711568669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TFYFQ61ctRSFlN/bttiBB+5mugWMaRLKWRSWFpqT0P4=; b=SF/v54ftaAgxdCwK9Mk936jQbnh1eosVZjz6+UjHnkx0R8SLpd/CLpVcn5DLbfCeR2SkXI 5+g67xX4bhoOMt+kamUMijoyIcwpPmEC7FNW93c2L86x8imFTdEtI0PxDtMqaRl/exVKqt Pct9Z91FAm3whuKHR5vZNQG0h09OJBsayJ7FbJIapJWNVrY+37yW4Bwkfept9kb8SNhTI6 OZDiN8c2hTRIvMzEk/4KJope6UkHzL5DotJ9mxZkrid4XY5zEIAGSxORdwZXGEs7q5ONJ7 HyHH+pn/xPIrhTInISh6HvNhaO1kSzSi5muP1ZCOSbcWjb4tTxxeSYMWe4O/Ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4cZ512LVzx2m; Wed, 27 Mar 2024 19:44: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 42RJiTGm050266; Wed, 27 Mar 2024 19:44:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RJiTa7050263; Wed, 27 Mar 2024 19:44:29 GMT (envelope-from git) Date: Wed, 27 Mar 2024 19:44:29 GMT Message-Id: <202403271944.42RJiTa7050263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: d5aead83dfa8 - main - arm64: Delete stale comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5aead83dfa8859ad8e12b8b782545c75fecb9b1 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d5aead83dfa8859ad8e12b8b782545c75fecb9b1 commit d5aead83dfa8859ad8e12b8b782545c75fecb9b1 Author: Jessica Clarke AuthorDate: 2024-03-27 19:43:38 +0000 Commit: Jessica Clarke CommitDate: 2024-03-27 19:43:38 +0000 arm64: Delete stale comment Fixes: 078a69abcbb8 ("Use a uint64_t to store the arm64 mpidr") --- sys/arm64/include/pcpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/arm64/include/pcpu.h b/sys/arm64/include/pcpu.h index ff2bf4df1271..09bd8fa8a966 100644 --- a/sys/arm64/include/pcpu.h +++ b/sys/arm64/include/pcpu.h @@ -48,7 +48,6 @@ struct debug_monitor_state; pcpu_ssbd pc_ssbd; \ struct pmap *pc_curpmap; \ struct pmap *pc_curvmpmap; \ - /* Store as two u_int values to preserve KBI */ \ uint64_t pc_mpidr; \ u_int pc_bcast_tlbi_workaround; \ char __pad[197] From nobody Wed Mar 27 20:02:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4cyg4hy1z5BPp9; Wed, 27 Mar 2024 20:02:19 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4cyg4D7qz4j45; Wed, 27 Mar 2024 20:02:19 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711569739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=od+uyTVPg6s3b+ZZDZgC0kwUL8UR4d/6SMjrWMyFPTI=; b=mUbhb7OdXGMm/seewxMrXbBOm5xakHXXDZU8dOMk3tSbqEiyFJ4H2AAvVU0vdZc6g8su91 6TTxFc4iRh1CAEI07V/R/kp4ffMLrS0XFMOQ3rByIliaO5PfcVtN2YDnpufVDrdGmjKWrl ovdUY8a42ipp1OK4wLGslOvMhgxQKIrEA8pyXP7LMXmoNir0Cu6MNcF8ShnO+JAwOS7Hvx 513FK/kUByUdl6fGva7tIpzMgNNQqz+suhXJJqHCrD7mktrjjxzQcVh6Bw16t3tL3grpOb DAybqlynRhJTXJ9kT92W11M9tF7GFivPwi9e14IXRmsFJnaOA3H23Hyr3DHHlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711569739; a=rsa-sha256; cv=none; b=oJSaRD7FgKDWOgTKidMjL/cp3jwprSI0rv59GuwukqhUNiOEb85/St8a5/1klc2xJozGn9 v0zjXu+44EtLLh2rKQ0sZkb/gpK5auQNyh4+rrDqBEciKF4JMUz9mCzDfSYohTNIZYOFEU ZQhVKLBvqGflWkmazfMkXFtmm6H4OI2hTrG9u0zuFNiSFkjOf0AkHeI1MUN2WsOg0YN93g SMMKfYofLgKxU8CR2yFfzo9H1Uox1DQOVkkm9/OvbboHJvkIt8ZVUS+yUBePLvaeiVBH7k beArjPAqzPO+2DAy9nEAN8PLHzaJ8dP2WrBFyHfNyzUe0pG7tZMAg4mseDMvEw== 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=1711569739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=od+uyTVPg6s3b+ZZDZgC0kwUL8UR4d/6SMjrWMyFPTI=; b=MsyPN7GLpJYV8qNjDUmzKWqfl+6JBFr2GYWr+5wEBxxaCH6seJhCDdD7JuQlHAK6HVifA+ 4GVif3zzjJf/sbg5uOoM3erJqmyiMvHRo5ORyM7NPyy5/HIWkcITGNyizYuiuzZfGs10hP GZ0FWHYg6/hcGinbubfQs8HpkmCqDtYJTlSgejESOB9Rt+iTiNxrE94Me6sPSowJXN81Ak 4nIajG+sWywjkAxJUxzpPRPxodgZRuyzhMmUEmpKzBt6beyqwQtegWzoXq+gQ42nmJs203 oTcosvCvytx+FfbEdOoYm3XfoGMpk8gsIeTReFlysPwaRoAzZgtb7PeLlxAg3Q== Received: from ltc.des.dev (2a02-8428-0993-f001-922e-16ff-fef1-acef.rev.sfr.net [IPv6:2a02:8428:993:f001:922e:16ff:fef1:acef]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4V4cyg3Bxqzc7m; Wed, 27 Mar 2024 20:02:19 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 438FA311; Wed, 27 Mar 2024 21:02:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: f126890ac538 - main - Import device-tree files from Linux 6.5 In-Reply-To: <202403212010.42LKAvFw039075@gitrepo.freebsd.org> (Emmanuel Vadot's message of "Thu, 21 Mar 2024 20:10:57 GMT") References: <202403212010.42LKAvFw039075@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Wed, 27 Mar 2024 21:02:18 +0100 Message-ID: <86sf0bbfzp.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Emmanuel Vadot writes: > commit f126890ac5386406dadf7c4cfa9566cbb56537c5 > Merge: 139d114acc7b 309417d444d2 > Author: Emmanuel Vadot > AuthorDate: 2024-03-21 20:10:18 +0000 > Commit: Emmanuel Vadot > CommitDate: 2024-03-21 20:10:18 +0000 > > Import device-tree files from Linux 6.5 >=20=20=20=20=20 > Sponsored by: Beckhoff Automation GmbH & Co. KG This broke the armv7 build and it's still not fixed, please pay attention to your Jenkins email. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Wed Mar 27 20:20:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4dMn2nqDz5BRCx; Wed, 27 Mar 2024 20:20: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 4V4dMn22bBz4kNK; Wed, 27 Mar 2024 20:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711570837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WptNiFmLIV57m+U2rFhpdLQzvKOz3JpseuUHFyH/iCM=; b=ni+cxS/LXqEHZ27K7tdUCjDi/xKZQnJ9TWjDCKRcPPiNdzdLI7kyblUCFED/jif/NtVdUn +SULRJ36qdTymRlEsuoX8XXyAS4byutOgNWrQtcGQ6HnaCc/8zGcxIw3SKFt4whPxl1+mO PEPRV97BhNZNAJ2dl6ZXuiYZ/5g1mhQVCJPV7jM4fhvDzlrKVwZKwv99cL6uMLZnxl4SQL BI8rpUTVPooJUCo3SVJq5ft39UfUbXms6JtC5A0K5U6vmr7PsgCG/AJD8U6pyf6zp89UeH Xhx6xqr17l/ph3oAMY2gE7ym59/Kpzoap3GmpApJr/5JeksrtseHegE867D+6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711570837; a=rsa-sha256; cv=none; b=VL2kcsyUIl56S8CAh2PGoVOsyyW9JFKnAa0L3OzZRNNGejyVZvLpIg8bwnxC95lpWG7uGj A9F7N7SDXWX1JJnEG3U5f/tovzOwNPdHG7MsFMv3H9JDAAo9LjO4FZwKaoesLKJNB3DfAa 6ilrAnnioPx8E47yrC8nSpjzYvzjOMW81L3aWv/DTfEy64QlRfg/F8f+XZHyYtqxx/S5S3 xvpuQ5nWRsyYlHhAFh31DlWT6lZlGFmHRfQ8wiRz+dI4tRNrnMM5p1EX8SU/wy9XeG3ggb BxOKOR/MCakxRBb4JhprFUuftOX7bOaNEdpWhR1VxkhCO7lKezKZ5wNpx5qggw== 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=1711570837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WptNiFmLIV57m+U2rFhpdLQzvKOz3JpseuUHFyH/iCM=; b=C4zmGO55zsYmaKAxFD0pEBOgHGYCb7IYt72Chagqeeb2BH02tU0KF5rNSiSHy+d5AV0HSn jIb4+EzXNfh6Bo7rKtQF27OIGRpAMouQwXxxwjdBDUbSQtcl8+Wec8WSfEGgnRUpdTfUUT gPkv9A0m9vfm2TDMyH22yHZWOZCABEwTIeLOewulGBYXpnAXK4iXotRc3Q1og/aaWQvquR htjpMWYu/Knpt1i5sQ9dfJ4gQZjLUSPPEaCXW03l/emEI1bHMtQ2vy93LyI1HNBsDLG2rb zo8JzEzgfVMnTpF1VnI50hb9sBvYho1YUFR01xLAzRfMWYcwKEDxHO8wcYPZUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4dMn1fbbzxwy; Wed, 27 Mar 2024 20:20: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 42RKKb6s012033; Wed, 27 Mar 2024 20:20:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RKKb6i012019; Wed, 27 Mar 2024 20:20:37 GMT (envelope-from git) Date: Wed, 27 Mar 2024 20:20:37 GMT Message-Id: <202403272020.42RKKb6i012019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 970ea0b2cb69 - main - bsdinstall: draw attention to new network config options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 970ea0b2cb6942b4fba088031e3b1968e056d6c9 Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=970ea0b2cb6942b4fba088031e3b1968e056d6c9 commit 970ea0b2cb6942b4fba088031e3b1968e056d6c9 Author: Mike Karels AuthorDate: 2024-03-27 20:10:43 +0000 Commit: Mike Karels CommitDate: 2024-03-27 20:20:26 +0000 bsdinstall: draw attention to new network config options The network configuration options have changed in bsdinstall, with an Auto option to proceed directly to DHCP and IPv6 autoconfig (which is the default) as well as Manual (the old mode). For users like me that were used to hitting return automatically to select an interface, but want manual configuration, attempt to call out the difference: Change the menu caption to say "Please select a network interface and configuration mode:" and not just an interface. Reviewed by: jrtc27 --- usr.sbin/bsdinstall/scripts/netconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index 130db2937234..0f23ae134cb6 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -76,7 +76,7 @@ exec 5>&1 INTERFACE=$(echo $BSDDIALOG_ITEMS | xargs -o bsddialog \ --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --ok-label 'Auto' --extra-button --extra-label 'Manual' \ - --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&5) + --menu 'Please select a network interface and configuration mode:' 0 0 0 2>&1 1>&5) # xargs collapses exit codes to 0/1 (ignoring signals and 255), so exploit # bsddialog output being empty when cancelling to distinguish Manual (Extra) # from Cancel. From nobody Wed Mar 27 22:22:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4h430F1Yz5FbKy; Wed, 27 Mar 2024 22:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4h426ZDpz4vDb; Wed, 27 Mar 2024 22:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711578130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hYznK5cwz8x2sRbvsmGZ1kQgy/JnpZirMNlBUP9M/Z4=; b=Pua/YK9jf31gyQmb7v11p2p/Zn45Gd8JDMxcfz8mMNcQxdhbUxQvM/QzFyu19sJt5+CDFZ 6k8R3Hzsaz73VkE1gQ3nfjBwG0l0R4UaQVD+KbmiZa0LIfkkHeCEtaZdINjMQAF8Iq9qVg Qn3W0R7RxfiqUyVOd/6kJTUcQGu8gX6UTCLQPwhqR/YwaQL6e9i/tWwWHXLU9a1FWyTNKJ 5+sHH3LxrO7jcRI7/LJ3yhVQvONsaKv+B55u+nHOFOUuMwtvMb96fYtLsfFhx/YCDvn7U/ HIb/eUAYDfkfXKqzIBgBLZe2SPR07NtdqAWDY2Xv7egIGmXkzOxuw8nFrILavQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711578130; a=rsa-sha256; cv=none; b=Ho6LJmRsu3CaJnL9aFXM7/X9lB3C0JABbm9fDxO6RwZ3Yrr3LXwC1vhDOKtKpmqoYlm/1H BqxLMlKHJB9lpBFf9epy2I7PRYkK9zwW3QwmmwzVwCeGt9qv0u2thfybEvhJ/E0FzmY/b1 4Q04LCKs22ZvrxxHfLUp3Uuw6RZuj5KiJDvuLKNJ+6Y0OLCr3IEXGA9irmNgdeMSiTAoIl jdTdprqQGs4xCBzTlbWLHPGkDf9C07cyHY6rpeL1xXwhpEKmHW5gGfqewNZ0UVTO0goiIZ A6rbT7J7aj6sk4dhLxKp8mxJ4TE3xE/mMd/zdFiC/+OTmwxkahIZXMJbRappIA== 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=1711578130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hYznK5cwz8x2sRbvsmGZ1kQgy/JnpZirMNlBUP9M/Z4=; b=m6khKONmrTzGWmzUBNSj/BagjA67hpJhHOyMBbCwOvtea5V0A2aRXm9blqPbyIiwFWwj3+ iC4JVH2zg91Ukglw/CgjuzGkDQCK7mCn+wFDOQfrluVqmsJd8Dnrb9fwUS3TNIOgSDJzv9 oVN0acDp2ijSZ4Ga2eb5HT1f74nTYk5CGYpBx1SLIhQnYCh9vf5nHFvjhXgQxyRUW3CIxF uAOfMTarhqg36LXS02PibrPP11pzlyVAOpsb1k+v/F/uPn4FuI4gP3i7HJYtEI43MUKoAJ HFALICOSrIBCPy3O5O1WdAhWRuJV7GnxC+Orp3VsFKSCRY2E0QennTxsBuK27g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4h4268wzz12QX; Wed, 27 Mar 2024 22:22:10 +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 42RMMAn5020682; Wed, 27 Mar 2024 22:22:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RMMAmA020679; Wed, 27 Mar 2024 22:22:10 GMT (envelope-from git) Date: Wed, 27 Mar 2024 22:22:10 GMT Message-Id: <202403272222.42RMMAmA020679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 3abd36c68fe4 - main - sys.mk: Define HOST_CC as CC by default. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3abd36c68fe48b666dc8f6bbbc77d27971488ef7 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=3abd36c68fe48b666dc8f6bbbc77d27971488ef7 commit 3abd36c68fe48b666dc8f6bbbc77d27971488ef7 Author: Stephen J. Kiernan AuthorDate: 2024-03-27 21:25:28 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-27 22:21:50 +0000 sys.mk: Define HOST_CC as CC by default. This allows for setting a different compiler for building hostprogs when cross compiling. Obtained from: Juniper Networks, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D44536 --- share/mk/sys.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/mk/sys.mk b/share/mk/sys.mk index d8c5809b0bed..44db9266784f 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -153,6 +153,8 @@ CFLAGS += -fno-strict-aliasing IR_CFLAGS ?= ${STATIC_CFLAGS:N-O*} ${CFLAGS:N-O*} PO_CFLAGS ?= ${CFLAGS} +HOST_CC ?= ${CC} + # cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle # read-only files as non-root by passing -f. CP ?= cp -f From nobody Wed Mar 27 22:22:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4h441x4gz5Fb4g; Wed, 27 Mar 2024 22:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4h440C9Bz4tv3; Wed, 27 Mar 2024 22:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711578132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FlWzVQqhcMLXgZ6zIeyHufgSWoTwKT3jk8ZE5qU+Wj8=; b=dKW+u1Hvwd24T2ufsJmE8sXzao2ptoFuKemGuA2RyQorxg8xlccAwCkcS8rZU05J7DRK+6 9aPcn6vYZd4xGT33dGg2lqBy54cMOB9t2MwIDLHuGSNyianAh479EdcT0FZ2lFvhtln2O6 LdHcpcelXDS6vgmCLGAQTJNbDzAFT60sCrffPy3LSwq7YwN84/jITXmQuxA/XWK0hTCFRB VZlOQXKM+2lr8MqRHAnD0HeTkhRnJ8kF+vOSFglZknp3QLF3Gv/zMvHeNZm/CqBhD9eKfx MrilmCM7xQdjEPg3LK77+pH4gzMYYkSw30fJoJNY9RtO0J8nR+S+ozxeVkVETA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711578132; a=rsa-sha256; cv=none; b=BwvuQfI8CimMhs2g8JRxsQg4sIAsCcC+TrbAFqK4rR5C9bO30F64tgPNFXBZiA0CG2sv6E y/ADFRuf9mqdCx/STZyauk0vFArJHea5mJl/F7A2Q2q/hcQtgSO/M4oVNtrepqMWZPOOwX KbQRZwrbru36VKJnrODeR/xU7UgDN6uSRzCeNwpNJbIbI8kTwnpPDwzrOvglGO+gWPUgN3 BxzQ9cMYOS8aIMDzOk6sxq7NW7yoWb0GteGrBS5NGIK+0eqHyBkyjc/4CCBVeIgbsMaUFQ AkXOGdkyu/NOzunUht2cbHGECulqpNxx/DUK65phUiQAZwDO5tjI8gBE3jGzPw== 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=1711578132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FlWzVQqhcMLXgZ6zIeyHufgSWoTwKT3jk8ZE5qU+Wj8=; b=amAAeEt3B8ob+kEUk2lDBWCha29iZZV6cJGiEkzPoNb0CPyigGcAdRaCgfatkb9P9Nl74k rxhIHD53Pnc2KsgCRyYhD9eVRzuxcMl9x8tG9h+Up0v7Yl0jhVt61NvuPa5y+uyJCh2g9l ADSAc49cVoyDgkb6z5053HRa4CjL7qcuBd9UHCRkvK7zDmQDcdVbscY73Uf7RX127GUrBJ pYWqnNMP5ZVIj5lGV0ih1mKHLlJGDYmo8jNpw/g68P+GcirMjujP3fGFazJ1bn1RgViCmj MH6UAkYOIa0TKuoo+43F7y2RLyXbYLGDJRlopq2yv9VheKc4OKHlBWTkOo9ElA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4h436xQvz12FX; Wed, 27 Mar 2024 22:22:11 +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 42RMMBYg020748; Wed, 27 Mar 2024 22:22:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RMMBDN020745; Wed, 27 Mar 2024 22:22:11 GMT (envelope-from git) Date: Wed, 27 Mar 2024 22:22:11 GMT Message-Id: <202403272222.42RMMBDN020745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: a6d8dcb0d981 - main - csh: Use HOST_CC when compiling hostprog used by csh build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6d8dcb0d981e2f271af6d71268e0abaad1a0823 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=a6d8dcb0d981e2f271af6d71268e0abaad1a0823 commit a6d8dcb0d981e2f271af6d71268e0abaad1a0823 Author: Stephen J. Kiernan AuthorDate: 2024-03-27 21:31:40 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-27 22:21:50 +0000 csh: Use HOST_CC when compiling hostprog used by csh build The "gethost" program should be built with the host compiler. Obtained from: Juniper Networks, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D44537 --- bin/csh/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/csh/Makefile b/bin/csh/Makefile index b482e32024ad..d9f40f180343 100644 --- a/bin/csh/Makefile +++ b/bin/csh/Makefile @@ -123,7 +123,7 @@ tc.defs.c: gethost DEPENDOBJS+= gethost gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META} @rm -f ${.TARGET} - ${CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ + ${HOST_CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ ${TCSHDIR}/gethost.c .endif From nobody Wed Mar 27 23:18:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4jKb68v9z5Fgrt; Wed, 27 Mar 2024 23:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4jKb5gKvz412C; Wed, 27 Mar 2024 23:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711581539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MAfLNe4GOj0aOz4+aEX5UbFCpUIEFSrehIA+MJapWKg=; b=vaj1Y8pncNpCb2DI7pK1k4YwPN+ISo+o868hfUC5du/8H8/GH+HzgaWkkh7TsvgzaHHIrY LM6cvQhsx0N5RKSHbmUP+Gawe16Zc2GoH34n3yzdy7uMjr6M66/b77A2kUilsfFhfcJ1oS 9Nwk7jLa2IHuxHy8uZNB3NMyLG8ZDnbp86t9VNtWIQ/eN2oXrrhLqr5ywb0S8rg999IFYv i8E4jZ1EU/TFUZ0VdSIWEJaYGIj13ClnIg2Ifu9oDi8WYeL701kSJRemQ1Ysa+cbgcVVyN eonU/TLJeD2/qzEo3mnE5JQqDCICIr6PQZTIX1DhROIp7zgrb6WY0tv5u28VOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711581539; a=rsa-sha256; cv=none; b=hjqpcdZqEpmXUS5u70AzdnVxFA/3OSJ6yCga9WIQ/EU2M9XBm0++pUgSjj+5rEdaASBGm1 uzZvpOvQUGjeeD4LdoPHAa5+BPQZar2T9HiwzPF1UkZqQ70/d49gS/Y5M3gPezq648PTdu UsoC9GzRk39HFBPl6IMSW7jtoFyMrreWyqeY+5IS7vpUPRT0SD8VHs71dgFsTP2pO5UXyt tT2sln4pnqgH8tChKAUH3Xc+IMPg/XRq4kyE8gx3S7IVyljVnelUTFROEiomnvdzQFHwYL O4z4QrsColwa4fhYTvmD9G7D72YIsXU0yWM8CmaN3TAsi95dhbvpvFtegilstg== 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=1711581539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MAfLNe4GOj0aOz4+aEX5UbFCpUIEFSrehIA+MJapWKg=; b=s27OK4RQjxRcmWNjUdNAhNm/RIB/Z6JUgUSCmb96iukbBoPCs0/vYx9Asa1/nq++CGO/y8 RgkfDWEARAVandfyOAZ1oSSsZWz+nCWS7jwWgByH53G4KwY6n2jQiAcFt+Mm7ODp7USXkv mAkHfC0lnDVZ0qsr9hZjD9+oVdjnbnnoNIbEm0yx+UI3xq8+S72em4RxGE5sWirC1SJdBv uEF7Cjeblqr2jxrAW4UM6Xl5avgN76k9SSxa5ZPG2FL+UWHDqmJ807RM5HokWHGEirA4AP 6WL8EaryV/CBFAv5V/r7QyksSWHYVynrTbKLBC9GP/Rja1uq4dwuPLNWodcT9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4jKb57xpz13fF; Wed, 27 Mar 2024 23:18:59 +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 42RNIxL1006963; Wed, 27 Mar 2024 23:18:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RNIxgS006960; Wed, 27 Mar 2024 23:18:59 GMT (envelope-from git) Date: Wed, 27 Mar 2024 23:18:59 GMT Message-Id: <202403272318.42RNIxgS006960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 39f6f6f1c6f8 - main - libmagic: Use HOST_CC when compiling hostprog used by build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39f6f6f1c6f81fa93f3d0711d5ea222a8936ffd1 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=39f6f6f1c6f81fa93f3d0711d5ea222a8936ffd1 commit 39f6f6f1c6f81fa93f3d0711d5ea222a8936ffd1 Author: Stephen J. Kiernan AuthorDate: 2024-03-27 22:02:32 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-27 23:18:43 +0000 libmagic: Use HOST_CC when compiling hostprog used by build The "mkmagic" program should be built with the host compiler. Only use BTOOLSPATH if not building for host Obtained from: Juniper Networks, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D44539 --- lib/libmagic/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile index 5aff4c1a478d..150ddc686241 100644 --- a/lib/libmagic/Makefile +++ b/lib/libmagic/Makefile @@ -59,12 +59,13 @@ magic.mgc: magic CLEANFILES+= mkmagic DEPENDOBJS+= mkmagic build-tools: mkmagic +# For the non-dirdeps build, HOST_CC is CC by default mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \ + ${HOST_CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \ ${.ALLSRC:N*.h:O:u} ${LDADD} .endif -.if ${MK_DIRDEPS_BUILD} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host" BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR} .else magic.mgc: mkmagic From nobody Wed Mar 27 23:19:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4jKd1wzpz5Fgmh; Wed, 27 Mar 2024 23:19: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 4V4jKc5sXZz41CK; Wed, 27 Mar 2024 23:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711581540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bGDInQ1NoILCHGnxc3CKPZzIy0pRHFdNZEqJTHoO5OY=; b=LNSb7qyEyLsYb3dgqE1rTums9MsqdZ25LqTxMMLFIaP8ZYVnglCnRiU2/G+QbuCTs2sQ4c NYg+5Ayr3HORIqprdKQgoWKjqV465BF6S9MZhadrN70/X4b3VMkJhZGcWTrdcuq6biKiMk uV9BR4blHJIo80Pryi5eZNuweTd1UY3tFO8DyPGz94b/43Ltsi/2U7ty41C0kvjWHgSBB4 hRlhGtWz6QNiwYTTnZEoY6usE1MKRTOXJM+SWWlu5/bZ1g10OopnuLr7f/xyLrQQ8pD7ux tBRHVrK8cMAyHRLq5ilmlSfE8T1g3dIyz0oNa6LWvu7p7e6x43KwI8dEfsV8hQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711581540; a=rsa-sha256; cv=none; b=SuZE/xMHHYEjqrFCFA6vc9WPp9+HLaITuyRP9rpum+7uqNM/znXZOF5Frb0Pn5RPBELQbc BFwuHkciNIkiwhBiAXYxE/ZKsGULLn4TqaB/bRNrB+AADqCbvE1QDSMVr4DMUHPsoo+fRm K4O6qSsP3pm7XwBFTvTQ6tZEmDGfEVUJPxDDxwlvdzy26pC6mKyUjD2OAbgdqjTzrVa48u ZuchFctm7rAV0iGn1HkOdnOpHypGxw0t+7vM8ap+jeowvAmI2uSHGdfFfSLLAl2TxtqHx+ 8VxlQcUCIhu3qDwkAu7bzeU/oBaIhEyA/lsDjYFI+FUtsKPCIHYnGfymQ8jXcA== 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=1711581540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bGDInQ1NoILCHGnxc3CKPZzIy0pRHFdNZEqJTHoO5OY=; b=PDN2aGwFRN26q7dBVBelXVM0fP4AuFOwd15zwjj6OiW1JsdPe2rJZxuyLKSSdtLNhXlDl2 +0b//FM7s5G9rqT4Tx86OkHp28kZ15NQ1UWgv9/LsUzbN8FtY2Xv9A/2E8CojtFGwuxjE7 /OkYHMTzw7O7YWv/eJp02zazjTgHofakCo4l1wRFGLGBTamcUGB/SHkP5TMW3r55rlnWQo lQpMBeI4/kIJ3Greih1AA6A3n92PQFalghuPNsk75Ln8m3qCW2AIDIAT1wKfHszG334tT1 LutrohCEeVvwhGfMXJMjDLeBJptL1kcJQI4m6dg7eUXKSqMK5Ll4xcgnyCw2WA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4jKc5SmGz12pg; Wed, 27 Mar 2024 23:19: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 42RNJ0LN007025; Wed, 27 Mar 2024 23:19:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42RNJ0Uk007022; Wed, 27 Mar 2024 23:19:00 GMT (envelope-from git) Date: Wed, 27 Mar 2024 23:19:00 GMT Message-Id: <202403272319.42RNJ0Uk007022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: f6e77cb8c146 - main - include: Allow SDESTDIR to be overridden List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6e77cb8c1463704ed2817ea529c6b237fb8909b Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=f6e77cb8c1463704ed2817ea529c6b237fb8909b commit f6e77cb8c1463704ed2817ea529c6b237fb8909b Author: Stephen J. Kiernan AuthorDate: 2024-03-27 22:13:00 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-27 23:18:43 +0000 include: Allow SDESTDIR to be overridden Obtained from: Juniper Networks, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D44540 --- include/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Makefile b/include/Makefile index c15446010a52..d9f0951c94a0 100644 --- a/include/Makefile +++ b/include/Makefile @@ -347,7 +347,7 @@ _MARCHS+= x86 META_TARGETS+= compat stage_includes: ${SHARED} -SDESTDIR= ${SYSROOT:U${DESTDIR}} +SDESTDIR?= ${SYSROOT:U${DESTDIR}} # Take care of stale directory-level symlinks. # Note: The "|| true" after find is needed in case one of the directories does From nobody Thu Mar 28 01:19:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4m1F3l25z5FsfX for ; Thu, 28 Mar 2024 01:20:01 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-8.consmr.mail.gq1.yahoo.com (sonic308-8.consmr.mail.gq1.yahoo.com [98.137.68.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4m1D1Gnrz4B6P for ; Thu, 28 Mar 2024 01:20:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=mLUyJpke; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1711588797; bh=PWGR911lZUJOxyyq9GwedclUte+s5v14xovNK+2XKBw=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=mLUyJpkedtjVuQymEE5U+ii4ylgMi2ULsN3nXVmbXMTL35N37xCjiLL+qjnLfiTVZYTg+YzU2+qpUvDR3oS/iStHGQmux2myxMbIEWJ7sVoFWHbcm5ZI7MBeF5Trz5nx1gqLbh/rBKiFmN2MaRekU7RoA5R/wrT1m9GGxumXl1z8R7qPiMqnsKXbfJaQnR5PMCMkYYtjegUKXhRZIoPniYI1az0sbDnByWZPbs/+W7tqaH7G7RqA4OvxoJSemlvRv027QP3Jxx6AAksmWQ7ltZauJnIgQYTrAxCeD0b54tUKtqrivMxpuoTB1YuuqbVG+6QdeJtJ7nIPldRQ0bphkA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1711588797; bh=JV1HJ4H3VXDHtjYi/i1YmFiwQ9yZpUbjpcQU64UnkrL=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=XY7NqSb6pWNT4n1BWYy7pDk3EWrJbIo/wak7KlYiNv4ZwS/Re+YA+Y/y8i/ewL8P6U+nG4/9rsgRPv/uEi3Xmqxill6IGOyRf7cOhwRinyEe22vyhPGXzZm0UVYUftRmJ06Z24Dye0qlnFU3+dMWf0LBrMtGfKpKoyFhcAbFYM7jOuGQT30jPtNyEvdoBOWzjvdamEXnGqtJm9dJ8u85bEiUxrg4yrYCmT7AopDhyVqhPtDh32QFMbEFVLTaslOgMEOvdYbk6RkltFTJoQbHjelPXp6qm4HDbuF9HVCPl056GszhjK93/MTPCyYQbCK40KWnsRjolnDXQtfr92iN6Q== X-YMail-OSG: fQoJ2OUVM1l2yMe4C42PFEI7RstLZDb3cJ0dHj7gd7rnDS8sdYrVwnwzBzSgLRS YE438gCs4J0F9qh5tp9oRO5Gdrdwsocz2lDsmcef.QOKMxEylS300D1ZVCB0KH5RMqza_EVzAzAY b3EcGxhW4AUONN5IkLf.jOt0n6EdW_5grT8C3EY1Jz85FlNvLKuKzbfXlBXgGiOHOUiMTh6LkTG1 RNIrjI1RHpN7fVC9D_X4pM_QB8EfPTM8H4zeZrVlRUlU9fhLk9epJfvFuAJUIM1QMKx4onb4DKIR kR9yBx8XK3QHhWNFq5q6uj0d6p9dyMQanCL.h5zIi2APDWDOpEcMVY9kEbgS9UtVcrxL3.XeEdUh tTU6x7wf7wtHL4ksr7z9xWTMBy9gMTbQhmCy9qzDi5KX76rrzD1LAiQuB3nD8Yg9ZBfymj.vOiJx IeoKQGzB42GWfD4EoQU4ith805LjIo1OdTSBgKO_oCiV7j3cYwnuz8sSY8Qbx9WjtqOPWzhjsgjL b4phJ8s_uWPU6.x7w4VkGwbmqyLfuh335EJQXj3WVJmiQmQYAF9kcgyXqJIHom2P1xo.JYXRRvF7 zmc7Y5yT9vWt_9wU.MrTgm0HrhYjlnk3K.D_M.62W.mKh14GQnC2Roru2lIx80.v5KLq.gAClDZn of1XTf5UHnG_JmJgVRB3I8HUYLta0LJABdh8hk7sBOS0.IUQQ69Rqv.tm5eYKeNx_qRMDk3xtYqG wD1BCKZXvNId59zyzLD4DjUjUc5D3r2GCYG5BChILSprdkdZ3RAT2Rx6WvR0PTI3HCkX_.CtZbun seks2.ObtLNZ1BmW5avCi3xLobb8BXj_4r9.OD1SkYY_ywBdBi6cBmkMFt1B6s9Guj1BmId4.okj fQ4DXnTzJc7DMeIm94pvtiXC2s2LFaPv.rciFoQwSN8HW_uNp8h11DZT66_qDuDJabyJZ8iGX9sN sA_Lvc0r7JZo2ldORyjfMxgLXWdkuQqcldRqf.yj5wUu_1F2IBD3HzzYIpC8dC0h5JdVjL1xNKlI xxCHhr8l4fm_NmZvJ6cogR6Yjo4GK8xJy_1lLBmWoV7VU1gKgBcModv6x.GMLeHZ9Zik_sBtDoLH 3QVuqNLw6uKVcTAgJg5irw3Z6W9ajN9FcmhM6MhxaXwVxYd60N8yQBDenpEYfVj5u4umQjngighi JB.pi9Wo1VGULKB6UM4roxOEo67F_hK2758gSps9tTwsBxFBqq9d0cUR3UKpG1TwUahM76dg2SHX J1RNNQd8AVzNkrwlf83JcX2Y0Qdrek0CmRwUHxCzX_9X3KLgm72oOA_wGFSUHBcasuG9xy0mrzwJ IV5TaKuumFZk2e2UgFnk9jl9N9_.mo3bTkyDpL46_UDGwErKL4EWRkJkJUIc4J0gQm__4qo1D7Zu u6r15fRVVK5Fjb9FhFLoj6XqODHeHyH6MUuscg1Jgd9IJvseVFPqz5XrRb5WZRrqLqlYRl09zq70 PeFvXjicCdVryquYgukpBr8PFKwQCRDUzMgiKz6KQqFdNVmkoh3LfAYUjr3s6QrflUegsko9GCGx j5X1bfsXOgRqOgnbCbocZGazUNWx3SG5nMTHK9fhzRM6ed..WpfN1O_UzMnL_k0Xxu.1NVH4UA.F RBHR44dsNrlqfdCsKBXdyIvjI0gXhvsUv8wmS198J29qMBtNLEBvqR.Bwir94tw1WfNNRspUDEKo sTA18wGEELt7lvj8v0LFF8pCT2xei8d1LDsjsniwnj4.x1.fJLXa95E2YJrPP8Qj7rRLVrYWOStl xRwsVSwOf_nxlqoKMEwwftoFiLzyK4bLqHkGQBfSupYGJ0of6HDzh._AqOtT5oDanQzRzoXVjMyl hqeN_iNYEFHOtDrYTSskX3FvaLoMJ9IhyiJghCJPXJhCDzTH0LKgM.kthm4NkiwWL3DOyWZXnvwZ anZba0pftvaBufAeMowmkPxF6MTSwy2idOA.7CIEstMlSUupDA8fGd9ZMd8TL2cSZk8Q9o_gTsHe HirJRxgEVz_uGxU5IhCBgrkQRgYiLPFJKvGjxoSUQzygwDAU3v.CP8TpTgvb1Tz8VQN1wtaD3C0e PY9s5wwGOZP9CLkevjJcJbZP08KiDnoiwckDbvTULX0OeLaqRhmUoCJIiWSIobu5SY9bVrAHt2Qe _GJfoobRnBmcUq8aUmiF0k2UXz_QH4ur853Knc.J36yIZiqch0mbUOSSR8KyhO.rki.fjCw9qRB_ cWnsIMebaGGCIX2bHi1k6XhDMErz2t.4n2khZvzx651E1.zHP3_0Z70NRzhJEfAsfoEi_xugjRWw JeFFeIqUpDpbHjYiQoCc- X-Sonic-MF: X-Sonic-ID: 2fb7f3fc-7926-482f-9b51-91715b2d4535 Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Thu, 28 Mar 2024 01:19:57 +0000 Received: by hermes--production-gq1-5c57879fdf-qprqq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 280c15cbc9d589e27ec802c9967a399f; Thu, 28 Mar 2024 01:19:56 +0000 (UTC) From: Mark Millard Content-Type: multipart/mixed; boundary="Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Re: git: f126890ac538 - main - Import device-tree files from Linux 6.5 Message-Id: <73934947-A2AB-45DA-821F-8209567148D0@yahoo.com> Date: Wed, 27 Mar 2024 18:19:45 -0700 To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3774.400.31) References: <73934947-A2AB-45DA-821F-8209567148D0.ref@yahoo.com> X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.29 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.29)[-0.293]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~,3:~,4:~,5:~,6:~]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.32:from]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.32:from] X-Rspamd-Queue-Id: 4V4m1D1Gnrz4B6P --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dag-Erling_Sm=C3=B8rgrav wrote on Date: Wed, 27 Mar 2024 20:02:18 UTC : > Emmanuel Vadot writes: > > commit f126890ac5386406dadf7c4cfa9566cbb56537c5 > > Merge: 139d114acc7b 309417d444d2 > > Author: Emmanuel Vadot > > AuthorDate: 2024-03-21 20:10:18 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2024-03-21 20:10:18 +0000 > > > > Import device-tree files from Linux 6.5 > >=20 > > Sponsored by: Beckhoff Automation GmbH & Co. KG >=20 > This broke the armv7 build and it's still not fixed, please pay > attention to your Jenkins email. I'm confused. https://ci.freebsd.org/job/FreeBSD-main-armv7-build/ shows: #20314 Sat Mar 23 16:28:10 GMT 2024 . . . #20334 Wed Mar 27 23:26:34 GMT 2024 as all successful builds. Even the older: #20307 Fri Mar 22 08:03:58 GMT 2024 was after the dts related commits and was successful. #20303 .. #20306 are where the dts commits had things broken relative to building. That was: #20303 Thu Mar 21 20:51:55 GMT 2024 . . . #20306 Fri Mar 22 05:39:02 GMT 2024 with the prior successful build being: #20302 Thu Mar 21 18:28:11 GMT 2024 =3D=3D=3D Mark Millard marklmi at yahoo.com --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287 Content-Disposition: inline; filename="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Type: image/png; x-unix-mode=0666; name="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA IGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAE8SURBVHja7JoxbsIw GEZfEBwARqYqEztdGZDgCL0CHRnbI3SkY8/AEeAKuQHKyMrImA5kyIDDH9sVivt9kqXEiZ7y5Dj5 HSWrqopUMyDhSE5ykpOc5CwZNne20ynAFzD3YH0CxZ1+b973+VxEkwNy4MOTtQHe/5gXdFvmAazc 2BfC05z7l3JH4OLJOjr6YvKCHigAr573u+tiYvPMybTkkZzkJCc5yUkugfXcvSx3CytrDPwAq3ob oAT29VovNJ35DyuUDnIr4OCqhCLIdeZrzklOcpKTnOQkl2r51Sh7xobzXDm0HBsBM+AKnGLyLXJv dQstnSx5ickfGEdOc66PcpeU5fZ9FbSO3KReM7W1dQsji9A68/USl5zkJCc5yUlOcpSOMq14Fn8Y WW7C7T+v5rf88ll8/c3Q1/wOAOSFPMys/HPDAAAAAElFTkSuQmCC --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287 Content-Disposition: inline; filename="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Type: image/png; x-unix-mode=0666; name="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA IGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAE8SURBVHja7JoxbsIw GEZfEBwARqYqEztdGZDgCL0CHRnbI3SkY8/AEeAKuQHKyMrImA5kyIDDH9sVivt9kqXEiZ7y5Dj5 HSWrqopUMyDhSE5ykpOc5CwZNne20ynAFzD3YH0CxZ1+b973+VxEkwNy4MOTtQHe/5gXdFvmAazc 2BfC05z7l3JH4OLJOjr6YvKCHigAr573u+tiYvPMybTkkZzkJCc5yUkugfXcvSx3CytrDPwAq3ob oAT29VovNJ35DyuUDnIr4OCqhCLIdeZrzklOcpKTnOQkl2r51Sh7xobzXDm0HBsBM+AKnGLyLXJv dQstnSx5ickfGEdOc66PcpeU5fZ9FbSO3KReM7W1dQsji9A68/USl5zkJCc5yUlOcpSOMq14Fn8Y WW7C7T+v5rf88ll8/c3Q1/wOAOSFPMys/HPDAAAAAElFTkSuQmCC --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287 Content-Disposition: inline; filename="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Type: image/png; x-unix-mode=0666; name="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA IGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAE8SURBVHja7JoxbsIw GEZfEBwARqYqEztdGZDgCL0CHRnbI3SkY8/AEeAKuQHKyMrImA5kyIDDH9sVivt9kqXEiZ7y5Dj5 HSWrqopUMyDhSE5ykpOc5CwZNne20ynAFzD3YH0CxZ1+b973+VxEkwNy4MOTtQHe/5gXdFvmAazc 2BfC05z7l3JH4OLJOjr6YvKCHigAr573u+tiYvPMybTkkZzkJCc5yUkugfXcvSx3CytrDPwAq3ob oAT29VovNJ35DyuUDnIr4OCqhCLIdeZrzklOcpKTnOQkl2r51Sh7xobzXDm0HBsBM+AKnGLyLXJv dQstnSx5ickfGEdOc66PcpeU5fZ9FbSO3KReM7W1dQsji9A68/USl5zkJCc5yUlOcpSOMq14Fn8Y WW7C7T+v5rf88ll8/c3Q1/wOAOSFPMys/HPDAAAAAElFTkSuQmCC --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287 Content-Disposition: inline; filename="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Type: image/png; x-unix-mode=0666; name="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA IGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAE8SURBVHja7JoxbsIw GEZfEBwARqYqEztdGZDgCL0CHRnbI3SkY8/AEeAKuQHKyMrImA5kyIDDH9sVivt9kqXEiZ7y5Dj5 HSWrqopUMyDhSE5ykpOc5CwZNne20ynAFzD3YH0CxZ1+b973+VxEkwNy4MOTtQHe/5gXdFvmAazc 2BfC05z7l3JH4OLJOjr6YvKCHigAr573u+tiYvPMybTkkZzkJCc5yUkugfXcvSx3CytrDPwAq3ob oAT29VovNJ35DyuUDnIr4OCqhCLIdeZrzklOcpKTnOQkl2r51Sh7xobzXDm0HBsBM+AKnGLyLXJv dQstnSx5ickfGEdOc66PcpeU5fZ9FbSO3KReM7W1dQsji9A68/USl5zkJCc5yUlOcpSOMq14Fn8Y WW7C7T+v5rf88ll8/c3Q1/wOAOSFPMys/HPDAAAAAElFTkSuQmCC --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287 Content-Disposition: inline; filename="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Type: image/png; x-unix-mode=0666; name="Trigger SCMTriggerCause : Started by an SCM change.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA IGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAE8SURBVHja7JoxbsIw GEZfEBwARqYqEztdGZDgCL0CHRnbI3SkY8/AEeAKuQHKyMrImA5kyIDDH9sVivt9kqXEiZ7y5Dj5 HSWrqopUMyDhSE5ykpOc5CwZNne20ynAFzD3YH0CxZ1+b973+VxEkwNy4MOTtQHe/5gXdFvmAazc 2BfC05z7l3JH4OLJOjr6YvKCHigAr573u+tiYvPMybTkkZzkJCc5yUkugfXcvSx3CytrDPwAq3ob oAT29VovNJ35DyuUDnIr4OCqhCLIdeZrzklOcpKTnOQkl2r51Sh7xobzXDm0HBsBM+AKnGLyLXJv dQstnSx5ickfGEdOc66PcpeU5fZ9FbSO3KReM7W1dQsji9A68/USl5zkJCc5yUlOcpSOMq14Fn8Y WW7C7T+v5rf88ll8/c3Q1/wOAOSFPMys/HPDAAAAAElFTkSuQmCC --Apple-Mail=_053FD3DD-6CCF-4FC5-B883-F2A2A0149287-- From nobody Thu Mar 28 06:27:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4trV1Q4lz5GK0D; Thu, 28 Mar 2024 06:27: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 4V4trT6qhJz4cxr; Thu, 28 Mar 2024 06:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711607274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aca9w2ggq5qNyqN4tyiVkODAfiza1Vu5gR9rHzOJgNQ=; b=OCFeUMLBCbhKMIFjPHz1zMWyrpYAMZ8jwehVYjkEBp+uXQ+HuwF3CPDYysafvY01jiisjF XAZpXSWsG4N2FxDDczi9XKr9EVjJfgUcjs64zSmwRiD4cjNJJHylLLCc+phHXBUdFzDhKn o5mpdIkG9KxbfJF+SS8TeFrpErQrFn13ujfcdjO0JyNvoW6I/fP8wWV2vGQrP7SD5MGga+ IrLcccsKmGLT0fYuWSDxvjWht4EtL3czWZh+2YWdaQi2u4hExmqNKCzDxC5z1c5yiAxPOX zpbGxWVCjtNW2F92Uzd/+NhImqwGj810oBKGfP6WkeSl7T0Fpk+wP+wje1RzuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711607274; a=rsa-sha256; cv=none; b=v1pvdmk9m6btH+iz7cGgDDZGT/ynHKhs7eAjQNXAlIBB9W8Jp58Tr/tmmIh8vtZQp7bRyG CAPKOu7TIXj7COf1dFmkpfJhTj2xZ1Zyv7gCAGZm4urZhtViqKGvOod+hitt6uGdvr85S0 +zyHpHvF6kmDkY9gjepNUzw3495Ow9FkpRCYG4LG008FUYKgFUgOi4/2nGD8wT/vlzEiPT Ax7QkOgmgY0/rqZqXhzWbd6r/gocKnxr4Rr4r60Qg6afmK0/L4vs5pYb/C72oijDWeotbW SXkeTzLI0Lxm+Pp4TJzCCUgRZLbHoCoBapFbA4WKGuoPF4++kEv48c/ZrWxW0A== 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=1711607274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aca9w2ggq5qNyqN4tyiVkODAfiza1Vu5gR9rHzOJgNQ=; b=Lmu+bZMhIcnKezwrqaCdINobrp8I8ycAiCJopjqX4HHsC+VHono4SFtYhuPjCC1LOKH91Z XJXNiQJ6ZpesgyOday9w70iWe4/ETTLhN2NlM7K/AcSNnbnYnc3XfEThiqaz/1dJsvD40F /8YZGFXyTC1Qd4MiPursJ9C7wfOYhRorgjq062v5IIpA4QYYiO/SSxx/sYCMWvvNYo0hto qs11KtT234RMekvainQCFZRry5g2dwlftW58VzNXZeD1GOkXqepN79hFf/AZ7C/BDJc7sQ rVYVdPpvPHWYJUeHqxQJMjpUYyzhW9gwVflQuF0lOUrehhsTBDU9Tqw5SKSdeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V4trT6K1KzGpT; Thu, 28 Mar 2024 06:27:53 +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 42S6RrwD034415; Thu, 28 Mar 2024 06:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42S6RrEl034412; Thu, 28 Mar 2024 06:27:53 GMT (envelope-from git) Date: Thu, 28 Mar 2024 06:27:53 GMT Message-Id: <202403280627.42S6RrEl034412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: fb393d22c9fd - main - arm: Remove TI from NOTES List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb393d22c9fd1d53da559ecc6e67e1322fb08a38 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=fb393d22c9fd1d53da559ecc6e67e1322fb08a38 commit fb393d22c9fd1d53da559ecc6e67e1322fb08a38 Author: Emmanuel Vadot AuthorDate: 2024-03-28 06:27:10 +0000 Commit: Emmanuel Vadot CommitDate: 2024-03-28 06:27:10 +0000 arm: Remove TI from NOTES TI support was removed so remove it from NOTES too. Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/arm/conf/NOTES | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/arm/conf/NOTES b/sys/arm/conf/NOTES index 994cf9a59b5e..1eecd2534977 100644 --- a/sys/arm/conf/NOTES +++ b/sys/arm/conf/NOTES @@ -87,15 +87,12 @@ nodevice mps # Build SOC-specific modules... makeoptions MODULES_EXTRA+="allwinner" -makeoptions MODULES_EXTRA+="arm_ti" makeoptions MODULES_EXTRA+="imx" # Build dtb files... makeoptions MODULES_EXTRA+="dtb/allwinner" -makeoptions MODULES_EXTRA+="dtb/am335x" makeoptions MODULES_EXTRA+="dtb/imx6" makeoptions MODULES_EXTRA+="dtb/nvidia" -makeoptions MODULES_EXTRA+="dtb/omap4" makeoptions MODULES_EXTRA+="dtb/rpi" makeoptions MODULES_EXTRA+="dtb/zynq" From nobody Thu Mar 28 10:15:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V4ztn5532z5FVPn for ; Thu, 28 Mar 2024 10:15:13 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V4ztn4StYz4Fwb; Thu, 28 Mar 2024 10:15:13 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711620913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gG87FPOeTxCgdd9C+TBMCBfvzgyGybLsmLJAoDRZrsw=; b=BZ9ZiusKWF4jqQO6Z59efmMczjBa8TeBr6esOjxqnPbMWUFh3LQ38CUgD7ARJK6mi/F6+h URcS/ZkSW7bmAphEfHFhUmzpJu0X/Z7NAL+Cz5aurLx4qPhG/Oz7xywOB7WXT1f37xoaeq I9vOUPahrfJxqrBdCZiQOJE8rDdP/+pt2RQ+1iQac9KMVt2uU7a1NHaFy+2Iv8DAEOCgxY cmbPIciqRAj1H8NFHcBfP2KfLD4LCvoMaOOE8uRS0hDQ719qePhNpw24rX048r8OmABeOU 8aEO5+rmKxSzWBZsWLPWyhUWkt5BqUJoHvQa0hqpI/XV01tJEFTOavSAha1MRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711620913; a=rsa-sha256; cv=none; b=JbpSZuW87x/7GBG29Ii2r6XW06oW5rgKsh4J54bEY0ooUiAKphqRgqtT02Za53Y74zS6Y3 TIMhWyehhjIgwaCEAsnnNZrQNgsWXGNxwuGzwSxKt/odn+16hsK1pIBZ2a/HXwBWJFYlxt pE9gcpPARKlwhEMe4LdN7AThrScg26V+KH61eGW7BPUwmwcpLf9pEaTTrUqD29v0iPHA1R lo78MGHoKh0HQz4LUmQGFWQOCly9JWJ1x7PugYr5EYk4znz7Fp0sX8PsNlFL+Ts493uRhT QHXpjH2p27vnwQHe0YF+k6PtiZmUCq3cFLsMj08aln/n27jzHXT5Gl1Kyx/Myg== 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=1711620913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gG87FPOeTxCgdd9C+TBMCBfvzgyGybLsmLJAoDRZrsw=; b=YrIh2TH4kfp8v1ZGZjAS/iX3kQpjsWHP+CgRqOW35ej7D3YBSQdWy8BwDo/AbdQ/dwoSWx sODVP1udTUwX7ANNFH03wFjp2jJYlyl9qTpuP2bz9k7qIH6yxWy4KrKW4sCguQ4RvZu4cF bh7pVChd7YEVmWl3aJs0W/wWmv+t3Yjel4Iv7ueZtpj7GnyonDtkTV07qWDp3x2M6K+iTl t4+3ESM9UAoIx9w+JnSu+0VPbAehAlKBaZIqR6IArsQ1amlAT9GkS6HPQC4XRxVI8dB9vP 9LWt2hvxAXjKzzYzTjGlASuacT6uWiwcLCdcIOTs9cEbkLPdANRByh3/M9OjJw== Received: from ltc.des.dev (2a02-8428-0993-f001-922e-16ff-fef1-acef.rev.sfr.net [IPv6:2a02:8428:993:f001:922e:16ff:fef1:acef]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4V4ztn3J4Bz18BZ; Thu, 28 Mar 2024 10:15:13 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 46D74424; Thu, 28 Mar 2024 11:15:11 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark Millard Cc: dev-commits-src-main@freebsd.org Subject: Re: git: f126890ac538 - main - Import device-tree files from Linux 6.5 In-Reply-To: <73934947-A2AB-45DA-821F-8209567148D0@yahoo.com> (Mark Millard's message of "Wed, 27 Mar 2024 18:19:45 -0700") References: <73934947-A2AB-45DA-821F-8209567148D0.ref@yahoo.com> <73934947-A2AB-45DA-821F-8209567148D0@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Thu, 28 Mar 2024 11:15:11 +0100 Message-ID: <86o7aybr2o.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark Millard writes: > Dag-Erling_Sm=C3=B8rgrav writes: > > This broke the armv7 build and it's still not fixed, please pay > > attention to your Jenkins email. > I'm confused. https://ci.freebsd.org/job/FreeBSD-main-armv7-build/ > shows: LINT was still broken as of 280085ef0c9d: =3D=3D=3D> dtb/am335x (all) [Creating objdir /tmp/obj/workspace/src/arm.armv7/sys/LINT/modules/work= space/src/sys/modules/dtb/am335x...] make[4]: make[4]: don't know how to make am335x-bone.dts. Stop =20=20=20=20 make[4]: stopped in /workspace/src/sys/modules/dtb/am335x cf. https://ci.freebsd.org/job/FreeBSD-main-armv7-LINT/7934/console It was fixed four hours ago by fb393d22c9fd. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Thu Mar 28 11:56:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V528C1qTyz5Fj4j; Thu, 28 Mar 2024 11:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V528C1HbNz4STW; Thu, 28 Mar 2024 11:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711627019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hd8VntiloEEGmi+kwbNSii8oexml2//e58cMu46Pqtk=; b=WXWPMR/44smZYVVuMMfCGibXIfqbpvyQrCrimXH3AS32AJgzHjWvCy+BD2yJJ0kWERgniX QNSjLGmsM2C0J8jFBiDn5n4+HpifxwnKhy+XBlgjdl3/PK4atAd87eYZ/ZiiCj8MOce8k5 hxNpQHrf15p6jLknFyorjOzSuJY+iGXWxU+jGidT1nNoJjg1J8pjsNLwiN0cvOcOm3KwIE Yk83wYfKf7mvoI7eCsuTZuCUw+MzAt1q5LED8NK0HhEg5hdhd5RO9O8H+5ymRB5EyMXLOt VkXoaidrDlULD3esMigjNE6ezTE29CV2SObaP++/n+pjOM9zorbeZ8GgUTae1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711627019; a=rsa-sha256; cv=none; b=xdQXTGKxWh1AQKWNztq8AswKDJyrQlEGD3Ii0frmmFnoLdmTubfNmFjzKum0dtdQqcsfXb RzZMX5lY2cJH7wF96IsHNld6pXdRbnVhpb5HggQT7NO0dfbxhNt02YWV3cWgP9WL3q8czX VrN5KYiIdBvjoA4Mt0tFE6/q12+fRC1n9MzPXhCUS547cqrszEJqgshfWckR1Ouqp7zh3y tmgbdfKBHhhjA4mU0k4E7AcoOlIUkjZ9R9AaOLZJzVUNSHvuYBLYU1DR/YCxzAypcVStmx m9BQe4sxTSE9MvZCmU2kZzaOLIE01WV4UNub6BXymBs66La6Frg8Ms/ffLFo/g== 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=1711627019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hd8VntiloEEGmi+kwbNSii8oexml2//e58cMu46Pqtk=; b=jomYVUCOCFWZ8utZRKnucQiAYYPrNlBnLWApTv4sJM7T70jMe6+0RTnpOeEXC2H1UwvcM/ GNBwZmYQ66Qw0UGi/74xmrGAie8J/jAzVjegsZwRwzojgybJtjmbYmu+BFuL8aBuSBzr8E +hUTB30ZsxCJMVALxUMZbsEEJ/VKRm4ZFJz2Z0gEpZ8AsF2K9Icors2EKZ1FdoQujfF+wP K7sQ9vAk3uQDKoyNP40BIvTdFTdp2azk9Vi9e98UMh1BS4Y8FhXmdFjr+0h+VXX+4AZ5+d 4UlrXpe9L7BmqfZ8xns37MVAI26gozZn+z3IkdAdraVyYVCx6ZZ9lDtCCnfPWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V528C0DnDzR2w; Thu, 28 Mar 2024 11:56:59 +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 42SBuwSL092571; Thu, 28 Mar 2024 11:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SBuwsN092568; Thu, 28 Mar 2024 11:56:58 GMT (envelope-from git) Date: Thu, 28 Mar 2024 11:56:58 GMT Message-Id: <202403281156.42SBuwsN092568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1c091d11261a - main - x86: handle MXCSR from XSAVEOPT when x87 state was optimized List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c091d11261a3c8cc3728b92760e65242c0f5949 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1c091d11261a3c8cc3728b92760e65242c0f5949 commit 1c091d11261a3c8cc3728b92760e65242c0f5949 Author: Konstantin Belousov AuthorDate: 2024-03-27 11:01:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-28 11:56:21 +0000 x86: handle MXCSR from XSAVEOPT when x87 state was optimized PR: 275322 Reported by: Cheyenne Wills Reviewed by: emaste, jhb, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44522 --- 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 dcc6ff1a03a8..ebc8b869b368 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -850,7 +850,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(); @@ -881,10 +884,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 16ad7a96ab35..0334aedd740b 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -975,8 +975,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); @@ -1019,10 +1022,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 Thu Mar 28 12:13:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V52W16Plyz5Fl95; Thu, 28 Mar 2024 12:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V52W15w5xz4VJH; Thu, 28 Mar 2024 12:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711627997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zDuBaP1HMPAZHiIzWeIK2tkDZ6TDosLZ7+ebw5ho/2I=; b=oH0r/tp0LwIvUXhfFy0+IwjpRhv82WZIHRPvsZPWBhlX49ds6zr1rOXgFALKAI5IEhkwoZ yfqg84hkwh7++d1GyAzMuJRmfxIWDMXTAEKLcqBbHKohJb2ktlJtibKHYgES2Sw7CxB1Zp +5InduIzFm5Xf1TRrxGior8cbecCTAyYdP09DT4eYBMWMc8/wjnZDWLR3etv+mFdkWcT49 v5xBG1HQOFgTARtq2/c74mD2IYTrQpyTA9IUzVCq5cDTttS30L0nwCxf+8kWcyEou8p2Ga 18x3NkvTv/eqU3dICwRpJyjYSp0r/mgLiIL/T7UvH1N0QpBUOHsaZ7x4+4oAYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711627997; a=rsa-sha256; cv=none; b=j/LxL1wAddpqmD4yURZBB0vbrvsAoI9ylguSiCVAu9hRKQ45UKN1jyfKbRy0dbbouSY2to +Ij4gpdHdY1kKqwapFIBf3Fucyms5EyYJ9F14NjDn0hYjzocrqx6TZKBKvnVau70dAVvRb eaJGnburfKh1AJ/iTRnKtCa4HHuarcyuUxcEaqSCuhl328PcIfo3f0GdVoOYwefcRQilOb LcqlH87ub0gdIHpBNEjfjbrKhVrkTI6sVh9mAtUH1VweqbV9t7RURU8Cbyen8wGVSeHOo6 9XpVyGX4ADJkwP9EuC4/xdMbX9QeWhzFUF3Wc5bwfXgDfy46aBtgtTXvYXARSw== 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=1711627997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zDuBaP1HMPAZHiIzWeIK2tkDZ6TDosLZ7+ebw5ho/2I=; b=eXlOcKmzQS0Ly4jsu7fHxV86ljz+yelTydab5wfAQbfCWKz69zWHYdgYCjCy7kyCg1xm/r qaRHNdMpu4ghaEDhA9loHyb4eKt/V3P/pPK4HWgo7o4SSUIkux4oKmWxfNFRlGHgnyyY5D znCN4hmiZLDA78nnZmhHkmKGcGgdgSXYu2ChHjDJhHpy7JpB9xQxESfAdWk7+3lgZvLPr8 k4TcW1Jt/dUrNHRrZxZAtK1HfpkywSYT29S+Br/7gKHo1QCSr0s6FMjdNNg2vmtn/fzmlW 8bHObreOlT3GK4jJeO8X3PsC4aRiZ0vT0d0PQiY7TuKwk1pXFsRHrZXicG4gUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V52W15D3QzRpC; Thu, 28 Mar 2024 12:13: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 42SCDHIK025955; Thu, 28 Mar 2024 12:13:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SCDH2P025953; Thu, 28 Mar 2024 12:13:17 GMT (envelope-from git) Date: Thu, 28 Mar 2024 12:13:17 GMT Message-Id: <202403281213.42SCDH2P025953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: b7b78c1c169d - main - Optimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7b78c1c169dd2213b4cb3e14e19c045b2c5e5af Auto-Submitted: auto-generated The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=b7b78c1c169dd2213b4cb3e14e19c045b2c5e5af commit b7b78c1c169dd2213b4cb3e14e19c045b2c5e5af Author: Randall Stewart AuthorDate: 2024-03-28 12:12:37 +0000 Commit: Randall Stewart CommitDate: 2024-03-28 12:12:37 +0000 Optimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold HPTS inserts a softclock for system call return that optimizes performance. However when no HPTS threads need the help (i.e. when they have less than 100 or so connections) then there should be little work done i.e. check the counter and return instead of running through all the threads getting locks etc.ptimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold. Reported by: eduardo Reviewed by: gallatin, glebius, tuexen Tested by: gallatin Differential Revision: https://reviews.freebsd.org/D44420 --- sys/kern/subr_trap.c | 2 ++ sys/netinet/tcp_hpts.c | 10 +++++++++- sys/sys/systm.h | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index e9a16cd0b36e..18388ae5f232 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -74,6 +74,8 @@ #include #endif +volatile uint32_t __read_frequently hpts_that_need_softclock = 0; + void (*tcp_hpts_softclock)(void); /* diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 8c4d2d41a3eb..222f8e0229dd 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -193,7 +193,8 @@ struct tcp_hpts_entry { uint8_t p_direct_wake :1, /* boolean */ p_on_min_sleep:1, /* boolean */ p_hpts_wake_scheduled:1, /* boolean */ - p_avail:5; + hit_callout_thresh:1, + p_avail:4; uint8_t p_fill[3]; /* Fill to 32 bits */ /* Cache line 0x40 */ struct hptsh { @@ -1683,6 +1684,13 @@ tcp_hpts_thread(void *ctx) ticks_ran = tcp_hptsi(hpts, 1); tv.tv_sec = 0; tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_SLOT; + if ((hpts->p_on_queue_cnt > conn_cnt_thresh) && (hpts->hit_callout_thresh == 0)) { + hpts->hit_callout_thresh = 1; + atomic_add_int(&hpts_that_need_softclock, 1); + } else if ((hpts->p_on_queue_cnt <= conn_cnt_thresh) && (hpts->hit_callout_thresh == 1)) { + hpts->hit_callout_thresh = 0; + atomic_subtract_int(&hpts_that_need_softclock, 1); + } if (hpts->p_on_queue_cnt >= conn_cnt_thresh) { if(hpts->p_direct_wake == 0) { /* diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 435e6b61c904..6c2b466c4cfe 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -400,8 +400,10 @@ extern int cpu_disable_c2_sleep; extern int cpu_disable_c3_sleep; extern void (*tcp_hpts_softclock)(void); +extern volatile uint32_t __read_frequently hpts_that_need_softclock; + #define tcp_hpts_softclock() do { \ - if (tcp_hpts_softclock != NULL) \ + if (hpts_that_need_softclock > 0) \ tcp_hpts_softclock(); \ } while (0) From nobody Thu Mar 28 14:09:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V555d3Fxtz5Fxsq; Thu, 28 Mar 2024 14:09: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 4V555d2lHgz4hFq; Thu, 28 Mar 2024 14:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711634997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9dQVWRlYIB6F7K9N9/10A4HMZ1Gp+5UenoG3qrd220=; b=DsbDCmjJ0wL+du3SBxs2GuDCu1ljfw9ccrKOJC7WCmfhPbNExJyiJOU7iIrRTAWEVL7G/a JRVVowKY+DYxS9kDvM8wDr2hBfXsQiSpmPVmjmFtruSrHtn3la+Ztm4A/pgicoXD8TFbgD vWtMSoQuWxRuhjUsw5vfAVibN3A4SjP5Kqs5gVEyPbhRX7DhsAth24uvu8iaqISLIdJsaA EJlfwQQCL/21KWyAHzgAf999kTy9pg0PNNlBdPbDsvVTOeCAmt3px7tZAEznpt0vIVxTW4 5K6R/r8ioTsha16wXxKTGj01oQexHCsw0XFVot14ux8pFeooev3fbBJdy4pAuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711634997; a=rsa-sha256; cv=none; b=XBzpvq7Vk1MQHtiDnjrXOOIb15Tr2yeZkF+9yxNoSAisl2H/TFb396nUwkksHEO82b3vg7 jcyJJEfkhn5gVg3WKVdMfr40Fx6nyzaNAlXTQIxO5+DNqeNebTC/lkw9MFvmURbNM3jjAF 39v6ogXsHYMvWo2zdHREoBIf2UqWo1+0qKdEeOgQDUoTD0OVWnqPTETw9O6n1qOsmenUz/ QC9qaYXCgdvl2eFIWx0j/E0KNkUHUl4kYPykpOL8genkPzIXp/20QAVbqShr6u2F/7pejH AHG751H0+lqUJSArITfFSGdp04q1V2miYke/R3bGavAWmHuY4odT8ssnsKEZmg== 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=1711634997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9dQVWRlYIB6F7K9N9/10A4HMZ1Gp+5UenoG3qrd220=; b=wg47kPSuhlelCZ5f9zkFvzYj0aSsOwYcTqygexOWC5bD+Mx3juaLohJve5F8ohlN6kNjlE oR+M5G3r8Yt3PG2DIzFGzzZXP5770xQ83vjHLL6s+Wm7FmwKWFlT69yZ6eXqOlAFYNjvch fzRjJrSyLL5WdPpP8vUZY7q1X6kFNpGNrhK4H4y8mHTzQ7VVEK/RY+r/a96DcVkGbXmsRr QPIldqiHiJc0YYLpoOd8HkEmDXqDqsFLSmlgPBqRpqMoPvIc5MihMmYttzPzZ9Nh7Jt1pb N8yxqxpWW5/jKwi9zAN9dBC/wNc2dxZaY4hsvM17NksHJjIT9eK6yGtJC0RlVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V555d2K28zWRm; Thu, 28 Mar 2024 14:09: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 42SE9vSt013477; Thu, 28 Mar 2024 14:09:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SE9vR7013474; Thu, 28 Mar 2024 14:09:57 GMT (envelope-from git) Date: Thu, 28 Mar 2024 14:09:57 GMT Message-Id: <202403281409.42SE9vR7013474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 5aaef5a60084 - main - cp: Fix grammar in comment. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5aaef5a6008419d0945699dfdb5ce1daffecd21d Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5aaef5a6008419d0945699dfdb5ce1daffecd21d commit 5aaef5a6008419d0945699dfdb5ce1daffecd21d Author: Dag-Erling Smørgrav AuthorDate: 2024-03-28 14:06:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-28 14:09:45 +0000 cp: Fix grammar in comment. This reverts commit 416fdc2d71656e2f0b4a16828fb0c736ae32b74a. --- bin/cp/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 4d77dfe3feed..14d1cc2a3f75 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -340,7 +340,7 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) * noexist/dir/foo (where foo is a file in dir), which * is the case where the target exists. * - * Also, check for "..". This is for the correct path + * Also, check for "..". This is for correct path * concatenation for paths ending in "..", e.g. * cp -R .. /tmp * Paths ending in ".." are changed to ".". This is From nobody Thu Mar 28 16:06:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V57hK5yxxz5GCSW; Thu, 28 Mar 2024 16:06: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 4V57hK4Cklz3xMM; Thu, 28 Mar 2024 16:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711642001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMgplaYofM1q/CzS0aboAGcU1s9M3qw6MRSArQ46+QU=; b=v3r5uTV3CtiJQ3hlBIJltNySWj7bpzasPBmvbWLw4q+siS5QygHJRGqhoRQKc1RfhXM3Av Fl+qkOMl3rnMxEfHTS1gPtQoNFKdTDcqhDfLP3nOLO7AnV0WFx3B7y5m/Wk7SyWgrBeBPZ 7LL0zbAwkj8cezCb4zsj++V27PS4SlPsOjVBlctJtEefA1Yvh4GQxhCpbADN3fmUWPMSGJ dviGLqfgq9T/6m3ZQ+hp+8TOGusKGkR9dHD0kG9fTkytfXKaGltTJJxnw3Msawm44FLXZO /pEQvmN4toN2aol8+3S0QprImz1ub7+d4TxQDguo84/Xm3wR+IumGC5h1hcA7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711642001; a=rsa-sha256; cv=none; b=ctvociZywACLWfPaF+nl3M0UWSpdTJBrimWNkZ5TIvAde3Y7xdx7vGpkJx4U5c5rq87oN3 +fsRyBhWtd0X8ZX0fc2Y9xGn3zLICVNTPjss6+Msi89yZjPNvbkQ4trGBHQ+oqG0RuMmZy OtTDhItsdxREnGUXXZjaxNAr4TozxFUujh05T7lSXz7ORle1DiiR1WVhsJss+ZuYFEYLXr cy/9qdqpNyuDTLOVbT1S5h/iXOwPH8zWZFXA+rES1MoNfdcNPZzlnw18d5jtwVzWIq6BtF 476OD8TjuFDsjzrftXZz9nczwEEgX8VGD0H5IkaJlxcvbQw/b8eEjp0XtDxTlQ== 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=1711642001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMgplaYofM1q/CzS0aboAGcU1s9M3qw6MRSArQ46+QU=; b=MAzjcfYeEBVt3NKtHsmrT7pGYn5R35qNUHWR2ARP6ZaNCQ2dYEVG3Dg10+Ao9nTDrOjgS8 xfmQMXHgKtRkdI6upb3NL6Nv5heGsB6Ocqsp+lHAhiy8Sp8oTNqVlo1tJuYfL/+s+4UY7T O0W/SRKxGvtmG0CiASw7ltAOn/pMLRBq5bk+Q6WQyeSjFyzt1j8fTxi7U4DS9uEuqUbhqq ahZNEaoZRRmoCpz42RsSZCSTj4dBZY3zBmxiEiBV2IGjez/P2W4W64hN19hfTYcM3lUXXh Ib+fp5732CGWack/uneSbbxtJBP8XQzwp9gLD9tRiFoMuKuaoKFT9fpLDALRKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V57hK3pMVzZSt; Thu, 28 Mar 2024 16:06: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 42SG6feL015991; Thu, 28 Mar 2024 16:06:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SG6fYM015988; Thu, 28 Mar 2024 16:06:41 GMT (envelope-from git) Date: Thu, 28 Mar 2024 16:06:41 GMT Message-Id: <202403281606.42SG6fYM015988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a983cea4e9a8 - main - pf: fix reply-to after rdr and dummynet List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a983cea4e9a8dcd52cfd6a3141d7aa03306b057b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a983cea4e9a8dcd52cfd6a3141d7aa03306b057b commit a983cea4e9a8dcd52cfd6a3141d7aa03306b057b Author: Kristof Provost AuthorDate: 2024-03-27 14:47:21 +0000 Commit: Kristof Provost CommitDate: 2024-03-28 16:06:01 +0000 pf: fix reply-to after rdr and dummynet If we redirect a packet to localhost and it gets dummynet'd it may be re-injected later (e.g. when delayed) which means it will be passed through ip_input() again. ip_input() will then reject the packet because it's directed to the loopback address, but did not arrive on a loopback interface. Fix this by having pf set the rcvif to V_iflo if we redirect to loopback. See also: https://redmine.pfsense.org/issues/15363 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 12 ++++++++ tests/sys/netpfil/pf/route_to.sh | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 50dc67b72439..4cec0936539e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7954,6 +7954,18 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, sizeof(struct sockaddr_in6)); } + if (s != NULL && s->nat_rule.ptr != NULL && + s->nat_rule.ptr->action == PF_RDR && + ((pd->af == AF_INET && IN_LOOPBACK(ntohl(pd->dst->v4.s_addr))) || + (pd->af == AF_INET6 && IN6_IS_ADDR_LOOPBACK(&pd->dst->v6)))) { + /* + * If we're redirecting to loopback mark this packet + * as being local. Otherwise it might get dropped + * if dummynet re-injects. + */ + (*m0)->m_pkthdr.rcvif = V_loif; + } + if (pf_pdesc_to_dnflow(pd, r, s, &dnflow)) { pd->pf_mtag->flags |= PF_MTAG_FLAG_DUMMYNET; pd->pf_mtag->flags |= PF_MTAG_FLAG_DUMMYNETED; diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 44fe6786e896..df95eaecc12e 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -626,6 +626,66 @@ ifbound_reply_to_v6_cleanup() pft_cleanup } +atf_test_case "ifbound_reply_to_rdr_dummynet" "cleanup" +ifbound_reply_to_rdr_dummynet_head() +{ + atf_set descr 'Test that reply-to states bind to the expected non-default-route interface after rdr and dummynet' + atf_set require.user root +} + +ifbound_reply_to_rdr_dummynet_body() +{ + dummynet_init + + j="route_to:ifbound_reply_to_rdr_dummynet" + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + ifconfig ${epair_one}b inet 192.0.2.2/24 up + ifconfig ${epair_two}b up + + vnet_mkjail $j ${epair_one}a ${epair_two}a + jexec $j ifconfig lo0 inet 127.0.0.1/8 up + jexec $j ifconfig ${epair_one}a 192.0.2.1/24 up + jexec $j ifconfig ${epair_two}a 198.51.100.1/24 up + jexec $j route add default 198.51.100.254 + + jexec $j pfctl -e + jexec $j dnctl pipe 1 config delay 1 + pft_set_rules $j \ + "set state-policy if-bound" \ + "rdr on ${epair_one}a proto icmp from any to 192.0.2.1 -> 127.0.0.1" \ + "rdr on ${epair_two}a proto icmp from any to 198.51.100.1 -> 127.0.0.1" \ + "match in on ${epair_one}a inet all dnpipe (1, 1)" \ + "pass in on ${epair_one}a reply-to (${epair_one}a 192.0.2.2) inet from any to 127.0.0.1 keep state" + + atf_check -s exit:0 -o ignore \ + ping -c 3 192.0.2.1 + + atf_check -s exit:0 \ + ${common_dir}/pft_ping.py \ + --to 192.0.2.1 \ + --from 203.0.113.2 \ + --sendif ${epair_one}b \ + --replyif ${epair_one}b + + # pft_ping uses the same ID every time, so this will look like more traffic in the same state + atf_check -s exit:0 \ + ${common_dir}/pft_ping.py \ + --to 192.0.2.1 \ + --from 203.0.113.2 \ + --sendif ${epair_one}b \ + --replyif ${epair_one}b + + jexec $j pfctl -sr -vv + jexec $j pfctl -ss -vv +} + +ifbound_reply_to_rdr_dummynet_cleanup() +{ + pft_cleanup +} + atf_test_case "dummynet_frag" "cleanup" dummynet_frag_head() { @@ -740,6 +800,7 @@ atf_init_test_cases() atf_add_test_case "ifbound_v6" atf_add_test_case "ifbound_reply_to" atf_add_test_case "ifbound_reply_to_v6" + atf_add_test_case "ifbound_reply_to_rdr_dummynet" atf_add_test_case "dummynet_frag" atf_add_test_case "dummynet_double" } From nobody Thu Mar 28 18:09:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5BQQ39x3z5GQlH; Thu, 28 Mar 2024 18:09: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 4V5BQQ1g6nz4D96; Thu, 28 Mar 2024 18:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711649390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gmcSdJV4/eTEsnFnm7D9A/AIwXEbEXdr9YErPqrKph4=; b=D7dfE5UTzipONBfcTrAHiJn0GP5n58j81NbrfFyjw23b9DQXVjRguCMPly5kNvbIlGb5ft sOLAz/x7+EOiSDcRnfNqpWgSLZ/4V3caeiZeAdww2c2dfp9i3o6z4ftRIX3yL8OLSUV+5F QUMERHM32xcx5dIbNOp6s8tzvDg8QOetmRtd1WX7RRQWyXLzekbfu17JRzyReEs16qr88c /Kq11a3Hzv8Mdgw23iuWkr5LvXzq6G70y2BwPTa9N8whuGygyWtVaTZuO7XunV6QWa5c3Z EarOI0S77jPsyFc7IMRNHlfHsPFW8rnwBT99ROZJouMoRqKvknqRpp2Gf+JRKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711649390; a=rsa-sha256; cv=none; b=d/DeycCET9wH8GdoUU1OPBBLD+BOnyz2m9pyPuKzg8SUfF5oFLsTZmQ771CM9jjcbcyKI2 q3qHFO1SjMpsQ2kBMYcgsSNdQ/SSzwoUZ1V9tAQrPx7FMW8a6kAv9g8NfEskjlSxjL6YcQ slLQYNFQrY6NySdZAJxj3Hy/GXjl6/jvHKO9eurHX3vl894czcuZpGzDFZuJeXLruUjIdJ s9BUuloP78Yc3JixoobomR1w4HKYru95KnCpgwp63TTOwYuI2DKt/b7sOQsbIIR4PHZK8P FEpPOOR0LYdZPrQM0qvS4aqWQ0jFhq6cbLaL76apXxufHnPjAVDxezdcPo9MVw== 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=1711649390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gmcSdJV4/eTEsnFnm7D9A/AIwXEbEXdr9YErPqrKph4=; b=kd3e4tfzbdj2sbw0RK1HKGFP39dEya15AUBd7q2MBa2zi/vhITE7jvy3o4c1TFkfaK50XS fu3frT9ASF36qird66bHu5gOvOplXjvD2Jm8swgKzEkSJ3vU8SY2o3bYAqrNk/YRV38fTA /232T1XapUPdOvsda1JdSU2XAJpjY1QdeA6T+rEQbRWUPM/qslsVaSNVOtp0gr9PUiAZ2p VYlx1aFn3iLSucIYZ2sMFGairVqlJQcYkXqn84NdwVlyDvhE7WKS4lubugH4edsyvhOEob XokUD0vMSkatTvFXJOla9fjt7qahU28Lgfc3zMwUlaa3mLAzGo9A7e8HGn2OYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5BQQ18NyzdnW; Thu, 28 Mar 2024 18:09: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 42SI9oHo021347; Thu, 28 Mar 2024 18:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SI9ovv021344; Thu, 28 Mar 2024 18:09:50 GMT (envelope-from git) Date: Thu, 28 Mar 2024 18:09:50 GMT Message-Id: <202403281809.42SI9ovv021344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: fe429e6794d3 - main - stand/efi: Changes to efichar to allow it to be used in the kernel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe429e6794d322636e7c1e520d50ec0cb711dd14 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=fe429e6794d322636e7c1e520d50ec0cb711dd14 commit fe429e6794d322636e7c1e520d50ec0cb711dd14 Author: Stephen J. Kiernan AuthorDate: 2024-03-27 22:37:48 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-28 18:09:37 +0000 stand/efi: Changes to efichar to allow it to be used in the kernel Replace malloc/free with EFICHAR_MALLOC and EFICHAR_FREEE macros. Obtained from: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44541 --- stand/efi/include/efichar.h | 8 ++++++++ stand/efi/libefi/efichar.c | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/stand/efi/include/efichar.h b/stand/efi/include/efichar.h index 4460f5efdcef..0a40906aeedf 100644 --- a/stand/efi/include/efichar.h +++ b/stand/efi/include/efichar.h @@ -37,4 +37,12 @@ int ucs2_to_utf8(const efi_char *, char **); int utf8_to_ucs2(const char *, efi_char **, size_t *); int ucs2len(const efi_char *); +#ifdef _KERNEL +#define EFICHAR_MALLOC(sz) malloc((sz), M_TEMP, M_WAITOK | M_ZERO) +#define EFICHAR_FREE(sz) free((sz), M_TEMP) +#else +#define EFICHAR_MALLOC(sz) malloc(sz) +#define EFICHAR_FREE(sz) free(sz) +#endif + #endif /* _BOOT_EFI_EFICHAR_H_ */ diff --git a/stand/efi/libefi/efichar.c b/stand/efi/libefi/efichar.c index 86642d325754..659212799b6a 100644 --- a/stand/efi/libefi/efichar.c +++ b/stand/efi/libefi/efichar.c @@ -25,14 +25,21 @@ */ #include +#ifndef _KERNEL #include +#endif #ifdef _STANDALONE #include #else +#ifdef _KERNEL +#include +#include +#else #include #include #include #include +#endif #include #include #endif @@ -87,7 +94,7 @@ ucs2_to_utf8(const efi_char *nm, char **name) if (*name != NULL) cp = *name; else - cp = *name = malloc(sz); + cp = *name = EFICHAR_MALLOC(sz); if (*name == NULL) return (ENOMEM); @@ -114,7 +121,7 @@ ucs2_to_utf8(const efi_char *nm, char **name) if (len >= sz) { /* Absent bugs, we'll never return EOVERFLOW */ if (freeit) { - free(*name); + EFICHAR_FREE(*name); *name = NULL; } return (EOVERFLOW); @@ -135,7 +142,7 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len) sz = strlen(name) * 2 + 2; if (*nmp == NULL) - *nmp = malloc(sz); + *nmp = EFICHAR_MALLOC(sz); if (*nmp == NULL) return (ENOMEM); nm = *nmp; @@ -183,7 +190,7 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len) } if (sz < 2) { if (freeit) { - free(nm); + EFICHAR_FREE(nm); *nmp = NULL; } return (EDOOFUS); @@ -194,7 +201,7 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len) return (0); ilseq: if (freeit) { - free(nm); + EFICHAR_FREE(nm); *nmp = NULL; } return (EILSEQ); From nobody Thu Mar 28 18:13:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5BVJ612Hz5GR6j; Thu, 28 Mar 2024 18:13: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 4V5BVJ4Dzfz4Dyd; Thu, 28 Mar 2024 18:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711649592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nd8J5gwYKl6ElcFmYUSfp+7bdPSK2KqKfTFD8+gDmTw=; b=rC/rXhJbPsNWPoH0UQS0NqpudjIOtVFtYZqrE9l7VL/cv/WK7kO7Etr1Hq6q+oYIrt+5u9 D6RSLCkQ8K1MEMdh9CXjV7VzBf2n48g/IFXV0L6bjY2xle3xBkPeYps2FZ90EtkJfea0um 2N3rnXmzBMeNPjCmkuo/QP4sz8QYV1GB9uN/9RtCp6dBs2E9lgZdAdKRVaxw3wWzq2Pedc iEQAtOuyiiLeqsa+PJ3LRsi8uaXKtd4uX/Ihuo3c077Egpj4Wi8mUfCk7t88YhXOq9QsDA Vp+R4tWnW+zlDDY2wKdO3JZTOrsIZL2dUu4zQDyAQ+UwZlsOgJIpGvysTNz4pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711649592; a=rsa-sha256; cv=none; b=mr/t7NfDJTlF4R36EIQkk6Oe3hA957Q7uv1TR74xfV0doVfdW4JHek3kUJwQDbR21g9Oq9 +ypqvSAz5dHjPmU8PEnHbHbzzCdrnTPQM6o3nXYLi2L1f6imd+FA2RtGwOVBlMPTM5mvT0 mT1eQ/OLBiki48tWu0z1CSDOtRdUc/iFuwKTiQWjEPFGoD00vK5+54/KyfhSBJiS6+/RYL W6bWtV6vQcoz/YWa3VzdHwPGyj1gPApFBLJorVFVQd5zTn7rLAfEBSEfIcx4xlMNAsmNHT HjKZGv5tSvRhn6017EW9lyjd+gbMvREI3XBtdj8niNKiC/xFN8lKh40rlhuAzQ== 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=1711649592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nd8J5gwYKl6ElcFmYUSfp+7bdPSK2KqKfTFD8+gDmTw=; b=oOcpZfbJ5R4+pNGrI2HyPp5BHcc3GUtrXBGk4/yjJJQqJsIf7IxdttOJ5hBSPbYxldGNae mi6Upqwrko/c4rvG0oNahzc61S7IdVyx2WS23wz5C1xVn4YH4qHMqc+69kQxkMZ58TQTuN OdruXvwrjTjLaHKKdvPJwcLwm1HD3qBiAwT2y1ixBuKsmp+AWJgVfuFV7vZvc1YvBZXVMJ n0juKeVHGBEHkg7UrpKi8pa4MM0XGeS5cvYUs/7gDtXdQcD1ju6IBniAlf5xKWnz4lJCQX rxdD/UvOMSpHtbb/SrkL4j3hIuKFGETjxiVaqxvc21gga6ysbG2+9FGQeTXpQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5BVJ3rgPzdL0; Thu, 28 Mar 2024 18:13: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 42SIDC5K037103; Thu, 28 Mar 2024 18:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SIDCil037100; Thu, 28 Mar 2024 18:13:12 GMT (envelope-from git) Date: Thu, 28 Mar 2024 18:13:12 GMT Message-Id: <202403281813.42SIDCil037100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 2aee804c9ef0 - main - kerneldump: Add flag to indicate kernel core was successfully dumped List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2aee804c9ef02b2ffa3e35037ea45f43e1709d2f Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=2aee804c9ef02b2ffa3e35037ea45f43e1709d2f commit 2aee804c9ef02b2ffa3e35037ea45f43e1709d2f Author: Stephen J. Kiernan AuthorDate: 2024-03-27 22:55:21 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-28 18:11:16 +0000 kerneldump: Add flag to indicate kernel core was successfully dumped This allows for shutdown_final EVENTHANDLERs to know that a core dump successfully occurred. Embedded systems may want to record this fact or act on it. Obtained from: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44542 --- sys/kern/kern_shutdown.c | 5 ++++- sys/sys/conf.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index f49e315a503d..b0a3c3fa9e91 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -229,6 +229,7 @@ bool scheduler_stopped __read_frequently; int dumping __read_mostly; /* system is dumping */ int rebooting __read_mostly; /* system is rebooting */ +bool dumped_core __read_mostly; /* system successfully dumped core */ /* * Used to serialize between sysctl kern.shutdown.dumpdevname and list * modifications via ioctl. @@ -415,8 +416,10 @@ doadump(boolean_t textdump) TAILQ_FOREACH(di, &dumper_configs, di_next) { error = dumpsys(di); - if (error == 0) + if (error == 0) { + dumped_core = true; break; + } } } diff --git a/sys/sys/conf.h b/sys/sys/conf.h index f34fd43cfe24..8470f53e0408 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -358,6 +358,7 @@ struct dumperinfo { }; extern int dumping; /* system is dumping */ +extern bool dumped_core; /* system successfully dumped kernel core */ /* * Save registers for later extraction from a kernel dump. From nobody Thu Mar 28 19:34:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5DHs3kjFz5Fr1Z; Thu, 28 Mar 2024 19:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5DHs0HjZz4RgV; Thu, 28 Mar 2024 19:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711654457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IopQ/6BaDvSrf0PZbvAzHuiU0JLqH0TDhg3Noi7gRPE=; b=nisTJX+osPV7jUT8k+iL8v8phkQfRzX7lzJhRHMN38Adul02/PZ2SZNaJnoTykrelphdzV BIWMpqtJlm0SS1uTeELAv5WgdG0NmlDY9viaLpLJgS67zM6NLoFMcdkOR1iW/o4QOeQI4v mE9P9ddf9cG8Q7KwXqAVrHzVu582t0sRvg93U2Ffz0cTUD9uTrfhcOKo3YM3MEqucBNN6I LpM1s3X7AdiFDZseUECTrr/rhEG8ICXeYVQErGZesIhah4ofnjXL9/uDd9XGwQrAjEvUhZ yyJAFn8vpzR6v4A1zD/L8jMzrA26EBlE8eHuu6q9tCVjLUWYaAiEJ9ZEl8Luww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711654457; a=rsa-sha256; cv=none; b=aeuj7N7ZK4V6hVsLRwlVf/aJJnjoeOvJ1ohzH+LR1nPx0ZAQwT5m8pVnf6u7Cg0dCIF8pP +Xl2k8DsHOXn0NYfnmNKJHftjbZyPZA42DYVZKx7Hv+aWHYqgi+hnc+z0wBG3xCxJHbtr+ njAhTITjJ94f/iGKXm8pFgK6+P/QxkHYfttT6E9za6rwsoDhwEcvC5N9R5ZTZJDFgUgAcT rrOkbtZ5MPEohbSEmVstajFRIWS3GmPlY1lJC3gUGVREsvDH19mjpkHqFGr6egDxwg6oSG IYl/PXQ0LMFRiywmMYzrPyCxn9h2UNhX7IeBY8p96sDYyu2Xzh8NbHgQvEIVEw== 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=1711654457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IopQ/6BaDvSrf0PZbvAzHuiU0JLqH0TDhg3Noi7gRPE=; b=ihrCi7NmhVyIkLmoVa29GOVfbahNQmgfK53SAUDbFH0MyY89nxfMdCVwaMzhiP0vG0nyRb FOhY3nmCZrBMSlheDeH4fN61locZj00fz4p+fzj6+G1AB2xVx0U9H3bIwJ46DFov90EEpL n5DTbiBNmla6wz1/KqhhQOIKZQ+nMUXC/UQ6eg62cRemvVHPlP/5yZlvAKYQcJdy2IHH4P mvWS8oq3P43DS97ZRJmDYhQQl284081NACh6ZuLBqoMcmjPqowJYdHmRQz652Zx1NTaxwy 9xytSpUM5vrZ8y+1MB8wIOzByNc/w7x9/C2jL6xDXjoyv1a1RvO6s+7+hQxLDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5DHr72BpzgTp; Thu, 28 Mar 2024 19:34: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 42SJYGxX071920; Thu, 28 Mar 2024 19:34:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SJYGi4071917; Thu, 28 Mar 2024 19:34:16 GMT (envelope-from git) Date: Thu, 28 Mar 2024 19:34:16 GMT Message-Id: <202403281934.42SJYGi4071917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 637e67e03290 - main - ddb: Drop obsolete -FreeBSD identifier from license List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 637e67e0329058c86353dbe523740e34d8fefd11 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=637e67e0329058c86353dbe523740e34d8fefd11 commit 637e67e0329058c86353dbe523740e34d8fefd11 Author: Bojan Novković AuthorDate: 2024-03-28 19:32:52 +0000 Commit: Bojan Novković CommitDate: 2024-03-28 19:32:52 +0000 ddb: Drop obsolete -FreeBSD identifier from license Reported by: jrtc27 Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing") Approved by: markj (mentor) --- sys/ddb/db_ctf.c | 2 +- sys/ddb/db_ctf.h | 2 +- sys/ddb/db_pprint.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/ddb/db_ctf.c b/sys/ddb/db_ctf.c index 03145064885c..56a6086849e9 100644 --- a/sys/ddb/db_ctf.c +++ b/sys/ddb/db_ctf.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2023 Bojan Novković * diff --git a/sys/ddb/db_ctf.h b/sys/ddb/db_ctf.h index 6da5f76b6cf6..c4c977cb8205 100644 --- a/sys/ddb/db_ctf.h +++ b/sys/ddb/db_ctf.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2023 Bojan Novković * diff --git a/sys/ddb/db_pprint.c b/sys/ddb/db_pprint.c index aae3d698e8ec..8aa14550f068 100644 --- a/sys/ddb/db_pprint.c +++ b/sys/ddb/db_pprint.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2022 Bojan Novković * From nobody Thu Mar 28 19:38:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5DN91KLpz5Frb5; Thu, 28 Mar 2024 19:38: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 4V5DN90s6Wz4TkL; Thu, 28 Mar 2024 19:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711654681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KsBkVFoCfPJaWJKwTLZhC76GHCSJmU1OuQyiJcaQo4U=; b=iWxMtMwj1soYkfE/T/CTPu+2O2WYAYqIoqvU1DJ4oVwr+ixfnGhivLSvPIohxdRR3Gd0pE 91Mq+82/2DP9syCAONATmMPYVgtwloVxHerMsX2x3bd27wIolTZE/OEC/1rDOFZJNO5E9B 7cnHCC2a0onge69kSzSAx4pdGKzWWB+V/mClHiMT1W5UlDb5U8lFbYXQgzqg+1Vhu0aHue 4DGciXzKFc0lDgck6egedrSDgFYIdpxe3LWOJxR5Cg92pRmkgNaEdUmTEXsEv5Yyv+bVBK 9UTqWWn/iLRX1JoTR0kOm1XL0QbzCYGy7U/1PrJYBLMvgEvx84N+RFmchx0YNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711654681; a=rsa-sha256; cv=none; b=cCCHRyPAqMziIJ1IC+K62EJeoFwQx+/gyNEX0yZ+nMj7bCvlu4/CFceb31psPGXvaRxfb8 IT5U7oPS7wdVpt+6OCQmRUVmgY8WQrHuJvJr9jQA+tA3XKPlcdj3FfV3LrNyrIkUT2Nxim iLmZecfRZ3V+LhaJXMLlIyyIUGwEw+LzNFbFy7oWzysOHPQJYr+ZSFwRnM7XGQHPpnnK8x RBiK7hu9BSvvHLFLujwhk+JY4ZsRpAbi19ZErwR/iF7wUwc7K8QVlZCLH/b7/6DtWxesEV xE2qEpjxFe2Y4Nk4JJQqFCn9td5GnMoVO8V3ByEoMlMrRV4wmsH19WxMD7mnSw== 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=1711654681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KsBkVFoCfPJaWJKwTLZhC76GHCSJmU1OuQyiJcaQo4U=; b=ce8umDw/essIBrvbONgKAtIkuCncyhSvXyWtFIdtf+L61ePK8pz7vjUlyyq4wsoGxKtoO5 vEov+FRITw8fAgcaZxiZLW8mCAYeGoqC8heQUBXDJPl68fjnV2BYwAfsDMkt22M28ldC8F I9CFrvLqoOkMzUBaj07HgLeTYkz1NUPcxrcC8L1MV5OZrb5wceMp2MntNQcAWbMwbZYhrS FWoIDVLCIpNhhJfcN+38zoGF2bZXWyRaH35HdqDT3eRCtQhg0DpqJ5EBk5DeXDNnqlzVZO j5ghlODIUSUV9e0RWrTQGPlulF8bJjmNkXUCU60vvy2D2F0lZBJD33aGVPWoJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5DN90SWDzgpk; Thu, 28 Mar 2024 19:38: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 42SJc0VG072928; Thu, 28 Mar 2024 19:38:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SJc07N072925; Thu, 28 Mar 2024 19:38:00 GMT (envelope-from git) Date: Thu, 28 Mar 2024 19:38:00 GMT Message-Id: <202403281938.42SJc07N072925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 722b8e3cb62b - main - Fix style nits in kern_linker.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 722b8e3cb62bd3e43035527e08fe058d5046901d Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=722b8e3cb62bd3e43035527e08fe058d5046901d commit 722b8e3cb62bd3e43035527e08fe058d5046901d Author: Bojan Novković AuthorDate: 2024-03-28 19:36:30 +0000 Commit: Bojan Novković CommitDate: 2024-03-28 19:36:30 +0000 Fix style nits in kern_linker.c Reported by: jrtc27 Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing") Approved by: markj (mentor) --- sys/kern/link_elf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index dddead849dc9..b08c19f3c018 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -147,7 +147,6 @@ static int link_elf_lookup_debug_symbol(linker_file_t, const char *, c_linker_sym_t *); static int link_elf_lookup_debug_symbol_ctf(linker_file_t lf, const char *name, c_linker_sym_t *sym, linker_ctf_t *lc); - static int link_elf_symbol_values(linker_file_t, c_linker_sym_t, linker_symval_t *); static int link_elf_debug_symbol_values(linker_file_t, c_linker_sym_t, From nobody Thu Mar 28 21:13:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5GVt1t51z5G2y0; Thu, 28 Mar 2024 21:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5GVt1QdKz4fqC; Thu, 28 Mar 2024 21:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711660438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LYuCxDZnru6vRraWfu5BEhN+6lM2rEtobd3KwT3q5L4=; b=ilqpbzZG3XkAIOFeEuJdRKMeNYN6emExdSBmGjfN3izpA5/PWg66dgEnGoCybVaLrsCRFa 2DV7tDD3pNKWrA1lduFK5KB3gOKqYsHnqn95zeUGsKdRmoyV4Dr6q0mS78zCwqb4PuOJxN h/3ffTVqlYoVgK3mDusR3aDvkStQOkqXAx7KMCxbnZESm58UbeOj6Gl/227JzDQlW/iZh5 GbsPsSYkaFcHSAewho9Vqsu4URtoYv/guDkx8evToMXZif2E062ad+ecrHbQC7pHIN85X8 n8WaV/VgN3xM/8qlGO93NE2jvsUBIJXvkNQou4ZJx0UCXjdMc2E9X9tKfnaarQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711660438; a=rsa-sha256; cv=none; b=nu+3S9sqeVtb/J92z8i3fakSd8PmdncZ/IGirnNlufHYeQ4+MxQVus2+TfjgeKcbAO7mA5 5jMAbhj5ANd4FAHPsj5Z7FiPDwnTxsml9JwqZ3Biv6b6hImdGnwIe+lzkHLh/GfGHLp5Ug iTl985zBUwOW4WhpYKyBc2HgJq74zo26hgpR9xpZiqBmAIg/IyOXVvxhorKDeafHq0blZT xp0LAjLCu7D8yn+/qT4YyntLlDg+yfnAHMRTyxxmIs/15YfJkvB+cGWHDa7wZ9NcEl+ykD abPHgwfcoWVqRK7DGNZXcdU/Xq/hgeUe8Y4ql07mQLwct7a+ZE7XSNsHYQpuGA== 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=1711660438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LYuCxDZnru6vRraWfu5BEhN+6lM2rEtobd3KwT3q5L4=; b=AvtP2mQyxZuw8t/PliY+zxDyOZaukqorBZjGur+2DDIxdLFka2fnluzwlksVOOM7rBoJ3T pmKA9MgJ2U7K39rP7kDh8rKCN/9GXOnAntMYP7WapAVM1FOPqgsb9XV+Eozz8Zy2uz2luj ZIkFBCJhXKQM4LR36N6tChK1DZbuuNIigYwPg0zIK1bQQ/qeYDi74GlepqS8iLBsszcaKR Q1FsZSdjl1oRXMzVivw6xvj/NpBJolzVX8aZr6r4HRjr4Rumg4vEK1qatbAPagao+q8/7o IVbpGofqptu6eKEUk8UY4vCLzACSs73v7I0M7nM3q0JZbIMjcEYZiW5shSIuLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5GVt121VzkRL; Thu, 28 Mar 2024 21:13:58 +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 42SLDwR1043079; Thu, 28 Mar 2024 21:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SLDwFc043077; Thu, 28 Mar 2024 21:13:58 GMT (envelope-from git) Date: Thu, 28 Mar 2024 21:13:58 GMT Message-Id: <202403282113.42SLDwFc043077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1bfe195143ff - main - pfilctl: fix 'pfilctl hooks' when nothing is connected List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bfe195143ffb6832ac6702e281964541554fcb3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1bfe195143ffb6832ac6702e281964541554fcb3 commit 1bfe195143ffb6832ac6702e281964541554fcb3 Author: Gleb Smirnoff AuthorDate: 2024-03-28 21:10:15 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-28 21:10:15 +0000 pfilctl: fix 'pfilctl hooks' when nothing is connected The 'hooks' command actually worked accidentially until now. It used PFILIOC_LISTHEADS to determine current number of hooks. This worked when at least one head had a hook connected to it. --- sbin/pfilctl/pfilctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfilctl/pfilctl.c b/sbin/pfilctl/pfilctl.c index 268f5a8d0e70..1af2190072b6 100644 --- a/sbin/pfilctl/pfilctl.c +++ b/sbin/pfilctl/pfilctl.c @@ -150,8 +150,8 @@ listhooks(int argc __unused, char *argv[] __unused) u_int nhooks, i; plh.pio_nhooks = 0; - if (ioctl(dev, PFILIOC_LISTHEADS, &plh) != 0) - err(1, "ioctl(PFILIOC_LISTHEADS)"); + if (ioctl(dev, PFILIOC_LISTHOOKS, &plh) != 0) + err(1, "ioctl(PFILIOC_LISTHOOKS)"); retry: plh.pio_hooks = calloc(plh.pio_nhooks, sizeof(struct pfilioc_hook)); if (plh.pio_hooks == NULL) From nobody Thu Mar 28 21:13:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5GVv2dy7z5G3P7; Thu, 28 Mar 2024 21:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5GVv26Znz4fgT; Thu, 28 Mar 2024 21:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711660439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q+/45JxNU5yA1CTqjpUvnt4Ma7LMLXw9vBUbH24RVGI=; b=UxKRUUQI/Kn3cqxUEAEi+tTipcnLcJGjjp6DwcWdrxnEzwO/Ef0g/dEYRInEkLowldNMdk zY6zVJSF3QfxU/oDveeWg3ljKnCN74iwb9tpXSU/uF6TpesyBckhsgS2CcSfu37GPEeKqI yPv9a37KohbMCaEI2VLN6KGqUaUtsuYMi2FyOVtWrqEWVkrqbKqPTZ3CvLN9F1HTM0MbR1 wmg5uszNP1zpnqwyrraV+/xG7L7I2OsqW+6meUIFcyQusaoZEzwRvPw9mq/21tJcEB7uvj BciAJrwxOsIr9svHuuM91xxx/7CnEh2ARgXnRZC6t3fgYJcxJPOg0levVNx5bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711660439; a=rsa-sha256; cv=none; b=RXwSzLAff+r7PDvmiP1UiuGk93S3pnFNsgwKNxKFvuQg04qYBdzZ0Y5a5x0lDJujBbby35 VSIwOjrPbJIoUNcbT6vH2p/I0bHoG/v6GkcZt7tFAGoh7N/DlBdKN4i3HVllKwtCIbqVtZ wSFpTzxF7UId0aSvR4ulvkOfEQjqRPtWrG0s924AyHepI36DxXOrBYmnmXgTjaRS2mA9sr H0Js8lFtxB6Xq4a5EIeAApkazZYnddcCfNyN/wGnoeqa5GwOXHzQS8DUICMUR0f4o8l/Wu aQ6CYj8wtBfy0x+VNKPbG3ThRMpim2hnUq8dBkYztd8fvnIm3scDFCytk0r+IQ== 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=1711660439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q+/45JxNU5yA1CTqjpUvnt4Ma7LMLXw9vBUbH24RVGI=; b=LsWfc3Vwhk+dsQ9vWA6KXysgkK5b2iWVVW8Z6uAy77X4/0E9J9L/mtsaPlOKhV55AJPQHD 5CXLUZ4+RcM/vddL74s/b6I6e36TsLRdcx2TyO+lNTwsAlyqrdaIraV/e8u4is/8W7/iAf pArvUNgcW2sar/xblkzTpCPvKCYmb4FkJm9LENh7r3Of6VI66/hj+IH8MZB8cBUHPCj4uY AJ2TKzTpyOdsvgGo2zHhYxx9EKB+SSa1NfP2IhHL4iiNac2BIqqkYl2djagUv407WcArBk N9/aFlMiiUur+jibNHvDmFK5sQ5jOQ97cFD9hon7OdsEU82Bq4SBOp1Mpjy0lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5GVv1kDgzjl7; Thu, 28 Mar 2024 21:13:59 +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 42SLDxKU043128; Thu, 28 Mar 2024 21:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SLDxIx043125; Thu, 28 Mar 2024 21:13:59 GMT (envelope-from git) Date: Thu, 28 Mar 2024 21:13:59 GMT Message-Id: <202403282113.42SLDxIx043125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3f2b9607756d - main - vtnet: set VNET context in RX handler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f2b9607756d0f92ca29c844db0718b313a06634 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3f2b9607756d0f92ca29c844db0718b313a06634 commit 3f2b9607756d0f92ca29c844db0718b313a06634 Author: Gleb Smirnoff AuthorDate: 2024-03-28 21:12:39 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-28 21:12:39 +0000 vtnet: set VNET context in RX handler The context is required for NIC-level pfil(9) filtering. --- sys/dev/virtio/network/if_vtnet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 1c731b496f12..5b854ad6cbb7 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -2086,6 +2086,7 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) VTNET_RXQ_LOCK_ASSERT(rxq); + CURVNET_SET_QUIET(if_getvnet(ifp)); while (count-- > 0) { struct mbuf *m; uint32_t len, nbufs, adjsz; @@ -2179,6 +2180,7 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) #endif virtqueue_notify(vq); } + CURVNET_RESTORE(); return (count > 0 ? 0 : EAGAIN); } From nobody Fri Mar 29 07:13:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5WpF4tdQz5Ff88; Fri, 29 Mar 2024 07:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5WpF48fSz4YcK; Fri, 29 Mar 2024 07:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711696389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=raTo3d3ZRIeEyZqElK/V3aRPTks0U9Wbgm1bCtwROG0=; b=gQP/TONaLkqp8etIeG7RikFiY+dKkPmA1GUE3tKSdRViOVD/LLJHNE1gp8C+kqPDescWY5 hZVuDkY1PSYODsTsq5PTeYzYmf9axfVATXkDlswmf6m98Kay//hWP2gLHidmn0gDNy43L5 04XorJlbuSOvnY0EekE3x4IQvBlx4fDZnAFuMgKGB4xOHjrTX1Rt5GtWT9OKRntVwUiJCF cDpKJGIqwYLUWgc6qUmPdW+4nHW6olGsrTsKlvrSQhlEqYs04/00RCgxrkccGzWmZGQwm9 I0OJmehCA5kJR2plDMFvWLYuKpKeNhV2PJReXF0e7tUeZXnGjlVrhVlrAKG6lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711696389; a=rsa-sha256; cv=none; b=bBQ4kv55bs2PcggSXRGsY0tBTAIHRSU27pTRgXrWt9SE0tBvTO2IWALvyqTiMK7QART8sc tiG+7v1Zc+azvciSOgsHANm4OoOQMyKHPX4YSZYx3oZ4fWTGlmfHactcas0K6rEiLp1df1 yNCflRNrrtUpgyNdFwvZ5/+9guevZ/7njQQclWwmYFQgSy5bnYuaHxcTuyDyfMni3P1VS5 Ovfu4362V+v0ieWAlGOZZa5oPQUUaJOLvFgshoS2ZyNg3mBT5G2jMdz1GXZu7RvRj53pVJ qmzZiqpsI3f/iHQ2sBoWfGlAEQnX86kbgjoNKmNkigduyMyPEpmInhKWH/NuZQ== 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=1711696389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=raTo3d3ZRIeEyZqElK/V3aRPTks0U9Wbgm1bCtwROG0=; b=FUtrNgcJWNwOrFgQbR9Sal6Uw98adqboMlBautcDQYwwtPLoP5ybLxe8/0KPym/GyiLRvp e/d1KcqiT++T1nCcfMdmG3itzQYxPjRspOMnNgNfbHLVQnQVTyKFJWuBS4Fv0cdl8mdVHQ dPdhSTL/Qbn7SsLu0h27FWiTf+Wsp2hYObx0/YdDFsBWzKdfO6bEZs3/9rFuE0Umgd1xAM H47Vcmh5Mcx+6tp/XNWL3kJ6zMO0wa2v4Eh04q0E7z8bWOtSy6A7aLiApFDcwbSXvoip4Q IgeGsk+eLBl6gCeU2XO8DZRGQyGlZfwE6VpGREG1FMgw0LS5pB9UorUHp1P8FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5WpF3k2mz11wr; Fri, 29 Mar 2024 07:13:09 +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 42T7D9E3060875; Fri, 29 Mar 2024 07:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42T7D9d3060872; Fri, 29 Mar 2024 07:13:09 GMT (envelope-from git) Date: Fri, 29 Mar 2024 07:13:09 GMT Message-Id: <202403290713.42T7D9d3060872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 6baddb6b1176 - main - release.sh: Don't install git if already present List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 6baddb6b117664f51e2b1d2427fced946913a08f Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6baddb6b117664f51e2b1d2427fced946913a08f commit 6baddb6b117664f51e2b1d2427fced946913a08f Author: Colin Percival AuthorDate: 2024-03-29 07:10:50 +0000 Commit: Colin Percival CommitDate: 2024-03-29 07:12:52 +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 --- 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 Fri Mar 29 15:32:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5kty1hB0z5DYJT; Fri, 29 Mar 2024 15:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5kty0Wctz4JmQ; Fri, 29 Mar 2024 15:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711726378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=klXyxP3nqepnLdFTFf/7HL4cvJvjRVjn9PVlCkOAGCs=; b=JQIgwDatFRsRZOWQtM9/gAjfg88/g9fh6sSda7bZ0zCSgjSfOlaks7LpxMWvskM1ibviSp oK8p6uMzRUw+tzURPs4+GLT2XGRu7DDlwsJVJSfvcsEl8BYk/PAZxsMqz/xhCCEKW7nmA+ zprwe4e7qtjkWQMhNpTquJKtVQa27/pXSsJhlMCZM094hxGDluGYaZ+ZBf/ayiFegQJUM6 YfX2vebrhbvYL/3SwTJ4MBmWpNlcl13VPOcPD9gbh2XXJVt3BCC/7AX0oQEKW4E6oqb0dW 4jijwNOMfJkr5mdfgw50XFfB9vPZfU8hsHQXK2zIxRmk9U38F4xyu9GRYJDvvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711726378; a=rsa-sha256; cv=none; b=s3dDZD1Ku1YhJXTKMkuROe7Cm0gj+ocNniC2z1gCFGefJqYouEm0Fsv4fU3103eZG6hDxM FOuqtyszVPecW4Cq5BqNwUbhzRfVDgZJQKLQSY3At8Dbv0mWAHxC8C+t5xIG/Dot+gWnrC hR48/dFfxZyMkWJKqJk/zS/cBMQtWTT92q5vOtk9UV1XxlMPH6xHwYY6QQgF7GF1VdtZmx iq5zvAnWxai/hLn3KRBQWWTigp6bEtCD8o1ch8tdiKsDKHaUdFfAl+VDJkGyPJ9XUel0tS K3fd8mIrVpOXVmsUDNRn1HEcmRnavWeHOjY4joqeHXC8mGppXf/pOoj9I1uoJQ== 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=1711726378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=klXyxP3nqepnLdFTFf/7HL4cvJvjRVjn9PVlCkOAGCs=; b=Y3LS4vW1yBY/OfGH5iZuQhhCzNiKQj1wdWdzcI7O7j941BfuwUFuLzPBwixdea3N6gZQ/d 6LKDbVBqfAzU5wVVnP6kYdT5p6c2Nwl0uvQFYoorCReRq3GL9RyyS+KS8ro/3RgXDXM0oe JNXL8ZN10yxRTZdtRHqWWowtFKk/Foo72pDgRgQbS1rA9NaifbQ/LZ/o+xR9cIOnMo3M2t VjpHiTDJLzLHIYRk2rPIlW8sIlcZVTxOSfAk9Z9RLYLO91aXrQmIr1ZMUUVRtEJcDped6e aGTRDXlhArKkvWL67+7ahLBZ9nByAfLOFMyi9qPOQHrRuP80shTWHMTQVtUkKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5kty06FlzGkC; Fri, 29 Mar 2024 15:32:58 +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 42TFWv7L011310; Fri, 29 Mar 2024 15:32:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TFWvOs011307; Fri, 29 Mar 2024 15:32:57 GMT (envelope-from git) Date: Fri, 29 Mar 2024 15:32:57 GMT Message-Id: <202403291532.42TFWvOs011307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: fba54d0179aa - main - sound: Drain buffer selinfo in sndbuf_free() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fba54d0179aabb3d94211ca80f94fe5b98ac6d3b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=fba54d0179aabb3d94211ca80f94fe5b98ac6d3b commit fba54d0179aabb3d94211ca80f94fe5b98ac6d3b Author: Christos Margiolis AuthorDate: 2024-03-29 15:29:23 +0000 Commit: Christos Margiolis CommitDate: 2024-03-29 15:29:23 +0000 sound: Drain buffer selinfo in sndbuf_free() Prevent a use-after-free in kern_poll() by making sure the buffer's selinfo is drained. This is required for a subsequent patch that implements asynchronous audio device detach. Reported by: KASAN Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44544 --- sys/dev/sound/pcm/buffer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 915c9110f107..afb4b95e357a 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -147,6 +147,7 @@ sndbuf_free(struct snd_dbuf *b) } else free(b->buf, M_DEVBUF); } + seldrain(sndbuf_getsel(b)); b->tmpbuf = NULL; b->shadbuf = NULL; From nobody Fri Mar 29 15:32:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5ktz1vW8z5DYth; Fri, 29 Mar 2024 15:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5ktz1HWjz4JpR; Fri, 29 Mar 2024 15:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711726379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R4sJH9Bad0NHVz+F7iWeGG3iOrvx+94m8vJU86/2aTM=; b=SFbL0iRJExjDGTBX0VvWMJJrP0W+ZQDEgMkV2wVajklOzJo8OWoe+nCveVNpxS3ymJqoCD qBuP8H6ziva1vmhC1bg+VXslDB9rc4RKoOPamm8SAONcjCKadP+2GYsCEiiZDJv9XELsO0 CT42IzLQAEbRnqZo7Dsv1HDUKzOrSZF5tOf3WwafqBEesmgZfDg/TyeK18mDcaHPlaU3uk vJuA6nXjDG1grqFM/6xzDcV/CZrZQJQdu8bOCs1oRzoLlf8d20c8VRIoz9qvtvriFN+xLT ARPySnpkI82xbm+ZRHY406HLgnieLJDZpD6jtPz2x1TAAV8oRFujIyG+QNmQNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711726379; a=rsa-sha256; cv=none; b=MdwLg76t87dcOKs6DNNVIG+zCd8eEayB5jRK644UsQfoH6/iNRrI5kE+FIaA8miRKqSSF3 8SKdY6u3mbejL2aS2FfKSvtaVwabq+dsEPbY6KEhf8no1jt107kANRzb1aLgaBz+/C/FlA Z5DJxh+C0BfwzsVGeDjyB0XsDDBq/xDt2WeBiRh6w+0j8dwUyDtIJvw5Fs6H19wzNiXVyD LYk3ntr3HtS3p+Ybh96FNBHMfs9u4k/bkHD1pdkLdH9J8HUYFuu4krcPCMs1KMom4oh8AF 6pgBf3WslNGPsr0gamWzFW28YJXLMNEUOpkROi6Xup/oosTjjphxIGWmixNfEQ== 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=1711726379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R4sJH9Bad0NHVz+F7iWeGG3iOrvx+94m8vJU86/2aTM=; b=E6650QOWqbnGXV0kW4K6v15WeqD3PLDbwcUoKevKM4WczfuxABHhPMt5DeMHfON90QojHo BkrFP5I1X4x4FTi1u5u4bJ1LWbBvkGdGVW6K0uNwvWlqPo82A32K/RvqZAJV+YyIRVaclL I80cBHqMDr2b7oXyn9o9ruw05s6BW8yfEX+CyH4qj3Y0gSX8IOc/RGf0XJWDJRkx0MjkYC d/h46yXN3lGo/YHHnuPeaL374YuHM+rk4a4W8QGCgyK1tHj5zJjH47IUpQsfBvigsR52CL TYBXdbS+J8UvOpJMrJjcVr2s2jp1XiqR16sYjpuvYN4ngbl6X2F5W1OV9ynQKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5ktz0tmGzGL2; Fri, 29 Mar 2024 15:32:59 +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 42TFWxwS011371; Fri, 29 Mar 2024 15:32:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TFWxsk011368; Fri, 29 Mar 2024 15:32:59 GMT (envelope-from git) Date: Fri, 29 Mar 2024 15:32:59 GMT Message-Id: <202403291532.42TFWxsk011368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 6d1cee1640e1 - main - sound: Get rid of pcm/sndstat.h and turn macros into regular code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d1cee1640e1c360917e483ece5ec1bde423b788 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6d1cee1640e1c360917e483ece5ec1bde423b788 commit 6d1cee1640e1c360917e483ece5ec1bde423b788 Author: Christos Margiolis AuthorDate: 2024-03-29 15:29:43 +0000 Commit: Christos Margiolis CommitDate: 2024-03-29 15:29:43 +0000 sound: Get rid of pcm/sndstat.h and turn macros into regular code There is no reason to have macros for this. Putting the code in sndstat_prepare_pcm() directly makes it easier to work with it. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44545 --- sys/dev/sound/pcm/sndstat.h | 169 -------------------------------------------- sys/dev/sound/pcm/sound.c | 136 +++++++++++++++++++++++++++++++++-- 2 files changed, 132 insertions(+), 173 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.h b/sys/dev/sound/pcm/sndstat.h deleted file mode 100644 index 62722e560a54..000000000000 --- a/sys/dev/sound/pcm/sndstat.h +++ /dev/null @@ -1,169 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007-2009 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SND_SNDSTAT_H_ -#define _SND_SNDSTAT_H_ - -#define SNDSTAT_PREPARE_PCM_ARGS \ - struct sbuf *s, device_t dev, int verbose - -#define SNDSTAT_PREPARE_PCM_BEGIN() do { \ - struct snddev_info *d; \ - struct pcm_channel *c; \ - struct pcm_feeder *f; \ - \ - d = device_get_softc(dev); \ - PCM_BUSYASSERT(d); \ - \ - if (CHN_EMPTY(d, channels.pcm)) { \ - sbuf_printf(s, " (mixer only)"); \ - return (0); \ - } \ - \ - if (verbose < 1) { \ - sbuf_printf(s, " (%s%s%s", \ - d->playcount ? "play" : "", \ - (d->playcount && d->reccount) ? "/" : "", \ - d->reccount ? "rec" : ""); \ - } else { \ - sbuf_printf(s, " (%dp:%dv/%dr:%dv", \ - d->playcount, d->pvchancount, \ - d->reccount, d->rvchancount); \ - } \ - sbuf_printf(s, "%s)%s", \ - ((d->playcount != 0 && d->reccount != 0) && \ - (d->flags & SD_F_SIMPLEX)) ? " simplex" : "", \ - (device_get_unit(dev) == snd_unit) ? " default" : "") - -#define SNDSTAT_PREPARE_PCM_END() \ - if (verbose <= 1) \ - return (0); \ - \ - sbuf_printf(s, "\n\t"); \ - sbuf_printf(s, "snddev flags=0x%b", d->flags, SD_F_BITS); \ - \ - CHN_FOREACH(c, d, channels.pcm) { \ - \ - KASSERT(c->bufhard != NULL && c->bufsoft != NULL, \ - ("hosed pcm channel setup")); \ - \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "%s[%s]: ", \ - (c->parentchannel != NULL) ? \ - c->parentchannel->name : "", c->name); \ - sbuf_printf(s, "spd %d", c->speed); \ - if (c->speed != sndbuf_getspd(c->bufhard)) \ - sbuf_printf(s, "/%d", \ - sndbuf_getspd(c->bufhard)); \ - sbuf_printf(s, ", fmt 0x%08x", c->format); \ - if (c->format != sndbuf_getfmt(c->bufhard)) \ - sbuf_printf(s, "/0x%08x", \ - sndbuf_getfmt(c->bufhard)); \ - sbuf_printf(s, ", flags 0x%08x, 0x%08x", \ - c->flags, c->feederflags); \ - if (c->pid != -1) \ - sbuf_printf(s, ", pid %d (%s)", \ - c->pid, c->comm); \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "interrupts %d, ", c->interrupts); \ - \ - if (c->direction == PCMDIR_REC) \ - sbuf_printf(s, \ - "overruns %d, feed %u, hfree %d, " \ - "sfree %d [b:%d/%d/%d|bs:%d/%d/%d]", \ - c->xruns, c->feedcount, \ - sndbuf_getfree(c->bufhard), \ - sndbuf_getfree(c->bufsoft), \ - sndbuf_getsize(c->bufhard), \ - sndbuf_getblksz(c->bufhard), \ - sndbuf_getblkcnt(c->bufhard), \ - sndbuf_getsize(c->bufsoft), \ - sndbuf_getblksz(c->bufsoft), \ - sndbuf_getblkcnt(c->bufsoft)); \ - else \ - sbuf_printf(s, \ - "underruns %d, feed %u, ready %d " \ - "[b:%d/%d/%d|bs:%d/%d/%d]", \ - c->xruns, c->feedcount, \ - sndbuf_getready(c->bufsoft), \ - sndbuf_getsize(c->bufhard), \ - sndbuf_getblksz(c->bufhard), \ - sndbuf_getblkcnt(c->bufhard), \ - sndbuf_getsize(c->bufsoft), \ - sndbuf_getblksz(c->bufsoft), \ - sndbuf_getblkcnt(c->bufsoft)); \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "channel flags=0x%b", c->flags, \ - CHN_F_BITS); \ - sbuf_printf(s, "\n\t"); \ - \ - sbuf_printf(s, "{%s}", \ - (c->direction == PCMDIR_REC) ? "hardware" : \ - "userland"); \ - sbuf_printf(s, " -> "); \ - f = c->feeder; \ - while (f->source != NULL) \ - f = f->source; \ - while (f != NULL) { \ - sbuf_printf(s, "%s", f->class->name); \ - if (f->desc->type == FEEDER_FORMAT) \ - sbuf_printf(s, "(0x%08x -> 0x%08x)", \ - f->desc->in, f->desc->out); \ - else if (f->desc->type == FEEDER_MATRIX) \ - sbuf_printf(s, "(%d.%d -> %d.%d)", \ - AFMT_CHANNEL(f->desc->in) - \ - AFMT_EXTCHANNEL(f->desc->in), \ - AFMT_EXTCHANNEL(f->desc->in), \ - AFMT_CHANNEL(f->desc->out) - \ - AFMT_EXTCHANNEL(f->desc->out), \ - AFMT_EXTCHANNEL(f->desc->out)); \ - else if (f->desc->type == FEEDER_RATE) \ - sbuf_printf(s, \ - "(0x%08x q:%d %d -> %d)", \ - f->desc->out, \ - FEEDER_GET(f, FEEDRATE_QUALITY), \ - FEEDER_GET(f, FEEDRATE_SRC), \ - FEEDER_GET(f, FEEDRATE_DST)); \ - else \ - sbuf_printf(s, "(0x%08x)", \ - f->desc->out); \ - sbuf_printf(s, " -> "); \ - f = f->parent; \ - } \ - sbuf_printf(s, "{%s}", \ - (c->direction == PCMDIR_REC) ? "userland" : \ - "hardware"); \ - } \ - \ - return (0); \ -} while (0) - -#endif /* !_SND_SNDSTAT_H_ */ diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 186e7b194f27..c03e4fa435e1 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -76,10 +75,139 @@ SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, struct unrhdr *pcmsg_unrhdr = NULL; static int -sndstat_prepare_pcm(SNDSTAT_PREPARE_PCM_ARGS) +sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) { - SNDSTAT_PREPARE_PCM_BEGIN(); - SNDSTAT_PREPARE_PCM_END(); + struct snddev_info *d; + struct pcm_channel *c; + struct pcm_feeder *f; + + d = device_get_softc(dev); + PCM_BUSYASSERT(d); + + if (CHN_EMPTY(d, channels.pcm)) { + sbuf_printf(s, " (mixer only)"); + return (0); + } + + if (verbose < 1) { + sbuf_printf(s, " (%s%s%s", + d->playcount ? "play" : "", + (d->playcount && d->reccount) ? "/" : "", + d->reccount ? "rec" : ""); + } else { + sbuf_printf(s, " (%dp:%dv/%dr:%dv", + d->playcount, d->pvchancount, + d->reccount, d->rvchancount); + } + sbuf_printf(s, "%s)%s", + ((d->playcount != 0 && d->reccount != 0) && + (d->flags & SD_F_SIMPLEX)) ? " simplex" : "", + (device_get_unit(dev) == snd_unit) ? " default" : ""); + + if (verbose <= 1) + return (0); + + sbuf_printf(s, "\n\t"); + sbuf_printf(s, "snddev flags=0x%b", d->flags, SD_F_BITS); + + CHN_FOREACH(c, d, channels.pcm) { + KASSERT(c->bufhard != NULL && c->bufsoft != NULL, + ("hosed pcm channel setup")); + + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "%s[%s]: ", + (c->parentchannel != NULL) ? + c->parentchannel->name : "", c->name); + sbuf_printf(s, "spd %d", c->speed); + if (c->speed != sndbuf_getspd(c->bufhard)) { + sbuf_printf(s, "/%d", + sndbuf_getspd(c->bufhard)); + } + sbuf_printf(s, ", fmt 0x%08x", c->format); + if (c->format != sndbuf_getfmt(c->bufhard)) { + sbuf_printf(s, "/0x%08x", + sndbuf_getfmt(c->bufhard)); + } + sbuf_printf(s, ", flags 0x%08x, 0x%08x", + c->flags, c->feederflags); + if (c->pid != -1) { + sbuf_printf(s, ", pid %d (%s)", + c->pid, c->comm); + } + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "interrupts %d, ", c->interrupts); + + if (c->direction == PCMDIR_REC) { + sbuf_printf(s, + "overruns %d, feed %u, hfree %d, " + "sfree %d [b:%d/%d/%d|bs:%d/%d/%d]", + c->xruns, c->feedcount, + sndbuf_getfree(c->bufhard), + sndbuf_getfree(c->bufsoft), + sndbuf_getsize(c->bufhard), + sndbuf_getblksz(c->bufhard), + sndbuf_getblkcnt(c->bufhard), + sndbuf_getsize(c->bufsoft), + sndbuf_getblksz(c->bufsoft), + sndbuf_getblkcnt(c->bufsoft)); + } else { + sbuf_printf(s, + "underruns %d, feed %u, ready %d " + "[b:%d/%d/%d|bs:%d/%d/%d]", + c->xruns, c->feedcount, + sndbuf_getready(c->bufsoft), + sndbuf_getsize(c->bufhard), + sndbuf_getblksz(c->bufhard), + sndbuf_getblkcnt(c->bufhard), + sndbuf_getsize(c->bufsoft), + sndbuf_getblksz(c->bufsoft), + sndbuf_getblkcnt(c->bufsoft)); + } + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "channel flags=0x%b", c->flags, CHN_F_BITS); + sbuf_printf(s, "\n\t"); + + sbuf_printf(s, "{%s}", + (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + sbuf_printf(s, " -> "); + f = c->feeder; + while (f->source != NULL) + f = f->source; + while (f != NULL) { + sbuf_printf(s, "%s", f->class->name); + if (f->desc->type == FEEDER_FORMAT) { + sbuf_printf(s, "(0x%08x -> 0x%08x)", + f->desc->in, f->desc->out); + } else if (f->desc->type == FEEDER_MATRIX) { + sbuf_printf(s, "(%d.%d -> %d.%d)", + AFMT_CHANNEL(f->desc->in) - + AFMT_EXTCHANNEL(f->desc->in), + AFMT_EXTCHANNEL(f->desc->in), + AFMT_CHANNEL(f->desc->out) - + AFMT_EXTCHANNEL(f->desc->out), + AFMT_EXTCHANNEL(f->desc->out)); + } else if (f->desc->type == FEEDER_RATE) { + sbuf_printf(s, + "(0x%08x q:%d %d -> %d)", + f->desc->out, + FEEDER_GET(f, FEEDRATE_QUALITY), + FEEDER_GET(f, FEEDRATE_SRC), + FEEDER_GET(f, FEEDRATE_DST)); + } else { + sbuf_printf(s, "(0x%08x)", + f->desc->out); + } + sbuf_printf(s, " -> "); + f = f->parent; + } + sbuf_printf(s, "{%s}", + (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + } + + return (0); } void * From nobody Fri Mar 29 15:33:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5kv066qlz5DYwT; Fri, 29 Mar 2024 15:33: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 4V5kv02ZGyz4K8Q; Fri, 29 Mar 2024 15:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711726380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iqSFY19/3sScQv3N1RY0k2fLXuLiNLf7MdyM0F0PGtE=; b=x9N/P2l+YRg5F/09RhjM1XMzjAoFW/o1LrPBzMV5wTULlwh4or1NUVtpOA1oH2bcUwVLDl VlnSliU0sjUNz15h+DsfLkZSyVmWyFWubAbvo3+OHmrgiwK3asxuF7Xh2xy8eDgVENYg03 piwQy/VSFznVL8KGohP4mZRYRLxrF//scJXVttjAnjpSU9rNA1rZ5ynnPqDrQEdDzmkI+D vP2B0WgijWIEKUNnA4DclaUhgG/R5M1Aku4uFkIkOIXOo6o5w3fdGr1AXXqc0WUSKYGA7D iTyAUD7zkAlOlLeIwrOM5XPdut48TfWWIcOKJnVWTLQjkSYwKTrn46Eiped0zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711726380; a=rsa-sha256; cv=none; b=DLrbrnmmg9nwsbm2wp1GtyWIaFGMdgPg8NjFrCOLZ7tCgm6Pw24YzuxIsmUoQp3QSS9h9i 275pYlzzoVde/42gQFU7X39NQPXdm0Pa6deEkmiQwr4WX8eoc6IHP3J8zr66eyGNEj1Opt pnKtOQoGi4CsfVI9RBJzDDbP0426tiBDpBGx/s7tRwNUVmAmRBLd6Yf7Wlnim7pEKQ4BNQ XPhE8SZJZbw0O0sr4+85IwJ2LV4/55kaB1mDmTKXanzL5rS4n6NKD7fMFpv0ICJcobxT7g HNWmyuVDckgU9XAmbTRSmruWw815cGW5rSg5piPgvK06HAaEgcbtaE0FSDfd5g== 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=1711726380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iqSFY19/3sScQv3N1RY0k2fLXuLiNLf7MdyM0F0PGtE=; b=n7uJeshAZQHPRYESKRXOEtummRm7U0Xf4SaEGtcIRU2U8Go+kvosNG/XrULPmWsWux78Cs HXKhJCodnkvYl+nmqsvtGdohBs28H6XQETcpqCrGkOjsHTZhBTLPG5sSIhn8Cu8yMCsDUZ PDJCg9BFx3WxvnVbQ/oRs+RHeL9x4SLRR8VkxsszUiwlMLJlk5dsABvNzozppvUJ5DpZBW jzbQw7UVbKuNoyZik1hG7EY057iSGNO8v53wI8+WUedY73CKRZvwi1WpqE6NgAJuGQ0YRG dqpprqr/1ZFjxH8DS86/vwqy9fnp78dm+BqBp+RYqvC9fGjdLzSRsfouJHLx8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5kv02B4QzGmC; Fri, 29 Mar 2024 15:33: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 42TFX0ih011438; Fri, 29 Mar 2024 15:33:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TFX0Al011435; Fri, 29 Mar 2024 15:33:00 GMT (envelope-from git) Date: Fri, 29 Mar 2024 15:33:00 GMT Message-Id: <202403291533.42TFX0Al011435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: c136e6180e47 - main - sound: Fix SND_DIAGNOSTIC ifdef comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c136e6180e4762c1180d89cd2291fd9a935a721d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c136e6180e4762c1180d89cd2291fd9a935a721d commit c136e6180e4762c1180d89cd2291fd9a935a721d Author: Christos Margiolis AuthorDate: 2024-03-29 15:32:13 +0000 Commit: Christos Margiolis CommitDate: 2024-03-29 15:32:13 +0000 sound: Fix SND_DIAGNOSTIC ifdef comment Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44555 --- sys/dev/sound/pcm/sound.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 4af56a2c411a..0a8144e97c24 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -519,7 +519,7 @@ int sound_oss_card_info(oss_card_info *); mtx_unlock(&Giant); \ } \ } while (0) -#else /* SND_DIAGNOSTIC */ +#else /* !SND_DIAGNOSTIC */ #define PCM_WAIT(x) do { \ PCM_LOCKASSERT(x); \ while ((x)->flags & SD_F_BUSY) \ @@ -590,7 +590,7 @@ int sound_oss_card_info(oss_card_info *); mtx_unlock(&Giant); \ } \ } while (0) -#endif /* !SND_DIAGNOSTIC */ +#endif /* SND_DIAGNOSTIC */ #define PCM_GIANT_LEAVE(x) \ PCM_GIANT_EXIT(x); \ From nobody Fri Mar 29 15:33:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5kv1649xz5DZ7Q; Fri, 29 Mar 2024 15:33: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 4V5kv13dGQz4Jmk; Fri, 29 Mar 2024 15:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711726381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh4asMvNkyoCWPHxKlgoIeRZ+WL2jlGuXOhwFXfBkl8=; b=Q/YmJaRHBvOYoei3bPpmbu0Rlkk0CsxqawM+UcT5Xom6AN57dHI9XkQBpgSxOZxVphRB9b GsMWTsXkdSn1NxKwCko/e2xMAL/Ia5vRNra0XaPciv0aYtEnXFfofju1HYWh5+fJFbwAlh A6C6lb8eqN0RHLoOtZUoytGUYeuPAJRCa8R1t961tgN7Q4orAQey54sLe5In8euBnmBqwN Sludite+yYROHY45IPJe/Cgbq+2fzsk+K8PepLxfoiBD4mZenG4qMlu/xRfW9djbKc7GyC PseU3mlewflg4qFiYshZE8a8MmblsT5jF+/BEmM9CfzhJ1bb/x9GLQQgHrbRZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711726381; a=rsa-sha256; cv=none; b=g7aLEkW0iFvi+ENQlq0TVYxWBrchj9xtzfy5tx2PGnMESaquq8ek1aD5wq/g4HDEilsR6H ESOModHKXXlMxN3+VdGsxnXHgJfDwrgoy+1nLgV4W3slbbDTJDlDS7N71I98ATZc3ePwoE EPqsGgZOggpqL44qP5nNibd2qFizC3rNrvPOUaZZWn3o8497c1lmB2+1IT64qOADbAl/RU 7NYGTPXVJXFFJr4TDDzslx3OPjrk92Iot7xA1VM+7eLzI3MTX6y/rbfTeUDCEBqPjb+JfL 3gVuFv9snMjwOjjpo6tzSp615rDXgmssYA/uj14uiNV6blDbweD+pMFdsS3U7g== 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=1711726381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh4asMvNkyoCWPHxKlgoIeRZ+WL2jlGuXOhwFXfBkl8=; b=LwJZ+996ER43a78cdiMt850JkVXjn3+uLqXKyxlxjlW1kJhNeh9/s2NUCwjm0U2KSzlcQV dIKm/7++vN5kGMgBz5FAe1m/gFcAsQCVqFpvRLbn1ORTJZlMhkV4+4eZTx+FYRWn3PoEyR KCbfNLqDF4s6tNEzW04LeAKZRC4NB6xySkTuMNQ70UG9M/vNdSeqxlfaWSxbqcSjmkkzco uL/kweDaG9TSNvveBsx5535ISXKCpYNEX95BBfxjJLpJgtGTCQRQy95KjEeOLC+I0cawJE naohpxzqoiPllFJZGim+aP/kTOIwR/lX41nPyLGyTYkxjWjELXrCvDIg5lqNyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5kv13BktzGXL; Fri, 29 Mar 2024 15:33: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 42TFX1cC011495; Fri, 29 Mar 2024 15:33:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TFX1xS011492; Fri, 29 Mar 2024 15:33:01 GMT (envelope-from git) Date: Fri, 29 Mar 2024 15:33:01 GMT Message-Id: <202403291533.42TFX1xS011492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: b5e55dbf3574 - main - sound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5e55dbf357472ffa39345b30b8b781e988a440f Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b5e55dbf357472ffa39345b30b8b781e988a440f commit b5e55dbf357472ffa39345b30b8b781e988a440f Author: Christos Margiolis AuthorDate: 2024-03-29 15:32:38 +0000 Commit: Christos Margiolis CommitDate: 2024-03-29 15:32:38 +0000 sound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44554 --- sys/dev/sound/pcm/sound.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 0a8144e97c24..51d1624b2d7e 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -287,9 +287,6 @@ struct snd_mixer; #define SND_DEV_DSP_SPDIFOUT 19 /* /dev/dsp_spdifout */ #define SND_DEV_DSP_SPDIFIN 20 /* /dev/dsp_spdifin */ -#define SND_DEV_LAST SND_DEV_DSP_SPDIFIN -#define SND_DEV_MAX PCMMAXDEV - #define DSP_DEFAULT_SPEED 8000 #define ON 1 From nobody Fri Mar 29 16:00:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5lVQ5VpPz5DcVw; Fri, 29 Mar 2024 16:00: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 4V5lVQ4DC7z4PLD; Fri, 29 Mar 2024 16:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711728014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6W70uoRngkNF2hLptxImwsjqR60+E5DDNzv/0mex2vg=; b=PlTQjNc3T7RXzoVcU1vykc7G9K+v2cMPC5ii7Lj6EuWy5MWuI4GtpOPMi5yhLQm/A8n+wl kukY16ze6IiVj72CM+fY9g+RNk1014YdOqA+nZcWTGcAnBlht5VrbL28gr3Kdq95Su4u6+ UuDpcJhm97iGLUFP9eFT0X9xrTxfreOloyIckLLTMvdda6AvTapuLbM4MxjLkspXPn3Usc UASqRthUVTxy2Av4Wse75UKYFH2ooIDiE645Nq1VilL3LevY85bfazQJ0Uugof/RNG/zDc 6Wc1cqxhfq/7CbWnv93Hi4M75MBu1Ql6ss7ssvomJlBVlO6Nz/FazulX3NsuDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711728014; a=rsa-sha256; cv=none; b=FkomhPcLJHLDEDjDg1lJABw1HIJvbxeN7VLDP6ZHaC0qOMnDWMrsifnFAT4uLxBVOqDm2n HhhbxRUsZsPYGF2d6ReIoAF909pDJZiinzdUdKpogMoA8mnbHG3xoikdizbpBPg5LqgFZ0 duCwxriPoUEcxsoWuopDEdkcmShM8jG09j7ZqfdREXYrykShBk3mVD4lpmKenva8FjP0Cd rpQqDvLOeJyIyRTfTFst5AZxM4mPC6T92nDmPTBc8hneqxO4vyoH8j6lrOYcVTTlD7UaFd IdjQWj6htXZ5qUIP+DbslXxPsDtN1NFsap3xjyCcqBldZqSsiCGjcyqGePIUsQ== 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=1711728014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6W70uoRngkNF2hLptxImwsjqR60+E5DDNzv/0mex2vg=; b=JpDTFQb7csSmfvwZHTj8mziHhxZZlnbVgR4U7eCJRz6TTedFVHGS7Qx4HifNNiuRUWg2iS J/0tHG9/3ndmfnkn3alU/R2NJuqdLJI0oS6qL/KXIAeQAJwF5uTNjiU/3zcbplZUX0mu2p oVfo2HXCh1ubg2pKPz7YBV2StjcZFeQULW7y6fSOpxpcIDzRl+CSGF0JNtcDksfHnIx02Z bVwW3MG4BmAxQXVbf5zOTw8pzkA6F+CssGm1hn3FQhOkij3BINoe9oJ5eD7aiUZJ6cPHLm B3upHEDjCaau3dXWUxKxVXfrqSLcQnbXCNwEIYfkrxZWGcMcPa35lVeXCkhTIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5lVQ3qwtzHRS; Fri, 29 Mar 2024 16:00: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 42TG0EaR053918; Fri, 29 Mar 2024 16:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TG0Ehv053908; Fri, 29 Mar 2024 16:00:14 GMT (envelope-from git) Date: Fri, 29 Mar 2024 16:00:14 GMT Message-Id: <202403291600.42TG0Ehv053908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: d46a6a77e8e1 - main - pcm.4: Showcase default device change using mixer(8) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d46a6a77e8e14177d07e3a53f68b428e5d1cb416 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d46a6a77e8e14177d07e3a53f68b428e5d1cb416 commit d46a6a77e8e14177d07e3a53f68b428e5d1cb416 Author: Christos Margiolis AuthorDate: 2024-03-29 15:59:55 +0000 Commit: Christos Margiolis CommitDate: 2024-03-29 15:59:55 +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 --- 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 Fri Mar 29 19:10:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5qkR3tByz5FWJS; Fri, 29 Mar 2024 19:10: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 4V5qkR1h4zz3xhW; Fri, 29 Mar 2024 19:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711739455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvGv2eG4rur0A69V/m8Ahev2ub35d5fIklcGOLUe3zU=; b=KbU8MziGBD/eP43TDpwi42n1yAgHHOM1+qgDA0UsSKErUISNt518zTcGpDHDTkFSEDWEXO AATb4tge1Gf6+5TP2a3245LOlcSdFsBnBwJV42s4W/nB+OCwBpG3eCGoi0FjihVjlvE0jt U7O0LtH06VgYr5m/IFO1qSEL8/bRdDFZOw4YT1DNEqoxR/RCEmYAF5JktwEDkq7vVAeQ6T e9Xnhk9AUDuOTqKNszwYmaeo7SHA0P17V7ioUQ0UxGvinDfCAjsP4xdvgLFspipdSngHtI kEX6ELj8KXTDxAaUCt3jsfFyQpUCembyOvZ5v98fwmO4fX5u03E9OGHUn4Np1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711739455; a=rsa-sha256; cv=none; b=j1wi7qHBJ2W6imyvFiyvE0Dlyfo2xxxGQEZd5gjFjSREoQDegvU2ux2CYPgbPQBurH5yrc 3WKdlCfyMAGyQ/4SWiOg0wwvnsiHkjtpX4p7ezMdVhQ7/dtf2OSbnr3IJlJoyHI7m3zpxB vaiNKuNnU/Bj9ddRo27AUImPzmee7+HJOWJ72fb1PfqZvb6yotiRKFQhLaPgz2E8Kc1dO3 GL8b8dAEpLFZcUmrx6WaK1Q07dquyNL7CmBZ6t+0tFzw1bLrq3r6s1jUCRAyGVCjJfH2Sl Q92DYzmUGMsxPwvpTgd2IzJIuE1aExwlxEDY6O2HsbPxTK043/O9aQ0zojiYJA== 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=1711739455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvGv2eG4rur0A69V/m8Ahev2ub35d5fIklcGOLUe3zU=; b=julNDvxq5i3Um6o29vEsEajuPWtOVhzrW9zqLPhjb6QM7ehQ8XoHocxdc39DOgNjE+ceh+ oVqC/IBL8g5FnRKFcd+RwXlJeQRXv9zJTZSGSyrOcMuVbKrwjQ+GDT4AaX3+ClACpruSqH ogTZ+zytM1/HGkSv5YT3+TlnYHN/xbIWuMF2umGtFY1UkUsaPL5Wzx4vPSVJBJDEhdm8Ng ZiERMIv9Sv9z5Jkte8PKF5pdgQe4rtsZ7h63qvzauizIsjmKmT1JyCgO2vjn4vl8LvQcJn w8piM8oOTCrhTq9LLM9xkTTxLFEx4c6gj9DzZ8JLBa8i38PQkfi90iS8kgpgIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5qkR0lxJzMsp; Fri, 29 Mar 2024 19:10: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 42TJAtsu079434; Fri, 29 Mar 2024 19:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TJAsiO079431; Fri, 29 Mar 2024 19:10:54 GMT (envelope-from git) Date: Fri, 29 Mar 2024 19:10:54 GMT Message-Id: <202403291910.42TJAsiO079431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: de2a4e80d7d3 - main - LinuxKPI: remove dummy header files with implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: de2a4e80d7d36651eaa688405ba72562cb7bc87c Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=de2a4e80d7d36651eaa688405ba72562cb7bc87c commit de2a4e80d7d36651eaa688405ba72562cb7bc87c Author: Bjoern A. Zeeb AuthorDate: 2024-03-29 19:07:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-03-29 19:10:02 +0000 LinuxKPI: remove dummy header files with implementation All three files now have an implementation so we no longer need the "dummy" versions. Sponsored by: The FreeBSD Foundation --- sys/compat/linuxkpi/dummy/include/asm/neon.h | 0 sys/compat/linuxkpi/dummy/include/linux/build_bug.h | 0 sys/compat/linuxkpi/dummy/include/linux/of.h | 0 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/sys/compat/linuxkpi/dummy/include/asm/neon.h b/sys/compat/linuxkpi/dummy/include/asm/neon.h deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/sys/compat/linuxkpi/dummy/include/linux/build_bug.h b/sys/compat/linuxkpi/dummy/include/linux/build_bug.h deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/sys/compat/linuxkpi/dummy/include/linux/of.h b/sys/compat/linuxkpi/dummy/include/linux/of.h deleted file mode 100644 index e69de29bb2d1..000000000000 From nobody Fri Mar 29 19:19:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5qws6sQrz5FWtr; Fri, 29 Mar 2024 19:19: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 4V5qws6JxWz41Cr; Fri, 29 Mar 2024 19:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711739997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DyUTD4060zoPPqi8yzRe+V0QhmrUyi7THxwW0+mlNOU=; b=XLwgdjrHNQLwDNWsdgFyo9GH+utjXTB1Bm4jNyfvyu85GKcskhgHe7lLATPTKlfu21p3nB w2vG3IdDnmd1m81h89jMODIw2bgoa5k3EEWkDRgC7sDow7e/kmXqpYTocY+M60+pJFahfr qgH/kg0zFJ02as3fOuYX65CRPZ2GES53dTAuRnh/leqBbVvnu1yieQOOEnW0T/lvrBZPPp 8QyLOdqzIm630R7dlEGoWQzU/Rsc+QO5/uugYRvBMq27AEUmq7X2D9xVhbwaTPE/5x/CCy OzGAYNPpFp2NZLAbRyl/hgxc7XpfOP8RdzMXbaTrrtcZIa+EGBbfM7FHI1JQVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711739997; a=rsa-sha256; cv=none; b=Rxewg066sudDVefjCvEujXtGi9lBA8sLJ6fSOzn4aYIWmET65StZ6XHIeeaO6urWc/msi9 TzTpVdyOXk6R1hQlD1VVzryUvtDTZK7vf7B8YHku0SC9MAmuq/Ifng61TBZA8mJL6VArkt /n3xLsI2yw1Bi+YnZsYWrnmQoZkcFraiDcdqQr0sD5ckWYzjx8diK1Y5/mrmfdoWWiFv9+ s9vqp6g0DuyfKRwlMj1ri6Z5Uiiia3618wn3WDBCevl3lhd9N0Gpy2hwVMrCuYn2AmrgFA 3GEIDKXVtXwkhnoNLPqYSxtIv0jOnYbdgHyULB4PS5LIQRCGYV8CNB6ETYcGnQ== 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=1711739997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DyUTD4060zoPPqi8yzRe+V0QhmrUyi7THxwW0+mlNOU=; b=SccmOL1Sq3watmJdwdSmPsBt40O9BpDOi0JQhOrqgJp/zG0otXgLjhozb6emS6klIbIrUj xCINWnhjlaqqdYRFGE6uANQLvNbUbt66tL31XHjQLXXIAz0ZZtBkq+uf3LgrrydOYZxIcQ S19Rld0KYsgyMcTNJ0sqyIjjZGJOsuJTUDv0LnXoNEhq1J1hIkLrAE6MtCK+uGQzR19Yns q2ZNz6IQTejhdUVBMopO/LJATBtOb79Qb8z8qgDaVdpYY+yutDpWFBBnbT2VJLX84RTPeY FtIoSSdMKD7c4ZK9RHkOvBnntfzs0zFVpZG1eWBLxqIpZDZlWYZohStz2tjgBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5qws5ZB5zNJ0; Fri, 29 Mar 2024 19:19: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 42TJJvaH087361; Fri, 29 Mar 2024 19:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TJJvqV087358; Fri, 29 Mar 2024 19:19:57 GMT (envelope-from git) Date: Fri, 29 Mar 2024 19:19:57 GMT Message-Id: <202403291919.42TJJvqV087358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1a8d176432e7 - main - inpcb: fully retire inp_ppcb pointer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a8d176432e76d7725ed1ac0b44f63ac6cc82397 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1a8d176432e76d7725ed1ac0b44f63ac6cc82397 commit 1a8d176432e76d7725ed1ac0b44f63ac6cc82397 Author: Gleb Smirnoff AuthorDate: 2024-03-29 19:16:59 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-29 19:18:32 +0000 inpcb: fully retire inp_ppcb pointer Before a protocol specific control block started to embed inpcb in self (see 0aa120d52f3c, e68b3792440c, 483fe96511ec) this pointer used to point at it. Retain kf_sock_inpcb field in the struct kinfo_file in . The exp-run detected a minimal use of the field in ports: * sysutils/lsof - patched upstream * net-mgmt/netdata - patch accepted upstream * emulators/qemu-user-static - upstream master branch seems not using the field anymore We can keep the field around for some time, but eventually it may be reused for something else. PR: 277659 (exp-run) Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D44491 --- lib/libprocstat/libprocstat.c | 29 ++++------------------------- lib/libprocstat/libprocstat.h | 1 - lib/libprocstat/libprocstat_compat.c | 2 +- sys/kern/sys_socket.c | 8 ++------ sys/netinet/in_pcb.c | 9 --------- sys/netinet/in_pcb.h | 9 ++++----- sys/netinet/tcp_subr.c | 7 ------- sys/sys/user.h | 2 +- usr.bin/fstat/fstat.c | 15 +++++---------- usr.bin/systat/netstat.c | 28 +++++++++++++--------------- 10 files changed, 30 insertions(+), 80 deletions(-) diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index 8f1f58d12957..0c7d28540e43 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -83,8 +83,6 @@ #include #include #include -#define _WANT_INPCB -#include #include #include @@ -1473,7 +1471,6 @@ procstat_get_socket_info_kvm(kvm_t *kd, struct filestat *fst, struct sockstat *sock, char *errbuf) { struct domain dom; - struct inpcb inpcb; struct protosw proto; struct socket s; struct unpcb unpcb; @@ -1522,28 +1519,15 @@ procstat_get_socket_info_kvm(kvm_t *kd, struct filestat *fst, sock->proto = proto.pr_protocol; sock->dom_family = dom.dom_family; sock->so_pcb = (uintptr_t)s.so_pcb; + sock->sendq = s.so_snd.sb_ccc; + sock->recvq = s.so_rcv.sb_ccc; + sock->so_rcv_sb_state = s.so_rcv.sb_state; + sock->so_snd_sb_state = s.so_snd.sb_state; /* * Protocol specific data. */ switch (dom.dom_family) { - case AF_INET: - case AF_INET6: - if (proto.pr_protocol == IPPROTO_TCP) { - if (s.so_pcb) { - if (kvm_read(kd, (u_long)s.so_pcb, - (char *)&inpcb, sizeof(struct inpcb)) - != sizeof(struct inpcb)) { - warnx("can't read inpcb at %p", - (void *)s.so_pcb); - } else - sock->inp_ppcb = - (uintptr_t)inpcb.inp_ppcb; - sock->sendq = s.so_snd.sb_ccc; - sock->recvq = s.so_rcv.sb_ccc; - } - } - break; case AF_UNIX: if (s.so_pcb) { if (kvm_read(kd, (u_long)s.so_pcb, (char *)&unpcb, @@ -1551,11 +1535,7 @@ procstat_get_socket_info_kvm(kvm_t *kd, struct filestat *fst, warnx("can't read unpcb at %p", (void *)s.so_pcb); } else if (unpcb.unp_conn) { - sock->so_rcv_sb_state = s.so_rcv.sb_state; - sock->so_snd_sb_state = s.so_snd.sb_state; sock->unp_conn = (uintptr_t)unpcb.unp_conn; - sock->sendq = s.so_snd.sb_ccc; - sock->recvq = s.so_rcv.sb_ccc; } } break; @@ -1603,7 +1583,6 @@ procstat_get_socket_info_sysctl(struct filestat *fst, struct sockstat *sock, case AF_INET: case AF_INET6: if (sock->proto == IPPROTO_TCP) { - sock->inp_ppcb = kif->kf_un.kf_sock.kf_sock_inpcb; sock->sendq = kif->kf_un.kf_sock.kf_sock_sendq; sock->recvq = kif->kf_un.kf_sock.kf_sock_recvq; } diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h index 3d30b4db4018..4aba1610a05f 100644 --- a/lib/libprocstat/libprocstat.h +++ b/lib/libprocstat/libprocstat.h @@ -154,7 +154,6 @@ struct shmstat { uint16_t mode; }; struct sockstat { - uint64_t inp_ppcb; uint64_t so_addr; uint64_t so_pcb; uint64_t unp_conn; diff --git a/lib/libprocstat/libprocstat_compat.c b/lib/libprocstat/libprocstat_compat.c index 472527973323..63eb35678752 100644 --- a/lib/libprocstat/libprocstat_compat.c +++ b/lib/libprocstat/libprocstat_compat.c @@ -182,7 +182,7 @@ freebsd11_procstat_get_socket_info(struct procstat *procstat, struct filestat *f r = procstat_get_socket_info(procstat, fst, &sock, errbuf); if (r != 0) return (r); - sock_compat->inp_ppcb = sock.inp_ppcb; + sock_compat->inp_ppcb = sock.so_pcb; sock_compat->so_addr = sock.so_addr; sock_compat->so_pcb = sock.so_pcb; sock_compat->unp_conn = sock.unp_conn; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 7854a4ebdf52..55837e4cb6ce 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -357,7 +357,6 @@ static int soo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) { struct sockaddr_storage ss = { .ss_len = sizeof(ss) }; - struct inpcb *inpcb; struct unpcb *unpcb; struct socket *so; int error; @@ -373,11 +372,8 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) switch (kif->kf_un.kf_sock.kf_sock_domain0) { case AF_INET: case AF_INET6: - if (so->so_pcb != NULL) { - inpcb = (struct inpcb *)(so->so_pcb); - kif->kf_un.kf_sock.kf_sock_inpcb = - (uintptr_t)inpcb->inp_ppcb; - } + /* XXX: kf_sock_inpcb is obsolete. It may be removed. */ + kif->kf_un.kf_sock.kf_sock_inpcb = (uintptr_t)so->so_pcb; kif->kf_un.kf_sock.kf_sock_rcv_sb_state = so->so_rcv.sb_state; kif->kf_un.kf_sock.kf_sock_snd_sb_state = diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index d966f8e386fe..d9caad6417ef 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1805,10 +1805,6 @@ in_pcbdrop(struct inpcb *inp) { INP_WLOCK_ASSERT(inp); -#ifdef INVARIANTS - if (inp->inp_socket != NULL && inp->inp_ppcb != NULL) - MPASS(inp->inp_refcount > 1); -#endif inp->inp_flags |= INP_DROPPED; if (inp->inp_flags & INP_INHASHLIST) @@ -2865,7 +2861,6 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi) sotoxsocket(inp->inp_socket, &xi->xi_socket); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; - xi->inp_ppcb = (uintptr_t)inp->inp_ppcb; xi->inp_flow = inp->inp_flow; xi->inp_flowid = inp->inp_flowid; xi->inp_flowtype = inp->inp_flowtype; @@ -3150,10 +3145,6 @@ db_print_inpcb(struct inpcb *inp, const char *name, int indent) db_print_inconninfo(&inp->inp_inc, "inp_conninfo", indent); - db_print_indent(indent); - db_printf("inp_ppcb: %p inp_pcbinfo: %p inp_socket: %p\n", - inp->inp_ppcb, inp->inp_pcbinfo, inp->inp_socket); - db_print_indent(indent); db_printf("inp_label: %p inp_flags: 0x%x (", inp->inp_label, inp->inp_flags); diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 7e9de02b0c7c..a4b4075b3501 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -133,8 +133,9 @@ struct in_conninfo { /* * struct inpcb captures the network layer state for TCP, UDP, and raw IPv4 and * IPv6 sockets. In the case of TCP and UDP, further per-connection state is - * hung off of inp_ppcb most of the time. Almost all fields of struct inpcb - * are static after creation or protected by a per-inpcb rwlock, inp_lock. + * located in a larger protocol specific structure that embeds inpcb in it. + * Almost all fields of struct inpcb are static after creation or protected by + * a per-inpcb rwlock, inp_lock. * * A inpcb database is indexed by addresses/ports hash as well as list of * all pcbs that belong to a certain proto. Database lookups or list traversals @@ -177,7 +178,6 @@ struct inpcb { int inp_flags; /* (i) generic IP/datagram flags */ int inp_flags2; /* (i) generic IP/datagram flags #2*/ uint8_t inp_numa_domain; /* numa domain */ - void *inp_ppcb; /* (i) pointer to per-protocol pcb */ struct socket *inp_socket; /* (i) back pointer to socket */ struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ struct ucred *inp_cred; /* (c) cache of socket cred */ @@ -266,8 +266,7 @@ struct xinpcb { struct xsocket xi_socket; /* (s,p) */ struct in_conninfo inp_inc; /* (s,p) */ uint64_t inp_gencnt; /* (s,p) */ - kvaddr_t inp_ppcb; /* (s) netstat(1) */ - int64_t inp_spare64[4]; + int64_t inp_spare64[5]; uint32_t inp_flow; /* (s) */ uint32_t inp_flowid; /* (s) */ uint32_t inp_flowtype; /* (s) */ diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index a6f84c297688..db335a890b28 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -3980,13 +3980,6 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *xt) xt->xt_len = sizeof(struct xtcpcb); in_pcbtoxinpcb(inp, &xt->xt_inp); - /* - * TCP doesn't use inp_ppcb pointer, we embed inpcb into tcpcb. - * Fixup the pointer that in_pcbtoxinpcb() has set. When printing - * TCP netstat(1) used to use this pointer, so this fixup needs to - * stay for stable/14. - */ - xt->xt_inp.inp_ppcb = (uintptr_t)tp; } void diff --git a/sys/sys/user.h b/sys/sys/user.h index d70cfe3bd718..e76b2a66ae94 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -371,7 +371,7 @@ struct kinfo_file { struct sockaddr_storage kf_sa_peer; /* Address of so_pcb. */ uint64_t kf_sock_pcb; - /* Address of inp_ppcb. */ + /* Obsolete! May be reused as a spare. */ uint64_t kf_sock_inpcb; /* Address of unp_conn. */ uint64_t kf_sock_unpconn; diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index 328e35e9138f..e5d0755062d0 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -400,11 +400,10 @@ print_socket_info(struct procstat *procstat, struct filestat *fst) /* * protocol specific formatting * - * Try to find interesting things to print. For tcp, the interesting - * thing is the address of the tcpcb, for udp and others, just the - * inpcb (socket pcb). For unix domain, its the address of the socket - * pcb and the address of the connected pcb (if connected). Otherwise - * just print the protocol number and address of the socket itself. + * Try to find interesting things to print. For internet and unix + * sockets, its the address of the socket pcb. For unix it is also the + * address of the connected pcb (if connected). Otherwise just print + * the protocol number and address of the socket itself. * The idea is not to duplicate netstat, but to make available enough * information for further analysis. */ @@ -417,11 +416,7 @@ print_socket_info(struct procstat *procstat, struct filestat *fst) printf(" %s", pe->p_name); else printf(" %d", sock.proto); - if (sock.proto == IPPROTO_TCP ) { - if (sock.inp_ppcb != 0) - printf(" %lx", (u_long)sock.inp_ppcb); - } - else if (sock.so_pcb != 0) + if (sock.so_pcb != 0) printf(" %lx", (u_long)sock.so_pcb); if (!sflg) break; diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index bc4acabe4eda..6d188bf1dd0d 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -168,12 +168,11 @@ fetchnetstat(void) static void fetchnetstat_kvm(void) { - struct inpcb *next; struct netinfo *p; struct inpcbhead head; - struct inpcb inpcb; struct socket sockb; struct tcpcb tcpcb; + struct inpcb *inpcb; void *off; int istcp; @@ -195,32 +194,31 @@ fetchnetstat_kvm(void) } again: KREAD(off, &head, sizeof (struct inpcbhead)); - LIST_FOREACH(next, &head, inp_list) { - KREAD(next, &inpcb, sizeof (inpcb)); - next = &inpcb; + LIST_FOREACH(inpcb, &head, inp_list) { + KREAD(inpcb, &tcpcb, istcp ? sizeof(tcpcb) : sizeof(inpcb)); + inpcb = (struct inpcb *)&tcpcb; if (!aflag) { - if (inpcb.inp_vflag & INP_IPV4) { - if (inpcb.inp_laddr.s_addr == INADDR_ANY) + if (inpcb->inp_vflag & INP_IPV4) { + if (inpcb->inp_laddr.s_addr == INADDR_ANY) continue; } #ifdef INET6 - else if (inpcb.inp_vflag & INP_IPV6) { - if (memcmp(&inpcb.in6p_laddr, + else if (inpcb->inp_vflag & INP_IPV6) { + if (memcmp(&inpcb->in6p_laddr, &in6addr_any, sizeof(in6addr_any)) == 0) continue; } #endif } - if (nhosts && !checkhost(&inpcb.inp_inc)) + if (nhosts && !checkhost(&inpcb->inp_inc)) continue; - if (nports && !checkport(&inpcb.inp_inc)) + if (nports && !checkport(&inpcb->inp_inc)) continue; if (istcp) { - KREAD(inpcb.inp_socket, &sockb, sizeof (sockb)); - KREAD(inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb)); - enter_kvm(&inpcb, &sockb, tcpcb.t_state, "tcp"); + KREAD(inpcb->inp_socket, &sockb, sizeof (sockb)); + enter_kvm(inpcb, &sockb, tcpcb.t_state, "tcp"); } else - enter_kvm(&inpcb, &sockb, 0, "udp"); + enter_kvm(inpcb, &sockb, 0, "udp"); } if (istcp && (protos&UDP)) { istcp = 0; From nobody Fri Mar 29 19:27:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5r5D2wWHz5FXts; Fri, 29 Mar 2024 19:27: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 4V5r5D1xvnz443g; Fri, 29 Mar 2024 19:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711740432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BvEcvpequtzf95/UqKgXnaSb83wxBPAkFI6Se9j6qTc=; b=nFZj3GJaK2ZCrZbXse5fl6JTSIa0RujRoAAPRZZ35UEPmK09Lh+t7gzcOM+khOnhheBwCX UZe8V8pxOU9URFV/gSTmZA9ifn4cWARUrvONdrCh63kercwRVZWwFDqkZg508zDrzsfE9B CPVKn5jjTF2yt6UJ3gN73IxEw6rE5vMXDI50QiQXje59K8IjfXInvefAjkoqhvj88SE4W/ IoxHoUU664XeQQjszgB14JOpDPMYRbaahkJ7Hnu4H2V2X6Q7rERJcunClz0+ryIuTFM9K1 vipgOcA0BkkIb/Bd+LP2M2+BbhUVcBKL7ZrUVdM6gl75wa4gUP15x5szafM1Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711740432; a=rsa-sha256; cv=none; b=jutWV1chwLU9e9V7WbYtomZ6U+5fjShs5SgMVzERG9iMhK5hxONnV0KzEr7YoYSRGe478u ukMGwrila/KiHWHXcDl4No7uBLpDFbSawpE1r+XhGtdOopvKH/4g32BmFnVrnnlSgw9gfz KxWQbAfPClz8Qo4/oE3+C7jctMZvrmAhpF27Qo7eC5qVSszxSoXlrESvrQg/ISS2KV5sew ahX/Vce+nwJrEo+QPhCva+nl38/tG66hF4D3mTi4VWazC/vaZYscqleehUXyVn5LuzyDtD +noH0TEI1o4f+2AigoVIlXb2j7JikBBmiEZeuA1fB78MEXXpYsZeHoZ4Sf0S9Q== 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=1711740432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BvEcvpequtzf95/UqKgXnaSb83wxBPAkFI6Se9j6qTc=; b=kDEwHGq3W44bfJJjOBHBtQvafIfuFciH981Cna58ga+W8ogOTASHR8bLFHsyhcA4IR/rFh s5reto4ZjvvBu7Y13a+EB+oUp9srLHw0i7sYiTjFxvfV36GoJ9PhQPC3koh8+XbxfPPMUV d+P9r80RfT7zEwTaZlo6EWvKAi7ioWq8p1yGjN6vWHaH9+GUSmSZxG/9i9TEqMnRdg9w8M vKM7MOJ+xnpJeeKtrCdojXOGlWiWvQGlz+e9vfM78Jd3B/3nEd93DjOsaDK4f8q8KwtYkq XSv8gbP76fnYDzLPBfLgtUaTU/zy8IaiEvbV6SD8gD42389xDf6uHLRLM14s7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5r5D1Xx0zNLg; Fri, 29 Mar 2024 19:27: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 42TJRCLB003778; Fri, 29 Mar 2024 19:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TJRCcD003775; Fri, 29 Mar 2024 19:27:12 GMT (envelope-from git) Date: Fri, 29 Mar 2024 19:27:12 GMT Message-Id: <202403291927.42TJRCcD003775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2ae32f1f8fcc - main - build: Do not pass -fno-sanitize-memory-param-retval to subr_coverage.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ae32f1f8fcc97c3e9c16effa2ee5e41a1a6c364 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae32f1f8fcc97c3e9c16effa2ee5e41a1a6c364 commit 2ae32f1f8fcc97c3e9c16effa2ee5e41a1a6c364 Author: Mark Johnston AuthorDate: 2023-12-23 00:24:48 +0000 Commit: Mark Johnston CommitDate: 2024-03-29 19:26:07 +0000 build: Do not pass -fno-sanitize-memory-param-retval to subr_coverage.c In the absence of -fsanitize=kernel-memory, the presence of this flag results in a -Wunused-command-line-argument warning. MFC after: 1 week --- sys/conf/files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 021829408c0f..549a3590f76b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3855,7 +3855,7 @@ kern/subr_clock.c standard kern/subr_compressor.c standard \ compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd" kern/subr_coverage.c optional coverage \ - compile-with "${NORMAL_C:N-fsanitize*}" + compile-with "${NORMAL_C:N-fsanitize*:N-fno-sanitize*}" kern/subr_counter.c standard kern/subr_csan.c optional kcsan \ compile-with "${NORMAL_C:N-fsanitize*:N-fstack-protector*}" From nobody Fri Mar 29 19:32:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5rCX23Cmz5FYp6; Fri, 29 Mar 2024 19:32: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 4V5rCX1ZZNz44ck; Fri, 29 Mar 2024 19:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711740760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yh1/I7lN6jPBYzSoD+dSvskje0iBKgU5V4Wv0cZdBNk=; b=KpgRgYl5NvpEiBfNxRX3o551ZRYfa5Nxuz2iUOsMLJ25F2316xbc7N5uhL03Dl1aazhwR/ FHjWrwnh3tLW7PqWE/ytw4dO24Q75KvKv0J9g2N8TzT4wxmaX7NTebrrSznjLp4rMJCwq4 qIkrKd15ZIJpyRgaI3xrVXM/fyeOjcXxu/PgECzKgNgYECoeRpk6Wgao6Rj16BXNIkzZGh uNHQFfh5ULlr2m5pb91SRNgEH1zXjgzTMtab2LY/10mYStnQjD5xqNTGEOpO+cjRqO1caL fsfbGpBMm7jn8rGRGvcaiLk9ns1Jk7RFA6p22s24gEt7mag2ryRc0h/HYmVGWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711740760; a=rsa-sha256; cv=none; b=eVBgkB5Hl2QMK6h16iv1ZBVedGg776VhbDJnYdFd631x8ZP8NyWseCwyc3MI4+I7dqISLQ yK1tagLWEXaw40PngfkW/Pbxt64/FQ3Jazb9jkft+/NiQ9xf1dkzwfZvgiLnU88BDHrH5i OuAfFjXKItvNJj2YMmphcg6X6gNdegShwcEql8Ud0sJDdSH3YmQiCpiYeO0CuQU1ih4h81 oHUq8zKI1COFUXq7/UoNkuD1YqydpN+2FipqVjTbELHw7NaZDX63TleWj/wpdSdr0+thOz JViVWUVBSg2zsDgMcOAyJGck75/TX1wbAVjFfT6OaxKvyMuj9lksQhEg+4U6HQ== 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=1711740760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yh1/I7lN6jPBYzSoD+dSvskje0iBKgU5V4Wv0cZdBNk=; b=tkWPJoRdXleba0OF3AopE5OMkywJYU2/weWMvS2w8gdmLzv9to3JV/32UEGj5sRU0ojgk/ ryOXK1lbl+Y0UZTVa2P0UlGLjG5ltu+A1axZiuB21BFhkwxdrFdN+ZOp1dFqMe1eI7x9SH Tqy5kmd01lugYlno0y+0SAcLHAcF4Euh1zG6BstoBp8Y1HrSd/VARKLSYvpjzkMU5WZd6I fK7GPkyzEnuaan0sFp/T8Yfg1E5sa3J5gijuYfo5TY7USAw4C8jloj6Jctv3SFwbbdVsZn 8G5MSbo1L/zM7jbrF/e0xLARBcRXnySvBtzNfOLQyWtJpPhieiI9fVfraPSgqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5rCX1BHMzMvB; Fri, 29 Mar 2024 19:32: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 42TJWel2020052; Fri, 29 Mar 2024 19:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TJWeOi020049; Fri, 29 Mar 2024 19:32:40 GMT (envelope-from git) Date: Fri, 29 Mar 2024 19:32:40 GMT Message-Id: <202403291932.42TJWeOi020049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: bdc903460be4 - main - kern_ctf.c: Don't print out warning messages unconditionally List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bdc903460be4b6a729c1b7cde55963730c68cec4 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=bdc903460be4b6a729c1b7cde55963730c68cec4 commit bdc903460be4b6a729c1b7cde55963730c68cec4 Author: Bojan Novković AuthorDate: 2024-03-29 19:17:19 +0000 Commit: Bojan Novković CommitDate: 2024-03-29 19:32:18 +0000 kern_ctf.c: Don't print out warning messages unconditionally The kernel CTF loading routines print various warnings when attempting to load CTF data from an ELF file. After the changes in c21bc6f3c242 those warnings are unnecessarily printed for each kernel module that was compiled without CTF data. The kernel linker already uses the bootverbose flag to conditionally print CTF loading errors. This patch alters kern_ctf.c routines to do the same. Reported by: Alexander@leidinger.net Approved by: markj (mentor) Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing") --- sys/kern/kern_ctf.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c index b525c274f9e0..1087406ff82e 100644 --- a/sys/kern/kern_ctf.c +++ b/sys/kern/kern_ctf.c @@ -144,9 +144,12 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) * .SUNW_ctf section containing the CTF data. */ if (hdr->e_shstrndx == 0 || shdr[hdr->e_shstrndx].sh_type != SHT_STRTAB) { - printf("%s(%d): module %s e_shstrndx is %d, sh_type is %d\n", - __func__, __LINE__, lf->pathname, hdr->e_shstrndx, - shdr[hdr->e_shstrndx].sh_type); + if (bootverbose) { + printf( + "%s(%d): module %s e_shstrndx is %d, sh_type is %d\n", + __func__, __LINE__, lf->pathname, hdr->e_shstrndx, + shdr[hdr->e_shstrndx].sh_type); + } error = EFTYPE; goto out; } @@ -167,8 +170,10 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) /* Check if the CTF section wasn't found. */ if (i >= hdr->e_shnum) { - printf("%s(%d): module %s has no .SUNW_ctf section\n", - __func__, __LINE__, lf->pathname); + if (bootverbose) { + printf("%s(%d): module %s has no .SUNW_ctf section\n", + __func__, __LINE__, lf->pathname); + } error = EFTYPE; goto out; } @@ -181,17 +186,21 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) /* Check the CTF magic number. */ if (cth.cth_magic != CTF_MAGIC) { - printf("%s(%d): module %s has invalid format\n", - __func__, __LINE__, lf->pathname); + if (bootverbose) { + printf("%s(%d): module %s has invalid format\n", + __func__, __LINE__, lf->pathname); + } error = EFTYPE; goto out; } if (cth.cth_version != CTF_VERSION_2 && cth.cth_version != CTF_VERSION_3) { - printf( - "%s(%d): module %s CTF format has unsupported version %d\n", - __func__, __LINE__, lf->pathname, cth.cth_version); + if (bootverbose) { + printf( + "%s(%d): module %s CTF format has unsupported version %d\n", + __func__, __LINE__, lf->pathname, cth.cth_version); + } error = EFTYPE; goto out; } @@ -250,8 +259,10 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) ret = uncompress(ctftab + sizeof(cth), &destlen, raw + sizeof(cth), shdr[i].sh_size - sizeof(cth)); if (ret != Z_OK) { - printf("%s(%d): zlib uncompress returned %d\n", - __func__, __LINE__, ret); + if (bootverbose) { + printf("%s(%d): zlib uncompress returned %d\n", + __func__, __LINE__, ret); + } error = EIO; goto out; } From nobody Fri Mar 29 19:36:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5rHV0q0bz5FYR6; Fri, 29 Mar 2024 19:36: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 4V5rHV0Czvz44pq; Fri, 29 Mar 2024 19:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711740966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lqS+f7plaVlaJVrCqgToF9wAUvlP5i9nJ4HpVtWJ3iM=; b=rjfW3FHTLYxzK7xnCdce53CCAsYWzzx0523cMTccc7GONBs+EfofsRFIKvlCNMHLziN/7K WRrhG3ZsWeZffDtfE+GBev+4q+1+MemjQ2E3G7WYTHkqvMh6F4J5X+Xm1/zMLvyF5Dnqph lontuYghO+ZCrGprohuI+k4I7yOTeODc26MN7Sq53u6EhZ4k+weVEY4c4g3YfMpw7+AiJk J00YSSAaraq2eEkMF6GraEjiAm+c1cTSmnG15Z83t54HGMJS6CfvArlZea2qeu7T6BWzZL e9Qaod3dMfNVbWW9v6hu4Uc/eogfU20h/NTgbOYkauFkkbfoyePOj+nunF9PAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711740966; a=rsa-sha256; cv=none; b=GCJZ7tI7ZXxdU6B3mXnC/LN1W3OONE9/sJQDVtT3I2o8AxzvWDzcWcd0YWJ6q8t+R0oWfu fnn9lBWgXj255D8cK5C6mSMwCTu640ES5jFQ+W0rASR9VmtYafHQZFlKWS6ao+Bc99oURh tYPr5QrE2KUMsL5VyFJNHbVEDptGJO0um9/JUWF0c2l40tQwnYfnHJphELCpZ1PAIKLD7S GiukQQd26vKQmB135bQXR3hOfxQqOHufOpeco1YL3H97usmBodQKKpTH2O/CAAW11L8ePT 7hrkb0+K5j/xZRuX+dFkwqbXi0+Pjzc/lFkLLvYQiyPjDgmdYHGEUPOILe3h6w== 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=1711740966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lqS+f7plaVlaJVrCqgToF9wAUvlP5i9nJ4HpVtWJ3iM=; b=Mre4mfE5vmbcKG0kMMdmJWDZTG7rhnLcEi5wzcGO02HxSCRil7aGflcxIWjRrryqHiFGWD AiKSoIDeu3nOQW+aciwtHpx2d3nHzD1o92GhGTyFMrXAH08GovZWY/DnQgTXK4+NL/YKc7 gtppThi6I585+gM7iSOd1IhoeA/mVCa8a1ttbOGQbPBAl2Vv0ZVfRBKVFvE0nJkdUtbqI3 JGytiSejrMYgJxkLZCgpPJzKFSxUJf/7YsL0CCxUV/U7Dkn2krNyAcSTTtI2w0oVMooCfw 4MzhjWD8EulhJMkDKa1Pnmom2L5b3lBabE8M7VWNlhDnC2dJ1itB3an+XSz5EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5rHT6wzTzNmB; Fri, 29 Mar 2024 19:36: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 42TJa5YE020728; Fri, 29 Mar 2024 19:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TJa52d020725; Fri, 29 Mar 2024 19:36:05 GMT (envelope-from git) Date: Fri, 29 Mar 2024 19:36:05 GMT Message-Id: <202403291936.42TJa52d020725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: fa93ba4097f0 - main - if_tuntap: simplify storage of per-vnet cloners List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa93ba4097f0db31b8f1b3d081979a4e6f34c191 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=fa93ba4097f0db31b8f1b3d081979a4e6f34c191 commit fa93ba4097f0db31b8f1b3d081979a4e6f34c191 Author: Gleb Smirnoff AuthorDate: 2024-03-29 19:35:41 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-29 19:35:41 +0000 if_tuntap: simplify storage of per-vnet cloners There is no need for a separate structure neither for a linked list. Provide each VNET with an array of pointers to if_clone that has the same size as the driver list. Reviewed by: zlei, kevans, kp Differential Revision: https://reviews.freebsd.org/D44307 --- sys/net/if_tuntap.c | 68 ++++++++++++++--------------------------------------- 1 file changed, 18 insertions(+), 50 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 4cb219dc92b6..1009dc7b3806 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -328,16 +328,9 @@ static struct tuntap_driver { .clone_destroy_fn = tun_clone_destroy, }, }; +#define NDRV nitems(tuntap_drivers) -struct tuntap_driver_cloner { - SLIST_ENTRY(tuntap_driver_cloner) link; - struct tuntap_driver *drv; - struct if_clone *cloner; -}; - -VNET_DEFINE_STATIC(SLIST_HEAD(, tuntap_driver_cloner), tuntap_driver_cloners) = - SLIST_HEAD_INITIALIZER(tuntap_driver_cloners); - +VNET_DEFINE_STATIC(struct if_clone *, tuntap_driver_cloners[NDRV]); #define V_tuntap_driver_cloners VNET(tuntap_driver_cloners) /* @@ -406,7 +399,6 @@ static int tuntap_name2info(const char *name, int *outunit, int *outflags) { struct tuntap_driver *drv; - struct tuntap_driver_cloner *drvc; char *dname; int flags, unit; bool found; @@ -422,12 +414,8 @@ tuntap_name2info(const char *name, int *outunit, int *outflags) dname = __DECONST(char *, name); found = false; - KASSERT(!SLIST_EMPTY(&V_tuntap_driver_cloners), - ("tuntap_driver_cloners failed to initialize")); - SLIST_FOREACH(drvc, &V_tuntap_driver_cloners, link) { - KASSERT(drvc->drv != NULL, - ("tuntap_driver_cloners entry not properly initialized")); - drv = drvc->drv; + for (u_int i = 0; i < NDRV; i++) { + drv = &tuntap_drivers[i]; if (strcmp(name, drv->cdevsw.d_name) == 0) { found = true; @@ -456,23 +444,16 @@ tuntap_name2info(const char *name, int *outunit, int *outflags) /* * Get driver information from a set of flags specified. Masks the identifying * part of the flags and compares it against all of the available - * tuntap_drivers. Must be called with correct vnet context. + * tuntap_drivers. */ static struct tuntap_driver * tuntap_driver_from_flags(int tun_flags) { - struct tuntap_driver *drv; - struct tuntap_driver_cloner *drvc; - - KASSERT(!SLIST_EMPTY(&V_tuntap_driver_cloners), - ("tuntap_driver_cloners failed to initialize")); - SLIST_FOREACH(drvc, &V_tuntap_driver_cloners, link) { - KASSERT(drvc->drv != NULL, - ("tuntap_driver_cloners entry not properly initialized")); - drv = drvc->drv; - if ((tun_flags & TUN_DRIVER_IDENT_MASK) == drv->ident_flags) - return (drv); - } + + for (u_int i = 0; i < NDRV; i++) + if ((tun_flags & TUN_DRIVER_IDENT_MASK) == + tuntap_drivers[i].ident_flags) + return (&tuntap_drivers[i]); return (NULL); } @@ -674,22 +655,15 @@ tun_clone_destroy(struct if_clone *ifc __unused, struct ifnet *ifp, uint32_t fla static void vnet_tun_init(const void *unused __unused) { - struct tuntap_driver *drv; - struct tuntap_driver_cloner *drvc; - int i; - for (i = 0; i < nitems(tuntap_drivers); ++i) { - drv = &tuntap_drivers[i]; - drvc = malloc(sizeof(*drvc), M_TUN, M_WAITOK | M_ZERO); - - drvc->drv = drv; + for (u_int i = 0; i < NDRV; ++i) { struct if_clone_addreq req = { - .match_f = drv->clone_match_fn, - .create_f = drv->clone_create_fn, - .destroy_f = drv->clone_destroy_fn, + .match_f = tuntap_drivers[i].clone_match_fn, + .create_f = tuntap_drivers[i].clone_create_fn, + .destroy_f = tuntap_drivers[i].clone_destroy_fn, }; - drvc->cloner = ifc_attach_cloner(drv->cdevsw.d_name, &req); - SLIST_INSERT_HEAD(&V_tuntap_driver_cloners, drvc, link); + V_tuntap_driver_cloners[i] = + ifc_attach_cloner(tuntap_drivers[i].cdevsw.d_name, &req); }; } VNET_SYSINIT(vnet_tun_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, @@ -698,15 +672,9 @@ VNET_SYSINIT(vnet_tun_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, static void vnet_tun_uninit(const void *unused __unused) { - struct tuntap_driver_cloner *drvc; - - while (!SLIST_EMPTY(&V_tuntap_driver_cloners)) { - drvc = SLIST_FIRST(&V_tuntap_driver_cloners); - SLIST_REMOVE_HEAD(&V_tuntap_driver_cloners, link); - if_clone_detach(drvc->cloner); - free(drvc, M_TUN); - } + for (u_int i = 0; i < NDRV; ++i) + if_clone_detach(V_tuntap_driver_cloners[i]); } VNET_SYSUNINIT(vnet_tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, vnet_tun_uninit, NULL); From nobody Fri Mar 29 20:36:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5scs0G3lz5Fgq5; Fri, 29 Mar 2024 20:36: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 4V5scr6PbPz4DPJ; Fri, 29 Mar 2024 20:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711744572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cD3BqIPajLmlpqydnIicYWOdG7a1+RL5cM6LUF5Wv1U=; b=JftFZqlzyXLZ3tO1kXmXUpHw8cNCLds8MZTJkdpxKfTeQau6PEJpPdIkM3Uq/XcMvcAFMw UEYVJ9DhTnVyJO26o0scussc1Wru70iAgeqsQtdqZXTTDns5jeJnb2BUEff2zQyLvU0JOT tH8HyCi6tZD5pJW/I6scqVYGiS4MsLmdemRS1OfZNaOubq2MDHT/6OE4NAJPipw8LZZV2D V98yw/Bbil3D2uqumNRspjAXGF4NsbZZl73O5UauB1zgsRKJgB1C2eX8s830WT6nwINVju Qwl5Fjl6wjs+1gh0XUkFF2AhNArg0jq+d0juWQUs/Y+98gwohLCb8Z9bZdSNIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711744572; a=rsa-sha256; cv=none; b=MTVBGNs+bbmQm/HKcTN6bJukvwWUFvxvb3Fou+IqlDzvkUJXIsFJXNDugo8+G/9s7g4Rz4 2e1SvmFmY93FqbwG1cbj7fW0W9s0JqtgXlmXcMH25gKvxtJZSfnCPjENZ3kcHDcOeGGqJ+ JOmw57HLta7MyRw8MC5m9TIVjA/un67wKHuzoX7mrWUx1BqGVOnRecprKruRLIMN/KLSOo LabUaUjCFe0iZhfsfEVM8R50FuuRBZKBeyEgpnzGcjl2lVeYc9NUCtLZzo6Ek2P6UQFjIb YPRrvFNTgHutqEL8ScYtWy4FmZE2D1pmlo5brPUjfgTbswJNcbqLYRfWmjxpKw== 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=1711744572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cD3BqIPajLmlpqydnIicYWOdG7a1+RL5cM6LUF5Wv1U=; b=tMqa4fDBulpCk/SRiaQhU7nkFBXiwVEW8DkIuvxhxo2kn/4xoBq9ymdeUw81t4bKwpc/r6 0XVV9J1pIN31JADOWZFoBtxbjB06GWkS1CbyvLgwzfoUgUrp5LPSwfD7+W8bV2gaAY9sJC J9bAdt2k6XkgMcIzFHtZDrmWVN/OA0lRkJLJUUTByPeXGlutwSCpBJcIpqAORvLPvcTdIu FGnLJ3xocwW84yWYZF4sRMzmOLYTT6sWAa82eMDeBgk68s3QPAgdbrkF9GcKeEQFMsv6AM 3W4ZY6bIfQ4M5l9/5q42xCAOKYUprBxWwFz8pIJ5m96HCuSG8SSA8FBkWZ1Fuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5scr619fzPZV; Fri, 29 Mar 2024 20:36: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 42TKaCo0023246; Fri, 29 Mar 2024 20:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TKaCTI023243; Fri, 29 Mar 2024 20:36:12 GMT (envelope-from git) Date: Fri, 29 Mar 2024 20:36:12 GMT Message-Id: <202403292036.42TKaCTI023243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9d4a08d162d8 - main - linux: use sa_family_t for address family conversions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d4a08d162d87ba120f418a1a71facd2c631b549 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9d4a08d162d87ba120f418a1a71facd2c631b549 commit 9d4a08d162d87ba120f418a1a71facd2c631b549 Author: Gleb Smirnoff AuthorDate: 2024-03-29 20:35:37 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-29 20:35:37 +0000 linux: use sa_family_t for address family conversions Express "conversion failed" with maximum possible value. This allows to reduce number of size/signedness conversion in the code that utilizes the functions. PR: 274536 Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D44375 --- sys/compat/linux/linux.c | 18 +++++++++--------- sys/compat/linux/linux_common.h | 5 +++-- sys/compat/linux/linux_socket.c | 9 +++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 69849b1d98ad..61b207070963 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -501,8 +501,8 @@ linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) return (ENOENT); } -int -linux_to_bsd_domain(int domain) +sa_family_t +linux_to_bsd_domain(sa_family_t domain) { switch (domain) { @@ -523,11 +523,11 @@ linux_to_bsd_domain(int domain) case LINUX_AF_NETLINK: return (AF_NETLINK); } - return (-1); + return (AF_UNKNOWN); } -int -bsd_to_linux_domain(int domain) +sa_family_t +bsd_to_linux_domain(sa_family_t domain) { switch (domain) { @@ -548,7 +548,7 @@ bsd_to_linux_domain(int domain) case AF_NETLINK: return (LINUX_AF_NETLINK); } - return (-1); + return (AF_UNKNOWN); } /* @@ -562,13 +562,13 @@ bsd_to_linux_sockaddr(const struct sockaddr *sa, struct l_sockaddr **lsa, socklen_t len) { struct l_sockaddr *kosa; - int bdom; + sa_family_t bdom; *lsa = NULL; if (len < 2 || len > UCHAR_MAX) return (EINVAL); bdom = bsd_to_linux_domain(sa->sa_family); - if (bdom == -1) + if (bdom == AF_UNKNOWN) return (EAFNOSUPPORT); kosa = malloc(len, M_LINUX, M_WAITOK); @@ -615,7 +615,7 @@ linux_to_bsd_sockaddr(const struct l_sockaddr *osa, struct sockaddr **sap, goto out; bdom = linux_to_bsd_domain(kosa->sa_family); - if (bdom == -1) { + if (bdom == AF_UNKNOWN) { error = EAFNOSUPPORT; goto out; } diff --git a/sys/compat/linux/linux_common.h b/sys/compat/linux/linux_common.h index 485ebaab58f2..97f5a259f300 100644 --- a/sys/compat/linux/linux_common.h +++ b/sys/compat/linux/linux_common.h @@ -38,8 +38,9 @@ unsigned short linux_ifflags(struct ifnet *); int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa); unsigned short bsd_to_linux_ifflags(int); -int linux_to_bsd_domain(int domain); -int bsd_to_linux_domain(int domain); +sa_family_t linux_to_bsd_domain(sa_family_t domain); +sa_family_t bsd_to_linux_domain(sa_family_t domain); +#define AF_UNKNOWN UINT8_MAX int bsd_to_linux_sockaddr(const struct sockaddr *sa, struct l_sockaddr **lsa, socklen_t len); int linux_to_bsd_sockaddr(const struct l_sockaddr *lsa, diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index ae22af90d443..1e578982fced 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -870,7 +870,8 @@ static const char *linux_netlink_names[] = { int linux_socket(struct thread *td, struct linux_socket_args *args) { - int domain, retval_socket, type; + int retval_socket, type; + sa_family_t domain; type = args->type & LINUX_SOCK_TYPE_MASK; if (type < 0 || type > LINUX_SOCK_MAX) @@ -880,7 +881,7 @@ linux_socket(struct thread *td, struct linux_socket_args *args) if (retval_socket != 0) return (retval_socket); domain = linux_to_bsd_domain(args->domain); - if (domain == -1) { + if (domain == AF_UNKNOWN) { /* Mask off SOCK_NONBLOCK / CLOEXEC for error messages. */ type = args->type & LINUX_SOCK_TYPE_MASK; if (args->domain == LINUX_AF_NETLINK && @@ -2309,8 +2310,8 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) name, &newval, UIO_SYSSPACE, &len); if (error != 0) return (error); - newval = bsd_to_linux_domain(newval); - if (newval == -1) + newval = bsd_to_linux_domain((sa_family_t)newval); + if (newval == AF_UNKNOWN) return (ENOPROTOOPT); return (linux_sockopt_copyout(td, &newval, len, args)); From nobody Fri Mar 29 20:36:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5sct3Wvyz5Fgrb; Fri, 29 Mar 2024 20:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5sct0H7zz4DPK; Fri, 29 Mar 2024 20:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711744574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WCMJlGBhv8jRXvgz2bvSM/0oGXkmgzl8FiJ7fha6HBY=; b=drGk8wn8LqHv2iy41M5M0RPPVbABOL/SgrEy6p0JSUhSOc8/OniLF+Z/70Z3+J/6ZpBfz8 gl5mM3T5Q+OIUjkL/zJGxUiDHYoc5mQyNmohc/i6TrKoy0B4c5tbrjwisDvQFJ5CkJuvqr kIQjdTrIHIOPsx/+7S/7qqyMQsIR/iDXGMtEdpIA/6ACwIBYEvnUkUXV915blwwe9+ZEzK WFBUG3NRkmn3aOXImn6UTU5s8JscYdVivUzeDTWBa5AlM90WgQTfSxEB85TMtQ9mhZWt17 Yw9hgSEWkCCKG1EKd583aukueKfy0VxC53r7nO5wKJvcPVanBw0zz8pP9Hxw1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711744574; a=rsa-sha256; cv=none; b=Q5I1DI2ori7wU03ei0kwyJRqa0tQGcb3lf+24QBEBYlxiXx9Z7rpGVVtxLGUPaWtY/qhg/ AFJ7weY5dcywg49saa3Fbx8z7UutOtRBv/epSG6JTbp98hzYUFD70lZOyZTX40k8IlLmK/ jEjRxP9d4LQTw1fuVwet/amLzdyt/fp9lELkoE4pKI8CZ6JbsX0tBIIu60O69cJ16dtLae caNyDq8P7fH7X3j1J6FV2U5h2bQfzUubhF8pgMugCd3S8PxfTXMgzI1+D5N0Jy5h/M/Unz r5DCfXziLhYOpzdta0qX1Ef8yQWjZhaOM/9BWkdSn5Op4c3wHNYazkDq1NBz2g== 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=1711744574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WCMJlGBhv8jRXvgz2bvSM/0oGXkmgzl8FiJ7fha6HBY=; b=aa/Wq3AmtyeM6CustLNnl2CRFpfWlidT81MC8JPQJwGaCXglPPsQTK0/Ujsyfy9ma44vv9 slzxKyiTtyb1YLwU3XnlL6QuYTxF0PTGjWWrKT8JbF+lAFiWCkrwr0BnkTgs1czdgKyLAf Q3AX/hexKCstFEgOZd8LRxw3qeohFKz13oA4aynTlpE1C3E2Oa8yFK/MXvmRdNDsu4xGXF Y7f454D2ig1EJO44tCD44KGHFx/vj6wdeFKVlBmacd8VfP7RYZ4A+4YBYJvZQiXNyIU1V4 lVQlaPzpMrTf/hYC+I89l12/SKz2KIr602mMSdbujsS48tTkPwIOBhdHlFqyVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5scs714dzQ99; Fri, 29 Mar 2024 20:36: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 42TKaDDE023294; Fri, 29 Mar 2024 20:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TKaDlZ023291; Fri, 29 Mar 2024 20:36:13 GMT (envelope-from git) Date: Fri, 29 Mar 2024 20:36:13 GMT Message-Id: <202403292036.42TKaDlZ023291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: b977dd1ea5fb - main - linux: make linux_netlink_p->msg_from_linux be able to fail List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b977dd1ea5fbc2df3f1279330be4d089322eb2cf Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b977dd1ea5fbc2df3f1279330be4d089322eb2cf commit b977dd1ea5fbc2df3f1279330be4d089322eb2cf Author: Gleb Smirnoff AuthorDate: 2024-03-29 20:35:51 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-29 20:35:51 +0000 linux: make linux_netlink_p->msg_from_linux be able to fail The KPI for this function was misleading. From the NetLink perspective it looked like a function that: a) allocates new hdr, b) can fail. Neither was true. Let the function return a error code instead of returning the same hdr it was passed to. In case if future Linux NetLink compatibility support calls for reallocating header, pass hdr as pointer to pointer. With KPI that returns a error, propagate domain conversion errors all the way up to NetLink module. This fixes panic when unknown domain is converted to 0xff and this invalid value is passed into NetLink processing. PR: 274536 Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D44392 --- sys/compat/linux/linux_netlink.c | 58 ++++++++++++++++++++++++++-------------- sys/netlink/netlink_io.c | 22 +++++++-------- sys/netlink/netlink_linux.h | 2 +- 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c index d2afec24fe71..8675f830b4ef 100644 --- a/sys/compat/linux/linux_netlink.c +++ b/sys/compat/linux/linux_netlink.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -73,37 +72,55 @@ _rta_get_uint32(const struct rtattr *rta) return (*((const uint32_t *)NL_RTA_DATA_CONST(rta))); } -static struct nlmsghdr * +static int rtnl_neigh_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) { struct ndmsg *ndm = (struct ndmsg *)(hdr + 1); + sa_family_t f; + + if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct ndmsg)) + return (EBADMSG); + if ((f = linux_to_bsd_domain(ndm->ndm_family)) == AF_UNKNOWN) + return (EPFNOSUPPORT); - if (hdr->nlmsg_len >= sizeof(struct nlmsghdr) + sizeof(struct ndmsg)) - ndm->ndm_family = linux_to_bsd_domain(ndm->ndm_family); + ndm->ndm_family = f; - return (hdr); + return (0); } -static struct nlmsghdr * +static int rtnl_ifaddr_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) { struct ifaddrmsg *ifam = (struct ifaddrmsg *)(hdr + 1); + sa_family_t f; - if (hdr->nlmsg_len >= sizeof(struct nlmsghdr) + sizeof(struct ifaddrmsg)) - ifam->ifa_family = linux_to_bsd_domain(ifam->ifa_family); + if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct ifaddrmsg)) + return (EBADMSG); + if ((f = linux_to_bsd_domain(ifam->ifa_family)) == AF_UNKNOWN) + return (EPFNOSUPPORT); - return (hdr); + ifam->ifa_family = f; + + return (0); } -static struct nlmsghdr * +/* + * XXX: in case of error state of hdr is inconsistent. + */ +static int rtnl_route_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) { /* Tweak address families and default fib only */ struct rtmsg *rtm = (struct rtmsg *)(hdr + 1); struct nlattr *nla, *nla_head; int attrs_len; + sa_family_t f; - rtm->rtm_family = linux_to_bsd_domain(rtm->rtm_family); + if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct rtmsg)) + return (EBADMSG); + if ((f = linux_to_bsd_domain(rtm->rtm_family)) == AF_UNKNOWN) + return (EPFNOSUPPORT); + rtm->rtm_family = f; if (rtm->rtm_table == 254) rtm->rtm_table = 0; @@ -122,7 +139,7 @@ rtnl_route_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) switch (rta->rta_type) { case NL_RTA_TABLE: if (!valid_rta_u32(rta)) - goto done; + return (EBADMSG); rtm->rtm_table = 0; uint32_t fibnum = _rta_get_uint32(rta); RT_LOG(LOG_DEBUG3, "GET RTABLE: %u", fibnum); @@ -133,13 +150,13 @@ rtnl_route_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) } } -done: - return (hdr); + return (0); } -static struct nlmsghdr * +static int rtnl_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) { + switch (hdr->nlmsg_type) { case NL_RTM_GETROUTE: case NL_RTM_NEWROUTE: @@ -157,21 +174,22 @@ rtnl_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) default: RT_LOG(LOG_DEBUG, "Passing message type %d untranslated", hdr->nlmsg_type); + /* XXXGL: maybe return error? */ } - return (hdr); + return (0); } -static struct nlmsghdr * -nlmsg_from_linux(int netlink_family, struct nlmsghdr *hdr, +static int +nlmsg_from_linux(int netlink_family, struct nlmsghdr **hdr, struct nl_pstate *npt) { switch (netlink_family) { case NETLINK_ROUTE: - return (rtnl_from_linux(hdr, npt)); + return (rtnl_from_linux(*hdr, npt)); } - return (hdr); + return (0); } diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index 61d9d657556a..2dd49d5e8eb5 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -275,25 +275,21 @@ nl_receive_message(struct nlmsghdr *hdr, int remaining_length, npt->hdr = hdr; - if (hdr->nlmsg_flags & NLM_F_REQUEST && hdr->nlmsg_type >= NLMSG_MIN_TYPE) { + if (hdr->nlmsg_flags & NLM_F_REQUEST && + hdr->nlmsg_type >= NLMSG_MIN_TYPE) { NL_LOG(LOG_DEBUG2, "handling message with msg type: %d", hdr->nlmsg_type); - - if (nlp->nl_linux && linux_netlink_p != NULL) { - struct nlmsghdr *hdr_orig = hdr; - hdr = linux_netlink_p->msg_from_linux(nlp->nl_proto, hdr, npt); - if (hdr == NULL) { - /* Failed to translate to kernel format. Report an error back */ - hdr = hdr_orig; - npt->hdr = hdr; - if (hdr->nlmsg_flags & NLM_F_ACK) - nlmsg_ack(nlp, EOPNOTSUPP, hdr, npt); - return (0); - } + if (nlp->nl_linux) { + MPASS(linux_netlink_p != NULL); + error = linux_netlink_p->msg_from_linux(nlp->nl_proto, + &hdr, npt); + if (error) + goto ack; } error = handler(hdr, npt); NL_LOG(LOG_DEBUG2, "retcode: %d", error); } +ack: if ((hdr->nlmsg_flags & NLM_F_ACK) || (error != 0 && error != EINTR)) { if (!npt->nw->suppress_ack) { NL_LOG(LOG_DEBUG3, "ack"); diff --git a/sys/netlink/netlink_linux.h b/sys/netlink/netlink_linux.h index 2d9f8d1b7bd6..d4c451d470b2 100644 --- a/sys/netlink/netlink_linux.h +++ b/sys/netlink/netlink_linux.h @@ -38,7 +38,7 @@ struct nl_pstate; struct nl_writer; typedef bool msgs_to_linux_cb_t(struct nl_writer *nw, struct nlpcb *nlp); -typedef struct nlmsghdr *msg_from_linux_cb_t(int netlink_family, struct nlmsghdr *hdr, +typedef int msg_from_linux_cb_t(int netlink_family, struct nlmsghdr **hdr, struct nl_pstate *npt); struct linux_netlink_provider { From nobody Fri Mar 29 23:13:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5x5s5sNHz5G01S; Fri, 29 Mar 2024 23:13: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 4V5x5s5c9Vz4Tw3; Fri, 29 Mar 2024 23:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711753985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SjDjCshZjrYeS9/FeE6OUJw0ltPqMYFn7oXFk//aZdM=; b=aXfO6zUhkfNwgGuqcUkUxOkuS3wgk3+uLmCM4Q4SSsPQSQc1eR6cWrMyfkXjeTI1JtnlNA +D+Jjn+KOzhOdaB5Rbe/O4wSKMZWE5XVt0Yu6nhW6oxf5N5nbIJWC+J6CpBSE/x9g8z754 G48ShSv+Iua3J1bVp7epeXZUAPRZ2Izr5rgtf+2XtXA2GE51fV5xQDPhQ+cBcyhSgYMLhs t8zm1jsrE3S27PIF0gbuKmXdPLEN8WBlESpOh4466VqNSikDFhwWJURAEsloM+7V5eXPxQ ZWGP40bbajtuDv/QSJLQ86ti7ruAdcAGlA67OmY3uTPe4IDjW+01fWezUVo7ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711753985; a=rsa-sha256; cv=none; b=oGhd9r3QoWUpSHZRzQIxNrNkk0PIJVS4Kx+NL1RWQt2wGJ3qg1qYuVxxikphVU8eUkwAny qksiCeiWaMsmt/fhnS3Fn8ePantegGpenQLXnWjLPn4LFwgP9nvUquV2xPZrOVY+gCA2Ac Wq61oLl3TzwkHrMo8G2DiphC8D55/D7g4xTonSjldsYBN2uNgZs41KfCziwq9iHk168vBf tKdpoaqO9vAmnwuWvL+vSPdXd7nTDrNfkS8bmNFt+H6DOw0uLYDKCLYZd9W4jPeolYcPjX OZDg3hSuZoW26Pca0NwSi1FFq0ke2T5wHt4dEnTkHnqJBVqZKiCKSDC5QS25rw== 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=1711753985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SjDjCshZjrYeS9/FeE6OUJw0ltPqMYFn7oXFk//aZdM=; b=cFVlXxXXarNPwu7rw19wAJhHlDSTzUWMMj0aXw7qkfDArux6uFC5CvpEWfO43kzcnZVlaM DzBB7yh5VwuyBB7oRiO/STamzkWvc+1q2Kyxh2z43QYpt28pKUp2EV1Ex4eL+I78wHw3rg W9xfBKg++fJ8PVQB6nAyy4NdKOURZpDwkgnOnSwGCV8C6XRtQKGNeKwrI1dNOuCiScfyqJ 7DgbghKbjODJCWCrYZvDZ1N44BIGKYnUoYtY6HP+/FD9gTJZqjUvvv1YgkwV0+prK8hjE9 tM6azHi58SewHUn4NOzFt4oeuzfOurlWgSwjxsUHRKbuZnzdbrpBHZ4NOAGWiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5x5s5BmDzVyx; Fri, 29 Mar 2024 23:13: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 42TND5Yi094336; Fri, 29 Mar 2024 23:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TND5pI094333; Fri, 29 Mar 2024 23:13:05 GMT (envelope-from git) Date: Fri, 29 Mar 2024 23:13:05 GMT Message-Id: <202403292313.42TND5pI094333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5ca8e32633c4 - main - vf_i2c: split up and add ACPI attachments in addition to FDT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c commit 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c Author: Pierre-Luc Drouin AuthorDate: 2024-03-22 22:12:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-03-29 23:04:51 +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. MFC after: 7 days Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI) Based on: D24917 by Val Packett (initial early version) Differential Revision: https://reviews.freebsd.org/D44020 --- sys/arm/freescale/vybrid/files.vybrid | 3 +- sys/conf/files.arm64 | 4 +- .../iicbus/controller}/vybrid/vf_i2c.c | 239 +++++++++++---------- 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(+), 120 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 679d442f672b..293a0ae1c0f9 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -669,7 +669,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 cc0b32bb4759..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,12 +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 @@ -50,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 */ @@ -85,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 }, @@ -143,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); @@ -200,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"); @@ -218,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) { @@ -237,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); @@ -244,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; @@ -262,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; @@ -278,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; @@ -297,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; @@ -307,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; @@ -355,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; @@ -405,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); @@ -428,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) { @@ -483,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); @@ -496,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); @@ -548,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); @@ -579,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), @@ -601,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..3498911dfd9c --- /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 dcd9e25b1cb3..748b0b18a14d 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -397,6 +397,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 Fri Mar 29 23:13:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5x5v0rT4z5G037; Fri, 29 Mar 2024 23:13: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 4V5x5t6RJxz4Txv; Fri, 29 Mar 2024 23:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711753986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2nPvv2mlq4wdpODCt7r3VpndA5ooPsMW3guWnXQ9hEU=; b=mamHT+BQ/eSQYb1nr7w4YMQYp+i9HDTOUvjMzyM/9bHnbXPM7V+QvONf233zP1/BxiveHg Z6h8gzUG5mVzggvpYJn9lMdfAzrgln5Aojhg/ih3c6mKUpfWxK1cYZD65C4leAEEAELL70 oz3cqaMkbmtZTkDXcjMbleUzHsbNvFS0WrqDSOv3pD5Aa72fuMSgtjSJclDt7yVSsuEP0D 0wfCdvX4D4mkCdW9WjU8wIxB8GB0j+DFZMDTkuOvn+5zBSJgTSuvOfisZJrGB2LGnr8hRW dOj56jyv3XYxMZ9mrLPNDypI0WrXleJ/VTJOY5MApGLxT4WsZ78MKqATqdKzQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711753986; a=rsa-sha256; cv=none; b=vRPUVRf5aB0NbE0wGsW/5+BtM4cWHMwkz+CMnDFRhk9sSaBNx9idAulPeg683p8nnb8arq UB6jjVtWB6Ywk8zFsK6nqiVJqcjKaajjoxQue0h8n2VLkA9v/6qBMV5viS5DEQ4azD9naj HSTTuiTlBkjzdSRZRElEfy/AoEV0jnUHQrX/2my608AX79GbLPXt+jU5vin/+POE0UbV4Y zRZ24KBOlk+Xac1F+CEkdyQ7DbysEOOlfiE8MHYMWJ3e58e5QaKf9yGXb62q/E59BUjAgu zRXfVo17RYt609dawQGT99C5f20b+TUpO+8HQMlDlpj7frz7VvRR02rsstZY3w== 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=1711753986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2nPvv2mlq4wdpODCt7r3VpndA5ooPsMW3guWnXQ9hEU=; b=LJsRMILJ1EcQSW+LACBHRPeOj0uK+mfa4dzrxM5yV+UZaIqJUaXqrWmjDC8EpnMqD3HIa2 0/C3n2CLwECFScBUZS/9HvLgQFjfGUkWNVBznBr0L6nLLAUDRLaR/F4/4kmEsw3E7WNdM3 j9A5cOSvx1VgXWcRL84HTg75MQ59VuEStFkdBFPmNhfBGJV7BNzTPlWSqMz06wgKHWwbLU El8ftQf7WuaLEAnelZ6xIRjuqnSQgOljn+dHwph/8qU+syGCGeI2atDyfkBdQETvUUYzch pkF/+Nf7wzq3xrntrEwV4uzMsSBmaGJ1IW6FBNCoWjfWtH7lahyBboUsLjRm1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5x5t5ymXzWBm; Fri, 29 Mar 2024 23:13:06 +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 42TND6uH094382; Fri, 29 Mar 2024 23:13:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42TND6qG094379; Fri, 29 Mar 2024 23:13:06 GMT (envelope-from git) Date: Fri, 29 Mar 2024 23:13:06 GMT Message-Id: <202403292313.42TND6qG094379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 44847114bd4c - main - vf_i2c: update I2C controller logic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 44847114bd4c61ed3dfcc879fa0d7deb452e12d3 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=44847114bd4c61ed3dfcc879fa0d7deb452e12d3 commit 44847114bd4c61ed3dfcc879fa0d7deb452e12d3 Author: Pierre-Luc Drouin AuthorDate: 2024-03-22 22:13:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-03-29 23:05:03 +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. MFC after: 7 days Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI) Differential Revision: https://reviews.freebsd.org/D44021 --- 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 3498911dfd9c..ba391e70bafc 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 Sat Mar 30 02:33:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V61YP2Gmdz5FvQl; Sat, 30 Mar 2024 02:33: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 4V61YP1lyLz3xnt; Sat, 30 Mar 2024 02:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711766025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tgm94cRifwjj5rogPdX2Jb+h1kXTmyPoSajcYjANVF8=; b=pr+VG/LTcnolAqIGy0pmkBCivDHa2f+U3Y2UTzER60HDw4lj3Xu+ZuWvmyKrwbK1loxnV6 HL/EFAueNbe0Ed6UWYiodnrGPLI5hOduvtzFtDZ3RqS1K1oe99WSHaKX/HI/S2IxcheTK9 hoYdf4i+qj7Jus/DzwKUkRnPh1Fqr/oXdkYYLA0md/fiB+uOdhi6AHvDqWmQAwkWbTh7je YtW+54mD8IKei6IGFYF3w9HxPMmcor3IoHfHbAn+Pqfv98b7KmHuLqAxRip//kXGY47yYw i0cSL8fi1CnUkpBvAL9JuLcJ04yjKB08l3nL4ThgwKijn2RI/SZ0ej0tJ1CqJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711766025; a=rsa-sha256; cv=none; b=Mxm748HFSK9Ov3551LXwGww60Y54WcLu3R0Qt0rNAw7a1Tk2e3mFfLQpoSFgO+JrU/SqGK VyhF9+LKImiTLmlEz6sCMbrTT6UxueZJz7JfMLxAub8fSq3k9RH07mhgkB3NPHVLo7xqdA tn3pYa19TJSSfHHjrCb4OP1dRMNHSeQIB6or8EjOlnYXsezwRQKed0j0rDKU7w+FOmXcXC QuskO6UqqNezbBdT1yGbbaC1PFXqnJQz59WT7/dgl36/307bOYr+FHJNfekYKqGrBNhENx fue3HqjvypDVcOiJdxide+7OVIFSsYWB+MbFuCpyku7Msr7bPKHguHJ2+1w63g== 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=1711766025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tgm94cRifwjj5rogPdX2Jb+h1kXTmyPoSajcYjANVF8=; b=xUUGqbc6f+iDHOcyEXDd5KkZJhULWdvMWpnM8oTLv0+C6Ezvad/JEFRnO+QyuRDSLO6woA PlsaTfQyPl0g+yMPCDL069tctxfyVykp8fEX3vcioUtLTpQZzc3YLr+BwplPbeDbFfx6eU oKRMPEAbbKLWqoAO6OO5J+tyy40kn6+hqpVoJCxEfowR/raTzaJX0FedEV6wyESGPHf/ly Xhlm+qnvar2AdexJDRJCcF66sy+l2xMcbWmtc9689RI5KPRqW+PaVHpYaFi4KP9ZaYCEe7 vZYV+dEuMfakLHaneYam4edBPOz8LaTnirkqgW9ER1rVra6BHBZi98F7Jzyl3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V61YP1MKczcYX; Sat, 30 Mar 2024 02:33: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 42U2Xj2h032320; Sat, 30 Mar 2024 02:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42U2XjLs032318; Sat, 30 Mar 2024 02:33:45 GMT (envelope-from git) Date: Sat, 30 Mar 2024 02:33:45 GMT Message-Id: <202403300233.42U2XjLs032318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 298b8f1cf0f4 - main - dts: Fix arm dts path for marvell too List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 298b8f1cf0f45f65573d8cf5efd78cfccb44790a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=298b8f1cf0f45f65573d8cf5efd78cfccb44790a commit 298b8f1cf0f45f65573d8cf5efd78cfccb44790a Author: Bjoern A. Zeeb AuthorDate: 2024-03-30 02:31:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-03-30 02:31:32 +0000 dts: Fix arm dts path for marvell too Linux 6.5 moved to a vendor-based subdirectory for arm DTS, change our Makefiles accordingly. This makes universe also compile arm.armv7 ARMADA38X sucessfully. --- sys/modules/dtb/mv/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/dtb/mv/Makefile b/sys/modules/dtb/mv/Makefile index 3e6da07796a4..0c78527b1fcc 100644 --- a/sys/modules/dtb/mv/Makefile +++ b/sys/modules/dtb/mv/Makefile @@ -2,8 +2,8 @@ .if ${MACHINE_ARCH} == "armv7" DTS= \ - armada-388-clearfog.dts \ - armada-388-gp.dts + marvell/armada-388-clearfog.dts \ + marvell/armada-388-gp.dts .elif ${MACHINE_ARCH} == "aarch64" DTS= \ marvell/armada-3720-espressobin.dts \ From nobody Sat Mar 30 08:40:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V69h30T09z5GYNy; Sat, 30 Mar 2024 08:40: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 4V69h24nypz4ZH2; Sat, 30 Mar 2024 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711788002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eURcU35ta45VpV9O1FHZgcKvBYBOd9gvyhack/oJo2g=; b=a+4wwYmQHitUBlCErMaGVqVD2HzXBKkkn5VHhKkkcmRvizCvmjcXaZRjJkgQbDfEZh5a6e qsazh/hXrUuDGZwrYpwS+do7GgLKhXHvmG6TZd8QQBhR/pi9dFr30YqoL8+k4BZwsFxUVZ tP4UJl3XQh78PJkKimCzwmSICzCfHArWJQhxrt0AqTmFnsEd6MlEESXXCDOx5Xg71gSbVy ZYLe5hXFHzhyCi5k0XMRzvpk20H1y9D0QK5CpAF6T5pbq62v5M05B7rf9S2FdWd9idXUg6 69onWSiIg4BGUuA98dCKCd/qKf0mxtjwnaUefT9OxVjOb7Dqfcu0KS1Wcv6MiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711788002; a=rsa-sha256; cv=none; b=MnWfE0RxsllMpuEz/MkzlsU/cMVsMCpyyV08JJJi4TMtEhDsIWi21YWBncx3A9zn0bIUqj 10+u8tepJC0xykurQ9Many87tNppQMnQVcO6pzeMvBmmFuPpeOYYFBumEE45/PVzAlGbeb KOzTxNMPBr+Hip7QakAVKNBvvUlKuWYhbSs5Wc2tDCuoTGtDx3SZUTJ4xlyHqGZzka2EXw p0yNNvj+t2Gh8tJ1axNjfTL6SMnu7orAj670+GpJuY14L3JBRagQyQWGpaFqwvCXwN4ybN vPEXZGmWzSTLmLmULczTU5lMPvS9VeNdQlY7SL47CR29c635jpr+OS2kSlrWSA== 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=1711788002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eURcU35ta45VpV9O1FHZgcKvBYBOd9gvyhack/oJo2g=; b=xylnF4LR4BnLY3Ci1wAUL8RHFENriQuEJB866W7ickl5T3XTRAptTSpYMjlz+VxKCyP63b hYDLHSqHQYG6PFIVo6OAznQoyVvD1c0LQMeduEZzSbLwjbv8nqUrffzDodEtXhBk35kfjE A+QNh910v64rE+ye/LZC3kD3JUxW9D9q6ZrifZZB4hphNkbPPdr+XJdWCtxV3E7Xvjy+lI SpyYsPcyPZBUoIbyE5HuZlyS0AL53sK5PZZiElozvefD4vUJ+9XEn5A3d3rjaN6jk59Zkt vn/++QIzQgpVxaet9XQqzENQZ4tU1nUZIJRkXCxMfmVM9l2/9w4S8yWZMVygNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V69h20cL0zn11; Sat, 30 Mar 2024 08:40: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 42U8e103044145; Sat, 30 Mar 2024 08:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42U8e1JP044140; Sat, 30 Mar 2024 08:40:01 GMT (envelope-from git) Date: Sat, 30 Mar 2024 08:40:01 GMT Message-Id: <202403300840.42U8e1JP044140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 0cade5566091 - main - pkgbase: Remove FreeBSD-ipfilter package List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cade55660917ecb3aff7a904759e1eb46772dab Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=0cade55660917ecb3aff7a904759e1eb46772dab commit 0cade55660917ecb3aff7a904759e1eb46772dab Author: Emmanuel Vadot AuthorDate: 2024-03-30 08:36:35 +0000 Commit: Emmanuel Vadot CommitDate: 2024-03-30 08:39:52 +0000 pkgbase: Remove FreeBSD-ipfilter package Put the periodic script for ipfilter in the FreeBSD-ipf package with all the utilities. PR: 278042 Sponsored by: Beckhoff Automation GmbH & Co. KG --- usr.sbin/periodic/etc/security/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/periodic/etc/security/Makefile b/usr.sbin/periodic/etc/security/Makefile index ddc51a672ae0..f70aa23a1445 100644 --- a/usr.sbin/periodic/etc/security/Makefile +++ b/usr.sbin/periodic/etc/security/Makefile @@ -24,7 +24,7 @@ DATAPACKAGE= periodic CONFGROUPS+= IPFILTER IPFILTER+= 510.ipfdenied IPFILTER+= 610.ipf6denied -IPFILTERPACKAGE= ipfilter +IPFILTERPACKAGE= ipf .endif .if ${MK_IPFW} != "no" From nobody Sat Mar 30 14:50:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6KvZ2CtQz5Fmbn; Sat, 30 Mar 2024 14:50: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 4V6KvZ1lD0z49jC; Sat, 30 Mar 2024 14:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711810234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=283eW5lKuHoTFxp+E3gkPRAMofUWdK7CMCsd3xodDXk=; b=aodQWKNNu3XTg0S/naf/0thq7kkZrN1KMkYmLUfR8swWHChWtqQFGOx3JwxEg4EPSXwhlR BX6AFofPv/yb5rC00qF5JjWeiqCkxTz3MXZ5ikDYazHTPlbbKWt/UlZWHitNZYHKbAME43 rarHHjSXYVpXz2BO3USLU4rlwF+jAYyrI6+svXTSmJsHv34g98L8e7t9MI5oU9Y774gnF5 NqIFpmBylTbIrv2B00Nu/u0HoiXwctLU+lIsSIlnkryVeYfbVIbIf+m/3y2u/udGuOzrQf pfy7jNzLFUej4Ohyjh8SEGEIQVUkMn6m/qBdy/CzMgMfAFkiCvEuoWEuWEZuVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711810234; a=rsa-sha256; cv=none; b=C2nksULnrUIHd8Per7Hdj93d4VhrzpDstym4/JZ09Nw0/lPvxokz7Ku226OZGq6mJHVecb REUiU0vS3akjoFICIJw03HfTwkjg+8V8/BsMPS5jbjFcZDMp7J/+jvKD4aE5ahpXsrY6Wp UF3lnCttEj8fSkDum8+WZHrM1hmJzG172b5QVuphhDMq2wZEdpFopHcx7SVIYsQAC65ala Ez9oeB7OpV1Vm9yodKrg7dclyn0d8bh/IRuL0Qbw0E8NfwC8t5udYyJY5Z9By92OXYfN+A Wfgd31YgfZnST2J8nl7zhKBrJbMS1UcP2aAhSolqFLlETzHuDRYSw6iGl+762A== 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=1711810234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=283eW5lKuHoTFxp+E3gkPRAMofUWdK7CMCsd3xodDXk=; b=Go7Sq+MLXHiFN2vJ4mqfpeUl6BW6O1TZ24Lak0s01GHjos8SgrV9ZNx/RkjMv/u8vtPHR8 I1HLbRBEHDa1B+HCr5uqrqkwRfY2r2MlZhwvErzshqUXt3rqDd07rs4hY7MVUzL+BnMn4s b/+vzm5RB23vCn7PKAFjEjoOXFzFmETR0ZyYLf/HS28jhmraWH/PbBXWalbD7jUzpXQdV6 4mo6puW5HsiP1qJtWK3+hpFbZkjYSFVu/KG1zJ6lDlBRyI4ZKjwlfyLlD+zcg178nEcyxw BeC4Ce/rRGoxUSj2bIYAWtbEMr3PpRuRWh5/krkdSlP80gyxNvOccifO51xV8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6KvZ1HX7zy69; Sat, 30 Mar 2024 14:50: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 42UEoYqR077630; Sat, 30 Mar 2024 14:50:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42UEoYRE077627; Sat, 30 Mar 2024 14:50:34 GMT (envelope-from git) Date: Sat, 30 Mar 2024 14:50:34 GMT Message-Id: <202403301450.42UEoYRE077627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9241ebc796c1 - main - thread_single(9): decline external requests for traced or debugger-stopped procs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9241ebc796c11cf133c550f188f324bd2c12d89a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9241ebc796c11cf133c550f188f324bd2c12d89a commit 9241ebc796c11cf133c550f188f324bd2c12d89a Author: Konstantin Belousov AuthorDate: 2024-03-27 12:29:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-30 14:43:52 +0000 thread_single(9): decline external requests for traced or debugger-stopped procs Debugger has the powers to cause unbound delay in single-threading, which then blocks the threaded taskqueue. The reproducer is `truss -f timeout 2 sleep 10`. Reported by: mjg Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44523 --- 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 5847d5ceab59..0bcd5c2f2add 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1248,6 +1248,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 Sat Mar 30 18:46:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6R7h0fQHz5GCvh; Sat, 30 Mar 2024 18:46: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 4V6R7h0Mc9z4Z4r; Sat, 30 Mar 2024 18:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711824384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+lLbopNXLN0WDmdnzYCvmpzstbtaFdevp8bA+z4lco=; b=qU3jvaPZDXEXJy90q3dXLK+yUHcLvqZF5oKqYjhovHS0eHrwIV9xhZJBop/7RJ3KTPvtoT aZQPO430SAsf0h9j3i1kMMUZdiQpXlkZEcSBkq9ndMdCQ2IKkTGi7nMvtaPkO5dlguZn8i Vw1/ROAUeZ/oN4b3Cg7JWkyOLxISf1lCOij++C//mYcB1waMSbg/rhvctiQj6PW8rrPNM1 DDevZKXazI5njvqprczIWOj6wqvPXVtMYXms46WrZOOy4DQaoa0/zpAOE45jXD9gd63+5y FoCUojyzYBJyiVZcpyRsQl+OZUEAh0xjMRjuo5Yy+bk1bRJBEEZ5DobpOkn5Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711824384; a=rsa-sha256; cv=none; b=Ic9BUOmbn2wv5RS5/USM8jEemAjvRWC2aeYZR1widwnqd8a5QX1ek2tezHU8DGw1Cx2BMZ izYk8Dwoa/do9knbFZa8WwvyCtaGUAiCme6e3WRGUrOh/yKU4zVnQwKIqJdXJAE1nUhHwM uCTskR75hw1fiAsWemqznF18mLcMJOFpSYcXhTadN4eDloqHEO/rGnQYkmYR55a5kxbq1J OK5MteUxfJaVRKt47lQXwxv50LJAa4z6TlN4XDNq1UC56mjsp1mcu6m2JP6OzalWI1dDlh 5cHHbbhPkm5QSPm5s/OR3PxSL03mB9Zp9Z1MnyEfj60+b6QrAmNTuQ3YKIqORQ== 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=1711824384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+lLbopNXLN0WDmdnzYCvmpzstbtaFdevp8bA+z4lco=; b=SEwZ0aTOaL6NfAffW48XMjQgEG6PaRx40X/N88SKq8PgeeHghtCq6Y0cZAG+pKIbn3P4yK yTq2ceEqOcpAXrzYhon7CPByukPEek5fs7yipYautVNCRxVpEj7mtzQu6RUxbt++jRFpWp S//eJ9cDWTiJsovlS9yDctPq1qq9PJxOWWh2PStlfTq2DSI9ZQfK2gL8I44HUMa+p+tOtR +HHEx7I0wNjpAlJaoT563J8WQThkwpbdnQJRJS5VocyUowGLud1keOlsskyilPb9f6rLlb cPw2+MrWTKhqW+5pAg76jH9X0IoTX8t0GIVhW97eOQ05l882yE7DIYS/iEAdmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6R7g72GHz15Xn; Sat, 30 Mar 2024 18:46: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 42UIkNl9075063; Sat, 30 Mar 2024 18:46:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42UIkNxo075060; Sat, 30 Mar 2024 18:46:23 GMT (envelope-from git) Date: Sat, 30 Mar 2024 18:46:23 GMT Message-Id: <202403301846.42UIkNxo075060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: fd6cb031f577 - main - arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1] List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd6cb031f577a449894e73daa8f6bd309ba27c73 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=fd6cb031f577a449894e73daa8f6bd309ba27c73 commit fd6cb031f577a449894e73daa8f6bd309ba27c73 Author: Eliot Solomon AuthorDate: 2024-03-24 19:01:47 +0000 Commit: Alan Cox CommitDate: 2024-03-30 18:37:17 +0000 arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1] The ATTR_CONTIGUOUS bit within an L3 page table entry designates that L3 page as being part of an aligned, physically contiguous collection of L3 pages. For example, 16 aligned, physically contiguous 4 KB pages can form a 64 KB superpage, occupying a single TLB entry. While this change only creates ATTR_CONTIGUOUS mappings in a few places, specifically, the direct map and pmap_kenter{,_device}(), it adds all of the necessary code for handling them once they exist, including demotion, protection, and removal. Consequently, new ATTR_CONTIGUOUS usage can be added (and tested) incrementally. Modify the implementation of sysctl vm.pmap.kernel_maps so that it correctly reports the number of ATTR_CONTIGUOUS mappings on machines configured to use a 16 KB base page size, where an ATTR_CONTIGUOUS mapping consists of 128 base pages. Additionally, this change adds support for creating L2 superpage mappings to pmap_kenter{,_device}(). Reviewed by: markj Tested by: gallatin Differential Revision: https://reviews.freebsd.org/D42737 --- sys/arm64/arm64/pmap.c | 767 +++++++++++++++++++++++++++++++++++++++++++++--- sys/arm64/include/pte.h | 21 ++ 2 files changed, 740 insertions(+), 48 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index ba72f1dac8d0..12e5e1d73b38 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -461,18 +461,33 @@ static bool pmap_activate_int(pmap_t pmap); static void pmap_alloc_asid(pmap_t pmap); static int pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, int mode, bool skip_unmapped); +static bool pmap_copy_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, + pt_entry_t l3e, vm_page_t ml3, struct rwlock **lockp); static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va); static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, struct rwlock **lockp); static pt_entry_t *pmap_demote_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va); +static bool pmap_demote_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static int pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, vm_page_t m, struct rwlock **lockp); +static bool pmap_every_pte_zero(vm_paddr_t pa); +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte, bool promoted, + bool all_l3e_AF_set); +static pt_entry_t pmap_load_l3c(pt_entry_t *l3p); +static void pmap_mask_set_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, + vm_offset_t *vap, vm_offset_t va_next, pt_entry_t mask, pt_entry_t nbits); +static bool pmap_pv_insert_l3c(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct rwlock **lockp); +static void pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va); static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pd_entry_t l1e, struct spglist *free, struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp); +static bool pmap_remove_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, + vm_offset_t *vap, vm_offset_t va_next, vm_page_t ml3, struct spglist *free, + struct rwlock **lockp); static void pmap_reset_asid_set(pmap_t pmap); static bool pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m, struct rwlock **lockp); @@ -483,6 +498,8 @@ static vm_page_t _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); +static void pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, + vm_offset_t va, vm_size_t size); static __inline vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); static uma_zone_t pmap_bti_ranges_zone; @@ -1121,19 +1138,20 @@ pmap_bootstrap_l2_block(struct pmap_bootstrap_state *state, int i) static void pmap_bootstrap_l3_page(struct pmap_bootstrap_state *state, int i) { + pt_entry_t contig; u_int l3_slot; bool first; - if ((physmap[i + 1] - state->pa) < L3_SIZE) + if (physmap[i + 1] - state->pa < L3_SIZE) return; /* Make sure there is a valid L2 table */ pmap_bootstrap_l2_table(state); MPASS((state->va & L3_OFFSET) == 0); - for (first = true; + for (first = true, contig = 0; state->va < DMAP_MAX_ADDRESS && - (physmap[i + 1] - state->pa) >= L3_SIZE; + physmap[i + 1] - state->pa >= L3_SIZE; state->va += L3_SIZE, state->pa += L3_SIZE) { /* * Stop if we are about to walk off the end of what the @@ -1142,13 +1160,27 @@ pmap_bootstrap_l3_page(struct pmap_bootstrap_state *state, int i) if (!first && (state->pa & L2_OFFSET) == 0) break; + /* + * If we have an aligned, contiguous chunk of L3C_ENTRIES + * L3 pages, set the contiguous bit within each PTE so that + * the chunk can be cached using only one TLB entry. + */ + if ((state->pa & L3C_OFFSET) == 0) { + if (state->va + L3C_SIZE < DMAP_MAX_ADDRESS && + physmap[i + 1] - state->pa >= L3C_SIZE) { + contig = ATTR_CONTIGUOUS; + } else { + contig = 0; + } + } + first = false; l3_slot = pmap_l3_index(state->va); MPASS((state->pa & L3_OFFSET) == 0); MPASS(state->l3[l3_slot] == 0); pmap_store(&state->l3[l3_slot], PHYS_TO_PTE(state->pa) | ATTR_DEFAULT | ATTR_S1_XN | ATTR_KERN_GP | - ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L3_PAGE); + ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | contig | L3_PAGE); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); } @@ -1649,6 +1681,17 @@ static u_long pmap_l2_promotions; SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLAG_RD, &pmap_l2_promotions, 0, "2MB page promotions"); +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l3c, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "64KB page mapping counters"); + +static u_long pmap_l3c_demotions; +SYSCTL_ULONG(_vm_pmap_l3c, OID_AUTO, demotions, CTLFLAG_RD, + &pmap_l3c_demotions, 0, "64KB page demotions"); + +static u_long pmap_l3c_mappings; +SYSCTL_ULONG(_vm_pmap_l3c, OID_AUTO, mappings, CTLFLAG_RD, + &pmap_l3c_mappings, 0, "64KB page mappings"); + /* * If the given value for "final_only" is false, then any cached intermediate- * level entries, i.e., L{0,1,2}_TABLE entries, are invalidated in addition to @@ -2016,7 +2059,8 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) pd_entry_t *pde; pt_entry_t attr, old_l3e, *pte; vm_offset_t va; - int lvl; + vm_page_t mpte; + int error, lvl; KASSERT((pa & L3_OFFSET) == 0, ("pmap_kenter: Invalid physical address")); @@ -2026,7 +2070,7 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) ("pmap_kenter: Mapping is not page-sized")); attr = ATTR_DEFAULT | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | - ATTR_KERN_GP | ATTR_S1_IDX(mode) | L3_PAGE; + ATTR_KERN_GP | ATTR_S1_IDX(mode); old_l3e = 0; va = sva; while (size != 0) { @@ -2035,8 +2079,55 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) ("pmap_kenter: Invalid page entry, va: 0x%lx", va)); KASSERT(lvl == 2, ("pmap_kenter: Invalid level %d", lvl)); + /* + * If we have an aligned, contiguous chunk of L2_SIZE, try + * to create an L2_BLOCK mapping. + */ + if ((va & L2_OFFSET) == 0 && size >= L2_SIZE && + (pa & L2_OFFSET) == 0 && vm_initialized) { + mpte = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(pde))); + KASSERT(pmap_every_pte_zero(VM_PAGE_TO_PHYS(mpte)), + ("pmap_kenter: Unexpected mapping")); + PMAP_LOCK(kernel_pmap); + error = pmap_insert_pt_page(kernel_pmap, mpte, false, + false); + if (error == 0) { + attr &= ~ATTR_CONTIGUOUS; + + /* + * Although the page table page "mpte" should + * be devoid of mappings, the TLB might hold + * intermediate entries that reference it, so + * we perform a single-page invalidation. + */ + pmap_update_entry(kernel_pmap, pde, + PHYS_TO_PTE(pa) | attr | L2_BLOCK, va, + PAGE_SIZE); + } + PMAP_UNLOCK(kernel_pmap); + if (error == 0) { + va += L2_SIZE; + pa += L2_SIZE; + size -= L2_SIZE; + continue; + } + } + + /* + * If we have an aligned, contiguous chunk of L3C_ENTRIES + * L3 pages, set the contiguous bit within each PTE so that + * the chunk can be cached using only one TLB entry. + */ + if ((va & L3C_OFFSET) == 0 && (pa & L3C_OFFSET) == 0) { + if (size >= L3C_SIZE) + attr |= ATTR_CONTIGUOUS; + else + attr &= ~ATTR_CONTIGUOUS; + } + pte = pmap_l2_to_l3(pde, va); - old_l3e |= pmap_load_store(pte, PHYS_TO_PTE(pa) | attr); + old_l3e |= pmap_load_store(pte, PHYS_TO_PTE(pa) | attr | + L3_PAGE); va += PAGE_SIZE; pa += PAGE_SIZE; @@ -2069,6 +2160,8 @@ pmap_kremove(vm_offset_t va) pt_entry_t *pte; pte = pmap_pte_exists(kernel_pmap, va, 3, __func__); + KASSERT((pmap_load(pte) & ATTR_CONTIGUOUS) == 0, + ("pmap_kremove: unexpected ATTR_CONTIGUOUS")); pmap_clear(pte); pmap_s1_invalidate_page(kernel_pmap, va, true); } @@ -2083,8 +2176,9 @@ pmap_kremove(vm_offset_t va) void pmap_kremove_device(vm_offset_t sva, vm_size_t size) { - pt_entry_t *pte; + pt_entry_t *ptep, *ptep_end; vm_offset_t va; + int lvl; KASSERT((sva & L3_OFFSET) == 0, ("pmap_kremove_device: Invalid virtual address")); @@ -2093,13 +2187,55 @@ pmap_kremove_device(vm_offset_t sva, vm_size_t size) va = sva; while (size != 0) { - pte = pmap_pte_exists(kernel_pmap, va, 3, __func__); - pmap_clear(pte); + ptep = pmap_pte(kernel_pmap, va, &lvl); + KASSERT(ptep != NULL, ("Invalid page table, va: 0x%lx", va)); + switch (lvl) { + case 2: + KASSERT((va & L2_OFFSET) == 0, + ("Unaligned virtual address")); + KASSERT(size >= L2_SIZE, ("Insufficient size")); - va += PAGE_SIZE; - size -= PAGE_SIZE; + if (va != sva) { + pmap_s1_invalidate_range(kernel_pmap, sva, va, + true); + } + pmap_clear(ptep); + pmap_s1_invalidate_page(kernel_pmap, va, true); + PMAP_LOCK(kernel_pmap); + pmap_remove_kernel_l2(kernel_pmap, ptep, va); + PMAP_UNLOCK(kernel_pmap); + + va += L2_SIZE; + sva = va; + size -= L2_SIZE; + break; + case 3: + if ((pmap_load(ptep) & ATTR_CONTIGUOUS) != 0) { + KASSERT((va & L3C_OFFSET) == 0, + ("Unaligned L3C virtual address")); + KASSERT(size >= L3C_SIZE, + ("Insufficient L3C size")); + + ptep_end = ptep + L3C_ENTRIES; + for (; ptep < ptep_end; ptep++) + pmap_clear(ptep); + + va += L3C_SIZE; + size -= L3C_SIZE; + break; + } + pmap_clear(ptep); + + va += PAGE_SIZE; + size -= PAGE_SIZE; + break; + default: + __assert_unreachable(); + break; + } } - pmap_s1_invalidate_range(kernel_pmap, sva, va, true); + if (va != sva) + pmap_s1_invalidate_range(kernel_pmap, sva, va, true); } /* @@ -2961,6 +3097,8 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwlock **lockp, int domain) tpte = pmap_load(pte); if ((tpte & ATTR_SW_WIRED) != 0) continue; + if ((tpte & ATTR_CONTIGUOUS) != 0) + (void)pmap_demote_l3c(pmap, pte, va); tpte = pmap_load_clear(pte); m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tpte)); if (pmap_pte_dirty(pmap, tpte)) @@ -3443,6 +3581,44 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entry_t l2e, u_int flags, return (true); } +/* + * Conditionally creates the PV entries for a L3C superpage mapping if + * the required memory can be allocated without resorting to reclamation. + */ +static bool +pmap_pv_insert_l3c(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct rwlock **lockp) +{ + pv_entry_t pv; + vm_offset_t tva; + vm_paddr_t pa __diagused; + vm_page_t mt; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((va & L3C_OFFSET) == 0, + ("pmap_pv_insert_l3c: va is not aligned")); + pa = VM_PAGE_TO_PHYS(m); + KASSERT((pa & L3C_OFFSET) == 0, + ("pmap_pv_insert_l3c: pa is not aligned")); + CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); + for (mt = m, tva = va; mt < &m[L3C_ENTRIES]; mt++, tva += L3_SIZE) { + /* Pass NULL instead of lockp to disable reclamation. */ + pv = get_pv_entry(pmap, NULL); + if (__predict_false(pv == NULL)) { + while (tva > va) { + mt--; + tva -= L3_SIZE; + pmap_pvh_free(&mt->md, pmap, tva); + } + return (false); + } + pv->pv_va = tva; + TAILQ_INSERT_TAIL(&mt->md.pv_list, pv, pv_next); + mt->md.pv_gen++; + } + return (true); +} + static void pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) { @@ -3547,6 +3723,9 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + old_l3 = pmap_load(l3); + if ((old_l3 & ATTR_CONTIGUOUS) != 0) + (void)pmap_demote_l3c(pmap, l3, va); old_l3 = pmap_load_clear(l3); pmap_s1_invalidate_page(pmap, va, true); if (old_l3 & ATTR_SW_WIRED) @@ -3570,6 +3749,95 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, return (pmap_unuse_pt(pmap, va, l2e, free)); } +/* + * Removes the specified L3C superpage mapping. Requests TLB invalidations + * to be performed by the caller through the returned "*vap". Returns true + * if the level 3 table "ml3" was unmapped and added to the spglist "free". + * Otherwise, returns false. + */ +static bool +pmap_remove_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, vm_offset_t *vap, + vm_offset_t va_next, vm_page_t ml3, struct spglist *free, + struct rwlock **lockp) +{ + struct md_page *pvh; + struct rwlock *new_lock; + pt_entry_t first_l3e, l3e, *tl3p; + vm_offset_t tva; + vm_page_t m, mt; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(((uintptr_t)l3p & ((L3C_ENTRIES * sizeof(pt_entry_t)) - 1)) == + 0, ("pmap_remove_l3c: l3p is not aligned")); + KASSERT((va & L3C_OFFSET) == 0, + ("pmap_remove_l3c: va is not aligned")); + + /* + * Hardware accessed and dirty bit maintenance might only update a + * single L3 entry, so we must combine the accessed and dirty bits + * from this entire set of contiguous L3 entries. + */ + first_l3e = pmap_load_clear(l3p); + for (tl3p = l3p + 1; tl3p < &l3p[L3C_ENTRIES]; tl3p++) { + l3e = pmap_load_clear(tl3p); + KASSERT((l3e & ATTR_CONTIGUOUS) != 0, + ("pmap_remove_l3c: l3e is missing ATTR_CONTIGUOUS")); + if ((l3e & (ATTR_SW_DBM | ATTR_S1_AP_RW_BIT)) == + (ATTR_SW_DBM | ATTR_S1_AP(ATTR_S1_AP_RW))) + first_l3e &= ~ATTR_S1_AP_RW_BIT; + first_l3e |= l3e & ATTR_AF; + } + if ((first_l3e & ATTR_SW_WIRED) != 0) + pmap->pm_stats.wired_count -= L3C_ENTRIES; + pmap_resident_count_dec(pmap, L3C_ENTRIES); + if ((first_l3e & ATTR_SW_MANAGED) != 0) { + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(first_l3e)); + new_lock = VM_PAGE_TO_PV_LIST_LOCK(m); + if (new_lock != *lockp) { + if (*lockp != NULL) { + /* + * Pending TLB invalidations must be + * performed before the PV list lock is + * released. Otherwise, a concurrent + * pmap_remove_all() on a physical page + * could return while a stale TLB entry + * still provides access to that page. + */ + if (*vap != va_next) { + pmap_invalidate_range(pmap, *vap, va, + true); + *vap = va_next; + } + rw_wunlock(*lockp); + } + *lockp = new_lock; + rw_wlock(*lockp); + } + pvh = page_to_pvh(m); + for (mt = m, tva = va; mt < &m[L3C_ENTRIES]; mt++, tva += + L3_SIZE) { + if (pmap_pte_dirty(pmap, first_l3e)) + vm_page_dirty(mt); + if ((first_l3e & ATTR_AF) != 0) + vm_page_aflag_set(mt, PGA_REFERENCED); + pmap_pvh_free(&mt->md, pmap, tva); + if (TAILQ_EMPTY(&mt->md.pv_list) && + TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(mt, PGA_WRITEABLE); + } + } + if (*vap == va_next) + *vap = va; + if (ml3 != NULL) { + ml3->ref_count -= L3C_ENTRIES; + if (ml3->ref_count == 0) { + _pmap_unwire_l3(pmap, va, ml3, free); + return (true); + } + } + return (false); +} + /* * Remove the specified range of addresses from the L3 page table that is * identified by the given L2 entry. @@ -3595,13 +3863,35 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, l3pg = !ADDR_IS_KERNEL(sva) ? PHYS_TO_VM_PAGE(PTE_TO_PHYS(l2e)) : NULL; va = eva; for (l3 = pmap_l2_to_l3(&l2e, sva); sva != eva; l3++, sva += L3_SIZE) { - if (!pmap_l3_valid(pmap_load(l3))) { + old_l3 = pmap_load(l3); + if (!pmap_l3_valid(old_l3)) { if (va != eva) { pmap_invalidate_range(pmap, va, sva, true); va = eva; } continue; } + if ((old_l3 & ATTR_CONTIGUOUS) != 0) { + /* + * Is this entire set of contiguous L3 entries being + * removed? Handle the possibility that "eva" is zero + * because of address wraparound. + */ + if ((sva & L3C_OFFSET) == 0 && + sva + L3C_OFFSET <= eva - 1) { + if (pmap_remove_l3c(pmap, l3, sva, &va, eva, + l3pg, free, lockp)) { + /* The L3 table was unmapped. */ + sva += L3C_SIZE; + break; + } + l3 += L3C_ENTRIES - 1; + sva += L3C_SIZE - L3_SIZE; + continue; + } + + (void)pmap_demote_l3c(pmap, l3, sva); + } old_l3 = pmap_load_clear(l3); if ((old_l3 & ATTR_SW_WIRED) != 0) pmap->pm_stats.wired_count--; @@ -3857,6 +4147,9 @@ retry: tpde = pmap_load(pde); pte = pmap_l2_to_l3(pde, pv->pv_va); + tpte = pmap_load(pte); + if ((tpte & ATTR_CONTIGUOUS) != 0) + (void)pmap_demote_l3c(pmap, pte, pv->pv_va); tpte = pmap_load_clear(pte); if (tpte & ATTR_SW_WIRED) pmap->pm_stats.wired_count--; @@ -3929,6 +4222,54 @@ pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pt_entry_t mask, pmap_s1_invalidate_page(pmap, sva, true); } +/* + * Masks and sets bits in the specified L3C superpage mapping. + * + * Requests TLB invalidations to be performed by the caller through the + * returned "*vap". + */ +static void +pmap_mask_set_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, + vm_offset_t *vap, vm_offset_t va_next, pt_entry_t mask, pt_entry_t nbits) +{ + pt_entry_t l3e, *tl3p; + vm_page_t m, mt; + bool dirty; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(((uintptr_t)l3p & ((L3C_ENTRIES * sizeof(pt_entry_t)) - 1)) == + 0, ("pmap_mask_set_l3c: l3p is not aligned")); + KASSERT((va & L3C_OFFSET) == 0, + ("pmap_mask_set_l3c: va is not aligned")); + dirty = false; + for (tl3p = l3p; tl3p < &l3p[L3C_ENTRIES]; tl3p++) { + l3e = pmap_load(tl3p); + KASSERT((l3e & ATTR_CONTIGUOUS) != 0, + ("pmap_mask_set_l3c: l3e is missing ATTR_CONTIGUOUS")); + while (!atomic_fcmpset_64(tl3p, &l3e, (l3e & ~mask) | nbits)) + cpu_spinwait(); + if ((l3e & (ATTR_SW_DBM | ATTR_S1_AP_RW_BIT)) == + (ATTR_SW_DBM | ATTR_S1_AP(ATTR_S1_AP_RW))) + dirty = true; + } + + /* + * When a dirty read/write superpage mapping is write protected, + * update the dirty field of each of the superpage's constituent 4KB + * pages. + */ + if ((l3e & ATTR_SW_MANAGED) != 0 && + (nbits & ATTR_S1_AP(ATTR_S1_AP_RO)) != 0 && + dirty) { + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l3p))); + for (mt = m; mt < &m[L3C_ENTRIES]; mt++) + vm_page_dirty(mt); + } + + if (*vap == va_next) + *vap = va; +} + /* * Masks and sets bits in last level page table entries in the specified * pmap and range @@ -4013,9 +4354,36 @@ pmap_mask_set_locked(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t m va, sva, true); va = va_next; } + if ((l3 & ATTR_CONTIGUOUS) != 0) { + l3p += L3C_ENTRIES - 1; + sva += L3C_SIZE - L3_SIZE; + } continue; } + if ((l3 & ATTR_CONTIGUOUS) != 0) { + /* + * Is this entire set of contiguous L3 entries + * being protected? Handle the possibility + * that "va_next" is zero because of address + * wraparound. + */ + if ((sva & L3C_OFFSET) == 0 && + sva + L3C_OFFSET <= va_next - 1) { + pmap_mask_set_l3c(pmap, l3p, sva, &va, + va_next, mask, nbits); + l3p += L3C_ENTRIES - 1; + sva += L3C_SIZE - L3_SIZE; + continue; + } + + (void)pmap_demote_l3c(pmap, l3p, sva); + + /* + * The L3 entry's accessed bit may have changed. + */ + l3 = pmap_load(l3p); + } while (!atomic_fcmpset_64(l3p, &l3, (l3 & ~mask) | nbits)) cpu_spinwait(); @@ -4141,9 +4509,10 @@ pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) * inconsistent state. */ static void -pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, +pmap_update_entry(pmap_t pmap, pd_entry_t *ptep, pd_entry_t newpte, vm_offset_t va, vm_size_t size) { + pd_entry_t *lip, *ptep_end; register_t intr; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -4151,6 +4520,11 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, if ((newpte & ATTR_SW_NO_PROMOTE) != 0) panic("%s: Updating non-promote pte", __func__); + if (size == L3C_SIZE) + ptep_end = ptep + L3C_ENTRIES; + else + ptep_end = ptep + 1; + /* * Ensure we don't get switched out with the page table in an * inconsistent state. We also need to ensure no interrupts fire @@ -4163,7 +4537,8 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, * unchanged, so that a lockless, concurrent pmap_kextract() can still * lookup the physical address. */ - pmap_clear_bits(pte, ATTR_DESCR_VALID); + for (lip = ptep; lip < ptep_end; lip++) + pmap_clear_bits(lip, ATTR_DESCR_VALID); /* * When promoting, the L{1,2}_TABLE entry that is being replaced might @@ -4173,7 +4548,10 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, pmap_s1_invalidate_range(pmap, va, va + size, false); /* Create the new mapping */ - pmap_store(pte, newpte); + for (lip = ptep; lip < ptep_end; lip++) { + pmap_store(lip, newpte); + newpte += PAGE_SIZE; + } dsb(ishst); intr_restore(intr); @@ -4321,8 +4699,7 @@ setl3: goto setl3; oldl3 &= ~ATTR_SW_DBM; } - if ((oldl3 & (ATTR_MASK & ~ATTR_AF)) != (newl2 & (ATTR_MASK & - ~ATTR_AF))) { + if ((oldl3 & ATTR_PROMOTE) != (newl2 & ATTR_PROMOTE)) { atomic_add_long(&pmap_l2_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" " in pmap %p", va, pmap); @@ -4338,7 +4715,7 @@ setl3: * such as pmap_enter_quick(), don't automatically mark the * underlying pages as referenced. */ - newl2 &= ~ATTR_AF | all_l3e_AF; + newl2 &= ~(ATTR_CONTIGUOUS | ATTR_AF | ATTR_DESCR_MASK) | all_l3e_AF; /* * Save the page table page in its current state until the L2 @@ -4363,10 +4740,7 @@ setl3: if ((newl2 & ATTR_SW_MANAGED) != 0) pmap_pv_promote_l2(pmap, va, PTE_TO_PHYS(newl2), lockp); - newl2 &= ~ATTR_DESCR_MASK; - newl2 |= L2_BLOCK; - - pmap_update_entry(pmap, l2, newl2, va & ~L2_OFFSET, L2_SIZE); + pmap_update_entry(pmap, l2, newl2 | L2_BLOCK, va & ~L2_OFFSET, L2_SIZE); atomic_add_long(&pmap_l2_promotions, 1); CTR2(KTR_PMAP, "pmap_promote_l2: success for va %#lx in pmap %p", va, @@ -4666,6 +5040,8 @@ havel3: * The physical page has changed. Temporarily invalidate * the mapping. */ + if ((orig_l3 & ATTR_CONTIGUOUS) != 0) + (void)pmap_demote_l3c(pmap, l3, va); orig_l3 = pmap_load_clear(l3); KASSERT(PTE_TO_PHYS(orig_l3) == opa, ("pmap_enter: unexpected pa update for %#lx", va)); @@ -4752,6 +5128,8 @@ validate: KASSERT(opa == pa, ("pmap_enter: invalid update")); if ((orig_l3 & ~ATTR_AF) != (new_l3 & ~ATTR_AF)) { /* same PA, different attributes */ + if ((orig_l3 & ATTR_CONTIGUOUS) != 0) + (void)pmap_demote_l3c(pmap, l3, va); orig_l3 = pmap_load_store(l3, new_l3); pmap_invalidate_page(pmap, va, true); if ((orig_l3 & ATTR_SW_MANAGED) != 0 && @@ -5278,6 +5656,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) vm_offset_t va_next; pd_entry_t *l0, *l1, *l2; pt_entry_t *l3; + bool partial_l3c; PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { @@ -5340,10 +5719,26 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) if (va_next > eva) va_next = eva; - for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, - sva += L3_SIZE) { + for (partial_l3c = true, l3 = pmap_l2_to_l3(l2, sva); + sva != va_next; l3++, sva += L3_SIZE) { if (pmap_load(l3) == 0) continue; + if ((pmap_load(l3) & ATTR_CONTIGUOUS) != 0) { + /* + * Avoid demotion for whole-page unwiring. + */ + if ((sva & L3C_OFFSET) == 0) { + /* + * Handle the possibility that + * "va_next" is zero because of + * address wraparound. + */ + partial_l3c = sva + L3C_OFFSET > + va_next - 1; + } + if (partial_l3c) + (void)pmap_demote_l3c(pmap, l3, sva); + } if ((pmap_load(l3) & ATTR_SW_WIRED) == 0) panic("pmap_unwire: l3 %#jx is missing " "ATTR_SW_WIRED", (uintmax_t)pmap_load(l3)); @@ -5360,6 +5755,58 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) PMAP_UNLOCK(pmap); } +/* + * This function requires that the caller has already added one to ml3's + * ref_count in anticipation of creating a 4KB page mapping. + */ +static bool +pmap_copy_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, pt_entry_t l3e, + vm_page_t ml3, struct rwlock **lockp) +{ + pt_entry_t *tl3p; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((va & L3C_OFFSET) == 0, + ("pmap_copy_l3c: va is not aligned")); + KASSERT((l3e & ATTR_SW_MANAGED) != 0, + ("pmap_copy_l3c: l3e is not managed")); + + /* + * Abort if a mapping already exists. + */ + for (tl3p = l3p; tl3p < &l3p[L3C_ENTRIES]; tl3p++) + if (pmap_load(tl3p) != 0) { + if (ml3 != NULL) + ml3->ref_count--; + return (false); + } + + if (!pmap_pv_insert_l3c(pmap, va, PHYS_TO_VM_PAGE(PTE_TO_PHYS(l3e)), + lockp)) { + if (ml3 != NULL) + pmap_abort_ptp(pmap, va, ml3); + return (false); + } + ml3->ref_count += L3C_ENTRIES - 1; + + /* + * Clear the wired and accessed bits. However, leave the dirty bit + * unchanged because read/write superpage mappings are required to be + * dirty. + */ + l3e &= ~(ATTR_SW_WIRED | ATTR_AF); + + for (tl3p = l3p; tl3p < &l3p[L3C_ENTRIES]; tl3p++) { + pmap_store(tl3p, l3e); + l3e += L3_SIZE; + } + pmap_resident_count_inc(pmap, L3C_ENTRIES); + atomic_add_long(&pmap_l3c_mappings, 1); + CTR2(KTR_PMAP, "pmap_copy_l3c: success for va %#lx in pmap %p", + va, pmap); + return (true); +} + /* * Copy the range specified by src_addr/len * from the source map to the range dst_addr/len @@ -5507,14 +5954,25 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, dst_pte = (pt_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte)); dst_pte = &dst_pte[pmap_l3_index(addr)]; - if (pmap_load(dst_pte) == 0 && + if ((ptetemp & ATTR_CONTIGUOUS) != 0 && (addr & + L3C_OFFSET) == 0 && addr + L3C_OFFSET <= + va_next - 1) { + if (!pmap_copy_l3c(dst_pmap, dst_pte, addr, + ptetemp, dstmpte, &lock)) + goto out; + addr += L3C_SIZE - PAGE_SIZE; + src_pte += L3C_ENTRIES - 1; + } else if (pmap_load(dst_pte) == 0 && pmap_try_insert_pv_entry(dst_pmap, addr, PHYS_TO_VM_PAGE(PTE_TO_PHYS(ptetemp)), &lock)) { /* - * Clear the wired, modified, and accessed - * (referenced) bits during the copy. + * Clear the wired, contiguous, modified, and + * accessed bits from the destination PTE. + * The contiguous bit is cleared because we + * are not copying the entire L3C superpage. */ - mask = ATTR_AF | ATTR_SW_WIRED; + mask = ATTR_SW_WIRED | ATTR_CONTIGUOUS | + ATTR_AF; nbits = 0; if ((ptetemp & ATTR_SW_DBM) != 0) nbits |= ATTR_S1_AP_RW_BIT; @@ -5879,9 +6337,13 @@ pmap_remove_pages(pmap_t pmap) lvl); } -/* - * We cannot remove wired pages from a process' mapping at this time - */ + /* + * We cannot remove wired mappings at this time. + * + * For L3C superpages, all of the constituent PTEs + * should have the wired bit set, so we don't + * check for ATTR_CONTIGUOUS here. + */ if (tpte & ATTR_SW_WIRED) { allfree = 0; continue; @@ -5912,6 +6374,11 @@ pmap_remove_pages(pmap_t pmap) /* * Update the vm_page_t clean/reference bits. + * + * We don't check for ATTR_CONTIGUOUS here + * because writeable L3C superpages are expected + * to be dirty, i.e., every constituent PTE + * should be dirty. */ if (pmap_pte_dirty(pmap, tpte)) { switch (lvl) { @@ -6000,7 +6467,7 @@ pmap_page_test_mappings(vm_page_t m, bool accessed, bool modified) struct rwlock *lock; pv_entry_t pv; struct md_page *pvh; - pt_entry_t *pte, mask, value; + pt_entry_t l3e, mask, *pte, value; pmap_t pmap; int md_gen, pvh_gen; bool rv; @@ -6033,8 +6500,11 @@ restart: mask |= ATTR_AF | ATTR_DESCR_MASK; value |= ATTR_AF | L3_PAGE; } - rv = (pmap_load(pte) & mask) == value; + l3e = pmap_load(pte); + if ((l3e & ATTR_CONTIGUOUS) != 0) + l3e = pmap_load_l3c(pte); PMAP_UNLOCK(pmap); + rv = (l3e & mask) == value; if (rv) goto out; } @@ -6205,6 +6675,15 @@ retry: pte = pmap_pte_exists(pmap, pv->pv_va, 3, __func__); oldpte = pmap_load(pte); if ((oldpte & ATTR_SW_DBM) != 0) { + if ((oldpte & ATTR_CONTIGUOUS) != 0) { + (void)pmap_demote_l3c(pmap, pte, pv->pv_va); + + /* + * The L3 entry's accessed bit may have + * changed. + */ + oldpte = pmap_load(pte); + } if (pmap->pm_stage == PM_STAGE1) { set = ATTR_S1_AP_RW_BIT; clear = 0; @@ -6362,11 +6841,23 @@ small_mappings: vm_page_dirty(m); if ((tpte & ATTR_AF) != 0) { if ((tpte & ATTR_SW_WIRED) == 0) { + /* + * Clear the accessed bit in this L3 entry + * regardless of the contiguous bit. + */ pmap_clear_bits(pte, ATTR_AF); pmap_invalidate_page(pmap, pv->pv_va, true); cleared++; } else not_cleared++; + } else if ((tpte & ATTR_CONTIGUOUS) != 0 && + (pmap_load_l3c(pte) & ATTR_AF) != 0) { + /* + * An L3C superpage mapping is regarded as accessed + * until the accessed bit has been cleared in all + * of its constituent entries. + */ + not_cleared++; } PMAP_UNLOCK(pmap); /* Rotate the PV list if it has more than one entry. */ @@ -6392,10 +6883,10 @@ void pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, int advice) { struct rwlock *lock; - vm_offset_t va, va_next; + vm_offset_t va, va_next, dva; vm_page_t m; pd_entry_t *l0, *l1, *l2, oldl2; - pt_entry_t *l3, oldl3; + pt_entry_t *l3, *dl3, oldl3; PMAP_ASSERT_STAGE1(pmap); @@ -6490,13 +6981,59 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, int advice) m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(oldl3)); vm_page_dirty(m); } - while (!atomic_fcmpset_long(l3, &oldl3, - (oldl3 & ~ATTR_AF) | - ATTR_S1_AP(ATTR_S1_AP_RO))) - cpu_spinwait(); - } else if ((oldl3 & ATTR_AF) != 0) + if ((oldl3 & ATTR_CONTIGUOUS) != 0) { + /* + * Unconditionally demote the L3C + * superpage because we do not allow + * writeable, clean superpages. + */ + (void)pmap_demote_l3c(pmap, l3, sva); + + /* + * Destroy the final mapping before the + * next L3C boundary or va_next, + * whichever comes first, so that a + * subsequent access may act as a + * repromotion trigger. + */ + if ((oldl3 & ATTR_SW_WIRED) == 0) { + dva = MIN((sva & ~L3C_OFFSET) + + L3C_SIZE - PAGE_SIZE, + va_next - PAGE_SIZE); + dl3 = pmap_l2_to_l3(l2, dva); + KASSERT(pmap_load(dl3) != 0, + ("pmap_advise: invalid PTE")); + lock = NULL; + pmap_remove_l3(pmap, dl3, dva, + pmap_load(l2), NULL, &lock); + if (lock != NULL) + rw_wunlock(lock); + } + + /* + * The L3 entry's accessed bit may have + * changed. + */ + oldl3 = pmap_load(l3); + } + + /* + * Check that we did not just destroy this entry so + * we avoid corrupting the page able. + */ *** 242 LINES SKIPPED *** From nobody Sat Mar 30 20:54:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6Tzt2ldYz5G0RB; Sat, 30 Mar 2024 20:54: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 4V6Tzt2D3Fz4pJ0; Sat, 30 Mar 2024 20:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711832090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lG9lUxFOLhiXhdvz9ftZuEnmdtOHsPB8dtW8NglEWE=; b=BOC1ONOjeDGV4gas/4LpPjKuN1vlhA1AjoU9wACV9xOeObumqIzRO4QpuvTs6pX3mUXjn0 RMNNkQkNriw3Bz9rezpxvz8gh2v4chRReW2UnsRf7vdygq7EqZRnPD1NFA/6+bCIWLL7xR nwAtE59yb3nsn/0KaRYXrrsbDMzDZtVrMmRo3ZuY8So1FjbRO/qiz8U+gZgPOi4TXJ4BaQ 17W8g+FLzCctgboAsMm0P+LFPRhcUwXTLntOhsZNDW5TkR2uSQjdDi/OFRUphhSihlmdY8 0P1Zbe9F9dyVZLEW3XO0dOWgspVlKEIzVbQddyYSxyiuC6o/Pfn+tlCHh5zEzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711832090; a=rsa-sha256; cv=none; b=PQzIE/m411md5xDYmTG67hizYWQ60qk0Y9hPAq/Xvbko5sYp0pY0+/Q/4dGAtaz/lHU43l tpfbzxZOgHgSUAfB1MW72MXPV6xPHG/KB0hrLrdJvIlUMPd9aV8DB9Sy5v25tickmk7SLj /RU1XMXqCqv6K9CQ2oIR3s+cNZoqSdm5lHNl+lV/IFtqlGHB1hbAebenhqW7LZqqcgNhvs ecBlKwWjaMEAqsz35JjGd1mUMXnPRcfH1ekDqNDO3EIOnKzx1aKtFLUFQRfwgbChz1Yzfc ruhCSqvx1yObneFEiGorK0E8rjXyb36iPURCYxi5TEoj9PAcTPnZfiqa8THdDQ== 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=1711832090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lG9lUxFOLhiXhdvz9ftZuEnmdtOHsPB8dtW8NglEWE=; b=ZxhkrU0jGfv0FeM4aC14cJMwGnGjQxpqoVOPhr3NleJNAfkQbLj1R5xHcZSG4XRhe5MuJa WqQFtbvF3dHqCNW52oeK8s2La6t1DoBOZZLmDt1RKAV8tAAgHARcvsPT8mq4aadXNG3mrw R54EvQPWWsqOJIdECQkdtGu/woPBUD0f03TkwW7C+tKvbkVHlTQ1/rWssVHkjxEWAAi1sn fCt2f1Uv/Dbwl4wtms6fkDYu8ATqaac9smHGtXytfV/zJ4uvalude5eURpzzso+45cmGyO xN49zP5iMglM4JZshd/RSZvk7j+SxKUjsMX5gclyYuhwVu8cEkkxyEcTB0+7/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6Tzt1rC3z18lQ; Sat, 30 Mar 2024 20:54: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 42UKsocA093095; Sat, 30 Mar 2024 20:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42UKso8X093092; Sat, 30 Mar 2024 20:54:50 GMT (envelope-from git) Date: Sat, 30 Mar 2024 20:54:50 GMT Message-Id: <202403302054.42UKso8X093092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: e0388a906ca7 - main - arm64: enable superpage mappings by pmap_mapdev{,_attr}() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0388a906ca77d07c99e8762d47dccaaaefd8bab Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=e0388a906ca77d07c99e8762d47dccaaaefd8bab commit e0388a906ca77d07c99e8762d47dccaaaefd8bab Author: Alan Cox AuthorDate: 2024-03-30 20:35:32 +0000 Commit: Alan Cox CommitDate: 2024-03-30 20:41:30 +0000 arm64: enable superpage mappings by pmap_mapdev{,_attr}() In order for pmap_kenter{,_device}() to create superpage mappings, either 64 KB or 2 MB, pmap_mapdev{,_attr}() must request appropriately aligned virtual addresses. Reviewed by: markj Tested by: gallatin Differential Revision: https://reviews.freebsd.org/D42737 --- sys/kern/subr_devmap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/kern/subr_devmap.c b/sys/kern/subr_devmap.c index 5976f16c7577..441ffeb1270a 100644 --- a/sys/kern/subr_devmap.c +++ b/sys/kern/subr_devmap.c @@ -273,6 +273,13 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t size) KASSERT(va >= VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE, ("Too many early devmap mappings")); } else +#endif +#ifdef __aarch64__ + if (size >= L2_SIZE && (pa & L2_OFFSET) == 0) + va = kva_alloc_aligned(size, L2_SIZE); + else if (size >= L3C_SIZE && (pa & L3C_OFFSET) == 0) + va = kva_alloc_aligned(size, L3C_SIZE); + else #endif va = kva_alloc(size); if (!va) @@ -304,6 +311,13 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) KASSERT(va >= (VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE)), ("Too many early devmap mappings 2")); } else +#ifdef __aarch64__ + if (size >= L2_SIZE && (pa & L2_OFFSET) == 0) + va = kva_alloc_aligned(size, L2_SIZE); + else if (size >= L3C_SIZE && (pa & L3C_OFFSET) == 0) + va = kva_alloc_aligned(size, L3C_SIZE); + else +#endif va = kva_alloc(size); if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); From nobody Sat Mar 30 22:56:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6Xgp4f2Kz5GD8s; Sat, 30 Mar 2024 22:56: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 4V6Xgp3RL2z51Wj; Sat, 30 Mar 2024 22:56:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711839366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v83iIsQCGSsgJ57SN+YOKD/cBI79Gey56HEqBVaJYqw=; b=dNdpGd1aTlWT3c2e3l0bvYS81WV3y67pVuUKQbR0vYyuu4D3AWeursuwIVOUcFb4AhxSe6 MqwVjs/CsRLypuyFT8giHwqkCF9+KsuQsoSSdnkVSkhILSa07nZ4ajWkyN2zsDLfHMRwq7 K7aADBtr3y7XEWo70DEHR8C8WRIOIn0DLsdmYZcaqL4jC2EW6yUgEO7MuDq723SFr/+Ku2 hnKMBM1PwV1dKNmz35Qkl3kqiRDCP33MiovXc54IIExWMQEy14VWFPlJK0Hwyv9CpN2XaP eJMEjd2i59v9ihMKXv0HrosnfrtpsiI8xKK7o84srWXfuokYxJxDuJdMElRbCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711839366; a=rsa-sha256; cv=none; b=rAvMuZ/4K0x54QegLtqyCCjf5AjMHg649gGXKsBWF77UIoTvBwduQ546RMTMB6gjW8MJSE yNZuJb83xCYcEQhMkBsOvYgRoIi94Zx51/UgkpnLu/mKLsoG0sLsg7LTMJD7/e1gfbMFkb hse/85c9yjsNxi1CwiL7+Mn0jdWrzqL8WvFQc8pSpz1C9FPJF93k6HLd0twKKMCnLyEy9d v9h1j/NEXgEVSHppa/fjvyVNI9q7J3X9ZIL66etX3iFrQHRB6APj11kylCbpPqc2zaxkxy uwUlIUuYpdspK3MSssttN5X0wfV7kMEFBaJH9aS6sc75J9IQY2OJKA0dT1Fo0g== 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=1711839366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v83iIsQCGSsgJ57SN+YOKD/cBI79Gey56HEqBVaJYqw=; b=GRZormHSqE/iGp1UVIat7DxCxkpFil97/+aeDmwJgqefR16rT28EAnzeXfaSH4G0VdNS6s 6XVzYyoWq4KdEEwI99YMzSp1zWWuSb9qyxq9LPJRuZhGEbKW6On32mwdoJPvtIi3MVg42T 8I0yEru4Tk+PojtEfZHS98rnFtiVGcyVq5t8ZVEWasSpWogk43r+0KCHxcdRin5jF4cLc+ 1TYopznHyPx1Fwzm0PSSI4SUnHTfOjNDJERzHxDKQf7eXl1yJrQDbxRi6roHWAev/gUtLi nzhKQsFA4K7UyURR9f4oRaDjjHPyHkvrW8Wke0IybIS7zL+4nz0/L9VbsNLmuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6Xgp2Nwwz1CMW; Sat, 30 Mar 2024 22:56:06 +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 42UMu6fs098099; Sat, 30 Mar 2024 22:56:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42UMu3Vk098091; Sat, 30 Mar 2024 22:56:03 GMT (envelope-from git) Date: Sat, 30 Mar 2024 22:56:03 GMT Message-Id: <202403302256.42UMu3Vk098091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 783d3ff6d7fa - main - zfs: merge openzfs/zfs@39be46f43 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 783d3ff6d7fae619db8a7990b8a6387de0c677b5 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=783d3ff6d7fae619db8a7990b8a6387de0c677b5 commit 783d3ff6d7fae619db8a7990b8a6387de0c677b5 Merge: e0388a906ca7 39be46f43f96 Author: Martin Matuska AuthorDate: 2024-03-30 21:14:52 +0000 Commit: Martin Matuska CommitDate: 2024-03-30 22:54:24 +0000 zfs: merge openzfs/zfs@39be46f43 Notable upstream pull request merges: #15509 b1e46f869 Add ashift validation when adding devices to a pool #15927 45e23abed Update resume token at object receive #15941 bf8f72359 BRT: Skip duplicate BRT prefetches #15950 8cd8ccca5 BRT: Skip getting length in brt_entry_lookup() #15951 80cc51629 ZAP: Massively switch to _by_dnode() interfaces #15954 2c01cae8b BRT: Change brt_pending_tree sorting order #15955 4616b96a6 BRT: Relax brt_pending_apply() locking #15959 5c4a4f82c zio: update ZIO type x stage documentation #15962 493fcce9b Provide macros for setting and getting blkptr birth times #15963 90ff73235 freebsd: fix missing headers in distribution tarball #15967 f68bde723 BRT: Make BRT block sizes configurable #15976 c28f94f32 ZAP: Some cleanups/micro-optimizations #15995 cfb96c772 vdev_disk: clean up spa/bdev mode conversion #16006 c0aab8b8f zvols: prevent overflow of minor device numbers #16007 a89d209bb BRT: Fix holes cloning #16008 c9d8f6c59 Fix option string, adding -e and fixing order Obtained from: OpenZFS OpenZFS commit: 39be46f43f96fb7420386d03751b01f5cb376d6b sys/contrib/openzfs/cmd/zdb/zdb.c | 19 +- sys/contrib/openzfs/cmd/zdb/zdb_il.c | 12 +- sys/contrib/openzfs/cmd/zhack.c | 4 +- .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 2 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 115 +++- sys/contrib/openzfs/cmd/ztest.c | 8 +- sys/contrib/openzfs/config/kernel-filemap.m4 | 1 + sys/contrib/openzfs/config/kernel-mm-page-size.m4 | 17 + .../openzfs/config/kernel-vfs-file_range.m4 | 27 + sys/contrib/openzfs/config/kernel.m4 | 4 + sys/contrib/openzfs/include/libzfs.h | 5 +- sys/contrib/openzfs/include/os/freebsd/Makefile.am | 2 + sys/contrib/openzfs/include/os/linux/Makefile.am | 1 + .../include/os/linux/kernel/linux/mm_compat.h | 36 + .../include/os/linux/kernel/linux/mod_compat.h | 1 + sys/contrib/openzfs/include/sys/abd.h | 9 + sys/contrib/openzfs/include/sys/abd_impl.h | 26 +- sys/contrib/openzfs/include/sys/dmu.h | 4 +- sys/contrib/openzfs/include/sys/fs/zfs.h | 3 +- sys/contrib/openzfs/include/sys/spa.h | 63 +- sys/contrib/openzfs/include/sys/uberblock_impl.h | 2 +- sys/contrib/openzfs/include/sys/zap.h | 8 + sys/contrib/openzfs/include/sys/zap_impl.h | 1 + sys/contrib/openzfs/include/sys/zap_leaf.h | 8 +- sys/contrib/openzfs/include/sys/zio_impl.h | 56 +- sys/contrib/openzfs/lib/libzdb/libzdb.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 76 ++- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 5 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 8 +- sys/contrib/openzfs/man/man4/zfs.4 | 43 +- sys/contrib/openzfs/man/man8/zpool-add.8 | 18 +- sys/contrib/openzfs/man/man8/zpool-events.8 | 57 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 18 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 4 +- sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 123 +++- .../openzfs/module/os/linux/zfs/vdev_disk.c | 759 ++++++++++++++++----- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 5 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 8 +- .../openzfs/module/os/linux/zfs/zpl_file_range.c | 16 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 7 + sys/contrib/openzfs/module/zfs/abd.c | 42 ++ sys/contrib/openzfs/module/zfs/arc.c | 16 +- sys/contrib/openzfs/module/zfs/bpobj.c | 7 +- sys/contrib/openzfs/module/zfs/brt.c | 146 ++-- sys/contrib/openzfs/module/zfs/dbuf.c | 37 +- sys/contrib/openzfs/module/zfs/ddt.c | 4 +- sys/contrib/openzfs/module/zfs/dmu.c | 53 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 28 +- sys/contrib/openzfs/module/zfs/dmu_send.c | 6 +- sys/contrib/openzfs/module/zfs/dmu_traverse.c | 11 +- sys/contrib/openzfs/module/zfs/dnode.c | 4 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 21 +- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 7 +- sys/contrib/openzfs/module/zfs/dsl_destroy.c | 13 +- sys/contrib/openzfs/module/zfs/dsl_pool.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 31 +- sys/contrib/openzfs/module/zfs/metaslab.c | 11 +- sys/contrib/openzfs/module/zfs/spa.c | 23 +- sys/contrib/openzfs/module/zfs/spa_errlog.c | 26 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 2 +- sys/contrib/openzfs/module/zfs/uberblock.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 13 +- sys/contrib/openzfs/module/zfs/zap.c | 43 +- sys/contrib/openzfs/module/zfs/zap_leaf.c | 77 +-- sys/contrib/openzfs/module/zfs/zap_micro.c | 206 ++++-- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 4 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 6 +- sys/contrib/openzfs/module/zfs/zil.c | 14 +- sys/contrib/openzfs/module/zfs/zio.c | 45 +- sys/contrib/openzfs/module/zfs/zio_checksum.c | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 3 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 1 + .../tests/functional/bclone/bclone_common.kshlib | 47 +- .../functional/bclone/bclone_corner_cases.kshlib | 20 +- .../functional/cli_root/zpool_add/add-o_ashift.ksh | 17 +- .../cli_root/zpool_add/add_prop_ashift.ksh | 16 +- .../zpool_add/zpool_add--allow-ashift-mismatch.ksh | 0 .../cli_root/zpool_add/zpool_add_002_pos.ksh | 11 + .../cli_root/zpool_add/zpool_add_004_pos.ksh | 2 +- .../cli_root/zpool_add/zpool_add_005_pos.ksh | 2 + .../cli_root/zpool_add/zpool_add_009_neg.ksh | 2 + .../cli_root/zpool_add/zpool_add_010_pos.ksh | 2 +- .../tests/functional/cp_files/cp_files_002_pos.ksh | 6 +- sys/contrib/openzfs/udev/zvol_id.c | 9 +- sys/modules/zfs/zfs_config.h | 10 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 88 files changed, 1801 insertions(+), 841 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-mm-page-size.m4 index 000000000000,d5ebd926986a..d5ebd926986a mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-mm-page-size.m4 +++ b/sys/contrib/openzfs/config/kernel-mm-page-size.m4 diff --cc sys/contrib/openzfs/include/os/linux/kernel/linux/mm_compat.h index 000000000000,40056c68d6dd..40056c68d6dd mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/linux/kernel/linux/mm_compat.h +++ b/sys/contrib/openzfs/include/os/linux/kernel/linux/mm_compat.h diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh index 000000000000,000000000000..e69de29bb2d1 new file mode 100755 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh diff --cc sys/modules/zfs/zfs_config.h index d3fa8b6c5aff,000000000000..267fe048749c mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1194 -1,0 +1,1200 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* Define to 1 if you have the `execvpe' function. */ +/* #undef HAVE_EXECVPE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->setattr() exists */ +/* #undef HAVE_IOPS_SETATTR */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* strscpy() exists */ +/* #undef HAVE_KERNEL_STRSCPY */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + ++/* page_size() is available */ ++/* #undef HAVE_MM_PAGE_SIZE */ ++ +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename2() exists */ +/* #undef HAVE_RENAME2 */ + +/* struct inode_operations_wrapper takes .rename2() */ +/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* cs->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ *** 368 LINES SKIPPED *** From nobody Sun Mar 31 02:27:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6dNF0w9pz5GZNX; Sun, 31 Mar 2024 02:27:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V6dND738sz45sR; Sun, 31 Mar 2024 02:27:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711852077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Oum9ICSDsCZHWHEquoXLJE38MsUH7/lFMBgK+kvN8vY=; b=ttzJFlTV04PRriWXM5UtAluhldX06txDMk1ZAtDsfnlOaCL6Zt7Qs2NotQs6rqXedYyIPw ncA67JCnvT73RGemghBtO2pPM6F1pFGBN9Bg89cUP7JOUoH/WpTp+dDoaMQ+jQEgUEFsPm 9CrKdRkN2JI0k3YxzmOHsx5uFTILEGazGRsvQrCkQuhZmKzOIjwfXFdsCzDjw46gUEOE/w 5axBeqXRsAhW1+PLrDGcn42JiDhsccJqGWPsXMU7lT1JJr/QEJfxkoucfi929bRHWCFEA8 UkgdEgukrKtrvxk/Y6fHa71DTzKLQ4QP6+zhqQR5G47WRpBaoE3ikNBOkbfbhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711852077; a=rsa-sha256; cv=none; b=exP/DnHq7hMw5oh2IQ9p0q9WCKA4NeX3C4X7I2x1IMS6xI84ZQVJzIiJk+onCvfNCrJUAx pAZZKstLXmeymba5led/JfvP3guMF0PK0913s+YMFhBWgRx4Lx/XId2da6ZUelbiZy/UWS /8mARLn3Sr/85CV4/y//flV/qT9RHa+6P0cMNQ2PnvzC2IpRVA6yQI8B5qlQ7dk5DYkvna o1NZEr1/yyqSqp8k7TiAo9rLiAyFun//zJyICFG/VdK5OTRDOdsDQHCHKo5Yci0kESmgjR nWNL5Hq2e4l+DYUq1J7jM5N6uX3N4ZbeNAM/Yh+S52W8WrvLKhdFX0s04z4hcg== 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=1711852077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Oum9ICSDsCZHWHEquoXLJE38MsUH7/lFMBgK+kvN8vY=; b=oDVxH3R7TjPTB/Q2AINl8q5a0mSt2T/OyoJmbGuuiZJpXHxHTfdTlJFGTwLl2Gu7cRn/Jx UR4NSdRamfvk7Tso161qFmyNSwb0rUaSy+/Iij8h7ZQHzlc3K/kkggjiasb5wqmZMYxgzM FpuBZAg+1gAdsYPNce8kkSyOrFZASL40+NFTRLCbSnc+kxLnKqjsRjuMRMQbEDpUUuv1pe OD8c/fwCGrqcvNtpDr2wAaISdAb4oMX0Yk3sQfOveqjhg3RUZsTO8YP8KnVCtbTflSbEdy pq6n3zvmlT43UAUjlKq8cDz9TNkV5eIl/yvRrdpyVXi8z71EisZAmI2OZw94/A== Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4V6dND5tynz1SDc; Sun, 31 Mar 2024 02:27:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 551928D4A235; Sun, 31 Mar 2024 02:27:55 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id A2FF12D029D8; Sun, 31 Mar 2024 02:27:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id KjX9gQlMBZs5; Sun, 31 Mar 2024 02:27:53 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 8370E2D029D2; Sun, 31 Mar 2024 02:27:53 +0000 (UTC) Date: Sun, 31 Mar 2024 02:27:52 +0000 (UTC) From: "Bjoern A. Zeeb" To: Andrew Turner cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 47e073941f4e - main - Import the kernel parts of bhyve/arm64 In-Reply-To: <202402211855.41LItsm2033633@gitrepo.freebsd.org> Message-ID: <2onsq27n-sn4p-3842-26s2-7ns994o6q024@SerrOFQ.bet> References: <202402211855.41LItsm2033633@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Wed, 21 Feb 2024, Andrew Turner wrote: > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=47e073941f4e7ca6e9bde3fa65abbfcfed6bfa2b > > commit 47e073941f4e7ca6e9bde3fa65abbfcfed6bfa2b > Author: Andrew Turner > AuthorDate: 2024-01-09 15:22:27 +0000 > Commit: Andrew Turner > CommitDate: 2024-02-21 18:55:32 +0000 > > Import the kernel parts of bhyve/arm64 I still see the following warning on every arm64 compile. Can we somehow fix this? /usr/obj/freebsd-src/freebsd14-amd64/tmp/usr/bin/ld -m aarch64elf -Bdynamic -T /freebsd-src/sys/conf/ldscript.arm64 -warn-common --build-id=sha1 --no-relax --no-warn-mismatch --warn-common --export-dynamic --dynamic-linker /red/herring -X -o vmm_hyp_blob.elf.full vmm_hyp_exception.o vmm_hyp.o --defsym=text_start='0x0' ld: warning: cannot find entry symbol _start; not setting start address -- Bjoern A. Zeeb r15:7 From nobody Sun Mar 31 05:20:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6jCc1Q0Nz5GsYG; Sun, 31 Mar 2024 05:20: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 4V6jCc0WnRz4hq9; Sun, 31 Mar 2024 05:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711862444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXJYTkmVthCDCbc7cmFFhFr6Y1A5WFJuI0vgWdKeexo=; b=Ko9zQB9bJynZ/RKeDXn8kML48BuEnfPBSjFcLxCM8R0csQskQUjQnjhPjH3dsUa/OlsaOt oVArZb3xSeC4EVM+D3Eh8m5pzoHEL8fapFlqB5o9prjKD9xfMo3vSEy2YAqr8K+8VOO4Oo /3XQ8jL24KFsEzyIOBRSxbyTNTeD19Q/J353QbqOpoqAcocMGX7LMWhuL2hM7drhwUPT+L QRiFW23Zlrg+Xhwl0+HqZqLuscxogEdu220ZkUgGmgjgd9h67/Oxtynoulo1p/eMKHQEOR Yr08A+/NrBTYLJ8ZRjJ/yp0hNPimuZqkBl22PLZ98ZqC/zZbZN1EG7Fw+cQ2mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711862444; a=rsa-sha256; cv=none; b=weYYM6YLv9NL1CIpt4kwn+2fWK0RCg3dartCr2w1yI5CA9m7fAL9Xrkrowa5y9tHfd47Zx A04N+ybi1WNXys1vrOrQAO8tTC1MtSNX3DGXKYjWeasrRqk1OWGQ8AB0Kojz4ppqn/N91M i3fpE4k0nEaNsst4++8jciDi1MOM7aGGMCTuVGg4iIzQYfCpLbjI3r5DzbF53Sjff/YeEg 0IZ21lB4YXOMJdu+dzt1a5zOilyu9HdCYaGYs4pqxulTVBOD3Dz7QataCNg/UhBTE/GKSI j5J0LgRO9JbCXxwcm60U0mDCKLAA/u1ML8lk3kVHufa6pZtm4uQnHB8kp8DpPA== 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=1711862444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXJYTkmVthCDCbc7cmFFhFr6Y1A5WFJuI0vgWdKeexo=; b=TZ0kpZpEwJAfNhm6Z8gG+Gzj9NFAAXXqpzJ9x1chB67+q3Xz4urtkoGTYG8fI5Uq3KAoKk VYVhopyuJ6w3mdSBp7+AhFxjIouFVOHs1UwqsMUeqmbS46Nr7rYArAG432t3znW51mfC39 /1djvf/HcK7yLbCSBFLmNelUXWKsmPEVWuLAYysQw7TTbKhhjanoDRvB1zuPssccLRlmMM 82ppwhrxn8cftXZzebJrhVvx6JJvrJUl/ri5rq+yEnRiqvofK/stiSGMxdFdZyRTTZ0fXv OS8xQWH4YKCdV8qJqzJFcS+ikOYS3mRhCgladl7GW8vUhejkvHq25q9doGihBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6jCc01M2zPlL; Sun, 31 Mar 2024 05:20: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 42V5KhRV066102; Sun, 31 Mar 2024 05:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42V5KhWw066099; Sun, 31 Mar 2024 05:20:43 GMT (envelope-from git) Date: Sun, 31 Mar 2024 05:20:43 GMT Message-Id: <202403310520.42V5KhWw066099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: dc831e93bad6 - main - sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc831e93bad63f9faea09f1806a7733a40bff316 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=dc831e93bad63f9faea09f1806a7733a40bff316 commit dc831e93bad63f9faea09f1806a7733a40bff316 Author: Christos Margiolis AuthorDate: 2024-03-31 05:20:17 +0000 Commit: Christos Margiolis CommitDate: 2024-03-31 05:20:17 +0000 sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9) Currently the snd_clone framework creates device nodes on-demand for every channel, through the dsp_clone() callback, and is responsible for routing audio to the appropriate channel(s). This patch gets rid of the whole snd_clone framework (including any related sysctls) and instead uses DEVFS_CDEVPRIV(9) to handle device opening, channel allocation and audio routing. This results in a significant reduction in code size as well as complexity. Behavior that is preserved: - hw.snd.basename_clone. - Exclusive access of an audio device (i.e VCHANs disabled). - Multiple processes can read from/write to the device. - A device can only be opened as many times as the maximum allowed channel number (see SND_MAXHWCHAN in pcm/sound.h). - OSSv4 compatibility aliases are preserved. Behavior changes: Only one /dev/dspX device node is created (on attach) for each audio device, as opposed to the current /dev/dspX.Y devices created by snd_clone. According to the sound(4) man page, devices are not meant to be opened through /dev/dspX.Y anyway, so it is best if we do not create device nodes for them in the first place. As a result of this, modify dsp_oss_audioinfo() to print /dev/dspX in the "ai->devnode", instead of /dev/dspX.Y. Sponsored by: The FreeBSD Foundation MFC after: 2 months Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D44411 --- share/man/man4/pcm.4 | 53 +- sys/conf/files | 1 - sys/dev/sound/clone.c | 705 -------------------------- sys/dev/sound/clone.h | 127 ----- sys/dev/sound/pcm/dsp.c | 1027 ++++++++++++-------------------------- sys/dev/sound/pcm/dsp.h | 7 +- sys/dev/sound/pcm/sound.c | 194 +------ sys/dev/sound/pcm/sound.h | 6 +- sys/modules/sound/sound/Makefile | 2 +- 9 files changed, 329 insertions(+), 1793 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 17ac499e6bb3..e406bd2c8343 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 10, 2024 +.Dd March 24, 2024 .Dt SOUND 4 .Os .Sh NAME @@ -513,14 +513,6 @@ device state on each tick using a mechanism. Disabled by default and currently only available for a few device drivers. .El -.Ss Recording Channels -On devices that have more than one recording source (ie: mic and line), -there is a corresponding -.Pa /dev/dsp%d.r%d -device. -The -.Xr mixer 8 -utility can be used to start and stop recording from an specific device. .Ss Statistics Channel statistics are only kept while the device is open. So with situations involving overruns and underruns, consider the output @@ -542,36 +534,24 @@ functions. .Sh FILES The .Nm -drivers may create the following -device nodes: +drivers may create the following device nodes: .Pp -.Bl -tag -width ".Pa /dev/audio%d.%d" -compact -.It Pa /dev/audio%d.%d -Sparc-compatible audio device. -.It Pa /dev/dsp%d.%d -Digitized voice device. -.It Pa /dev/dspW%d.%d -Like -.Pa /dev/dsp , -but 16 bits per sample. -.It Pa /dev/dsp%d.p%d -Playback channel. -.It Pa /dev/dsp%d.r%d -Record channel. -.It Pa /dev/dsp%d.vp%d -Virtual playback channel. -.It Pa /dev/dsp%d.vr%d -Virtual recording channel. +.Bl -tag -width ".Pa /dev/sndstat" -compact +.It Pa /dev/dsp%d +Audio device. +The number represents the unit number of the device. +.It Pa /dev/dsp +Alias of +.Pa /dev/dsp${hw.snd.default_unit} . +Available only if +.Pa hw.snd.basename_clone +is set. .It Pa /dev/sndstat Current .Nm status, including all channels and drivers. .El .Pp -The first number in the device node -represents the unit number of the -.Nm -device. All .Nm devices are listed @@ -581,15 +561,6 @@ Additional messages are sometimes recorded when the device is probed and attached, these messages can be viewed with the .Xr dmesg 8 utility. -.Pp -The above device nodes are only created on demand through the dynamic -.Xr devfs 5 -clone handler. -Users are strongly discouraged to access them directly. -For specific sound card access, please instead use -.Pa /dev/dsp -or -.Pa /dev/dsp%d . .Sh EXAMPLES Use the sound metadriver to load all .Nm diff --git a/sys/conf/files b/sys/conf/files index 549a3590f76b..0fbb7fea70c9 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3064,7 +3064,6 @@ dev/smc/if_smc.c optional smc dev/smc/if_smc_acpi.c optional smc acpi dev/smc/if_smc_fdt.c optional smc fdt dev/snp/snp.c optional snp -dev/sound/clone.c optional sound dev/sound/unit.c optional sound dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci diff --git a/sys/dev/sound/clone.c b/sys/dev/sound/clone.c deleted file mode 100644 index 4cac5f050ee2..000000000000 --- a/sys/dev/sound/clone.c +++ /dev/null @@ -1,705 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_snd.h" -#endif - -#if defined(SND_DIAGNOSTIC) || defined(SND_DEBUG) -#include -#endif - -#include - -/* - * So here we go again, another clonedevs manager. Unlike default clonedevs, - * this clone manager is designed to withstand various abusive behavior - * (such as 'while : ; do ls /dev/whatever ; done', etc.), reusable object - * after reaching certain expiration threshold, aggressive garbage collector, - * transparent device allocator and concurrency handling across multiple - * thread/proc. Due to limited information given by dev_clone EVENTHANDLER, - * we don't have much clues whether the caller wants a real open() or simply - * making fun of us with things like stat(), mtime() etc. Assuming that: - * 1) Time window between dev_clone EH <-> real open() should be small - * enough and 2) mtime()/stat() etc. always looks like a half way / stalled - * operation, we can decide whether a new cdev must be created, old - * (expired) cdev can be reused or an existing cdev can be shared. - * - * Most of the operations and logics are generic enough and can be applied - * on other places (such as if_tap, snp, etc). Perhaps this can be - * rearranged to complement clone_*(). However, due to this still being - * specific to the sound driver (and as a proof of concept on how it can be - * done), si_drv2 is used to keep the pointer of the clone list entry to - * avoid expensive lookup. - */ - -/* clone entry */ -struct snd_clone_entry { - TAILQ_ENTRY(snd_clone_entry) link; - struct snd_clone *parent; - struct cdev *devt; - struct timespec tsp; - uint32_t flags; - pid_t pid; - int unit; -}; - -/* clone manager */ -struct snd_clone { - TAILQ_HEAD(link_head, snd_clone_entry) head; - struct timespec tsp; - int refcount; - int size; - int typemask; - int maxunit; - int deadline; - uint32_t flags; -}; - -#ifdef SND_DIAGNOSTIC -#define SND_CLONE_ASSERT(x, y) do { \ - if (!(x)) \ - panic y; \ -} while (0) -#else -#define SND_CLONE_ASSERT(...) KASSERT(__VA_ARGS__) -#endif - -/* - * snd_clone_create() : Return opaque allocated clone manager. - */ -struct snd_clone * -snd_clone_create(int typemask, int maxunit, int deadline, uint32_t flags) -{ - struct snd_clone *c; - - SND_CLONE_ASSERT(!(typemask & ~SND_CLONE_MAXUNIT), - ("invalid typemask: 0x%08x", typemask)); - SND_CLONE_ASSERT(maxunit == -1 || - !(maxunit & ~(~typemask & SND_CLONE_MAXUNIT)), - ("maxunit overflow: typemask=0x%08x maxunit=%d", - typemask, maxunit)); - SND_CLONE_ASSERT(!(flags & ~SND_CLONE_MASK), - ("invalid clone flags=0x%08x", flags)); - - c = malloc(sizeof(*c), M_DEVBUF, M_WAITOK | M_ZERO); - c->refcount = 0; - c->size = 0; - c->typemask = typemask; - c->maxunit = (maxunit == -1) ? (~typemask & SND_CLONE_MAXUNIT) : - maxunit; - c->deadline = deadline; - c->flags = flags; - getnanouptime(&c->tsp); - TAILQ_INIT(&c->head); - - return (c); -} - -int -snd_clone_busy(struct snd_clone *c) -{ - struct snd_clone_entry *ce; - - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - if (c->size == 0) - return (0); - - TAILQ_FOREACH(ce, &c->head, link) { - if ((ce->flags & SND_CLONE_BUSY) || - (ce->devt != NULL && ce->devt->si_threadcount != 0)) - return (EBUSY); - } - - return (0); -} - -/* - * snd_clone_enable()/disable() : Suspend/resume clone allocation through - * snd_clone_alloc(). Everything else will not be affected by this. - */ -int -snd_clone_enable(struct snd_clone *c) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - if (c->flags & SND_CLONE_ENABLE) - return (EINVAL); - - c->flags |= SND_CLONE_ENABLE; - - return (0); -} - -int -snd_clone_disable(struct snd_clone *c) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - if (!(c->flags & SND_CLONE_ENABLE)) - return (EINVAL); - - c->flags &= ~SND_CLONE_ENABLE; - - return (0); -} - -/* - * Getters / Setters. Not worth explaining :) - */ -int -snd_clone_getsize(struct snd_clone *c) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - return (c->size); -} - -int -snd_clone_getmaxunit(struct snd_clone *c) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - return (c->maxunit); -} - -int -snd_clone_setmaxunit(struct snd_clone *c, int maxunit) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - SND_CLONE_ASSERT(maxunit == -1 || - !(maxunit & ~(~c->typemask & SND_CLONE_MAXUNIT)), - ("maxunit overflow: typemask=0x%08x maxunit=%d", - c->typemask, maxunit)); - - c->maxunit = (maxunit == -1) ? (~c->typemask & SND_CLONE_MAXUNIT) : - maxunit; - - return (c->maxunit); -} - -int -snd_clone_getdeadline(struct snd_clone *c) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - return (c->deadline); -} - -int -snd_clone_setdeadline(struct snd_clone *c, int deadline) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - c->deadline = deadline; - - return (c->deadline); -} - -uint32_t -snd_clone_getflags(struct snd_clone *c) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - return (c->flags); -} - -uint32_t -snd_clone_setflags(struct snd_clone *c, uint32_t flags) -{ - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - SND_CLONE_ASSERT(!(flags & ~SND_CLONE_MASK), - ("invalid clone flags=0x%08x", flags)); - - c->flags = flags; - - return (c->flags); -} - -uint32_t -snd_clone_getdevflags(struct cdev *dev) -{ - struct snd_clone_entry *ce; - - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - - ce = dev->si_drv2; - if (ce == NULL) - return (0xffffffff); - - SND_CLONE_ASSERT(ce->parent != NULL, ("NULL parent")); - - return (ce->flags); -} - -uint32_t -snd_clone_setdevflags(struct cdev *dev, uint32_t flags) -{ - struct snd_clone_entry *ce; - - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - SND_CLONE_ASSERT(!(flags & ~SND_CLONE_DEVMASK), - ("invalid clone dev flags=0x%08x", flags)); - - ce = dev->si_drv2; - if (ce == NULL) - return (0xffffffff); - - SND_CLONE_ASSERT(ce->parent != NULL, ("NULL parent")); - - ce->flags = flags; - - return (ce->flags); -} - -/* Elapsed time conversion to ms */ -#define SND_CLONE_ELAPSED(x, y) \ - ((((x)->tv_sec - (y)->tv_sec) * 1000) + \ - (((y)->tv_nsec > (x)->tv_nsec) ? \ - (((1000000000L + (x)->tv_nsec - \ - (y)->tv_nsec) / 1000000) - 1000) : \ - (((x)->tv_nsec - (y)->tv_nsec) / 1000000))) - -#define SND_CLONE_EXPIRED(x, y, z) \ - ((x)->deadline < 1 || \ - ((y)->tv_sec - (z)->tv_sec) > ((x)->deadline / 1000) || \ - SND_CLONE_ELAPSED(y, z) > (x)->deadline) - -/* - * snd_clone_gc() : Garbage collector for stalled, expired objects. Refer to - * clone.h for explanations on GC settings. - */ -int -snd_clone_gc(struct snd_clone *c) -{ - struct snd_clone_entry *ce, *tce; - struct timespec now; - int pruned; - - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - if (!(c->flags & SND_CLONE_GC_ENABLE) || c->size == 0) - return (0); - - getnanouptime(&now); - - /* - * Bail out if the last clone handler was invoked below the deadline - * threshold. - */ - if ((c->flags & SND_CLONE_GC_EXPIRED) && - !SND_CLONE_EXPIRED(c, &now, &c->tsp)) - return (0); - - pruned = 0; - - /* - * Visit each object in reverse order. If the object is still being - * referenced by a valid open(), skip it. Look for expired objects - * and either revoke its clone invocation status or mercilessly - * throw it away. - */ - TAILQ_FOREACH_REVERSE_SAFE(ce, &c->head, link_head, link, tce) { - if (!(ce->flags & SND_CLONE_BUSY) && - (!(ce->flags & SND_CLONE_INVOKE) || - SND_CLONE_EXPIRED(c, &now, &ce->tsp))) { - if ((c->flags & SND_CLONE_GC_REVOKE) || - ce->devt->si_threadcount != 0) { - ce->flags &= ~SND_CLONE_INVOKE; - ce->pid = -1; - } else { - TAILQ_REMOVE(&c->head, ce, link); - destroy_dev(ce->devt); - free(ce, M_DEVBUF); - c->size--; - } - pruned++; - } - } - - /* return total pruned objects */ - return (pruned); -} - -void -snd_clone_destroy(struct snd_clone *c) -{ - struct snd_clone_entry *ce, *tmp; - - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - - ce = TAILQ_FIRST(&c->head); - while (ce != NULL) { - tmp = TAILQ_NEXT(ce, link); - if (ce->devt != NULL) - destroy_dev(ce->devt); - free(ce, M_DEVBUF); - ce = tmp; - } - - free(c, M_DEVBUF); -} - -/* - * snd_clone_acquire() : The vital part of concurrency management. Must be - * called somewhere at the beginning of open() handler. ENODEV is not really - * fatal since it just tell the caller that this is not cloned stuff. - * EBUSY is *real*, don't forget that! - */ -int -snd_clone_acquire(struct cdev *dev) -{ - struct snd_clone_entry *ce; - - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - - ce = dev->si_drv2; - if (ce == NULL) - return (ENODEV); - - SND_CLONE_ASSERT(ce->parent != NULL, ("NULL parent")); - - ce->flags &= ~SND_CLONE_INVOKE; - - if (ce->flags & SND_CLONE_BUSY) - return (EBUSY); - - ce->flags |= SND_CLONE_BUSY; - - return (0); -} - -/* - * snd_clone_release() : Release busy status. Must be called somewhere at - * the end of close() handler, or somewhere after fail open(). - */ -int -snd_clone_release(struct cdev *dev) -{ - struct snd_clone_entry *ce; - - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - - ce = dev->si_drv2; - if (ce == NULL) - return (ENODEV); - - SND_CLONE_ASSERT(ce->parent != NULL, ("NULL parent")); - - ce->flags &= ~SND_CLONE_INVOKE; - - if (!(ce->flags & SND_CLONE_BUSY)) - return (EBADF); - - ce->flags &= ~SND_CLONE_BUSY; - ce->pid = -1; - - return (0); -} - -/* - * snd_clone_ref/unref() : Garbage collector reference counter. To make - * garbage collector run automatically, the sequence must be something like - * this (both in open() and close() handlers): - * - * open() - 1) snd_clone_acquire() - * 2) .... check check ... if failed, snd_clone_release() - * 3) Success. Call snd_clone_ref() - * - * close() - 1) .... check check check .... - * 2) Success. snd_clone_release() - * 3) snd_clone_unref() . Garbage collector will run at this point - * if this is the last referenced object. - */ -int -snd_clone_ref(struct cdev *dev) -{ - struct snd_clone_entry *ce; - struct snd_clone *c; - - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - - ce = dev->si_drv2; - if (ce == NULL) - return (0); - - c = ce->parent; - SND_CLONE_ASSERT(c != NULL, ("NULL parent")); - SND_CLONE_ASSERT(c->refcount >= 0, ("refcount < 0")); - - return (++c->refcount); -} - -int -snd_clone_unref(struct cdev *dev) -{ - struct snd_clone_entry *ce; - struct snd_clone *c; - - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - - ce = dev->si_drv2; - if (ce == NULL) - return (0); - - c = ce->parent; - SND_CLONE_ASSERT(c != NULL, ("NULL parent")); - SND_CLONE_ASSERT(c->refcount > 0, ("refcount <= 0")); - - c->refcount--; - - /* - * Run automatic garbage collector, if needed. - */ - if ((c->flags & SND_CLONE_GC_UNREF) && - (!(c->flags & SND_CLONE_GC_LASTREF) || - (c->refcount == 0 && (c->flags & SND_CLONE_GC_LASTREF)))) - (void)snd_clone_gc(c); - - return (c->refcount); -} - -void -snd_clone_register(struct snd_clone_entry *ce, struct cdev *dev) -{ - SND_CLONE_ASSERT(ce != NULL, ("NULL snd_clone_entry")); - SND_CLONE_ASSERT(dev != NULL, ("NULL dev")); - SND_CLONE_ASSERT(dev->si_drv2 == NULL, ("dev->si_drv2 not NULL")); - SND_CLONE_ASSERT((ce->flags & SND_CLONE_ALLOC) == SND_CLONE_ALLOC, - ("invalid clone alloc flags=0x%08x", ce->flags)); - SND_CLONE_ASSERT(ce->devt == NULL, ("ce->devt not NULL")); - SND_CLONE_ASSERT(ce->unit == dev2unit(dev), - ("invalid unit ce->unit=0x%08x dev2unit=0x%08x", - ce->unit, dev2unit(dev))); - - SND_CLONE_ASSERT(ce->parent != NULL, ("NULL parent")); - - dev->si_drv2 = ce; - ce->devt = dev; - ce->flags &= ~SND_CLONE_ALLOC; - ce->flags |= SND_CLONE_INVOKE; -} - -struct snd_clone_entry * -snd_clone_alloc(struct snd_clone *c, struct cdev **dev, int *unit, int tmask) -{ - struct snd_clone_entry *ce, *after, *bce, *cce, *nce, *tce; - struct timespec now; - int cunit, allocunit; - pid_t curpid; - - SND_CLONE_ASSERT(c != NULL, ("NULL snd_clone")); - SND_CLONE_ASSERT(dev != NULL, ("NULL dev pointer")); - SND_CLONE_ASSERT((c->typemask & tmask) == tmask, - ("invalid tmask: typemask=0x%08x tmask=0x%08x", - c->typemask, tmask)); - SND_CLONE_ASSERT(unit != NULL, ("NULL unit pointer")); - SND_CLONE_ASSERT(*unit == -1 || !(*unit & (c->typemask | tmask)), - ("typemask collision: typemask=0x%08x tmask=0x%08x *unit=%d", - c->typemask, tmask, *unit)); - - if (!(c->flags & SND_CLONE_ENABLE) || - (*unit != -1 && *unit > c->maxunit)) - return (NULL); - - ce = NULL; - after = NULL; - bce = NULL; /* "b"usy candidate */ - cce = NULL; /* "c"urthread/proc candidate */ - nce = NULL; /* "n"ull, totally unbusy candidate */ - tce = NULL; /* Last "t"ry candidate */ - cunit = 0; - allocunit = (*unit == -1) ? 0 : *unit; - curpid = curthread->td_proc->p_pid; - - getnanouptime(&now); - - TAILQ_FOREACH(ce, &c->head, link) { - /* - * Sort incrementally according to device type. - */ - if (tmask > (ce->unit & c->typemask)) { - if (cunit == 0) - after = ce; - continue; - } else if (tmask < (ce->unit & c->typemask)) - break; - - /* - * Shoot.. this is where the grumpiness begin. Just - * return immediately. - */ - if (*unit != -1 && *unit == (ce->unit & ~tmask)) - goto snd_clone_alloc_out; - - cunit++; - /* - * Simmilar device type. Sort incrementally according - * to allocation unit. While here, look for free slot - * and possible collision for new / future allocation. - */ - if (*unit == -1 && (ce->unit & ~tmask) == allocunit) - allocunit++; - if ((ce->unit & ~tmask) < allocunit) - after = ce; - /* - * Clone logic: - * 1. Look for non busy, but keep track of the best - * possible busy cdev. - * 2. Look for the best (oldest referenced) entry that is - * in a same process / thread. - * 3. Look for the best (oldest referenced), absolute free - * entry. - * 4. Lastly, look for the best (oldest referenced) - * any entries that doesn't fit with anything above. - */ - if (ce->flags & SND_CLONE_BUSY) { - if (ce->devt != NULL && (bce == NULL || - timespeccmp(&ce->tsp, &bce->tsp, <))) - bce = ce; - continue; - } - if (ce->pid == curpid && - (cce == NULL || timespeccmp(&ce->tsp, &cce->tsp, <))) - cce = ce; - else if (!(ce->flags & SND_CLONE_INVOKE) && - (nce == NULL || timespeccmp(&ce->tsp, &nce->tsp, <))) - nce = ce; - else if (tce == NULL || timespeccmp(&ce->tsp, &tce->tsp, <)) - tce = ce; - } - if (*unit != -1) - goto snd_clone_alloc_new; - else if (cce != NULL) { - /* Same proc entry found, go for it */ - ce = cce; - goto snd_clone_alloc_out; - } else if (nce != NULL) { - /* - * Next, try absolute free entry. If the calculated - * allocunit is smaller, create new entry instead. - */ - if (allocunit < (nce->unit & ~tmask)) - goto snd_clone_alloc_new; - ce = nce; - goto snd_clone_alloc_out; - } else if (allocunit > c->maxunit) { - /* - * Maximum allowable unit reached. Try returning any - * available cdev and hope for the best. If the lookup is - * done for things like stat(), mtime() etc. , things should - * be ok. Otherwise, open() handler should do further checks - * and decide whether to return correct error code or not. - */ - if (tce != NULL) { - ce = tce; - goto snd_clone_alloc_out; - } else if (bce != NULL) { - ce = bce; - goto snd_clone_alloc_out; - } - return (NULL); - } - -snd_clone_alloc_new: - /* - * No free entries found, and we still haven't reached maximum - * allowable units. Allocate, setup a minimal unique entry with busy - * status so nobody will monkey on this new entry. Unit magic is set - * right here to avoid collision with other contesting handler. - * The caller must be carefull here to maintain its own - * synchronization, as long as it will not conflict with malloc(9) - * operations. - * - * That said, go figure. - */ - ce = malloc(sizeof(*ce), M_DEVBUF, - ((c->flags & SND_CLONE_WAITOK) ? M_WAITOK : M_NOWAIT) | M_ZERO); - if (ce == NULL) { - if (*unit != -1) - return (NULL); - /* - * We're being dense, ignorance is bliss, - * Super Regulatory Measure (TM).. TRY AGAIN! - */ - if (nce != NULL) { - ce = nce; - goto snd_clone_alloc_out; - } else if (tce != NULL) { - ce = tce; - goto snd_clone_alloc_out; - } else if (bce != NULL) { - ce = bce; - goto snd_clone_alloc_out; - } - return (NULL); - } - /* Setup new entry */ - ce->parent = c; - ce->unit = tmask | allocunit; - ce->pid = curpid; - ce->tsp = now; - ce->flags |= SND_CLONE_ALLOC; - if (after != NULL) { - TAILQ_INSERT_AFTER(&c->head, after, ce, link); - } else { - TAILQ_INSERT_HEAD(&c->head, ce, link); - } - c->size++; - c->tsp = now; - /* - * Save new allocation unit for caller which will be used - * by make_dev(). - */ - *unit = allocunit; - - return (ce); - -snd_clone_alloc_out: - /* - * Set, mark, timestamp the entry if this is a truly free entry. - * Leave busy entry alone. - */ - if (!(ce->flags & SND_CLONE_BUSY)) { - ce->pid = curpid; - ce->tsp = now; - ce->flags |= SND_CLONE_INVOKE; - } - c->tsp = now; - *dev = ce->devt; - - return (NULL); -} diff --git a/sys/dev/sound/clone.h b/sys/dev/sound/clone.h deleted file mode 100644 index 38b57b85b3e4..000000000000 --- a/sys/dev/sound/clone.h +++ /dev/null @@ -1,127 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2007 Ariff Abdullah - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _SND_CLONE_H_ -#define _SND_CLONE_H_ - -struct snd_clone_entry; -struct snd_clone; - -/* - * 750 milisecond default deadline. Short enough to not cause excessive - * garbage collection, long enough to indicate stalled VFS. - */ -#define SND_CLONE_DEADLINE_DEFAULT 750 - -/* - * Fit within 24bit MAXMINOR. - */ -#define SND_CLONE_MAXUNIT 0xffffff - -/* - * Creation flags, mostly related to the behaviour of garbage collector. - * - * SND_CLONE_ENABLE - Enable clone allocation. - * SND_CLONE_GC_ENABLE - Enable garbage collector operation, automatically - * or if explicitly called upon. - * SND_CLONE_GC_UNREF - Garbage collect during unref operation. - * SND_CLONE_GC_LASTREF - Garbage collect during last reference - * (refcount = 0) - * SND_CLONE_GC_EXPIRED - Don't garbage collect unless the global clone - * handler has been expired. - * SND_CLONE_GC_REVOKE - Revoke clone invocation status which has been - * expired instead of removing and freeing it. - * SND_CLONE_WAITOK - malloc() is allowed to sleep while allocating - * clone entry. - */ -#define SND_CLONE_ENABLE 0x00000001 -#define SND_CLONE_GC_ENABLE 0x00000002 -#define SND_CLONE_GC_UNREF 0x00000004 -#define SND_CLONE_GC_LASTREF 0x00000008 -#define SND_CLONE_GC_EXPIRED 0x00000010 -#define SND_CLONE_GC_REVOKE 0x00000020 -#define SND_CLONE_WAITOK 0x80000000 - -#define SND_CLONE_GC_MASK (SND_CLONE_GC_ENABLE | \ - SND_CLONE_GC_UNREF | \ - SND_CLONE_GC_LASTREF | \ - SND_CLONE_GC_EXPIRED | \ - SND_CLONE_GC_REVOKE) - -#define SND_CLONE_MASK (SND_CLONE_ENABLE | SND_CLONE_GC_MASK | \ - SND_CLONE_WAITOK) - -/* - * Runtime clone device flags - * - * These are mostly private to the clone manager operation: - * - * SND_CLONE_NEW - New clone allocation in progress. - * SND_CLONE_INVOKE - Cloning being invoked, waiting for next VFS operation. - * SND_CLONE_BUSY - In progress, being referenced by living thread/proc. - */ -#define SND_CLONE_NEW 0x00000001 -#define SND_CLONE_INVOKE 0x00000002 -#define SND_CLONE_BUSY 0x00000004 - -/* - * Nothing important, just for convenience. - */ -#define SND_CLONE_ALLOC (SND_CLONE_NEW | SND_CLONE_INVOKE | \ - SND_CLONE_BUSY) - -#define SND_CLONE_DEVMASK SND_CLONE_ALLOC - -struct snd_clone *snd_clone_create(int, int, int, uint32_t); -int snd_clone_busy(struct snd_clone *); -int snd_clone_enable(struct snd_clone *); -int snd_clone_disable(struct snd_clone *); -int snd_clone_getsize(struct snd_clone *); -int snd_clone_getmaxunit(struct snd_clone *); -int snd_clone_setmaxunit(struct snd_clone *, int); -int snd_clone_getdeadline(struct snd_clone *); -int snd_clone_setdeadline(struct snd_clone *, int); -uint32_t snd_clone_getflags(struct snd_clone *); -uint32_t snd_clone_setflags(struct snd_clone *, uint32_t); *** 1882 LINES SKIPPED *** From nobody Sun Mar 31 14:16:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6x6836ksz5G7fx; Sun, 31 Mar 2024 14:16: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 4V6x682WPvz4ZVK; Sun, 31 Mar 2024 14:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711894608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0aeEtaX3nM0QJyMFbYezkrvIeHPRfX2CU9yP06nLGwk=; b=IIWdLI/N4BjHaMKMmj5pWeOlDDkugVIuuqb5QnAt3dQ7HHVfoZ2nTsT9SVGH0AzSbxydyk LyjaTYgfKu65ReJNeQy9xREz1WGPC+s8jqz9SSBuduNE0E5Whis5S7n4nyERdug/P74dCU L/pbfW5Ke6nYxq/hfcf5cYM0LRUAez9bQJtkmmiMvPT0snMjcDV6Y7B70e+H5LlcYmjhA8 /mxC6/xF12qs9gviBOCRkCkfQFjiYB0bkHJgHp9LwuipSmyTC1U2xgaWT3UW2P6bDxFuWb HlGpjJnKYgf43ToVbI0OhnetVID1iPc87Vq3XidXcRiW72oaxNsft3ARwfZkzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711894608; a=rsa-sha256; cv=none; b=lEgMuhTJit1zdHGL54luyjTGiDRQH2dRSV+MolW3+UR2q9Y8xqsVtPO4COa3ae2uguuDSu DZQ/SS5krXWz8epwRmshZLq4v0F3d7MwzSteVXCsD21xTTbcOu9WlGNIoc43RUqWnrzooS vK8ons95sXsjefYIJl78smdPYA6a+HRC9wm3ApS2gFlqjQe6f61wvoSfw6r51FuMHRlx2Y uQlksbGBlqoFKiOzWw1L9VGsMLNTVXoxF8yFGjALIWjFcvLS6cy0mAXEmUN4wCFgveaRxX cq8jg44atg9jggPLXEFQYLrjcH7Ze3q47yne4/9blYECOn9R3VBfaOvjt0wGwQ== 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=1711894608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0aeEtaX3nM0QJyMFbYezkrvIeHPRfX2CU9yP06nLGwk=; b=mqSOzf3QV1cCY8suwuZoez67fUlgeahm8Dw63KYN94be6F0qNhNf6wWZj9uC5UpY2WQRR5 SEtewCpYP9r1JRHxxuSb5J+duBfQ+gOr3trXa6c/jOeL7sg8HV/s+fWUXLm0jxodSCmu0U JnHrB24qXQUVhi+oyoEgbQl3HqWmSlBqel7rwttIjwQBv3Wg4nvnP9lbJt6FBjqtm4mThJ 01CL96C+6WUvyZYHIyD537lGJ/bHdqEsyj/8x7Lc/IOqabtJ+oyh2GseD9xNzWdh9rtmvp YUHIY+NUrxcIf90uEFs3AtJM3Q+7b9Rhr5U0394ibaLowrzydAVggcnaSISM/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6x6822LWzgyy; Sun, 31 Mar 2024 14:16: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 42VEGmrE068328; Sun, 31 Mar 2024 14:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VEGmRA068325; Sun, 31 Mar 2024 14:16:48 GMT (envelope-from git) Date: Sun, 31 Mar 2024 14:16:48 GMT Message-Id: <202403311416.42VEGmRA068325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9eff58c6d52b - main - sound: Implement asynchronous device detach List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9eff58c6d52b66eb8abe7f724dabcd804a566df4 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9eff58c6d52b66eb8abe7f724dabcd804a566df4 commit 9eff58c6d52b66eb8abe7f724dabcd804a566df4 Author: Christos Margiolis AuthorDate: 2024-03-31 14:13:43 +0000 Commit: Christos Margiolis CommitDate: 2024-03-31 14:13:43 +0000 sound: Implement asynchronous device detach Hot-unplugging a sound device, such as a USB sound card, whilst being consumed by an application, results in an infinite loop until either the application closes the device's file descriptor, or the channel automatically times out after hw.snd.timeout seconds. In the case of a detach however, the timeout approach is still not ideal, since we want all resources to be released immediatelly, without waiting for N seconds until we can use the bus again. The timeout mechanism works by calling chn_sleep() in chn_read() and chn_write() (see pcm/channel.c) in order to send the thread to sleep, using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag while waiting for cv_timedwait_sig() to return, we can test this flag in pcm_unregister() (called during detach) and wakeup the sleeping thread(s) to immediately kill the channel(s) being consumed. Sponsored by: The FreeBSD Foundation MFC after: 2 months PR: 194727, 278055, 202275, 220949, 272286 Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D43545 --- share/man/man4/snd_uaudio.4 | 11 +---------- sys/dev/sound/pcm/dsp.c | 2 +- sys/dev/sound/pcm/mixer.c | 11 ----------- sys/dev/sound/pcm/sound.c | 24 ++++++++++-------------- sys/dev/sound/usb/uaudio.c | 13 +++---------- 5 files changed, 15 insertions(+), 46 deletions(-) diff --git a/share/man/man4/snd_uaudio.4 b/share/man/man4/snd_uaudio.4 index b6a6c06a2312..6e2509b8f2ac 100644 --- a/share/man/man4/snd_uaudio.4 +++ b/share/man/man4/snd_uaudio.4 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 29, 2024 +.Dd March 26, 2024 .Dt SND_UAUDIO 4 .Os .Sh NAME @@ -156,15 +156,6 @@ and modified for by .An Hiten Pandya Aq Mt hmp@FreeBSD.org . .Sh BUGS -The PCM framework in -.Fx -only supports synchronous device detach. -That means all mixer and DSP character devices belonging to a given -USB audio device must be closed when receiving an error on a DSP read, -a DSP write or a DSP IOCTL request. -Else the USB audio driver will wait for this to happen, preventing -enumeration of new devices on the parenting USB controller. -.Pp Some USB audio devices might refuse to work properly unless the sample rate is configured the same for both recording and playback, even if only simplex is used. diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index b9693908da43..754f09c7199e 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -295,7 +295,7 @@ dsp_close(void *data) d = priv->sc; /* At this point pcm_unregister() will destroy all channels anyway. */ - if (!PCM_REGISTERED(d)) + if (PCM_DETACHING(d)) goto skip; PCM_GIANT_ENTER(d); diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index ee1ed11a8ed0..cc8cf5b1ceea 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -817,17 +817,6 @@ mixer_uninit(device_t dev) KASSERT(m->type == MIXER_TYPE_PRIMARY, ("%s(): illegal mixer type=%d", __func__, m->type)); - snd_mtxlock(m->lock); - - if (m->busy) { - snd_mtxunlock(m->lock); - return EBUSY; - } - - /* destroy dev can sleep --hps */ - - snd_mtxunlock(m->lock); - pdev->si_drv1 = NULL; destroy_dev(pdev); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 36a6f778e024..b45ca30dc984 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1137,26 +1137,22 @@ pcm_unregister(device_t dev) CHN_FOREACH(ch, d, channels.pcm) { CHN_LOCK(ch); - if (ch->refcount > 0) { - device_printf(dev, - "unregister: channel %s busy (pid %d)\n", - ch->name, ch->pid); - CHN_UNLOCK(ch); - PCM_RELEASE_QUICK(d); - return (EBUSY); + if (ch->flags & CHN_F_SLEEPING) { + /* + * We are detaching, so do not wait for the timeout in + * chn_read()/chn_write(). Wake up the thread and kill + * the channel immediately. + */ + CHN_BROADCAST(&ch->intr_cv); + ch->flags |= CHN_F_DEAD; } + chn_abort(ch); CHN_UNLOCK(ch); } dsp_destroy_dev(dev); - if (mixer_uninit(dev) == EBUSY) { - device_printf(dev, "unregister: mixer busy\n"); - PCM_LOCK(d); - PCM_RELEASE(d); - PCM_UNLOCK(d); - return (EBUSY); - } + (void)mixer_uninit(dev); /* remove /dev/sndstat entry first */ sndstat_unregister(dev); diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 5d7396c527e0..2351c2522021 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1255,20 +1255,13 @@ uaudio_detach_sub(device_t dev) unsigned i = uaudio_get_child_index_by_dev(sc, dev); int error = 0; -repeat: if (sc->sc_child[i].pcm_registered) { error = pcm_unregister(dev); - } else { - if (sc->sc_child[i].mixer_init) - error = mixer_uninit(dev); + } else if (sc->sc_child[i].mixer_init) { + error = mixer_uninit(dev); } - if (error) { - device_printf(dev, "Waiting for sound application to exit!\n"); - usb_pause_mtx(NULL, 2 * hz); - goto repeat; /* try again */ - } - return (0); /* success */ + return (error); } static int From nobody Sun Mar 31 14:40:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V6xdT5HWnz5G9hj; Sun, 31 Mar 2024 14:40: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 4V6xdT4jJlz4gNs; Sun, 31 Mar 2024 14:40:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711896029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16uIcKYNXP0YsiEqlMg59NRcbtsIzadBo/WQeOZ/OJk=; b=o4mIcH3vmkqDLcwtfJyZIkY23K5wFFBKa0mXbs3DUVCoFKYubPoipnZ66k3dKj4CYvuKq/ ERYZmL2sxYb8szTT81+3PIlyAYEbzK1dSFTpMvmJXE4IAmBjyO9oAhS4Ju3Y+t8B4yGFBq I8yUo+ttDbLYGx9hO7IV//KDpNHxYkH2z9tTum5vthC7a6qY9B3usKKt5TPjNZ36jsfBW+ kK0+jRl9bQD1huSxA1Y6GVZ5/obbrF3jsQxGaaMt+2GWlVcEL0tUPQqo3WuMp4LYWnnBZm ktLAD8lGi45xVckKqsUSk3ybfYpkVCVV+pBo8PgfsfycWs/VwFlAhoD8bfsiQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711896029; a=rsa-sha256; cv=none; b=CLXbW2OiqQPM86PXAe+JbP6Kg7WCgRVDD1ns3pFhok8JiNJigodn+Q+v9/k7V6odj6zDZO rBsnXEzlGCyVbo3HrX4x65VLkNF6pFKwID7HF2uT6qk/XF6YYAUZI9dJz0IgxcRV+ZH6FA dsdJHRa4Xexmytlx0MOL+W7rBLjNdSXUHtNs7cJGycy3XlL22DzPBrkqGs+0e65L/Msn06 QxOG5Z1UxgE7CeHxh6LeSmsnKpyvu8mXh5ecbpXpw0YMqwFI7d8N8h+Z16MYh7mRsfs3UB u/9X6eIiR3eU3eHw4eBhB+nSZliKuODieH0rZmOqsTNvtU6+mNrrEv5ioh9d2A== 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=1711896029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16uIcKYNXP0YsiEqlMg59NRcbtsIzadBo/WQeOZ/OJk=; b=l7Xa1bZl4AiIhV/iQKB3M/dLfLoRuQT5jJ3IqOCCraxT/53deXE4hrqh0GswlWYf/Z/hip BA+e1byVrsM3Fp/D9lA9aTfikJtCJrQaHXwFlK3WnPVLSnwRH4j99CPoKupjMOvTpM5l3s /2ZG69XbZRBsFvHUNuUdn+kMYW3Dk/i5H+UVctPkE58wqTdkqFYmzzbM9Qr4fROdyKOrDU Y2FTS7Jjkhz2qBrvC+GkVJQ0YYStia+mi++wDkAbDYIT9jdHsfjkzcyttcaQtic+hWPd22 eSqDBox7m76xcdUaWOex/5WDXDLboxT5ovjx3G2N0djmA9hzH1JmrBRiKaowug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V6xdT433WzhvN; Sun, 31 Mar 2024 14:40: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 42VEeTFv010995; Sun, 31 Mar 2024 14:40:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VEeTCm010992; Sun, 31 Mar 2024 14:40:29 GMT (envelope-from git) Date: Sun, 31 Mar 2024 14:40:29 GMT Message-Id: <202403311440.42VEeTCm010992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d68c68693e11 - main - tar: make error reporting more robust and use correct errno List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d68c68693e110353f70b5c04f8de416cf5766eca Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d68c68693e110353f70b5c04f8de416cf5766eca commit d68c68693e110353f70b5c04f8de416cf5766eca Author: Ed Maste AuthorDate: 2024-03-31 14:37:38 +0000 Commit: Ed Maste CommitDate: 2024-03-31 14:39:53 +0000 tar: make error reporting more robust and use correct errno Apply upstream pull request 2101. --- 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 Mar 31 18:15:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V72Q05WKyz5G6Tf; Sun, 31 Mar 2024 18:15: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 4V72Q04yyfz43Xf; Sun, 31 Mar 2024 18:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711908952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1N6RR2+stJUVmnhDxvsIm3VAYWpAXGxjcmFRfcxy3Go=; b=yXgruZrRSxP/0xf0Vtb43bAFHNzsQgXn+FxGvyp8wMbFtPNMOTi6gr+tIXKosROBDBdREK HPx8W76AQMZnda08a+/0cm5JRJD9PwppVptrKRY9x4Jt0U4ctLRNlgoUVruEbYaktynPmm e+nMQT+N9pP+mmJzHZsGDIj3E07/8mS9ewOkoCLzcrYmH0r1ahB6QyH73rnr8KCjL9nyqL WX1C/YYT+F7F/bNUocQc0obSbmozmo0q2gR3tZ/Xnt91ElFQftfAHPOu/pyxqP5HrC1ZYP gptpIvLbJq4lxok1XkiSQ61q9f+70tfetZec0TPdsQGS9V16npJcOSQETYzD7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711908952; a=rsa-sha256; cv=none; b=RLZT+ieOwIWmQwZruCJmtiQ4z9OovCZNp6Es//3DQdO3a0EsIhwcToDSRhK8i0xrJmRWiH ydH43XzuAxWGLkofOrniMC7CfAQwoOoGzXWEhq8okS9NFJWDZTJFTqfvzS6A/ktwwr+R49 ay05hZYyP/UfGMzROJGl4azPR1TlhHFiEeXl0XzwxYpOcfUD2txwaAQvCK5BDJVq8q6Ins T+U3TnkxIwy0FmkVUv70pY+Sb93yWlvr+Ai96Q+JUhPsE5bPPpmb7Ui10rhi1t+cprWUdk RcBk3cCY+GpyyfcBvWNoL6UIWkT6oEtGUMGkmbOgEolwHjw9CvgzTNi3QmlOQA== 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=1711908952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1N6RR2+stJUVmnhDxvsIm3VAYWpAXGxjcmFRfcxy3Go=; b=Klx1cvDo01Lf1j5ValjPuU9fpfDBb20WOkSidLavIlGaVSHSk564aarCBIMN/OOi4FyMig ljLOf356hZIaKMD7ZWOFSFd4FDAsL8UGwFkeOROrloZMTnk0S2RHFR+lNGPkEIt8HxUy+2 25CcN/QIBsTZsAftKvltJdjwOdwZDJSCknOggiQCONksZRzfna9LzMaumATIPkq+mT/B7a saACRcV6s3lPhJCGFHw8eFTM4k+FNtWyizPFEsq+5pNT7Nz++/tixblaGQSN1YV19gLcEv /y2c3xUh4GhIWv7QF+AA79GreLC4zxEFmZ9Pww1qYylacvpScL5lris4UuDGbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V72Q04Z6dzpCZ; Sun, 31 Mar 2024 18:15:52 +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 42VIFqbB075174; Sun, 31 Mar 2024 18:15:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VIFqYb075171; Sun, 31 Mar 2024 18:15:52 GMT (envelope-from git) Date: Sun, 31 Mar 2024 18:15:52 GMT Message-Id: <202403311815.42VIFqYb075171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 43b4da44118e - main - ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43b4da44118e4fe29e9d7456db4390c9cbb53636 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=43b4da44118e4fe29e9d7456db4390c9cbb53636 commit 43b4da44118e4fe29e9d7456db4390c9cbb53636 Author: Mark Johnston AuthorDate: 2024-03-31 18:11:47 +0000 Commit: Mark Johnston CommitDate: 2024-03-31 18:11:47 +0000 ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee This exercises the bug fix in commit 9241ebc796c1 ("thread_single(9): decline external requests for traced or debugger-stopped procs"). Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D44564 --- tests/sys/kern/ptrace_test.c | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index bd176e2963f0..b65c84144ad0 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -4368,6 +4368,52 @@ ATF_TC_BODY(ptrace__PT_SC_REMOTE_getpid, tc) ATF_REQUIRE(ptrace(PT_DETACH, fpid, (caddr_t)1, 0) != -1); } +/* + * Ensure that procctl(PROC_REAP_KILL) won't block forever waiting for a target + * process that stopped to report its status to a debugger. + */ +ATF_TC_WITHOUT_HEAD(ptrace__reap_kill_stopped); +ATF_TC_BODY(ptrace__reap_kill_stopped, tc) +{ + struct procctl_reaper_kill prk; + pid_t debuggee, wpid; + int error, status; + + REQUIRE_EQ(procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL), 0); + + debuggee = fork(); + ATF_REQUIRE(debuggee >= 0); + if (debuggee == 0) { + trace_me(); + for (;;) + sleep(10); + _exit(0); + } + wpid = waitpid(debuggee, &status, 0); + REQUIRE_EQ(wpid, debuggee); + ATF_REQUIRE(WIFSTOPPED(status)); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); + + /* Resume the child and ask it to stop during syscall exits. */ + ATF_REQUIRE(ptrace(PT_TO_SCX, debuggee, (caddr_t)1, 0) != -1); + + /* Give the debuggee some time to go to sleep. */ + usleep(100000); + + /* + * Kill the child process. procctl() may attempt to stop the target + * process to prevent it from adding new children to the reaper subtree, + * and this should not conflict with the child stopping itself for the + * debugger. + */ + memset(&prk, 0, sizeof(prk)); + prk.rk_sig = SIGTERM; + error = procctl(P_PID, getpid(), PROC_REAP_KILL, &prk); + REQUIRE_EQ(error, 0); + REQUIRE_EQ(1, prk.rk_killed); + REQUIRE_EQ(-1, prk.rk_fpid); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_trace_me); @@ -4434,6 +4480,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__procdesc_wait_child); ATF_TP_ADD_TC(tp, ptrace__procdesc_reparent_wait_child); ATF_TP_ADD_TC(tp, ptrace__PT_SC_REMOTE_getpid); + ATF_TP_ADD_TC(tp, ptrace__reap_kill_stopped); return (atf_no_error()); } From nobody Sun Mar 31 18:15:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V72Q172MYz5G6bv; Sun, 31 Mar 2024 18:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V72Q163bGz43bq; Sun, 31 Mar 2024 18:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711908953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RDwXW3qZbHwjfDyGPBG12eNEBPd9mihBOeebUwoZmxQ=; b=VJHmIxDflTgjbD6pn6N1HS+kmAwDXtEImQ6zGKDpJaKAVFy12CCQbWlcbArOthLwOoW8UI xhSl0S8U6VioUa5vKqJ9b0cN2D9MkorGoZM9591gyT+6qMbgfESshjxiiDuJBIb4oKxah1 U+JbN4nhTosYlmLKC1QQ6Zq5jh2oojNCZm3nu13f1BgnNJLK9ge1JOeScFNAFnW1XMCDTV prczeynLEqteRjHBqYbNbWgu9rh46GLtYBLOQ7XHkNeYi4To7/vVldHUeUBkbrbB1aq8JH 8WNqnj0sxEH9JRV4f4qXIawfgy0YFqd8QwF2NV1ThozIzblSoWLqIISCRA9LHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711908953; a=rsa-sha256; cv=none; b=QhQ68zyB0faNwPuFzCbPqHimX/3WN/K7iHvLwDk7dczqJyPX7thX/YsSH4I/+tmUXA7n3I BZ50nR77p8mgmzzdGs5Q610/d6xcpUo1Ni485sf/MG6KZQBfOAsbPSSHjZMIHsNdpwCRWY Ph9VX50yIHNbkZnvT3nbl3DjsWmVfeDR1xeJbJ+45S13YKUZMywgebSHVURHdUdI5msIUl B3hWDHI1o1SbKYucjMMYcPcO3kM/pA5qaQox2HcwHaZDENandFFHac6Etlyn2xTlQXwL6k l8QLUTdbYaKpe13+rEtJ1wvGo1rUKR4U1o0aC3HPAkIYVzXXOVnK9ZE9KOZscQ== 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=1711908953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RDwXW3qZbHwjfDyGPBG12eNEBPd9mihBOeebUwoZmxQ=; b=R1gIeb9C3gJWx4UdUNXnNB7EzGfX4iUPAhebAfNO+mtxJiI8dDKNLCF/QfGX8vNqsgTATv jTJVdWLiohhQMRzCaE0pSdNupttK9M11HRaxrqN0WiI3LnzbcsHBx1UZtLHqvPolV46sRr J1GB3klr02/OQiEiAgjXpGELiFgchucvkSC1FI4MlS+vrzg0l72ZnH54muaxMBJgkFGExF /Yyr8MrxDBCOucWdJQvQv2Wzwlo5GZ5E27i7fUF2u3kE4Kz/L2xo+ci1fQFYEj4hg6QMwV qMzvJ8TEAljmKPS2nmqtCrIH867b7rWJt1OEWr7wqLvUbeoaMRMF+iUYfBMA9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V72Q15fxbzpGn; Sun, 31 Mar 2024 18:15:53 +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 42VIFre4075228; Sun, 31 Mar 2024 18:15:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VIFr0S075225; Sun, 31 Mar 2024 18:15:53 GMT (envelope-from git) Date: Sun, 31 Mar 2024 18:15:53 GMT Message-Id: <202403311815.42VIFr0S075225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7ef5c19b219e - main - kern linker: Don't invoke dtors without having invoked ctors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ef5c19b219e47684afd9d8d9126df39edc8d885 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7ef5c19b219e47684afd9d8d9126df39edc8d885 commit 7ef5c19b219e47684afd9d8d9126df39edc8d885 Author: Mark Johnston AuthorDate: 2024-03-31 18:14:02 +0000 Commit: Mark Johnston CommitDate: 2024-03-31 18:15:11 +0000 kern linker: Don't invoke dtors without having invoked ctors I have a kernel module which fails to load because of an unrecognized relocation type. link_elf_load_file() fails before the module's ctors are invoked and it calls linker_file_unload(), which causes the module's dtors to be executed, resulting in a kernel panic. Add a flag to the linker file to ensure that dtors are not invoked if unloading due to an error prior to ctors being invoked. At the moment I only implemented this for link_elf_obj.c since link_elf.c doesn't invoke dtors, but I refactored link_elf.c to make them more similar. Fixes: 9e575fadf491 ("link_elf_obj: Invoke fini callbacks") Reviewed by: zlei, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D44559 --- sys/kern/kern_linker.c | 1 + sys/kern/link_elf.c | 15 +++++++++++++-- sys/kern/link_elf_obj.c | 30 +++++++++++++++++++++++++++--- sys/sys/linker.h | 5 +++++ 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 54b7466124db..08b85867d781 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -657,6 +657,7 @@ linker_make_file(const char *pathname, linker_class_t lc) return (NULL); lf->ctors_addr = 0; lf->ctors_size = 0; + lf->ctors_invoked = LF_NONE; lf->dtors_addr = 0; lf->dtors_size = 0; lf->refs = 1; diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index b08c19f3c018..9f9c10456b60 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -358,7 +358,7 @@ link_elf_error(const char *filename, const char *s) } static void -link_elf_invoke_ctors(caddr_t addr, size_t size) +link_elf_invoke_cbs(caddr_t addr, size_t size) { void (**ctor)(void); size_t i, cnt; @@ -373,6 +373,17 @@ link_elf_invoke_ctors(caddr_t addr, size_t size) } } +static void +link_elf_invoke_ctors(linker_file_t lf) +{ + KASSERT(lf->ctors_invoked == LF_NONE, + ("%s: file %s ctor state %d", + __func__, lf->filename, lf->ctors_invoked)); + + link_elf_invoke_cbs(lf->ctors_addr, lf->ctors_size); + lf->ctors_invoked = LF_CTORS; +} + /* * Actions performed after linking/loading both the preloaded kernel and any * modules; whether preloaded or dynamicly loaded. @@ -403,7 +414,7 @@ link_elf_link_common_finish(linker_file_t lf) #endif /* Invoke .ctors */ - link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); + link_elf_invoke_ctors(lf); return (0); } diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index c8ccebea0832..a7c7d4826322 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -658,6 +658,30 @@ link_elf_invoke_cbs(caddr_t addr, size_t size) } } +static void +link_elf_invoke_ctors(linker_file_t lf) +{ + KASSERT(lf->ctors_invoked == LF_NONE, + ("%s: file %s ctor state %d", + __func__, lf->filename, lf->ctors_invoked)); + + link_elf_invoke_cbs(lf->ctors_addr, lf->ctors_size); + lf->ctors_invoked = LF_CTORS; +} + +static void +link_elf_invoke_dtors(linker_file_t lf) +{ + KASSERT(lf->ctors_invoked != LF_DTORS, + ("%s: file %s ctor state %d", + __func__, lf->filename, lf->ctors_invoked)); + + if (lf->ctors_invoked == LF_CTORS) { + link_elf_invoke_cbs(lf->dtors_addr, lf->dtors_size); + lf->ctors_invoked = LF_DTORS; + } +} + static int link_elf_link_preload_finish(linker_file_t lf) { @@ -684,7 +708,7 @@ link_elf_link_preload_finish(linker_file_t lf) /* Apply protections now that relocation processing is complete. */ link_elf_protect(ef); - link_elf_invoke_cbs(lf->ctors_addr, lf->ctors_size); + link_elf_invoke_ctors(lf); return (0); } @@ -1239,7 +1263,7 @@ link_elf_load_file(linker_class_t cls, const char *filename, #endif link_elf_protect(ef); - link_elf_invoke_cbs(lf->ctors_addr, lf->ctors_size); + link_elf_invoke_ctors(lf); *result = lf; out: @@ -1259,7 +1283,7 @@ link_elf_unload_file(linker_file_t file) elf_file_t ef = (elf_file_t) file; u_int i; - link_elf_invoke_cbs(file->dtors_addr, file->dtors_size); + link_elf_invoke_dtors(file); /* Notify MD code that a module is being unloaded. */ elf_cpu_unload_file(file); diff --git a/sys/sys/linker.h b/sys/sys/linker.h index b6184f4fc876..52fbeb5584ff 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -82,6 +82,11 @@ struct linker_file { size_t size; /* size of file */ caddr_t ctors_addr; /* address of .ctors/.init_array */ size_t ctors_size; /* size of .ctors/.init_array */ + enum { + LF_NONE = 0, + LF_CTORS, + LF_DTORS, + } ctors_invoked; /* have we run ctors yet? */ caddr_t dtors_addr; /* address of .dtors/.fini_array */ size_t dtors_size; /* size of .dtors/.fini_array */ int ndeps; /* number of dependencies */ From nobody Sun Mar 31 18:36:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V72tH75fNz5G8dL; Sun, 31 Mar 2024 18:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V72tH67JKz46Gn; Sun, 31 Mar 2024 18:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711910215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5CdA87M9gnyUrF4ZFCRLeAKnYJmJgY8qIjmQFtEjCes=; b=H3Lf196Kn6Un9H+QJuHwZF4XNwcT9xIJ6GKlQ/0m5TlLT5IC8ya5zAY2aZWELjMZXNQMCO e6e8RmzjJdfk6CXxl7/LRBW/rrlMyGgW/9/dqJcPwfNdWYC2G99B124CMa8YGaT1gdIxUX Oi4jPtD6k483nUKWv8pMHdOVzgGzBPzZ4nCshIl8d+NvohZy1wqyB0yVrx2AOJJJIeH0i2 6XN1EV/IgSO9JoDL+N190R44NNceKC1hILd31GrA7au78BJwJZ1OaD33d1Ma2ycntqDRI8 +vDTl/vWat/ZfvDvc9m3AzYNgxoaiiEElqfR1pkfsOIb29O1MKiP1icFhLqY5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711910215; a=rsa-sha256; cv=none; b=nun+ApdKSJcXfU+7wOZ2v0ijOSDQs3i+m6/oGByz8LgwXh1W1uEyu5NTzOA9OfSkYYjiuV CYEEDStafUvwJyfH8S9LDgEVjaGEp3p7FOnSA/Q2y+U5zI0Y/8O8ef2OFlXrPdX5wsAN24 +3v7NOvxQebCZS68L7g/TNzT3OOQrAzkYsoterZpWEQGqiTu42AX1sZu9l8COfHGhdyD7J VQDDZ3dFjyKsWChLe/G4zD3VBdhiHIvMqsPxfKXgTBkmXP6uBE5ii9ENV+mD1i63VQwkEO rXbuDbX42LC6FXPltdvgAmHHpFVkAdmS4oqLTzFyDhWTFaYXgZlZYzQqvDT7xQ== 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=1711910215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5CdA87M9gnyUrF4ZFCRLeAKnYJmJgY8qIjmQFtEjCes=; b=qQcIXoUXScZ3kib1xeEFnCAdbKbmWTq9q7ayCB0uoeNxpRcbix4cQWOPEVv6J8nDGvXtse rHU5DSzjIGDOK3CWB8PpPW5MuDGd/Wq9oGJV8FFLSlKgDt7spG2ApU2Rvr1LgFoYR0lsS5 hkC8SC6yODl8pAvOrMhJlBqHRNuXCkDxVy2ovfwRzj6lo0Tt8QhcAkJzvxoDFa3bcO2LpW 2reHSYWLrEI71VR20A5IKTHAdXjzB2uRWjHpfqQCbu7jfX9c5moQEM8OIVkzsslCDiphAd oAUS3KenL2sx0wCnWhI1efJwrRNwuJ0u3wKOR2383jl8E5Ot3lMA2kfhQae5Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V72tH5kJQzpT5; Sun, 31 Mar 2024 18:36: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 42VIatD6009272; Sun, 31 Mar 2024 18:36:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VIatNp009269; Sun, 31 Mar 2024 18:36:55 GMT (envelope-from git) Date: Sun, 31 Mar 2024 18:36:55 GMT Message-Id: <202403311836.42VIatNp009269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 07b17a1692a3 - main - bsd-family-tree: add NetBSD 10.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07b17a1692a3c067e8f3e2dad31441ae441c5387 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=07b17a1692a3c067e8f3e2dad31441ae441c5387 commit 07b17a1692a3c067e8f3e2dad31441ae441c5387 Author: Maxim Konovalov AuthorDate: 2024-03-31 18:35:02 +0000 Commit: Maxim Konovalov CommitDate: 2024-03-31 18:35:02 +0000 bsd-family-tree: add NetBSD 10.0 --- share/misc/bsd-family-tree | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 06cb803f709c..6bcde1ed052e 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -456,6 +456,8 @@ FreeBSD 5.2 | | | | | | | | | | | FreeBSD | | | | | 13.3 | | | | + | | *--NetBSD | | + | | | 10.0 | | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -886,6 +888,7 @@ macOS 14 2023-09-26 [APL] OpenBSD 7.4 2023-10-16 [OBD] FreeBSD 14.0 2023-11-20 [FBD] FreeBSD 13.3 2024-03-05 [FBD] +NetBSD 10.0 2024-03-28 [NBD] Bibliography ------------------------ From nobody Sun Mar 31 18:36:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V72tK1Bsyz5G8QG; Sun, 31 Mar 2024 18:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V72tK00d4z46KH; Sun, 31 Mar 2024 18:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711910217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xWujVjSCWdxPSKPUkuNxuitsR6LZtEQKVHU/q/yPqY8=; b=Z0m1KqiWYT2WTFBiFZY3trZI0sEgkCTK5Q6eJyP7wwzWdNXVpa337wgY51g2jeyl/aOojg TuE7hFY7xu09x3QlK6JSGAGi3enpKn4axBZzDhIMFdVypMikkUZDpd4aGr6XNwYp/5oC/O xAZhiO5TAbLjDJsvC5zWq0kCu/GZFYXmjq4DlNC0j6ooZzPb9hTvavlnx2zHfZo0GNJg/u FSv0gzAlWYUONU3IN1gn0zTMS/5BcMEYI8rWOujgRkemAw/2M/t8kVYME4XnwOsC2/3egz OuSdmgM/q1Q/KOLEB0Xho6eOVKQbNulEQ09W2Aqmch0V4IK9eT9JjssuPxyw+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711910217; a=rsa-sha256; cv=none; b=V2n+t8NjNek60GE7Ti5/wpKaePZ0mOkqd2Kgle/MZx5Bs5duUa2Y4k8gv1BndRf9YZO5zF ffFzX9QooYcPoXU1MlwFMwEAoiOOeB9zkxPbNQlGrn7bqNzNkz1wc9LYLr7wNgNW+rIae5 kYus3hOsQBZ8NVHF0ad9R5UbEU7mAt3CnbIXlhdyQrPK/qFJ6fXDqjZJakjN4zwcj3xk92 hhSk/Rkgq5Um6jU57BebwClpYDbjSG32EGn65BqH+oUC1eoiaXIjY1yiHi7aVFUHhMTJhi Ec8fRCg+qJshmtcb8X6lGzCv7sheMjXFsR1Lweee2U9L90RkTaHdlsl/UDVS/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=1711910217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xWujVjSCWdxPSKPUkuNxuitsR6LZtEQKVHU/q/yPqY8=; b=rokvn1s+JarQ0UnPGkbVpOSCyhNyIpCiA3Q5u6KW4vezpB+I0s2SE4hlaYfLKnyzi2JXF3 TELe8qHW6RXncxyyorq46rKHtLIGllo5YhwyDeilYr3Rxhys6MYeWUjmMWR+MdkH7J1x7S aw/0uWqsB8AJQpUjWIrUB+T77posNeLY6Va5twq482tkvsmn/ffX1mytEDgdYWim0/MwXq Vqq45ib2UiU9T0I6LZmM4PAYJRU8qgFpWtmz55xhiCX3oyoaZ5kHwcInHb9zPd+op7L73i JuZned00AeYyWzFF22lIuupfn2jwrCCdUseqgZhAciCUwt6ytv4BD5GJaGXn1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V72tJ6kH5zpT6; Sun, 31 Mar 2024 18:36:56 +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 42VIauiE009311; Sun, 31 Mar 2024 18:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VIaupo009308; Sun, 31 Mar 2024 18:36:56 GMT (envelope-from git) Date: Sun, 31 Mar 2024 18:36:56 GMT Message-Id: <202403311836.42VIaupo009308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: ad5ec5136ba3 - main - bsd-family-tree: remove EoL whitespace List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad5ec5136ba3aa7d2863db23dc97fd875213f7ad Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=ad5ec5136ba3aa7d2863db23dc97fd875213f7ad commit ad5ec5136ba3aa7d2863db23dc97fd875213f7ad Author: Maxim Konovalov AuthorDate: 2024-03-31 18:36:03 +0000 Commit: Maxim Konovalov CommitDate: 2024-03-31 18:36:03 +0000 bsd-family-tree: remove EoL whitespace --- share/misc/bsd-family-tree | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 6bcde1ed052e..e2aa0ceecc20 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -924,7 +924,7 @@ URL: https://web.archive.org/web/20081230094857/http://www.byte.com/art/9410/sec Andreas Klemm, Lars Köller. If you're going to San Francisco ... Die freien BSD-Varianten von Unix. c't April 1997, page 368ff. -FreeBSD Release Information +FreeBSD Release Information URL: https://www.FreeBSD.org/releases/ Manual pages for FreeBSD and ports From nobody Sun Mar 31 19:01:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V73QJ0CRZz5GC51; Sun, 31 Mar 2024 19:01: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 4V73QH6mh3z4MZj; Sun, 31 Mar 2024 19:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711911672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/6i6Pkyezu2CGfy2qkZycf+qpNnhe8xrNrHYeqamLE=; b=RW1NuszvTx5SM/ijDTRIPFeYGLTS0qls/tT7K3GC+WZ3qNGTgdmtJ7JywT+5zLtX2wX48m wKe88aBzoZpM4MhLGVtEPVitGMbfAGhBbc0qtMXuMKD5iwj9UnuUNbI80vh9Q6j54/8ye7 Otv/kj66FYZRGarVCuCht04PIGy8XzgySbNlNLqkY9xbPmi+YYvaA7XWuQdychBRJX/LaS 3n6Twv8lnGViS/4stuc8oHgeHtgeSP78WCb2bhuFoqs4LsGy6eZScvuPLhjpObOt45gxVz JjcO3VG5uIGv6AvmIFm8noeWOvKpQaCixAOnn+8LvgPh3dMq73EfEO7a+LjVMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711911671; a=rsa-sha256; cv=none; b=CfU2xesUynqdu2AM4rqtoeWVPOsbeCc7SOeGLEwnunqW77I1Xhz5fk1Pme0vqN7NTyJB92 G/bOMnhQH+QT75aiCH8sVyk4p7qB8xJIjFVuptSr3uuSDqjoHA9fmE95LoCPTAHgywt4NL r+GVEZ++zq9vHjJJKEPN8BuZlbdQ/RQJ3yIUgZFY674A+b8a0lkldAbUwp3lyry1BiJW/g fxqacQuVmsLDb8XRjZwosMAj80Mdb68+V/hDTuYboshsrqawfHZaOnA4065S0oh5iFeHKY i6AQ/hC+GbdmUNzCuvSvDsaMhIXwVqNnZ1OQjltDuQD3QDqLwKYrkrqBopmeGw== 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=1711911671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/6i6Pkyezu2CGfy2qkZycf+qpNnhe8xrNrHYeqamLE=; b=t2U8tsK8MC2eIjguvnmXPIytocdFBjfjFzIlsrgr6BE2jYwFCG+QkFPEikxao4pxIhUudU oqkYNCkS47Uu+EPMlJM6gvPKMqr3UjyKx6qnth9CpdkSgkPpiJntIgho6OBYlQG27s+6rE 2/BRWONZk8Z8wpdCJqs4cURZDwXaO/FHyc28ZAQz6TLUer+sEnxxDd73kJD3h4ZQKLlBc2 lUFJA4IsYfWj9Kb1TluGIOFBCwdNKos86VmSJN6FAJyhcGl4mB5Ap7Rn78Jd7GGp0ZZOZa IGEN/Dnn1io5MwuXVmFeabevTY1dHbAql6dDsqGCfr6jge4e36+8acst57uNug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V73QH6NJ1zqh1; Sun, 31 Mar 2024 19:01:11 +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 42VJ1BA0060843; Sun, 31 Mar 2024 19:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VJ1BRF060840; Sun, 31 Mar 2024 19:01:11 GMT (envelope-from git) Date: Sun, 31 Mar 2024 19:01:11 GMT Message-Id: <202403311901.42VJ1BRF060840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: fefb7c399b39 - main - mountd.c: Add warning messages for administrative controls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fefb7c399b39403e1a31157e925a541f1cc24f0b Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=fefb7c399b39403e1a31157e925a541f1cc24f0b commit fefb7c399b39403e1a31157e925a541f1cc24f0b Author: Rick Macklem AuthorDate: 2024-03-31 19:00:08 +0000 Commit: Rick Macklem CommitDate: 2024-03-31 19:00:08 +0000 mountd.c: Add warning messages for administrative controls When "administrative controls" (which are exports of subdirectories within a NFS server's local file system) are used, they export the entire local server file system. (The subdirectory only applies to the Mount protocol used for NFSv3 mounts.) To minimize the risk that this causes confusion w.r.t. what is exported to NFS client(s), this patch generates warning messages for these. Only one message is generated for each server local file system. The messages can be silenced via a new "-A" command line option. The mountd.8 man page will be patched via a separate commit. Reviewed by: emaste, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D44502 --- usr.sbin/mountd/mountd.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 73a4dbfe39b3..14693a922186 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -130,10 +130,11 @@ struct exportlist { SLIST_ENTRY(exportlist) entries; }; /* ex_flag bits */ -#define EX_LINKED 0x1 -#define EX_DONE 0x2 -#define EX_DEFSET 0x4 -#define EX_PUBLICFH 0x8 +#define EX_LINKED 0x01 +#define EX_DONE 0x02 +#define EX_DEFSET 0x04 +#define EX_PUBLICFH 0x08 +#define EX_ADMINWARN 0x10 SLIST_HEAD(exportlisthead, exportlist); @@ -272,6 +273,7 @@ static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; static char **hosts = NULL; static int force_v2 = 0; +static int warn_admin = 1; static int resvport_only = 1; static int nhosts = 0; static int dir_only = 1; @@ -434,11 +436,14 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnp:RrS")) != -1) + while ((c = getopt(argc, argv, "2Adeh:lnp:RrS")) != -1) switch (c) { case '2': force_v2 = 1; break; + case 'A': + warn_admin = 0; + break; case 'e': /* now a no-op, since this is the default */ break; @@ -1696,6 +1701,20 @@ get_exportlist_one(int passno) fsb.f_fsid.val[1]); } + if (warn_admin != 0 && + (ep->ex_flag & EX_ADMINWARN) == 0 && + strcmp(unvis_dir, fsb.f_mntonname) != + 0) { + if (debug) + warnx("exporting %s exports entire " + "%s file system", unvis_dir, + fsb.f_mntonname); + syslog(LOG_ERR, "Warning: exporting %s " + "exports entire %s file system", + unvis_dir, fsb.f_mntonname); + ep->ex_flag |= EX_ADMINWARN; + } + /* * Add dirpath to export mount point. */ From nobody Sun Mar 31 19:21:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V73st1NRZz5GFR2; Sun, 31 Mar 2024 19:21: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 4V73st0xmSz4SJH; Sun, 31 Mar 2024 19:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711912898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5QLegiki3QPeC3B9BnomLXGz+15D2nAIFQP0Lk8SPLo=; b=Fjz95xYXZp+ubVfEz1xZYlEW8BnfnCZz8YVuWfJtCToqk7B42x7IgLA/LrXca/P53o1dg2 p4HJAAPw9nnTS+yAu6t+B1xEdFxpBr7/rChAy27zSsad59yn4L1M3IDoj6bG3DSlvFsacA LSi9gnX7Obdv4UelryfCT8P1YIhZBdpEQRxbHWuRLFRS5ln+VauBBxy91HP4kuYMEvU94j eJcvx6cX8bMu56YdF8r0cOad15ULrmRvZoWMpYsVvCbbmq9uH7O7yjbE7xc7VDxcxijmHb 7+st+n0z8obLcLUE6TaNdM+1SMEg8+ZhTR5+feWnSuncTtMk/ZVwzlvwurDRiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711912898; a=rsa-sha256; cv=none; b=f3FlFubbw05yPEOQVBVSnQAQua+gG7Xhn4ZN6tVaJn0qJAJ35KRbNk/+SrECLOvFqZvK7N Atb0obmzpcBEMzTkUlPM46gosF/rJwoVW9ql3badYpx23Ql7omKgsr7LY07vMe9N+negIr YCN9dq8tajD5NaP1VFnWy8Of3zs1ZCSShv3gYSKMnoJpxaM3r/HSTVf8W2mQZXKPHVypmM N6YH49y5/0pHrHv3p9xvPYuesXPvWDUyZdLZlQz2QYeq4bhElYfwsBPuk6FAAeKlw579fE QOqaXwgimyjtt6J1Gv3Rl5U9eTky2Sc9X6rCf4xJgcLwau40jzkjkiWslQy1ow== 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=1711912898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5QLegiki3QPeC3B9BnomLXGz+15D2nAIFQP0Lk8SPLo=; b=P0O7OrXCPMdvffJFL09VYnhFkOKpHi7vFakQZ6bphIOdc/JB6FX20EzkiKlA9SkxJLnhBa zCsxBAPz7usd9fZvX807UB4xjsuGdgVnLvJZGoANNp4idDB2HiuwbX9HvGBTJTNIQ8KO3C HtMlttzu89wSGXM1xn3GwuYxIQQb1pe47EaFfHJ+qAxNy5G7gGM9KfgiBCcecmB2+r6vFy 5sHIudUD1xlS2a/PxKr21mQaMxbGS6mTI/wGyM/fd3DoanA3RcCsJBQn6skX81fcd8cknb UkUYooz4tJhaS8OtZ78GGtcpRt5Hx+8dERcNTPfp5yhb1VGj/Km/0jBfADZPAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V73st0Ybgzr0M; Sun, 31 Mar 2024 19:21: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 42VJLbmp097321; Sun, 31 Mar 2024 19:21:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42VJLbcr097318; Sun, 31 Mar 2024 19:21:37 GMT (envelope-from git) Date: Sun, 31 Mar 2024 19:21:37 GMT Message-Id: <202403311921.42VJLbcr097318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: ee36e7faceaf - main - snd_hdspe(4): Only buffer_copy() audio data once. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee36e7faceafeef05c5e81654a1d8ec11d314894 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=ee36e7faceafeef05c5e81654a1d8ec11d314894 commit ee36e7faceafeef05c5e81654a1d8ec11d314894 Author: Florian Walpen AuthorDate: 2024-03-31 19:14:16 +0000 Commit: Ruslan Bukin CommitDate: 2024-03-31 19:14:16 +0000 snd_hdspe(4): Only buffer_copy() audio data once. Instead of blindly copying two periods of audio data to and from DMA buffers, keep track of the writing position and derive the actual part of audio data that needs to be copied. This approximately halves the number of samples copied in total. Differential Revision: https://reviews.freebsd.org/D44084 --- sys/dev/sound/pci/hdspe-pcm.c | 46 ++++++++++++++++++++++++++++++++++--------- sys/dev/sound/pci/hdspe.h | 1 + 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index 594a4f704028..0e78be113a66 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -540,7 +540,8 @@ buffer_copy(struct sc_chinfo *ch) struct sc_pcminfo *scp; struct sc_info *sc; uint32_t row, ports; - unsigned int pos; + uint32_t dma_pos; + unsigned int pos, length, offset; unsigned int n; unsigned int adat_width, pcm_width; @@ -558,13 +559,35 @@ buffer_copy(struct sc_chinfo *ch) else pcm_width = 8; - if (ch->dir == PCMDIR_PLAY) - pos = sndbuf_getreadyptr(ch->buffer); - else - pos = sndbuf_getfreeptr(ch->buffer); + /* Derive buffer position and length to be copied. */ + if (ch->dir == PCMDIR_PLAY) { + /* Position per channel is n times smaller than PCM. */ + pos = sndbuf_getreadyptr(ch->buffer) / n; + length = sndbuf_getready(ch->buffer) / n; + /* Copy no more than 2 periods in advance. */ + if (length > (sc->period * 4 * 2)) + length = (sc->period * 4 * 2); + /* Skip what was already copied last time. */ + offset = (ch->position + HDSPE_CHANBUF_SIZE) - pos; + offset %= HDSPE_CHANBUF_SIZE; + if (offset <= length) { + pos = (pos + offset) % HDSPE_CHANBUF_SIZE; + length -= offset; + } + } else { + /* Position per channel is n times smaller than PCM. */ + pos = sndbuf_getfreeptr(ch->buffer) / n; + /* Get DMA buffer write position. */ + dma_pos = hdspe_read_2(sc, HDSPE_STATUS_REG); + dma_pos &= HDSPE_BUF_POSITION_MASK; + /* Copy what is newly available. */ + length = (dma_pos + HDSPE_CHANBUF_SIZE) - pos; + length %= HDSPE_CHANBUF_SIZE; + } - pos /= 4; /* Bytes per sample. */ - pos /= n; /* Destination buffer n-times smaller. */ + /* Position and length in samples (4 bytes). */ + pos /= 4; + length /= 4; /* Iterate through rows of ports with contiguous slots. */ ports = ch->ports; @@ -576,10 +599,10 @@ buffer_copy(struct sc_chinfo *ch) while (row != 0) { if (ch->dir == PCMDIR_PLAY) buffer_mux_port(sc->pbuf, ch->data, row, ch->ports, pos, - sc->period * 2, adat_width, pcm_width); + length, adat_width, pcm_width); else buffer_demux_port(sc->rbuf, ch->data, row, ch->ports, - pos, sc->period * 2, adat_width, pcm_width); + pos, length, adat_width, pcm_width); ports &= ~row; if (pcm_width == adat_width) @@ -587,6 +610,8 @@ buffer_copy(struct sc_chinfo *ch) else row = hdspe_port_first(ports); } + + ch->position = ((pos + length) * 4) % HDSPE_CHANBUF_SIZE; } static int @@ -620,6 +645,8 @@ clean(struct sc_chinfo *ch) row = hdspe_port_first_row(ports); } + ch->position = 0; + return (0); } @@ -664,6 +691,7 @@ hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, /* Allocate maximum buffer size. */ ch->size = HDSPE_CHANBUF_SIZE * hdspe_channel_count(ch->ports, 8); ch->data = malloc(ch->size, M_HDSPE, M_NOWAIT); + ch->position = 0; ch->buffer = b; ch->channel = c; diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index 26694f60ce58..de20462170e7 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -184,6 +184,7 @@ struct sc_chinfo { /* Buffer */ uint32_t *data; uint32_t size; + uint32_t position; /* Flags */ uint32_t run;