From nobody Mon Jul 22 00:55:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zT6ntYz5QwTG; Mon, 22 Jul 2024 00:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zT6FKtz4j16; Mon, 22 Jul 2024 00:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2VEXFRgOQ+hKKMSY16R4k5gJRyu7lr5IPOE5SrAi8WE=; b=Q/Fc9IjuOMvtYZrf0wtCGPVsQGIptpm/xjCtmXQFGhzK/by2A8t9T2eMsmZVYDt44qA3oM 16Qtkl7xJsvvGXIGJaP6Y6Nr+jXs1SQa/CafMg3NESEAiuYWoMbnzufcCthwKKHk4EdHmL C6WKgEXvLjaKOccnIkMNh4OmPmRph9TAQPKmxaNiX3Bg21us03Y76QhCvSGyEQhOE/93+M g0Y1eax0ZF8z0a/o1LdUSxgvjK29sPgJu22Ulun31xPzk4z5o+U5WiIYewX0CycbQlZ9Cu IFr9s6PHn7WMq67ygneNfLvQEP9DaCneK7JF4OVq4+f0FWUBkrzDZu+zyQ9LFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609733; a=rsa-sha256; cv=none; b=gZn+yblWGhTUmx5jDbuxZ2DJLTnDHXrcXH83SpEZcq5VhYYE2DEqpR2Hao3UigGNWlrccN 4S31Wda+dZ3+inyKyeqluAqIccrTz8FF0gAGg/6cOiMG6lFFTTieHkfLzFIZ283GWK32hB s0lyJYCaY7pNCf5srXp9nQtpHSJiNGP9PRn6ialoMy4PYPtAV3Z7FpKAbSxgwHWRJA6NRH Bo0Fi/DH6PHKMq6zhXsbvUuPCEW9ZaB7L0+PEf4+FsmrUQfh+erKSV7eAtfQGBAi57yH79 2y3rXdbcTgd/vaLCyBgVnp1y3Dvs0AEoRk3QrMQnQ2xe09uYyPaVL650zZ/iSQ== 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=1721609733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2VEXFRgOQ+hKKMSY16R4k5gJRyu7lr5IPOE5SrAi8WE=; b=CrJSC9PCDbc0iik7fihGSsZAM/wKJZBpBvDAzthR4/aQ+lY55Ey9T9S5y1cF2BeXcazfrd kldgt4SuyhOjvYrJ6cpKyDh/Ox1hje0H3+rwztjvZOh+VW3GuJTwJOYyUQ/oVgHCII+Fjp GlkFI3JCkB7H1bpPXQZlXYB1inEHYbmYIBM+yOfnq1UMCPBN4tjIsBifdzdfsEp28z4ix6 De4Kde3Xrt4Be3skMaH0/rxIKdWoDESgndZ1K5iLp2Mymin3FzlKxpgkF8Q66eGwOM8ul5 WHadPR7QGB7BLhNaA8QKvBabHtsVnrzhZZ0+8PDpLFxk9XuLU+Sz3RUpHCbyiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zT5rxnzNb6; Mon, 22 Jul 2024 00:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tXNo007153; Mon, 22 Jul 2024 00:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tXj3007150; Mon, 22 Jul 2024 00:55:33 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:33 GMT Message-Id: <202407220055.46M0tXj3007150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: dc1f4c3d9aab - stable/14 - libdtrace: Use designated initializers for modules ops tables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dc1f4c3d9aab6524b06630e2168a1ca6525674bf Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dc1f4c3d9aab6524b06630e2168a1ca6525674bf commit dc1f4c3d9aab6524b06630e2168a1ca6525674bf Author: Mark Johnston AuthorDate: 2024-07-10 21:17:38 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 libdtrace: Use designated initializers for modules ops tables No functional change intended. MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit f6372351da07ae101d5a22a2bb2bdb2753da2b40) --- .../contrib/opensolaris/lib/libdtrace/common/dt_module.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 281c787de533..6fb9b0f84769 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -452,17 +452,17 @@ dt_module_symaddr64(dt_module_t *dmp, GElf_Addr addr, } static const dt_modops_t dt_modops_32 = { - dt_module_syminit32, - dt_module_symsort32, - dt_module_symname32, - dt_module_symaddr32 + .do_syminit = dt_module_syminit32, + .do_symsort = dt_module_symsort32, + .do_symname = dt_module_symname32, + .do_symaddr = dt_module_symaddr32 }; static const dt_modops_t dt_modops_64 = { - dt_module_syminit64, - dt_module_symsort64, - dt_module_symname64, - dt_module_symaddr64 + .do_syminit = dt_module_syminit64, + .do_symsort = dt_module_symsort64, + .do_symname = dt_module_symname64, + .do_symaddr = dt_module_symaddr64 }; dt_module_t * From nobody Mon Jul 22 00:55:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zW1zGgz5QwlK; Mon, 22 Jul 2024 00:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zV6t08z4hvQ; Mon, 22 Jul 2024 00:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5JTqRmrJQ0c5BJ5l2U7N3yrYDqpkLK5CFPh1uGd3Wk8=; b=bEYFIS4EHTym3aU5Fz8hXvzLJyWVI0uHpu/zP9vo7m1vKJ+uo+JuC2ulpA8vyJk8lGczc/ nCj6KWbLH7Ez19d0KMl169KSusIO0bjPECvtWUxC7NJk3SYhiL5RHdV/JbvrpvBZhaZ2Mi 3r4nZGEtKQ7LJ9F8378oTdwKBPmLelUUoipXn065412OEonL8+HX+RpraVzgC5hO2TE/iJ aVHn+ehKM31/y6hTSx6gV8w2xs1QgFfup1CCikS0l97WVAZ0DaMUpMRgrsQWb8pZTah7L7 O0OLBaiRV/N/WwUZZF+Nr5UtVdPB5eBDsBGSS//rYipj28aJWd2h2Ew0Tqh3Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609735; a=rsa-sha256; cv=none; b=O6B/cjIBx3Jlk97K6E4OWNkNfLqpxpkDt/2s8VjbNvCkYkdEOQetdVF/7YKiLHiiIXdDb4 fElgdNoJ0RjPi3y5LrTh3oiSjiFCbwbXL3prcS00AnpJ7uuqgBlhvbv0fv7PGxlulVmdiR MW3aNs20aWbFLtFLPirz6Wq/itzHYdP/qtlTbrZkWDQpy7XXnm6Oh6v7OBWJ0q2bDVJlPW CSgPJAlf6AkXPXQlDMH1tfRm2gRiukERKpx2bXhrQOetNVQVhowdWG9GALGrribkm42lK8 L8bohI79baOMlEcggFwubpTudfHS5yr+N11Duj7MTrwMXPD6fPNd8HNeuI0D1w== 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=1721609735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5JTqRmrJQ0c5BJ5l2U7N3yrYDqpkLK5CFPh1uGd3Wk8=; b=iHVaQk6dnT+D60/zYxUGSWLz1cqnhHOQc8+b6hdetgSYgMsumtWBaMeKvvv4JwekaxD09f yPdTw1jnkozONuwMVJ0P2mfl/v/JFojm8fAyXuwl6peXrbnbijL4M8cJfzNG60N70/rYde cFdlRJpJHU8iNcu+xlNk72R5b40me1brsh0OGz8Zn3aFKdAJ/bX7Fofcx6sbb4J8jswuxT UvLb5qOTnYZm5JWBrcd+epI46UZwltlb67gMbOkYmjDoyfGUk+A939831eCcVCDskyQCGR 1U2hZkfs5sQ4pX5dzytwCVkxowVLn159ul2F601lrZTasfp+HuloWV0Ff3wA3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zV6VGkzNb7; Mon, 22 Jul 2024 00:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tYRd007201; Mon, 22 Jul 2024 00:55:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tYVO007198; Mon, 22 Jul 2024 00:55:34 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:34 GMT Message-Id: <202407220055.46M0tYVO007198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7d521f0a61ff - stable/14 - buf_ring: Make buf_ring.h amenable to userspace compilation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d521f0a61ff8be5778979d97e71760fe8559e14 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d521f0a61ff8be5778979d97e71760fe8559e14 commit 7d521f0a61ff8be5778979d97e71760fe8559e14 Author: Mark Johnston AuthorDate: 2024-07-11 18:55:11 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 buf_ring: Make buf_ring.h amenable to userspace compilation This will be useful for adding test cases. Reviewed by: andrew MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45869 (cherry picked from commit a161269b2451140a45de2d0cae0dad84f9e7b439) --- sys/sys/buf_ring.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 32c9f5b15f22..cb18175c3a75 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -30,11 +30,18 @@ #ifndef _SYS_BUF_RING_H_ #define _SYS_BUF_RING_H_ +#include +#include +#include #include #ifdef DEBUG_BUFRING +#ifdef _KERNEL #include #include +#else +#error "DEBUG_BUFRING is only supported in kernel" +#endif #endif struct buf_ring { @@ -361,8 +368,36 @@ buf_ring_count(struct buf_ring *br) & br->br_prod_mask); } +#ifdef _KERNEL struct buf_ring *buf_ring_alloc(int count, struct malloc_type *type, int flags, struct mtx *); void buf_ring_free(struct buf_ring *br, struct malloc_type *type); +#else -#endif +#include + +static inline struct buf_ring * +buf_ring_alloc(int count) +{ + struct buf_ring *br; + + KASSERT(powerof2(count), ("buf ring must be size power of 2")); + + br = calloc(1, sizeof(struct buf_ring) + count * sizeof(void *)); + if (br == NULL) + return (NULL); + br->br_prod_size = br->br_cons_size = count; + br->br_prod_mask = br->br_cons_mask = count - 1; + br->br_prod_head = br->br_cons_head = 0; + br->br_prod_tail = br->br_cons_tail = 0; + return (br); +} + +static inline void +buf_ring_free(struct buf_ring *br) +{ + free(br); +} + +#endif /* !_KERNEL */ +#endif /* _SYS_BUF_RING_H_ */ From nobody Mon Jul 22 00:55:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zX3KKxz5Qwjw; Mon, 22 Jul 2024 00:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zX0zyzz4j17; Mon, 22 Jul 2024 00:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zi8ajJC420nGpve2eNNwKHw6DkY8d6k/2vgGvcaZV9s=; b=wy8o1EOvwSztX6Ep6cE033H8deqsOmbWYRMaquX/0Mh/GWs3PsCVyUgnoj92mEekKFyPQk FYwz/+1/0beUyj4LeySO+Psl1n3qwZguovjHwC/xeFJYP59EbfdxkVgPVVmHDqfM21um95 QpT1V+HZmicfAkOJN8E5AhtXypovKyiAEJLZG1J7xY+qOPbSns6dP7cqiDf8VZKDGn4NJe zQAltVsWIaZw48NZiSIcjNsR57GxB9jN7Gik/zXw81FAaMDd+U5sfWvTVI7MEC/PdpWSZR mTAy+4sweNvFuPmUjE0x95lrJd7G3PWYebgUS3VaPb2fPOYNsg6/VpfazaFHTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609736; a=rsa-sha256; cv=none; b=NN895ZJl7lcAA9FgbkRlCCBp7/EzWf9nXECCsXCyMN+/Uyw4GDkEgVWnuo/5mIk6Rysh1R Qwr6dmeIcDObZ25w6c/qRNK2BpUbOtq7agyz9dbBBuRW7h5OCBQRIz6FKfSSfgvUph2kal 1Q2Tn07bleeFgKy1TUvj6FyT7jZRrjAu/NN3rri+gWzonJymq5mA1TNb48cDqOKOkRBLdD LyaDijyKof/rNwsMXCJhzySO/DKCC1NqAcqb0aNq1wDlLExwy4jjd8Y2Q8RKrSeOBFAChP udEemvo+nktukkY++7lFkwZgW8bypPxwAlUYhV9qIco7GkS8i+gI5+7yWkjtmw== 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=1721609736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zi8ajJC420nGpve2eNNwKHw6DkY8d6k/2vgGvcaZV9s=; b=K28Z/liz3Kt/QO2OfTYXKCypVKSvzwhMEonmNVSUW3jKtfWfmnaEEwvzPSZ4ilrCvRsGma 7LeXMepBTBeMO+uxAkcIgGxQRnDKfCTlX86maxo8QmMMQi2Xck41rJDq8776JlKkZ5Uo8S tXkPfhHwL7NLHPW/HoVEnecPBe/CJuw1ttsU0cHqzCPILMuGzE6toZJu5oeb0U2n1y+P3D u34HS5bgLTpOjhBnvv4eogOMXvwtKAT9YmAWQtAS1YzoXgeEN2mxtreXs1mhQD8iDvkSrd M8h219CljspNC2KxADbdwySmfJsbXwK7Pg4asIzu6by6VYfaBC+orRbqkoSpqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zX0b9rzNcY; Mon, 22 Jul 2024 00:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tZhW007244; Mon, 22 Jul 2024 00:55:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tZQd007241; Mon, 22 Jul 2024 00:55:35 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:35 GMT Message-Id: <202407220055.46M0tZQd007241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3985e96ac5c6 - stable/14 - route: Wrap long lines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3985e96ac5c6cf407642e9ccfdd3094989508121 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3985e96ac5c6cf407642e9ccfdd3094989508121 commit 3985e96ac5c6cf407642e9ccfdd3094989508121 Author: Mark Johnston AuthorDate: 2024-07-14 16:20:48 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 route: Wrap long lines No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit ec1b18c7353ad20d2d373e58931aeccfccd5599d) --- sys/net/route/route_debug.h | 36 +++++++++++++++++++++++------------- sys/net/rtsock.c | 4 +++- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/sys/net/route/route_debug.h b/sys/net/route/route_debug.h index b00fbf1784e7..ebf0d9408171 100644 --- a/sys/net/route/route_debug.h +++ b/sys/net/route/route_debug.h @@ -78,33 +78,42 @@ SYSCTL_DECL(_net_route_debug); * This is NOT compiled in by default. Turning it on should NOT seriously impact performance * LOG_DEBUG3 - last debug level. Per-item large debug outputs. * This is NOT compiled in by default. All performance bets are off. - * */ -#define _output printf +#define _output printf #define _DEBUG_PASS_MSG(_l) (DEBUG_VAR_NAME >= (_l)) -#define IF_DEBUG_LEVEL(_l) if ((DEBUG_MAX_LEVEL >= (_l)) && (__predict_false(DEBUG_VAR_NAME >= (_l)))) +#define IF_DEBUG_LEVEL(_l) \ + if ((DEBUG_MAX_LEVEL >= (_l)) && (__predict_false(DEBUG_VAR_NAME >= (_l)))) /* * Logging for events specific for particular family and fib - * Example: [nhop_neigh] inet.0 find_lle: nhop nh#4/inet/vtnet0/10.0.0.1: mapped to lle NULL + * Example: [nhop_neigh] inet.0 find_lle: */ -#define FIB_LOG(_l, _fib, _fam, _fmt, ...) FIB_LOG_##_l(_l, _fib, _fam, _fmt, ## __VA_ARGS__) -#define _FIB_LOG(_l, _fib, _fam, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ - _output("[" DEBUG_PREFIX_NAME "] %s.%u %s: " _fmt "\n", rib_print_family(_fam), _fib, __func__, ##__VA_ARGS__); \ -} +#define FIB_LOG(_l, _fib, _fam, _fmt, ...) \ + FIB_LOG_##_l(_l, _fib, _fam, _fmt, ## __VA_ARGS__) +#define _FIB_LOG(_l, _fib, _fam, _fmt, ...) \ + if (_DEBUG_PASS_MSG(_l)) { \ + _output("[" DEBUG_PREFIX_NAME "] %s.%u %s: " _fmt "\n", \ + rib_print_family(_fam), _fib, __func__, ##__VA_ARGS__); \ + } /* Same as FIB_LOG, but uses nhop to get fib and family */ -#define FIB_NH_LOG(_l, _nh, _fmt, ...) FIB_LOG_##_l(_l, nhop_get_fibnum(_nh), nhop_get_upper_family(_nh), _fmt, ## __VA_ARGS__) +#define FIB_NH_LOG(_l, _nh, _fmt, ...) \ + FIB_LOG_##_l(_l, nhop_get_fibnum(_nh), nhop_get_upper_family(_nh), \ + _fmt, ## __VA_ARGS__) /* Same as FIB_LOG, but uses rib_head to get fib and family */ -#define FIB_RH_LOG(_l, _rh, _fmt, ...) FIB_LOG_##_l(_l, (_rh)->rib_fibnum, (_rh)->rib_family, _fmt, ## __VA_ARGS__) +#define FIB_RH_LOG(_l, _rh, _fmt, ...) \ + FIB_LOG_##_l(_l, (_rh)->rib_fibnum, (_rh)->rib_family, _fmt, \ + ## __VA_ARGS__) /* Same as FIB_LOG, but uses nh_control to get fib and family from linked rib */ -#define FIB_CTL_LOG(_l, _ctl, _fmt, ...) FIB_LOG_##_l(_l, (_ctl)->ctl_rh->rib_fibnum, (_ctl)->ctl_rh->rib_family, _fmt, ## __VA_ARGS__) +#define FIB_CTL_LOG(_l, _ctl, _fmt, ...) \ + FIB_LOG_##_l(_l, (_ctl)->ctl_rh->rib_fibnum, \ + (_ctl)->ctl_rh->rib_family, _fmt, ## __VA_ARGS__) /* * Generic logging for routing subsystem - * Example: [nhop_neigh] nhops_update_neigh: L2 prepend update from lle/inet/valid/vtnet0/10.0.0.157 + * Example: [nhop_neigh] nhops_update_neigh: */ #define RT_LOG(_l, _fmt, ...) RT_LOG_##_l(_l, _fmt, ## __VA_ARGS__) #define _RT_LOG(_l, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ @@ -113,7 +122,8 @@ SYSCTL_DECL(_net_route_debug); /* - * Wrapper logic to avoid compiling high levels of debugging messages for production systems. + * Wrapper logic to avoid compiling high levels of debugging messages for + * production systems. */ #if DEBUG_MAX_LEVEL>=LOG_DEBUG3 #define FIB_LOG_LOG_DEBUG3 _FIB_LOG diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index caee9bd6e83f..3905584e431d 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -138,7 +138,9 @@ struct linear_buffer { }; #define SCRATCH_BUFFER_SIZE 1024 -#define RTS_PID_LOG(_l, _fmt, ...) RT_LOG_##_l(_l, "PID %d: " _fmt, curproc ? curproc->p_pid : 0, ## __VA_ARGS__) +#define RTS_PID_LOG(_l, _fmt, ...) \ + RT_LOG_##_l(_l, "PID %d: " _fmt, curproc ? curproc->p_pid : 0, \ + ## __VA_ARGS__) MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); From nobody Mon Jul 22 00:55:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zZ60qzz5Qwr7; Mon, 22 Jul 2024 00:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zZ2cSMz4jDV; Mon, 22 Jul 2024 00:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/boUohqG21H0op7wiTDg8FaZyDou3UlhCh7TahOH5To=; b=XK/NLD7LvceBsyQlupgPVzxGNsuPw7+hm2YP2Y35Zk39MxOsO8txVhhik83c48hO4h3mCj 09R3x4ym4/SHeCZFRnbwJmkonckZlmBa2ol903eZncIX6X89oZPKYDb7Ac/MUVwXPTYLRf uhokKY+9i8isfRYFXGAeu1zih7PRXG4H2SrkEFPiss/aC5NmKCA4spghK7IkACXuwXTOHY 06+wvkLlWEDTH2U0kANamKTs0uBy+yTmTM4QZFk/w0hjw19dnWRBNM5xqyJIXWrVKW9hZk wttiHjqJFIBkJtPq3yToh4Ey59NYvnwMmp8LJri9yO/Z/YRMKfWmwSntVBI1+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609738; a=rsa-sha256; cv=none; b=D8U8NDcd3IEnLf/OACF5HLWo5WCU8nCXv04OB9c85qv8xEv8qrrDfIFa8gRcCZ+E02WpFl 8LAZpog6WxGvzDKgfaQRObrQDwHSrnCwLbTQL/VTrEJk0lDD13LcLtp6MfpPvVSUEI44SR 66wS48M/i5CzSLz7IMrwfUk6+H6uCTPDLyqwzS+3o5j9t0TiLx9BFSP6J4f1S/Iu+Md66G YNNN45BWqK9pchf/SQa/IStNovXO2wL2gp6ZdPJ7TQ8qE1URGQ1M1UlfyAwUTmXi6rhs+j jgEUITiTOejaIFcRE/sEaZBj6pEzyvZ4D+NP7AhDvhivnuSRKvOe8p7G1LPm3w== 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=1721609738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/boUohqG21H0op7wiTDg8FaZyDou3UlhCh7TahOH5To=; b=NAJa3tXQApcS+h2u6LNoPuLGCTsq9kyzlTEIB9mpEDu2oDikKz/K8N1UM8Ak3todBRGdiF ZoT68EUCbFl4BIdoY0d10F8V4UXN5qiXp8xAKhpXh/R7wXsXDwJra2SUC19U1zwLO975li 4cQzAn+Js9r71VFwuuT3x+oulKTyEND2DdISfHfmLP2lF4xvL+qKbKHwbHlWJ/0loLEnXs xSx26D16Ad6HIW4qIIjgfUTdp1GBEGdmkk6Syvis5lcDkXgrex99KwtJ4/SlqFGmrMTSjL P/RxW4pRaxSfLhO0+Uf1+GA2uuml2pMVF6JxMW9P2v1U4dNLxf4wlOv+YoPnCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zZ2D4lzNcb; Mon, 22 Jul 2024 00:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tcCK007322; Mon, 22 Jul 2024 00:55:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tc12007319; Mon, 22 Jul 2024 00:55:38 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:38 GMT Message-Id: <202407220055.46M0tc12007319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a8a1633e34f1 - stable/14 - lockf tests: Fix a race List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8a1633e34f1961f724c5ede96cdb435702b194d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a8a1633e34f1961f724c5ede96cdb435702b194d commit a8a1633e34f1961f724c5ede96cdb435702b194d Author: Mark Johnston AuthorDate: 2024-07-14 16:13:13 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 lockf tests: Fix a race The test launches lockf(1) in the background and races with it, so it shouldn't be using atf_check to check that lockf won the race. MFC after: 1 week (cherry picked from commit 498b3b494b8b3e500e555a9653d950b9e25a2f1a) --- usr.bin/lockf/tests/lockf_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index cc6938d2306e..d73c7590653d 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -47,7 +47,9 @@ basic_body() lpid=$! # Make sure that the lock exists... - atf_check test -e "testlock" + while ! test -e "testlock"; do + sleep 0.1 + done # Attempt both verbose and silent re-lock atf_check -s exit:${EX_TEMPFAIL} -e not-empty \ From nobody Mon Jul 22 00:55:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zb6hvsz5Qwr8; Mon, 22 Jul 2024 00:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zb3KZtz4hsB; Mon, 22 Jul 2024 00:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJIOMVYuMAyHwYu2jZXzmSLiQ64XmmcJoMGKRyfd30s=; b=QZRFZajGWKMXiLc0LP3RSoVhuRROeTghbP2HxWJXH/O2No011ZND/kas5DguoMsYzT0INM r1T2GLyJP953UTR/GNlU2jy65+jeFf5Lawtj4yn6Ah+juwq+m43j6CuqguOwtOOxngLbFZ tG5TgIDEMoHtnyZy3tFlhiLri/wGUtLA4pcmXTpxFXj6qmIpMObUi616tRQpXuTJaftman xp0itubC4IExOhB+3EhTDhPpyf4VFimtR/DCIOBOGSNvhbt0VgO+I8+qlbEuvlVjQoWx3j nw/6702FxhTvZZeenrP+5dyHgNa5FUUnpqYrL2QhnmQ058wK6bG+TUfQT/YlLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609739; a=rsa-sha256; cv=none; b=JMqACIbSoS34dm3YQiNt7PqOCBSEC1yjq2NEuUQzu+XxGin8HkrQ+IW8BNeo+qfZKeO6QD 65rddRDb1Dy0wkMUj0fy3691nv6YK9cs2EmWyPkOOK+9Mf3iKrHNXwCQd5xgmX3BrzBGMH ITZmRrtJ5I0UNmf8Cr9ChRxQr6tnQF058M8Ex+g7/E7JxXx4bS3aeB62vG/nkp1OaDOsT3 dfPpAxPTV6r0IqR2eve0qFvwceQt1QQtJBtAojpbc5BREQNp71YZ8pr5nZt6sEk4Jv0HNA RwnOziDs4acbOAqjNYnqETQj40e4+m1Hs4CwaQ7rUmuLmEkZ5GmNAvz3mtjukg== 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=1721609739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJIOMVYuMAyHwYu2jZXzmSLiQ64XmmcJoMGKRyfd30s=; b=vyj3QweJEo5r0R8j6ATy9uj7SKxquYdJ2TSgj7YDzXsVzpxQxUAbSEvV0CqYO5AqShcvS8 RvrNq+wQNRJ5hav5XfMMRBvfl/i1nrTsuGoGXd5omN0zhMVkXyzCSGn7mXxAx7A+ZCPjHj HDhHf9wLhDbUILHjxROjQIN9k8nFNSqd6yevaSa1oLiWgq8illImf7r8BMDHoljHFXm6Mr StfYImWTySKKZZF1UIoLFbm5IKF+tVKR4aVgX1oPKMC2YRKkB+dwihv0NtiJQbR4zboHkR yWKrkytM1dt1d/lV0YAXnhJ3gnlHk1mGMXcdjAubKQNRETRTNk8Ym08wGgpUeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zb2wcqzN8f; Mon, 22 Jul 2024 00:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tdjh007380; Mon, 22 Jul 2024 00:55:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tdq1007377; Mon, 22 Jul 2024 00:55:39 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:39 GMT Message-Id: <202407220055.46M0tdq1007377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c1dd895406a8 - stable/14 - sched tests: Avoid underflow when maxcpuid == 0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c1dd895406a849bebeceaac6e6f48c4983c37268 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c1dd895406a849bebeceaac6e6f48c4983c37268 commit c1dd895406a849bebeceaac6e6f48c4983c37268 Author: Mark Johnston AuthorDate: 2024-07-14 16:12:32 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 sched tests: Avoid underflow when maxcpuid == 0 MFC after: 1 week (cherry picked from commit 5b98bd30686a358b2a20728a4a6b5cecb7e28dc9) --- tests/sys/kern/sched_affinity.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/sched_affinity.c b/tests/sys/kern/sched_affinity.c index dce8678bcf6e..44802c5ac8e1 100644 --- a/tests/sys/kern/sched_affinity.c +++ b/tests/sys/kern/sched_affinity.c @@ -67,13 +67,16 @@ ATF_TC_BODY(test_setinvalidcpu, tc) { size_t cpusetsize; cpuset_t *set; + int cpu; + + cpu = maxcpuid > 1 ? maxcpuid - 1 : 0; cpusetsize = CPU_ALLOC_SIZE(maxcpuid + 1); set = CPU_ALLOC(maxcpuid + 1); ATF_REQUIRE(set != NULL); CPU_ZERO_S(cpusetsize, set); CPU_SET_S(maxcpuid + 1, cpusetsize, set); - CPU_SET_S(maxcpuid - 1, cpusetsize, set); + CPU_SET_S(cpu, cpusetsize, set); ATF_REQUIRE(sched_setaffinity(0, cpusetsize, set) == 0); CPU_FREE(set); @@ -82,7 +85,7 @@ ATF_TC_BODY(test_setinvalidcpu, tc) ATF_REQUIRE(set != NULL); CPU_ZERO_S(cpusetsize, set); CPU_SET_S(maxcpuid + 1, cpusetsize, set); - CPU_SET_S(maxcpuid - 1, cpusetsize, set); + CPU_SET_S(cpu, cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EINVAL); From nobody Mon Jul 22 00:55:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zY416bz5QwB2; Mon, 22 Jul 2024 00:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zY1Zrnz4hvS; Mon, 22 Jul 2024 00:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ChuWT3I2yjng/bUgKkXPCm30DuCNAXyLQ1gLcL3r+0=; b=tkeVVqdzFv28vlq0TZgJiUj9bI2xOaGIUXYgG/q8Ql8p4hRjriZson/gW/9B8/BxlHLXa/ WpODfBtAqKjCbh2+XXuLf4PUs0zuMEIIoETMUBdflYi1mYr2pWkSYfXUWi7l4vBlGFhvry r3F+c8po05oyuT+WUe/Kh4F5ZLUWd+zdbrfnv+aoGhtYDfLyrgolnMfrng04TDXJ1akL5J ffvtR1Hb3SYkarKnPVQ8hWGe7YxY91XcUwgDwqI00VlCn68mXlvR1RvK/jUpSoVrhvICKU iR2yFMBELRXg7lpCfzwHIPWEWf/hd13UjCAtTeBk3N6+btvAxgAfuySgmJ8OhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609737; a=rsa-sha256; cv=none; b=DM5rWO7EUOo9HxdzF6/iVLH204eM6pjZLz3zvMs81UgP/qC1ofrbedvU6ywcXULsf13e26 jh2SQGHmayNqvHKdXXhZE4lwc2kz4kWo7CBhrs5quwIb8Yi/wC+zNXEnBFdenQUPg0VjiR j9cEjLsdawkCTaidMUyetV668o39aaLpZroDaUQpXglkPp2H4EBztSLZHh52CEZBUutxjf LsdGH+sd1FpA4HmKg2F9apg0NELqrVQjWYxhppyaED1pr2bXL+LIn/S+O4FMHTdpMn0HC1 3vMvbWGjiar8oZ9shJjBixPh3EC0gxkfA/uJrKe48Xk4SBaOiYhRpLze9D3hNg== 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=1721609737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ChuWT3I2yjng/bUgKkXPCm30DuCNAXyLQ1gLcL3r+0=; b=ts0GULkZ+JQ6zGk/eG3RyG02Thu/+evVw7qeQHYrt9WajPujfEdZTaG7FZVOloLvGNJnw4 5wtl6KJrW9Mm3WbWwxovOiOCO73jzDVeFeA1yPMGjIzFB3IUKwddVGo4fAx23ypy67FaVY Oxk1CSdWzmDAEycNAAToNi7TIMRXirtX+RC/CWqQZ6l0a10kKeKM9VlqfmCOzvoOqwH2dW iWces6s5wiMEfN96+sJ/NEIpZRJQ4lA6ZSo4/qqsZBalqFqFY1OCBRYedUMxWM4bY7Qjp4 SfgRFyXvrnT+KJCJYOTjPO4IfnofQhXDr/Kita+cbB85INoIbohIQvQCwZZR6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zY1CFgzNcZ; Mon, 22 Jul 2024 00:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tbkg007280; Mon, 22 Jul 2024 00:55:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tbuX007277; Mon, 22 Jul 2024 00:55:37 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:37 GMT Message-Id: <202407220055.46M0tbuX007277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 239c9c6de125 - stable/14 - hptiop: Use device_set_descf() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 239c9c6de1250cc53f9f063fe9c698373aa9709c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=239c9c6de1250cc53f9f063fe9c698373aa9709c commit 239c9c6de1250cc53f9f063fe9c698373aa9709c Author: Mark Johnston AuthorDate: 2024-07-14 16:18:27 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 hptiop: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit 1c64b3aba3d0e2910ac52c18e3c240348eb3e36e) --- sys/dev/hptiop/hptiop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c index aa1251796bf1..bdb545be5b7e 100644 --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -1799,7 +1799,6 @@ static int hptiop_probe(device_t dev) { struct hpt_iop_hba *hba; u_int32_t id; - static char buf[256]; int sas = 0; struct hptiop_adapter_ops *ops; @@ -1852,9 +1851,8 @@ static int hptiop_probe(device_t dev) pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev)); - sprintf(buf, "RocketRAID %x %s Controller\n", - id, sas ? "SAS" : "SATA"); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "RocketRAID %x %s Controller", + id, sas ? "SAS" : "SATA"); hba = (struct hpt_iop_hba *)device_get_softc(dev); bzero(hba, sizeof(struct hpt_iop_hba)); From nobody Mon Jul 22 00:55:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zh5TRNz5Qwnk; Mon, 22 Jul 2024 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zc58vwz4jF0; Mon, 22 Jul 2024 00:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKmNzECsxqmrEPedlPS/hPQjJPu82D1WdZ1/F3sYrxU=; b=qWYwG2gDjGJ9wRcjEkMOwq7Q9jeSgggDkKOolPc22njkdGesZnbSRofw7bUyryJF2JFJlH 3FuPIM0ndNxb7HdkDqsgq6ojCx4oa+Zn+1h7P0tn26rl/7J3NSzTJGrt9ecqc/K8ruKmMb x7z8lhG3LnGAVHqdveMIKV9jRLQ74XlNyeaKpFHel92asJMRw6XGKzcxGJ5KQBvAocxrZ5 kSaJ75w/OLLibv5CbTB9VkPByyFQ3+CNjV9I/gIxhyRQyN0vUJIhqXKv+mtXeKMzapCpLu dbaVJKFpl7mGvjoTvjpeJ1ROE7p48hrCvUXUTeyTT3pINXfMS6UqfUosembHzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609740; a=rsa-sha256; cv=none; b=wWN2lk2jh2v+ZxQsozeeNmbcIE7smEmrJmpSLWiuQ50IgRxRpvhvPhODn9XYi7wrPZPSDF rqIrXthKkHkhWk6wZyZHxiNARdCMKNTYV2SNSyoWc1wfIkQmcwt751pAz59Q4ObegQByZA olyE1mTe/6Fi2QyMQ+gJs2GD3J1ElXp21mR+h5DghtxIxH3k7zBKWxOH3XJ2LLsPxSHLWu ibxYCWCVHSoTtda8O+vIyfYpzbu0E9iGVzUNR+avyHd7JaMaYMvSK5u4p2JYOUENVjC4hR 0KHABVpWcVSfNrHS4Pk7iJZpO9E7KYo7GqqivI6ztts+Qfi8uqp2yx9rL0mUcw== 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=1721609740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKmNzECsxqmrEPedlPS/hPQjJPu82D1WdZ1/F3sYrxU=; b=YTk/nmP8UFtB0b7W0fnbxtJ6WYMakQIDDYb367pt69BlReUSqpQ+tMhaAJiLzOyvnh3PqA +g9NbgrmZofLYjmFBJrVIvbwolLNPxYiaEFxxi6ZcMv3Ub0Kc8RJKlol3vaw7JFtJn0RF6 A99xSWOajZGBBR70KikHQWXLIUD4P04h9k21Zf5sCuOOoblsKe9qhYfzVhtFzDy7FKD+3l xrCeMBb68DTLpG5seB7TzqOqfscW/SFZeqGfI+kEx4yCMBfVC+nKMlGXFBH706SZriQoxp 0c8fx1XUciuebBDgxxPdl1emuQSgsbO/QIxNsEwN/nZZa14xC1Uvl3agBB7kYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zc4CjqzN8g; Mon, 22 Jul 2024 00:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0teWa007419; Mon, 22 Jul 2024 00:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0te0x007416; Mon, 22 Jul 2024 00:55:40 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:40 GMT Message-Id: <202407220055.46M0te0x007416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 73ee1909bfcf - stable/14 - netlink: Wrap long lines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 73ee1909bfcf7432ef48ef0411c3d0036520417d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=73ee1909bfcf7432ef48ef0411c3d0036520417d commit 73ee1909bfcf7432ef48ef0411c3d0036520417d Author: Mark Johnston AuthorDate: 2024-07-14 16:20:18 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 netlink: Wrap long lines No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit e536b197c0cf5c245e0b65f1b73447d53f3656f2) --- sys/netlink/netlink_debug.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/netlink/netlink_debug.h b/sys/netlink/netlink_debug.h index 0d8423d4933a..db987b26b6d7 100644 --- a/sys/netlink/netlink_debug.h +++ b/sys/netlink/netlink_debug.h @@ -46,12 +46,16 @@ SYSCTL_DECL(_net_netlink_debug); * Logging for events specific for particular process * Example: [nl_domain] PID 4834 fdump_sa: unsupported family: 45 */ -#define NL_RAW_PID_LOG(_l, _pid, _fmt, ...) NL_RAW_PID_LOG_##_l(_l, _pid, _fmt, ## __VA_ARGS__) -#define _NL_RAW_PID_LOG(_l, _pid, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ - _output("[" DEBUG_PREFIX_NAME "] PID %u %s: " _fmt "\n", _pid, __func__, ##__VA_ARGS__); \ -} +#define NL_RAW_PID_LOG(_l, _pid, _fmt, ...) \ + NL_RAW_PID_LOG_##_l(_l, _pid, _fmt, ## __VA_ARGS__) +#define _NL_RAW_PID_LOG(_l, _pid, _fmt, ...) \ + if (_DEBUG_PASS_MSG(_l)) { \ + _output("[" DEBUG_PREFIX_NAME "] PID %u %s: " _fmt "\n", _pid, \ + __func__, ##__VA_ARGS__); \ + } -#define NLP_LOG(_l, _nlp, _fmt, ...) NL_RAW_PID_LOG_##_l(_l, nlp_get_pid(_nlp), _fmt, ## __VA_ARGS__) +#define NLP_LOG(_l, _nlp, _fmt, ...) \ + NL_RAW_PID_LOG_##_l(_l, nlp_get_pid(_nlp), _fmt, ## __VA_ARGS__) #if DEBUG_MAX_LEVEL>=LOG_DEBUG3 #define NL_RAW_PID_LOG_LOG_DEBUG3 _NL_RAW_PID_LOG @@ -77,7 +81,5 @@ SYSCTL_DECL(_net_netlink_debug); #define NL_RAW_PID_LOG_LOG_ERR _NL_RAW_PID_LOG #define NL_RAW_PID_LOG_LOG_WARNING _NL_RAW_PID_LOG - - -#endif -#endif +#endif /* _KERNEL */ +#endif /* !_NETLINK_NETLINK_DEBUG_H_ */ From nobody Mon Jul 22 00:55:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zj0bdBz5QwJ8; Mon, 22 Jul 2024 00:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zd5zw7z4hpk; Mon, 22 Jul 2024 00:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtXC8eTvpUr2HmaEk+1U52Ip6FQWSiJUGHsutD966G8=; b=W24xRwtYoE2rF67yWRa0PppI5b8ptd6EWBYbb6Eauuu1XXV9s8LWAntVdPQIF/c211wFV9 YR4dI2+MXyOZOXAm+8DCzhOGxGwR1Ic0f4ElQCVBHdkUWfEUxpjHFgM1SGsXKNfC27RQcU lrGJaXhCYUhq1v301h4j1innXwPLk+k9pYy0or8f4jh1LqOfZk2T1wM4q++iIW8es4Gvot TD5U1vlwdUk9e9LYzwh3HsveacdKnjEB+J8nlb4NPmrpnAnHnyvwOVsojI+eJkml1ZZwKF yd5C7PfbVcQrh3X3fBaqpA8w+Mg8ZR6tZvwp8O/B+Y6W9WKkjYX+AOQuYtRONA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609741; a=rsa-sha256; cv=none; b=fhhbQbwHpZFIM2XHAVlPKmsgM7RlwfesiuhB7b/x70JFD8KI9JWbYGnpEdX5jqRK1GgDWG Sz1C9Qa7NWkQyCcF9qf9Nw4UP+9VJhJCPLdclY2q0PQlwKpKQyu6qf2iWr3JTAnrq3kX6c PlCAyZwLPJnq/xcsLy9aGGjb/zUsGY61nrPd/0XT56jTmWaE1wDE38dkaxzWEtgcSDEuoD KoW6tEVtTKCvl0MffFPQbSaOq72E07tL+5CFailtv+yQtrHASKfC8JjA/2TviRGAGCcso6 WznqsUjUYAGa2tk8l1Cj/JeOqwnwYgMgiI5kzrrsQAF0Pnhu1+3fVwEt08eYrg== 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=1721609741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtXC8eTvpUr2HmaEk+1U52Ip6FQWSiJUGHsutD966G8=; b=p1ss+F4G3p6bQtt28vo9xmB/5oKUGxQlvo8DYykJ7W3AW8uBfJETKAye2m1yI2aJaIlRRu 6FLu936uRvMwtZy+3CsOsEJMOVbOGFUCncBvfV3KutBYsVpEwl/mFwTCf8heOxYgvyS6B7 ptvEE2VI2bGQ48AgON7tLZryJZHG+J6yC433j9D0eyijVgE8IlhVNbbVDCOuFmJ4G4FF8L RhKaxy08dK8F8LapANtFjCiwGwwkXQ1Y4D+5+b8vRexGYJdr+TiivDohuj64Hz0AqJGDUl CrTMx1VnzHrPE2KIj0I+S12/oXUBmTUvQQCFUP1ceh18msT7Y8oXMT4KFjGbHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zd5DMJzNQW; Mon, 22 Jul 2024 00:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tfAL007467; Mon, 22 Jul 2024 00:55:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tfeo007464; Mon, 22 Jul 2024 00:55:41 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:41 GMT Message-Id: <202407220055.46M0tfeo007464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f48bfa248f39 - stable/14 - axgbe: Remove a nonsensical use of kernel_sysctlbyname() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f48bfa248f3991f4a6d9b99b4dcc5099886855b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f48bfa248f3991f4a6d9b99b4dcc5099886855b4 commit f48bfa248f3991f4a6d9b99b4dcc5099886855b4 Author: Mark Johnston AuthorDate: 2024-07-14 16:15:23 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:28 +0000 axgbe: Remove a nonsensical use of kernel_sysctlbyname() No functional change intended. MFC after: 1 week (cherry picked from commit d254651de392538fa7f5c0020093dde0ca06c614) --- sys/dev/axgbe/if_axgbe_pci.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 7f661e6d9c98..7a7c8539405c 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -589,8 +590,6 @@ axgbe_set_counts(if_ctx_t ctx) struct axgbe_if_softc *sc = iflib_get_softc(ctx); struct xgbe_prv_data *pdata = &sc->pdata; cpuset_t lcpus; - int cpu_count, err; - size_t len; /* Set all function pointers */ xgbe_init_all_fptrs(pdata); @@ -617,21 +616,12 @@ axgbe_set_counts(if_ctx_t ctx) * number of Rx queues or maximum allowed */ - /* Get cpu count from sysctl */ - len = sizeof(cpu_count); - err = kernel_sysctlbyname(curthread, "hw.ncpu", &cpu_count, &len, NULL, - 0, NULL, 0); - if (err) { - axgbe_error("Unable to fetch number of cpus\n"); - cpu_count = 1; - } - if (bus_get_cpus(pdata->dev, INTR_CPUS, sizeof(lcpus), &lcpus) != 0) { axgbe_error("Unable to fetch CPU list\n"); /* TODO - handle CPU_COPY(&all_cpus, &lcpus); */ } - DBGPR("ncpu %d intrcpu %d\n", cpu_count, CPU_COUNT(&lcpus)); + DBGPR("ncpu %d intrcpu %d\n", mp_ncpus, CPU_COUNT(&lcpus)); pdata->tx_ring_count = min(CPU_COUNT(&lcpus), pdata->hw_feat.tx_ch_cnt); pdata->tx_ring_count = min(pdata->tx_ring_count, From nobody Mon Jul 22 01:39:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS2y36kbfz5R14x; Mon, 22 Jul 2024 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS2y367ksz4nJJ; Mon, 22 Jul 2024 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721612363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=usNLBVnzzkwrp6LjcPhyzC/Ty4DmIs2CeO58HcFhK4k=; b=jgV4rNYjsw9iHG5NjEnVGxSkfbWfbKXPlOqXszq+VUe7xz/9u8klfFYIcljd05QKauMGxM aQGiz9VDIYP+Ug/EmyQaYRJgR00nnpnduoevn4CnPpGLIPz3vLsRtZduFShBnduJYMKszm FN9JRxRCGEY5o+qCVMHqHfvq8kUstdggFFkNTi0T1r/EV5mYSbu2dzELOTZRh+5lbtb3ty NgkOx6vW3i+hibsYHD/5sO0nQOekoKMz2UbGxTaaBGtgGDPsqWpcTr4oQWWKsU/+WLCLlr Jro5lRi208eLgLrmd2QrYdyv1OBlt+ypOPwm02CrTR/zVwMUDorwKbYtI8eh+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721612363; a=rsa-sha256; cv=none; b=xtmCv9sKNwwIf2ELLLUC+ZRl5efOnwEbN5GtVV54hRHn03hPiFJwPYAlWM6ayfbadHyhCW hjywsqdqZIkgTWqqaGeylGVABhoWz9jzzVDrlENBqsAsRCV+gRIvRTx77yKX2Ho5p7GSuE WRyHIwGvvUtSEcwKdJ/I66+hEYQmBARV0YzgiUy6H+i1gzKwIcnly3JeKLvR3b86cLvnXy NKWY2yRHjPvNr3OEqA/DAqTbIc0RxreG6f0jG6CIEHY6VoKsGajREwpWehgtiZYTMwsh29 qxXLdIHreoNd7B7MTq/lSG42wDrrqgOaH0sbctdsr88Yp96nqEVKQ/SEdvEk7Q== 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=1721612363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=usNLBVnzzkwrp6LjcPhyzC/Ty4DmIs2CeO58HcFhK4k=; b=EjuOOPraiz/3XcWmPXhKw5zJLNzxGN9OfeNjT1L2ZAleBaw0VUEe1NEP6XaWe1MlX90UQ9 MNmP1qhnAaG6uv5PUO6yzNZLD+XGL7SCpdgZnlfPUYAFq+oKvQHc60p3OoDiMB6VRgZDWF CEDrhd4aHnfCOpXuPADUjiVz15HOLlPt9fDJJcMqjwt8SQqG35ExvaHrce17Khsa1NXOxi 38o0uQHAv/XkSrvHclvnhOebnj+PFT6OMD0mkSYSfvj7i0WH0nu3iU1BC1AZUZ7ocyJ1Kp hFDr3tLUmxITwygLq9w5fhD4rwVqYECzzzp2pizrtPqKaqudxeG8SJKMiTIGyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS2y35g6rzP2X; Mon, 22 Jul 2024 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M1dNoP075773; Mon, 22 Jul 2024 01:39:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M1dNas075770; Mon, 22 Jul 2024 01:39:23 GMT (envelope-from git) Date: Mon, 22 Jul 2024 01:39:23 GMT Message-Id: <202407220139.46M1dNas075770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: c664b786ccd1 - stable/13 - nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c664b786ccd18bd186c59279e26fd19c6a212be4 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c664b786ccd18bd186c59279e26fd19c6a212be4 commit c664b786ccd18bd186c59279e26fd19c6a212be4 Author: Rick Macklem AuthorDate: 2024-06-21 22:08:48 +0000 Commit: Rick Macklem CommitDate: 2024-07-21 23:30:11 +0000 nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex On Feb. 28, a problem was reported on freebsd-stable@ where a nfsd thread processing an ExchangeID operation was blocked for a long time by another nfsd thread performing a copy_file_range. This occurred because the copy_file_range was taking a long time, but also because handling a clientID requires that all other nfsd threads be blocked via an exclusive lock, as required by ExchangeID. This patch adds two arguments to nfsv4_cleanclient() so that it can optionally be called with a mutex held. For this patch, the first of these arguments is "false" and, as such, there is no change in semantics. However, this change will allow a future commit to modify handling of the clientID so that it can be done with a mutex held while other nfsd threads continue to process NFS RPCs. (cherry picked from commit a7de51068502ad1e2851d4a855ed28b27573bb36) --- sys/fs/nfs/nfsrvstate.h | 2 +- sys/fs/nfsserver/nfs_nfsdsocket.c | 2 +- sys/fs/nfsserver/nfs_nfsdstate.c | 53 +++++++++++++++++++++++---------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 3652e2c2db2f..c196f43aac04 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -331,7 +331,7 @@ struct nfsf_rec { u_int32_t numboots; /* Number of boottimes */ }; -void nfsrv_cleanclient(struct nfsclient *, NFSPROC_T *); +void nfsrv_cleanclient(struct nfsclient *, NFSPROC_T *, bool, SVCXPRT **); void nfsrv_freedeleglist(struct nfsstatehead *); /* diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index da92b7b0047c..94369c575e52 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -792,7 +792,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, !LIST_EMPTY(&clp->lc_deleg)) nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 06d0b79f10d5..911f5053bd3c 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -203,7 +203,8 @@ static void nfsrv_locallock_commit(struct nfslockfile *lfp, int flags, static void nfsrv_locklf(struct nfslockfile *lfp); static void nfsrv_unlocklf(struct nfslockfile *lfp); static struct nfsdsession *nfsrv_findsession(uint8_t *sessionid); -static int nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid); +static int nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid, + bool locked, SVCXPRT **old_xprtp); static int nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, int dont_replycache, struct nfsdsession **sepp, int *slotposp); static int nfsv4_getcbsession(struct nfsclient *clp, struct nfsdsession **sepp); @@ -329,7 +330,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (i != nfsrv_clienthashsize) { LIST_REMOVE(clp, lc_hash); - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); zapit = 1; @@ -382,7 +383,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (clp->lc_expiry < NFSD_MONOSEC && (!LIST_EMPTY(&clp->lc_open) || !LIST_EMPTY(&clp->lc_deleg))) { - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); } @@ -445,7 +446,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, /* Get rid of all sessions on this clientid. */ LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { - ret = nfsrv_freesession(sep, NULL); + ret = nfsrv_freesession(sep, NULL, false, NULL); if (ret != 0) printf("nfsrv_setclient: verifier changed free" " session failed=%d\n", ret); @@ -715,7 +716,7 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * for an Open with CLAIM_DELEGATE_PREV unless in * grace, but get rid of the rest of the state. */ - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_olddeleg); if (nfsrv_checkgrace(nd, clp, 0)) { /* In grace, so just delete delegations */ @@ -874,7 +875,7 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) } /* Destroy the clientid and return ok. */ - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); @@ -943,7 +944,7 @@ nfsrv_adminrevoke(struct nfsd_clid *revokep, NFSPROC_T *p) */ clp->lc_flags &= ~LCL_CALLBACKSON; clp->lc_flags |= LCL_ADMINREVOKED; - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); NFSLOCKV4ROOTMUTEX(); @@ -1363,7 +1364,8 @@ nfsrv_servertimer(void *arg __unused) * there are no other active nfsd threads. */ void -nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p) +nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p, bool locked, + SVCXPRT **old_xprtp) { struct nfsstate *stp, *nstp; struct nfsdsession *sep, *nsep; @@ -1372,7 +1374,7 @@ nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p) nfsrv_freeopenowner(stp, 1, p); if ((clp->lc_flags & LCL_ADMINREVOKED) == 0) LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) - (void)nfsrv_freesession(sep, NULL); + (void)nfsrv_freesession(sep, NULL, locked, old_xprtp); } /* @@ -4603,7 +4605,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, if (procnum != NFSV4PROC_CBNULL) nfsv4_freeslot(&sep->sess_cbsess, slotpos, true); - nfsrv_freesession(sep, NULL); + nfsrv_freesession(sep, NULL, false, NULL); } else if (nd->nd_procnum == NFSV4PROC_CBNULL) error = newnfs_connect(NULL, &clp->lc_req, cred, NULL, 1, dotls, &clp->lc_req.nr_client); @@ -4652,7 +4654,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, nfsv4_freeslot(&sep->sess_cbsess, slotpos, true); } - nfsrv_freesession(sep, NULL); + nfsrv_freesession(sep, NULL, false, NULL); } else error = newnfs_request(nd, NULL, clp, &clp->lc_req, NULL, NULL, cred, clp->lc_program, @@ -5250,7 +5252,7 @@ nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); nfsrv_backupstable(); - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); @@ -5442,7 +5444,7 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); nfsrv_backupstable(); if (clp->lc_expiry < NFSD_MONOSEC) { - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); @@ -6243,7 +6245,7 @@ nfsrv_throwawayallstate(NFSPROC_T *p) for (i = 0; i < nfsrv_clienthashsize; i++) { LIST_FOREACH_SAFE(clp, &NFSD_VNET(nfsclienthash)[i], lc_hash, nclp) { - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); free(clp->lc_stateid, M_NFSDCLIENT); @@ -6456,7 +6458,7 @@ nfsrv_destroysession(struct nfsrv_descript *nd, uint8_t *sessionid) } while (igotlock == 0); NFSUNLOCKV4ROOTMUTEX(); - error = nfsrv_freesession(NULL, sessionid); + error = nfsrv_freesession(NULL, sessionid, false, NULL); if (error == 0 && samesess != 0) nd->nd_flag &= ~ND_HASSEQUENCE; @@ -6547,12 +6549,14 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) * Free up a session structure. */ static int -nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid) +nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid, + bool locked, SVCXPRT **old_xprtp) { struct nfssessionhash *shp; int i; - NFSLOCKSTATE(); + if (!locked) + NFSLOCKSTATE(); if (sep == NULL) { shp = NFSSESSIONHASH(sessionid); NFSLOCKSESSION(shp); @@ -6565,21 +6569,28 @@ nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid) sep->sess_refcnt--; if (sep->sess_refcnt > 0) { NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!locked) + NFSUNLOCKSTATE(); return (NFSERR_BACKCHANBUSY); } LIST_REMOVE(sep, sess_hash); LIST_REMOVE(sep, sess_list); } NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!locked) + NFSUNLOCKSTATE(); if (sep == NULL) return (NFSERR_BADSESSION); for (i = 0; i < NFSV4_SLOTS; i++) if (sep->sess_slots[i].nfssl_reply != NULL) m_freem(sep->sess_slots[i].nfssl_reply); - if (sep->sess_cbsess.nfsess_xprt != NULL) - SVC_RELEASE(sep->sess_cbsess.nfsess_xprt); + if (!locked) { + if (sep->sess_cbsess.nfsess_xprt != NULL) + SVC_RELEASE(sep->sess_cbsess.nfsess_xprt); + if (old_xprtp != NULL) + *old_xprtp = NULL; + } else if (old_xprtp != NULL) + *old_xprtp = sep->sess_cbsess.nfsess_xprt; free(sep, M_NFSDSESSION); return (0); } From nobody Mon Jul 22 02:36:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4D84yl0z5R6GV; Mon, 22 Jul 2024 02:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4D84NrRz4rwX; Mon, 22 Jul 2024 02:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHnBb7krYdkLyMpkjstpBdYa0/or+JGHhPaj3QhgjzA=; b=cFhaiE8a+MvuIHDZVWZPG4SbfUjMCzD3OmgA6w62OqkOpj5agxC+CK5oaCgXAj3KanOt7J 1zgHcaZq3Hrm2GDXAWCsdLQUHSj2e4YJGbVy8x8zB9Q76eEydfeFPL+shDtqg635GjF2bf hKG8dQU7t99QF4t0rmV6kxdGItzWv0kdSPN/ZsDMmyK6lKU3ABX3vjR9UWMAnynVzp/hcJ hf/bHa8q+Dwnb5r1RIW27JPF/sJ7wiyybw4WMKfL9dGcyg8uyAC3EpkpcEq9O0TQMTbJOJ /2yRUiuDinL9OvggacMTmtz1CIRhix9DJEGn2ZcsqXH3W3KMcRbt7MyQoXelYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615800; a=rsa-sha256; cv=none; b=fVY4J4NVuI7R6pNQAre6lu9aQYDmuaOJxDk0lJVUB3jHyHN3fAuIUT/Owg9Plm8RRPTAk6 fn4d7ROscLgm0NdrmmOiVgibKQT/cUNt5EAOxuflVGr7g1oX2X5fxZpDWF/gGIfwS70Bni M0WOXSThGOf4HixpZka6mygjgWV/doEQnXNzLyotzczoW0fQWo7lUowD61Jws/5pND7CMU Obq88lEFg3t4HdSniOcrDvGV33RzDMZIFRiWyHxR29A4rphqZ4wZGnadxj9SrHyGYBgPWq AXUIc2+CrXHwrnsq30Sjt6w/shIM1YsJ4O89Vrl2EXx2+MA3p84L+LGqpecfOA== 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=1721615800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHnBb7krYdkLyMpkjstpBdYa0/or+JGHhPaj3QhgjzA=; b=tvpCSjSQZKrPLkzrG06zZrApRrMKvfJO5hgSS9+XgiXnvbZkNDe/dvgGgIg1fXFk/2oyWf SxgMTbCAyVStcFwoqodnHX5kRr5tRAYFtEb6TzwldupaM3MmnulYdwIMExXnUsFGeBPn7y RF70z23Oeoc+sn77jz6fy3rjcYV71n+bwfSmBnw26bq/lCltDsafvz28cAhvFIflaR/kgN TTqPl58xTPvOYDhKdEYBcb+kCp1P2tW0tm9T/P35FxxU2TbfPz9BXf6n/612SlSYSKFsGb rSSd/SinSwliDqDXaljMprdQkFz+GQI95LQkds+1x9M2AB5aZ9IfjNf9aciwYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4D840D3zRFy; Mon, 22 Jul 2024 02:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2aeCB076829; Mon, 22 Jul 2024 02:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2aewL076826; Mon, 22 Jul 2024 02:36:40 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:36:40 GMT Message-Id: <202407220236.46M2aewL076826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 13f9c4addb6e - stable/14 - rc.conf: Leap-seconds sources: Add IANA back List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 13f9c4addb6ed36221d89e61194ea9fe5f8f3aaf Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=13f9c4addb6ed36221d89e61194ea9fe5f8f3aaf commit 13f9c4addb6ed36221d89e61194ea9fe5f8f3aaf Author: Cy Schubert AuthorDate: 2024-07-19 18:04:43 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:36:30 +0000 rc.conf: Leap-seconds sources: Add IANA back 11da791920ba switched Leap-seconds source from IANA to IERS, as IERS is the canonoical source. The problem ist that IERS is not accessible from IPv6 only networks. To work around this we must add IANA back in order to provide IPv6-only users a source for leap-seconds fetch. PR: 279413 Fixes: 11da791920ba (cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index a7b149bb0cd4..5073718e91f4 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -424,7 +424,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Canonical place to get the leap seconds from -ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list" +ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Mon Jul 22 02:36:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4D95sQqz5R68F; Mon, 22 Jul 2024 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4D95S16z4rr1; Mon, 22 Jul 2024 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDrqy4fuE1TmuPhQ1R4i6Glm5oSkDDs7YH/GzmqO8rs=; b=De2nKdxgWWaiFMkzIADQW6X+k95y3TrCaBfUsB7tWcJRANXLYZF9OxBxFo2q9cp4HMoWUS zZTmyiQjWB1bVOEjrdXYF2D7ibAy0NoM5JP4XgDyfTDYvpndVwDJYb5K6iE8HBvrIxqonE EcjK6DJd9dpT3Qz7FePfI2VRNlE89DMw4scNUSldLXkVc0H6fXiCGnmS6jRzhfaOImvMqM zej4z3qO7Mmb2PW8B0eai/0uosvXswccJ0GYFouA2NSNAQCRh6e1EypMed5Q4YhU787q6K dCgF+DfFTwXUVWclnQlb936N/01h5jbmWWaEJsORrHnTmI94QzWTeEFVB8yUHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615801; a=rsa-sha256; cv=none; b=pjYAXtaImakqQ9Uhja1u6PXBv+/O6zuIBSZ0deZgUI6XNXdSeJzCTObSxl7bVbjEl6HPmi MMXO8bcISx+xFqRGiu+gQrme95kuKKc/yd+pN/2lV9HqhM0uKdZflMQKmtaKWxfpAsTM+0 /vOzemokSgiBxUHvcLRieR2cHX0D903xkGx0T1AI4AFK69NI0m1Vf/6V3LBP0EGJLE4ktR rudLBKpn9NcNQc0grO7kgfkbSvK9mOWHoGbwSG9UWvoInFoGnsWYWge4678mGqEmi+A1Xk PKxJQndz7dxkw76M4gWWDvt6SbM+LzhpA/j1ZzFVruzg425ZVhDKne+CwfyqFw== 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=1721615801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDrqy4fuE1TmuPhQ1R4i6Glm5oSkDDs7YH/GzmqO8rs=; b=TYdfxMzZ8vhTn+k0eP+9xmW5d1X+nfotPctX6hlPmP7e0g/c0ClMTYwfzLEil0WTnhgXKq rinvOe+zLHzGIEdt9wUNtwlp4wqFjQDHf8B8vcTgSwZxED+3fTqXPRHGd59ye/2JeFGrpH eGjJiCcElrxX3N+rPDcEzZ2KcBtFfTWWikRUVjiXihlcnBuUem3aAmkpAylBgRh4HhokOt JCFGewjHFqIiFqYhXcmL8G7FyhvAofsen7XLYHeHHnwNvf0PjngrgTyL1/H24aZiHf/zog pdlnwpsB4OhhT28IOmBfsL+PEmxOJX+v25C9b33T2eXpVO/nylZo5XzSDYKIoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4D952LbzQf0; Mon, 22 Jul 2024 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2afFE076880; Mon, 22 Jul 2024 02:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2afeG076877; Mon, 22 Jul 2024 02:36:41 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:36:41 GMT Message-Id: <202407220236.46M2afeG076877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 12f2e9525bd8 - stable/14 - leap-seconds: Update to leap-seconds 3960057600 obtained from IERS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 12f2e9525bd8be328febbc5839f763e4a271c05d Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=12f2e9525bd8be328febbc5839f763e4a271c05d commit 12f2e9525bd8be328febbc5839f763e4a271c05d Author: Cy Schubert AuthorDate: 2024-07-21 01:41:09 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:36:30 +0000 leap-seconds: Update to leap-seconds 3960057600 obtained from IERS IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain their leap-second updates from IERS. This resolves an issue for IPv6-only hosts as IERS is not accessible via IPv6, requiring IPv6-only host to rely on some other source, above. From this point forward we should fetch the file from IERS, the organization responsible for deciding when to insert leap-seconds. PR: 279413 Obtained from: https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list Discussed with: imp (cherry picked from commit 04b4dcf04fc345b29b78e5061768091648b8ee2a) --- usr.sbin/ntp/ntpd/leap-seconds | 373 +++++++++++++---------------------------- 1 file changed, 119 insertions(+), 254 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index c5a95aa51799..da0efc8c8566 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -1,255 +1,120 @@ +# ATOMIC TIME +# Coordinated Universal Time (UTC) is the reference time scale derived +# from The "Temps Atomique International" (TAI) calculated by the Bureau +# International des Poids et Mesures (BIPM) using a worldwide network of atomic +# clocks. UTC differs from TAI by an integer number of seconds; it is the basis +# of all activities in the world. # -# In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until -# the end of the line. A plain comment line has a -# whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace -# character in column 2. -# -# A blank line should be ignored. -# -# The following table shows the corrections that must -# be applied to compute International Atomic Time (TAI) -# from the Coordinated Universal Time (UTC) values that -# are transmitted by almost all time services. -# -# The first column shows an epoch as a number of seconds -# since 1 January 1900, 00:00:00 (1900.0 is also used to -# indicate the same epoch.) Both of these time stamp formats -# ignore the complexities of the time scales that were -# used before the current definition of UTC at the start -# of 1972. (See note 3 below.) -# The second column shows the number of seconds that -# must be added to UTC to compute TAI for any timestamp -# at or after that epoch. The value on each line is -# valid from the indicated initial instant until the -# epoch given on the next one or indefinitely into the -# future if there is no next line. -# (The comment on each line shows the representation of -# the corresponding initial epoch in the usual -# day-month-year format. The epoch always begins at -# 00:00:00 UTC on the indicated day. See Note 5 below.) -# -# Important notes: -# -# 1. Coordinated Universal Time (UTC) is often referred to -# as Greenwich Mean Time (GMT). The GMT time scale is no -# longer used, and the use of GMT to designate UTC is -# discouraged. -# -# 2. The UTC time scale is realized by many national -# laboratories and timing centers. Each laboratory -# identifies its realization with its name: Thus -# UTC(NIST), UTC(USNO), etc. The differences among -# these different realizations are typically on the -# order of a few nanoseconds (i.e., 0.000 000 00x s) -# and can be ignored for many purposes. These differences -# are tabulated in Circular T, which is published monthly -# by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.org for more information. -# -# 3. The current definition of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before that epoch, and it can be -# quite difficult to compute precise timestamps and time -# intervals in those "prehistoric" days. For more information, -# consult: -# -# The Explanatory Supplement to the Astronomical -# Ephemeris. -# or -# Terry Quinn, "The BIPM and the Accurate Measurement -# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. -# reprinted in: -# Christine Hackman and Donald B Sullivan (eds.) -# Time and Frequency Measurement -# American Association of Physics Teachers (1996) -# , pp. 75-86 -# -# 4. The decision to insert a leap second into UTC is currently -# the responsibility of the International Earth Rotation and -# Reference Systems Service. (The name was changed from the -# International Earth Rotation Service, but the acronym IERS -# is still used.) -# -# Leap seconds are announced by the IERS in its Bulletin C. -# -# See www.iers.org for more details. -# -# Every national laboratory and timing center uses the -# data from the BIPM and the IERS to construct UTC(lab), -# their local realization of UTC. -# -# Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the -# foreseeable future. -# -# 5. If your system keeps time as the number of seconds since -# some epoch (e.g., NTP timestamps), then the algorithm for -# assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI -# timestamp would be obtained by advancing to the next entry in the -# following table when the time equivalent to 23:59:59 UTC -# is used for the second time. Thus the leap second which -# occurred on 30 June 1972 at 23:59:59 UTC would have TAI -# timestamps computed as follows: -# -# ... -# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds -# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds -# ... -# -# If your system realizes the leap second by repeating 00:00:00 UTC twice -# (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivalent to -# 00:00:00 UTC is used. Thus, using the same example as above: -# -# ... -# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds -# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds -# ... -# -# in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. However, -# although the long-term behavior of the time scale is correct in both -# methods, the second method is technically not correct because it adds -# the extra second to the wrong day. -# -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch -# during the leap second does not arise. -# -# Some systems implement leap seconds by amortizing the leap second -# over the last few minutes of the day. The frequency of the local -# clock is decreased (or increased) to realize the positive (or -# negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# definition of UTC. -# -# Questions or comments to: -# Judah Levine -# Time and Frequency Division -# NIST -# Boulder, Colorado -# Judah.Levine@nist.gov -# -# Last Update of leap second values: 8 July 2016 -# -# The following line shows this last update date in NTP timestamp -# format. This is the date on which the most recent change to -# the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two -# columns as shown below. -# -#$ 3676924800 -# -# The NTP timestamps are in units of seconds since the NTP epoch, -# which is 1 January 1900, 00:00:00. The Modified Julian Day number -# corresponding to the NTP time stamp, X, can be computed as -# -# X/86400 + 15020 -# -# where the first term converts seconds to days and the second -# term adds the MJD corresponding to the time origin defined above. -# The integer portion of the result is the integer MJD for that -# day, and any remainder is the time of day, expressed as the -# fraction of the day since 0 hours UTC. The conversion from day -# fraction to seconds or to hours, minutes, and seconds may involve -# rounding or truncation, depending on the method used in the -# computation. -# -# The data in this file will be updated periodically as new leap -# seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic -# file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to -# the most recent version of the file. -# -# This update procedure will be performed only when a new leap second -# is announced. -# -# The following entry specifies the expiration date of the data -# in this file in units of seconds since the origin at the instant -# 1 January 1900, 00:00:00. This expiration date will be changed -# at least twice per year whether or not a new leap second is -# announced. These semi-annual changes will be made no later -# than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, -# respectively. (These are the customary effective dates for new -# leap seconds.) This expiration date will be identified by a -# unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an -# effective date other than 30 June or 31 December, then this -# file will be edited to include that leap second as soon as it is -# announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will -# be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file -# will not change. -# -# Updated through IERS Bulletin C67 -# File expires on: 28 December 2024 -# -#@ 3944332800 -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -3692217600 37 # 1 Jan 2017 -# -# the following special comment contains the -# hash value of the data in this file computed -# use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/pub/sha for -# the details of how this hash value is -# computed. Note that the hash computation -# ignores comments and whitespace characters -# in data lines. It includes the NTP values -# of both the last modification time and the -# expiration time of the file, but not the -# white space on those lines. -# the hash line is also ignored in the -# computation. -# -#h 199a9d45 3f630d2f e47cb9cc c2f0fa47 96932227 +# +# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. +# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various +# irregular fluctuations progressively detected in the rotation rate of the Earth led +# in 1972 to the replacement of UT1 by UTC as the reference time scale. +# +# +# LEAP SECOND +# Atomic clocks are more stable than the rate of the earth's rotation since the latter +# undergoes a full range of geophysical perturbations at various time scales: lunisolar +# and core-mantle torques, atmospheric and oceanic effects, etc. +# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller +# than 0.9 seconds. Therefore, when necessary a "leap second" is applied to UTC. +# Since the adoption of this system in 1972 it has been necessary to add a number of seconds to UTC, +# firstly due to the initial choice of the value of the second (1/86400 mean solar day of +# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is +# theoretically possible to have a negative leap second (a second removed from UTC), but so far, +# all leap seconds have been positive (a second has been added to UTC). Based on what we know about +# the earth's rotation, it is unlikely that we will ever have a negative leap second. +# +# +# HISTORY +# The first leap second was added on June 30, 1972. Until the year 2000, it was necessary in average to add a +# leap second at a rate of 1 to 2 years. Since the year 2000 leap seconds are introduced with an +# average interval of 3 to 4 years due to the acceleration of the Earth's rotation speed. +# +# +# RESPONSIBILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC +# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of +# the International Earth Rotation and reference System Service (IERS). This center is located at Paris +# Observatory. According to international agreements, leap seconds should be scheduled only for certain dates: +# first preference is given to the end of December and June, and second preference at the end of March +# and September. Since the introduction of leap seconds in 1972, only dates in June and December were used. +# +# Questions or comments to: +# Christian Bizouard: christian.bizouard@obspm.fr +# Earth orientation Center of the IERS +# Paris Observatory, France +# +# +# +# COPYRIGHT STATUS OF THIS FILE +# This file is in the public domain. +# +# +# VALIDITY OF THE FILE +# It is important to express the validity of the file. These next two dates are +# given in units of seconds since 1900.0. +# +# 1) Last update of the file. +# +# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) +# +# The following line shows the last update of this file in NTP timestamp: +# +#$ 3929093563 +# +# 2) Expiration date of the file given on a semi-annual basis: last June or last December +# +# File expires on 28 June 2025 +# +# Expire date in NTP timestamp: +# +#@ 3960057600 +# +# +# LIST OF LEAP SECONDS +# NTP timestamp (X parameter) is the number of seconds since 1900.0 +# +# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 +# +# DTAI: The difference DTAI= TAI-UTC in units of seconds +# It is the quantity to add to UTC to get the time in TAI +# +# Day Month Year : epoch in clear +# +#NTP Time DTAI Day Month Year +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 +# +# A hash code has been generated to be able to verify the integrity +# of this file. For more information about using this hash code, +# please see the readme file in the 'source' directory : +# https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README +# +#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 From nobody Mon Jul 22 02:37:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4Dh2ncPz5R6DK; Mon, 22 Jul 2024 02:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4Dh1xtPz4sgx; Mon, 22 Jul 2024 02:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWJrC+0w2DP/FHOhFQnRDYDeGgCS//2ccVucu7FLCU8=; b=vrOd/XDD+c4tnGfoVHKnyXBYHWb8Ac7lWhtluKUWWtTCOflFFm4gTM/Xr0dzCylLhZPZHU BQcSYN9byzLztGSTwwODxrHgUlyZS5K9Pl27+62RNosG21zgt2Qg8RI9R0Ench4WEdZzNb vz4M2bbN1O23UGKQt3D8hBJsTGfa/thTENBMCRg9DCdQJ44KQ/UA7RncHy3hnT4ZyIZOTr XElArBkz2TvMvoHDReTXuj/PnlOTZVId4uY9u4mg96xMHJB/OjU3zkh4YfNODwjM6f/7EY 9VFy/F+dzvu4m7FXmXvfQX5f8qzDwZpSlLHj4lu+3i1V3wtIHHcOTbDMSKnISg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615828; a=rsa-sha256; cv=none; b=Qvq+JayfO24DGX6Mog3VulnlrRmpMyunibaAoH576sX2ydUZ+hVB3lzoMLLJOlgeepbQkJ ayrZzhmQAwsWoiOKP0dXKONBafJL81IGQ0CadcZnumZ72kgRMeDhv3sfx0RFEbGOcOoOex ZANP1czsRaynwBAttwwfVKZpOAoHyrbU2d0OFgAdONoxgZ676ZMS4A+Il/eT6uBxS9tXC0 vfrAth6y1Xn4dZPEQThHN4rhcSaYogKzpO6tYoKDYmeYyDyw68ypXIkuGbcVRjNwRNzg25 kyPdinTjh5i5RoI08xZwXJJ1Ci42bOCMPCQfQFuRngww91WH2HcBCBC7pBxkfA== 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=1721615828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWJrC+0w2DP/FHOhFQnRDYDeGgCS//2ccVucu7FLCU8=; b=DdkRBymp69ZJf2mvQc8tjHxB+3m9ayeuB2Xm2LE/PQyl2Q0Rt71LzCYOvVX40HM2XYDmoL J+eBMTQqtk7mnoxHHnoCjky5XlrjzjwU+Fucjjx8vMEtA/zcrjiyI3v4vqzpAgTX+N9NFz Kd6U7njgfTmGvzRMLRwbKiRRi7VuK10xVH2DW4VNRakCcdlz8EyfHXBB0ZpbVP4doOZ4xf uP/kMtebQhZ2dmSfNZZBKmidSXmCM5+BGkaQDRpD1O3vX5cUwObvpKn274y7gC3O4YIWTE jNH67poDnWU6UxRBxydAePdJbLvuozXBnEB1Heasj1dgNaO/8wZfTNlFs6ORQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4Dh1Wr6zQf1; Mon, 22 Jul 2024 02:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2b8PZ077081; Mon, 22 Jul 2024 02:37:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2b8Sp077078; Mon, 22 Jul 2024 02:37:08 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:37:08 GMT Message-Id: <202407220237.46M2b8Sp077078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 176f8488e167 - stable/13 - rc.conf: Leap-seconds sources: Add IANA back List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 176f8488e167ec3943108965c7c0e3e98fe167da Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=176f8488e167ec3943108965c7c0e3e98fe167da commit 176f8488e167ec3943108965c7c0e3e98fe167da Author: Cy Schubert AuthorDate: 2024-07-19 18:04:43 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:37:03 +0000 rc.conf: Leap-seconds sources: Add IANA back 11da791920ba switched Leap-seconds source from IANA to IERS, as IERS is the canonoical source. The problem ist that IERS is not accessible from IPv6 only networks. To work around this we must add IANA back in order to provide IPv6-only users a source for leap-seconds fetch. PR: 279413 Fixes: 11da791920ba (cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 16c44baaa68a..fab8ffb4fff9 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -421,7 +421,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Canonical place to get the leap seconds from -ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list" +ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Mon Jul 22 02:37:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4Dj2vXHz5R6B0; Mon, 22 Jul 2024 02:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4Dj2KDZz4scR; Mon, 22 Jul 2024 02:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gSJYpYgcMeXzR+D/hOD3r3w/CIQZpRQ42ml7Fd88FEk=; b=LMWGWyhYBdF7WKuWGVbJVzFlKqMZkKthxuyfLRW5b2bnNtI+izUIc2tNewzDd/ZsQwGtzb U86Xb2L1eJmauoN7UkOizPQZBk9TluuWhK9gwEroitNiETtpERHZOHQnWd1PreNfuEvQua 4Ez8ZC1esqWYBiXQAAvwOTmrReL7zHrX0XGHYgfCzZuFwfumXzaBHyqhD1SXe9ZD8udBTW enmTbzt3gesweE0odb5wryh+mAz2maeTM+Bi3v0NEoDqwW1sYCTrF0AV+3IYA5VOOr/q7x J2eivIHHY0D2FBqc013qOSph3a4YnkEmOQ9PHjC9qGNTHfRo4Vo5IEIWlb0uEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615829; a=rsa-sha256; cv=none; b=FweWHJYiYCnPusFW42eaon/ItZcl0zZ3dxR+NzEuqzvtAKKI4oXk74utIX4EcFg8doQ9ZE tv7Yexc7AfyvlOGZ0Ud8psS14GLddheu5BZUvqfau+e6i3pyNQfV1F6wAjSEr3dWgoSViL +FriZI4QWU98IMd1r0qOlFTVbFCAuInAtFCZ+URsVIJmfkyFXNUIIWzp92EyVsR1XR4E8X wPfbgMYJa7k/+KXzSuk3YQ3opteq9t1dt+TcTu/f/LJGqbDqLuqziNGRN9bTF4BnhXCu8c u3ZgwBOCwLMgMoqRpJkwVWG2vW5qClgVMm4hVgfHvf4bEdNUBsOj3Vvp0HfGSQ== 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=1721615829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gSJYpYgcMeXzR+D/hOD3r3w/CIQZpRQ42ml7Fd88FEk=; b=cme7j5gELTnkRLDPQrqdggxvw1sq123ZbnIrxAxTTxGKbfdpYVObZmmHFEYpo02/g0zT+j kSp5qBgufFY4SQVP48XvyjcJiNR79nqbGcYtA6yKbITr1fRkgF1rwOW45Ni+1U2ZRhOKin b16D3iwlXOtj9682aUB6iActJjsaCr+crJVJLbkiBxWeI3JYABY5+Lif77o1uZyGAZcucw fg82Vq5+2J5PilN5LZb/RYSpKWaBP8tCMHNu7QZRcY4EdiQ0RWypDAM0GnlnByb7C0l132 O4xmduSyl6AkG7+Yl+wgqPuFd/kfDfCQ1F6yDvPEiNT5DeKsL00KfkalW4TvtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4Dj1wqJzQwT; Mon, 22 Jul 2024 02:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2b9xw077136; Mon, 22 Jul 2024 02:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2b92A077133; Mon, 22 Jul 2024 02:37:09 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:37:09 GMT Message-Id: <202407220237.46M2b92A077133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fad8955b97cc - stable/13 - leap-seconds: Update to leap-seconds 3960057600 obtained from IERS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fad8955b97cc2d29c2d66b63c4346611715eff6e Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fad8955b97cc2d29c2d66b63c4346611715eff6e commit fad8955b97cc2d29c2d66b63c4346611715eff6e Author: Cy Schubert AuthorDate: 2024-07-21 01:41:09 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:37:03 +0000 leap-seconds: Update to leap-seconds 3960057600 obtained from IERS IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain their leap-second updates from IERS. This resolves an issue for IPv6-only hosts as IERS is not accessible via IPv6, requiring IPv6-only host to rely on some other source, above. From this point forward we should fetch the file from IERS, the organization responsible for deciding when to insert leap-seconds. PR: 279413 Obtained from: https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list Discussed with: imp (cherry picked from commit 04b4dcf04fc345b29b78e5061768091648b8ee2a) --- usr.sbin/ntp/ntpd/leap-seconds | 373 +++++++++++++---------------------------- 1 file changed, 119 insertions(+), 254 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index c5a95aa51799..da0efc8c8566 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -1,255 +1,120 @@ +# ATOMIC TIME +# Coordinated Universal Time (UTC) is the reference time scale derived +# from The "Temps Atomique International" (TAI) calculated by the Bureau +# International des Poids et Mesures (BIPM) using a worldwide network of atomic +# clocks. UTC differs from TAI by an integer number of seconds; it is the basis +# of all activities in the world. # -# In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until -# the end of the line. A plain comment line has a -# whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace -# character in column 2. -# -# A blank line should be ignored. -# -# The following table shows the corrections that must -# be applied to compute International Atomic Time (TAI) -# from the Coordinated Universal Time (UTC) values that -# are transmitted by almost all time services. -# -# The first column shows an epoch as a number of seconds -# since 1 January 1900, 00:00:00 (1900.0 is also used to -# indicate the same epoch.) Both of these time stamp formats -# ignore the complexities of the time scales that were -# used before the current definition of UTC at the start -# of 1972. (See note 3 below.) -# The second column shows the number of seconds that -# must be added to UTC to compute TAI for any timestamp -# at or after that epoch. The value on each line is -# valid from the indicated initial instant until the -# epoch given on the next one or indefinitely into the -# future if there is no next line. -# (The comment on each line shows the representation of -# the corresponding initial epoch in the usual -# day-month-year format. The epoch always begins at -# 00:00:00 UTC on the indicated day. See Note 5 below.) -# -# Important notes: -# -# 1. Coordinated Universal Time (UTC) is often referred to -# as Greenwich Mean Time (GMT). The GMT time scale is no -# longer used, and the use of GMT to designate UTC is -# discouraged. -# -# 2. The UTC time scale is realized by many national -# laboratories and timing centers. Each laboratory -# identifies its realization with its name: Thus -# UTC(NIST), UTC(USNO), etc. The differences among -# these different realizations are typically on the -# order of a few nanoseconds (i.e., 0.000 000 00x s) -# and can be ignored for many purposes. These differences -# are tabulated in Circular T, which is published monthly -# by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.org for more information. -# -# 3. The current definition of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before that epoch, and it can be -# quite difficult to compute precise timestamps and time -# intervals in those "prehistoric" days. For more information, -# consult: -# -# The Explanatory Supplement to the Astronomical -# Ephemeris. -# or -# Terry Quinn, "The BIPM and the Accurate Measurement -# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. -# reprinted in: -# Christine Hackman and Donald B Sullivan (eds.) -# Time and Frequency Measurement -# American Association of Physics Teachers (1996) -# , pp. 75-86 -# -# 4. The decision to insert a leap second into UTC is currently -# the responsibility of the International Earth Rotation and -# Reference Systems Service. (The name was changed from the -# International Earth Rotation Service, but the acronym IERS -# is still used.) -# -# Leap seconds are announced by the IERS in its Bulletin C. -# -# See www.iers.org for more details. -# -# Every national laboratory and timing center uses the -# data from the BIPM and the IERS to construct UTC(lab), -# their local realization of UTC. -# -# Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the -# foreseeable future. -# -# 5. If your system keeps time as the number of seconds since -# some epoch (e.g., NTP timestamps), then the algorithm for -# assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI -# timestamp would be obtained by advancing to the next entry in the -# following table when the time equivalent to 23:59:59 UTC -# is used for the second time. Thus the leap second which -# occurred on 30 June 1972 at 23:59:59 UTC would have TAI -# timestamps computed as follows: -# -# ... -# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds -# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds -# ... -# -# If your system realizes the leap second by repeating 00:00:00 UTC twice -# (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivalent to -# 00:00:00 UTC is used. Thus, using the same example as above: -# -# ... -# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds -# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds -# ... -# -# in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. However, -# although the long-term behavior of the time scale is correct in both -# methods, the second method is technically not correct because it adds -# the extra second to the wrong day. -# -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch -# during the leap second does not arise. -# -# Some systems implement leap seconds by amortizing the leap second -# over the last few minutes of the day. The frequency of the local -# clock is decreased (or increased) to realize the positive (or -# negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# definition of UTC. -# -# Questions or comments to: -# Judah Levine -# Time and Frequency Division -# NIST -# Boulder, Colorado -# Judah.Levine@nist.gov -# -# Last Update of leap second values: 8 July 2016 -# -# The following line shows this last update date in NTP timestamp -# format. This is the date on which the most recent change to -# the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two -# columns as shown below. -# -#$ 3676924800 -# -# The NTP timestamps are in units of seconds since the NTP epoch, -# which is 1 January 1900, 00:00:00. The Modified Julian Day number -# corresponding to the NTP time stamp, X, can be computed as -# -# X/86400 + 15020 -# -# where the first term converts seconds to days and the second -# term adds the MJD corresponding to the time origin defined above. -# The integer portion of the result is the integer MJD for that -# day, and any remainder is the time of day, expressed as the -# fraction of the day since 0 hours UTC. The conversion from day -# fraction to seconds or to hours, minutes, and seconds may involve -# rounding or truncation, depending on the method used in the -# computation. -# -# The data in this file will be updated periodically as new leap -# seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic -# file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to -# the most recent version of the file. -# -# This update procedure will be performed only when a new leap second -# is announced. -# -# The following entry specifies the expiration date of the data -# in this file in units of seconds since the origin at the instant -# 1 January 1900, 00:00:00. This expiration date will be changed -# at least twice per year whether or not a new leap second is -# announced. These semi-annual changes will be made no later -# than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, -# respectively. (These are the customary effective dates for new -# leap seconds.) This expiration date will be identified by a -# unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an -# effective date other than 30 June or 31 December, then this -# file will be edited to include that leap second as soon as it is -# announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will -# be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file -# will not change. -# -# Updated through IERS Bulletin C67 -# File expires on: 28 December 2024 -# -#@ 3944332800 -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -3692217600 37 # 1 Jan 2017 -# -# the following special comment contains the -# hash value of the data in this file computed -# use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/pub/sha for -# the details of how this hash value is -# computed. Note that the hash computation -# ignores comments and whitespace characters -# in data lines. It includes the NTP values -# of both the last modification time and the -# expiration time of the file, but not the -# white space on those lines. -# the hash line is also ignored in the -# computation. -# -#h 199a9d45 3f630d2f e47cb9cc c2f0fa47 96932227 +# +# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. +# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various +# irregular fluctuations progressively detected in the rotation rate of the Earth led +# in 1972 to the replacement of UT1 by UTC as the reference time scale. +# +# +# LEAP SECOND +# Atomic clocks are more stable than the rate of the earth's rotation since the latter +# undergoes a full range of geophysical perturbations at various time scales: lunisolar +# and core-mantle torques, atmospheric and oceanic effects, etc. +# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller +# than 0.9 seconds. Therefore, when necessary a "leap second" is applied to UTC. +# Since the adoption of this system in 1972 it has been necessary to add a number of seconds to UTC, +# firstly due to the initial choice of the value of the second (1/86400 mean solar day of +# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is +# theoretically possible to have a negative leap second (a second removed from UTC), but so far, +# all leap seconds have been positive (a second has been added to UTC). Based on what we know about +# the earth's rotation, it is unlikely that we will ever have a negative leap second. +# +# +# HISTORY +# The first leap second was added on June 30, 1972. Until the year 2000, it was necessary in average to add a +# leap second at a rate of 1 to 2 years. Since the year 2000 leap seconds are introduced with an +# average interval of 3 to 4 years due to the acceleration of the Earth's rotation speed. +# +# +# RESPONSIBILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC +# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of +# the International Earth Rotation and reference System Service (IERS). This center is located at Paris +# Observatory. According to international agreements, leap seconds should be scheduled only for certain dates: +# first preference is given to the end of December and June, and second preference at the end of March +# and September. Since the introduction of leap seconds in 1972, only dates in June and December were used. +# +# Questions or comments to: +# Christian Bizouard: christian.bizouard@obspm.fr +# Earth orientation Center of the IERS +# Paris Observatory, France +# +# +# +# COPYRIGHT STATUS OF THIS FILE +# This file is in the public domain. +# +# +# VALIDITY OF THE FILE +# It is important to express the validity of the file. These next two dates are +# given in units of seconds since 1900.0. +# +# 1) Last update of the file. +# +# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) +# +# The following line shows the last update of this file in NTP timestamp: +# +#$ 3929093563 +# +# 2) Expiration date of the file given on a semi-annual basis: last June or last December +# +# File expires on 28 June 2025 +# +# Expire date in NTP timestamp: +# +#@ 3960057600 +# +# +# LIST OF LEAP SECONDS +# NTP timestamp (X parameter) is the number of seconds since 1900.0 +# +# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 +# +# DTAI: The difference DTAI= TAI-UTC in units of seconds +# It is the quantity to add to UTC to get the time in TAI +# +# Day Month Year : epoch in clear +# +#NTP Time DTAI Day Month Year +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 +# +# A hash code has been generated to be able to verify the integrity +# of this file. For more information about using this hash code, +# please see the readme file in the 'source' directory : +# https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README +# +#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 From nobody Mon Jul 22 20:59:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXhR594Gz5QB0Q; Mon, 22 Jul 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXhR4QBtz4cxV; Mon, 22 Jul 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721681959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/s40MCURfwhhtHPVa0Q31k1PUW5GMBh+4F1ZIAfafCw=; b=cgO6LpBIFgCsyBumF6eswDV16uRSCzmUz+ELPml0ue9gAqYpPFTLq1q+rBdFCp0jhR/+6n wSVMkdZjDvX6o+SqMnGI9iEYbL4bgSHQflmJwBDxGYQM1XVt/EzNnfQXD436MHEuoJBlND 3FnYAZ8gp8tu4pqvBFvAF1MNt7/jXP1ZId+wZDGT71fLeOlQLugQkG8v8TifQxze+QEJzF yM1bb2bz/ni4ScnSG3jqdgG2HoHJX3szv4v3xFGWcm7yY+G/VoRCz1B1dve1kkfWOoBgYl Ov/549N2vkN0qc1+GK2MDDkoGa34ygiuJ9eazUHgAo6dDpCjpbiaXUbdSPZp8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721681959; a=rsa-sha256; cv=none; b=ymdw6gBtTbDm7f0BO5BKsC0duFJLoI3pDCeM0RK2qA7oIXW228CFkIPJSUu4fGaTnz8SA+ gGODg9Yl5RQIvkyoxK6Aa3sza0hoXgNsHHDl1ww+wW2fQhYGLElXciPDrd7U+ZfOTtyc7X GkiaYK7tVX5slSaQq/wrwmwVshvZ02CLERlHLX4BZmrM9TvWp6dX0JQGBs5fu0bUNavzFH hJqU4sGRUiNv67TCNA9FidMzQcLYsE896rlaImty9doKzJeiZygYYPMjX835Gx6iRg8TTv Uqm07fjf1fhh/Cqw8KdO/6xfh8WOsW3OTVTKSOpxfoqG1xyTzjtoNnv2fofjKA== 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=1721681959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/s40MCURfwhhtHPVa0Q31k1PUW5GMBh+4F1ZIAfafCw=; b=BjHwjnlDYkU3WXu4R34lB47tzWKE1S877yPEE7UBljdrAD7B9CTboHCq0IyGLnM1Kkhel1 cSo50rmAod4Jb1lZIuxfHASO4Azu3riZyYQTc2aUAwxUs7r0hvKm9yNni1fBkcN1D7d/js 6biOck/gtsCOa5g95piJbh8dkqA6QouNm9XaNh5Y/Apdy2lD32W7bWoNRy/XG6ikkek2RV IdamtegksdGnYEztHeXvRQPdJDd7ZG5eSq0T8pfN667RaTRDHeYd4qVkSnmh3W9zMApYS1 b19IExEkO9i5s5nYf2kXIxub25yDYj2AdoFxBpjB4+BfN75E3xPYsPDK8+dUsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXhR3v6zz106d; Mon, 22 Jul 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MKxJoN045245; Mon, 22 Jul 2024 20:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MKxJNS045242; Mon, 22 Jul 2024 20:59:19 GMT (envelope-from git) Date: Mon, 22 Jul 2024 20:59:19 GMT Message-Id: <202407222059.46MKxJNS045242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4ba4cfaf9f29 - stable/14 - acpi: Narrow workaround for broken interrupt settings on x86 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ba4cfaf9f2991fea0d438e915df8b681a47facf Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4ba4cfaf9f2991fea0d438e915df8b681a47facf commit 4ba4cfaf9f2991fea0d438e915df8b681a47facf Author: John Baldwin AuthorDate: 2024-07-15 19:13:08 +0000 Commit: John Baldwin CommitDate: 2024-07-22 19:54:14 +0000 acpi: Narrow workaround for broken interrupt settings on x86 Commit 9a7bf07ccdc1 from 2016 introduced a workaround for some broken BIOSes that specified active-lo instead of active-hi polarity for ISA IRQs for UARTs. The workaround assumed that edge-sensitive ISA IRQs on x86 should always be active-hi. However, some recent AMD systems actually use active-lo edge-sensitive ISA IRQs (and not just for UARTs, but also for the keyboard and PS/2 mouse devices) and the override causes interrupts to be dropped resulting in boot time hangs, non-working keyboards, etc. Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl post-boot) to control this quirk. It can be set to 1 to force enable the override and 0 to disable it. The log of original message mentions an Intel motherboard as the sample case, so default the tunable to 1 on systems with an Intel CPU and 0 otherwise. Special thanks to Matthias Lanter for tracking down boot time issues on recent AMD systems to mismatched interrupt polarity. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45554 (cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5) --- share/man/man4/acpi.4 | 8 +++++++- sys/dev/acpica/acpi.c | 19 +++++++++++++++++++ sys/dev/acpica/acpi_resource.c | 11 ++++------- sys/dev/acpica/acpivar.h | 12 ++++++++++++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index 434e97d529f5..cdad3ceeedfc 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 12, 2021 +.Dd July 15, 2024 .Dt ACPI 4 .Os .Sh NAME @@ -256,6 +256,12 @@ is a valid list of two interfaces .Qq Li FreeBSD and .Qq Li Linux . +.It Va hw.acpi.hw.acpi.override_isa_irq_polarity (x86) +Forces active-lo polarity for edge-triggered ISA interrupts. +Some older systems incorrectly specify active-lo polarity for ISA +interrupts and this override fixes those systems. +This override is enabled by default on systems with Intel CPUs, +but can be enabled or disabled by setting the tunable explicitly. .It Va hw.acpi.reset_video Enables calling the VESA reset BIOS vector on the resume path. This can fix some graphics cards that have problems such as LCD white-out diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0894f4464162..71b19067707b 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -55,6 +55,8 @@ #if defined(__i386__) || defined(__amd64__) #include #include +#include +#include #endif #include #include @@ -289,6 +291,10 @@ int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); +#if defined(__amd64__) || defined(__i386__) +int acpi_override_isa_irq_polarity; +#endif + /* * ACPI standard UUID for Device Specific Data Package * "Device Properties UUID for _DSD" Rev. 2.0 @@ -601,6 +607,19 @@ acpi_attach(device_t dev) OID_AUTO, "handle_reboot", CTLFLAG_RW, &sc->acpi_handle_reboot, 0, "Use ACPI Reset Register to reboot"); +#if defined(__amd64__) || defined(__i386__) + /* + * Enable workaround for incorrect ISA IRQ polarity by default on + * systems with Intel CPUs. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL) + acpi_override_isa_irq_polarity = 1; + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "override_isa_irq_polarity", CTLFLAG_RDTUN, + &acpi_override_isa_irq_polarity, 0, + "Force active-hi polarity for edge-triggered ISA IRQs"); +#endif + /* * Default to 1 second before sleeping to give some machines time to * stabilize. diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index e17b891d7974..8d81d61989a8 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -159,14 +159,11 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) } #if defined(__amd64__) || defined(__i386__) - /* - * XXX: Certain BIOSes have buggy AML that specify an IRQ that is - * edge-sensitive and active-lo. However, edge-sensitive IRQs - * should be active-hi. Force IRQs with an ISA IRQ value to be - * active-hi instead. - */ - if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW) + if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW && + acpi_override_isa_irq_polarity) { + device_printf(dev, "forcing active-hi polarity for IRQ %u\n", irq); pol = ACPI_ACTIVE_HIGH; + } #endif BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index bb969821b945..afb0a6909e1a 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -231,6 +231,18 @@ extern int acpi_quirks; #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) +#if defined(__amd64__) || defined(__i386__) +/* + * Certain Intel BIOSes have buggy AML that specify an IRQ that is + * edge-sensitive and active-lo. Normally, edge-sensitive IRQs should + * be active-hi. If this value is non-zero, edge-sensitive ISA IRQs + * are forced to be active-hi instead. At least some AMD systems use + * active-lo edge-sensitive ISA IRQs, so this setting is only enabled + * by default on systems with Intel CPUs. + */ +extern int acpi_override_isa_irq_polarity; +#endif + /* * Plug and play information for device matching. Matching table format * is compatible with ids parameter of ACPI_ID_PROBE bus method. From nobody Mon Jul 22 20:59:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXhS5qrpz5Q9pd; Mon, 22 Jul 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXhS51rTz4cxW; Mon, 22 Jul 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721681960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MRkz49nO3m6two7up26geeg5s7iJins3P+e6a302wM4=; b=PuxxsZyn1JSRbJgbEI0unvOYqxGC6bgk66neu5sWej/2q0m7c39XHANUh7tRKcRt8Ukp9L PIzotS3kxxON6B3hgwq6/CvyRrB840cdBrPrJl39GxWAzEuaDfGiqDsjjPvzL2E5GsAqJX GR/hxR3lZf2vTth3hIgVhQTJ/J2zoE9E5w48akx2cOp+9WceFievUpXZ5g9kdsVwJQ03gK 7ZE1TqNZlCwu2NXnZ7LqwWeAi6oE0U+tr4W0ZjXgrLyDnb0/sSVcaxMR0W7g98tl/mSKw9 hBltaIOn5Q9SC7SLhwjGC14d8sBp8z4I01qBPW1eII/kwejYCKP2Y4tL6zl3Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721681960; a=rsa-sha256; cv=none; b=LD7VPPWm4nv76PJNmgZMYe5wUNa48w+szUI2uYqytsNPkUsBtMHTxA/plj9fksRXT+0WL0 tTMxPGn3EXypGI57LgpQPgHSqHou5fZAQvZgS7Th0nUu1JFJTy6KY1k1gNlYnrfKzCWG32 iWBr+sq0RivHTh4WykismD24KYFJILPNOx5IamlQGWe+zGzY4nmCoiNPLoDvnx9SjeOgaO rmm6+UUTF/duP0j7CML58qn/RF5bPU4r4vkshwxgyDetMrS9qW3BtFdFMF2riKrkpAc6Qk MK/j9Krn7AW2bkgjlgnjBd/T9q2bLj49SD8fo+HznpLpaGNilOrpeJi57gT5qw== 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=1721681960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MRkz49nO3m6two7up26geeg5s7iJins3P+e6a302wM4=; b=g+mZigkG1j5aROcZ01NIOCsLF7C3sPctib4/Jx00mg45O4yKl3DCnbiP14ZIMFWaQqIgR6 qqRVQc3ZIy219uRzLvJ11I3trBZE9KwPoGRpYJcMXt2PIZ8iNpTk/KIJGWNEYN5ICeoL63 UaXYt4U7rZ6QAh+78+YdvdQLvf36AkzrtFqI9luzLYpiwOmawwfF7P7+VvankVT7DEvMzI UKI5WFvZOhKu1ERjDU6xTUesdukk4kzG50w/2zN1LwaB2k0TfyE0UplqhF3xGP6ZkV40Ok ztBVXhI0Ormx1WP58MnjrxEE0mIiVSqCfjGDUM9YnuMtr9GuUe3rS6wZPRSn6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXhS4f6Sz10Np; Mon, 22 Jul 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MKxKKH045296; Mon, 22 Jul 2024 20:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MKxKtA045293; Mon, 22 Jul 2024 20:59:20 GMT (envelope-from git) Date: Mon, 22 Jul 2024 20:59:20 GMT Message-Id: <202407222059.46MKxKtA045293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4efd13ffd63d - stable/14 - amd64 GENERIC: Drop hints for fdc0 and ppc0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4efd13ffd63db60191a2dac696646b93c01091bb Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4efd13ffd63db60191a2dac696646b93c01091bb commit 4efd13ffd63db60191a2dac696646b93c01091bb Author: John Baldwin AuthorDate: 2024-07-15 14:16:39 +0000 Commit: John Baldwin CommitDate: 2024-07-22 19:55:58 +0000 amd64 GENERIC: Drop hints for fdc0 and ppc0 Modern x86 systems do not ship with ISA floppy disk controllers or LPT ports. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45946 (cherry picked from commit 480cc750a2a8f92d078803f15eecb1f8a084a1ea) --- sys/amd64/conf/GENERIC.hints | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index be3f59cd1950..7c2a3f28b9ce 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -1,11 +1,3 @@ -hint.fdc.0.at="isa" -hint.fdc.0.port="0x3F0" -hint.fdc.0.irq="6" -hint.fdc.0.drq="2" -hint.fd.0.at="fdc0" -hint.fd.0.drive="0" -hint.fd.1.at="fdc0" -hint.fd.1.drive="1" hint.atkbdc.0.at="isa" hint.atkbdc.0.port="0x060" hint.atkbd.0.at="atkbdc" @@ -21,8 +13,6 @@ hint.uart.0.irq="4" hint.uart.1.at="isa" hint.uart.1.port="0x2F8" hint.uart.1.irq="3" -hint.ppc.0.at="isa" -hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Mon Jul 22 20:59:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXhV0Rc2z5Q9rC; Mon, 22 Jul 2024 20:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXhT6B56z4csC; Mon, 22 Jul 2024 20:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721681961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6sRtH/pdiU/XaKhqBytkEscGAO8d1BBPVr5b11lk+0=; b=hKepXO8za6j1Vur+nSf8UXYlCQV2rX41cFmdmjoMU4VOz0m7xStGs2WC5H4vjP+SJNe9TP I120k63prqmrbNk5blt/XEWrEemIWpjKrY/K9vNxKQ++xIULk7xG0LNaQkr6XE2apvR0iG Ztac+hs3IpgZtQw/YtyV5fRczdGTKvTRLkwiGfFIN88zIEq7iF66qLAs7AYS1C+6BEjvVa bHBdWzwtprYuTnCb3mQpE5TNw65XbsOKe7Fx+Xs0S2EI6BoZ+sITRE6RD7GKDYkGXOUQow qRuyV7JRs7CVkndBXPrsiCJnHeTvt5tCRJIBjATGgCT/Lxdbz3MndH522LMfpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721681961; a=rsa-sha256; cv=none; b=Y3CF5ou0E9YsiSEKr5J2YUtdStlY0s9QAQ1G/1nBxdO9VANqnVL4ZFueiv7Mw/GY/8mhhx +e9Pn0lRUWcuLvejY3EoIkcwOFW/V68V8Z9k+HozpR1ziY1vKNnDI0JK8h3fSZSWSL441P ETSydjuSEnJq+IliybtDQX5aQ+uMP+7REjVNdYxX3ZSmbNNh5uTGzhCqnBIdRD21d1mOJd ZYkUfFtmrKnInrMVZC8Sd20azFbiEv1e/MOJJofRzHoe59BJBe8e2WZ/mX4gCOyY+9ZuXn xQnXOG6tehodBux1WEQsFb+yciYpvVt14tRY6hWTZ2pd3x99LGsjlLIdxDlhEQ== 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=1721681961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6sRtH/pdiU/XaKhqBytkEscGAO8d1BBPVr5b11lk+0=; b=ATzsaVRUPrJ1kWAGK8hjFk0jLFphgPLXD0mt4tIuEInkfgWv8g+2xsdbnpnZAcBoPqex2U 5GMYtjHHRjLYVqc6ZW4JbbGP1VJFhufueD4sT9doesMg0rQPBLH5EPXxAnPnLMLrhWMLvb lEKRVeLZ1cAAAk5cwE0AUA8/FtulL23MtEceyRxpL8xoRLQnRqy02QXRMEaPlcIZlnkF3H eHadfbcSUHQmzUMqmhw6loSrKcgkdbOi32MxgCAScE5HA+ph8OQFFStHbNnm2F+jCJ+aE+ RgXn39bRWftlahAjJH797Tw64Zm3uE3Hs2s6skSuDPseoc6j6CnGTpjH5yb01w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXhT5lBsz10dn; Mon, 22 Jul 2024 20:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MKxL00045350; Mon, 22 Jul 2024 20:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MKxLa2045347; Mon, 22 Jul 2024 20:59:21 GMT (envelope-from git) Date: Mon, 22 Jul 2024 20:59:21 GMT Message-Id: <202407222059.46MKxLa2045347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 74b9fc7adcf4 - stable/14 - amd64 GENERIC: Switch uart hints from "isa" to "acpi" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 74b9fc7adcf4afb1c3039267e338c3cfdf022957 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=74b9fc7adcf4afb1c3039267e338c3cfdf022957 commit 74b9fc7adcf4afb1c3039267e338c3cfdf022957 Author: John Baldwin AuthorDate: 2024-07-15 19:14:01 +0000 Commit: John Baldwin CommitDate: 2024-07-22 19:56:00 +0000 amd64 GENERIC: Switch uart hints from "isa" to "acpi" This causes these hints to be only used to wire device unit numbers for serial ports enumerated by ACPI but will not create ISA device nodes if ACPI doesn't enumerate them. Note that IRQ hints are not used for wiring so have been removed. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45945 (cherry picked from commit 9cc06bf7aa2846c35483de567779bb8afc289f53) --- sys/amd64/conf/GENERIC.hints | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index 7c2a3f28b9ce..4f6121c7cf77 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -6,13 +6,11 @@ hint.psm.0.at="atkbdc" hint.psm.0.irq="12" hint.sc.0.at="isa" hint.sc.0.flags="0x100" -hint.uart.0.at="isa" +hint.uart.0.at="acpi" hint.uart.0.port="0x3F8" hint.uart.0.flags="0x10" -hint.uart.0.irq="4" -hint.uart.1.at="isa" +hint.uart.1.at="acpi" hint.uart.1.port="0x2F8" -hint.uart.1.irq="3" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Mon Jul 22 22:09:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSZFV56HPz5QHDk; Mon, 22 Jul 2024 22:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSZFV4Stkz4l0b; Mon, 22 Jul 2024 22:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721686174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D/aIrBo1Bx8tKzs3rGnE/8G/9LsAm3riwkIpL2bPGNQ=; b=e07VOhGawARohliI/vG7q4X+aR4IqV3Hl+GsshSax+wGuTJ2AgeYWLkzL35UGuGneG2okM vIa8SxPlAxk5A2pbL7TtVSqWHU4RIi2Y4jbUxGb6IGjD0v/vQpUmjSuSpzJwN3JCCzGY/o 3yUtCyn9q8Eiby0YNoiUPuV2H5j17WGB0gFPlT7Bw5Iaj0EJVW10B9ZJw2uMXDg4Dz5PGR CSRtNZS+25VJ6JN3NaH8fLTzfqX1/s0xwrMk0CuLNja496+1u1BmB2ANJnNA1yQXqSh3qL y9+VVygSpVT33U8kIdsxH3l4Z9vKDlt6Sob63Gr6OLzLmBqXCaKN0abvzT59zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721686174; a=rsa-sha256; cv=none; b=q7czgsrB0ypVZXb+I7y3/aRMh4UiR9avqzPVbedHck5SDWKt5phwNWQtT67ZBo5fsXY3Xb JE1m4vur2zxSzvBS+qcD7DWF4oq+3MeJdsOjmsm044vMV1Mw1zEmLfV6LKMw9huS7jh9Sr WptK/iwn5jQU49PCIfWf2HBWscMPfHmMliY25MWMFROVkAL7ampqTfwGjS+IxInafmFruH uViBMVnnfgSD4x1LaKLQ/Ef166uXhEgvCW180SDa31opejS5GEaB0eEpuEOwoupa66egLp RZoK+nv9q4ml2kR6IPTKetPXz4jIroq5NCNOrIC3eQUryOEGyZUw6iZxOJVqxg== 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=1721686174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D/aIrBo1Bx8tKzs3rGnE/8G/9LsAm3riwkIpL2bPGNQ=; b=wfnPQkQJCMIEykMB6sQu51vMzHPT+OFJdpdHXOjryL9l4baAe7KZdHqifoHtgCP6xkWe93 zcMbwsjsK3NkBuUkvvh3N2aCZ1wRDgbe4FoWdqXrAyp2vYRc34ff8NyCQ+dNp4GBaokEkF KxGngF7ozx8z69X69sUTRtHig9QsbH5GsA1wN/+o9eYJXSkZopxoJoFG6zIHW3uhqpirAP YBVmmo9ZowREhjIpgV5i0WBHfh73MzCPYc/uW7sUvzAXEndNdsEOpZ5VnU/8ITq3GvkbgS OK0ZPpSViF9XCYkm7EJy1heiWGj5MCZ3ezoLfZZJ0cnrgVtfppAVAxEl8SvRFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSZFV3t81z12ZJ; Mon, 22 Jul 2024 22:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MM9Ymh064182; Mon, 22 Jul 2024 22:09:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MM9YSj064179; Mon, 22 Jul 2024 22:09:34 GMT (envelope-from git) Date: Mon, 22 Jul 2024 22:09:34 GMT Message-Id: <202407222209.46MM9YSj064179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 7a76f3591036 - stable/14 - nfsd: Allow a mutex lock for clientID handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a76f3591036af124998a03c048d69deb3a554a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=7a76f3591036af124998a03c048d69deb3a554a4 commit 7a76f3591036af124998a03c048d69deb3a554a4 Author: Rick Macklem AuthorDate: 2024-06-22 22:56:40 +0000 Commit: Rick Macklem CommitDate: 2024-07-22 21:57:56 +0000 nfsd: Allow a mutex lock for clientID handling On Feb. 28, a problem was reported on freebsd-stable@ where a nfsd thread processing an ExchangeID operation was blocked for a long time by another nfsd thread performing a copy_file_range. This occurred because the copy_file_range was taking a long time, but also because handling a clientID requires that all other nfsd threads be blocked via an exclusive lock, as required by ExchangeID. This patch allows clientID handling to be done with only a mutex held (instead of an exclusive lock that blocks all other nfsd threads) when vfs.nfsd.enable_locallocks is 0. For the case of vfs.nfsd.enable_locallocks set to 1, the exclusive lock that blocks all nfsd threads is still required. This patch does make changing the value of vfs.nfsd.enable_locallocks somewhat racy. A future commit will ensure any change is done when all nfsd threads are blocked to avoid this racyness. (cherry picked from commit dfaeeacc2cc29d0497ecd4cd5b7fd0d5ab61fcd5) --- sys/fs/nfsserver/nfs_nfsdstate.c | 245 ++++++++++++++++++++++++++------------- 1 file changed, 162 insertions(+), 83 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 7a28e51e21fc..6b40e0f64141 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -245,6 +245,45 @@ static void nfsrv_issuedelegation(struct vnode *vp, struct nfsclient *clp, u_quad_t filerev, uint64_t rdonly, struct nfsstate **new_delegp, struct nfsstate *new_stp, struct nfslockfile *lfp, uint32_t *rflagsp, nfsv4stateid_t *delegstateidp); +static void nfsrv_clientlock(bool mlocked); +static void nfsrv_clientunlock(bool mlocked); + +/* + * Lock the client structure, either with the mutex or the exclusive nfsd lock. + */ +static void +nfsrv_clientlock(bool mlocked) +{ + int igotlock; + + if (mlocked) { + NFSLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + } +} + +/* + * Unlock the client structure. + */ +static void +nfsrv_clientunlock(bool mlocked) +{ + + if (mlocked) { + NFSUNLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + } +} /* * Scan the client list for a match and either return the current one, @@ -266,7 +305,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, struct sockaddr_in6 *sin6, *rin6; #endif struct nfsdsession *sep, *nsep; - int zapit = 0, gotit, hasstate = 0, igotlock; + SVCXPRT *old_xprt; + struct nfssessionhead old_sess; + int zapit = 0, gotit, hasstate = 0; + bool mlocked; static u_int64_t confirm_index = 0; /* @@ -294,14 +336,11 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ new_clp->lc_program = 0; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); /* * Search for a match in the client list. @@ -318,6 +357,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, if (gotit == 0) i++; } + old_xprt = NULL; if (!gotit || (clp->lc_flags & (LCL_NEEDSCONFIRM | LCL_ADMINREVOKED))) { if ((nd->nd_flag & ND_NFSV41) != 0 && confirmp->lval[1] != 0) { @@ -325,9 +365,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, * For NFSv4.1, if confirmp->lval[1] is non-zero, the * client is trying to update a confirmed clientid. */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); confirmp->lval[1] = 0; error = NFSERR_NOENT; goto out; @@ -337,7 +375,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (i != nfsrv_clienthashsize) { LIST_REMOVE(clp, lc_hash); - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); zapit = 1; @@ -372,11 +413,12 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); - if (zapit) + nfsrv_clientunlock(mlocked); + if (zapit != 0) { + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); + } *new_clpp = NULL; goto out; } @@ -390,7 +432,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (clp->lc_expiry < NFSD_MONOSEC && (!LIST_EMPTY(&clp->lc_open) || !LIST_EMPTY(&clp->lc_deleg))) { - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); } @@ -435,9 +480,9 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, break; #endif } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); error = NFSERR_CLIDINUSE; goto out; } @@ -452,13 +497,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ LIST_REMOVE(clp, lc_hash); - /* Get rid of all sessions on this clientid. */ - LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { - ret = nfsrv_freesession(NULL, sep, NULL, false, NULL); - if (ret != 0) - printf("nfsrv_setclient: verifier changed free" - " session failed=%d\n", ret); - } + LIST_NEWHEAD(&old_sess, &clp->lc_session, sess_list); new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) { @@ -502,21 +541,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) { + nfsrv_clientunlock(mlocked); + NFSLOCKSTATE(); + } /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsd clp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &old_sess, sess_list, nsep) { + ret = nfsrv_freesession(NULL, sep, NULL, false, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + nfsrv_zapclient(clp, p); *new_clpp = NULL; goto out; @@ -568,24 +617,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, nfsrv_openpluslock++; nfsrv_clients++; } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + nfsrv_clientunlock(mlocked); if ((nd->nd_flag & ND_NFSV41) == 0) { /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsdclp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); *new_clpp = NULL; + } else { + if (mlocked) + NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } out: @@ -605,11 +661,13 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, struct nfsstate *stp; int i; struct nfsclienthashhead *hp; - int error = 0, igotlock, doneok; + int error = 0, doneok, igotlock; struct nfssessionhash *shp; struct nfsdsession *sep; uint64_t sessid[2]; - bool sess_replay; + CLIENT *client; + SVCXPRT *old_xprt; + bool mlocked, sess_replay; static uint64_t next_sess = 0; if (clpp) @@ -626,13 +684,27 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * already held. Otherwise, we need to get either that or, * for the case of Confirm, lock out the nfsd threads. */ + client = NULL; + old_xprt = NULL; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); + if (nsep != NULL && + (nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) + client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); + if (mlocked) { + nfsrv_clientlock(mlocked); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + } /* * Create a new sessionid here, since we need to do it where * there is a mutex held to serialize update of next_sess. @@ -641,7 +713,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, sessid[0] = ++next_sess; sessid[1] = clientid.qval; } - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + NFSUNLOCKV4ROOTMUTEX(); } else if (opflags != CLOPS_RENEW) { NFSLOCKSTATE(); } @@ -678,9 +751,9 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, } if (error) { if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -725,7 +798,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * for an Open with CLAIM_DELEGATE_PREV unless in * grace, but get rid of the rest of the state. */ - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_olddeleg); if (nfsrv_checkgrace(nd, clp, 0)) { /* In grace, so just delete delegations */ @@ -749,10 +825,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && !sess_replay) { - if (clp->lc_req.nr_client == NULL) - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + if (clp->lc_req.nr_client == NULL) { + clp->lc_req.nr_client = client; + client = NULL; + } if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); CLNT_ACQUIRE(clp->lc_req.nr_client); @@ -769,13 +845,15 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, NFSX_V4SESSIONID); if (!sess_replay) { shp = NFSSESSIONHASH(nsep->sess_sessionid); - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!mlocked) + NFSUNLOCKSTATE(); } } } @@ -809,9 +887,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, clp->lc_expiry = nfsrv_leaseexpiry(); } if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -831,21 +911,20 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) { struct nfsclient *clp; struct nfsclienthashhead *hp; - int error = 0, i, igotlock; + SVCXPRT *old_xprt; + int error = 0, i; + bool mlocked; if (NFSD_VNET(nfsrvboottime) != clientid.lval[0]) { error = NFSERR_STALECLIENTID; goto out; } + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (igotlock == 0); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); hp = NFSCLIENTHASH(clientid); LIST_FOREACH(clp, hp, lc_hash) { @@ -853,9 +932,7 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) break; } if (clp == NULL) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); /* Just return ok, since it is gone. */ goto out; } @@ -863,9 +940,7 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) /* Check for the SP4_MACH_CRED case. */ error = nfsrv_checkmachcred(NFSV4OP_DESTROYCLIENTID, nd, clp); if (error != 0) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); goto out; } @@ -878,28 +953,28 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) /* Scan for state on the clientid. */ for (i = 0; i < nfsrv_statehashsize; i++) if (!LIST_EMPTY(&clp->lc_stateid[i])) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } if (!LIST_EMPTY(&clp->lc_session) || !LIST_EMPTY(&clp->lc_deleg)) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } /* Destroy the clientid and return ok. */ - nfsrv_cleanclient(clp, p, false, NULL); + old_xprt = NULL; + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); out: NFSEXITCODE2(error, nd); @@ -1388,8 +1463,12 @@ nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p, bool locked, struct nfsstate *stp, *nstp; struct nfsdsession *sep, *nsep; - LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) - nfsrv_freeopenowner(stp, 1, p); + LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) { + if (locked) + nfsrv_freeopenowner(stp, 0, p); + else + nfsrv_freeopenowner(stp, 1, p); + } if ((clp->lc_flags & LCL_ADMINREVOKED) == 0) LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) (void)nfsrv_freesession(NULL, sep, NULL, locked, From nobody Mon Jul 22 23:33:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSc692sycz5QQWw; Mon, 22 Jul 2024 23:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSc692gCzz4tg8; Mon, 22 Jul 2024 23:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721691201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BdgEHL2oOgJ3gUk1fV4LquRBc6obB9uAcWZzV6vX6ic=; b=f1rzvY+fYq4S26wmpiGa5+UMn9RxN3sau8bD5iuIHgPza3VtlIyn7BFd/b4NukEerjxX5O IGGyYUiLXmfiEWzy2OgzZTKLFA9I8pP9yD3eHaf5U9CrY4+sqYnw3SQVQ0VpejQxcSmxzY SxTGDDPxvM7c7Sh54PqD7oVz/o/0QYvS/MdMqvjIN961+s+XKC15PQkOdYXVzEPPMjoyYQ SCmaotQquomncufGbSRQNjB1C17qAuLkLsgvvCnJJf3b0kfPVaQAya5YPM3vj+jlvQFP1F EvFWl8Bmf03hm6g30UZhnDyRMhR4+gcxxLosBLmmGooe2An6o8IuAJzhE6/QgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721691201; a=rsa-sha256; cv=none; b=XLv4ZAlx+xxbiEeOZtGz5onn+CgOIdWveRjIV9R1OLqSN/C7pritupYUkNBAYr3W0nF4sE y8gQYHaL3hIHWz1Cx/q14SJmAbwXhNlwEuY3HYveETLs0i/vrVhn5YGoCzVsZG4KmGhbF6 ZNza5O/+K5URSKrVNSPN6edF+qWJNK27A8qAwM7LQ0+LErw/aggsO2RuWhO8XRZzZPtwAV +yAC7MMfDc/+fpKPMDLYorOR3E43nkAswc2P1isv7KK70TgHORv4CYylAUcE2/qyCOXyOh Ss497N4I2m7PsKMMiQKNS728a9ykxLjYqmqXBS6SCx0+kKbUC7j0bNlL9/YNtQ== 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=1721691201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BdgEHL2oOgJ3gUk1fV4LquRBc6obB9uAcWZzV6vX6ic=; b=cZ8TlirlsEFa49BbZzpELEf7wfE1NrMtkGuT+fMdpFCKQTDUoCYxDgUXdGQfo5pajmzvww xIwAi01Corjf1y8VCJC/xmvADiFtBfbX7RV7anWP1HIqSNBlw0bj+frIzlgr9m8ipWJCCi mCFNV1rRELWStOJdklQ4+BiVDAtYC9GF8Nq42zfL/F/Jsz0ZWERdB8PVAd5HmprDpArjg9 zNzzv2uQfdiJ+HBLAzy0f4C5qE3nAXru8K6nPSN0k03U/MV/+9QbSC8hwbvvLztz3jR53U DwZX9xe8FPNFQMFm1SP2jAMvzLN1CF0rjGwqphEczbiJLVxDs/8g4n8ZqIprpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSc692BJtz14b3; Mon, 22 Jul 2024 23:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MNXLdI015421; Mon, 22 Jul 2024 23:33:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MNXLSI015418; Mon, 22 Jul 2024 23:33:21 GMT (envelope-from git) Date: Mon, 22 Jul 2024 23:33:21 GMT Message-Id: <202407222333.46MNXLSI015418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: e6d78780c9cc - stable/13 - nfsd: Allow a mutex lock for clientID handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6d78780c9cc13f5c4f353404b54292cd060251c Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d78780c9cc13f5c4f353404b54292cd060251c commit e6d78780c9cc13f5c4f353404b54292cd060251c Author: Rick Macklem AuthorDate: 2024-06-22 22:56:40 +0000 Commit: Rick Macklem CommitDate: 2024-07-22 22:18:16 +0000 nfsd: Allow a mutex lock for clientID handling On Feb. 28, a problem was reported on freebsd-stable@ where a nfsd thread processing an ExchangeID operation was blocked for a long time by another nfsd thread performing a copy_file_range. This occurred because the copy_file_range was taking a long time, but also because handling a clientID requires that all other nfsd threads be blocked via an exclusive lock, as required by ExchangeID. This patch allows clientID handling to be done with only a mutex held (instead of an exclusive lock that blocks all other nfsd threads) when vfs.nfsd.enable_locallocks is 0. For the case of vfs.nfsd.enable_locallocks set to 1, the exclusive lock that blocks all nfsd threads is still required. This patch does make changing the value of vfs.nfsd.enable_locallocks somewhat racy. A future commit will ensure any change is done when all nfsd threads are blocked to avoid this racyness. (cherry picked from commit dfaeeacc2cc29d0497ecd4cd5b7fd0d5ab61fcd5) --- sys/fs/nfsserver/nfs_nfsdstate.c | 241 ++++++++++++++++++++++++++------------- 1 file changed, 161 insertions(+), 80 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 911f5053bd3c..44f8aeb2a70d 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -238,6 +238,45 @@ static int nfsrv_createdsfile(vnode_t vp, fhandle_t *fhp, struct pnfsdsfile *pf, vnode_t dvp, struct nfsdevice *ds, struct ucred *cred, NFSPROC_T *p, vnode_t *tvpp); static struct nfsdevice *nfsrv_findmirroredds(struct nfsmount *nmp); +static void nfsrv_clientlock(bool mlocked); +static void nfsrv_clientunlock(bool mlocked); + +/* + * Lock the client structure, either with the mutex or the exclusive nfsd lock. + */ +static void +nfsrv_clientlock(bool mlocked) +{ + int igotlock; + + if (mlocked) { + NFSLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + } +} + +/* + * Unlock the client structure. + */ +static void +nfsrv_clientunlock(bool mlocked) +{ + + if (mlocked) { + NFSUNLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + } +} /* * Scan the client list for a match and either return the current one, @@ -259,7 +298,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, struct sockaddr_in6 *sin6, *rin6; #endif struct nfsdsession *sep, *nsep; - int zapit = 0, gotit, hasstate = 0, igotlock; + SVCXPRT *old_xprt; + struct nfssessionhead old_sess; + int zapit = 0, gotit, hasstate = 0; + bool mlocked; static u_int64_t confirm_index = 0; /* @@ -287,14 +329,11 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ new_clp->lc_program = 0; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); /* * Search for a match in the client list. @@ -311,6 +350,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, if (gotit == 0) i++; } + old_xprt = NULL; if (!gotit || (clp->lc_flags & (LCL_NEEDSCONFIRM | LCL_ADMINREVOKED))) { if ((nd->nd_flag & ND_NFSV41) != 0 && confirmp->lval[1] != 0) { @@ -318,9 +358,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, * For NFSv4.1, if confirmp->lval[1] is non-zero, the * client is trying to update a confirmed clientid. */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); confirmp->lval[1] = 0; error = NFSERR_NOENT; goto out; @@ -330,7 +368,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (i != nfsrv_clienthashsize) { LIST_REMOVE(clp, lc_hash); - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); zapit = 1; @@ -365,11 +406,12 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); - if (zapit) + nfsrv_clientunlock(mlocked); + if (zapit != 0) { + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); + } *new_clpp = NULL; goto out; } @@ -383,7 +425,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (clp->lc_expiry < NFSD_MONOSEC && (!LIST_EMPTY(&clp->lc_open) || !LIST_EMPTY(&clp->lc_deleg))) { - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); } @@ -428,9 +473,9 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, break; #endif } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); error = NFSERR_CLIDINUSE; goto out; } @@ -444,13 +489,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ LIST_REMOVE(clp, lc_hash); - /* Get rid of all sessions on this clientid. */ - LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { - ret = nfsrv_freesession(sep, NULL, false, NULL); - if (ret != 0) - printf("nfsrv_setclient: verifier changed free" - " session failed=%d\n", ret); - } + LIST_NEWHEAD(&old_sess, &clp->lc_session, sess_list); new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) { @@ -494,21 +533,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) { + nfsrv_clientunlock(mlocked); + NFSLOCKSTATE(); + } /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsd clp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &old_sess, sess_list, nsep) { + ret = nfsrv_freesession(sep, NULL, false, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + nfsrv_zapclient(clp, p); *new_clpp = NULL; goto out; @@ -560,24 +609,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, nfsrv_openpluslock++; nfsrv_clients++; } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + nfsrv_clientunlock(mlocked); if ((nd->nd_flag & ND_NFSV41) == 0) { /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsdclp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); *new_clpp = NULL; + } else { + if (mlocked) + NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } out: @@ -597,11 +653,13 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, struct nfsstate *stp; int i; struct nfsclienthashhead *hp; - int error = 0, igotlock, doneok; + int error = 0, doneok, igotlock; struct nfssessionhash *shp; struct nfsdsession *sep; uint64_t sessid[2]; - bool sess_replay; + CLIENT *client; + SVCXPRT *old_xprt; + bool mlocked, sess_replay; static uint64_t next_sess = 0; if (clpp) @@ -618,13 +676,27 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * already held. Otherwise, we need to get either that or, * for the case of Confirm, lock out the nfsd threads. */ + client = NULL; + old_xprt = NULL; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); + if (nsep != NULL && + (nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) + client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); + if (mlocked) { + nfsrv_clientlock(mlocked); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + } /* * Create a new sessionid here, since we need to do it where * there is a mutex held to serialize update of next_sess. @@ -633,7 +705,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, sessid[0] = ++next_sess; sessid[1] = clientid.qval; } - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + NFSUNLOCKV4ROOTMUTEX(); } else if (opflags != CLOPS_RENEW) { NFSLOCKSTATE(); } @@ -670,9 +743,9 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, } if (error) { if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -716,7 +789,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * for an Open with CLAIM_DELEGATE_PREV unless in * grace, but get rid of the rest of the state. */ - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_olddeleg); if (nfsrv_checkgrace(nd, clp, 0)) { /* In grace, so just delete delegations */ @@ -740,10 +816,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && !sess_replay) { - if (clp->lc_req.nr_client == NULL) - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + if (clp->lc_req.nr_client == NULL) { + clp->lc_req.nr_client = client; + client = NULL; + } if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); CLNT_ACQUIRE(clp->lc_req.nr_client); @@ -760,13 +836,15 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, NFSX_V4SESSIONID); if (!sess_replay) { shp = NFSSESSIONHASH(nsep->sess_sessionid); - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!mlocked) + NFSUNLOCKSTATE(); } } } @@ -800,9 +878,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, clp->lc_expiry = nfsrv_leaseexpiry(); } if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -822,21 +902,20 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) { struct nfsclient *clp; struct nfsclienthashhead *hp; - int error = 0, i, igotlock; + SVCXPRT *old_xprt; + int error = 0, i; + bool mlocked; if (NFSD_VNET(nfsrvboottime) != clientid.lval[0]) { error = NFSERR_STALECLIENTID; goto out; } + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (igotlock == 0); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); hp = NFSCLIENTHASH(clientid); LIST_FOREACH(clp, hp, lc_hash) { @@ -844,9 +923,7 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) break; } if (clp == NULL) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); /* Just return ok, since it is gone. */ goto out; } @@ -860,28 +937,28 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) /* Scan for state on the clientid. */ for (i = 0; i < nfsrv_statehashsize; i++) if (!LIST_EMPTY(&clp->lc_stateid[i])) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } if (!LIST_EMPTY(&clp->lc_session) || !LIST_EMPTY(&clp->lc_deleg)) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } /* Destroy the clientid and return ok. */ - nfsrv_cleanclient(clp, p, false, NULL); + old_xprt = NULL; + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); out: NFSEXITCODE2(error, nd); @@ -1370,8 +1447,12 @@ nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p, bool locked, struct nfsstate *stp, *nstp; struct nfsdsession *sep, *nsep; - LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) - nfsrv_freeopenowner(stp, 1, p); + LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) { + if (locked) + nfsrv_freeopenowner(stp, 0, p); + else + nfsrv_freeopenowner(stp, 1, p); + } if ((clp->lc_flags & LCL_ADMINREVOKED) == 0) LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) (void)nfsrv_freesession(sep, NULL, locked, old_xprtp); From nobody Tue Jul 23 00:30:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSdNd64jkz5QVtL; Tue, 23 Jul 2024 00:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSdNd5XlNz3yBc; Tue, 23 Jul 2024 00:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721694657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IgnblNA3ahz+0pmD9Aw6hvf92xfAW2eYDRZciB9PRYw=; b=MSHNr1+vPYPe89a6OMjVMX/VSsQRqZZSEbI//MhmG3BfKI+UgBjPvrm0LpJt1vlFE5sLXJ QDZzuTE2gvm+Atapa7GP0TMcOorbWMYsixQaB9jNuFLlXFVSMmKDNBcxyGGFOaXEL2KqP7 sP99S+ZtqltTbU9u9RaI1PzctqIRJaYm/B55heOZH49xpgde6zjKJkzkIgOAq4bbxuUq4j QlOmSbIvwjhvMuC/HupRsbQCakQKoO2keK0NgBlKOSp34Og4OZ28N34aaf7jzszd8P9Kw/ ILH982qFO0EpgEpjFd49EjwTpMQqbH9ISIy/DXtw9OjaKBFq2wWLJqkNQbh42g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721694657; a=rsa-sha256; cv=none; b=QSB7T+s7yw9ucAX2xEHwFwZ7QzvsPatUjFYc27r0qGyXnid+jVj/0U1coQgr2xXUWJmTTC C5m8AIFPS4f/5MH5+APtZcwAlKZt+dTrN0wmUCJ2ITNPuHMmGSfm79fN2Rg9C1FdkYW0nQ V5VNy9h/N0r6AvfShS39oTZSFdDOIhsR0uYUIbRvZz62Vn3qWc2PQlM5+Us0MrBBg6kJck kdMxXu0S0fmFb8CQUsOv2d+NbmTm01xPW+X0/Jamd0k1g+9V5hmSxfPt4g92bqMRIAECJ8 7RYMYdKdwvDJvT1fJgYyyziA29yrf3QABF90S+E6ct48xwd0vbKQQ1DQ3vYcmQ== 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=1721694657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IgnblNA3ahz+0pmD9Aw6hvf92xfAW2eYDRZciB9PRYw=; b=BiSDYwdqfwxTKSh4EN/iMuNxVj/cBtBrQdQzlBfPiTnH5aJm3UDRd6kKaqtUtvvXtRZXyi 4woNguKKySe2nM2oaJjTDx1aCL/77BgQdfQGONFgbfmkfRFua97dRFB9e7PvLTjZ5WZfg5 ko1eC5G2tGG1kpLWPd7xRRFEVaJKPifO1bGfqLsyEfz8Jix3wz6M1jsZYgdT5O/jQT6rVj tds+eRu1DzJ1nZ6choQJLoKVT+xkOukrhl2xrCjNloBWx1qFd26a8UTDBKWY4m8hzvvhqr a0E80nULY8mwUV6yxxgN/DuZSCmiDzTgdGDgYQf01nbPSDhX3tn1fUmsXK5egw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSdNd57qnz169S; Tue, 23 Jul 2024 00:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N0UvhZ008842; Tue, 23 Jul 2024 00:30:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N0Uvm0008839; Tue, 23 Jul 2024 00:30:57 GMT (envelope-from git) Date: Tue, 23 Jul 2024 00:30:57 GMT Message-Id: <202407230030.46N0Uvm0008839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d5ae681d2e74 - stable/14 - nfsd: Make modifying vfs.nfsd.enable_locallocks safe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d5ae681d2e747e28076f670ca2b3deb27b00acf6 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d5ae681d2e747e28076f670ca2b3deb27b00acf6 commit d5ae681d2e747e28076f670ca2b3deb27b00acf6 Author: Rick Macklem AuthorDate: 2024-06-23 22:47:22 +0000 Commit: Rick Macklem CommitDate: 2024-07-23 00:29:54 +0000 nfsd: Make modifying vfs.nfsd.enable_locallocks safe Commit dfaeeacc2cc2 modified clientID handling so that it could be done with only a mutex lock held when vfs.nfsd.enable_locallocks is 0. This makes it unsafe to change the setting of vfs.nfsd.enable_locallocks when nfsd threads are active. This patch forces all nfsd threads to be blocked when the value of vfs.nfsd.enable_locallocks is changed, so that it is done safely. (cherry picked from commit 67284d32e5e0d5f015d73eeac4342974277263f5) --- sys/fs/nfsserver/nfs_nfsdport.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index f4679309657b..3769fdc4ff73 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -70,6 +70,7 @@ extern int nfsrv_maxpnfsmirror; extern uint32_t nfs_srvmaxio; extern int nfs_bufpackets; extern u_long sb_max_adj; +extern struct nfsv4lock nfsv4rootfs_lock; NFSD_VNET_DECLARE(int, nfsrv_numnfsd); NFSD_VNET_DECLARE(struct nfsrv_stablefirst, nfsrv_stablefirst); @@ -179,8 +180,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_delegations, CTLFLAG_RW, &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); -SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, - &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, debuglevel, CTLFLAG_RW, &nfsd_debuglevel, 0, "Debug level for NFS server"); NFSD_VNET_DECLARE(int, nfsd_enable_stringtouid); @@ -295,6 +294,38 @@ SYSCTL_PROC(_vfs_nfsd, OID_AUTO, srvmaxio, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_srvmaxio, "IU", "Maximum I/O size in bytes"); +static int +sysctl_dolocallocks(SYSCTL_HANDLER_ARGS) +{ + int error, igotlock, newdolocallocks; + + newdolocallocks = nfsrv_dolocallocks; + error = sysctl_handle_int(oidp, &newdolocallocks, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (newdolocallocks == nfsrv_dolocallocks) + return (0); + if (jailed(curthread->td_ucred)) + return (EINVAL); + + NFSLOCKV4ROOTMUTEX(); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + + nfsrv_dolocallocks = newdolocallocks; + + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 0); + NFSUNLOCKV4ROOTMUTEX(); + return (0); +} +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, enable_locallocks, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_dolocallocks, "IU", "Enable nfsd to acquire local locks on files"); + #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 #define NHUSE_INIT 64 From nobody Tue Jul 23 00:55:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSdws5bJ6z5QYQP; Tue, 23 Jul 2024 00:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSdws51rZz42XY; Tue, 23 Jul 2024 00:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/wceRLETung1fifr5VeAfDAkSPFeLltQjx4NVrwQ9f0=; b=JMYM6dr7nbzmGJ5DfSI7LlxTeU86I+iibq0CdhwNdYY1TLuHxBJGWj5CRyaIsKyybN/PLW eD3Xvd1o3vvsXVGOJZz44a0X5G/BFTDA9zpbLCbBG2GGAKhRkUnyYlNODJZqff7oCNuFAi um2sU9G1KT6woeKXsVvvSDO/ugRZS/0ps7llczC7OpHdU7ZJ5Z8PIrGyxS/Vg5z5ZH1/6G 46yP6D7itNUSPOex66d/y+QIsSm+AVy/S8c5FK2+50kAJteiR9uV0wKp5VxbiPyxIsPnKd lqh6B5KU4b4mnKFkJF76U5IHWWL1oDjNogOYNqLsb0IFiky2qfKTa9fEOgvAJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721696125; a=rsa-sha256; cv=none; b=WSMurWAeSsQL2XPo8RKAIuOXVlDNBdldcGNKPiLV1F0pf2B5Vy1dpLV0jK2wzrHZr3abik JMpEaIPSlAwFLSCMFKzNBCAayhs9MQAKiHZeQXIDi+sIr67DaGnpHNn/WwR3qdhrPuxtlM SxVeUfYQejR6pxlbqmJ/BarOJpHi6o/GHD9/cdDa6LM8+P6iaJyN/HCL/yWH8CMFYVk/bl fUW4ekSbSMnSkUVpH3nvT02qFXqWBkAXIs1mOKJMAP4FdvJW9sqVB8Aty7tWB60g+jJ5+0 XiAifLQd27D9iQuQpbCW+Ck5lfalUe68BQAN1NQNOoscTCpTAp3ojaP4ExyfvQ== 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=1721696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/wceRLETung1fifr5VeAfDAkSPFeLltQjx4NVrwQ9f0=; b=w8ITWNL7HXQYP58ouImhej5zrIv2V4Y9nmyB5iig6dPZUiLkXdOLkbyl/LDHIPmqemDQqH zkThShDkYz0Ra3yJFWJJnMKBGXDA55c/8lCmYKgq3LT+c3cyLsH4PVkYKqQWEoNYZ6HkCZ xltruzfQMsi4qa9ZEkRJdu4zx5iyo7l7zQshGzvXZXIkIaphINZJYsIsEM2ueUosJixhvg 4B5qDmh/v3WPnIBcCSxN7X9NdFdTs8YhgrpI20J7GGmz31U41vUdbHeFgx7rJhg6eioyah SWb+PV/WxcPDoym8Y/neTBVkdjz1rO+RVRqqJZOmm+q/xLDAvbXivQGFfhl4Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSdws4QbZz16Cd; Tue, 23 Jul 2024 00:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N0tP0P050588; Tue, 23 Jul 2024 00:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N0tP28050585; Tue, 23 Jul 2024 00:55:25 GMT (envelope-from git) Date: Tue, 23 Jul 2024 00:55:25 GMT Message-Id: <202407230055.46N0tP28050585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f84ac01e1829 - stable/13 - nfsd: Make modifying vfs.nfsd.enable_locallocks safe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f84ac01e1829a6f3e48af076041120692c00ccb0 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f84ac01e1829a6f3e48af076041120692c00ccb0 commit f84ac01e1829a6f3e48af076041120692c00ccb0 Author: Rick Macklem AuthorDate: 2024-06-23 22:47:22 +0000 Commit: Rick Macklem CommitDate: 2024-07-23 00:35:02 +0000 nfsd: Make modifying vfs.nfsd.enable_locallocks safe Commit dfaeeacc2cc2 modified clientID handling so that it could be done with only a mutex lock held when vfs.nfsd.enable_locallocks is 0. This makes it unsafe to change the setting of vfs.nfsd.enable_locallocks when nfsd threads are active. This patch forces all nfsd threads to be blocked when the value of vfs.nfsd.enable_locallocks is changed, so that it is done safely. (cherry picked from commit 67284d32e5e0d5f015d73eeac4342974277263f5) --- sys/fs/nfsserver/nfs_nfsdport.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 46be3e051056..f412451e4e35 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -70,6 +70,7 @@ extern int nfsrv_maxpnfsmirror; extern uint32_t nfs_srvmaxio; extern int nfs_bufpackets; extern u_long sb_max_adj; +extern struct nfsv4lock nfsv4rootfs_lock; NFSD_VNET_DECLARE(int, nfsrv_numnfsd); NFSD_VNET_DECLARE(struct nfsrv_stablefirst, nfsrv_stablefirst); @@ -177,8 +178,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_delegations, CTLFLAG_RW, &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); -SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, - &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, debuglevel, CTLFLAG_RW, &nfsd_debuglevel, 0, "Debug level for NFS server"); NFSD_VNET_DECLARE(int, nfsd_enable_stringtouid); @@ -293,6 +292,38 @@ SYSCTL_PROC(_vfs_nfsd, OID_AUTO, srvmaxio, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_srvmaxio, "IU", "Maximum I/O size in bytes"); +static int +sysctl_dolocallocks(SYSCTL_HANDLER_ARGS) +{ + int error, igotlock, newdolocallocks; + + newdolocallocks = nfsrv_dolocallocks; + error = sysctl_handle_int(oidp, &newdolocallocks, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (newdolocallocks == nfsrv_dolocallocks) + return (0); + if (jailed(curthread->td_ucred)) + return (EINVAL); + + NFSLOCKV4ROOTMUTEX(); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + + nfsrv_dolocallocks = newdolocallocks; + + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 0); + NFSUNLOCKV4ROOTMUTEX(); + return (0); +} +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, enable_locallocks, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_dolocallocks, "IU", "Enable nfsd to acquire local locks on files"); + #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 #define NHUSE_INIT 64 From nobody Tue Jul 23 13:19:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRQ5p8fz5Rx2x; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRQ5DJ9z4Hn7; Tue, 23 Jul 2024 13:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740770; h=from:from:reply-to:subject:subject: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/+TZaJU35mPQRzh1iPZ5VX43sYad8+f3tlzgV4jFTQ=; b=kAoKrx9xl/ta8RVD5vDuWAOT/n0oYQU++nHYK4FR3WgqAdT5YJDVpp925/HR4oLr6v5XNT aaj5/pU95k/SqjuYVyk+kokTy7uT1IjVNHzI0IhTiK5uF5VKy3Bc/osG1BDY4Z/UPlkDC3 9WhkQuKBlaQmV3vachgKAoSOa52STlI4MbsHqX55WAjPO6F6Qnx4JOJT81b6PxTGZcg/MZ 0R2/S8GCmv5jPbxUrB5jxRTQ2hNZOzSrVjs+2U/Ru/NX98OYIfOyjb25rgW2+LdCZFcWsY 2RPNaM9/bA9gYaTneY5G8+3neJdYTVsBYJfgO+6RDsrauIKAym5ARjsrYhyQFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740770; a=rsa-sha256; cv=none; b=VtdMTXkqLidpO5tSS2jWZoSRuEqsqAOxeSAJkOKBKGtJ1tOR0ndJKy54NubjXEXp3b0SSB gdaf8Eh2JQ0sc2YkNe/9YgR85XbDxTPp33D+uQEIi/5uJbX4ofDeFRIPxiYIrD8IJUVzGC 9jE/3q8EjWhPWQDnvvBulUxl2f/koHFBbj/W2epRvCmReTMQSrU9ApJiMCxmbgDbXG/5xx 27itMhr26xIFpiIYTXys76S42V1cY05VrGweH9FxHmNUwO8TLGd2qy7Qk2zlLbhXJZynQY LEnaQV45TStcDTtEqxMb9tnlE3VoEqPwqoLj39g/6LBzTWCxnEYP45va3Sq13Q== 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=1721740770; h=from:from:reply-to:subject:subject: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/+TZaJU35mPQRzh1iPZ5VX43sYad8+f3tlzgV4jFTQ=; b=H7siixc6RoMAyYpLBoW2BUwvQy0WnMHaTahwiGTb4dE1v72JqmlFvidah9+uX3a0sUnXcb Yw+VsbJqECIYyJqCHyi2GmburvFt5UEjV38GiAiO0UOKEfDtRZHSrtW773XYa+NIQ9dga4 HE8IJxaVJnlxwD19ctrgDaAxi3GLKcxvlJOE9p079uDnlxkrrWm/fJAZxaHXhJ+7hXy/xC CK6QZhdA11rtJh0C77KDXcPdrVuw8sumEwo0HGYsNEeRPqQJYNAxI21Ncd4amhEEJjTfot jjBgBdTP0+NhzbWHKWudj6GenWsljzIZjAvpps3Baj2gvFcD7xcM7c9+7SGPpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRQ4kmkzVvK; Tue, 23 Jul 2024 13:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJUu5004216; Tue, 23 Jul 2024 13:19:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJUrB004213; Tue, 23 Jul 2024 13:19:30 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:30 GMT Message-Id: <202407231319.46NDJUrB004213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 88c041e4870c - stable/14 - socket: Pass capsicum rights down to socket option handlers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88c041e4870c278fe7c326e8ac0880cb76586c29 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=88c041e4870c278fe7c326e8ac0880cb76586c29 commit 88c041e4870c278fe7c326e8ac0880cb76586c29 Author: Mark Johnston AuthorDate: 2024-07-08 15:46:33 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:29 +0000 socket: Pass capsicum rights down to socket option handlers One needs the CAP_GETSOCKOPT and CAP_SETSOCKOPT rights to call getsockopt(2) and setsockopt(2) on a socket descriptor, respectively. The syscall layer checks this, but individual socket option handlers have no access to the file descriptor and so can't check for additional rights, should the want to do so. In particular, a forthcoming implementation of SO_SPLICE logically requires at least CAP_RECV and CAP_SEND rights. Modify the syscall layer to look up Capsicum rights on the descriptor and pass that along to socket option handlers; this way, the handlers can check for additional rights if they need to. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45673 (cherry picked from commit e2e771deeca7c10eaa46f380a9b64079468ec209) --- sys/kern/uipc_syscalls.c | 9 +++++++-- sys/sys/sockopt.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 6c13740d8094..6121bde4c574 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1236,6 +1236,7 @@ kern_setsockopt(struct thread *td, int s, int level, int name, const void *val, { struct socket *so; struct file *fp; + struct filecaps fcaps; struct sockopt sopt; int error; @@ -1261,8 +1262,10 @@ kern_setsockopt(struct thread *td, int s, int level, int name, const void *val, } AUDIT_ARG_FD(s); - error = getsock(td, s, &cap_setsockopt_rights, &fp); + error = getsock_cap(td, s, &cap_setsockopt_rights, &fp, + &fcaps); if (error == 0) { + sopt.sopt_rights = &fcaps.fc_rights; so = fp->f_data; error = sosetopt(so, &sopt); fdrop(fp, td); @@ -1300,6 +1303,7 @@ kern_getsockopt(struct thread *td, int s, int level, int name, void *val, { struct socket *so; struct file *fp; + struct filecaps fcaps; struct sockopt sopt; int error; @@ -1325,8 +1329,9 @@ kern_getsockopt(struct thread *td, int s, int level, int name, void *val, } AUDIT_ARG_FD(s); - error = getsock(td, s, &cap_getsockopt_rights, &fp); + error = getsock_cap(td, s, &cap_getsockopt_rights, &fp, &fcaps); if (error == 0) { + sopt.sopt_rights = &fcaps.fc_rights; so = fp->f_data; error = sogetopt(so, &sopt); *valsize = sopt.sopt_valsize; diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h index 11799dde4883..b139062cf492 100644 --- a/sys/sys/sockopt.h +++ b/sys/sys/sockopt.h @@ -37,6 +37,7 @@ #error "no user-serviceable parts inside" #endif +struct cap_rights; struct thread; struct socket; @@ -52,6 +53,7 @@ struct sockopt { int sopt_name; /* third arg of [gs]etsockopt */ void *sopt_val; /* fourth arg of [gs]etsockopt */ size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */ + struct cap_rights *sopt_rights; /* Capsicum rights attached to the fd */ struct thread *sopt_td; /* calling thread or null if kernel */ }; From nobody Tue Jul 23 13:19:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRR6ThNz5Rwrn; Tue, 23 Jul 2024 13:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRR63K3z4HSW; Tue, 23 Jul 2024 13:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPgLLaQ7wFaHEWTLl73zRD5dK+k6NGGQxxqhRXqTdtg=; b=n85lkuJZsDBa0adqpFqdrvZSZ1ulSRKAKRfGx0whweinFPqkSAMPYLVl9IAKaJToNkmkJY W37d67ZxtUTk8J2seT1ez/G+uWrUaTGJiWaSCRPwdp5M9fKhjL2QOii98trUHNvQ2YT3tP hgpbtyVr9CZQd35/4qDOsYCy3jmbO0X2UO+DygDW/x9hHI97lFWSZaQXQJIL0v/PhF2LQF BILvKNINkT8IFXqXgbakg5mLfWL6B7hC0YJxBDN8U5d7zLJAVG8cwtPwn6KJhmBbdm3yp5 nRzsIy5uX3eWTYjo6Zn3/wFKtgSxpOg/zlmvZD0xLJce+5oQRBY6APF4a72qQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740771; a=rsa-sha256; cv=none; b=SFYlDFQ7mS/mEMGGqKB5Fvuiait9rhwZyY7wDVcHEtPX2Yi6CmW06JopNuhFBQzmIg2foP SiaGzHQ1varjC5XlwKCf8HhaRl22p5dUFPkRmMpUY9IAYB6TzJzlOX8YHJIeig0zTEr3rM kOLb+CBm1c4IBl0S2ah8lAF4I5wLYor7vXT5/9q8Hl04iY1zRjnlYzHVKdctU9Gl9LS3if m8l8DrVkKLwPOdPsiPmlC//psilyCiGDLal8QrH3EXD6e7Nce1tDUcBF+yTpPHaYBp9l1s VkGvQSrmp4rW4HiTkThLsspzySlhWWpigIH1dm9vLmKvgEeLaiZTE4joR7GC0g== 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=1721740771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPgLLaQ7wFaHEWTLl73zRD5dK+k6NGGQxxqhRXqTdtg=; b=reE9IznP43dJCb8x9AkChFJt6/1iqxdtsz1erD49L02jU2f1DWvY9VfM4zVn2Auhnge2ZF YYigcpIf2nlkxtM3ZCA0WY5sK0U8aJuj+sEU+BiHtvCQ2V/Hc/JXLhVK9H8vHRYk1hlM+k WcJ5Qk/AhIYrFjXRro46y0XhWDwJKwO1W+HvkfvzgJpb84HP+vt3GCSfctd6bpXzcV8NQZ FkLON6jJYqKONO4GZN5Ci7Mv5f+6thdIAS1b024ORMHlBWQHIKnxJUm/9RH/RAz4RY9k+m X5RlTddBcvNo7cLSIryNA5LQ0PelvzqysUOEE9lPEwDZvFV7WlbOwo4qqViNIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRR5ggbzVvL; Tue, 23 Jul 2024 13:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJVMl004272; Tue, 23 Jul 2024 13:19:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJVlw004269; Tue, 23 Jul 2024 13:19:31 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:31 GMT Message-Id: <202407231319.46NDJVlw004269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4d8e3fafda19 - stable/14 - ndp: Fix libxo formatting for the prefix expiry string List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d8e3fafda19cede6b0bd8f4f3497a83e0c0287b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4d8e3fafda19cede6b0bd8f4f3497a83e0c0287b commit 4d8e3fafda19cede6b0bd8f4f3497a83e0c0287b Author: Mark Johnston AuthorDate: 2024-07-15 20:06:24 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:29 +0000 ndp: Fix libxo formatting for the prefix expiry string Fixes: e1c7783e220b ("ndp(8): add structured output formatting via libxo") MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Bell Tower Integration (cherry picked from commit b3877767883e9b26fbcce47c015ba3eab323bf1b) --- usr.sbin/ndp/ndp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index b7bc25dd7aa4..4f7c32f0fdf7 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1329,7 +1329,7 @@ plist(void) if (p->expire == 0) xo_emit(", expire=Never{en:permanent/true}"); else if (p->expire >= now.tv_sec) - xo_emit(", expire=%s{e:expires_sec/%d}", + xo_emit(", expire={:expires/%s}{e:expires_sec/%d}", sec2str(expire_in), expire_in); else xo_emit(", expired{e:expires_sec/%d}", expire_in); From nobody Tue Jul 23 13:19:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRT1xxNz5Rwmg; Tue, 23 Jul 2024 13:19:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRS6h3bz4HSh; Tue, 23 Jul 2024 13:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ia16fY8bdz1qXdq/Ii2d7nyJrCQ6evZdXMHIl9l3yxg=; b=oAI+G9/pQPAQQUKqcJQd3CWv182b/CI5Z9OpzGDq92ULd0valEVEGv8QEFHJZKM/rRK0Y4 PzWg2FpJzxAooKdjJuU4iqay59sMgaG2zNvzkfP6WjRh8b5AEyrUYvsZT0rlC7ZuiNZJlR euf7iuTRetDnmyKsy+POf6v9wmgYUrW8BWKp/rViSb2vT6KrEvVhxCkLsoh3xp1c/0p3pF oHhhRM4HP7bXwjeu2Ti1GdyX2fxf5lgRNX2IK7KvsETmpv8Sa0Ar+rtgqKTGX9UYKOyDbn W204XbTuRsqc3ACvJoCCaNcQbMurs55gMXrWqb2baXG59sQN/eYZKNkZBpXaUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740772; a=rsa-sha256; cv=none; b=EczwTdCmFuIuAkgEew0W1mwcmIbGVPsrCQRL34jJbYmmSPx3A+dkOz7XyaFv4Mk6+4PkSp ChF6SSZmQ0CUtZgBi7tZ1H/FM0+xoDisYqEU8Dqa+3Jq5rLhaLYJ1Tf2ZLucm+g/E4QJwZ z16UMg23XvkEpaDq0IvDpTt8ZAzk6dyI8DNiwGjfRIB0PCNMZanvhyWGtXDg+au/H8ofyk ITMM1FcRVKj+Xmhnvc5WNVI/P+a0wCRDRdPKV3WfAEKHuTDBdaGIzG7VD3FL8JqbMe8qs8 rLO08iyUU6GkdMZaY3ExhoH12+rp2Cut0XiFvYzQ7ixM0hdhAqymELaQVgrMFw== 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=1721740772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ia16fY8bdz1qXdq/Ii2d7nyJrCQ6evZdXMHIl9l3yxg=; b=ROgeusmPVdmMAgGqeXK/qtwoUCw27K+jf/zcrcO3YH8zC5h2F7qnIhXozu0sMIGOu5j6nF VNwYrCG5+otEnwKmnD1vacAsLO4MuoJnQQyFHt5p0pkd5aN3j+PCNpgCd0F37JVwTDEiLa jCSVrZ0fGw7uPPPu2e/nqvH6/VdACh4auTTr7XZmTBGFoN3djii43xfPA/JtVz9aJ4IGNe UTUX5Qn7VpMduur2fljTmcg3SFuGLU4DbadHICG/x20DPVFRhEWyTRNFSi4jtnegi4rHuQ SrPvN3Lhl4ZEFrKiv3AVMw/eWG8xnPqMWh9ZgLHutWZ6e4YLtDnWl00ijXND6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRS6HJLzVT2; Tue, 23 Jul 2024 13:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJW6f004324; Tue, 23 Jul 2024 13:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJWEf004321; Tue, 23 Jul 2024 13:19:32 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:32 GMT Message-Id: <202407231319.46NDJWEf004321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 97d88163d468 - stable/14 - ktls: Remove the socket parameter to ktls_ocf_try() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 97d88163d4685b57b3f50e7788691454256c5182 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97d88163d4685b57b3f50e7788691454256c5182 commit 97d88163d4685b57b3f50e7788691454256c5182 Author: Mark Johnston AuthorDate: 2024-07-08 15:52:07 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:30 +0000 ktls: Remove the socket parameter to ktls_ocf_try() The socket is unused, and not passing it means that there's less to think about when considering how KTLS is synchronized with the rest of the socket code. No functional change intended. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45675 (cherry picked from commit 5dfca6c375d530908eedb7f103681c2493cf0ca3) --- sys/kern/uipc_ktls.c | 10 +++++----- sys/opencrypto/ktls.h | 2 +- sys/opencrypto/ktls_ocf.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 91dfb8516308..b4b169c4daf2 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1076,11 +1076,11 @@ ktls_use_sw(struct ktls_session *tls) } static int -ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) +ktls_try_sw(struct ktls_session *tls, int direction) { int error; - error = ktls_ocf_try(so, tls, direction); + error = ktls_ocf_try(tls, direction); if (error) return (error); ktls_use_sw(tls); @@ -1237,7 +1237,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) if (error) return (error); - error = ktls_ocf_try(so, tls, KTLS_RX); + error = ktls_ocf_try(tls, KTLS_RX); if (error) { ktls_free(tls); return (error); @@ -1318,7 +1318,7 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) #endif error = ktls_try_ifnet(so, tls, KTLS_TX, false); if (error) - error = ktls_try_sw(so, tls, KTLS_TX); + error = ktls_try_sw(tls, KTLS_TX); if (error) { ktls_free(tls); @@ -1503,7 +1503,7 @@ ktls_set_tx_mode(struct socket *so, int mode) if (mode == TCP_TLS_MODE_IFNET) error = ktls_try_ifnet(so, tls_new, KTLS_TX, true); else - error = ktls_try_sw(so, tls_new, KTLS_TX); + error = ktls_try_sw(tls_new, KTLS_TX); if (error) { counter_u64_add(ktls_switch_failed, 1); ktls_free(tls_new); diff --git a/sys/opencrypto/ktls.h b/sys/opencrypto/ktls.h index 0fe02b7f50f5..efba25e17013 100644 --- a/sys/opencrypto/ktls.h +++ b/sys/opencrypto/ktls.h @@ -48,7 +48,7 @@ struct ktls_ocf_encrypt_state { void ktls_encrypt_cb(struct ktls_ocf_encrypt_state *state, int error); void ktls_ocf_free(struct ktls_session *tls); -int ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction); +int ktls_ocf_try(struct ktls_session *tls, int direction); int ktls_ocf_encrypt(struct ktls_ocf_encrypt_state *state, struct ktls_session *tls, struct mbuf *m, struct iovec *outiov, int outiovcnt); diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 0b9a07a9c83e..f61fb7f73b5d 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -983,7 +983,7 @@ ktls_ocf_free(struct ktls_session *tls) } int -ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) +ktls_ocf_try(struct ktls_session *tls, int direction) { struct crypto_session_params csp, mac_csp, recrypt_csp; struct ktls_ocf_session *os; From nobody Tue Jul 23 13:19:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRV2Phtz5Rx09; Tue, 23 Jul 2024 13:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRV0cd6z4Hxq; Tue, 23 Jul 2024 13:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1UNWTWH/tinUasOW/tx3sav2rne2qteBkScdp1J1Q0I=; b=AO69R2b4Ps/wlO7yxZL9LGOPkIUKoKLieyi87MSrY3dzgANeW5s/nbnBSWU8E3vx0odSRj sJbfcZPC/NDUZe8Euju2n3TNqbSsspPf/pH0zveHqVJvSPUBRiRDwZ2Ie6NX6bBU7DypQ5 zx4X2pWRjeMMeHewkPCKm71qUrVlJEhYDJxnTORMQpdk61NqVgZA/XrPM6MK4ZiFBAYsJ/ PrZ3KTsHr9IcmTL9W6bgVZAwoDl39AoIbMVYRvFfQk0Ryi5xLTieefEnLU9LIYM1CrFOrT wh2lX9p8lXwuF6nC3uatxj404jc1hOBNnjwlLlyN3HpW+HuEMwzkqI7IvP/rdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740774; a=rsa-sha256; cv=none; b=VTYHGXUc6tqHYi3tB1t/QsBBD55qczUug/Fha13imNYOtyuuhiJCKZ81fwaZxfgC/PSrrq A92hb1scSYI5f4PzYLgllBzDY90k+x/w8tumtU6YX3PkhGNRU7rRkytkUjk1g4jhQptd6M PasC+YKsMyQYSGmBYYl40PY7ZKvz5+VC2oXl6yFyaSdPol5Rm+Dyl0MaZAIZGefYk5sE0/ VOPbaruAtWzdigVm4chKlKiieviF6N9FMclAhs7nPRvI/rMN5OP21GCWmXwUghswYqV2K9 TQs5LF82Q04pnzTOPP774/CMliFE6AwlTtUAJT9RabOLLtRghX2o0KDOAeQJVg== 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=1721740774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1UNWTWH/tinUasOW/tx3sav2rne2qteBkScdp1J1Q0I=; b=u8F56yqHqglsHyX62yiECMFOoJ7h2dQ0k78+Is9s7HIN/4imqc193YvtfGkMvOM/JuGN6Z f/uE64f4jpOxAF3VfM7LmyiArUYq8O3xCrcucy6BJ8SMYvNfe9KO+KDMG37lRS8l9CXoIa 6vcRdavahkyhXONBm3Gdg6acRZZKUvnrn5bVhw3U0+PS3o5WHXFGj+ip2RfY8w3ecEyurS fBo3xf7b0QANF1mytAcS1cxwPg6WA09W1sDsOpeV6yNSau7fDYA+Vev3k2VNbTnICeypMb QFsCjtK+5BUkoUOy26kLYpkKOy++SD7yrxttwsW6nqnF9tEQypsctqeq9Rrikg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRV0CddzTcN; Tue, 23 Jul 2024 13:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJX4K004382; Tue, 23 Jul 2024 13:19:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJXfu004379; Tue, 23 Jul 2024 13:19:33 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:33 GMT Message-Id: <202407231319.46NDJXfu004379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b14a49128381 - stable/14 - ktls: Fix races that can lead to double initialization List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b14a491283816864e4b8ec88744efbfd7d4e2bc7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b14a491283816864e4b8ec88744efbfd7d4e2bc7 commit b14a491283816864e4b8ec88744efbfd7d4e2bc7 Author: Mark Johnston AuthorDate: 2024-07-08 15:49:29 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:30 +0000 ktls: Fix races that can lead to double initialization ktls_enable_rx() and ktls_enable_tx() have checks to return EALREADY if the socket already has KTLS enabled. However, these are done without any locks held and nothing blocks concurrent attempts to set the socket option. I believe the worst outcome of the race is leaked memory. Fix the problem by rechecking under the sockbuf lock. While here, unify the locking protocol for sb_tls_info: require both the sockbuf and socket I/O locks in order to enable KTLS. This means that either lock is sufficient for checking whether KTLS is enabled in a given sockbuf, which simplifies some refactoring further down the road. Note that the SOLISTENING() check can go away because SOCK_IO_RECV_LOCK() atomically locks the socket buffer and checks whether the socket is a listening socket. This changes the returned errno value, so update a test which checks it. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45674 (cherry picked from commit 163cdf6a32b9a0f84226a70101d143c10707336f) --- sys/kern/uipc_ktls.c | 23 +++++++++++++++++++++-- sys/sys/sockbuf.h | 3 ++- tests/sys/kern/ktls_test.c | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index b4b169c4daf2..294a196db60d 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1243,12 +1243,23 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) return (error); } + /* + * Serialize with soreceive_generic() and make sure that we're not + * operating on a listening socket. + */ + error = SOCK_IO_RECV_LOCK(so, SBL_WAIT); + if (error) { + ktls_free(tls); + return (error); + } + /* Mark the socket as using TLS offload. */ SOCK_RECVBUF_LOCK(so); - if (SOLISTENING(so)) { + if (__predict_false(so->so_rcv.sb_tls_info != NULL)) { SOCK_RECVBUF_UNLOCK(so); + SOCK_IO_RECV_UNLOCK(so); ktls_free(tls); - return (EINVAL); + return (EALREADY); } so->so_rcv.sb_tls_seqno = be64dec(en->rec_seq); so->so_rcv.sb_tls_info = tls; @@ -1258,6 +1269,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) sb_mark_notready(&so->so_rcv); ktls_check_rx(&so->so_rcv); SOCK_RECVBUF_UNLOCK(so); + SOCK_IO_RECV_UNLOCK(so); /* Prefer TOE -> ifnet TLS -> software TLS. */ #ifdef TCP_OFFLOAD @@ -1343,6 +1355,13 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) inp = so->so_pcb; INP_WLOCK(inp); SOCK_SENDBUF_LOCK(so); + if (__predict_false(so->so_snd.sb_tls_info != NULL)) { + SOCK_SENDBUF_UNLOCK(so); + INP_WUNLOCK(inp); + SOCK_IO_SEND_UNLOCK(so); + ktls_free(tls); + return (EALREADY); + } so->so_snd.sb_tls_seqno = be64dec(en->rec_seq); so->so_snd.sb_tls_info = tls; if (tls->mode != TCP_TLS_MODE_SW) { diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 14107f5b2a10..a6ec72975252 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -130,7 +130,8 @@ struct sockbuf { struct mbuf *sb_mtls; /* TLS mbuf chain */ struct mbuf *sb_mtlstail; /* last mbuf in TLS chain */ uint64_t sb_tls_seqno; /* TLS seqno */ - struct ktls_session *sb_tls_info; /* TLS state */ + /* TLS state, locked by sockbuf and sock I/O mutexes. */ + struct ktls_session *sb_tls_info; }; /* * PF_UNIX/SOCK_DGRAM diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index f57ae74112a2..72497196b945 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -2812,7 +2812,7 @@ ATF_TC_BODY(ktls_listening_socket, tc) TLS_MINOR_VER_THREE, (uint64_t)random(), &en); ATF_REQUIRE_ERRNO(ENOTCONN, setsockopt(s, IPPROTO_TCP, TCP_TXTLS_ENABLE, &en, sizeof(en)) != 0); - ATF_REQUIRE_ERRNO(EINVAL, + ATF_REQUIRE_ERRNO(ENOTCONN, setsockopt(s, IPPROTO_TCP, TCP_RXTLS_ENABLE, &en, sizeof(en)) != 0); ATF_REQUIRE(close(s) == 0); } From nobody Tue Jul 23 13:19:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRW3J22z5Rwrs; Tue, 23 Jul 2024 13:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRW2DK7z4HyD; Tue, 23 Jul 2024 13:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/OjInUEY2RocD7YTqE6sh0mLepnIBWukR11EPRdcOw=; b=fNITH3/y2tA6/E63719ohnB6ccmrdZq9JXugXyelKFeY9gTLE56a+8ayC6W5cZ0KURhTOq 5Nn93PAr0HGw4rb1ApXzC0l00XU6OKWj5hrPMKnCR0wXTrkBxt61M0O7SQfUkifkXemdG1 0DA8XG7ZV1RzKFCDZzbsTQWI0QWX3xZfkobnXqEhM4sPAatxbwYLFmlhKFNgassL0H2y2p 91x7Fa0XKR8sTz+kLLIQhLtzqIiKUvIssWP1SbkvjAVe1wzcPiaka3tzwqure9YJ0B6fjS bVwzndstEi+wUsSfcikg+VzKMwkyKXJl7bL+lrDypaIeDH75FP9VVhPvm+G8oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740775; a=rsa-sha256; cv=none; b=KALZsIuHZ7Av5Ij3xwtAYuc6raIxuIK6nEVg2EoETMNOop4yDs+Wz1H8qyfs8wi7dyZZW+ JqJ8j/4G4bH9KSpHqcDJoroHqDborqsrrNvjDUpNoDNt+tQq6Eu086sI391qTAoFyguUWg 9uvsTuc8xEQrAQAzokeQta0qgri82u7tqgpY+736GE2DHQdxDf1SOi5QvGkums+7HIiR8M Vb688aOISId8n7R5cLcy9djaskjtNKFSB6e+uYSGN1jVPSbfpg6suh7jg02AwuitFNq4JX U/h6hZ/vWRRQOJJ4+2O0HjZMmtC8wX9kfIJpTyjNjGmQlfXGh6VL7P6XzQQK9w== 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=1721740775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/OjInUEY2RocD7YTqE6sh0mLepnIBWukR11EPRdcOw=; b=MlL8EEkNZNLKrR1j1urLD016bFanZHIlFVmb6wu4zcKt+i+9JPWvJ1OLS0F7kuLkSyybc9 6w62EfMQy/L4n6tOB5ZcVb9dubCoGdMAlu/tEeK9uO5OiCBqR3Myw4GR8WosSextKGa8xv f9M71zer3dV9NAMr/IFa7UWE4MLebGYOmsf3T3CUDP0Sj07HwYUiSqQRmtnqzqA7vjY9Jj nfprfvZ+ZSm8kLWbejbAvXcu+sb8whM7EwDFe8l7q2z6zDU23YaDuZcqkmKsQMs4sVOHYc fpM4h0FKLl4YZ0fuCgWpEQZmUEDhCAU53R88DC5bc4sQNpZ7uJKPbMPcq4jC0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRW1FG4zTcP; Tue, 23 Jul 2024 13:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJZ8K004436; Tue, 23 Jul 2024 13:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJZMG004433; Tue, 23 Jul 2024 13:19:35 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:35 GMT Message-Id: <202407231319.46NDJZMG004433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 030cbcc4c231 - stable/14 - if_urndis: Organize buffer layouts more naturally List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 030cbcc4c231be94b5ded668930e5be17cb9d3d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=030cbcc4c231be94b5ded668930e5be17cb9d3d5 commit 030cbcc4c231be94b5ded668930e5be17cb9d3d5 Author: Mark Johnston AuthorDate: 2024-07-09 14:10:45 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:37 +0000 if_urndis: Organize buffer layouts more naturally - Group the request header and I/O buffer in one structure, rather than assuming that both request structures have the same size. - Pass a pointer to the whole structure to urndis_ctrl_query() and urndis_ctrl_set() rather than just the header. Otherwise, on CHERI platforms, these functions violate subobject bounds since they modify the buffer following the header. While here, there is no apparent reason for the request structure used in urndis_attach() to be allocated statically. Change it so that it's allocated on the stack. No functional change intended. Reviewed by: jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D45866 (cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e) --- sys/dev/usb/net/if_urndis.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/usb/net/if_urndis.c b/sys/dev/usb/net/if_urndis.c index 824609aa869f..0a7cb3fed953 100644 --- a/sys/dev/usb/net/if_urndis.c +++ b/sys/dev/usb/net/if_urndis.c @@ -214,15 +214,15 @@ urndis_attach_post(struct usb_ether *ue) static int urndis_attach(device_t dev) { - static struct { - union { + union { + struct { struct rndis_query_req query; + uint8_t addr[ETHER_ADDR_LEN]; + } eaddr; + struct { struct rndis_set_req set; - } hdr; - union { - uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t filter; - } ibuf; + } filter; } msg; struct urndis_softc *sc = device_get_softc(dev); struct usb_ether *ue = &sc->sc_ue; @@ -278,10 +278,10 @@ urndis_attach(device_t dev) } /* Determine MAC address */ - memset(msg.ibuf.eaddr, 0, sizeof(msg.ibuf.eaddr)); + memset(msg.eaddr.addr, 0, sizeof(msg.eaddr.addr)); URNDIS_LOCK(sc); error = urndis_ctrl_query(sc, OID_802_3_PERMANENT_ADDRESS, - &msg.hdr.query, sizeof(msg.hdr.query) + sizeof(msg.ibuf.eaddr), + (struct rndis_query_req *)&msg.eaddr, sizeof(msg.eaddr), &buf, &bufsz); URNDIS_UNLOCK(sc); if (error != (int)RNDIS_STATUS_SUCCESS) { @@ -297,10 +297,10 @@ urndis_attach(device_t dev) /* Initialize packet filter */ sc->sc_filter = NDIS_PACKET_TYPE_BROADCAST | NDIS_PACKET_TYPE_ALL_MULTICAST; - msg.ibuf.filter = htole32(sc->sc_filter); + msg.filter.filter = htole32(sc->sc_filter); URNDIS_LOCK(sc); error = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, - &msg.hdr.set, sizeof(msg.hdr.set) + sizeof(msg.ibuf.filter)); + (struct rndis_set_req *)&msg.filter, sizeof(msg.filter)); URNDIS_UNLOCK(sc); if (error != (int)RNDIS_STATUS_SUCCESS) { device_printf(dev, "Unable to set data filters\n"); @@ -641,7 +641,7 @@ urndis_ctrl_handle_reset(struct urndis_softc *sc, msg_filter.filter = htole32(sc->sc_filter); rval = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, - &msg_filter.hdr, sizeof(msg_filter)); + (struct rndis_set_req *)&msg_filter, sizeof(msg_filter)); if (rval != RNDIS_STATUS_SUCCESS) { DPRINTF("unable to reset data filters\n"); From nobody Tue Jul 23 13:19:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRX3bXzz5Rx7K; Tue, 23 Jul 2024 13:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRX2hnXz4HfV; Tue, 23 Jul 2024 13:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7/j+s2uQzJ/rhMYfFJ6Th2hX2/wMH6IqcZ2QrcL3ss=; b=efXoFm86G/OlGKM3hRDHClRCjinQ6XOPFCMVoxlFPMIaV7dpYx2+DPczvoZCWzbXw53ub2 pAmGiMiHRyHqUWKNEUtN2TvjMGV2qWORWvyJhW9PWzKliWlhhg/gtCEFpehZe17E12DPlp 8ncSlDHas+Rzs4gc19qpWt5jg8iYYTX58YN7+IPKsCfjtO0FVtKlQJHIMpyS/XZTZayLUm sFFflGnVYsnJD0PFYxlr0eWmUc4Wby+y3gZbGaVpJntJ4KYUJTiyTfMpldo1DJXnomHbCB SxW0eZif6pV31WHdVDu+huXqFYEM0x0JmAjbk+8MHcNGbfXd5J7j6g4lqMud0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740776; a=rsa-sha256; cv=none; b=nR6P60m/08d/JxnBeyOiVTREwttUUq6itTIcQBVWD4k3DOIgqIihRFwQ3n8W0IDYlWfdsX vKh2FjLBVUXCknZ2TBbDTN8O0Hq2ujA8URg4/z/uneXKQ7BUJqbVC24M4ceT6SQTSe/V7u 94Yf4kZsEQiXKs5JKurkCO9gkLBVx+h0qirlc37jH3dwaaCuhSj11bgPT49k09FhBRpjPS oT87sivKU6MqA5pJFwp4dAHyDdUcamfFnT33OGvZoSvX9hWjcVl3SzOPuoEzf2jwX9v9mJ tIpWvFgAjKbs0gJEZ5w7DGgiDFeHP02TbIrD7RQ94yXzZllyRpxszl8IgIfOSw== 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=1721740776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7/j+s2uQzJ/rhMYfFJ6Th2hX2/wMH6IqcZ2QrcL3ss=; b=Pu64Bb+kLmmDrishkJQSyIGZJU5cDJU15Eod6xrujhbm9E26udCEh3NeCcXy4YrJn0dQ6l 8342h63gcRKH/9J684IeUVXtUQssqErqjWWz+5rC9gefFzZZIhTrX5oZdsi1CCbhUBbwEb 7lpjyOiHUcq7pGZCRp1GK3LNvhacg+z5fntZEe0wSAvh867ZI+Jc/0oojJZNU7TjWYlKiI Nyz7g8xK27AadyFfe27DZ5C69SDMMZk85dmMy4NIFVO/rtAcaUeXAAjt/InIvIow34dkan pPXwcAW3WjKVJ8PUWwoLK8DCUnJ8Nxa6Qq1oMjnkFfNUi5gFQCGJrAyp0KFcFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRX20SJzW3Z; Tue, 23 Jul 2024 13:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJag6004478; Tue, 23 Jul 2024 13:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJaob004475; Tue, 23 Jul 2024 13:19:36 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:36 GMT Message-Id: <202407231319.46NDJaob004475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f5fabf3dcfb6 - stable/14 - socket: Simplify synchronization in soreceive_stream() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f5fabf3dcfb67434d13890b9143a361478e731e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f5fabf3dcfb67434d13890b9143a361478e731e2 commit f5fabf3dcfb67434d13890b9143a361478e731e2 Author: Mark Johnston AuthorDate: 2024-07-09 14:33:53 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:53 +0000 socket: Simplify synchronization in soreceive_stream() Now that the socket recv I/O lock is required in order to enable receive-side KTLS, we can move a check from out of the socket buffer lock, which in turn will simplify some further refactoring. Add a __predict_false annotation while here since we already perform a lockless check before acquiring any locks. Reviewed by: gallatin, jhb MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45922 (cherry picked from commit 30f30ccae71ce6b3bbe7b2719a3d588cb46f97ba) --- sys/kern/uipc_socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 32a6ff14bb43..479184a87a5e 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2560,17 +2560,15 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); - SOCKBUF_LOCK(sb); - #ifdef KERN_TLS - if (sb->sb_tls_info != NULL) { - SOCKBUF_UNLOCK(sb); + if (__predict_false(sb->sb_tls_info != NULL)) { SOCK_IO_RECV_UNLOCK(so); return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); } #endif + SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ if (uio->uio_resid == 0) { error = EINVAL; From nobody Tue Jul 23 13:55:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSzDb6jfHz5S0Zs; Tue, 23 Jul 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSzDb6DCKz4Mb7; Tue, 23 Jul 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721742911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9sJcsbICJaSp7DHFks25Z45ZvsrEFnoKQrr+f2PbZc=; b=uDdvXbABl6Ok8ub5ndyyqlnmP6LoSxbXZP5E37+mZr0ZlcpDDIhouSYeV4xZTkeLQEsz/c OR00sWZR/BRnPbjT3DySnJcb2N/XK0M5uL/EHjS4sWpOD4/AaWhcNRvArGNts9EJpRbGex hOwiO4zz9TwX3un5nBoHtqL0nTtNlmrokKF4z+dlTmBNdr+sl6HljiaI85GkXDJP5034JM aOHglnw4pTsC/D5MSIybQZ1uCwIIABRvdu4AWqKW1j9ksh+zPlF+5NXmj+6yYzzzeKmpux IJcgJUotr5g5zje4EI+qEuKCaJKgyHZiubSiOmiERBo2ocIJx13J8DRziXPhfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721742911; a=rsa-sha256; cv=none; b=s2Rsv1JEODrfyS5IEwGPfzbLFKX2n6EHYwHdAgdO5eLmp8v/rvYnE+O0g2k6ov2Ge3vSfG /mBtiKBm0rzA5vw5nSGT511OTjfQ++yVsSHXEGvNcP1UyLIfMqMBteGZaOxf9ISV64CCBd uQigplxFuzFXWp5QQ59nk3AUxF/8Z70iV3jgt+dIxQ3cMXHEzt2e2ZmWUzruzq5z/PVQ4+ 3OuLrcquFnmblnafASK2jFUeOErPJn7AzlmfiqE/7Se14QivLHuOOlXA2JnyasNSP4z5dV pdjeQqkPGBiqsajLZrCREzoc1wVuPDFJPOcmLQ+RIZhTGSJ38RqzkBEmOntxLg== 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=1721742911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9sJcsbICJaSp7DHFks25Z45ZvsrEFnoKQrr+f2PbZc=; b=fUgmanRremk5v+zDcnFSplfGphPouRgRrlTO6JZ2m/hVJy6OvqIYKhHWEUudSNWoYct35c EGvBSHry98uf378tX93Q+EN0AGG5Y68cFv/VFaL8p3Q8+kkq3wa5NtSFjdmKehXbcQEWKw 8zuCeI+/evlAxytvgVZdwxjkq0dRbh3u9aOfhZj56s0RXmbv43O9lFtuDN9CxLFaR9Q1IP sE37e24oKAmeK3/lG12haw4+c+m/avELNVAms+dJxTNic9PPfbVoqhCpUty5gi1CgDxxtT Sl22CsnBYTAhQgSg54O9kFRDfTDZZ2TOUtlp55qNyy9ofQCWFRgNiuRCcSe1wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSzDb5QzPzX87; Tue, 23 Jul 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDtB6o070928; Tue, 23 Jul 2024 13:55:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDtBfa070925; Tue, 23 Jul 2024 13:55:11 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:55:11 GMT Message-Id: <202407231355.46NDtBfa070925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 17c6c686eda8 - stable/13 - acpi: Narrow workaround for broken interrupt settings on x86 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17c6c686eda814c52218ea6b393c8388bc6bc1b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=17c6c686eda814c52218ea6b393c8388bc6bc1b4 commit 17c6c686eda814c52218ea6b393c8388bc6bc1b4 Author: John Baldwin AuthorDate: 2024-07-15 19:13:08 +0000 Commit: John Baldwin CommitDate: 2024-07-23 13:29:17 +0000 acpi: Narrow workaround for broken interrupt settings on x86 Commit 9a7bf07ccdc1 from 2016 introduced a workaround for some broken BIOSes that specified active-lo instead of active-hi polarity for ISA IRQs for UARTs. The workaround assumed that edge-sensitive ISA IRQs on x86 should always be active-hi. However, some recent AMD systems actually use active-lo edge-sensitive ISA IRQs (and not just for UARTs, but also for the keyboard and PS/2 mouse devices) and the override causes interrupts to be dropped resulting in boot time hangs, non-working keyboards, etc. Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl post-boot) to control this quirk. It can be set to 1 to force enable the override and 0 to disable it. The log of original message mentions an Intel motherboard as the sample case, so default the tunable to 1 on systems with an Intel CPU and 0 otherwise. Special thanks to Matthias Lanter for tracking down boot time issues on recent AMD systems to mismatched interrupt polarity. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45554 (cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5) --- share/man/man4/acpi.4 | 8 +++++++- sys/dev/acpica/acpi.c | 19 +++++++++++++++++++ sys/dev/acpica/acpi_resource.c | 11 ++++------- sys/dev/acpica/acpivar.h | 12 ++++++++++++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index 53ed47fdfaee..cdad3ceeedfc 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 24, 2021 +.Dd July 15, 2024 .Dt ACPI 4 .Os .Sh NAME @@ -256,6 +256,12 @@ is a valid list of two interfaces .Qq Li FreeBSD and .Qq Li Linux . +.It Va hw.acpi.hw.acpi.override_isa_irq_polarity (x86) +Forces active-lo polarity for edge-triggered ISA interrupts. +Some older systems incorrectly specify active-lo polarity for ISA +interrupts and this override fixes those systems. +This override is enabled by default on systems with Intel CPUs, +but can be enabled or disabled by setting the tunable explicitly. .It Va hw.acpi.reset_video Enables calling the VESA reset BIOS vector on the resume path. This can fix some graphics cards that have problems such as LCD white-out diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 1706938e49a3..0dd75166c5d2 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -55,6 +55,8 @@ #if defined(__i386__) || defined(__amd64__) #include #include +#include +#include #endif #include #include @@ -301,6 +303,10 @@ int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); +#if defined(__amd64__) || defined(__i386__) +int acpi_override_isa_irq_polarity; +#endif + /* * ACPI standard UUID for Device Specific Data Package * "Device Properties UUID for _DSD" Rev. 2.0 @@ -613,6 +619,19 @@ acpi_attach(device_t dev) OID_AUTO, "handle_reboot", CTLFLAG_RW, &sc->acpi_handle_reboot, 0, "Use ACPI Reset Register to reboot"); +#if defined(__amd64__) || defined(__i386__) + /* + * Enable workaround for incorrect ISA IRQ polarity by default on + * systems with Intel CPUs. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL) + acpi_override_isa_irq_polarity = 1; + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "override_isa_irq_polarity", CTLFLAG_RDTUN, + &acpi_override_isa_irq_polarity, 0, + "Force active-hi polarity for edge-triggered ISA IRQs"); +#endif + /* * Default to 1 second before sleeping to give some machines time to * stabilize. diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index e81b5ec53f2d..ebfcc7447677 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -159,14 +159,11 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) } #if defined(__amd64__) || defined(__i386__) - /* - * XXX: Certain BIOSes have buggy AML that specify an IRQ that is - * edge-sensitive and active-lo. However, edge-sensitive IRQs - * should be active-hi. Force IRQs with an ISA IRQ value to be - * active-hi instead. - */ - if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW) + if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW && + acpi_override_isa_irq_polarity) { + device_printf(dev, "forcing active-hi polarity for IRQ %u\n", irq); pol = ACPI_ACTIVE_HIGH; + } #endif BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 362538e47bfc..2410dcb14993 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -231,6 +231,18 @@ extern int acpi_quirks; #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) +#if defined(__amd64__) || defined(__i386__) +/* + * Certain Intel BIOSes have buggy AML that specify an IRQ that is + * edge-sensitive and active-lo. Normally, edge-sensitive IRQs should + * be active-hi. If this value is non-zero, edge-sensitive ISA IRQs + * are forced to be active-hi instead. At least some AMD systems use + * active-lo edge-sensitive ISA IRQs, so this setting is only enabled + * by default on systems with Intel CPUs. + */ +extern int acpi_override_isa_irq_polarity; +#endif + /* * Plug and play information for device matching. Matching table format * is compatible with ids parameter of ACPI_ID_PROBE bus method. From nobody Tue Jul 23 13:55:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSzDc6zyBz5S0Zw; Tue, 23 Jul 2024 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSzDc6KW9z4Mk1; Tue, 23 Jul 2024 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721742912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vWGAC/0Y+Arh6Pj+5yh3AQXBFwZwqkZpJdIsUXNsxig=; b=h4cccFWfjjo2zg3QdyERdpyEaV8VgZ8NOPeKYhToFRiFyslVHpYcV+NozybuLzW6tntFmA tclmr5cINhuJ1pJc9eqVH6B6Rw2dadlN7zzHP0/k8aN8ymvE4xinfs1BaDRcBy7OM8pomt XKfddXAPqqxsBOuV/dWT+3O7uSYNGiM7vye0OBPGHlrWGn9GYN25nuiPVajbVMc6UCs2sS tl9vyznfSCPDZ6vTB9uCQ+ArJr3jhlTYyckSxwf+qfJDeNFtvxIHJuYXMlHzWeK5nrca59 W2cUiyLFpqkFzAz2VkYZOU4o7lz7fpWSB7/KJnuoig8C/9vqF7FpCH+cobbwwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721742912; a=rsa-sha256; cv=none; b=xy2Vix91UDOa73ug3idrCHNFek7zk63c2tpSk1Qy8FLlNA4UoM/Uk9E92Et/idunPjVDKX DvnBewiQ4PVoWWqcOxQ5LYqgwkBEYeiSt5Yi+kEeP9ZZohw++O5JcKrgxXHQFhIexholhG wE28a+EiZq1jpNG4gLtpOm4Y5XVSKd5VIMwTVu/Fp3Ee7uEDXMvZWToz6KvZ6HkJ0TZdPZ 8pcASXb+PaDWn4NkJzURZuPLbOEhfrsgRynYmQpCDHDEJKGDmNJIQ0z3wuasqnZG8otZ3H 9asl4PYJs1bOWN0VoW8iteykIAyxwsEbKF1/WUTs7GSiZhKHA6mob41N+426/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=1721742912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vWGAC/0Y+Arh6Pj+5yh3AQXBFwZwqkZpJdIsUXNsxig=; b=QpZhUjOkdS56Oxv1uy8ZfJRG97wNhb/36tDUfWdkVAeNW9eP4zNuAyxTvgX2DFWcwyPpUC rVt5XlNUoe4XZn6XPVHicVxZMbP4TIMkmYyLqJPGWfNa8c7CfMXYIG3NESt9LEtVek0AWT lI4i7980qWvimjvg6yZ+biNrpsfNWy2mSs0obWMBdvM+f0DvH9dIKl6Fjvh/XtR3DezdBc lSfJ8yMHAy1Hq0LSor/0OjmrcbNmtt38aNnxh4smC/Y/TD8bGs6whmp7MexWKYExLt+sl1 l7FMpWWwezjE3U1MLI91Lp8E77aTSa4NNGc8lJKbt/QMYNTiZNUf9yX5T0+5Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSzDc5wmpzXJ2; Tue, 23 Jul 2024 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDtC2P070979; Tue, 23 Jul 2024 13:55:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDtCDG070976; Tue, 23 Jul 2024 13:55:12 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:55:12 GMT Message-Id: <202407231355.46NDtCDG070976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 60e1c72afd02 - stable/13 - amd64 GENERIC: Drop hints for fdc0 and ppc0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 60e1c72afd02a2e1f09800f0fb070d1447c5aa84 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=60e1c72afd02a2e1f09800f0fb070d1447c5aa84 commit 60e1c72afd02a2e1f09800f0fb070d1447c5aa84 Author: John Baldwin AuthorDate: 2024-07-15 14:16:39 +0000 Commit: John Baldwin CommitDate: 2024-07-23 13:29:17 +0000 amd64 GENERIC: Drop hints for fdc0 and ppc0 Modern x86 systems do not ship with ISA floppy disk controllers or LPT ports. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45946 (cherry picked from commit 480cc750a2a8f92d078803f15eecb1f8a084a1ea) --- sys/amd64/conf/GENERIC.hints | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index be3f59cd1950..7c2a3f28b9ce 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -1,11 +1,3 @@ -hint.fdc.0.at="isa" -hint.fdc.0.port="0x3F0" -hint.fdc.0.irq="6" -hint.fdc.0.drq="2" -hint.fd.0.at="fdc0" -hint.fd.0.drive="0" -hint.fd.1.at="fdc0" -hint.fd.1.drive="1" hint.atkbdc.0.at="isa" hint.atkbdc.0.port="0x060" hint.atkbd.0.at="atkbdc" @@ -21,8 +13,6 @@ hint.uart.0.irq="4" hint.uart.1.at="isa" hint.uart.1.port="0x2F8" hint.uart.1.irq="3" -hint.ppc.0.at="isa" -hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Tue Jul 23 13:55:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSzDf48Z5z5S0Pq; Tue, 23 Jul 2024 13:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSzDf08b7z4MhJ; Tue, 23 Jul 2024 13:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721742914; h=from:from:reply-to:subject:subject: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/BKnFIFJlkIPWWj8V5oO1EkJK5yeubUp4CG5FlSqyg=; b=XI2D7A2rws8/JE3stSGqbxjLQkAy2uRFilJzv9Gdr99aEYnqElBKgCoqBoky7az5L33+xQ l1CxPt30nC+XchMPmQ7Feypdb7rqdeCB2Akh29bP82DldGJCbVPsUy1RB4Dw2NDBtI/pJD Tk2lN8jD5TCFa/SP80n2En7klwWkb3muKfUn62XrzpweKUCmkzhHJRuNfvJlZYSM+o45kb juvpcFZG8/zA+Nmf8SSyAJA05YFPRL6dji+UnO7gdD/Fow51ibn/QmyhGL4QMBkwavk5P+ 8yXBxKcyjcJyvMorkjDk0yYBzcNIj26eTsydzF0q94bTJPgXXQQR55Qo+LLL0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721742914; a=rsa-sha256; cv=none; b=Yx2X4Op19XFRj4z/vOSzTibj9vAldzB2ioX2EHaehqlEhDAkeNElJ7yHiuyKKThfJnqLc1 zZp/G0vae1MgWiDwz3fauhsPeI92Ss1zwgSADhIqAg/00BtJwsRvD1ULGfck6Yhv3R7nRQ eimpBXPX19DaeqrvjQQP/JsnJVYvKhAH1JnGXeVHbt8WST38TQMftZb5Czpe8zmXFqNRsy s5o+CadVFq+bH5BnBH5f38irannQ+tyx3vBD4YweCsoUvVcoG2DbzW1YBR8D9DNRHqcDi4 zdlSloBvPuZYS2ELtqYSjmO0I2agbL/9Bu2X2UeeQAUsHkm8C5/5B5UCjWW18g== 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=1721742914; h=from:from:reply-to:subject:subject: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/BKnFIFJlkIPWWj8V5oO1EkJK5yeubUp4CG5FlSqyg=; b=TOgsmM4sJ9HdlXpenZ+VR8gCmgpTOsnsK5Nxpnc5ghYzYBmT4ZvEsoLIgP8stZfASJRcbi /Pozy2zTJuDuDIC+bOeqxu4dooftOYTGdtzX2ZiIgmx7ZGt/+LUct3VJULKR5xSgkKk/kO lLf5jMuFb9XgMuZ8NqFNbiXntyypHvf5X/4R9qmpcZTRrrYJQR37Y+uMxx18jkqSbttbXd NSQa78oZ+uHxcvdQ3vVr/x/8qX38OYhV39B1DbdS4RTsgiYJyaQNYq22ByX24VbWrb08MV SNdMy+rmUmRPRxoGuyYoYeGcApP28F4X++Mf/E2VYiV8VnZGK+v5bpxXhuBdmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSzDd6ZyHzXKx; Tue, 23 Jul 2024 13:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDtDXo071033; Tue, 23 Jul 2024 13:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDtD8v071030; Tue, 23 Jul 2024 13:55:13 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:55:13 GMT Message-Id: <202407231355.46NDtD8v071030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8e9992f7e326 - stable/13 - amd64 GENERIC: Switch uart hints from "isa" to "acpi" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e9992f7e32647a4b73a215e7cb6a7c159403988 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e9992f7e32647a4b73a215e7cb6a7c159403988 commit 8e9992f7e32647a4b73a215e7cb6a7c159403988 Author: John Baldwin AuthorDate: 2024-07-15 19:14:01 +0000 Commit: John Baldwin CommitDate: 2024-07-23 13:29:17 +0000 amd64 GENERIC: Switch uart hints from "isa" to "acpi" This causes these hints to be only used to wire device unit numbers for serial ports enumerated by ACPI but will not create ISA device nodes if ACPI doesn't enumerate them. Note that IRQ hints are not used for wiring so have been removed. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45945 (cherry picked from commit 9cc06bf7aa2846c35483de567779bb8afc289f53) --- sys/amd64/conf/GENERIC.hints | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index 7c2a3f28b9ce..4f6121c7cf77 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -6,13 +6,11 @@ hint.psm.0.at="atkbdc" hint.psm.0.irq="12" hint.sc.0.at="isa" hint.sc.0.flags="0x100" -hint.uart.0.at="isa" +hint.uart.0.at="acpi" hint.uart.0.port="0x3F8" hint.uart.0.flags="0x10" -hint.uart.0.irq="4" -hint.uart.1.at="isa" +hint.uart.1.at="acpi" hint.uart.1.port="0x2F8" -hint.uart.1.irq="3" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Wed Jul 24 19:43:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTkwZ0dBhz5QJts; Wed, 24 Jul 2024 19:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTkwZ06Xcz4Vbg; Wed, 24 Jul 2024 19:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721850238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhR7WBqC1LdUZkOYA7pBVN5uDCwWOONqTO9Wyww9K20=; b=OC+sYwps6JiBbDN8QKi3zw0TWqbkMlGPlKcD3YuMNTTvvtbtw/IJATcNeKFwntyll991Jm eiqg3NqiyI9bOS7IOD/awORRhQfcZmx7wpObbshUiX231ikmWQ1Tr8xOb82EM7v0HW8ivJ kwK/aSndE3IQ2tvVid8YsbRRwoZY89so696hQc6qWCpYvd3/52hjB8h3OUJ6sLWloAFTWS FOONbrSadjL7HVDTT6tSJARtsaIZua0nr6t4x2dNPa7iqqKjmteRfEKe55zpoIDJmdmRkp Ceja8cVzD5HjJH0ikX2qUoC1yj0PwUvoSI6QK31O2rUeHWILEVqJDB2hDVxRwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721850238; a=rsa-sha256; cv=none; b=mufWW8IRWUOEcMzNsb+gmeZrXHPFAqR1l5nfVo5DVqs6qrcZKAEaNQCsQW/tRvW4obMXZ9 tGGxTBl0djCHLLg+4FNsefNKz7OF74OTDVhESXzUdGn8+dvI7QLPEe0ZHSYHK/SE4MVol8 EOrqnc9Sk1Fd30fXKSctMCP0QE8fdoUpx/YAD4IyA1MmserAaa1m57HV07z85JLRVA/ufW +onR6I6zrXr0EpMo2reu2paGHFWJNgZZOCyEhA11JHX5u/EVjCIjoU3gMYXB54DVr3Mry1 duxK3SkoI7S5TmCE4lD19GIvSk6VW2bJSbm4D/c2+Yc+1IVvp5xo6dJGCItSyA== 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=1721850238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhR7WBqC1LdUZkOYA7pBVN5uDCwWOONqTO9Wyww9K20=; b=N9Z6ccPsKIN2U20Ow/OHEI+NKpH+rTHOPbi9u40EUPwNov/cJFI50xWaeZRiJ2KztObnTe o/CjUncKTU4jHmA5xKtobP6yeTj2kRQOp6Cl9RdFNo57NqFzEgb5XhTiQPnKNKb/8nrsKo o0PsOFVVwNmaj00PlZ3rFzgn3Ksma0MCR6UTicfyjV5DtvGmuJfHjWgnFyBr4YOGsVV2ED vCEr1IVaKzjJHsGVi5jgv6RUIgXSMf3UV7zKFIEiCxgIWGvGoXoT0Z8QBPG4CR3XCU8gbb 8BB5L/T/njcsa3gH8eX46/L1a+OhVitcJX8rAUIY7y+6xiIX80wDb4nO6WwFsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTkwY6qX9zPtF; Wed, 24 Jul 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.18.1/8.18.1) with ESMTP id 46OJhvbu010944; Wed, 24 Jul 2024 19:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OJhvgR010941; Wed, 24 Jul 2024 19:43:57 GMT (envelope-from git) Date: Wed, 24 Jul 2024 19:43:57 GMT Message-Id: <202407241943.46OJhvgR010941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2c75d993783c - stable/14 - Fix llvm register allocator for native/cross build differences List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c75d993783ca4b0d1bf8dcdf424643781326e4b Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2c75d993783ca4b0d1bf8dcdf424643781326e4b commit 2c75d993783ca4b0d1bf8dcdf424643781326e4b Author: Dimitry Andric AuthorDate: 2024-07-21 20:37:27 +0000 Commit: Dimitry Andric CommitDate: 2024-07-24 19:25:53 +0000 Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f) --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..afde8d001f88 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,7 +256,12 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // FreeBSD customization: similar to the HWeight declaration below, add a + // volatile qualifier to avoid slightly different weight results on amd64 + // and i386 hosts, and possibly choosing different registers in the register + // allocator. See for + // more details. + volatile float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Wed Jul 24 19:44:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTkwn5ZWTz5QKPQ; Wed, 24 Jul 2024 19:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTkwn53cnz4Vtb; Wed, 24 Jul 2024 19:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721850249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbS3jkG0L8XoCNCzi+8p2Ct1l4cvzpXktOT9S3XaZkI=; b=BnoQ/0IxTkEqg5yfBwHjow0QCWtC+t7Iz6GVNBViJj05qCch3vTemG0up7mYKfNbi2JPHp IdJf3G153XKP/tWgdMejXkmxa2HCoC8+WaMyg9zSScy8zJeVWSPWGXmCdiHP34XSB0rH7/ +0JmNfOx3TCt1UjOQTh9zXK7j3ZiYkwRSaWZWxpYOVofYifJ6DzcKZZ/Wie7qaGgZ3XCk1 OAi2qaB5K5yNHBdVls9nrzQ+bBx2IQf0LZc9Ola2jh6JK/sTO1iDr0Z/SQL5vgNjbp62xc JUyr9fsbFvHVKH0BhD42snGl6wR0BiQM/668Fk5QqA0fDdkRAfv8goqodCgsYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721850249; a=rsa-sha256; cv=none; b=qVIpjw0iKbC9UBLDpkiysI/1tmzBmqp/qtJPZiqi40jKksQ74b9dCx4ujd0+zvciSf7Ltv AB1vKv6oKga0VA3qMzT45YXyUM1vKLJwX3DxmcN/IB0haqPWCslPAvR3oMm9somf1LC7lh 89fJt6gFZ8TRmXySXIcsOX4NJDE3zubhxTtoBmKwwU6bfvqKHAtKh71ktwUsSwOfRH/dcC 7lzSVTotmslCi2irouHOvJD47sHVzAzQHxKgwfHz4BnBuQy7WlH260Gtcav6aSy2eF/Goa B5lrE9c5kTYXSCFowJEfTjB+phZIdxleEdqxw1UNQfvT1w2bYzNG4iZn5ilDIQ== 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=1721850249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbS3jkG0L8XoCNCzi+8p2Ct1l4cvzpXktOT9S3XaZkI=; b=Nd+radwFXSpF6wr2Wrb6MrJJ0zfajnWdQcFBG2+TldMIAGIgX/Y/bggWhaEZ2ouX70z9PA znwntOXfOVSfuhBR+Ug+FPKvrh85ufBOjFg+Ku1X23udP0zrVBz12SB9x0O7rNYUaNLLN/ Yh2YrnOB1FBHPOmWh1YUczWCaQ5dl44r7GVG/TnbPIdOpAp+NhwUzjpE8muja7zvfSTBeW IwuSDuFgo8wZjxJPnXwUCoIfOusSdtNZVWpvSx3nLwuZH1AcaNZkQW8F0YZETacYEz4AL8 NMEqF92QCXVx6jLTnERqSblSKnFXoe1t3w16VJRBUTNMlCx4FTvvM+BDgzML2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTkwn4flWzPfM; Wed, 24 Jul 2024 19:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OJi9S1011146; Wed, 24 Jul 2024 19:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OJi92Z011143; Wed, 24 Jul 2024 19:44:09 GMT (envelope-from git) Date: Wed, 24 Jul 2024 19:44:09 GMT Message-Id: <202407241944.46OJi92Z011143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 8d87e47b8d10 - stable/13 - Fix llvm register allocator for native/cross build differences List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d87e47b8d1093a264ca954620b9e58b81fb9b34 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8d87e47b8d1093a264ca954620b9e58b81fb9b34 commit 8d87e47b8d1093a264ca954620b9e58b81fb9b34 Author: Dimitry Andric AuthorDate: 2024-07-21 20:37:27 +0000 Commit: Dimitry Andric CommitDate: 2024-07-24 19:26:11 +0000 Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f) --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..afde8d001f88 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,7 +256,12 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // FreeBSD customization: similar to the HWeight declaration below, add a + // volatile qualifier to avoid slightly different weight results on amd64 + // and i386 hosts, and possibly choosing different registers in the register + // allocator. See for + // more details. + volatile float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Thu Jul 25 13:41:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrB725Qz5S4kk; Thu, 25 Jul 2024 13:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrB6f84z4S7T; Thu, 25 Jul 2024 13:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N89IyTO1fZ0a/O1PqBCJ83724+jk+b6DDy5wI3/Srfw=; b=eXwGS6Nu5ZyDPNVL65RpZpLYCBqFvALrMwp9DLU6yfSXbwm5kiEfmOCdGbwsQ1iy/Mskje QDorLq8mGmKndLjP17uxf2ZINqAGX3D+tt0quL0dRvcXIC6g+iP/IG8WpNVrNsAdy9fuyU HKSbOei8IyhGeOgSQ4S7msH2cnTE9fuLo9B9N6v8zunifH+fxiE6x83W5klEUGuK0IIqPE 4cHcjZo64S5N4k6Ru95dn7Upy5+sLxV9HRCRJDBNU2FE4jmg/xmIAdfjn2ESFzAhlun0HV 0B+eCJoVBcuzxewjlIei4u58UGSlKNuv8Wtj0AqKo1n4zw1tYfX/Mh13VRp6Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914906; a=rsa-sha256; cv=none; b=o2gCRz7ypfX2UUQx4S0APbgE2n9LokxqRWUyYT+VRce1bbBOxWVRUbKHF4SzgqMN/eZns2 hour3L0vF3Iey2Bo7JVxz9Wmh/ZpOy1+RoU8FjI3iNFpGIkyu+SMdtPDHpij/fgEis7lju kXjxWNkmQpwdaEZP/Q3jj9168sBLzMT1wfaZ1iu+bMGyR0weWByHSBDX80+s7TT8oPnUnf xXF7VSMVP1dzg73TcQQBGF77kGifyB1RcO4s9hdmAlDBDCf+lOq3WY7fuIRrGGwYL4eNdi gcujWUGEhMIWAT2rRF2ZKVAJE6Z+cVZva6RPurKHHfjfK8QwT4uRr8U/YTU8XQ== 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=1721914906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N89IyTO1fZ0a/O1PqBCJ83724+jk+b6DDy5wI3/Srfw=; b=H+EhhHuidvS0CmeGHc3o5Cmk+kViiyjdHLgJZuj94DlObdTCwb1IjqjhMpk/rdIHNy9ptH 2SWtj9J5jO/hx83Cz6Ac2Rtq00+l8z/F5+FbLCbyJeSTpMTea+KePEKvJZI0GWNLIoK3RX cbqiFhGQWQ9k2bowZ4j2Ue12AbTlI1kSypqSq0mGdGNG6FF+IcjpQyUb26/6LqcpXaV5mY juvV9Hvu4dy3GWxHlfyNRlgAnq+8/XuQpek6KGKLO1jnDvHtWDPKozsJbMzzjKzkjEXKfG Gyf3RqGpT4vyJv8w+t96SiW50Hbx0rZsWRloMmq8Qa0UwG5+NZZr+SpQx98Fjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrB6FynzxhV; Thu, 25 Jul 2024 13:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfkJ6044296; Thu, 25 Jul 2024 13:41:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfkW6044292; Thu, 25 Jul 2024 13:41:46 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:46 GMT Message-Id: <202407251341.46PDfkW6044292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 428b8c820265 - stable/13 - pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 428b8c8202654bddbfe871eb412e272c23f86802 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=428b8c8202654bddbfe871eb412e272c23f86802 commit 428b8c8202654bddbfe871eb412e272c23f86802 Author: Kristof Provost AuthorDate: 2024-07-17 13:52:13 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:19:55 +0000 pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask These variables are tunables, so in principle they never change at runtime. That would mean they don't need to be tracked per-vnet. However, they both can be decreased (back to their default values) if the memory allocations for their respective tables fail, and these allocations are per-vnet. That is, it's possible for a few vnets to be started and have the tuned size for the hash and srchash tables only to have later vnets fail the initial allocation and fall back to smaller allocations. That would confuse the previously created vnets (because their actual table size and size/mask variables would no longer match). Avoid this by turning these into per-vnet variables. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 271f146955641857c93705b5b1916b8004e5623c) --- sys/net/pfvar.h | 8 +++-- sys/netpfil/pf/if_pfsync.c | 12 +++++--- sys/netpfil/pf/pf.c | 74 ++++++++++++++++++++++++---------------------- sys/netpfil/pf/pf_ioctl.c | 22 +++++++------- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 11bde6224eb3..5d72dabfe305 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1851,8 +1851,10 @@ struct pf_idhash { }; extern u_long pf_ioctl_maxcount; -extern u_long pf_hashmask; -extern u_long pf_srchashmask; +VNET_DECLARE(u_long, pf_hashmask); +#define V_pf_hashmask VNET(pf_hashmask) +VNET_DECLARE(u_long, pf_srchashmask); +#define V_pf_srchashmask VNET(pf_srchashmask) #define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); @@ -1862,7 +1864,7 @@ VNET_DECLARE(struct pf_idhash *, pf_idhash); VNET_DECLARE(struct pf_srchash *, pf_srchash); #define V_pf_srchash VNET(pf_srchash) -#define PF_IDHASH(s) (be64toh((s)->id) % (pf_hashmask + 1)) +#define PF_IDHASH(s) (be64toh((s)->id) % (V_pf_hashmask + 1)) VNET_DECLARE(void *, pf_swi_cookie); #define V_pf_swi_cookie VNET(pf_swi_cookie) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index b8632e1fd61b..6ca6db00e685 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -764,7 +764,7 @@ pfsync_in_clr(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) pfi_kkif_find(clr[i].ifname) == NULL) continue; - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; relock: @@ -1847,7 +1847,11 @@ pfsync_defer_tmo(void *arg) struct pfsync_softc *sc = pd->pd_sc; struct mbuf *m = pd->pd_m; struct pf_kstate *st = pd->pd_st; - struct pfsync_bucket *b = pfsync_get_bucket(sc, st); + struct pfsync_bucket *b; + + CURVNET_SET(sc->sc_ifp->if_vnet); + + b = pfsync_get_bucket(sc, st); PFSYNC_BUCKET_LOCK_ASSERT(b); @@ -1860,11 +1864,11 @@ pfsync_defer_tmo(void *arg) if (sc->sc_sync_if == NULL) { pf_release_state(st); m_freem(m); + CURVNET_RESTORE(); return; } NET_EPOCH_ENTER(et); - CURVNET_SET(sc->sc_sync_if->if_vnet); pfsync_tx(sc, m); @@ -2211,7 +2215,7 @@ pfsync_bulk_update(void *arg) else i = sc->sc_bulk_hashid; - for (; i <= pf_hashmask; i++) { + for (; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; if (s != NULL) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e99886a2d120..0c3df612e3f8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -431,16 +431,18 @@ VNET_DEFINE(struct pf_srchash *, pf_srchash); SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "pf(4)"); -u_long pf_hashmask; -u_long pf_srchashmask; -static u_long pf_hashsize; -static u_long pf_srchashsize; +VNET_DEFINE(u_long, pf_hashmask); +VNET_DEFINE(u_long, pf_srchashmask); +VNET_DEFINE_STATIC(u_long, pf_hashsize); +#define V_pf_hashsize VNET(pf_hashsize) +VNET_DEFINE_STATIC(u_long, pf_srchashsize); +#define V_pf_srchashsize VNET(pf_srchashsize) u_long pf_ioctl_maxcount = 65535; -SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, - &pf_hashsize, 0, "Size of pf(4) states hashtable"); -SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, - &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_hashsize), 0, "Size of pf(4) states hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_srchashsize), 0, "Size of pf(4) source nodes hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); @@ -607,7 +609,7 @@ pf_hashkey(struct pf_state_key *sk) sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), V_pf_hashseed); - return (h & pf_hashmask); + return (h & V_pf_hashmask); } static __inline uint32_t @@ -628,7 +630,7 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) panic("%s: unknown address family %u", __func__, af); } - return (h & pf_srchashmask); + return (h & V_pf_srchashmask); } #ifdef ALTQ @@ -829,7 +831,7 @@ pf_overload_task(void *v, int pending) return; } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state_key *sk; struct pf_kstate *s; @@ -1009,10 +1011,10 @@ pf_initialize(void) struct pf_srchash *sh; u_int i; - if (pf_hashsize == 0 || !powerof2(pf_hashsize)) - pf_hashsize = PF_HASHSIZ; - if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) - pf_srchashsize = PF_SRCHASHSIZ; + if (V_pf_hashsize == 0 || !powerof2(V_pf_hashsize)) + V_pf_hashsize = PF_HASHSIZ; + if (V_pf_srchashsize == 0 || !powerof2(V_pf_srchashsize)) + V_pf_srchashsize = PF_SRCHASHSIZ; V_pf_hashseed = arc4random(); @@ -1027,26 +1029,26 @@ pf_initialize(void) sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - V_pf_keyhash = mallocarray(pf_hashsize, sizeof(struct pf_keyhash), + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_NOWAIT | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, sizeof(struct pf_idhash), + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_keyhash == NULL || V_pf_idhash == NULL) { printf("pf: Unable to allocate memory for " - "state_hashsize %lu.\n", pf_hashsize); + "state_hashsize %lu.\n", V_pf_hashsize); free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - pf_hashsize = PF_HASHSIZ; - V_pf_keyhash = mallocarray(pf_hashsize, + V_pf_hashsize = PF_HASHSIZ; + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_WAITOK | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_hashmask = pf_hashsize - 1; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + V_pf_hashmask = V_pf_hashsize - 1; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { mtx_init(&kh->lock, "pf_keyhash", NULL, MTX_DEF | MTX_DUPOK); mtx_init(&ih->lock, "pf_idhash", NULL, MTX_DEF); @@ -1060,19 +1062,19 @@ pf_initialize(void) uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT); uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached"); - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_srchash == NULL) { printf("pf: Unable to allocate memory for " - "source_hashsize %lu.\n", pf_srchashsize); + "source_hashsize %lu.\n", V_pf_srchashsize); - pf_srchashsize = PF_SRCHASHSIZ; - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchashsize = PF_SRCHASHSIZ; + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_srchashmask = pf_srchashsize - 1; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) + V_pf_srchashmask = V_pf_srchashsize - 1; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); /* ALTQ */ @@ -1111,7 +1113,7 @@ pf_cleanup(void) struct pf_send_entry *pfse, *next; u_int i; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty", __func__)); @@ -1123,7 +1125,7 @@ pf_cleanup(void) free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { KASSERT(LIST_EMPTY(&sh->nodes), ("%s: source node hash not empty", __func__)); mtx_destroy(&sh->lock); @@ -1519,7 +1521,7 @@ pf_find_state_byid(uint64_t id, uint32_t creatorid) pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); - ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; + ih = &V_pf_idhash[(be64toh(id) % (V_pf_hashmask + 1))]; PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) @@ -1901,7 +1903,7 @@ pf_purge_thread(void *unused __unused) * table every run. */ V_pf_purge_idx = - pf_purge_expired_states(V_pf_purge_idx, pf_hashmask / + pf_purge_expired_states(V_pf_purge_idx, V_pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* @@ -1945,7 +1947,7 @@ pf_unload_vnet_purge(void) /* * Now purge everything. */ - pf_purge_expired_states(0, pf_hashmask); + pf_purge_expired_states(0, V_pf_hashmask); pf_purge_fragments(UINT_MAX); pf_purge_expired_src_nodes(); @@ -2005,7 +2007,7 @@ pf_purge_expired_src_nodes(void) int i; LIST_INIT(&freelist); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states == 0 && cur->expire <= time_uptime) { @@ -2176,7 +2178,7 @@ relock: SDT_PROBE2(pf, purge, state, rowcount, i, count); /* Return when we hit end of hash. */ - if (++i > pf_hashmask) { + if (++i > V_pf_hashmask) { V_pf_status.states = uma_zone_get_cur(V_pf_state_z); return (0); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index a7f9f2604068..2ddb84642b7d 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2961,7 +2961,7 @@ DIOCCHANGERULE_error: sizeof(struct pfsync_state), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATES_retry: @@ -3039,7 +3039,7 @@ DIOCGETSTATES_full: sizeof(struct pf_state_export), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATESV2_retry: @@ -4637,7 +4637,7 @@ DIOCCHANGEADDR_error: struct pf_src_node *p, *pstore; uint32_t i, nr = 0; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) @@ -4656,7 +4656,7 @@ DIOCCHANGEADDR_error: nr = 0; p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK | M_ZERO); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -5068,7 +5068,7 @@ pf_clear_all_states(void) struct pf_kstate *s; u_int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock: PF_HASHROW_LOCK(ih); @@ -5104,7 +5104,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) struct pf_kstate *s; int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); @@ -5120,7 +5120,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) if (n == NULL) { struct pf_srchash *sh; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -5142,7 +5142,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) struct pf_ksrc_node_list kill; LIST_INIT(&kill); - for (int i = 0; i <= pf_srchashmask; i++) { + for (int i = 0; i <= V_pf_srchashmask; i++) { struct pf_srchash *sh = &V_pf_srchash[i]; struct pf_ksrc_node *sn, *tmp; @@ -5163,7 +5163,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) PF_HASHROW_UNLOCK(sh); } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; @@ -5224,7 +5224,7 @@ pf_clear_states(const struct pf_kstate_kill *kill) int idx; unsigned int killed = 0, dir; - for (unsigned int i = 0; i <= pf_hashmask; i++) { + for (unsigned int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock_DIOCCLRSTATES: @@ -5298,7 +5298,7 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) return; } - for (unsigned int i = 0; i <= pf_hashmask; i++) + for (unsigned int i = 0; i <= V_pf_hashmask; i++) *killed += pf_killstates_row(kill, &V_pf_idhash[i]); return; From nobody Thu Jul 25 13:41:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrC50b9z5S4cY; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrC3PLRz4S5f; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXWmvC4gczMjM+HRBcM6Tv/fkhRcGETJ35uGqnIqQI0=; b=kL//9HF7uTcAerITUoio/aR7hdECs1hTKQ0vLqVjWttGf1XN0pTkXOEMVdOTXpzfxpeIjl Pb6rVch4yhEBNemtCMMSFZ/f/lnKeYShRdW6FCd3Eb+dTPav+HvBplCxmIubm26OL8GCFl lZRHX//M8V8uCt2HA8B0/ViZeUNfcgAkZXyC5uhZWWog5JQMgOywzjmZiKTvBOkPj86Z0B 5ww75b4saKy3UUa1QY9b6DvDzq6yzSGnps3ZwmT2WBHDNr/R39NPBVyGlumzBos/n/xtrM JecHOpCWTjAsNPItuVX4cGCpHu2EpwZVCLBgeit/RYaRSMWv0lgx/aM/Mfbc4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914907; a=rsa-sha256; cv=none; b=VO0M+A5M9U21BAByHC9VEsrG98cux4Yuqh1a6KlIdWxbkWVy6NSKZazKaSHWoAGDNFKqRe /stzwDZuRHNX4mowSqnZUxiS5UTVFo/2wH8yspBTtpT5NXkMF7miyUfFA3rmwRFdN7xVS/ T6foM5HFqZSXFOfA5of51R8nhVlSE8KhZOVYQb/iazK1CPdNzNtHADIk9ymwmPrze5bJDX 96Oqbz/r0hzIqiTS7U8LikOHz/gRfjPCSqvRk8bz2TD2WkyUSKzyo0HtNXy5baeLZvEvcY uAXnoFDISn9DBKPHiwBTwCdVp9PpQbY68PSUl1KtWt6gfDvZJW7uMVVp8kxhxw== 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=1721914907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXWmvC4gczMjM+HRBcM6Tv/fkhRcGETJ35uGqnIqQI0=; b=OSJFA7M6do5vJWhlRdmfP3gHGOd9pNxoju76yETqU+Rm3ChvH91epNTWa9Ljn+5s303aOE Im4YeGFKo3ea91OlDUZolHL1UAGzEZw1LrJxXSDVtL7bUe1ny6qYEcoNyA6FsYJy7fynek c90qzmFXJXpXcuuOAYzjBKqAc/+1TCgOQqKPZsivSYIm7tiwOlX8twSPe/KdmsLoBLEUDg gZZdLkDR121FjTYFUOV8lzK+6sPtxqyh9uCXKASTRxEeWDqWx+BKUXEwjtvIrbOMnPk+52 xrmtrQHjeh3yojT1fjuFVo7Kj1XCmsb+n7mlvlPbqAvsKlBtDzD9QUT2hi/owQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrC1NCBzxn0; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDflIj044399; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfl1J044396; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:47 GMT Message-Id: <202407251341.46PDfl1J044396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4842a15fa43b - stable/14 - pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4842a15fa43ba66ec581daa51a1bbaa3a22f93fa Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4842a15fa43ba66ec581daa51a1bbaa3a22f93fa commit 4842a15fa43ba66ec581daa51a1bbaa3a22f93fa Author: Kristof Provost AuthorDate: 2024-07-17 13:52:13 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:19:22 +0000 pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask These variables are tunables, so in principle they never change at runtime. That would mean they don't need to be tracked per-vnet. However, they both can be decreased (back to their default values) if the memory allocations for their respective tables fail, and these allocations are per-vnet. That is, it's possible for a few vnets to be started and have the tuned size for the hash and srchash tables only to have later vnets fail the initial allocation and fall back to smaller allocations. That would confuse the previously created vnets (because their actual table size and size/mask variables would no longer match). Avoid this by turning these into per-vnet variables. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 271f146955641857c93705b5b1916b8004e5623c) --- sys/net/pfvar.h | 8 +++-- sys/netpfil/pf/if_pfsync.c | 12 +++++--- sys/netpfil/pf/pf.c | 74 ++++++++++++++++++++++++---------------------- sys/netpfil/pf/pf_ioctl.c | 22 +++++++------- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1c932026aeb3..4e2888b21a39 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2104,8 +2104,10 @@ struct pf_idhash { }; extern u_long pf_ioctl_maxcount; -extern u_long pf_hashmask; -extern u_long pf_srchashmask; +VNET_DECLARE(u_long, pf_hashmask); +#define V_pf_hashmask VNET(pf_hashmask) +VNET_DECLARE(u_long, pf_srchashmask); +#define V_pf_srchashmask VNET(pf_srchashmask) #define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); @@ -2115,7 +2117,7 @@ VNET_DECLARE(struct pf_idhash *, pf_idhash); VNET_DECLARE(struct pf_srchash *, pf_srchash); #define V_pf_srchash VNET(pf_srchash) -#define PF_IDHASH(s) (be64toh((s)->id) % (pf_hashmask + 1)) +#define PF_IDHASH(s) (be64toh((s)->id) % (V_pf_hashmask + 1)) VNET_DECLARE(void *, pf_swi_cookie); #define V_pf_swi_cookie VNET(pf_swi_cookie) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 7af9ce8f468d..503bdab0c6ac 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -979,7 +979,7 @@ pfsync_in_clr(struct mbuf *m, int offset, int count, int flags, int action) pfi_kkif_find(clr[i].ifname) == NULL) continue; - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; relock: @@ -2080,7 +2080,11 @@ pfsync_defer_tmo(void *arg) struct pfsync_softc *sc = pd->pd_sc; struct mbuf *m = pd->pd_m; struct pf_kstate *st = pd->pd_st; - struct pfsync_bucket *b = pfsync_get_bucket(sc, st); + struct pfsync_bucket *b; + + CURVNET_SET(sc->sc_ifp->if_vnet); + + b = pfsync_get_bucket(sc, st); PFSYNC_BUCKET_LOCK_ASSERT(b); @@ -2093,11 +2097,11 @@ pfsync_defer_tmo(void *arg) if (sc->sc_sync_if == NULL) { pf_release_state(st); m_freem(m); + CURVNET_RESTORE(); return; } NET_EPOCH_ENTER(et); - CURVNET_SET(sc->sc_sync_if->if_vnet); pfsync_tx(sc, m); @@ -2483,7 +2487,7 @@ pfsync_bulk_update(void *arg) else i = sc->sc_bulk_hashid; - for (; i <= pf_hashmask; i++) { + for (; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; if (s != NULL) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4eed6dd31860..1a4ef22ce5de 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -459,16 +459,18 @@ VNET_DEFINE(struct pf_srchash *, pf_srchash); SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "pf(4)"); -u_long pf_hashmask; -u_long pf_srchashmask; -static u_long pf_hashsize; -static u_long pf_srchashsize; +VNET_DEFINE(u_long, pf_hashmask); +VNET_DEFINE(u_long, pf_srchashmask); +VNET_DEFINE_STATIC(u_long, pf_hashsize); +#define V_pf_hashsize VNET(pf_hashsize) +VNET_DEFINE_STATIC(u_long, pf_srchashsize); +#define V_pf_srchashsize VNET(pf_srchashsize) u_long pf_ioctl_maxcount = 65535; -SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, - &pf_hashsize, 0, "Size of pf(4) states hashtable"); -SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, - &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_hashsize), 0, "Size of pf(4) states hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_srchashsize), 0, "Size of pf(4) source nodes hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); @@ -635,7 +637,7 @@ pf_hashkey(const struct pf_state_key *sk) sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), V_pf_hashseed); - return (h & pf_hashmask); + return (h & V_pf_hashmask); } static __inline uint32_t @@ -656,7 +658,7 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) panic("%s: unknown address family %u", __func__, af); } - return (h & pf_srchashmask); + return (h & V_pf_srchashmask); } #ifdef ALTQ @@ -861,7 +863,7 @@ pf_overload_task(void *v, int pending) return; } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state_key *sk; struct pf_kstate *s; @@ -1051,10 +1053,10 @@ pf_initialize(void) struct pf_srchash *sh; u_int i; - if (pf_hashsize == 0 || !powerof2(pf_hashsize)) - pf_hashsize = PF_HASHSIZ; - if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) - pf_srchashsize = PF_SRCHASHSIZ; + if (V_pf_hashsize == 0 || !powerof2(V_pf_hashsize)) + V_pf_hashsize = PF_HASHSIZ; + if (V_pf_srchashsize == 0 || !powerof2(V_pf_srchashsize)) + V_pf_srchashsize = PF_SRCHASHSIZ; V_pf_hashseed = arc4random(); @@ -1069,26 +1071,26 @@ pf_initialize(void) sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - V_pf_keyhash = mallocarray(pf_hashsize, sizeof(struct pf_keyhash), + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_NOWAIT | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, sizeof(struct pf_idhash), + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_keyhash == NULL || V_pf_idhash == NULL) { printf("pf: Unable to allocate memory for " - "state_hashsize %lu.\n", pf_hashsize); + "state_hashsize %lu.\n", V_pf_hashsize); free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - pf_hashsize = PF_HASHSIZ; - V_pf_keyhash = mallocarray(pf_hashsize, + V_pf_hashsize = PF_HASHSIZ; + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_WAITOK | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_hashmask = pf_hashsize - 1; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + V_pf_hashmask = V_pf_hashsize - 1; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { mtx_init(&kh->lock, "pf_keyhash", NULL, MTX_DEF | MTX_DUPOK); mtx_init(&ih->lock, "pf_idhash", NULL, MTX_DEF); @@ -1102,19 +1104,19 @@ pf_initialize(void) uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT); uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached"); - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_srchash == NULL) { printf("pf: Unable to allocate memory for " - "source_hashsize %lu.\n", pf_srchashsize); + "source_hashsize %lu.\n", V_pf_srchashsize); - pf_srchashsize = PF_SRCHASHSIZ; - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchashsize = PF_SRCHASHSIZ; + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_srchashmask = pf_srchashsize - 1; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) + V_pf_srchashmask = V_pf_srchashsize - 1; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); /* ALTQ */ @@ -1153,7 +1155,7 @@ pf_cleanup(void) struct pf_send_entry *pfse, *next; u_int i; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty", __func__)); @@ -1165,7 +1167,7 @@ pf_cleanup(void) free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { KASSERT(LIST_EMPTY(&sh->nodes), ("%s: source node hash not empty", __func__)); mtx_destroy(&sh->lock); @@ -1558,7 +1560,7 @@ pf_find_state_byid(uint64_t id, uint32_t creatorid) pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); - ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; + ih = &V_pf_idhash[(be64toh(id) % (V_pf_hashmask + 1))]; PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) @@ -1947,7 +1949,7 @@ pf_purge_thread(void *unused __unused) * table every run. */ V_pf_purge_idx = - pf_purge_expired_states(V_pf_purge_idx, pf_hashmask / + pf_purge_expired_states(V_pf_purge_idx, V_pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* @@ -1991,7 +1993,7 @@ pf_unload_vnet_purge(void) /* * Now purge everything. */ - pf_purge_expired_states(0, pf_hashmask); + pf_purge_expired_states(0, V_pf_hashmask); pf_purge_fragments(UINT_MAX); pf_purge_expired_src_nodes(); @@ -2051,7 +2053,7 @@ pf_purge_expired_src_nodes(void) int i; LIST_INIT(&freelist); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states == 0 && cur->expire <= time_uptime) { @@ -2225,7 +2227,7 @@ relock: SDT_PROBE2(pf, purge, state, rowcount, i, count); /* Return when we hit end of hash. */ - if (++i > pf_hashmask) { + if (++i > V_pf_hashmask) { V_pf_status.states = uma_zone_get_cur(V_pf_state_z); return (0); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 7c148d857144..04369a1aa9bb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -3794,7 +3794,7 @@ DIOCCHANGERULE_error: sizeof(struct pfsync_state_1301), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATES_retry: @@ -3873,7 +3873,7 @@ DIOCGETSTATES_full: sizeof(struct pf_state_export), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATESV2_retry: @@ -5516,7 +5516,7 @@ DIOCCHANGEADDR_error: struct pf_src_node *p, *pstore; uint32_t i, nr = 0; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) @@ -5535,7 +5535,7 @@ DIOCCHANGEADDR_error: nr = 0; p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK | M_ZERO); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -6007,7 +6007,7 @@ pf_clear_all_states(void) struct pf_kstate *s; u_int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock: PF_HASHROW_LOCK(ih); @@ -6043,7 +6043,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) struct pf_kstate *s; int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); @@ -6059,7 +6059,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) if (n == NULL) { struct pf_srchash *sh; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -6081,7 +6081,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) struct pf_ksrc_node_list kill; LIST_INIT(&kill); - for (int i = 0; i <= pf_srchashmask; i++) { + for (int i = 0; i <= V_pf_srchashmask; i++) { struct pf_srchash *sh = &V_pf_srchash[i]; struct pf_ksrc_node *sn, *tmp; @@ -6102,7 +6102,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) PF_HASHROW_UNLOCK(sh); } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; @@ -6163,7 +6163,7 @@ pf_clear_states(const struct pf_kstate_kill *kill) int idx; unsigned int killed = 0, dir; - for (unsigned int i = 0; i <= pf_hashmask; i++) { + for (unsigned int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock_DIOCCLRSTATES: @@ -6237,7 +6237,7 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) return; } - for (unsigned int i = 0; i <= pf_hashmask; i++) + for (unsigned int i = 0; i <= V_pf_hashmask; i++) *killed += pf_killstates_row(kill, &V_pf_idhash[i]); return; From nobody Thu Jul 25 13:41:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrD5702z5S4kq; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrD2wWSz4RqK; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eoVKkVQM+SicojnyXaauJZpYjeE5yEMFSVsWt9TS1U=; b=yVng8l0OzjCZUFdJ3dbqHjIPPjnOEGy4hFLLY9jIaNGQ8IXRkTR1qbAQDpxsLt+APvrDOi to2o3Ea+HznbahYn6fC417ph5YZ1xNAUuHR8N968pGc2pVZFli/DEPDKkhheFR4gjuhAOa RpS/sy6q5WrCx/GuObUQPYzhrHU6TyYh32MbWNFj3sx7fduZ0Lo6Km2X8HrjIL/elsuOhP bCv3aIjhTKeIqIN6ILSSCMTLOP/mVRVnDBwoExJ/dXRk+wavxWQQYzgbFKOMVAOLcp+90b HRV9A3cdWkjfspIKOUtcbO7sZ4Azk6ENxS9v+ElnqnwQ4+W8EsPp2+u16CFoKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914908; a=rsa-sha256; cv=none; b=UcvSkhB8YkTXdp/R7Ivt4p9WyZWoILp17L65hVhWPPNgGsruvFIMFYxytT+qwtJ9X1zW3h r7IvnLacfYkmGlaNkB4npTIgpgU9mcDwtuISybaggeiFjF2cNaE3LGN0llng9fkE+bmfWT zUpYW8n6DHerAiHyerYqCunHsIh/tIp6F/vWfpFZwzYPXkkPu9z3ctuVdwxt3zWsplWArw TOqepjys2s5d5SAvHgpSPDeU05z01WSDYH6Wggd5DGkeG62aff6htT5JdGjM3uO7ON78c2 lsz+HshPEVwNfN8IUZUQinC6GVrnukWdiNBwBC7QX0/w8OM1n296nnPgaDI+KA== 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=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eoVKkVQM+SicojnyXaauJZpYjeE5yEMFSVsWt9TS1U=; b=wZ/z+VCY9tLsI4bfUoN6R4s8Awe2IciHR1/BBZ1x7CzptkCae6c8ezc7Br+R1DeTTovGTG w4BkHBGQ776jJmGVZSU3tW8/5uLzSVppA03V2DD4mc8TWCNUUfgkdANoizCap+LHvB+VfK /1Cb80Jbg++Gks+CzY2hz1u8yEqeeVkJKNgtsOAwo5PFkc6ueA5xWRGZs4U4o5yCO48sSj WUSkdSIVK//rXlAYQOniCwp8JQKvktxlhFYWNbbR+zhJl+anZgLpE4YlMTXdOqST67Ep0g FqTWMyNhDvTE6oBWdoIjPU7es9hXSVIw0h2EvxOXqWEdLYGCfx3C5d/4X4SZQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrD2PFSzxXv; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfmsZ044501; Thu, 25 Jul 2024 13:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfmCQ044498; Thu, 25 Jul 2024 13:41:48 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:48 GMT Message-Id: <202407251341.46PDfmCQ044498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 5acd8ff56604 - stable/14 - pf tests: test setting and retrieving timeout values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5acd8ff56604d1a4263c3775d14024fa055c52f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5acd8ff56604d1a4263c3775d14024fa055c52f8 commit 5acd8ff56604d1a4263c3775d14024fa055c52f8 Author: Kristof Provost AuthorDate: 2024-06-06 15:50:42 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:29 +0000 pf tests: test setting and retrieving timeout values (cherry picked from commit 8ed5170c66ec4914e90c2f3657227ceb9e35193f) --- tests/sys/netpfil/pf/sctp.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c6dba1719d00..c3e1301238b0 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -656,6 +656,37 @@ pfsync_cleanup() pfsynct_cleanup } +atf_test_case "timeout" "cleanup" +timeout_head() +{ + atf_set descr 'Test setting and retrieving timeout values' + atf_set require.user root +} + +timeout_body() +{ + sctp_init +} + +timeout_cleanup() +{ + pft_cleanup + + vnet_mkjail timeout + + pft_set_rules timeout \ + "set timeout sctp.first 13" \ + "set timeout sctp.opening 14" + + atf_check -s exit:0 -o match:"sctp.first.*13" \ + jexec timeout pfctl -st + atf_check -s exit:0 -o match:"sctp.opening.*14" \ + jexec timeout pfctl -st + # We've not changed other timeouts + atf_check -s exit:0 -o match:"sctp.established.*86400" \ + jexec timeout pfctl -st +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -666,4 +697,5 @@ atf_init_test_cases() atf_add_test_case "nat_v6" atf_add_test_case "rdr_v4" atf_add_test_case "pfsync" + atf_add_test_case "timeout" } From nobody Thu Jul 25 13:41:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrD2sBLz5S4mj; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrD0LzMz4RqG; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3o7XEvnDeTlXuwRTLgptc3HVtd6HoXO0IGog8beBjc=; b=H99TIW6uFOtZjazF1mT+gQkfdImnnSwhOQul6aEtx1fSkC6EHl66UdHu7On9kaBAhgmEhk +CafUzso8WRELhYdwGOalwk/icmXuYvu043LMIhZtKGehDdn2DsW3yoUvYCdKP4VvKMH5U pK/zcPqcANya0KoqYSss+ZZhmNwqPNH4Clplphw9Qs+LcRH/hGeSYooNsAU33ZvL66oTrJ /EhAp1TsbRpByECJn6c2Pz9qCBwYf1xFpc2cVIDPPe8uq+5uJ6SBvYhT6My2HjHgyDx2i/ sEtDNqsuS5PtJK8Y3e209ox5HA1qDIIovoFAljIodCEKHMT5paBDjXDbgaTQYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914908; a=rsa-sha256; cv=none; b=N1w+4mHhsZyf/C5R9lByGclJLbjKCwHHtQC4tLNag2N7lstP3MjlRXubegWTTvdvAFZeDt 7R6tSe4Id5EILZO6jsGjvOOxtiuu5i7SN2k+gcF++kpigU2/Bp6QR4bBGiSiV1G6GIWPYW UaUcTHtp5cLtvySyxZXdOqtyo8Teh4652pPJbrS9J18VMCpUba41P5LrN0J7OiUmjkYgVB kKZHf5UbJj7jenK90eUra81MggmHuUKuyqoBt45IoawfSYtLq48q9cBYNFkirVuvAkG1J7 T1TS33Mxzq5TcszV/+6011mUpT/Qz5mO2BvdelDdY2DDaDMK+m2Hj8lclb9zgw== 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=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3o7XEvnDeTlXuwRTLgptc3HVtd6HoXO0IGog8beBjc=; b=R2TOdR+liyN4QzoDIuqf5JnWX6udEidbmyqsGOLcbb6zzA3FGLKpaUw8GP2skpgNkuhRIT 4PprRGZ7kMOr1avBy39pJY5LUouq7ZLuZRU1eB0NhndWSwpZFenckESlVmwFrOC0MfGI42 +AYlOTCi7cyNaUg30wMnwl4gtZav82lnIhyVSglJp5UN781zxWd22W7CEXwUlSat36Vj24 cNEIdx5WUz5IJAV689zxqDwOLdZrI9iT2rjorH/9WwjgKWnQMO4Vmtnb6l845YL/YBSDnk Xkqnf+PDL4l6a/LN9VGbNGY8vCeHyohDqN6ybOaniElZzv8FU2wbnoxMbAElBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrC6zKWzxkV; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfl1W044450; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfl2m044447; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:47 GMT Message-Id: <202407251341.46PDfl2m044447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 193455c91b90 - stable/13 - pf tests: test setting and retrieving timeout values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 193455c91b9065beef2b4a86956713f633041340 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=193455c91b9065beef2b4a86956713f633041340 commit 193455c91b9065beef2b4a86956713f633041340 Author: Kristof Provost AuthorDate: 2024-06-06 15:50:42 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:35 +0000 pf tests: test setting and retrieving timeout values (cherry picked from commit 8ed5170c66ec4914e90c2f3657227ceb9e35193f) --- tests/sys/netpfil/pf/sctp.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c6dba1719d00..c3e1301238b0 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -656,6 +656,37 @@ pfsync_cleanup() pfsynct_cleanup } +atf_test_case "timeout" "cleanup" +timeout_head() +{ + atf_set descr 'Test setting and retrieving timeout values' + atf_set require.user root +} + +timeout_body() +{ + sctp_init +} + +timeout_cleanup() +{ + pft_cleanup + + vnet_mkjail timeout + + pft_set_rules timeout \ + "set timeout sctp.first 13" \ + "set timeout sctp.opening 14" + + atf_check -s exit:0 -o match:"sctp.first.*13" \ + jexec timeout pfctl -st + atf_check -s exit:0 -o match:"sctp.opening.*14" \ + jexec timeout pfctl -st + # We've not changed other timeouts + atf_check -s exit:0 -o match:"sctp.established.*86400" \ + jexec timeout pfctl -st +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -666,4 +697,5 @@ atf_init_test_cases() atf_add_test_case "nat_v6" atf_add_test_case "rdr_v4" atf_add_test_case "pfsync" + atf_add_test_case "timeout" } From nobody Thu Jul 25 13:41:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrF6k0Cz5S4f8; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrF3yxnz4Rrt; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tNrhhlCistSF+fapO6B67GZcvnjpqKOx3HPv9OQWPI=; b=LMtMltP2F4pcbl1bJnE+PavDr6qqyoi/pG9Bc7TgvnieO8ZTRDJKYpUlb6SlbgLAwfmn+Y ENCrA8uZb0YwnrA278S0B97mdK8bJLdlUCB9W740n3e5dfkKNgLe2Bm2uUn7WhpVZfgbDb Z3PZqPzOstlJX+8wHvmri3T9EraIJaHv5Ve/nMrko18L6hZtPkT6KGRN+ZziXiaHAP/5Me 4llWht64cNweX2lUd/fdeeJew2uctE+Xw0pks16A25IQawj2u4hPdZqEUb5G2UB2CsXpaY 9hY+jB94A3rOiKvGWBQkchwyyvVwnXWVSMw6raq4TS2vsOZSa5LRgmzomoSxmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914909; a=rsa-sha256; cv=none; b=ob3HuZDCopxTdfHu9l3WQhz2B76zzec1X8Yj4BRvwZpNO5VE7qOhB/phOSP2EJZ1gxB9Dn gGJGsc1lO/9YEp8W1A3u1Ha54LUkf/IPK2H5CKXV2sQkYeCYAXTP7V/Y9EGYZLTcCWXlSg TCX+lmlpHkKIyNkAeZebVdKEqiNQTbLiKR3ZClM1x5MHXe2prFmVTHPdfTgNQEv3Tdv4do eEdEJ8hxwAo3LdbQs1R+YtyK3PO/FAFPRH/hhBfaTUsnoeKwIeKnrLgMwAZZSoODC3RWH/ ZY1ejCsrVLIVUodeA8MrhRZg5NWejNRxa83cEV6454ld9D1FnmnKcIyryy9+Xw== 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=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tNrhhlCistSF+fapO6B67GZcvnjpqKOx3HPv9OQWPI=; b=iunV6NcrObtjmHZy4mSxYhJ0TlPPEKnu00hRc5mzaNoXfVlCSMCp03R8z5qbt2h4kp7ij8 DigvqEIAk+zA+6llobjT0qrVjpT7j0Bnio06rJc89BAZTuABFqo9yWNff8/P/ODAAZH2V6 TW9CLNEXc0R7tiE4hSBBVf5FWLIm1otF2drabMs7/1RCiT1da3CLiF5E7tEAOF2vxeMWwJ grfTy2OS5meAfX2C8PKLU2q4Uk8xkVkHpZsPOvmQtz/M1Th3+2KPk/v0OxZPAJ+hewAY9I IQDjE61ELWwokuIxlSDDde3X9yYpPXrDZDHSrsoQbZZXsgiCsSQKJFyy9icrtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrF3M78zx08; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfnP1044597; Thu, 25 Jul 2024 13:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfnK5044594; Thu, 25 Jul 2024 13:41:49 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:49 GMT Message-Id: <202407251341.46PDfnK5044594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4f5440f2abe9 - stable/14 - pf tests: fix sctp:timeout test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4f5440f2abe9f3250b7852399ecfc1af51084373 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5440f2abe9f3250b7852399ecfc1af51084373 commit 4f5440f2abe9f3250b7852399ecfc1af51084373 Author: Kristof Provost AuthorDate: 2024-07-17 13:56:49 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:31 +0000 pf tests: fix sctp:timeout test The test body somehow wound up in the cleanup function. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fe0c82a603ce069786ee81604315f499fd965546) --- tests/sys/netpfil/pf/sctp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c3e1301238b0..d07d1122048b 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -666,11 +666,6 @@ timeout_head() timeout_body() { sctp_init -} - -timeout_cleanup() -{ - pft_cleanup vnet_mkjail timeout @@ -687,6 +682,11 @@ timeout_cleanup() jexec timeout pfctl -st } +timeout_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" From nobody Thu Jul 25 13:41:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrF3MSdz5S4mk; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrF1y6Zz4S5y; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hoL28rXNQy4zeowxkAWZsfZltEooE0VWSLR1vWEcQx0=; b=XYILwzJubafUq0eWj6vxb+f+cJIHR3+JHOtwZVwQ9h9LOlhuGjYQbMe8YtCmIdK+AuWx3X xehJcNgcuqRWPEcNodNHuRzUVG1jArt4am2pcjxCK8R3ZPYkMAMrARAqXEQ4fBbx5Bw+hJ bsW4L8zmU8TfIgtT8cKnbiN/XzY+Y0GNiHdkNlfEgfXsSWlW69wPzYyIvB7ZWGvF3UjNdA gNpdLn0uRBWVh6F9yidfVGUuuC77z8MdQSLP36iCawn184duSobyEmolPG3m7F7IwNzkuL GNpJiX9A2P98XMpH+hq/go8i3/g80AgAO1eKZGY0444AGSEkshWpwoN4eLq61Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914909; a=rsa-sha256; cv=none; b=nxluzCE7XxwOA6ifYtcm5OKLGk9RZvSNVz4I7uFQSuOIi1SMV2+EauVlAgsu2ZMD3ba80Z vI/3aesANGI+WaQgjNnbTW498q84OX5yGLQJKWuAcNghcAG6s8hbP+agwPjJK2709GOWFV DfNGwYlt1BbdnepFCdKhLIY4lVZkIjXpLA5B5YZgeFFUuiawG6tj/bWfe+MZfRCREwZAuI My/5WVHfLZvgArvBYS7cL3K5kpfg8PCGCHXvRnyCy73q8720yaSbCO9iT8UXVYeKsCq4BK 9w0c2J/XPSvLEDsLFbmeRdVuXO+USnMO2eQosMZM5IJeyivYQ4XBbyG5hB4JZQ== 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=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hoL28rXNQy4zeowxkAWZsfZltEooE0VWSLR1vWEcQx0=; b=XdNPpg01+AgOw/PCCllDN3wIR0dmOBSGi+D9ao4XAJtcIH1o8yX6z9ap5H7ut9+mWe8qWr Hl4IFn49zwx4Oseuz0abXnq7F6Lv4VwwcpAT2vDsLPceo1WwNJf/qfmSwPba8WB5aDfg1w sdSynbuogD2ijx4xJCnJRTWpniWu4wwyc4lZoVho6lYYtN2bAPte5xjP6fGku5pJPtjpcU 6ZwA9ZQuhYnCl6MjKhMlANmM3SR6GJHfOJZk3+b/D0Cf8WHdmc49VmCFUhTN+nxAPC8YCd I9qnEMI9kXdkYS9+4dHj5Ht/S8+yF9eDjRTpVr7H5MFT7i2+3KGv9XJhtYzHFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrF1G0TzwbV; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfnQt044554; Thu, 25 Jul 2024 13:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfmC5044551; Thu, 25 Jul 2024 13:41:48 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:48 GMT Message-Id: <202407251341.46PDfmC5044551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 35bde8969eb6 - stable/13 - pf tests: fix sctp:timeout test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 35bde8969eb6e63c9ca6ebdd4245588b4b8cb6c2 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=35bde8969eb6e63c9ca6ebdd4245588b4b8cb6c2 commit 35bde8969eb6e63c9ca6ebdd4245588b4b8cb6c2 Author: Kristof Provost AuthorDate: 2024-07-17 13:56:49 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:38 +0000 pf tests: fix sctp:timeout test The test body somehow wound up in the cleanup function. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fe0c82a603ce069786ee81604315f499fd965546) --- tests/sys/netpfil/pf/sctp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c3e1301238b0..d07d1122048b 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -666,11 +666,6 @@ timeout_head() timeout_body() { sctp_init -} - -timeout_cleanup() -{ - pft_cleanup vnet_mkjail timeout @@ -687,6 +682,11 @@ timeout_cleanup() jexec timeout pfctl -st } +timeout_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" From nobody Sun Jul 28 03:54:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWngV1mQSz5RLBS; Sun, 28 Jul 2024 03:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWngV0J86z4kkv; Sun, 28 Jul 2024 03:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722138886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsZ7qOFmV/QWvCYF/WLpyNAbV3JEB9Ilb0Z7DfAv6iM=; b=qWmZGnKb7Mlb8Lb8sQsQmxO3qLdL5FQ2pkBGDrYyN+e8L2X0OJvsseWh6b5hoU5GzCnQTL +SH35vKa7qtaDqiTXOPgTp/4jXR8bP6xvb76ANjgqWwIA7qVl5LsGHQ5uz+N8fzwAi7yMK ZHmyasepx++CdWdb+h0hbjIJTuYA0GnnhhJDoPK1AH2va3vM3PNXwuUsRj3P26ZF7H3bTx g4ALqKgNWXx5l/ZPMJoevTaAYutaxj5QZdxZjbXTO3EZTdVHP/HE7gCOGnjwZWOmTZmRKa xYAiOfeySXy0XmbMccdB+idivxzJvGmszF3vvPcd/zoiYQWQKIqR33KnhUZN1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722138886; a=rsa-sha256; cv=none; b=QWX1IFMaQPvAMfTYogTW4G3LXmRKeQ4oQpuAaw2GvnPWGkrZf5WeEhcDNZONEQpSXWpXI6 ZEubRgcjYQwjbPYqlHhjN/MOiNMoLhH0uULOoXYetfdtCb4TYgeM8OERYHxlCm1vh0yzUb wVhNG+VeBdctCb4OmegG01VROcrpnCuRe95Q2XwuYWNFwgaDZMKVQfaxInS1+vdLP6aXnA cLPNcLNgDwLihig0O0WiVWQrGZPTo0rP/8r4aPCiSKE6C+W/ADcVRdUr2zMsHUY3WWbG23 /LtTgE5ZE8lxfaKf6tq4zj7Fn6SEV5RcN/sZr0LS+lC04QSF/k8ElreVJhp3+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=1722138886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsZ7qOFmV/QWvCYF/WLpyNAbV3JEB9Ilb0Z7DfAv6iM=; b=JY0HqYpOPPa5T343+cqOGDKu+2ZV/dHXhFE2NY7h5G1tMXvReTnUhLMr4kmho9P6NUPz1S HWo7bl7Le5MFDGt1hGXoxtqNhA0+fvboLroEyL6Xtvdry8X9qnCw8no5jK+9CJpQYxspHO eJJTl/rW83CeW63vxBWyorrVDY/k3cly70MNyz/WEPf2UYttOeljTfrnkpUG27nOUD9D4A coxE9bHqBy8O6qQlOIX7ONTSV/uxu2p7abdqP+kOnljT2c4fyQZ1aV8u58SnEwA9kkhQ6K nXG8f6G0QpRJSXCIO1FhFa+7BExr+eeKfAQZ9XEINRn2L1sZIKg3nesPtHNEAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWngT6yyMzb24; Sun, 28 Jul 2024 03:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46S3sjxR073581; Sun, 28 Jul 2024 03:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46S3sjp2073578; Sun, 28 Jul 2024 03:54:45 GMT (envelope-from git) Date: Sun, 28 Jul 2024 03:54:45 GMT Message-Id: <202407280354.46S3sjp2073578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9328ded386d5 - stable/14 - nfscl: Scan readdir reply filenames for invalid characters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9328ded386d570c8455b9021e047520ef72e0e79 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9328ded386d570c8455b9021e047520ef72e0e79 commit 9328ded386d570c8455b9021e047520ef72e0e79 Author: Rick Macklem AuthorDate: 2024-07-21 22:56:16 +0000 Commit: Rick Macklem CommitDate: 2024-07-28 03:53:17 +0000 nfscl: Scan readdir reply filenames for invalid characters The NFS RFCs are pretty loose with respect to what characters can be in a filename returned by a Readdir. However, FreeBSD, as a POSIX system will not handle imbedded '/' or nul characters in file names. Also, for NFSv4, the file names "." and ".." are handcrafted on the client and should not be returned by a NFSv4 server. This patch scans for the above in filenames returned by Readdir and ignores any entry returned by Readdir which has them in it. Because an imbedded nul would be a string terminator, it was not possible to code this check efficiently using string(3) functions. Reported by: Apple Security Engineering and Architecture (SEAR) (cherry picked from commit 026cdaa3b3a92574d9ac3155216e5cc0b0bd4c51) --- sys/fs/nfsclient/nfs_clrpcops.c | 137 ++++++++++++++++++++++++++++++++-------- 1 file changed, 110 insertions(+), 27 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 13bdc74655dd..8947b608b743 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -142,6 +142,7 @@ static int nfsrpc_createv4(vnode_t , char *, int, struct vattr *, nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, int *); +static bool nfscl_invalidfname(bool, char *, int); static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, struct nfscllockowner *, u_int64_t, u_int64_t, u_int32_t, struct ucred *, NFSPROC_T *, int); @@ -3321,6 +3322,31 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, return (error); } +/* + * Check to make sure the file name in a Readdir reply is valid. + */ +static bool +nfscl_invalidfname(bool is_v4, char *name, int len) +{ + int i; + char *cp; + + if (is_v4 && ((len == 1 && name[0] == '.') || + (len == 2 && name[0] == '.' && name[1] == '.'))) { + printf("Readdir NFSv4 reply has dot or dotdot in it\n"); + return (true); + } + cp = name; + for (i = 0; i < len; i++, cp++) { + if (*cp == '/' || *cp == '\0') { + printf("Readdir reply file name had imbedded / or nul" + " byte\n"); + return (true); + } + } + return (false); +} + /* * Readdir rpc. * Always returns with either uio_resid unchanged, if you are at the @@ -3373,6 +3399,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdir: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; /* * There is no point in reading a lot more than uio_resid, however @@ -3630,6 +3658,17 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -3645,20 +3684,35 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + DIRHDSIZ; uiop->uio_iov->iov_len -= DIRHDSIZ; + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) @@ -3824,6 +3878,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirplusrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdirplus: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; timespecclear(&dctime); *attrflagp = 0; @@ -4059,6 +4115,17 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -4077,25 +4144,41 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, cnp->cn_nameptr = uiop->uio_iov->iov_base; cnp->cn_namelen = len; NFSCNHASHZERO(cnp); + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - if (len == 2 && cnp->cn_nameptr[0] == '.' && - cnp->cn_nameptr[1] == '.') - isdotdot = 1; - else - isdotdot = 0; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + if (len == 2 && + cnp->cn_nameptr[0] == '.' && + cnp->cn_nameptr[1] == '.') + isdotdot = 1; + else + isdotdot = 0; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) From nobody Sun Jul 28 04:14:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWp6k4df8z5RMV3; Sun, 28 Jul 2024 04:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWp6k2bDhz4m5Y; Sun, 28 Jul 2024 04:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722140094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRIgRUsj8IZiLe15I6NsMnLsZ8z/wsyqLE6Be7HbZCE=; b=AlmxZBV3C+V4Pmk6kc2Wi6p9TGPvNNByaUhVJOKT+dA4HPrRyoHbVnq2swkUx/lupFB42L IW37+Y5a99Tka1rBV1rdvz2M7Bo0x4AjY74TPEi46K8iau7dLFw4sr8cHDHhhy/qtnezIk sBsRgUZZNPtN/uW5/qEiZJrGVUgBBSyPDfC0skrlfTYVxfjXl0KXDBBOgvRNEPXupjMPPJ ZSPnjQlWdLeS0FUEPB+d7CUjRermWyF5JyzzjcCMiygZdnp20PQSoA/QKkatt7YwAB6BQH DgNUYnaJ28rJTFthsqvkbIXL6OV8kkOc1i/MLxIf+xsdbv1hyb9V4pjbrFSVGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722140094; a=rsa-sha256; cv=none; b=Ajv0Nep37L+DqKPxjnuzGxNErTTqsnwldiwut2I8ZPmUi80fJ5h/lFoZcdc/cDcQz1doDL 6FpS2Ruv3Jp5JS7XlNEE+Tu/1hy9ZWx+mZNGb1kt2gRh+G68UYYrOxZ17G1l5CUg4zSmdb G5LDMtq6saVzY7Vgjf7TbC+umtsrBd3BtOfhkPeN3s4brceIeicyptxJ5KgJLkPUa6QD4I Jl9sBeaEakrfnQ9GZX/MzQS1vDLOyD+H/X1sUAR4EI/SUou9wfkxBdUjSgH6MYSfJy0law f2zlXyCvJ1bGLAw09R7cZNY/AOBIXQViLR3wUoyR+l6iRwYTBmo58tJjE93PDg== 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=1722140094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRIgRUsj8IZiLe15I6NsMnLsZ8z/wsyqLE6Be7HbZCE=; b=O6KxRACJ2wyYUqCguntK/2dG99rvYRT1sdHthYqSGdPseap0DWjEn02KYHAAs4ZRCCCyvp hiGD2RzLXP9tkgxe+YBtyodDhlSGmsdPpJFQG45pgEQR6krLzoxvVe/hx+DOYx8mW+L9bS I1KrQiZMn+F/rhwk8KOtlt7LTm4WPfwEE7ZY2euJdfc3kLkiI1mZMjWQFl1J8YPgOg0xfT kGJLkYjJmUn8IVomfpGi+UyXSfez6PiRnd6NwKUpO1atJFjGYm9JWyTsRJCb8i2S192k7w 70zcJXkxz4kslcnqxEPwRvIY2KzRVgS5t6xmi88pt7LdkCKvmiaB3guYPTnyfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWp6k29JJzc05; Sun, 28 Jul 2024 04:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46S4Eso7008780; Sun, 28 Jul 2024 04:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46S4EsGl008777; Sun, 28 Jul 2024 04:14:54 GMT (envelope-from git) Date: Sun, 28 Jul 2024 04:14:54 GMT Message-Id: <202407280414.46S4EsGl008777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 0172b5145ad9 - stable/13 - nfscl: Scan readdir reply filenames for invalid characters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0172b5145ad9435569978ed4d268b9f65ac59526 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0172b5145ad9435569978ed4d268b9f65ac59526 commit 0172b5145ad9435569978ed4d268b9f65ac59526 Author: Rick Macklem AuthorDate: 2024-07-21 22:56:16 +0000 Commit: Rick Macklem CommitDate: 2024-07-28 04:00:36 +0000 nfscl: Scan readdir reply filenames for invalid characters The NFS RFCs are pretty loose with respect to what characters can be in a filename returned by a Readdir. However, FreeBSD, as a POSIX system will not handle imbedded '/' or nul characters in file names. Also, for NFSv4, the file names "." and ".." are handcrafted on the client and should not be returned by a NFSv4 server. This patch scans for the above in filenames returned by Readdir and ignores any entry returned by Readdir which has them in it. Because an imbedded nul would be a string terminator, it was not possible to code this check efficiently using string(3) functions. Reported by: Apple Security Engineering and Architecture (SEAR) (cherry picked from commit 026cdaa3b3a92574d9ac3155216e5cc0b0bd4c51) --- sys/fs/nfsclient/nfs_clrpcops.c | 137 ++++++++++++++++++++++++++++++++-------- 1 file changed, 110 insertions(+), 27 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 475034768e04..b3062b5a5d88 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -140,6 +140,7 @@ static int nfsrpc_createv4(vnode_t , char *, int, struct vattr *, nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *, int *); +static bool nfscl_invalidfname(bool, char *, int); static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, struct nfscllockowner *, u_int64_t, u_int64_t, u_int32_t, struct ucred *, NFSPROC_T *, int); @@ -3005,6 +3006,31 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, return (error); } +/* + * Check to make sure the file name in a Readdir reply is valid. + */ +static bool +nfscl_invalidfname(bool is_v4, char *name, int len) +{ + int i; + char *cp; + + if (is_v4 && ((len == 1 && name[0] == '.') || + (len == 2 && name[0] == '.' && name[1] == '.'))) { + printf("Readdir NFSv4 reply has dot or dotdot in it\n"); + return (true); + } + cp = name; + for (i = 0; i < len; i++, cp++) { + if (*cp == '/' || *cp == '\0') { + printf("Readdir reply file name had imbedded / or nul" + " byte\n"); + return (true); + } + } + return (false); +} + /* * Readdir rpc. * Always returns with either uio_resid unchanged, if you are at the @@ -3057,6 +3083,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdir: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; /* * There is no point in reading a lot more than uio_resid, however @@ -3315,6 +3343,17 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -3330,20 +3369,35 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + DIRHDSIZ; uiop->uio_iov->iov_len -= DIRHDSIZ; + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) @@ -3511,6 +3565,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirplusrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdirplus: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; timespecclear(&dctime); *attrflagp = 0; @@ -3746,6 +3802,17 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -3764,25 +3831,41 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, cnp->cn_nameptr = uiop->uio_iov->iov_base; cnp->cn_namelen = len; NFSCNHASHZERO(cnp); + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - if (len == 2 && cnp->cn_nameptr[0] == '.' && - cnp->cn_nameptr[1] == '.') - isdotdot = 1; - else - isdotdot = 0; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + if (len == 2 && + cnp->cn_nameptr[0] == '.' && + cnp->cn_nameptr[1] == '.') + isdotdot = 1; + else + isdotdot = 0; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) From nobody Sun Jul 28 11:04:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWzCZ5SsNz5RyJM; Sun, 28 Jul 2024 11:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWzCZ4rQrz4Hj2; Sun, 28 Jul 2024 11:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722164682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptcWjfVFtM5G7dIgZUQvrTS1I7kcwYonvl0YKMf/5eA=; b=h89SS9JbFUbmfI6z+pqfg8T7nI8cqAFUw4l8xSvnIOlYNrN/reb1owxe1y6tt9VUXKlMFy LIptsEEQcWEm3BEmNYJrfnB6bh18VWTWqnhU/2o7Osi+OBfloVBaOQ5V0vpKDkMSviZbGb 6sD/ZPslO08IspzvZuLfgTw9UMIwAzM75gH9Cp032LipzrHPpfMKMKHiLETVW4nc/2qxu4 WWc2oIi03LaUtexZLL3Yx+zfXbX6jTM17ne/nXVtU2VPVRXTCHlRzORDLWPSz62RB8DpBd 0mmTkur3kZIKasM8BYrlNq/DyngUbLNTkjIkRmLfz40R8p2xHzqmXMsat8viPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722164682; a=rsa-sha256; cv=none; b=NJI1Sza+jlcCgvKWK6QGPlAQ+Lk92Z6cPzgt/qCTh5zhku1KMfCnmi9Xyfk14u5wXHVypl FI0gZ+ke/ZohgyfwEuK1yxhttacXrJRrxsQWNPdAb39VxCnRC3CRsm7YKdnK2Uspn7lagA d3kNGKvUR9CMthtV30uyUdz7iqBZmTTgzIo2If/3t/0oLh+hTa7g2+aO9GYB+iCbrX3eNZ In7HhW13E6bM2jCJtiJtCKR4VTBlSZ04Ta1M6R7AV3leRQ+C0AgUpvr+Icho04lmZxItsL bOSF/cXH40DvOK0Pjg+/B2sTwAmk/U+xSej7u53rtuJyrGspK79kmh7kTbdNbQ== 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=1722164682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptcWjfVFtM5G7dIgZUQvrTS1I7kcwYonvl0YKMf/5eA=; b=BhpRNv3cAZ4X7Ww+tLhhcE/MYQUFmOP8s/JP8HK4Vh85YRGKoFbmiQKqlUdT61oy26yzc2 SJohVMtIRka6T/+qqOoj67AmFGo5lg5Is+lfR3EsJYTTRTM+LZccZqJG8to9MSGzfcxdZf 7ejQ5S5A3+Yx0AQDPqBDMbEdMkC+c0xloU1/PhkIXwumR3UuwryjJTmovLNwl1zqIvtjUX mx8mu7+asVkyS2gIFArYDTsF5BR8Ya4nCoE130EgFaZFz4ojULAC4fgABmgT1kTR/Y8af4 SyqC71RHz99n2HV2G5OPUFDfqHSgjvDDof5P0P4qZXlivDuBI76jqirL/rf66A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWzCZ4LSTzpDp; Sun, 28 Jul 2024 11:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SB4gDJ002043; Sun, 28 Jul 2024 11:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SB4gBd002040; Sun, 28 Jul 2024 11:04:42 GMT (envelope-from git) Date: Sun, 28 Jul 2024 11:04:42 GMT Message-Id: <202407281104.46SB4gBd002040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 806fbbbbe5d2 - stable/14 - Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 806fbbbbe5d2eb5decfaafba6deb94534655cc8e Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=806fbbbbe5d2eb5decfaafba6deb94534655cc8e commit 806fbbbbe5d2eb5decfaafba6deb94534655cc8e Author: Dimitry Andric AuthorDate: 2024-07-25 11:13:45 +0000 Commit: Dimitry Andric CommitDate: 2024-07-28 11:04:21 +0000 Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): [DeadStoreElimination] Use SmallSetVector (NFC) (#79410) The use of SmallSetVector saves 0.58% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the final size of ToCheck was 8 or less 88% of the time. Merge commit 9e95c4947d31 from llvm-project (by Nikita Popov): [DSE] Fix non-determinism due to address reuse (#84943) The malloc->calloc fold creates a new MemoryAccess, which may end of at the same address as a previously deleted access inside SkipStores. To the most part, this is not a problem, because SkipStores is normally only used together with MemDefs. Neither the old malloc access nor the new calloc access will be part of MemDefs, so there is no problem here. However, SkipStores is also used in one more place: In the main DSE loop, ToCheck entries are checked against it. Fix this by not using SkipStores here, and instead using a separate set to track deletions inside this loop. This way it is not affected by the calloc optimization that happens outside it. This is all pretty ugly, but I haven't found another good way to fix it. Suggestions welcome. No test case as I don't have a reliable DSE-only test-case for this. Fixes https://github.com/llvm/llvm-project/issues/84458. This fixes another possible difference in output when building i386 object files with a native or cross build of clang. (Specifically, the file sbin/ipf/ipmon/ipmon.o.) PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 55a2a91c5e1bb39dd625ba56597608883fbcb318) --- .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 380d65836553..f0f0f5f28025 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1697,7 +1697,9 @@ struct DSEState { /// Delete dead memory defs and recursively add their operands to ToRemove if /// they became dead. - void deleteDeadInstruction(Instruction *SI) { + void + deleteDeadInstruction(Instruction *SI, + SmallPtrSetImpl *Deleted = nullptr) { MemorySSAUpdater Updater(&MSSA); SmallVector NowDeadInsts; NowDeadInsts.push_back(SI); @@ -1718,6 +1720,8 @@ struct DSEState { if (IsMemDef) { auto *MD = cast(MA); SkipStores.insert(MD); + if (Deleted) + Deleted->insert(MD); if (auto *SI = dyn_cast(MD->getMemoryInst())) { if (SI->getValueOperand()->getType()->isPointerTy()) { const Value *UO = getUnderlyingObject(SI->getValueOperand()); @@ -2111,7 +2115,12 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit; unsigned PartialLimit = MemorySSAPartialStoreLimit; // Worklist of MemoryAccesses that may be killed by KillingDef. - SetVector ToCheck; + SmallSetVector ToCheck; + // Track MemoryAccesses that have been deleted in the loop below, so we can + // skip them. Don't use SkipStores for this, which may contain reused + // MemoryAccess addresses. + SmallPtrSet Deleted; + [[maybe_unused]] unsigned OrigNumSkipStores = State.SkipStores.size(); ToCheck.insert(KillingDef->getDefiningAccess()); bool Shortend = false; @@ -2119,7 +2128,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, // Check if MemoryAccesses in the worklist are killed by KillingDef. for (unsigned I = 0; I < ToCheck.size(); I++) { MemoryAccess *Current = ToCheck[I]; - if (State.SkipStores.count(Current)) + if (Deleted.contains(Current)) continue; std::optional MaybeDeadAccess = State.getDomMemoryDef( @@ -2166,7 +2175,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, continue; LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } else { @@ -2203,7 +2212,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, Shortend = true; // Remove killing store and remove any outstanding overlap // intervals for the updated store. - State.deleteDeadInstruction(KillingSI); + State.deleteDeadInstruction(KillingSI, &Deleted); auto I = State.IOLs.find(DeadSI->getParent()); if (I != State.IOLs.end()) I->second.erase(DeadSI); @@ -2215,13 +2224,16 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, if (OR == OW_Complete) { LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } } } + assert(State.SkipStores.size() - OrigNumSkipStores == Deleted.size() && + "SkipStores and Deleted out of sync?"); + // Check if the store is a no-op. if (!Shortend && State.storeIsNoop(KillingDef, KillingUndObj)) { LLVM_DEBUG(dbgs() << "DSE: Remove No-Op Store:\n DEAD: " << *KillingI From nobody Sun Jul 28 11:05:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWzD7331Wz5RyjW; Sun, 28 Jul 2024 11:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWzD7223Vz4J5G; Sun, 28 Jul 2024 11:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722164711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U1Vt7/aAN4VAmxNxJ8kLwOWa3mxfom4Tb6yu6x1oUd8=; b=d0V29bLoBkMy0WI1RTd1Vu89xmwc6Sr/IdDoOl1Ojnmrba9cqHa87FxVdoyemBWe5yBzpm /54gkKYlNHo11WfUAwH4B+mF99ruvQ3Tedb/IN1dkMXOygiiiXbkKhqF0V1X+UsOinRLkM dvrQU+/+KHMCYB6MZghaj0bpLwg9a6TNT1TI+mMzcl9CNj1BfLf3OingFmnW+hNdzO3lk1 lmTMiCUkLki/ZdNo4kZigggineEKRX6Oshn8StkzGYQM3BOZVUO6dLJI3Xux1UYsVtdqYY msCQdOmkrp6UmaW3bFOgJJYDbnWEves2JbV3tE21MuDvHNdNp8k0fjraKK9jcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722164711; a=rsa-sha256; cv=none; b=bHTkBivjVBK+i8IYFnqr1fWYpvFPS0FNsSnnPoAZWOg/hK1UqbxiOngUIGvU8Rr4+vWLo5 oCyh6iXXbRw9BWtB64+20Gtr1UN/2wfq5i2mCsmIFq7dhNbO/nusKcMoZYvBghKRFsKeqo vN+JyAw3TxIuQgxRZRZUkQ+RAy7gKFJouFi4SQB4RDfMdrVJTDQC7XoZNdII2X+NFBYMAX sjVSERcxyZJatjqYN6evM5WjlVgSbU1aGhL9e7NcJSGgQ/yofGgd8ugWs7RLrYOR2HctuF TXNYMistf44lIwgUBszZih2T95mgeIzBU7eaBQxlJHQu4CV4mjX+rKUNa/QZlg== 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=1722164711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U1Vt7/aAN4VAmxNxJ8kLwOWa3mxfom4Tb6yu6x1oUd8=; b=Xi5PAOC8accVrvPrIixvmfRs3YP9igMFeb/mCta3+RCdfgfyS28MhotAPKN2Nrv1YxeE2M v5oZCiCg52Czqg7W+w3LLPS4eLzmRv/O+Jdohay1r7NvO3D3o0kmHiZMW/e1MsZmr2b102 N9SOS/XK0Pt0+RSj7kM1VszglkNnYS4CPqMRXkSsby96piJTopXpyiJMmYqtWawnue3ny6 rypGqKHuQKu8D2aR1jJpmv5qzptRDgGqxq6oSIpN+pHzkXSIA3lf+cSNtza5ySs3WdzcZw ESD0gApnjDpddzL80MbswXIvKrWSKgXTTX+GXsFztyitxLZTKCdbYLDgK+Jc9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWzD71P8qzp5N; Sun, 28 Jul 2024 11:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SB5BbA002275; Sun, 28 Jul 2024 11:05:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SB5Bro002272; Sun, 28 Jul 2024 11:05:11 GMT (envelope-from git) Date: Sun, 28 Jul 2024 11:05:11 GMT Message-Id: <202407281105.46SB5Bro002272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: c7e5a0d42f20 - stable/13 - Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7e5a0d42f20e9a81b96fc89b3b9883cf4be9839 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c7e5a0d42f20e9a81b96fc89b3b9883cf4be9839 commit c7e5a0d42f20e9a81b96fc89b3b9883cf4be9839 Author: Dimitry Andric AuthorDate: 2024-07-25 11:13:45 +0000 Commit: Dimitry Andric CommitDate: 2024-07-28 11:04:26 +0000 Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): [DeadStoreElimination] Use SmallSetVector (NFC) (#79410) The use of SmallSetVector saves 0.58% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the final size of ToCheck was 8 or less 88% of the time. Merge commit 9e95c4947d31 from llvm-project (by Nikita Popov): [DSE] Fix non-determinism due to address reuse (#84943) The malloc->calloc fold creates a new MemoryAccess, which may end of at the same address as a previously deleted access inside SkipStores. To the most part, this is not a problem, because SkipStores is normally only used together with MemDefs. Neither the old malloc access nor the new calloc access will be part of MemDefs, so there is no problem here. However, SkipStores is also used in one more place: In the main DSE loop, ToCheck entries are checked against it. Fix this by not using SkipStores here, and instead using a separate set to track deletions inside this loop. This way it is not affected by the calloc optimization that happens outside it. This is all pretty ugly, but I haven't found another good way to fix it. Suggestions welcome. No test case as I don't have a reliable DSE-only test-case for this. Fixes https://github.com/llvm/llvm-project/issues/84458. This fixes another possible difference in output when building i386 object files with a native or cross build of clang. (Specifically, the file sbin/ipf/ipmon/ipmon.o.) PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 55a2a91c5e1bb39dd625ba56597608883fbcb318) --- .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 380d65836553..f0f0f5f28025 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1697,7 +1697,9 @@ struct DSEState { /// Delete dead memory defs and recursively add their operands to ToRemove if /// they became dead. - void deleteDeadInstruction(Instruction *SI) { + void + deleteDeadInstruction(Instruction *SI, + SmallPtrSetImpl *Deleted = nullptr) { MemorySSAUpdater Updater(&MSSA); SmallVector NowDeadInsts; NowDeadInsts.push_back(SI); @@ -1718,6 +1720,8 @@ struct DSEState { if (IsMemDef) { auto *MD = cast(MA); SkipStores.insert(MD); + if (Deleted) + Deleted->insert(MD); if (auto *SI = dyn_cast(MD->getMemoryInst())) { if (SI->getValueOperand()->getType()->isPointerTy()) { const Value *UO = getUnderlyingObject(SI->getValueOperand()); @@ -2111,7 +2115,12 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit; unsigned PartialLimit = MemorySSAPartialStoreLimit; // Worklist of MemoryAccesses that may be killed by KillingDef. - SetVector ToCheck; + SmallSetVector ToCheck; + // Track MemoryAccesses that have been deleted in the loop below, so we can + // skip them. Don't use SkipStores for this, which may contain reused + // MemoryAccess addresses. + SmallPtrSet Deleted; + [[maybe_unused]] unsigned OrigNumSkipStores = State.SkipStores.size(); ToCheck.insert(KillingDef->getDefiningAccess()); bool Shortend = false; @@ -2119,7 +2128,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, // Check if MemoryAccesses in the worklist are killed by KillingDef. for (unsigned I = 0; I < ToCheck.size(); I++) { MemoryAccess *Current = ToCheck[I]; - if (State.SkipStores.count(Current)) + if (Deleted.contains(Current)) continue; std::optional MaybeDeadAccess = State.getDomMemoryDef( @@ -2166,7 +2175,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, continue; LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } else { @@ -2203,7 +2212,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, Shortend = true; // Remove killing store and remove any outstanding overlap // intervals for the updated store. - State.deleteDeadInstruction(KillingSI); + State.deleteDeadInstruction(KillingSI, &Deleted); auto I = State.IOLs.find(DeadSI->getParent()); if (I != State.IOLs.end()) I->second.erase(DeadSI); @@ -2215,13 +2224,16 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, if (OR == OW_Complete) { LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } } } + assert(State.SkipStores.size() - OrigNumSkipStores == Deleted.size() && + "SkipStores and Deleted out of sync?"); + // Check if the store is a no-op. if (!Shortend && State.storeIsNoop(KillingDef, KillingUndObj)) { LLVM_DEBUG(dbgs() << "DSE: Remove No-Op Store:\n DEAD: " << *KillingI From nobody Sun Jul 28 15:02:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX4VN3Ll3z5SK6j; Sun, 28 Jul 2024 15:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX4VN2mp8z4fY6; Sun, 28 Jul 2024 15:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722178972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+hBVq3dIAhG3JGArXVkFxdPT0I/Msw38i86UlIX9mfk=; b=lbGbbuJdI25+Vr7Jvq0h+SpDrw8plbw3y2xTMRtNZVwX6uJtjbmD1PQm4yMezfsnY89v+G GCaqGm154gclmFDDUPAZ9x1qNwdLQDVz0H4a3gYUpgbTBEIt3gurv9WdQkMp/6K2EzbQlj Gh1YUe6/WIA3WU0vvRmjYijtbw9B3XXlloaJn+f/KSGV6LaOnGBbjlphqjD7mC4pcB7/sv TUItvUr9uEHzmLhZoGxI8Dr4eyn/NXtFO+ci3Txp+cyI0yks9kQOSxebAIWLLNqktGUp4C zCKqUIAms404UWW72vZjeWJ1dHOFlc7oziRgq7YXorB0fAhD9TppkXrdiTBg+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722178972; a=rsa-sha256; cv=none; b=SFLERn36E6wvhwlszHMTBzp3AwENAaV5IHQPNHXrgI/2otB4NESATlS1OaUZN6hlWiOZ+G v9KqUazJEBeLWM7UW6nca14Wt5W6oIy5KhdurZhaAGbE01+fKlWFKMbf4G/X315CwmT8y3 8U0XOoYJf2YgXPMZNYiG07DHDfcG7L0W3xrF//K3X8mVvWzDZG14ckFI5kaDwODKVc4zNu Ie0ZvLqEHl8+AERl1HbwNBSG+0fFZaQHGXGUCFOmmugZr5NV8fEzP3xdq1YwqnPhmBVl9K EjcjvsZB73OlGlkyOkpVmi8ME+03TkdkFSHIMXnQr8wWC/yjPc0Mqyn2iqf9lg== 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=1722178972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+hBVq3dIAhG3JGArXVkFxdPT0I/Msw38i86UlIX9mfk=; b=rcd7jI+ao2dnKJZ1YoMs76+aiSNeGg8qAarGYNWhbCCCxSRiiIuaU6gNHDh7h67Dp4xhz6 n8jQ+BIrPeC7Zb+sjm4l36pvo/c0vl8dBSX0C06Kyn9JN6+j3y/Q/KtLLE7u/XAoFNhD8J wtRNijnMW+3G0cEwcDeR6rKLX9DV/9J/aV6TZFC4slj2Z8by/l+PO6Aoo/28R0ZW+EQ5oC 4jCySNNOXvq1cbR7QvY3mGYwLKIsK6ZXhMAh8imz66hvUhumyUjmiOsJ1jvecYYKcAB+dj VDBlAaEjt0DFwqnzMVKQAv1quRrJajVxrJftyz408kORXgLbbSAGoZ8XtshngQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX4VN2Gvpzvwg; Sun, 28 Jul 2024 15:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SF2qn7008550; Sun, 28 Jul 2024 15:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SF2qVV008547; Sun, 28 Jul 2024 15:02:52 GMT (envelope-from git) Date: Sun, 28 Jul 2024 15:02:52 GMT Message-Id: <202407281502.46SF2qVV008547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7d1e4b7bf299 - stable/14 - sockstat(1): tolerate situation where file info cannot be fetched List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d1e4b7bf299dbf2319c969357cd1545ad81c8a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7d1e4b7bf299dbf2319c969357cd1545ad81c8a6 commit 7d1e4b7bf299dbf2319c969357cd1545ad81c8a6 Author: Konstantin Belousov AuthorDate: 2024-07-20 00:30:55 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-28 15:02:45 +0000 sockstat(1): tolerate situation where file info cannot be fetched PR: 279875 (cherry picked from commit 35f4984343229545881a324a00cdbb3980d675ce) --- usr.bin/sockstat/sockstat.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index 52c494f03045..56f107b5cdaf 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -1165,8 +1165,11 @@ displaysock(struct sock *s, int pos) f = RB_FIND(files_t, &ftree, &(struct file){ .xf_data = p->socket }); - pos += xprintf("[%lu %d]", - (u_long)f->xf_pid, f->xf_fd); + if (f != NULL) { + pos += xprintf("[%lu %d]", + (u_long)f->xf_pid, + f->xf_fd); + } } else pos += printaddr(&p->laddr->address); } @@ -1184,9 +1187,12 @@ displaysock(struct sock *s, int pos) f = RB_FIND(files_t, &ftree, &(struct file){ .xf_data = p->socket }); - pos += xprintf("%s[%lu %d]", - fref ? "" : ",", - (u_long)f->xf_pid, f->xf_fd); + if (f != NULL) { + pos += xprintf("%s[%lu %d]", + fref ? "" : ",", + (u_long)f->xf_pid, + f->xf_fd); + } ref = p->faddr->nextref; fref = false; } From nobody Sun Jul 28 19:04:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX9rz6V3Kz5RSTp; Sun, 28 Jul 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX9rz5zHkz43nk; Sun, 28 Jul 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722193459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgokET+yF1XGboNIRxxaLYoHP5vJj/ZiV/nMBXJcq+0=; b=xOkQzsDKIlNM9pYpR1Q/tUMKQh3fXjuiaarQG03dMi7p3THfJMsg40vn9N+29pArWdLf3T 4MWvwNpg48erVzN7RS64LqbiulHpuQsNDumEYeNSG3Douv4JqBPvcbUnl/xljh4l89lCS6 wDwS0l6ufGIRdTrCe8b/Wb4d3G0nlsX7iYXl8xOlmOiB/0o5iXJ4pUY7bFiSrNCyuWuZyM tPkLci7Bhocj7F/VI9x4ZGS8AqhfY2yjNP2A60Je5byruUBzFFbX2lu8ubuPxst9VOSkr4 b4aTtoOhAELV+Di7rw2VpoMJ9fOhKOPU+tjZis3/NV6LPJQzR8AYeiXOEnp0OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722193459; a=rsa-sha256; cv=none; b=a/8cTZ8LmH6itvGf6tkW+hDUENuTsgylLs6jvA/2EAbZTiAKHS2tjP+QZPeaDenSb9yV3X Ik6bJ4w6NeOFV9O5GBukCFK8JVSxltgWOcfsCcTPyThytk0LC5aw3prml+ykqLqU7ljCjC teErOhmVxt8FVMUfB8u3P6bcs6vPIqnV7xFgkSJ01kqGg8I58A3GIMQQr9u5P916hg6qht CLlRvZIOIONaA+R5f9qYbraOzcqcRhSTnjQLehUppo1tTY7qt00xVkhpD/Qc0AF0kG4+OX hEjtUZi+QnOeR1FRKF+QO/H2kzyqbY625szAfUrQmqz9Sd8jSqLWfaihdnIAiA== 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=1722193459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgokET+yF1XGboNIRxxaLYoHP5vJj/ZiV/nMBXJcq+0=; b=BnLgqBZguPw2ih+ROuMxljHPpXFC49xlWhEHTxKKjEFjlEAxCyzq2B8RC5zjew8HlQ/N9Y rXffOTEaY/bbj0pjd8kuM8VXf2le5megq7QzO7Wnz1nFjGFVdV9/ixUsV8/pV9JRp1Vq79 XfxwY/eS5OljQszxnqSAj16pd3ntjh/jWTcOwPynGeUPQZY5xN+554sNc/QuojoJam1g/f Xfbg9n48WMgK5O+jZZ5N1cpAsf2Onkn85BuLJKo3nPGaUlOrSG9CC8uZR8lGIDCwHc83p5 SECCbOcxlF+WxxljzOq4LIayPC6cnVImGvN1Kv9TpFArKrE5WvWmW0HSN7GzfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX9rz5YHdz12r5; Sun, 28 Jul 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SJ4JgJ015123; Sun, 28 Jul 2024 19:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SJ4J84015120; Sun, 28 Jul 2024 19:04:19 GMT (envelope-from git) Date: Sun, 28 Jul 2024 19:04:19 GMT Message-Id: <202407281904.46SJ4J84015120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: b45276b1693d - stable/14 - Do not allow snapshots on UFS filesystems using gjournal. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b45276b1693db0f13d6203a8b989fe7ea856dbfb Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=b45276b1693db0f13d6203a8b989fe7ea856dbfb commit b45276b1693db0f13d6203a8b989fe7ea856dbfb Author: Kirk McKusick AuthorDate: 2024-07-25 06:09:58 +0000 Commit: Kirk McKusick CommitDate: 2024-07-28 19:04:10 +0000 Do not allow snapshots on UFS filesystems using gjournal. PR: 280216 (cherry picked from commit cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 7e8c4dbb17d1..fedac50e38fb 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -224,6 +224,15 @@ ffs_snapshot(struct mount *mp, char *snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, filesystems using gjournal cannot support + * taking snapshots. + */ + if ((mp->mnt_flag & MNT_GJOURNAL) != 0) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "using gjournal", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); From nobody Sun Jul 28 19:07:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX9w62JJ7z5RT01; Sun, 28 Jul 2024 19:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX9w61qR1z44Sp; Sun, 28 Jul 2024 19:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722193622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rg/Znx+7y0b6NrAJ8ffWkjDBgsDX2pV1ORxH2UXHP9A=; b=HJDrAJSK/DjNgHHXHBc/anLOQrbhYCQlJF9Mecht/xWN+6lgx9CSPiBu6dlrd1CkrP4u6b /weXixaick55S8WbtQP+gMTOpkQ9cAcmGskhREwhAEx8f1J6E8ZVY/LLtxaBzDT+frT6wZ 7E+2VqaSONd/4oPUkhG7vtBtk7ZTvSfqGKCQ6c64PmkcLpLTKL25SIt9fnxvEWMpQCptQh xnGD12rGoyhrCsq1HWUHVFxA856b/93v28QzvcChX8bB/3Ziwae6XKeklMlS6hNKpJ7RaG j5Cs7ooE/1IhavSthIxWzjDSQC0Sak4B/d51DI3R0wjNbb8rAnHg7OROVeX3eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722193622; a=rsa-sha256; cv=none; b=mz8Q3l7OdZXnR+M4hhL/oPBOXkzrcfAeT1tklVS0esa2Toh4WgaCTCrIfS1EhInGfhchhW EC+8TCkViJJRQ0evWL1ghbCoRi+naCL/Y01vOo9anfYBtTWV0zZOtfzAG+5r0UaTdqE0e6 bV5XL267LsP5oZ7YfnqKpj2HdWp17I+lczFVIiCKd9agBaDwa0bhbPUCQrEsEvxdsQ3nlV 7oMs/p1jj8CKm/dd5eIDSNbsVpimMFqK00gjs1a2SI+8bDAuii6y8NOOLmSDxECB/RHz0I eEe5Qt5VdseG2ERP/qD6n2xkcFi33jzkp3FzaFol7RbT0cgjTgHMJGsrWjqSMg== 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=1722193622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rg/Znx+7y0b6NrAJ8ffWkjDBgsDX2pV1ORxH2UXHP9A=; b=BYHOUTMSKl+bkuJ+uSSDuvO60dNqs2o8dmydVy68Ib9kOumklrY86H4g+vuZtfcva6mQCd 3uFL/JRx2/Ti5y2dKF1AOKygucqQPA71DTwACaRXYsUdQtJpm7eeA2uw4zmlHXP14dRRwc C9ImwF8dBn1exVAaGcBtFUXS85cEZn6e9p/Nntf3RndWg4G0UY7b57IVSwfiLltcmLcon0 O0tl7z7rqEubay0zUIThSGt4jLwbfazPwSpR0BOBPdZuRfiPfox/S4u+POKqQsfnoezmB9 7ftuQYvqZnPAfCnXxNS8rvnpABjRXbnmoMQTzNfvRAakmSk0J0FywVMt9b6P4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX9w61NtXz136g; Sun, 28 Jul 2024 19:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SJ7250015624; Sun, 28 Jul 2024 19:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SJ72tu015621; Sun, 28 Jul 2024 19:07:02 GMT (envelope-from git) Date: Sun, 28 Jul 2024 19:07:02 GMT Message-Id: <202407281907.46SJ72tu015621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 21161df3e032 - stable/13 - Do not allow snapshots on UFS filesystems using gjournal. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21161df3e032252e7533a183acbc5374157b66f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=21161df3e032252e7533a183acbc5374157b66f1 commit 21161df3e032252e7533a183acbc5374157b66f1 Author: Kirk McKusick AuthorDate: 2024-07-25 06:09:58 +0000 Commit: Kirk McKusick CommitDate: 2024-07-28 19:06:52 +0000 Do not allow snapshots on UFS filesystems using gjournal. PR: 280216 (cherry picked from commit cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index d4280391f48c..bc4dbdf52e5b 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -224,6 +224,15 @@ ffs_snapshot(struct mount *mp, char *snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, filesystems using gjournal cannot support + * taking snapshots. + */ + if ((mp->mnt_flag & MNT_GJOURNAL) != 0) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "using gjournal", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); From nobody Sun Jul 28 20:21:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXCYW58bQz5Rb6x; Sun, 28 Jul 2024 20:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXCYW1bK9z4CQX; Sun, 28 Jul 2024 20:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722198063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axW4SbGmQ4S9EAbAycCCzMJ1RRmCEtt5wsYw3b25F9A=; b=mPB+GVcwIqDp7AS1HlPTYxYVLpMCQahf/vwJWtLXhu33j/RuIoOLeJkvDksfMDMs7H9Z2l vn+I1/kRx19Et4jj1Mgs2AIhWueWvKpyVUFOGUx8KVaEHuwRkEog3+G37CEEfLud/3hpCA 1wRauS+HRmmRUPqSsjuIti6C+rjBd+5PSxQF1JJrXWh+Lq948swQCt0MNBqcKnfh2QQHZa yYFnacB53Q4iufB8ISse9Y6lwYN5A6JHMh4EKzONcP5Hs6lm19FHKo+93yKEjJLhxQXxAS 3Kqwo0gujmjkW0TST4oXkIxPKHr+m2dtBXxVRBWTm/ProOgYgmPiXbYLGXoB2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722198063; a=rsa-sha256; cv=none; b=fYmrCApX1gb1jmt0KipaOv7WSBgkeSFK8WA229dnRKXOSIVrROk3MzUp1fRbXlrDm8XY2x y79E6HVfWyIWQXoX2JgwKJP0fLqPG43XxwT79MAFcsd2smuVdYoqbBsJgyyenVgL/149Us uvJSC5zACYzNGMxRBMR3sPIHAraHhzOvjtAhAqQ/J/vjhLEbJRxUKcE0ocYSOzmwsUyhBj 6LHBwBpguHVTERkWpGy2WiJ7DBRTtT+ilw7XAFIDF9fFFtWvT6Wvq35K0pZ3dv6DT2Mtcw nUU7cAR2/4YTWNSqH7kVKAyTYQqsSMMVISWx0PH17WZ4Mk1ry9i8GE7SzTDpqQ== 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=1722198063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axW4SbGmQ4S9EAbAycCCzMJ1RRmCEtt5wsYw3b25F9A=; b=Z8v4/13eB/xL6fOOkAz4Wh+84TvvJfBk2t8iicFbzQRYd4YOOF4Lq4CE/UiF7GAUfh4U7S vBHWweBDu+MkiFL/zzfMGMnT3Oa6FR3f8d55gayWg1OUiYoHopYQd5fG6HhfC41SW3m+/d Up1PW1rvrq6JsBuXKWPKJPnIgDtrEt99WwGdg8SstEoY/p8bFE5+Nc0T7yHUlcq4WK5NyR AaBHcUNYzE3KMWMRYNJOFghfISXpYg8gRNg8N45g/SvTHXwm2YBanWn1qoiPEF5WcZYHKG htUan95lwd8jXWX4K8K5Fdee7NvFZNrdM2EGRKO0wF1cHYN+727M5jYva7IQ/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 4WXCYW1BKtz14cb; Sun, 28 Jul 2024 20:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SKL3X2045865; Sun, 28 Jul 2024 20:21:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKL3Vl045862; Sun, 28 Jul 2024 20:21:03 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:21:03 GMT Message-Id: <202407282021.46SKL3Vl045862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ruslan Bukin Subject: git: 301ced3b69fb - stable/13 - snd_hdspe(4): Recognize newer firmware's PCI vendor id. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 301ced3b69fb162bb157043c4a8da483cfff56e7 Auto-Submitted: auto-generated The branch stable/13 has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=301ced3b69fb162bb157043c4a8da483cfff56e7 commit 301ced3b69fb162bb157043c4a8da483cfff56e7 Author: Florian Walpen AuthorDate: 2024-04-27 08:48:37 +0000 Commit: Ruslan Bukin CommitDate: 2024-07-28 20:20:04 +0000 snd_hdspe(4): Recognize newer firmware's PCI vendor id. At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI vendor id instead of the Xilinx one. Other HDSPe cards are probably also affected. Update snd_hdspe(4) to recognize both the old Xilinx and the new RME vendor ids. Differential Revision: https://reviews.freebsd.org/D44978 MFC after: 1 day (cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623) --- sys/dev/sound/pci/hdspe.c | 3 ++- sys/dev/sound/pci/hdspe.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 7289bd3401dc..9bd7bc449c70 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -231,7 +231,8 @@ hdspe_probe(device_t dev) { uint32_t rev; - if (pci_get_vendor(dev) == PCI_VENDOR_XILINX && + if ((pci_get_vendor(dev) == PCI_VENDOR_XILINX || + pci_get_vendor(dev) == PCI_VENDOR_RME) && pci_get_device(dev) == PCI_DEVICE_XILINX_HDSPE) { rev = pci_get_revid(dev); switch (rev) { diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index 7056a75a66c1..fc2af2972d1c 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -27,6 +27,7 @@ */ #define PCI_VENDOR_XILINX 0x10ee +#define PCI_VENDOR_RME 0x1d18 /* Newer firmware versions. */ #define PCI_DEVICE_XILINX_HDSPE 0x3fc6 /* AIO, MADI, AES, RayDAT */ #define PCI_CLASS_REVISION 0x08 #define PCI_REVISION_AIO 212 From nobody Sun Jul 28 20:23:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXCcw0FBzz5RbjK; Sun, 28 Jul 2024 20:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXCcv4x9bz4DW8; Sun, 28 Jul 2024 20:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722198239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=491oJw0Y1wH/KweK8hq3opCQp4u9VG2PEEd6Om03gZg=; b=Cch4ledGIztynVp4WUUyAAbLXvW1H8fe2DJ3I2FEUXGjy3ZbUG8BCR668m8wQzsSiGBt7j ZUoklMcFuy/wC9dZ3I7ECWzrar7AOM5R7LmNLEToI5E0VpGB/c//dmm0i3PVgDR0+htbvd QUMXNuFBFtyVr0G2Q2xuy/qAkA2IATc3dJvqV7pz13zMBWdRKHl7Y/yDUu273qxWj4Ivcp uohQj4JUXZmE6M+s5hpJrjwyLrIGJaxMD+ofqQrGcKG8v5wE3Xn8a5hAqAnC+Bx+40w/Ux lHAw1Df/9X6XhG0zyYz9w7rZNd0RrPRz+7AOxr0kZmjao4CAA6D6YpNUibWqRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722198239; a=rsa-sha256; cv=none; b=QrzEJDbffsRLxoV/hJXxp2GasfsdoOZYA641InLogd8ah9cBhbxmZ/Br17BQ5HC0bmlWqY Z/Pz7x21pL56TpaIEcNvdx3IIy0Ts0vyyz5kB+yGNn7kg7s92hjZojT7gdb96oHN95oBXb 7zDODJYeKYqgHfnlSPrOewHcAvWnrVBB0A6E5QC0ik3E4255V5L4w9x90/R1tA6J/N3ybC Sq5ASrMVfrDtVdU+zE+/N2HXdNOejtOQ0UxtJ8hfFxhOMeC05smgq+fCcYYuq+Nbz5+z4N BStCeksZRN0IgA78twbn6LfrERcdiqpIqE+yE9vAV8t9dQaNpHK+K8p/ZOPgiw== 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=1722198239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=491oJw0Y1wH/KweK8hq3opCQp4u9VG2PEEd6Om03gZg=; b=QsUOKVcyvpnzc1x9RpF2BHRRVjWVu2FTkpwYUxHKakCy3kAGXMSWe0d8gXmL1kaC4y3Gkc d5Q9PfZf2r9pkDXdZhFcUvQnX4aWgHgnQFlQR8vz6GIPjShnE13NaA4SS2cw93+LgKxYcO vARSMEzy9zpYcAej3eb4zN9doy+jgoJKwP4HZmrz1Y6WfCyUlAIa6ISmcfO57t1T5dCiEk yrFIlo7o26h98CrBJadVBTq4eHtxaEjYwmnPb3e/RSI3GHicj2JLlX38ghfe9fqHdq5dR7 GWwmcFRM1OacYefT8mo9aSdDWapVdwKHB3C58eVr6sqIsClkpwyUfHKSPvpQFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXCcv4Wrqz14Sx; Sun, 28 Jul 2024 20:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SKNxRg050384; Sun, 28 Jul 2024 20:23:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKNxXP050381; Sun, 28 Jul 2024 20:23:59 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:23:59 GMT Message-Id: <202407282023.46SKNxXP050381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ruslan Bukin Subject: git: 12f6e0a4d2d5 - stable/14 - snd_hdspe(4): Recognize newer firmware's PCI vendor id. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 12f6e0a4d2d5e51c403a45dcaf34928572a88345 Auto-Submitted: auto-generated The branch stable/14 has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=12f6e0a4d2d5e51c403a45dcaf34928572a88345 commit 12f6e0a4d2d5e51c403a45dcaf34928572a88345 Author: Florian Walpen AuthorDate: 2024-04-27 08:48:37 +0000 Commit: Ruslan Bukin CommitDate: 2024-07-28 20:23:07 +0000 snd_hdspe(4): Recognize newer firmware's PCI vendor id. At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI vendor id instead of the Xilinx one. Other HDSPe cards are probably also affected. Update snd_hdspe(4) to recognize both the old Xilinx and the new RME vendor ids. Differential Revision: https://reviews.freebsd.org/D44978 MFC after: 1 day (cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623) --- sys/dev/sound/pci/hdspe.c | 3 ++- sys/dev/sound/pci/hdspe.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 91d1f3ee1bf6..0b378cc3d8f4 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -395,7 +395,8 @@ hdspe_probe(device_t dev) { uint32_t rev; - if (pci_get_vendor(dev) == PCI_VENDOR_XILINX && + if ((pci_get_vendor(dev) == PCI_VENDOR_XILINX || + pci_get_vendor(dev) == PCI_VENDOR_RME) && pci_get_device(dev) == PCI_DEVICE_XILINX_HDSPE) { rev = pci_get_revid(dev); switch (rev) { diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index d5d8dd46e580..56b928b23abd 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -28,6 +28,7 @@ */ #define PCI_VENDOR_XILINX 0x10ee +#define PCI_VENDOR_RME 0x1d18 /* Newer firmware versions. */ #define PCI_DEVICE_XILINX_HDSPE 0x3fc6 /* AIO, MADI, AES, RayDAT */ #define PCI_CLASS_REVISION 0x08 #define PCI_REVISION_AIO 212