From nobody Mon Aug 19 04:02:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnJpG00GLz5Tv0n; Mon, 19 Aug 2024 04:02: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 4WnJpF6hmvz4s2R; Mon, 19 Aug 2024 04:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724040149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uP8SQlaSQSE1ScKuxzlgcwd0OOSKgScF/Fk/5vezJbU=; b=vKoNeooujI110nOVIWyy5ttQR9T3zUrito0uySxxX+a62Sb0wl8VILbjTWzzvrf+fNfGfM IL5s0Tw0z8b1nSnWNvTJALIiG26OcLIWIoubzhH/09eyc0axIhhHLL80IC2d8AOxmNrsIF RFoGSE3rFgWYPe163WyiXS6ORrgrN+Vd5Wxpyx1KhuN0CMhAECscbCNctKdhPytvLJ+br1 PFYw6UFDhwly9h+pPEYEUrSt9pjfTjlkIX9HViBynepzKNoJus8Zg9EZzeSGJEYsy5iYXj O7GJfa0Qfnqk5WwzLXtuNT2K7oCQ4uS+1m/ZrgcT9/sEXF+wtb0olYtsf1rYDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724040149; a=rsa-sha256; cv=none; b=sg2sSUuPu3I3LzSNMIN5lqYhYGM3wKf3Q8FClTqCzy3194A3v4+vY1O5Q1bkVQu+ZWK+7p bV81ynVBVp7oScBop+v7M1qsRkD29g0+fC5a1C6J9LtoDbq8o9Yec2hKZbB2BwjS12AcgJ OVrbbDi8+ScVoJhNfNFkrcfjv16Gj16UfKfjo9oqrCr3b8/my31POJfKcj2t0atLR5iOrw CTWXnbjOPgW+Ar2CHvqlkROLNwdpWJiHo1FJsaxSNd6XxymTSzPa+jh3PSwCOi4q33RnH8 ditX4iQVN/Lm1RIpgCscXG9Ds822IL47p2XumY6JI32jAmk7IVKjAlMrG5Iq1Q== 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=1724040149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uP8SQlaSQSE1ScKuxzlgcwd0OOSKgScF/Fk/5vezJbU=; b=md3BxInPD0cQh2vSt6YNxI2S3SNVqXnukE4nwFqkd7Wj7bpsWiz6zDvGBZ3bEQ+SZMeKFS SxDrSoZmrmjZXI2myMG72510gXSLIi5Nyg5TpOW00XrqM63YEder9lC8VJXfkNTz95ZhxX rGmF0XFsNlMzFaFxp6Ui/igXQyHYn/QKOrnydxZEOx8nDBZe3BAI/o3YBJupUPqcSNQze0 wGshU22JA9DymwfCX+Rb6yY55gWKWT8gOfnmr18aEb9BvLWrcWz/y4SPKFdc2Uwkv5Uq78 E/PgOlJ++mEl0z+/+mVSoKd2ylmdULuw43iWHpElPKq8bCQdVSX5qH9WfuHmJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnJpF6JLcz11cl; Mon, 19 Aug 2024 04:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47J42TDm028369; Mon, 19 Aug 2024 04:02:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47J42TTP028366; Mon, 19 Aug 2024 04:02:29 GMT (envelope-from git) Date: Mon, 19 Aug 2024 04:02:29 GMT Message-Id: <202408190402.47J42TTP028366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 8132e959099f - main - libalias: fix subtle racy problem in outside-inside forwarding List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8132e959099f0c533f698d8fbc17386f9144432f Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=8132e959099f0c533f698d8fbc17386f9144432f commit 8132e959099f0c533f698d8fbc17386f9144432f Author: Eugene Grosbein AuthorDate: 2024-08-19 03:34:37 +0000 Commit: Eugene Grosbein CommitDate: 2024-08-19 03:34:37 +0000 libalias: fix subtle racy problem in outside-inside forwarding sys/netinet/libalias/alias_db.c has internal static function UseLink() that passes a link to CleanupLink() to verify if the link has expired. If so, UseLink() may return NULL. _FindLinkIn()'s usage of UseLink() is not quite correct. Assume there is "redirect_port udp" configured to forward incoming traffic for specific port to some internal address. Such a rule creates partially specified permanent link. After first such packet libalias creates new fully specifiled temporary LINK_UDP with default timeout 60 seconds. Also, in case of low traffic libalias may assign "timestamp" for this new temporary link way in the past because LibAliasTime is updated seldom and can keep old value for tens of seconds, and it will be used for the temporary link. It may happen that next incoming packet for redirected port passed to _FindLinkIn() results in a call to UseLink() that returns NULL due to detected expiration. Immediate return of NULL results in broken translation: either a packet is dropped (deny_incoming mode) or delivered to original destination address instead of internal one. Fix it with additional check for NULL to proceed with a search for original partially specified link. In case of UDP, it also recreates temporary fully specified link with a call to ReLink(). Practical examples are "redirect_port udp" rules for unidirectional SYSLOG protocol (port 514) or some low volume VPN encapsulated in UDP. Thanks to Peter Much for initial analysis and first version of a patch. Reported by: Peter Much PR: 269770 MFC after: 1 week --- sys/netinet/libalias/alias_db.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 167201fa1b8f..d516b6cda96c 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -868,8 +868,15 @@ _FindLinkIn(struct libalias *la, struct in_addr dst_addr, case 0: LIST_FOREACH(lnk, &grp->full, all.in) { if (lnk->dst_addr.s_addr == dst_addr.s_addr && - lnk->dst_port == dst_port) - return (UseLink(la, lnk)); + lnk->dst_port == dst_port) { + struct alias_link *found; + + found = UseLink(la, lnk); + if (found != NULL) + return (found); + /* link expired */ + break; + } } break; case LINK_UNKNOWN_DEST_PORT: From nobody Mon Aug 19 07:59:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnQ493qDfz5SW9q; Mon, 19 Aug 2024 07:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnQ493FVnz49j0; Mon, 19 Aug 2024 07:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724054393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hOChzROT4a0Slhel6P8fSFb2YxbcugCbEy5hX7bxSrk=; b=NqXEZSRS1KTu3mbKR0A5HgWophy+LdEWVNkvEZ32kx5Mp0prvlNxXgL3Lo3NySDn9v3LYe YxEEqLpJ4g2KqjrY+gImqlWIifXP4rkGMKrufglQiFDKau+sG52of7Ys1cSp0FQT//rAGm V+agMebrICdhu32VmKH/9CeNYPg2Ebxf5KT3Ji9iAwc8VqMjxHfd2JT5jVvMst/d1VATMe dDaCey6KD4kojhgeWu1h7pBPGurga/q42UdTVwIbz3P/YyHapwefLN51BO8J0FlDj1/cU6 w1EZELJS9A8u6okqPbf2qukqkAtA/gNg+Hs+l+mWfBN7SAqjSBaEAuT4VWIG/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724054393; a=rsa-sha256; cv=none; b=O1mLaciBIyYZErohI6vacEmSSS8AbOoVk8zqM5+0g0Zj6gzt2hQwc3mvEWOa5Db2bU6rsb cSFq1lnwiFezdCx1c0w44vryoWiibJxnhW18PxkEx8lZpkHMFAuJkn0NQrjCO14hT+X5T/ YEozoRz3HGLqAvt4JRElMQgu9837yU35BgTp7hLqH+ztVcbUdr/2xVp3xWps0HBV6ON3EK M9V4w842cRF1NGwb+LIgFQmAtBcPhJMJ5ZdBrlTNhOehIbxD/xFE1A3ln959wN00l5LPoL U/CmYTFkIKWQV4EDdlkS89Tty9XSASiOge25fLuw9fU9sz0ooOxiJqNYHu126A== 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=1724054393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hOChzROT4a0Slhel6P8fSFb2YxbcugCbEy5hX7bxSrk=; b=KAY36yaUST8sgaaWjWrQ41McIniogDrgjUhI384x8GK7clNUembBVPk9a9JKFATn/XbChL FGkb2pfSX541IQUbDaTSaW5VYkFdIwsPMnQZUl/w9acuJzQ0KrOVMyLHGGQwE2Vtc9h7e8 BXtLWYHaOjO0C0lWG8l12tkyHH9hgNu2t4PmVfQeEP45EgIkoudXLqp2SAg6C0+XPQgk0X XYsX13ZHFj22JRzoCAQNsAiyxyxB31hxM+jXLdthZBI04zNQ6z/XeZEYTE/uJI0Ui9witL WVcAYi2Um5VuanE1t0FUIB5F9HszEvpYEuiMfUTAQiBO2GUMvFudcK/ks5N5Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnQ492kT0z17f9; Mon, 19 Aug 2024 07:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47J7xrj4016358; Mon, 19 Aug 2024 07:59:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47J7xrmg016355; Mon, 19 Aug 2024 07:59:53 GMT (envelope-from git) Date: Mon, 19 Aug 2024 07:59:53 GMT Message-Id: <202408190759.47J7xrmg016355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 308399a179a4 - main - tail -F: fix crash List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 308399a179a49b7b858c725de10177fdb0502fd2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=308399a179a49b7b858c725de10177fdb0502fd2 commit 308399a179a49b7b858c725de10177fdb0502fd2 Author: Andre Albsmeier AuthorDate: 2024-08-19 07:54:24 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-19 07:54:24 +0000 tail -F: fix crash When show() detects an error and closes the file and follow() wants to close it again, a NULL dereference occurs. PR: 280910 MFC after: 1 week --- usr.bin/tail/forward.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index a5303385a74f..6d9db94a827f 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -379,7 +379,8 @@ follow(file_info_t *files, enum STYLE style, off_t off) sb2.st_dev != file->st.st_dev || sb2.st_nlink == 0) { show(file); - fclose(file->fp); + if (file->fp != NULL) + fclose(file->fp); file->fp = ftmp; memcpy(&file->st, &sb2, sizeof(struct stat)); From nobody Mon Aug 19 08:30:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnQlB0cbWz5SYpL; Mon, 19 Aug 2024 08:30: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 4WnQlB06Cdz4F0X; Mon, 19 Aug 2024 08:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724056214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pRy7Nd9eL2ws22T/yH6eDJGnGzZHHwBm7W8P7ZEyU/8=; b=yrIZdMRhtKKAss4NGTVPD+syucBtBAceux6xpy7kbxL4F4q1zaeV57j/3iHx//N+g/t7YF +V9nAwEcxLW8ELEwmJIN7ycIkyxfyjH/5pd4/+c+2jIiFq5GYZfSESIMNDXXgYKlZ3Y46G TDBiZuuCm9Ru924no0fnolaa6Ea3Cg4hj0nXGebqu9EbMDT9YeuMKPsiEXGB+cpqfqovsn 34+xLUhUsulUDae1wVK/i4QUJWUkxcufNHfVO0R6ARVs8b9C8vW7sdtxJhO/VHUWRNLTrP vbi9cu5igKG0yTzX9FWyKSzmr5aJ9xqglVP6Mw56K5P7daKaOd0Xrvo0TiwFYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724056214; a=rsa-sha256; cv=none; b=pWKoB8Z4IvNxwMlvNQ0ftBiyANBbq5b4ziYYncB630WpJb+St4lDInHHfx3/CXt2QK4VmE pGLHyP+cEs6KgSbSOg5B+3PzxSx3bkjM9iXEbmrYwYiV4OXXl1shDu9AGXUeVrN1S+KNUt /QcjmJDwdipcpSAVL2rXoxNKZvvPC5a8VbtIsA4jwG3xJeATrAQSe1vU4rr7gIN9Bn7UiW XbfaiFIlOsY1ucTXRoNfMnWdmluX95BKiQaWxiQp2hso0K1H1fdO/5zKU8UKQ/ygeqNBt4 jEk6wZmOMHrqZazCMUEobduros/d/zBuie1DcNwtnWmH/FRrI93nYoFpiYgw0w== 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=1724056214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pRy7Nd9eL2ws22T/yH6eDJGnGzZHHwBm7W8P7ZEyU/8=; b=pbS+3NeCLAxOYRIYx/G6cBzzzCMDSb2BE752c1aNABvMpKpMZbPpmRmckNa5vTirSfZokf QaxksuI8f8d7XV7nARteNmQzuUbh1Bwq+FWWIPP+8MU/ha3XcM1jHqWRjOGO3t91b0xKAo 627PzVhP1j9J2UeUf8pSNQ05HqQP+BnSLaH5B04f2Q7ywkY0eSnxGPVEnaX9zJKVafrpgd G8D3VUf7a0UUQGwVCR13Dbsp48oPgL3QMgOR46YjjlGqLkQAAnvP2tD4M8QT9v/XJDrpCe tv+BVdomEz23VedKUg1ING/ohVWXVEX3iBZE1HmwMN2eCNy2aF8dXRqARGInYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnQl96q9jz18Tm; Mon, 19 Aug 2024 08:30: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 47J8UD8K074256; Mon, 19 Aug 2024 08:30:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47J8UDWL074243; Mon, 19 Aug 2024 08:30:13 GMT (envelope-from git) Date: Mon, 19 Aug 2024 08:30:13 GMT Message-Id: <202408190830.47J8UDWL074243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 9ff2ebd92891 - main - adduser: Better document ZFS dataset creation. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ff2ebd92891b6953bbe44c6d6a6d8bc31f5139f Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9ff2ebd92891b6953bbe44c6d6a6d8bc31f5139f commit 9ff2ebd92891b6953bbe44c6d6a6d8bc31f5139f Author: Dag-Erling Smørgrav AuthorDate: 2024-08-19 08:30:01 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-19 08:30:11 +0000 adduser: Better document ZFS dataset creation. MFC after: 3 days PR: 280873 Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D46316 --- usr.sbin/adduser/adduser.conf.5 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.conf.5 b/usr.sbin/adduser/adduser.conf.5 index 09b80f2df021..9663926ee341 100644 --- a/usr.sbin/adduser/adduser.conf.5 +++ b/usr.sbin/adduser/adduser.conf.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 12, 2007 +.Dd August 18, 2024 .Dt ADDUSER.CONF 5 .Os .Sh NAME @@ -171,8 +171,12 @@ The default information to be held in the GECOS field of .It Va uidstart The default user ID setting. This must be a number above 1000 and fewer than 65534. -.It Va Zflag -Do not attempt to create ZFS home dataset. +.It Va Zcreate +Set to +.Dq no +to prevent the creation of a ZFS home dataset if +.Va homeprefix +is a ZFS mountpoint. .El .Sh EXAMPLES The following is an example From nobody Mon Aug 19 11:03:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV7w5g5Sz5Sp3f; Mon, 19 Aug 2024 11:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV7w4yC9z4S1x; Mon, 19 Aug 2024 11:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyZasvq2xhSTrD5V1Nn/xAPkdp48WqhSo2iXOL9bKBE=; b=oR2gUx4tVQaldAfxv59OKEIZBjiIrqa3gZKj7l8Uwam5BzNaVqAGSP9e3toKoICpWKqALa O/O3uWIRfG0B4ybuaoABZ5fop85kjvxcHMp0E6JKdKfcVCkdV/fkCJWWAwC9ordFG1JwUV UAUdqHAZ2zNw+HBKUe/tUk9qDxMmzA07WFKtZ76Ocg/rhe4C9ndl8h7QtC/1AM37Bw/hTF GQYWue44EOtuPvuejZhnJzvx+reppshxwUCVOQqRV5e8VsP+yxmu6DSqu/08MOMAomw9yX Q2GigNYY1DZFR7Ncn0CVJsHADFX5JThtkL3PPLey+zdhGj6kh3JcIM4T5wOnMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065404; a=rsa-sha256; cv=none; b=rOgezABVffJtAQL7UYz+Mc7Nw/XAQm6JmtV5EpkQ9IgfEm/4B8CPURbBewO+zIYMBCqpah 55UkUVp/d7DeFe4MpxilfXuDRbXGF33VdmX6kTmRiTjerHgpDE9vikVJ4lYlV6/Q669T6b 1NxvGVaaOO1p1T9uRjZYHRWJQzAkdYUbhaHcANrmAkS3x8HlsWV6hoxwca5noDATtqJ5fT TMydGvo+4947NSmBCoh5isgUBPkcm0bTK9joF7yD2dmqYgX3cQUKcuNHd8bzQx5mOke2a3 96tN2EuIRGqOyXP3jhC2V+diWU+TTiyNHk9t4wV+l9iLiOFxMRb/SCLWVF5R3g== 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=1724065404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyZasvq2xhSTrD5V1Nn/xAPkdp48WqhSo2iXOL9bKBE=; b=aI609e7ZTcztf2PGU/kudERao7FMiGzUycum6H6AJIsobQMzE9yA16Unu/yXQ34tASXV41 PnMV8sHOO5Y9JVThx4qOwHH0qhoYwt+eiuPTSRY4cikwmY3OHuNE4kjNGFgBIlYU+L+/gK jmomr2tHfJQ32ooKFxyZdtI1G3b4hiHlaroaiiDdlJJ1CDu7Jk1fwYODScXY87P3YzLPxY cleYYTq/CAhEIQn/Gq8jYCk977CMlXvrZt7ODdN8Cjl2TMfPZ06qHyXd1z0kDC8LAB2JQQ zjUSaVWV1gRCk6gpHr9EYEWTLCGuuF6fXbTt5PGRczjcUCxJWFHiTjUg5o7Qsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV7w4YcNzF9l; Mon, 19 Aug 2024 11:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JB3Ooh037441; Mon, 19 Aug 2024 11:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3OVp037438; Mon, 19 Aug 2024 11:03:24 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:24 GMT Message-Id: <202408191103.47JB3OVp037438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5048308bdb76 - main - buf_ring: Remove PREFETCH_DEFINED List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5048308bdb76f40e88c9133658fc61d82158ded2 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5048308bdb76f40e88c9133658fc61d82158ded2 commit 5048308bdb76f40e88c9133658fc61d82158ded2 Author: Andrew Turner AuthorDate: 2024-07-29 10:28:15 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 09:04:24 +0000 buf_ring: Remove PREFETCH_DEFINED I'm not able to find anything in the tree that ever defined it. Remove as it's unused so is untested. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46148 --- sys/sys/buf_ring.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index cb18175c3a75..6bd3b91dcd04 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -165,9 +165,6 @@ static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { uint32_t cons_head, cons_next; -#ifdef PREFETCH_DEFINED - uint32_t cons_next_next; -#endif uint32_t prod_tail; void *buf; @@ -204,20 +201,10 @@ buf_ring_dequeue_sc(struct buf_ring *br) prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = (cons_head + 1) & br->br_cons_mask; -#ifdef PREFETCH_DEFINED - cons_next_next = (cons_head + 2) & br->br_cons_mask; -#endif if (cons_head == prod_tail) return (NULL); -#ifdef PREFETCH_DEFINED - if (cons_next != prod_tail) { - prefetch(br->br_ring[cons_next]); - if (cons_next_next != prod_tail) - prefetch(br->br_ring[cons_next_next]); - } -#endif br->br_cons_head = cons_next; buf = br->br_ring[cons_head]; From nobody Mon Aug 19 11:03:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV7x6mKRz5SnrY; Mon, 19 Aug 2024 11:03: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 4WnV7x5wqLz4SNk; Mon, 19 Aug 2024 11:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=78YzzI4MmWJ57l6qxJmju6yID0HUfOwjUuohaY56j44=; b=sx6g2NkeHuajId1QON9T9nCgxc9Iqh3okpjn3dOzBla3WMro/kbZNwOTE6/f1qdLVusaji QwR/fR3u1GC8Rsh7KiYPqi4e//FkenJaRQ/U6bjjrOwAniSWA15OBVn++/rnqgJW67nW/i ggwaQtxwx7MXKilU62xLjbl/QegctQlcxEyAlwBQdZNOKlAzF5Wl/3uGF/QcxEcyEpba2d ZPdQ0hNiVLUL0p6YVCw9aURw/TRJ00LVZTJjzCqRjXoPFEymyYe9UTYYKq+fQrD1y1qzbs eZzeNR05/idTH2rdpfjlmTEOlwDLJGT9KcJVreiyjP5hdHqep7qvpFRVlvIUZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065405; a=rsa-sha256; cv=none; b=b30NLxHyAR01PIYU2HSSO/lm6mmYFgCjLeYA/Y4smWi0bROphDljxXFxp8AqeN/B843hl9 2LBF62dkFgpNEvKPx9sss3WpSZU6w/01v7usTQFxooVM+XY7Bj9iIVwzAVxUNqtgR+rK6m wF2dYS/hN0Ji0I3Ff6A40gPBMQl/EbRKsqr4PlARbBAx08hJKNWlv6/EtQhiwPYVUqc7wU A+1TK0cEjBEqHMy/VW4YLybnj8ybXqheO85VyhKWlrzXzaMZK8RoRYibpd1kmUH7YFC2MV FE23/+JJKz3bz7rA2gNsvPMXtVuAOun/eQhunDk54VIDlvqbZ3jOazouppmYFA== 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=1724065405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=78YzzI4MmWJ57l6qxJmju6yID0HUfOwjUuohaY56j44=; b=JNTyqCrGlOJf5qNhaKbA0zLTSwY8tzKEhu1yudr2KkpM6nefp3/oncfkZq8ek+ndobVRx4 V2sfLd4iZx7af6p4rRov4zkzmqeZFm7ePBOSzTvk6L38FZc3r+UZRtUvdt1B4Zyzu5Xbho CP5ZO3L7TUXx59ait+WZ1vs3lTE9oYUfncyR+uauxpMBGPjLXx2es74FpOvnL50TT4JoC7 TtfDqjVNL0moJQiSktSd5f75ywJGbkRdAI0zkf8g1WRj+7G+aYuMdRzQFrrRs5VAG/0u42 QDLbaaXeXQ66JA+VNVyApI7K7ePG3ucnWND0G1bKbS4z0yaSz6pXwbs7MoKwDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV7x5X46zFGj; Mon, 19 Aug 2024 11:03: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 47JB3Peb037492; Mon, 19 Aug 2024 11:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3PjZ037489; Mon, 19 Aug 2024 11:03:25 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:25 GMT Message-Id: <202408191103.47JB3PjZ037489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d3d34d56bee4 - main - buf_ring: Support DEBUG_BUFRING in userspace List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3d34d56bee4222b3bf3ec26d7877998405115a3 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d3d34d56bee4222b3bf3ec26d7877998405115a3 commit d3d34d56bee4222b3bf3ec26d7877998405115a3 Author: Andrew Turner AuthorDate: 2024-07-29 10:28:24 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 09:04:25 +0000 buf_ring: Support DEBUG_BUFRING in userspace The only part of DEBUG_BUFRING we don't support in userspace is the mutex checks. Add _KERNEL checks around these so we can enable the extra debugging. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46149 --- sys/sys/buf_ring.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 6bd3b91dcd04..2d61f393712d 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -35,13 +35,9 @@ #include #include -#ifdef DEBUG_BUFRING -#ifdef _KERNEL +#if defined(DEBUG_BUFRING) && defined(_KERNEL) #include #include -#else -#error "DEBUG_BUFRING is only supported in kernel" -#endif #endif struct buf_ring { @@ -54,7 +50,7 @@ struct buf_ring { volatile uint32_t br_cons_tail; int br_cons_size; int br_cons_mask; -#ifdef DEBUG_BUFRING +#if defined(DEBUG_BUFRING) && defined(_KERNEL) struct mtx *br_lock; #endif void *br_ring[0] __aligned(CACHE_LINE_SIZE); @@ -210,8 +206,10 @@ buf_ring_dequeue_sc(struct buf_ring *br) #ifdef DEBUG_BUFRING br->br_ring[cons_head] = NULL; +#ifdef _KERNEL if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); +#endif if (br->br_cons_tail != cons_head) panic("inconsistent list cons_tail=%d cons_head=%d", br->br_cons_tail, cons_head); @@ -277,7 +275,7 @@ static __inline void * buf_ring_peek(struct buf_ring *br) { -#ifdef DEBUG_BUFRING +#if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif @@ -296,9 +294,9 @@ buf_ring_peek(struct buf_ring *br) static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { -#ifdef DEBUG_BUFRING void *ret; +#if defined(DEBUG_BUFRING) && defined(_KERNEL) if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif @@ -320,17 +318,15 @@ buf_ring_peek_clear_sc(struct buf_ring *br) atomic_thread_fence_acq(); #endif + ret = br->br_ring[br->br_cons_head]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - ret = br->br_ring[br->br_cons_head]; br->br_ring[br->br_cons_head] = NULL; - return (ret); -#else - return (br->br_ring[br->br_cons_head]); #endif + return (ret); } static __inline int From nobody Mon Aug 19 11:03:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV7z2QMWz5Sp3j; Mon, 19 Aug 2024 11:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV7y6VZcz4S9t; Mon, 19 Aug 2024 11:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ubS5qKs/Q1caEnUii0RLyNExt4BWYhHHC86nb4K9YNk=; b=O2DzsKIsn23TEAOye/xkyp2GhnjeuGhHQ8AVsfyFQxBMXGCQa7SsjKtxwTXjwL2Oot6+cn Q0LH+01n2LqbvD9L0LEv+rV01q3V/yrf9Taj50XdG3cC+IBPyHz7XCmtFSqwRFhQHJk/kx Zc3KM5x0JwnTlsjZWNBNSiZJcSSn46zqBLXfxobYR9XlxYpeNFOFklQ4hWiLkjhfPJvU9v 4IOm6icpukPxZwrGl/HguWrvH+dgXsKYk5yX+y3TKbrBktkLw08VkbZ7XgJ9Fhh+MCNKbH GCdPHhGDjBaI7WHLfd2VHPqRoZVm0ZM3i3otBZErvO0UDVKHrQrebtO4yRXYqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065406; a=rsa-sha256; cv=none; b=ypIpYHgbFnPwjEC1Gb8ApSgcC2QNwQNKm7QxrX5p9OO8Lqbna8obfKSAmsWFgJ+c+Wu2oV krd4RcFoNkwk0zPvaaDNJoItJoJ4lo/Uen16oskd3D2RQNIUAmq6maK3r8KV3IUGZBpGY0 2jpIfU2Zlbm0Gx/mZf1d7jQqGPtqE/0eH2UzRZ7vd/ZCaC2s4mlzNwUjuXM/0DMHMxxFF0 M4c4gmwbYbm0KO5D705O5nDj8BZ6jENBSEqthCjCeQ0FGkDEX0CWCMBSnnGsQeunvh77Tb ERW4ECRawruEdh+oJChuYfjNPI9cqEDuUDJln2hfBdXbN7kS1sjBo5D4NVqhkw== 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=1724065406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ubS5qKs/Q1caEnUii0RLyNExt4BWYhHHC86nb4K9YNk=; b=e/qyTMX7BexJ74vnQUFVckpPaeJ8lK2UKJveyYunZU3nwV4hpwsT2z5EyO3xzHvZ6V/du5 doWakGkqsUaBPuvFCJlA6u8ZFZ9Y3v4d/E7CkNvoKtuNsbY4dlQp8993CFkW2vo0Yb37Fa mG96NxTJLAv0kQEU+XtPCMWnPk5gXK4ofmqHkgIoLPKIHrlaaBS77k0ENLZCDkTV8n5EvN fT5s2LlYxdLp63orCVe/jhOViKQG46UBlR4KneisTORsfoxfOaCwPPcje5aabVWH0VR6N+ 7ElYS1TnToaQQGuzaLcE8Fu1MB1WaZZlMjLJaJProjcMIZ7/6DIjv47Q4vQ1zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV7y60dnzFGk; Mon, 19 Aug 2024 11:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JB3QgH037531; Mon, 19 Aug 2024 11:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3QIA037528; Mon, 19 Aug 2024 11:03:26 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:26 GMT Message-Id: <202408191103.47JB3QIA037528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 17a597bc13aa - main - buf_ring: Consistently use atomic_*_32 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17a597bc13aa59ee90facaf9b8dada80f32eb52d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=17a597bc13aa59ee90facaf9b8dada80f32eb52d commit 17a597bc13aa59ee90facaf9b8dada80f32eb52d Author: Andrew Turner AuthorDate: 2024-07-29 10:28:33 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 09:04:25 +0000 buf_ring: Consistently use atomic_*_32 We are operating on uint32_t values, use uint32_t atomic functions. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46150 --- sys/sys/buf_ring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 2d61f393712d..47ed04f570c1 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -94,7 +94,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) } continue; } - } while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); #ifdef DEBUG_BUFRING if (br->br_ring[prod_head] != NULL) panic("dangling value in enqueue"); @@ -108,7 +108,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) */ while (br->br_prod_tail != prod_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_prod_tail, prod_next); + atomic_store_rel_32(&br->br_prod_tail, prod_next); critical_exit(); return (0); } @@ -132,7 +132,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_exit(); return (NULL); } - } while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next)); + } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); buf = br->br_ring[cons_head]; #ifdef DEBUG_BUFRING @@ -146,7 +146,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) while (br->br_cons_tail != cons_head) cpu_spinwait(); - atomic_store_rel_int(&br->br_cons_tail, cons_next); + atomic_store_rel_32(&br->br_cons_tail, cons_next); critical_exit(); return (buf); From nobody Mon Aug 19 11:03:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV804MRXz5Sp3k; Mon, 19 Aug 2024 11:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV800lV8z4S4g; Mon, 19 Aug 2024 11:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2qKiVXgt2UGnU1IZ/WjHqpqFxnoShxJVjCCCDLXbhA=; b=vSoA5Q2miQ0XiA0xc4s72lv5a+XCnei8inW7il62XNzNUcNj868pJ5hSeloBIkY/LgkDnX Z54yWUExS6CbvoyxSpoBywllSK5S8aLl2z9kHQQ8+OxEF8er/yeC3PhoWHIiEC7mdvuiqY LS/MHUh2rSWcOPEFq5AetEuOzZsMBPwPfmf/oFrtCtIAVzlCFLtu5h8zfrYo9sd1DhESXt UOKBr/rw67vvl7pg8I20hkwpzujKyZG+UX0hhSTxAthBktJqPDGJ9qhIqsF0hXmDwjeLvM NRoW1Fb1cYuyKkOZyVkhO/5XTkmASjqytGM2ArVS661Y622XcJRNp8vuEpvW9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065408; a=rsa-sha256; cv=none; b=lNavcJKwOVugYAsIHJSEwBi+qcGCYAeEUjSrajpV2RSZAQC9MyUGNrm4+thpcD3L6BCBnc BNzI8HvzGyRzukAXMCctSe+V0goCXhRquu37GTTg7KODC2+t4PO+0XK5l6CfNd93LFSb9t g97YHvjJZ4QN6wr6uSROHOL4fVlxlrsnAWnOXx7FH/mRpaS2H8ARGWC9Z0fFkhdESU0a5M vcBOpI2IZNKH0Y41EmcEZ6GnRGiT0KdO58OsUMxW9N5EgnByV/q1vC68OE8Sr8rflB0QI/ 26g8fyfiiV4vfbuKU8yxVDtO79tSGAF/qGWUge2uGFiOka0pC/N2I3X9+Rl53g== 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=1724065408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2qKiVXgt2UGnU1IZ/WjHqpqFxnoShxJVjCCCDLXbhA=; b=Ts+Zct1aQaJ4iKPny4y2+pbM+KLziLPFlBBx3p091FUe4+GBIsmY3VKwUQiwGe1FlDpp1m c+eIeoUASCZ/TOTgI0ra7/mZAyTvGTEJSCVh84QEjV8IEfkGYOkdVb7DZ17fdb+WhMAo0y GTAe7JR+IsuMH7Hb+uOzmIbw5fOQI8q8B58rfWDcm0gPs8TrIvs/mkXUPzulnCyUeIE5QT Bab3SSLdTTyB+YimiXafNHUP6iT2DBtorErVMLEQpJwIZmtW/BGhMat9GfyM1wyyoOzDqc p+z+pz1WmixcpBut6+7iZM/hQZfpsNUd/HFYgmww3wXcPsD3aR5FIBkHT0Flig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV800HKTzF9m; Mon, 19 Aug 2024 11:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JB3RvH037590; Mon, 19 Aug 2024 11:03:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3RwZ037587; Mon, 19 Aug 2024 11:03:27 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:27 GMT Message-Id: <202408191103.47JB3RwZ037587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3cc603909e09 - main - buf_ring: Keep the full head and tail values List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cc603909e09c958e20dd5a8a341f62f29e33a07 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3cc603909e09c958e20dd5a8a341f62f29e33a07 commit 3cc603909e09c958e20dd5a8a341f62f29e33a07 Author: Andrew Turner AuthorDate: 2024-08-19 09:06:44 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:11 +0000 buf_ring: Keep the full head and tail values If a thread reads the head but then sleeps for long enough that another thread fills the ring and leaves the new head with the expected value then the cmpset can pass when it should have failed. To work around this keep the full head and tail value and use the upper bits as a generation count. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46151 --- sys/sys/buf_ring.h | 87 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 31 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 47ed04f570c1..dec0f971ae44 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -40,6 +40,15 @@ #include #endif +/* + * We only apply the mask to the head and tail values when calculating the + * index into br_ring to access. This means the upper bits can be used as + * epoch to reduce the chance the atomic_cmpset succeedes when it should + * fail, e.g. when the head wraps while the CPU is in an interrupt. This + * is a probablistic fix as there is still a very unlikely chance the + * value wraps back to the expected value. + * + */ struct buf_ring { volatile uint32_t br_prod_head; volatile uint32_t br_prod_tail; @@ -63,28 +72,28 @@ struct buf_ring { static __inline int buf_ring_enqueue(struct buf_ring *br, void *buf) { - uint32_t prod_head, prod_next, cons_tail; -#ifdef DEBUG_BUFRING - int i; + uint32_t prod_head, prod_next, prod_idx; + uint32_t cons_tail, mask; + mask = br->br_prod_mask; +#ifdef DEBUG_BUFRING /* * Note: It is possible to encounter an mbuf that was removed * via drbr_peek(), and then re-added via drbr_putback() and * trigger a spurious panic. */ - for (i = br->br_cons_head; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if (br->br_ring[i] == buf) + for (uint32_t i = br->br_cons_head; i != br->br_prod_head; i++) + if (br->br_ring[i & mask] == buf) panic("buf=%p already enqueue at %d prod=%d cons=%d", buf, i, br->br_prod_tail, br->br_cons_tail); #endif critical_enter(); do { prod_head = br->br_prod_head; - prod_next = (prod_head + 1) & br->br_prod_mask; + prod_next = prod_head + 1; cons_tail = br->br_cons_tail; - if (prod_next == cons_tail) { + if ((int32_t)(cons_tail + br->br_prod_size - prod_next) < 1) { rmb(); if (prod_head == br->br_prod_head && cons_tail == br->br_cons_tail) { @@ -95,11 +104,12 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) continue; } } while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next)); + prod_idx = prod_head & mask; #ifdef DEBUG_BUFRING - if (br->br_ring[prod_head] != NULL) + if (br->br_ring[prod_idx] != NULL) panic("dangling value in enqueue"); #endif - br->br_ring[prod_head] = buf; + br->br_ring[prod_idx] = buf; /* * If there are other enqueues in progress @@ -120,23 +130,26 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { - uint32_t cons_head, cons_next; + uint32_t cons_head, cons_next, cons_idx; + uint32_t mask; void *buf; critical_enter(); + mask = br->br_cons_mask; do { cons_head = br->br_cons_head; - cons_next = (cons_head + 1) & br->br_cons_mask; + cons_next = cons_head + 1; if (cons_head == br->br_prod_tail) { critical_exit(); return (NULL); } } while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next)); + cons_idx = cons_head & mask; - buf = br->br_ring[cons_head]; + buf = br->br_ring[cons_idx]; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_idx] = NULL; #endif /* * If there are other dequeues in progress @@ -160,8 +173,8 @@ buf_ring_dequeue_mc(struct buf_ring *br) static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next; - uint32_t prod_tail; + uint32_t cons_head, cons_next, cons_idx; + uint32_t prod_tail, mask; void *buf; /* @@ -189,6 +202,7 @@ buf_ring_dequeue_sc(struct buf_ring *br) * * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. */ + mask = br->br_cons_mask; #if defined(__arm__) || defined(__aarch64__) cons_head = atomic_load_acq_32(&br->br_cons_head); #else @@ -196,16 +210,17 @@ buf_ring_dequeue_sc(struct buf_ring *br) #endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); - cons_next = (cons_head + 1) & br->br_cons_mask; + cons_next = cons_head + 1; - if (cons_head == prod_tail) + if (cons_head == prod_tail) return (NULL); + cons_idx = cons_head & mask; br->br_cons_head = cons_next; - buf = br->br_ring[cons_head]; + buf = br->br_ring[cons_idx]; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_idx] = NULL; #ifdef _KERNEL if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); @@ -226,18 +241,21 @@ buf_ring_dequeue_sc(struct buf_ring *br) static __inline void buf_ring_advance_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next; - uint32_t prod_tail; + uint32_t cons_head, cons_next, prod_tail; +#ifdef DEBUG_BUFRING + uint32_t mask; + mask = br->br_cons_mask; +#endif cons_head = br->br_cons_head; prod_tail = br->br_prod_tail; - cons_next = (cons_head + 1) & br->br_cons_mask; - if (cons_head == prod_tail) + cons_next = cons_head + 1; + if (cons_head == prod_tail) return; br->br_cons_head = cons_next; #ifdef DEBUG_BUFRING - br->br_ring[cons_head] = NULL; + br->br_ring[cons_head & mask] = NULL; #endif br->br_cons_tail = cons_next; } @@ -261,9 +279,12 @@ buf_ring_advance_sc(struct buf_ring *br) static __inline void buf_ring_putback_sc(struct buf_ring *br, void *new) { - KASSERT(br->br_cons_head != br->br_prod_tail, + uint32_t mask; + + mask = br->br_cons_mask; + KASSERT((br->br_cons_head & mask) != (br->br_prod_tail & mask), ("Buf-Ring has none in putback")) ; - br->br_ring[br->br_cons_head] = new; + br->br_ring[br->br_cons_head & mask] = new; } /* @@ -274,11 +295,13 @@ buf_ring_putback_sc(struct buf_ring *br, void *new) static __inline void * buf_ring_peek(struct buf_ring *br) { + uint32_t mask; #if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif + mask = br->br_cons_mask; /* * I believe it is safe to not have a memory barrier * here because we control cons and tail is worst case @@ -288,12 +311,13 @@ buf_ring_peek(struct buf_ring *br) if (br->br_cons_head == br->br_prod_tail) return (NULL); - return (br->br_ring[br->br_cons_head]); + return (br->br_ring[br->br_cons_head & mask]); } static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { + uint32_t mask; void *ret; #if defined(DEBUG_BUFRING) && defined(_KERNEL) @@ -301,6 +325,7 @@ buf_ring_peek_clear_sc(struct buf_ring *br) panic("lock not held on single consumer dequeue"); #endif + mask = br->br_cons_mask; if (br->br_cons_head == br->br_prod_tail) return (NULL); @@ -318,13 +343,13 @@ buf_ring_peek_clear_sc(struct buf_ring *br) atomic_thread_fence_acq(); #endif - ret = br->br_ring[br->br_cons_head]; + ret = br->br_ring[br->br_cons_head & mask]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - br->br_ring[br->br_cons_head] = NULL; + br->br_ring[br->br_cons_head & mask] = NULL; #endif return (ret); } @@ -333,7 +358,7 @@ static __inline int buf_ring_full(struct buf_ring *br) { - return (((br->br_prod_head + 1) & br->br_prod_mask) == br->br_cons_tail); + return (br->br_prod_head == br->br_cons_tail + br->br_cons_size - 1); } static __inline int From nobody Mon Aug 19 11:03:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV813zsTz5Sp3n; Mon, 19 Aug 2024 11:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV811d17z4SGJ; Mon, 19 Aug 2024 11:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQ0dvsMgLj7PwRKrpc8qJbG0/fWN85A+XLYP2OroQ+w=; b=jAAzp6zfTkJ54ouwiviTTuGDKgXALscuiR6LMcESoRq70Wom9SKiWid+go51JIsUw0qSEL qzd2ACSkTkK2YVXPzl8VZfUs7fKzL7FbmiIhgLrw+gjLhOw8x/qIGFDctlakWpTcV90L27 XNjBxnw8JPwUyCtxzIjZ8JCbpycbHymzvGclRCBLAXVkP5belKbKUufowKcbwbRomYYr42 auRrcKhK+cRToBPsigq26NjYdPQUzIOtYiJ5v7poAoYn5FWDoSn9Sf6GMuzsGR8kGtMF2f tP4BLBhfmEoS7cgjPf1qgUCtaCNFtGOcOgYyo0J6QUxrbZmW4hrd+PH8POwQOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065409; a=rsa-sha256; cv=none; b=C9YvcEjh7ZjQPAxNNEdXN+Bo6hCQB9TXUGtrZ6w0+PinEPTY5qK9vyqeS5T7R50/VjoPQe 5AaB2vXYvi+yKbEAk3oXczxzHIBDBRSU3ceBdV/X4iSEwkwE2YHr36h06JflyZTfPN5thG HTp8QqK/tYD2NP8pwct7zTtGco+VY5mA2kVMl3FjPPaU3AmuYoy8eNgMDs9VPjYNtAOud1 HXGo+oITBg/u1DHaiDfgPb+WL7JuNwda/dQC8nFLxRaj+SA2CE5yx2P6hVoI8WUMY4VLSj FLiqR3WcEhx7z5U6Kco7DAQCCPPk8UlLiTJ8gFFPJRf0rdZCg/cHqHU/TDwMIg== 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=1724065409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQ0dvsMgLj7PwRKrpc8qJbG0/fWN85A+XLYP2OroQ+w=; b=BZvH0tBrQ8Mtqgt6efGjzRCUbNPEueGXrN3uM6AtFXcX1rYLDM9df8GOCITRypHv70arcu ZNd71EvgHEMAgtbgkDgWsjjk+DbZVX8fiSUcRk3Tx12Yz/9wvOoQjc6+Tt+FdeqxU+J+we 6IXMAIBj0MP9UJFNhYQPlkGFX8FTQIBsS7LG1OQG7o1taXQzxX3HeEVIhZzEzb7iQcyBFl TCQzSv2Yuj9ofx1L4NnbwEqtMBLpuQKkPUCMhC1CEBkAumVcyEZei6+gehycg3VE4lqIl9 GnOxcm0p57Is1ovwgTu2lc0+54sgh1YUPWYxWihoKcDHjfcW2kYCT/+EU9CAJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV811F1BzF9n; Mon, 19 Aug 2024 11:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JB3TsF037635; Mon, 19 Aug 2024 11:03:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3T2R037632; Mon, 19 Aug 2024 11:03:29 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:29 GMT Message-Id: <202408191103.47JB3T2R037632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 44e1cfca417c - main - buf_ring: Use atomic operations with br_cons_tail List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44e1cfca417c5ef0db908f3836ec3ba704ef1de2 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=44e1cfca417c5ef0db908f3836ec3ba704ef1de2 commit 44e1cfca417c5ef0db908f3836ec3ba704ef1de2 Author: Andrew Turner AuthorDate: 2024-08-19 09:06:52 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:11 +0000 buf_ring: Use atomic operations with br_cons_tail Use an atomic operation with a memory barrier loading br_cons_tail from the producer thread and storing to it in the consumer thread. On dequeue we need to read the pointer value from the buf_ring before moving the consumer tail as that indicates the entry is available to be used. The store release atomic operation guarantees this. In the enqueueing thread we then need to use a load acquire atomic operation to ensure writing to this entry can only happen after the tail has been read and checked. Reported by: Ali Saidi Co-developed by: Ali Saidi Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46152 --- sys/sys/buf_ring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index dec0f971ae44..9aeb5aa19fa8 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -91,7 +91,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) do { prod_head = br->br_prod_head; prod_next = prod_head + 1; - cons_tail = br->br_cons_tail; + cons_tail = atomic_load_acq_32(&br->br_cons_tail); if ((int32_t)(cons_tail + br->br_prod_size - prod_next) < 1) { rmb(); @@ -229,7 +229,7 @@ buf_ring_dequeue_sc(struct buf_ring *br) panic("inconsistent list cons_tail=%d cons_head=%d", br->br_cons_tail, cons_head); #endif - br->br_cons_tail = cons_next; + atomic_store_rel_32(&br->br_cons_tail, cons_next); return (buf); } @@ -257,7 +257,7 @@ buf_ring_advance_sc(struct buf_ring *br) #ifdef DEBUG_BUFRING br->br_ring[cons_head & mask] = NULL; #endif - br->br_cons_tail = cons_next; + atomic_store_rel_32(&br->br_cons_tail, cons_next); } /* From nobody Mon Aug 19 11:03:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV826dX6z5Sp4G; Mon, 19 Aug 2024 11:03: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 4WnV8232pTz4SJl; Mon, 19 Aug 2024 11:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWpjo1Qa0JlWKelNRak1F1cukWCbaVw7q7/oSpHu3gI=; b=Gohhvc8ZEePr40eov9JQ1i6QfcK6TgMrxeGaSYrst0URuizdfkm7kICwKuvBfikosIGJUo iWDZ8kVP1+e10ggat4ifmb7eeLD4yJDGk596e38RraN9TvLUjOmRoIBFU5KE/TKPfbXHFS WAH+V+8smzMb8E4qDpjPBEOgvCxFUTuDzr3MPpojwtO0CSCUFNrFciKI0qryWhg6u21nNH ev4hsj24bvHb31Vu6HexBCIEqcH0io3vY63RFuP5tKOktczA946g9s1v4nEHmMTqx/l1pz 2uKTlvpbEoLtG1rMwNq5dI+b+MKrbly4P8Axdwf/Qr7LjwOuWnrexnvXf9jNsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065410; a=rsa-sha256; cv=none; b=Jjxo0kOhY8sXHBD7ecwXvpJtT2FqN5x1PP4sJj843d2vgOxOK2OJNInrpubIz+Y5YsIfOu Vlq1w68uqQaR+k2CPfkGkSz/jpy3RkyKRCEIimzuZuYaLPen47eoB307gCME74My8Y75ty RHvEliDNqnDPvsPX+SSv24V6DXVex/bBC1fdxuA5rVAQaMFUan7bif4StBCL5Y62yLFLWE SrzqV52GYWJqjQLuJgYfao7UJ8bmkD3AN7lGwXdNd/Izdo8O836lJc7YCx/ocJ9+TPnnEC ubeWjxW1RMCf/f8HF4MoHPSF0/dLbZKjzuuoWYTMZAwOstPgJDxg/q7rHRw69w== 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=1724065410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWpjo1Qa0JlWKelNRak1F1cukWCbaVw7q7/oSpHu3gI=; b=WOHU8lWKJxX/v5Qh2qb1kdmHcI4AMcC6TTuFFhBeIuwDeEtH6wa8nrgI3D++UJsgsQZ3wd hcuKTGvMB/SKGr9IhTOpFgLG1kVw0KoQpAhOTYsmuRgQQ7OWOYP5kz68zVqhfZF1C2TPyl km5Z6HwE93OVVgqLP5HRhdPOb7Piofa7spoZ+f3up9IT1WjekzgW1bM2Z9YzUzQoGyITEx eTHxrheLM5WNi8H6lCNfJKChfMHYDbf9Pz13EriUSlGvBAqUig+RLYmHWkQIU++4bY5oVa kF2CfdTjtM++CzKrNnAwl2TR9l5BwEoZwH2S6TdbeVnJb8Z3eQq6tQcVJk2bXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV822DmdzF9p; Mon, 19 Aug 2024 11:03: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 47JB3UWL037690; Mon, 19 Aug 2024 11:03:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3UqY037687; Mon, 19 Aug 2024 11:03:30 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:30 GMT Message-Id: <202408191103.47JB3UqY037687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7eb0fffc7792 - main - buf_ring: Remove old arm-only dequeue code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7eb0fffc7792bc294d6b86546a3923e2e2f83f8a Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7eb0fffc7792bc294d6b86546a3923e2e2f83f8a commit 7eb0fffc7792bc294d6b86546a3923e2e2f83f8a Author: Andrew Turner AuthorDate: 2024-08-19 09:07:10 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:11 +0000 buf_ring: Remove old arm-only dequeue code In the single consumer dequeue the consumer thread controls br_cons_head. As such no ordering between this and other data are required. Reviewed by: alc, imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46153 --- sys/sys/buf_ring.h | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 9aeb5aa19fa8..ad463fba27cb 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -177,37 +177,8 @@ buf_ring_dequeue_sc(struct buf_ring *br) uint32_t prod_tail, mask; void *buf; - /* - * This is a workaround to allow using buf_ring on ARM and ARM64. - * ARM64TODO: Fix buf_ring in a generic way. - * REMARKS: It is suspected that br_cons_head does not require - * load_acq operation, but this change was extensively tested - * and confirmed it's working. To be reviewed once again in - * FreeBSD-12. - * - * Preventing following situation: - - * Core(0) - buf_ring_enqueue() Core(1) - buf_ring_dequeue_sc() - * ----------------------------------------- ---------------------------------------------- - * - * cons_head = br->br_cons_head; - * atomic_cmpset_acq_32(&br->br_prod_head, ...)); - * buf = br->br_ring[cons_head]; > - * br->br_ring[prod_head] = buf; - * atomic_store_rel_32(&br->br_prod_tail, ...); - * prod_tail = br->br_prod_tail; - * if (cons_head == prod_tail) - * return (NULL); - * ` - * - * <1> Load (on core 1) from br->br_ring[cons_head] can be reordered (speculative readed) by CPU. - */ mask = br->br_cons_mask; -#if defined(__arm__) || defined(__aarch64__) - cons_head = atomic_load_acq_32(&br->br_cons_head); -#else cons_head = br->br_cons_head; -#endif prod_tail = atomic_load_acq_32(&br->br_prod_tail); cons_next = cons_head + 1; From nobody Mon Aug 19 11:03:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV840l0Wz5SpT2; Mon, 19 Aug 2024 11:03:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV833d3nz4SSM; Mon, 19 Aug 2024 11:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmspvFo7jJJAlp6AufO6IxyZwSDyTVQ395wu2LyHAZY=; b=BKUF+PSuNWkTzA/P7NwCNbxeDNBAqQHP4i8bJX7pXjQ3nTrA6Wxxo6YQgfJL2dKIToXIX5 h513CuJHPhsHrbZZc1o5MjjtmxuilfJlCgMqWjQWOUfWHwb3sJC8cUr1ca5GFk4R1yqzpm VF2wfsUHBretiHoyeKjkP5iGMerL6fPjXcwLloczkwkDGmS344k6MXpz0gPnmim8Z2xmg5 Iod6H77T4u9t6smtPTde/RRMdlLA0Uf9P7zg822ecTJ9sWobNhlj5t+64DMFSnPx1M4F/v BF7wisjh3rBm72F9DWej65H/OjyKn7VKM8dl8csYhD+3E3n6HrLBChDvqlt7pA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065411; a=rsa-sha256; cv=none; b=eX/2itwRvTNA+zYdae5cN8FzhyAstcdExOGjJ+th6gPFCNVODAJS7tufcoflX2/rxSuRNO te3PdUDn2TRmXgJXz+Lic39C+Tfs2a7xCF3Do+osvH0gnzw4ZanZsaKf5JpaiTa8Xa9ZyB p+vv3gf7d2fmKZFPT3Yw36CB2zjilJTtHEhedYicuK6baJi5AJE6HNVV3YhJDtMXV+DCv/ oyimOaal03WMzB8uJ1uPEH+rE7ZOPVw4wupwq5FbSUAseOomoJume9+uzR69hMM4d2s1T+ bxR95BxvdbofGB+5KbpSk0WRMKhx7yvBiZpkeEJmyVFUuFr5hGOSXDFP3Ltrxw== 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=1724065411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmspvFo7jJJAlp6AufO6IxyZwSDyTVQ395wu2LyHAZY=; b=mHIcusfcVj4GgdeSyv9yXR+67qeVwSq8KLIuNpYoUG2H8al7mmnHx8i6OHodj8HixPluBW LPalTZvnR1NSlePWqZ8o6tgYu3VscecZwgsKtARK6yiP00MKYIRB30g8dX628Zyhhfs6hn Y9HcZW1XesTSARfM/IGEMqabjfNt1LztUSiH36sh21hkO7jTlSiERaX4fEY8PMGhQBNI4g 8Q4HSLa5OEh9BZ6TEQfIRCc+R2CKLUkOlCwPjXsIDhuPC+wMt96DKhJeCHQOTME7xAwOVt qEMWV+iDdhpis2cLM286V46lYGYmcQ2zcZQbj6miSkMosTolO8sgYST7HfVMeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV833Dtzz1Ctv; Mon, 19 Aug 2024 11:03: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 47JB3VQE037741; Mon, 19 Aug 2024 11:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3V4Y037738; Mon, 19 Aug 2024 11:03:31 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:31 GMT Message-Id: <202408191103.47JB3V4Y037738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 947754af55ed - main - buf_ring: Use atomic operations with br_prod_tail List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 947754af55edc217c10e3456d97558c4eb6d0f99 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=947754af55edc217c10e3456d97558c4eb6d0f99 commit 947754af55edc217c10e3456d97558c4eb6d0f99 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:19 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:11 +0000 buf_ring: Use atomic operations with br_prod_tail As with br_cons_tail use an atomic load acquire to read br_prod_tail in buf_ring_dequeue_mc and buf_ring_peek*. On dequeue we need to ensure we don't read the entry from the buf_ring until it is available and prod_tail has updated. There is already an appropriate store in the enqueue path and an appropriate load in the single consumer dequeue, we just need one in the other functions that read from the buf_ring. Reviewed by: imp, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46154 --- sys/sys/buf_ring.h | 45 ++++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index ad463fba27cb..66e1e55bc5e9 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -131,7 +131,7 @@ static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { uint32_t cons_head, cons_next, cons_idx; - uint32_t mask; + uint32_t prod_tail, mask; void *buf; critical_enter(); @@ -139,8 +139,9 @@ buf_ring_dequeue_mc(struct buf_ring *br) do { cons_head = br->br_cons_head; cons_next = cons_head + 1; + prod_tail = atomic_load_acq_32(&br->br_prod_tail); - if (cons_head == br->br_prod_tail) { + if (cons_head == prod_tail) { critical_exit(); return (NULL); } @@ -266,29 +267,26 @@ buf_ring_putback_sc(struct buf_ring *br, void *new) static __inline void * buf_ring_peek(struct buf_ring *br) { - uint32_t mask; + uint32_t cons_head, prod_tail, mask; #if defined(DEBUG_BUFRING) && defined(_KERNEL) if ((br->br_lock != NULL) && !mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif mask = br->br_cons_mask; - /* - * I believe it is safe to not have a memory barrier - * here because we control cons and tail is worst case - * a lagging indicator so we worst case we might - * return NULL immediately after a buffer has been enqueued - */ - if (br->br_cons_head == br->br_prod_tail) + prod_tail = atomic_load_acq_32(&br->br_prod_tail); + cons_head = br->br_cons_head; + + if (cons_head == prod_tail) return (NULL); - return (br->br_ring[br->br_cons_head & mask]); + return (br->br_ring[cons_head & mask]); } static __inline void * buf_ring_peek_clear_sc(struct buf_ring *br) { - uint32_t mask; + uint32_t cons_head, prod_tail, mask; void *ret; #if defined(DEBUG_BUFRING) && defined(_KERNEL) @@ -297,30 +295,19 @@ buf_ring_peek_clear_sc(struct buf_ring *br) #endif mask = br->br_cons_mask; - if (br->br_cons_head == br->br_prod_tail) - return (NULL); + prod_tail = atomic_load_acq_32(&br->br_prod_tail); + cons_head = br->br_cons_head; -#if defined(__arm__) || defined(__aarch64__) - /* - * The barrier is required there on ARM and ARM64 to ensure, that - * br->br_ring[br->br_cons_head] will not be fetched before the above - * condition is checked. - * Without the barrier, it is possible, that buffer will be fetched - * before the enqueue will put mbuf into br, then, in the meantime, the - * enqueue will update the array and the br_prod_tail, and the - * conditional check will be true, so we will return previously fetched - * (and invalid) buffer. - */ - atomic_thread_fence_acq(); -#endif + if (cons_head == prod_tail) + return (NULL); - ret = br->br_ring[br->br_cons_head & mask]; + ret = br->br_ring[cons_head & mask]; #ifdef DEBUG_BUFRING /* * Single consumer, i.e. cons_head will not move while we are * running, so atomic_swap_ptr() is not necessary here. */ - br->br_ring[br->br_cons_head & mask] = NULL; + br->br_ring[cons_head & mask] = NULL; #endif return (ret); } From nobody Mon Aug 19 11:03:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV846hNMz5SpCd; Mon, 19 Aug 2024 11:03:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnV844f3lz4SGp; Mon, 19 Aug 2024 11:03:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmKZqYGPIyhgUWKfWNO/QMMpE4YKFyGaKKrB7LzIMfk=; b=l5e6/veOYkNOGdzyTKujo80sHrHuehvJDzmCCCjp7GWDyMcEBTKogyV5CqHzR3IYIgyc4K 31MlAnjU5Vpio4E4cYVsWAV0b1ro836VB5T+LdvJxxIKwXz7IGpXLUlL9k3K4J56kNi1Re qOBAyTJ4goP4WNWNx84UwY35A4ITwBfaNEQpZ8XmA/Ys1HXQhVSK+Iy7ZphrFqaErbc+GD STFcqMZfKglQLCwa3sY+Y27UXig/k9ySIEArWJ8acDDIUqoLW+re4KldytYhifesRM1b3t UC90OHIjTNNDHt+CLUrqn+4WOzzv2SQye/eGYZwDS5WWztqjje90Qdu36YRe4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065412; a=rsa-sha256; cv=none; b=ovh+2E7FebX+8endtAAo88dBaMLHjXQ+bDdNoWtWFq0LYa005rXUHFArij42dz37ho3jpO WVAZR5sETT4DySSI4AFo8Ob2rxIJ61WIk7AftR/CtsxWsyeBfwmX2fT5YVBEixAiX51uLO tVXQziYOWNMCcsnzC6BpJ8i075cYsG2n0Fw5MHCQ4shWKPuyqPOr6f/4e2VwSvHs1HKvZX MlxUujhr/bY59X0Wz/OO07dXcavVbsugbEn+m47nbKyg9sybRtQa6En0anXFeu81bw1bWT HT3rjJfYpwM8ALLGWnd4WCBrjuOqvDpR9n1JmRHr0QiVbp+pHxNsGCv4EHGuBw== 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=1724065412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmKZqYGPIyhgUWKfWNO/QMMpE4YKFyGaKKrB7LzIMfk=; b=FbcT8xTjyCDQWrvhYjSNnYJqD0pOuyjanPY71OFY9SIZqM+diTNhjsRvhbaSkMuaXunkdv MsDukYSprk0uS2Q3CSLbOX7jIRLTPjk+ks1dXRqCS20dJAtuW9WMTTwgAolqI20afCqQBb OwfOdIqanCzlAV/aozVGLCEGtJu1i8AvR5I6JhmWF/Gi/CInrKzFm/8T95vb9ZmhF0o8vl hEdhQ0djzMz3YDS2ap34hxvEDFCNMBL95ga2fM5z/i+7px103tNob2yYqw/KIc0IBdkuLD Npqh5vAj3bnNLfCO8wauiiH+nHCLWS70CG58TolQXutAzAf7+qALfMN6bj7z4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV843rBqzF05; Mon, 19 Aug 2024 11:03: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 47JB3WJ1037786; Mon, 19 Aug 2024 11:03:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3W9A037783; Mon, 19 Aug 2024 11:03:32 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:32 GMT Message-Id: <202408191103.47JB3W9A037783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fe2445f47d02 - main - buf_ring: Ensure correct ordering of loads List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe2445f47d027c73aa7266669e7d94b70d3949a4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fe2445f47d027c73aa7266669e7d94b70d3949a4 commit fe2445f47d027c73aa7266669e7d94b70d3949a4 Author: Andrew Turner AuthorDate: 2024-08-19 09:07:26 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:11 +0000 buf_ring: Ensure correct ordering of loads When enqueueing on an architecture with a weak memory model ensure loading br->br_prod_head and br->br_cons_tail are ordered correctly. If br_cons_tail is loaded first then other threads may perform a dequeue and enqueue before br_prod_head is loaded. This will mean the tail is one less than it should be and the code under the prod_next == cons_tail check could incorrectly be skipped. buf_ring_dequeue_mc has the same issue with br->br_prod_tail and br->br_cons_head so needs the same fix. Reported by: Ali Saidi Co-developed by: Ali Saidi Reviewed by: imp, kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46155 --- sys/sys/buf_ring.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 66e1e55bc5e9..512f20dc13e2 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -89,7 +89,17 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) #endif critical_enter(); do { - prod_head = br->br_prod_head; + /* + * br->br_prod_head needs to be read before br->br_cons_tail. + * If not then we could perform the dequeue and enqueue + * between reading br_cons_tail and reading br_prod_head. This + * could give us values where br_cons_head == br_prod_tail + * (after masking). + * + * To work around this us a load acquire. This is just to + * ensure ordering within this thread. + */ + prod_head = atomic_load_acq_32(&br->br_prod_head); prod_next = prod_head + 1; cons_tail = atomic_load_acq_32(&br->br_cons_tail); @@ -137,7 +147,12 @@ buf_ring_dequeue_mc(struct buf_ring *br) critical_enter(); mask = br->br_cons_mask; do { - cons_head = br->br_cons_head; + /* + * As with buf_ring_enqueue ensure we read the head before + * the tail. If we read them in the wrong order we may + * think the bug_ring is full when it is empty. + */ + cons_head = atomic_load_acq_32(&br->br_cons_head); cons_next = cons_head + 1; prod_tail = atomic_load_acq_32(&br->br_prod_tail); From nobody Mon Aug 19 11:03:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV8616Hbz5Spg4; Mon, 19 Aug 2024 11:03: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 4WnV855NKxz4SSc; Mon, 19 Aug 2024 11:03:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/970s+Lf9vwgC5WvBqzPqcnAHWtOaJn9av4rHVtOJt8=; b=g+4hGJI3QHss9xMZ1b0T1d7qtBPG/RwAT+6Zd+cB6pnSSbmPNzJEm3pcv4aSO7bJO8d/hS FenZ30Q+S+f3gjS/1gSHNNHu23aYXernp2CKGNH66rxK6U/fEhBDbhnq8n1McsIT3wCpRw kMIW2UNn28pXul30fF1+Bfoh9TEPuDSKaoBJlw6HPYXOOlHxwqTZORpZBEAEUR198tb2wW 8ku5AS1MOGVlLk9Jk4kfGheQlly1a6PqvV9bKjSlkXgSmyKxrugCpKXtif0SoN2ufbb4Nx nG4GkS0z1qOLl+WJz98oWeZ3zLsseYu/8G70jVwLo0jgVXSvyrONbR1eeSbyOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065413; a=rsa-sha256; cv=none; b=bExWlCWfrznc76ecVqgt3E395eNqhjrT/RW9F4hRPOpXfWSH3XrqtC3mxM8IKmPktN1exK Rsu0HpsNWwzq2QC3/3rYhcR+iy21mSmgmWtFvwy5jFWNi1vQ3g9f3+XiCrXSRocDdF5bLk yGe//U7ZsVFiy73lPKmg6ZomtJe33KKObyhyTfDJx/AAM//qB0iODZX9aSv8S3Cp/rjL9k Rsjth1qpQEerWxLPvQA1HGdG6JcOIK8wyvS0iSrT7Rd5TG1niAHU7uYDxxSUiNgc0NQVqM Fj6pAk3kbaAaxHUHbNmRoCtHunrUHphZD1Wgyg5RvDNwogYZar5EmlPTGeC0/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/970s+Lf9vwgC5WvBqzPqcnAHWtOaJn9av4rHVtOJt8=; b=nBRVUmyUNNbbYcS7+4Y7Zu2qHEl+ytoinYPqM17egl1j7Sdk/zlKMRKmOgwVZW+Ki7uqks w0Mj6fyWxm1XIZGbEhCnN8AsGr4Z5vMPerR8f5JtT/XYmOIJRmQ4NxPw2p8S0zSJptWs30 Q0abQbY0ViLc8ahlIaSKieGW8nKl2rCSyVnmZEgwNu3EFGsgcewJtyRws7j/HLTeCAaI8H YS0h1LX9k17wVqxxp9J738phQguUXMMrWtY+8xPM3cQCEjDUXHWhRGLBNsH/Gu6xziF+l8 imSy6d/DhtHjPEhmbOkkpe7xeefp/3MsjILmsS8IR9iGmjssXJH6buQ14nheGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV854yKqzFGl; Mon, 19 Aug 2024 11:03: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 47JB3X53037829; Mon, 19 Aug 2024 11:03:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3Xjh037826; Mon, 19 Aug 2024 11:03:33 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:33 GMT Message-Id: <202408191103.47JB3Xjh037826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 87940d2b331c - main - buf_ring: Add an Arm copyright List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87940d2b331c2575f96fbff2600d8da35191157b Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=87940d2b331c2575f96fbff2600d8da35191157b commit 87940d2b331c2575f96fbff2600d8da35191157b Author: Andrew Turner AuthorDate: 2024-08-19 09:08:20 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:12 +0000 buf_ring: Add an Arm copyright I've change enough of this file to add Arm as a copyright holder. Add it after the "All rights reserved" line as that's not needed. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46157 --- sys/sys/buf_ring.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 512f20dc13e2..c99cf81d8b6d 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -3,6 +3,7 @@ * * Copyright (c) 2007-2009 Kip Macy * All rights reserved. + * Copyright (c) 2024 Arm Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From nobody Mon Aug 19 11:03:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnV872ZNYz5SpWd; Mon, 19 Aug 2024 11:03: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 4WnV870LRRz4SgK; Mon, 19 Aug 2024 11:03:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724065415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0OMv/F0Bra9jVZgoCzuUe/5ZmPaX+Tbe3a7vg5jmvI=; b=L9QJ8XsTqCG0KE3TLj/jNGITudzsh9ptNIhTrIM8+AuVWYWHGaIpamWQLrKwx24e+Aneab 3r+Md7CIh7oiVA8Cor81mfPgKT1dAdyyxrDvuOVGAgUvVJqeCF2bupwsChSZo4B3bjqbf4 UWVIJK+vCFryTmdfX4yEuBAcCDaN77wCqrC7iY7ddMMWsmbQOeDENbv6tJ0AGYUlHydmTz S8Tg3EMpoM1uIh6QUOWYvAFAxScsWsmdaKbDdAta1jELp/I9BE236nlcJ2GZoEMkYK1kwP fDhUt5r55QQQHO0tqvuwRxviC1HhEk2HASEOeNsfW31NeRdvST+uU0BJsFVp3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724065415; a=rsa-sha256; cv=none; b=ZFSihqf9Vk04PTM4bwECCAk0hMU7HKCWRiRnJPTIP3pLyGGFmKncxkF/HYrNk0P7U7O40v LLWt8pd6MUtFS1FFxGCFTlLcgzvOMxJXL2AzMLOHXNXLcjzpegrsFYvVqjiYmumsHjVeKQ h1w5zjN4qfuodHdO6lZCw7nNQkUY/K/7AzEQRLfSwFlR2ym26gqgbb3pNDvuxOoA/8QGfg 7j1s3rnglK2qTC6ks+xZjxvhGAVJBP+pzid8N86/+IofYg2kLx3X91Cetg/rjsqtXwII6z akaPpoBkeY6Dj+sl+jY9flgkWGzmhUHalyAPcjKNmkNUTmAuauaqVtHfxW1sag== 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=1724065415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0OMv/F0Bra9jVZgoCzuUe/5ZmPaX+Tbe3a7vg5jmvI=; b=lXRYBfw7JabubddhTenqOudXWjSfaUIHucor2yXAIoiobC7uHPNn0DTwNgsv9hHJujivqy +101jHg85QxpcGWoA/jhbHaSp5AVCqltV2QXa0iwjzHeoAHtRME7kLT52eNdlZm3KurajY 6clbd3j5DIN1gQ183LUaVCTW9QKVGIorUT9r9NrKorZ4nFsRw5hGOphNal8Dj7VHTaEwlk dsjvXqeSaus1tKH27R5hSKPkiLXtjXkE244CJ9dzzReXWUclzfmV47iL3qOoi92JFHMVO7 iWvcpQ7kRzgPxrjlWIpW8TOhQ03rOGCWOH1odLK4PnWP3AmGbm0v5nsrMfKleQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnV8669L0zFGm; Mon, 19 Aug 2024 11:03: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 47JB3YYU037877; Mon, 19 Aug 2024 11:03:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JB3YjY037874; Mon, 19 Aug 2024 11:03:34 GMT (envelope-from git) Date: Mon, 19 Aug 2024 11:03:34 GMT Message-Id: <202408191103.47JB3YjY037874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7a345763f96d - main - arm64: Expand the use of Armv8.1-A atomics List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a345763f96d86eee9ab578e64311bf452e58900 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7a345763f96d86eee9ab578e64311bf452e58900 commit 7a345763f96d86eee9ab578e64311bf452e58900 Author: Andrew Turner AuthorDate: 2024-07-30 09:26:21 +0000 Commit: Andrew Turner CommitDate: 2024-08-19 10:53:12 +0000 arm64: Expand the use of Armv8.1-A atomics When targeting Armv8.1 we can assume FEAT_LSE is available and can use the atomic instructions this provides without needing to check for support first. Reviewed by: imp, markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46159 --- sys/arm64/include/atomic.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h index 76ca951678d4..c7aaa76d9de9 100644 --- a/sys/arm64/include/atomic.h +++ b/sys/arm64/include/atomic.h @@ -65,8 +65,9 @@ extern _Bool lse_supported; #include -#ifdef _KERNEL - +#if defined(__ARM_FEATURE_ATOMICS) +#define _ATOMIC_LSE_SUPPORTED 1 +#elif defined(_KERNEL) #ifdef LSE_ATOMICS #define _ATOMIC_LSE_SUPPORTED 1 #else From nobody Mon Aug 19 13:22:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnYCv6Vzzz5T22J; Mon, 19 Aug 2024 13:22:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnYCv644Yz4kRD; Mon, 19 Aug 2024 13:22:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724073723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z5yLuGP5gE+JRUvmuOWS57SsgXYvxcH4sliI6qGg96Q=; b=BabFyz6dvB2KPCkNhxX6oX3PFyjDGT0gZtRhjHzjm/rB1HlPI4O8wEuM8kwOik4ItXH8Un RtDbnx3posFGmjdJCjpnemnI8MoqXXV30SIkbKSASPNjmhc1jiPr454AmgxH5bcn/3RaC1 T0qN1Y+c9Jfmv5CUdaFTQ3xaEsVhYQpos4z5+yunHhg67XrqMSNGu8e0r//BjZ9oXp9l3F hN78nStxJfBq30RM4Jq8m/eGsXwnkpKSbWKF+LEqBUNSq67Dk0VsvLVWCgJum73s3It05l 4OhcBRXSEuQfdfdhivtnOkfRYxSL/YamPPINovvrbMLVmzQaIOiU8S0Be0vr/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724073723; a=rsa-sha256; cv=none; b=mQZCuKHVdrRJP+YSCsnt+PHj30gyuEw8wB81WAAHH2E8+R+UAYi7nkeyGqboZ6MYdtT03H BisV2bwzRDGvS5NA5jvbEbUbcLv9Cv7RDpxKc42zk94m8OK7CF5c5iLsDKqi6M+OVSa4ua e3KrrwZpaHvDj+ThCkuY9SI+Q0nQXC20R9CKoVYUQQbtemAySHQr9dyjHhvJNZQfInTU3a eiEXd5Rye+HFZA0XvIQqgydlwLaRHIkUSwWHq88yzT7sosxUT5lznPeB3BkuhnABRQbfSM Rl2GRROGpfDeJmXdyI8vqCBDMnWwlYr+wxFsNv5EENDK/3zgeTLQJYo1EY0Txg== 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=1724073723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z5yLuGP5gE+JRUvmuOWS57SsgXYvxcH4sliI6qGg96Q=; b=k1kF25+dn5kG+EZy+uvYKupoP4cbAVGjfm+6rDIH14gakRma7XI2yZT35v8B/VCoQBCrJg gapsTwTL6zXF+ITRmgJRydHaetcoNuBy2Uo3/pvBpR6hUCFkOHMkZVSIN8O6Ev8qikH3m9 C7jmuzDYKr2TcB7cqToS3zEYWSVFHMPycQUEp2p/IaDj4gXbvGSO+nKZ7KLKxRH1Ta4fIb bQdlBjFJB1k/oo1x4lYxAg0yzJM8m3dO2J+38AOAC8mC/rwQ9zeARGopBxN20el3l8b5ur hhgFdXMjGlOoeqj679in8D7dBUpxca0kcvUXv71iUIlEXE8kBCoaKMfZlPmHPQ== Received: from [IPV6:2601:5c0:4200:b830:49b5:d921:1c85:942f] (unknown [IPv6:2601:5c0:4200:b830:49b5:d921:1c85:942f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WnYCv4MwxzWrY; Mon, 19 Aug 2024 13:22:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <91c2e929-b663-45ac-8c7e-40f9cb219a41@FreeBSD.org> Date: Mon, 19 Aug 2024 06:22:01 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f44ff2aba2d6 - main - bhyve: Treat the COMMAND register for PCI passthru devices as emulated Content-Language: en-US To: Navdeep Parhar , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202407311450.46VEoql9014730@gitrepo.freebsd.org> <58a179b1-9e92-461a-8902-31bd0a8c057e@FreeBSD.org> From: John Baldwin In-Reply-To: <58a179b1-9e92-461a-8902-31bd0a8c057e@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/13/24 21:17, Navdeep Parhar wrote: > On 7/31/24 7:50 AM, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=f44ff2aba2d64d1d9312cb55008dc90275ccdc04 >> >> commit f44ff2aba2d64d1d9312cb55008dc90275ccdc04 >> Author: John Baldwin >> AuthorDate: 2024-07-31 14:50:33 +0000 >> Commit: John Baldwin >> CommitDate: 2024-07-31 14:50:33 +0000 >> >> bhyve: Treat the COMMAND register for PCI passthru devices as emulated >> >> Don't pass through writes of the command register through to the >> physical device. These registers do not need to be in sync, and in >> some cases (e.g. when the guest is sizing the BAR and temporarily >> disables decoding), the states need to diverge. > > This seems to break MSI-X interrupts for a device that is passed through > to a VM. That is, the device generates an interrupt but the driver in > the VM never receives it. Reverting this change fixes the problem. Yes, https://reviews.freebsd.org/D46245 is what I have been using. It turns out the ppt(4) driver wasn't fully managing the command register. -- John Baldwin From nobody Mon Aug 19 13:59:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZ2j44b8z5T4hd; Mon, 19 Aug 2024 13:59: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 4WnZ2j3Z8rz4ngg; Mon, 19 Aug 2024 13:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724075949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkqlpbyFBxP/vTHfOvmHxK71yTqBADDhJcOAlES1iwo=; b=NFi+j5aeMEZOGou2dt14tfxoi0angabGmDvP3Xgltw/nSB3wbQqFoHVWaCtKy9gnEpQpPH mfYhDpuz1EHoBkJkko4kOFGwrBbI8i1oVkX5nVWeJnHgi6A7m2AcC9CsGyR8eHSBqW0ISP dWU86KLz7Vt6o+hpI3MhMMltabhPKGIm5mxSbZriRpqfGPWAWpTkSiU2PNRS5jTmBdX40O XNKzLrveImwRu4XS8I2MhgtgG/XXTqXs9jAB30qUz/ht7NkaQVRyQfDKrX0A9ZWvVfeMkT cL924FjpbsFO+3YfXY62n9qB6eT7o9yXprZQbP2Lw+EKsoRVDUmLI7pig+/TWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724075949; a=rsa-sha256; cv=none; b=SpcAyYLiaXD39Zg1Af3VrdvcI8G2aKlzJ3/Yok8M+D9gMkayVn5aWl79QdHHKm7hSnWWSQ LQjZh2xiWvqAGimG6QxOll7P8KIGoUfZYlLrCLMF440D4ib2u4na1c3584/7XI3DpwME+d e7AawC02PO8CY5RilZ44jXGDzpl93QFxKJe2tVIMPoeEBzPLO1OQ15mJnVGdSDldmmxXT2 BAkKqehkbYWrdF4h6T/lcacEgRbzkX01iBO8+o2GVsqCr7bgNVpthHlFVg7tbCjlmuyplc bSlZb45Vw2Kr19S7Vyl/Xwj08nrRiAe1l9zVHU2HKxeBdvE1ukJkNSTUfs26Kg== 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=1724075949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkqlpbyFBxP/vTHfOvmHxK71yTqBADDhJcOAlES1iwo=; b=qX6DDyZPogY3HumjJPVIV1FpVG1jZ63OyNEAYvx85GrYWcr5TVPzlNaaeFQ4vCxm/VtSpD f1XVsrAP34jl369sUUMz/v8ucf15GMEM/iuS4Tn08oYArEKBG+UhectDOkDiluuQzuE+eh wG2GTTnDrZKIcc0aqChTPZS7CDjAKfPm4vEJ4GK4XFPxIiQz+DTh/ua6hoINrgHYH9hBgj qbBHtN3LeRumejnsn/ih4KQQQ5j99VuXi3FYWBGaKsZphEyJeIBL4rnXdqYDIxplaUzFC/ QZRyIfOfbCOXDd5SkqDDN5sObhtxgiRx8medq0LVNm3a6Wbl5tKZIRIGORDnBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZ2j3920zJfR; Mon, 19 Aug 2024 13:59: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 47JDx9L5025960; Mon, 19 Aug 2024 13:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JDx9AE025957; Mon, 19 Aug 2024 13:59:09 GMT (envelope-from git) Date: Mon, 19 Aug 2024 13:59:09 GMT Message-Id: <202408191359.47JDx9AE025957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 43caa2e805c2 - main - bhyve: Make boot ROM handling more consistent List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43caa2e805c28a236e6624aedd91591d7018fce5 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=43caa2e805c28a236e6624aedd91591d7018fce5 commit 43caa2e805c28a236e6624aedd91591d7018fce5 Author: Mark Johnston AuthorDate: 2024-08-19 13:55:47 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 13:55:47 +0000 bhyve: Make boot ROM handling more consistent - On amd64, deprecate lpc.bootrom and lpc.bootvars. Use top-level config variables instead. - Introduce a generic predicate which can be used to determine whether the guest has a boot ROM. Reviewed by: corvink, jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46282 --- usr.sbin/bhyve/amd64/bhyverun_machdep.c | 20 ++++++++++++++++++-- usr.sbin/bhyve/amd64/ioapic.c | 3 ++- usr.sbin/bhyve/amd64/pci_irq.c | 3 ++- usr.sbin/bhyve/amd64/pci_lpc.c | 19 ++----------------- usr.sbin/bhyve/amd64/pci_lpc.h | 1 - usr.sbin/bhyve/bhyve_config.5 | 24 ++++++++++++------------ usr.sbin/bhyve/bhyverun.c | 7 +------ usr.sbin/bhyve/bootrom.c | 17 +++++++++++++---- usr.sbin/bhyve/bootrom.h | 3 ++- 9 files changed, 52 insertions(+), 45 deletions(-) diff --git a/usr.sbin/bhyve/amd64/bhyverun_machdep.c b/usr.sbin/bhyve/amd64/bhyverun_machdep.c index c453092107d5..d51ad3a5fc05 100644 --- a/usr.sbin/bhyve/amd64/bhyverun_machdep.c +++ b/usr.sbin/bhyve/amd64/bhyverun_machdep.c @@ -37,6 +37,7 @@ #include "acpi.h" #include "atkbdc.h" #include "bhyverun.h" +#include "bootrom.h" #include "config.h" #include "debug.h" #include "e820.h" @@ -241,6 +242,18 @@ bhyve_optparse(int argc, char **argv) bhyve_usage(1); } } + + /* Handle backwards compatibility aliases in config options. */ + if (get_config_value("lpc.bootrom") != NULL && + get_config_value("bootrom") == NULL) { + warnx("lpc.bootrom is deprecated, use '-o bootrom' instead"); + set_config_value("bootrom", get_config_value("lpc.bootrom")); + } + if (get_config_value("lpc.bootvars") != NULL && + get_config_value("bootvars") == NULL) { + warnx("lpc.bootvars is deprecated, use '-o bootvars' instead"); + set_config_value("bootvars", get_config_value("lpc.bootvars")); + } } void @@ -291,7 +304,7 @@ bhyve_start_vcpu(struct vcpu *vcpu, bool bsp) int error; if (bsp) { - if (lpc_bootrom()) { + if (bootrom_boot()) { error = vm_set_capability(vcpu, VM_CAP_UNRESTRICTED_GUEST, 1); if (error != 0) { @@ -332,6 +345,9 @@ bhyve_init_platform(struct vmctx *ctx, struct vcpu *bsp __unused) rtc_init(ctx); sci_init(ctx); error = e820_init(ctx); + if (error != 0) + return (error); + error = bootrom_loadrom(ctx); if (error != 0) return (error); @@ -355,7 +371,7 @@ bhyve_init_platform_late(struct vmctx *ctx, struct vcpu *bsp __unused) if (error != 0) return (error); - if (lpc_bootrom() && strcmp(lpc_fwcfg(), "bhyve") == 0) + if (bootrom_boot() && strcmp(lpc_fwcfg(), "bhyve") == 0) fwctl_init(); if (get_config_bool("acpi_tables")) { diff --git a/usr.sbin/bhyve/amd64/ioapic.c b/usr.sbin/bhyve/amd64/ioapic.c index 9ad1c501fbae..494fb0c7ae82 100644 --- a/usr.sbin/bhyve/amd64/ioapic.c +++ b/usr.sbin/bhyve/amd64/ioapic.c @@ -33,6 +33,7 @@ #include #include +#include "bootrom.h" #include "ioapic.h" #include "pci_emul.h" #include "pci_lpc.h" @@ -72,7 +73,7 @@ ioapic_pci_alloc_irq(struct pci_devinst *pi) if (pci_pins == 0) return (-1); - if (lpc_bootrom()) { + if (bootrom_boot()) { /* For external bootrom use fixed mapping. */ return (16 + (4 + pi->pi_slot + pi->pi_lintr.pin) % 8); } diff --git a/usr.sbin/bhyve/amd64/pci_irq.c b/usr.sbin/bhyve/amd64/pci_irq.c index 7e1aee7fbb1d..fea6d9a2591c 100644 --- a/usr.sbin/bhyve/amd64/pci_irq.c +++ b/usr.sbin/bhyve/amd64/pci_irq.c @@ -38,6 +38,7 @@ #include #include "acpi.h" +#include "bootrom.h" #include "inout.h" #include "ioapic.h" #include "pci_emul.h" @@ -205,7 +206,7 @@ pirq_alloc_pin(struct pci_devinst *pi) pirq_cold = 0; - if (lpc_bootrom()) { + if (bootrom_boot()) { /* For external bootrom use fixed mapping. */ best_pin = (4 + pi->pi_slot + pi->pi_lintr.pin) % 8; } else { diff --git a/usr.sbin/bhyve/amd64/pci_lpc.c b/usr.sbin/bhyve/amd64/pci_lpc.c index 57d2333edcc6..ed41a800a2ea 100644 --- a/usr.sbin/bhyve/amd64/pci_lpc.c +++ b/usr.sbin/bhyve/amd64/pci_lpc.c @@ -104,7 +104,7 @@ lpc_device_parse(const char *opts) if (romfile == NULL) { errx(4, "invalid bootrom option \"%s\"", opts); } - set_config_value("lpc.bootrom", romfile); + set_config_value("bootrom", romfile); varfile = strsep(&str, ","); if (varfile == NULL) { @@ -112,7 +112,7 @@ lpc_device_parse(const char *opts) goto done; } if (strchr(varfile, '=') == NULL) { - set_config_value("lpc.bootvars", varfile); + set_config_value("bootvars", varfile); } else { /* varfile doesn't exist, it's another config * option */ @@ -182,13 +182,6 @@ lpc_print_supported_devices(void) printf("%s\n", pctestdev_getname()); } -const char * -lpc_bootrom(void) -{ - - return (get_config_value("lpc.bootrom")); -} - const char * lpc_fwcfg(void) { @@ -256,14 +249,6 @@ lpc_init(struct vmctx *ctx) const char *backend, *name; char *node_name; int unit, error; - const nvlist_t *nvl; - - nvl = find_config_node("lpc"); - if (nvl != NULL && nvlist_exists(nvl, "bootrom")) { - error = bootrom_loadrom(ctx, nvl); - if (error) - return (error); - } /* COM1 and COM2 */ for (unit = 0; unit < LPC_UART_NUM; unit++) { diff --git a/usr.sbin/bhyve/amd64/pci_lpc.h b/usr.sbin/bhyve/amd64/pci_lpc.h index 2dca8f7bec24..402eae082545 100644 --- a/usr.sbin/bhyve/amd64/pci_lpc.h +++ b/usr.sbin/bhyve/amd64/pci_lpc.h @@ -69,7 +69,6 @@ int lpc_device_parse(const char *opt); void lpc_print_supported_devices(void); char *lpc_pirq_name(int pin); void lpc_pirq_routed(void); -const char *lpc_bootrom(void); const char *lpc_fwcfg(void); #endif diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index d0e5c8ae47d3..ebbb206cca9f 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 20, 2023 +.Dd August 13, 2024 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -120,6 +120,17 @@ The value must be formatted as described in .Xr expand_number 3 . .It Va memory.wired Ta bool Ta false Ta Wire guest memory. +.It Va bootrom Ta path Ta Ta +Path to a boot ROM. +During initialization of the guest, the contents of this file are copied into +the guest's memory. +If a boot ROM is present, a firmware interface device is +also enabled for use by the boot ROM. +.It Va bootvars Ta path Ta Ta +Path to boot VARS. +The contents of this file are copied beneath the boot ROM. +Firmware can write to it to save variables. +All variables will be persistent even on reboots of the guest. .It Va acpi_tables Ta bool Ta true Ta Generate ACPI tables. .It Va acpi_tables_in_memory Ta bool Ta true Ta @@ -550,17 +561,6 @@ The following nodes are available under .Va lpc : .Bl -column "pc-testdev" "Format" "Default" .It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description -.It Va bootrom Ta path Ta Ta -Path to a boot ROM. -The contents of this file are copied into the guest's -memory ending just before the 4GB physical address. -If a boot ROM is present, a firmware interface device is -also enabled for use by the boot ROM. -.It Va bootvars Ta path Ta Ta -Path to boot VARS. -The contents of this file are copied beneath the boot ROM. -Firmware can write to it to save variables. -All variables will be persistent even on reboots of the guest. .It Va com1 Ta node Ta Ta Settings for the COM1 serial port device. .It Va com2 Ta node Ta Ta diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index f844da90e76c..41655a188bf9 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -525,12 +525,7 @@ do_open(const char *vmname) reinit = false; -#ifdef __amd64__ - romboot = lpc_bootrom() != NULL; -#else - romboot = true; -#endif - + romboot = bootrom_boot(); error = vm_create(vmname); if (error) { if (errno == EEXIST) { diff --git a/usr.sbin/bhyve/bootrom.c b/usr.sbin/bhyve/bootrom.c index 1d461ba76597..e4adaca55947 100644 --- a/usr.sbin/bhyve/bootrom.c +++ b/usr.sbin/bhyve/bootrom.c @@ -192,7 +192,7 @@ bootrom_alloc(struct vmctx *ctx, size_t len, int prot, int flags, } int -bootrom_loadrom(struct vmctx *ctx, const nvlist_t *nvl) +bootrom_loadrom(struct vmctx *ctx) { struct stat sbuf; ssize_t rlen; @@ -204,9 +204,9 @@ bootrom_loadrom(struct vmctx *ctx, const nvlist_t *nvl) rv = -1; varfd = -1; - bootrom = get_config_value_node(nvl, "bootrom"); + bootrom = get_config_value("bootrom"); if (bootrom == NULL) { - return (-1); + return (0); } /* @@ -235,7 +235,7 @@ bootrom_loadrom(struct vmctx *ctx, const nvlist_t *nvl) rom_size = sbuf.st_size; - varfile = get_config_value_node(nvl, "bootvars"); + varfile = get_config_value("bootvars"); var_size = 0; if (varfile != NULL) { varfd = open(varfile, O_RDWR); @@ -314,3 +314,12 @@ done: free(romfile); return (rv); } + +/* + * Are we relying on a bootrom to initialize the guest's CPU context? + */ +bool +bootrom_boot(void) +{ + return (get_config_value("bootrom") != NULL); +} diff --git a/usr.sbin/bhyve/bootrom.h b/usr.sbin/bhyve/bootrom.h index d22ac3718fa2..0477b0f35218 100644 --- a/usr.sbin/bhyve/bootrom.h +++ b/usr.sbin/bhyve/bootrom.h @@ -45,6 +45,7 @@ enum { }; int bootrom_alloc(struct vmctx *ctx, size_t len, int prot, int flags, char **region_out, uint64_t *gpa_out); -int bootrom_loadrom(struct vmctx *ctx, const nvlist_t *nvl); +bool bootrom_boot(void); +int bootrom_loadrom(struct vmctx *ctx); #endif From nobody Mon Aug 19 13:59:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZ2k6FPXz5T4lF; Mon, 19 Aug 2024 13:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnZ2k4Z0bz4nbN; Mon, 19 Aug 2024 13:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724075950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nTiPBILVzBCL8ijGuxyIPLCW3SHVzR9U/zgkBkawcwE=; b=L7iqjN0hyUhLcwbmE+R0h7GQEvSF0SZUx51ueaQSqDiLlmzTUjUrzhJUlzfM3vkR/RYpAb 1rVl1/Rtmv3HzXv3J9lnm3zv5kyV9TSLS0Ab/lyik9FEQ20FzK03M8LYhq+cpVsf8vKhll dVC999O2z8+m32bDY+/h3jscTtvonXr9OgIAlZkNYabyoru5DMjxhXf42AcqAXzyMM/pvi 8JChTpH4GEKkf0uyAqp9OGkh4WEtzRrpy2vCtZmCEH5Qu5Sb2zJh1vdYWSooONsNj6bx60 2VQd3XqQcD+hZT6+hltKSPw3m5rmtw8nLEsqn27FijGyJ+8tQFWoDztKCobeDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724075950; a=rsa-sha256; cv=none; b=Z6kIPbMQay1vjAOBMAUKJfsl0rXUvPxVRmev9ad24IctRljVmp7qZ3tkPc1ib7cXa+jQxn N3bcec8u2uhUb+FrwxY3IVKDGjiwvz/8E614UcSSyaWnwsroZvpOcODWmQO8jcL87wsQcS CMLaKHFL7XYOUJjiT2T0Tjfqoeop8hk3POeMZZ/o55WJKE6eJfYUp5RBhnEymNDDMhii+k uRz9vIwiFpl4dIioBPeUCHWdetRFFCPiGJzS7hrmdW/+Q8FHHg2zhjkxPSSnF52ipLc66c BAu6v+caKh/uKfkiQvZpSLAmIj1L297dp92r+8PnILxfMbP7QYW0WIztBzKwLA== 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=1724075950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nTiPBILVzBCL8ijGuxyIPLCW3SHVzR9U/zgkBkawcwE=; b=kSQ5qA8kp7uG3nJ9q0AO9g0BQEbDm+N/4dVrn/X1HHXqBLBNJoedw3DI+HDa/AxFzenVHx gCzjvkCEj7VbJxvK+dKqrxOMMcMaej0RDQrnR0C3V7Ncdig/p39OOJe84nMFUrLhXfICt/ 8rDCzWhesgrkhCc9AaJ6Jvw1HOhkcpxFrgDYoqwhoow4XIUKeHmkWPwWYstLpARpgpAa+/ ngAmNXUFrFI6ciK/FADqdOgg3BN4ZpDjV//cD6eiQaHzg/hEmILAs3XDWvstvY4p7xRPNw g6ZaB4cOgYY41cU04TycMq2bpq481rtPFeqmAF/j7453R49yOY4sn418u22/lA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZ2k49HXzJPq; Mon, 19 Aug 2024 13:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JDxAdl026032; Mon, 19 Aug 2024 13:59:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JDxAbK026029; Mon, 19 Aug 2024 13:59:10 GMT (envelope-from git) Date: Mon, 19 Aug 2024 13:59:10 GMT Message-Id: <202408191359.47JDxAbK026029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e962b37bf0ff - main - bhyve: Do not enable PCI BAR decoding if a boot ROM is present List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e962b37bf0ffe7f30f5b025b46ea49ba01c71f2f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e962b37bf0ffe7f30f5b025b46ea49ba01c71f2f commit e962b37bf0ffe7f30f5b025b46ea49ba01c71f2f Author: Mark Johnston AuthorDate: 2024-08-19 13:56:06 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 13:56:06 +0000 bhyve: Do not enable PCI BAR decoding if a boot ROM is present Let the boot ROM handle BAR initialization. This fixes a problem where u-boot's BAR remapping conflicts with some limitations in bhyve. See https://lists.freebsd.org/archives/freebsd-virtualization/2024-April/002103.html for a description of what goes wrong. The old behaviour can be restored by setting the pci.enable_bars configuration variable. Reviewed by: corvink, jhb Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D45049 --- usr.sbin/bhyve/bhyve_config.5 | 3 +++ usr.sbin/bhyve/pci_emul.c | 27 ++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index ebbb206cca9f..25185e2ef1b4 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -157,6 +157,9 @@ Specify the keyboard layout name with the file name in This value only works when loaded with UEFI mode for VNC, and used a VNC client that don't support QEMU Extended Key Event Message (e.g. TightVNC). +.It Va pci.enable_bars Ta bool Ta Ta +Enable and map PCI BARs before executing any guest code. +This setting is false by default when using a boot ROM and true otherwise. .It Va tpm.path Ta string Ta Ta Path to the host TPM device. This is typically /dev/tpm0. diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 00e9138d3910..e066d6766f3c 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -48,6 +48,7 @@ #include "acpi.h" #include "bhyverun.h" +#include "bootrom.h" #include "config.h" #include "debug.h" #ifdef __amd64__ @@ -853,6 +854,14 @@ pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, TAILQ_INSERT_BEFORE(bar, new_bar, chain); } + /* + * Enable PCI BARs only if we don't have a boot ROM, i.e., bhyveload was + * used to load the initial guest image. Otherwise, we rely on the boot + * ROM to handle this. + */ + if (!get_config_bool_default("pci.enable_bars", !bootrom_boot())) + return (0); + /* * pci_passthru devices synchronize their physical and virtual command * register on init. For that reason, the virtual cmd reg should be @@ -966,8 +975,19 @@ pci_emul_assign_bar(struct pci_devinst *const pdi, const int idx, pci_set_cfgdata32(pdi, PCIR_BAR(idx + 1), bar >> 32); } - if (type != PCIBAR_ROM) { - register_bar(pdi, idx); + switch (type) { + case PCIBAR_IO: + if (porten(pdi)) + register_bar(pdi, idx); + break; + case PCIBAR_MEM32: + case PCIBAR_MEM64: + case PCIBAR_MEMHI64: + if (memen(pdi)) + register_bar(pdi, idx); + break; + default: + break; } return (0); @@ -1140,7 +1160,8 @@ pci_emul_init(struct vmctx *ctx, struct pci_devemu *pde, int bus, int slot, pci_set_cfgdata8(pdi, PCIR_INTLINE, 255); pci_set_cfgdata8(pdi, PCIR_INTPIN, 0); - pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN); + if (!get_config_bool_default("pci.enable_bars", !bootrom_boot())) + pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN); err = (*pde->pe_init)(pdi, fi->fi_config); if (err == 0) From nobody Mon Aug 19 14:14:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZNt1P7Kz5T6CS; Mon, 19 Aug 2024 14: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 4WnZNt0fz1z4qmZ; Mon, 19 Aug 2024 14: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=1724076894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWplqVji8ibK3xjBGRhPQTisjoGNyfw9kMvv9dzjDcU=; b=jnGErInfr5Ku3pIB+W5BQ7hKwMYL+7yNxnC3aTuT/1L5nwZ1zhThs+Nb2LZV1zfJt7tY1T qzA3LBdkmvJnITP+7tyS1NsEfSUjc5ozoKYAMjjWOvNt75VkT022NsnMcnYXuvo2KdDzH/ rUsMQOPMO+X5WQXkVAIrMpQHbZQhCvCG5Vt0OjI4DqwfC94S6C99/nUdZkyQAqbIDmJlMc XjUE3aUWvOHwEZ3oszi+Yo3rWc244msCBBowHZEC+LNRUuPVx55deRBW1a/9JXN3f0YWo1 O3Ndga9LmSZL9My10+KUSuMgiQaEJe+4JElFcEQi33wqCiGL52Ri++TfidMtqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724076894; a=rsa-sha256; cv=none; b=XE3yl4ig4wJ538h4oC31v+6ygcakRVNOX+qMSvdrFny5Zlk/Z6JM9A+4fuQrEVGeZlFuH6 +waT4Nb2jSnZedHvo8PfjURdmR+vMlp/5R7rN2H1ZFm7Ty+pvsoyWZtbRn/JczltYjZxUp s0x7LbCHkxBHiPIBN1savmGJr1nhCIid9LGNRxzi2a98yrgzJ4GLXXnTNg/0WK+/7gLNyV xg+5GqqURxM8GOa7mwc4a1VyFFkLX5N3BobIOCFwP3OvNabFgXGfu83E1WeZsEVvWUf5Jw 9CmbNk+gyVcgCEi/FXWPu5Bgml6jz4SD1DzOljpG1hyqVsqD0JGcuYUrueMuAw== 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=1724076894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWplqVji8ibK3xjBGRhPQTisjoGNyfw9kMvv9dzjDcU=; b=sRd8/4Dhm/vuD7WdxldvzB+c1dXcdTs0c5gts+UtIG24VbexO7mLKuo0Op3He1OFwB/gdt aBxCY8XvgkaNCYsIjw06xW+Imi/wRtEFFr68TY0Ffp8Vqey4ibU8wwjvs/9Cv5KhlNeZfU jRE89YrMY3DIKmCX317cjiPJ4H8KmXA57j8Yos+N7oWo7ycBjjh31XgZ/XENgfbyP6nn5y wVB8phmobGXqcPwa5u1yNljUz7RnM773j9KNG//PcPSCL6fgtnQYYeGNe4K02yzLZa3Wf9 BWFTXuzlk6EL7D/QwtdMMRdYeBw7jr4VppXPVlAqRcvhAnKS88aazrNW9mXIDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZNt0FrpzKn4; Mon, 19 Aug 2024 14: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 47JEEriG059337; Mon, 19 Aug 2024 14:14:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEErkK059334; Mon, 19 Aug 2024 14:14:53 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:14:53 GMT Message-Id: <202408191414.47JEErkK059334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f66e71fa78e1 - main - linux.4: clarify path translation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f66e71fa78e16164339f7fd4791306fb30165581 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f66e71fa78e16164339f7fd4791306fb30165581 commit f66e71fa78e16164339f7fd4791306fb30165581 Author: Ed Maste AuthorDate: 2024-08-19 13:43:37 +0000 Commit: Ed Maste CommitDate: 2024-08-19 14:14:28 +0000 linux.4: clarify path translation Try to be a little more explicit about the path translation mechanism accessing /compat/linux/ then falling back to /. PR: 277804 Reviewed by: fernape Sponsored by: The FreeBSD Foundation --- share/man/man4/linux.4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 212dd2526f3f..b404c9e1c04d 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -63,9 +63,11 @@ before .Pa / . For example, when Linux process attempts to open .Pa /etc/passwd , -it will really access +it will first access .Pa /compat/linux/etc/passwd , -unless the latter does not exist. +falling back to +.Pa /etc/passwd +if the former does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual From nobody Mon Aug 19 14:29:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZjs3x1Zz5T7Qy; Mon, 19 Aug 2024 14:29: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 4WnZjs3MTzz4sh1; Mon, 19 Aug 2024 14:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724077777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yatoOlKYvDoEiNhc94p8Yuc1YiSXSTR1Rt6WQQwTSvg=; b=kUR0VG4bt8TnVFBLpYpMyStzpeu2kKNSAha1HN27znRUFS7Rth0psl4uLMND1BhGPKoog/ alP13rwD336Aoa+xmRpNWT5jbSGlpG2B6keKzhg4U1MefGcLZj9M3OHB+gN2dSxJMPPnUH +UgmThXY4xo8Vdng1Ll0WT2uAvYeT9ffJNlmoUF3MNsSls+4cZWV+lLaBXxI+ejzTcn9gi iOGFL7GkX40Y5dIktwiLu3oTu3NUE2hXbk1lintmaP7qd+IWCu15BYoIPqhj5is+PxJKyM 3206vErFftIcN6TlRi4QyGF2OfY0ceiWSEziF5Pe2XLVARtOwyotmdC8XvjqMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724077777; a=rsa-sha256; cv=none; b=NBEhv2r5En+vV49I3iTUNpeXOV9tpz9AppXzvlGG0xZ5jYGwHL0vaHviQqt2b/gzjci8If gGOyiG759pE1c88rvKI2e2K52+9p2lUf1peqQf5HuVdwEm3db04oav4+H4mW89zj086MTl u21RF1N6J+NtpO4rZTaBkZXNNpABmggZxLArtnGvlcf6xBNxvNYNRi0fGIdMxag3U8K7qj D93lJ5E2Bu/ph9AxXcW2sgf7E3kKIQNtTs8SmooYMFZoestzLWEQ5svDGQ9nBNkxZIhLZC irJuQV7P4C3AFJ7/EvwuZJ2XdaJJ6jW0T7pmYCGwXp1YyZdU6q6DkBAW9PQ30A== 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=1724077777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yatoOlKYvDoEiNhc94p8Yuc1YiSXSTR1Rt6WQQwTSvg=; b=Yzmpw/Pd+NokiOAMgZ/wb8+BEAgP1ukdx5IAlAvNiteH5oGDVHMLM+uzf/NjHV0HZVcQuJ v9FgnIpbqCN7qailUtQY6rjPfh4ayVUi3zD5ZVBBiaIvPdEc4ft6PuD/nt+AltiyebfBsQ vNWZ6TsbVCaf6/8uOBfd94LuQo/GDzj3hBxvFwXh0R71OJgjcDL7239UtgUUtaJWLIQsgm YW4aq/6QrxQoXFaDfVM1C60fhvR/cfOue7yJGmbJXSGeehOYMYafQG5G2J37BvTE8yDoZJ b7vdpEX2pJ+4pOcbiVKZYVgwRTJ862jlgSWGdqCFwRC1l6S5rHZ3YPySa0H5Og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZjs2yvPzJvF; Mon, 19 Aug 2024 14:29: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 47JETbID076829; Mon, 19 Aug 2024 14:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JETbc9076826; Mon, 19 Aug 2024 14:29:37 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:29:37 GMT Message-Id: <202408191429.47JETbc9076826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d1daec3d358e - main - linux.4: improve the path translation clarificiation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1 commit d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1 Author: Ed Maste AuthorDate: 2024-08-19 14:26:26 +0000 Commit: Ed Maste CommitDate: 2024-08-19 14:29:19 +0000 linux.4: improve the path translation clarificiation As suggested by martin@lispworks.com, refer to the compat path explicitly, and correct an existing grammaro. PR: 277804 Fixes: f66e71fa78e1 ("linux.4: clarify path translation") Sponsored by: The FreeBSD Foundation --- share/man/man4/linux.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index b404c9e1c04d..711ac11e8fce 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -61,13 +61,13 @@ under .Pa /compat/linux ) before .Pa / . -For example, when Linux process attempts to open +For example, when a Linux process attempts to open .Pa /etc/passwd , it will first access .Pa /compat/linux/etc/passwd , falling back to .Pa /etc/passwd -if the former does not exist. +if the compat path does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual From nobody Mon Aug 19 14:37:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZv361PZz5T8DF; Mon, 19 Aug 2024 14:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnZv35Rgkz4ttG; Mon, 19 Aug 2024 14:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kBnqa8Y/rD8b6ulMtkfv0WgRIOfj9+wyKh5ynqoemb0=; b=sXw+iAWQuP8z/aXR9obHd12BglvSs3+uxqr1aXuDPzO+YzSlUGcTNp+vm3zO2ck1Q4sZYW QvHxDBh3RXG3mp00d7fn1JqIIn8856bJYgUYCz873/BJ6dq4XJgYZpeZrKL2jICDIA7xQa bMEQXfT/MYBm+vSORU/jS+q8Mkc5luJ7PfnHbBF9tJJ5MLklWEmc+Tsji/dOEFyB4gXM+J CqiJ8xgg8pCu94RX4DytJ/RsT0yphGTCZF18l9mzjbrHka8UH1JqEkiO8hGgP0uJLci71Z 3RCI6+V4UA/UVLHbyZSpVwRZ4vWz1vRRiKmd00aTppdDQH1ZreEd/dAPZGKiAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078255; a=rsa-sha256; cv=none; b=qd+rv4aKB4DWk1MmeZB94TlAsry7s2jxRcxyHnW4PhFCh+AdMDP7fuKm1z3EzXAKuIlNSC BlMcZKHzlz8XYulqBQJikUiy7OCSOms9hd2v6KnGTviq16sBPQH6Pne0HsiCjfHtQZTaiC U6OPUT9sKXPKgMBpsGJbxzZbCwxxGNpDhVSmK95eZjG4N8+HlYGqwhOr5t5IZ/gteaznxd an3KV53mUYn/mY+w8dYyLTg1L2DQ7PjQCp13cVKf/QyIg+Wk2AoUyvojmWHD1HH1YvNXXk thQAOD7TYjSdyjrUAWWP9+cCJbU5O12QoE5UsCwOiyvwCnUsMXeULhbAvesaKw== 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=1724078255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kBnqa8Y/rD8b6ulMtkfv0WgRIOfj9+wyKh5ynqoemb0=; b=vFY4m0GSQBE9dMnU8skJT+5Gcay4Gjl4DYriqGfgsVk9AiSg8zcA2QCg+9e65hBVvLmJbv iipqTY8NVxbf8oZ815lNfDs31emVym29YTRpX1WWTtHxZ5Cc36DJsEBpnyBB8+JKBTiuBJ 136nyZFwcSMMJRaKeim5jrRf9iVE++4NfLDFZ2BVI9L/q+7K7aS2Pf9bui3Wim/M3aOeiS 6CnNxvqrvuulwLg24wWR3JobfbDKpWXlBPLrjYm5zvCL5ZcO/jNXyXV+x1EMIe6ySo8AU6 +C8aR1Bh6nVAbytc2FE1vBOtdX9r8bnVmsAzgCjOgyVI/WcrgZnlwlc3PPfn0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZv34w7dzKqr; Mon, 19 Aug 2024 14:37: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 47JEbZNw093909; Mon, 19 Aug 2024 14:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbZUe093906; Mon, 19 Aug 2024 14:37:35 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:35 GMT Message-Id: <202408191437.47JEbZUe093906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1d26746cfd4a - main - build.7: Document the packages target List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d26746cfd4a19e9d641ecd2a21e764743a7bc03 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d26746cfd4a19e9d641ecd2a21e764743a7bc03 commit 1d26746cfd4a19e9d641ecd2a21e764743a7bc03 Author: Mark Johnston AuthorDate: 2024-08-19 14:07:37 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 build.7: Document the packages target Reviewed by: manu, emaste MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46286 --- share/man/man7/build.7 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 3c71c14e6039..afafef9d3c02 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -401,6 +401,19 @@ Install the kernel to the directory .Pa ${DISTDIR}/kernel/boot/kernel . This target is used while building a release; see .Xr release 7 . +.It Cm packages +Create a +.Xr pkg 7 +repository containing packages that can be used to create or upgrade an +installation of the base system. +The output repository is placed in the object directory, under +.Pa repo/${PKG_ABI} +where +.Va PKG_ABI +is the +.Xr pkg 7 +ABI for the build target, for example, +.Pa /usr/obj/${SRCDIR}/repo/FreeBSD:15:amd64 . .It Cm packagekernel Archive the results of .Cm distributekernel , From nobody Mon Aug 19 14:37:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZv474s5z5T8JJ; Mon, 19 Aug 2024 14:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnZv46PTBz4v20; Mon, 19 Aug 2024 14:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7WUrP4h1/Kpjc84L2UcLI/uXmMY9ONX9crBiB5KjI1M=; b=uvY0mZwRqK7QHIKq0E4+8uPkz/boqf87a99fAQeMLBwEtARNeDg5XjLkrjnHGx+Ai3aFuc QYO0gGc55ZaIUL6t22X6PzJJg8RaSWGHiH4+QOFJR4VvvcZcegxqRTDK5W5s8Gx1LlQj48 5nnqfij2mP2cUEtKRVhiasRbRJbivmVb7yOA+L6wXtVXkC7/3WXzqGjqK1H/2x8NJjOqBm xUgrCA9g/hlJFt1y6oKp763slZrKID/o32PUZ4VjSbwp4+CX/ezTHVSnFHiYkqqihLM8cQ UYiflDGargt82/9Ksg2c+QB3Y+jiFvytO/5AHH/Qo1+Vl66h3/MOcMugPHyVjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078256; a=rsa-sha256; cv=none; b=P/5O+9zZGgtc0qyBBW/QgSKT5YAh6uxwu7brHcoLeUXK+FLDjZu6lnzJMSQYfiUgyTKgEv uJ6IZnV8yAGSmJX/B/x9sHc4I9CIWsv1w1nV5XHiJzSwwhz90GdRpXrfwmH9+8HwD1qCMp RtdwP433AdhMYFZux+T5DIhmRsboYY503u5qEtI0u8C1LckqL/PUaLT9YGIVBOoYmTrVvt KwOelnv4Mu0JjVxTfiUwGxugUz0eNAlhRWrlEFTYBUu1MPGgeOmpM9FVCIyd2uBaMDOI8p zDz60RoVjoOuaaMHVQeNYhTMWmZ9MZv45Gf7Kg5MsvOypNL0bPvnoIh0WvkdRQ== 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=1724078256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7WUrP4h1/Kpjc84L2UcLI/uXmMY9ONX9crBiB5KjI1M=; b=iGr1SmW/dpLKebL085gNRgFd/qdW3LdT3bAoT1jK59C0H7AtO/5/sdJRG05rc5SCL/jD9A cMUnp37rLhuNtOUXu3BPKZx+2CF6097TRm3DdNCch/Ka9d3jWlji6ipsofCwumh81kBCfL Thj3jhP8du0I6UU44TCi6wIvF5X5/5EN3SaSxaheVfEdeVBwgQO+DLAuXPjGi34Vf3NKH6 HA7kXELrjztzqDnGVwhZ1BSIGlKyX+u1bKOiYe6QLQnnW3VkBsmVv04WpYRXPQB+7RWAD2 dAKtekp6f73FYXh+ZiFN73dyqAn14bSoGbqwvCrR/wmjxBpaxjGkVQ7t/P5FPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZv45thXzLRS; Mon, 19 Aug 2024 14:37: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 47JEbaxd093961; Mon, 19 Aug 2024 14:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbaFB093958; Mon, 19 Aug 2024 14:37:36 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:36 GMT Message-Id: <202408191437.47JEbaFB093958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b118b6eb4cb7 - main - pkgbase: Unify pkg ABI handling for pkgbase targets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b118b6eb4cb7520eb348a6ac965b077fc5179fde Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b118b6eb4cb7520eb348a6ac965b077fc5179fde commit b118b6eb4cb7520eb348a6ac965b077fc5179fde Author: Mark Johnston AuthorDate: 2024-08-19 14:07:51 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 pkgbase: Unify pkg ABI handling for pkgbase targets Right now, to get the pkg ABI we either use PKG_ABI, derived from newvers.sh, or use an ABI file from the staged world. This inconsistency is confusing and can cause problems. Switch to a single source of truth: use an ABI file from the worldstage dir to get the ABI of pkgbase packages. In particular, we do not need to know the ABI until staging is done. More specifically: - use a shell command to define PKG_ABI, - replace inline uses of ABI_FILE, - run sign-packages in a subshell (this was already done for the update-packages target) so that the staging targets are done before we try to evaluate the ABI. Reviewed by: manu MFC after: 1 month Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46287 --- Makefile.inc1 | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 19ed923702b1..62296134f7d8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1994,6 +1994,10 @@ REPODIR?= ${OBJROOT}repo PKG_FORMAT?= tzst PKG_REPO_SIGNING_KEY?= # empty PKG_OUTPUT_DIR?= ${PKG_VERSION} +PKG_ABI_FILE?= ${WSTAGEDIR}/usr/bin/uname +.if make(create-*-packages*) || make(real-update-packages) || make(real-sign-packages) +PKG_ABI!= ${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI +.endif .ORDER: stage-packages create-packages .ORDER: create-packages create-world-packages @@ -2006,12 +2010,6 @@ _pkgbootstrap: .PHONY @env ASSUME_ALWAYS_YES=YES pkg bootstrap .endif -# -# Determine PKG_ABI from newvers.sh if not already set. -# -.if !defined(PKG_ABI) && (make(create-world-packages-jobs) || make(create-kernel-packages*) || make(real-update-packages) || make (create-source-packages) || make(sign-packages)) -PKG_ABI=${_TYPE}:${MAJOR_REVISION}:${TARGET_ARCH} -.endif PKG_BIN_VERSION!=${PKG_CMD} --version /dev/null |\ awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}' .if ${PKG_BIN_VERSION} < 11700 @@ -2021,8 +2019,7 @@ PKG_EXT= pkg .endif .if !defined(PKG_VERSION_FROM) && make(real-update-packages) -.if defined(PKG_ABI) -.if exists(${REPODIR}/${PKG_ABI}) +.if exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}) PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM} BRANCH_EXT_FROM= ${PKG_VERSION_FROM:C/.*([[:alpha:]][^\.]*).*/\1/} @@ -2032,7 +2029,6 @@ PKG_VERSION_FROM_DIR= BRANCH_EXT_FROM= .endif .endif -.endif PKGMAKEARGS+= PKG_VERSION=${PKG_VERSION} \ NO_INSTALLEXTRAKERNELS=${NO_INSTALLEXTRAKERNELS} @@ -2204,7 +2200,7 @@ create-world-package-${pkgname}: .PHONY @if [ "${pkgname}" == "runtime" ]; then \ sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \ fi - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ @@ -2306,7 +2302,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ create -f ${PKG_FORMAT} \ -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ @@ -2318,20 +2314,22 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne . endfor .endif -sign-packages: _pkgbootstrap .PHONY +sign-packages: .PHONY + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} real-sign-packages + +real-sign-packages: _pkgbootstrap .PHONY printf "version = 2;\n" > ${WSTAGEDIR}/meta .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ - -o OSVERSION="${SRCRELDATE}" \ + @[ -L "${REPODIR}/${PKG_ABI}/latest" ] && unlink ${REPODIR}/${PKG_ABI}/latest; \ + ${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ -m ${WSTAGEDIR}/meta \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ + -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ + ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${PKG_REPO_SIGNING_KEY} ; \ - cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \ + cd ${REPODIR}/${PKG_ABI}; \ ln -s ${PKG_OUTPUT_DIR} latest # From nobody Mon Aug 19 14:37:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZv63yMyz5T8Lv; Mon, 19 Aug 2024 14:37: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 4WnZv60CT9z4v4t; Mon, 19 Aug 2024 14:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i0pBNnJsd5OHy0W4/d5dJp10eeP4/6c1k57Grxo61FQ=; b=wXYMM+IBeQ1Rb0d6U5Q/0Hs2nqe4Aw8pKXRXv1mEf8RunI37ged0Z9hq/NRqjjN4czC+kf MTO3PJLxFs+uDHo0twbQy0sdI8Sf+TJ7hUDarofmEpxTgbKflft01aNey8lpC3HriRpSpl jAs88Ep/tyubpBhDSAl9gPKW8/Av6IZZbE8ozHpPNMC/ZmidOfrzLGSsVPjbxk2uvr7vF2 Qd9032ZTiozAUQ4qZXDOYzEWxiFPmGvnSD4PkWjg4k0JteAw04EXqT2G0R0ds92oZFW/CF ir0PnLF5Ce3sG+DL9x7OmlsFRNDIefAC5zuhzvf/jsRE5h5EArjOGNskgY9+vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078258; a=rsa-sha256; cv=none; b=NQaJLMOkYclVrceXyySKOf1udf6QEPOSVz1vKo7wqR0sNyrQMJYHxSvBb4x9J1r+gp83q7 HsMc/4y8jLHm2PbhYlkF2yzDK9Per/e+9HPppy+Qxsk1pmMgsV90/rM2wOgnx90+Tx2StF WKO13gpu8HTRb83omTqSA/qGboMF79IAGTHOR/FP77RSSJ5CF2OjcMlg57bOn6Q6vK5Ljh T02lJu/7EmHxDvvEsnKsutrS9T0eodb2u7wR8HTbLXn3XUTQJkfXZ2SYZVgec/joZnZ/jn NqXAse3DkAH0E2S5GBZq3YLq6POX35tocr5qiGoYcjN//oxkOw1dqphwCkgBhA== 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=1724078258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i0pBNnJsd5OHy0W4/d5dJp10eeP4/6c1k57Grxo61FQ=; b=RQrN2ttv8V4nmEzj3HguaXgXyCO5gZfiGUiQbus60Fwc2V669L2lzDi83u+DNdkvHk+81p 92llCiKtKk85PzBqqMkEZ3ehjUjwJKpfXMHEowDUHMSDOL9JDaVRX9xdYvIs6E5vIg0pEH qCQC2uw6M4fi88iaF5ln6aIWPCli1tBy0EdjgDhpbRwcKuiWlBRNddViPpaRxhfoOptFER QSEQXZgKHGKH0smpzTc5uXPUTZ8GddA5yLgpPtG/XoqNcGoGlQ0gKJN7WYH91Ff9o2lCfw BdZFw2REGu9va2Ek4EOj9zl8F/7ju7mPzDJvjsnKXwWlkrQKY962xp6v+izeIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZv56Y0gzLRT; Mon, 19 Aug 2024 14:37: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 47JEbbip094012; Mon, 19 Aug 2024 14:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbbT8094009; Mon, 19 Aug 2024 14:37:37 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:37 GMT Message-Id: <202408191437.47JEbbT8094009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d7d5c9efef03 - main - pkgbase: Let source packages be built in parallel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7d5c9efef031aa11a841d1836f7c937dcbe4ec8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d7d5c9efef031aa11a841d1836f7c937dcbe4ec8 commit d7d5c9efef031aa11a841d1836f7c937dcbe4ec8 Author: Mark Johnston AuthorDate: 2024-08-19 14:08:05 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 pkgbase: Let source packages be built in parallel To build the packages target, we build src and src-sys packages containing the source code from which the repo was built. These packages take significantly longer than the others, presumably because they contain many more files. Because both source packages are built to satisfy the same target, they end up being built serially. Split them into separate subtargets so that they can run in parallel. This saves a couple of minutes on my build machine. Reviewed by: manu, emaste MFC after: 1 month Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46288 --- Makefile.inc1 | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 62296134f7d8..4df7f1900cf4 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2119,17 +2119,13 @@ create-packages-source: _pkgbootstrap _repodir .PHONY create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source -create-source-packages: _pkgbootstrap .PHONY +create-source-src-package: _pkgbootstrap .PHONY rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : .if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) @cd ${SRCDIR}; \ ( echo "@override_prefix /usr/src" ; \ ${GIT_CMD} ls-files --recurse-submodules ":!:sys/" ) \ > ${SSTAGEDIR}/src.plist - @cd ${SRCDIR}; \ - ( echo "@override_prefix /usr/src" ; \ - ${GIT_CMD} ls-files --recurse-submodules "sys/" ) \ - > ${SSTAGEDIR}/src-sys.plist ${SRCDIR}/release/packages/generate-ucl.lua \ PKGNAME "src" \ PKGGENNAME "src" \ @@ -2141,6 +2137,22 @@ create-source-packages: _pkgbootstrap .PHONY PKG_WWW "${PKG_WWW}" \ ${SRCDIR}/release/packages/template.ucl \ ${SSTAGEDIR}/src.ucl + ${PKG_CMD} -o ABI=${PKG_ABI} \ + -o OSVERSION="${SRCRELDATE}" \ + create -f ${PKG_FORMAT} \ + -M ${SSTAGEDIR}/src.ucl \ + -p ${SSTAGEDIR}/src.plist \ + -r ${SRCDIR} \ + -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} +.endif + +create-source-src-sys-package: _pkgbootstrap .PHONY + rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : +.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) + @cd ${SRCDIR}; \ + ( echo "@override_prefix /usr/src" ; \ + ${GIT_CMD} ls-files --recurse-submodules "sys/" ) \ + > ${SSTAGEDIR}/src-sys.plist ${SRCDIR}/release/packages/generate-ucl.lua \ PKGNAME "src-sys" \ PKGGENNAME "src" \ @@ -2152,13 +2164,6 @@ create-source-packages: _pkgbootstrap .PHONY PKG_WWW "${PKG_WWW}" \ ${SRCDIR}/release/packages/template.ucl \ ${SSTAGEDIR}/src-sys.ucl - ${PKG_CMD} -o ABI=${PKG_ABI} \ - -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} \ - -M ${SSTAGEDIR}/src.ucl \ - -p ${SSTAGEDIR}/src.plist \ - -r ${SRCDIR} \ - -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} ${PKG_CMD} -o ABI=${PKG_ABI} \ -o OSVERSION="${SRCRELDATE}" \ create -f ${PKG_FORMAT} \ @@ -2168,6 +2173,8 @@ create-source-packages: _pkgbootstrap .PHONY -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} .endif +create-source-packages: .PHONY _pkgbootstrap create-source-src-package create-source-src-sys-package + create-world-packages: _pkgbootstrap .PHONY @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : @cd ${WSTAGEDIR} ; \ From nobody Mon Aug 19 14:37:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZv73dmyz5T8Gp; Mon, 19 Aug 2024 14:37: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 4WnZv71Ll4z4ttt; Mon, 19 Aug 2024 14:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YE/Xa2Ou7Z00oGYVesANvoKbVMj5wm2WudVJ3sFu2Ns=; b=Yl1T3ovuOtwEendOi7s/l17udJRJIg94SQNod6S1tid4cNhtf0TXKSbWmknnN84CsCYTTC AR/yL6I6n2HYXzVZ5o3E7mm2rm7c68Ht5oIec0WPBKPw02lCmMzwwcWxPS97qxRjggntoE XfzBG5K2SMBGqUpvCdPHqgu/zcJuaEGwRfACc/QltDcts2FQ24RozLS1Yl1ikmWtSodBGb /E24Ts2Wgqe6dJ+53CSnWhi/kTqP0xcOA6P04TvqA7KmsSbAVwu3SUIldvWQoyg0WVXNrU osw5oZtZK+9gZiTf7Hnraqn8PsVUel8pHCdVaK14bRmOF9F+x1rwPKSlZkSpEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078259; a=rsa-sha256; cv=none; b=nkhx3zcNgbRMxvP+T1DkVuXlLFtaP0tSxNhv8HeO+3q0+lfNC7nV7ndGv0i1MffKEeIaHW qR+BSjGgAdm/TeWfJE3Cnc80X37pildaC4jcDUb5r2U3X5Cf/T0sEBOu8hPBksHx/84SFS TCTLYxTHq4FtfLtB/Rj6xNhyx4uJ82q8iPPlfvaUw86mGAgg90MkgZa3jZ9smQ/JhOYEbh tVmebsi6SoTtGlwDzRatNuBiyfjS1EBUY27txj4AHl1zVZjDs/QYRwbzSo78TIoKLAivSb k4DZ6QMkkOIDt9+FhiEdEKe3Df/7zTX7J6PCyJE5c3EPKNrtRhptwJc7Gmc03w== 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=1724078259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YE/Xa2Ou7Z00oGYVesANvoKbVMj5wm2WudVJ3sFu2Ns=; b=T4HoL4v2NKFAdT1NnKOcKFMle464pyj1ww3NAUHGO2jmJdz8CHGn14Vrm5nZAHnu5oE1pP 3hFoP7Aa9/k+sQtzc/YuSAkgIVw+ebgLtKAPsKZj1TWkNgfDiWp0gz93t3RhSzj5eqidqC 1MY5ryZws7UOc8Ptz8In7u1HKmj1uWSDJNun9++Gfh407FqjMXUk9kUH//dC/l2hJ5pcZx eXU1lNYdkocRdPSSDiKkI3x2y4nf8XnKxltKceLu3hyL97UwbjzljLY7Qrf9YGd1QgPdic Ze+VN7e4iIulLjkT8iikqnJgJCe+5pU9XDlqkNqjKuxiet2FPeJczAs1ILuKIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZv70bh4zL1W; Mon, 19 Aug 2024 14:37: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 47JEbcIQ094096; Mon, 19 Aug 2024 14:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbco3094093; Mon, 19 Aug 2024 14:37:38 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:38 GMT Message-Id: <202408191437.47JEbco3094093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9897a66923a3 - main - pf: Let rdr rules modify the src port if doing so would avoid a conflict List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9897a66923a3e79c22fcbd4bc80afae9eb9f277c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9897a66923a3e79c22fcbd4bc80afae9eb9f277c commit 9897a66923a3e79c22fcbd4bc80afae9eb9f277c Author: Mark Johnston AuthorDate: 2024-08-19 14:08:44 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 pf: Let rdr rules modify the src port if doing so would avoid a conflict If NAT rules cause inbound connections to different external IPs to be mapped to the same internal IP, and some application uses the same source port for multiple such connections, rdr translation may result in conflicts that cause some of the connections to be dropped. Address this by letting rdr rules detect state conflicts and modulate the source port to avoid them. Reviewed by: kp, allanjude MFC after: 3 months Sponsored by: Klara, Inc. Sponsored by: Modirum Differential Revision: https://reviews.freebsd.org/D44488 --- share/man/man5/pf.conf.5 | 9 +++- sys/netpfil/pf/pf_lb.c | 70 ++++++++++++++++++++++--- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/rdr-srcport.py | 20 ++++++++ tests/sys/netpfil/pf/rdr.sh | 100 ++++++++++++++++++++++++++++++++++++ 5 files changed, 191 insertions(+), 9 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index da55f00293bb..f04b0799741e 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 6, 2024 +.Dd June 24, 2024 .Dt PF.CONF 5 .Os .Sh NAME @@ -1400,9 +1400,14 @@ or .Xr udp 4 connections; implicitly in the case of .Ar nat -rules and explicitly in the case of +rules and both implicitly and explicitly in the case of .Ar rdr rules. +A +.Ar rdr +rule may cause the source port to be modified if doing so avoids a conflict +with an existing connection. +A random source port in the range 50001-65535 is chosen in this case. Port numbers are never translated with a .Ar binat rule. diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 4fcad7e578a8..4b703d3d02da 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -600,7 +600,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, { struct pf_krule *r = NULL; struct pf_addr *naddr; - uint16_t *nport; + uint16_t *nportp; uint16_t low, high; PF_RULES_RASSERT(); @@ -643,9 +643,8 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, return (NULL); } - /* XXX We only modify one side for now. */ naddr = &(*nkp)->addr[1]; - nport = &(*nkp)->port[1]; + nportp = &(*nkp)->port[1]; switch (r->action) { case PF_NAT: @@ -658,7 +657,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, } if (r->rpool.mape.offset > 0) { if (pf_get_mape_sport(pd->af, pd->proto, r, saddr, - sport, daddr, dport, naddr, nport, sn)) { + sport, daddr, dport, naddr, nportp, sn)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: MAP-E port allocation (%u/%u/%u)" " failed\n", @@ -668,7 +667,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, goto notrans; } } else if (pf_get_sport(pd->af, pd->proto, r, saddr, sport, - daddr, dport, naddr, nport, low, high, sn)) { + daddr, dport, naddr, nportp, low, high, sn)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation (%u-%u) failed\n", r->rpool.proxy_port[0], r->rpool.proxy_port[1])); @@ -742,6 +741,9 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, } break; case PF_RDR: { + struct pf_state_key_cmp key; + uint16_t cut, low, high, nport; + if (pf_map_addr(pd->af, r, saddr, naddr, NULL, NULL, sn)) goto notrans; if ((r->rpool.opts & PF_POOL_TYPEMASK) == PF_POOL_BITMASK) @@ -762,9 +764,63 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, /* Wrap around if necessary. */ if (tmp_nport > 65535) tmp_nport -= 65535; - *nport = htons((uint16_t)tmp_nport); + nport = htons((uint16_t)tmp_nport); } else if (r->rpool.proxy_port[0]) - *nport = htons(r->rpool.proxy_port[0]); + nport = htons(r->rpool.proxy_port[0]); + else + nport = dport; + + /* + * Update the destination port. + */ + *nportp = nport; + + /* + * Do we have a source port conflict in the stack state? Try to + * modulate the source port if so. Note that this is racy since + * the state lookup may not find any matches here but will once + * pf_create_state() actually instantiates the state. + */ + bzero(&key, sizeof(key)); + key.af = pd->af; + key.proto = pd->proto; + key.port[0] = sport; + PF_ACPY(&key.addr[0], saddr, key.af); + key.port[1] = nport; + PF_ACPY(&key.addr[1], naddr, key.af); + + if (!pf_find_state_all_exists(&key, PF_OUT)) + break; + + low = 50001; /* XXX-MJ PF_NAT_PROXY_PORT_LOW/HIGH */ + high = 65535; + cut = arc4random() % (1 + high - low) + low; + for (uint32_t tmp = cut; + tmp <= high && tmp <= UINT16_MAX; tmp++) { + key.port[0] = htons(tmp); + if (!pf_find_state_all_exists(&key, PF_OUT)) { + /* Update the source port. */ + (*nkp)->port[0] = htons(tmp); + goto out; + } + } + for (uint32_t tmp = cut - 1; tmp >= low; tmp--) { + key.port[0] = htons(tmp); + if (!pf_find_state_all_exists(&key, PF_OUT)) { + /* Update the source port. */ + (*nkp)->port[0] = htons(tmp); + goto out; + } + } + + DPFPRINTF(PF_DEBUG_MISC, + ("pf: RDR source port allocation failed\n")); + if (0) { +out: + DPFPRINTF(PF_DEBUG_MISC, + ("pf: RDR source port allocation %u->%u\n", + ntohs(sport), ntohs((*nkp)->port[0]))); + } break; } default: diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 4a16642a967b..2b3cb9fbd858 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -73,6 +73,7 @@ ${PACKAGE}FILES+= CVE-2019-5597.py \ pfsync_defer.py \ pft_ether.py \ pft_read_ipfix.py \ + rdr-srcport.py \ utils.subr ${PACKAGE}FILESMODE_CVE-2019-5597.py= 0555 diff --git a/tests/sys/netpfil/pf/rdr-srcport.py b/tests/sys/netpfil/pf/rdr-srcport.py new file mode 100644 index 000000000000..633580582711 --- /dev/null +++ b/tests/sys/netpfil/pf/rdr-srcport.py @@ -0,0 +1,20 @@ +# +# A helper script which accepts TCP connections and writes the remote port +# number to the stream. +# + +import socket + +def main(): + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.bind(('0.0.0.0', 8888)) + s.listen(5) + + while True: + cs, addr = s.accept() + cs.sendall(str(addr[1]).encode()) + cs.close() + +if __name__ == '__main__': + main() diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index b7ec80b4d85e..135bfd42c1f4 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -121,7 +121,107 @@ tcp_v6_cleanup() pft_cleanup } + +atf_test_case "srcport" "cleanup" +srcport_head() +{ + atf_set descr 'TCP rdr srcport modulation' + atf_set require.user root + atf_set require.progs python3 + atf_set timeout 9999 +} + +# +# Test that rdr works for multiple TCP with same srcip and srcport. +# +# Four jails, a, b, c, d, are used: +# - jail d runs a server on port 8888, +# - jail a makes connections to the server, routed through jails b and c, +# - jail b uses NAT to rewrite source addresses and ports to the same 2-tuple, +# avoiding the need to use SO_REUSEADDR in jail a, +# - jail c uses a redirect rule to map the destination address to the same +# address and port, resulting in a NAT state conflict. +# +# In this case, the rdr rule should also rewrite the source port (again) to +# resolve the state conflict. +# +srcport_body() +{ + pft_init + + j="rdr:srcport" + epair1=$(vnet_mkepair) + epair2=$(vnet_mkepair) + epair3=$(vnet_mkepair) + + echo $epair_one + echo $epair_two + + vnet_mkjail ${j}a ${epair1}a + vnet_mkjail ${j}b ${epair1}b ${epair2}a + vnet_mkjail ${j}c ${epair2}b ${epair3}a + vnet_mkjail ${j}d ${epair3}b + + # configure addresses for a + jexec ${j}a ifconfig lo0 up + jexec ${j}a ifconfig ${epair1}a inet 198.51.100.50/24 up + jexec ${j}a ifconfig ${epair1}a inet alias 198.51.100.51/24 + jexec ${j}a ifconfig ${epair1}a inet alias 198.51.100.52/24 + + # configure addresses for b + jexec ${j}b ifconfig lo0 up + jexec ${j}b ifconfig ${epair1}b inet 198.51.100.1/24 up + jexec ${j}b ifconfig ${epair2}a inet 198.51.101.2/24 up + + # configure addresses for c + jexec ${j}c ifconfig lo0 up + jexec ${j}c ifconfig ${epair2}b inet 198.51.101.3/24 up + jexec ${j}c ifconfig ${epair2}b inet alias 198.51.101.4/24 + jexec ${j}c ifconfig ${epair2}b inet alias 198.51.101.5/24 + jexec ${j}c ifconfig ${epair3}a inet 203.0.113.1/24 up + + # configure addresses for d + jexec ${j}d ifconfig lo0 up + jexec ${j}d ifconfig ${epair3}b inet 203.0.113.50/24 up + + jexec ${j}b sysctl net.inet.ip.forwarding=1 + jexec ${j}c sysctl net.inet.ip.forwarding=1 + jexec ${j}b pfctl -e + jexec ${j}c pfctl -e + + pft_set_rules ${j}b \ + "set debug misc" \ + "nat on ${epair2}a inet from 198.51.100.0/24 to any -> ${epair2}a static-port" + + pft_set_rules ${j}c \ + "set debug misc" \ + "rdr on ${epair2}b proto tcp from any to ${epair2}b port 7777 -> 203.0.113.50 port 8888" + + jexec ${j}a route add default 198.51.100.1 + jexec ${j}c route add 198.51.100.0/24 198.51.101.2 + jexec ${j}d route add 198.51.101.0/24 203.0.113.1 + + jexec ${j}d python3 $(atf_get_srcdir)/rdr-srcport.py & + sleep 1 + + echo a | jexec ${j}a nc -w 3 -s 198.51.100.50 -p 1234 198.51.101.3 7777 > port1 + + jexec ${j}a nc -s 198.51.100.51 -p 1234 198.51.101.4 7777 > port2 & + jexec ${j}a nc -s 198.51.100.52 -p 1234 198.51.101.5 7777 > port3 & + sleep 1 + + atf_check -o inline:"1234" cat port1 + atf_check -o match:"[0-9]+" -o not-inline:"1234" cat port2 + atf_check -o match:"[0-9]+" -o not-inline:"1234" cat port3 +} + +srcport_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "tcp_v6" + atf_add_test_case "srcport" } From nobody Mon Aug 19 14:37:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZv84QT6z5T8Bk; Mon, 19 Aug 2024 14:37: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 4WnZv82DSvz4tv2; Mon, 19 Aug 2024 14:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyj6DZX0JWhknLtbFvZ7JEDBDEqTjSrbEhfA3ZhrLCw=; b=u8RUE5nT2UTTzG5MLitsdl7oTt+Z0WgrmF4+o8xp5z6UwM8cO7BOuTJFD7UsbZ65bE9/Wt 5k2ffeQIRWSdLTjh6Kptm+KJbuBWE0hfYGLz6d2rcVT6kHBq+j3Vft46B0TCm/uBvo9/hN 2Q2v2vuTWm9tllkllG+bdrj32qWF1XIyUFQF6/BjMqL8zJLIBIUhkuYyPlrAykDsDgdvIk lff3oGC0uShqEY9kPEP4otFOWnnx1FHIq904VBI4MxWXphAh2FmX67NCm24SwFPk5dsq/Q 9s3NkOCUC8qkaEV0uCwu/CWUzoR5gjKVMiQYQ69qb1KJuJEDu/kpBa1Q03/lDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078260; a=rsa-sha256; cv=none; b=k89ble7nt6r+3pzxDbZsaaxDPWrYs7qmtOAuMwbLOkHTZuY8DYicN59Fjx5bcR+SkNIZ+6 ewdbIlL+ZlUkJlIFhal6TFTwL1Eun7TnlpLQpD027hKNr6fqmMZ/YfBQAyL+wx6PRcSmAd 3NfM/t4z/gC1OSbYl6KQnpeOTXZuK+JmLRM2jhOmwFcHPfbakMfdTF8HDtO4AfjOsC+IZa uhbrfr/46uFyD7OdVS8nrfoLZF+C7qal06I42giotF5pAMgFrXpzjOg/YQ6HzhGFAeS6ov KkKBiE+xIk3CtPFCCSozIYY1RmbvCrWjPd61OFUC/TpmVuIKfhWqZgrQ8Qf6RQ== 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=1724078260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyj6DZX0JWhknLtbFvZ7JEDBDEqTjSrbEhfA3ZhrLCw=; b=NobiXsyJCNfk0fcendJMa43Pw/rqJehFcT0XjchJqIKPMAbGiafvHv6/HI1o5ki7HuI20/ 0pz5rBHIspaQ/NNaCBtKlFDep27iM2AaeEYP/+L3l6d+Tae3G5cus/LUnHBgrkzPatP08f 8CxF7SXf+ffbS5Fud1aPIgc3mGqiNEdKhmR1nlmeFJ3jSU7uZGGuWDiLUTgMApk0H+J6s5 yE2nr/mFPT1l9lb1lTX5ad6gRjIygoE4+aF9rbC5gsRvJLvzY+F1rtiSxeU6Uz92JVx4V9 V2+U5RSBpdasTJdEI8NZTCPJ7qkIpWu9rWZ75XX+elIUFOqKXoZ+19Z6HfP1CA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZv81KsBzLRV; Mon, 19 Aug 2024 14:37: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 47JEbeid094141; Mon, 19 Aug 2024 14:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbeaf094138; Mon, 19 Aug 2024 14:37:40 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:40 GMT Message-Id: <202408191437.47JEbeaf094138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7e65cfc9bbe5 - main - pf: Make pf_get_translation() more expressive List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e65cfc9bbe5a9d735ef38f7ed49965b234b8a20 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7e65cfc9bbe5a9d735ef38f7ed49965b234b8a20 commit 7e65cfc9bbe5a9d735ef38f7ed49965b234b8a20 Author: Mark Johnston AuthorDate: 2024-08-19 14:14:30 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 pf: Make pf_get_translation() more expressive Currently pf_get_translation() returns a pointer to a matching nat/rdr/binat rule, or NULL if no rule was matched or an error occurred while applying the translation. That is, we don't distinguish between errors and the lack of a matching rule. This, if an error (e.g., a memory allocation failure or a state conflict) occurs, we simply handle the packet as if no translation rule was present. This is not desireable. Make pf_get_translation() return the matching rule as an out-param and instead return a reason code which indicates whether there was no translation rule, or there was a translation rule and we failed to apply it, or there was a translation rule and we applied it successfully. Reviewed by: kp, allanjude MFC after: 3 months Sponsored by: Klara, Inc. Sponsored by: Modirum Differential Revision: https://reviews.freebsd.org/D45672 --- sys/net/pfvar.h | 5 +++-- sys/netpfil/pf/pf.c | 18 ++++++++++++---- sys/netpfil/pf/pf_lb.c | 57 +++++++++++++++++++++++++++++++++----------------- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 863883c2d61e..d66e6f799761 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2569,11 +2569,12 @@ u_short pf_map_addr(u_int8_t, struct pf_krule *, struct pf_addr *, struct pf_addr *, struct pfi_kkif **nkif, struct pf_addr *, struct pf_ksrc_node **); -struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, +u_short pf_get_translation(struct pf_pdesc *, struct mbuf *, int, struct pfi_kkif *, struct pf_ksrc_node **, struct pf_state_key **, struct pf_state_key **, struct pf_addr *, struct pf_addr *, - uint16_t, uint16_t, struct pf_kanchor_stackframe *); + uint16_t, uint16_t, struct pf_kanchor_stackframe *, + struct pf_krule **); struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0547e29e04c2..2bbd231b3ee9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4605,7 +4605,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, struct pf_ksrc_node *nsn = NULL; struct tcphdr *th = &pd->hdr.tcp; struct pf_state_key *sk = NULL, *nk = NULL; - u_short reason; + u_short reason, transerror; int rewrite = 0, hdrlen = 0; int tag = -1; int asd = 0; @@ -4618,6 +4618,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, PF_RULES_RASSERT(); + SLIST_INIT(&match_rules); + if (inp != NULL) { INP_LOCK_ASSERT(inp); pd->lookup.uid = inp->inp_cred->cr_uid; @@ -4686,8 +4688,17 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_FILTER].active.ptr); /* check packet for BINAT/NAT/RDR */ - if ((nr = pf_get_translation(pd, m, off, kif, &nsn, &sk, - &nk, saddr, daddr, sport, dport, anchor_stack)) != NULL) { + transerror = pf_get_translation(pd, m, off, kif, &nsn, &sk, + &nk, saddr, daddr, sport, dport, anchor_stack, &nr); + switch (transerror) { + default: + /* A translation error occurred. */ + REASON_SET(&reason, transerror); + goto cleanup; + case PFRES_MAX: + /* No match. */ + break; + case PFRES_MATCH: KASSERT(sk != NULL, ("%s: null sk", __func__)); KASSERT(nk != NULL, ("%s: null nk", __func__)); @@ -4836,7 +4847,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, pd->nat_rule = nr; } - SLIST_INIT(&match_rules); while (r != NULL) { pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 4b703d3d02da..68fc76233dab 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -591,22 +591,26 @@ done: return (reason); } -struct pf_krule * +u_short pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, struct pfi_kkif *kif, struct pf_ksrc_node **sn, struct pf_state_key **skp, struct pf_state_key **nkp, struct pf_addr *saddr, struct pf_addr *daddr, - uint16_t sport, uint16_t dport, struct pf_kanchor_stackframe *anchor_stack) + uint16_t sport, uint16_t dport, struct pf_kanchor_stackframe *anchor_stack, + struct pf_krule **rp) { struct pf_krule *r = NULL; struct pf_addr *naddr; uint16_t *nportp; uint16_t low, high; + u_short reason; PF_RULES_RASSERT(); KASSERT(*skp == NULL, ("*skp not NULL")); KASSERT(*nkp == NULL, ("*nkp not NULL")); + *rp = NULL; + if (pd->dir == PF_OUT) { r = pf_match_translation(pd, m, off, kif, saddr, sport, daddr, dport, PF_RULESET_BINAT, anchor_stack); @@ -624,23 +628,23 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, } if (r == NULL) - return (NULL); + return (PFRES_MAX); switch (r->action) { case PF_NONAT: case PF_NOBINAT: case PF_NORDR: - return (NULL); + return (PFRES_MAX); } *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); if (*skp == NULL) - return (NULL); + return (PFRES_MEMORY); *nkp = pf_state_key_clone(*skp); if (*nkp == NULL) { uma_zfree(V_pf_state_key_z, *skp); *skp = NULL; - return (NULL); + return (PFRES_MEMORY); } naddr = &(*nkp)->addr[1]; @@ -664,6 +668,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, r->rpool.mape.offset, r->rpool.mape.psidlen, r->rpool.mape.psid)); + reason = PFRES_MAPFAILED; goto notrans; } } else if (pf_get_sport(pd->af, pd->proto, r, saddr, sport, @@ -671,6 +676,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation (%u-%u) failed\n", r->rpool.proxy_port[0], r->rpool.proxy_port[1])); + reason = PFRES_MAPFAILED; goto notrans; } break; @@ -682,8 +688,10 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, #ifdef INET case AF_INET: if (r->rpool.cur->addr.p.dyn-> - pfid_acnt4 < 1) + pfid_acnt4 < 1) { + reason = PFRES_MAPFAILED; goto notrans; + } PF_POOLMASK(naddr, &r->rpool.cur->addr.p.dyn-> pfid_addr4, @@ -694,8 +702,10 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, #ifdef INET6 case AF_INET6: if (r->rpool.cur->addr.p.dyn-> - pfid_acnt6 < 1) + pfid_acnt6 < 1) { + reason = PFRES_MAPFAILED; goto notrans; + } PF_POOLMASK(naddr, &r->rpool.cur->addr.p.dyn-> pfid_addr6, @@ -715,8 +725,10 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, switch (pd->af) { #ifdef INET case AF_INET: - if (r->src.addr.p.dyn-> pfid_acnt4 < 1) + if (r->src.addr.p.dyn->pfid_acnt4 < 1) { + reason = PFRES_MAPFAILED; goto notrans; + } PF_POOLMASK(naddr, &r->src.addr.p.dyn->pfid_addr4, &r->src.addr.p.dyn->pfid_mask4, @@ -725,8 +737,10 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, #endif /* INET */ #ifdef INET6 case AF_INET6: - if (r->src.addr.p.dyn->pfid_acnt6 < 1) + if (r->src.addr.p.dyn->pfid_acnt6 < 1) { + reason = PFRES_MAPFAILED; goto notrans; + } PF_POOLMASK(naddr, &r->src.addr.p.dyn->pfid_addr6, &r->src.addr.p.dyn->pfid_mask6, @@ -744,7 +758,8 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, struct pf_state_key_cmp key; uint16_t cut, low, high, nport; - if (pf_map_addr(pd->af, r, saddr, naddr, NULL, NULL, sn)) + reason = pf_map_addr(pd->af, r, saddr, naddr, NULL, NULL, sn); + if (reason != 0) goto notrans; if ((r->rpool.opts & PF_POOL_TYPEMASK) == PF_POOL_BITMASK) PF_POOLMASK(naddr, naddr, &r->rpool.cur->addr.v.a.mask, @@ -815,12 +830,13 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, DPFPRINTF(PF_DEBUG_MISC, ("pf: RDR source port allocation failed\n")); - if (0) { + reason = PFRES_MAPFAILED; + goto notrans; + out: - DPFPRINTF(PF_DEBUG_MISC, - ("pf: RDR source port allocation %u->%u\n", - ntohs(sport), ntohs((*nkp)->port[0]))); - } + DPFPRINTF(PF_DEBUG_MISC, + ("pf: RDR source port allocation %u->%u\n", + ntohs(sport), ntohs((*nkp)->port[0]))); break; } default: @@ -828,14 +844,17 @@ out: } /* Return success only if translation really happened. */ - if (bcmp(*skp, *nkp, sizeof(struct pf_state_key_cmp))) - return (r); + if (bcmp(*skp, *nkp, sizeof(struct pf_state_key_cmp))) { + *rp = r; + return (PFRES_MATCH); + } + reason = PFRES_MAX; notrans: uma_zfree(V_pf_state_key_z, *nkp); uma_zfree(V_pf_state_key_z, *skp); *skp = *nkp = NULL; *sn = NULL; - return (NULL); + return (reason); } From nobody Mon Aug 19 14:37:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZv96dMlz5T8M2; Mon, 19 Aug 2024 14:37: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 4WnZv93q5Bz4tvD; Mon, 19 Aug 2024 14:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6dapba6pF3Z5OT+DYg50kymfDYrtEgxsB5y9w3DGA7o=; b=YUmPO6QV+KJpn+LCs/3fhXrP7IcDOiuiBny7Woh+7tSDl1ZwGZt4zVTRhF5foL4kiM5HeN XxOkRmTsOLJ4DIPJsl7dlB1jN5SqbExkpcNTal4kcVC4raAgx147yFEgclsPh+br4OG5E+ tsTupSXDFgcSha1RREmcbcwxwQ/lXsWbyZIoL+tVCPufo5PrJGyRL79Cg9Oe1glgYxjRLC EAYzCNBjdEZWpKznnMPt26OuaO4fuO86oFXOO+ABRoz6evA39QC9ojVNLoWY6FXU4Ga6hH MOqp2I8eW0oQzrklLobrl/qhZ5PDTii75gmrG35lSQPNAjR+HAlTu0OD6RRg0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078261; a=rsa-sha256; cv=none; b=XtRwcoFSqv6B8dPZ4Ms6jB+SjVWydLoDp8gwJOQwP1Xu25TWGLlkTWfzCV6aT38EBboVaV K30DLCB1+Cgaw5J4HqD3jtSd9PkLKadC+5TlheWU2F5w3c3vAGpSceyJpW85lxQG6F+WYF /PlMdcTn1AOe8H41+o/K0u77jjCQaKBkKN+c8glm28h1yu2ac1ciYBltdNx8Rq3/ycYtuN uhTCf5+3KXozQ5emxVvZZxyruz+9Rhk7QV2TJVgPUzc2TT8NiAscof6zdzBp0NSbqbz6yd RZOb8FSe4pGLrC030xSK3QjfGEAd+OlA4TkmySDRtqjeA6d/xwBpoOuAeO0FFA== 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=1724078261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6dapba6pF3Z5OT+DYg50kymfDYrtEgxsB5y9w3DGA7o=; b=BFWhr6EvTrdDfFkcvVRAw+fvjwPBJcGCwI46RVpbn1ZTNdsWixNaJCnHtroOe/jyVE831p sGSedF3KYJs7PWaHcgyBuRjuxfVCjf4Xsp2d8RuGBVuWQrYmA6XnUz4+CtJ56kTHOiMDNa jC78Jz++udEjIumbWka5CtJ2exyqsxVlyMpeo9vYNJx/YesHejV+dU+BpvIEnfdMgfuumw yBPk84rQ52c4MVbtH5PrwUh6L9RwfS0Dgo30E0yM8DJhD8Hk98AdOzPQUbXS8amf8rou3r R0kTW+vdzYYV01Bmtb1uvYC9054+Y0irG1JN/iAw6mb2pcOAvJ8w8AgidJLwYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZv92KTWzKqs; Mon, 19 Aug 2024 14:37: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 47JEbfCD094180; Mon, 19 Aug 2024 14:37:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbf28094177; Mon, 19 Aug 2024 14:37:41 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:41 GMT Message-Id: <202408191437.47JEbf28094177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: aa141adc039a - main - socket: Split up soreceive_stream() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa141adc039a5418d7b7800094115d861baf91a0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aa141adc039a5418d7b7800094115d861baf91a0 commit aa141adc039a5418d7b7800094115d861baf91a0 Author: Mark Johnston AuthorDate: 2024-08-19 14:20:03 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 socket: Split up soreceive_stream() Factor out the bits that run with the sock I/O lock held into a separate function. No functional change intended. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46303 --- sys/kern/uipc_socket.c | 109 ++++++++++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 47 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 9a44c1d557f0..5886c7ac84f4 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2566,56 +2566,15 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. */ -int -soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, - struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +static int +soreceive_stream_locked(struct socket *so, struct sockbuf *sb, + struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, + struct mbuf **controlp, int flags) { - int len = 0, error = 0, flags, oresid; - struct sockbuf *sb; + int len = 0, error = 0, oresid; struct mbuf *m, *n = NULL; - /* We only do stream sockets. */ - if (so->so_type != SOCK_STREAM) - return (EINVAL); - if (psa != NULL) - *psa = NULL; - if (flagsp != NULL) - flags = *flagsp &~ MSG_EOR; - else - flags = 0; - if (controlp != NULL) - *controlp = NULL; - if (flags & MSG_OOB) - return (soreceive_rcvoob(so, uio, flags)); - if (mp0 != NULL) - *mp0 = NULL; - - sb = &so->so_rcv; - -#ifdef KERN_TLS - /* - * KTLS store TLS records as records with a control message to - * describe the framing. - * - * We check once here before acquiring locks to optimize the - * common case. - */ - if (sb->sb_tls_info != NULL) - return (soreceive_generic(so, psa, uio, mp0, controlp, - flagsp)); -#endif - - /* Prevent other readers from entering the socket. */ - error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); - if (error) - return (error); -#ifdef KERN_TLS - if (__predict_false(sb->sb_tls_info != NULL)) { - SOCK_IO_RECV_UNLOCK(so); - return (soreceive_generic(so, psa, uio, mp0, controlp, - flagsp)); - } -#endif + SOCK_IO_RECV_ASSERT_LOCKED(so); SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ @@ -2778,6 +2737,62 @@ out: SBLASTRECORDCHK(sb); SBLASTMBUFCHK(sb); SOCKBUF_UNLOCK(sb); + return (error); +} + +int +soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, + struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +{ + struct sockbuf *sb; + int error, flags; + + sb = &so->so_rcv; + + /* We only do stream sockets. */ + if (so->so_type != SOCK_STREAM) + return (EINVAL); + if (psa != NULL) + *psa = NULL; + if (flagsp != NULL) + flags = *flagsp & ~MSG_EOR; + else + flags = 0; + if (controlp != NULL) + *controlp = NULL; + if (flags & MSG_OOB) + return (soreceive_rcvoob(so, uio, flags)); + if (mp0 != NULL) + *mp0 = NULL; + +#ifdef KERN_TLS + /* + * KTLS store TLS records as records with a control message to + * describe the framing. + * + * We check once here before acquiring locks to optimize the + * common case. + */ + if (sb->sb_tls_info != NULL) + return (soreceive_generic(so, psa, uio, mp0, controlp, + flagsp)); +#endif + + /* + * Prevent other threads from reading from the socket. This lock may be + * dropped in order to sleep waiting for data to arrive. + */ + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); + if (error) + return (error); +#ifdef KERN_TLS + if (__predict_false(sb->sb_tls_info != NULL)) { + SOCK_IO_RECV_UNLOCK(so); + return (soreceive_generic(so, psa, uio, mp0, controlp, + flagsp)); + } +#endif + error = soreceive_stream_locked(so, sb, psa, uio, mp0, controlp, flags); SOCK_IO_RECV_UNLOCK(so); return (error); } From nobody Mon Aug 19 14:37:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZvC0519z5T85G; Mon, 19 Aug 2024 14:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnZvB4m17z4v3L; Mon, 19 Aug 2024 14:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IH3XQbp6U5J8gENbk5XuWG475Jo8FwIh1LhDyCIufss=; b=BA2fbsFSXLSPksotqOG2G7deyNnXslXdlIDX3eh/DgET6B9jhTegTiZG8DmYzYt+kkWoDN kzrx5G2MyLgXHAlmEnoEfEWdnbbqMslCo/S6Z3HPYHJWeCZTRxPIGyFlLY2SMKu8CUluBh drXQK8KBq0bl6T05WcGoVGw46yM133r2xN6tgC4XGmY5vh9CQDh0tZa5KKXrIGD5Xe/OYk BPit+eXcv2BpiKImU49p+SEpvNWwanxeY8ueijeGfdH53aMOhhWzE7SoD30J2QG0PRAOJO gUgSJNKfdQVRRCECRe2Vi/uiHf8wMVWKGFRf7lND8mE82K8sSmXXOZeV4x4MlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078262; a=rsa-sha256; cv=none; b=pJxR9vPwYdpFCVYE2se7EXKlRNOEZOxrJJmLPrj1Kvy/xJnOYR1A0vVjX7UeZnuJX+6ODW 58GToAs2bRZ6khZTJlYmULB+XYRHC6wlz3n4lFYVPdJZyd/3U+9PlyXeQQsIBEFKqluVHx oVUDIaBvb5OHrT4bpWS4lhjYTxeLuwvdwAfv9fwo2A0uZ+IliwBIwtA9vvFvOfN4AJgNOo NhlsWfrNJi9VKCzEK4rWC4adn1SGLlP2IwTWGnK9sOAGBkB5GonvzLCHmRmuenbDxp6EAz fzKVaxRU5yJhQwprylfdPYu4EOvDc37vHLKt9sldF2xRzKcE2km0Obe03iQefg== 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=1724078262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IH3XQbp6U5J8gENbk5XuWG475Jo8FwIh1LhDyCIufss=; b=v5g+cKuiz97gw67tcmh9n6CepFJkhCVSn6STXQDTZOP+IQwgqDbBVNqcUZfp+ZVxpGA2LL wijgBIEhRVVCwZxmkGCth6TaB1HV1mTChPHIy44UCBlBBuCczwSRgae5zZfILAosj5V7i8 QyURNd7zgCMBE2Quu4SnAj1p0b4SU7a0+HJ8SudJA480OcQV2Uq8jctruHzuxG/8QZmLiL ubg3aSujZmSLVsuPHhmY4lTwI9PEJjZHZhhBlSIY/q8WBqV91L9MY0lo0eiliDImO6BcZk jAX33KUhoMaXcZJ/0dqj8A4Y/Bwm4j1PE6fuknHHcjq8mT2k9iCgFfakbkNN5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZvB3hD4zLRW; Mon, 19 Aug 2024 14:37: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 47JEbgdN094219; Mon, 19 Aug 2024 14:37:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbgAv094216; Mon, 19 Aug 2024 14:37:42 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:42 GMT Message-Id: <202408191437.47JEbgAv094216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0a68f644dca1 - main - socket: Split up soreceive_generic() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a68f644dca19670686007071479f919a56ea37f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a68f644dca19670686007071479f919a56ea37f commit 0a68f644dca19670686007071479f919a56ea37f Author: Mark Johnston AuthorDate: 2024-08-19 14:20:19 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 socket: Split up soreceive_generic() Factor out the bits that run with the sock I/O lock held into a separate function. No functional change intended. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46304 --- sys/kern/uipc_socket.c | 51 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 5886c7ac84f4..e7c4a85d5970 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2070,11 +2070,11 @@ sockbuf_pushsync(struct sockbuf *sb, struct mbuf *nextrecord) * mbuf **mp0 for use in returning the chain. The uio is then used only for * the count in uio_resid. */ -int -soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, - struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +static int +soreceive_generic_locked(struct socket *so, struct sockaddr **psa, + struct uio *uio, struct mbuf **mp, struct mbuf **controlp, int *flagsp) { - struct mbuf *m, **mp; + struct mbuf *m; int flags, error, offset; ssize_t len; struct protosw *pr = so->so_proto; @@ -2083,25 +2083,15 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, ssize_t orig_resid = uio->uio_resid; bool report_real_len = false; - mp = mp0; - if (psa != NULL) - *psa = NULL; - if (controlp != NULL) - *controlp = NULL; + SOCK_IO_RECV_ASSERT_LOCKED(so); + + error = 0; if (flagsp != NULL) { report_real_len = *flagsp & MSG_TRUNC; *flagsp &= ~MSG_TRUNC; flags = *flagsp &~ MSG_EOR; } else flags = 0; - if (flags & MSG_OOB) - return (soreceive_rcvoob(so, uio, flags)); - if (mp != NULL) - *mp = NULL; - - error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); - if (error) - return (error); restart: SOCKBUF_LOCK(&so->so_rcv); @@ -2559,6 +2549,33 @@ dontblock: if (flagsp != NULL) *flagsp |= flags; release: + return (error); +} + +int +soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, + struct mbuf **mp, struct mbuf **controlp, int *flagsp) +{ + int error, flags; + + if (psa != NULL) + *psa = NULL; + if (controlp != NULL) + *controlp = NULL; + if (flagsp != NULL) { + flags = *flagsp; + if ((flags & MSG_OOB) != 0) + return (soreceive_rcvoob(so, uio, flags)); + } else { + flags = 0; + } + if (mp != NULL) + *mp = NULL; + + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); + if (error) + return (error); + error = soreceive_generic_locked(so, psa, uio, mp, controlp, flagsp); SOCK_IO_RECV_UNLOCK(so); return (error); } From nobody Mon Aug 19 14:37:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnZvD27BTz5T8Gy; Mon, 19 Aug 2024 14:37: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 4WnZvC5Q19z4v7G; Mon, 19 Aug 2024 14:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724078263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Q1j114JbbcVQa/dHb57bxs+eHckYuxSOsUIhj3nJJo=; b=IGbUcdBSBb7q5dJHkqjrCjM6cJchr1hjK/G0PZU6NrMrDc7HmCMoaBSSHg4fJme5w3pbJy xHYH17OKu+pNS8fGMemb9hz7kgzn5Yl8aisB4runREJGqwCpmqm9gg9STgHMLL58tWQ0mx 5wxObj2GXqR93ElSoMme4IR9VfVGvFniXZ+Ds4J2f6zjevnhCfV9zQQqr3ctqRrSCjXjc4 7D+OQunV1a3LgfHadHii4Y2sKnaqtndCCIqY2HXK4Zn4kUrqTNJuhfr8EOKvCOgGNChGcj LUUvy/2+w71GWDu0hWBDULeJ3CEjb6F9mZ2bdySt2DnhuxfLEg3/vmynFc5JDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724078263; a=rsa-sha256; cv=none; b=lTfSu+eJqVHZzJv4RIPLUL0DuiOpd3UvSaLVCNWAZHC4Czf3mbRlfVKX7hM2CIVSyPbDrk kSUqoJ0SsryehFZ8kuU8pRdDQt7EqUYe0y7jD84sOfgePe9Yj+R4toK+bibrb+ovmweGVy FImnyupJeI6J/JpuE0e6H3DDuWFku1KYWWIg6I7Ck2HfwhwP8IPA1D03Y7QnFNHqU5WSMK bSEd3nCdMhlG+HAtYlX8uX6p+q8StSEcx7Mz3EnY3TpeOaWoGaWKutbz9pw61+GE62oiXy lZcXYRP+YDpv6ouIy4/WX20Z9TOlx+fhMzdleEhlx+/UaEMDzQaAkeP/5BjW2A== 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=1724078263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Q1j114JbbcVQa/dHb57bxs+eHckYuxSOsUIhj3nJJo=; b=c2oodQrBp1HVGSSL7AU07z9fV2WHJBiaELvxI1WE1rDlQcqi+sGVsHN2+Tl6glnH6TWF8O jG9Sv+/q5Ihxd89DHNZ5gUwOfG1ixKEwe+393/9HUxgB6J3CPJqLjmb6RR6VaIgpWaLxUp 3mDI31MTi8PjOG52TXnyslivIeENvy/7GVSf7OxmyiDm2MetDyvwEtqMi0AsbAFjam7mmm m30JNnBn0RLEG3wVsSXpreajqlPOsPSpWOUir5PBSxDnHzIZQN165LWQaDHf4Rohy+YEjY /AjDp6XoRBVRHf7pzYMuGKSpaWGKttCEImHb5/POLfMGdZMXauvuy4attaUPMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnZvC4lWzzKqt; Mon, 19 Aug 2024 14:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JEbhBu094261; Mon, 19 Aug 2024 14:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEbhOG094258; Mon, 19 Aug 2024 14:37:43 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:37:43 GMT Message-Id: <202408191437.47JEbhOG094258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fb901935f257 - main - socket: Split up sosend_generic() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb901935f257ddcc492fe9efb605797f181c6597 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fb901935f257ddcc492fe9efb605797f181c6597 commit fb901935f257ddcc492fe9efb605797f181c6597 Author: Mark Johnston AuthorDate: 2024-08-19 14:20:43 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:37:27 +0000 socket: Split up sosend_generic() Factor out the bits that run with the sock I/O lock held into a separate function. In this implementation, we are doing a bit more work under the I/O lock than before. However, lock contention is only a problem when multiple threads are transmitting on the same socket, which is an unusual case that is not expected to perform well in any case. No functional change intended. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46305 --- sys/kern/uipc_socket.c | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index e7c4a85d5970..a5e88fc7ffc6 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1656,8 +1656,8 @@ out: * counts if EINTR/ERESTART are returned. Data and control buffers are freed * on return. */ -int -sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, +static int +sosend_generic_locked(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { long space; @@ -1673,6 +1673,9 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, tls = NULL; tls_rtype = TLS_RLTYPE_APP; #endif + + SOCK_IO_SEND_ASSERT_LOCKED(so); + if (uio != NULL) resid = uio->uio_resid; else if ((top->m_flags & M_PKTHDR) != 0) @@ -1702,10 +1705,6 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, if (control != NULL) clen = control->m_len; - error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); - if (error) - goto out; - #ifdef KERN_TLS tls_send_flag = 0; tls = ktls_hold(so->so_snd.sb_tls_info); @@ -1728,7 +1727,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, if (resid == 0 && !ktls_permit_empty_frames(tls)) { error = EINVAL; - goto release; + goto out; } } #endif @@ -1739,13 +1738,13 @@ restart: if (so->so_snd.sb_state & SBS_CANTSENDMORE) { SOCKBUF_UNLOCK(&so->so_snd); error = EPIPE; - goto release; + goto out; } if (so->so_error) { error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(&so->so_snd); - goto release; + goto out; } if ((so->so_state & SS_ISCONNECTED) == 0) { /* @@ -1759,7 +1758,7 @@ restart: if (!(resid == 0 && clen != 0)) { SOCKBUF_UNLOCK(&so->so_snd); error = ENOTCONN; - goto release; + goto out; } } else if (addr == NULL) { SOCKBUF_UNLOCK(&so->so_snd); @@ -1767,7 +1766,7 @@ restart: error = ENOTCONN; else error = EDESTADDRREQ; - goto release; + goto out; } } space = sbspace(&so->so_snd); @@ -1777,7 +1776,7 @@ restart: clen > so->so_snd.sb_hiwat) { SOCKBUF_UNLOCK(&so->so_snd); error = EMSGSIZE; - goto release; + goto out; } if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { @@ -1785,12 +1784,12 @@ restart: (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; - goto release; + goto out; } error = sbwait(so, SO_SND); SOCKBUF_UNLOCK(&so->so_snd); if (error) - goto release; + goto out; goto restart; } SOCKBUF_UNLOCK(&so->so_snd); @@ -1835,7 +1834,7 @@ restart: ((flags & MSG_EOR) ? M_EOR : 0)); if (top == NULL) { error = EFAULT; /* only possible error */ - goto release; + goto out; } space -= resid - uio->uio_resid; resid = uio->uio_resid; @@ -1899,12 +1898,10 @@ restart: control = NULL; top = NULL; if (error) - goto release; + goto out; } while (resid && space > 0); } while (resid); -release: - SOCK_IO_SEND_UNLOCK(so); out: #ifdef KERN_TLS if (tls != NULL) @@ -1917,6 +1914,20 @@ out: return (error); } +int +sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, + struct mbuf *top, struct mbuf *control, int flags, struct thread *td) +{ + int error; + + error = SOCK_IO_SEND_LOCK(so, 0); + if (error) + return (error); + error = sosend_generic_locked(so, addr, uio, top, control, flags, td); + SOCK_IO_SEND_UNLOCK(so); + return (error); +} + /* * Send to a socket from a kernel thread. * From nobody Mon Aug 19 14:56:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnbJg64D2z5T9QC; Mon, 19 Aug 2024 14:56: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 4WnbJg5c5jz41GS; Mon, 19 Aug 2024 14:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724079379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7EnH0VH+ml+SX/YIw18EIispSbzJ68WGU/wdNb4D+MI=; b=GTjSsDRpNfyK0YLP/0/X8VJnwW19X+ZVx/5w8sjrj59jIkxt85L2eYUM/kIOIpoob46FIo n3MIyzzQQXTlgui9EfB7y/8K3BWR1n+P0XD2a13nPw9rHxQG3tdHrDi3nvQM4AebkXkyjv UzbjntGC/gKWB2s5DDg1e4/QtmyiUgQlvsslnSuJ5HCWPrP7Map/If0OZskREok6wZ/yer P48BbHs2DJJyJGPJaDGCrcdtWTcWXlJ9IqXa/dvXYZr272OMi5jIu9/ca6zqiZrqNe5Ebi jmizzMRLBSYFjk/D1fjHU5/SvZLU6BILKcoc4P/Lv0p5mOxHwePV4VdhElnLPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724079379; a=rsa-sha256; cv=none; b=VVav2LxHj2oxcPD4oFCWPVfcjXvMQsUwwLkxuT0V843pbrXEbJWsHB6+VCxF3P/uBZ1Yop RrtjyUsyoO0lVrYkDOJa4V2h4IpsL48D0ZNRPxcNTqCmYiRs3Pj2/4Un5ABUkoMHPvw6tV I+gSCKTSb6zJcFp/otRr8p1xzs7FL448lPFD4bHlUViFvOPzVHp9hrKgMnwEkuSQIVnnOQ 3Q9UC5SpnwwUYM1r2tSEaQrGTOTE8WkIuDVQlAWXW9nEgyGdvIzOKltGTPy/aQsu9y1tbX EwTukN3BUyosglMvKUQO+6p/7qFrv9L0D8jDBpieFk+A5BG8O+f+dKtkCb0kqQ== 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=1724079379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7EnH0VH+ml+SX/YIw18EIispSbzJ68WGU/wdNb4D+MI=; b=njf8QDB3WxprufRysCULIUcOiLdTlBQf8LBuAah3vGLwSR3T1WstBd+mPfMr714kEH4LMY rLWKIyVg+hWUeyshsLd48n+jQh/heYOvvbNkE2Dvr3ONl/fvEQCH0sYIVRRUoQg4tILeEY MOq4v7ESWu8WuKfwi7M5sWNfpP3KR6ZCHpxNb0w1tiCKEh/3sOD7o8FpZoFNvgUuh0OZqy hKZ+FBQIolkWyNX5NzVv0jSABS/6vznFNdPNZ0gY1tz6XU2fj9cpvBaa8WUdC7ZWR6Gy3N dKAPTEiedIqmML+4X/svaaANSizi1xncXcSGwx5WnmatTBsVZSreKtZ64hmdMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnbJg5CbXzLT4; Mon, 19 Aug 2024 14:56: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 47JEuJSn027547; Mon, 19 Aug 2024 14:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JEuJXg027544; Mon, 19 Aug 2024 14:56:19 GMT (envelope-from git) Date: Mon, 19 Aug 2024 14:56:19 GMT Message-Id: <202408191456.47JEuJXg027544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6982be38cb7e - main - socket: Microoptimize soreceive_stream_locked() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6982be38cb7e4254ff4ffbb334cd7e234b5f6cc2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6982be38cb7e4254ff4ffbb334cd7e234b5f6cc2 commit 6982be38cb7e4254ff4ffbb334cd7e234b5f6cc2 Author: Mark Johnston AuthorDate: 2024-07-05 18:01:29 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 14:52:39 +0000 socket: Microoptimize soreceive_stream_locked() There is no need to hold the sockbuf lock while checking uio_resid. No functional change intended. MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/kern/uipc_socket.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index a5e88fc7ffc6..13b6253bd115 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2604,14 +2604,12 @@ soreceive_stream_locked(struct socket *so, struct sockbuf *sb, SOCK_IO_RECV_ASSERT_LOCKED(so); - SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ - if (uio->uio_resid == 0) { - error = EINVAL; - goto out; - } + if (uio->uio_resid == 0) + return (EINVAL); oresid = uio->uio_resid; + SOCKBUF_LOCK(sb); /* We will never ever get anything unless we are or were connected. */ if (!(so->so_state & (SS_ISCONNECTED|SS_ISDISCONNECTED))) { error = ENOTCONN; From nobody Mon Aug 19 15:12:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnbhF1BWLz5TBq9 for ; Mon, 19 Aug 2024 15:13:17 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-20.consmr.mail.gq1.yahoo.com (sonic309-20.consmr.mail.gq1.yahoo.com [98.137.65.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnbhD0mWQz433Y for ; Mon, 19 Aug 2024 15:13:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=nYaFdRIF; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1724080393; bh=0kH2oM9oPqdnnikhKA7kPPQStqo2pq3o6VEMte4AzMg=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=nYaFdRIFBqEh3SNCZr2q3HJF9vCTSBnXpXuNKiyMaTmVpxsxZ/if7hvbLUnBpXGLCASp3WSAg1ja6Jfn/uZi6i5/jjAEEJztdvdm6gZR/dvzh+0KxCijf4vCz1QUaOLE56rnXDmoYR9d5rO/ksBZdTJyVDVWqY2BUYZtgl11cDvv7YM6rumzB71bbCgEdcNPe40S754CU7Z4wwrZsxrqGvkEFENknj0COy40HxztdgZuvCfYna4bg9E9bl2/4VWx+vdUb8ND42eRyhxW5z2Cw8/U2E7F2VHoswCTMUaFYAZOljkc9zmJkcSHO7W00baRd1nJWTEQJ89zai/7TLlDxw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1724080393; bh=0zIvfLupEJC9c/q/83hvuROH54Fnte7dgI5fY5x4ZIC=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=Qd5SEHkcZl7UjGX5XvGtviqhuRgRq5+bfODJV9/qwD35GxssS+w4M1aTCLYCpMH2KuSK6sBkWR0KlNH6TcKVocIyPmstBpBMyanEygfgs6AzmhjfHNQ/CsTi70PT7YpLZnZPS6unBYybCl5GTzJ5r4tH+PbRJYAYQihFmI4IMr+pP86YWTCfTuJnhjnEY8Emgd9M7lGGV7KBLHeDAFvTX2Xmpye3aMx6vfL0C+aCCwLyR/+nwpEMJPCMS2HagtCrTPSLvjgD9QfsnhDl+jdbCXLewh0v54524EFYxtmsGJcTFjooI2AdNSsy93v5/i5erWuwdg9gNv9mtildu6+J3A== X-YMail-OSG: 011hOZ4VM1kzfQoYMGWDkuvK2.k7pcOgr5qvKGh41PvOKLW9q0y9NEH613LK0a3 HXjLlVx8CqMAr7KdHf6DpBSFCrUzo1zC4nSPVArRFBMdXR0.YFqQQl24O0TOJdRW.R.k_WJFqPin O5KRpOL5UJYV7U.T.8Dk6g19R5PRWK7GFU0n9n9tythRGTeyfhNydud_KHhTNx_Z8QZCGqhZEJFV Oh_8M8GLM2v_gRwIeDOmsfamhA3R8uJKIxPcKIXxjInlA3N5mlaJ2PwL3gAsQ8h1a7w4GSYbFB0. S3f_j7OLgm8j1zMK4LTbrO4OoZP4XQa.H5Lspiz0GyYBCpUI41XleOB1YeBthJ4gFa7Wb7imi6Eq RH_2flZq3i1jEs1wbJsaGYbI2oQdouaXL_7GF8y6qfLU2U1wLeb1H.cDeJyt5ChWqpgjkdhdfSHo _2AMa9YKc8b5dHeDe1maqn1QXv7Ly0qB.vQ7K7NG21_k0wnM55aBTr9UHmfNFRQAqxvPqPhBeylC ZKT3a88M5ss603aq3pAO8qVF6OCkKEtGUgvYYX4RRQZw1eDWOJhvSVQKpv6OejlvlMmTeFLofwn9 8ba98dChSbffyTIdD5MbLfy9UWqAeqCgrp4TuaAGQXr.g2iSQbWwzGOBgqp_uTuHloWcSyUqTQKG bDX9w7oHjvzXgVxFPrCMloyzmao7RsXJwKLDY9jH5_6HBq6RKybIk0pcX2oyKNLqZWdG6XbvhqzJ qZ.l8jD8GKgLaCZS5SqWw6uoKTJuYF47G15umVmC3T54JJHiSUm38Dxw77BNExWgM4XFB0XwuJuY eTywFrE394FSV3iLR4KfuxeIOP4mrRGcNLZePrfyv9HUY0OZVKoYjJSw9arwi68DeQEVsSy306ya UC1acHbpy_e8poiu6RqTIlo00P09PjuptJ_cqKXSJPGafVCi2J7X8qZ4lCvXH0Y0wXFGayi5VDmY okY3SrRHfGtPveM1wKncTGtFXU_T.IsTFF0_LxLJIiBUiloRJWFJW71.vjLh6Sq8oigz.hyxChji 4w415m9GYk0PtelinUQuYvgT9QYYgEU.UZdeTwFn8.PayTyIFmySwEjvn3rRkC7uMKsf3IZnGtxw CnxTO.RtUQ_ES.p2J7r8g91Vg1qmIhoxqRjgYTwE0T88rKoysG.ISHcve9h9uSGCXzwCAYkOxUT0 wo4wD7_SOi6.3ZoVQ6z.s.01KY73brLRMQ.JcoLrROedv0ugKS1hh.6a.cD_0AD5ROacL3Cf8tVV 1m7q_BPAoljSpGsQfN5Yqriv6awGU2nRwptzy5njbMRLBafjyQ5miuPgx_uRY4GVJwrFNUZnnRcP nzbWeUMU6.q0rHSxO2QRpE7u8DedjDGr5ZHOpmhy0aZ5TEtoAuUfx2kbQBitnJW0mbgp_SjqlX8R GZyW.3xg9PmR1HafdHjr7ZMjLVdz57AWi6HSpm4Ku.2U6GBxvbHREmQeIgCGktFCJG0dlgZoE5jw MUbvDCD_m742pigjoya3EgXlJ_xKRjPa2moSH495zZ7XsKqOcLRvteV_JEKBwMGnabyY7IgAZde. CJts_3DXKrP760rDiKGW2omIXspHomLKu04iBXyD8lmviwmaf3cbnw8F4fzHjp_qx8AqAnQvW3Mo T0nWF72nFOtvQbNQuT9vwVImGhUKsuYOjzsJYlJfO3aTU5oZaSvcg2ZcKwWZwIKjyh063qqSbBdS zy3EEqf4WjQZK65EADYjopABa5T56M78m0ETbKg5g4m8CQmOpqawgDG6eYjUXEVXA_EWgZa0Hkpc VhagDRbbm.2jQaeS48XpsQc8umPNvbfIv4jHnAiLNgCqYag1lgU0XX2njdQ4YrcWQZ6qsjwwt2UP oR3WNzOsDg74eCeg12aNQrFNXfQjfmAhVaLhgrvePQZPyosUezHbIE..ca2hJQOq.Q4FT2e.RH84 bvLqcd_5FI_CCwUM8KZ9WJDft_v2_J0QwCaxX3WHSezrWyrbzfSNkwoUj72KY9AVYJxlR6cvLeK2 WHlT9_YzsPk57SASEL71V8tuzl5JPYjlUoyqFe4hE5GlMdBn1K1g_mVz_hWt4EpIhyZN.ov3rTOr _FrftFQkAdqLGF6H2oWP1g0CUY2mOpyAHPGFCvG6wSQXHi2_nGaox6SlTSRMIwcnrqHLcZCSf3UG tNkAdChVlEMWMxfAYsuEj1Ej5xV03Woj1RzLbesGcB4_EnN3E6wEsBMvW63e1p_YGzPvLOIf20c9 jHa.jFUT0QnwhHnClCL5v_DCwIwB2DjRO36KBj2OiTyZNSEawvaJ4tBCMvx0QII96LpTmc6Tu_sL 5DBZ2bRkSt61aesc4t3zHVX0Eb23yGch5a0on X-Sonic-MF: X-Sonic-ID: 3686078d-e8d4-43f9-87aa-870514beb0af Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Mon, 19 Aug 2024 15:13:13 +0000 Received: by hermes--production-gq1-5d95dc458-7jxgc (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c7bcf039851ec12b3b27b11b40af8eec; Mon, 19 Aug 2024 15:13:09 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: RE: git: d7d5c9efef03 - main - pkgbase: Let source packages be built in parallel Message-Id: <7B9F6ED4-4906-43CC-860F-DB4AA3FD44D9@yahoo.com> Date: Mon, 19 Aug 2024 08:12:57 -0700 To: Mark Johnston , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3776.700.51) References: <7B9F6ED4-4906-43CC-860F-DB4AA3FD44D9.ref@yahoo.com> X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.994]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.146:from]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.146:from] X-Rspamd-Queue-Id: 4WnbhD0mWQz433Y Mark Johnston wrote on Date: Mon, 19 Aug 2024 14:37:37 UTC : > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd7d5c9efef031aa11a841d1836f7c937= dcbe4ec8 >=20 > commit d7d5c9efef031aa11a841d1836f7c937dcbe4ec8 > Author: Mark Johnston > AuthorDate: 2024-08-19 14:08:05 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-19 14:37:27 +0000 >=20 > pkgbase: Let source packages be built in parallel >=20 > To build the packages target, we build src and src-sys packages > containing the source code from which the repo was built. These > packages take significantly longer than the others, presumably because > they contain many more files. Because both source packages are built > to satisfy the same target, they end up being built serially. Split > them into separate subtargets so that they can run in parallel. This > saves a couple of minutes on my build machine. . . . For parallel execution of the 2 targets below, aren't the following "rm -f" commands racy relative to the later *.plist generation activity in each of the ". . ." sections of code ? create-source-src-package: _pkgbootstrap .PHONY rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : . . . . . . > ${SSTAGEDIR}/src.plist . . . create-source-src-sys-package: _pkgbootstrap .PHONY rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : . . . . . . > ${SSTAGEDIR}/src-sys.plist . . . =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Mon Aug 19 15:24:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wnbx26t64z5TChx for ; Mon, 19 Aug 2024 15:24:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wnbx251M2z43hc for ; Mon, 19 Aug 2024 15:24:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7a1e0ff6871so294508385a.2 for ; Mon, 19 Aug 2024 08:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724081062; x=1724685862; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=lZW245F1E9PSmF5CdT/1o7SrUVoY+sDtbtLn1bE+Lcw=; b=cEsA4PxdDB6PNkknfslKPJ993dwjIvKvTAtHEdvyyX5gUlKfPlWII2IjjnN0+IamHY /pUlttofKEV6iPxJoADcyyUM74I1SlkR5EXJesagcJ8fPM7rzzBK+HxBt9aSVldn0y9N x2B1ofCG4mEsCl2chre+EL6Jt4bO72vyYpD0Jw+H9s/ocnkPL5NVOJfyg43lXyuPswGt Apgy0IoMC1BoKapAamnzKK5Epc6le4w2Z/bAm34jq6fVdaeqHtMUJ1bE38Iv9rcOYGcj Saz/8sGEIJMDJvsnrAalqNkVn3cUMetDHjYLb7MivlLX5oAjw4Q7pzEdKDFYs/CmBdSP THig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724081062; x=1724685862; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lZW245F1E9PSmF5CdT/1o7SrUVoY+sDtbtLn1bE+Lcw=; b=ECCLqzNgF/Rk/eS2BGm/sYYp3XX5Mh33rvcvnFcpUD9m06n00NIsGIM9CGeQ9iAu9E bEYYFfPgTMP0qLHGlITFT6k7g9c7Qa3QyAgxDgmVUucmgnMFMs+ItU//cfIP6KSMZSBi WwYh+fH5lH2n6MhIo42t3yX4VIOZ7HL7EeoGVnRJm9YpvCNeyHrcPbhMO8thDOzyH+L/ MLrP+bEZHLVe1qGZ305lFfcQN7CVgFimgti4St5MbKTvM6orYA9FnfhTX2ftpxnJkYiu zP3m5l06N8cj5wIFQKp+m3NoR3lSkEOOc9f762ZeLfKnOYqgcPHDqtkf7TsCeG3K2Ioy pt3Q== X-Gm-Message-State: AOJu0YyiwFrUA+q411A2lU1Mt/k6q/YLAxT30OBwkPxyXIlodXWtFVgk vBKJNbKPZRXFLXlf8LrgWCpNo/MYWXQnXLXdoonPvlGfV20JLSBp8gBgDA== X-Google-Smtp-Source: AGHT+IGAi3aCjFbPdtyJ/mqLDW2laoQ8qPMo7qshWBEHBnqBkH2pmZ7IiH8T6usvNiOnL3z6WfjzvA== X-Received: by 2002:a05:622a:5a8f:b0:44f:e5fd:4643 with SMTP id d75a77b69052e-454b682fad4mr84791601cf.24.1724081061709; Mon, 19 Aug 2024 08:24:21 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4536a072267sm40656901cf.81.2024.08.19.08.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 08:24:21 -0700 (PDT) Date: Mon, 19 Aug 2024 11:24:18 -0400 From: Mark Johnston To: Mark Millard Cc: dev-commits-src-main@freebsd.org Subject: Re: git: d7d5c9efef03 - main - pkgbase: Let source packages be built in parallel Message-ID: References: <7B9F6ED4-4906-43CC-860F-DB4AA3FD44D9.ref@yahoo.com> <7B9F6ED4-4906-43CC-860F-DB4AA3FD44D9@yahoo.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7B9F6ED4-4906-43CC-860F-DB4AA3FD44D9@yahoo.com> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Wnbx251M2z43hc On Mon, Aug 19, 2024 at 08:12:57AM -0700, Mark Millard wrote: > Mark Johnston wrote on > Date: Mon, 19 Aug 2024 14:37:37 UTC : > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=d7d5c9efef031aa11a841d1836f7c937dcbe4ec8 > > > > commit d7d5c9efef031aa11a841d1836f7c937dcbe4ec8 > > Author: Mark Johnston > > AuthorDate: 2024-08-19 14:08:05 +0000 > > Commit: Mark Johnston > > CommitDate: 2024-08-19 14:37:27 +0000 > > > > pkgbase: Let source packages be built in parallel > > > > To build the packages target, we build src and src-sys packages > > containing the source code from which the repo was built. These > > packages take significantly longer than the others, presumably because > > they contain many more files. Because both source packages are built > > to satisfy the same target, they end up being built serially. Split > > them into separate subtargets so that they can run in parallel. This > > saves a couple of minutes on my build machine. > . . . > > For parallel execution of the 2 targets below, aren't > the following "rm -f" commands racy relative to the > later *.plist generation activity in each of the > ". . ." sections of code ? Yes, thank you. I believe this patch is sufficient: https://reviews.freebsd.org/D46320 > create-source-src-package: _pkgbootstrap .PHONY > rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : > . . . > . . . > ${SSTAGEDIR}/src.plist > . . . > > create-source-src-sys-package: _pkgbootstrap .PHONY > rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : > . . . > . . . > ${SSTAGEDIR}/src-sys.plist > . . . > > === > Mark Millard > marklmi at yahoo.com > From nobody Mon Aug 19 15:59:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wncjc68kfz5TGcJ; Mon, 19 Aug 2024 15:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wncjc5W2kz47CV; Mon, 19 Aug 2024 15:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724083172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U2xmjNopwj+V6UyMwY71zSJF4D7mx7jcINOcM4rk/IE=; b=gGxaiWBVT+yLggvlM1BeId026KE+Fid0Uqiii9byRA3x6gRtqHWiD4RZEXWg0HO1kCSM6J Y2uKcIeNe480ScDne+5gc002OTj5YqmNu9PBNr9J6u5fSUZ06e+QcJh18KjWJwbbcS4L6y epIZBy0cSTmln10m2MLGDwKV1ekdf5zvt2Yqvl6gO2k6v2gXYKf0Dejf4JJs9EnjQ0QdTf Gwgeabity8ReKMFtuHxRP0Wg8mJl79vHFyOHa0/n5GjyyYKzcO3QMblXLho+ba0bAQIHTC IPDEaNvlM1paM7rkL1flFFKpWkJEAdiQKA7ovrGhtrdeerYC4zorkIKvi2ZKtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724083172; a=rsa-sha256; cv=none; b=Ula/Ao4sFrQiHns5hIF49oRW7f0f4IjgQb0QYaoGYCqa5dew+pSdzN4erEBSWmhd3aIvPH GcMOlWU5Zr3ssw4WSfug6Ir+icDYhFRzzIZedJmQQuQPMG674yoTwi2FZiLkUy0x69dnyz KcFKx/1XT869VYQzXkTovM5xrvwSnddI7PvHp/UKe0S5/1hdgmDMWlL4c99NqUuqfgEVFr 3v4qXEVl78pVpQ9jx2NjE1m9tQnofOjclcKE/sZlR8rVb1dvRV58KT8UYaZ0HbhxTWK2u3 y7WZuJ1Ff9JwaSlJCsatSkpNjmXZ14TkQcfiNkDH0VtuMmr2TB3tzQMRlPwbKg== 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=1724083172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U2xmjNopwj+V6UyMwY71zSJF4D7mx7jcINOcM4rk/IE=; b=RvkcEmRUa8meo4MffyP16DqcFuhDdXIK311wJm6cWnHeMc5Vli0yyRBV2EhoebQups98tT BHvKB4nOh17qzAujPTVUUi3uv/hpzmiG1WJbOkJ7fBbaPYf3LpRsYR5+HH9Ii9UNcXn88Q m3b8qaEJDhmDkp3hX0Ebr5q57bDvjw00BzQloImtQTbgW4H+M6QwJH7Qf1wbt2Kb/YHK7D xob65eISl9Covk8aBwvOqNeO9tJeYj48UQ0ho9msw3qNe2VZcV/kOBptglINxM+/x8tbRT IO1fm5zs6lFeEEAbWaBP/LKTzAfD7v+BcJN4UUCL5sp3/O7ThHWCBHBLdHdcgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wncjc42ddzN5T; Mon, 19 Aug 2024 15:59: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 47JFxWHm030605; Mon, 19 Aug 2024 15:59:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JFxW2Y030602; Mon, 19 Aug 2024 15:59:32 GMT (envelope-from git) Date: Mon, 19 Aug 2024 15:59:32 GMT Message-Id: <202408191559.47JFxW2Y030602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d02dcf21eea3 - main - pkgbase: Make src package creation recipes more precise List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d02dcf21eea3973a714294b011537c2af6c747fa Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d02dcf21eea3973a714294b011537c2af6c747fa commit d02dcf21eea3973a714294b011537c2af6c747fa Author: Mark Johnston AuthorDate: 2024-08-19 15:22:03 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 15:48:12 +0000 pkgbase: Make src package creation recipes more precise Just remove the plist created by the respective rule. Otherwise the two receipes can race with each other. Fixes: d7d5c9efef03 ("pkgbase: Let source packages be built in parallel") Reviewed by: bapt, emaste Reported by: Mark Millard Differential Revision: https://reviews.freebsd.org/D46320 --- Makefile.inc1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 4df7f1900cf4..5400cb5e734a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2120,7 +2120,7 @@ create-packages-source: _pkgbootstrap _repodir .PHONY create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source create-source-src-package: _pkgbootstrap .PHONY - rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : + rm -f ${SSTAGEDIR}/src.plist 2>/dev/null || : .if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) @cd ${SRCDIR}; \ ( echo "@override_prefix /usr/src" ; \ @@ -2147,7 +2147,7 @@ create-source-src-package: _pkgbootstrap .PHONY .endif create-source-src-sys-package: _pkgbootstrap .PHONY - rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || : + rm -f ${SSTAGEDIR}/src-sys.plist 2>/dev/null || : .if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) @cd ${SRCDIR}; \ ( echo "@override_prefix /usr/src" ; \ From nobody Mon Aug 19 16:02:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WncnK44wXz5TH07; Mon, 19 Aug 2024 16:02: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 4WncnK3ZdLz47s7; Mon, 19 Aug 2024 16:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724083365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z6Gbq1IzQnVyPwRoWAMGl+ASryR4zWnOn6tJ8nQ6IT4=; b=aOXoqglrekF8rQp9EuvmzxGxlX+OWh892Kp8E3MXKDTK3mKUuNoPGWKwvOFTHxijtyTksa 4WjQYaaO8kymRkJZJniL4fd2qwLL9Yleo5/2RLBbjiz+fEdI2Nkwg+C4L7ox6Nudo8R6kj rr7WH9KijBrLrBUg/17T3U3z9Jg72AvG/Ag+j7avN/7WbqskLdJP2l4owoyHY9w9e9u/ON CA0gnv4mjp2jxgSFIiX+7JfrSVS9pu5cyAyFNzQaZegOYiwz4OfjCvheeF6CUpGLn73xy4 S97cHdd4gYsAvq0rZByw4gWkSD76APDchWVAfZGHn9NFaHMQECcCcmNd2cTIFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724083365; a=rsa-sha256; cv=none; b=P+zUGEXruS5YoWgVGRRJ5IOygqIsenI8nSkU6qKEa+bmm36O2Jt0H9EKwwgtu5n1dKLz9W FE5o0ezrJmvyV9PKYi3XP1uE8YKQ+tEnFp2QYBwMUWeR7waro3n/om67IxTma5+Gxo7A0F SLJqgcIp63+hlErAxiRG/mnQArYOkfdIr3OzgH4cDt/cUZtMOQEjOJnUIXBr49eihbKCV8 4riniIBEAN+kvOAVCq9C5W+zvgC9qlI7u1A4s5v9AeiO8LOZbzNcHKrVaQciBHoq/i3/NB kSjHaCS2kpBT9SrePb6S11c7gndUr0HuZDi2UgHj1EaCrkDGZsFIoABfUKBjBw== 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=1724083365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z6Gbq1IzQnVyPwRoWAMGl+ASryR4zWnOn6tJ8nQ6IT4=; b=yb49axs2rI7dkfnvbrVsuQ921HWn2jm0HjNxOHL3Kt8UlZOyXf65vs2Nz2Uys6mItcND/Z YJSE8cIuseyy5VufcSgCH5GB6t+TIMdAx81ZbBnCqdZXQcI9XLlPFdJgu5/lcIyxJc1Gd2 2zXB7Rv8DXyucCrz6O0UY7nYLbaHg0iVbkcaf3ATYyA6XtqAPiL9/qvpnJdBoKP3ikj6C2 YyF/LBLT30x0VoqKo1Y7XM3XtG+/WN1D+5VXhbs+JR2+Zvyki5mqdXf8kKghiFZbZeX7oe 5Pi5TCQu3YKG+iuOSPknQYjgJyKQj7TJJ4/1DNHepNuiku4X/8gJYt3YYpxFKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WncnK39yVzNbx; Mon, 19 Aug 2024 16:02: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 47JG2j4c047583; Mon, 19 Aug 2024 16:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JG2jgF047580; Mon, 19 Aug 2024 16:02:45 GMT (envelope-from git) Date: Mon, 19 Aug 2024 16:02:45 GMT Message-Id: <202408191602.47JG2jgF047580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6a88e22728d2 - main - pfctl: pfik_ifp is always NULL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a88e22728d285c4df17216515ce2b8d1e5a6835 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a88e22728d285c4df17216515ce2b8d1e5a6835 commit 6a88e22728d285c4df17216515ce2b8d1e5a6835 Author: Kristof Provost AuthorDate: 2024-08-16 12:55:31 +0000 Commit: Kristof Provost CommitDate: 2024-08-19 16:02:15 +0000 pfctl: pfik_ifp is always NULL The pfik_ifp field is not provided by the kernel, it is always NULL. Do not check for it. This caused us to not clear the skip flag on interfaces, leading to unexpected behaviour when a 'set skip' was removed. PR: 280834 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46311 --- sbin/pfctl/pfctl.c | 7 +---- tests/sys/netpfil/pf/set_skip.sh | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index b60e64fba338..45bfdf31f8dc 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -394,8 +394,6 @@ pfctl_check_skip_ifaces(char *ifname) continue; for (n = h; n != NULL; n = n->next) { - if (p->pfik_ifp == NULL) - continue; if (strncmp(p->pfik_name, ifname, IFNAMSIZ)) continue; @@ -422,9 +420,6 @@ pfctl_adjust_skip_ifaces(struct pfctl *pf) for (n = h; n != NULL; n = n->next) PFRB_FOREACH(pp, &skip_b) { - if (pp->pfik_ifp == NULL) - continue; - if (strncmp(pp->pfik_name, n->ifname, IFNAMSIZ)) continue; @@ -437,7 +432,7 @@ pfctl_adjust_skip_ifaces(struct pfctl *pf) } PFRB_FOREACH(p, &skip_b) { - if (p->pfik_ifp == NULL || ! (p->pfik_flags & PFI_IFLAG_SKIP)) + if (! (p->pfik_flags & PFI_IFLAG_SKIP)) continue; pfctl_set_interface_flags(pf, p->pfik_name, PFI_IFLAG_SKIP, 0); diff --git a/tests/sys/netpfil/pf/set_skip.sh b/tests/sys/netpfil/pf/set_skip.sh index e5b1440360e9..e984377721b8 100644 --- a/tests/sys/netpfil/pf/set_skip.sh +++ b/tests/sys/netpfil/pf/set_skip.sh @@ -26,6 +26,50 @@ . $(atf_get_srcdir)/utils.subr +atf_test_case "unset" "cleanup" +unset_head() +{ + atf_set descr 'Unset set skip test' + atf_set require.user root +} + +unset_body() +{ + pft_init + + vnet_mkjail alcatraz + jexec alcatraz ifconfig lo0 127.0.0.1/8 up + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set skip on lo0" \ + "block in proto icmp" + + echo "set skip" + jexec alcatraz pfctl -v -sI + + jexec alcatraz ifconfig + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + + # Unset the skip on the group + pft_set_rules noflush alcatraz \ + "block in proto icmp" + + echo "No setskip" + jexec alcatraz pfctl -v -sI + + # Do flush states + jexec alcatraz pfctl -Fs + + # And now our ping is blocked + atf_check -s exit:2 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + + jexec alcatraz pfctl -v -sI +} + +unset_cleanup() +{ + pft_cleanup +} + atf_test_case "set_skip_group" "cleanup" set_skip_group_head() { @@ -45,8 +89,24 @@ set_skip_group_body() pft_set_rules alcatraz "set skip on foo" \ "block in proto icmp" + echo "set skip" + jexec alcatraz pfctl -v -sI + jexec alcatraz ifconfig atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + + # Unset the skip on the group + pft_set_rules noflush alcatraz \ + "block in proto icmp" + + # Do flush states + jexec alcatraz pfctl -Fs + + # And now our ping is blocked + atf_check -s exit:2 -o ignore jexec alcatraz ping -c 1 127.0.0.1 + + echo "No setskip" + jexec alcatraz pfctl -v -sI } set_skip_group_cleanup() @@ -163,6 +223,7 @@ pr255852_cleanup() atf_init_test_cases() { + atf_add_test_case "unset" atf_add_test_case "set_skip_group" atf_add_test_case "set_skip_group_lo" atf_add_test_case "set_skip_dynamic" From nobody Mon Aug 19 16:02:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WncnL55gGz5TH5L; Mon, 19 Aug 2024 16:02: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 4WncnL4f7pz47xK; Mon, 19 Aug 2024 16:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724083366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RCGWO6FFjAstJ6eaAlIi0GfZkp0YYyHuVgUVRqjsc0U=; b=qMH4GSiKLoAa8WdQcUgLq1XL2r+AujhMde+NzVA7dkM/fYkKT1BM9rIB12qwFcR0sOR6N5 SmuEfGGvYa4MOxdlpY22wKM0P3tL+AqOjbIrEbYxDKFPslESVW3JeWWGPAthUu+E0G2tHj 42Wetg3+MK3XK249w/wzwbFRVAVatWcD1CgUwhlriJR9eU9a8HUST514Hc4mm73JrDLOz3 vvrlJ7Q7gmmAKaZx9cZCGcAdYb5qooAnwnpwQv+98nQColE0mE9mxQRUxXX+bV5JSFgEb7 eE5Fpq6PHOImnhzBF7MYjKf3Hov+BeM2UPSXGav6TOACiQsxfG3MOFA4VM00xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724083366; a=rsa-sha256; cv=none; b=E6Nn5u+HhcEhYfjGsxMcFnc8VYLZkNGSZaB3v4vB3pAjy2LGKHT4wkE6P+ISgS34l7FJXH XSzBtaV1mZ9oT9YCsBItcIEPIKi0m5ltqh61RbxY3rMha3WPmfTPpts8bzcWlDq09Gn/Q+ MZGPVq34i7yLGnoPFB1k2OXY+5beQJggQW0EJSCrP2PCUVxE0qChUxz1Wy2SRqYdql43qe 2HW4pNbR02fgRKO+w3ek9v8yT25Xfq39+R4QHJV+pkEDmMMCE8FMzmNaGsBhUzXMN+UW+O 8etOg+DDyut0Kg+twDcJ4HthJ0FTSzEacFUkNLxUyfd17NyD5WWUwxTj4Fw2sg== 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=1724083366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RCGWO6FFjAstJ6eaAlIi0GfZkp0YYyHuVgUVRqjsc0U=; b=UWnjYjPm3+C3+HVSRPoKsMskgZsE1r5cFPAQ98KRXq6/s7AgSqHdQ8+86hzwz1ZbwsYI6u iNbBulcJJsi8TmZqjkBImyySmo+eaXEnfHuhidU+di6klnMyRyLKFE0n5nBP7dqj4uTzeZ ujUDEk8j9UzCJqJLiZ3hsXRgC+67BF2fKpEYg+DqWw7urDJoTBkqGzblnYjCKW4O3NpW5T JSsbLyPzeNs3YhV95JfiAUXklMrHqgannveBBtoRSNmhT9vdqSEfTGv3jKi2ZrDubGQhn+ bruikIjr62oX2UAW9fbp4/8tm3kRSzqsN9JggvMWwi0Ow/cYkK3IWA5sp3fRDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WncnL4GYszNZF; Mon, 19 Aug 2024 16:02: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 47JG2kFb047638; Mon, 19 Aug 2024 16:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JG2kBd047635; Mon, 19 Aug 2024 16:02:46 GMT (envelope-from git) Date: Mon, 19 Aug 2024 16:02:46 GMT Message-Id: <202408191602.47JG2kBd047635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 22a632c366a9 - main - pf: Make pf_test6 handle m_len < sizeof(struct ip6_hdr) case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22a632c366a98692d7114135241c10f154e52a76 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=22a632c366a98692d7114135241c10f154e52a76 commit 22a632c366a98692d7114135241c10f154e52a76 Author: Igor Ostapenko AuthorDate: 2024-08-16 14:49:06 +0000 Commit: Kristof Provost CommitDate: 2024-08-19 16:02:20 +0000 pf: Make pf_test6 handle m_len < sizeof(struct ip6_hdr) case Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46312 --- sys/netpfil/pf/pf.c | 8 ++++++ tests/sys/netpfil/pf/mbuf.sh | 61 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2bbd231b3ee9..9b1601ac0ee5 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8946,6 +8946,14 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb pd.af = AF_INET6; pd.act.rtableid = -1; + if (__predict_false(m->m_len < sizeof(struct ip6_hdr)) && + (m = *m0 = m_pullup(*m0, sizeof(struct ip6_hdr))) == NULL) { + DPFPRINTF(PF_DEBUG_URGENT, + ("pf_test6: m_len < sizeof(struct ip6_hdr)" + ", pullup failed\n")); + PF_RULES_RUNLOCK(); + return (PF_DROP); + } h = mtod(m, struct ip6_hdr *); off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); diff --git a/tests/sys/netpfil/pf/mbuf.sh b/tests/sys/netpfil/pf/mbuf.sh index 082de08b0838..2dffa48ed2f5 100644 --- a/tests/sys/netpfil/pf/mbuf.sh +++ b/tests/sys/netpfil/pf/mbuf.sh @@ -91,7 +91,68 @@ inet_in_mbuf_len_cleanup() pft_cleanup } +atf_test_case "inet6_in_mbuf_len" "cleanup" +inet6_in_mbuf_len_head() +{ + atf_set descr 'Test that pf can handle inbound with the first mbuf with m_len < sizeof(struct ip6_hdr)' + atf_set require.user root +} +inet6_in_mbuf_len_body() +{ + pft_init + dummymbuf_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::1/64 up no_dad + + # Set up a simple jail with one interface + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::2/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore ping -c1 2001:db8::2 + + # Should be denied + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "pass quick inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" + atf_check -s not-exit:0 -o ignore ping -c1 -t1 2001:db8::2 + + # Should be allowed by from/to addresses + pft_set_rules alcatraz \ + "block" \ + "pass quick inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in inet6 from 2001:db8::1 to 2001:db8::2" + atf_check -s exit:0 -o ignore ping -c1 2001:db8::2 + + # Should still work for m_len=0 + jexec alcatraz pfilctl link -i dummymbuf:inet6 inet6 + jexec alcatraz sysctl net.dummymbuf.rules="inet6 in ${epair}b pull-head 0;" + atf_check_equal "0" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + atf_check -s exit:0 -o ignore ping -c1 2001:db8::2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=1 + jexec alcatraz sysctl net.dummymbuf.rules="inet6 in ${epair}b pull-head 1;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 2001:db8::2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=39 + # provided IPv6 basic header is 40 bytes long, it should impact the dst addr + jexec alcatraz sysctl net.dummymbuf.rules="inet6 in ${epair}b pull-head 39;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 2001:db8::2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" +} +inet6_in_mbuf_len_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "inet_in_mbuf_len" + atf_add_test_case "inet6_in_mbuf_len" } From nobody Mon Aug 19 16:03:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wncp31cykz5TGqm; Mon, 19 Aug 2024 16:03: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 4Wncp26CR1z49Lp; Mon, 19 Aug 2024 16:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724083402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VWybNsLNxxOXDXyp4IV6ydDi7+0IsuyphQwrErpQ2D0=; b=LxNJGcnKUiT70dyJC/KMQNwMnsX8FiqHgv3ijwUzqYEQ0sMs5dDkKxJkw4Lr/CrPx3RiGu 50TuIYt5id325kaqvquwTtXgHvQLu0EbqaV+tDJGmxackQ0nWtL3tO7jfQTEiRXU/k2d+p FsmC9Z82nREnKnIRyv18dfwIXCaW1gYdBx562yincADmglu3Ik3tsdQzZx1gd5jg3+npid 8QXw5sjaPmPe/Y2MiJH8AEv6A7gKrJSuqaMYUqhLWPaFgvS4GioO2r/dzYBwUrpbCtseRd 5tJaXaqhTLZTTklN+ZeVNX4wPcwu/2OYC3L2/nmuzCCYoSVtn7LefQk5RzQl+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724083402; a=rsa-sha256; cv=none; b=xl0PYiJIgU3Z/1PvBLXkIPcT2DfHwndTq+tOoKEJ2FzfAN5OF5nT3zIicq9E4fktMaLb5N zEwhRRaJB1pEBwBKfTqwC7DTb+OEUwEGcW5eisysVOkTRXmghnF2B8pl5TDoq2zcQddIzO UOOBfHS6kRf0qybGTFyywujqxzxWmVG2xCn+IEWak0HGzUczlEVewB4TD6Xr7dqaOO7JtY muchOYFrqQQv4XZEugbYehOrg0Ta2UIvZVm+DriEk6vCwYM3NO8H7NCEOOw+ylbSbgyQPb 2JSgXUI24T03sUuXWEXIH/npVSt28dfFbYWaTJ58egrfKSsWg1HgQiMWRGyWSQ== 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=1724083402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VWybNsLNxxOXDXyp4IV6ydDi7+0IsuyphQwrErpQ2D0=; b=ZqbRFRB1d74PlXBin9opiWRR5NitlePgHn3Af1Zh3kR+rYAsc20CWFjpxdS3148HZbMlQD ETJFkl1EFEk9bwbHwUgP8RAVBiCUw3yg/mN/OiESzgVPxwcPsXgkBWcDqvLmErIjO9JJdM CJbluGs2XENTi8mPrNEIkzZD8so97hFV3wktEPCXeqm/bI/806hODp/nWG+bVyIN7yUpbd CQhTjA/DFqCZioDHoBXDKuqUdtBiyq/j78Y1KEANy790rsgnxb8il/8VuUpL/KRiktNi2y Clvex7PC8/hRa85pBP7IbVv08T0rWSGwg3w5fQ7n0iLzV/20EfW4rXBes+2vgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wncp25XP6zNXB; Mon, 19 Aug 2024 16:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JG3MxD047889; Mon, 19 Aug 2024 16:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JG3MVt047886; Mon, 19 Aug 2024 16:03:22 GMT (envelope-from git) Date: Mon, 19 Aug 2024 16:03:22 GMT Message-Id: <202408191603.47JG3MVt047886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d06fe346eccf - main - libgeom: Avoid fixed remappings of the devstat device List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d06fe346eccf0919a29d43599548e49c0d6a7a17 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d06fe346eccf0919a29d43599548e49c0d6a7a17 commit d06fe346eccf0919a29d43599548e49c0d6a7a17 Author: Mark Johnston AuthorDate: 2024-08-19 16:02:26 +0000 Commit: Mark Johnston CommitDate: 2024-08-19 16:02:59 +0000 libgeom: Avoid fixed remappings of the devstat device libgeom maintains a quasi-private mapping of /dev/devstat, which might grow over time if new devices appear. When the mapping needs to be expanded, the old mapping is passed as a hint, but this appears to be unnecessary. Simplify and improve things a bit: - stop passing a hint when remapping, - don't creat a mapping in geom_stats_open(), as geom_stats_resync() will create it for us, - check for errors from munmap(). Reviewed by: imp, asomers Tested by: asomers MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46294 --- lib/libgeom/geom_stats.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c index 7ae5c947b7b1..510636eb9a8b 100644 --- a/lib/libgeom/geom_stats.c +++ b/lib/libgeom/geom_stats.c @@ -54,9 +54,12 @@ geom_stats_close(void) { if (statsfd == -1) return; - munmap(statp, npages * pagesize); - statp = NULL; - close (statsfd); + if (statp != NULL) { + if (munmap(statp, npages * pagesize) != 0) + err(1, "munmap"); + statp = NULL; + } + close(statsfd); statsfd = -1; } @@ -73,22 +76,18 @@ geom_stats_resync(void) if (error) err(1, "DIOCGMEDIASIZE(" _PATH_DEV DEVSTAT_DEVICE_NAME ")"); - munmap(statp, npages * pagesize); - p = mmap(statp, mediasize, PROT_READ, MAP_SHARED, statsfd, 0); + if (statp != NULL && munmap(statp, npages * pagesize) != 0) + err(1, "munmap"); + p = mmap(NULL, mediasize, PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) - err(1, "mmap(/dev/devstat):"); - else { - statp = p; - npages = mediasize / pagesize; - } + err(1, "mmap(/dev/devstat)"); + statp = p; + npages = mediasize / pagesize; } int geom_stats_open(void) { - int error; - void *p; - if (statsfd != -1) return (EBUSY); statsfd = open(_PATH_DEV DEVSTAT_DEVICE_NAME, O_RDONLY); @@ -96,15 +95,6 @@ geom_stats_open(void) return (errno); pagesize = getpagesize(); spp = pagesize / sizeof(struct devstat); - p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0); - if (p == MAP_FAILED) { - error = errno; - close(statsfd); - statsfd = -1; - errno = error; - return (error); - } - statp = p; npages = 1; geom_stats_resync(); return (0); From nobody Mon Aug 19 16:14:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wnd2R5YX3z5THQ3; Mon, 19 Aug 2024 16:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wnd2R5JBxz4Cl8; Mon, 19 Aug 2024 16:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724084047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VH7J62eiV1s1hRJrjYXRcRQL3gar90dplz5ZoT51HY0=; b=k0zcjSNyzXVHdFM0mJipcIQM3FXPRFkSmaRjzkSGoYsINeaZC2u5BS6M2u+x3U9aCRmALW QwvCLdTvf0HkzW5GszjbNSDoKJQ0BIdOn9a/eH9Gb23oKgDpTETUlm2cuHpUMU0NKgjM0R QRIgooVEX2tO5fX3vAeaEp0SD/ZqEsjSOVasFaeD++KIoDkZW4s+O/7iYpAHR2P+PJ98Pd 85TFGgcwetJe1UNka8sOgm6ClF7uj5Is4SJthftqVmnvXUJYVgzvG+fOcuKybDao2VcDI1 OIKaO/6I3QkKMm8TErPscdzxRag8HQn+hkgoTv1xUwVUcsR25N4YFoZPX12HlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724084047; a=rsa-sha256; cv=none; b=cQexvP7iblvJHo4sCq3TN2eqXdS23Lrplr4iKmxVKZgYF780SVBRHPhYdzl/LFZjw/M185 JVfmTxmbIUtmlDJFg4BQ0DU2LHWRI8NUEplUi4ydVC06r/W/YdGvrROM3qL632lR+2f029 zRTypyj1mW9/SO+SzQa7HRxKWiiDL9Hqh9hkf9BUAirUzOIgWRmvfTiApSH2BYI1KyGbmj tblf6Umg0DUghoWu4RwqHaB6HpOY41vLy3oJhJYaA0yHrFdYBNOF4k0E/Xny44/ubG9a04 jqoYX9Y0jUJv6egC9PmAaFhuuiID7/j+ZtoZ5fgTkDJXrW2YUDHuKHL4zsLxKA== 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=1724084047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VH7J62eiV1s1hRJrjYXRcRQL3gar90dplz5ZoT51HY0=; b=KMzJZ4hWtcnwpQwv21d0QCTQoNpscg/whsa66GJ3AXKzZYna3YyeRRRm50HGPBf2aOKPe9 /AM7WEAqoHD4LIxcgCEKb7jwygP/zw7KZmtB5U/lQ23fdyyLigO5qVkkk5cblbBN/4Ju3h 2NG+LZu3qgqnLQzajBjU1O0V8j5dc3KMBwIoVfPoMeoKRZ13IhV3VaMxv4/PuA6riJB/YV WmxYqLQgorN4xUm1IWGAAhxt+7oXFrIKvRCKFytBkVKPKtt8mLT+kPnAYJ5preM4OS6vFQ BgE5zrTujNkl0ZxdiAsLekViK21Zd+xzdMhCLMT+ZPQBnuXmcq4CEs6/kE3EjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wnd2R4sYzzP0p; Mon, 19 Aug 2024 16:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JGE75V065513; Mon, 19 Aug 2024 16:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JGE7ZI065510; Mon, 19 Aug 2024 16:14:07 GMT (envelope-from git) Date: Mon, 19 Aug 2024 16:14:07 GMT Message-Id: <202408191614.47JGE7ZI065510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b9d1249b5b68 - main - pci_vendors: update to 2024.06.23 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9d1249b5b686dad0346e7d211693456c64049ec Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b9d1249b5b686dad0346e7d211693456c64049ec commit b9d1249b5b686dad0346e7d211693456c64049ec Author: Baptiste Daroussin AuthorDate: 2024-08-19 16:10:55 +0000 Commit: Baptiste Daroussin CommitDate: 2024-08-19 16:10:55 +0000 pci_vendors: update to 2024.06.23 --- share/misc/pci_vendors | 238 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 215 insertions(+), 23 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index df152a4e97e0..f168678909c8 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2024.05.14 -# Date: 2024-05-14 03:15:02 +# Version: 2024.06.23 +# Date: 2024-06-23 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -104,6 +104,17 @@ 025e d81d NVMe DC SSD E1.L 9.5mm [D5-P5336] 0b70 NVMe DC SSD [Yorktown controller] 2b59 NVMe DC SSD [Atomos Prime] + 025e 0008 NVMe DC SSD U.2-SFF 15mm [D7-PS1010] + 025e 0019 NVMe DC SSD E3.S-1T 7.5mm [D7-PS1010] + 025e 0108 NVMe DC SSD U.2-SFF 15mm [D7-PS1030] + 025e 0119 NVMe DC SSD E3.S-1T 7.5mm [D7-PS1030] + 108e 48a0 NVMe DC SSD U.2-SFF 15mm 3.84TB [D7-PS1010 Custom] + 108e 48a1 NVMe DC SSD U.2-SFF 15mm 7.68TB [D7-PS1010 Custom] + 108e 48a2 NVMe DC SSD U.2-SFF 15mm 15.36TB [D7-PS1010 Custom] + 108e 48a3 NVMe DC SSD Add-In-Card [D7-PS1030 Custom] + 108e 48a4 NVMe DC SSD E3.S-1T 7.5mm 3.84TB [D7-PS1010 Custom] + 108e 48a5 NVMe DC SSD E3.S-1T 7.5mm 7.68TB [D7-PS1010 Custom] + 108e 48a6 NVMe DC SSD E3.S-1T 7.5mm 15.36TB [D7-PS1010 Custom] f1ab P41 Plus NVMe SSD (DRAM-less) [Echo Harbor] f1ac P44 Pro NVMe SSD [Hollywood Beach] 0270 Hauppauge computer works Inc. (Wrong ID) @@ -616,6 +627,7 @@ 1bd4 000e 6G SAS2008IR 1bd4 000f 6G SAS2008IT SA5248 1bd4 0010 6G SAS2008IR SA5248 + 4c52 96c8 LRSA96C8 8-Port SATA3(6Gb/s)Exchange Adapter (with Raid) 8086 350f RMS2LL040 RAID Controller 8086 3700 SSD 910 Series 0073 MegaRAID SAS 2008 [Falcon] @@ -1082,6 +1094,12 @@ 10e4 MegaRAID 12GSAS/PCIe Unsupported SAS38xx 10e5 MegaRAID 12GSAS/PCIe SAS38xx 10e6 MegaRAID 12GSAS/PCIe Secure SAS38xx + 1000 04d9 3808N iMR ROMB + 1000 04da 3808N iMR ROMB + 1000 04db 3808N iMR ROMB + 1000 04dc 3808N iMR ROMB + 1000 04dd 3808N iMR ROMB + 1000 40d8 MegaRAID 9524-8i 1000 40e0 MegaRAID 9540-2M2 1028 2172 PERC H355 Adapter 1028 2173 PERC H355 Front @@ -1127,6 +1145,7 @@ 1000 a064 PEX88064 64 lane/port PCIe Gen 4 Switch 1000 a080 PEX88080 80 lane/port PCIe Gen 4 Switch 1000 a096 PEX88096 98 lane/port PCIe Gen 4.0 Switch + 4c52 9f48 LRNV9F48 4-port Built-in 8654 NVMe Switching Adapter c012 PEX880xx PCIe Gen 4 Switch # Virtual endpoint used in Broadcom synthetic PCIe switches for resource reservation 1000 100b PEX88000 PCIe Gen 4 Virtual Upstream/Downstream Port @@ -1249,7 +1268,7 @@ 103c 8b17 ProBook 445 G9/455 G9 [Ryzen 7 Integrated Radeon GPU] 15ff Fenghuang [Zhongshan Subor Z+] 1607 Arden - 1636 Renoir [Radeon RX Vega 6 (Ryzen 4000/5000 Mobile Series)] + 1636 Renoir [Radeon Vega Series / Radeon Vega Mobile Series] 1637 Renoir Radeon High Definition Audio Controller 1638 Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] 1043 16c2 Radeon Vega 8 @@ -3987,6 +4006,8 @@ 1458 2408 Radeon RX 6750 XT GAMING OC 12G 1462 3980 Radeon RX 6700 XT Mech 2X 12G [MSI] 148c 2409 Red Devil RX 6700 XT +# Dual fan version + 1849 5210 Radeon RX 6700 XT Challenger D 1849 5219 Radeon RX 6700 XT Challenger D 1849 5222 RX 6700 XT Challenger D OC # Gaming 1440/QHD Overclock edition with 12 Gb GDDR6 and PCIe 4.0 of Radeon RX 6700 XT by Sapphire PULSE manufactured on autumn 2022 / C1 reviseion @@ -4022,13 +4043,17 @@ 7448 Navi 31 [Radeon Pro W7900] 744c Navi 31 [Radeon RX 7900 XT/7900 XTX/7900M] 1002 0e3b RX 7900 GRE [XFX] + 1043 0506 TUF Gaming Radeon RX 7900 XTX OC + 1849 5304 Radeon RX 7900 XTX 1da2 471e PULSE RX 7900 XTX + 1da2 475e PULSE RX 7900 GRE 1da2 e471 NITRO+ RX 7900 XTX Vapor-X 1eae 7901 RX-79XMERCB9 [SPEEDSTER MERC 310 RX 7900 XTX] 745e Navi 31 [Radeon Pro W7800] + 7460 7460 Navi32 GL-XL [AMD Radeon PRO V710] 7470 Navi 32 [Radeon PRO W7700] 747e Navi 32 [Radeon RX 7700 XT / 7800 XT] - 7480 Navi 33 [Radeon RX 7700S/7600/7600S/7600M XT/PRO W7600] + 7480 Navi 33 [Radeon RX 7600/7600 XT/7600M XT/7600S/7700S / PRO W7600] 1849 5313 RX 7600 Challenger OC 7483 Navi 33 [Radeon RX 7600M/7600M XT] 7489 Navi 33 [Radeon Pro W7500] @@ -5460,10 +5485,12 @@ 1849 43c8 Fatal1ty X370 Professional Gaming 43b6 X399 Series Chipset SATA Controller 43b7 300 Series Chipset SATA Controller + 43b8 A320 Chipset SATA Controller [AHCI mode] 43b9 X370 Series Chipset USB 3.1 xHCI Controller 1849 43d0 Fatal1ty X370 Professional Gaming 43ba X399 Series Chipset USB 3.1 xHCI Controller 43bb 300 Series Chipset USB 3.1 xHCI Controller + 43bc A320 USB 3.1 XHCI Host Controller 43c6 400 Series Chipset PCIe Bridge 43c7 400 Series Chipset PCIe Port 43c8 400 Series Chipset SATA Controller @@ -9186,12 +9213,17 @@ 8717 PEX 8717 16-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch with DMA 8718 PEX 8718 16-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch 8724 PEX 8724 24-Lane, 6-Port PCI Express Gen 3 (8 GT/s) Switch, 19 x 19mm FCBGA + 4c52 9234 LRNV9324 2-port Built-in 8643 NVMe Exchange Adapter + 4c52 9524 LRNV9524 2-port M.2 NVMe SSD Exchange Adapter 8725 PEX 8725 24-Lane, 10-Port PCI Express Gen 3 (8.0 GT/s) Multi-Root Switch with DMA 8732 PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch 8734 PEX 8734 32-lane, 8-Port PCI Express Gen 3 (8.0GT/s) Switch 8747 PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch + 4c52 9347 LRNV9347L 2-port Built-in 8643 NVMe Switching Adapter + 4c52 9547 LRNV9547 4-port M.2 NVMe SSD Exchange Adapter 8748 PEX 8748 48-Lane, 12-Port PCI Express Gen 3 (8 GT/s) Switch, 27 x 27mm FCBGA 8749 PEX 8749 48-Lane, 18-Port PCI Express Gen 3 (8.0 GT/s) Multi-Root Switch with DMA + 4c52 9349 LRNV9349 8-port SFF-8643 NVMe SSD Exchange Adapter 87a0 PEX PCI Express Switch NT0 Port Link Interface 87a1 PEX PCI Express Switch NT1 Port Link Interface 87b0 PEX PCI Express Switch NT0 Port Virtual Interface @@ -12959,6 +12991,8 @@ 2296 Tegra PCIe Endpoint Virtual Network 22a3 GH100 [H100 NVSwitch] 22ba AD102 High Definition Audio Controller + 22bc AD104 High Definition Audio Controller + 22bd AD106M High Definition Audio Controller 2302 GH100 2313 GH100 [H100 CNX] 2321 GH100 [H100L 94GB] @@ -13080,6 +13114,7 @@ 2681 AD102 [RTX TITAN Ada] 2684 AD102 [GeForce RTX 4090] 2685 AD102 [GeForce RTX 4090 D] + 2689 AD102 [GeForce RTX 4070 Ti SUPER] 26b1 AD102GL [RTX 6000 Ada Generation] 26b2 AD102GL [RTX 5000 Ada Generation] 26b3 AD102GL [RTX 5880 Ada Generation] @@ -13299,6 +13334,7 @@ 8043 LANai4.x [Myrinet LANai interface chip] 8062 S5933_PARASTATION 807d S5933 [Matchmaker] + 8081 GPIB interface card [IOtech Inc. PCI488] 8088 Kongsberg Spacetec Format Synchronizer 8089 Kongsberg Spacetec Serial Output Board 809c S5933_HEPC3 @@ -16238,7 +16274,9 @@ 11ae Aztech System Ltd 11af Avid Technology Inc. 0001 Cinema + ee21 Digidesign DSP Farm ee40 Digidesign Audiomedia III + ee60 Digidesign SampleCell II / II Plus 11b0 V3 Semiconductor Inc. 0002 V300PSC 0292 V292PBC [Am29030/40 Bridge] @@ -17445,7 +17483,8 @@ 10a9 8002 Acenic Gigabit Ethernet 12ae 0002 Gigabit Ethernet-T (3C986-T) 00fa Farallon PN9100-T Gigabit Ethernet -12af TDK USA Corp +12af TDK Corporation + 5831 GBDriver GX1 x2 NVMe SSD Controller (DRAM-less) 12b0 Jorge Scientific Corp 12b1 GammaLink 12b2 General Signal Networks @@ -18916,6 +18955,9 @@ 580b Secure Flash Controller (Xenon) 580d System Management Controller (Xenon) 5811 Xenos GPU (Xenon) + 5821 Xenos GPU (Zephyr/Falcon) + 5831 Xenos GPU (Jasper) + 5841 Xenos GPU (Slim) 1415 Oxford Semiconductor Ltd 8401 OX9162 Mode 1 (8-bit bus) 8403 OX9162 Mode 0 (parallel port) @@ -19859,6 +19901,7 @@ 144d a801 SM963 2.5" NVMe PCIe SSD a806 NVMe SSD SM0032L a808 NVMe SSD Controller SM981/PM981/PM983 +# Used by different variants of SSD 970 EVO and PRO 144d a801 SSD 970 EVO/PRO 1d49 403b Thinksystem U.2 PM983 NVMe SSD a809 NVMe SSD Controller 980 (DRAM-less) @@ -19886,7 +19929,7 @@ # Actually 88SS1322 according to techpowerup a80b NVMe SSD Controller PM9B1 (DRAM-less) a80c NVMe SSD Controller S4LV008[Pascal] - a80d NVMe SSD Controller PM9C1a + a80d NVMe SSD Controller PM9C1a (DRAM-less) a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -20844,6 +20887,7 @@ 14e4 5250 NetXtreme-E BCM57504 4x25G KR Mezz 14e4 5425 NetXtreme-E Quad-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957504-N425G) 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE + 1590 0420 HPE Ethernet 25/50Gb 2-port 6310C Adapter 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 1760 BCM57608 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet 14e4 d125 BCM57608 2x200G PCIe Ethernet NIC @@ -21908,11 +21952,13 @@ 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image - 0270 Spectrum-4L, Flash recovery mode + 0270 Spectrum-5 in Flash Recovery Mode 0271 Spectrum-4L, RMA - 0274 Spectrum-4C, Flash recovery mode + 0274 Spectrum-6 in Flash Recovery Mode 0275 Spectrum-4C RMA 0277 Spectrum-4TOR RMA + 0278 Quantum-4 in Flash Recovery Mode + 0279 Quantum-4 RMA 0281 NPS-600 Flash Recovery 0282 ArcusE Flash recovery 0283 ArcusE RMA @@ -22132,6 +22178,7 @@ d2f2 Quantum-2 NDR (400Gbps) switch d2f4 Quantum-3 d2f6 Quantum-3CPO + d2f8 Quantum-4 15b4 CCI/TRIAD 15b5 Cimetrics Inc 15b6 Texas Memory Systems Inc @@ -23338,7 +23385,8 @@ 1108 IPQ95xx/97xx PCIe Root Port 1109 QCN62xx/92xx Wireless Network Adapter 17cc NetChip Technology, Inc - 2280 USB 2.0 + 2280 NET2280 PCI to USB 2.0 Hi-Speed Peripheral Controller + 2282 NET2282 PCI to USB 2.0 Hi-Speed Peripheral Controller 17cd Cadence Design Systems, Inc. 17cf Z-Com, Inc. 17d3 Areca Technology Corp. @@ -23925,6 +23973,7 @@ 0013 SH7757 PCIe Switch [PS] 0014 uPD720201 USB 3.0 Host Controller 0015 uPD720202 USB 3.0 Host Controller + 4c52 9a72 LRSU9A72 2-Port USB 3.0 Exchange Adapter 001a SH7758 PCIe-PCI Bridge [PPB] 001b SH7758 PCIe End-Point [PBI] 001d SH7758 PCIe Switch [PS] @@ -24087,6 +24136,8 @@ 1942 ClearSpeed Technology plc e511 Advance X620 accelerator card e521 Advance e620 accelerator card +1945 MERA + 6200 PXI/PXIe measurement module 1947 C-guys, Inc. 4743 CG200 Dual SD/SDIO Host controller device 1948 Alpha Networks Inc. @@ -24184,6 +24235,7 @@ 7010 MPC8641 PCI Host Bridge 7011 MPC8641D PCI Host Bridge 7018 MPC8610 + 81c0 LS1046A PCI Express Bridge c006 MPC8308 1a56 1201 Bigfoot Killer E2100 Gigabit Ethernet Controller # PCIe interface for emulator @@ -24773,6 +24825,7 @@ 1050 Virtio 1.0 GPU 1052 Virtio 1.0 input 1053 Virtio 1.0 socket + 1058 virtio-mem 105a Virtio file system 1110 Inter-VM shared memory 1af4 1100 QEMU Virtual Machine @@ -24797,6 +24850,7 @@ 0612 ASM1061/ASM1062 Serial ATA Controller 1849 0612 Motherboard 0622 ASM106x Serial ATA AHCI Controller + 4c52 9661 LRST9661 2-port M.2 SATA3(6Gb/s) Raid Adapter 0624 ASM106x SATA/RAID Controller 0625 106x SATA/RAID Controller 1040 ASM1040 SuperSpeed USB Host Controller @@ -24818,6 +24872,7 @@ 1187 ASM1187e 7-Port PCIe x1 Gen2 Packet Switch 118f ASM1187e 7-Port PCIe x1 Gen2 Packet Switch 1242 ASM1142 USB 3.1 Host Controller + 4c52 9a42 LRSU9A42 2-Port Type-A Exchange Adapter 1343 ASM1143 USB 3.1 Host Controller 1806 ASM1806 4-Port PCIe x2 Gen2 Packet Switch 1812 ASM1812 6-Port PCIe x4 Gen2 Packet Switch @@ -24907,10 +24962,13 @@ 1028 2113 BOSS-N1 Modular 1028 2151 BOSS-N1 Modular ET 1028 2196 ROR-N1 + 1028 2286 BOSS-N1 DC-MHS + 1028 2287 BOSS-N1 Modular 1b4b 2241 Santa Cruz NVMe Host Adapter 1b96 4000 WD_BLACK AN1500 NVMe SSD 1d49 0306 ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit 1d49 0307 ThinkSystem 7mm NVMe 2-Bay Rear RAID Enablement Kit + 4c52 9541 LRNV9541 2-port M.2 NVMe Raid Adapter 2b42 88W8997 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 5 (802.11ac) + Bluetooth® 5.3 Solution 2b43 NXP 88W9098 Wi-Fi 6 (ax) MAC #1 2b44 NXP 88W9098 Wi-Fi 6 (ax) MAC #2 @@ -24919,6 +24977,7 @@ 9123 88SE9123 PCIe SATA 6.0 Gb/s controller dc93 600e DC-6xxe series SATA 6G controller 9125 88SE9125 PCIe SATA 6.0 Gb/s controller + 4c52 9615 LRST9615 4-port SATA3(6Gb/s) Exchange Adapter 9128 88SE9128 PCIe SATA 6 Gb/s RAID controller 9130 88SE9128 PCIe SATA 6 Gb/s RAID controller with HyperDuo 1043 8438 P8P67 Deluxe Motherboard @@ -24947,6 +25006,7 @@ 1d49 0303 ThinkSystem SE350 M.2 SATA 4-Bay Data RAID Mirroring Enablement Kit 1d49 0304 ThinkSystem M.2 SATA 2-Bay RAID Enablement Kit 1d49 0305 ThinkSystem 7mm SATA 2-Bay Rear RAID Enablement Kit + 4c52 9630 LRST9630 4-port SATA3(6Gb/s) Raid Adapter 9235 88SE9235 PCIe 2.0 x2 4-port SATA 6 Gb/s Controller 9445 88SE9445 PCIe 2.0 x4 4-Port SAS/SATA 6 Gbps RAID Controller 9480 88SE9480 SAS/SATA 6Gb/s RAID controller @@ -24960,6 +25020,21 @@ # 2xHDMI and 2xHD-SDI inputs e5f4 MPEG2 and H264 Encoder-Transcoder f1c4 Dual ASI-RX/TX-CI card +1b5e STAR-Dundee Ltd. + 0001 SpaceWire PCI Mk2 + 0002 SpaceWire PCIe Mk1 + 0003 SpaceWire cPCI Mk2 + 0004 SpaceWire PXI Recorder Mk1 + 0005 SpaceWire PXI Interface Mk1 + 0006 SpaceWire PXI Interface Mk1 with RMAP Target + 0008 SpaceWire PXI Router Mk1 + 000b SpaceWire PXI Interface Mk2 + 000c SpaceWire PXI Interface Mk2 with RMAP Target + 000d SpaceWire PXI Router Mk2 + 000e SpaceWire PXI Recorder Mk2 + 0100 STAR-Ultra PCIe + 0102 STAR-Ultra Single-Lane Router + 0200 SpaceWire PCIe Mk2 1b61 Byd Precision Manufacture Co.,Ltd 1b66 DELTACAST 0007 DELTA-3G-elp-d @@ -25121,11 +25196,14 @@ 1bb1 0179 Nytro 5360S - E3.S # Nytro 5360S (Rocinante Single Port) TCG - E3.S 1bb1 0180 Nytro 5360S TCG - E3.S +# Nytro 5060H (Rocinante High Performance) non-SED + 1bb1 0181 Nytro 5060H 1bb1 01a1 Nytro XP7102 5012 FireCuda/IronWolf 510 SSD 5013 BarraCuda Q5 NVMe SSD (DRAM-less) 5016 FireCuda 520/IronWolf 525 SSD 5018 FireCuda 530 SSD + 5019 BarraCuda PCIe SSD (DRAM-less) # 2TB 5021 FireCuda 520 SSD # 1TB @@ -25315,6 +25393,7 @@ 0023 Ultrastar SN200 Series NVMe SSD 1c58 8823 Ultrastar Memory (ME200) 1c5c SK hynix + 1069 PCB01 NVMe Solid State Drive 1282 PC300 NVMe Solid State Drive 128GB 1283 PC300 NVMe Solid State Drive 256GB 1284 PC300 NVMe Solid State Drive 512GB @@ -25525,6 +25604,7 @@ 5762 FALCON, GAMMIX S41, SPECTRIX S40G NVMe SSD (DRAM-less) 5763 XPG GAMMIX S5 NVMe SSD (DRAM-less) 5766 XPG GAMMIXS1 1L, XPG GAMMIX S5, LEGEND 710 / 740, SWORDFISH NVMe SSD (DRAM-less) + 5772 LEGEND 850 LITE NVMe SSD (DRAM-less) 612a LEGEND 750 NVMe SSD (DRAM-less) 613a ATOM 50, LEGEND 840 NVMe SSD (DRAM-less) 621a LEGEND 850 NVMe SSD (DRAM-less) @@ -25565,6 +25645,7 @@ 6304 AM630 PCIe 4.0 NVMe SSD 1024GB 6a02 AM6A0 PCIe 4.0 NVMe SSD 256GB 6a03 RPETJ512MKP1QDQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) + 6a13 RPJYJ512MKN1QWQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) 6a14 RPEYJ1T24MKN2QWY PCIe 4.0 NVMe SSD 1024GB (DRAM-less) 8030 NVMe SSD Controller UH8X2X/UH7X2X series 1cc4 1122 NVMe SSD UH812a U.2 1.92TB @@ -25662,7 +25743,7 @@ 071a KX-5000/KX-6000/KX-6000G/KH-40000 PCI Express Root Port 071b KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port 071c KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port - 071d KX-5000/KX-6000/KX-6000G/KH-40000 PCI Express Root Port + 071d KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port 071e KX-5000/KX-6000/KX-6000G/KH-40000/KX-7000 PCI Express Root Port 071f ZX-200 Upstream Port of PCI Express Switch 0720 ZX-200 PCIE RC6 controller @@ -25851,6 +25932,9 @@ 1024 AR-TK242 [2x10GbE Packet Capture Device] 1025 AR-TK242-FX2 [2x100GbE Gen5 Packet Capture Device] 1026 AR-TK242-FX2 [1x200GbE Gen5 Packet Capture Device] + 1027 AR-P2P-DBG [P2P Debug Function] + 1028 AR-P2P-ATR [P2P Actor Function] + 1029 AR-P2P-UTL [P2P Utility Function] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d72 Xiaomi 1d78 DERA Storage @@ -25979,6 +26063,7 @@ 1062 Lexar NM710 NVME SSD 1160 FORESEE P900 BGA NVMe SSD (DRAM-less) 1202 Lexar NM610 PRO NVME SSD (DRAM-less) + 12e4 ORCA 4836 Series eSSD 1602 Lexar NM790 NVME SSD (DRAM-less) 1d97 Lexar NM620 NVME SSD (DRAM-less) 2263 SM2263EN/SM2263XT-based OEM NVME SSD (DRAM-less) @@ -26058,6 +26143,9 @@ 1dbe 2006 Dongting-N2 DC SSD U.2 7680GB 1dbe 3001 Donghu-Z2 DC ZNS SSD U.2 4000GB 1dbe 3002 Donghu-Z2 DC ZNS SSD U.2 8000GB + 5666 NVMe SSD Controller IG5666 + 5668 NVMe SSD Controller IG5668 + 5669 NVMe SSD Controller IG5669 [Tacoma] 1dbf Guizhou Huaxintong Semiconductor Technology Co., Ltd 0401 StarDragon4800 PCI Express Root Port 1dc2 Alco Digital Devices Limited @@ -26410,6 +26498,7 @@ 1df8 d100 M.2 NVMe SSD 1df8 d201 M.2 NVMe SSD 1df8 d600 M.2 NVMe SSD +1dfa Astera Labs, Inc. 1dfc JSC NT-COM 1181 TDM 8 Port E1/T1/J1 Adapter 1e0d SambaNova Systems, Inc @@ -26595,10 +26684,12 @@ 1e3b 0069 Enterprise NVMe SSD U.2 3.20TB (R5301D) 1e3b 006c Enterprise NVMe SSD U.2 1.92TB (R5101) 1e3b 006d Enterprise NVMe SSD U.2 1.60TB (J5301) - 1e3b 00b9 Enterprise NVMe SSD U.2 QDP 25.60TB (R5300) - 1e3b 00be Enterprise NVMe SSD U.2 QDP 30.72TB (R5100) - 1e3b 00c1 Enterprise NVMe SSD U.2 QDP 25.60TB (R5300D) - 1e3b 00c4 Enterprise NVMe SSD U.2 QDP 30.72TB (R5100D) + 1e3b 00b9 Enterprise NVMe SSD U.2 ODP 25.60TB (R5301)/(J5301) + 1e3b 00be Enterprise NVMe SSD U.2 ODP 30.72TB (R5101)/(J5101) + 1e3b 00c1 Enterprise NVMe SSD U.2 ODP 25.60TB (R5301D)/(J5301D) + 1e3b 00c4 Enterprise NVMe SSD U.2 ODP 30.72TB (R5101D)/(J5101D) + 1e3b 00c7 Enterprise NVMe SSD U.2 ODP 25.60TB (J5300) + 1e3b 00c8 Enterprise NVMe SSD U.2 ODP 30.72TB (J5100) 1e3b 00c9 Enterprise NVMe SSD U.2 ODP 15.36TB (J5001) 1e3b 00ca Enterprise NVMe SSD U.2 ODP 3.84TB (J5102) 1e3b 00cb Enterprise NVMe SSD U.2 ODP 7.68TB (J5102) @@ -26609,12 +26700,16 @@ 1e3b 00dc Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM (J5001) 1e3b 00dd Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001) 1e3b 00de Enterprise NVMe SSD U.2 ODP 15.36TB with SK 16GB DRAM(J5001D) - 1e3b 00df Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM(J5001D) + 1e3b 00df Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM(J5001) 1e3b 00e7 Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001D) 1e3b 00e8 Enterprise NVMe SSD U.2 QDP 3.20TB (J5301) 1e3b 00e9 Enterprise NVMe SSD U.2 ODP 6.40TB (J5301) 1e3b 00ea Enterprise NVMe SSD U.2 QDP 3.20TB (J5301D) 1e3b 00eb Enterprise NVMe SSD U.2 ODP 6.40TB (J5301D) + 1e3b 00ec Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5101) + 1e3b 00ed Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(R5101) + 1e3b 00ee Enterprise NVMe SSD U.2 ODP 15.36B with SK 16GB DRAM(J5101) + 1e3b 00ef Enterprise NVMe SSD U.2 ODP 12.80TB with SK 16GB DRAM(J5301) 1e3b 00f0 Enterprise NVMe SSD U.2 0.40TB (X2900) 1e3b 00f1 Enterprise NVMe SSD U.2 0.80TB (X2900) 1e3b 00f2 Enterprise NVMe SSD U.2 1.60TB (X2900) @@ -26786,6 +26881,7 @@ 1001 Video Accelerator 1eb4 Quantum Nebula Microelectronics Technology Co.,Ltd. 3401 SSD Contoller +1eb6 Wuxi Stars Microsystem Technology Co., Ltd 1eb9 Senscomm Semiconductor, Inc 2020 SCM2625 Wi-Fi6 Network Adapter 1ebd EMERGETECH Company Ltd. @@ -26829,12 +26925,14 @@ 1eca Lightmatter 0000 Envise-B 1ed0 Hosin Global Electronics + 2283 Patriot P300 NVMe SSD (DRAM-less) 1ed2 FuriosaAI, Inc. 0000 Warboy 1111 RNGD 0000 1111 RNGD-S 0000 2222 RNGD VF 0000 3333 RNGD-S VF + 2222 RNGD-S 1ed3 Yeston 1ed5 Moore Threads Technology Co.,Ltd 0100 MTT S10 @@ -26918,6 +27016,7 @@ 1ef6 GrAI Matter Labs 1ef7 Shenzhen Gunnir Technology Development Co., Ltd 1efb Flexxon Pte Ltd +1eff Rebellions Inc. 1f02 Beijing Dayu Technology 1f03 Shenzhen Shichuangyi Electronics Co., Ltd 1202 MAP1202-Based NVMe SSD (DRAM-less) @@ -26947,7 +27046,27 @@ 1a01 M16104 Family Virtual Function 1f0f 0001 M16104 Family Virtual Function 2022 D1055AS PCI Express Switch Upstream Port + 3403 M18110 Family + 3404 M18110 Lx Family + 3405 M18110 Family BASE-T + 3406 M18110 Lx Family BASE-T + 3407 M18110 Family OCP + 3408 M18110 Lx Family OCP + 3409 M18110 Family BASE-T OCP + 340a M18110 Lx Family BASE-T OCP + 340b M18120 Family + 340c M18120 Lx Family + 340d M18120 Family BASE-T + 340e M18120 Lx Family BASE-T + 340f M18120 Family OCP + 3410 M18120 Lx Family OCP + 3411 M18120 Family BASE-T OCP + 3412 M18120 Lx Family BASE-T OCP + 3413 M18100 Family Virtual Function 9088 D1055AS PCI Express Switch Downstream Port +1f16 XConn Technologies +# XConn XC50256 CXL2.0/PCIe5.0 switch + c500 XC50256 1f17 Zettastone Technology 1f24 xFusion Digital Technologies Co., Ltd. 1058 EP500/EP600 NVMe SSD @@ -27148,6 +27267,25 @@ 1fe4 0077 Enterprise NVMe SSD U.2 6.40TB(HP630) 1fe4 0078 Enterprise NVMe SSD U.2 3.20TB(HP630) 1fe9 MemryX +# LinkData Technology (Tianjin) Co., LTD +1ff2 Linkdata + 10a1 NIC1160 Ethernet Controller Family + 1ff2 0c11 10GE Ethernet Adapter 1160-2X + 10a2 NIC1160 Ethernet Controller Virtual Function Family + 20a1 IOC2110 Storage Controller + 1ff2 0a11 2120-16i SATA3/SAS3 HBA Adapter + 1ff2 0a12 2120-8i SATA3/SAS3 HBA Adapter + 20a2 IOC2250 Storage Controller + 1ff2 0a21 2230-18i Tri-mode HBA Adapter + 1ff2 0a22 2230-10i Tri-mode HBA Adapter + 1ff2 0a23 2230-16i Tri-mode HBA Adapter + 1ff2 0a24 2230-8i Tri-mode HBA Adapter + 1ff2 0a28 2233-16i Tri-mode HBA Adapter + 30a2 ROC3250 Storage Controller + 1ff2 0b21 3260-18i Tri-mode RAID Adapter + 1ff2 0b22 3260-10i Tri-mode RAID Adapter + 1ff2 0b23 3260-16i Tri-mode RAID Adapter + 1ff2 0b24 3260-8i Tri-mode RAID Adapter 1ff4 DEEPX Co., Ltd. 0000 DX_M1 0001 DX_M1A @@ -27600,10 +27738,8 @@ 4c52 LR-LINK 1001 Smart Network Adapter 4c52 a008 LREG1008PT Single-port 1Gb Smart Ethernet Network Adapter - 4c52 a009 LREG1009PT Single-port 2.5Gb Smart Ethernet Network Adapter 1002 Smart Network Adapter 4c52 a006 LREG1006PT Single-port 1.2Gb Network Security Isolation Adapter - 4c52 a007 LREG1007PT Quad-port 10Gb Smart Ethernet Network Adapter 1003 Smart Network Adapter 1004 Smart Network Adapter 4c52 b010 LREG1010PF Single-port 10Gb FPGA Network Security Isolation Adapter @@ -27667,6 +27803,9 @@ 50b2 TerraTec Electronic GmbH 50ce System-on-Chip Engineering S.L. 0001 RELY-MIL-XMC-TSN-SWITCH + 0100 XMC_AV-Dual-ETH + 0101 XMC_AV-ETSN + 0102 XMC_AV-AFDX 5136 S S Technologies 5143 Qualcomm Inc 5145 Ensoniq (Old) @@ -29738,7 +29877,12 @@ 125d Ethernet Controller I226-IT 12d1 Ethernet Controller E830-CC for backplane 12d2 Ethernet Controller E830-CC for QSFP + 8086 0002 Ethernet Network Adapter E830-C-Q2 for OCP 3.0 + 8086 0004 Ethernet Network Adapter E830-CC-Q1 for OCP 3.0 12d3 Ethernet Controller E830-CC for SFP + 8086 0001 Ethernet Network Adapter E830-XXV-2 for OCP 3.0 + 8086 0003 Ethernet Network Adapter E830-XXV-2 + 8086 0004 Ethernet Network Adapter E830-XXV-4 for OCP 3.0 12d4 Ethernet Controller E830-CC for SFP-DD 12d5 Ethernet Controller E830-C for backplane 12d8 Ethernet Controller E830-C for QSFP @@ -30368,6 +30512,7 @@ 15fc Ethernet Connection (13) I219-V 15ff Ethernet Controller X710 for 10GBASE-T 1014 0000 PCIe3 4-port 10GbE Base-T Adapter + 108e 7b1f Quad Port 10GBase-T Adapter - CP 1137 0000 X710TLG GbE RJ45 PCIe NIC 1137 02c1 X710T2LG 2x10 GbE RJ45 PCIe NIC 1137 02c2 X710T4LG 4x10 GbE RJ45 PCIe NIC @@ -34334,6 +34479,7 @@ 37d9 X722 Hyper-V Virtual Function 3882 Ice Lake LPC Controller 38a4 Ice Lake SPI Controller + 38c8 Ice Lake-LP Smart Sound Technology Audio Controller 38e0 Ice Lake Management Engine Interface 3a00 82801JD/DO (ICH10 Family) 4-port SATA IDE Controller 3a02 82801JD/DO (ICH10 Family) SATA AHCI Controller @@ -34932,6 +35078,7 @@ 4641 12th Gen Core Processor Host Bridge/DRAM Registers 1028 0b10 Precision 3571 464d 12th Gen Core Processor PCI Express x4 Controller #0 + 464e Alder Lake-N Thunderbolt 4 USB Controller 464f 12th Gen Core Processor Gaussian & Neural Accelerator 1028 0b10 Precision 3571 4650 12th Gen Core Processor Host Bridge @@ -34978,8 +35125,13 @@ 4908 DG1 [Iris Xe Graphics] 4909 DG1 [Iris Xe MAX 100] 4940 4xxx Series QAT - 4942 4xxx Series QAT - 4944 4xxx Series QAT + 4941 4xxx Series QAT Virtual Function + 4942 401xx Series QAT + 4943 401xx Series QAT Virtual Function + 4944 402xx Series QAT + 4945 402xx Series QAT Virtual Function + 4946 420xx Series QAT + 4947 420xx Series QAT Virtual Function 4b00 Elkhart Lake eSPI Controller 4b23 Elkhart Lake SMBus Controller 4b24 Elkhart Lake SPI (Flash) Controller @@ -35107,6 +35259,7 @@ 51b0 Alder Lake PCI Express Root Port #9 51b1 Alder Lake PCI Express x1 Root Port #10 51bb Alder Lake-P PCH PCIe Root Port #4 + 51bd Alder Lake-P PCH PCIe Root Port #6 51bf Alder Lake PCH-P PCI Express Root Port #9 51c5 Alder Lake-P Serial IO I2C Controller #0 51c6 Alder Lake-P Serial IO I2C Controller #1 @@ -35166,7 +35319,15 @@ 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter 530d 80310 (IOP) IO Processor 5481 Alder Lake-N PCH eSPI Controller + 54a3 Alder Lake-N SMBus + 54a4 Alder Lake-N SPI (flash) Controller + 54a8 Alder Lake-N Serial IO UART Host Controller + 54b0 Alder Lake-N PCI Express Root Port #9 + 54b1 Alder Lake-N PCI Express Root Port #10 + 54b2 Alder Lake-N PCI Express Root Port #11 + 54b3 Alder Lake-N PCI Express Root Port #12 54c8 Alder Lake-N PCH High Definition Audio Controller + 54d3 Alder Lake-N SATA AHCI Controller 54e0 Alder Lake-N PCH HECI Controller 54ed Alder Lake-N PCH USB 3.2 xHCI Host Controller 54ef Alder Lake-N PCH Shared SRAM @@ -35205,7 +35366,7 @@ 56bf DG2 [Arc Graphics A580E] 56c0 ATS-M [Data Center GPU Flex 170] 56c1 ATS-M [Data Center GPU Flex 140] - 56c2 ATS-M [Data Center GPU Flex 170G] + 56c2 ATS-M [Data Center GPU Flex 170V] 5780 Thunderbolt 80/120G Bridge [Barlow Ridge Host 80G 2023] 5781 Thunderbolt 80/120G NHI [Barlow Ridge Host 80G 2023] 5782 Thunderbolt 80/120G USB Controller [Barlow Ridge Host 80G 2023] @@ -35219,9 +35380,12 @@ 579e Ethernet Connection E825-C for SFP 57a4 Thunderbolt Bridge [Barlow Ridge Hub 40G 2023] 57a5 Thunderbolt USB Controller [Barlow Ridge Hub 40G 2023] + 57ae Ethernet Controller E610 Backplane + 57af Ethernet Controller E610 SFP 57b0 Ethernet Controller E610 10GBASE T 57b1 Ethernet Controller E610 2.5GBASE T 8086 0000 Ethernet Converged Network Adapter E610 + 57b2 Ethernet Controller E610 SGMII 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5900 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers @@ -35600,6 +35764,7 @@ 7a27 Raptor Lake-S PCH Shared SRAM 7a30 Raptor Lake PCI Express Root Port #9 7a38 Raptor Lake PCI Express Root Port #1 + 7a3a Raptor Point-S PCH - PCI Express Root Port 3 7a3b Raptor Lake PCI Express Root Port #4 7a40 Raptor Lake PCI Express Root Port #17 7a44 Raptor Lake PCI Express Root Port #21 @@ -35646,7 +35811,10 @@ 8086 0094 Wi-Fi 6 AX201 160MHz 7afc Alder Lake-S PCH Serial IO I2C Controller #4 7afd Alder Lake-S PCH Serial IO I2C Controller #5 + 7d03 Meteor Lake-P Dynamic Tuning Technology 7d0b Volume Management Device NVMe RAID Controller Intel Corporation + 7d0d Meteor Lake-P Platform Monitoring Technology + 7d19 Meteor Lake IPU 7d1d Meteor Lake NPU 7d40 Meteor Lake-M [Intel Graphics] 7d41 Arrow Lake-U [Intel Graphics] @@ -35668,10 +35836,15 @@ 7e30 Meteor Lake-P Serial IO SPI Controller #1 7e40 Meteor Lake PCH CNVi WiFi 8086 0094 Wi-Fi 6E AX211 160MHz +# Refer from Intel Meteor Lake EDS (doc#640228) under its "Device IDs" section. + 7e45 Meteor Lake-P Integrated Sensor Hub 7e46 Meteor Lake-P Serial IO SPI Controller #2 + 7e4c Meteor Lake-P Gaussian & Neural-Network Accelerator 7e50 Meteor Lake-P Serial IO I2C Controller #4 7e51 Meteor Lake-P Serial IO I2C Controller #5 7e52 Meteor Lake-P Serial IO UART Controller #2 + 7e70 Meteor Lake-P CSME HECI #1 + 7e73 Meteor Lake-P Keyboard and Text (KT) Redirection 7e78 Meteor Lake-P Serial IO I2C Controller #0 7e79 Meteor Lake-P Serial IO I2C Controller #1 7e7a Meteor Lake-P Serial IO I2C Controller #2 @@ -36758,6 +36931,7 @@ a72f Raptor Lake-P Thunderbolt 4 PCI Express Root Port #2 a73e Raptor Lake-P Thunderbolt 4 NHI #0 1028 0c06 Precision 3580 + a740 Raptor Lake-S 8+12 - Host Bridge/DRAM Controller a74d Raptor Lake PCIe 4.0 Graphics Port a74f GNA Scoring Accelerator module 1028 0c06 Precision 3580 @@ -36851,6 +37025,11 @@ d156 Core Processor Semaphore and Scratchpad Registers d157 Core Processor System Control and Status Registers d158 Core Processor Miscellaneous Registers + e202 Battlemage G21 [Intel Graphics] + e20b Battlemage G21 [Intel Graphics] + e20c Battlemage G21 [Intel Graphics] + e20d Battlemage G21 [Intel Graphics] + e212 Battlemage G21 [Intel Graphics] f1a5 SSD 600P Series 8086 390a SSDPEKKW256G7 256GB f1a6 SSD DC P4101/Pro 7600p/760p/E 6100p Series @@ -36921,7 +37100,7 @@ 0119 WX1860-LC Gigabit Ethernet Controller Virtual Function 011a WX1860A1 Gigabit Ethernet Controller Virtual Function 011b WX1860AL1 Gigabit Ethernet Controller Virtual Function - 1000 Ethernet Controller RP1000 Virtual Function for 10GbE SFP+ + 1000 Ethernet Controller SP1000A Virtual Function for 10GbE SFP+ 1001 Ethernet Controller SP1000A for 10GbE SFP+ 1bd4 0084 Ethernet Controller SP1000A for 10GbE SFP+(lldp) 1bd4 0085 Ethernet Controller SP1000A for 10GBASE-T @@ -36931,7 +37110,7 @@ 8088 0000 Ethernet Network Adaptor RP1000 for 10GbE SFP+ 8088 0300 Ethernet Network Adaptor RP1000-A03 for 10GbE SFP+ 8088 0400 Ethernet Network Adaptor RP1000-A04 for 10GbE SFP+ - 2000 Ethernet Controller RP2000 Virtual Function for 10GbE SFP+ + 2000 Ethernet Controller WX1820AL Virtual Function for 10GbE SFP+ 2001 Ethernet Controller WX1820AL for 10GbE SFP+ 8088 2000 Ethernet Network Adaptor RP2000 for 10GbE SFP+ 8088 2300 Ethernet Network Adaptor RP2000-A03 for 10GbE SFP+ @@ -36943,7 +37122,17 @@ 8384 SigmaTel 8401 TRENDware International Inc. 8510 Sietium Semiconductor Co., Ltd. - 0201 GenBu02 [GB2062-PCIe-C0] + 0201 GenBu02 Series GPU + 8510 0001 GB2062-PUB-LPDDR + 8510 0002 GB2062-PCIe-C0 + 8510 0003 GB2062-PCIe-C41 + 8510 0004 GB2062-PCIe-HIEILP4 + 8510 0005 CQ2040-PCIe-C21 + 8510 0007 GB2062-PCIe-C40 + 8510 0008 CQ2040-MXM-M60 + 8510 0009 GB2062-PCIe-C20 + 8510 000c CQ2040-PUB + 8510 0201 GB2062-PUB-DDR # nee ScaleMP 8686 SAP 1010 vSMP Foundation controller [vSMP CTL] @@ -37316,6 +37505,9 @@ 103c 1101 Smart Array P416ie-m SR G10 105b 1211 HBA 8238-16i 105b 1321 HBA 8242-24i + 1137 02f8 24G TriMode M1 RAID 4GB FBWC 32D + 1137 02f9 24G TriMode M1 RAID 4GB FBWC 16D + 1137 02fa 24G TriMode M1 HBA 16D 13fe 8312 SKY-9200 MIC-8312BridgeB 152d 8a22 QS-8204-8i 152d 8a23 QS-8238-16i From nobody Mon Aug 19 16:14:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wnd2T0SXzz5THtB; Mon, 19 Aug 2024 16:14: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 4Wnd2S6WGbz4Csc; Mon, 19 Aug 2024 16:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724084048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vsdSXgYiAbIn+omxWL6CfTo4WlHIIOGBY82LKiESWI4=; b=kgnsOk02wkT/1BgHSUWfGgFOORBtXmSzZQgWgk8Jb1oEouWhB+QLp2NKw3ScwC0hYVr5W9 CpGYxjmvJW5YiAtcD6F6qxEPPJYMePRN5qJl3beEUx3URfELHR7TozuwhccnCXlSRjTm2t mVWWgQc98++p5aS6RkwEHRwHIXTQg7Y2jrpYhn/oTf9Od/v9yd/Kvfw64vjbbndSqkYcyH Xsg54og70KMF05T9k0yD4tlylU4awe98rDv+GllUD4i3pHEMvbDrcYQixRHTkc713kZeex Gdg8Jya7HqtadJgGOKmPkOWzJDKjCgrsRqJX4nKphCywGOHjAjlRfYdPMFEEmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724084048; a=rsa-sha256; cv=none; b=lNyaHeSTSew+GY5EGSzg5wMrSk/JqQCvFnXtYIPsAWkfgqjv/nX4m2ZOHE06AvSpKNBge5 HnDMlNjGMXvLX6QndxkHxPQg2A69dmXC5FO2pVxHboPAvHApZj9x1/DaH6L76tYsaW6Rbi tefJJ9C/E1Y9MK78QLk/NluvaWbq0zidw+iafEeURGRfhCZnGQHBKTfcCM1XaVhm6aj6EU tIlEDEFN1sY2mly6vsiUAD4I28WqHwM/wESF4ulnR26J9EShE8Bg1UlQepD5qBn+ejwyME UfB+sPyWRkptmEOsuJYbtoxTvpfCaUsINVtuOAIYbCluV7duY9Hlj2KnmWfyOQ== 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=1724084048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vsdSXgYiAbIn+omxWL6CfTo4WlHIIOGBY82LKiESWI4=; b=jcXmgFysvsM8p/Qa81MHjggatOfxFuhymrBy/48OGjIVolGj3TXOOetycSGuE08wTqJ0LI 8ajrssNLzQrBTJgVXKq17bQo8nN4xhXHhlLPCvfhn5FG/XnB0T78NDnPO+zokOv70DyEIv kgImyzC6Q7v77wbcgxUf/kOemS0d8voBfDflKxzku6pKxfPJBfm4Sv8on2fIYmYp7dsXLk 5uhtUD0yFHY5A/qmwQYYkgm7l65Ygqx8lbBnsrJz15VdWdg0+ISqNygaqS1fv3XNHWoyVb FivhCyp7InHLiuIyLwe//nBlbEEUGLQGfGA46RPdLCBcuQxQn1Ig6N5bBCWJjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wnd2S5tTKzNmN; Mon, 19 Aug 2024 16:14: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 47JGE8qZ065561; Mon, 19 Aug 2024 16:14:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JGE8iv065558; Mon, 19 Aug 2024 16:14:08 GMT (envelope-from git) Date: Mon, 19 Aug 2024 16:14:08 GMT Message-Id: <202408191614.47JGE8iv065558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 3cd90cb66d96 - main - usb_vendors: update to 2024.07.04 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cd90cb66d96b7604b8c5fde6f061e68eddbfc82 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3cd90cb66d96b7604b8c5fde6f061e68eddbfc82 commit 3cd90cb66d96b7604b8c5fde6f061e68eddbfc82 Author: Baptiste Daroussin AuthorDate: 2024-08-19 16:11:41 +0000 Commit: Baptiste Daroussin CommitDate: 2024-08-19 16:11:41 +0000 usb_vendors: update to 2024.07.04 --- share/misc/usb_vendors | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/share/misc/usb_vendors b/share/misc/usb_vendors index a1e3ea4acd1d..41b367d1a0d6 100644 --- a/share/misc/usb_vendors +++ b/share/misc/usb_vendors @@ -9,8 +9,8 @@ # The latest version can be obtained from # http://www.linux-usb.org/usb.ids # -# Version: 2024.03.18 -# Date: 2024-03-18 20:34:02 +# Version: 2024.07.04 +# Date: 2024-07-04 20:34:02 # # Vendors, devices and interfaces. Please keep sorted. @@ -2400,6 +2400,7 @@ 02e3 Xbox One Elite Controller 02e6 Xbox Wireless Adapter for Windows 02ea Xbox One Controller + 02f3 Xbox One Chatpad 02fd Xbox One S Controller [Bluetooth] 02fe Xbox Wireless Adapter for Windows 0306 Surface Pro 7 SD Card Reader @@ -4992,7 +4993,7 @@ 0a28 INDI AV-IN Device 1301 Network Controller 1302 i3 Gateway - 1303 3 Micro Module + 1303 i3 Micro Module 1304 i3 Module 1305 i3 Multi Sensing Module 04c1 U.S. Robotics (3Com) @@ -6433,6 +6434,7 @@ 2060 PT-E550W P-touch Label Printer 2061 PT-P700 P-touch Label Printer 2064 PT-P700 P-touch Label Printer RemovableDisk + 2065 PT-P750W P-Touch Label Writer 2074 PT-D600 P-touch Label Printer 209b QL-800 Label Printer 209c QL-810W Label Printer @@ -7439,6 +7441,7 @@ 03dd PTH-460 [Intuos Pro BT (S)] tablet 03ec DTH134 [DTH134] touchscreen 03ed DTC121 [DTC121] touchscreen + 03f0 DTH135 [Movink 13] 0400 PenPartner 4x5 4001 TPC4001 4004 TPC4004 @@ -9049,6 +9052,7 @@ 0752 micros Reader 0760 USB 2.0 Card Reader/Writer 0761 Genesys Mass Storage Device + 0769 SPR2801S [Lightspeeur 2801] 0780 USBFS DFU Adapter 07a0 Pen Flash 0880 Wasp (SL-6612) @@ -10898,7 +10902,7 @@ 0056 Agfa AP1100 Photo Printer 005d Mobile Mass Storage 005f Laser Pro LL [MFPrinter] - 0062 XG-76NA 802.11bg + 0062 XG-76NA / XG-760N 802.11b/g Wireless adapter 0078 Laser Pro Monochrome MFP 079d Alfadata Computer Corp. 0201 GamePort Adapter @@ -11169,6 +11173,7 @@ 1228 MPEG-2 Capture Device (M038) 1830 AVerTV Volar Video Capture (H830) 1871 TD310 DVB-T/T2/C dongle + 2553 Live Gamer Ultra 2.1 3835 AVerTV Volar Green HD (A835B) 850a AverTV Volar Black HD (A850) 850b AverTV Red HD+ (A850T) @@ -11180,6 +11185,7 @@ b300 A300 DVB-T TV receiver b800 MR800 FM Radio c039 DVD EZMaker 7 + d553 Live Gamer Ultra Pro-RGB e880 MPEG-2 Capture Device (E880) e882 MPEG-2 Capture Device (E882) 07cb Kingmax Technology, Inc. @@ -12286,7 +12292,7 @@ 0a0b WLU5053 802.11abgn Wireless Module [Broadcom BCM43236B] 0a13 AX88179 Gigabit Ethernet [Toshiba] 0b05 PX1220E-1G25 External hard drive - 0b09 PX1396E-3T01 External hard drive + 0b09 PX139xE 3.5 External HDD 0b1a STOR.E ALU 2S 1300 Wireless Broadband (CDMA EV-DO) SM-Bus Minicard Status Port 1301 Wireless Broadband (CDMA EV-DO) Minicard Status Port @@ -12420,6 +12426,7 @@ 010f nanoKONTROL studio controller 0117 nanoKONTROL2 MIDI Controller 012f SQ-1 + 0154 NTS-1 digital kit mkII 0203 KRONOS 0f03 K-Series K61P MIDI studio controller 0945 Pasco Scientific @@ -13004,6 +13011,7 @@ 5803 BCM5880 Secure Applications Processor with secure keyboard 5804 BCM5880 Secure Applications Processor with fingerprint swipe sensor 5832 BCM5880 Secure Applications Processor Smartcard reader + 5843 BCM58200 ControlVault 3 (FingerPrint sensor + Contacted SmartCard) 6300 Pirelli Remote NDIS Device 6410 BCM20703A1 Bluetooth 4.1 + LE bd11 BCM4320 802.11bg Wireless Adapter @@ -13020,11 +13028,14 @@ 0009 LP2844 Printer 0027 ZTC LP2844-Z-200dpi 0050 P120i / WM120i + 0062 GK420d Label Printer + 0065 ZM400 Label Printer 0080 GK420d Label Printer 0081 GK420t Label Printer 0084 GX420d Desktop Label Printer 008b HC100 wristbands Printer 008c ZP 450 Printer + 00a1 TLP2824 Plus 00d1 GC420d Label Printer 0110 ZD500 Desktop Label Printer 011c ZD410 Direct Thermal Label Printer @@ -13035,6 +13046,7 @@ 0010 MPMan MP-F40 MP3 Player 0a66 ClearCube Technology 0a67 Medeli Electronics Co., Ltd + ffff LCS Audio 0a68 Comaide Corp. 0a69 Chroma ate, Inc. 0a6b Green House Co., Ltd @@ -13246,10 +13258,11 @@ 0ac9 Micro Solutions, Inc. 0000 Backpack CD-ReWriter 0001 BACKPACK 2 Cable - 0010 BACKPACK + 0010 BACKPACK CD Drive 0011 Backpack 40GB Hard Drive 0110 BACKPACK 0111 BackPack + 10ff BACKPACK 1234 BACKPACK 0aca OPEN Networks Ltd 1060 OPEN NT1 Plus II @@ -13308,7 +13321,7 @@ 3102 MemoryStick Card Reader 3201 MMC/SD+MemoryStick Card Reader 3216 HS Card Reader - 3260 7-in-1 Card Reader + 3260 ND3260 7-in-1 Card Reader 5010 ND5010 Card Reader 0af0 Option 5000 UMTS Card @@ -13382,6 +13395,7 @@ 17a0 Xonar U3 sound card 17a1 Eee Note EA800 (mass storage mode) 17ab USB-N13 802.11n Network Adapter (rev. B1) [Realtek RTL8192CU] + 17b5 Broadcom BCM20702A0 Bluetooth 17ba N10 Nano 802.11n Network Adapter [Realtek RTL8192CU] 17c2 ROG Spitfire 17c7 WL-330NUL From nobody Mon Aug 19 18:11:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wngdr4JHFz5TDR6; Mon, 19 Aug 2024 18:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wngdr2jV8z4TQP; Mon, 19 Aug 2024 18:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724091088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k/eH1Ozxyj3wsen/udyQCyMJyGLQlXWpc4cobmUe4EE=; b=e3JFuZp5fQzd8/hWvdLhVWdCrI2V9gyxt+LClk4EhxV2Bw3Ki823lG10D6jQ8ss4Jinhz3 /OdFQfXvEmKl5Jygk0UfKfna9SFSnvSb/YFUBW+FseLgntdyORJrdfL+1dE3FobQ1avmLi zBhZ2vkS3QUzyXmyry7cScyjoukWn51/2vXK6X7QgMq4CqXpLUMVz+f49bzK7MBOiUD6gD 5fTTbhBLES0EzJ32BLIH2jSK1/22K4naWjv9bVCl97I+7DD+08gc3+c/YfEubvGbk+DAXj PtzBy3N+NbUHq17dpsiPG3dQOn/+doMFo50V9oZ/EAOh5ISAKbGDBVn/7ybwPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724091088; a=rsa-sha256; cv=none; b=CHlAky/B+K9sgG0TNh2Lf7qBU+SQKQkKMPjAPvaEv/Irr57kxkirDLj5393+Xt6dKSB256 53EoxoSq5QXyK/XwW1Xh5eAjGcqS6If5LwG9GBMqUW4RM9AppgZ1xhKPRpwwnRkLHbeads fo7XPtbALJnbJz7z0pmglpPubrvrAkXJUSn/5AMrbkynWQUr5/xBBk2ULPaZjtbWufUN3+ aIsm2SJ6ZxzkkCzye5GeGs/Hu/YZC04a1qUx/vZ1FPgjP13R2ahXIETfyIqEl8m6Li8GXZ nWj5175Cl3DfHC+wIztm8EEkJPkU0jC4gd5d8kjYQWg2J/UVG+vMnro1DYdJ+A== 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=1724091088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k/eH1Ozxyj3wsen/udyQCyMJyGLQlXWpc4cobmUe4EE=; b=KcrSOXJBFotR7oC4iPjAySuPHpG7mMETKZ65qHsVETmgrXKt3+L5wXQqSIAT5wx8FkyVLy hoBvEjYJQxN6Acm43VWBgI4vD4+suZpuBqFABza5ONJxo+S1VfSCknrxDyiakH9RgVUkpm /M30YmtRPmfL/3YJ007rgvnl3W++JDF+jgWimiTpqXSMSd7OKljSlqOVdpJDYej1PlfzkO sZqXHmFNaT07fKCMBkS3n9XfRZng77o+1Yn0363FbWKGFlNyF70B4hjXivHMgTR1rfkQNG gTo1hSte++1qXZo2U8hc4GlcsAMYrAfDRYfcxh25WvGvzhUuLVgseDVllmaH3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wngdr2L0HzR16; Mon, 19 Aug 2024 18:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JIBSCx065099; Mon, 19 Aug 2024 18:11:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JIBSG4065096; Mon, 19 Aug 2024 18:11:28 GMT (envelope-from git) Date: Mon, 19 Aug 2024 18:11:28 GMT Message-Id: <202408191811.47JIBSG4065096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: e06022e1bfc2 - main - Makefile.ec2: Add missing CLEANFILES entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e06022e1bfc263e8b1393c7b948707a250f16f83 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e06022e1bfc263e8b1393c7b948707a250f16f83 commit e06022e1bfc263e8b1393c7b948707a250f16f83 Author: Colin Percival AuthorDate: 2024-08-18 01:59:18 +0000 Commit: Colin Percival CommitDate: 2024-08-19 18:10:52 +0000 Makefile.ec2: Add missing CLEANFILES entry Without this, "make clean ec2ami" won't build a new AMI. MFC after: 3 days Sponsored by: Amazon --- release/Makefile.ec2 | 1 + 1 file changed, 1 insertion(+) diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index 8f5f6f205779..4363aac21369 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -60,6 +60,7 @@ cw-ec2-portinstall: SSMOPTS_${_FL}_${_FS}= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/${_FL}/${_FS}/${REVISION}/${BRANCH} .endif EC2AMILIST+= ec2ami-${_FL}-${_FS} +CLEANFILES+= ec2ami-${_FL}-${_FS} ec2ami-${_FL}-${_FS}: cw-ec2-${_FL}-${_FS} ${CW_EC2_PORTINSTALL} .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) @echo "--------------------------------------------------------------" From nobody Mon Aug 19 18:11:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wngds4sddz5TDCr; Mon, 19 Aug 2024 18:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wngds3jMDz4TVv; Mon, 19 Aug 2024 18:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724091089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S6jHA1LNiml/SqunXXOIlOjC+5HmgieGJT8YO8O7K9o=; b=yMNBZse1l0Dm38AkycbY4E+9oOD7hZ5JcHV6svyad5vHZrPP43HwIdTEnsxPCklCfForle MDrWs407vAnST2OdOFfzsPt4IldbpUi6C9Dk+2kT1ZP8bwXJdipu6xzLNgmeBAOYvjHKDf ErsE56PANb17XnCblU+EeXSoqcKUzNMvdGVZI02Drnl7/5FuS1dPZGmDkcp3bMqSVxxAPE NBh+w8c9d+8+toRyWidPowe+cC2jnIZP4IuLRHfgEgnf/CleWXiG1FSOvo7DyTQCrP+ibs 6ABWvuT0B8VzgU/KlJQgcHb5DLLJh4Rxf59XgoN/+vN9rcequS4d2iLtqVJDfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724091089; a=rsa-sha256; cv=none; b=Z+2VaSaQleMmjDcdP73s9dQ6bUamAz3Foq0r9BeAowVvtE9ZfB4K6jYIM2WDZygM8LPX3C 5dV1VEOGyaUfpoNleo84eCicmoMr12tXJWjrCTLSRbUs2IbbtsRsdXi2A+y1FcZ46Ogrmt BpmqkgJ05Xfsa6ryGXxEx1FfjEspQtkUdRzmyyE3EO2JHR1WvnA0QZ+5SE1+bYFQLqlJe7 /wxJ4onhvl+aJEL/E2Penzi3HR89mOllpS8o8L0jVxqwFjA9YYq+3CaVhwC4jG4C+iiolY wNVuu9NRLtZg1JMBx8ZQjsRD+0qCd57FVBytV+N7r/w4ScROUYSgC+nuE6iyLw== 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=1724091089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S6jHA1LNiml/SqunXXOIlOjC+5HmgieGJT8YO8O7K9o=; b=wM09y+mpTvaOTiBhvskAcVAVOK0eBkGzCsK0cwnaEEy9lEL0WJ533RDD/4RAARvcrfNrxl iEvmOuxBBurvQxi1M3HFdy9OeR7e6U0iEFG45oxxYQuXR4UN2IC/57LukKHGqeDnEpWKeD fCmZi6bBmAoIuZNNHIlZ1KsmS4et4VT3yZdjqlRqUx+u0u+l2gQUxO8I1D7lSuNDbWF90u h7H2LBOMg3qNHHDo8i7/f16tCbFKqpaXmb5dnDZ9QiUbUjgEp7BKEDOF+PxGASZgoLMfuF rxrgmn2IMq+AENuC9DZmgUsD7yFdoDDq6+OYpY9yGW8y5kEfjmJ9AF4Uu9Myiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wngds3KXWzRNm; Mon, 19 Aug 2024 18:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JIBT4t065147; Mon, 19 Aug 2024 18:11:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JIBTcN065144; Mon, 19 Aug 2024 18:11:29 GMT (envelope-from git) Date: Mon, 19 Aug 2024 18:11:29 GMT Message-Id: <202408191811.47JIBTcN065144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 2dac89aee330 - main - EC2: Bump AMI size to 8 GB List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2dac89aee3304dd6eda9b267a0ad1cc6621a7094 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2dac89aee3304dd6eda9b267a0ad1cc6621a7094 commit 2dac89aee3304dd6eda9b267a0ad1cc6621a7094 Author: Colin Percival AuthorDate: 2024-08-18 02:00:31 +0000 Commit: Colin Percival CommitDate: 2024-08-19 18:11:04 +0000 EC2: Bump AMI size to 8 GB 8 GB root disk images make FreeBSD/EC2 boot much faster than 6 GB root disk images. MFC after: 2 days Sponsored by: Amazon --- release/tools/ec2.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 989e8a05a318..602216d3c2d4 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -10,12 +10,12 @@ export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ebsnvme-id amazon-ssm-agent" # Services which should be enabled by default in rc.conf(5). export VM_RC_LIST="dev_aws_disk ntpd" -# Build with a 5.9 GB partition; the growfs rc.d script will expand +# Build with a 7.9 GB partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the filesystem partition, not the disk # which it resides within. -export VMSIZE=6000m +export VMSIZE=8000m # No swap space; it doesn't make sense to provision any as part of the disk # image when we could be launching onto a system with anywhere between 0.5 From nobody Mon Aug 19 18:11:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wngdv1q0Qz5TDR9; Mon, 19 Aug 2024 18:11: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 4Wngdt5lZmz4TMm; Mon, 19 Aug 2024 18:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724091090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kn7Q534AU8XROiow/RcW5dlAZz6GwGt+5qVx2S70FiA=; b=eK9h5a3VBkdLpA1a12UBoHYNsFSsGllVRHnmXtBemQFK76XbY+hTZ+cbKlds6kl3DsqA7c 2LPvenYzgumMxSZJxIlBbHbO+B327px5cWbjeYfW+VU6aUDC06At1ibWDPs3klWZscoTUU fZiv6zpS9TkG6pOC56jrc9ciXRuy/vlLZoQWmQtonKUzwUTXITa0jjYxoOn+KJavugKcIT xBRlFVSsKhw9mqOuQ7J8keb9irHYulVSMQ6zdIzYraR+2OviB9fKUuRNnC2nJ0vqsYRO9o NFvf2Xe8E5+O+ObpPjha5bI34GLk8qxrfJg5sHSwg9WVFHu2JmHhPfaEyjEHEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724091090; a=rsa-sha256; cv=none; b=b8niffiVnwYSjjuzeCnoHir8xy4ys3WlG2sqAaSYIEcGh8Wj5p+jewLt08EZihniGJlNSD po/cXYHjuChMBjAb4kUrDYl+YLUYZcD0UwEvJtT2gp/z0zPVFnYs1SdpGYGl5+g+4MRuDJ Du02yoKxn53h5cG2JK9BW60q7UTf/hhoifk9o2Q2gMTOD13ZlaosL94b7HT7wTv6XACXK8 irWS2LL9HLFW/McOv4pnm15QxWCI6jjZZqKdPdPUL54jxisqLwGUIRiflcqnsVcdHLXrXw zwDO2Wc00C9z64W5QfLEpASS2uHba9cicEU1g/wvCEMDjstSJLswKQvz1awlQg== 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=1724091090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kn7Q534AU8XROiow/RcW5dlAZz6GwGt+5qVx2S70FiA=; b=LGvfkH+unffgqU5JtdCcBsoK4adtL4f9m4bMcz0INIsCQV6qjykRFr6AhHwUjY8+LJQHuQ q6+6NG0Y7Ymkg4G7pL4ghyUDkdQOjhjjn3zpjMqgjpsACs298txzwntizEXYhbuRFIawHc y3EMu+zAAfc3qTDlM3wUcJVyzc8xAJpduQovIw94JIrl1dlJkdjwOSCAxAT7u4P0EfESSU hfy3YwtIjngy5rChrm8hE89Rm8Anuh8F+BezYD5xk4LhjnpfP/rg3wlS4pVhvNiCRSWOXE wLnGgxtQmJFqzLOOOqjc/z7Xt6HgtY/CT9nMohWzVf55MHg70V7WjoaAO/8qJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wngdt4LgGzRjC; Mon, 19 Aug 2024 18:11: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 47JIBUcN065193; Mon, 19 Aug 2024 18:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JIBUlA065190; Mon, 19 Aug 2024 18:11:30 GMT (envelope-from git) Date: Mon, 19 Aug 2024 18:11:30 GMT Message-Id: <202408191811.47JIBUlA065190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: c482d65cd187 - main - EC2: Drop UEFI-PREFERRED from AMI names List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c482d65cd187a5cc311ede3e328270bfcd014e73 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c482d65cd187a5cc311ede3e328270bfcd014e73 commit c482d65cd187a5cc311ede3e328270bfcd014e73 Author: Colin Percival AuthorDate: 2024-08-18 02:05:52 +0000 Commit: Colin Percival CommitDate: 2024-08-19 18:11:17 +0000 EC2: Drop UEFI-PREFERRED from AMI names Starting in September 2021 EC2 AMI names have included the boot method: "BIOS", "UEFI", or "UEFI-PREFERRED". The third option became available in June 2023 and allows AMIs to boot via UEFI on EC2 instance types which support that, but fall back to (much slower) BIOS booting on the instance types which don't support UEFI. Since UEFI-PREFERRED is basically a best-of-both-worlds option and is now the default, there's no point mentioning it in the AMI names. If for some reason an AMI is built with the boot method forced to BIOS or UEFI, that will still be included in the AMI name. This will not be MFCed, in case anyone has scripts which look at the AMI names on 13.x/14.x. Sponsored by: Amazon --- release/Makefile.ec2 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index 4363aac21369..27e6340dca2b 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -29,6 +29,11 @@ BOOTMODEOPT= --uefi .if ${AMIBOOTMETHOD} == "UEFI-PREFERRED" && ${TARGET_ARCH} == "amd64" BOOTMODEOPT= --uefi-preferred .endif +.if ${AMIBOOTMETHOD} == "UEFI-PREFERRED" +AMIBASENAME=${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} +.else +AMIBASENAME=${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD} +.endif CLEANFILES+= ec2ami @@ -83,7 +88,7 @@ ec2ami-${_FL}-${_FS}: cw-ec2-${_FL}-${_FS} ${CW_EC2_PORTINSTALL} /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \ ${EC2ARCH} ${SSMOPTS_${_FL}_${_FS}} ${BOOTMODEOPT} --sriov --ena \ ${.OBJDIR}/${EC2-${_FL:tu}${_FS:tu}IMAGE} \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD} ${_FL} ${_FS:tu}" \ + "${AMIBASENAME} ${_FL} ${_FS:tu}" \ "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} From nobody Mon Aug 19 19:33:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WnjSF2fr8z5TMST; Mon, 19 Aug 2024 19:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WnjSF29Khz4f9x; Mon, 19 Aug 2024 19:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724095997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xXKDkz8BwgYFL/EHaH+f/VefCHHzFAY2c03HosDoybE=; b=E0WEuIicOPWds1bwTdDDZ48FpjUK0EEtiyQqYLRMPdU1KzmZOTf8A3ajst59OgHPY4FOGe uV9MoMK7VRzoDvV/Oeoo6WDSQxp0VYLOt+oUhBaWrEPxRdMz8Tm+CwgGmFb7ynX+xogxF8 YYHCzw0BuvoqfcZU5gTEkTKcltZnZI63OnEJN44+sB9T7unp4S/76ljRabO5wSL7rs4ZKU mMF5K52OKxnel8hDKooKp91fqktW6gosqMYC514OYJw9cuU3UxZueHROUE4tF0GbKNY/5J IR++KDhB/s9wg6L33cO4SDldFA0hhVr95tSAt6vCr/pud7LO4e+Evyw+Ou6u0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724095997; a=rsa-sha256; cv=none; b=O3+Qv9s5V3/EwjenhGI293hyAxmoB4kqQASVxqgJ/LPb+Q8fifAxPyEcFd7RL/dwJf9cvo cNiSAcKvtXXpkmgSGiIA+VrWTGmVKV7WTPZ0YkDpQCw36NuXiALemZ0IEcSl7iSCNVjD6p wWIEHPJvm8bD4mUSoyt5jbyLVMNh4sEGJi03Et1gBM8f2yjzkYD2BJqZ31QG5QnOpStwLi v4BJjraHeSgVC3QJKRHtStzuePOyTopMleusSOk2NxwGy+BENnaqOU3gjpYTKmZF38QbJg rRdqnXTsW6RiB60yC96i4SksxyAZC4ApzTyI7Cr4UsJCkED0oxfzskSWwPG4Vw== 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=1724095997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xXKDkz8BwgYFL/EHaH+f/VefCHHzFAY2c03HosDoybE=; b=Vqp9BnjwI6o7KSCoVtATj4aihuXgaRGYEbVmqvKkvpefNG0sTbFvMN3qh1J0zTYij4wFKk UeTaMFoK9Xx1I52iBqegVx2e/J1MSkSv99cKnNhZBUGKeFN3M8t9QA3ULvyA6U6I+uCbO+ /qTV7+BCmzUjQ5zfqjMnVm250eQ7Ecgesk3hRsGxVR/ZYGPtbDNmV59HDirwupXjOIXt9+ Ua9evI9NeI7U+OYGAbotFAhjW+DmhTG3YHnhOtdt5a9ULE0rzjjb1T0+//gM0/49meYqpa Fbg4h8E2xH5qLGa1boCWhjJLoiNAsrQ3BHdc5b3R4e9QD2uXJL2d4ZUgJKzDSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WnjSF1mHrzTy3; Mon, 19 Aug 2024 19:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47JJXHFk003878; Mon, 19 Aug 2024 19:33:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JJXHg7003875; Mon, 19 Aug 2024 19:33:17 GMT (envelope-from git) Date: Mon, 19 Aug 2024 19:33:17 GMT Message-Id: <202408191933.47JJXHg7003875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 2a916499470a - main - bsd-family-tree: shorter URL for FreeBSD manual pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a916499470ae35178ca218e68175478037c3b0a Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=2a916499470ae35178ca218e68175478037c3b0a commit 2a916499470ae35178ca218e68175478037c3b0a Author: Wolfram Schneider AuthorDate: 2024-08-19 19:32:51 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-19 19:32:51 +0000 bsd-family-tree: shorter URL for FreeBSD manual pages --- share/misc/bsd-family-tree | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 955bb0f30e43..24de0a603731 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -934,7 +934,7 @@ FreeBSD Release Information URL: https://www.FreeBSD.org/releases/ Manual pages for FreeBSD and ports -URL: https://man.FreeBSD.org/cgi/man.cgi +URL: https://man.FreeBSD.org UNIX history graphing project URL: https://minnie.tuhs.org/Unix_History/index.html From nobody Mon Aug 19 19:41:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wnjdl4378z5TNc8; Mon, 19 Aug 2024 19:41: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 4Wnjdl2526z4fjm; Mon, 19 Aug 2024 19:41:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724096491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79I3Dzm+WI2AltKDJal68vSxygaUMG7lGERpuoIi2CA=; b=t/R5XKQZWvCdcQJgjeva6envK/Nj/mJ5cy9x+aaqMcEessPI9upEPCSojvA7kCqE7cPs25 vhT0KVzIXi62pN5QWBAMxpXgjJUHVw/k6Rk+cG9xVCvpmP9TL74yN+OGHWqoCrTZWd3iyK 4csd4wDIj3I4JeWgu7BeheFOcoxGHBsW0IYzoGCXBXOt+M2Fq3l5YztQpgtgc/3yP//84p 9GNru/SyYOuLHtpY29fE08ljQTKUxOWxMhrBaVG9cbKlHLCwILktuWumDRTL7eBIbG4IcV c6YToEQLoYjF67fglpRitIFkVEeBO7bZu2ootsLmidDMDHBxGhqUWH9TR28VEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724096491; a=rsa-sha256; cv=none; b=B5vabxrscCNwwzzxAKIaSGbL7CW4jU0a70/kgBJS3wjF8KM9kIRqcGpwRS1ValvJDKwUcT K0hOr3hZ5fp90SlJsz1/OK8rIuzdqJ6CcinftC/+MobwVYfWuHjNPf91NJa54jvgbyoxZe Mb3AR+w4W6QuJhhFAvUla55EC8lXfhRvMON63Njou3vvFiEoKqqfwhD/VmPNYbRZpaDcDt r9j4hEi67t1e7QOCR2CM/apHgMxgsyeoPx5lGyEIvRDkDFvTjJreVcykmA3dcYPYKp26yS Z1/GlUHrjeqDBUeYsfX8wkcXKESq3cBTQeq2aQ+IODzAN31Stzdt+Jb1FT2www== 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=1724096491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79I3Dzm+WI2AltKDJal68vSxygaUMG7lGERpuoIi2CA=; b=U61CLhfPi1tmLmZiEX/DVg2cFJE9H0N7UVPpMutK8DAsxJj+FsBM4IMQfmFpwWqDiyWAz3 tcn6dJqbgWpnm2FG2J96xqPtKmVQ0AfKava1IYyWZXHolWfzWks/mezPX7FcetVll/k/3/ 6e7/++r/zutdadF3ANR83m/8A4UPDkyIelJFRl2Lpzl9ubIgRW1GNADpQQpx2pOV8AYJ73 pRoutLCLQyHYJ6mbdQMFW9P0HfeTTbMwlPBtYfjyR4iDSSBZSpc/e4pn+n7Hd2oQD5N3be Zy6EcalbTJ1eh2+gSarUnnWfQ5jgw8lFry0M8+KjL2UZx+llFQHC3Et492j70A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wnjdl1HVvzVxV; Mon, 19 Aug 2024 19:41: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 47JJfV8V017832; Mon, 19 Aug 2024 19:41:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47JJfVfv017829; Mon, 19 Aug 2024 19:41:31 GMT (envelope-from git) Date: Mon, 19 Aug 2024 19:41:31 GMT Message-Id: <202408191941.47JJfVfv017829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 4132c4be4c0a - main - bsd-family-tree: add FreeBSD Documentation Archive List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4132c4be4c0a4b80a4ef6f4b8ff0d8ac9a3b9939 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=4132c4be4c0a4b80a4ef6f4b8ff0d8ac9a3b9939 commit 4132c4be4c0a4b80a4ef6f4b8ff0d8ac9a3b9939 Author: Wolfram Schneider AuthorDate: 2024-08-19 19:40:34 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-19 19:40:34 +0000 bsd-family-tree: add FreeBSD Documentation Archive --- share/misc/bsd-family-tree | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 24de0a603731..4f9ee8d438d8 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -936,6 +936,9 @@ URL: https://www.FreeBSD.org/releases/ Manual pages for FreeBSD and ports URL: https://man.FreeBSD.org +FreeBSD Documentation Archive +URL: https://docs-archive.freebsd.org/doc/ + UNIX history graphing project URL: https://minnie.tuhs.org/Unix_History/index.html From nobody Tue Aug 20 09:02:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pb1G91z5Sj1W; Tue, 20 Aug 2024 09:02: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 4Wp3PZ6fz4z4v7k; Tue, 20 Aug 2024 09:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3HZSZzbsC4iJlyWRaY7aA5/TPpXGpBsdkTVIDQuqoA=; b=ucTCEQrmJSat55sktwj3tj5dUuEwl7q0sz7f5rql4iZ+s81YHj0iYr8ROzv24BgkhGUuiU Jir6HuV1YwZ0l/j4osBD1ntw44UbpKZwxpsvSQrbvDg8HxvHO/3TRBPYU0ax+ELlAxJFcF cC1O+RVrm1yCD0Xgcpp9/yIzFRtCYXOml83t1emhAZI6qNyshtPwLOIsIPoZJGiLVUT3nv Umr73DQZ4BrceC32nfKsMxxd8cFAXa0rWyaG/Ezf07zYk99Wom5vHsYVYtJrtcoTOOiann j5gi5H6KiG3kzlFo99WzfFoyP20S+zsuupCjUAUoQ2w0bALRZDzpCzNIueDoLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144530; a=rsa-sha256; cv=none; b=Bnj6V5ycgn2a2VEi3DKRjm8tfax04nLn7wa99wkLIdRBP23chUkorsrIaubZaoeIf743MA ACpxoSGAWODd5GcOw779I5uluj533gmJvQ8kD1sdbTMNAuBrVQ654t277s1iXHUmIN5G/x OXBrHqF2QHgZv5pgQlIGoXcS6+HuA/VkG/p4P2pfz4cn4v/FkUBjz0vj4xvOaTKpxHXRbr BsRq1BYjZwL5hDHOB/G0sXNjNlgl6Cghj0CsfEBloIMk3cW98Y58w1Z10KBe+kduOxJDcm sIkSkikY2mSBTB1XOmiv5SROKD4n3ZYPk6JhkBreXrOwckzN+ODcZXx/HZvuLQ== 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=1724144530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3HZSZzbsC4iJlyWRaY7aA5/TPpXGpBsdkTVIDQuqoA=; b=qgSgZchUh52QdnGFgbcZAQG6HP0t1hzhWZq5JZ4GRsvrqSGGqWILpg554sqAJf5goEkkdH HQGx5NIcZw7BHSCJXRsdCsQE1a16Qkvflg3q4NMUL7zg0Coa6R5EK7JhgpIrTl4qEPe47q F43JBUKViDzsa3OPmK9Vsjh99ReGrgvcgYNQu2AdM57IdyOGrBIZJIUQqx/uC2WnZYTmHE H701I96jUo6Ru7QVckd3wCoJ211532uQxUzQ+lCWT8KfI5UhEF7fhVA7SVRVjyazlQ93gs m1T/Q8OwkNy/59gE2ddbb5eXEonbcrz5UivbDwjQ5xo67cWxB8KDYklqFVkU7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3PZ6CKqztc3; Tue, 20 Aug 2024 09:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92AY2078041; Tue, 20 Aug 2024 09:02:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92A37078038; Tue, 20 Aug 2024 09:02:10 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:10 GMT Message-Id: <202408200902.47K92A37078038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 12a6257a9600 - main - sys/conf: Introduce NOSAN_CFLAGS and NOSAN_C List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12a6257a96007222e5441d883709fca2a28febb5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=12a6257a96007222e5441d883709fca2a28febb5 commit 12a6257a96007222e5441d883709fca2a28febb5 Author: Andrew Turner AuthorDate: 2024-08-19 12:53:27 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 sys/conf: Introduce NOSAN_CFLAGS and NOSAN_C To simplify disabling the kernel sanitizers in some files add NOSAN_CFLAGS and NOSAN_C variables. These are CFLAGS and NORMAL_C with the sanitizer flags removed. While here add MSAN_CFLAGS to simplify keeping KMSAN in kern_kcov.c Reviewed by: khng, brooks, imp, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45498 --- sys/conf/files | 10 +++++----- sys/conf/files.arm64 | 6 +++--- sys/conf/kern.mk | 2 ++ sys/conf/kern.post.mk | 6 +++--- sys/conf/kern.pre.mk | 9 +++++++-- sys/conf/kmod.mk | 4 ++-- sys/modules/linux64/Makefile | 3 +-- sys/modules/vmm/Makefile | 15 ++++++--------- 8 files changed, 29 insertions(+), 26 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index df4c702540ae..6445f00e2801 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3811,7 +3811,7 @@ kern/kern_idle.c standard kern/kern_intr.c standard kern/kern_jail.c standard kern/kern_kcov.c optional kcov \ - compile-with "${NORMAL_C:N-fsanitize*} ${NORMAL_C:M-fsanitize=kernel-memory}" + compile-with "${NOSAN_C} ${MSAN_CFLAGS}" kern/kern_khelp.c standard kern/kern_kthread.c standard kern/kern_ktr.c optional ktr @@ -3879,7 +3879,7 @@ kern/stack_protector.c standard \ kern/subr_acl_nfs4.c optional ufs_acl | zfs kern/subr_acl_posix1e.c optional ufs_acl kern/subr_asan.c optional kasan \ - compile-with "${NORMAL_C:N-fsanitize*:N-fstack-protector*}" + compile-with "${NOSAN_C:N-fstack-protector*}" kern/subr_autoconf.c standard kern/subr_blist.c standard kern/subr_boot.c standard @@ -3891,10 +3891,10 @@ kern/subr_clock.c standard kern/subr_compressor.c standard \ compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd" kern/subr_coverage.c optional coverage \ - compile-with "${NORMAL_C:N-fsanitize*:N-fno-sanitize*}" + compile-with "${NOSAN_C}" kern/subr_counter.c standard kern/subr_csan.c optional kcsan \ - compile-with "${NORMAL_C:N-fsanitize*:N-fstack-protector*}" + compile-with "${NOSAN_C:N-fstack-protector*}" kern/subr_devstat.c standard kern/subr_disk.c standard kern/subr_early.c standard @@ -3914,7 +3914,7 @@ kern/subr_mchain.c optional libmchain kern/subr_memdesc.c standard kern/subr_module.c standard kern/subr_msan.c optional kmsan \ - compile-with "${NORMAL_C:N-fsanitize*:N-fno-sanitize*:N-fstack-protector*}" + compile-with "${NOSAN_C:N-fstack-protector*}" kern/subr_msgbuf.c standard kern/subr_param.c standard kern/subr_pcpu.c standard diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 0ff18cc6dd99..0688aabb562b 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -81,7 +81,7 @@ arm64/arm64/trap.c standard arm64/arm64/uio_machdep.c standard arm64/arm64/undefined.c standard arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack \ - compile-with "${NORMAL_C:N-fsanitize*:N-fno-sanitize*}" + compile-with "${NOSAN_C}" arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard @@ -124,10 +124,10 @@ arm64/vmm/vmm_arm64.c optional vmm arm64/vmm/vmm_reset.c optional vmm arm64/vmm/vmm_call.S optional vmm arm64/vmm/vmm_hyp_exception.S optional vmm \ - compile-with "${NORMAL_C:N-fsanitize*:N-fno-sanitize*:N-mbranch-protection*} -fpie" \ + compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ no-obj arm64/vmm/vmm_hyp.c optional vmm \ - compile-with "${NORMAL_C:N-fsanitize*:N-fno-sanitize*:N-mbranch-protection*} -fpie" \ + compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ no-obj vmm_hyp_blob.elf.full optional vmm \ dependency "vmm_hyp.o vmm_hyp_exception.o" \ diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 106f09d80ac1..93187d93ac63 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -294,6 +294,8 @@ CSTD?= gnu99 CFLAGS+= -std=${CSTD} .endif # CSTD +NOSAN_CFLAGS= ${CFLAGS:N-fsanitize*:N-fno-sanitize*:N-fasan-shadow-offset*} + # Please keep this if in sync with bsd.sys.mk .if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 5760ebd987f1..5f6ec2db498d 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -245,21 +245,21 @@ offset.inc: $S/kern/genoffset.sh genoffset.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > ${.TARGET} genoffset.o: $S/kern/genoffset.c - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} \ + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} \ -fcommon $S/kern/genoffset.c # genoffset_test.o is not actually used for anything - the point of compiling it # is to exercise the CTASSERT that checks that the offsets in the offset.inc # _lite struct(s) match those in the original(s). genoffset_test.o: $S/kern/genoffset.c offset.inc - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} \ + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} \ -fcommon -DOFFSET_TEST $S/kern/genoffset.c -o ${.TARGET} assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: $S/$M/$M/genassym.c offset.inc - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} \ + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} \ -fcommon $S/$M/$M/genassym.c OBJS_DEPEND_GUESS+= opt_global.h diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 4d626cdd2aad..e787d023d9a9 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -129,11 +129,12 @@ KMSAN_ENABLED!= grep KMSAN opt_global.h || true ; echo .if !empty(KMSAN_ENABLED) # Disable -fno-sanitize-memory-param-retval until interceptors have been # updated to work properly with it. -SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \ +MSAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \ -fsanitize=kernel-memory .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 160000 -SAN_CFLAGS+= -fno-sanitize-memory-param-retval +MSAN_CFLAGS+= -fno-sanitize-memory-param-retval .endif +SAN_CFLAGS+= ${MSAN_CFLAGS} .endif KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo @@ -212,6 +213,10 @@ NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \ $S/kern/firmw.S -DFIRMW_FILE=\""${.ALLSRC:M*.fw}"\" \ -DFIRMW_SYMBOL="${.ALLSRC:M*.fw:C/[-.\/]/_/g}" +# Remove sanitizer arguments. Some -fno-sanitize* and -fasan-shadow-offset* +# arguments become an error if the appropriate sanitizer is not enabled. +NOSAN_C= ${NORMAL_C:N-fsanitize*:N-fno-sanitize*:N-fasan-shadow-offset*} + # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \ -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \ diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index ed186619434d..4dc66c69d67b 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -526,13 +526,13 @@ assym.inc: ${SYSDIR}/kern/genassym.sh sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc genassym.o: ${SRCS:Mopt_*.h} - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} -fcommon \ + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon \ ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET} genoffset.o: ${SYSDIR}/kern/genoffset.c genoffset.o: ${SRCS:Mopt_*.h} - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} -fcommon \ + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon \ ${SYSDIR}/kern/genoffset.c CLEANDEPENDFILES+= ${_ILINKS} diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index d558319f3ba2..b23891a65a4f 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -89,8 +89,7 @@ linux_support.o: linux_support.S assym.inc linux_assym.h ${.ALLSRC:M*.S:u} -o ${.TARGET} linux_genassym.o: offset.inc - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} \ - -fcommon ${.IMPSRC} + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon ${.IMPSRC} .if !defined(KERNBUILDDIR) .warning Building Linuxulator outside of a kernel does not make sense diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 88586a39bf96..055ae0df3a65 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -44,12 +44,11 @@ CLEANFILES+= vmm_hyp_blob.elf vmm_hyp_blob.bin vmm_hyp_exception.o: vmm_hyp_exception.S ${CC} -c -x assembler-with-cpp -DLOCORE \ - ${CFLAGS:N-fsanitize*:N-fno-sanitize*:N-mbranch-protection*} \ - ${.IMPSRC} -o ${.TARGET} -fpie + ${NOSAN_CFLAGS:N-mbranch-protection*} ${.IMPSRC} -o ${.TARGET} -fpie vmm_hyp.o: vmm_hyp.c - ${CC} -c ${CFLAGS:N-fsanitize*:N-fno-sanitize*:N-mbranch-protection*} \ - ${.IMPSRC} -o ${.TARGET} -fpie + ${CC} -c ${NOSAN_CFLAGS:N-mbranch-protection*} ${.IMPSRC} \ + -o ${.TARGET} -fpie vmm_hyp_blob.elf.full: vmm_hyp_exception.o vmm_hyp.o ${LD} -m ${LD_EMULATION} -Bdynamic -L ${SYSDIR}/conf -T ${SYSDIR}/conf/ldscript.arm64 \ @@ -135,14 +134,12 @@ svm_support.o: ${.IMPSRC} -o ${.TARGET} hyp_genassym.o: offset.inc - ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} + ${CC} -c ${NOSAN_CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} vmx_genassym.o: offset.inc - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} \ - -fcommon ${.IMPSRC} + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon ${.IMPSRC} svm_genassym.o: offset.inc - ${CC} -c ${CFLAGS:N-flto*:N-fno-common:N-fsanitize*:N-fno-sanitize*} \ - -fcommon ${.IMPSRC} + ${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} -fcommon ${.IMPSRC} .include From nobody Tue Aug 20 09:02:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pc0tN5z5Sj66; Tue, 20 Aug 2024 09:02: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 4Wp3Pc06RYz4vMQ; Tue, 20 Aug 2024 09:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1xtxGfvbv1v2TOfro+NGN9VR+nIyc9uZb3nbmv3eh3Y=; b=Ge6j4BEk3Acuu4kNpGr5p2pYRJwpjACgpnYDr3Vm7UtBY3gziegtob9ZP9V4NdguJba0RC EF5d8vU0iw/b8nu7CAh9T7H4DtBtRKS0Gl6VDS2RU4cs2HIinyrJ9j3rbfhtnJRq9qFJN0 43ry9sB7lvQwuaDbqIdBvVCIl3qrNpVMhyhUkwPVfbttv9a/yhIY76PdCauOPdmEEc6E7v SbbRIhTlITVTEM1p6VZiNYooRslGoWGc/3ZcI2HhhjRC1afxUIk/oFT+UU6W51YG/XwAEn bEMOg5dAdnMkJSeQ6NeULqeRfX4rf680BrTjeFRjUOv9ZxhYckbw7PYUy5HG4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144532; a=rsa-sha256; cv=none; b=f71/bzlEsQU54j/LEpDM/SiXSpNUQb9IG390Lv0YcRlQGLDHD8W0ciAgnCfv1deoPp3+bv 1G/bEOCoRNxcNSzuYX8HoJGOgEHsd8atnhHTZr56DN3+pDCbodlK84osLrHcuJkbKzOOUc nd/Ko9/ufTYnpAwU/OykBDMFVhURqKAt2UoPBMBvo5ID8K1/x/LWtTE0k3mulGV3rMP5AO UpNwmgSJ7s2H/vQY0d0YaWWw6PIC4N7xHcvXfwySAEVRPGhnSQmuyKxBCEsEtD6W1pbQqH fhwVlYJXVgfUTDfsQHdWG3IVg6UYwDvffMqf0Te3BN8CdC7yXo9X+bRZncfzVw== 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=1724144532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1xtxGfvbv1v2TOfro+NGN9VR+nIyc9uZb3nbmv3eh3Y=; b=QYCDLLEtN8BVdgLPq71lrkc1+mwxTeCGe4z6RZPjn5a135BbjtRoIXeVA+ANQTEnC/OMFj VpCkAbRC7GQ0GfnQeG3Gxgoll9L6aej9tcxkPXCpODE4+jsqlmvsewIWciYGBUVAXSQKr6 K6UgQZqxSbhoGicgYCZKqOD+1jMDa4npr+k69IxPO6JVFZaVOHZOvAkeGqUoiFZt6yfJyo XYMOW4eVkedCR0LvxFTM3eQ9ukbQZyI292eddUsHQGfcZHV527uXxMvgtQs8+3ADXhXRSa 1oLUgdMLFRPxggBOQa3vtZnPo6vJqhT6PJN0S2ZuO9KJms33TkRy1fdf5n862g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pb6r5pztfm; Tue, 20 Aug 2024 09:02: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 47K92BJI078099; Tue, 20 Aug 2024 09:02:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92BsJ078096; Tue, 20 Aug 2024 09:02:11 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:11 GMT Message-Id: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 43e8849bc294 - main - conf: Enable BTI checking in the arm64 kernel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43e8849bc29414036ccaef7788de95a07ad32ab5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=43e8849bc29414036ccaef7788de95a07ad32ab5 commit 43e8849bc29414036ccaef7788de95a07ad32ab5 Author: Andrew Turner AuthorDate: 2024-08-19 12:59:49 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 conf: Enable BTI checking in the arm64 kernel To ensure new code has BTI support make it an error to not have the BTI ELF note when linking the kernel and kernel modules. Reviewed by: kib, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45469 --- sys/conf/kern.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 93187d93ac63..079bd1173fad 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -143,6 +143,9 @@ CFLAGS += -mgeneral-regs-only CFLAGS += -ffixed-x18 # Build with BTI+PAC CFLAGS += -mbranch-protection=standard +.if ${LINKER_TYPE} == "lld" +LDFLAGS += -Wl,-zbti-report=error +.endif # TODO: support outline atomics CFLAGS += -mno-outline-atomics INLINE_LIMIT?= 8000 From nobody Tue Aug 20 09:02:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pd4Qq2z5Shxc; Tue, 20 Aug 2024 09:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pd1kKFz4vPl; Tue, 20 Aug 2024 09:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TR2i+SftWEvkGiJL5DYY8DgWRcAhtvz+tN86g9aej3w=; b=JynR6WSG0F+TphzVYCjlPp7AjTGzsZ51ghkqzJeQVe1SqKyTWAPPlUnN9YWLWInpTTmtXd ED96l6DkA3C1pHHMFrPyBNpE18GCpBGWHUGqTfMwS1SKvqnwpp01pltbykZsJEEL8CSR0a eF25gm0fqm5xpOtYwLaU3Igpw1AfR+AOIU/eNd7tHaN1nD1MwcTLW7RmK+7jAQiFX8Xw9U v3u+Sz4ChyeQ8VjOuftWlGx5YvkalsX59t+cGDfDbUXqTcVxfQhaa7oaQlK7+pjn48sWgb u09a8bvvX06UotMy2TGK8849mDI3MDg1xfeuQElHtReAUNw6vVssjssrCPBX3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144533; a=rsa-sha256; cv=none; b=glnHZNDLJFCFQR7VYbYW8Try1vv0Ay9x1rmC91imJH65PrWKVhnYLTjeTI/wjrCG6XhXnr FV2djn6eXofNKSN6PlJnPJZtou5znRfYFoEIaJMK/iVahbgopYf3FotHA8ru7LCEEam7Vk pDgWv4ZFo0EWsQ7P7sR3xVU7dLQFf220+z3BjRbgyzwDJUUjg1e0UVyTt3I7UBR6sO2lY9 KkRS6NpEr/n1Dqx+FISvIMzrFVpB6/+PkySoyVAfxWvTCiVVGKUqHNebP/03cce5bZb/9i j3BDKaz1q5EAL5lnv6yc+mYnx2m7NpixhfWIWn+5if+Oagtz65pVIEXWz6SWQQ== 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=1724144533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TR2i+SftWEvkGiJL5DYY8DgWRcAhtvz+tN86g9aej3w=; b=mHPC5LQzkjhyrAY20JXtidEeXbug7PyFRWXzsrDUkpowBfQaMWN2kihRZIYBEhMV8s9aRm K8aqgoed2niU0eX0zVctR1NgKlJIfn2CzYVg99otFlqz9RhszzdkRKUBq9xTCORuB9GEKV MgmT//FSI6zqnWx7HavnDHZSW3NPLvn96Ca3N2MoOUQN/EvuJDEFh21v8VIpzEaUa4qvJf 8dGQocUOhvgqLTO8DKetqpdAGf4EcRTVcZHWmJFOiEcrzy15E4shCrQb1Mta2Q7sDUiX4V tuLq7N1tztNqPDZ0Rzk+AHSwov6ZwiAxonwWgpAmfjpc8NgzUfu83b4W+9KydA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pd13KFztys; Tue, 20 Aug 2024 09:02: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 47K92Dtj078147; Tue, 20 Aug 2024 09:02:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92Di3078144; Tue, 20 Aug 2024 09:02:13 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:13 GMT Message-Id: <202408200902.47K92Di3078144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4db15ab2c65e - main - arm64: Add counter timer registers to armreg.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4db15ab2c65e60f4d49d40ad6922ca301b184510 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4db15ab2c65e60f4d49d40ad6922ca301b184510 commit 4db15ab2c65e60f4d49d40ad6922ca301b184510 Author: Andrew Turner AuthorDate: 2024-08-19 12:43:05 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64: Add counter timer registers to armreg.h Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46071 --- sys/arm64/include/armreg.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index b2ab472dad0d..ce21bf4de0a9 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -231,6 +231,22 @@ #define CLIDR_CTYPE_ID 0x3 /* Split instruction and data */ #define CLIDR_CTYPE_UNIFIED 0x4 /* Unified */ +/* CNTKCTL_EL1 - Counter-timer Kernel Control Register */ +#define CNTKCTL_EL1 MRS_REG(CNTKCTL_EL0) +#define CNTKCTL_EL1_op0 3 +#define CNTKCTL_EL1_op1 0 +#define CNTKCTL_EL1_CRn 14 +#define CNTKCTL_EL1_CRm 1 +#define CNTKCTL_EL1_op2 0 + +/* CNTKCTL_EL12 - Counter-timer Kernel Control Register */ +#define CNTKCTL_EL12 MRS_REG(CNTKCTL_EL0) +#define CNTKCTL_EL12_op0 3 +#define CNTKCTL_EL12_op1 5 +#define CNTKCTL_EL12_CRn 14 +#define CNTKCTL_EL12_CRm 1 +#define CNTKCTL_EL12_op2 0 + /* CNTP_CTL_EL0 - Counter-timer Physical Timer Control register */ #define CNTP_CTL_EL0 MRS_REG(CNTP_CTL_EL0) #define CNTP_CTL_EL0_op0 3 @@ -266,6 +282,38 @@ #define CNTPCT_EL0_CRm 0 #define CNTPCT_EL0_op2 1 +/* CNTV_CTL_EL0 - Counter-timer Virtual Timer Control register */ +#define CNTV_CTL_EL0 MRS_REG(CNTV_CTL_EL0) +#define CNTV_CTL_EL0_op0 3 +#define CNTV_CTL_EL0_op1 3 +#define CNTV_CTL_EL0_CRn 14 +#define CNTV_CTL_EL0_CRm 3 +#define CNTV_CTL_EL0_op2 1 + +/* CNTV_CTL_EL02 - Counter-timer Virtual Timer Control register */ +#define CNTV_CTL_EL02 MRS_REG(CNTV_CTL_EL02) +#define CNTV_CTL_EL02_op0 3 +#define CNTV_CTL_EL02_op1 5 +#define CNTV_CTL_EL02_CRn 14 +#define CNTV_CTL_EL02_CRm 3 +#define CNTV_CTL_EL02_op2 1 + +/* CNTV_CVAL_EL0 - Counter-timer Virtual Timer CompareValue register */ +#define CNTV_CVAL_EL0 MRS_REG(CNTV_CVAL_EL0) +#define CNTV_CVAL_EL0_op0 3 +#define CNTV_CVAL_EL0_op1 3 +#define CNTV_CVAL_EL0_CRn 14 +#define CNTV_CVAL_EL0_CRm 3 +#define CNTV_CVAL_EL0_op2 2 + +/* CNTV_CVAL_EL02 - Counter-timer Virtual Timer CompareValue register */ +#define CNTV_CVAL_EL02 MRS_REG(CNTV_CVAL_EL02) +#define CNTV_CVAL_EL02_op0 3 +#define CNTV_CVAL_EL02_op1 5 +#define CNTV_CVAL_EL02_CRn 14 +#define CNTV_CVAL_EL02_CRm 3 +#define CNTV_CVAL_EL02_op2 2 + /* CONTEXTIDR_EL1 - Context ID register */ #define CONTEXTIDR_EL1 MRS_REG(CONTEXTIDR_EL1) #define CONTEXTIDR_EL1_REG MRS_REG_ALT_NAME(CONTEXTIDR_EL1) From nobody Tue Aug 20 09:02:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pf4kvzz5Shxd; Tue, 20 Aug 2024 09:02: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 4Wp3Pf2ZWWz4vMZ; Tue, 20 Aug 2024 09:02:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lLVKYSsWcdXOf8CAdSDINLlj7CDouAX9OnA5tXJHKw=; b=vQ0N+3f6nQYX4fznykESPcbz52CQkQNgXS0IfPHVlKqUhetgpFW8qZk5bC/NgY2nPoGSH0 ghT+W/wQD/0R1KRf7izLEJFstP8GfdopaRIw8EJgpKlpCLaCIXde48ovKQgmLTZ6qvBImU mmlVbkjM3uX0FURzQ5zUGl0DFtcrpbIz5aXYFqbpYa7Yo6cb1UcuMfKgDqckjyuKTu5Ab9 IhRll6wJ4HzboszplmrRN3ynBfMar9zKiiSkoPNNtE1mfZn0vhY/kMQ7Kc/5d4jg67R4L5 MxxhRbWqWPjde+9+4i5W7aLnnCUzHJWsZT5K1UGdkWm9Tl4a+knWbFK2eMK/XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144534; a=rsa-sha256; cv=none; b=AiP0/4IWD70xRl2IproyS7oiGyHaRgCBxe3OJmwDx8xx4F7Hju8W1aTnH+v7int48sOgIm RyecR2YLmdVrs6seSbsHzkQwkwGKwbusqYVL+Vy+SZ+dCVymlMiWfW2CUcx9YeNuu7b2iP o38UevYOlpZWoYCe3vt7JfMhkr+fB3G3LMyTTDaOxwOtn1+Y4v8UImadt0sGKepm6Jeq9z 52e7r09z6HQD0tLPyoxxCXNFIpAyQdSiOPqC46oMzJdMWwCmFvNJdSnXjtw4hSnTFSLbav Tslvi+EvSwW/XXyfDFhbUKv0RwZdZWfqMPdnvtQBKlBeKRzLT7Y5tqGsUXm5qA== 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=1724144534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lLVKYSsWcdXOf8CAdSDINLlj7CDouAX9OnA5tXJHKw=; b=UYOzEz2g22bPY3dipqKe0IP21wXBAKxApujKPQivQoOnIGF9NKMFzro6HFGwaQupOyGc33 uswgMoxFWZpqDOGoH5oAeZQqQJ3VspB9w7jPvd/BHKXgmPR412Xhoyr0uTlREpLh88iqJ+ Az0bLav4QNRJqaC1FmIC03UHP1Z31ciDzhzdLLzbvkViW+G0S/awCKwv+FwJS8iVjGZNv5 gWGJeJmdBVs2QSONGOABNVKryMmPmMg09aJTUfg7b42qf5Z+/AIqq1lI+Xdsvn2WEwPLZl GOxsIUnx9khFIxkOYdPJCkUlIW+8LWKa7LY/JmexJyfOIf+EPeuiaoYvT9HkkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pf274fztfn; Tue, 20 Aug 2024 09:02:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92EPQ078201; Tue, 20 Aug 2024 09:02:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92ES7078198; Tue, 20 Aug 2024 09:02:14 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:14 GMT Message-Id: <202408200902.47K92ES7078198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3d61bcf1eb84 - main - arm64/vmm: Start to extract code not needed by VHE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d61bcf1eb8403780418096e4f520573acad6c0d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3d61bcf1eb8403780418096e4f520573acad6c0d commit 3d61bcf1eb8403780418096e4f520573acad6c0d Author: Andrew Turner AuthorDate: 2024-08-19 12:43:22 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Start to extract code not needed by VHE We can share some of the vmm code between VHE and non-VHE modes. To support this create new files that include the common code and create macros to name what will be the common functions. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46072 --- sys/arm64/vmm/vmm_hyp.c | 58 ++++++++++++++++++++------------------ sys/arm64/vmm/vmm_hyp_exception.S | 6 ++-- sys/arm64/vmm/vmm_nvhe.c | 31 ++++++++++++++++++++ sys/arm64/vmm/vmm_nvhe_exception.S | 30 ++++++++++++++++++++ sys/conf/files.arm64 | 6 ++-- sys/modules/vmm/Makefile | 9 +++--- 6 files changed, 103 insertions(+), 37 deletions(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index 9ff250e798e7..1226876aa642 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -41,7 +41,7 @@ struct hypctx; uint64_t vmm_hyp_enter(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); -uint64_t vmm_enter_guest(struct hypctx *); +uint64_t VMM_HYP_FUNC(do_call_guest)(struct hypctx *); static void vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) @@ -496,7 +496,7 @@ vmm_hyp_call_guest(struct hyp *hyp, struct hypctx *hypctx) WRITE_SPECIALREG(mdcr_el2, hypctx->mdcr_el2); /* Call into the guest */ - ret = vmm_enter_guest(hypctx); + ret = VMM_HYP_FUNC(do_call_guest)(hypctx); WRITE_SPECIALREG(mdcr_el2, host_hypctx.mdcr_el2); isb(); @@ -566,8 +566,20 @@ vmm_hyp_call_guest(struct hyp *hyp, struct hypctx *hypctx) return (ret); } -static uint64_t -vmm_hyp_read_reg(uint64_t reg) +VMM_STATIC uint64_t +VMM_HYP_FUNC(enter_guest)(struct hyp *hyp, struct hypctx *hypctx) +{ + uint64_t ret; + + do { + ret = vmm_hyp_call_guest(hyp, hypctx); + } while (ret == EXCP_TYPE_REENTER); + + return (ret); +} + +VMM_STATIC uint64_t +VMM_HYP_FUNC(read_reg)(uint64_t reg) { switch (reg) { case HYP_REG_ICH_VTR: @@ -579,18 +591,16 @@ vmm_hyp_read_reg(uint64_t reg) return (0); } -static int -vmm_clean_s2_tlbi(void) +VMM_STATIC void +VMM_HYP_FUNC(clean_s2_tlbi)(void) { dsb(ishst); __asm __volatile("tlbi alle1is"); dsb(ish); - - return (0); } -static int -vm_s2_tlbi_range(uint64_t vttbr, vm_offset_t sva, vm_size_t eva, +VMM_STATIC void +VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, bool final_only) { uint64_t end, r, start; @@ -634,12 +644,10 @@ vm_s2_tlbi_range(uint64_t vttbr, vm_offset_t sva, vm_size_t eva, /* Switch back t othe host vttbr */ WRITE_SPECIALREG(vttbr_el2, host_vttbr); isb(); - - return (0); } -static int -vm_s2_tlbi_all(uint64_t vttbr) +VMM_STATIC void +VMM_HYP_FUNC(s2_tlbi_all)(uint64_t vttbr) { uint64_t host_vttbr; @@ -656,8 +664,6 @@ vm_s2_tlbi_all(uint64_t vttbr) /* Switch back t othe host vttbr */ WRITE_SPECIALREG(vttbr_el2, host_vttbr); isb(); - - return (0); } static int @@ -705,27 +711,25 @@ uint64_t vmm_hyp_enter(uint64_t handle, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6, uint64_t x7) { - uint64_t ret; - switch (handle) { case HYP_ENTER_GUEST: - do { - ret = vmm_hyp_call_guest((struct hyp *)x1, - (struct hypctx *)x2); - } while (ret == EXCP_TYPE_REENTER); - return (ret); + return (VMM_HYP_FUNC(enter_guest)((struct hyp *)x1, + (struct hypctx *)x2)); case HYP_READ_REGISTER: - return (vmm_hyp_read_reg(x1)); + return (VMM_HYP_FUNC(read_reg)(x1)); case HYP_CLEAN_S2_TLBI: - return (vmm_clean_s2_tlbi()); + VMM_HYP_FUNC(clean_s2_tlbi()); + return (0); case HYP_DC_CIVAC: return (vmm_dc_civac(x1, x2)); case HYP_EL2_TLBI: return (vmm_el2_tlbi(x1, x2, x3)); case HYP_S2_TLBI_RANGE: - return (vm_s2_tlbi_range(x1, x2, x3, x4)); + VMM_HYP_FUNC(s2_tlbi_range)(x1, x2, x3, x4); + return (0); case HYP_S2_TLBI_ALL: - return (vm_s2_tlbi_all(x1)); + VMM_HYP_FUNC(s2_tlbi_all)(x1); + return (0); case HYP_CLEANUP: /* Handled in vmm_hyp_exception.S */ default: break; diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index 9a9dc6901f40..3b9c08af97ac 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -349,12 +349,12 @@ LEND(handle_el2_el1_error64) /* * Usage: - * uint64_t vmm_enter_guest(struct hypctx *hypctx) + * uint64_t vmm_do_call_guest(struct hypctx *hypctx) * * Expecting: * x0 - hypctx address */ -ENTRY(vmm_enter_guest) +ENTRY(VMM_HYP_FUNC(do_call_guest)) /* Save hypctx address */ msr tpidr_el2, x0 @@ -363,7 +363,7 @@ ENTRY(vmm_enter_guest) /* Enter guest */ ERET -END(vmm_enter_guest) +END(VMM_HYP_FUNC(do_call_guest)) /* * Usage: diff --git a/sys/arm64/vmm/vmm_nvhe.c b/sys/arm64/vmm/vmm_nvhe.c new file mode 100644 index 000000000000..768e2132522d --- /dev/null +++ b/sys/arm64/vmm/vmm_nvhe.c @@ -0,0 +1,31 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define VMM_STATIC static +#define VMM_HYP_FUNC(func) vmm_nvhe_ ## func + +#include "vmm_hyp.c" diff --git a/sys/arm64/vmm/vmm_nvhe_exception.S b/sys/arm64/vmm/vmm_nvhe_exception.S new file mode 100644 index 000000000000..3bc0ff591399 --- /dev/null +++ b/sys/arm64/vmm/vmm_nvhe_exception.S @@ -0,0 +1,30 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define VMM_HYP_FUNC(func) vmm_nvhe_ ## func + +#include "vmm_hyp_exception.S" diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 0688aabb562b..10590d6c77e2 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -123,14 +123,14 @@ arm64/vmm/vmm_stat.c optional vmm arm64/vmm/vmm_arm64.c optional vmm arm64/vmm/vmm_reset.c optional vmm arm64/vmm/vmm_call.S optional vmm -arm64/vmm/vmm_hyp_exception.S optional vmm \ +arm64/vmm/vmm_nvhe_exception.S optional vmm \ compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ no-obj -arm64/vmm/vmm_hyp.c optional vmm \ +arm64/vmm/vmm_nvhe.c optional vmm \ compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ no-obj vmm_hyp_blob.elf.full optional vmm \ - dependency "vmm_hyp.o vmm_hyp_exception.o" \ + dependency "vmm_nvhe.o vmm_hyp_exception.o" \ compile-with "${SYSTEM_LD_BASECMD} -o ${.TARGET} ${.ALLSRC} --defsym=_start='0x0' --defsym=text_start='0x0'" \ no-obj no-implicit-rule vmm_hyp_blob.elf optional vmm \ diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 055ae0df3a65..409804f4e25c 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -38,19 +38,20 @@ SRCS+= vgic.c \ vgic_v3.c \ vtimer.c -CLEANFILES+= vmm_hyp_exception.o vmm_hyp.o +CLEANFILES+= vmm_nvhe_exception.o vmm_nvhe.o + CLEANFILES+= vmm_hyp_blob.elf.full CLEANFILES+= vmm_hyp_blob.elf vmm_hyp_blob.bin -vmm_hyp_exception.o: vmm_hyp_exception.S +vmm_nvhe_exception.o: vmm_nvhe_exception.S ${CC} -c -x assembler-with-cpp -DLOCORE \ ${NOSAN_CFLAGS:N-mbranch-protection*} ${.IMPSRC} -o ${.TARGET} -fpie -vmm_hyp.o: vmm_hyp.c +vmm_nvhe.o: vmm_nvhe.c ${CC} -c ${NOSAN_CFLAGS:N-mbranch-protection*} ${.IMPSRC} \ -o ${.TARGET} -fpie -vmm_hyp_blob.elf.full: vmm_hyp_exception.o vmm_hyp.o +vmm_hyp_blob.elf.full: vmm_nvhe_exception.o vmm_nvhe.o ${LD} -m ${LD_EMULATION} -Bdynamic -L ${SYSDIR}/conf -T ${SYSDIR}/conf/ldscript.arm64 \ ${_LDFLAGS:N-zbti-report*} --no-warn-mismatch --warn-common --export-dynamic \ --dynamic-linker /red/herring -X -o ${.TARGET} ${.ALLSRC} \ From nobody Tue Aug 20 09:02:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Ph054wz5Shs0; Tue, 20 Aug 2024 09:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pg3brfz4vN1; Tue, 20 Aug 2024 09:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ND6MQwyQAynHzswRlad2BZWRXS/kFFCDxmo2R5f8lJc=; b=mDDOeOgleNBbpYNxsX3qrelFTBMq7gjl8RfYphZvXLlN0xF38VhHz0DHf07DfIjyVl1hGz NzSQDaddqi97aFNAodAc1mAhxVhYeLNZiBiMGpWURwPT7HSvdyLnMSS+W68tIIBhKkui0H 4R+Vh0URHF6RqGwxhGNbOWVdJTAJRLsaEnfIE4rHoEBRaK2EEh49j5Da8ZIuVa+e6BWDr/ bdWgeWUXMM7LJHjQebK9l1bEnu6LK7TqUi7Kkce4pZpdPNldIk1fkPiHHImab3Zx7LMva0 IpXH6sgZWRaaZAcgC8R5vRpKpnEXst02Qaw8A/6ssV/o28eRRIioIAZ1+qmFcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144535; a=rsa-sha256; cv=none; b=bDNZZf0hDCaN1Zbs/VuwwyozcrZ0mNlDkPKGDP/UYLEXHOPm6TB819pO45yesTYpOfXgJ/ GFigAT21HST8AAlq27Zs9ZZpKDUl15Q1doOqnb8VKViDaoeunsH+tlGppREznXZhnGrKuW GBYAg2U8l/RZAeMNrTvuU5sHshRYuUXnWwOYWXmE9K7/wBMvVaFgK9ylOhSjRIWx9BvYYl SBA11qx0gnloBUqpPX4Tg8kPp5Kn/LsJVy+61VDWMsODyDoThRHEVoBTkiRv8fNyZmOjOa 5XO/7NhzvZKQ/meZj23uVcaiKoRdxKqcCMRZscXPrzUsqSkEmNC7KM5ZgVvFRA== 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=1724144535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ND6MQwyQAynHzswRlad2BZWRXS/kFFCDxmo2R5f8lJc=; b=K0bM7jBk1sglq56lvnx9Px+tTlkxxhtA+4Deg9xiRe1DjN37MkRvQkAGtbkM1J0cbRQXuS RfUUllZFzfDupsZqMW/TELPlH3q66OMKDSLUEKGifsp6y4rzOLKJ6RNXeu5MoMMX1Fw6/R wSOIYzlu3WvyovoAR8kvHnlWQIO+Tb/2RZ4sRYMVa+f8pBrpTxQstLi1A/ZbnJPBM1TY+8 prjc2jTJIKtrXKbTfxRG5qGiGLkA2I/GGx6fecS86x2EemRluuAHGVUTQ/9oqigwZchOWn jbhRY7JeI/7y46E5noJJPfPYnf88qtAi1pr+yceo0jPZqbkkV7YqSkhpbRbiZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pg38BYztly; Tue, 20 Aug 2024 09:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92FLu078252; Tue, 20 Aug 2024 09:02:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92Fda078249; Tue, 20 Aug 2024 09:02:15 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:15 GMT Message-Id: <202408200902.47K92Fda078249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4b6c9f84deb5 - main - arm64/vmm: Move nVHE-only code to the new file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b6c9f84deb53b111ccbcbea595b2cdd347ca7f9 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4b6c9f84deb53b111ccbcbea595b2cdd347ca7f9 commit 4b6c9f84deb53b111ccbcbea595b2cdd347ca7f9 Author: Andrew Turner AuthorDate: 2024-08-19 12:43:31 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Move nVHE-only code to the new file There are some functions that are only needed in non-VHE mode. These are used to handle hypervisor calls from the kernel, and to manage the page tables in EL2. As these won't be used by the VHE code we can move them to the non-VHE specific files. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46073 --- sys/arm64/vmm/vmm_hyp.c | 74 ------------------------------- sys/arm64/vmm/vmm_hyp_exception.S | 88 ------------------------------------- sys/arm64/vmm/vmm_nvhe.c | 83 +++++++++++++++++++++++++++++++++++ sys/arm64/vmm/vmm_nvhe_exception.S | 90 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 173 insertions(+), 162 deletions(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index 1226876aa642..92f8cd25251d 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -39,8 +39,6 @@ struct hypctx; -uint64_t vmm_hyp_enter(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, - uint64_t, uint64_t, uint64_t); uint64_t VMM_HYP_FUNC(do_call_guest)(struct hypctx *); static void @@ -665,75 +663,3 @@ VMM_HYP_FUNC(s2_tlbi_all)(uint64_t vttbr) WRITE_SPECIALREG(vttbr_el2, host_vttbr); isb(); } - -static int -vmm_dc_civac(uint64_t start, uint64_t len) -{ - size_t line_size, end; - uint64_t ctr; - - ctr = READ_SPECIALREG(ctr_el0); - line_size = sizeof(int) << CTR_DLINE_SIZE(ctr); - end = start + len; - dsb(ishst); - /* Clean and Invalidate the D-cache */ - for (; start < end; start += line_size) - __asm __volatile("dc civac, %0" :: "r" (start) : "memory"); - dsb(ish); - return (0); -} - -static int -vmm_el2_tlbi(uint64_t type, uint64_t start, uint64_t len) -{ - uint64_t end, r; - - dsb(ishst); - switch (type) { - default: - case HYP_EL2_TLBI_ALL: - __asm __volatile("tlbi alle2" ::: "memory"); - break; - case HYP_EL2_TLBI_VA: - end = TLBI_VA(start + len); - start = TLBI_VA(start); - for (r = start; r < end; r += TLBI_VA_L3_INCR) { - __asm __volatile("tlbi vae2is, %0" :: "r"(r)); - } - break; - } - dsb(ish); - - return (0); -} - -uint64_t -vmm_hyp_enter(uint64_t handle, uint64_t x1, uint64_t x2, uint64_t x3, - uint64_t x4, uint64_t x5, uint64_t x6, uint64_t x7) -{ - switch (handle) { - case HYP_ENTER_GUEST: - return (VMM_HYP_FUNC(enter_guest)((struct hyp *)x1, - (struct hypctx *)x2)); - case HYP_READ_REGISTER: - return (VMM_HYP_FUNC(read_reg)(x1)); - case HYP_CLEAN_S2_TLBI: - VMM_HYP_FUNC(clean_s2_tlbi()); - return (0); - case HYP_DC_CIVAC: - return (vmm_dc_civac(x1, x2)); - case HYP_EL2_TLBI: - return (vmm_el2_tlbi(x1, x2, x3)); - case HYP_S2_TLBI_RANGE: - VMM_HYP_FUNC(s2_tlbi_range)(x1, x2, x3, x4); - return (0); - case HYP_S2_TLBI_ALL: - VMM_HYP_FUNC(s2_tlbi_all)(x1); - return (0); - case HYP_CLEANUP: /* Handled in vmm_hyp_exception.S */ - default: - break; - } - - return (0); -} diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index 3b9c08af97ac..9a1648130f49 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -145,29 +145,6 @@ b handle_\name .endm - .section ".vmm_vectors","ax" - .align 11 -hyp_init_vectors: - vempty /* Synchronous EL2t */ - vempty /* IRQ EL2t */ - vempty /* FIQ EL2t */ - vempty /* Error EL2t */ - - vempty /* Synchronous EL2h */ - vempty /* IRQ EL2h */ - vempty /* FIQ EL2h */ - vempty /* Error EL2h */ - - vector hyp_init /* Synchronous 64-bit EL1 */ - vempty /* IRQ 64-bit EL1 */ - vempty /* FIQ 64-bit EL1 */ - vempty /* Error 64-bit EL1 */ - - vempty /* Synchronous 32-bit EL1 */ - vempty /* IRQ 32-bit EL1 */ - vempty /* FIQ 32-bit EL1 */ - vempty /* Error 32-bit EL1 */ - .text .align 11 hyp_vectors: @@ -191,50 +168,6 @@ hyp_vectors: vempty /* FIQ 32-bit EL1 */ vempty /* Error 32-bit EL1 */ -/* - * Initialize the hypervisor mode with a new exception vector table, translation - * table and stack. - * - * Expecting: - * x0 - translation tables physical address - * x1 - stack top virtual address - * x2 - TCR_EL2 value - * x3 - SCTLR_EL2 value - * x4 - VTCR_EL2 value - */ -LENTRY(handle_hyp_init) - /* Install the new exception vectors */ - adrp x6, hyp_vectors - add x6, x6, :lo12:hyp_vectors - msr vbar_el2, x6 - /* Set the stack top address */ - mov sp, x1 - /* Use the host VTTBR_EL2 to tell the host and the guests apart */ - mov x9, #VTTBR_HOST - msr vttbr_el2, x9 - /* Load the base address for the translation tables */ - msr ttbr0_el2, x0 - /* Invalidate the TLB */ - dsb ish - tlbi alle2 - dsb ishst - isb - /* Use the same memory attributes as EL1 */ - mrs x9, mair_el1 - msr mair_el2, x9 - /* Configure address translation */ - msr tcr_el2, x2 - isb - /* Set the system control register for EL2 */ - msr sctlr_el2, x3 - /* Set the Stage 2 translation control register */ - msr vtcr_el2, x4 - /* Return success */ - mov x0, #0 - /* MMU is up and running */ - ERET -LEND(handle_hyp_init) - .macro do_world_switch_to_host save_guest_registers restore_host_registers @@ -364,24 +297,3 @@ ENTRY(VMM_HYP_FUNC(do_call_guest)) /* Enter guest */ ERET END(VMM_HYP_FUNC(do_call_guest)) - -/* - * Usage: - * void vmm_cleanup(uint64_t handle, void *hyp_stub_vectors) - * - * Expecting: - * x1 - physical address of hyp_stub_vectors - */ -LENTRY(vmm_cleanup) - /* Restore the stub vectors */ - msr vbar_el2, x1 - - /* Disable the MMU */ - dsb sy - mrs x2, sctlr_el2 - bic x2, x2, #SCTLR_EL2_M - msr sctlr_el2, x2 - isb - - ERET -LEND(vmm_cleanup) diff --git a/sys/arm64/vmm/vmm_nvhe.c b/sys/arm64/vmm/vmm_nvhe.c index 768e2132522d..1127a6e37781 100644 --- a/sys/arm64/vmm/vmm_nvhe.c +++ b/sys/arm64/vmm/vmm_nvhe.c @@ -1,8 +1,12 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2021 Andrew Turner * Copyright (c) 2024 Arm Ltd * + * This work was supported by Innovate UK project 105694, "Digital Security + * by Design (DSbD) Technology Platform Prototype". + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -29,3 +33,82 @@ #define VMM_HYP_FUNC(func) vmm_nvhe_ ## func #include "vmm_hyp.c" + +uint64_t vmm_hyp_enter(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t, uint64_t, uint64_t); + +/* + * Handlers for EL2 addres space. Only needed by non-VHE code as in VHE the + * kernel is in EL2 so pmap will manage the address space. + */ +static int +vmm_dc_civac(uint64_t start, uint64_t len) +{ + size_t line_size, end; + uint64_t ctr; + + ctr = READ_SPECIALREG(ctr_el0); + line_size = sizeof(int) << CTR_DLINE_SIZE(ctr); + end = start + len; + dsb(ishst); + /* Clean and Invalidate the D-cache */ + for (; start < end; start += line_size) + __asm __volatile("dc civac, %0" :: "r" (start) : "memory"); + dsb(ish); + return (0); +} + +static int +vmm_el2_tlbi(uint64_t type, uint64_t start, uint64_t len) +{ + uint64_t end, r; + + dsb(ishst); + switch (type) { + default: + case HYP_EL2_TLBI_ALL: + __asm __volatile("tlbi alle2" ::: "memory"); + break; + case HYP_EL2_TLBI_VA: + end = TLBI_VA(start + len); + start = TLBI_VA(start); + for (r = start; r < end; r += TLBI_VA_L3_INCR) { + __asm __volatile("tlbi vae2is, %0" :: "r"(r)); + } + break; + } + dsb(ish); + + return (0); +} + +uint64_t +vmm_hyp_enter(uint64_t handle, uint64_t x1, uint64_t x2, uint64_t x3, + uint64_t x4, uint64_t x5, uint64_t x6, uint64_t x7) +{ + switch (handle) { + case HYP_ENTER_GUEST: + return (VMM_HYP_FUNC(enter_guest)((struct hyp *)x1, + (struct hypctx *)x2)); + case HYP_READ_REGISTER: + return (VMM_HYP_FUNC(read_reg)(x1)); + case HYP_CLEAN_S2_TLBI: + VMM_HYP_FUNC(clean_s2_tlbi()); + return (0); + case HYP_DC_CIVAC: + return (vmm_dc_civac(x1, x2)); + case HYP_EL2_TLBI: + return (vmm_el2_tlbi(x1, x2, x3)); + case HYP_S2_TLBI_RANGE: + VMM_HYP_FUNC(s2_tlbi_range)(x1, x2, x3, x4); + return (0); + case HYP_S2_TLBI_ALL: + VMM_HYP_FUNC(s2_tlbi_all)(x1); + return (0); + case HYP_CLEANUP: /* Handled in vmm_hyp_exception.S */ + default: + break; + } + + return (0); +} diff --git a/sys/arm64/vmm/vmm_nvhe_exception.S b/sys/arm64/vmm/vmm_nvhe_exception.S index 3bc0ff591399..17bc4cb70366 100644 --- a/sys/arm64/vmm/vmm_nvhe_exception.S +++ b/sys/arm64/vmm/vmm_nvhe_exception.S @@ -28,3 +28,93 @@ #define VMM_HYP_FUNC(func) vmm_nvhe_ ## func #include "vmm_hyp_exception.S" + + .section ".vmm_vectors","ax" + .align 11 +hyp_init_vectors: + vempty /* Synchronous EL2t */ + vempty /* IRQ EL2t */ + vempty /* FIQ EL2t */ + vempty /* Error EL2t */ + + vempty /* Synchronous EL2h */ + vempty /* IRQ EL2h */ + vempty /* FIQ EL2h */ + vempty /* Error EL2h */ + + vector hyp_init /* Synchronous 64-bit EL1 */ + vempty /* IRQ 64-bit EL1 */ + vempty /* FIQ 64-bit EL1 */ + vempty /* Error 64-bit EL1 */ + + vempty /* Synchronous 32-bit EL1 */ + vempty /* IRQ 32-bit EL1 */ + vempty /* FIQ 32-bit EL1 */ + vempty /* Error 32-bit EL1 */ + + .text + +/* + * Initialize the hypervisor mode with a new exception vector table, translation + * table and stack. + * + * Expecting: + * x0 - translation tables physical address + * x1 - stack top virtual address + * x2 - TCR_EL2 value + * x3 - SCTLR_EL2 value + * x4 - VTCR_EL2 value + */ +LENTRY(handle_hyp_init) + /* Install the new exception vectors */ + adrp x6, hyp_vectors + add x6, x6, :lo12:hyp_vectors + msr vbar_el2, x6 + /* Set the stack top address */ + mov sp, x1 + /* Use the host VTTBR_EL2 to tell the host and the guests apart */ + mov x9, #VTTBR_HOST + msr vttbr_el2, x9 + /* Load the base address for the translation tables */ + msr ttbr0_el2, x0 + /* Invalidate the TLB */ + dsb ish + tlbi alle2 + dsb ishst + isb + /* Use the same memory attributes as EL1 */ + mrs x9, mair_el1 + msr mair_el2, x9 + /* Configure address translation */ + msr tcr_el2, x2 + isb + /* Set the system control register for EL2 */ + msr sctlr_el2, x3 + /* Set the Stage 2 translation control register */ + msr vtcr_el2, x4 + /* Return success */ + mov x0, #0 + /* MMU is up and running */ + ERET +LEND(handle_hyp_init) + +/* + * Usage: + * void vmm_cleanup(uint64_t handle, void *hyp_stub_vectors) + * + * Expecting: + * x1 - physical address of hyp_stub_vectors + */ +LENTRY(vmm_cleanup) + /* Restore the stub vectors */ + msr vbar_el2, x1 + + /* Disable the MMU */ + dsb sy + mrs x2, sctlr_el2 + bic x2, x2, #SCTLR_EL2_M + msr sctlr_el2, x2 + isb + + ERET +LEND(vmm_cleanup) From nobody Tue Aug 20 09:02:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pj0F2wz5Sj69; Tue, 20 Aug 2024 09:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Ph4bbCz4vL2; Tue, 20 Aug 2024 09:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GdlMqGAxGfXnMzTTO1tv1qYed0AdK0BkFKGi5lBzIs=; b=kXdAvMh1xFYxFUc/zj3Ted5vDXe9O8HP3q4hsRLn2RyUlugBvRQfCiI7679B3Brh+2pifa eL8P4UEF+nP0EObtMmH+fRqMBSP81IJkASYMbDh43bZ08ODLn6UjXw2vfKOSDJoeq9erFg kcqxgWXmbzsz2StXF/NgWsYVtWEUAbutmer+Nlq5mG6V9gB+sSX2Y4tHYg9DaqJuDlLEqx KAlh7TU2jCyvXLvrBaBWnYJ7aHEUhY53/5Lay56cAZ8FZdjKxe+OKgpTgBoJrJNwEn9wlQ KRlpjvOuDCqxgaeCrZ2ABawOad56/MrhbSd4nWpvPHuyXnmPWHJtvyzv73NEqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144536; a=rsa-sha256; cv=none; b=IdW0kYmZb+7mSx/ggrvq7wuWk4tBMKEfLNgODnI6h7pNTcZd2bh7txNC6YqvJ4NGHHIfo+ fMsx0mmZkVL7fYnBflNiXSBFK8SXMTDGm2UxN3RMPYve4GSvLVYwKDMX+CriLBH7Kv/KSP xVYJlR7+VxESHz0Z8Kd96mBwD8rbVEfNGllbbEKSwASgWXNajlUBo5DDPY5TnATj5EGF3V rCP7KfkZn51sOSxTaHli2tgRARhJqRN22ltdOL5c7VwArXkA0n0bi7btVURbh1x4I4CLOr crWY2ErnmemXbcx2pyK65W7szdn3HC+H1ICLd5xskPfbcjlvhFlFmD9nzHJVQQ== 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=1724144536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GdlMqGAxGfXnMzTTO1tv1qYed0AdK0BkFKGi5lBzIs=; b=H1t9Y0jB5+nJxIYozC092cKtaN2x9IVlisHKijn2X79zeT+dJMzVeW8IQVPqFwXDyZ2iKa VIZttzfpifAXFKLB4zQhp9peH78vxfilXdGR1u4soX95/9Pphsuwsc+9w9CLnue+8oLK2p bhCOMwD3Aa4ovoN/yxTPxUviM0zWuzMhUR3p+ELcO/E22FdpJOEdAFu5Y1rJW7K95sYwn1 ikfSqCxKCeDvaCpjqTsGklSgpnY+Pq2CXRBe8YZQvpBHuXzf61/9vPkQkxIUm2fSfXX70r 1ZsxHNJQV4zroHT3cSn7UVgwu28Qj2Yw40W/vUV1mbNFTcclfyK3ioduoC6JHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Ph49pKztnm; Tue, 20 Aug 2024 09:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92GeE078297; Tue, 20 Aug 2024 09:02:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92GJk078294; Tue, 20 Aug 2024 09:02:16 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:16 GMT Message-Id: <202408200902.47K92GJk078294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a745cdc19b7f - main - arm64/vmm: Teach the vtimer about VHE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a745cdc19b7f92b490f7c332abad82945f3b06cb Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a745cdc19b7f92b490f7c332abad82945f3b06cb commit a745cdc19b7f92b490f7c332abad82945f3b06cb Author: Andrew Turner AuthorDate: 2024-08-19 12:43:37 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Teach the vtimer about VHE Teach the virtual timer about the cnthctl_el2 field layout under VHE. As with non-VHE we need to trap the physical timer and not trap the virtual timer. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46074 --- sys/arm64/include/hypervisor.h | 4 ++++ sys/arm64/vmm/io/vtimer.c | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 011f86e83fdf..4c501e2722a9 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -41,6 +41,10 @@ #define CNTHCTL_EL1PCTEN (1 << 0) /* Allow physical counter access */ #define CNTHCTL_EL1PCEN (1 << 1) /* Allow physical timer access */ /* Valid if HCR_EL2.E2H == 1 */ +#define CNTHCTL_E2H_EL0PCTEN (1 << 0) /* Allow EL0 physical counter access */ +#define CNTHCTL_E2H_EL0VCTEN (1 << 1) /* Allow EL0 virtual counter access */ +#define CNTHCTL_E2H_EL0VTEN (1 << 8) +#define CNTHCTL_E2H_EL0PTEN (1 << 9) #define CNTHCTL_E2H_EL1PCTEN (1 << 10) /* Allow physical counter access */ #define CNTHCTL_E2H_EL1PTEN (1 << 11) /* Allow physical timer access */ /* Unconditionally valid */ diff --git a/sys/arm64/vmm/io/vtimer.c b/sys/arm64/vmm/io/vtimer.c index aa0b3ff1588e..f59d7ebc1ad4 100644 --- a/sys/arm64/vmm/io/vtimer.c +++ b/sys/arm64/vmm/io/vtimer.c @@ -129,14 +129,42 @@ vtimer_vminit(struct hyp *hyp) { uint64_t now; + hyp->vtimer.cnthctl_el2 = cnthctl_el2_reg; + /* * Configure the Counter-timer Hypervisor Control Register for the VM. - * - * CNTHCTL_EL1PCEN: trap access to CNTP_{CTL, CVAL, TVAL}_EL0 from EL1 - * CNTHCTL_EL1PCTEN: trap access to CNTPCT_EL0 */ - hyp->vtimer.cnthctl_el2 = cnthctl_el2_reg & ~CNTHCTL_EL1PCEN; - hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_EL1PCTEN; + if (in_vhe()) { + /* + * CNTHCTL_E2H_EL0PCTEN: trap EL0 access to CNTP{CT,CTSS}_EL0 + * CNTHCTL_E2H_EL1VCTEN: don't trap EL0 access to + * CNTV{CT,CTSS}_EL0 + * CNTHCTL_E2H_EL0VTEN: don't trap EL0 access to + * CNTV_{CTL,CVAL,TVAL}_EL0 + * CNTHCTL_E2H_EL0PTEN: trap EL0 access to + * CNTP_{CTL,CVAL,TVAL}_EL0 + * CNTHCTL_E2H_EL1PCEN: trap EL1 access to + CNTP_{CTL,CVAL,TVAL}_EL0 + * CNTHCTL_E2H_EL1PCTEN: trap access to CNTPCT_EL0 + * + * TODO: Don't trap when FEAT_ECV is present + */ + hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_E2H_EL0PCTEN; + hyp->vtimer.cnthctl_el2 |= CNTHCTL_E2H_EL0VCTEN; + hyp->vtimer.cnthctl_el2 |= CNTHCTL_E2H_EL0VTEN; + hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_E2H_EL0PTEN; + + hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_E2H_EL1PTEN; + hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_E2H_EL1PCTEN; + } else { + /* + * CNTHCTL_EL1PCEN: trap access to CNTP_{CTL, CVAL, TVAL}_EL0 + * from EL1 + * CNTHCTL_EL1PCTEN: trap access to CNTPCT_EL0 + */ + hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_EL1PCEN; + hyp->vtimer.cnthctl_el2 &= ~CNTHCTL_EL1PCTEN; + } now = READ_SPECIALREG(cntpct_el0); hyp->vtimer.cntvoff_el2 = now; From nobody Tue Aug 20 09:02:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pk0qz0z5Shs6; Tue, 20 Aug 2024 09:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pj5L4kz4vTL; Tue, 20 Aug 2024 09:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z/QZ056/+HCO5UBZJCIMtsxM0wu7Lt6RiBpRPar8W74=; b=FbeF9fAhIKK3YKqa/90lEMwnRInvhZRyYE6siOZvFQu6eTXdeATv4n65YJX9K5EgAv18gC qEyiCozOELDvzHQ1bsoeKzTeNczjNoFka2KFl8xQ6k65yETyPqdrGEz9N3+het4H8+ieVA zpC3uvU5vA291yAU1TDn3fnQmsud9onUPQXpwFtQlwPZaPKPw8bQ9saviyCE9vY4JI0167 a3OXwcJ7uxNQgzdPmoIeP9N7WrEos6/9KAg816Qs+XWni6JonwUu8vVzH1Rkt5gIXL7mRl Vi2V/ezM1rPlX7SkYknaWAGsAwM7UQcLZyziwqujUovmfg8wUkvu/vSn1kMrMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144537; a=rsa-sha256; cv=none; b=cy7qAosb7a8IpIz6crkNsDxV8BPH5gHFfnn5B6IiMIcFjhKgGU4c48QLfMoF8IvNqkhRbj dKuTwSLVvzh3IW0M7kdJfjp2qcR7k+UMyhKW6Vnw0k50ZVAGdzJpFQ5NACHORpRJkWzUKp YzwNuParfdbxbysn1/V+ISyHJCzv1X6hlEelI4VWWSAvm4M5ak3n7YmsAFlnBXFOQbdqiI SvsdV9W8SzBDYpa8UqFoCnCh4YN000AuKayMH9kfordWn/MbfDaqqVEhdwoPkzarb+E5vP N0q4XmBYi61ORxe/fgoZT+/Yd7poUzHaj/7IaYVWRk/qZ7QpCmE1a55JqTVPQg== 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=1724144537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z/QZ056/+HCO5UBZJCIMtsxM0wu7Lt6RiBpRPar8W74=; b=DSv63990Xn8tvJkjtutss6FQiALYi7K2c++m26X3Yw+J3xyRDjfw+T57WHjHl2TM1v2A6O 8dbyJOlp1eX3qMsnHdNsNev+TNkrBkUN2+KKKNSv0tz52JI8NMrD7jPuY76qAsAbaGnnuY RVZz3ZEc+/8qhEbFJUS0L48E35jGMbcGBuYN21Q3Tf3mxmcewkZeuAAUpp3YuBm7bSBZ6L Uya3ouV+H+J9Qwfbag9BHGZNnimcFiVVp/R31kxPIehcCFhUFXH6lSESOYnDeSZX5FIyT7 tIH+AhQ4cQ+44mtc/QLi3izM06vNdABeTswNwuq6dtKxlcoWCaFNS0HU8Lp2gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pj4gRCztyy; Tue, 20 Aug 2024 09:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92H0P079817; Tue, 20 Aug 2024 09:02:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92HCT079798; Tue, 20 Aug 2024 09:02:17 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:17 GMT Message-Id: <202408200902.47K92HCT079798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 55aa31480ced - main - arm64/vmm: Create functions to call into EL2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55aa31480ced477610b7cb0a948af6e99fefe864 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=55aa31480ced477610b7cb0a948af6e99fefe864 commit 55aa31480ced477610b7cb0a948af6e99fefe864 Author: Andrew Turner AuthorDate: 2024-08-19 12:43:42 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Create functions to call into EL2 These will become ifuncs to enable VHE in a later change. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46075 --- sys/arm64/vmm/io/vgic_v3.c | 3 +- sys/arm64/vmm/vmm_arm64.c | 38 ++++---------------------- sys/arm64/vmm/vmm_handlers.c | 65 ++++++++++++++++++++++++++++++++++++++++++++ sys/arm64/vmm/vmm_handlers.h | 48 ++++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + sys/modules/vmm/Makefile | 1 + 6 files changed, 123 insertions(+), 33 deletions(-) diff --git a/sys/arm64/vmm/io/vgic_v3.c b/sys/arm64/vmm/io/vgic_v3.c index 7ed591c409ba..67afb3374815 100644 --- a/sys/arm64/vmm/io/vgic_v3.c +++ b/sys/arm64/vmm/io/vgic_v3.c @@ -68,6 +68,7 @@ #include #include #include +#include #include "vgic.h" #include "vgic_v3.h" @@ -2252,7 +2253,7 @@ vgic_v3_init(device_t dev) uint64_t ich_vtr_el2; uint32_t pribits, prebits; - ich_vtr_el2 = vmm_call_hyp(HYP_READ_REGISTER, HYP_REG_ICH_VTR); + ich_vtr_el2 = vmm_read_reg(HYP_REG_ICH_VTR); /* TODO: These fields are common with the vgicv2 driver */ pribits = ICH_VTR_EL2_PRIBITS(ich_vtr_el2); diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index e5eee47b405b..1b73ed019fad 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -65,6 +65,7 @@ #include "io/vgic.h" #include "io/vgic_v3.h" #include "io/vtimer.h" +#include "vmm_handlers.h" #include "vmm_stat.h" #define HANDLED 1 @@ -101,9 +102,6 @@ static vm_offset_t stack_hyp_va[MAXCPU]; static vmem_t *el2_mem_alloc; static void arm_setup_vectors(void *arg); -static void vmm_pmap_clean_stage2_tlbi(void); -static void vmm_pmap_invalidate_range(uint64_t, vm_offset_t, vm_offset_t, bool); -static void vmm_pmap_invalidate_all(uint64_t); DPCPU_DEFINE_STATIC(struct hypctx *, vcpu); @@ -235,7 +233,6 @@ vmmops_modinit(int ipinum) vm_paddr_t vmm_base; uint64_t id_aa64mmfr0_el1, pa_range_bits, pa_range_field; uint64_t cnthctl_el2; - register_t daif; int cpu, i; bool rv __diagused; @@ -291,9 +288,9 @@ vmmops_modinit(int ipinum) /* Set up the stage 2 pmap callbacks */ MPASS(pmap_clean_stage2_tlbi == NULL); - pmap_clean_stage2_tlbi = vmm_pmap_clean_stage2_tlbi; - pmap_stage2_invalidate_range = vmm_pmap_invalidate_range; - pmap_stage2_invalidate_all = vmm_pmap_invalidate_all; + pmap_clean_stage2_tlbi = vmm_clean_s2_tlbi; + pmap_stage2_invalidate_range = vmm_s2_tlbi_range; + pmap_stage2_invalidate_all = vmm_s2_tlbi_all; /* * Create an allocator for the virtual address space used by EL2. @@ -429,9 +426,7 @@ vmmops_modinit(int ipinum) vmem_add(el2_mem_alloc, next_hyp_va, HYP_VM_MAX_ADDRESS - next_hyp_va, M_WAITOK); - daif = intr_disable(); - cnthctl_el2 = vmm_call_hyp(HYP_READ_REGISTER, HYP_REG_CNTHCTL); - intr_restore(daif); + cnthctl_el2 = vmm_read_reg(HYP_REG_CNTHCTL); vgic_init(); vtimer_init(cnthctl_el2); @@ -567,26 +562,6 @@ vmmops_vmspace_free(struct vmspace *vmspace) vmspace_free(vmspace); } -static void -vmm_pmap_clean_stage2_tlbi(void) -{ - vmm_call_hyp(HYP_CLEAN_S2_TLBI); -} - -static void -vmm_pmap_invalidate_range(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, - bool final_only) -{ - MPASS(eva > sva); - vmm_call_hyp(HYP_S2_TLBI_RANGE, vttbr, sva, eva, final_only); -} - -static void -vmm_pmap_invalidate_all(uint64_t vttbr) -{ - vmm_call_hyp(HYP_S2_TLBI_ALL, vttbr); -} - static inline void arm64_print_hyp_regs(struct vm_exit *vme) { @@ -1143,8 +1118,7 @@ vmmops_run(void *vcpui, register_t pc, pmap_t pmap, struct vm_eventinfo *evinfo) vgic_flush_hwstate(hypctx); /* Call into EL2 to switch to the guest */ - excp_type = vmm_call_hyp(HYP_ENTER_GUEST, - hyp->el2_addr, hypctx->el2_addr); + excp_type = vmm_enter_guest(hyp, hypctx); vgic_sync_hwstate(hypctx); vtimer_sync_hwstate(hypctx); diff --git a/sys/arm64/vmm/vmm_handlers.c b/sys/arm64/vmm/vmm_handlers.c new file mode 100644 index 000000000000..2ce674d5ba46 --- /dev/null +++ b/sys/arm64/vmm/vmm_handlers.c @@ -0,0 +1,65 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include + +#include "arm64.h" +#include "vmm_handlers.h" + +uint64_t +vmm_read_reg(uint64_t reg) +{ + return (vmm_call_hyp(HYP_READ_REGISTER, reg)); +} + +uint64_t +vmm_enter_guest(struct hyp *hyp, struct hypctx *hypctx) +{ + return (vmm_call_hyp(HYP_ENTER_GUEST, hyp->el2_addr, hypctx->el2_addr)); +} + +void +vmm_clean_s2_tlbi(void) +{ + vmm_call_hyp(HYP_CLEAN_S2_TLBI); +} + +void +vmm_s2_tlbi_range(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, + bool final_only) +{ + vmm_call_hyp(HYP_S2_TLBI_RANGE, vttbr, sva, eva, final_only); +} + +void +vmm_s2_tlbi_all(uint64_t vttbr) +{ + vmm_call_hyp(HYP_S2_TLBI_ALL, vttbr); +} diff --git a/sys/arm64/vmm/vmm_handlers.h b/sys/arm64/vmm/vmm_handlers.h new file mode 100644 index 000000000000..f651fce6f32d --- /dev/null +++ b/sys/arm64/vmm/vmm_handlers.h @@ -0,0 +1,48 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _VMM_VMM_HANDLERS_H_ +#define _VMM_VMM_HANDLERS_H_ + +#include + +struct hyp; +struct hypctx; + +void vmm_clean_s2_tlbi(void); +uint64_t vmm_enter_guest(struct hyp *, struct hypctx *); +uint64_t vmm_read_reg(uint64_t); +void vmm_s2_tlbi_range(uint64_t, vm_offset_t, vm_offset_t, bool); +void vmm_s2_tlbi_all(uint64_t); + +void vmm_vhe_clean_s2_tlbi(void); +uint64_t vmm_vhe_enter_guest(struct hyp *, struct hypctx *); +uint64_t vmm_vhe_read_reg(uint64_t); +void vmm_vhe_s2_tlbi_range(uint64_t, vm_offset_t, vm_offset_t, bool); +void vmm_vhe_s2_tlbi_all(uint64_t); + +#endif /* _VMM_VMM_HANDLERS_H_ */ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 10590d6c77e2..b522177221e5 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -122,6 +122,7 @@ arm64/vmm/vmm_instruction_emul.c optional vmm arm64/vmm/vmm_stat.c optional vmm arm64/vmm/vmm_arm64.c optional vmm arm64/vmm/vmm_reset.c optional vmm +arm64/vmm/vmm_handlers.c optional vmm arm64/vmm/vmm_call.S optional vmm arm64/vmm/vmm_nvhe_exception.S optional vmm \ compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 409804f4e25c..a3a878a653ff 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -28,6 +28,7 @@ DPSRCS+= assym.inc SRCS+= vmm_arm64.c \ vmm_reset.c \ vmm_call.S \ + vmm_handlers.c \ vmm_mmu.c \ vmm_hyp_el2.S From nobody Tue Aug 20 09:02:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pk72bLz5Shs8; Tue, 20 Aug 2024 09:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pk657qz4v8h; Tue, 20 Aug 2024 09:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4fOho7UHMJRxCET7MK4PZ4NaJykcDNEgMY585Li4Lpw=; b=U+005wzGOAZY7tQZ310tyfaTf+kvKMWLhpJGlFVGdvE/UksVrtpcgxuvj1++LwBlooV2Xi XQl2xxuCAqQsYlmSN2npt8Qg6jX2Epwqeg793ITnxs4Iw8YSCSGMzAsJg4weZQ2+k2cSET hAH9Lp9TD+bKe33RztHi5em2SrT9hFd5NHVypwHORnYXDz4dSO0KlHJBBHXaijWW9t2ydn 3g/2zf2ye8+0hu/46Q9JgUh1H5n1ThYK8jzwurh2kAUqjTCs6NGNhpICdl8+E8rBINdLca EqffMQT/6sBvUT6llf13bpkdkkPcBJfyUSBsci7JGjo/JvBiBqI9l18WOfFloA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144538; a=rsa-sha256; cv=none; b=OIStk85VyHUhfmiS3n9W5m9BYzz2l3/vORRVI1xgLxCSpgVsqvEzaTAaYd+ACUV5H4LF1g hnAHHzYLSwo1nzW0whIR4x/W7AluzwT83R3ICkH26/z/8+x5C8+GBBB1Q0aqRSXkRsxEgH TF7oDiu0VfItqiW92dQcWkARz9NiH/No5ka++yWWo3PAYJxPYrJcuo9bGZId1Eht44a6ju ewt8ZUUp0b2Q3XTypKG4J8XgfzxgF+DrJwH2Cc7uUT4VIZ1ig9hqd/VxFH5zGeD5DqRtHP 45c4DowwqtGPdAyYcIWepSpEO9IKK6CjyAcSfSEpYN/eWMMToO9vOcwAmQqg3g== 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=1724144538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4fOho7UHMJRxCET7MK4PZ4NaJykcDNEgMY585Li4Lpw=; b=RsXCGK0297AJDWEaGwfFjJwhiK6O+wNeosbseSMAYUCUTq415gmZfZ1G393IPL/3QJRdCC r9NxviUOA6jOapZZGwZpfMSPjY+6aKiNgBwpP46no6Eu4pDuP184VhjBBL1JVfG4PH6xSm iEshRy8luEpSHqUIxhuFvQhAv8ab2PyYmJTl0p6TYhL9f/370RpZssEHqiL9QgdtJfwOP1 WXqaEFahpxzTP3MmTVaIui7arHhf7mPZM5Nqffpz9wXqr46GuU5wfCIG/uhHQspgbCi1f7 5hIa/8VbRv1yoWGdbnoMWhV4Dpf14ZphvakJlNHpDMgO+B9tpkhIfftHLAg/bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pk5XcKztm3; Tue, 20 Aug 2024 09:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92ID5081140; Tue, 20 Aug 2024 09:02:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92I38081128; Tue, 20 Aug 2024 09:02:18 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:18 GMT Message-Id: <202408200902.47K92I38081128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 387f878aa7af - main - arm64/vmm: Teach vmm_arm.c about VHE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 387f878aa7afdc48cdd304a9c2f5e6806639f6f0 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=387f878aa7afdc48cdd304a9c2f5e6806639f6f0 commit 387f878aa7afdc48cdd304a9c2f5e6806639f6f0 Author: Andrew Turner AuthorDate: 2024-08-19 12:43:46 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Teach vmm_arm.c about VHE Most of the code is identical however some, e.g. managing EL2 memory or setting EL2 registers, are unneeded under VHE as the kernel is in EL2 so can manage these directly. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46076 --- sys/arm64/vmm/vmm_arm64.c | 224 +++++++++++++++++++++++++--------------------- sys/arm64/vmm/vmm_reset.c | 8 +- 2 files changed, 127 insertions(+), 105 deletions(-) diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index 1b73ed019fad..3079353668e3 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -128,20 +128,6 @@ arm_setup_vectors(void *arg) el2_regs = arg; arm64_set_active_vcpu(NULL); - daif = intr_disable(); - - /* - * Install the temporary vectors which will be responsible for - * initializing the VMM when we next trap into EL2. - * - * x0: the exception vector table responsible for hypervisor - * initialization on the next call. - */ - vmm_call_hyp(vtophys(&vmm_hyp_code)); - - /* Create and map the hypervisor stack */ - stack_top = stack_hyp_va[PCPU_GET(cpuid)] + VMM_STACK_SIZE; - /* * Configure the system control register for EL2: * @@ -159,9 +145,27 @@ arm_setup_vectors(void *arg) sctlr_el2 |= SCTLR_EL2_WXN; sctlr_el2 &= ~SCTLR_EL2_EE; - /* Special call to initialize EL2 */ - vmm_call_hyp(vmmpmap_to_ttbr0(), stack_top, el2_regs->tcr_el2, - sctlr_el2, el2_regs->vtcr_el2); + daif = intr_disable(); + + if (in_vhe()) { + WRITE_SPECIALREG(vtcr_el2, el2_regs->vtcr_el2); + } else { + /* + * Install the temporary vectors which will be responsible for + * initializing the VMM when we next trap into EL2. + * + * x0: the exception vector table responsible for hypervisor + * initialization on the next call. + */ + vmm_call_hyp(vtophys(&vmm_hyp_code)); + + /* Create and map the hypervisor stack */ + stack_top = stack_hyp_va[PCPU_GET(cpuid)] + VMM_STACK_SIZE; + + /* Special call to initialize EL2 */ + vmm_call_hyp(vmmpmap_to_ttbr0(), stack_top, el2_regs->tcr_el2, + sctlr_el2, el2_regs->vtcr_el2); + } intr_restore(daif); } @@ -280,10 +284,12 @@ vmmops_modinit(int ipinum) } pa_range_bits = pa_range_field >> ID_AA64MMFR0_PARange_SHIFT; - /* Initialise the EL2 MMU */ - if (!vmmpmap_init()) { - printf("vmm: Failed to init the EL2 MMU\n"); - return (ENOMEM); + if (!in_vhe()) { + /* Initialise the EL2 MMU */ + if (!vmmpmap_init()) { + printf("vmm: Failed to init the EL2 MMU\n"); + return (ENOMEM); + } } /* Set up the stage 2 pmap callbacks */ @@ -292,55 +298,58 @@ vmmops_modinit(int ipinum) pmap_stage2_invalidate_range = vmm_s2_tlbi_range; pmap_stage2_invalidate_all = vmm_s2_tlbi_all; - /* - * Create an allocator for the virtual address space used by EL2. - * EL2 code is identity-mapped; the allocator is used to find space for - * VM structures. - */ - el2_mem_alloc = vmem_create("VMM EL2", 0, 0, PAGE_SIZE, 0, M_WAITOK); - - /* Create the mappings for the hypervisor translation table. */ - hyp_code_len = round_page(&vmm_hyp_code_end - &vmm_hyp_code); - - /* We need an physical identity mapping for when we activate the MMU */ - hyp_code_base = vmm_base = vtophys(&vmm_hyp_code); - rv = vmmpmap_enter(vmm_base, hyp_code_len, vmm_base, - VM_PROT_READ | VM_PROT_EXECUTE); - MPASS(rv); - - next_hyp_va = roundup2(vmm_base + hyp_code_len, L2_SIZE); - - /* Create a per-CPU hypervisor stack */ - CPU_FOREACH(cpu) { - stack[cpu] = malloc(VMM_STACK_SIZE, M_HYP, M_WAITOK | M_ZERO); - stack_hyp_va[cpu] = next_hyp_va; - - for (i = 0; i < VMM_STACK_PAGES; i++) { - rv = vmmpmap_enter(stack_hyp_va[cpu] + ptoa(i), - PAGE_SIZE, vtophys(stack[cpu] + ptoa(i)), - VM_PROT_READ | VM_PROT_WRITE); - MPASS(rv); + if (!in_vhe()) { + /* + * Create an allocator for the virtual address space used by + * EL2. EL2 code is identity-mapped; the allocator is used to + * find space for VM structures. + */ + el2_mem_alloc = vmem_create("VMM EL2", 0, 0, PAGE_SIZE, 0, + M_WAITOK); + + /* Create the mappings for the hypervisor translation table. */ + hyp_code_len = round_page(&vmm_hyp_code_end - &vmm_hyp_code); + + /* We need an physical identity mapping for when we activate the MMU */ + hyp_code_base = vmm_base = vtophys(&vmm_hyp_code); + rv = vmmpmap_enter(vmm_base, hyp_code_len, vmm_base, + VM_PROT_READ | VM_PROT_EXECUTE); + MPASS(rv); + + next_hyp_va = roundup2(vmm_base + hyp_code_len, L2_SIZE); + + /* Create a per-CPU hypervisor stack */ + CPU_FOREACH(cpu) { + stack[cpu] = malloc(VMM_STACK_SIZE, M_HYP, M_WAITOK | M_ZERO); + stack_hyp_va[cpu] = next_hyp_va; + + for (i = 0; i < VMM_STACK_PAGES; i++) { + rv = vmmpmap_enter(stack_hyp_va[cpu] + ptoa(i), + PAGE_SIZE, vtophys(stack[cpu] + ptoa(i)), + VM_PROT_READ | VM_PROT_WRITE); + MPASS(rv); + } + next_hyp_va += L2_SIZE; } - next_hyp_va += L2_SIZE; - } - el2_regs.tcr_el2 = TCR_EL2_RES1; - el2_regs.tcr_el2 |= min(pa_range_bits << TCR_EL2_PS_SHIFT, - TCR_EL2_PS_52BITS); - el2_regs.tcr_el2 |= TCR_EL2_T0SZ(64 - EL2_VIRT_BITS); - el2_regs.tcr_el2 |= TCR_EL2_IRGN0_WBWA | TCR_EL2_ORGN0_WBWA; + el2_regs.tcr_el2 = TCR_EL2_RES1; + el2_regs.tcr_el2 |= min(pa_range_bits << TCR_EL2_PS_SHIFT, + TCR_EL2_PS_52BITS); + el2_regs.tcr_el2 |= TCR_EL2_T0SZ(64 - EL2_VIRT_BITS); + el2_regs.tcr_el2 |= TCR_EL2_IRGN0_WBWA | TCR_EL2_ORGN0_WBWA; #if PAGE_SIZE == PAGE_SIZE_4K - el2_regs.tcr_el2 |= TCR_EL2_TG0_4K; + el2_regs.tcr_el2 |= TCR_EL2_TG0_4K; #elif PAGE_SIZE == PAGE_SIZE_16K - el2_regs.tcr_el2 |= TCR_EL2_TG0_16K; + el2_regs.tcr_el2 |= TCR_EL2_TG0_16K; #else #error Unsupported page size #endif #ifdef SMP - el2_regs.tcr_el2 |= TCR_EL2_SH0_IS; + el2_regs.tcr_el2 |= TCR_EL2_SH0_IS; #endif + } - switch (el2_regs.tcr_el2 & TCR_EL2_PS_MASK) { + switch (pa_range_bits << TCR_EL2_PS_SHIFT) { case TCR_EL2_PS_32BITS: vmm_max_ipa_bits = 32; break; @@ -396,36 +405,37 @@ vmmops_modinit(int ipinum) smp_rendezvous(NULL, arm_setup_vectors, NULL, &el2_regs); - /* Add memory to the vmem allocator (checking there is space) */ - if (vmm_base > (L2_SIZE + PAGE_SIZE)) { - /* - * Ensure there is an L2 block before the vmm code to check - * for buffer overflows on earlier data. Include the PAGE_SIZE - * of the minimum we can allocate. - */ - vmm_base -= L2_SIZE + PAGE_SIZE; - vmm_base = rounddown2(vmm_base, L2_SIZE); + if (!in_vhe()) { + /* Add memory to the vmem allocator (checking there is space) */ + if (vmm_base > (L2_SIZE + PAGE_SIZE)) { + /* + * Ensure there is an L2 block before the vmm code to check + * for buffer overflows on earlier data. Include the PAGE_SIZE + * of the minimum we can allocate. + */ + vmm_base -= L2_SIZE + PAGE_SIZE; + vmm_base = rounddown2(vmm_base, L2_SIZE); + + /* + * Check there is memory before the vmm code to add. + * + * Reserve the L2 block at address 0 so NULL dereference will + * raise an exception. + */ + if (vmm_base > L2_SIZE) + vmem_add(el2_mem_alloc, L2_SIZE, vmm_base - L2_SIZE, + M_WAITOK); + } /* - * Check there is memory before the vmm code to add. - * - * Reserve the L2 block at address 0 so NULL dereference will - * raise an exception. + * Add the memory after the stacks. There is most of an L2 block + * between the last stack and the first allocation so this should + * be safe without adding more padding. */ - if (vmm_base > L2_SIZE) - vmem_add(el2_mem_alloc, L2_SIZE, vmm_base - L2_SIZE, - M_WAITOK); + if (next_hyp_va < HYP_VM_MAX_ADDRESS - PAGE_SIZE) + vmem_add(el2_mem_alloc, next_hyp_va, + HYP_VM_MAX_ADDRESS - next_hyp_va, M_WAITOK); } - - /* - * Add the memory after the stacks. There is most of an L2 block - * between the last stack and the first allocation so this should - * be safe without adding more padding. - */ - if (next_hyp_va < HYP_VM_MAX_ADDRESS - PAGE_SIZE) - vmem_add(el2_mem_alloc, next_hyp_va, - HYP_VM_MAX_ADDRESS - next_hyp_va, M_WAITOK); - cnthctl_el2 = vmm_read_reg(HYP_REG_CNTHCTL); vgic_init(); @@ -439,21 +449,25 @@ vmmops_modcleanup(void) { int cpu; - smp_rendezvous(NULL, arm_teardown_vectors, NULL, NULL); + if (!in_vhe()) { + smp_rendezvous(NULL, arm_teardown_vectors, NULL, NULL); - CPU_FOREACH(cpu) { - vmmpmap_remove(stack_hyp_va[cpu], VMM_STACK_PAGES * PAGE_SIZE, - false); - } + CPU_FOREACH(cpu) { + vmmpmap_remove(stack_hyp_va[cpu], + VMM_STACK_PAGES * PAGE_SIZE, false); + } - vmmpmap_remove(hyp_code_base, hyp_code_len, false); + vmmpmap_remove(hyp_code_base, hyp_code_len, false); + } vtimer_cleanup(); - vmmpmap_fini(); + if (!in_vhe()) { + vmmpmap_fini(); - CPU_FOREACH(cpu) - free(stack[cpu], M_HYP); + CPU_FOREACH(cpu) + free(stack[cpu], M_HYP); + } pmap_clean_stage2_tlbi = NULL; pmap_stage2_invalidate_range = NULL; @@ -505,8 +519,9 @@ vmmops_init(struct vm *vm, pmap_t pmap) vtimer_vminit(hyp); vgic_vminit(hyp); - hyp->el2_addr = el2_map_enter((vm_offset_t)hyp, size, - VM_PROT_READ | VM_PROT_WRITE); + if (!in_vhe()) + hyp->el2_addr = el2_map_enter((vm_offset_t)hyp, size, + VM_PROT_READ | VM_PROT_WRITE); return (hyp); } @@ -534,8 +549,9 @@ vmmops_vcpu_init(void *vmi, struct vcpu *vcpu1, int vcpuid) vtimer_cpuinit(hypctx); vgic_cpuinit(hypctx); - hypctx->el2_addr = el2_map_enter((vm_offset_t)hypctx, size, - VM_PROT_READ | VM_PROT_WRITE); + if (!in_vhe()) + hypctx->el2_addr = el2_map_enter((vm_offset_t)hypctx, size, + VM_PROT_READ | VM_PROT_WRITE); return (hypctx); } @@ -1124,9 +1140,7 @@ vmmops_run(void *vcpui, register_t pc, pmap_t pmap, struct vm_eventinfo *evinfo) vtimer_sync_hwstate(hypctx); /* - * Deactivate the stage2 pmap. vmm_pmap_clean_stage2_tlbi - * depends on this meaning we activate the VM before entering - * the vm again + * Deactivate the stage2 pmap. */ PCPU_SET(curvmpmap, NULL); intr_restore(daif); @@ -1179,7 +1193,8 @@ vmmops_vcpu_cleanup(void *vcpui) vtimer_cpucleanup(hypctx); vgic_cpucleanup(hypctx); - vmmpmap_remove(hypctx->el2_addr, el2_hypctx_size(), true); + if (!in_vhe()) + vmmpmap_remove(hypctx->el2_addr, el2_hypctx_size(), true); free(hypctx, M_HYP); } @@ -1194,7 +1209,8 @@ vmmops_cleanup(void *vmi) smp_rendezvous(NULL, arm_pcpu_vmcleanup, NULL, hyp); - vmmpmap_remove(hyp->el2_addr, el2_hyp_size(hyp->vm), true); + if (!in_vhe()) + vmmpmap_remove(hyp->el2_addr, el2_hyp_size(hyp->vm), true); free(hyp, M_HYP); } diff --git a/sys/arm64/vmm/vmm_reset.c b/sys/arm64/vmm/vmm_reset.c index a929a60c9474..3195bc10dedd 100644 --- a/sys/arm64/vmm/vmm_reset.c +++ b/sys/arm64/vmm/vmm_reset.c @@ -136,6 +136,9 @@ reset_vm_el2_regs(void *vcpu) */ el2ctx->hcr_el2 = HCR_RW | HCR_TID3 | HCR_TWI | HCR_BSU_IS | HCR_FB | HCR_AMO | HCR_IMO | HCR_FMO | HCR_SWIO | HCR_VM; + if (in_vhe()) { + el2ctx->hcr_el2 |= HCR_E2H; + } /* TODO: Trap all extensions we don't support */ el2ctx->mdcr_el2 = 0; @@ -166,7 +169,10 @@ reset_vm_el2_regs(void *vcpu) * Don't trap accesses to CPACR_EL1, trace, SVE, Advanced SIMD * and floating point functionality to EL2. */ - el2ctx->cptr_el2 = CPTR_RES1; + if (in_vhe()) + el2ctx->cptr_el2 = CPACR_FPEN_TRAP_NONE; + else + el2ctx->cptr_el2 = CPTR_RES1; /* * Disable interrupts in the guest. The guest OS will re-enable * them. From nobody Tue Aug 20 09:02:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pm44Msz5ShsH; Tue, 20 Aug 2024 09:02: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 4Wp3Pl6tprz4vbw; Tue, 20 Aug 2024 09:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FjZ9RiKMC659aVDH3Z+ZSJVtLtVbySec3mAWm/qJW2s=; b=I5Mt9yIbxwzWxaWPPOL5JpADWc4fYEhWXBW5Q3szRY5w/iVYZ0ARPIAlby/GyZyg/y+4cy F5iJyV5KFQKa3rSww996gbCW9YWwzlfyT8l4rfHB58rCSHTUP/uapWpBKCsGW0t2XyOvz0 X7rw9GcAApK2nxZxq0A7J4jVjby8E+kTo080lffnQBR22QZz53aD3pJgorg2vFaPlqkdTc qeSdxmghdCK0eWP3KjED3IuJJO94pr/N9T+TGNc4Oko3HR2Nqt1eTZhCK/AL9qd1N0j472 Wj5JKlJmWl0BSkxqnLmGA8XC9WC+Yq7St18rXa6Zfph55XajO0K5w/PTmlRKow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144540; a=rsa-sha256; cv=none; b=Y+Fak1KaKBwX5X2hf1u8WuVwAZD6cttUNwQ7zwzYNm2hHod5gj9MRWrKcfaL2mCvMigVTr 6sgc9c2/hKwhjT4PCMdOyAwf1z9gTNXda9nqVkjLpdvBQFGR3xd7h67qbGmtVKBdrdreyD Txl6X7oOWJ+xEl6JVMctsYD9BTM8y/QthsXLnwmH9LVWjN8vdGuykykASbFwpWvWQ6rCqZ Vny/tSm0nnN9mQ54gvSF7466IjTJLOzShXFBp2a14laSEPxx/VXEPvRGoYOqGtKTZEEhDT APC9BslRmwq+yoXuL1WSdULcj7jwabe3bba6lZfadu6yzcjnrE+J+K9k83hjfg== 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=1724144540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FjZ9RiKMC659aVDH3Z+ZSJVtLtVbySec3mAWm/qJW2s=; b=h/VWcPznvTMxwa9fdR+DSCRCMOeDZblQg72KnCcsXplCKU+4ecrhib0vI3VVtptcOP0831 Pq51lcAPzIYAtJPp7CI+9buUkE90jsxsqhxcSX/dM12VnUWZuIpHPT2DZPxmnfs+5UR4g6 h2N0EyPWtTW80d5rX13++400tZSl1FExxRcfiNfDvgAqA3gme6AfdHq1h95FuCuhBbkKD6 Navgg5r9WPvli6A/5Bu5pVEHK3gsZme+9InuAXHyKk7jMPusoXHtzxRGFe4OJYQigz2wQx 4/Rjm6LiKDO4VeO8W8gqQEx1YwkgLMlguJY+f80d7jNuBVnWVu1jYKUZfkrD9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pl6T1lztjk; Tue, 20 Aug 2024 09:02: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 47K92JsI081602; Tue, 20 Aug 2024 09:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92J2Z081599; Tue, 20 Aug 2024 09:02:19 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:19 GMT Message-Id: <202408200902.47K92J2Z081599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 6b17f49da0a2 - main - arm64/vmm: Restore hcr_el2 earlier List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b17f49da0a2c4cba05e6a1994fb10d16f11fe0a Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6b17f49da0a2c4cba05e6a1994fb10d16f11fe0a commit 6b17f49da0a2c4cba05e6a1994fb10d16f11fe0a Author: Andrew Turner AuthorDate: 2024-08-19 12:43:51 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Restore hcr_el2 earlier It may cause fields in other registers to change meaning. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46077 --- sys/arm64/vmm/vmm_hyp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index 92f8cd25251d..9341f42daef6 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -262,6 +262,9 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) uint64_t dfr0; /* Restore the special registers */ + WRITE_SPECIALREG(hcr_el2, hypctx->hcr_el2); + isb(); + WRITE_SPECIALREG(elr_el1, hypctx->elr_el1); WRITE_SPECIALREG(sp_el0, hypctx->sp_el0); WRITE_SPECIALREG(tpidr_el0, hypctx->tpidr_el0); @@ -290,7 +293,6 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(spsr_el1, hypctx->spsr_el1); WRITE_SPECIALREG(cptr_el2, hypctx->cptr_el2); - WRITE_SPECIALREG(hcr_el2, hypctx->hcr_el2); WRITE_SPECIALREG(vpidr_el2, hypctx->vpidr_el2); WRITE_SPECIALREG(vmpidr_el2, hypctx->vmpidr_el2); From nobody Tue Aug 20 09:02:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pn4crDz5SjCB; Tue, 20 Aug 2024 09:02: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 4Wp3Pn0m8cz4vcH; Tue, 20 Aug 2024 09:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYQ8fgj9OkI6azdBhqQsGB3bFE+GqSuvr/TtzUQcfdo=; b=J1ezOoSokaZ+eIuj8LVOwhNTZJkYIGg2e7eyrdOL0qyFegeVD0ajVohz1swfKHP4Wqt2D3 18WIkDz+N2Ik/JO/Huiuj+gDBnOusfXnWnUAqTtGgEWivuxl3pDbpHVDSwAq3eZFpVwvdU fT5nJ9Z7doR6tr9gGezuNnYtEJ8bapwLo5GZzktnQinWCKB7DmajNQ/+W+7cg4NAPi82gH COmQkmKQuZHbnDLzw29zp1uDMihfW/9p5tQ3YFY76tngBjfMemAIIppLgzeLhpl7pkYuGd +oZIW9MXv8fXilAKevYXtoaj9sglPfehxsi1QzQa+ZBGSLUgSb8XcgyFmG1faA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144541; a=rsa-sha256; cv=none; b=lQFoFcyMWOZAGYqWeLQLNhhRa0h/pV4n/O2ixAvH1uFGSB0uqH4AZF5mhvRIiMiNaJAdCH onuK27ISXVycarrwdj0/MoMq4FiDeJZvP8hY5Op64qR1my6lt0ANccHdKZvfn4ArbI418l DkUEYL2Uh24Maq99XvtEKwLo6b4PQAXsMegBVlpSy787nxEFxLepTnMFbASE+KTKSRT5HA zjNijzXzijhk+Je+OmNh3JTCMIP4Z0eQBJFjut6j3+hTgjhE6yTzYJIX8vxqqAG/jrp/D/ iimsomwyXGDc0f0AfRXZYkLYPxuDrFi8nT50B4ggGhWWe4VhkOFCFzutEusv7g== 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=1724144541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYQ8fgj9OkI6azdBhqQsGB3bFE+GqSuvr/TtzUQcfdo=; b=VK2Z+jmid0SXMh6dMh9Vu5MPLLFixcILMTlq7JClT9dBv0LwKofaFNUoOt5hD9azMcxeSa Lrmbm8fCEOAWyHg59yhOqo3Mg/8TYfaLHjnZiDXY/fpfiI5YZqggTeuOCE80FUC1XF3uVH 5tUlhedz+dofWLsc++mlXARYC76xZhnIVMs0us5GB4xtsoQDr5LZes/OTZSw1v0dzJ6Fvl RBDUAy+m9t0KyIXr5Ws4B+nG8w7wBvprydq8IpKh+6yMIXcABqVD8tXh7K6ucnKeN+Bvg5 K37MFUQXdn7O0QYP7h5J4pUc6Fa3dI8HWSic1TMLokpq59jGFUEbC8dmcgMbHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pn0LYYztjm; Tue, 20 Aug 2024 09:02: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 47K92Kp5081650; Tue, 20 Aug 2024 09:02:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92K4W081647; Tue, 20 Aug 2024 09:02:20 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:20 GMT Message-Id: <202408200902.47K92K4W081647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7861ecd18b6f - main - arm64/vmm: Teach the switcher about new registers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7861ecd18b6f15cfe37fc6f51f6ba89b92398648 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7861ecd18b6f15cfe37fc6f51f6ba89b92398648 commit 7861ecd18b6f15cfe37fc6f51f6ba89b92398648 Author: Andrew Turner AuthorDate: 2024-08-19 12:43:59 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Teach the switcher about new registers To support booting the kernel in EL2 some of the EL0 and EL1 registers are changed to point to an EL2 version. To get access to the EL0/EL1 version of these registers we need to use the new EL02 and EL12 registers, e.g. to access elr_el1 from the host we would use elr_el12. Add macros that can be different on VHE vs non-VHE code so these registers can be accessed in the correct way. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46078 --- sys/arm64/vmm/vmm_hyp.c | 89 +++++++++++++++++++++++++++--------------------- sys/arm64/vmm/vmm_nvhe.c | 4 +++ 2 files changed, 54 insertions(+), 39 deletions(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index 9341f42daef6..ae0c46331382 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -49,11 +49,12 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) /* Store the guest VFP registers */ if (guest) { /* Store the timer registers */ - hypctx->vtimer_cpu.cntkctl_el1 = READ_SPECIALREG(cntkctl_el1); + hypctx->vtimer_cpu.cntkctl_el1 = + READ_SPECIALREG(EL1_REG(CNTKCTL)); hypctx->vtimer_cpu.virt_timer.cntx_cval_el0 = - READ_SPECIALREG(cntv_cval_el0); + READ_SPECIALREG(EL0_REG(CNTV_CVAL)); hypctx->vtimer_cpu.virt_timer.cntx_ctl_el0 = - READ_SPECIALREG(cntv_ctl_el0); + READ_SPECIALREG(EL0_REG(CNTV_CTL)); /* Store the GICv3 registers */ hypctx->vgic_v3_regs.ich_eisr_el2 = @@ -222,33 +223,37 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) } /* Store the guest special registers */ - hypctx->elr_el1 = READ_SPECIALREG(elr_el1); hypctx->sp_el0 = READ_SPECIALREG(sp_el0); hypctx->tpidr_el0 = READ_SPECIALREG(tpidr_el0); hypctx->tpidrro_el0 = READ_SPECIALREG(tpidrro_el0); hypctx->tpidr_el1 = READ_SPECIALREG(tpidr_el1); - hypctx->vbar_el1 = READ_SPECIALREG(vbar_el1); hypctx->actlr_el1 = READ_SPECIALREG(actlr_el1); - hypctx->afsr0_el1 = READ_SPECIALREG(afsr0_el1); - hypctx->afsr1_el1 = READ_SPECIALREG(afsr1_el1); - hypctx->amair_el1 = READ_SPECIALREG(amair_el1); - hypctx->contextidr_el1 = READ_SPECIALREG(contextidr_el1); - hypctx->cpacr_el1 = READ_SPECIALREG(cpacr_el1); hypctx->csselr_el1 = READ_SPECIALREG(csselr_el1); - hypctx->esr_el1 = READ_SPECIALREG(esr_el1); - hypctx->far_el1 = READ_SPECIALREG(far_el1); - hypctx->mair_el1 = READ_SPECIALREG(mair_el1); hypctx->mdccint_el1 = READ_SPECIALREG(mdccint_el1); hypctx->mdscr_el1 = READ_SPECIALREG(mdscr_el1); hypctx->par_el1 = READ_SPECIALREG(par_el1); - hypctx->sctlr_el1 = READ_SPECIALREG(sctlr_el1); - hypctx->spsr_el1 = READ_SPECIALREG(spsr_el1); - hypctx->tcr_el1 = READ_SPECIALREG(tcr_el1); - /* TODO: Support when this is not res0 */ - hypctx->tcr2_el1 = 0; - hypctx->ttbr0_el1 = READ_SPECIALREG(ttbr0_el1); - hypctx->ttbr1_el1 = READ_SPECIALREG(ttbr1_el1); + + if (guest_or_nonvhe(guest)) { + hypctx->elr_el1 = READ_SPECIALREG(EL1_REG(ELR)); + hypctx->vbar_el1 = READ_SPECIALREG(EL1_REG(VBAR)); + + hypctx->afsr0_el1 = READ_SPECIALREG(EL1_REG(AFSR0)); + hypctx->afsr1_el1 = READ_SPECIALREG(EL1_REG(AFSR1)); + hypctx->amair_el1 = READ_SPECIALREG(EL1_REG(AMAIR)); + hypctx->contextidr_el1 = READ_SPECIALREG(EL1_REG(CONTEXTIDR)); + hypctx->cpacr_el1 = READ_SPECIALREG(EL1_REG(CPACR)); + hypctx->esr_el1 = READ_SPECIALREG(EL1_REG(ESR)); + hypctx->far_el1 = READ_SPECIALREG(EL1_REG(FAR)); + hypctx->mair_el1 = READ_SPECIALREG(EL1_REG(MAIR)); + hypctx->sctlr_el1 = READ_SPECIALREG(EL1_REG(SCTLR)); + hypctx->spsr_el1 = READ_SPECIALREG(EL1_REG(SPSR)); + hypctx->tcr_el1 = READ_SPECIALREG(EL1_REG(TCR)); + /* TODO: Support when this is not res0 */ + hypctx->tcr2_el1 = 0; + hypctx->ttbr0_el1 = READ_SPECIALREG(EL1_REG(TTBR0)); + hypctx->ttbr1_el1 = READ_SPECIALREG(EL1_REG(TTBR1)); + } hypctx->cptr_el2 = READ_SPECIALREG(cptr_el2); hypctx->hcr_el2 = READ_SPECIALREG(hcr_el2); @@ -265,32 +270,37 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(hcr_el2, hypctx->hcr_el2); isb(); - WRITE_SPECIALREG(elr_el1, hypctx->elr_el1); WRITE_SPECIALREG(sp_el0, hypctx->sp_el0); WRITE_SPECIALREG(tpidr_el0, hypctx->tpidr_el0); WRITE_SPECIALREG(tpidrro_el0, hypctx->tpidrro_el0); WRITE_SPECIALREG(tpidr_el1, hypctx->tpidr_el1); - WRITE_SPECIALREG(vbar_el1, hypctx->vbar_el1); WRITE_SPECIALREG(actlr_el1, hypctx->actlr_el1); - WRITE_SPECIALREG(afsr0_el1, hypctx->afsr0_el1); - WRITE_SPECIALREG(afsr1_el1, hypctx->afsr1_el1); - WRITE_SPECIALREG(amair_el1, hypctx->amair_el1); - WRITE_SPECIALREG(contextidr_el1, hypctx->contextidr_el1); - WRITE_SPECIALREG(cpacr_el1, hypctx->cpacr_el1); WRITE_SPECIALREG(csselr_el1, hypctx->csselr_el1); - WRITE_SPECIALREG(esr_el1, hypctx->esr_el1); - WRITE_SPECIALREG(far_el1, hypctx->far_el1); WRITE_SPECIALREG(mdccint_el1, hypctx->mdccint_el1); WRITE_SPECIALREG(mdscr_el1, hypctx->mdscr_el1); - WRITE_SPECIALREG(mair_el1, hypctx->mair_el1); WRITE_SPECIALREG(par_el1, hypctx->par_el1); - WRITE_SPECIALREG(sctlr_el1, hypctx->sctlr_el1); - WRITE_SPECIALREG(tcr_el1, hypctx->tcr_el1); - /* TODO: tcr2_el1 */ - WRITE_SPECIALREG(ttbr0_el1, hypctx->ttbr0_el1); - WRITE_SPECIALREG(ttbr1_el1, hypctx->ttbr1_el1); - WRITE_SPECIALREG(spsr_el1, hypctx->spsr_el1); + + if (guest_or_nonvhe(guest)) { + WRITE_SPECIALREG(EL1_REG(ELR), hypctx->elr_el1); + WRITE_SPECIALREG(EL1_REG(VBAR), hypctx->vbar_el1); + + WRITE_SPECIALREG(EL1_REG(AFSR0), hypctx->afsr0_el1); + WRITE_SPECIALREG(EL1_REG(AFSR1), hypctx->afsr1_el1); + WRITE_SPECIALREG(EL1_REG(AMAIR), hypctx->amair_el1); + WRITE_SPECIALREG(EL1_REG(CONTEXTIDR), hypctx->contextidr_el1); + WRITE_SPECIALREG(EL1_REG(CPACR), hypctx->cpacr_el1); + WRITE_SPECIALREG(EL1_REG(ESR), hypctx->esr_el1); + WRITE_SPECIALREG(EL1_REG(FAR), hypctx->far_el1); + WRITE_SPECIALREG(EL1_REG(MAIR), hypctx->mair_el1); // + + WRITE_SPECIALREG(EL1_REG(SCTLR), hypctx->sctlr_el1); + WRITE_SPECIALREG(EL1_REG(SPSR), hypctx->spsr_el1); + WRITE_SPECIALREG(EL1_REG(TCR), hypctx->tcr_el1); + /* TODO: tcr2_el1 */ + WRITE_SPECIALREG(EL1_REG(TTBR0), hypctx->ttbr0_el1); + WRITE_SPECIALREG(EL1_REG(TTBR1), hypctx->ttbr1_el1); + } WRITE_SPECIALREG(cptr_el2, hypctx->cptr_el2); WRITE_SPECIALREG(vpidr_el2, hypctx->vpidr_el2); @@ -413,10 +423,11 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) if (guest) { /* Load the timer registers */ - WRITE_SPECIALREG(cntkctl_el1, hypctx->vtimer_cpu.cntkctl_el1); - WRITE_SPECIALREG(cntv_cval_el0, + WRITE_SPECIALREG(EL1_REG(CNTKCTL), + hypctx->vtimer_cpu.cntkctl_el1); + WRITE_SPECIALREG(EL0_REG(CNTV_CVAL), hypctx->vtimer_cpu.virt_timer.cntx_cval_el0); - WRITE_SPECIALREG(cntv_ctl_el0, + WRITE_SPECIALREG(EL0_REG(CNTV_CTL), hypctx->vtimer_cpu.virt_timer.cntx_ctl_el0); WRITE_SPECIALREG(cnthctl_el2, hyp->vtimer.cnthctl_el2); WRITE_SPECIALREG(cntvoff_el2, hyp->vtimer.cntvoff_el2); diff --git a/sys/arm64/vmm/vmm_nvhe.c b/sys/arm64/vmm/vmm_nvhe.c index 1127a6e37781..025b1308ce68 100644 --- a/sys/arm64/vmm/vmm_nvhe.c +++ b/sys/arm64/vmm/vmm_nvhe.c @@ -32,6 +32,10 @@ #define VMM_STATIC static #define VMM_HYP_FUNC(func) vmm_nvhe_ ## func +#define guest_or_nonvhe(guest) (true) +#define EL1_REG(reg) MRS_REG_ALT_NAME(reg ## _EL1) +#define EL0_REG(reg) MRS_REG_ALT_NAME(reg ## _EL0) + #include "vmm_hyp.c" uint64_t vmm_hyp_enter(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, From nobody Tue Aug 20 09:02:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pp6Bggz5Sj8r; Tue, 20 Aug 2024 09:02: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 4Wp3Pp2kHTz4vj4; Tue, 20 Aug 2024 09:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hFAPG/SqsHTaTAGMRW7LxxDISBd2muLnLZZ53KpDEuk=; b=QFldxuFhCmWFm5Xrhv/v79cCVYyxxMmsV+y7O7X/1zF1GtPpcIB8UBZ+R87JDGUtfz37X6 HfS6UaBzgzNW4sK841OzqqRzbz9iybld4epb6Vr7VWry92dquSbi1UBT/b9LNEhyab/yBd BTOYLklc53QpORoIW0SM2464IoLqXvUBt6nOFzqWMFFrguPGfjzmJ2MG/rB2mSHeZbCQHY 1bYwJhNH9ME1Mp/UJVyt3oYgsu+IYURbFzuB1yDn/p85K41bVLClcaIkjVXGImT/LxjjBL 7ioPrIFj/hmQOIM544HxX4RGJZG6ImWffgoJJ5sB8oUaGr5eoj7Y31xF17X+ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144542; a=rsa-sha256; cv=none; b=bNVjsnNY/Xq/Z/4Mi6VFiM7hYv75RxbGiSsvXouYP8uAU79NREjI6tuNe1ga3xjcqeOIRy by7y4NXAgCELmy0/+pE3WcEZrNj4ET/fy65UgYzkpypUIrsrkKLvrpYBdbHT8qr8uXC3FR nsuMbHqzpivrtWLOOkYjKDSW7xv9VdkDWfwyHMwapygfuSeQ9z758Ny0RKpZ9oM/Bzlu/w BMNLSGf7Hp2a7b/o9xClvbTYP1cHMH9DeWCfCor8UKOtAm94pvsZ9xJj2RXFvubv0kc1Q6 TejcluUoFs9tTHytmk9j/8q8tU+KU/+snR+HtgvCBxeqDFzPzxpTFHVQxtdR4A== 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=1724144542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hFAPG/SqsHTaTAGMRW7LxxDISBd2muLnLZZ53KpDEuk=; b=T1XX3REQIHYARRuUw3RE7o9RN/NT6aZM7VQhk6XN3L4FlF8XhscmXSWjyzxguktXfsgo/R zdP4xmNiHtHszc8HiL7Rq1cDFer3DZN3B4LvSAINngl75XB3WyMpSW20bsMt96K0RLtcD9 ehLNtl5FkHKqge1HUMi8HF2xv7HgeHwGzDWsJk8wS0Uiw2383K8zt1eCYuiwWua/TVI5+g uLxJeAaC9BGQRa04LIX/12QlRjnj9xNsHwgjCvYcxx+Qhla0O+8wvFzyNBttOXkeq8rJS0 PydYUhFhJ0GFQ1j0twQlDdSSVao5/M33cCdB/DkH6vQd+P7iOb01E6syjNswWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pp1MWxztfq; Tue, 20 Aug 2024 09:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92MX5081697; Tue, 20 Aug 2024 09:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92MDW081694; Tue, 20 Aug 2024 09:02:22 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:22 GMT Message-Id: <202408200902.47K92MDW081694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 20eabb33b464 - main - arm64/vmm: Only store the guest par_el1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20eabb33b4645bc088c40d6475d5fa628b39031f Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=20eabb33b4645bc088c40d6475d5fa628b39031f commit 20eabb33b4645bc088c40d6475d5fa628b39031f Author: Andrew Turner AuthorDate: 2024-08-19 12:44:05 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Only store the guest par_el1 There is no need to store the host par_el1. We don't depend on it not changing across calls into a guest. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46079 --- sys/arm64/vmm/vmm_hyp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index ae0c46331382..9c84bb4b294e 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -220,6 +220,7 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) hypctx->tf.tf_spsr = READ_SPECIALREG(spsr_el2); if (guest) { hypctx->tf.tf_esr = READ_SPECIALREG(esr_el2); + hypctx->par_el1 = READ_SPECIALREG(par_el1); } /* Store the guest special registers */ @@ -232,7 +233,6 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) hypctx->csselr_el1 = READ_SPECIALREG(csselr_el1); hypctx->mdccint_el1 = READ_SPECIALREG(mdccint_el1); hypctx->mdscr_el1 = READ_SPECIALREG(mdscr_el1); - hypctx->par_el1 = READ_SPECIALREG(par_el1); if (guest_or_nonvhe(guest)) { hypctx->elr_el1 = READ_SPECIALREG(EL1_REG(ELR)); @@ -279,7 +279,6 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(csselr_el1, hypctx->csselr_el1); WRITE_SPECIALREG(mdccint_el1, hypctx->mdccint_el1); WRITE_SPECIALREG(mdscr_el1, hypctx->mdscr_el1); - WRITE_SPECIALREG(par_el1, hypctx->par_el1); if (guest_or_nonvhe(guest)) { WRITE_SPECIALREG(EL1_REG(ELR), hypctx->elr_el1); @@ -302,6 +301,10 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(EL1_REG(TTBR1), hypctx->ttbr1_el1); } + if (guest) { + WRITE_SPECIALREG(par_el1, hypctx->par_el1); + } + WRITE_SPECIALREG(cptr_el2, hypctx->cptr_el2); WRITE_SPECIALREG(vpidr_el2, hypctx->vpidr_el2); WRITE_SPECIALREG(vmpidr_el2, hypctx->vmpidr_el2); From nobody Tue Aug 20 09:02:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pq4Knzz5Sj4T; Tue, 20 Aug 2024 09:02: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 4Wp3Pq2d9Sz4vcx; Tue, 20 Aug 2024 09:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144543; h=from:from:reply-to:subject:subject: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/AiDUEFWM6woieuiyZxSn11hFoqQcMCDCJzwe7ElLk=; b=qYl6+BhKj3M7V1oakk16+AQhh1Ba8sJlo+tSGvGW3s3rDtYJknJApD777NWi/1r88f9N3l ufyEcpC4fhTO5BmGLO+v0GR8e7NVct71PnZdSkpFILCMglpP3m8IL5ErNCQJFreSwA3GOi we7Ei5BI11nKF3By8DuTesXZywqCqynGi1Nz7IudDIz4cOGi+txZnkDcQcNchTycdFTsBq 96nbMW8D3n3sCOZTn0zLU5ZIkgVWs5PbEc/FfR2c3W+pxGu7e3rjRBgqtdO9rbS6ti3Fki IZ96mbBg4z7Jm2odP9NCGndM/dqzHQX2aO5VIAV0qnB66LwhaLuSRIGOBdQ9Jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144543; a=rsa-sha256; cv=none; b=UkbGMAj7yk5ALiio0eEHU7OgD4mnTufOtoapUpmdHyuGqXDUGxkWrwHlZb2Jk6d7BcMspm NYDuPdh1prlBM+ViofRKsYAJVkfxvAiI8wtFOHOTfwyDwT07U91Oyc5KjJuB2nGPwhuzGM 23PvM4taEvflg4sV7K4dt22rC6TLj+1dg5sTmlJ/LZeMc2EfxMWK7JypVXDzkz0an3gexz 3sEbq3dbv1z86A0PGPMAby7i3cMsEz+fK/76Ryn6UtORbtU+i6LUywWToriz0izALNu/hz hfJfvEbMyf4c7s+Lw/Khl69aUFMbyvYHNa+Nr0xr++STdnMyRLh+fhDQ48xhlA== 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=1724144543; h=from:from:reply-to:subject:subject: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/AiDUEFWM6woieuiyZxSn11hFoqQcMCDCJzwe7ElLk=; b=fVyQNTlcZ/d11ChQ/E6CzeWa0DvXVlTh81FW7opIe0zl/nT0AUbqoKp1GAa+T5yhRPLW4a /4Q+7p3n1rCkcmU/znYcDYqQUk3T/a1nMlkBjoIOxPLsQYyuPQiv+6t0LlWr+v6eqhbuAB jadEJXfVjGfR8F67jYir1ux+OHF2LyOCgI4ufX8tt5PsCzTqz0c3N1RN42OoUnpNb5DwSN 2EgX9GH2BvqfrruXZzTNYz8jggkQA1csCDYJsXPKm2KdbPo+l7y+EfEfnTVbI8qUL8kK+t UI8dhEScfeC2Tg3Of6Cd0THy1M2kdmCFBEKrxBdB+BmIxxr7iHtAKHNn8BHRBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pq21Vjztnn; Tue, 20 Aug 2024 09:02: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 47K92NCF081743; Tue, 20 Aug 2024 09:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92NcI081740; Tue, 20 Aug 2024 09:02:23 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:23 GMT Message-Id: <202408200902.47K92NcI081740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5577bb2f67ff - main - arm64/vmm: Support tlbi from VHE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5577bb2f67ff442a92a3c0edb133e03bc28bb9d6 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5577bb2f67ff442a92a3c0edb133e03bc28bb9d6 commit 5577bb2f67ff442a92a3c0edb133e03bc28bb9d6 Author: Andrew Turner AuthorDate: 2024-08-19 12:44:11 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Support tlbi from VHE When invalidating the stage 2 TLB we need to ensure page tables updates have completed and for tlbi vmalle1is the HCR_EL2 TGE flag needs to be clear. To fix the former add a data barrier before the tlbi instructions. On non-VHE this will happen as part of the exception entry, so is only needed for VHE. The tlbi vmalle1is instruction operates on the EL2 & 0 regime when HCR_EL2 E2H and TGE flags are both set. By clearing the TGE flag it will stop this and operate on the EL1 & 0 regime we are expecting. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46080 --- sys/arm64/vmm/vmm_hyp.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index 9c84bb4b294e..bd119c80139b 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -619,6 +619,13 @@ VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, { uint64_t end, r, start; uint64_t host_vttbr; +#ifdef VMM_VHE + uint64_t host_tcr; +#endif + +#ifdef VMM_VHE + dsb(ishst); +#endif #define TLBI_VA_SHIFT 12 #define TLBI_VA_MASK ((1ul << 44) - 1) @@ -631,6 +638,12 @@ VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, WRITE_SPECIALREG(vttbr_el2, vttbr); isb(); +#ifdef VMM_VHE + host_tcr = READ_SPECIALREG(tcr_el2); + WRITE_SPECIALREG(tcr_el2, host_tcr & ~HCR_TGE); + isb(); +#endif + /* * The CPU can cache the stage 1 + 2 combination so we need to ensure * the stage 2 is invalidated first, then when this has completed we @@ -655,7 +668,12 @@ VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, dsb(ish); isb(); - /* Switch back t othe host vttbr */ +#ifdef VMM_VHE + WRITE_SPECIALREG(tcr_el2, host_tcr); + isb(); +#endif + + /* Switch back to the host vttbr */ WRITE_SPECIALREG(vttbr_el2, host_vttbr); isb(); } @@ -665,6 +683,10 @@ VMM_HYP_FUNC(s2_tlbi_all)(uint64_t vttbr) { uint64_t host_vttbr; +#ifdef VMM_VHE + dsb(ishst); +#endif + /* Switch to the guest vttbr */ /* TODO: Handle Cortex-A57/A72 erratum 131936 */ host_vttbr = READ_SPECIALREG(vttbr_el2); From nobody Tue Aug 20 09:02:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pr5Y9vz5Shxw; Tue, 20 Aug 2024 09:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pr3c69z4vpD; Tue, 20 Aug 2024 09:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hk/+nNyKip15RdrbnkZUC9OR3baog7YWcPEuzeY28Kg=; b=ThBfbbn61T9yqOVdYu9WX9KvuX6Z7x4Tk0HdoH0vYs70xQcBja+4Sf3wH6wSJz+WsEjpC/ FD4VsjwxNPtLoNiLFX5l/A2sd7FbzGA5CxTGZXTwPOgT1ho17uBhKv6rM1xrWO/H83XBSV IXgbiNTQKiQxAwO/C/SJ8zd5ea1Tmmf8cq71dslTU+A5BvNh3kmPOHpZwzt22G+Ybxi4gl 41Zg2XlnZAYmLhg7JoeEJfyHcc2VOkw7SbXVc24NxCtdDvmQM/t9f0u0UuAs/fXFyqT48L TQxt1NaY776BrLRy44iqxwHWs4t9onlVScsJ/nNj9Lq5uf9M/wmTX4PjRg7cIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144544; a=rsa-sha256; cv=none; b=T4K92mtigJBfj8+HNV217HdG1ESgGRSlRwIdI2fcy9aG3zrASatOBcvx9DFyoOtD4RhXcT wfjOD08HQk3uPeGZGkWDkNm1+HNhB8qfjdu3VwthjoivVXMnEmDNXsk5Pn+sXvuMY5QEmD AaMjiqpT81piwUyV9XAgwxb3ZRvwLtYoh84/klKMu3Vppy8xbHHnxwYwvf3Ksp8Yrrf3m0 LZyyJh79aXljl8vMa+BDWfoFFDlRhYW6AjFxjbsoREcwPWsAtrnT4VvJpS4TQRFtokdMYG JafPOXBqpU2dghDv6LtPOB3hOCHKkpdfp6yaA1cEARA7j+okTPoJRAjM19+NSQ== 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=1724144544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hk/+nNyKip15RdrbnkZUC9OR3baog7YWcPEuzeY28Kg=; b=H8XkETki8WFz/4GTCU5DmOBwXf7ST4RjvRo+9Ma0+lb5pvEhCzO9SvvRPCY3i3LqYpxeQj hzUsSZZh4EakkdEQOHf8ac30JcgLwNuBRAabWGzQpbRKTB0GFd03+rfiCNcou9XKsJku7H weyoDtPAV6bUtxdj60G0JXBELEuudAdglH3qFuHPS0wubvoBr1Lif7u5JrRoXNbL6rVq1B 4HpP54ii1MZQ4gcZuxQrE8cpyMjlJS8r0W2G1AOF0ROKBUNpk/ZpDVTwRHmCwQx6EOkMf4 oivDxlyf5ku5vd8T+8CMEz0vNpUuxoWlOUe75Em9KNI8gyn9gcOYqcX4ujW7MQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pr31rzztc4; Tue, 20 Aug 2024 09:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92OMV081793; Tue, 20 Aug 2024 09:02:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92Oh7081790; Tue, 20 Aug 2024 09:02:24 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:24 GMT Message-Id: <202408200902.47K92Oh7081790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f83a0f38d14e - main - arm64/vmm: Update exception vectors around a guest List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f83a0f38d14e26f5f7f31050786e9190cd131902 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f83a0f38d14e26f5f7f31050786e9190cd131902 commit f83a0f38d14e26f5f7f31050786e9190cd131902 Author: Andrew Turner AuthorDate: 2024-08-19 12:44:18 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Update exception vectors around a guest When entering into a guest with VHE we need to switch from the kernel exception vectors to the vmm exception vectors. The latter understands an exception will be from a guest and can switch back to a kernel context. Rather than encoding the location of the kernel vectors we can just read the value from vbar_el2 and restore it later. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46081 --- sys/arm64/vmm/vmm_hyp_exception.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index 9a1648130f49..cd2b94f1ff0b 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -175,6 +175,10 @@ hyp_vectors: /* Restore host VTTBR */ mov x9, #VTTBR_HOST msr vttbr_el2, x9 + +#ifdef VMM_VHE + msr vbar_el1, x1 +#endif .endm @@ -288,6 +292,14 @@ LEND(handle_el2_el1_error64) * x0 - hypctx address */ ENTRY(VMM_HYP_FUNC(do_call_guest)) +#ifdef VMM_VHE + mrs x1, vbar_el1 + adrp x2, hyp_vectors + add x2, x2, :lo12:hyp_vectors + msr vbar_el1, x2 + isb +#endif + /* Save hypctx address */ msr tpidr_el2, x0 From nobody Tue Aug 20 09:02:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pt0Dydz5SjCL; Tue, 20 Aug 2024 09:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Ps4VK9z4vlw; Tue, 20 Aug 2024 09:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fclc2UlIVTyK7GU6JSOBEJog36XgqLTJt+GY3B2V3t0=; b=KaqrFVhRSKKLCx+lEpf51ta+ir8d1Ht7MOOL1EyhbC462rLzzSHZki6HEEQwSrs4ronNwX POjIO7CuI9NstB//QDGSOG4SwLSPFUJPJ3HexUrAmYdBnMx9FBoYE6iosW2K5NinNbKexC yebjSmZXkvqmCFJoD+3V7N+vazaG97CyeFFqsDkIWmVuVWUFxqpjN533/dUH9pg/VIY5Hs diFZ+3wXC2BDO1xJVRtbKXjsrIPGxyPI+dLh9HoqESp95C2/xgsLrbMVRAG+iYi5jhFTzz 9OlOahjGdoG+sa+U6ZYgnl78oZsHpOjksYAT2xjMtH6ilFWLQSIevYUJI43FkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144545; a=rsa-sha256; cv=none; b=ZwKs1jVRUoRKEOlS2GbrvKCOKXi7h5ZCymIJQ5DbAPph194+tcojlUXvn8Esl4K4GKXA1R jdlrVipHixGn7ubU3hRWrcngGWH3QBTv8IWT5M6EgWNgCmo9VMZTzZVevXNnpdc29H/ELr Nv8GYz6jFw+FySh7pQJLJyoRYD9MeN3AeqjQ/fdDZzuwLIHdOcNbpxtCEsZ2xPitqaiiBb WeN3aC86fftvXgVVEQ8UmNOSypjHQFYYIrJYj7YumakfvYQhFMz13hbhtp8meaH+DirvZC wGrLlblpMu3oJ4hgzR663Weyc8OjSXY3hIeKYEYBsbhjUICk7e+Tr3q5Q+DYHg== 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=1724144545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fclc2UlIVTyK7GU6JSOBEJog36XgqLTJt+GY3B2V3t0=; b=csmhKs0hTCdGPGLJlWpg1RcOWZSzd6DGqG8Zj65pRp8E6v8Q35ud03bHhxZOvT2I6i3nnT Kk8PY6w9A00zukoZ6btM5+1yyNU1gdnBsEuhMRpDhbKuNjxSdh1+R9jtZ318H/EvEqeSoD dMdUjO9IBjB3nCq1MQMaCPfx0TCl0iVtF1TmL1qfcKEUksAnvfmF0rF5oLUCDMJLpbXz2/ EyZ8iieUFj4gr+IG+slpBbEbPXbtq88cNMgzmOQW1AuaHTw2pXN3QOdHA/DZRyBdhAhpjl 1LqqHFcFSktdsrWJ1KRGMY3+NfudvqXlsbw7PKF76hkPRk6qoDOoBVt2FcU98A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Ps437kzv01; Tue, 20 Aug 2024 09:02: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 47K92P7G081841; Tue, 20 Aug 2024 09:02:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92PdL081838; Tue, 20 Aug 2024 09:02:25 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:25 GMT Message-Id: <202408200902.47K92PdL081838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 79a19e0e8d8d - main - arm64/vmm: Hide non-VHE exception code from VHE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79a19e0e8d8d1fa71092e542671213bfe99b024e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=79a19e0e8d8d1fa71092e542671213bfe99b024e commit 79a19e0e8d8d1fa71092e542671213bfe99b024e Author: Andrew Turner AuthorDate: 2024-08-19 12:44:24 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Hide non-VHE exception code from VHE Remove the non-VHE exception code from the VHE code path. As we replace the exception vectors when entering the guest we don't need to check which context we are in so can skip parts of the exception vectors. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46082 --- sys/arm64/vmm/vmm_hyp_exception.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index cd2b94f1ff0b..95b0e20f37ed 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -183,6 +183,7 @@ hyp_vectors: .macro handle_el2_excp type +#ifndef VMM_VHE /* Save registers before modifying so we can restore them */ str x9, [sp, #-16]! @@ -193,15 +194,18 @@ hyp_vectors: /* We got the exception while the guest was running */ ldr x9, [sp], #16 +#endif /* !VMM_VHE */ do_world_switch_to_host mov x0, \type ret +#ifndef VMM_VHE 1: /* We got the exception while the host was running */ ldr x9, [sp], #16 mov x0, \type ERET +#endif /* !VMM_VHE */ .endm @@ -223,6 +227,7 @@ LEND(handle_el2_el2h_error) LENTRY(handle_el2_el1_sync64) +#ifndef VMM_VHE /* Save registers before modifying so we can restore them */ str x9, [sp, #-16]! @@ -245,7 +250,9 @@ LENTRY(handle_el2_el1_sync64) ldr lr, [sp], #16 ERET -1: /* Guest exception taken to EL2 */ +1: +#endif + /* Guest exception taken to EL2 */ do_world_switch_to_host mov x0, #EXCP_TYPE_EL1_SYNC ret From nobody Tue Aug 20 09:02:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pv186Jz5Shy2; Tue, 20 Aug 2024 09:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pt5ps1z4vZx; Tue, 20 Aug 2024 09:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UerdfGlkNOKJYGJih9svpd4L2vyq7dHMQFZPYBQrNY=; b=PbhZe8KCsQwm+jddUjMxt1g1/ODTlm5lyFKm7SCjXJKvlc4q07uYutz74EExpc3ULZhGaj neLLnBSIDuLlobTzBXlp/38B7sg0l758DQRsF7Dqb1g8ok6hPkrVUMGU4e5hOqUW7509ch fW002JqYMvzuMksD92RXHCuEqiMJqgcZEvj/vs74jzddd7R6vmlAqc+kgqs/l6iXuj9LWN 7X8cf7KJpTeKkkORmRRp5Ta+YJjqlfwkQUu0u3T1HKxjXOF1e87MEqOpEXmj+LAKjffHNZ 2Cbza8z/eRFo7koP80ewDF5KihFFSLWOA9rOZXu5kflJTaH/SoXKWAY3qOHVYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144546; a=rsa-sha256; cv=none; b=b/jpWEPvJlAi1qPzI1bBZJZSJ5o4oyX/4s90Kl0mifjTXK+tBN8p8AfGDgZ9Xhpdcc6/xv npByLVaNhrKEoiAN6lBu7DeZTLxIPphYrsYd1lqTfMtckg6z69Ipx1uwZNj+KIrHubrdfp rNPGH9zzw37+5hwL7M6ZQvw6PYv/u2YNqhw95OVf/BbJQsIjEB/6M7iAA5NUtYuk0lZZat ZlVhu33FP8b4GKTtF2Mb0JH1lWhCgklXMfLJAMiKcOS7jz4ucjNVUfrTaekR6c60IEpr5w sUeO/Ye9MLqv+echKtMvJoF9E8Ht88FwPFSIOETzeohV/X1wArBAKxbn/Y0MYw== 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=1724144546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UerdfGlkNOKJYGJih9svpd4L2vyq7dHMQFZPYBQrNY=; b=jRTIEyDJOYgP2qy5Hm1mUdmlFMTpQcPaErY1EOkt+bzfmjk8vZ5i31azsU+cDz9wKBNveb hw4oitlVcTT3sDkbXdKtBq2zLpbJ+KL7004IB69W1oeFK8sAm2H/kI+rNwXuBsxzHWL4jf lY7KPXape1qPN8n5C3fyzdoEHb/X6YqaZw+gTgBxsIDEQs/A3G74t59Xqy3xcQu+PDc/b8 hYp7HfM/ZoTQ9fBJBRlf1owSix2jJn59pHuWuDwbyrFcx6sYpJLEro/FH74iV62FzYXbTK GNOTwnJxqoW3smqDNL4GK919+tgSmBQjEs3Nh6VjY38X5cFmu3z26KW8O4olrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pt5BlWztm5; Tue, 20 Aug 2024 09:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92Q60081889; Tue, 20 Aug 2024 09:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92Q1B081886; Tue, 20 Aug 2024 09:02:26 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:26 GMT Message-Id: <202408200902.47K92Q1B081886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b87952e837ec - main - arm64/vmm: Mark asm files as supporting BTI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b87952e837ec1e42a573557a8e938693d8952705 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b87952e837ec1e42a573557a8e938693d8952705 commit b87952e837ec1e42a573557a8e938693d8952705 Author: Andrew Turner AuthorDate: 2024-08-19 13:28:39 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Mark asm files as supporting BTI These already support BTI as they use the ENTRY macro. While the non-VHE code doesn't need this the new VHE code will need it as it is linked into either the kernel or the vmm module so will be included in the BTI check. Sponsored by: Arm Ltd --- sys/arm64/vmm/vmm_hyp_exception.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index 95b0e20f37ed..50c2490f37bf 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -30,6 +30,7 @@ */ +#include #include #include @@ -316,3 +317,5 @@ ENTRY(VMM_HYP_FUNC(do_call_guest)) /* Enter guest */ ERET END(VMM_HYP_FUNC(do_call_guest)) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) From nobody Tue Aug 20 09:02:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Pw1jDkz5Sj9N; Tue, 20 Aug 2024 09:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Pv6mlhz4vbF; Tue, 20 Aug 2024 09:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nq4RrZgPMfl/PqXOPWc0h4xaoEC9jPHAXUWpFGdR904=; b=TCfchDPjfKr896Cwr35y4XiRdqgLmlf3ssu8XznZM1Pt54gidZ/cuv+p0p486euIXV5qfz Oxnga0YoUQ31pm5166s7sYfTBJt6Kpy+wamw8pvUCkfb4B3bCcDDV+MD3MFahQVTlBBTfF jEhVBvfaEIcBksCWzZqnwpa9W5xBzb/p1ZHRBhDKRY7pyZRxnATfJ9SZb9zYvA/TBm9DPX juZc4zPuIvGFK5XcF6SoLKazthN6iS4FIjZHYmupq50zpnyjZq9ccfFR4EMAso6OPbjX0N d6hXeTxKuSiO8FWkMUh3t1VOIpH5iiqdPumRTm+ryuCmH5WfUbmTAKZ5/9k0ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144548; a=rsa-sha256; cv=none; b=cvW6YYsvvOBmbzeTlQKfXxD2nVvOuTKCLRmyA4RTbtDdQ3ccmHu8D1YQRSOnxx/yge5Rrf zLAfamE+2GrWyZiCOcPnWgX6CI/TRO4636p5ApaCXW7Okk0aaoM/Nf3+UM2C+Lj7Z0NJgM ctLgolV2wbrYeNgVtpLnQPVoNMTCpWiM42lH+StF2SgHpCLpe9z51zsl4mNRiFMI5Rx3N1 j8z5zLroRmqXAFvS4wDtCq50A4Kv6buzmIBkW0wNhNuaCmIkGmD7YBkpDuADszx1sR1MC6 qcEHs/dJTIoBPCqvMx/fMwIppzCTyfTvpAdhKrRfbSLOxH2/onQ7l5GReMb85A== 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=1724144547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nq4RrZgPMfl/PqXOPWc0h4xaoEC9jPHAXUWpFGdR904=; b=yEZp0Ji/d+1kdckSgfLpo+zF+JpA5Ve+PThrgmVCxt7rCpmhhuDchBG+q2WFQnW1VfkxPY 6NKx0cEkqlV3XHLQBikv1o8lokHWtNptEHuYaFKfLDrMSRJchtYQ33tAvThKJVTtbgE4XE JCHVJ6RN2zx/y8UcM86eAfZO82KZ6Tmxw9S/TtKUR/xd7Ruv4doZ+sforYlDadc9LV+KKx AG+UaPCPRQYxYnVpol4Nfu5UKRZ4YgT3VZY7u/qCLQ9/zhoRv3AUFhE+/YEL6PL04F19sb Bos8fe+ZNAL8wHttTSEtkI3uT3+Sj2kA/jr5fobVVpVZBVHkr67TnoBUwltv2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pv6MgXztpl; Tue, 20 Aug 2024 09:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92Ro0081940; Tue, 20 Aug 2024 09:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92Rpv081937; Tue, 20 Aug 2024 09:02:27 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:27 GMT Message-Id: <202408200902.47K92Rpv081937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: bbe97db3c211 - main - arm64/vmm: Add the VHE exception and switcher files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbe97db3c211bd0a89a5b9c1a58857625b763475 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=bbe97db3c211bd0a89a5b9c1a58857625b763475 commit bbe97db3c211bd0a89a5b9c1a58857625b763475 Author: Andrew Turner AuthorDate: 2024-08-19 12:44:31 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Add the VHE exception and switcher files These just need to include the common code with macros to ensure it is built correctly. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46083 --- sys/arm64/vmm/vmm_vhe.c | 39 +++++++++++++++++++++++++++++++++++++++ sys/arm64/vmm/vmm_vhe_exception.S | 31 +++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 2 ++ sys/modules/vmm/Makefile | 2 ++ 4 files changed, 74 insertions(+) diff --git a/sys/arm64/vmm/vmm_vhe.c b/sys/arm64/vmm/vmm_vhe.c new file mode 100644 index 000000000000..8a12852e2a7a --- /dev/null +++ b/sys/arm64/vmm/vmm_vhe.c @@ -0,0 +1,39 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "vmm_handlers.h" + +#define VMM_VHE + +#define VMM_STATIC +#define VMM_HYP_FUNC(func) vmm_vhe_ ## func + +#define guest_or_nonvhe(guest) (guest) +#define EL1_REG(reg) MRS_REG_ALT_NAME(reg ## _EL12) +#define EL0_REG(reg) MRS_REG_ALT_NAME(reg ## _EL02) + +#include "vmm_hyp.c" diff --git a/sys/arm64/vmm/vmm_vhe_exception.S b/sys/arm64/vmm/vmm_vhe_exception.S new file mode 100644 index 000000000000..286f5df03707 --- /dev/null +++ b/sys/arm64/vmm/vmm_vhe_exception.S @@ -0,0 +1,31 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define VMM_VHE +#define VMM_HYP_FUNC(func) vmm_vhe_ ## func + +#include "vmm_hyp_exception.S" diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index b522177221e5..b105ce873d24 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -145,6 +145,8 @@ vmm_hyp_blob.bin optional vmm \ arm64/vmm/vmm_hyp_el2.S optional vmm \ dependency vmm_hyp_blob.bin arm64/vmm/vmm_mmu.c optional vmm +arm64/vmm/vmm_vhe.c optional vmm +arm64/vmm/vmm_vhe_exception.S optional vmm arm64/vmm/io/vgic.c optional vmm arm64/vmm/io/vgic_v3.c optional vmm arm64/vmm/io/vgic_if.m optional vmm diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index a3a878a653ff..0604a34690e5 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -30,6 +30,8 @@ SRCS+= vmm_arm64.c \ vmm_call.S \ vmm_handlers.c \ vmm_mmu.c \ + vmm_vhe_exception.S \ + vmm_vhe.c \ vmm_hyp_el2.S .PATH: ${SRCTOP}/sys/${MACHINE}/vmm/io From nobody Tue Aug 20 09:02:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Px3pJmz5SjCg; Tue, 20 Aug 2024 09:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp3Px0gtWz4vf3; Tue, 20 Aug 2024 09:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hiu+cNk0y5r/2ZIERIPD+fm++fr5Jw0Q3tVewGBYMsg=; b=XOF66POelRX2QitIVPtHmBqdG4xkU3S5e/4AYNpmGSaJ/k4iWZdz8nWCyjMYKqAaDd9rFf cpB3+wRlq0gQwGDwS0YWq8jr/KqfaTf0sO1IIv6uFcFMNK1mEzRyqyBwfFCepqKUSBmsqy CqGNj0X52PTwNNHaLMuvUJteLvNdRbiK1p6TCKHNL/dKCBWNNjYyhCmoo05AeZtGEjsa5d eqMRM3q6WYf7GabxbVftY5QolqHE+Zw0usLoS/jIae5FytxDJ60cTOp9Gv5Emumbu5t1mE WybgUJKcveEUR4pDbAR+RuxazkKS4wumHPzeI/zGD3EIcr9LKzJdq51lTNef7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144549; a=rsa-sha256; cv=none; b=qD6ImKPKIkYFiJY81kwjHdKkkdKDdWR9v0tvzMJrM2TmXPX8a2zCDPnvFH5UBWZ5J2uSy1 tpCMdQscvehwc7XQzaGAAyNw2K0kwGUzsItTF2MffyoI97E52OCkVcL1DxU7Sz4bFbXwWd wT2TeyEoT7uxV+vZsCkvCMeKWMAPH8Mzc3tP6BgZLL898wK5+T3QKis2u+cvDXhkReMjNT i9c23HX1NYjN/3Hn3dHPAcu8hGvcbs2jIDew9EXItpsWbF7hjseOkIMYP3OQKM/RL9hfQJ p7HBGxEagC6gZhNfqqTx5O105qZUSWvA3WJnmwLKdyaL2l8cuZ9HR3ZjzgKv7w== 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=1724144549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hiu+cNk0y5r/2ZIERIPD+fm++fr5Jw0Q3tVewGBYMsg=; b=VrpfcVuMXT6hxAhUmGyIzgK+Cjrwtom4j74TuyOolUcFzgoHUXi+IArApMP/cLj11KrkTE cBzzAw1pXDg9Dtqkt/WDA0PsH/sc9leWNTr0oMEIPhESkS0NhCvM43kjHGdz4w+2erXkHK 4FGP1JxjkyKsTN9kqVB93QpBJxLnAwrq6TxyPoK/L8weCrqVjfABi6qdkYTQ6+hPDZ3QmO aYngjLCeatxlagmzxmlUjyKdidXPhtEI4swPQYKgjUEi9dU4oDSgaWIcnqeQ2QzrO2QQrs ad5gJ69UNDSktTpbClSEbFd0++nw29rBlSvihuUs373DpDJYFk3vDsvBo5pP5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Pw75bRzv4b; Tue, 20 Aug 2024 09:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47K92SEd081990; Tue, 20 Aug 2024 09:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92SbR081986; Tue, 20 Aug 2024 09:02:28 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:28 GMT Message-Id: <202408200902.47K92SbR081986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7279fa6af13d - main - arm64/vmm: Convert the handlers into ifuncs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7279fa6af13d1c370f9bcb293562c694090d849d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7279fa6af13d1c370f9bcb293562c694090d849d commit 7279fa6af13d1c370f9bcb293562c694090d849d Author: Andrew Turner AuthorDate: 2024-08-19 12:45:54 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Convert the handlers into ifuncs Now we have support for both VHE and non-VHE update the handlers to use an ifunc to decide which version to use. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46084 --- sys/arm64/vmm/vmm_handlers.c | 68 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/sys/arm64/vmm/vmm_handlers.c b/sys/arm64/vmm/vmm_handlers.c index 2ce674d5ba46..c567b585eb06 100644 --- a/sys/arm64/vmm/vmm_handlers.c +++ b/sys/arm64/vmm/vmm_handlers.c @@ -33,33 +33,81 @@ #include "arm64.h" #include "vmm_handlers.h" -uint64_t -vmm_read_reg(uint64_t reg) +/* Read an EL2 register */ +static uint64_t +vmm_nvhe_read_reg(uint64_t reg) { return (vmm_call_hyp(HYP_READ_REGISTER, reg)); } -uint64_t -vmm_enter_guest(struct hyp *hyp, struct hypctx *hypctx) +DEFINE_IFUNC(, uint64_t, vmm_read_reg, (uint64_t reg)) +{ + if (in_vhe()) + return (vmm_vhe_read_reg); + return (vmm_nvhe_read_reg); +} + +/* Enter the guest */ +static uint64_t +vmm_nvhe_enter_guest(struct hyp *hyp, struct hypctx *hypctx) { return (vmm_call_hyp(HYP_ENTER_GUEST, hyp->el2_addr, hypctx->el2_addr)); } -void -vmm_clean_s2_tlbi(void) +DEFINE_IFUNC(, uint64_t, vmm_enter_guest, + (struct hyp *hyp, struct hypctx *hypctx)) +{ + if (in_vhe()) + return (vmm_vhe_enter_guest); + return (vmm_nvhe_enter_guest); +} + +/* Clean the TLB for all guests */ +static void +vmm_nvhe_clean_s2_tlbi(void) { vmm_call_hyp(HYP_CLEAN_S2_TLBI); } -void -vmm_s2_tlbi_range(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, +DEFINE_IFUNC(, void, vmm_clean_s2_tlbi, (void)) +{ + if (in_vhe()) + return (vmm_vhe_clean_s2_tlbi); + return (vmm_nvhe_clean_s2_tlbi); +} + +/* + * Switch to a guest vttbr and clean the TLB for a range of guest + * virtual address space. + */ +static void +vmm_nvhe_s2_tlbi_range(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, bool final_only) { vmm_call_hyp(HYP_S2_TLBI_RANGE, vttbr, sva, eva, final_only); } -void -vmm_s2_tlbi_all(uint64_t vttbr) +DEFINE_IFUNC(, void, vmm_s2_tlbi_range, + (uint64_t vttbr, vm_offset_t sva, vm_offset_t eva, bool final_only)) +{ + if (in_vhe()) + return (vmm_vhe_s2_tlbi_range); + return (vmm_nvhe_s2_tlbi_range); +} + +/* + * Switch to a guest vttbr and clean the TLB for all the guest + * virtual address space. + */ +static void +vmm_nvhe_s2_tlbi_all(uint64_t vttbr) { vmm_call_hyp(HYP_S2_TLBI_ALL, vttbr); } + +DEFINE_IFUNC(, void, vmm_s2_tlbi_all, (uint64_t vttbr)) +{ + if (in_vhe()) + return (vmm_vhe_s2_tlbi_all); + return (vmm_nvhe_s2_tlbi_all); +} From nobody Tue Aug 20 09:02:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp3Py3Y4Jz5Sj9Z; Tue, 20 Aug 2024 09:02: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 4Wp3Py1c4Gz3wbp; Tue, 20 Aug 2024 09:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7uITKvnLS6tcDa3OslCKFrJW0gJYP7MoD96HsuxMGIg=; b=qL89tI0ZFi5qqxFNXwv6SgNijhiqRQvszyUMnlAjvgHEhjw7E5KyI/r6BMaBG10lgMjj7K PVCNGA05c8XaAyzyZ7WCq28FMc08nxJuyozpWj2K296jBcB3UkaPSidmtFusLe/KGa+Zyf HKnB7avZ4RtDd2ZkIQIyVqCsX7ywVyp1unU15cO2mT/9KgXbKdaU6l0S2cX4LWjUjVaW+c bO8B18UqeBqKCZ+zblSGs5CHy4SlOoN7dLiHowThnscoEWLroLyA64IjZtuRPiwReb3SYl ZRNTpfj+0IdPcRwUzHnKicCnGSRmKqwQkDbfV4mII+uB0MDeatnCRYwGc1Z6ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144550; a=rsa-sha256; cv=none; b=UcORaDn7RLGpr/R1mId4QjjEpaRKJU8a64mnI3Dy+LbIzPx7VWD7ZPVz8s0RC1efsiH8hI WRZYs6D/eHlY4Ox1zY3ETcCM96uUrgP7rpMT2p/ziy/omq1aLnUda8O0Q6E+hOo5KTfCW5 QMOJKC3kq1DJI+GatiLy8STQT/43hkd+OriZ5Po4ddppnO4UfU9i2SbxrIpAwadX3zl0MZ bx+/jfEimiCleiMWh9H3IXNfHHpsWshz+xjxNYSniBeMYS0tIhSbett/zxt8gOf5qZ4rKG XfZqOaQFr7fK3rs9u3r+FOfDBov0WheAOSHSazByKDYrtdmv1jK3U2SMg38Nmg== 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=1724144550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7uITKvnLS6tcDa3OslCKFrJW0gJYP7MoD96HsuxMGIg=; b=S6EAMq4DmZaH+7nI+dnV5fcuqRALX54frNkDlLVRV/jlOBrHX2ZDDoNj7sict2lJwD3utt zRtwWVYLH/lbGnsJruiiAc5bs7Ep5Wg+qgNx8oqSCqVbP+M+Dl9pri5B5blHqzS6lJCH9f TdMXdBHVXOMROS71cDTD1NqgU73mFM2SctVGe8bzVJYB251E6bkLNqcjWsfQ30AkbWr0ym dkzflwjxxipGZt6BnQsflbdsoCm/+v0IP8ghBiB9qxT2RDoAasw36dpRKU1sNj6a8NyscT NtL6ZjYnXU3lMh9LTQLeESzj6hrAkjCoI5RbRXKFWaeOfiXR6KaXF9JacMVXLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp3Py144Xzv0D; Tue, 20 Aug 2024 09:02: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 47K92Upn082041; Tue, 20 Aug 2024 09:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92Udq082038; Tue, 20 Aug 2024 09:02:30 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:30 GMT Message-Id: <202408200902.47K92Udq082038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 53b8812c9a99 - main - arm64/vmm: Allow vmm when in VHE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53b8812c9a997ef7e8879484890ef688bca4acdf Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=53b8812c9a997ef7e8879484890ef688bca4acdf commit 53b8812c9a997ef7e8879484890ef688bca4acdf Author: Andrew Turner AuthorDate: 2024-08-19 12:46:00 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Allow vmm when in VHE We now support VHE in byve so there is no reason to block it. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46085 --- sys/arm64/vmm/vmm_arm64.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index 3079353668e3..164ff65cfe2c 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -246,12 +246,6 @@ vmmops_modinit(int ipinum) return (ENXIO); } - /* TODO: Support VHE */ - if (in_vhe()) { - printf("vmm: VHE is unsupported\n"); - return (ENXIO); - } - if (!vgic_present()) { printf("vmm: No vgic found\n"); return (ENODEV); From nobody Tue Aug 20 10:12:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp4yH4wTgz5Spjd; Tue, 20 Aug 2024 10:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp4yH4SrTz4BtC; Tue, 20 Aug 2024 10:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724148727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pB3BRIiJS1tZT415bEBBg/B9e6COBTtABvD+dc1ZKIg=; b=q8XtDRYGCTaKo6nBwxRDJu3nKQfSC3NbkH2eHa2bMEwtWDRvhlJjNedajE6ymtSyF2HXeK m4eknriZ3c7sXY086MtH1j3SIhje5+om2cngF/X7Vo4pPp212g62TkaWWPLod92Edn/B8a CLhM66kMy/0QUBncZAu63cIDzJOEAbDw/MrjOUAAf67dcja964AYFdw6hMnLoFehP/fZU9 qx5B1b5Y7EwC7lqtiZAAMZ0cK4N0IH6jsL6bs/gOPDPNjUEFfIYzs7h05EecQyrBXRqWlv eo6qZHuIpY7ti9KSuIJoFOvuOJRVBAc+vt0BR5hq//bYvl0BoQHUDkzu1fUqmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724148727; a=rsa-sha256; cv=none; b=FdtRB7l6dG2FfB0C+dpwubwxmd16I2tVzm/huTgSR8iHSRMNxZkWj4uJlR4VXNCMQy670O 88aEaDu5ec36Vcuag05zg7VVDMv0A67WVf6bQKnIExuAFw7LJYykFCHrM4tQd25J18sich uYo60QaWGZBJqdV/j90TYVGCDm+d4gYtlilHtbTTLV/v6ySj10gjvrgFZPwf3e7kr3Qx7v sE5DshnOMSoQYP7MfIF405OBknp5+HhDzYbR1EgYB9u6/kmVYCp5q9gDRQfNFXqKFbqTvc 1PC05XxwO/6nIHZ3hZKjunVYjCNRgEYjUyM1bT/F9vNQcI6dTOdin16OypwRqQ== 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=1724148727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pB3BRIiJS1tZT415bEBBg/B9e6COBTtABvD+dc1ZKIg=; b=Jg4PCZdDLMFBQAANRYqMtMBO9SbZVMztBRW9pcRThvjfHKeXRKsBS3Ajwo7TJVc7ioV0KQ fqry3Kw78d/mR66Pb/XyaUMnJLJjBwgnV2kpgSw7nnUFvjbP9AA1KVFgSgiaSZJDqlHBGr qSM8//wjKgYo8CI27QuvD1qTVoh1TOVFXQ5K5gBgFExxAKP6ROh+CmEzSwuarDlxtaWAEp i2ljQRvqr1GMdK1kld7N9gSRCQzeDNGMnHeepV1utLU6w1q67pm0Een4Ihjl+TBvzbTfpj YN8w3nivRFyaCtUqi7vlN597r8EYS5yrfyfSi1HYjgN5m5NclaXFIjbMrNrUZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp4yH44pRzwck; Tue, 20 Aug 2024 10:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KAC7pR099577; Tue, 20 Aug 2024 10:12:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KAC7wM099574; Tue, 20 Aug 2024 10:12:07 GMT (envelope-from git) Date: Tue, 20 Aug 2024 10:12:07 GMT Message-Id: <202408201012.47KAC7wM099574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 19fb9ad74651 - main - nuageinit: readd ssh key parsing when key is in meta_data.json List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19fb9ad746517c7af9d79a982334b2550f285355 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=19fb9ad746517c7af9d79a982334b2550f285355 commit 19fb9ad746517c7af9d79a982334b2550f285355 Author: Baptiste Daroussin AuthorDate: 2024-08-20 10:04:01 +0000 Commit: Baptiste Daroussin CommitDate: 2024-08-20 10:08:29 +0000 nuageinit: readd ssh key parsing when key is in meta_data.json in openstack when no user is specified but a sshkey is provided the information is stored in meta_data.json under "public_keys" PR: 280461 Reported by: tdb --- libexec/nuageinit/nuageinit | 6 +++++ libexec/nuageinit/tests/nuageinit.sh | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index f268f9b0f52c..622e294bb531 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -164,6 +164,12 @@ if citype == "config-2" then nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) end local obj = parser:get_object() + if obj.public_keys then + local homedir = nuage.adduser(default_user) + for _,v in pairs(obj.public_keys) do + nuage.addsshkey(homedir, v) + end + end nuage.sethostname(obj["hostname"]) -- network diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index c6a86bc15486..b5078e256853 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -8,6 +8,7 @@ atf_test_case nocloud_network atf_test_case config2 atf_test_case config2_pubkeys atf_test_case config2_pubkeys_user_data +atf_test_case config2_pubkeys_meta_data atf_test_case config2_network atf_test_case config2_network_static_v4 @@ -242,6 +243,52 @@ EOF atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } +config2_pubkeys_meta_data_body() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + if [ $(id -u) -ne 0 ]; then + atf_skip "root required" + fi + mkdir -p media/nuageinit + cat > media/nuageinit/meta_data.json < etc/master.passwd < etc/group < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: a6ecbf2b3585 - main - nuageinit: improve debugging when mkdir fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6ecbf2b35856e312d1e826b206142b9f930a760 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a6ecbf2b35856e312d1e826b206142b9f930a760 commit a6ecbf2b35856e312d1e826b206142b9f930a760 Author: Baptiste Daroussin AuthorDate: 2024-08-20 10:05:25 +0000 Commit: Baptiste Daroussin CommitDate: 2024-08-20 10:09:43 +0000 nuageinit: improve debugging when mkdir fails --- libexec/nuageinit/nuage.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index cca1fe9b4678..116ab143ccfa 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -188,10 +188,7 @@ local function addsshkey(homedir, key) chownak = true dirattrs = lfs.attributes(dotssh_path) if dirattrs == nil then - if not lfs.mkdir(dotssh_path) then - warnmsg("nuageinit: impossible to create ".. dotssh_path) - return - end + assert(lfs.mkdir(dotssh_path)) chowndotssh = true dirattrs = lfs.attributes(homedir) end From nobody Tue Aug 20 11:54:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp7Dn41h0z5Sydj; Tue, 20 Aug 2024 11:54: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 4Wp7Dn3JQmz4LfF; Tue, 20 Aug 2024 11:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724154889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BHhBn0pHL2Tzelmh8wAQJjXNrBNRhOXg7mlutw/4NM=; b=RVOKof5F+gJbdiqcRmhvQs/3/OnIZ5ZGareZihZwq6qowzMsMP3rmlKvbmF8S/401P1Vgb tp+KdzaALhoEZbs1BxNYO17dr/E2Cht14QCZ16bVkcuUxQp/Jou/qX5a8CR2mDMeyFqVOQ u/WkQzxZLkT1C1K1wBsPQHj/VR6vGpHCOvLvKWE4BxuCL3IDcKDRrkn332thtc4r4WFeGi g0IScKXf67x4P+7MA8oAxFWDqk88BE4SWyducGM+f4KgbTd5LmkQ8e3pC+782XRyVl7Ui/ RsdyBxZ4jaNIRs1/ZVhgfZ9W67O+OyPnthn2xaw/GDCv/PAXc1mi4ksINYAAqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724154889; a=rsa-sha256; cv=none; b=mpyfJic0C57QLNJh1QaDXrW1XIridTyV84vet/DJqo7yaBTZ/bXg4E93xcY+AODlKklHjU XOtEwW4VuGqhrbT53JJH/z3mYidTKX2SB6xqzZ9aQ6JsK3bYBh7GrTJs7Gl2juAI6uPEn+ rUCJNPAx2EK4Wz87knumbORfLT2P6YjEIyFUdJPfzCK4iEcQBdw1LSt92saePT/9eezEId Nn4llDveZro/IqpQxY4a/jH/lXoG2M7zVr9KoxvTuIZ9wvdaU3BTJAl5rss5XGCmYZZ1b4 zNABVokmI2GWr8XNTanVqmVkx5yb4rLT8BeoV5luUrjC2cjFIuvZKGyAU/acYQ== 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=1724154889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BHhBn0pHL2Tzelmh8wAQJjXNrBNRhOXg7mlutw/4NM=; b=ccjdvlaf7ZPp0VcGh+zncc817XhJ48AAxFX39WFbh7Pp58je4QGp2IZ7RBPs1FxR6BEbZj nwonueqpacm4CnjjAUEjgPuxUbXw23ao642zW62OKnvt9XqwvLHblJvu0U1ey7eyU30eRE b7TjhWBOS0OHuEWmBlmOm9h2JDyox+switjyGU/MHJe9NuBvYiAJXUzFFBGyDyKuIOcQKU TPHhJpz+9b2FPgXAZ+mMXuGB0DEEcpd/PV+ruC8mtLd54TjwL2VkjSdP24pmnOSJ+vfTyp PdmokpYaGkrnLPe5OlWMxbach7u4ZVJxTYKn06ifZJzhAXa06yC5uVUWDIwRPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp7Dn2vVrzyrc; Tue, 20 Aug 2024 11:54: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 47KBsnpn068308; Tue, 20 Aug 2024 11:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KBsngJ068305; Tue, 20 Aug 2024 11:54:49 GMT (envelope-from git) Date: Tue, 20 Aug 2024 11:54:49 GMT Message-Id: <202408201154.47KBsngJ068305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0a5996443b61 - main - src.conf.5: Fix spelling typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a5996443b61861d6658ac216699b6717f05930d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0a5996443b61861d6658ac216699b6717f05930d commit 0a5996443b61861d6658ac216699b6717f05930d Author: John Baldwin AuthorDate: 2024-08-20 11:54:12 +0000 Commit: John Baldwin CommitDate: 2024-08-20 11:54:12 +0000 src.conf.5: Fix spelling typo Sponsored by: AFRL, DARPA --- share/man/man5/src.conf.5 | 4 ++-- tools/build/options/WITH_UNDEFINED_VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 200ce8211e17..afdf3ee51619 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd August 6, 2024 +.Dd August 20, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1759,7 +1759,7 @@ and related programs. .It Va WITH_UNDEFINED_VERSION Link libraries with --undefined-version which permits version maps to contain symbols that are not present in the library. -If this is necessicary to build a particular configuration, a bug is +If this is necessary to build a particular configuration, a bug is present and the configuration should be reported. .It Va WITHOUT_UNIFIED_OBJDIR Use the historical object directory format for diff --git a/tools/build/options/WITH_UNDEFINED_VERSION b/tools/build/options/WITH_UNDEFINED_VERSION index 71b048349a6f..99f687d37bcf 100644 --- a/tools/build/options/WITH_UNDEFINED_VERSION +++ b/tools/build/options/WITH_UNDEFINED_VERSION @@ -1,4 +1,4 @@ Link libraries with --undefined-version which permits version maps to contain symbols that are not present in the library. -If this is necessicary to build a particular configuration, a bug is +If this is necessary to build a particular configuration, a bug is present and the configuration should be reported. From nobody Tue Aug 20 12:18:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp7mN3gnTz5T1cJ; Tue, 20 Aug 2024 12:18: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 4Wp7mN2pxBz4QFg; Tue, 20 Aug 2024 12:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724156324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNRGKrmiHVXfXcudmRTor7f3NfYyEp3jFvFuwMujrgo=; b=geN8QfZjCQ8I8iR6/FKDAlJQl2SaqOMYBOItRUBp25+g2jkC+bzDrQsZDV2zRRIpwrKkzv C6sK7YCuRlR1+w2qYpBiV4xtKNCfTZRRA0JmeBLBRHnie9nHRCZXHX5WUI8YifU7yTPyX6 V7X7QhmnMljtTjc61qBJSKc5QOAv07P0mICUvuMjA7ZBF9HUNwjRIoa/Ra+EO0wTNTMvPd U3GR5MX403v7iql3S7XlcSIW99OcFskz1CvnhmjQFqbSnyn6lshO2ud4H5RdTHv6xbXsy7 jwIdtoeNluTvSq7NHTs66G3zN/qxs8iGGWiQhpi6IJw4yYk/1XShqnNw/2Fx5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724156324; a=rsa-sha256; cv=none; b=BPM39Gu5P8J1jTCPnGWj8GqfDa0YTO2DRWz+pMqByqVAWxnPM56ywDxWIh4yeoYbRP1yPO 2ClSLGViW5h0yjTRn4pIgwnqIwmBrO/UsY/mBP8yJZpzcSTxXbPYQk/UVEqb+yN5UPfzWU P3wgIqLNkPC7A3OoQ1c+KjYdibTTcW4jy2//P3s86TtcB9pUjqH4RnO15Jizkm/bVw3FO4 6KwwEkrAAxF8FrkVDZMdGCHpZxJ/x6hNPrwaEKG6MddJ33NjCH1n/U95BjRQjJ3V5Cv3Do bHXTr+UcI+8/Wejx6ZFp4m8zP3GQpfaPe3koR3UhmoXww4W7sSmUMDRZEoziBw== 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=1724156324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNRGKrmiHVXfXcudmRTor7f3NfYyEp3jFvFuwMujrgo=; b=TLpqSqB1Lw+gEL20BM1g/NdSi61qnQ9zew7ysswNUFHb+lUfEgLScP0Ruw7CH1tlgEBBe7 Lj5Yf1nb2tVeYbzst0qwk5sXAGuNEVgOkFL4ZDFJfD16EqsDS2Y3GJRYzaQWrXtRqdcFpd xAxu8ygSOeEMYX2GmeNLDMB+ZgRXWlIab/AmfS7zDudz7sSCv7zhxy1YFEkOS3M0CELf+J aFUorgFG6Wr+Ide9WDzzUVse5YdprIDNIix83XQki/WAS3HALqAa8rMzy+4lDqakoo4w4V x5TYX4SbafQ+ktaQZSv34nNMxOmm8X6W4F858ctix3sIQxYWqP8xvzK4QbVOrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp7mN2JXqz10kQ; Tue, 20 Aug 2024 12:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KCIiVn003732; Tue, 20 Aug 2024 12:18:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KCIi5i003729; Tue, 20 Aug 2024 12:18:44 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:18:44 GMT Message-Id: <202408201218.47KCIi5i003729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7d12558904ca - main - pf: Make pf_test predict that m_len < sizeof(struct ip) is false List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d12558904ca5b6f830a4ba9f7b1f8ba119bc5e3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7d12558904ca5b6f830a4ba9f7b1f8ba119bc5e3 commit 7d12558904ca5b6f830a4ba9f7b1f8ba119bc5e3 Author: Igor Ostapenko AuthorDate: 2024-08-20 10:02:56 +0000 Commit: Kristof Provost CommitDate: 2024-08-20 12:17:59 +0000 pf: Make pf_test predict that m_len < sizeof(struct ip) is false Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46374 --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9b1601ac0ee5..ad2dc2e707ed 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8354,7 +8354,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, pd.af = AF_INET; pd.act.rtableid = -1; - if (m->m_len < sizeof(struct ip) && + if (__predict_false(m->m_len < sizeof(struct ip)) && (m = *m0 = m_pullup(*m0, sizeof(struct ip))) == NULL) { DPFPRINTF(PF_DEBUG_URGENT, ("pf_test: m_len < sizeof(struct ip), pullup failed\n")); From nobody Tue Aug 20 12:43:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KD5Vjxz5T440; Tue, 20 Aug 2024 12:43: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 4Wp8KD4zvfz4TBR; Tue, 20 Aug 2024 12:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+m5r1p//1YsbV9K95dEQtvNtIk/2LDi22ny+791LYbk=; b=iVBQ3ZC0uYENEGccv+GSYYnZ00mMcfgGatvF3w9cPAvVNFY3MBm/MTicwySKdWX/m/icTz 1gSzjUhqQ6Ty1aj2A/gg/XmY5syxHhLMvDUwj7F5iTpmixLY/xpREHuJCYX7RvnUe/SIQV jXdjH/W49LaPc8K7dN6Pby0TZP5uMG1O8f7kEM4iOTSlaY2Usi6n9K+88S7gg00wKNTkgW exfdvBYRpqITjrJEoiluZKa6AdNdKz6fn4vqUxxrWZ/JFbHdx2eZr2D8LNZUudRrPY+wzP BR/3NgoSIrdvAyGySSma3XdDvx7OCDyozWjUoc0Wr8TZ2A9IS5Tf8u9cYasGoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157824; a=rsa-sha256; cv=none; b=MZmA+9pFtjBRSsQYA5NQpZbfhvfBLXp+5cpciIkGF8i5Nu+UmESdfEmNyxnGOrM0GV0YMh WMT1AORo2tZcHdl7YmoJFWzrHu7qL2jVmQPh17VgBmx8bTRjd/q8NWNrjeHU2jZ6Xg0Yoc 7b/08iAej00n054WateD4rQhrmmXWguxPPmq/+4U8ErwowNjZSsiFv/VVOC0NGqU+YHli5 YbNmdy6iYJHAq/Ci0MFtHjsynEzlf+S4ZKJNnOE3o0hYuGGnHS8ysgd0WqHY1KxFVvCGZM voe1ansLyOW83voSu5Cf0gNWVbnfq/aRqosbtCAD5rqRb9BlJN23Rn6L529PJA== 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=1724157824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+m5r1p//1YsbV9K95dEQtvNtIk/2LDi22ny+791LYbk=; b=prZPprCWpthhCP+Rad1VhR2z44r5olM5C6KEimpnOyfSq6CjfEBffG6oBv+UxDSkYippLM ywsJ3uamvkanXBArvhxfFcxrGmRcXH874pz2bBGOSrpd1mPbGbO2sa8pADPfd9QspwVIpr pgDOu9WmqotpUdpJCjR1ffSyuR7ke0aFjv/gyKpUiW1Zpmq1Rw2bXTqltiXivGbsNjOdJ3 xJJKH6Lo+ddBxwJV0ZFBsxVVjEn5FnhKCw9YNS46audXlVZjA7LsyWRJP8CMIxVgSnebWB Bq7YWzBRFJfAJcs7RZHwLTmxr0X7lnIqAdiFK8tz7m3Is8Ck0wUzlHg8g123Vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KD4Zv4z11MD; Tue, 20 Aug 2024 12:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KChiT0054197; Tue, 20 Aug 2024 12:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChi4d054194; Tue, 20 Aug 2024 12:43:44 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:44 GMT Message-Id: <202408201243.47KChi4d054194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2787f8c39c60 - main - mlx5en: stop including mlx5_accel/ipsec.h from en.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2787f8c39c60f7510f9bc04ec46fe0b37ece0e3e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2787f8c39c60f7510f9bc04ec46fe0b37ece0e3e commit 2787f8c39c60f7510f9bc04ec46fe0b37ece0e3e Author: Konstantin Belousov AuthorDate: 2024-07-31 22:13:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 mlx5en: stop including mlx5_accel/ipsec.h from en.h This creates a circular dependency preventing inline functions from ipsec.h from using en.h definitions. Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_en/en.h | 1 - sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 1 + sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index cdc8caa838d6..8966aeacb890 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -70,7 +70,6 @@ #include #include #include -#include #define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c index 1601557e52cc..ac275b5b145c 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c @@ -27,6 +27,7 @@ #include "opt_ratelimit.h" #include +#include #include #include diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index a80235f0f347..acb9f72b15c3 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -30,6 +30,7 @@ #include "opt_ratelimit.h" #include +#include #include #include From nobody Tue Aug 20 12:43:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KF6yGcz5T441; Tue, 20 Aug 2024 12:43: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 4Wp8KF66ZLz4TNj; Tue, 20 Aug 2024 12:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z2Xiyk40Ozi/PfPKQGQ0BsJPBgWp1ODwHzwgs5iPWQA=; b=CGOlSYnv156WKxATNCtg5ZdZ8wX2ysyWZRf/TlYWXQyq7FZZ8/odwlyg4k43xGgykb3a+0 9NKQdA5WnogX/1lRaukiD/nwuAezEndMfd3BEiiBskWd1YktceaGzsnDTjcg3u0zShwL2k 5Zb9kzu1E9qFaD6jkjL3vSQ29SAJCVejEuFYplSh1G3ElVjWAmOdFVZrwYFktdXWLfokYe Z5BEZ0ZABXFGbcLziu80IONKdwYwco21abB1JsD+KjFWM0eN1uO2vIC9E9rQaeWY6MYMXC jMsrlqXcN3MrBRLm6HoX99soS+eyuLB7HVbxuUm1DvdmN3vSdQmYnSshrm7Dwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157825; a=rsa-sha256; cv=none; b=E63cwNQQ5hj7ezbIcQnUQbyp8DtSKwjffuHSfnz0x5y6FlxWYECglkD015yJwufrshuSnk ndfjkZcu8lpcehfQgQ8QUOSVpWqLaFVMLgp5dMoR1NQFDvizeLWWqJcx20z8w3alkvsRlD W87wNDEfp+D7YRf0z7QrnchsTQucAxQ+Pema+4GIGOElfqO7MGOE3Gx/fPhQN3Bf7q3lUH a4iNQe/Muw5fvFPWa/B2zzEWZRftuMkEoIR8EmxWNRsjd//te3KpYBcC//2zxxNOntPnlT NL5irodwULrd6hthnz0c5HK9T+mHBmC5KW6nBM1vZ4nDCTHkBC5GwcuNPAMH3w== 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=1724157825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z2Xiyk40Ozi/PfPKQGQ0BsJPBgWp1ODwHzwgs5iPWQA=; b=ZaxRz7NvpqFn9mnEf+F3wx+WHzkWp/bsbtsIkH2ZrULdgsKWMxfGdovbDwpriIgrizTgJv 45XDEl7NEXAl4dt4BwduA4Ps0uNoZF9a6kgLmc7RweQKkA/6RzdryihAjw//EKaDd0LGA3 60yfvOG1Httv86qlY7RqV8C6nmabvpvTPuRSI5GGyD9N5hIB4UbvnzGSaph/ltb6Ku9I/j s4lCvcrfsFwtoJKYol1JZQbBM5sHYjNLZOnUCPjxF1viwie5yvmab1pc7wu2l/qK5B3OjL npvk7AREySxXiTXVsj8YLi6ig2aYg0jqtB7srCPz07YKBMZGIVruK5jNNHq6ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KF5gTZz119K; Tue, 20 Aug 2024 12:43: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 47KChjtT054251; Tue, 20 Aug 2024 12:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChjVQ054248; Tue, 20 Aug 2024 12:43:45 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:45 GMT Message-Id: <202408201243.47KChjVQ054248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d00f3505efad - main - mlx5en: do now waste ipsec_accel_in_tag on non-ipsec packets rx List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d00f3505efad7c323f74bee63f7d2527daf0f534 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d00f3505efad7c323f74bee63f7d2527daf0f534 commit d00f3505efad7c323f74bee63f7d2527daf0f534 Author: Konstantin Belousov AuthorDate: 2024-07-31 22:23:09 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 mlx5en: do now waste ipsec_accel_in_tag on non-ipsec packets rx Do not prepend ipsec tags into mbuf head when preparing rx wqe, store it separately. Only prepend (and clear the store) when received packed was indeed offloaded by ipsec engine. Then we do not need to refill tags for slots that received non-ipsec packets. This should solve some minimal degradation of the rx CPU usage due to unneeded tag allocation for each packet. Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_accel/ipsec.h | 23 +++++++----------- sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c | 39 +++++++++++++++++-------------- sys/dev/mlx5/mlx5_en/en.h | 3 +++ sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 2 ++ sys/dev/mlx5/mlx5_en/mlx5_en_rx.c | 12 +++++----- 5 files changed, 42 insertions(+), 37 deletions(-) diff --git a/sys/dev/mlx5/mlx5_accel/ipsec.h b/sys/dev/mlx5/mlx5_accel/ipsec.h index 1658542fc9c6..2abd68d9770a 100644 --- a/sys/dev/mlx5/mlx5_accel/ipsec.h +++ b/sys/dev/mlx5/mlx5_accel/ipsec.h @@ -251,27 +251,22 @@ void mlx5e_accel_ipsec_fs_rx_tables_destroy(struct mlx5e_priv *priv); int mlx5e_accel_ipsec_fs_rx_tables_create(struct mlx5e_priv *priv); void mlx5e_accel_ipsec_fs_rx_catchall_rules_destroy(struct mlx5e_priv *priv); int mlx5e_accel_ipsec_fs_rx_catchall_rules(struct mlx5e_priv *priv); -int mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mbuf *mb); -int mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe); +int mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mlx5e_rq_mbuf *mr); +void mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe, + struct mlx5e_rq_mbuf *mr); + static inline int mlx5e_accel_ipsec_flow(struct mlx5_cqe64 *cqe) { return MLX5_IPSEC_METADATA_MARKER(be32_to_cpu(cqe->ft_metadata)); } -static inline void mlx5e_accel_ipsec_handle_rx(struct mbuf *mb, struct mlx5_cqe64 *cqe) +static inline void +mlx5e_accel_ipsec_handle_rx(struct mbuf *mb, struct mlx5_cqe64 *cqe, + struct mlx5e_rq_mbuf *mr) { u32 ipsec_meta_data = be32_to_cpu(cqe->ft_metadata); - if (!MLX5_IPSEC_METADATA_MARKER(ipsec_meta_data)) { - struct m_tag *mtag; - - mtag = m_tag_find(mb, PACKET_TAG_IPSEC_ACCEL_IN, NULL); - if (mtag != NULL) - m_tag_delete(mb, mtag); - - return; - } - - mlx5e_accel_ipsec_handle_rx_cqe(mb, cqe); + if (MLX5_IPSEC_METADATA_MARKER(ipsec_meta_data)) + mlx5e_accel_ipsec_handle_rx_cqe(mb, cqe, mr); } #endif /* __MLX5_ACCEL_IPSEC_H__ */ diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c index 5ff8e021b196..0883cfb2d510 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_rxtx.c @@ -35,36 +35,41 @@ #define MLX5_IPSEC_METADATA_HANDLE(ipsec_metadata) (ipsec_metadata & 0xFFFFFF) -int mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mbuf *mb) +int +mlx5_accel_ipsec_rx_tag_add(if_t ifp, struct mlx5e_rq_mbuf *mr) { struct mlx5e_priv *priv; - struct ipsec_accel_in_tag *tag; - struct m_tag *mtag; + struct ipsec_accel_in_tag *mtag; priv = if_getsoftc(ifp); if (priv->ipsec == NULL) return (0); + if (mr->ipsec_mtag != NULL) + return (0); - mtag = m_tag_get(PACKET_TAG_IPSEC_ACCEL_IN, sizeof(*tag), M_NOWAIT); + mtag = (struct ipsec_accel_in_tag *)m_tag_get( + PACKET_TAG_IPSEC_ACCEL_IN, sizeof(*mtag), M_NOWAIT); if (mtag == NULL) - return -ENOMEM; - - m_tag_prepend(mb, mtag); - return 0; + return (-ENOMEM); + mr->ipsec_mtag = mtag; + return (0); } -int mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe) +void +mlx5e_accel_ipsec_handle_rx_cqe(struct mbuf *mb, struct mlx5_cqe64 *cqe, + struct mlx5e_rq_mbuf *mr) { - struct ipsec_accel_in_tag *tag; - u32 drv_spi; + struct ipsec_accel_in_tag *mtag; + u32 drv_spi; drv_spi = MLX5_IPSEC_METADATA_HANDLE(be32_to_cpu(cqe->ft_metadata)); - tag = (struct ipsec_accel_in_tag *) m_tag_find(mb, PACKET_TAG_IPSEC_ACCEL_IN, NULL); - WARN_ON(tag == NULL); - if (tag) - tag->drv_spi = drv_spi; - - return 0; + mtag = mr->ipsec_mtag; + WARN_ON(mtag == NULL); + mr->ipsec_mtag = NULL; + if (mtag != NULL) { + mtag->drv_spi = drv_spi; + m_tag_prepend(mb, &mtag->tag); + } } void diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index 8966aeacb890..80e0b7fbdedb 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -747,10 +747,13 @@ struct mlx5e_cq { struct mlx5_wq_ctrl wq_ctrl; } __aligned(MLX5E_CACHELINE_SIZE); +struct ipsec_accel_in_tag; + struct mlx5e_rq_mbuf { bus_dmamap_t dma_map; caddr_t data; struct mbuf *mbuf; + struct ipsec_accel_in_tag *ipsec_mtag; }; struct mlx5e_rq { diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index acb9f72b15c3..5081c1a0b782 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1325,6 +1325,8 @@ mlx5e_destroy_rq(struct mlx5e_rq *rq) wq_sz = mlx5_wq_ll_get_size(&rq->wq); for (i = 0; i != wq_sz; i++) { if (rq->mbuf[i].mbuf != NULL) { + if (rq->mbuf[i].ipsec_mtag != NULL) + m_tag_free(&rq->mbuf[i].ipsec_mtag->tag); bus_dmamap_unload(rq->dma_tag, rq->mbuf[i].dma_map); m_freem(rq->mbuf[i].mbuf); } diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c index 3d4b75884354..a24bbe3d193e 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c @@ -70,7 +70,7 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, /* get IP header aligned */ m_adj(mb, MLX5E_NET_IP_ALIGN); - err = mlx5_accel_ipsec_rx_tag_add(rq->ifp, mb); + err = mlx5_accel_ipsec_rx_tag_add(rq->ifp, &rq->mbuf[ix]); if (err) goto err_free_mbuf; err = -bus_dmamap_load_mbuf_sg(rq->dma_tag, rq->mbuf[ix].dma_map, @@ -277,9 +277,8 @@ mlx5e_mbuf_tstmp(struct mlx5e_priv *priv, uint64_t hw_tstmp) } static inline void -mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, - struct mlx5e_rq *rq, struct mbuf *mb, - u32 cqe_bcnt) +mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq, + struct mbuf *mb, struct mlx5e_rq_mbuf *mr, u32 cqe_bcnt) { if_t ifp = rq->ifp; struct mlx5e_channel *c; @@ -423,7 +422,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, break; } - mlx5e_accel_ipsec_handle_rx(mb, cqe); + mlx5e_accel_ipsec_handle_rx(mb, cqe, mr); } static inline void @@ -588,7 +587,8 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) rq->mbuf[wqe_counter].dma_map); } rx_common: - mlx5e_build_rx_mbuf(cqe, rq, mb, byte_cnt); + mlx5e_build_rx_mbuf(cqe, rq, mb, &rq->mbuf[wqe_counter], + byte_cnt); rq->stats.bytes += byte_cnt; rq->stats.packets++; #ifdef NUMA From nobody Tue Aug 20 12:43:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KH3mWjz5T442; Tue, 20 Aug 2024 12:43: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 4Wp8KG6b7Vz4THf; Tue, 20 Aug 2024 12:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=deR9Xp9+5XUUoHxLB+QvViwBPLuAyQVsoJKkN0n8xkc=; b=iFz4TpIp7RsvZ4m5hlQvdHWczg4VvsTjXtQTcJKHFtjHBz6/VhJjSJqX1KuD3Jkizclsgq lYczKd8Z48Zg58uJKELgbRgxLq39fZstuugybIhcn0u1D8YkkbQniJdA+DZYWpK2SupyhR bFAFSOGAdd5y/8S2l0JkEYhWpCnaAw5u6dY1xtcW/9GlJ8Ozo0L0aGBKYk7Ve55ducgSUZ jTHx7Ofwcy6uKwIURJeKoaEUqhypXkqkgK0+OJVvsnkdfE/icPNMweOZPQlTqpBaWzPTpj 4kxP6qhGbx8epaKeo3xru7i/2DSsbMbbWdRMxIUX0lC5DfIDB5oDBKdrP/7ktQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157826; a=rsa-sha256; cv=none; b=s0xGWEDblmWJI7qOTErOKCEzNsZl1GUShB5u6hqSuvWKfnsNPY2wXk3xa/EGWH5Hmyi/Y9 g/6MQYu4mahLJ4/siof4u5EcbxLXWzMwj4QxXRT5MD0657KLCbFzY0aCq9GjsNdlwD8fgC d2SojaXmm+it7TXQUU3pLvM7YJwnIzT2BmRRNxopmZlPYdGHpu9EZuL/cK/3z1+a+RU/O7 YoWCe56V8UyGj/ZVvj+XPODLxjfXtqpqRjl0lIdH0xPqom6soEbNJmPr2UqQ4Ykbvf99tM Fu9GZgE2069CsFPwAwa/SzR/Cu5FDMKW9TXfWeTWW5yPAEfUWINCWjTfjH4nDg== 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=1724157826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=deR9Xp9+5XUUoHxLB+QvViwBPLuAyQVsoJKkN0n8xkc=; b=rRK9LSjAMpEvBW/F1UJB8mOZUvQRe0T7laHEwMQt5LvuBNeMQAYKVHraMy/P1HLW5X8tZL taSMZ5jrDKK2UejWlk+6FIQ/IufSJELkKsG7Od3BkzJDAdg+MZ7xpzIHZ38a0gEbngcCls Ie3J2MURGTKqcRYAk4CEWkr5v5CiA4tEXoJEeHmvUOKIOFn9nyFDC+tFulRH2alp+YyKEU Qn8xhJrd3fMYj9v9LBzly7IEu+I2juT8tONEFAFUXx0G5u35pgSperNDxWPaoeMIfHnFGT ZD9Z3xQ/qWgQx3qC+O38CYxglG7pQHAwiI2Sl8M1r9vQWYTt5NXC6t/rqI5hcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KG6BlZz10wv; Tue, 20 Aug 2024 12:43: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 47KChkIe054318; Tue, 20 Aug 2024 12:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChkY0054315; Tue, 20 Aug 2024 12:43:46 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:46 GMT Message-Id: <202408201243.47KChkY0054315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 828da10bb3c3 - main - mlx5en: fix destroying tx sa_entry when installing rx sa_entry failed List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 828da10bb3c338b5964e120dd970e649730b7f4f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=828da10bb3c338b5964e120dd970e649730b7f4f commit 828da10bb3c338b5964e120dd970e649730b7f4f Author: Konstantin Belousov AuthorDate: 2024-08-13 08:38:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 mlx5en: fix destroying tx sa_entry when installing rx sa_entry failed In particular, do not cancel freed linux delayed work. Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c index 555847717779..01d1cb28f86d 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c @@ -45,6 +45,8 @@ #define MLX5_IPSEC_RESCHED msecs_to_jiffies(1000) +static void mlx5e_if_sa_deinstall_onekey(struct ifnet *ifp, u_int dev_spi, + void *priv); static int mlx5e_if_sa_deinstall(struct ifnet *ifp, u_int dev_spi, void *priv); static struct mlx5e_ipsec_sa_entry *to_ipsec_sa_entry(void *x) @@ -378,6 +380,7 @@ err_fs: mlx5_ipsec_free_sa_ctx(sa_entry); err_sa_ctx: kfree(sa_entry->dwork); + sa_entry->dwork = NULL; err_xfrm: kfree(sa_entry); mlx5_en_err(ifp, "Device failed to offload this state"); @@ -403,7 +406,9 @@ mlx5e_if_sa_newkey(struct ifnet *ifp, void *sav, u_int dev_spi, void **privp) if (error == 0) { *privp = pb; } else { - mlx5e_if_sa_deinstall(ifp, dev_spi, pb->priv_in); + if (pb->priv_in->dwork != NULL) + cancel_delayed_work_sync(&pb->priv_in->dwork->dwork); + mlx5e_if_sa_deinstall_onekey(ifp, dev_spi, pb->priv_in); free(pb, M_DEVBUF); } return (error); From nobody Tue Aug 20 12:43:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KJ5p3xz5T4Gq; Tue, 20 Aug 2024 12:43: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 4Wp8KJ0n2Sz4TWt; Tue, 20 Aug 2024 12:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7mEGomBJMuVcgqEumIB0Uh01nyPhnCUgvtvOrJ/xhro=; b=rEVUt21m0T7bQPY5nMiWrRRFznLwcldwda9nQT7yOHo5LOxUAZV0fNVqv5cCexM0Tr4fqf KMlKLAciKz6YWfxQnSQwDxA2na/B8E7jvWPJoQcYKrw2CrE8XBDMaWl2Da03PxSxUjRbkZ m9NKiOu9M2cylPzm372CfJ6vC2I/i9Cc0U66jKXREvijrDIv9p4zcEYN74fIRMaMiiCNYv 9+LeH6/O2jzEJBVV/Yxz7YJ7lOECn+s1xa9MD6106gJQUAipLKVI1MM1QN/J3kVg1DG65w aOw61qiAuSB6VikgvUKche9dSYsyIcBvVlgYuXH7rDWucDeQ7GVIX24pdLPWEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157828; a=rsa-sha256; cv=none; b=tmvICPLKYpwYZ2gOcmOPqHoYBimFjat2UwrXopC1zv5KPNB7PbooNvx3Ml2SzMJvH1wuG/ 6clrP0OflhL8P9Gfor/moHMYLCPuAUtZQ57olLSyYE2l1gAo9w+RHI2lLvI0FLVQpvF8mS dou+F3nypUe4EKnnDz7NW5j33EeK4SwwLmPQEOlhF2PwQd5mWrJoW5HB0JngWddFU1AKfw qO0BDHOJ6yBowmi60+LymAlfOPlb++RmeOfYP/TvUrIBX4HZhGnYNJlh/L3J4XA/uJ5L2J VRrv/WItziBwQlylwBq1yjEZBc6H3YYpF9isObhtBujLEOogdM+ATpG0Ny8bbw== 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=1724157828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7mEGomBJMuVcgqEumIB0Uh01nyPhnCUgvtvOrJ/xhro=; b=VzZvCxTJTIi9sogtDujjUvTN7C6mIWJrGVMlzN7LvRHFXLHDEA+prbe6mZNEyzEFCqkFfZ A7ipV5/svFORImW1inGz6NE3l4iIB8UfsPYCDX41sqkjtaWyr7LFJxCEZqQ5GG3EfznY7y RgtWBrFFBFK4x2YcePMC5t10hkvDCLXyK/tETeXs3vdYCpxJVySXKE1ujCgwa+ZuyM62/W irMONRxTf1ibqTai3sCx1YTPlRWsKlFwDQ0g1HuZE3dZU7z+s54/nhp6FloyzrGUeX1vNI 8xKAjh+ojKb0AfND3wxkMI0adrqfKB913jraAA7tVzrciPrADoDldne3pC20Pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KJ0Nhfz11XD; Tue, 20 Aug 2024 12:43: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 47KChloR054371; Tue, 20 Aug 2024 12:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChlUD054368; Tue, 20 Aug 2024 12:43:47 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:47 GMT Message-Id: <202408201243.47KChlUD054368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c4a0ee9b97bf - main - ipsec_offload: add handler for interface down events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4a0ee9b97bfc7407366567aaa2c09313b3e6bd2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c4a0ee9b97bfc7407366567aaa2c09313b3e6bd2 commit c4a0ee9b97bfc7407366567aaa2c09313b3e6bd2 Author: Konstantin Belousov AuthorDate: 2024-08-08 11:43:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 ipsec_offload: add handler for interface down events Remove all offloaded SAs and SPs on ifdown. Sponsored by: NVIDIA networking --- sys/netipsec/ipsec_offload.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index 984134539d8b..4d81803f4be7 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -138,6 +139,8 @@ PCTRIE_DEFINE(DRVSPI_SA, ifp_handle_sav, drv_spi, drvspi_sa_trie_alloc, drvspi_sa_trie_free); static struct pctrie drv_spi_pctrie; +static eventhandler_tag ipsec_accel_ifdetach_event_tag; + static void ipsec_accel_sa_newkey_impl(struct secasvar *sav); static int ipsec_accel_handle_sav(struct secasvar *sav, struct ifnet *ifp, u_int drv_spi, void *priv, uint32_t flags, struct ifp_handle_sav **ires); @@ -154,6 +157,7 @@ static struct mbuf *ipsec_accel_key_setaccelif_impl(struct secasvar *sav); static void ipsec_accel_on_ifdown_impl(struct ifnet *ifp); static void ipsec_accel_drv_sa_lifetime_update_impl(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); +static void ipsec_accel_ifdetach_event(void *arg, struct ifnet *ifp); static void ipsec_accel_init(void *arg) @@ -174,6 +178,9 @@ ipsec_accel_init(void *arg) ipsec_accel_drv_sa_lifetime_update_p = ipsec_accel_drv_sa_lifetime_update_impl; pctrie_init(&drv_spi_pctrie); + ipsec_accel_ifdetach_event_tag = EVENTHANDLER_REGISTER( + ifnet_departure_event, ipsec_accel_ifdetach_event, NULL, + EVENTHANDLER_PRI_ANY); } SYSINIT(ipsec_accel_init, SI_SUB_VNET_DONE, SI_ORDER_ANY, ipsec_accel_init, NULL); @@ -181,6 +188,8 @@ SYSINIT(ipsec_accel_init, SI_SUB_VNET_DONE, SI_ORDER_ANY, static void ipsec_accel_fini(void *arg) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + ipsec_accel_ifdetach_event_tag); ipsec_accel_sa_newkey_p = NULL; ipsec_accel_forget_sav_p = NULL; ipsec_accel_spdadd_p = NULL; @@ -799,6 +808,14 @@ ipsec_accel_on_ifdown_impl(struct ifnet *ifp) ipsec_accel_on_ifdown_sav(ifp); } +static void +ipsec_accel_ifdetach_event(void *arg __unused, struct ifnet *ifp) +{ + if ((ifp->if_flags & IFF_RENAMING) != 0) + return; + ipsec_accel_on_ifdown_impl(ifp); +} + static bool ipsec_accel_output_pad(struct mbuf *m, struct secasvar *sav, int skip, int mtu) { From nobody Tue Aug 20 12:43:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KK3Dvzz5T4Dq; Tue, 20 Aug 2024 12:43: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 4Wp8KK1pw8z4TVX; Tue, 20 Aug 2024 12:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7AWr4Wf6tljZLL841Zx8iT4F+bsnGtYId0E+1/BKcFA=; b=NXtouNPiNZt1bjy2q2K8wMpQzjX5Fe/qPndxfnuaBqrehLB8YGpN3C9rD5ZIRo6iYdUo32 jmF6KhiV+xT/uONE4iR8qFIAHx9w+VdQVXC3ekm6k8W+ZheG+Ztbdb95j1Cdqrl0oBbl5e bDw1MTwscbyLZSljvqklyw/Meh6JUTxsojQwKfMWNMH/mv8aB6IqvIOwcvDvdzH39LZ8IO 8+t5dx19B8MAgiyh+A4PqbVCUGH6yb8muXGCBYpXZeYZ9OM9pFc6xunUxeGFAtR8tmcqEJ fl+P47NdP7KcVnKEpxnI9YqRcFNYSCqC178oaufNba4Q59z+aPeXIMBkfO7ghQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157829; a=rsa-sha256; cv=none; b=t5cIUru9r6jCELyabaD7gCFt58zLDF9jPUpo8lyZ3BsTnfskaq2HPsoVa2KEZvJiCm2aJH 4UJq7wyi077FdVxiChzkBEzwnz67+cDoJbjG704V+b9sncyTiiHR6FhuFHBfWM6yt9N/gV qSdC5ATPYq49G3KRmT+A51tZSnu7hZNS7vsyRma6ufDbX3fIfUukA32imDfYVCBR+yW0lQ sJKgvGxHrm8NoPeaDNa6FzFLXHUoHihE27vv9Mk3ylHTw8OWB08wUZ+dyG1Do+GTg/K2gC iBm8ZuBeXmgFS3dA6hxrWJAVn3qB2f8EXx4kupJNvgDogA6tHdp00AxaqrF0CQ== 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=1724157829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7AWr4Wf6tljZLL841Zx8iT4F+bsnGtYId0E+1/BKcFA=; b=G8yzUtOo4Isz6GwumnUrSYC8+0c9DnLn1e+eoE/DXu96WGiD9cLF/Z8QNF/9jOr7xXGHrC ycoYG9oT+xFJRgAX7SE15npjXFwhr8v6CLZMAVcWEEi53cNboN0xOP5NKUfptrUpnn3PDC /Ps9LjN+UEGWmvC5Xp5svokEecDWxpif/qXVbrKqry2nkP0I54u4N17r2u7kFvz24znMzR /ezxuTOuKYrfWOHLdELsJGnfq+58J/SEV+kAlWWQu+Ng6iTkvm//C38zMkAbI+wQ5WYeZX XLtkiRdHG3qb65AGNr04dEDhhp/9OxTcksYD984Zo1kT8AQ1Hc/focq21fj2Ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KK1QHgz11KW; Tue, 20 Aug 2024 12:43: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 47KChnil054416; Tue, 20 Aug 2024 12:43:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChn7g054413; Tue, 20 Aug 2024 12:43:49 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:49 GMT Message-Id: <202408201243.47KChn7g054413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4f4c34e9d6e1 - main - if_vlan.c: remove stray include of sys/cdefs.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f4c34e9d6e1d496ac2c00d490c4218049375b4c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4f4c34e9d6e1d496ac2c00d490c4218049375b4c commit 4f4c34e9d6e1d496ac2c00d490c4218049375b4c Author: Konstantin Belousov AuthorDate: 2024-08-14 03:06:55 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 if_vlan.c: remove stray include of sys/cdefs.h Sponsored by: NVidia networking --- sys/net/if_vlan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index e2b32ac2e7de..4349a6c99291 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -42,7 +42,6 @@ * use by the real outgoing interface, and ask it to send them. */ -#include #include "opt_inet.h" #include "opt_inet6.h" #include "opt_kern_tls.h" From nobody Tue Aug 20 12:43:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KN0Wk8z5T4Gv; Tue, 20 Aug 2024 12:43: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 4Wp8KM3G5sz4TZf; Tue, 20 Aug 2024 12:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mHm7WEaWPFLvkDC7wSUE8VCkTnf45+DWweiCih+DbzA=; b=B7+cNWXX/uKk+MiEuooxO1pyWXPAqiLEiDUvWzRP2T+Un7iDrUUx3LPeVsl/Yy32cDRt5f mzFnL1KMUPAIBehdAOTdOnt/gCIkeYqQYF+kCWiZm/dTPxRLYhrqyxf0XQ9Fm0RCp1RvnT 7j+i9LylB6HRU9RWUAW8SviZKCQ4gVAzcmiFBohz1qqt/kGveznxXc2PqyxIcIs3+QCoNA YiKuyyxh3BEb5vba3u8BLtZSJMO/ec+p39/mzGtWXkrSugFF5MItQDKIxCgRxr9KOvRfJo rqdEla3HZU/8U9kqgN/aYldOjyof/BNzobHik/8TyohdDLnZqAIXGYL5FimRUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157831; a=rsa-sha256; cv=none; b=fIar8Llx69vLYelrV/5LymSEqbDSimSd8S7zU+Mo0UlgERf6LehiRW9eWSf2Pgw7hnVQAu uqTnKaEG/pkD9atcrb/eWBRgSZn9inCG47wW6wBUVft0DDco1ycB/BQ04Ikc+/Rtpc3Irj /ue9bfR3C70TjgkXbDLo3A0AbgNra5LJ/2YTDLIiNtWdmNJnoHo9WyyyZ41e2MEMJ6+5Cp qP68ZINCc6kJlVLadvp1QYLrQ47/w8fe+ZYYWX4HagllsN+5JWm3ue1s0aGa+/SOMmHykR 4ZARmIhPlAWYuOCmh1xpVe8sSeEju7BcdVgsQhrzSvv9t6oKdzTdb42GGhiQHw== 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=1724157831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mHm7WEaWPFLvkDC7wSUE8VCkTnf45+DWweiCih+DbzA=; b=BVs5AJJpl88WpXDRHdlPRKn+zE6+qlYEBu2i0mK8ifMOaGudX7nCrq7kXrj6MzkVB8bF+e /bf83wxm+uCXTfTifKe7SOnrv2AeZHQo2KiyDXgpdoawhgxAtbld0qN5dNVeeY47r1wh3u QobMgVpEZ18yBnqmX6oefQbCKrLSMulAeOnijju80JWZsyvQMIL4HONIZ3YhTS2KUD8UyA esYbXlKOzHOARUbXSjkNc2jRt1Cf7T/aN5I9OHxrgZa2hLXB6B2R4nhUhE561xRGBMKC9X uRHpeWputMG1d2FB281PTMhEDaLRksuoRruep0VFNM8e7XFXzvVwaix9xwrgNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KM2pH2z11XX; Tue, 20 Aug 2024 12:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KChpO8054500; Tue, 20 Aug 2024 12:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChpws054497; Tue, 20 Aug 2024 12:43:51 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:51 GMT Message-Id: <202408201243.47KChpws054497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 205263ac250a - main - mlx5en: support ipsec offload on vlan if List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 205263ac250aadd84931d2b77475bc931c3afeff Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=205263ac250aadd84931d2b77475bc931c3afeff commit 205263ac250aadd84931d2b77475bc931c3afeff Author: Ariel Ehrenberg AuthorDate: 2024-07-30 16:50:40 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:13 +0000 mlx5en: support ipsec offload on vlan if Add vlan tag match to RX FS SA and policy rules and report SA lifetime counter on vlan interface in case SA was installed on vlan interface Existing code didn't have the net tag id as part of the FS matching rules. This can cause applying ipsec offload to the wrong interface. This commit add tag id as part of FS matchers and treat tag value 0 as no tag Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_accel/ipsec.h | 6 ++ sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c | 90 +++++++++++++----- sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c | 157 ++++++++++++++++++++++++-------- 3 files changed, 194 insertions(+), 59 deletions(-) diff --git a/sys/dev/mlx5/mlx5_accel/ipsec.h b/sys/dev/mlx5/mlx5_accel/ipsec.h index 2abd68d9770a..95742c4099f1 100644 --- a/sys/dev/mlx5/mlx5_accel/ipsec.h +++ b/sys/dev/mlx5/mlx5_accel/ipsec.h @@ -37,6 +37,8 @@ #define MLX5E_IPSEC_SADB_RX_BITS 10 #define MLX5_IPSEC_METADATA_MARKER(ipsec_metadata) ((ipsec_metadata >> 31) & 0x1) +#define VLAN_NONE 0xfff + struct mlx5e_priv; struct mlx5e_tx_wqe; struct mlx5e_ipsec_tx; @@ -135,6 +137,7 @@ struct mlx5e_ipsec_rule { struct mlx5_flow_handle *rule; struct mlx5_flow_handle *kspi_rule; struct mlx5_flow_handle *reqid_rule; + struct mlx5_flow_handle *vid_zero_rule; struct mlx5_modify_hdr *modify_hdr; struct mlx5_pkt_reformat *pkt_reformat; struct mlx5_fc *fc; @@ -149,6 +152,7 @@ struct mlx5e_ipsec_esn_state { struct mlx5e_ipsec_sa_entry { struct secasvar *savp; if_t ifp; + if_t ifpo; struct mlx5e_ipsec *ipsec; struct mlx5_accel_esp_xfrm_attrs attrs; struct mlx5e_ipsec_rule ipsec_rule; @@ -158,6 +162,7 @@ struct mlx5e_ipsec_sa_entry { u32 enc_key_id; u16 kspi; /* Stack allocated unique SA identifier */ struct mlx5e_ipsec_esn_state esn_state; + u16 vid; }; struct upspec { @@ -184,6 +189,7 @@ struct mlx5_accel_pol_xfrm_attrs { u8 dir : 2; u32 reqid; u32 prio; + u16 vid; }; struct mlx5e_ipsec_pol_entry { diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c index 01d1cb28f86d..a25ed4c1c51f 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c @@ -97,8 +97,8 @@ mlx5e_ipsec_handle_counters(struct work_struct *_work) bytes += bytes1; #ifdef IPSEC_OFFLOAD - ipsec_accel_drv_sa_lifetime_update(sa_entry->savp, sa_entry->ifp, - sa_entry->kspi, bytes, packets); + ipsec_accel_drv_sa_lifetime_update( + sa_entry->savp, sa_entry->ifpo, sa_entry->kspi, bytes, packets); #endif queue_delayed_work(sa_entry->ipsec->wq, &dwork->dwork, @@ -321,19 +321,23 @@ static int mlx5e_xfrm_validate_state(struct mlx5_core_dev *mdev, } static int -mlx5e_if_sa_newkey_onedir(struct ifnet *ifp, void *sav, int dir, - u_int drv_spi, struct mlx5e_ipsec_sa_entry **privp, - struct mlx5e_ipsec_priv_bothdir *pb) +mlx5e_if_sa_newkey_onedir(struct ifnet *ifp, void *sav, int dir, u_int drv_spi, + struct mlx5e_ipsec_sa_entry **privp, struct mlx5e_ipsec_priv_bothdir *pb, + struct ifnet *ifpo) { struct mlx5e_ipsec_sa_entry *sa_entry = NULL; struct mlx5e_priv *priv = if_getsoftc(ifp); struct mlx5_core_dev *mdev = priv->mdev; struct mlx5e_ipsec *ipsec = priv->ipsec; + u16 vid = VLAN_NONE; int err; if (priv->gone != 0 || ipsec == NULL) return (EOPNOTSUPP); + if (if_gettype(ifpo) == IFT_L2VLAN) + VLAN_TAG(ifpo, &vid); + err = mlx5e_xfrm_validate_state(mdev, sav); if (err) return err; @@ -345,7 +349,9 @@ mlx5e_if_sa_newkey_onedir(struct ifnet *ifp, void *sav, int dir, sa_entry->kspi = drv_spi; sa_entry->savp = sav; sa_entry->ifp = ifp; + sa_entry->ifpo = ifpo; sa_entry->ipsec = ipsec; + sa_entry->vid = vid; mlx5e_ipsec_build_accel_xfrm_attrs(sa_entry, &sa_entry->attrs, dir); @@ -387,22 +393,35 @@ err_xfrm: return err; } +#define GET_TRUNK_IF(vifp, ifp, ept) \ + if (if_gettype(vifp) == IFT_L2VLAN) { \ + NET_EPOCH_ENTER(ept); \ + ifp = VLAN_TRUNKDEV(vifp); \ + NET_EPOCH_EXIT(ept); \ + } else { \ + ifp = vifp; \ + } + static int -mlx5e_if_sa_newkey(struct ifnet *ifp, void *sav, u_int dev_spi, void **privp) +mlx5e_if_sa_newkey(struct ifnet *ifpo, void *sav, u_int dev_spi, void **privp) { struct mlx5e_ipsec_priv_bothdir *pb; + struct epoch_tracker et; + struct ifnet *ifp; int error; + GET_TRUNK_IF(ifpo, ifp, et); + pb = malloc(sizeof(struct mlx5e_ipsec_priv_bothdir), M_DEVBUF, M_WAITOK | M_ZERO); - error = mlx5e_if_sa_newkey_onedir(ifp, sav, IPSEC_DIR_INBOUND, - dev_spi, &pb->priv_in, pb); + error = mlx5e_if_sa_newkey_onedir( + ifp, sav, IPSEC_DIR_INBOUND, dev_spi, &pb->priv_in, pb, ifpo); if (error != 0) { free(pb, M_DEVBUF); return (error); } - error = mlx5e_if_sa_newkey_onedir(ifp, sav, IPSEC_DIR_OUTBOUND, - dev_spi, &pb->priv_out, pb); + error = mlx5e_if_sa_newkey_onedir( + ifp, sav, IPSEC_DIR_OUTBOUND, dev_spi, &pb->priv_out, pb, ifpo); if (error == 0) { *privp = pb; } else { @@ -431,9 +450,13 @@ mlx5e_if_sa_deinstall_onekey(struct ifnet *ifp, u_int dev_spi, void *priv) } static int -mlx5e_if_sa_deinstall(struct ifnet *ifp, u_int dev_spi, void *priv) +mlx5e_if_sa_deinstall(struct ifnet *ifpo, u_int dev_spi, void *priv) { struct mlx5e_ipsec_priv_bothdir pb, *pbp; + struct epoch_tracker et; + struct ifnet *ifp; + + GET_TRUNK_IF(ifpo, ifp, et); pbp = priv; pb = *(struct mlx5e_ipsec_priv_bothdir *)priv; @@ -462,12 +485,16 @@ mlx5e_if_sa_cnt_one(struct ifnet *ifp, void *sa, uint32_t drv_spi, } static int -mlx5e_if_sa_cnt(struct ifnet *ifp, void *sa, uint32_t drv_spi, - void *priv, struct seclifetime *lt) +mlx5e_if_sa_cnt(struct ifnet *ifpo, void *sa, uint32_t drv_spi, void *priv, + struct seclifetime *lt) { struct mlx5e_ipsec_priv_bothdir *pb; u64 packets_in, packets_out; u64 bytes_in, bytes_out; + struct epoch_tracker et; + struct ifnet *ifp; + + GET_TRUNK_IF(ifpo, ifp, et); pb = priv; mlx5e_if_sa_cnt_one(ifp, sa, drv_spi, pb->priv_in, @@ -546,9 +573,9 @@ static int mlx5e_xfrm_validate_policy(struct mlx5_core_dev *mdev, return 0; } -static void mlx5e_ipsec_build_accel_pol_attrs(struct mlx5e_ipsec_pol_entry *pol_entry, - struct mlx5_accel_pol_xfrm_attrs *attrs, - struct inpcb *inp) +static void +mlx5e_ipsec_build_accel_pol_attrs(struct mlx5e_ipsec_pol_entry *pol_entry, + struct mlx5_accel_pol_xfrm_attrs *attrs, struct inpcb *inp, u16 vid) { struct secpolicy *sp = pol_entry->sp; struct secpolicyindex *spidx = &sp->spidx; @@ -592,15 +619,22 @@ static void mlx5e_ipsec_build_accel_pol_attrs(struct mlx5e_ipsec_pol_entry *pol_ attrs->action = IPSEC_POLICY_IPSEC; } attrs->dir = spidx->dir; + attrs->vid = vid; } -static int mlx5e_if_spd_install(struct ifnet *ifp, void *sp, void *inp1, - void **ifdatap) +static int +mlx5e_if_spd_install(struct ifnet *ifpo, void *sp, void *inp1, void **ifdatap) { struct mlx5e_ipsec_pol_entry *pol_entry; struct mlx5e_priv *priv; + struct epoch_tracker et; + u16 vid = VLAN_NONE; + struct ifnet *ifp; int err; + GET_TRUNK_IF(ifpo, ifp, et); + if (if_gettype(ifpo) == IFT_L2VLAN) + VLAN_TAG(ifpo, &vid); priv = if_getsoftc(ifp); if (priv->gone || !priv->ipsec) return (EOPNOTSUPP); @@ -616,7 +650,8 @@ static int mlx5e_if_spd_install(struct ifnet *ifp, void *sp, void *inp1, pol_entry->sp = sp; pol_entry->ipsec = priv->ipsec; - mlx5e_ipsec_build_accel_pol_attrs(pol_entry, &pol_entry->attrs, inp1); + mlx5e_ipsec_build_accel_pol_attrs(pol_entry, &pol_entry->attrs, + inp1, vid); err = mlx5e_accel_ipsec_fs_add_pol(pol_entry); if (err) goto err_pol; @@ -630,11 +665,12 @@ err_pol: return err; } - -static int mlx5e_if_spd_deinstall(struct ifnet *ifp, void *sp, void *ifdata) +static int +mlx5e_if_spd_deinstall(struct ifnet *ifpo, void *sp, void *ifdata) { - struct mlx5e_ipsec_pol_entry *pol_entry = to_ipsec_pol_entry(ifdata); + struct mlx5e_ipsec_pol_entry *pol_entry; + pol_entry = to_ipsec_pol_entry(ifdata); mlx5e_accel_ipsec_fs_del_pol(pol_entry); kfree(pol_entry); return 0; @@ -654,9 +690,17 @@ void mlx5e_ipsec_cleanup(struct mlx5e_priv *priv) } static int -mlx5e_if_ipsec_hwassist(if_t ifnet, void *sav __unused, +mlx5e_if_ipsec_hwassist(if_t ifneto, void *sav __unused, uint32_t drv_spi __unused, void *priv __unused) { + if_t ifnet; + + if (if_gettype(ifneto) == IFT_L2VLAN) { + ifnet = VLAN_TRUNKDEV(ifneto); + } else { + ifnet = ifneto; + } + return (if_gethwassist(ifnet) & (CSUM_TSO | CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_IP6_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP)); } diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c index a6a0398f9dca..e348ab1992a5 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c @@ -185,6 +185,44 @@ static void setup_fte_spi(struct mlx5_flow_spec *spec, u32 spi, bool encap) } } +static void +setup_fte_vid(struct mlx5_flow_spec *spec, u16 vid) +{ + /* virtual lan tag */ + spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS; + + MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, + outer_headers.cvlan_tag); + MLX5_SET(fte_match_param, spec->match_value, + outer_headers.cvlan_tag, 1); + MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, + outer_headers.first_vid); + MLX5_SET(fte_match_param, spec->match_value, outer_headers.first_vid, + vid); +} + +static void +clear_fte_vid(struct mlx5_flow_spec *spec) +{ + MLX5_SET(fte_match_param, spec->match_criteria, + outer_headers.cvlan_tag, 0); + MLX5_SET(fte_match_param, spec->match_value, + outer_headers.cvlan_tag, 0); + MLX5_SET(fte_match_param, spec->match_criteria, + outer_headers.first_vid, 0); + MLX5_SET(fte_match_param, spec->match_value, + outer_headers.first_vid, 0); +} + +static void +setup_fte_no_vid(struct mlx5_flow_spec *spec) +{ + MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, + outer_headers.cvlan_tag); + MLX5_SET(fte_match_param, spec->match_value, + outer_headers.cvlan_tag, 0); +} + static struct mlx5_fs_chains * ipsec_chains_create(struct mlx5_core_dev *mdev, struct mlx5_flow_table *miss_ft, enum mlx5_flow_namespace_type ns, int base_prio, @@ -474,17 +512,6 @@ static int rx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) if (!spec) return -ENOMEM; - if (attrs->family == AF_INET) - setup_fte_addr4(spec, &attrs->saddr.a4, &attrs->daddr.a4); - else - setup_fte_addr6(spec, attrs->saddr.a6, attrs->daddr.a6); - - if (!attrs->encap) - setup_fte_esp(spec); - - setup_fte_spi(spec, attrs->spi, attrs->encap); - setup_fte_no_frags(spec); - if (!attrs->drop) { err = setup_modify_header(mdev, sa_entry->kspi | BIT(31), IPSEC_DIR_INBOUND, &flow_act); @@ -520,15 +547,46 @@ static int rx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) dest[1].type = MLX5_FLOW_DESTINATION_TYPE_COUNTER; dest[1].counter_id = mlx5_fc_id(counter); + if (attrs->family == AF_INET) + setup_fte_addr4(spec, &attrs->saddr.a4, &attrs->daddr.a4); + else + setup_fte_addr6(spec, attrs->saddr.a6, attrs->daddr.a6); + + if (!attrs->encap) + setup_fte_esp(spec); + + setup_fte_spi(spec, attrs->spi, attrs->encap); + setup_fte_no_frags(spec); + + if (sa_entry->vid != VLAN_NONE) + setup_fte_vid(spec, sa_entry->vid); + else + setup_fte_no_vid(spec); + rule = mlx5_add_flow_rules(rx->ft.sa, spec, &flow_act, dest, 2); if (IS_ERR(rule)) { err = PTR_ERR(rule); mlx5_core_err(mdev, "fail to add RX ipsec rule err=%d\n", err); goto err_add_flow; } + ipsec_rule->rule = rule; + + /* Add another rule for zero vid */ + if (sa_entry->vid == VLAN_NONE) { + clear_fte_vid(spec); + setup_fte_vid(spec, 0); + rule = mlx5_add_flow_rules(rx->ft.sa, spec, &flow_act, dest, 2); + if (IS_ERR(rule)) { + err = PTR_ERR(rule); + mlx5_core_err(mdev, + "fail to add RX ipsec zero vid rule err=%d\n", + err); + goto err_add_flow; + } + ipsec_rule->vid_zero_rule = rule; + } kvfree(spec); - ipsec_rule->rule = rule; ipsec_rule->fc = counter; ipsec_rule->modify_hdr = flow_act.modify_hdr; ipsec_rule->pkt_reformat = flow_act.pkt_reformat; @@ -536,10 +594,12 @@ static int rx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) err_add_flow: mlx5_fc_destroy(mdev, counter); + if (ipsec_rule->rule != NULL) + mlx5_del_flow_rules(&ipsec_rule->rule); err_add_cnt: mlx5_packet_reformat_dealloc(mdev, flow_act.pkt_reformat); err_pkt_reformat: - if (flow_act.modify_hdr) + if (flow_act.modify_hdr != NULL) mlx5_modify_header_dealloc(mdev, flow_act.modify_hdr); err_mod_header: kvfree(spec); @@ -1222,8 +1282,6 @@ static int tx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) switch (attrs->action) { case IPSEC_POLICY_IPSEC: flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; - /*if (!attrs->reqid) - break;*/ err = setup_modify_header(mdev, attrs->reqid, IPSEC_DIR_OUTBOUND, &flow_act); if (err) @@ -1278,7 +1336,7 @@ static int rx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) struct mlx5_flow_spec *spec; struct mlx5_flow_table *ft; struct mlx5e_ipsec_rx *rx; - int err, dstn = 0; + int err, dstn = 0; rx = (attrs->family == AF_INET) ? ipsec->rx_ipv4 : ipsec->rx_ipv6; ft = rx->chains ? ipsec_chains_get_table(rx->chains, attrs->prio) : rx->ft.pol; @@ -1291,14 +1349,6 @@ static int rx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) goto err_alloc; } - if (attrs->family == AF_INET) - setup_fte_addr4(spec, &attrs->saddr.a4, &attrs->daddr.a4); - else - setup_fte_addr6(spec, attrs->saddr.a6, attrs->daddr.a6); - - setup_fte_no_frags(spec); - setup_fte_upper_proto_match(spec, &attrs->upspec); - switch (attrs->action) { case IPSEC_POLICY_IPSEC: flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; @@ -1318,21 +1368,52 @@ static int rx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) dest[dstn].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; dest[dstn].ft = rx->ft.sa; dstn++; - rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, dstn); - if (IS_ERR(rule)) { - err = PTR_ERR(rule); - mlx5_core_err(mdev, "Fail to add RX IPsec policy rule err=%d\n", err); - goto err_action; - } - kvfree(spec); - pol_entry->ipsec_rule.rule = rule; + if (attrs->family == AF_INET) + setup_fte_addr4(spec, &attrs->saddr.a4, &attrs->daddr.a4); + else + setup_fte_addr6(spec, attrs->saddr.a6, attrs->daddr.a6); + + setup_fte_no_frags(spec); + setup_fte_upper_proto_match(spec, &attrs->upspec); + if (attrs->vid != VLAN_NONE) + setup_fte_vid(spec, attrs->vid); + else + setup_fte_no_vid(spec); + + rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, dstn); + if (IS_ERR(rule)) { + err = PTR_ERR(rule); + mlx5_core_err(mdev, + "Failed to add RX IPsec policy rule err=%d\n", err); + goto err_action; + } + pol_entry->ipsec_rule.rule = rule; + + /* Add also rule for zero vid */ + if (attrs->vid == VLAN_NONE) { + clear_fte_vid(spec); + setup_fte_vid(spec, 0); + rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, dstn); + if (IS_ERR(rule)) { + err = PTR_ERR(rule); + mlx5_core_err(mdev, + "Failed to add RX IPsec policy rule err=%d\n", + err); + goto err_action; + } + pol_entry->ipsec_rule.vid_zero_rule = rule; + } + + kvfree(spec); return 0; err_action: - kvfree(spec); + if (pol_entry->ipsec_rule.rule != NULL) + mlx5_del_flow_rules(&pol_entry->ipsec_rule.rule); + kvfree(spec); err_alloc: - if (rx->chains) + if (rx->chains != NULL) ipsec_chains_put_table(rx->chains, attrs->prio); return err; } @@ -1854,7 +1935,9 @@ void mlx5e_accel_ipsec_fs_del_rule(struct mlx5e_ipsec_sa_entry *sa_entry) mlx5_del_flow_rules(&ipsec_rule->rule); mlx5_del_flow_rules(&ipsec_rule->kspi_rule); - if (ipsec_rule->reqid_rule) + if (ipsec_rule->vid_zero_rule != NULL) + mlx5_del_flow_rules(&ipsec_rule->vid_zero_rule); + if (ipsec_rule->reqid_rule != NULL) mlx5_del_flow_rules(&ipsec_rule->reqid_rule); mlx5_fc_destroy(mdev, ipsec_rule->fc); mlx5_packet_reformat_dealloc(mdev, ipsec_rule->pkt_reformat); @@ -1863,7 +1946,7 @@ void mlx5e_accel_ipsec_fs_del_rule(struct mlx5e_ipsec_sa_entry *sa_entry) return; } - if (ipsec_rule->modify_hdr) + if (ipsec_rule->modify_hdr != NULL) mlx5_modify_header_dealloc(mdev, ipsec_rule->modify_hdr); } @@ -1881,6 +1964,8 @@ void mlx5e_accel_ipsec_fs_del_pol(struct mlx5e_ipsec_pol_entry *pol_entry) struct mlx5_core_dev *mdev = mlx5e_ipsec_pol2dev(pol_entry); mlx5_del_flow_rules(&ipsec_rule->rule); + if (ipsec_rule->vid_zero_rule != NULL) + mlx5_del_flow_rules(&ipsec_rule->vid_zero_rule); if (pol_entry->attrs.dir == IPSEC_DIR_INBOUND) { struct mlx5e_ipsec_rx *rx; From nobody Tue Aug 20 12:43:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KM2ZlFz5T4Gt; Tue, 20 Aug 2024 12:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp8KL31Qsz4TJN; Tue, 20 Aug 2024 12:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GToH70GJNSBL1fyAsll9Q/qAo9BZ09Jd1UWdVEI77as=; b=pt48nFBKOPEwdsYVOzZmbIoQvpPnU0uzc9OFERz+SAGKDBPLZgs3XLLTdggrqtx1zHDlIb fzm7bnwJKKQPAOAZ6/JHyapCLjLozqEfbbz694L6fAvtQLLTcW384hMfLyR/E4oB1vqz4c 3hb5Lcu5zTpNW9RYVOrfhJMXBl0gBpJmYKiMpntE7dvVYsXpx9KopzrvkhHvDtcSnRnfBt JbU3+AISknl5eJS+4j87ScGpvG2YEHAYNdvEs5T/xMv0AzRN1lsNiqpNiwJDhLolfQDZ+u CMNbEPitsV48UnEX/ZIY6oAQ6Vbo3klML4hRJmdnGykp2WG7cGxb1FNBiRHrJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157830; a=rsa-sha256; cv=none; b=VBuc7ted1FhC2slfUL/lAK5DI4HxGk+mgAJ1eIDzza9O/38P/Vs6otEbZn3UCDyu8sNz0y XwVwJGMCDLd/hZ5slREW6ptKDWKMlX4Xg0Zl8C1JSNxGRTEy662bcTldQA7z41iQm3x0cI F0pjJp73U9ascMmscbDXOFbzi8SVVxtn1hBjtnvqRDDrK4MLQxZfd+qXvYIpWiRCWpa7sE a5TN2uaPJ13yDT9f9/XgMLmx2EKm2bZN61W4z1svTo+2QUuc/DBamjFyfgjue1cAEnkqUD 7oXoG5eRJVMDstzwbPO7SOJuKGZCDuwdy+QRz5DDrVSEiMIwe34YtAwZ+fqh/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=1724157830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GToH70GJNSBL1fyAsll9Q/qAo9BZ09Jd1UWdVEI77as=; b=vKPtI5sfGQ1T3xIwH3RqPaq2UzCJp9zbcj3DIXGAdjV9rCxjaN6w5HRkoycT6NCOCtAFQ6 hx+We2VzfLh0ffuD2X/4pDdN0zbuGyR+gSr2yERwS9aBPb8+5ACdRtJumnCgQdpUkDoWiG 2OFIM6dbNfMH9TsM4pD3e2FUgo7UjSCsj8mCJleVaHmPreDXXFm1MW5fGZIEjKUyNaF5AI suXDWlsby2yRoDFS+l9Rhx4oL3ll38X/z0Xb0k7fePqBPHgdvR4yCOJxopJgfRhYz5bo4/ TJgKDPUSB9PCfpBqJ5yXajL93ZvKQeWgjiA1IZEKIXkBquZ9hSeETNzna46YXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KL2ZJ8z10sy; Tue, 20 Aug 2024 12:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KChoTP054452; Tue, 20 Aug 2024 12:43:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChoVd054449; Tue, 20 Aug 2024 12:43:50 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:50 GMT Message-Id: <202408201243.47KChoVd054449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 84abf7e26d19 - main - ipsec_offload: support vlans List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84abf7e26d1981a26cc3cd1842d5cefeb2253754 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=84abf7e26d1981a26cc3cd1842d5cefeb2253754 commit 84abf7e26d1981a26cc3cd1842d5cefeb2253754 Author: Konstantin Belousov AuthorDate: 2024-07-17 05:55:56 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 ipsec_offload: support vlans Sponsored by: NVIDIA networking --- sys/net/if_vlan.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 4349a6c99291..45489138fdef 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -44,6 +44,7 @@ #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ipsec.h" #include "opt_kern_tls.h" #include "opt_vlan.h" #include "opt_ratelimit.h" @@ -184,6 +185,7 @@ struct ifvlan { void *ifv_cookie; int ifv_pflags; /* special flags we have set on parent */ int ifv_capenable; + int ifv_capenable2; int ifv_encaplen; /* encapsulation length */ int ifv_mtufudge; /* MTU fudged by this much */ int ifv_mintu; /* min transmission unit */ @@ -1750,6 +1752,7 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid, ifv->ifv_mintu = ETHERMIN; ifv->ifv_pflags = 0; ifv->ifv_capenable = -1; + ifv->ifv_capenable2 = -1; /* * If the parent supports the VLAN_MTU capability, @@ -2008,13 +2011,90 @@ vlan_link_state(struct ifnet *ifp) NET_EPOCH_EXIT(et); } +#ifdef IPSEC_OFFLOAD +#define VLAN_IPSEC_METHOD(exp) \ + if_t p; \ + struct ifvlan *ifv; \ + int error; \ + \ + ifv = ifp->if_softc; \ + VLAN_SLOCK(); \ + if (TRUNK(ifv) != NULL) { \ + p = PARENT(ifv); \ + if_ref(p); \ + error = p->if_ipsec_accel_m->exp; \ + if_rele(p); \ + } else { \ + error = ENXIO; \ + } \ + VLAN_SUNLOCK(); \ + return (error); + + +static int +vlan_if_spdadd(if_t ifp, void *sp, void *inp, void **priv) +{ + VLAN_IPSEC_METHOD(if_spdadd(ifp, sp, inp, priv)); +} + +static int +vlan_if_spddel(if_t ifp, void *sp, void *priv) +{ + VLAN_IPSEC_METHOD(if_spddel(ifp, sp, priv)); +} + +static int +vlan_if_sa_newkey(if_t ifp, void *sav, u_int drv_spi, void **privp) +{ + VLAN_IPSEC_METHOD(if_sa_newkey(ifp, sav, drv_spi, privp)); +} + +static int +vlan_if_sa_deinstall(if_t ifp, u_int drv_spi, void *priv) +{ + VLAN_IPSEC_METHOD(if_sa_deinstall(ifp, drv_spi, priv)); +} + +static int +vlan_if_sa_cnt(if_t ifp, void *sa, uint32_t drv_spi, void *priv, + struct seclifetime *lt) +{ + VLAN_IPSEC_METHOD(if_sa_cnt(ifp, sa, drv_spi, priv, lt)); +} + +static int +vlan_if_ipsec_hwassist(if_t ifp, void *sav, u_int drv_spi,void *priv) +{ + if_t trunk; + + NET_EPOCH_ASSERT(); + trunk = vlan_trunkdev(ifp); + if (trunk == NULL) + return (0); + return (trunk->if_ipsec_accel_m->if_hwassist(trunk, sav, + drv_spi, priv)); +} + +static const struct if_ipsec_accel_methods vlan_if_ipsec_accel_methods = { + .if_spdadd = vlan_if_spdadd, + .if_spddel = vlan_if_spddel, + .if_sa_newkey = vlan_if_sa_newkey, + .if_sa_deinstall = vlan_if_sa_deinstall, + .if_sa_cnt = vlan_if_sa_cnt, + .if_hwassist = vlan_if_ipsec_hwassist, +}; + +#undef VLAN_IPSEC_METHOD +#endif /* IPSEC_OFFLOAD */ + static void vlan_capabilities(struct ifvlan *ifv) { struct ifnet *p; struct ifnet *ifp; struct ifnet_hw_tsomax hw_tsomax; - int cap = 0, ena = 0, mena; + int cap = 0, ena = 0, mena, cap2 = 0, ena2 = 0; + int mena2 __unused; u_long hwa = 0; NET_EPOCH_ASSERT(); @@ -2025,6 +2105,7 @@ vlan_capabilities(struct ifvlan *ifv) /* Mask parent interface enabled capabilities disabled by user. */ mena = p->if_capenable & ifv->ifv_capenable; + mena2 = p->if_capenable2 & ifv->ifv_capenable2; /* * If the parent interface can do checksum offloading @@ -2129,7 +2210,15 @@ vlan_capabilities(struct ifvlan *ifv) ifp->if_capabilities = cap; ifp->if_capenable = ena; + ifp->if_capabilities2 = cap2; + ifp->if_capenable2 = ena2; ifp->if_hwassist = hwa; + +#ifdef IPSEC_OFFLOAD + cap2 |= p->if_capabilities2 & IFCAP2_BIT(IFCAP2_IPSEC_OFFLOAD); + ena2 |= mena2 & IFCAP2_BIT(IFCAP2_IPSEC_OFFLOAD); + ifp->if_ipsec_accel_m = &vlan_if_ipsec_accel_methods; +#endif } static void From nobody Tue Aug 20 12:43:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KP3xLZz5T487; Tue, 20 Aug 2024 12:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp8KN4mmNz4TXm; Tue, 20 Aug 2024 12:43:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5HDtnAhqkiPcPjx4mOEFE5GOOzjEKHcx0pV5XQhB6m0=; b=vs73LkXZIAzPP7Fzc/icFx1vJzAIhtE/wrVBM1f3eBg6KQeErhFAzdz0UJ8meHG+Cm0j91 UySI3680o6Zq90nvOoUkPaZIVwKdr5gcweWCldi4WIof60amXaKyfm9b67JtiT1QuxeWr6 Om+AQyBe8RHP7oKgaQOVk2Tzce219JS8hoSOZabKyZhKQWxWhmZrEGTOpHJ/4VMlC/ahEh SYSXFt+7syS2EwwBhFIHL+Rp03EoT28x/pkuOlLo3m426ZHHv4Kpx6oXCY7O17MkkFg/d4 cmxWC8DJcB5iJ96UUbBPVxOovR6W2JaEywtGA66ox1ns91XFyhwUfgTzVzzsjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157832; a=rsa-sha256; cv=none; b=GRqKZLyHNFHR5EdH6U9cvI6L0DtwJ1BHRWxoWtLId1k8Yxt758SBPj5Kt2cJJ05gXJYHFR t6fRKCKabR7ibgYc9kOoez6lt0NdbyHQo1RLdkO4SfHmIyBxvoP+Q5dunvXyttDn3quyVx atc58SrmqS+q/eEU8of1k4kqgiWzWJup4QONvWohjiQ5iDKR10VdjohDrcJilSj2hd6Fe6 wdHCH9NtFpG75kEL/PmLCyWfCpsM2BgCxir5soIWChPrDC4MV7TliKPpnvOXXNhv/l6IiQ yGC07mXiynxc8qMR9uXARgtSVAZi2O/PExvJloRTGCRB2qeQjES5C/GmEsWoag== 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=1724157832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5HDtnAhqkiPcPjx4mOEFE5GOOzjEKHcx0pV5XQhB6m0=; b=CQa+wbIoCfx9ZgHpI+BaClGSLenHYa5pndqUOpTBgGTqbyCdy5WqmIMqPZb7zbsdFt4s70 soqwJXKr0Q9uGst1BMZZQ7k2AM6TQokpa4pduIU6fK2SSol8FWlmkjR8AB+ST/S1RvSbsU e5Ro+2qyPDnv9OD3+7laK7SH1zAP89ZN8T5mmWTDXBLmftQh+L3b3cND6r+bdeMppgiBHE jkTGCIhOBNMZSpzmssSQXuFZfqd/Hv2g0HmCH2yNhYSqQPRNn1/QYdt0l5/DvOEbTdwDHE 4x0rKJDghYhInzRICSFx/q9STymuXIsqbEiEMZAhAi6Zq1hKlFcBX2EosvhhkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KN43FVz11KX; Tue, 20 Aug 2024 12:43: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 47KChqub054542; Tue, 20 Aug 2024 12:43:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChqcb054539; Tue, 20 Aug 2024 12:43:52 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:52 GMT Message-Id: <202408201243.47KChqcb054539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 66f0e2017f7c - main - ipsec_offload: add ipsec_accel_drv_sa_lifetime_fetch() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66f0e2017f7cd804f31ae4fc2ad38607d85a08d3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66f0e2017f7cd804f31ae4fc2ad38607d85a08d3 commit 66f0e2017f7cd804f31ae4fc2ad38607d85a08d3 Author: Konstantin Belousov AuthorDate: 2024-08-18 13:22:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:13 +0000 ipsec_offload: add ipsec_accel_drv_sa_lifetime_fetch() A function to fetch hardware counters for offloaded SA on specific interface. Sponsored by: NVidia networking --- sys/netipsec/ipsec_offload.c | 29 +++++++++++++++++++++++++++++ sys/netipsec/ipsec_offload.h | 4 ++++ sys/netipsec/key.c | 15 +++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index 4d81803f4be7..bbf98ac7a676 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -157,6 +157,8 @@ static struct mbuf *ipsec_accel_key_setaccelif_impl(struct secasvar *sav); static void ipsec_accel_on_ifdown_impl(struct ifnet *ifp); static void ipsec_accel_drv_sa_lifetime_update_impl(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); +static int ipsec_accel_drv_sa_lifetime_fetch_impl(struct secasvar *sav, + if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs); static void ipsec_accel_ifdetach_event(void *arg, struct ifnet *ifp); static void @@ -177,6 +179,8 @@ ipsec_accel_init(void *arg) ipsec_accel_on_ifdown_p = ipsec_accel_on_ifdown_impl; ipsec_accel_drv_sa_lifetime_update_p = ipsec_accel_drv_sa_lifetime_update_impl; + ipsec_accel_drv_sa_lifetime_fetch_p = + ipsec_accel_drv_sa_lifetime_fetch_impl; pctrie_init(&drv_spi_pctrie); ipsec_accel_ifdetach_event_tag = EVENTHANDLER_REGISTER( ifnet_departure_event, ipsec_accel_ifdetach_event, NULL, @@ -200,6 +204,7 @@ ipsec_accel_fini(void *arg) ipsec_accel_key_setaccelif_p = NULL; ipsec_accel_on_ifdown_p = NULL; ipsec_accel_drv_sa_lifetime_update_p = NULL; + ipsec_accel_drv_sa_lifetime_fetch_p = NULL; ipsec_accel_sync_imp(); clean_unrhdr(drv_spi_unr); /* avoid panic, should go later */ clear_unrhdr(drv_spi_unr); @@ -1017,6 +1022,30 @@ out: NET_EPOCH_EXIT(et); } +static int +ipsec_accel_drv_sa_lifetime_fetch_impl(struct secasvar *sav, + if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs) +{ + struct ifp_handle_sav *i; + int error; + + NET_EPOCH_ASSERT(); + error = 0; + + mtx_lock(&ipsec_accel_cnt_lock); + CK_LIST_FOREACH(i, &sav->accel_ifps, sav_link) { + if (i->ifp == ifp && i->drv_spi == drv_spi) { + *octets = i->cnt_octets; + *allocs = i->cnt_allocs; + break; + } + } + if (i == NULL) + error = ENOENT; + mtx_unlock(&ipsec_accel_cnt_lock); + return (error); +} + static void ipsec_accel_sa_lifetime_hw(struct secasvar *sav, if_t ifp, struct seclifetime *lft) diff --git a/sys/netipsec/ipsec_offload.h b/sys/netipsec/ipsec_offload.h index 72055a110951..904fe6252396 100644 --- a/sys/netipsec/ipsec_offload.h +++ b/sys/netipsec/ipsec_offload.h @@ -64,6 +64,8 @@ extern struct mbuf *(*ipsec_accel_key_setaccelif_p)(struct secasvar *sav); extern void (*ipsec_accel_on_ifdown_p)(struct ifnet *ifp); extern void (*ipsec_accel_drv_sa_lifetime_update_p)(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); +extern int (*ipsec_accel_drv_sa_lifetime_fetch_p)(struct secasvar *sav, + if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs); #ifdef IPSEC_OFFLOAD /* @@ -191,6 +193,8 @@ struct ipsec_accel_in_tag *ipsec_accel_input_tag_lookup(const struct mbuf *); void ipsec_accel_on_ifdown(struct ifnet *ifp); void ipsec_accel_drv_sa_lifetime_update(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); +int ipsec_accel_drv_sa_lifetime_fetch(struct secasvar *sav, + if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs); #endif /* _KERNEL */ diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 149173e0b5f6..5a3e5727bc2e 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -112,6 +112,8 @@ struct mbuf *(*ipsec_accel_key_setaccelif_p)(struct secasvar *sav); void (*ipsec_accel_on_ifdown_p)(struct ifnet *ifp); void (*ipsec_accel_drv_sa_lifetime_update_p)(struct secasvar *sav, if_t ifp, u_int drv_spi, uint64_t octets, uint64_t allocs); +int (*ipsec_accel_drv_sa_lifetime_fetch_p)(struct secasvar *sav, if_t ifp, + u_int drv_spi, uint64_t *octets, uint64_t *allocs); #endif #define FULLMASK 0xff @@ -8990,4 +8992,17 @@ ipsec_accel_drv_sa_lifetime_update(struct secasvar *sav, if_t ifp, if (p != NULL) p(sav, ifp, drv_spi, octets, allocs); } + +int +ipsec_accel_drv_sa_lifetime_fetch(struct secasvar *sav, + if_t ifp, u_int drv_spi, uint64_t *octets, uint64_t *allocs) +{ + int (*p)(struct secasvar *sav, if_t ifp, u_int drv_spi, + uint64_t *octets, uint64_t *allocs); + + p = atomic_load_ptr(&ipsec_accel_drv_sa_lifetime_fetch_p); + if (p == NULL) + return (EOPNOTSUPP); + return (p(sav, ifp, drv_spi, octets, allocs)); +} #endif From nobody Tue Aug 20 12:43:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp8KQ5L4Cz5T447; Tue, 20 Aug 2024 12:43: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 4Wp8KP5jjkz4Tfk; Tue, 20 Aug 2024 12:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n8UNk/oYFuDtVGNN7z9Llo01el7CTOZ+kuYsMSWBais=; b=ggZ/iaHpihnSM8kTUhbpsAwSjeCs05bIexNUen1gJ/nDlU5HCt5r5PGL0/taREbOeTl0Rt TGoBrFySehXxmwMSmNWbxym47/sj9q95L9UjtqicR6j9Iu9AzIG5PYQVjbeCcJnjSspvZz qK+u9CNh/7vBrKPqoKYB+13qCJ3dGillH4OueMEeciiCePP+wtEwsZmvEEL5mYYLheDI7i tkh+eIUijBXrqY1gwGN4oGzLZ2lVX7475qp1sa4VSRp7uroOIPa/JLudMpeJ3nHrCLAV4Q XbZ+PgYTci6fFoJoOWgHbTmcQlrK1vPwjPHnhxe1T6KzsjWfT6AJh5jutSbhfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157833; a=rsa-sha256; cv=none; b=F5Vd2CeCuZmWWKkDRCxaEE91h/S93/e9f+vR5UhXE1rVPzG5LEyepQmMfmAfG9ckqD5SP/ dF5pZExS+zPCmi3voYdY2ju67DNgWiFv2IMD4s4Tw2tsFDdGFsyrsZO8dQYCqpj5x0+yQ1 oO7eCZSCWz7rbbebTdRDKBRcmHOB1jMCE8AKHnkCXaZhjTzHZY2Qqe2sM1kpqv1cF58XBD WHFFHrH3z3hiX+UTAoFgCl6UcbFjw6cvdmIYoRUKiQjSlZyGlFEBj4LA41q8nBxQVZMAFj o80vkH7AX+uqo1pa/XlAd9WJ1F5/EtCevl64lASFsrpPAEon26QQYxIIAqPWrw== 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=1724157833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n8UNk/oYFuDtVGNN7z9Llo01el7CTOZ+kuYsMSWBais=; b=Wl9LyTeV7j1/29Cy7XU/xqlS0rKF49EDuZH65nos3idgRRW2934b4HoxulalRCVSrxaaFP /t5PgHQE/nVx7lPDRoz1UjOkDnlhi6MunoZ8DqCdd9VmwkBgnuHkFadbilevuKRdDXU9/E UHHHVCB9Rf8AZaqzqbRwTmaVCQTaIzZwkMW+ta87vPL9FiOsgzzlfVxj5NYR2907q94eG7 thBCnq9xAM41KqwX8Sy/aY41+V09ESthFrPrs6GS/3vzY0M/G1T2E9AySN0WbMpSACali8 Al68n7IkIcyo6bTuo42ygpqMb+i0k19tdSgk7bCr378UXR5SFdQMC2u8o5cpkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp8KP4xljz10ww; Tue, 20 Aug 2024 12:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KChrlR054587; Tue, 20 Aug 2024 12:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChrDM054584; Tue, 20 Aug 2024 12:43:53 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:53 GMT Message-Id: <202408201243.47KChrDM054584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e9ace6e8f8fb - main - net/if_lagg.c: remove stray include is sys/cdefs.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9ace6e8f8fb69cbc4973bc2d3ae1b4088cc49dd Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e9ace6e8f8fb69cbc4973bc2d3ae1b4088cc49dd commit e9ace6e8f8fb69cbc4973bc2d3ae1b4088cc49dd Author: Konstantin Belousov AuthorDate: 2024-08-15 03:34:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:13 +0000 net/if_lagg.c: remove stray include is sys/cdefs.h Sponsored by: NVidia networking --- sys/net/if_lagg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 2f558fba32de..988f23fc029c 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -18,7 +18,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include "opt_inet.h" #include "opt_inet6.h" #include "opt_kern_tls.h" From nobody Tue Aug 20 13:29:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp9LL09KTz5T7hc; Tue, 20 Aug 2024 13:29: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 4Wp9LK6lNZz4bKw; Tue, 20 Aug 2024 13:29:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724160585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PWzFoUEmUwxVZNliMH1Walp1U3fdeR+u6sl9w9yTh0=; b=BIRYNKOnL0CGsS1QrMbs+EtQR6YyNJkMACRxfEhk0tceUzBekRxQ8/BFLdXphRISBwoTZq zA0ijQh8y2Sm/u/j4xGuvs3R4kx7NRadhuMINBGBNPeoy8YjIbeHJLhP9z9sMqBW3hiD+F 3BbtGkbpV+wXxwY3nVkiifeTknNTW00kicnVebEhGxBID9m4d8BZWbf5veON9GCkQELfWN gZNKCnbB1MSLIUqUESDvQ43fXODGpxvSH5+2JAhjgr7RWqGrs77ZFWOf9vC9QqrkaVrG1Z rbqRY+6YiOsMNTRz3WwFdAu5KZoC81CjFT9Dru5yrN6VEmdAcQCCold4GFP+Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724160585; a=rsa-sha256; cv=none; b=KT9puN8RIR7niHLERO9EIA/QiRNKtEHWRGs5cCAnIAQMs/HXosrMFCN9U6Kp15lG7yc5kS s/6cZVfcPI9eB2vvopLbbxwXCsi/ejC+aVVQW+QI+ktySq+VhOTHsCScdDljffgW/m4AFi IKYQwGM/hSXPzx9bwETq96y+FoJux4Du3AEeehgpqizVAjN+VwJjIBDwEnPZdZ+/pbd9nW phYdv5WKXgWKTBT5BfI0Kji22VFy51TTh24LxePEJdJV1hemTiGqeHJT1QaS3oAtpJ47jW IiPQC7Ve/pUl/Cih5WzB+FKd1T9+5nA+t0AEHqFYpLRwjhWhgzJHUsazygmTQQ== 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=1724160585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PWzFoUEmUwxVZNliMH1Walp1U3fdeR+u6sl9w9yTh0=; b=ZwwnSZBWcVH48UgSczzLvK+JrbBODdSgm+DQ+aganWqO8fVnBQes3SOl6y5SdTlpLCAaom c+fB6iC7RH89FrQiNzgrvrRfYoxUz7grh+e92ysW2FJ/Xq9bc2LOORsA+JNUsTSVdP/VL+ Yxfx9VU2cUC8yuMV/BA2AfeeLQbDxpjEnmuaiMa+/ykn9M6E9T4N6bXwyaOak5o99m4ZuR +23jnqFUvIYQ/o1zp7lK3WrtaNEWozH3v/B0WTnIqQi6skzirTnXeofhKouJaI4zKdZ6pc fIk73hF3yjxr87uKIWpF8wtH8sLUmXmZd9y+SRMVrURFL4ZsURcRMivBa9LQmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp9LK6Kfhz12Tv; Tue, 20 Aug 2024 13:29: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 47KDTjLi023499; Tue, 20 Aug 2024 13:29:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KDTjfO023496; Tue, 20 Aug 2024 13:29:45 GMT (envelope-from git) Date: Tue, 20 Aug 2024 13:29:45 GMT Message-Id: <202408201329.47KDTjfO023496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: d1e78fbd4a67 - main - bsd-family-tree: add NetBSD 9.4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1e78fbd4a67245e058e9d26b333216093f8d2d1 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=d1e78fbd4a67245e058e9d26b333216093f8d2d1 commit d1e78fbd4a67245e058e9d26b333216093f8d2d1 Author: Wolfram Schneider AuthorDate: 2024-08-20 13:26:46 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-20 13:26:46 +0000 bsd-family-tree: add NetBSD 9.4 --- share/misc/bsd-family-tree | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 4f9ee8d438d8..5b5bf87557b8 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -438,23 +438,23 @@ FreeBSD 5.2 | | | | | 13.1 | | | | | | | | | | | | | DragonFly 6.2.2 | | | | | NetBSD 9.3 | | - | | | macOS | OpenBSD 7.2 | - | | | 13 | | | - | | FreeBSD | | | | - | | 12.4 | | | | - | | | | | DragonFly 6.4.0 - | | | | OpenBSD 7.3 | - | FreeBSD | | | | - | 13.2 | | | | - | | | | | | - | `------. | | | | - | | macOS | | | - | | 14 | | | - | | | | OpenBSD 7.4 | - *--FreeBSD | | | | | - | 14.0 | | | | | - | | | | | | | - | | FreeBSD | | | | + | | | macOS | | OpenBSD 7.2 | + | | | 13 | | | | + | | FreeBSD | | | | | + | | 12.4 | | | | | + | | | | | | DragonFly 6.4.0 + | | | | | OpenBSD 7.3 | + | FreeBSD | | | | | + | 13.2 | | | | | + | | | | | | | + | `------. | | | | | + | | macOS | | | | + | | 14 | | | | + | | | | | OpenBSD 7.4 | + *--FreeBSD | | | | | | + | 14.0 | | | | | | + | | | | | | | | + | | FreeBSD | | NetBSD 9.4 | | | | 13.3 | | | | | | | *--NetBSD | | | | | | 10.0 | | @@ -894,6 +894,7 @@ FreeBSD 14.0 2023-11-20 [FBD] FreeBSD 13.3 2024-03-05 [FBD] NetBSD 10.0 2024-03-28 [NBD] OpenBSD 7.5 2024-04-05 [OBD] +NetBSD 9.4 2024-04-20 [NBD] FreeBSD 14.1 2024-06-04 [FBD] Bibliography @@ -959,5 +960,5 @@ original BSD announcements from Usenet or tapes. Steven M. Schultz for providing 2.8BSD, 2.10BSD, 2.11BSD manual pages. -- -Copyright (c) 1997-2023 Wolfram Schneider +Copyright (c) 1997-2024 Wolfram Schneider URL: https://cgit.freebsd.org/src/tree/share/misc/bsd-family-tree From nobody Tue Aug 20 13:29:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wp9LM1FF4z5T81V; Tue, 20 Aug 2024 13:29: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 4Wp9LM0bFTz4bFy; Tue, 20 Aug 2024 13:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724160587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sOOJIsB151Cx0CYKXpTbsT++CYkOKtH+of3RP3N0av0=; b=lbZp1SGh5LqVowpcrqk3cMsiMnY3XP+ZykZJh2pi/6fHhlkaYO7iins41wIe33RRuzmz8z vbjjzLQ0xTbjry7mXH8OyPDv7XobmMUAvqXosnCKki5WrdXjhXYM+WkT2OJvWDSSWGqxbc VUX75mcra+/yp0c0HmnDWYZc8kb2aIv9MMfFBwNgag3by0Jm+NJTBF+0qXqAxqY4xYkE1u 2MFxP/NG3FH75ewaJ8PFMrKTQZS0BFZ7xQyxD1ZU3eOzfkPaU/UjDY14Rg+lCDzneBT1sV XoNyGvV695l7Kpk7Py8ex5/Suzj1Eouz4NFSip07r+J9PNi0z+Q8JKrEpf/qHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724160587; a=rsa-sha256; cv=none; b=voByxK+kKKU0zoCq2WRD0v4T7RD1RPMevAN06NmvQ2GWLnG8uQbX+99LzhlzKlCUykd08W ghrfxbOgk/LsRD+gEx2YwlTDA0HMVkvcXuv+2+WyY1TGHrNPQ4Esrw9Tl1j0RrrfIa/5yX 1h+E+9GItee4v3gaa0gLYGN0rL6qZLeBAQhmgH8tOjA4FJGHwnyFLdZ5sdfueMTGJCXgOC Yz5ifb3qN6vyfNmTESiMYNJ8hnrYzmUq/KtpEZ9WohcOiKrKdUZpNYc490OIDvWXQvyzEZ 3pvYM5lFKCqAHErrHpjv5/MESN6muxOPHVxcI2NY9BOIpH2CkN7mxQV7HmKMVQ== 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=1724160587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sOOJIsB151Cx0CYKXpTbsT++CYkOKtH+of3RP3N0av0=; b=yxzTmRtzolkz/NjKp6Z+7/434EvMK3dQBEitwAG4im4PY9JwIAOEOwrh8qfR2lO5DNY+sU rYRyzsuaz+3F/GqAO4YfkTcK05vQaRXHwgRf4wKZu6Qz0bbG0Z4JJHgYfTeFL+PEqZIDna hDwzZczgmNvK8O8Eyim67WDYG5YPGYxTc0Iqr/E56c3vwkEDDuYqoDbp6E8LHK69rBJEKF L+ZEThuy2bJd51GoZyiPNYckeARVhdfacP/MGSiizoP/c2/FX7Ua4pk7ACak/0PDIy2twC XcSHkbdeSdYxGI8zGY6iOku8VOe0BuoOKYoycH69sYzi2s214jDl5ahNYpL4Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wp9LM08snz12Tw; Tue, 20 Aug 2024 13:29: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 47KDTk15023537; Tue, 20 Aug 2024 13:29:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KDTkad023534; Tue, 20 Aug 2024 13:29:46 GMT (envelope-from git) Date: Tue, 20 Aug 2024 13:29:46 GMT Message-Id: <202408201329.47KDTkad023534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: d4a4d1e74285 - main - bsd-family-tree: shorter URLs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4a4d1e742852b00427f723f59534b42718628de Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a4d1e742852b00427f723f59534b42718628de commit d4a4d1e742852b00427f723f59534b42718628de Author: Wolfram Schneider AuthorDate: 2024-08-20 13:29:18 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-20 13:29:18 +0000 bsd-family-tree: shorter URLs --- share/misc/bsd-family-tree | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 5b5bf87557b8..c4a7790b773d 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -492,7 +492,7 @@ the announcement in Usenet or if it was available as tape. [QCU] Salus, Peter H. A quarter century of UNIX. ISBN 0201547775, EAN 9780201547771 [SMS] Steven M. Schultz. 2.11BSD, UNIX for the PDP-11. -[TUHS] The Unix Historical Society. https://minnie.tuhs.org/Unix_History/. +[TUHS] The Unix Historical Society. https://minnie.tuhs.org/Unix_History/ [USE] Usenet announcement. [WRS] Wind River Systems, Inc. [dmr] Dennis Ritchie, via E-Mail @@ -941,7 +941,7 @@ FreeBSD Documentation Archive URL: https://docs-archive.freebsd.org/doc/ UNIX history graphing project -URL: https://minnie.tuhs.org/Unix_History/index.html +URL: https://minnie.tuhs.org/Unix_History/ UNIX history URL: https://www.levenez.com/unix/ From nobody Tue Aug 20 14:04:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpB690LHhz5TBMM; Tue, 20 Aug 2024 14:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpB686yyHz4fhf; Tue, 20 Aug 2024 14:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724162657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V0AneJlUMrHRZhtCpD9bAbWE69R+SrmSVn76Ib7E0rQ=; b=TivDBRC0p16fL5IMp9AxTqkcuUbl3Pc5ZkHOTvAXjP60mrek/eAZtZoY/dIr1LkzFdzV03 aFR/GL+t0+R8TIZT4pgbd54OA7T/oqwjYeGhHaG7/MZbn/7Kc7F90sV0YN4+6q+sMsZW3W CZyf4yraoTK5yVN2JCsYClV1pp5fvQ3xBIzwpvKzvi6YSqBpagYq/pW8YHG5PnFjJ+nnZr eEiEjBKJ//EG0d9jH5djrg+lmWCDiKmn/wwzNBKNfZtx7K8c3Wtk7eTyAaeTKUehLkIjBj ShOCzwCMjn4Jxy8DNBPc69ArX+qQg0iFmVSLP8sKdKPPyzevx/H63rbNTrEVgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724162657; a=rsa-sha256; cv=none; b=aqUG556gkk50KSbx6w2rpkkXPfKbwn/BtlFie8wpcbNX8thF/0AEehMgq66QuRQC1iWTPk XxIicWEfi6VMFVeyY6psoqZGUrl91oiNcDhpEdZKjULfvOeGYpgbRKO5vhfk9CO6fH7X8k HrtKMxgzDGp+hATci9HstlsxyCukl2J/DhPSu3Oux8ijN8lh144ZYAj8fBhVp8OIm/lgjI RitgM4Y3FTMKtzowVwSITYeUV6rGQnKSah9ZdVebZ85y3oppAyswKYznO9r3+SjAfh3cjm JAkTvVPlc1uRkAE+P7Mdt2iQDRikbpWw/psJLP0TaAD7+Eix0CD941KwsLVGdg== 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=1724162657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V0AneJlUMrHRZhtCpD9bAbWE69R+SrmSVn76Ib7E0rQ=; b=cEFXsqbJcwEW8T6m/66AHCJ+GlFbOK3ZCdQy+ZvHo8Dyp5GDnImMFid1mNEhcXlmQjMyEJ XAqhqWitTLF6uK4Su9cb30EW1Ggj485aEga6F9K4q+QGs4v3hwCp4+AVCVVgfNK6aCo46C 9wDhKQIUXE++lxPmOg6JL1w7+4wevR2m0cs0sgsUEUubgZ3WpIT2YWPKMjlHjmFvUYIv7M 5mowecFXHnDMjtxJzxiu4cHzbbaY2wW+/zccDF6wwcMH0yyoxCLrFje9VI9xRMUz4mvLBT 4JdUtZnyrHsMlwfKD5ok2+9fdN+k72U+jKGmWqqfY05FV8nwVN9guE8zcYHy/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpB686ZYyz132q; Tue, 20 Aug 2024 14:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KE4GkN090770; Tue, 20 Aug 2024 14:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KE4GHk090767; Tue, 20 Aug 2024 14:04:16 GMT (envelope-from git) Date: Tue, 20 Aug 2024 14:04:16 GMT Message-Id: <202408201404.47KE4GHk090767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: e5b853808363 - main - libalias: add another check to previous change List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5b85380836378c9e321a4e6d300591e6faf622a Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=e5b85380836378c9e321a4e6d300591e6faf622a commit e5b85380836378c9e321a4e6d300591e6faf622a Author: Eugene Grosbein AuthorDate: 2024-08-20 14:00:35 +0000 Commit: Eugene Grosbein CommitDate: 2024-08-20 14:04:13 +0000 libalias: add another check to previous change If UseLink() returns NULL, it is possible that Deletelink() has already freed "grp", so check it out carefully. PR: 269770 Reported by: Peter Much X-MFC-With: 8132e959099f0c533f698d8fbc17386f9144432f --- sys/netinet/libalias/alias_db.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index d516b6cda96c..4bb95549aaaf 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -875,6 +875,9 @@ _FindLinkIn(struct libalias *la, struct in_addr dst_addr, if (found != NULL) return (found); /* link expired */ + grp = StartPointIn(la, alias_addr, alias_port, link_type, 0); + if (grp == NULL) + return (NULL); break; } } From nobody Tue Aug 20 14:36:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpBqL1hYMz5TFMg; Tue, 20 Aug 2024 14:36: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 4WpBqL15NCz4pP1; Tue, 20 Aug 2024 14:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724164590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8ExEFQN0ye9bG4zLw8oa2ULCYO792FXb4JbQ/sj6N0=; b=fqerBYm/fWdf/DXelwsGomLyZVU04X/cWe+YXNnSm4ZGVbupCYvJQRhq4kmecFu9LTRejC mIL6huY2maoSpPMKopcJQsha83FJfgniupZlqCAm8vxwKgXbCvrsC2mi2B0wetZmzMHE66 Z81GT992N0fkyte1WFIqZMF3T38EE/QLJF+UY8Vv5BruZ0bciiU8vfRJZnMi44s8+BfxVD EuIuOfCvkj7EsBBqzprwkyVq2Hrdm9jt/OMRt1B/eMZ825CmIsRuwnaCpRKC+FzSfTyn0+ VXCez+4xOGleUIyePbSIa00B1xQ9l9sMfjxXo62l/bwSQf5ZbfV3ysjewCGHIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724164590; a=rsa-sha256; cv=none; b=KPpJVJ7Uf3/iPgqHZ5WF9E7O1rhU+wNby7kb3ZmgUEVcHH+6KqxNLbtH604GB42+bmQQRJ +sJM6MvHRg1ykMoWhcO50fIC+TdWqmAt5CbMiYqUnTl9pEsy6khZLa1YpfXUhbuCp2gK/X hCWAP6ryQ7QTv4HypHGLrUnllHJ7baMCQlcRgJ+boEfJYf8NvLVvl6rxnkR1u5j/Hqav1h 18+k+MMUXJ7BtiUQOXYjO2TVqq71csEojyurtIGksh1Oa7c3aCZf9q9JtVmwlf8KrR68Jq /K395uREQeAAUNbdlGXhwFw75BFGu0fytJf4awoMsirUxHbWO/B+G9xyc3V4tg== 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=1724164590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8ExEFQN0ye9bG4zLw8oa2ULCYO792FXb4JbQ/sj6N0=; b=A1lZsFnS7VMV7j02Nr2EYF1tF3t2t9/WMXuJS8/Qo7Bt91vpuEbZJ93zMe2MQDtSNH/OjL 92HC/Ou5JQl1n74Oc6dZvm0PzREgcNFSpmNJ4COzVKaCCEcFymN/khnQvYOtnFqERfPd9U K17Uj2143BBOizTqQ6o5geQ1xukaRJp50ik7F+RjU4t5DMN+9v80FbveG0eqePgRItY/Jd DWgTTF9WmoBHRiUBlEVWz92cDg7lnWGegmCSSq3zyNBCNn05YZNHE1YdJz8BwwmRjzHrj8 UqmjZkX3U8KkESJ9wmykznb2QAeDDEyQwNKmDDKMeTOFLRBMe7IlpbLH/ZitQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpBqL0hydz13qp; Tue, 20 Aug 2024 14:36: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 47KEaU8e042253; Tue, 20 Aug 2024 14:36:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KEaU9G042250; Tue, 20 Aug 2024 14:36:30 GMT (envelope-from git) Date: Tue, 20 Aug 2024 14:36:30 GMT Message-Id: <202408201436.47KEaU9G042250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: b49aec04f073 - main - bsd-family-tree: fix macOS 11 release date List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b49aec04f073de02b03b44503feffeb52cbbdd51 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=b49aec04f073de02b03b44503feffeb52cbbdd51 commit b49aec04f073de02b03b44503feffeb52cbbdd51 Author: Wolfram Schneider AuthorDate: 2024-08-20 14:35:29 +0000 Commit: Wolfram Schneider CommitDate: 2024-08-20 14:36:20 +0000 bsd-family-tree: fix macOS 11 release date --- share/misc/bsd-family-tree | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index c4a7790b773d..1d8dacf393be 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -868,7 +868,7 @@ DragonFly 5.8.3 2020-09-24 [DFB] OpenBSD 6.8 2020-10-18 [OBD] NetBSD 9.1 2020-10-18 [NBD] FreeBSD 12.2 2020-10-27 [FBD] -macOS 11 2020-11-19 [APL] +macOS 11 2020-11-12 [APL] FreeBSD 13.0 2021-04-13 [FBD] OpenBSD 6.9 2021-05-01 [OBD] DragonFly 6.0 2021-05-08 [DFB] From nobody Tue Aug 20 14:37:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpBrZ1wDsz5TFTF; Tue, 20 Aug 2024 14:37:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpBrY5mL8z4pYf; Tue, 20 Aug 2024 14:37:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id gJmBsCp1p9TOUgPzJs0nY0; Tue, 20 Aug 2024 14:37:33 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id gPzGsFSK02M9qgPzIsb7mO; Tue, 20 Aug 2024 14:37:32 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=66c4aa2c a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=yoJbH4e0A30A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=8NkmwPbCC_4RqZIh4z8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id A0905C6A; Tue, 20 Aug 2024 07:37:30 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 9BCDB1E3; Tue, 20 Aug 2024 07:37:30 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mark Johnston cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: fb901935f257 - main - socket: Split up sosend_generic() In-reply-to: <202408191437.47JEbhOG094258@gitrepo.freebsd.org> References: <202408191437.47JEbhOG094258@gitrepo.freebsd.org> Comments: In-reply-to Mark Johnston message dated "Mon, 19 Aug 2024 14:37:43 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 20 Aug 2024 07:37:30 -0700 Message-Id: <20240820143730.9BCDB1E3@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCNY08Z6qVk8oaNW+L/QvsDJfxdUyndga+ZpH1pQWB5CAv+EZ8HmmAqQBlIVvy+ha4ztive9et8tdtb05+qM069PJ8jxBbqitYbmFdvEXVB7iunbfytT SsbyOGv7M5SwQlZcOLdQQ0WmOVmUAOLhywEdj017zfAbHg7XtDDFyApNYbKcCD0ywqvnJVV8HqEy5YKo802oM43Y063xNUBNVI1Jdxbmxh+o64QNzf2pNw/J BDMLgN1Zn4onbzc7hzHPb+z8ODD7QHwLs99qvCDd7mlpM3gqLWEcVJZvQANcURG7R8U+wQoRbxKzvDJkUcuCLxuwQmnRoeW5Awxv6j72huc= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4WpBrY5mL8z4pYf In message <202408191437.47JEbhOG094258@gitrepo.freebsd.org>, Mark Johnston wri tes: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb901935f257ddcc492fe9efb605797f > 181c6597 > > commit fb901935f257ddcc492fe9efb605797f181c6597 > Author: Mark Johnston > AuthorDate: 2024-08-19 14:20:43 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-19 14:37:27 +0000 > > socket: Split up sosend_generic() > > Factor out the bits that run with the sock I/O lock held into a separate > function. In this implementation, we are doing a bit more work under > the I/O lock than before. However, lock contention is only a problem > when multiple threads are transmitting on the same socket, which is an > unusual case that is not expected to perform well in any case. > > No functional change intended. > > Reviewed by: gallatin, glebius > MFC after: 2 weeks > Sponsored by: Klara, Inc. > Sponsored by: Stormshield > Differential Revision: https://reviews.freebsd.org/D46305 > --- > sys/kern/uipc_socket.c | 47 +++++++++++++++++++++++++++++------------------ > 1 file changed, 29 insertions(+), 18 deletions(-) > > diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c > index e7c4a85d5970..a5e88fc7ffc6 100644 > --- a/sys/kern/uipc_socket.c > +++ b/sys/kern/uipc_socket.c > @@ -1656,8 +1656,8 @@ out: > * counts if EINTR/ERESTART are returned. Data and control buffers are free > d > * on return. > */ > -int > -sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, > +static int > +sosend_generic_locked(struct socket *so, struct sockaddr *addr, struct uio * > uio, > struct mbuf *top, struct mbuf *control, int flags, struct thread *td) > { > long space; > @@ -1673,6 +1673,9 @@ sosend_generic(struct socket *so, struct sockaddr *addr > , struct uio *uio, > tls = NULL; > tls_rtype = TLS_RLTYPE_APP; > #endif > + > + SOCK_IO_SEND_ASSERT_LOCKED(so); > + > if (uio != NULL) > resid = uio->uio_resid; > else if ((top->m_flags & M_PKTHDR) != 0) > @@ -1702,10 +1705,6 @@ sosend_generic(struct socket *so, struct sockaddr *add > r, struct uio *uio, > if (control != NULL) > clen = control->m_len; > > - error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); > - if (error) > - goto out; > - > #ifdef KERN_TLS > tls_send_flag = 0; > tls = ktls_hold(so->so_snd.sb_tls_info); > @@ -1728,7 +1727,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr > , struct uio *uio, > > if (resid == 0 && !ktls_permit_empty_frames(tls)) { > error = EINVAL; > - goto release; > + goto out; > } > } > #endif > @@ -1739,13 +1738,13 @@ restart: > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EPIPE; > - goto release; > + goto out; > } > if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > - goto release; > + goto out; > } > if ((so->so_state & SS_ISCONNECTED) == 0) { > /* > @@ -1759,7 +1758,7 @@ restart: > if (!(resid == 0 && clen != 0)) { > SOCKBUF_UNLOCK(&so->so_snd); > error = ENOTCONN; > - goto release; > + goto out; > } > } else if (addr == NULL) { > SOCKBUF_UNLOCK(&so->so_snd); > @@ -1767,7 +1766,7 @@ restart: > error = ENOTCONN; > else > error = EDESTADDRREQ; > - goto release; > + goto out; > } > } > space = sbspace(&so->so_snd); > @@ -1777,7 +1776,7 @@ restart: > clen > so->so_snd.sb_hiwat) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EMSGSIZE; > - goto release; > + goto out; > } > if (space < resid + clen && > (atomic || space < so->so_snd.sb_lowat || space < clen)) { > @@ -1785,12 +1784,12 @@ restart: > (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EWOULDBLOCK; > - goto release; > + goto out; > } > error = sbwait(so, SO_SND); > SOCKBUF_UNLOCK(&so->so_snd); > if (error) > - goto release; > + goto out; > goto restart; > } > SOCKBUF_UNLOCK(&so->so_snd); > @@ -1835,7 +1834,7 @@ restart: > ((flags & MSG_EOR) ? M_EOR : 0)); > if (top == NULL) { > error = EFAULT; /* only possible error > */ > - goto release; > + goto out; > } > space -= resid - uio->uio_resid; > resid = uio->uio_resid; > @@ -1899,12 +1898,10 @@ restart: > control = NULL; > top = NULL; > if (error) > - goto release; > + goto out; > } while (resid && space > 0); > } while (resid); > > -release: > - SOCK_IO_SEND_UNLOCK(so); > out: > #ifdef KERN_TLS > if (tls != NULL) > @@ -1917,6 +1914,20 @@ out: > return (error); > } > > +int > +sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, > + struct mbuf *top, struct mbuf *control, int flags, struct thread *td) > +{ > + int error; > + > + error = SOCK_IO_SEND_LOCK(so, 0); > + if (error) > + return (error); > + error = sosend_generic_locked(so, addr, uio, top, control, flags, td); > + SOCK_IO_SEND_UNLOCK(so); > + return (error); > +} > + > /* > * Send to a socket from a kernel thread. > * > This commit broke NFS over TCP (V3 and V4). It it results in random unrecoverable hangs of an NFS share. My test is to installworld/installkernel over NFS from my main build server. All the other socket commits in this series had no adverse affect on NFS over TCP. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Tue Aug 20 14:50:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpC7c3d90z5TGFx; Tue, 20 Aug 2024 14:50:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpC7b6Txjz4r9H; Tue, 20 Aug 2024 14:50:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6bf6606363fso32303556d6.3; Tue, 20 Aug 2024 07:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724165435; x=1724770235; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=OGhL1ER0vAmkZfLN0+Tod5Lzx5gFBujhxrq24/HFIQg=; b=OJNTVylpcoNFDwYaIKtJNHBu0crvG0hjIU/Nlomsj7sCr50F09EzOzcJiIALQWwtHV jNIcaYFL0UjigHom6MHbD6cEcBukd7czEX1lZPFtxKkAc636XE2Ws5kQSaPynKuO6+o3 79PtJ7Qy3VLchCGVPXD6MXfGZpyj6gOdyIlyz7XlHWFaGaiIJyXE1LRu7y7nlQFBH4dT M8I5zDKOHuOoo3x9lJSdZwCNy0MfLxeZ2U3FPrkCIPDfSNh79oHPZI/fueohwvP1MoMU ZSGZwg/GgWF7RzNNMP3xFw/AKCeQ5U5/wRD4WWxalI2sR6ae0GwVZsQUqTy0vWvgDWL4 pmKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724165435; x=1724770235; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OGhL1ER0vAmkZfLN0+Tod5Lzx5gFBujhxrq24/HFIQg=; b=lZ5R8XUcqxWRHDng/hkJHWmwhTRg09gsk5mTWXnsnxrIZfjDOX4C2Rag23/TOO2Ttp nk5F5EMtl0YtCSNTEkJtcVz/3h1kCELuouhEGOUwVJqbCqK2/jjbNcZc559+h1/0GuZX 5VDzWNubv7NMXotUPfZbeFZ5isCi2pFmz+JujdLYCY7kL4DeUjCEenISCtHxpOarpMwT XFFkbCl2Nx9GKMT8FvQBjMVxkZoJZi8zGTTDfo2zialTqBYFphOdq7AfhsjgShYqiEmB 5uAVneIAp9E6qpUViSFY/OJ+cIUiEvd9oCs+9VZb6HcUDy7kHjBuVjF50ebn+LFhmc3x jkpw== X-Forwarded-Encrypted: i=1; AJvYcCUcVC0mP7uBZCFQc0+Gqk1baLkSEPRQ3pHWKtjbrZUmfPt3jj0UMMSx4XTwgq5hUpDmiOI2QFDCrz1hn+/nJl/zeYbM9D0=@freebsd.org, AJvYcCX61hFjqk32dC2lqQ2YEjGlurQ374KZlsh9EBqluqwvyEyvvZ7ZDX/e1oSuU1cPg+7P6uJtBBo6IqNl0UKoof+cgsHB@freebsd.org X-Gm-Message-State: AOJu0YwdQ+eXSKsbZJ2U6zlFRxw+mxvX1wzJla81EBVYwHd8fH10U9T2 gQp0eGdb+ALZu55tAVgM8oUKJF/Tb/p5QWOxH9MfFPGgTXtOhZf6BM9oFQ== X-Google-Smtp-Source: AGHT+IF8bRd203Uuc1Cm728DiOyJiHG/NmN2WLy+cr8kX0WUM7XHT+Hepvt4816dQDjSn/DCdRMVQw== X-Received: by 2002:a05:6214:3c9c:b0:6b7:a6eb:c343 with SMTP id 6a1803df08f44-6bf7ce9648fmr154650586d6.51.1724165434779; Tue, 20 Aug 2024 07:50:34 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bf6fdd7fb4sm52390006d6.28.2024.08.20.07.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 07:50:34 -0700 (PDT) Date: Tue, 20 Aug 2024 10:50:31 -0400 From: Mark Johnston To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fb901935f257 - main - socket: Split up sosend_generic() Message-ID: References: <202408191437.47JEbhOG094258@gitrepo.freebsd.org> <20240820143730.9BCDB1E3@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240820143730.9BCDB1E3@slippy.cwsent.com> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WpC7b6Txjz4r9H On Tue, Aug 20, 2024 at 07:37:30AM -0700, Cy Schubert wrote: > In message <202408191437.47JEbhOG094258@gitrepo.freebsd.org>, Mark Johnston > wri > tes: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb901935f257ddcc492fe9efb605797f > > 181c6597 > > > > commit fb901935f257ddcc492fe9efb605797f181c6597 > > Author: Mark Johnston > > AuthorDate: 2024-08-19 14:20:43 +0000 > > Commit: Mark Johnston > > CommitDate: 2024-08-19 14:37:27 +0000 > > > > socket: Split up sosend_generic() > > > > Factor out the bits that run with the sock I/O lock held into a separate > > function. In this implementation, we are doing a bit more work under > > the I/O lock than before. However, lock contention is only a problem > > when multiple threads are transmitting on the same socket, which is an > > unusual case that is not expected to perform well in any case. > > > > No functional change intended. > > > > Reviewed by: gallatin, glebius > > MFC after: 2 weeks > > Sponsored by: Klara, Inc. > > Sponsored by: Stormshield > > Differential Revision: https://reviews.freebsd.org/D46305 > > --- > > sys/kern/uipc_socket.c | 47 +++++++++++++++++++++++++++++------------------ > > 1 file changed, 29 insertions(+), 18 deletions(-) > > > > [...] > > This commit broke NFS over TCP (V3 and V4). It it results in random > unrecoverable hangs of an NFS share. > > My test is to installworld/installkernel over NFS from my main build server. > > All the other socket commits in this series had no adverse affect on NFS > over TCP. Does the patch below fix this for you? diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 13b6253bd115..42c43539b484 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1920,7 +1920,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, { int error; - error = SOCK_IO_SEND_LOCK(so, 0); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); error = sosend_generic_locked(so, addr, uio, top, control, flags, td); From nobody Tue Aug 20 15:16:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpCjb1wjbz5TJFf; Tue, 20 Aug 2024 15:16:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpCjZ5yL1z4vvy; Tue, 20 Aug 2024 15:16:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id gNNssCutZ9TOUgQb3s0uqD; Tue, 20 Aug 2024 15:16:33 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id gQb1sia7vE0IVgQb3sMtwX; Tue, 20 Aug 2024 15:16:33 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=cI9DsUeN c=1 sm=1 tr=0 ts=66c4b351 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=yoJbH4e0A30A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=w3Aupa3vw4SgNZJgN8gA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id B034FD27; Tue, 20 Aug 2024 08:16:31 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 964971E8; Tue, 20 Aug 2024 08:16:31 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mark Johnston cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fb901935f257 - main - socket: Split up sosend_generic() In-reply-to: References: <202408191437.47JEbhOG094258@gitrepo.freebsd.org> <20240820143730.9BCDB1E3@slippy.cwsent.com> Comments: In-reply-to Mark Johnston message dated "Tue, 20 Aug 2024 10:50:31 -0400." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 20 Aug 2024 08:16:31 -0700 Message-Id: <20240820151631.964971E8@slippy.cwsent.com> X-CMAE-Envelope: MS4xfJbZeLl2D+OVmxAxFbm66sJvGRGisE3gMVhcZEZbA34/uBgCkJcW2ghB/CImKCcyZ2eCiDyVOQIe5RhZYi2lcvAyQ0UndAym4fylgjO1BT/CyZaCGbN7 GTAa8Ih4Geqp7e8uSHyDiG/CMwBceDJQ3aOhhQfQtvuf+4hcINJdUBS1UhZZoySJ7ZqHahQfcs/8bJ4tg0xIoniF6QC7ziwoqOKuWekopz4pmtRnr1yT9pNk pZ+yJAVhc39UsC1VNTv/gaqPJZVhHVRmx9PvMEJP855XOm7MkvKjRePN0yEY0QaqdoGkDZBscGIKvmuTLzmqWzL5C8ehJ8NBdDxoD8wODiY= X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4WpCjZ5yL1z4vvy In message , Mark Johnston writes: > On Tue, Aug 20, 2024 at 07:37:30AM -0700, Cy Schubert wrote: > > In message <202408191437.47JEbhOG094258@gitrepo.freebsd.org>, Mark Johnston > > > wri > > tes: > > > The branch main has been updated by markj: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb901935f257ddcc492fe9efb605 > 797f > > > 181c6597 > > > > > > commit fb901935f257ddcc492fe9efb605797f181c6597 > > > Author: Mark Johnston > > > AuthorDate: 2024-08-19 14:20:43 +0000 > > > Commit: Mark Johnston > > > CommitDate: 2024-08-19 14:37:27 +0000 > > > > > > socket: Split up sosend_generic() > > > > > > Factor out the bits that run with the sock I/O lock held into a separ > ate > > > function. In this implementation, we are doing a bit more work under > > > the I/O lock than before. However, lock contention is only a problem > > > when multiple threads are transmitting on the same socket, which is a > n > > > unusual case that is not expected to perform well in any case. > > > > > > No functional change intended. > > > > > > Reviewed by: gallatin, glebius > > > MFC after: 2 weeks > > > Sponsored by: Klara, Inc. > > > Sponsored by: Stormshield > > > Differential Revision: https://reviews.freebsd.org/D46305 > > > --- > > > sys/kern/uipc_socket.c | 47 +++++++++++++++++++++++++++++--------------- > --- > > > 1 file changed, 29 insertions(+), 18 deletions(-) > > > > > > [...] > > > > This commit broke NFS over TCP (V3 and V4). It it results in random > > unrecoverable hangs of an NFS share. > > > > My test is to installworld/installkernel over NFS from my main build server > . > > > > All the other socket commits in this series had no adverse affect on NFS > > over TCP. > > Does the patch below fix this for you? > > diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c > index 13b6253bd115..42c43539b484 100644 > --- a/sys/kern/uipc_socket.c > +++ b/sys/kern/uipc_socket.c > @@ -1920,7 +1920,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr > , struct uio *uio, > { > int error; > > - error = SOCK_IO_SEND_LOCK(so, 0); > + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); > if (error) > return (error); > error = sosend_generic_locked(so, addr, uio, top, control, flags, td); Thanks. This fixes it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Tue Aug 20 15:17:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpCkj3CSXz5TJG0; Tue, 20 Aug 2024 15:17: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 4WpCkj14wlz40lR; Tue, 20 Aug 2024 15:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724167053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMw+kFAFF/oI0UMT97j7WiH3m1HCkgGb10GEVHRSaYw=; b=pkQsNPGjuT7MjcWTMMeT6aQocGfIcVOpjZl918htpwTKISBRc6coXdCZpBNsrkymHkKFTN QI7M0YIYymRieXX2tVjlfEB8w8TgzhwU6cr9oYwvaNlaW2zaqxpvIEC2lUj/u0ugtJYVbi fdNj1r+gppMEU/ZaVhR4LV0O2htn48I1eEPJSXXobEhvrIOEioM6XGL9BkbriaUgdJ+cBk KW4hXwfnJmek+T6P4JcNF5lQiacew3EKQIMbh7uYq5z8TvdgpNUZ+VqpUbMePwOETcQH45 /XRgCbN8xLE4sWZsxMxdqW3J4IysoVlP95YnHvTx1zUj2Q2NQf2PlWLhZKPEjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724167053; a=rsa-sha256; cv=none; b=kzXcj/0eKPeQb969hKjS4PhryQ8YdCxtYDMnP3lneeHFYDKDhhu4KQeL6qAoKFd1Bg+3Mb iWiRh2j53V2A2H/baNajw3vcgzqaFbc7JDvlfOhBG1SPJV/OrpBKCVcSgp+Li3QnZAsDGC 1365BhSYO3LF7sFhdRHd4GISCP3VW/NYsKeGBVx4763mRzFCBwfe+C0ktLMEreXRjP1U5D P/LWAFFzC+o+DyBufauKKvX5o+1Ua7x5EARakbKU7zeqikmhcffdE2va8FiPwQ1M7X6X6q 4LN4HLSixvWSDEJFR9T4bJ8DNzThLt+BI7MwQVA4tKVNLTgHshVul3MBroOgng== 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=1724167053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMw+kFAFF/oI0UMT97j7WiH3m1HCkgGb10GEVHRSaYw=; b=no1ZTfMU7uFAZlMiMryLLZksWMWsZTgK2q1rO/gccnOiXmUCIj6gYkfYSt+8KkWzpH1Ogf +kpecN2zT8OwFKEk3qbjNHnvkM2vVMSw8EYvLAvcdKqUisPdcntgG02d9mCTcTJYAZD5Sz /B3TvYPrCvVY/j2uFFoVK58lncXpPldPFTv3u4+mXmac0bUSN4QyT+Xaqj6gUhq9c+h1sD cJQ9hOQkY0HFIvi+fd76Lk1jinPiXO6bPbG/HNF4IJW0wt3sZDAnXZ/G4Ymb+ZaI1oFypn zC8ObYyjFA3slcfOnXSxzb90DaEpidHbiCSiUy0+OAxg0hxxMKFKif6WpEZ6hw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpCkj0cGCz14mb; Tue, 20 Aug 2024 15:17: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 47KFHWGV011067; Tue, 20 Aug 2024 15:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KFHWvJ011064; Tue, 20 Aug 2024 15:17:32 GMT (envelope-from git) Date: Tue, 20 Aug 2024 15:17:32 GMT Message-Id: <202408201517.47KFHWvJ011064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 66aed7e3488a - main - socket: Set lock flags properly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66aed7e3488aa60195abcf846da5e04aa82fb1bf Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=66aed7e3488aa60195abcf846da5e04aa82fb1bf commit 66aed7e3488aa60195abcf846da5e04aa82fb1bf Author: Mark Johnston AuthorDate: 2024-08-20 14:52:02 +0000 Commit: Mark Johnston CommitDate: 2024-08-20 15:17:14 +0000 socket: Set lock flags properly Fixes: fb901935f257 ("socket: Split up sosend_generic()") Reported by: cy Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/kern/uipc_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 13b6253bd115..42c43539b484 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1920,7 +1920,7 @@ sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, { int error; - error = SOCK_IO_SEND_LOCK(so, 0); + error = SOCK_IO_SEND_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); error = sosend_generic_locked(so, addr, uio, top, control, flags, td); From nobody Tue Aug 20 15:35:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpD6v1zDBz5TKvZ; Tue, 20 Aug 2024 15:35: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 4WpD6v1SfRz43m2; Tue, 20 Aug 2024 15:35:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724168103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3yv+w0S5KCMnshnTd3fQuECAztO24HJHqD38N8zHLA=; b=l1V8iUDXpNyQgfBMSQ5w2V7EOKEZQAUVKlzkmw7Djp49ktKp6Kcm3t9WWPn0PB9I5ZmzRQ BCnS4OQBs/volcGiJUJi9tH327jo7TLW1YJmC9JB0ap6ZDpm9fg1PFWO5nP0SYoTvZjCFR sO2LA3i2jIhaaQip4JNG9YaeSU4Cj3lKHgvX5s/zYKgYzWbyDTRGVZCn+aQegRkLn4zL2F QC+ZiFGdGKuiy5/9nrr/F/pF8n0kqf6kFoCgdkNPpZYw2IP5752h5XjbU+mCvTlZUs8Ad5 ghl1OXc/vsiMfE1z5aSKHRJgd5W+Yyp0IjJtSOpEWTk2UwSuEn2RxmPnBYX4eA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724168103; a=rsa-sha256; cv=none; b=Ni1NN6NZR1/Tz4X+6VkMh4q0aupkfWzdApMNxe6NvYYD8A0bfDGiQXu8/N1ek6NFOtSCTK ndRamRB695gpdPYdktVl2c0EyR+QzgzEWFfwq9srevpOdDHFNHg9Bw/5q8Fcsa9i0ushH9 AAB/z6Wtcz5YumqfAtVHdoszIDCdWyQkkU/jAWEdOu1uwlZznFv+jq5W2ECKDlvhOMl2xD vu/VoSAhQrwxjv8MK8yxf3tKkt1e0D9+aSHKmQmoaIuyuClbI1RkGDefDEioji6713PnEW TJrx2yGsXqVX7JRx0wQtAdEEn3260bggIHrjrENelgNoFRxTj8yNjblCnBWHCA== 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=1724168103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3yv+w0S5KCMnshnTd3fQuECAztO24HJHqD38N8zHLA=; b=caLBXnVRSDgA8t+Y9WLmoKqN8r1iHA6UZjZ7mR2FI4AXrvCYWKhWefEia2Keuhbnf1Xzc3 YLcHmmKN7ZyMFFeQ1cF0KSxDRpBn1jUXgOXkYTuGSZkUkS61jXggc2aK8ox/K3GjvtrRox B0UKXK90OoFpEzqYgY0qRcf37w91Yto9vw9oxO/Hxa4ylgSbAkkS8cSljes1BoEecREUtF zEpV88T7eTK5DyJBXDhZSzJWASYbiLD6MIkRNTvZYa8egtyOYmARqUnewYEO3qHJOQ/0bm eLTd4xcIFFJ7Bwm75s0wOgthav+KVp4fNfS+jKkDU+GpOu3EZfUpaVFyCJGmpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpD6v14Wpz15py; Tue, 20 Aug 2024 15:35: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 47KFZ3DK044501; Tue, 20 Aug 2024 15:35:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KFZ3v8044498; Tue, 20 Aug 2024 15:35:03 GMT (envelope-from git) Date: Tue, 20 Aug 2024 15:35:03 GMT Message-Id: <202408201535.47KFZ3v8044498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: aa6c490bf80f - main - tcp: initialize the LRO hash table with correct size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa6c490bf80fcef15cfc0d3f562fae19ef2375aa Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=aa6c490bf80fcef15cfc0d3f562fae19ef2375aa commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-20 15:30:55 +0000 tcp: initialize the LRO hash table with correct size There will at most lro_entries entries in the LRO hash table. So no need to take lro_mbufs into account, which only results in the LRO hash table being too large and therefore wasting memory. Reviewed by: rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 --- sys/netinet/tcp_lro.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 921d28f82517..2603815f9e61 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -175,7 +175,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, { struct lro_entry *le; size_t size; - unsigned i, elements; + unsigned i; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -190,11 +190,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, LIST_INIT(&lc->lro_active); /* create hash table to accelerate entry lookup */ - if (lro_entries > lro_mbufs) - elements = lro_entries; - else - elements = lro_mbufs; - lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + lc->lro_hash = phashinit_flags(lro_entries, M_LRO, &lc->lro_hashsz, HASH_NOWAIT); if (lc->lro_hash == NULL) { memset(lc, 0, sizeof(*lc)); From nobody Tue Aug 20 15:50:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpDS95nRZz5TLmT; Tue, 20 Aug 2024 15:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpDS95GJwz44ck; Tue, 20 Aug 2024 15:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724169001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WhrGKiw65jkdbqE4H7v1joRHJzEUXNU7apmbHYrWT9Q=; b=dsuMWBq2i3iVTw1RpVZtlOwjF/U0O2DYY1B2xIMfVG/KsVx2H4kHOneBYP7T6Yvoj+cxN5 gmfIm2f7ukaufGcsWE7Ap4zs853LzSbr0Yh4Ba1rrr+8hobb9XswqNLXs217//eoT+0qSn 0Kyzsv246OI0b4E7roSCpr2qHVaMfCkE/zzlsUZCOUVLv7YoI6zRJD41p/8BFVzn6xIXqo ABCsrFdD4MW0QkyLx6aiqYwNaU+KHKohzz4w5gqVC1sSwzN4BgdZZVBYbsr4SRMHMSjw96 Fuh1TE48IE+bpTI8kQsLNaMzlKrPhjK5zxUd02nP+IKsJIgdP5/AHtxBb+H6TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724169001; a=rsa-sha256; cv=none; b=AhYkuQcL/evPzBoYPxmolk44nUM/+yL3dbNxhiHJG9/jLQQrT2sDiELDXP/eL1A5vvSL6N HrBGgWQkip3ifB7Ubaip+RWy7cw+vGEtd+yAMyX0Ro5NUavI3CqC493gIRmgwvAvNf4zIk IRQUERRMPJEUlfc5oZpGNGahNbylFqUWAWiXrTsYEHYRw41XW41SJOAq1Whbx9cql6Yq4v HiUz9V3gncGeFBCG/iVf+L2e+cRL/lY8dnMHTNKnNG7RHO9Jso3lMsbIbBIDUHCsG5eMn0 zPJvN50xI0sgKgIy435UkKxPG7EWpxB78kJhbDRY0nb0/mLpPaVFSmat3dRGug== 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=1724169001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WhrGKiw65jkdbqE4H7v1joRHJzEUXNU7apmbHYrWT9Q=; b=GZQ7a9oHu1BOFJsJAjYtPcY8XOsBy3ClZDwiW6vTS87I/9YojBTaBsD88iIsML6QayhHRI 6A0I26/465v2FCGk01npLwbWc+SsV5NBIuTMcvdU/NeJwbd9nsT1TBVHyVL/JA/hb0gySQ qdP1QFLP+QQZmu+SI+eZhpR+czELpwP8lPhLBrrBSodlwSivnD5R4eFhQFPXjLs4KfSkin 3JolkoihpF1mqzq5a67SRXsAr9kDufFZw4T+6RvkcdSf12Z/DhrRHm803BmNDCO6kFGalV +5RatxR1xbgEV/s2NU3WgjFVoZu0oqzBqM+9VEifXkeXeerOZQRFq8pJtPPTQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpDS94spzz15qq; Tue, 20 Aug 2024 15:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KFo12v064009; Tue, 20 Aug 2024 15:50:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KFo1Ke064005; Tue, 20 Aug 2024 15:50:01 GMT (envelope-from git) Date: Tue, 20 Aug 2024 15:50:01 GMT Message-Id: <202408201550.47KFo1Ke064005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0875f3cd74b2 - main - Revert "x86: Enable Intel DMAR by default" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0875f3cd74b2f305e82bff4e640c89f891ca84f8 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0875f3cd74b2f305e82bff4e640c89f891ca84f8 commit 0875f3cd74b2f305e82bff4e640c89f891ca84f8 Author: Ed Maste AuthorDate: 2024-08-20 15:43:11 +0000 Commit: Ed Maste CommitDate: 2024-08-20 15:49:25 +0000 Revert "x86: Enable Intel DMAR by default" A number of people have reported panics with it enabled by default, possibly due to broken ACPI tables, which we do not handle well. D46382 is a potential fix for this issue. Additionally DMAR is currently not compatible with bhyve passthrough (see comment #10 in PR280817), with a draft patch to address that in D25672. Revert to disabling DMAR by default pending the resolution of those two issues. This reverts commit 3192fc30230ae432b80cca783abc2dbea9d3f383. PR: 280817 Sponsored by: The FreeBSD Foundation --- sys/x86/iommu/intel_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 9401892aa9d6..0b25620114cd 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -159,8 +159,7 @@ dmar_count_iter(ACPI_DMAR_HEADER *dmarh, void *arg) int dmar_rmrr_enable = 1; -static int dmar_enable = 1; - +static int dmar_enable = 0; static void dmar_identify(driver_t *driver, device_t parent) { From nobody Tue Aug 20 20:46:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpM2L3QvSz5SbGr; Tue, 20 Aug 2024 20:46: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 4WpM2L2xKxz4hxp; Tue, 20 Aug 2024 20:46:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724186794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ehmWc3JHKxwItYVwWlp3w+CZ5fAqXQrNcbrrLAa1iZ0=; b=SgOUV0rPcfUsLRHhRzgFR6ANo7gKSKD4YwEPdinZRHXzC52qaNKagdlPOcaW01WV7vI532 EYVakj/al30tq3SIF+wgjrIhBKFYfl6YMRqfr5q4s3Mg4H4YPxFXJxJqvWqnC1kRPqofww kCohANP1it+7Q41KAv/dDhrG8q5RurppfxeC2TgVtroDpx+p0L3ZTiYUEfbdVquzPGXz5p PP1OIgLlQs9FXqcDfXZc/wh1m4TOgclZX18/cDyBI7Juw3dpCwPyWraIOizWhywi/4W7rY yoAHSq7eTrtg3UFSUw8c+Ls+2LShU+MewE+Zf8+Bpvdl1VJ5JE8amRIk/Tj69w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724186794; a=rsa-sha256; cv=none; b=XbW/Y0cXtTioQKGT7Kry39oE6L5DLvs0cRIQrdSKJ/0gNzdRrWWV+SwrhhJPdbw+NRQ0yN fOH0znv/U1qZ9qgYzIRgQJWIAOhxv1WH3StVZv8e4MyxT4svpCFYtGJLLJfmQyPfpBE9Le 4evhhQGAISitTWYSD5xjCF6vLv0HxD37K+NOzrz+E3rIXXeGfbf0uch6iY7vPa1ibC2g90 b/P5S/WHOdI4tbWkiMyA7Aif8mKXLyxyuknLyAp9k3hSGKw4WULeRWMjEHCg5fbaemlFRt 9gGZlVH2gfp7zE88rkck6D2qPGsIXM4r2gWtc2E6NVyrtEKY6escvTWR5xSgEg== 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=1724186794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ehmWc3JHKxwItYVwWlp3w+CZ5fAqXQrNcbrrLAa1iZ0=; b=HoC86Hbs7X2iFug+CqfOaSTawxGN0C3JDMg2sqzVFj0T6M7+Tx/B2TwqiYRJZvgZQ9gD2R lgKVL6f+b7G+Tj49FXKQaLVoUvd5hGlOJiJb5SCRKRe1vCwCRqL+IdPxL3Eai92v/RXBBr 7U44hiQ6h9fX8wP1+fRNlNtZQYVbDL8FzAcxOI+GRe4euI0Bm7trT8rpKZtdZ9bT+++vUw aITeINqessz5KNa+jf2k0EMX/C3VlzltJGac+GmgVHDuozl5b8OTWMw65akS5FePG67FVr nBS15KI6tZcx/Qmbm0cIdUZAkTcoJ5FuMS+RYIF5YW5U5DtR+MSTLOmQaQEz5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpM2L2TDvzFw8; Tue, 20 Aug 2024 20:46: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 47KKkYeX070191; Tue, 20 Aug 2024 20:46:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KKkYf5070188; Tue, 20 Aug 2024 20:46:34 GMT (envelope-from git) Date: Tue, 20 Aug 2024 20:46:34 GMT Message-Id: <202408202046.47KKkYf5070188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: aa72c5bacb5f - main - dummymbuf: fix build without INET or INET6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa72c5bacb5f7ab359a3b7ae07b7c7b8705b60a8 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=aa72c5bacb5f7ab359a3b7ae07b7c7b8705b60a8 commit aa72c5bacb5f7ab359a3b7ae07b7c7b8705b60a8 Author: Gleb Smirnoff AuthorDate: 2024-08-20 20:45:38 +0000 Commit: Gleb Smirnoff CommitDate: 2024-08-20 20:45:38 +0000 dummymbuf: fix build without INET or INET6 Note that VIMAGE would mask both compilation failures. --- sys/net/dummymbuf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/net/dummymbuf.c b/sys/net/dummymbuf.c index cb92889c5b77..8c46421888ed 100644 --- a/sys/net/dummymbuf.c +++ b/sys/net/dummymbuf.c @@ -117,11 +117,15 @@ SYSCTL_PROC(_net_dummymbuf, OID_AUTO, hits, * pfil(9) context */ +#ifdef INET VNET_DEFINE_STATIC(pfil_hook_t, dmb_pfil_inet_hook); #define V_dmb_pfil_inet_hook VNET(dmb_pfil_inet_hook) +#endif +#ifdef INET6 VNET_DEFINE_STATIC(pfil_hook_t, dmb_pfil_inet6_hook); #define V_dmb_pfil_inet6_hook VNET(dmb_pfil_inet6_hook) +#endif VNET_DEFINE_STATIC(pfil_hook_t, dmb_pfil_ethernet_hook); #define V_dmb_pfil_ethernet_hook VNET(dmb_pfil_ethernet_hook) @@ -321,6 +325,7 @@ dmb_pfil_mbuf_chk(int pfil_type, struct mbuf **mp, struct ifnet *ifp, return (PFIL_PASS); } +#ifdef INET static pfil_return_t dmb_pfil_inet_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, void *ruleset, struct inpcb *inp) @@ -328,7 +333,9 @@ dmb_pfil_inet_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, return (dmb_pfil_mbuf_chk(PFIL_TYPE_IP4, mp, ifp, flags, ruleset, inp)); } +#endif +#ifdef INET6 static pfil_return_t dmb_pfil_inet6_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, void *ruleset, struct inpcb *inp) @@ -336,6 +343,7 @@ dmb_pfil_inet6_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, return (dmb_pfil_mbuf_chk(PFIL_TYPE_IP6, mp, ifp, flags, ruleset, inp)); } +#endif static pfil_return_t dmb_pfil_ethernet_mbuf_chk(struct mbuf **mp, struct ifnet *ifp, int flags, From nobody Tue Aug 20 20:46:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpM2M4kZ6z5Sb5Q; Tue, 20 Aug 2024 20:46: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 4WpM2M4FjWz4j5l; Tue, 20 Aug 2024 20:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724186795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/OSv5mjyI7DqkPiuB2tZOFfIkcwxmHfokYinmAr4Wpk=; b=RHEoCGmG8IxSCeG6JAoKKZN1d3mV3b9nYYkdiPI8Ny76O4+OwqNtjda8gabuhg1zhxqedt GcVT/2dA9MQyfYKr8hk/lXLNkkdLG999sfTG13z2iAMhJIOFyJIwi5NhNuwuJx6S7svfFp mYjuY4b4rcY3WYnb6RlpoSR33/S3g9UOKtTQEJJ9fejINVSF/cARxf6rPQd4ErMPj7zQ1R 1eLwrFfo+37ZEpIqNWs37ixsRcpt5HBTzdLg4RWtmt3VCOGk1bdKvCLaQCA9NgkMcQYAgo dA7X/BxMcJT5ma96ZuRj5kuZyC6haZMy4nzzH00jD+/babyy64kzQMbNYYumUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724186795; a=rsa-sha256; cv=none; b=I7em55Ct34iV2u1cOyQG61QP2VS62+F26dpmA2J7tyLpOk/27TaGgYLUIf/wwHugtX7Miq CW8qf4Ho2tWgA6G4NrVxydi3suinhUTSRwPan7+NiUolJc7Fxj+guMNrGRvwcFqn3VMm4C Xgao84waGRdWNckc0a06kpuXIUwuWpwV2OJ/CfKegDweeDtqOD+9ULQY/0zcRoJm8Bz6Hq V5qMIWsYMK0jFJ/MXDP5EsBByl+Zqtqmj8gNLVd7PB3bGcMC+SHh/FHeAbH2F5EQjzK5my ROdW8jD3jPOyPxJEs4ZV6wlqZwfue7Spe5IzOjsZHsxCjabQvg1QDcwcjwv3zA== 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=1724186795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/OSv5mjyI7DqkPiuB2tZOFfIkcwxmHfokYinmAr4Wpk=; b=H9P9ayqL8qXR9UuHt2k2dUV99ZUnqIOXLxBpWtOhd3s0zmwdw7MNXu0rszpL/HXsjCRWLc quzMVFap7RUChNv664mOC8C6za6JJEOcNmMDG4ndHxdEskIlQhO768WxFj3W9ZHCHBJepI Ay2Ua/m5ouXCYrJ9557ZUcmAb+JwyRzFeRoUn5Jr0uOzKVibqYpzCiH+Ufo1XlrPHcfBjv U+7LEozJYSPMDyeYhQQY9Jifw7VKfCO572GTcWa7PKqKs0DFRz+ladHjJ9fP/taf3q7awV LqPLsO62rx1uiMDnUUD6quW8MaidEFfXxEBV+oXxtgW1AHAbM2g3R8IgeFh0OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpM2M3740zFw9; Tue, 20 Aug 2024 20:46: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 47KKkZ5V070233; Tue, 20 Aug 2024 20:46:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KKkZQx070230; Tue, 20 Aug 2024 20:46:35 GMT (envelope-from git) Date: Tue, 20 Aug 2024 20:46:35 GMT Message-Id: <202408202046.47KKkZQx070230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6bc966987e7a - main - dummymbuf: add to LINT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6bc966987e7a6e5bcf9568b5c8b17037787c33a2 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6bc966987e7a6e5bcf9568b5c8b17037787c33a2 commit 6bc966987e7a6e5bcf9568b5c8b17037787c33a2 Author: Gleb Smirnoff AuthorDate: 2024-08-20 20:46:09 +0000 Commit: Gleb Smirnoff CommitDate: 2024-08-20 20:46:09 +0000 dummymbuf: add to LINT --- sys/conf/NOTES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index a531620ede55..47d6bcb4e5da 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -977,6 +977,9 @@ device lagg # WireGuard interface. device wg +# dummymbuf – mbuf alteration pfil hooks +device dummymbuf + # # Internet family options: # From nobody Tue Aug 20 21:34:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpN5r0bHsz5SgMP; Tue, 20 Aug 2024 21:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpN5q70LNz4nNG; Tue, 20 Aug 2024 21:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724189680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Shwap851Tk00JyIXYY8Y2nA7OW03XuiNKCT/BNivho=; b=cVx6+JgrB86viq3LkQWXYKoyqlgt+f38Rs9BSjElOQz2FMtWZJeUhua64I68XBtrjdZSQY x1WizVFuX3eZqaAhdDVeQWEd95t2cSIiDq2hbMSnhcwZ+Uw4oBk8jhKICObT4vA+Geil+0 bu4VbmZMQqkJ2QDfJp3kgGQzpEBfT3LAeK3d6m//ohoci0IzLFFroSFaz6Tul8li00kFby uMq/dl+b92/GL+iERl1VOg35d2sZtdHijpGhADFgvFpMvEtTHIy4V+reOnRSw4Ht3gGlic 3TG3d2rJsf1oIKIb1xlsPWM69/wZQOrF9qYaoqPiVVz22GDJ39d9spb51ssi/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724189680; a=rsa-sha256; cv=none; b=p9+ntgUSJl6hM01/wHGlObqhSfL2XtCSpf1cAmRn9SdKhWqO2gw81kqgX3C0hOPbI8gdT2 qP8EEiOk8ghOoSq7KgrNZRFc76POe0LjfN8wWGP00Rx3DM34QnW+T7dZSUUmIgMGqMo2BS E08nnCvn8VPE/Q6adQmZa4BNRBoDRdYa23VXRrf1Yp2ZlegENurS/ZMPkDbn1osoGVfrnZ JYbD5iL22crn+LtODWQ4kRXbrLDfItV8aq33QT9oq3hDJpEcB0pnhedRrfMN1mHuyta8ta 2Cqp/KalVA+8JvtKj9wvCcDXguDBZZpe7S/OrbuVcr7Posob+RTcZbBUVwJ1AQ== 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=1724189680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Shwap851Tk00JyIXYY8Y2nA7OW03XuiNKCT/BNivho=; b=Fi7jcbsILQAk2xIZzv8m/W18xd1NbbjsbzxBWRNloiKNO65XK8pN1Tk1IhRM9a8sR2GsP5 AW2+34ABJB4/ogRqYYAgcamZ05Du/4ufETsfjecg1ZJmqy5brUEJVsh38LnayD9rZJZtxw kBILQC7w3zaRCyqYSeLjw/xGPIAcaRz5kVU7s+FlvCEYD0Nlk0OXOpLrLqDP+i/AahJII1 XccOeuN0AEwVR5pzXhEMSNDHLa46nyRZrGyNxhHOj4QA17FGXvksahPgz8DtcZjDhnMlq9 /m+UI0AYTFJeedI9v4yWzdxwGeE46CviAIbFbYRyzqOZz85cmGNvincoz89aqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpN5q6bdvzGsf; Tue, 20 Aug 2024 21:34: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 47KLYduh055389; Tue, 20 Aug 2024 21:34:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KLYdPH055386; Tue, 20 Aug 2024 21:34:39 GMT (envelope-from git) Date: Tue, 20 Aug 2024 21:34:39 GMT Message-Id: <202408202134.47KLYdPH055386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 417b35a97b76 - main - netinet: Add a sysctl to allow disabling connections to INADDR_ANY List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 417b35a97b7669eb0bf417b43e97cccbedbce6f9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=417b35a97b7669eb0bf417b43e97cccbedbce6f9 commit 417b35a97b7669eb0bf417b43e97cccbedbce6f9 Author: Mark Johnston AuthorDate: 2024-08-20 21:31:57 +0000 Commit: Mark Johnston CommitDate: 2024-08-20 21:31:57 +0000 netinet: Add a sysctl to allow disabling connections to INADDR_ANY See the discussion in Bugzilla PR 280705 for context. PR: 280705 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46259 --- sys/netinet/in_pcb.c | 8 +++++++- sys/netinet6/in6_pcb.c | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 1a341d421f31..3fc90f1e12c2 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -234,6 +234,12 @@ in_pcbhashseed_init(void) VNET_SYSINIT(in_pcbhashseed_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, in_pcbhashseed_init, 0); +VNET_DEFINE_STATIC(int, connect_inaddr_wild) = 1; +#define V_connect_inaddr_wild VNET(connect_inaddr_wild) +SYSCTL_INT(_net_inet_ip, OID_AUTO, connect_inaddr_wild, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_inaddr_wild), 0, + "Allow connecting to INADDR_ANY or INADDR_BROADCAST for connect(2)"); + static void in_pcbremhash(struct inpcb *); /* @@ -1309,7 +1315,7 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, inp->inp_flowtype = hash_type; } #endif - if (!CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { + if (V_connect_inaddr_wild && !CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { /* * If the destination address is INADDR_ANY, * use the primary local address. diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index e6ec0f24c898..098b4e50483c 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -83,6 +83,7 @@ #include #include #include +#include #include #include #include @@ -97,6 +98,7 @@ #include #include #include +#include #include #include @@ -112,6 +114,14 @@ #include #include +SYSCTL_DECL(_net_inet6); +SYSCTL_DECL(_net_inet6_ip6); +VNET_DEFINE_STATIC(int, connect_in6addr_wild) = 1; +#define V_connect_in6addr_wild VNET(connect_in6addr_wild) +SYSCTL_INT(_net_inet6_ip6, OID_AUTO, connect_in6addr_wild, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_in6addr_wild), 0, + "Allow connecting to the unspecified address for connect(2)"); + int in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred) { @@ -351,7 +361,7 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr_in6 *sin6, if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0) return(error); - if (!CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { + if (V_connect_in6addr_wild && !CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { /* * If the destination address is UNSPECIFIED addr, * use the loopback addr, e.g ::1. From nobody Tue Aug 20 22:11:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpNwM4vdmz5SkQ7; Tue, 20 Aug 2024 22:11: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 4WpNwM4SJKz4rNp; Tue, 20 Aug 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724191891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkrn4FmRKo1cMXYenprIr9gbRFzePWO7BIruXLARTLw=; b=xFXJsdQB4eo3UE67oiBEUz84MRaELjnmznnFVVihIi+mGaiQeD1hQsc4Hvm+FpV1AxyMbz rV3VPDHx99YBwhA605WsVFMJlvSPZaueWw0wPRZ3twUv5lZYeyXbg6mwLsT2UA1yNxcYVc oSqBEv077tIqxGscRGAH735JR71VAvdVikb8bZaZyOM3xDKx7z1enyheUOvBBo/GKPvdw1 2LSVmgiyk0fFJBsYfKCs+llLn+F6NeOEmGzPsWBnm+MdQGTG6nW/n3t6JB+yYdKy/CR693 10kdKsqiZYi/tRCvXPPMIWH1doGg+FKF4+yMFEkV53rIdz3y5mPoTFh1tUiFlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724191891; a=rsa-sha256; cv=none; b=kfZ6AALuQrpkFShUdPHkKPrHcDDNCqiGlqxGFwz+vWTmSYiiNbbu/n4aS4BJSb/ylSLRaJ bAHd8htFC1Wp69u219MFlHspN2gMy1YFhvQUZYdqpu7PJ2b4vq69YP4y0SOeOHTvkx9Tq5 gszxz0BqG8fA+e36m65AmzCE7ZwcR34epc1kC0AjN+RsNIbmcmEhF/RV4rC/aY87T2ekZu K5Cm/g+an6v/yLAuTg2RFun4yoxOm1awvE06mzLD53qOEingZr9rhdlIROYL3z/odJzcQO 4mE8D65G3bbP2S6o67umQIyK0wWI+Jb1pDggDToRnNSzQ6gDi/56JGy9IoUT4A== 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=1724191891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkrn4FmRKo1cMXYenprIr9gbRFzePWO7BIruXLARTLw=; b=Jc9PwnpCwzq7uVUpxsK8PC3FzIDwZ9rCF+1IFbexLyGbk4yXRyefz7grBaAXJW8DiGbTNq 8X80IQtfSfB5tJAzBa7c1d6vzfvU7lHQbShS8KKdvpQtOruMdJ7wpDltOfP4R0zTvf6Wy3 IpctxDuCadbDnTGfM0IujXYl1mlxYhnEzjRubz7dvJr4niy1BtwnPytG8g3sycoDcNlSHO 3ma0gjngH3lVGiwQfPokqFKQOLNRhpiOYPQIOxiJokMpv8r0Azy2KnWds23JF21Rx9bXGY oFg7HgjGi4gzyc95Ynk4gV+ilyM2I8PPkvtjqQCLToc7qYeZwc/BjbaTpyTzbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpNwM44RtzHtm; Tue, 20 Aug 2024 22:11: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 47KMBVZk021614; Tue, 20 Aug 2024 22:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KMBVgh021611; Tue, 20 Aug 2024 22:11:31 GMT (envelope-from git) Date: Tue, 20 Aug 2024 22:11:31 GMT Message-Id: <202408202211.47KMBVgh021611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 64443828bbe7 - main - tcp: fix list iteration in tcp_lro_flush_active() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64443828bbe7c571db8d8731758ec8c4b8364c86 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=64443828bbe7c571db8d8731758ec8c4b8364c86 commit 64443828bbe7c571db8d8731758ec8c4b8364c86 Author: Michael Tuexen AuthorDate: 2024-08-20 22:07:37 +0000 Commit: Michael Tuexen CommitDate: 2024-08-20 22:07:37 +0000 tcp: fix list iteration in tcp_lro_flush_active() Use LIST_FOREACH_SAFE(), since the list element is removed from the list in the loop body, zero out and inserted in the free list. Reviewed by: rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46383 --- sys/netinet/tcp_lro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 2603815f9e61..906e01257a04 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -595,7 +595,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc) static void tcp_lro_flush_active(struct lro_ctrl *lc) { - struct lro_entry *le; + struct lro_entry *le, *le_tmp; /* * Walk through the list of le entries, and @@ -607,7 +607,7 @@ tcp_lro_flush_active(struct lro_ctrl *lc) * is being freed. This is ok it will just get * reallocated again like it was new. */ - LIST_FOREACH(le, &lc->lro_active, next) { + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (le->m_head != NULL) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le); From nobody Wed Aug 21 00:59:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpSf154ysz5T158 for ; Wed, 21 Aug 2024 00:59:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpSf13Lf2z551G for ; Wed, 21 Aug 2024 00:59:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-8223685fbe9so302808239f.1 for ; Tue, 20 Aug 2024 17:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1724201960; x=1724806760; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=u9dArMZ/x4HDxMkmUuU/L74dk9GqqU8b+wIiOfjeZLk=; b=IjFEDtZnve1uftHfMF3ED6HQisuFiOzGU8HRis1hzOb/uw/YGbtRH/r4DnZNeBK6b+ 4Reg+4SOFTivEmtFVFtXppI5fjAgtt6xvmmUCuP4LPac7S4zeo5BmZf1a8hE5edSQ/uq 6TaT8LGncvuacLoPU1F7ROMW+X1w4NoHx7PDpW4rebd+ps1nrBVmPDdl8MjgKTctolme a4OdyHE5vUAPz+0tUr9u8dcr5WtKHdN7sHcdJeCyeutGWGmiIh5eZ59WcZd0EzavjauA 8KONyuAgQ63wvfwdsYbE/twTHxBU3bDtFI8qJalI3g9fSVve8+V6/7qetTsN8APBvj5c PsbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724201960; x=1724806760; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u9dArMZ/x4HDxMkmUuU/L74dk9GqqU8b+wIiOfjeZLk=; b=ai8zxmWdWtaIqDYzKgb4eJrXj8KPRULtF3P/ttTNPDnIH9AH4XyzfwbmuIP1yrDceZ Ls0Eybf0USlJ3C9uJPoRQz+RTuhB6QzFGP+Zuw2Lu54PCiJgqEH0asthd8xOKtJbdsex XJsQTmyW18G3cH7d3NPK0ONZakfuL2+BNMrmWi0QTlK1bcdABoRLKEu7XYDV6Z2Ad0Sf NzsSQKLd8bP/01shuiSycA2n4i7hX/KLN32SmAsN3YWsNrK3PMeF8o735Xd7eRMVOY/2 sjT3jNDhO5kslSSn8dPr91mv59qWtHZ1NNZnWgixeb5i5rgosNxl6JJCWBVI9qiN5S2o Edbg== X-Forwarded-Encrypted: i=1; AJvYcCUWlJa/lldJynazqMIKNMdibbq5ShfjP85Bxa+NCG8zomxbT7g3rqw7o9IjrHk9enrPSNXO3FCNuJK39My+7lHPjxQdAg==@freebsd.org X-Gm-Message-State: AOJu0YzkOqudmSMEYWz9hvbOsApS0ekQkPwiA6jI+//yVRmYbh2hQvwp HqfuK6IzX12kSGjXRd46VMwy8L9doJvRXFz3vU7kxjfPKs53TE9WqvdbxNl/b18= X-Google-Smtp-Source: AGHT+IG7Cfz48sWhHgNQDm69eRpfZk7M/1w8AKYqPUJ5Thav0iHPedpDQgh13q9fy0l/M2n8oYqecg== X-Received: by 2002:a05:6602:1343:b0:7eb:7f2e:5b3a with SMTP id ca18e2360f4ac-8253189b8e5mr83947239f.2.1724201959964; Tue, 20 Aug 2024 17:59:19 -0700 (PDT) Received: from mutt-hbsd (174-24-73-190.clsp.qwest.net. [174.24.73.190]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ccd6eb4c65sm4130637173.76.2024.08.20.17.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 17:59:19 -0700 (PDT) Date: Wed, 21 Aug 2024 00:59:18 +0000 From: Shawn Webb To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 417b35a97b76 - main - netinet: Add a sysctl to allow disabling connections to INADDR_ANY Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202408202134.47KLYdPH055386@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7cczi3fmhkdqbt5t" Content-Disposition: inline In-Reply-To: <202408202134.47KLYdPH055386@gitrepo.freebsd.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WpSf13Lf2z551G --7cczi3fmhkdqbt5t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Mark, When I set the net.inet.ip.connect_inaddr_wild sysctl node to 0 and try running `nc -vv 0.0.0.0 22` (this VM has sshd enabled), the below-linked KASSERT fires: https://cgit.freebsd.org/src/tree/sys/netinet/in_pcb.c#n2304 No KASSERT is tripped on the IPv6 code path--that works fine. Only IPv4 is impacted. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc On Tue, Aug 20, 2024 at 09:34:39PM UTC, Mark Johnston wrote: > The branch main has been updated by markj: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D417b35a97b7669eb0bf417b43e= 97cccbedbce6f9 >=20 > commit 417b35a97b7669eb0bf417b43e97cccbedbce6f9 > Author: Mark Johnston > AuthorDate: 2024-08-20 21:31:57 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-20 21:31:57 +0000 >=20 > netinet: Add a sysctl to allow disabling connections to INADDR_ANY > =20 > See the discussion in Bugzilla PR 280705 for context. > =20 > PR: 280705 > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D46259 > --- > sys/netinet/in_pcb.c | 8 +++++++- > sys/netinet6/in6_pcb.c | 12 +++++++++++- > 2 files changed, 18 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c > index 1a341d421f31..3fc90f1e12c2 100644 > --- a/sys/netinet/in_pcb.c > +++ b/sys/netinet/in_pcb.c > @@ -234,6 +234,12 @@ in_pcbhashseed_init(void) > VNET_SYSINIT(in_pcbhashseed_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, > in_pcbhashseed_init, 0); > =20 > +VNET_DEFINE_STATIC(int, connect_inaddr_wild) =3D 1; > +#define V_connect_inaddr_wild VNET(connect_inaddr_wild) > +SYSCTL_INT(_net_inet_ip, OID_AUTO, connect_inaddr_wild, > + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_inaddr_wild), 0, > + "Allow connecting to INADDR_ANY or INADDR_BROADCAST for connect(2)"); > + > static void in_pcbremhash(struct inpcb *); > =20 > /* > @@ -1309,7 +1315,7 @@ in_pcbconnect_setup(struct inpcb *inp, struct socka= ddr_in *sin, > inp->inp_flowtype =3D hash_type; > } > #endif > - if (!CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { > + if (V_connect_inaddr_wild && !CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { > /* > * If the destination address is INADDR_ANY, > * use the primary local address. > diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c > index e6ec0f24c898..098b4e50483c 100644 > --- a/sys/netinet6/in6_pcb.c > +++ b/sys/netinet6/in6_pcb.c > @@ -83,6 +83,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -97,6 +98,7 @@ > #include > #include > #include > +#include > =20 > #include > #include > @@ -112,6 +114,14 @@ > #include > #include > =20 > +SYSCTL_DECL(_net_inet6); > +SYSCTL_DECL(_net_inet6_ip6); > +VNET_DEFINE_STATIC(int, connect_in6addr_wild) =3D 1; > +#define V_connect_in6addr_wild VNET(connect_in6addr_wild) > +SYSCTL_INT(_net_inet6_ip6, OID_AUTO, connect_in6addr_wild, > + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_in6addr_wild), 0, > + "Allow connecting to the unspecified address for connect(2)"); > + > int > in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *= cred) > { > @@ -351,7 +361,7 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr_in6 *= sin6, > if ((error =3D sa6_embedscope(sin6, V_ip6_use_defzone)) !=3D 0) > return(error); > =20 > - if (!CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { > + if (V_connect_in6addr_wild && !CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { > /* > * If the destination address is UNSPECIFIED addr, > * use the loopback addr, e.g ::1. >=20 --7cczi3fmhkdqbt5t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmbFO+AACgkQ/y5nonf4 4fqemBAAjf67rFwLzeO9c4TVt+tKSJvOwnQuQGu+dsCzVHiEpx0UlLCU7aH867Uo 7rUQvnq5ZXP9JBb53xk9M4g4Qv/jAky0waM4nWy6XvI9dohGVRQY/dB+6L0d+A/1 QcMcJsxs3VV0NTQ2vKPayB1YYtsM0uX4OwfTDx1mKHkVIucq84n5nCeHWWLcvoUh e7TF038IFvgfI/FdMGsBuLiv5gAxE0fTMftMB6ss/3wAlEKrTHNfR9K8CJTlkZig FPRe19byPYPutMjReMYTqkaEpgs37UB+iuVDCJRIaNmlzheHHVZIUePXgZHlh6r9 PsBdan/BlipbyDHtqWR2gtVH1a8XvdAUJZF5iIhPSRu6Tg0/mTn1iyWKQKsdElv3 /WW+YnlUnCP48ea4K83CTYS0ip7f0mQTX8G5dCcAhO99WixLZzok8HQNGs+/+Lik Jd491rqLzntkp1EQPjh+56kOdYxNthXbVLGAbGjPYRFKmHVRrpEpWllSvUjcdHdW xdzbB7yXkCR92c3fJcKkf4SeFqhsArFRU+FTuhrkZqawrQ8g6aS914tghJXQtMKP ftIRo/cb4fLrmopWGBzh/r3qGwiOoiWOuMjJULDTjvViaKUN0NnAsPE7OQhVTlqe 9yjJcHqni9GnnZ9yyHlAhGfu+OCo3nupc27Ki2nY8BBx991V0kE= =kGZs -----END PGP SIGNATURE----- --7cczi3fmhkdqbt5t-- From nobody Wed Aug 21 01:18:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpT3b2mScz5T2hV; Wed, 21 Aug 2024 01:18: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 4WpT3b2DZXz56FP; Wed, 21 Aug 2024 01:18:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724203083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+abcfaKqd01M7a9xWquBLwPQiIc6onDyqXSDNf7Xm4A=; b=wvNbgVCQmAIidt8k5xQMpuGEtmp0stziWXgziMUmkrnrN1DbpzPAkKg6jv2Fgc12/hJOmy DELD1TV6HYbii0f5eccyFZNBZJyI2ILXmCjIhYhIe45l66sfvsaYS4auVPbNARbjomh6eE 01iIKPPjcXr0iqEyFooe3lKrbM2e7UHuo9No6EffHv/XWd7owKmcf8dZVthe6i+JJBMToQ UgNp4YhVmJ754BCTGYnr1hmbLsNS405kEMXqLRQy3tacN3nMbLrBFmpa9Zc8gCI1W0Y2E3 Lp+ke5gfrIYRyfgQmZGBfMkn3VpII4F4e2rFuvbXTp+vanVmjMPC6mJiwTSuTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724203083; a=rsa-sha256; cv=none; b=BlZBIhRiKecBJYQxlHBdtkDpBjCOQ2iVvjpEFVmt7XSfrK4hpKvAxL/Z+oA/705eYvUEvj O9CK+XiNADZUFR02nxRhN3hWHvhuGG6cXwMVt1Tx/FmJE1vmTpijEmX6DQ2AarEnPAh/It TtsXb10N+5/H9A/BnSUMSvm8JE24GwGPm+IfNNOVOqMLOH8Hfhq0yu9LdCWQB/e811wPKZ 4/EbpfOV5jAa8fCN/qqTgRa8fw0ZQP21uUwj/e3P5L8tSNEG/aCDRanrcJuwGCsxCzGOAc XxDhtcx9xxEGJv3/93rhnwRJo8dZut81jLj1/TnGngVFgdUKH/PtezZtAb21cw== 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=1724203083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+abcfaKqd01M7a9xWquBLwPQiIc6onDyqXSDNf7Xm4A=; b=opWnfAlSGzUMHj9IuATnTGF7z/o6OrqZs+XfVJVE1NmgbJ46w6BYskTl2lyfHlo2SdQXA4 eKDVp8bVAQLzDCOaXIKMbsCCeOESMWz0/szmrcE9E9bA8YX/+ULkpPcKrrI3mO3P/GYAXg gAE6+DGk5Y8YaEcI/4hBbSD5xV7J9Hc7Tme5VcHnazakRPiS6EecvNwgkwL/mFhJfpl7Dd WFvKm34w2pn/DRWcpUJy0D1l+4jR0JcN84hxyAaHZVjMBICOMB/VJh/YQ4Sr+SYJy2T+Gs iOviWqs4wRD/Km5uUpiq6AfNX+/acYMFKGtDVOt0EXkjvECxMWGLFSjFdDpFCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpT3b1jtHzP0t; Wed, 21 Aug 2024 01:18: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 47L1I3nf028123; Wed, 21 Aug 2024 01:18:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47L1I3I5028120; Wed, 21 Aug 2024 01:18:03 GMT (envelope-from git) Date: Wed, 21 Aug 2024 01:18:03 GMT Message-Id: <202408210118.47L1I3I5028120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: aa0bc761d245 - main - bsd.symver.mk: pass $CFLAGS to $CPP invocation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa0bc761d245d2ea1e4b7a0343715cc76859d5da Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=aa0bc761d245d2ea1e4b7a0343715cc76859d5da commit aa0bc761d245d2ea1e4b7a0343715cc76859d5da Author: Ed Maste AuthorDate: 2024-05-24 16:15:17 +0000 Commit: Ed Maste CommitDate: 2024-08-21 01:17:52 +0000 bsd.symver.mk: pass $CFLAGS to $CPP invocation This allows us to support symbols optionally available based on configuration, not just on compiler built-in #defines. Reviewed by: brooks, jrtc27 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45346 --- share/mk/bsd.symver.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.symver.mk b/share/mk/bsd.symver.mk index a1c6e62fba76..d0b63206d8fe 100644 --- a/share/mk/bsd.symver.mk +++ b/share/mk/bsd.symver.mk @@ -44,7 +44,7 @@ _vgen= ${path}/${VERSION_GEN} # Run the symbol maps through the C preprocessor before passing # them to the symbol version generator. ${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS} - cat ${SYMBOL_MAPS} | ${CPP} - - \ + cat ${SYMBOL_MAPS} | ${CPP} ${CFLAGS} - - \ | awk -v vfile=${VERSION_DEF} -f ${_vgen} > ${.TARGET} .endif # !empty(VERSION_DEF) && !empty(SYMBOL_MAPS) .endif # !target(____) From nobody Wed Aug 21 01:49:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpTm519KMz5T5P5; Wed, 21 Aug 2024 01:49: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 4WpTm50XnGz59Fq; Wed, 21 Aug 2024 01:49:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724204981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6UyMuN4Gq3nCTatAtszjZHE4es1GiJWBZPHgTnFX+Js=; b=YpADbEase3OwQHlu9jiDa0pbGDD0AuzHGh5RiFa+uR0H6TxJq/kmtLKONHAUsRrnZkYl2P 29PhZqJKL3jK1IIhyBqcgaG9NfOaL53cF5r1qoBHRnt+oKBDfB4aWMdWYdkeexB+n2gVIq Z1Gw9e3ltNoY3wY8LZTJMp1B5YpLD/ORio0m4aSC+twInFJzsRgucA8vs6TVgG4dr+xVDa 5c3sFjcluIQdHV0AAqA84/wPS6PMf7nzFdLKPtN7dp8tld33OBlFR5bht2ijiSw4c8MReU M5N59TdJHLSfs8qvYtALlrDP92ZwvrRpj3tCurg0yCpzB0eqPI3zvwzzeNdnXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724204981; a=rsa-sha256; cv=none; b=U+lI9dSbQXU73/VTJ84IyH4K5D9elJoopllafxViZfkpPDfGQeL8Vl7Jwx0e+y9+jqJt5o JzfVDsrd7Ht4bPJerbpJxaJcUBqxQiTDxUTCjSS2H8pAVwak2q9tzgfsX6wb+tDDH4/umT eiyj3GOyQPvlywno1Rcp32b0eufRHZiJ5n9cYvEf+ydC6Faod7fRcILcYn4KyM5DdZ3xpm 9VNdB87yzkr7UNgIs2bzH5xV2AqdT5IxzB8rzwK8JsraXqKqC6sN10B+kkD29FAuK+pLGN 6y/Z4nsheMKVd6sW15LuVKc45KgYuB6hPXDBtMohaU+/cNU8PdHpJopYsxGP/A== 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=1724204981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6UyMuN4Gq3nCTatAtszjZHE4es1GiJWBZPHgTnFX+Js=; b=tva+dn5/7VYqULo+7TriSl6EjW49TMyP3um89/RBDKjfrPTlYktYvpA49UP0ZbxqgCc7O5 i3W8qYE9GAY7kTNrgF5Z0fLy3LM4vPEr4fH+7E7M7pcwFa4WOY7fpUjZBSdG8T10NqBSSk iAHXFbGq+K1Gl+cQVGZuVq/DXKGPl11XsL91iayVaiBhjr033ai6aELe9idSNyiH1JwEAc blNfbEpJBtnpooKOPXvmV5R3FdaxReJTJYbDxrca3D9Rh4WiAy1F2DRWw9Jj4Nr48XEQOV y7JpxEW735aJC4sR2253qy7zeLXaXU+xclj4cdgCxH+C/hLQzvwpZ+8Y2yshuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpTm507r8zP2s; Wed, 21 Aug 2024 01:49: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 47L1neS2078876; Wed, 21 Aug 2024 01:49:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47L1nett078873; Wed, 21 Aug 2024 01:49:40 GMT (envelope-from git) Date: Wed, 21 Aug 2024 01:49:40 GMT Message-Id: <202408210149.47L1nett078873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 2477e88b8d43 - main - nfs: Add support for the NFSv4.2 mode_umask attribute List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2477e88b8d4328535357bc62409f673a551be179 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2477e88b8d4328535357bc62409f673a551be179 commit 2477e88b8d4328535357bc62409f673a551be179 Author: Rick Macklem AuthorDate: 2024-08-21 01:48:19 +0000 Commit: Rick Macklem CommitDate: 2024-08-21 01:48:19 +0000 nfs: Add support for the NFSv4.2 mode_umask attribute RFC8275 defines a new attribute as an extension to NFSv4.2 called MODE_UMASK. This patch adds support for this attribute to the NFSv4.2 client and server. Since FreeBSD applies the umask above the VFS/VOP layer, this attribute does not actually have any effect on the handling of ACL inheritance, which is what it is designed for. However, future changes to NFSv4.2 require support of it, so this patch does that, resulting in behaviour identcal to the mode attribute already supported. MFC after: 2 months --- sys/fs/nfs/nfs_commonsubs.c | 46 ++++++++++++++++++++++++++++------------- sys/fs/nfs/nfscl.h | 9 ++++---- sys/fs/nfs/nfsproto.h | 12 +++++++---- sys/fs/nfsclient/nfs_clrpcops.c | 18 +++++++++------- sys/fs/nfsserver/nfs_nfsdport.c | 17 +++++++++++++++ 5 files changed, 72 insertions(+), 30 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 3c9af40253ad..f0469958a43f 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -610,8 +610,18 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vattr *vap, break; case ND_NFSV4: NFSZERO_ATTRBIT(&attrbits); - if (vap->va_mode != (mode_t)VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_MODE); + np = NULL; + if (strcmp(vp->v_mount->mnt_vfc->vfc_name, "nfs") == 0) + np = VTONFS(vp); + if (vap->va_mode != (mode_t)VNOVAL) { + if ((flags & NFSSATTR_NEWFILE) != 0 && np != NULL && + NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, + NFSATTRBIT_MODEUMASK)) + NFSSETBIT_ATTRBIT(&attrbits, + NFSATTRBIT_MODEUMASK); + else + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_MODE); + } if ((flags & NFSSATTR_FULL) && vap->va_uid != (uid_t)VNOVAL) NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_OWNER); if ((flags & NFSSATTR_FULL) && vap->va_gid != (gid_t)VNOVAL) @@ -622,18 +632,14 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vattr *vap, NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); if (vap->va_mtime.tv_sec != VNOVAL) NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFYSET); - if (vap->va_birthtime.tv_sec != VNOVAL && - strcmp(vp->v_mount->mnt_vfc->vfc_name, "nfs") == 0) { - /* - * We can only test for support of TimeCreate if - * the "vp" argument is for an NFS vnode. - */ - np = VTONFS(vp); - if (NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, - NFSATTRBIT_TIMECREATE)) - NFSSETBIT_ATTRBIT(&attrbits, - NFSATTRBIT_TIMECREATE); - } + /* + * We can only test for support of TimeCreate if + * the "vp" argument is for an NFS vnode. + */ + if (vap->va_birthtime.tv_sec != VNOVAL && np != NULL && + NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, + NFSATTRBIT_TIMECREATE)) + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMECREATE); (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); break; @@ -3109,6 +3115,18 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, *tl = newnfs_false; retnum += NFSX_UNSIGNED; break; + case NFSATTRBIT_MODEUMASK: + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + /* + * Since FreeBSD applies the umask above the VFS/VOP, + * there is no umask to handle here. If FreeBSD + * moves handling of umask to below the VFS/VOP, + * this could change. + */ + *tl++ = vtonfsv34_mode(vap->va_mode); + *tl = 0; + retnum += 2 * NFSX_UNSIGNED; + break; default: printf("EEK! Bad V4 attribute bitpos=%d\n", bitpos); } diff --git a/sys/fs/nfs/nfscl.h b/sys/fs/nfs/nfscl.h index a52b9e433145..3b1445e1923c 100644 --- a/sys/fs/nfs/nfscl.h +++ b/sys/fs/nfs/nfscl.h @@ -68,10 +68,11 @@ struct nfsv4node { * These flag bits are used for the argument to nfscl_fillsattr() to * indicate special handling of the attributes. */ -#define NFSSATTR_FULL 0x1 -#define NFSSATTR_SIZE0 0x2 -#define NFSSATTR_SIZENEG1 0x4 -#define NFSSATTR_SIZERDEV 0x8 +#define NFSSATTR_FULL 0x01 +#define NFSSATTR_SIZE0 0x02 +#define NFSSATTR_SIZENEG1 0x04 +#define NFSSATTR_SIZERDEV 0x08 +#define NFSSATTR_NEWFILE 0x10 /* Use this macro for debug printfs. */ #define NFSCL_DEBUG(level, ...) do { \ diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 0268940fd8a6..ce7acf102d41 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1183,7 +1183,8 @@ struct nfsv3_sattr { */ #define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SUPPSETONLY2 (NFSATTRBM_MODESETMASKED) +#define NFSATTRBIT_SUPPSETONLY2 (NFSATTRBM_MODESETMASKED | \ + NFSATTRBM_MODEUMASK) /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1197,11 +1198,12 @@ struct nfsv3_sattr { (NFSATTRBM_MODE | \ NFSATTRBM_OWNER | \ NFSATTRBM_OWNERGROUP | \ - NFSATTRBM_TIMECREATE | \ + NFSATTRBM_TIMECREATE | \ NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) #define NFSATTRBIT_SETABLE2 \ - (NFSATTRBM_MODESETMASKED) + (NFSATTRBM_MODESETMASKED | \ + NFSATTRBM_MODEUMASK) /* * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. @@ -1218,7 +1220,9 @@ struct nfsv3_sattr { /* * NFSATTRBIT_NFSV42 - Attributes only supported by NFSv4.2. */ -#define NFSATTRBIT_NFSV42_2 NFSATTRBM_XATTRSUPPORT +#define NFSATTRBIT_NFSV42_2 \ + (NFSATTRBM_XATTRSUPPORT | \ + NFSATTRBM_MODEUMASK) /* * Set of attributes that the getattr vnode op needs. diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 8947b608b743..7540893ce63c 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2423,7 +2423,7 @@ nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, *tl = vtonfsv34_type(vtyp); } if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4)) - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, 0); if ((nd->nd_flag & ND_NFSV3) && (vtyp == VCHR || vtyp == VBLK)) { NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); @@ -2645,14 +2645,16 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, if (NFSHASSESSPERSIST(nmp)) { /* Use GUARDED for persistent sessions. */ *tl = txdr_unsigned(NFSCREATE_GUARDED); - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, + 0); } else { /* Otherwise, use EXCLUSIVE4_1. */ *tl = txdr_unsigned(NFSCREATE_EXCLUSIVE41); NFSM_BUILD(tl, u_int32_t *, NFSX_VERF); *tl++ = cverf.lval[0]; *tl = cverf.lval[1]; - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, + 0); } } else { /* NFSv4.0 */ @@ -2663,7 +2665,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, } } else { *tl = txdr_unsigned(NFSCREATE_UNCHECKED); - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, 0); } NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OPEN_CLAIMNULL); @@ -3238,7 +3240,7 @@ nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, *tl = txdr_unsigned(NFDIR); } (void) nfsm_strtom(nd, name, namelen); - nfscl_fillsattr(nd, vap, dvp, NFSSATTR_SIZENEG1, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_SIZENEG1 | NFSSATTR_NEWFILE, 0); if (nd->nd_flag & ND_NFSV4) { NFSGETATTR_ATTRBIT(&attrbits); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); @@ -8456,18 +8458,18 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, if (NFSHASSESSPERSIST(nmp)) { /* Use GUARDED for persistent sessions. */ *tl = txdr_unsigned(NFSCREATE_GUARDED); - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, 0); } else { /* Otherwise, use EXCLUSIVE4_1. */ *tl = txdr_unsigned(NFSCREATE_EXCLUSIVE41); NFSM_BUILD(tl, u_int32_t *, NFSX_VERF); *tl++ = cverf.lval[0]; *tl = cverf.lval[1]; - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, 0); } } else { *tl = txdr_unsigned(NFSCREATE_UNCHECKED); - nfscl_fillsattr(nd, vap, dvp, 0, 0); + nfscl_fillsattr(nd, vap, dvp, NFSSATTR_NEWFILE, 0); } NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OPEN_CLAIMNULL); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index fa99a76f492e..12592d4c5c59 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3212,6 +3212,23 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, nd->nd_repstat = moderet; attrsum += 2 * NFSX_UNSIGNED; break; + case NFSATTRBIT_MODEUMASK: + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + mode = fxdr_unsigned(u_short, *tl++); + mask = fxdr_unsigned(u_short, *tl); + /* + * If moderet != 0, mode has already been done. + * If vp != NULL, this is not a file object creation. + */ + if ((nd->nd_flag & ND_NFSV42) == 0) + nd->nd_repstat = NFSERR_ATTRNOTSUPP; + else if ((mask & ~0777) != 0 || vp != NULL || + moderet != 0) + nd->nd_repstat = NFSERR_INVAL; + else + nvap->na_mode = (mode & ~mask); + attrsum += 2 * NFSX_UNSIGNED; + break; default: nd->nd_repstat = NFSERR_ATTRNOTSUPP; /* From nobody Wed Aug 21 07:00:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpcfp44cJz5TKTC; Wed, 21 Aug 2024 07:00: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 4Wpcfp3S1zz4PTj; Wed, 21 Aug 2024 07:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724223634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hOEMpjiAWeI7RQ8cYzOvkaH3tbyNA32GR21sF9kJsPs=; b=m6ytW2i5p++YaY9kpB8gQT292L5ITxjkiiGy4ibP4uliBu3i4reN1uNDgLjXYfIImUNvZI lwTLjHQuWUISDxuAmxszOhqYSRhACVCkAYddEFfgrBapg87CRf7gVGuPaEkRDIuWqkdDK3 ijhgrVqiqvgg9T9RCbhx21ViyRqtwFRJf7Q6DQZz4m+zrRO2lv2grvG1aIu+0KL9X0r0RC t5LCVkONcEtTlO7TYV53qzlD//b6egI+IVi5bXygL6iTySrK/za4tfqhwgpLnBi/jK+J9T Gr5aD0Vc3o6FGuTY4e6KIaNWQIC2qCB+QT6NBu4P9un2pQlzLzLb6EqAVJFXow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724223634; a=rsa-sha256; cv=none; b=K1hmQbIwswSnJffK2dJtyiu41+UqSZxRxW0d5ROU15yeTL8e/myAGCjzeptp7U003mTEdB 8QU/wt9tmU8GUSv/dMH3LzhLL0mvcBvxkT+6Vq5s5gDZvyF9d2uVSXMFYs6earpqoNcitC U/gh6i6PDDMu9GvL61hUa7N36ZSfLCT+zmC/x0x+YYZRruOrgZe09aca4eeRPTGjjY1uAH pDI9zfzgN/ZARsggAEOzGWOmHCt2ox2tQcAvzXPdYVCbWISqHkvcyPSxteaWjbAmoA2wTG PsZZyIvIwKz4gEq4qfjYbnrktHL2aPZEZA/Wj2NMxsaE9i8pbJlX7yoLXLJT3w== 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=1724223634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hOEMpjiAWeI7RQ8cYzOvkaH3tbyNA32GR21sF9kJsPs=; b=yZc2BMYA1zh/q5e1CbvHE3h34y0Ke7GdizkG6wYgP3iIBZMl/g8hXB621N1HabrMpaMRKs kcVnJJb/isVAAfps2XJr7CnXDb3qERhteao/5CEvKhxdRaDg1buCtjfAvEayDXP15R8kSr 6te6dNhN6kSAmmq/N0qtLG1WJ3UP8YJTWMs5dmymUWtIBCD+jYywBDc6SPYacVNNkci0Qw uYuXODDGm8w1oGOHXGlVwOVH0x0Uz7kJA81A1qbYSAWtoGXA2p+Oi76lEYGLWD8+T9jCj6 008xd/I6A1bYMrddroGPxYjEsvSq6dFnd7w8hUe0IJlnPwHw7I7/q4hbGi7CpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpcfp2ws8zZWg; Wed, 21 Aug 2024 07:00: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 47L70YFo014537; Wed, 21 Aug 2024 07:00:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47L70Yt3014534; Wed, 21 Aug 2024 07:00:34 GMT (envelope-from git) Date: Wed, 21 Aug 2024 07:00:34 GMT Message-Id: <202408210700.47L70Yt3014534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 213eb102aeec - main - msun: Fix typo in comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 213eb102aeec50b8c236aac1d8f0e0a3f9a99449 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=213eb102aeec50b8c236aac1d8f0e0a3f9a99449 commit 213eb102aeec50b8c236aac1d8f0e0a3f9a99449 Author: Steve Kargl AuthorDate: 2024-08-21 06:59:07 +0000 Commit: Li-Wen Hsu CommitDate: 2024-08-21 06:59:07 +0000 msun: Fix typo in comment PR: 280965 MFC after: 3 days --- lib/msun/src/math_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h index f3f7985ab7b6..1595f902846c 100644 --- a/lib/msun/src/math_private.h +++ b/lib/msun/src/math_private.h @@ -405,7 +405,7 @@ do { \ * any extra precision into the type of 'a' -- 'a' should have type float_t, * double_t or long double. b's type should be no larger than 'a's type. * Callers should use these types with scopes as large as possible, to - * reduce their own extra-precision and efficiciency problems. In + * reduce their own extra-precision and efficiency problems. In * particular, they shouldn't convert back and forth just to call here. */ #ifdef DEBUG From nobody Wed Aug 21 08:48:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpg3G1bS8z5TTYh; Wed, 21 Aug 2024 08:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpg3F6T2jz4c63; Wed, 21 Aug 2024 08:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724230105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6bip2IkajyU1AE16UTQmkkg2feug1X1GBjA7mt1QacI=; b=ssddpmSEi2f+UPsph0bGkN4BztBMwyfE2A/edV6LXWQkBGDby+49AHvh5P/hX9/qdjyEu3 CMqN6pfU6yJJczpiVIg+W+gASO10Lod9dn2vtpoHH6fzl8qsstVL4ftDtE5fvHmsGmI/E2 KPUpgVFbt4YkVBllQiAf4T5eogGp5bfhP1OmZLZUqWlkoVPCXtNWtd5BfynCWjVh/rwiog gn35tq35g7gTcj6qop6Gj7wBDBXWnGxUOwCe2eHKCyvQhUemgcNVHhiypquXFxDn3V/iwM c8SBGv2qrgeVNLb94eRXcjnZ6QEkRjZ+2GyL/O02VMqwtVwaNbNEF9TyJeRhIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724230105; a=rsa-sha256; cv=none; b=pKt4I+VbDDJhgz4nn3eXz913n3CmOThCZ2W2NapL1dO6kD2PH5ipcK6IfYAHutGAq6m29V FSf2P3V/o2/cXgAspRVMhkuQS63T1KJushu8YezPDtdY7Q8sK2FFM1J5q5QLJhiN1DPHUR IxpZ17MhS3Na+ENwpJiR3F5l20gKts8L8cPcxTv/Tdm4t9eiWccWi1Wq5ncqHwHvSzwBj6 nt2Mv5yRhvd6XluSJJRkEsIoQihvAfAtjAIPIiYT1A607nkhqNOuISWH4J/aZPQnAS2j6h 2PEXNqoeGmrOu9fVMbAcAgi20WAwAd/uJhYdnIr1KADW4Fdgf2hOgfbN6xilvg== 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=1724230105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6bip2IkajyU1AE16UTQmkkg2feug1X1GBjA7mt1QacI=; b=bB0Z75i0HpINRJjChHcUvxEaqbXbfZ/7LyYr2mGMSx+ExTx49O2iU+yWqzgeNy4v49WNHG PMchRi7n0tszwWhz+PpRzQ1un9Wh2OufhkHlDO4E3U8wbym1B0fM3ZgBwX+5L2/BsRV2Oi 6lHArBU5LcBTsI1k2Q9OhW+ILtMPxhcWTbxjLrcqEEWrfI0JVpbOM3NicB5AdMggXNxXO1 NpdLUYU6Tm1vifLGgnv+qV9+olHnFbfdJMMps4pINWYcmlyzN8Xt2V0gS4EJMMGkqevLnw QJfCEukzkeLvE7dHA+gXgsePTKCdM7hp60oqR5cbe5UGdqFFWqvXRedRWjBVoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpg3F57qnzct5; Wed, 21 Aug 2024 08:48: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 47L8mPmR091794; Wed, 21 Aug 2024 08:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47L8mPg2091791; Wed, 21 Aug 2024 08:48:25 GMT (envelope-from git) Date: Wed, 21 Aug 2024 08:48:25 GMT Message-Id: <202408210848.47L8mPg2091791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: db6e3260a8b9 - main - arm64: Remove the E2H check from has_hyp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db6e3260a8b9257aa4f1991867e46973e4f0dce8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=db6e3260a8b9257aa4f1991867e46973e4f0dce8 commit db6e3260a8b9257aa4f1991867e46973e4f0dce8 Author: Andrew Turner AuthorDate: 2024-08-19 12:46:05 +0000 Commit: Andrew Turner CommitDate: 2024-08-21 08:46:59 +0000 arm64: Remove the E2H check from has_hyp This was added to not use the physical timer when E2H was set. As we now use the correct timer in this case we can remove this extra check. Tested by: kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46086 --- sys/arm64/arm64/genassym.c | 1 - sys/arm64/arm64/locore.S | 1 - sys/arm64/arm64/machdep.c | 9 +-------- sys/arm64/include/machdep.h | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c index c4f52ae61a77..a4db825e976c 100644 --- a/sys/arm64/arm64/genassym.c +++ b/sys/arm64/arm64/genassym.c @@ -42,7 +42,6 @@ ASSYM(BP_MODULEP, offsetof(struct arm64_bootparams, modulep)); ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack)); ASSYM(BP_KERN_TTBR0, offsetof(struct arm64_bootparams, kern_ttbr0)); ASSYM(BP_BOOT_EL, offsetof(struct arm64_bootparams, boot_el)); -ASSYM(BP_HCR_EL2, offsetof(struct arm64_bootparams, hcr_el2)); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4252ea3f59f8..ab1fea0c4716 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -134,7 +134,6 @@ virtdone: str x25, [x0, #BP_KERN_STACK] str x27, [x0, #BP_KERN_TTBR0] str x23, [x0, #BP_BOOT_EL] - str x4, [x0, #BP_HCR_EL2] #ifdef KASAN /* Save bootparams */ diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 090ea2c10853..c73c6d205c1a 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -131,7 +131,6 @@ static struct trapframe proc0_tf; int early_boot = 1; int cold = 1; static int boot_el; -static uint64_t hcr_el2; struct kva_md_info kmi; @@ -207,12 +206,7 @@ pan_enable(void) bool has_hyp(void) { - - /* - * XXX The E2H check is wrong, but it's close enough for now. Needs to - * be re-evaluated once we're running regularly in EL2. - */ - return (boot_el == CURRENTEL_EL_EL2 && (hcr_el2 & HCR_E2H) == 0); + return (boot_el == CURRENTEL_EL_EL2); } bool @@ -905,7 +899,6 @@ initarm(struct arm64_bootparams *abp) TSRAW(&thread0, TS_ENTER, __func__, NULL); boot_el = abp->boot_el; - hcr_el2 = abp->hcr_el2; /* Parse loader or FDT boot parametes. Determine last used address. */ lastaddr = parse_boot_param(abp); diff --git a/sys/arm64/include/machdep.h b/sys/arm64/include/machdep.h index 2f2960ae39f2..4fa80219da42 100644 --- a/sys/arm64/include/machdep.h +++ b/sys/arm64/include/machdep.h @@ -33,7 +33,6 @@ struct arm64_bootparams { vm_offset_t modulep; vm_offset_t kern_stack; vm_paddr_t kern_ttbr0; - uint64_t hcr_el2; int boot_el; /* EL the kernel booted from */ int pad; }; From nobody Wed Aug 21 08:48:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpg3H2S4Bz5TT9p; Wed, 21 Aug 2024 08:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpg3H0f9gz4c8Y; Wed, 21 Aug 2024 08:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724230107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YWBfyD4ndYV1MgSpqYqj6FAt0y3YD+cJiVKAwhpCugw=; b=Ikqt7Akeywm/ns0559sX4HCt6A1JMXPzDlqA1PV2m/y/WZSB8oHCquexjqyAbA63GdYw0B Fq+dludkAlQ5jUH4pzh2+zXlQT54fvAYWym4G/tjfypfrJelnIjzfQWMn1GALbF7exUBlL TSj+O5gIZe9mwCvs/Q21LDyJbtsqDnVyiI7bbvNXna8r4iNYXacNt9KJL6gBiCCyes+HAG Qpx4Te9/xyFg5vgLEg6PuILAODfNLh/RjNEglkug7mV2DlpCWLV3Qyh5qp2P21Oj1Nsbvs F9ldW2LlfmTQfUeE9+ONllvimVTQFZ90zZn9mBwhxdqe7Xh0iVpv8ioteefhlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724230107; a=rsa-sha256; cv=none; b=jxWTLGQWbMrwtvvMIsNXIzrh5J6oX7nID3mzQuhD/cBRei0sJ6i9zh7znWkJeGkvCo14Fq nUtdm4iIZR3jA3uEl2btomYpPKoMU83J5dAdKj4cnVkTdc1tUFKgzZNiOntn6krQL3J/fE x7I8Kp8OygX+KzGamVknlyypnRAtkUwn7x/sFBGftt0o1vHIXj3Jy8RQoANPflRO2BKFit JgGpwd/P6b6BRYFb3E4EJu9X6dKptv9yQ6TXB66QdlYUPcq0n1z0g7miKrz1O29R1qF5iO rNWMaoY3Bxcln4rJKYkEcWVGoVFNlaKnTuQT2rLEmXaR/NQX+yfxUPzFMfitaQ== 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=1724230107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YWBfyD4ndYV1MgSpqYqj6FAt0y3YD+cJiVKAwhpCugw=; b=FohFSvBde6F3V8eJB3IgMCM25y+06lGjS5GKrJ+qMqWBXtQ9ET/FMBLT/KA+E7RgG8bSzg 21KyQJqjve0P65Bv+IGqEdDQChhx3bvA791n959ifedpxiK6th6LBBaZBimS0opFkeQYVR 2f2sW3ll/Hdmv1U0/QKmjx3P+ufVFAg8ZgY3r05i0oM8e5nkO3/QV07eCB3CO90KPRTYvP ln6E6JQY+lFpAs1Zpl4vs7awQTVen3xICnhOjri1a+bvuB0Czn1HG3EvFb6fbwOCiuELOa rjFHK4ho48SiEKwY1gJNlz+9rzsY9HgwL484Pw4CtQyK9KSupaWQrWulNk9qyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpg3G66zHzd6x; Wed, 21 Aug 2024 08:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47L8mQbJ091842; Wed, 21 Aug 2024 08:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47L8mQce091839; Wed, 21 Aug 2024 08:48:26 GMT (envelope-from git) Date: Wed, 21 Aug 2024 08:48:26 GMT Message-Id: <202408210848.47L8mQce091839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0054693392f0 - main - arm64: Boot into VHE mode when able List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0054693392f094c035fd396db339b8ceb16f17dd Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0054693392f094c035fd396db339b8ceb16f17dd commit 0054693392f094c035fd396db339b8ceb16f17dd Author: Andrew Turner AuthorDate: 2024-08-19 12:46:10 +0000 Commit: Andrew Turner CommitDate: 2024-08-21 08:46:59 +0000 arm64: Boot into VHE mode when able When FEAT_VHE is present the HCR_EL2 E2H field will be implemented. Try setting this and checking if it's still set to decide if we can boot into VHE mode or not. When it is implemented the kernel will boot into EL2 rather than EL1 it currently boots to. The parts of the kernel that need to know if they are in EL1 or EL2 have been updated other than the CoreSight driver as there doesn't appear to be any way to currently use it and it will be updated soon with the new HWT framework. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46087 --- sys/arm64/arm64/locore.S | 65 +++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index ab1fea0c4716..b71e02538716 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -296,8 +296,12 @@ LEND(mpentry_common) #endif /* - * If we are started in EL2, configure the required hypervisor - * registers and drop to EL1. + * Enter the exception level the kernel will use: + * + * - If in EL1 continue in EL1 + * - If the CPU supports FEAT_VHE then set HCR_E2H and HCR_TGE and continue + * in EL2 + * - Configure EL2 to support running the kernel at EL1 and exit to that */ LENTRY(enter_kernel_el) #define INIT_SCTLR_EL1 (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_EIS | \ @@ -335,13 +339,14 @@ LENTRY(enter_kernel_el) isb /* Configure the Hypervisor */ - ldr x2, =(HCR_RW | HCR_APK | HCR_API) + ldr x2, =(HCR_RW | HCR_APK | HCR_API | HCR_E2H) msr hcr_el2, x2 /* Stash value of HCR_EL2 for later */ isb mrs x4, hcr_el2 + /* Load the Virtualization Process ID Register */ mrs x2, midr_el1 msr vpidr_el2, x2 @@ -354,41 +359,51 @@ LENTRY(enter_kernel_el) ldr x2, =INIT_SCTLR_EL1 msr sctlr_el1, x2 + /* Check if the E2H flag is set */ + tst x4, #HCR_E2H + b.eq .Lno_vhe + /* - * On some hardware, e.g., Apple M1, we can't clear E2H, so make sure we - * don't trap to EL2 for SIMD register usage to have at least a - * minimally usable system. + * The kernel will be running in EL2, route exceptions here rather + * than EL1. */ - tst x4, #HCR_E2H - mov x3, #CPTR_RES1 /* HCR_E2H == 0 */ - mov x5, #CPTR_FPEN /* HCR_E2H == 1 */ - csel x2, x3, x5, eq + orr x4, x4, #(HCR_TGE) + msr hcr_el2, x4 + isb + + msr SCTLR_EL12_REG, x2 + ldr x2, =(CPTR_FPEN) + ldr x3, =(CNTHCTL_E2H_EL1PCTEN | CNTHCTL_E2H_EL1PTEN) + ldr x5, =(PSR_DAIF | PSR_M_EL2h) + b .Ldone_vhe + +.Lno_vhe: + /* Hypervisor trap functions */ + adrp x2, hyp_stub_vectors + add x2, x2, :lo12:hyp_stub_vectors + msr vbar_el2, x2 + + ldr x2, =(CPTR_RES1) + ldr x3, =(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + ldr x5, =(PSR_DAIF | PSR_M_EL1h) + +.Ldone_vhe: + msr cptr_el2, x2 + /* Enable access to the physical timers at EL1 */ + msr cnthctl_el2, x3 + /* Set the return PSTATE */ + msr spsr_el2, x5 /* Don't trap to EL2 for CP15 traps */ msr hstr_el2, xzr - /* Enable access to the physical timers at EL1 */ - tst x4, #HCR_E2H - ldr x3, =(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) - ldr x5, =(CNTHCTL_E2H_EL1PCTEN | CNTHCTL_E2H_EL1PTEN) - csel x2, x3, x5, eq - msr cnthctl_el2, x2 - /* Set the counter offset to a known value */ msr cntvoff_el2, xzr - /* Hypervisor trap functions */ - adrp x2, hyp_stub_vectors - add x2, x2, :lo12:hyp_stub_vectors - msr vbar_el2, x2 - /* Zero vttbr_el2 so a hypervisor can tell the host and guest apart */ msr vttbr_el2, xzr - mov x2, #(PSR_DAIF | PSR_M_EL1h) - msr spsr_el2, x2 - /* Configure GICv3 CPU interface */ mrs x2, id_aa64pfr0_el1 /* Extract GIC bits from the register */ From nobody Wed Aug 21 10:04:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wphkg3N9Cz5Tbnp; Wed, 21 Aug 2024 10:04: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 4Wphkg2vxbz4jFR; Wed, 21 Aug 2024 10:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724234651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vkzZN03LlTaRrBbNa98p4iAQadU32N3r6djy0XOfwNw=; b=U0lFuXNsp1MITEtaeYLiCMzqTNsNiUhge+bsV+zYUnjeKg8a98bCEU3sMs+c6a8OsdJ16t 6U/nT+v3yNkgnPcaL0DZ1Ss/gyWTwuCFSdZFFouoGNse+denmwAqW0bjn2TzuvNH7cI6j4 /1PPoTo+nFvdmhaWE3ReIST3SIzucNAlH43zXlUlfPJNuTiwQi+71iawfkVqM4mKarCOK/ dy0g1vDe2jAzhLLQxo6r6Xz8UAKNl1c/ufp9WASWVDeO3kWozccTAo6jcng1iJgZfrCziu 5iVL1t8FWMUm857ts2ltuXt987Ab0scNXgTvFwLuGuO+LUUtlzRgd7H6sEUPLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724234651; a=rsa-sha256; cv=none; b=dltxB95EfmbgDGXGLk6FXHodQaevw8Vcvc31cLWwtV5AakQMjhk24vPoE9jnJA5Ih7Srgw tob7ING51JG19nGRZVn0420OiraIuXUEF7FPQkLaVEfienOj/SsFsdcyJ7WBvtzId8WpTi tzspqNfxd8yAKVOEUGYwvM+gnvOjKxb2dgPJ28pCls4/3i0W3BlEIkojNEgk5R0Zkkw2CR gBwBTGA1skwqv+gd8jexwVHfmiqNqrIsT57Xn/D3oO9v59emTddcmIPjohJyePuhUbNSql PAJPOeMz+zEt4uMMu4ij6MGUPdpHOjcFnvxXSHkqIl6cNcvfqD8OiGXXiqY5sg== 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=1724234651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vkzZN03LlTaRrBbNa98p4iAQadU32N3r6djy0XOfwNw=; b=x4D2GewCZ5KhsZyH2r2N93FAWaihsSXJCSpUWiq8SrqYI7JPugpij18ZRvwQ8CqxosI3Gv PmgCSt4wTC7VoWZxD3TXR3X2B522e9p6ECs7jsiXkDNtT7NCZGo5TKYb1KODVEN5AR/X5+ JbaiIYRgoKpIXr4jF8e+QbDbxMgrdf3d9n8mWZ914y0KfuWkguuslzyEioi+FCaXUS80B7 ZFsM8LVVPbWwsKccLZ079Gh1MbJ+gx6PNFowSV+39iyMCwaOVDn0GDuYafnPsGo91u3/uR LbQDogInSrECTDAFoMzJept3hjGOOeSo4qJAf4fuNa1Wk1XUJYLzK3wXQ1sSIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wphkg2WDWzg0X; Wed, 21 Aug 2024 10:04: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 47LA4Bn4026868; Wed, 21 Aug 2024 10:04:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LA4Bm9026865; Wed, 21 Aug 2024 10:04:11 GMT (envelope-from git) Date: Wed, 21 Aug 2024 10:04:11 GMT Message-Id: <202408211004.47LA4Bm9026865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 7412517f2947 - main - init_main: Sprinkle const qualifiers where appropriate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7412517f2947342d599e42dd563fd6b3a7656e29 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7412517f2947342d599e42dd563fd6b3a7656e29 commit 7412517f2947342d599e42dd563fd6b3a7656e29 Author: Zhenlei Huang AuthorDate: 2024-08-21 10:01:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-08-21 10:01:30 +0000 init_main: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week --- sys/kern/init_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 7386a0729835..9d2663015027 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -347,13 +347,13 @@ mi_startup(void) } static void -print_caddr_t(void *data) +print_caddr_t(const void *data) { - printf("%s", (char *)data); + printf("%s", (const char *)data); } static void -print_version(void *data __unused) +print_version(const void *data __unused) { int len; From nobody Wed Aug 21 10:19:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpj4Q5ww2z5Tckf; Wed, 21 Aug 2024 10: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 4Wpj4Q5R9hz4kHb; Wed, 21 Aug 2024 10: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=1724235574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ix+cG+D2r58uIpgD06F+CIn0AQlOwd7cNkEISQFwdSI=; b=cuFQVzSSkfBjV6ZoUCaaGOq5QBaUAlV9p/+GJGkJGWRl8TMfTblLzV8nO34rorey09DoTq 96YTXVoY+B4WObqwbhuS4OgSeIxh0EyFl7sK0N4tyOm0Gj1FQ5bOWvDc3lxnmUYKvw0zks VQCBq4gGpn0x4KIsz06yTOy0aj+1gudiAYDAmtNazuA0LfAhHQmjNU4d0JIVgOkEu7QpQe +xBoIZEzPX5LP10lyAJqiSmpMyKuEsO/2dN47/NP6DRzystdjAEeL9ldJCJ7Y+uwcs1ESA pawBzJ/dy8oIpdH2jILpdUoiXYFnlPzcKF5BV8wI9kzm6OYdbsrdlestxIY42w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724235574; a=rsa-sha256; cv=none; b=ug5+BVwHkE1PIMkI6IATtYwIN9mu4FsnVReEWvQvEjCnzXK4V/aimmHHCwykdsjlJN4TyK 5hcqOUFBgmMnsaNXEekccHXbotGUZmdd50WOccGqQ3uxQXLNuNOai0Lebt8CG8Jz11oASZ FmN7Vio5zmxPhJYZFb2W77e1FdetKlaIswg6Sob+th0sDdpl/yrZfra0lj8gqC5QMEmbbx L80+MIjiZTlzlUCKSKWePM1ZA38TjtyK0h+pJRs3E+vLQprewoiLPpW5xmWpVHSaribOeS 8DCgBiKE9VSxvuiYs+guRuaC2jFqxDEiqRKyjl3kafWjc+oF6gEgyVFOymd+vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724235574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ix+cG+D2r58uIpgD06F+CIn0AQlOwd7cNkEISQFwdSI=; b=vJ8SdFAIPTRInPAUCPYDuSGjEkMtSMoZpOmxP5gzl5Wavd6n4383HokfG+rnIOlZt3mt/+ oIDMlbn6MQVcwKw/yzSJnU0ghXY6iDA+86hhV9Qe10RZPtIH9t2l2k9BuwUwnTZ/2d84tJ DS9Hydw/1+QtGJ3szSASLDfwaSLOpOo87uMX08PMgqWBIDf+YvXwIWCmAiuj/ebYMPA1Xh 7Gt2Syp1MXslEGjqUlF0+tFRtuLlFOyLqLiaHF31gKL2pSVQJFaentNLwGiV0BH5tgz1aO y3TW9TgaQ+gKFZqh759qTCZz+6YwWQ6SstjQ14tCA5mz85EhYYhwBGrKHuZ+QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpj4Q4hhFzgHg; Wed, 21 Aug 2024 10: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 47LAJYed044202; Wed, 21 Aug 2024 10:19:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LAJYn5044199; Wed, 21 Aug 2024 10:19:34 GMT (envelope-from git) Date: Wed, 21 Aug 2024 10:19:34 GMT Message-Id: <202408211019.47LAJYn5044199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 78d69d0a3c7f - main - arm64: Fix the kernel with options VMM List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78d69d0a3c7f17944a7ecb84509fca6d0aa8545e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=78d69d0a3c7f17944a7ecb84509fca6d0aa8545e commit 78d69d0a3c7f17944a7ecb84509fca6d0aa8545e Author: Andrew Turner AuthorDate: 2024-08-21 09:06:57 +0000 Commit: Andrew Turner CommitDate: 2024-08-21 10:16:10 +0000 arm64: Fix the kernel with options VMM * We can build the non-VHE code with branch protection, it is already build as such in the module. * Use the correct file name for the non-VHE exception .o file. --- sys/conf/files.arm64 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index b105ce873d24..1c863ff98998 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -125,13 +125,13 @@ arm64/vmm/vmm_reset.c optional vmm arm64/vmm/vmm_handlers.c optional vmm arm64/vmm/vmm_call.S optional vmm arm64/vmm/vmm_nvhe_exception.S optional vmm \ - compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ + compile-with "${NOSAN_C} -fpie" \ no-obj arm64/vmm/vmm_nvhe.c optional vmm \ - compile-with "${NOSAN_C:N-mbranch-protection*} -fpie" \ + compile-with "${NOSAN_C} -fpie" \ no-obj vmm_hyp_blob.elf.full optional vmm \ - dependency "vmm_nvhe.o vmm_hyp_exception.o" \ + dependency "vmm_nvhe.o vmm_nvhe_exception.o" \ compile-with "${SYSTEM_LD_BASECMD} -o ${.TARGET} ${.ALLSRC} --defsym=_start='0x0' --defsym=text_start='0x0'" \ no-obj no-implicit-rule vmm_hyp_blob.elf optional vmm \ From nobody Wed Aug 21 10:19:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpj4R6ZtPz5Tcr5; Wed, 21 Aug 2024 10: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 4Wpj4R5RP9z4k66; Wed, 21 Aug 2024 10: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=1724235575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X5XexcMELglAyeQwYNC/BCoiJHk1d3IRWNid0ZPrdlU=; b=eqDBoOg5wKGKmc+rNJNiRm6aU81dBUFDTIZi3HLtCpKFswZ0KtAl8lV2KCRjHq5U0XtZ0o 9g9N76sEwq10w8DwGqzntxIuBX/vgtnUk7RIs6jW8aZDHULtkzHN185dz60zyxcsMXH03L JGcWYcEX+wDwG3jwc/fZgo8z5Rc5sADsAkMm/fd7JVNMKW8X8C04UQqc4/oPPiqM3fI/vh h8zcUYiOkv5oAth+d4MddIjw6UiboXMUyfX4K1mX1KCG47SVH+MzYuYY7VXp09PQ1cSlMO u/pt16u7LcaMjaXBfxS9ukv4IDGzgi+gG5M0gj4yTRjbyawdE5oLZwb65ZCH3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724235575; a=rsa-sha256; cv=none; b=k84izt4ahx8KTSDVCXODR4dugKOoDbg72KwmM89k5L+Dy9bte9m4LPRSzaLUArcRruMO5+ TP64EzSb2MMmKKZYiQ4Qtli48Krd/1TXHkOga634HO05fBhn3XvoVQfjf5AD6vEzvMKqRp 9t5EreYnrJYJstVfoNUhAfO0B6TqFdnxX2HfS7ZKhCJ6eWTkhORxX+koJJzyPlAdKGKL8G a0ZQUsbsFyxOqiXgZ6FIWteCsg1gAtMICFdXMcs/HQyKlPmkGi3ePt32BKtQiAsCMVce95 cSVgCWZoSeSI/GcQ3tmGCMeodLSM3Xnjb2WczU57mQ2HumkV8rXWKIefC9pwNg== 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=1724235575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X5XexcMELglAyeQwYNC/BCoiJHk1d3IRWNid0ZPrdlU=; b=o/nu3GhMot/SNd7RnKq72OdDhxqA0vERUXObREZQdk4OnHZAHHvb6iI2DRz0zAfkwOJPjD TrrEUUyiAX8xU8N9x2K02Fc241Wh+W+axkfKHgGmxOWnZQNIrdfM9P1HMF/AtGGQYHCkQp fufPL/RTOjnHjDkVBM3fjFbBLmgpwHHRdgp2JDAVKOp8aPyPentleo459b6gMGMGyRQ5gv a7nkVf4ro4l8rfzlJ3olfMvQ4NVbpc5J/oyt0ZrspjCdE7oWH3a4VeUy5dk6NkZU+E9Wrs XAfpIbFFFI8ljBpeNBzPAuSpgmnFw46vJ7tJjPlXZeDHPrFJpQPnv3Z7u9z5NA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpj4R52xDzg2h; Wed, 21 Aug 2024 10: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 47LAJZ7n044256; Wed, 21 Aug 2024 10: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 47LAJZDK044253; Wed, 21 Aug 2024 10:19:35 GMT (envelope-from git) Date: Wed, 21 Aug 2024 10:19:35 GMT Message-Id: <202408211019.47LAJZDK044253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f1bc3750cf9a - main - arm64: Use store-pair to zero the kernel bss List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1bc3750cf9a6623b0c0861984ef2a8ac966a4e3 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f1bc3750cf9a6623b0c0861984ef2a8ac966a4e3 commit f1bc3750cf9a6623b0c0861984ef2a8ac966a4e3 Author: Andrew Turner AuthorDate: 2024-08-20 17:14:28 +0000 Commit: Andrew Turner CommitDate: 2024-08-21 10:16:10 +0000 arm64: Use store-pair to zero the kernel bss While this won't be noticed by most users the time to zero the bss while using instruction tracing in the Arm FVP models (simulators) is noticeable. Reduce this time by using a store-pair instruction to double the size of memory we zero on each iteration of the loop. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42733 --- sys/arm64/arm64/locore.S | 2 +- sys/conf/ldscript.arm64 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index b71e02538716..ae1a005fd68f 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -111,7 +111,7 @@ virtdone: ldr x15, .Lbss ldr x14, .Lend 1: - str xzr, [x15], #8 + stp xzr, xzr, [x15], #16 cmp x15, x14 b.lo 1b diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index ea52a3128527..32af035105d0 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -121,6 +121,7 @@ SECTIONS .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); + . = ALIGN(16); __bss_start = .; .sbss : { *(.sbss) *(.scommon) } .bss : @@ -128,7 +129,7 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) - . = ALIGN(8); + . = ALIGN(16); __bss_end = .; /* A section for the initial page table, it doesn't need to be in the kernel file, however unlike normal .bss entries should not be zeroed From nobody Wed Aug 21 10:19:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpj4T1q6Kz5TcsK; Wed, 21 Aug 2024 10:19: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 4Wpj4S6g9Jz4kds; Wed, 21 Aug 2024 10: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=1724235576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WxzOzXXr3qEppm2ISYt/jmXm1R6SC9rP/M84u04erOw=; b=B1Ts6QjhpFh4+rTAQEl1toYWT79p1CwSFqubMaB8jWMt7x/P4yIbZPiE0m8oYQ+UcYXiy3 M6DatnLuUWkHWR38a5RWnP4nb8GxLV+mYOS3QpL8PlRTbqYG9IEwbNi5smvKTD0FqTIA1K CjzpFLlFQdfxh/nFJtvESwcByLio6siBJ926iyw/kLOw8jQ1BeWR+IHwta1NcwmrVArUyS vwjYGfhoeo5XvvKdCHcIrx18JN6a/7PvFvUP3HeYeyf+CfvJD1RtYBGei4zEmghqoYYUqk FY2XvVxjkntnVqbYNrOmVDDwf6JTBE9qSB2u59yk1MJr5rdXVhTQ1lFgtCZHeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724235576; a=rsa-sha256; cv=none; b=LzRUiBpv7MnbdnxMMN+mKJzOE2At/uL45T0C3MWpK8mLm2LRlapriBoQjAxt1ZCnZIfMaq 1RuukuC37RTt318wR9+BOUrgb4zDPQcezmt6NiQt8IDyrGjhRq2GH0f6ztFI5jJ3/rkaYg ZRalLwvwGJFpdDMIXrP6ChYNktJ4qCi4yd2DsX9bNbb+1aEy+CikeBqSVQgM4EySSZFM8W 08to7gI/ZhZRIiAPfjPj5zq99gpED/nncjv13snzbftIQoVlDI7ivRDDbA4vc+Z/Hx3S9C 71PPO5rao46Mv/EnVnw+W/5MRE12LvxSDok4NuiAFIJqp5nih96ni/ddOjFO9A== 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=1724235576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WxzOzXXr3qEppm2ISYt/jmXm1R6SC9rP/M84u04erOw=; b=PBeyqefziP4zVhyGoJ40LguxebOsyTGwphv/G0g2D82whe2uSX0KISr3RTJK9rVXuqvGdc ohRncnOpr+UGxBtF7atjp6oPrh6bb0KhUuNN3KvebY3SWdwU16WDm2jwQI/nsyoGNcp2n/ CQrPoe85MDxa8/5PQ6I9l+CnptCfQcqie5l2rxZmlSaeos4FSZh/hhmJqRffz6T32ljRD0 K+ii6uLnOMWmEu5h3LLSyGdS05Ktoxr3SR5z5QomWCUcOgeFU8/ILKK+xSIVs14MlmkfKP VJluKP98keeaTA5GO5V6Pme9ehDBcNLM6/c6aSPoQKqt/NlJFWUbSIWSdtmVcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpj4S64Brzflm; Wed, 21 Aug 2024 10: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 47LAJa50044301; Wed, 21 Aug 2024 10: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 47LAJauN044298; Wed, 21 Aug 2024 10:19:36 GMT (envelope-from git) Date: Wed, 21 Aug 2024 10:19:36 GMT Message-Id: <202408211019.47LAJauN044298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 024248c933c5 - main - libc/aarch64: Remove an unneeded weak symbol List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 024248c933c5741a21c17eda63092f330dd98337 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=024248c933c5741a21c17eda63092f330dd98337 commit 024248c933c5741a21c17eda63092f330dd98337 Author: Andrew Turner AuthorDate: 2024-01-02 16:32:08 +0000 Commit: Andrew Turner CommitDate: 2024-08-21 10:16:10 +0000 libc/aarch64: Remove an unneeded weak symbol The index symbol doesn't belong in memcpy.S as it is already in strchr.S where it belongs. Sponsored by: Arm Ltd --- lib/libc/aarch64/string/memcpy.S | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/libc/aarch64/string/memcpy.S b/lib/libc/aarch64/string/memcpy.S index ac4fbe8d6175..f403dd2e42a8 100644 --- a/lib/libc/aarch64/string/memcpy.S +++ b/lib/libc/aarch64/string/memcpy.S @@ -1,6 +1,3 @@ #define __memcpy_aarch64 memcpy #define __memmove_aarch64 memmove #include "aarch64/memcpy.S" - -.weak index -.equ index, strchr From nobody Wed Aug 21 10:32:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpjLw2kclz5TdlH; Wed, 21 Aug 2024 10:32: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 4WpjLw20S2z4npc; Wed, 21 Aug 2024 10:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724236328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOGeJfKy9Jfs90TZ9gqCuMfXSoLOImAHiBH+bEepYIA=; b=RMfT2ULdyRTVQNC/wOES0TywXMzBeYEKbA1rosDdly3ZgacD3bsvUDhf0b281LiaaYve/C h/xa2F2EF1J6WkWODEd/OVAJRnXbYK4IvpY3spd+bssYvkEYALmxSAMiLkDV3wMO2BIcDK jIwPqGvdjlhx65c++zbZrZ6aqTeA9kKMGSdAj7tMbA/qkpuk73WnhSCu0ayZ6gxtQ1Hiqv RD6Rt9OcrxUFTEpzag9Q1yx5xbxnSJ4246Fq+gLGbcvD/vhYPD0cgtk1fZ8XJcOSuUkYwk J+BXfNriMcvesfGkODNloluZeDHyvQtXVqHGIDR1HVRX4BQkfqRDyKXIe4BWzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724236328; a=rsa-sha256; cv=none; b=YPr79kDSgXwyXDklP+1Dd5bYJ/NIJhFkDkBe/wDE1Ol+TtQjSr1jen5Y82OAVfe6kWTVfn dhttoU9/KCJVGf0khcrsNu8+dvMoG8fkYm/hiBWDyqVpVvE3C6q+zNw7b3u5Wl/Qr0VmFl WyAgXI1Mqv29lJnDxsf99zr7bNZuDbeF3YCHqc8xW9pZ1YJ0NSZ9g+4Z92lwZ8NVCgj9EJ 2JjTRLlveB5zsIb3CAb/0DINAWdu9XF0sDnIVjJByKvdeRWFsHRvVgWgS2U7gvczK2gNxO 2+s2wdH4ieBzw/Mkwi7wmF0xah4DtgrMdifLan6n5/ijicYWZtTZ0zEK1XUu5w== 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=1724236328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOGeJfKy9Jfs90TZ9gqCuMfXSoLOImAHiBH+bEepYIA=; b=uQ8sO5LqxDB10428EOUv8FEWx627omOpZA90h8kSNV9srwzOummuqrzoquoyqC07mtJBCQ CUdu5mr+8pKSdsg5++3hBsIIy+L62pGdScn7j3F7dpgIs7UErXLy9sKFkxGqDJRPwXTUAW vr9YQxRD3z3ebZgwtU2moNJ55nwJR124E/khPo0qb3JTAd90zKd5noL+Sm82ejtBVhzWEh QJ+kL3Ol8mQDFVlDDafRqQJHf3vujyIar1M6daSHMBhNbacu1Nw5tbFYRC0OFZDhM8nnkN x5aiKWUMZnARbeJ4mK5vJMo8hsXoiXYZ7SH2CJjvXuEhcSdKuc0nIA8HYm35qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpjLw1RG7zgX6; Wed, 21 Aug 2024 10:32: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 47LAW85p077144; Wed, 21 Aug 2024 10:32:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LAW8Yg077141; Wed, 21 Aug 2024 10:32:08 GMT (envelope-from git) Date: Wed, 21 Aug 2024 10:32:08 GMT Message-Id: <202408211032.47LAW8Yg077141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 828445cc5e18 - main - if_vlan: set if_cap{abilities2,enable2} after IFCAP_IPSEC_OFFLOAD is recalculated List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 828445cc5e18b678ff032325a8dadc59b9bfbea6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=828445cc5e18b678ff032325a8dadc59b9bfbea6 commit 828445cc5e18b678ff032325a8dadc59b9bfbea6 Author: Konstantin Belousov AuthorDate: 2024-08-20 22:20:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 10:31:41 +0000 if_vlan: set if_cap{abilities2,enable2} after IFCAP_IPSEC_OFFLOAD is recalculated This makes the vlan IPSEC offload really functional. Noted by: Ariel Ehrenberg Sponsored by: NVidia networking --- sys/net/if_vlan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 45489138fdef..a30db9173383 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -2210,8 +2210,6 @@ vlan_capabilities(struct ifvlan *ifv) ifp->if_capabilities = cap; ifp->if_capenable = ena; - ifp->if_capabilities2 = cap2; - ifp->if_capenable2 = ena2; ifp->if_hwassist = hwa; #ifdef IPSEC_OFFLOAD @@ -2219,6 +2217,9 @@ vlan_capabilities(struct ifvlan *ifv) ena2 |= mena2 & IFCAP2_BIT(IFCAP2_IPSEC_OFFLOAD); ifp->if_ipsec_accel_m = &vlan_if_ipsec_accel_methods; #endif + + ifp->if_capabilities2 = cap2; + ifp->if_capenable2 = ena2; } static void From nobody Wed Aug 21 12:11:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WplZ04WmNz5TmmX; Wed, 21 Aug 2024 12:11: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 4WplZ0435mz41WD; Wed, 21 Aug 2024 12:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724242312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SsiO5/hMGY8blXHgkQjkq2XRfW3U//e+7+8TWAtSg60=; b=deV0eFkhSpVfhpHSGYFb8+rrn79NTk5alXwcSGddIjfkORnqmGwEg7KNpmy4v5q7hrufsX O/qaWxqsg0khRHhpmWqzuDBwJA8AX2hEG6Qz9MVhacdlfnF7fFOOMCeiH4Q/NskijwoCeg ggXQe+//huCZ80oE+NSd0tRwUZWDwJUDQ3kKRkkLZ/3EmQ1LkD9xIHzjyWvC2zRUBbmBM6 8TRTp6tRQEVoAb+/f3NjUmVH7DP8dWyA97DqoCYL+t1AH7EuasUYAYCF5+BPoxtce59R34 h8DCf8R6uCR1MTQF5wdZ688+67xc5ThP5kPEfLtXfiML/6gE/+fhrU09e8wmBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724242312; a=rsa-sha256; cv=none; b=SFa3EwlrHEono3qHfnYiNxi2iGnQaHJ+8PWD6KV4c24csQmewYjRrJFMovP39Z7qvJ3gqB KwGqIIq/brJLGxMrCJ7iTEYs6jfLEgkZ8TFS3ykiuxsiWOpNi9JFVKxCTWH2EyisALkGN5 RcpNNSCjtdkk5v6bOqpW8q9C6E09ji2u/NruXA/Zx/0jhBs42GGXil4bYse2zQ/z5KrNk5 5R4tOH3t3yD8CntPyrtynFlaNQ4Hu/J95pwW/Tgt+9bzmfn3tYA7kaD5KhTIyLvnoKAR+g FRvAKVerOyxJo6sR1kdrZeZGmiX1HpVJ/hUv3xNzV14sIbMmVXLizuQhu0/Tcg== 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=1724242312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SsiO5/hMGY8blXHgkQjkq2XRfW3U//e+7+8TWAtSg60=; b=e6Sa6TaoJPJ5j3w43P3gI89MDlLpTieH7vfL52MmDXxdhIwCoo1qQhtg1G5cGiYVJm2WKT AFPSRHJmA5NBWt3HzT4/AZAH9cp7yWCs8qKmTm1YtcuAlUsofU3beQPPAyNV/qgNUcj0Ch db3PLEt83o4JTV7PKIy+kV0uLi+vMiKhuX/VaqC5OqFAASojQpewh5ghr5PwreGZ2qimu9 7/XSdYPRwKHxH6uqaOzMovMkqWXv4n+6tlh5a4TQ6vSCOSii2thjar+aViNkxPTK75IlBs sI+oQ0gz0i3wlPBJ0w0JyLgHVXV2+A1D1d1UV9SMpaVIAWRVVMW36LFL/tNAKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WplZ03fZgzkNr; Wed, 21 Aug 2024 12:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LCBqdl045732; Wed, 21 Aug 2024 12:11:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LCBqvY045729; Wed, 21 Aug 2024 12:11:52 GMT (envelope-from git) Date: Wed, 21 Aug 2024 12:11:52 GMT Message-Id: <202408211211.47LCBqvY045729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e7f9171b6738 - main - pf: Handle m_len < sizeof(struct ether_header) case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7f9171b6738809ded7250bc5c78368421255b1b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e7f9171b6738809ded7250bc5c78368421255b1b commit e7f9171b6738809ded7250bc5c78368421255b1b Author: Igor Ostapenko AuthorDate: 2024-08-21 10:01:34 +0000 Commit: Kristof Provost CommitDate: 2024-08-21 12:10:03 +0000 pf: Handle m_len < sizeof(struct ether_header) case Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46391 --- sys/netpfil/pf/pf.c | 7 +++++ tests/sys/netpfil/pf/mbuf.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ad2dc2e707ed..cb69d06b1fe6 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4365,6 +4365,13 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0) r = TAILQ_FIRST(rules); rm = NULL; + if (__predict_false(m->m_len < sizeof(struct ether_header)) && + (m = *m0 = m_pullup(*m0, sizeof(struct ether_header))) == NULL) { + DPFPRINTF(PF_DEBUG_URGENT, + ("pf_test_eth_rule: m_len < sizeof(struct ether_header)" + ", pullup failed\n")); + return (PF_DROP); + } e = mtod(m, struct ether_header *); proto = ntohs(e->ether_type); diff --git a/tests/sys/netpfil/pf/mbuf.sh b/tests/sys/netpfil/pf/mbuf.sh index 2dffa48ed2f5..a4664718093a 100644 --- a/tests/sys/netpfil/pf/mbuf.sh +++ b/tests/sys/netpfil/pf/mbuf.sh @@ -151,8 +151,81 @@ inet6_in_mbuf_len_cleanup() pft_cleanup } +atf_test_case "ethernet_in_mbuf_len" "cleanup" +ethernet_in_mbuf_len_head() +{ + atf_set descr 'Test that pf can handle inbound with the first mbuf with m_len < sizeof(struct ether_header)' + atf_set require.user root +} +ethernet_in_mbuf_len_body() +{ + pft_init + dummymbuf_init + + epair=$(vnet_mkepair) + epair_a_mac=$(ifconfig ${epair}a ether | awk '/ether/ { print $2; }') + ifconfig ${epair}a 192.0.2.1/24 up + + # Set up a simple jail with one interface + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + epair_b_mac=$(jexec alcatraz ifconfig ${epair}b ether | awk '/ether/ { print $2; }') + + # Sanity check + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + + # Should be denied + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "ether block" \ + "pass" + atf_check -s not-exit:0 -o ignore ping -c1 -t1 192.0.2.2 + + # Should be allowed by from/to addresses + echo $epair_a_mac + echo $epair_b_mac + pft_set_rules alcatraz \ + "ether block" \ + "ether pass in from ${epair_a_mac} to ${epair_b_mac}" \ + "ether pass out from ${epair_b_mac} to ${epair_a_mac}" \ + "pass" + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + + # Should still work for m_len=0 + jexec alcatraz pfilctl link -i dummymbuf:ethernet ethernet + jexec alcatraz sysctl net.dummymbuf.rules="ethernet in ${epair}b pull-head 0;" + atf_check_equal "0" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=1 + jexec alcatraz sysctl net.dummymbuf.rules="ethernet in ${epair}b pull-head 1;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=11 + # for the simplest L2 Ethernet frame it should impact src field + jexec alcatraz sysctl net.dummymbuf.rules="ethernet in ${epair}b pull-head 11;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" + + # m_len=13 + # provided L2 Ethernet simplest header is 14 bytes long, it should impact ethertype field + jexec alcatraz sysctl net.dummymbuf.rules="ethernet in ${epair}b pull-head 13;" + jexec alcatraz sysctl net.dummymbuf.hits=0 + atf_check -s exit:0 -o ignore ping -c1 192.0.2.2 + atf_check_equal "1" "$(jexec alcatraz sysctl -n net.dummymbuf.hits)" +} +ethernet_in_mbuf_len_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "inet_in_mbuf_len" atf_add_test_case "inet6_in_mbuf_len" + atf_add_test_case "ethernet_in_mbuf_len" } From nobody Wed Aug 21 12:35:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpm5K420Jz5TpBs; Wed, 21 Aug 2024 12:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpm5K3Mcdz43fy; Wed, 21 Aug 2024 12:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724243733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=utHkc/pAA8C4vyL1MK+WU+Oj6B0g/7tUgWoDqhOijZA=; b=KU6ITXG5L4gHdEzAMWDyNe2zlH2W+ykYsyJUT8XA6L4WTJAN/fsTLsjK9fAkmmYsfHTLbC HlvbZsbaqOseKavTEN0XpTKAShYeiUBMPIZaSJUiXdM0dGQQ00uc4G4HsEcGBUpGXZ4c9v EbtyyfGwXy/q0MzA7F7DQoj+Pz9BkaC4bPypKpuXExvqm5UQfDa5VQ0+GoH6qryMVJnaRR plBr5wF7FUQqap3zit+JoQn/PqR77ziBr2Q1iGy6amQIDqEKyNJtg0UosjpHuYYPZJnRJw bA9UO2loNIDipLiIivLoYQ78+HYAeVL9Z+7SInKluBPSDb0iaSbUsg+OnhvMMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724243733; a=rsa-sha256; cv=none; b=hMIzy2SigsaL1ZWpe54iQMBqIJ7tk0MwDYVR9pQTx2BPyeES2uNiGaIdpRETaafW1S4Ck3 2YNgb7sawF3AjudBR1IGiJkokRKgdiKirbMthcqJG/qGMeqaaA+cq0ytxOtjmM/PH5/VdZ 9Unc/4H+4CWYlICSg9SvJQR8qvQED+etVuhiETMJSXczuPpm/wDE3ZocMDympbrsaoUJTx 9JkNmvFjFNe8xqblrfOqeoIBg5fwETOg/ADDnK9Th5jYqFQ2rCneePd7wSYDf6v+DcX3sN fJJzSkMw91VI+auiMchyNCz+8s2E4QeJ69JW5XkNhYWTShX67BkJdWuggcADRA== 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=1724243733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=utHkc/pAA8C4vyL1MK+WU+Oj6B0g/7tUgWoDqhOijZA=; b=ZT1Xc/cdSiqG5DZ/pdEN0V1bHIcw8/q8s9K5pmhA9ABh97pZdesEh3MeWTxrys3Lz6TFa3 hEvSMQ5n/7ZvcDlHvozn37HONxPrXw1H7X3Rd86tHNVkuZu1sZosJI+aLBd4zBdnCiyld/ SXREfskL1p8ssI+r4aaZQmiZFVYyWIDyQBGQWpUOx6MeD4FyuTCYmzNiNfWrrFD96hYueF +e2CAHBy4kkT2Vje+yZrSTNXxxuMmEuF42LMcPi3GzWZVvSCK/ydmKCvUFBalItbMGwqjP 7DLktu6Cj0D0hRPtEeDzsRC9hBnQIeoR3jMNtTNoBShgNYPdYLqZ0mhDhlivcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpm5K2yg2zl1G; Wed, 21 Aug 2024 12:35: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 47LCZXmH081247; Wed, 21 Aug 2024 12:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LCZXBS081244; Wed, 21 Aug 2024 12:35:33 GMT (envelope-from git) Date: Wed, 21 Aug 2024 12:35:33 GMT Message-Id: <202408211235.47LCZXBS081244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pietro Cerutti Subject: git: 1af7d5f38953 - main - libfetch: don't include fragments in HTTP requests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gahr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1af7d5f389536a2f391153513d95d92ffdf360e4 Auto-Submitted: auto-generated The branch main has been updated by gahr: URL: https://cgit.FreeBSD.org/src/commit/?id=1af7d5f389536a2f391153513d95d92ffdf360e4 commit 1af7d5f389536a2f391153513d95d92ffdf360e4 Author: Pietro Cerutti AuthorDate: 2024-08-21 12:35:27 +0000 Commit: Pietro Cerutti CommitDate: 2024-08-21 12:35:27 +0000 libfetch: don't include fragments in HTTP requests Summary: Fragments are reserved for client-side processing, see https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1 Also, some servers don't like to receive HTTP requests with fragments. ``` $ fetch 'https://dropbox.com/a/b' fetch: https://dropbox.com/a/b: Not Found $ fetch 'https://dropbox.com/a/b#' fetch: https://dropbox.com/a/b#: Bad Request ``` This is a real-world scenario, where some download link from dropbox (eventually) redirects to an URL with a fragment: ``` $ fetch -v 'https://www.dropbox.com/sh//?dl=1' 2>&1 | grep requesting requesting https://www.dropbox.com/sh//?dl=1 requesting https://www.dropbox.com/scl/fo//?rlkey=&dl=1 requesting https://.dl.dropboxusercontent.com/zip_download_get/# ``` See how the last redirect ends with a `#`. Currently, libfetch includes the ending fragment and makes it impossible to download the file. Differential Revision: https://reviews.freebsd.org/D46318 MFC after: 2 weeks --- lib/libfetch/fetch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 12cbd0fb746f..97fc04bb09a6 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -447,7 +447,10 @@ nohost: goto ouch; } u->doc = doc; - while (*p != '\0') { + /* fragments are reserved for client-side processing, see + * https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1 + */ + while (*p != '\0' && *p != '#') { if (!isspace((unsigned char)*p)) { *doc++ = *p++; } else { From nobody Wed Aug 21 13:32:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpnMW5Y24z5Tthf; Wed, 21 Aug 2024 13:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpnMW4r7Bz4941; Wed, 21 Aug 2024 13:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724247175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9y5Dw1dmN4f+aQc7Jd2WU9KTnSPyqnCHm33LDxC0Fs=; b=wLhqiuqfKBi+XdoTfV/jzOi02bzdSNJT0Il51wVpNiJLOBctyjH+ihziFv2NwF0SJ/deOS kjmttyR7GBBD2FhQIlr5TJWVcvWV5YrsnYc1hgL8rd5IgIJ0B6HUHOf+G3POW0WGTmvUU4 JObBzWfuqwxAk2Nm9kCQ9n5a3kd+I0t8snqZLBQQYK9JLIV8vKnjAvN18AdXMpjoHazhBK RVZO6M8mi5LNyPgIWmIRviHoLX1vqCUvSJTSqKOHgy78lRHQd31CkFt/Mp/+8yxX+ajn2a YuZuWHz5sLGO+sNhaowoWad8OXKXJN0fwFy+e5vc2ro3420/tuoDcbbTjsZ44Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724247175; a=rsa-sha256; cv=none; b=C+g2VSWgLtE1MSq5CzM2uJ/7TvrnXpKgWklhHyMieW8IRkQ0BWTBj/QcnyxTqWqLJ9OOkj wdqqMKrxzRVYgf+ntuC3zS3oXM9Mw80tOkuOEfn8p4J1O5t2p1+irTWCtFeH5FxuuC0gN9 iTJhpupMD/X+lHkfv+j5JDK4FmUS5OKFWH0P2F0fe7mA3ZNHDo3SVOUsmF0XgEzeZAabF0 N/SNzX1J+Ci5RDUcXVCT/Sf2ozdXDpbk6mPcAqVf0g3J0ky4TzKYCGKEtvcqwD7C8E7pD9 0bytQ0/2bnDm4ckUroO7oLJvF3VlKiDXD6hTRtHFbY5J2rY9Yb5Su409a7v6tQ== 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=1724247175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9y5Dw1dmN4f+aQc7Jd2WU9KTnSPyqnCHm33LDxC0Fs=; b=jdwbL5n+7ZYTGfkEHk1fQbnNqVPG5yt8r24VJAYkMcUbccGiyRknGm3qZgYo8CQ8tEMwVc lUkmL9X0byRmyo1vCyDBPHyJ2z0qTifL0DoW/dC+fQ1t13rsEcoDcG47Wa35YwItF+P45I EW+SqYk6HLF+rG+sa4LKriKOgd6N6jWKIOncUiyByJbLjAf5+vMMXRugJeQzT6P6IJ3JDY lTIVfR6uJO5jWosd06j30FRRDFnrEKwaOEaNR3zpE00I72y8jxlMvRMBxSXNFK/+HtolMM zkPxIw3BQKxxGsq4FLAKr0RVJtiIs4LrfdQPldcdG7gSkJ+o8GYJnQD5g0OT1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpnMW4RSNzmRP; Wed, 21 Aug 2024 13:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LDWtvE082802; Wed, 21 Aug 2024 13:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LDWtf3082799; Wed, 21 Aug 2024 13:32:55 GMT (envelope-from git) Date: Wed, 21 Aug 2024 13:32:55 GMT Message-Id: <202408211332.47LDWtf3082799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: db87c98168b1 - main - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db87c98168b1605f067d283fa36a710369c3849d Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=db87c98168b1605f067d283fa36a710369c3849d commit db87c98168b1605f067d283fa36a710369c3849d Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-21 13:32:41 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index fac65e155890..845cffe77a5d 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9304,14 +9304,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Wed Aug 21 14:28:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WppcD4KN3z5TyTB; Wed, 21 Aug 2024 14:29:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WppcD3Xfzz4FqC; Wed, 21 Aug 2024 14:29:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724250540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ITIFV+yT8dO6AYckCucNsz7zLcFCnbP1W+YfJnP5KR0=; b=bjAoFe3hUTfXYiJQpRySQ5cjKtrjMxuHDpbOEAZBgLfYlLcHYao5fV7w5ngiOIbvnUfhQQ QCgRSm4Hjr9WOAQY0tx22xz9DKkJNfu36z05zGPvZn/GyaDu1Ryr6UPyjxPuNMTWRSSqPt 0SyfU5FdKLgqH8HNgeZKJb+FexI7I9+fdUzMnDuV02OAEdg1cTn/EU7zN3z4BN7dF7SFXk TYkAQbSAQor29W79Pc42u+Ul27arnNbn+2cBcbKs5+00pIC7bBnDXFI8eLGmj/qANhGvdp mU9y2EKFp7qFy1xgEgYY5MDB5I1VHFfRVGel155m6jufbcAf/wEL6N+5UAn+vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724250540; a=rsa-sha256; cv=none; b=gAfJJ8c72eJHQqcebzkkNTyk+jZfN6+FSWS9oOtXCCo28IM5SLqBHW8ESOI+ojbnJcdkmf Ha6dtRd0iX7/I1ZTKi3EeRylir6FZuCOBfd9MkpXjBA749lCh96E2WPWWJIpW22t/oh6G1 P090T45zS4aEgY0MjXEACvSNZST8CzFBGYWlENOvJME9Fr3XYKm62uzT6tWBVhZ8nQhF5J 6DuEaAhXLiVfRR3gnOKRTkyz78tbxgN+2dY+EVH+panEe41hJlGxP0JXGYk3pUBlaHM8al +tKFRc/gZF8tZ7/dRbE7h4WhMKKpLROf8OafYhPlT/R2WjgcDiWikmCvQQ0YwA== 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=1724250540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ITIFV+yT8dO6AYckCucNsz7zLcFCnbP1W+YfJnP5KR0=; b=C95JwIM1cxiQuQ7pw/FnqZ+/trF/JqR+Jnyoa0O5cFAfVq9vlZyq9n8Lb9B+8EXFRThj91 SDswOmcqSXYeMhY6ed2Wk3+z4/xmNeD1eOkJ9l7mBw9gouoHB+yjwh8WOPIxUyrK5q/6/g Mms85dumzJ3MlEf0AsMOgubCxGfL9dul1wHT1FRGhq6rJBWB3CYu/BaO9N4+Df+OsrjVom 7DU2sT5XT5rAPZK7CcwF8kR6x+m4v1x4Xyh8+tPnOTbNfPtR8WUOWy3hnoSVlXb2sgtjS4 i/XWYUAXuzo/333IKQolNMeflUCgngKumHhnHhB7tCjbEB6jDwOcLGzRyWFBKQ== Received: from [IPV6:2601:5c0:4200:b830:b87a:940e:7b39:6d8e] (unknown [IPv6:2601:5c0:4200:b830:b87a:940e:7b39:6d8e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WppcD1l4pzWTs; Wed, 21 Aug 2024 14:29:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <77cbcd47-1778-4e71-b824-4e75e0e4b2d6@FreeBSD.org> Date: Wed, 21 Aug 2024 10:28:59 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 43e8849bc294 - main - conf: Enable BTI checking in the arm64 kernel Content-Language: en-US To: Andrew Turner , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/20/24 05:02, Andrew Turner wrote: > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=43e8849bc29414036ccaef7788de95a07ad32ab5 > > commit 43e8849bc29414036ccaef7788de95a07ad32ab5 > Author: Andrew Turner > AuthorDate: 2024-08-19 12:59:49 +0000 > Commit: Andrew Turner > CommitDate: 2024-08-20 08:49:15 +0000 > > conf: Enable BTI checking in the arm64 kernel > > To ensure new code has BTI support make it an error to not have the > BTI ELF note when linking the kernel and kernel modules. > > Reviewed by: kib, emaste > Sponsored by: Arm Ltd > Differential Revision: https://reviews.freebsd.org/D45469 This has broken two of the GitHub CI actions using clang 12 and clang 13. Please fix this to be conditional on a supported linker version (or perhaps add a new linker feature to bsd.linker.mk). -- John Baldwin From nobody Wed Aug 21 15:21:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn00xfWz5V2p8; Wed, 21 Aug 2024 15:21: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 4Wpqn00P7jz4PBb; Wed, 21 Aug 2024 15:21:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWu/SJ+RDnuvYdLA/D1uYDLeNyhMhFR3G66iUEa7PyE=; b=kpQAGA1rvdL5iQNyj1CKW+hCifC4Kf1UYqvxxjy7QwrmTmcLKYq12wREOXDW/DEOHErQLN ZLgOSRm8wWnWQJui8vNWo/+dzdkLiTVAJhGvK6v5EFNd9bsiMxbaigNtsHH/FoqDOR0l2c zMSj0eXjf2FdfNWZLs6MXc583nli7FmBoUoEmGWG6E3nbM47HLadtmzzw3IX/UAFf9Hnud A1inYfnIBozKSRxddx2LASJvM8pkFEiRTD8l0uHaNNoxfSiTJnFKyw7iiE6AvAoTJriDdn ecweb1uZOi8qgY21iS8To6uQ3LNBp2GqERNR2NVe4cDoAnMNRNjzN7ehtGNxqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253700; a=rsa-sha256; cv=none; b=ZlMfQX1b/NPAjosuT6ZZK128rS0Jz1cbuVNpNQ6fsHqb6n9NeQJUFfWKxnp5e4UzKq00ev TqVSESb8kIeI6HorKWofyoyRo+tNNfGx/JvpdqJG6w/kS0BxEZ2hIA+0Qy+xP3GY624nlx 56ZeMWuKFKi6pVGkNRkW1Zqk8MYxsWUW4Cz/p6yBEqrzpI8Kfmdb6wCL549SFDqndoQnXv 6aHjjd2YMElL3C6uEzYnQrxACNwL5mkOv43agKaCRNwRbsT/XpXE+skW/whE6pufSWHoxA zsrw9ChJRmx6lxZQKFp19jG7DstpKe0JBxzfV5QdWeLpWpMjmEnVsjy914mBKw== 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=1724253700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWu/SJ+RDnuvYdLA/D1uYDLeNyhMhFR3G66iUEa7PyE=; b=AJ2Yg4rLck1xgCBNE6vPXOHd2VwPDX7DGrKCOk7gQ+GtdNM7h6njJQTKwCdSdIF1UG0S2Y z7PWaLjS2elkqbv4//PurYWH+Crng+mdC5ATwH3riW76TuxwnhjU6FG0psvkQBKzlCMV5t icIJ0StfenkpCJZmsKxlMnG5SU9kbfgQowK1QkaWgEvxGmslS8KnM+sZMegMF0og7Mxyrl xwoHgu7DyxU6vLucCu9g6xVMRu5O/YH7TGgmdgh+0oMkwFzi9DxEd5fKbvv77Mmr9DH6yx IKBSD3ztfSXbhNWGPSVY303ooQ9rSMwlhFpG+8AFX0mW5yZK3RRPY/J8cwG7Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn000x3zplg; Wed, 21 Aug 2024 15:21: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 47LFLd38067078; Wed, 21 Aug 2024 15:21:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLdDB067075; Wed, 21 Aug 2024 15:21:39 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:39 GMT Message-Id: <202408211521.47LFLdDB067075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a3f10d0882e1 - main - rangelocks: add rangelock_free_free() helper to free free list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3f10d0882e1aebef27698f1e0f94ffadade5935 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a3f10d0882e1aebef27698f1e0f94ffadade5935 commit a3f10d0882e1aebef27698f1e0f94ffadade5935 Author: Konstantin Belousov AuthorDate: 2024-08-12 03:48:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:18:16 +0000 rangelocks: add rangelock_free_free() helper to free free list Tested by: markj, pho Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 20b65778c06d..c2f1f2d762bb 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -288,6 +288,8 @@ struct rl_q_entry { static uma_zone_t rl_entry_zone; static smr_t rl_smr; +static void rangelock_free_free(struct rl_q_entry *free); + static void rangelock_sys_init(void) { @@ -392,6 +394,26 @@ rl_e_is_rlock(const struct rl_q_entry *e) return ((e->rl_q_flags & RL_LOCK_TYPE_MASK) == RL_LOCK_READ); } +static void +rangelock_free_free(struct rl_q_entry *free) +{ + struct rl_q_entry *x, *xp; + struct thread *td; + + td = curthread; + for (x = free; x != NULL; x = xp) { + MPASS(!rl_e_is_marked(x)); + xp = x->rl_q_free; + MPASS(!rl_e_is_marked(xp)); + if (td->td_rlqe == NULL) { + smr_synchronize(rl_smr); + td->td_rlqe = x; + } else { + uma_zfree_smr(rl_entry_zone, x); + } + } +} + static void rangelock_unlock_int(struct rangelock *lock, struct rl_q_entry *e) { @@ -623,14 +645,12 @@ static struct rl_q_entry * rangelock_lock_int(struct rangelock *lock, bool trylock, vm_ooffset_t start, vm_ooffset_t end, int locktype) { - struct rl_q_entry *e, *free, *x, *xp; - struct thread *td; + struct rl_q_entry *e, *free; void *cookie; enum RL_INSERT_RES res; if (rangelock_cheat_lock(lock, locktype, trylock, &cookie)) return (cookie); - td = curthread; for (res = RL_LOCK_RETRY; res == RL_LOCK_RETRY;) { free = NULL; e = rlqentry_alloc(start, end, locktype); @@ -643,17 +663,7 @@ rangelock_lock_int(struct rangelock *lock, bool trylock, vm_ooffset_t start, free = e; e = NULL; } - for (x = free; x != NULL; x = xp) { - MPASS(!rl_e_is_marked(x)); - xp = x->rl_q_free; - MPASS(!rl_e_is_marked(xp)); - if (td->td_rlqe == NULL) { - smr_synchronize(rl_smr); - td->td_rlqe = x; - } else { - uma_zfree_smr(rl_entry_zone, x); - } - } + rangelock_free_free(free); } return (e); } From nobody Wed Aug 21 15:21:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn11gztz5V2tl; Wed, 21 Aug 2024 15:21: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 4Wpqn116s2z4P47; Wed, 21 Aug 2024 15:21:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vJMqpqIK2LIotT86yvX1Nl8ux1i7iK6UXV5HAJb26dM=; b=VOoP1d0n1OnYkNoho9GfkVv7NIaFfIlW2xkov6oOK+YUMRjThxeaXR+rT6biO/CuRHP4zX d+88r83TCfccy2qUQ/b1qQq+S/eQH85Gpcb652na3xL56/KIBQDYSDT59sZCzdBPnyWTsN AB2+jE2hwKvELhpRqRAB3ndJ4UwkDSNpf8gqEGqoxK1T0yhfUSSZkN4Ep0DsDQsab/8y1z xfmcSuSWRAfTVeF8i7lEjzXH3N7XFUxxV/y6CCGfFT9jJ8eqDdSY3gjA+eHDHabw1BtbMA jM8Bmtw66wXx1KSSxdCjN3vF2RV53/9syNyC33IFRzmUUskp4ohTyEnKTJV4zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253701; a=rsa-sha256; cv=none; b=U28oYfEtXeXeR8xtPr4/yCKfcbZKspC3s8aHMdkkRh4q0lUiEtW8jjjc/DBTnKypOztwTB dQF1joL+zzaxZjgJRPHs/tTRsjeQwbhBx5VHT4wozDbLli16jtuQFuEc8QRpgJia23kHn7 tMSFEQAdQayJwxKpzNHj+fYSNyvV7k3otMO3XtbfUNwQIbdfsCkuNZlhgrzbJSaFxs/nkT yEGsby3KX22oP1Vx7wHJDrmPHguJQVdA3EwU8LWV5iiEkCLUuhxz97Y8YYy0OAqUgznGyz Vcg2XTGgYV6bx0Ype8bE9Anbwcw/G0vdDfr8Beacm68yTSpPfCLIatkJXoL0nw== 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=1724253701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vJMqpqIK2LIotT86yvX1Nl8ux1i7iK6UXV5HAJb26dM=; b=AUqt0B7IN9RaW4ApstDxeRqM9jVICqx76enqHyWLLQIccx0i54r/2PZWqnuEgsemlYmqV9 RmGoxGCCglYkviPkoF9T8+rnhnaLsIxnsXQWUE1RAPyBubByY95Xc9OakjNvK691O6Vw0X 3m9KZMd7jwgz0DpzELCULVAASyFyGsZX+PPp/WH4hFOM1m3Zd3rpcWvHFEXiVnW5UgtZYW BrG1lBBSdXG2yd3K70esdOU/M1PJyAl8VJKcGyGn82c1Z10wpmDiXQoSDP6P/mijuAY8jh 1sA2nK3DaYIQnpAfZxS/ebcvkmWcZ1fUWeVFgdCHwAW+M763jYHdtbDQmUUGxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn10kShzq6L; Wed, 21 Aug 2024 15:21: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 47LFLfod067139; Wed, 21 Aug 2024 15:21:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLfNY067136; Wed, 21 Aug 2024 15:21:41 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:41 GMT Message-Id: <202408211521.47LFLfNY067136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8a5b2db3d81d - main - ranglelock_destroy(): do not remove lock entries from under live lock acquirer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a5b2db3d81db16e9e6aaea82cc071bdc766e360 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8a5b2db3d81db16e9e6aaea82cc071bdc766e360 commit 8a5b2db3d81db16e9e6aaea82cc071bdc766e360 Author: Konstantin Belousov AuthorDate: 2024-08-09 22:55:36 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:18:39 +0000 ranglelock_destroy(): do not remove lock entries from under live lock acquirer Tested by: markj, pho Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 56 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index c2f1f2d762bb..c01ed05e4a6a 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -289,6 +289,7 @@ static uma_zone_t rl_entry_zone; static smr_t rl_smr; static void rangelock_free_free(struct rl_q_entry *free); +static void rangelock_noncheating_destroy(struct rangelock *lock); static void rangelock_sys_init(void) @@ -340,16 +341,9 @@ rangelock_init(struct rangelock *lock) void rangelock_destroy(struct rangelock *lock) { - struct rl_q_entry *e, *ep; - MPASS(!lock->sleepers); - if (rangelock_cheat_destroy(lock)) - return; - for (e = (struct rl_q_entry *)atomic_load_ptr(&lock->head); - e != NULL; e = rl_e_unmark(ep)) { - ep = atomic_load_ptr(&e->rl_q_next); - uma_zfree_smr(rl_entry_zone, e); - } + if (!rangelock_cheat_destroy(lock)) + rangelock_noncheating_destroy(lock); } static bool @@ -487,6 +481,50 @@ rl_q_cas(struct rl_q_entry **prev, struct rl_q_entry *old, (uintptr_t)new) != 0); } +static void +rangelock_noncheating_destroy(struct rangelock *lock) +{ + struct rl_q_entry *cur, *free, *next, **prev; + + free = NULL; +again: + smr_enter(rl_smr); + prev = (struct rl_q_entry **)&lock->head; + cur = rl_q_load(prev); + MPASS(!rl_e_is_marked(cur)); + + for (;;) { + if (cur == NULL) + break; + if (rl_e_is_marked(cur)) + goto again; + + next = rl_q_load(&cur->rl_q_next); + if (rl_e_is_marked(next)) { + next = rl_e_unmark(next); + if (rl_q_cas(prev, cur, next)) { +#ifdef INVARIANTS + cur->rl_q_owner = NULL; +#endif + cur->rl_q_free = free; + free = cur; + cur = next; + continue; + } + smr_exit(rl_smr); + goto again; + } + + sleepq_lock(&lock->sleepers); + if (!rl_e_is_marked(cur)) { + rl_insert_sleep(lock); + goto again; + } + } + smr_exit(rl_smr); + rangelock_free_free(free); +} + enum RL_INSERT_RES { RL_TRYLOCK_FAILED, RL_LOCK_SUCCESS, From nobody Wed Aug 21 15:21:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn24Vbdz5V2tm; Wed, 21 Aug 2024 15:21: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 4Wpqn22DpGz4P6W; Wed, 21 Aug 2024 15:21:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/gTTc/riN2pmzWjZl6mf6XmrvtdBdiwzOcx8Ajbkq24=; b=np8c189HAFjTunwipM7gi5PENTH7uFTc6m7wAaRuCIbr6ZjuHXFCLCEoQLEzAZXYTcC+qi JnEgclEsTl0PJfX7Z1qnFizF5zdFu60d1+WkKQXOO11aPcpXHFp3saB/W3a8r9QDXTjgXx XtwValBlW0QgSRaC9xbMDPOkvO4b97R1bF0WSCRrfAA3G2gHzNqNc0GLCluePHbZelZGcn xsdewt+BSqftYjeZ/s+De1iXFOQ0WHOOvGF66u2yEaBetJoMueCJdWHGpFzgnldZHkkIfx EaepFM2QLms/xsWwltYwgoZ6malc8pIcfaKLciG+WNCf5UhIDtpz3GtdHywyrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253702; a=rsa-sha256; cv=none; b=TGWQ5Ow+qNrasBf+PZS1ZZL6+sc2WdYPe2EDOvum9Dpc2gKLJ8/eEpHylEJ5pjWKHfExPn izmWog5aUCzXv08FgOnijyO9bcPs++wTJNzA/vSauRxlh9k29nqhiVfIXU7w1kSu47UWNf s6Yio6zhxJZf352r+3O6XjEo6JWQU/pe0r3vcU3yqZn04RwsCkGu03KINyVMFjZWNlgdWC Afuxp2rCRSj8reOFGbXutBsUt/2HGqf2g90WgPefiKgpBCy8eZ2yrPQCrOfKNOlucmKWzI avYRtxyBtrPS7AgUugmPid1p/MYHfC1ioMOjyZx+nfsNrEXPuz3VbeYbz5PANA== 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=1724253702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/gTTc/riN2pmzWjZl6mf6XmrvtdBdiwzOcx8Ajbkq24=; b=w2sGdtl/yX/mQOzRSFS/XRXQvTc4r9XSQ8Zw+FOlf39zFzxEuviRkimeP05jP9tFekcyyW jzB5pZvVRtHd/tOLRFPIc+mBSLHMbivjUXNWW3AbNCQ11uKQNMcjwAVRZfaCOGGrKyvlIi 9t9gzGKl5HPqWOY7aCcZz/0f0dOpdVComhHh1w1WyOjJ0314WF2KSxIDna/pvSksHNv3g0 KjoUUjJTbXdH5E7yL9pUwyf97K53LEpwzFUglGYG5VBeZwbQGNCjyF10CHlNqFf38l+tmM yh+FArM3wzRBFK3vJlTJgVJtmdNrWAgZDnlLvzHyUOjMFX9SInQSK2LTn3HbSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn21rN0zpcY; Wed, 21 Aug 2024 15:21: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 47LFLgbJ067199; Wed, 21 Aug 2024 15:21:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLgW9067196; Wed, 21 Aug 2024 15:21:42 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:42 GMT Message-Id: <202408211521.47LFLgW9067196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e228961d6e3b - main - rangelock_destoy(): poison lock->head to trip fault on lock attempt List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e228961d6e3b4a22a3684dc4f688cc3cd3cdff09 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e228961d6e3b4a22a3684dc4f688cc3cd3cdff09 commit e228961d6e3b4a22a3684dc4f688cc3cd3cdff09 Author: Konstantin Belousov AuthorDate: 2024-08-10 08:12:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:18:56 +0000 rangelock_destoy(): poison lock->head to trip fault on lock attempt Tested by: markj, pho Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index c01ed05e4a6a..992a19701611 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -344,6 +344,7 @@ rangelock_destroy(struct rangelock *lock) MPASS(!lock->sleepers); if (!rangelock_cheat_destroy(lock)) rangelock_noncheating_destroy(lock); + DEBUG_POISON_POINTER(*(void **)&lock->head); } static bool From nobody Wed Aug 21 15:21:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn34xzYz5V34f; Wed, 21 Aug 2024 15:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpqn33Y9Rz4PBy; Wed, 21 Aug 2024 15:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x75nIPkAb0cE6iFn/UCQfYvgfFHDIy5266W+V/qOAl0=; b=QKfIC4yD2Q3B+Htt9aEWgaY4IAQmP32HiTPz9AJEmEFe8/8UxIyFPy/HYGIzx1q/W7Tv/a bcvM6Ig/jQ+TuhQpuCURAAw4VUtSzi5qukeF61qpgB+sLgp4z51D1ZiROnHGKiQAEpK48S 4tI2gFdoE7682mAshGPWYRdpJ9sQ2yvlH4im9h+0Hg91JoN9BQTtmbY2m3Y83KdGCeJYot NJfik3EklEZAhzq8Ylql4m4VULskpFPNjNGYo29NQuRP7Sn/1txhMTZgyxl5NtW2OQMkwE joMjWYcnL6LEFzpb7U059tJFjMVzeH/BvZTAgBobke15aoAlv+SVwQUqMQHK6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253703; a=rsa-sha256; cv=none; b=Llxx4ZpaImoRndvU3DPHEhs5C5HI/stk/ETFDOScBigYy/1CCyDe0lwOh1vQAZUg6gQQW4 Z9TfHnUm5bstzOm+P/iFFCV2eBIjb2ad1PW2y3nYEB/bCT0cmcptnLAvYnJ8Z0GLQg5gTU Vs/C5kBKKEyW+2d3Zr4O3e8o6jqSLX16OG2UKqzplJ4bp9G0+GLRmiOTvi7y+f8C96QwdH QU+GdY4mcruSXqTOXWkwOIIDspPpo/iUcFwWegskT7fWS9M7Ae3d8t+i+FKIo/EQc9flJ3 /1t+piI9oh9aT6MFUo3kXwK/W+oPL3Gx0CGpFlJI5WbByqE4sxe9ViGAITVyZg== 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=1724253703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x75nIPkAb0cE6iFn/UCQfYvgfFHDIy5266W+V/qOAl0=; b=G6f62Ry6eVNpVy79PnyWEMvLykZAxb6kmZR3zXOidilXMJamrX3VI+sOgxkkYzEEYMVk7T B7ofkUbh7PoTUUrmChOShOucuwOM1ECD0mZ2mioZ2Wvr+BhN7ACTraL3VKaCoKyPtoS8Jm Fd8GPQIzL2NjQP+APMQPV2G1TW7J9f0+iKEZ6vnCdqEa8yesKVgDWq2WLOQMcSjkUTWxvZ 5fG/lMaxEPhW64pX869puqintdZSdJhecsLX0dllRxlL1RRE24KBEVQdgO67ZTGu0hiZgI syTyKol26zpXoHxN09+WoES2OVjPzmXQt/U9oDYyJKCx09bD9pZhgHIDHil8Bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn330MCzpjj; Wed, 21 Aug 2024 15:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LFLhlw067272; Wed, 21 Aug 2024 15:21:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLhE2067269; Wed, 21 Aug 2024 15:21:43 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:43 GMT Message-Id: <202408211521.47LFLhE2067269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9467c1a69b81 - main - rangelock: assert that we never insert or remove our entry after a logically deleted one List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9467c1a69b81fff65b85f1e142c6dff196e66ba7 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9467c1a69b81fff65b85f1e142c6dff196e66ba7 commit 9467c1a69b81fff65b85f1e142c6dff196e66ba7 Author: Konstantin Belousov AuthorDate: 2024-08-11 04:25:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:19:15 +0000 rangelock: assert that we never insert or remove our entry after a logically deleted one Tested by: markj, pho Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 992a19701611..2667bf30fb6f 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -478,6 +478,7 @@ static bool rl_q_cas(struct rl_q_entry **prev, struct rl_q_entry *old, struct rl_q_entry *new) { + MPASS(!rl_e_is_marked(old)); return (atomic_cmpset_rel_ptr((uintptr_t *)prev, (uintptr_t)old, (uintptr_t)new) != 0); } @@ -647,6 +648,7 @@ again: } } + MPASS(!rl_e_is_marked(cur)); r = rl_e_compare(cur, e); if (r == -1) { prev = &cur->rl_q_next; From nobody Wed Aug 21 15:21:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn45Y5rz5V2tr; Wed, 21 Aug 2024 15:21: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 4Wpqn44HbMz4P72; Wed, 21 Aug 2024 15:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Ni3vIzGdGOGgiifSZr5D2I592QCUsF6AgD+6dgrvnU=; b=VKr8PcY24+2RoXILQ5NWj/M17mtjAcz8PG/AXbbijHkCfpZd3M3KbiNOuGqTunSIPRPyGu ZuDSpS/zlwZMN2Lc9U5kCN3PQGzny+ReMMGzsz57wBY+xMK3uwfrVJhN/iXUSBwcp5BXjC F4E1FlT1XBadoFBcYW/aLsc2JzsWRBdlX6rjS/UwG8SlCqdCnBDM+9mfSWfg1i4719xKLd CuLmRpbXehZhlRGKldmCx1hGpphx3pq/KOZCVHjW3im8p272pKs8c3MRcCTwOZYriW7JPh dxrnpvwhiwZvDMUEpYzJw22wf0tyFu2QJHpvYnaH7fhubj/eeZ1WgZPc/pPxxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253704; a=rsa-sha256; cv=none; b=LfTyvkX1ukcDCbmsAPmXCvYnaG6XErcZSjeNZPb3TVsr9CZ/2WWzKVmzhBkNUJDfTgQJfm 6HXk90Pj69N7jfREPhogpkKIJyQzyf2OYAFOiQqiH+RR1VTVpDkHq2dxcJAqnd2o7vIX2w YAROZWx22gh67BcoLY9SRw22dFw/i/V/IA56mlFiAebpbYZSZLJQvCXUCs5NeJekUz+keF 8yDc4aR0IP6oHhHbfxfMLrmrs5LY4fx7F96BMdE0VTW/UVs6b5NQT2hsGQJoYn9l4i1mrR Eg3cS4mcmisfuNwEMAiu00efRtfH4YF3tMGpWadVhWkKvex8JK/Xf5FIYnTy3w== 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=1724253704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Ni3vIzGdGOGgiifSZr5D2I592QCUsF6AgD+6dgrvnU=; b=tbzGdaoKK8ZQLbkqNHzJ1HFFjYcludx7Z2xE687G/Uiiss+YLC88ME6n7w5mh8+8RlxhDc uiSy8Wf8CnBO3kOGhw0/bo8f3hJNXTM0j5IOSkszgTHuGNXRWmmw60GJAl51+RnfCogwrk heftKpskTWSL28FH7F853xxMcRdMXfcveRSjc77Sq2h9Ru4XU56oef1ljxTunYRTD1sp7b KgHqB6+AOmUCPhwBcQ3nNfSIZb7p4MrFjGWB7c6T6I/1rQVYGeGzIKTdJkJrohZCIFcFhK r5dPJZznhfzi/+BF8H+EbPRRjInnt9PjxZk9qNeRBBJG+oPUKU5iHt6EJ+YgTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn43fd7zpjk; Wed, 21 Aug 2024 15:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LFLiFR067326; Wed, 21 Aug 2024 15:21:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLiV9067323; Wed, 21 Aug 2024 15:21:44 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:44 GMT Message-Id: <202408211521.47LFLiV9067323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a725d61825f3 - main - rangelock: if CAS for removal failed, restart list iteration List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a725d61825f32ea00d07a2064431a02fd640313a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a725d61825f32ea00d07a2064431a02fd640313a commit a725d61825f32ea00d07a2064431a02fd640313a Author: Konstantin Belousov AuthorDate: 2024-08-16 05:45:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:19:36 +0000 rangelock: if CAS for removal failed, restart list iteration Our next pointer is invalid and cannot be followed. Tested by: markj, pho Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 2667bf30fb6f..d9042f364737 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -539,6 +539,7 @@ rl_r_validate(struct rangelock *lock, struct rl_q_entry *e, bool trylock, { struct rl_q_entry *cur, *next, **prev; +again: prev = &e->rl_q_next; cur = rl_q_load(prev); MPASS(!rl_e_is_marked(cur)); /* nobody can unlock e yet */ @@ -551,9 +552,10 @@ rl_r_validate(struct rangelock *lock, struct rl_q_entry *e, bool trylock, if (rl_q_cas(prev, cur, next)) { cur->rl_q_free = *free; *free = cur; + cur = next; + continue; } - cur = next; - continue; + goto again; } if (rl_e_is_rlock(cur)) { prev = &cur->rl_q_next; @@ -583,6 +585,7 @@ rl_w_validate(struct rangelock *lock, struct rl_q_entry *e, { struct rl_q_entry *cur, *next, **prev; +again: prev = (struct rl_q_entry **)&lock->head; cur = rl_q_load(prev); MPASS(!rl_e_is_marked(cur)); /* head is not marked */ @@ -595,9 +598,10 @@ rl_w_validate(struct rangelock *lock, struct rl_q_entry *e, if (rl_q_cas(prev, cur, next)) { cur->rl_q_next = *free; *free = cur; + cur = next; + continue; } - cur = next; - continue; + goto again; } if (cur->rl_q_end <= e->rl_q_start) { prev = &cur->rl_q_next; @@ -642,9 +646,10 @@ again: #endif cur->rl_q_free = *free; *free = cur; + cur = next; + continue; } - cur = next; - continue; + goto again; } } From nobody Wed Aug 21 15:21:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn55xH3z5V2ll; Wed, 21 Aug 2024 15:21: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 4Wpqn556Lhz4PQb; Wed, 21 Aug 2024 15:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jpm0RI4+l9SbmBbep6YBVwItOcV/NZrjpXfIL4G2hFs=; b=X8AwhCkgPIDco7YtNxO13/1UAGGeQo7z84O9JoiPdxYFjqlZyiVbVcKc6Qg7qhrqXGRyvs iKNVVPErYBZpEbSn2OWJ0zOxu8gLlcg8ZEezltXkYh9E7SrNwkroXXdIgWehda4PSEE1kZ V7wy6f+RHd1K26+E124mroQt8CRV0SPe3KpKEYVo4BcmdRDjyHF8/zImuwjdARrw+9VTp/ rkmN0ZNcUt8jfUFLnulVs6W8yLwzgDOyjSFr36yVuLsJCtZzd2+o81ZvAL2l5ukrBfpkW4 n9YZEBPXXVuX/BNyKrkvv1i9qwwuH05dmRjogXbkNIwVdYIFKs71Sks4RwlbKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253705; a=rsa-sha256; cv=none; b=wuQrxyd7coCmngovPAmNND+jQifXJRyoirhOQuHopNFa6HxCyImm304dEg15NbVeqg/TXh nE/e0PBPlEX1reEZe4Z7wkkg/rO6zSve2q3lftmAt1X0yeFXMKemFuk/d6uJFPW//tTlfs XQTiqc2OEl/o6NY4t8RjJZGVJkDAlGTD+L1TzxWs/ipCXs2ZeVNWKfBxG4LDToxvlv/I+v pxDrL9UbI2UpqZMccU8Z3GdMDArDLNmE8KetpMhzyV0vPfL2kpqHwuAFAELa++BpyBPZnH KHvOWVSy90x9uT4LIaCmdPrZER48TFdAtEm6W6SkT4WCIq9fpZlVW6HY4ashKw== 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=1724253705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jpm0RI4+l9SbmBbep6YBVwItOcV/NZrjpXfIL4G2hFs=; b=xua8h+WYnGWnAujhsWKSqauI4twgdWGgsc802QKknzhihYEkMjNqikzVQWkv0Kqjm98O0M /04iBNjRtYHmRIAAyquxrGHDbgO/wtFsHP4FS7mtteyYzYsdkyePxvsNKuuqRnJs2KeTmf s3gr8XnDd/mcrsomLWwwi5ExjeMlP5vc5TjZCVso3Fa3IC81UdZ5hAmseT6kFEgQsI3M1n FE9xXa4mqYlqqaAqYXzCAMshFaFpuV8hZUPqDFyUfXc8lzrSmOr2PYiSOlhig4GkZFp55Z RX5f6IGLe1GSUOlYhlRQ+/9sS4v0gKTwG0UfXfEu6UQy41ZSlk+Z3vtlIV5LMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn54l3Rzq6N; Wed, 21 Aug 2024 15:21: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 47LFLjau067392; Wed, 21 Aug 2024 15:21:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLjoa067389; Wed, 21 Aug 2024 15:21:45 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:45 GMT Message-Id: <202408211521.47LFLjoa067389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c4d8b2462e77 - main - rangelocks: recheck that entry is not marked after sleepq is locked in rl_w_validate() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4d8b2462e771e409d29df5545cbfb8465673818 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c4d8b2462e771e409d29df5545cbfb8465673818 commit c4d8b2462e771e409d29df5545cbfb8465673818 Author: Konstantin Belousov AuthorDate: 2024-08-20 12:59:35 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:19:57 +0000 rangelocks: recheck that entry is not marked after sleepq is locked in rl_w_validate() otherwise we might loose the wakeup. Reported and tested by: markj Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index d9042f364737..ef9d0104af72 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -609,6 +609,12 @@ again: continue; } sleepq_lock(&lock->sleepers); + /* Reload after sleepq is locked */ + next = rl_q_load(&cur->rl_q_next); + if (rl_e_is_marked(next)) { + sleepq_release(&lock->sleepers); + goto again; + } rangelock_unlock_int(lock, e); if (trylock) { sleepq_release(&lock->sleepers); From nobody Wed Aug 21 15:21:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqn71kTvz5V2r7; Wed, 21 Aug 2024 15:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpqn66Y6yz4PL4; Wed, 21 Aug 2024 15:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pzhV1qMWdIc2fv/gzMa6mP/+iTPzaMAzEcKGDkH/F2I=; b=DMRBT9ZlNXs1TbfG6NCXJa/Oe6kG8K4X9ozsMxTzfTEP9If7y3/dUBPzgK6YrObbnUdDHh 5Sp/BuwvdCl9NM/EqYANAGeF/uCzJIa//OgIPCq9uCPGkqcYjomlangnaEo+RBVmKu2u4y IJYLf5t4hyJDdA+BAnxoIuwP4gL967wj46uGujkpU/LNa+G+i0TvQpQ21MoxBpl9akUp1W p4AJ81nk/HVO7j6NvEww5tZtBejqrte70I9mZ9tGJSBMpaEg6AvbCpNyKQZuYrqEP6bTT1 9glOfPHUHtQBB+n/qApv4lXdt7rWHXWv3CLy5Rhbk+veJww7JdLlwp7rAb5MXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253706; a=rsa-sha256; cv=none; b=uh3VPcl79965tp+B8ATwUtLJMPhs5Ezy/EZ7pwaWz6cOHViFxvVEpudcsjgnq5kNZ+74sk SlMBAqQ1/5jdeG0tpKRLsfzfvjBBvh1PDUvX9L9onW7GnxlA151Vx7ksxkKNXIpf0IIFnr MwpVQvcqaRkVNOOc8lsIQ/U8l7fjGrUt31rhmFVepZsoVWpM0FnKYfSITTp1LD9o9CqgBB AO467hzQSVxEfJBqoGDRf5y5irWgp/oapnDMb3nLwOKsMHPMms3E2Kg3ktSYsI+Dn9/+kU s/rmAbpQ8/NGEmlQ5Sia42IZrrQnATX+qvHZvtKbxxVASGaaqSYgJ2Da4yuKgw== 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=1724253706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pzhV1qMWdIc2fv/gzMa6mP/+iTPzaMAzEcKGDkH/F2I=; b=pB3UkTFbZTYeNSdh2cgmJ6uneuKOIX2wQWAOZCXpXRdaPcCaSl9HoK5fG/embMdzsW0sQF R6MLPA3DJJKCT27Bg0c9+1fknmy7QFAiS2oXiEm1uGxeTNQUc4AOolc8q5DY3+JFjlYbtI eVs3AOV9q22HYfX8bIqxfgi3cE/PZzayrn0ToitDxB1WAOTVKULuQpPr+DOogA8M+TLG7+ jy8y4FLfF9DtBT/EFzz5zrshr1e4Rpy3eiFVdGZgUiVB/93Yjaclypma4muCW/ww2YzCNg fz17CKPMPUKN8epWfsYlZzjPC3TNXBOXXhAWro/AiBQgbPNL+Bhv8KUi6GSyUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqn65tYPzpcb; Wed, 21 Aug 2024 15:21: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 47LFLkwE067434; Wed, 21 Aug 2024 15:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFLkqA067431; Wed, 21 Aug 2024 15:21:46 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:21:46 GMT Message-Id: <202408211521.47LFLkqA067431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 40bffb7d2124 - main - rangelocks: fix typo in rl_w_validate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40bffb7d2124141b9f2970a4de93cf57f5fbd91b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=40bffb7d2124141b9f2970a4de93cf57f5fbd91b commit 40bffb7d2124141b9f2970a4de93cf57f5fbd91b Author: Konstantin Belousov AuthorDate: 2024-08-20 22:07:10 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:20:28 +0000 rangelocks: fix typo in rl_w_validate The freed elements should be threaded using rl_q_free pointer. Reported by: dougm, markj Tested by: markj Sponsored by: The FreeBSD Foundation --- sys/kern/kern_rangelock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index ef9d0104af72..e3bb413ab1bb 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -596,7 +596,7 @@ again: if (rl_e_is_marked(next)) { next = rl_e_unmark(next); if (rl_q_cas(prev, cur, next)) { - cur->rl_q_next = *free; + cur->rl_q_free = *free; *free = cur; cur = next; continue; From nobody Wed Aug 21 15:24:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpqqj6958z5V3Jn; Wed, 21 Aug 2024 15:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpqqj3K2Bz4RnC; Wed, 21 Aug 2024 15:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724253841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qXSJteVB7+gqMBGZpdmFHNPe9pk/spvkJOUxBMRIWRI=; b=UrQPjOshHxaDoJT5ochA6YpLY0G06ZYWv2bp1UGeD/GhL2gZPOXEEUjo95MQc9CTquffW+ TwpEQzWGNE+aGET5fW+VyUzwuqLj0jD96do25etbsyibyltDJcYwsVyIUvYdBzjEXBPgHC c1dADg9I+kcOF3tSiWdEHoB3pqizQJ0NJsXU7g4JyxtUe2bzGu3Qy75Rioxu3pILifYL3l er2eBt6GnHVydqPIzd02G8FH22xr878sd8DcT8yACM+xwsZ6X5OZjjjmNJWJF0K+JIuTV6 8Sr7L+8uBbfXCk1BY5EnSF1T3UPuA6FUMVP/g3DViYzjX6LQaFo3nmszlypd9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724253841; a=rsa-sha256; cv=none; b=dYrGLjYvhFCZjlcqX+5K3k6tENDcT7kM2BT52eI3xnCGa6iEuBaSRNJj8UEZ573hq4mp4f odr3mFFrV9VF04kv8ZS7EKlDFjOu55L0u8uKwYnpxEtPULtNw0Sg2cVZWfPuXO+I9+/URz FzjS6S6Vspu5hNevbFK2UCFq737Vt51h9TB99NzickFCHWOoVyCHlQ6LDo8zDHqpfYGqJ5 /Tfq7kWdPYT8I3/pd0YhGkUTIsqBeQ3K6P5cDy+/Hulg4CukEJWGe1NfUAb0zjihlx/mBe o5B3B+kIVEO4piaV5voryN6JMnkUSqPNi0gryPn0s6mh0OSa0aWK/XPpTGQi7Q== 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=1724253841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qXSJteVB7+gqMBGZpdmFHNPe9pk/spvkJOUxBMRIWRI=; b=Mm6xylV3LYFDYRDwnuP1kOZ18sIlUzy30Pe6rHg9vrlSZsGxCUTK0YpT1FDXtt5rQluNHf qZNsRe+lejM+RIuz5bpWDpRMDr61sdDRrTrPi2V16rXKWqR34FV8qjuW23B+Yh/4+JIoZa wUlJpZ1wb1Yuj/GUQNvkUFXGGjmN2j/UpUgpCS9KELZS7K0JT4qcevfbR4lcxdTBz14uc4 sTtNL/AXsTDPhdoSjLg0QltyRA2eWjdt/dH5q0T14s7Gd+yAALZsddkA/NllolVXt/QHe6 TuqJRXblDYbBKnJtgASBvQXD53OLc8GjPdGTRfOTo4bBTmyUnWMeilCYTZ6naw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpqqj2HmJzq6Z; Wed, 21 Aug 2024 15:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LFO1sB070208; Wed, 21 Aug 2024 15:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LFO1qT070205; Wed, 21 Aug 2024 15:24:01 GMT (envelope-from git) Date: Wed, 21 Aug 2024 15:24:01 GMT Message-Id: <202408211524.47LFO1qT070205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 45543d3424d4 - main - DMAR: clear dmar_devs[unit] if attach failed List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45543d3424d46f84a5399879e190fc359dcefbd4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=45543d3424d46f84a5399879e190fc359dcefbd4 commit 45543d3424d46f84a5399879e190fc359dcefbd4 Author: Konstantin Belousov AuthorDate: 2024-08-20 14:41:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 15:23:07 +0000 DMAR: clear dmar_devs[unit] if attach failed This should stop attempts to use a unit which was not completely initialized, but referenced by ACPI DMAR table during scoped devices operions. PR: 280817 Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46382 --- sys/x86/iommu/intel_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 0b25620114cd..636534173715 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -422,6 +422,7 @@ dmar_attach(device_t dev) &unit->reg_rid, RF_ACTIVE); if (unit->regs == NULL) { device_printf(dev, "cannot allocate register window\n"); + dmar_devs[unit->iommu.unit] = NULL; return (ENOMEM); } unit->hw_ver = dmar_read4(unit, DMAR_VER_REG); @@ -449,6 +450,7 @@ dmar_attach(device_t dev) error = dmar_alloc_irq(dev, unit, DMAR_INTR_FAULT); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } if (DMAR_HAS_QI(unit)) { @@ -463,6 +465,7 @@ dmar_attach(device_t dev) error = dmar_alloc_irq(dev, unit, DMAR_INTR_QI); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } } @@ -496,12 +499,14 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_inv_ctx_glob(unit); if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } if ((unit->hw_ecap & DMAR_ECAP_DI) != 0) { @@ -509,6 +514,7 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } } @@ -517,16 +523,19 @@ dmar_attach(device_t dev) error = dmar_init_fault_log(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_init_qi(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_init_irt(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } @@ -542,6 +551,7 @@ dmar_attach(device_t dev) error = iommu_init_busdma(&unit->iommu); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } @@ -551,6 +561,7 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } DMAR_UNLOCK(unit); From nobody Wed Aug 21 16:36:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpsQx4dt4z5V8SR; Wed, 21 Aug 2024 16:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpsQx46w0z4YR1; Wed, 21 Aug 2024 16:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724258169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XrWy/3csl3LZvB6BMdxpc9X2aoS8ADYmSFeaL9cotyE=; b=SYbKct8T+shcTd04p/fmACoPm3oZvNonzESUEM5nD1OV7O/gBxSxfiSDv7M7KMO+jCHqRS k+hR++FGveUo9IJ512GF6X3erZICaVMRz4rqSM+8hvVjn6hPehJHWVJ9lRQcV8y3KZ4RcK BpJcdPyV3o/nZlNKdVGe+/8V+KLXMsxXuj6h3mD0F8EB7PSrbsf+dqvSnZl5qK+7WNxdq7 PAFAl1zBvGcuObkUh+MvfLY8SjZQazDQyT8N16uPt3pbv2f2hQh/Gr7Tn/sEsIOvvhL53P PqT50uQW4oIeMw9B+gwis+by7iksWqqXpE7WjQpLK+VRPMPj05i+6ytKywmnWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724258169; a=rsa-sha256; cv=none; b=SbuYvw/icKP0MiUe5ibPa4A1jjmwSiJaIF7tNvwgiXieRYxA01qPcfWfqtUlEj5pKYlWax OQBARtr/U5zaMp1DRdcK5sBb9aaOR+u882kbuQ97ooT5qZprw3q4dL+OfRI3uFloGRF6b4 poyBIDIzfRQcpf9vQlSfmTCzFa4bd/sYniPdOyY6JUXgohI6WDEE0fHr/qgUF65SOSzd6r GPFS8vUIxzlrCsZ1BGtVRaf2EmFQE0VksHGNzOozOLdgsCcvzbMRDJguFGqyPwEyTMM9g5 sqox7CtJirkTqpSUwaNecm7TEftKXa7QiB39ZhlpJyoYOLmCWYh+lhsGN/gvrQ== 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=1724258169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XrWy/3csl3LZvB6BMdxpc9X2aoS8ADYmSFeaL9cotyE=; b=ZhYz/om/G2OBmda7F0wGsjUNW7EEOlJiP73WCBCCSu2s1inSJJeepAYOs8k6BUp3auzr+B wrGZrIhm3cSliMeN65720HAstkUWLlV5D2xebsyRxHucxweaEKeedsbBWqnSKPc5ree3Xe xyYkm64BZV+hUybbVwhqka3ZIqWhET8TtOobfYIyuDjqJsa03/NEz7G9n5fsI7M1r2DHis DlPX76lYTLBRM6hrBTw8SA5gaLPLxt+rSIBvRvw/fzY/vJb5I9Z9zMVJhNlktxC7hlIsjn DvsM5JSJlFGSvm1SItuEywGvzPRr47HFi3uMpme624jOFG8854kSBFvYOMyo7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpsQx3jpjzqs3; Wed, 21 Aug 2024 16:36: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 47LGa9i6089001; Wed, 21 Aug 2024 16:36:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LGa9rJ088998; Wed, 21 Aug 2024 16:36:09 GMT (envelope-from git) Date: Wed, 21 Aug 2024 16:36:09 GMT Message-Id: <202408211636.47LGa9rJ088998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 111c7fc2fe21 - main - amd64: add convenience wrappers for INVLPGB and TBLSYNC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 111c7fc2fe21356a637f89fa58c407958f05ad93 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=111c7fc2fe21356a637f89fa58c407958f05ad93 commit 111c7fc2fe21356a637f89fa58c407958f05ad93 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:40:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 16:34:59 +0000 amd64: add convenience wrappers for INVLPGB and TBLSYNC Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45191 --- sys/amd64/include/cpufunc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 62e782304fca..ca53d73b0186 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -525,6 +525,29 @@ invpcid(struct invpcid_descr *d, int type) : : "r" (d), "r" ((u_long)type) : "memory"); } +#define INVLPGB_VA 0x0001 +#define INVLPGB_PCID 0x0002 +#define INVLPGB_ASID 0x0004 +#define INVLPGB_GLOB 0x0008 +#define INVLPGB_FIN 0x0010 +#define INVLPGB_NEST 0x0020 + +#define INVLPGB_DESCR(asid, pcid) (((pcid) << 16) | (asid)) + +#define INVLPGB_2M_CNT (1u << 31) + +static __inline void +invlpgb(uint64_t rax, uint32_t edx, uint32_t ecx) +{ + __asm __volatile("invlpgb" : : "a" (rax), "d" (edx), "c" (ecx)); +} + +static __inline void +tlbsync(void) +{ + __asm __volatile("tlbsync"); +} + static __inline u_short rfs(void) { From nobody Wed Aug 21 16:36:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpsQy5DNQz5V8ST; Wed, 21 Aug 2024 16:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpsQy4jlfz4Y9y; Wed, 21 Aug 2024 16:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724258170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zw8WlpTLtH8xL3Xne8yeMQBP+fgc8Wxl3ITPm8edlG0=; b=rpFU8dXX8FLf2EebeXSwMMXhHzpAKuQsZoeMM2Ry7uo9ySI4UfBJgCmuGllRjBvw9PS/Lm 52ncXR5/OpMz3o8g++QZ4OneWuIvVhIJdKwk6Tp5QA8yy7qiSjxE9FaDFfWA68mYdeQTP2 7Z73JAFg9yGCaznZigpEvpKHudE9MFV3ZtgqQqUJeWeJ42/hqRyUXWw4VkYits5od3blrz yHvnC2m5S80O3/Lcw1nHgQnfdK/7lSloCLrDYCz6iXstu168FrgYH2gkvVYE0B1s9h4kgH Hrn1tu6aGqyo6GLWgztmPTH+Z7/lx//0e6E0BXcWI5Z+Ma5N6MtgAka0SnP64g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724258170; a=rsa-sha256; cv=none; b=ctSBGEvID7DYx812Y3ZENXdcZM3M92GzbTXt7oWik+GRQ7dUk1aNypXN/OkL0Jwn+maMXB iZowKeS9HMODuRVHapZAX8M8qsHNCeEhYB9G2uoQsTX3vVrfG+nq5w2rJJikJDhEWwUOl3 L3GO5AfbYBIysXc71mo2s1KrzMPQC+r1KzF3LxDlA27D3pp88fd19NJqS1Hs+ltfpeie1J 2YlnxqzDHcTkKbBcxgBM61d9nwzWBDgKJ+htEWJTzXzidfuATM11nEO38QmFdZYz3cAy79 In7zwe63y8SpT3kDhLYeVZYHkD0DdafevlTKleyGmPrkqbN5n8YlQ+jvomjxnw== 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=1724258170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zw8WlpTLtH8xL3Xne8yeMQBP+fgc8Wxl3ITPm8edlG0=; b=bS2xa3+DTEot0VGSTWhpW3LCfIgK0HZfyTD7d+xk3hpoqzBwQjs/WP2NN81wUO5vBUzt/d jEp36mH3dMmyJCQ5aol6hEAmBbrnF51X+CXUnONsa45s9GZxv13gQN+kAyQOLbxKgOjWLq HoYqhRpKtINaNvgslhRUrR9ApglMdPntWTi4HHsFoNxedgmjwaUQVOvr+dCLDYXcU4jopl AUQhzm6y81rPwpXWI+KAapdIBLp8j5bxfJbf54iFbmE2lIq/bbAJH4Gws0sh5MtTD/nMAa S4ZWOU1nvZG9XJs5kZs90gIO6Tlgw4Wt6EbklWn33Sq9gKq5FRLjbtTvYRt9jQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpsQy4K9YzrgM; Wed, 21 Aug 2024 16:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LGaAK6089053; Wed, 21 Aug 2024 16:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LGaAMa089050; Wed, 21 Aug 2024 16:36:10 GMT (envelope-from git) Date: Wed, 21 Aug 2024 16:36:10 GMT Message-Id: <202408211636.47LGaAMa089050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bc4ffcadf268 - main - amd64: add variables indicating INVLPGB works List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc4ffcadf2681c954444e1853200dca3f5e65676 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc4ffcadf2681c954444e1853200dca3f5e65676 commit bc4ffcadf2681c954444e1853200dca3f5e65676 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:41:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 16:35:07 +0000 amd64: add variables indicating INVLPGB works Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45191 --- sys/amd64/amd64/machdep.c | 6 ++++++ sys/amd64/amd64/pmap.c | 4 ++++ sys/amd64/include/pmap.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index c509dcc2f7dd..025c3c365de5 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1487,6 +1487,12 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) finishidentcpu(); /* Final stage of CPU initialization */ + invlpgb_works = (amd_extended_feature_extensions & + AMDFEID_INVLPGB) != 0; + TUNABLE_INT_FETCH("vm.pmap.invlpgb_works", &invlpgb_works); + if (invlpgb_works) + invlpgb_maxcnt = cpu_procinfo3 & AMDID_INVLPGB_MAXCNT; + /* * Initialize the clock before the console so that console * initialization can use DELAY(). diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index cf0fc7184f56..ff5c229b7652 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -550,6 +550,10 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); +int invlpgb_works; +SYSCTL_INT(_vm_pmap, OID_AUTO, invlpgb_works, CTLFLAG_RD, &invlpgb_works, 0, + "Is the invlpgb instruction available?"); +int invlpgb_maxcnt; int pmap_pcid_invlpg_workaround = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_invlpg_workaround, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 273693e1f782..0819b3bc2945 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -424,6 +424,8 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int invlpgb_works; +extern int invlpgb_maxcnt; extern int pmap_pcid_invlpg_workaround; extern int pmap_pcid_invlpg_workaround_uena; From nobody Wed Aug 21 16:36:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpsR00cqnz5V8M5; Wed, 21 Aug 2024 16:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpsQz5jtNz4YSn; Wed, 21 Aug 2024 16:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724258171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OuAilEqiwp3VIvVlO/D0Yg8kFMkS7pVHcOo0Povhq+w=; b=l+VDk+Zw9Pz7VnT62jh8FAvfyZjrR/tUqm5w9GZTL7siPuGtuyPnZcnuC65DvdOkmdNwB/ nneOnxaYv/BmNc6GKDN3omETv9CkV4LqaikQx0CSxtH5Se6+Ba1h8NKJv3a3jWLYePGcOL GPOREeDWjNGuMEQquq6r8l22MSXxZIV8EBN+vqZyILJaXkwn+HhNhlV0rrCK99QDE89OXo V4F8XvExASt2RxXw68gARcfRNpXJQceBaVMvgaFAS+wY7GVYtqkN5lV9lXXjMZGBSoV9OT Ux7oQc6QYgvehp/BjJGVLxPFsSUQ6gGWZkHaCejN5JGBp7xA/2aMp3izz0qCRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724258171; a=rsa-sha256; cv=none; b=DG4YT+cW17KLO7dhy6E4Lrk7HVPoVNBPR9w6C9SNBo6SXmay+p+E9pFr6S6FrQ9tkM4WY2 MDCXMgsHw//bH6k1w7u9D5JRVZ498vA1BP4Tz50+9SttmPUFf7e/a+UrFXh6SLPmfbUvku RM8vbkg7jnQV09YyBA/sm5QUmB7eMQdLEhmqB6FterHX0UeDkptYWgSW07k7SGkeB/sgEK KVZgB7EkLWtNbwUuTe8BIskntAK2dr+nhxTbdzuttob6k8WLW2t4Ty47hqqdIWKaBsHEnn jl6mRtlte+UStsFrYSiC+eBco17G7CDWk+yGez6r7vR/5nTI4S3R3eub35Ey5A== 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=1724258171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OuAilEqiwp3VIvVlO/D0Yg8kFMkS7pVHcOo0Povhq+w=; b=c7Y5wGU6+6HaMLkySULOwkgprl8D9+mFQVh2kWvFbnPSHpExBd6G3X5pq0nOK8uk45ieuu hcinMutvjwtS4nFg/r6ltazz2ewFKatPJB3IXmgOgDV0y6oHioDiS+b8Cxua6uBrS66C8m FLG34+MhTaS11NYu9o1ETJTuDEe6Y7tWNeEi5hHuKgLBJE0xPqPgLAcv9+vkSqHfokgGZ3 uvMeTkLvKra0DrYl8NCaCEtksUxyf7PbsKKN27nuyb0hPT91/kagw3ltS82ok6H0Ta1Tg6 qvW1rbemlnzM1beXmVFSqxBQ33h5izSbTPXnD9VzY79ojjBtyA5Le3rYplRJKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpsQz5L4MzrgN; Wed, 21 Aug 2024 16:36: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 47LGaBPZ089101; Wed, 21 Aug 2024 16:36:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LGaBg8089098; Wed, 21 Aug 2024 16:36:11 GMT (envelope-from git) Date: Wed, 21 Aug 2024 16:36:11 GMT Message-Id: <202408211636.47LGaBg8089098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 47656cc1ef1c - main - amd64: use INVLPGB for kernel pmap invalidations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47656cc1ef1cac307f24de88a4fe23a1389af44e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=47656cc1ef1cac307f24de88a4fe23a1389af44e commit 47656cc1ef1cac307f24de88a4fe23a1389af44e Author: Konstantin Belousov AuthorDate: 2024-05-13 22:42:08 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 16:35:15 +0000 amd64: use INVLPGB for kernel pmap invalidations avoiding broadcast IPIs. Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45191 --- sys/amd64/amd64/mp_machdep.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 91737637b714..12abb8b6bf8b 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -679,6 +679,20 @@ local_cb: void smp_masked_invltlb(pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + invlpgb(INVLPGB_GLOB, 0, 0); + + /* + * TLBSYNC syncs only against INVLPGB executed on the + * same CPU. Since current thread is pinned by + * caller, we do not need to enter critical section to + * prevent migration. + */ + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, 0, 0, curcpu_cb, invl_op_tlb); #ifdef COUNT_XINVLTLB_HITS ipi_global++; @@ -688,6 +702,13 @@ smp_masked_invltlb(pmap_t pmap, smp_invl_cb_t curcpu_cb) void smp_masked_invlpg(vm_offset_t addr, pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + invlpgb(INVLPGB_GLOB | INVLPGB_VA | trunc_page(addr), 0, 0); + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, addr, 0, curcpu_cb, invl_op_pg); #ifdef COUNT_XINVLTLB_HITS ipi_page++; @@ -698,6 +719,39 @@ void smp_masked_invlpg_range(vm_offset_t addr1, vm_offset_t addr2, pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + vm_offset_t va; + uint64_t cnt, total; + + addr1 = trunc_page(addr1); + addr2 = round_page(addr2); + total = atop(addr2 - addr1); + for (va = addr1; total > 0;) { + if ((va & PDRMASK) != 0 || total < NPDEPG) { + cnt = atop(NBPDR - (va & PDRMASK)); + if (cnt > total) + cnt = total; + if (cnt > invlpgb_maxcnt + 1) + cnt = invlpgb_maxcnt + 1; + invlpgb(INVLPGB_GLOB | INVLPGB_VA | va, 0, + cnt - 1); + va += ptoa(cnt); + total -= cnt; + } else { + cnt = total / NPTEPG; + if (cnt > invlpgb_maxcnt + 1) + cnt = invlpgb_maxcnt + 1; + invlpgb(INVLPGB_GLOB | INVLPGB_VA | va, 0, + INVLPGB_2M_CNT | (cnt - 1)); + va += cnt << PDRSHIFT; + total -= cnt * NPTEPG; + } + } + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, addr1, addr2, curcpu_cb, invl_op_pgrng); #ifdef COUNT_XINVLTLB_HITS From nobody Wed Aug 21 17:38:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WptpN5tkKz5VDq1; Wed, 21 Aug 2024 17:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WptpN5GT1z4k6m; Wed, 21 Aug 2024 17:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724261884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7C3hLN+Cwr2kC7/stihoFgj1/luxpaw3LCsyhMt/6Y=; b=Q5UarUxBDywmGx1ymbg6js9Pa5sDg1Wbw1jnOr1yRVElPjxwWPN7cmt3BHTX3uRarIg6u+ Dj8vNiHyNv2QK0DZ03Agmob7sIeyL/W+GuPxM7XI27/WHyLwlp2RkSDqNrmrnL5Fdp60qa Dx/0cXQRCxv/QgPSuaWuAbhdpJWvIxLucOR0skgXxE3jMy/X5yxTFlLtHvPoa10CT8YOEs pvzqQVLPHeBH3Ezao/vUYICADMSFNCDtgK9uMdctRcKlXKKcDfvFwJn3MwC8lpUHzP5fAV T1viYFuGJh3TrCBM/7q3t6t0+qgtg4QH5XBHy1NLtgRivwlXQ9myf4ixsMrkkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724261884; a=rsa-sha256; cv=none; b=udX+3Cqbskx4qBpTtFWgxeW12qQV5665f/uxv9ZslavikG03LME7LB+OuD9MyEzAGKynpU 1h9P9RYw284TDrtYWE1H8bQY5yLXPj6wizMIrksnfGpOFfaDEyGKGbWGzlWoS9Yd8gOvjI DHCwNJBiaVEBbsLVoFl7z14jA7/dhRU7UT+youhDzuwgoYpxQkwhCPuAEfApou04H/cWP/ f8GIXf7k3ZkrtbDgUMvqDhTJnwRwSajBQvl3aawDtWra1VpQ2WZvtta24SiNtyVddFlpv7 5K5f7gxZYyST0iDAM5vO1xyKBk3NHMqFqoX1Q9a9+4uF7l5yeD4OvJsnp2fESQ== 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=1724261884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7C3hLN+Cwr2kC7/stihoFgj1/luxpaw3LCsyhMt/6Y=; b=c7FcT8owsyY064KiqfQgj4fjf98Fuk9KDkVip065f5dgv9NyerCjXSjnLuIi3iEmOGcsOQ mRz8eAiX5VQLvPAYWYrg37pcZPabeX24VUCXuO7MfygYoMCXlvmhL4nqfWB1cvzRf527n2 C06GhNh9VNOyS4ewJFjaM39v9YT6+CTsSAiOWQdpEdU7zUPZJ55jT2lBr2kkttcg+lVvO+ 7LkQwyBrD//+zdc3QukaQoNZKTNeIpnWCLhStKwhP55rglWU9IjjHqXUkV23DKb5poz3HW G3QyxIjB7CLBcgh6slnSlA+YnVKdIQ1CbZNvbJjRcmmd0bRD9HuQju/4AEpS1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WptpN4skrzstP; Wed, 21 Aug 2024 17:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LHc4qD092054; Wed, 21 Aug 2024 17:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LHc4LV092051; Wed, 21 Aug 2024 17:38:04 GMT (envelope-from git) Date: Wed, 21 Aug 2024 17:38:04 GMT Message-Id: <202408211738.47LHc4LV092051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 297a9e552b9a - main - libcxxrt: Add a stub implementation of __cxa_call_terminate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 297a9e552b9a5adf07d195eae9649b0758f395af Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=297a9e552b9a5adf07d195eae9649b0758f395af commit 297a9e552b9a5adf07d195eae9649b0758f395af Author: John Baldwin AuthorDate: 2024-08-21 17:37:48 +0000 Commit: John Baldwin CommitDate: 2024-08-21 17:37:48 +0000 libcxxrt: Add a stub implementation of __cxa_call_terminate This function is called by GCC 14 if a destructor invoked during exception unwinding throws an exception. Reviewed by: emaste Obtained from: libcxxrt commit 391a3dcc1054e18c2f0dff4e14d6d79ac95399d7 Differential Revision: https://reviews.freebsd.org/D46004 --- contrib/libcxxrt/exception.cc | 13 +++++++++++++ lib/libcxxrt/Version.map | 4 ++++ lib/libcxxrt/Version.map.arm | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index 35ff997dd445..b56333e979a2 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -1433,6 +1433,19 @@ extern "C" void __cxa_call_unexpected(void*exception) abort(); } +/** + * ABI function, called when an object destructor exits due to an + * exception during stack unwinding. + * + * This function does not return. + */ +extern "C" void __cxa_call_terminate(void *exception) throw() +{ + std::terminate(); + // Should not be reached. + abort(); +} + /** * ABI function, returns the adjusted pointer to the exception object. */ diff --git a/lib/libcxxrt/Version.map b/lib/libcxxrt/Version.map index 012026079e33..02cce34c234f 100644 --- a/lib/libcxxrt/Version.map +++ b/lib/libcxxrt/Version.map @@ -253,6 +253,10 @@ CXXABI_1.3.11 { __cxa_init_primary_exception; } CXXABI_1.3.9; +CXXABI_1.3.15 { + __cxa_call_terminate; +} CXXABI_1.3.11; + CXXRT_1.0 { extern "C++" { diff --git a/lib/libcxxrt/Version.map.arm b/lib/libcxxrt/Version.map.arm index bc4cf68a3654..aef918149b79 100644 --- a/lib/libcxxrt/Version.map.arm +++ b/lib/libcxxrt/Version.map.arm @@ -254,6 +254,10 @@ CXXABI_1.3.11 { __cxa_init_primary_exception; } CXXABI_1.3.9; +CXXABI_1.3.15 { + __cxa_call_terminate; +} CXXABI_1.3.11; + CXXRT_1.0 { extern "C++" { From nobody Wed Aug 21 19:01:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpwfH1gKTz5ScJn; Wed, 21 Aug 2024 19:01: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 4WpwfH0nY1z4sjk; Wed, 21 Aug 2024 19:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724266871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Gssd+9V36jpwSUOQrqL+2K3b6CRxdPf8Z9YxJ4w1Zo=; b=KYl2SSEBrYS4B8mChYkQHfm4+OZJE/fO8QcHEEcNhZrra5hO6j1q7N4NESd4fN5P+WxPDT 5nWDXm0KDpiEL6xoBuiscyKv/LtteqqDf9lcvBxHX/hj/eqQNnzSoK+7pccEQNwu1GzTv3 1W7i/HbBj+pA39Q/YK0rKXxLOlSE/OWSa9aU2sNPDvD/EVgwCMT/PIOTtqyBGm/t4E9xP4 vtlcyphEwECBxud5+vvnEgNP5SuHpz0bJ48BeikFCvwI4AHVokt8CM4uvxs+T4QCcvLGUl LeErzjuVs9B1+yC/ljt9HxwKvDxq1/l4GDBzvwIGmtYOjDVYITyrtlDUUYaOKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724266871; a=rsa-sha256; cv=none; b=HDyVmxB30oc6M5ktT7zsussFlxf11UiZ5lUX5qxH0ShhOeYxOixYD6v/gvp72X+VpDZrTX y9/trC6AMo/HWlaWel5v27445BpkswsRsrQOGib9SH6m/y+rVCzUXsUSp4R9HW8Va0vtTZ 6JCZx5hAUCE8Tk2s4kSWsA/BSTtT/JzTJuTWsj66gKP1bxuSgd5K69kuZfVf7OoTRu1+/3 NWwT6mDWFZ/piwyV0Lz2yxpIX1TT1NRw9uZHqMBUQqk6yxM3l8D23krz8hf8Hizh+VyfzY 3GIpF5+ZYAMCBigJ77Hqwo6ywmdNxL+wnOp67VbjBYata55/Kug2boPAR2/7Ag== 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=1724266871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Gssd+9V36jpwSUOQrqL+2K3b6CRxdPf8Z9YxJ4w1Zo=; b=YlmeVwb4cKFWlZ9hvG0Qddkxg48OwiywsiXqT9j8eHmCzJsD4fTO5ANwKWxZOITjB1ZAGx qm14X1mJEgGShyc/Qs7JLffigwKpAFlwiG9+nBkOilR9NACzAmB6vW6OCU/4ROi7DwOPyc m5+pB0jvvl/OHio/XGUzvyUhWJfwQD98RFeUoYAoYnmp22l7FnrGbS7AhHN9u9Wtg8X+QW C0UAQ2SqvGc9LNIqcEDKG5Dk7Wf6ZvdZuT+ndef5fcoF+XSOplHfMV1HcLIGHsUFz/C1pE v/kWcECi25EOOWSFkXYYnq0cqEV6vNVpfToSH66ykHIUNeFAOKzMDBtfz3Iuig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpwfH065nzw3D; Wed, 21 Aug 2024 19:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LJ1AjM041578; Wed, 21 Aug 2024 19:01:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LJ1AJG041575; Wed, 21 Aug 2024 19:01:10 GMT (envelope-from git) Date: Wed, 21 Aug 2024 19:01:10 GMT Message-Id: <202408211901.47LJ1AJG041575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: d668a0b0abe4 - main - cxgbe(4): reset routine for general use. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d668a0b0abe4b079ac2a0d9cd0d7b71bd4a043c6 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d668a0b0abe4b079ac2a0d9cd0d7b71bd4a043c6 commit d668a0b0abe4b079ac2a0d9cd0d7b71bd4a043c6 Author: Navdeep Parhar AuthorDate: 2024-07-26 22:39:35 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-21 18:47:15 +0000 cxgbe(4): reset routine for general use. Add a reset_adapter wrapper that picks the most suitable reset routine internally. Use it in the fatal error handler as well as the sysctl based reset. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 57c1eeceab22..5fedf10869d2 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2534,6 +2534,15 @@ reset_adapter_with_pl_rst(struct adapter *sc) return (0); } +static inline int +reset_adapter(struct adapter *sc) +{ + if (vm_guest == 0) + return (reset_adapter_with_pci_bus_reset(sc)); + else + return (reset_adapter_with_pl_rst(sc)); +} + static void reset_adapter_task(void *arg, int pending) { @@ -2544,10 +2553,7 @@ reset_adapter_task(void *arg, int pending) if (pending > 1) CH_ALERT(sc, "%s: pending %d\n", __func__, pending); - if (vm_guest == 0) - rc = reset_adapter_with_pci_bus_reset(sc); - else - rc = reset_adapter_with_pl_rst(sc); + rc = reset_adapter(sc); if (rc != 0) { CH_ERR(sc, "adapter did not reset properly, rc = %d, " "flags 0x%08x -> 0x%08x, err_flags 0x%08x -> 0x%08x.\n", @@ -3650,7 +3656,7 @@ fatal_error_task(void *arg, int pending) if (t4_reset_on_fatal_err) { CH_ALERT(sc, "resetting adapter after fatal error.\n"); - rc = reset_adapter_with_pci_bus_reset(sc); + rc = reset_adapter(sc); if (rc == 0 && t4_panic_on_fatal_err) { CH_ALERT(sc, "reset was successful, " "system will NOT panic.\n"); From nobody Wed Aug 21 20:50:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpz4J4nRcz5Snx5; Wed, 21 Aug 2024 20:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpz4J42T3z43YK; Wed, 21 Aug 2024 20:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724273424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K+HIeKKuaJ5bv+ni5pFwL2pZxtb2cVa/ZZP84L6zTAo=; b=GVGgV0P9AcplWkeE+/Qyr/GLvMKQ5bZ2Q7/t8QnkZckiS/uG3x5apwl9u9+X4Imul9QHi4 uYdFW2RXCMRcfD5Ta11aROaEuE0CRYLZdjv4GKqbG9yOi4HCe/b6ip5IfwWutKgIVj7/Gh cMx1YcGop5JgjYld3pyTiPao89Ekasf2Z2ZoHoKgTCaWiBjh0gsPauMX6Nrf1s/mkzPHa5 m0eapUkcKp17j4ESZMkrWLsP8s+rbn6SQXMt/+z7ne3x4ubEgTY7scZ5jx/1etpNHTsIUc vVYTfwfzOv7Jvftk8MIlUDgWVlXvdJseR13fbGkmDgs4C5rqWWl8NksWnJ3pIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724273424; a=rsa-sha256; cv=none; b=c4EImBQpAGsCs8QlcA66uhmw36kY5aMnhbzhydo0YmuFcxtyzKSAt/Mh8KdQCxDA6F8zr+ VoQqdbdJok9IbFa60W+NqMV7NCOv0bP941NSyKzc1hLmUUEJmJ+S16pfV8CGtbSdTl5L4X ALJSNf5U5w3bNm+d/q+tu3x96ioOCpMQAN5MqGvRVIwQ1D+brCt9XHadwdzBPlwEAmXw3E t2KA1HhiSoSCnRtFsn8nabHmMncufivw+5Zta+rh0UHBcJ1nQVN1YRJGYzNuDvcSyMZ4i9 dnfw2ehNXmFSYB7EWmbl0brqq6+4pdNzvDSNpVNVXe6kul/4izBJUB9Yp3qW7A== 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=1724273424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K+HIeKKuaJ5bv+ni5pFwL2pZxtb2cVa/ZZP84L6zTAo=; b=sqQwEFtrGKfr1lPPTr0dFYwfmEZ9v3p9IGTn7ruIsfybD2OhtoGU9B+BZacx2siAuYNqcS 91XG1zOfk902NPcY9e0H+Q2PKl/1yi6nPvOYWInINKDXckFUbazMOO5vhTpweNjWcy4LL8 JAfjYycuKhr7GAnz+P3FhgmSy1rOspkmrC9lbxiKOKSFU+jedu84t4JO+kThsCZfkbVhPK uFDklcAFqPw3OqCz7L0vVcpKkRBrybGDWKsND6mdzK9GzhhczLdsTPgayBxRurcNerPkO8 yWR8qKthJdNR4n4luQ5RUrzPTKL8fnxIPnEMs56/ndNr+PyZq7TXGAs1GE3+Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpz4J3dVpzykf; Wed, 21 Aug 2024 20:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LKoO8K022793; Wed, 21 Aug 2024 20:50:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LKoOAJ022790; Wed, 21 Aug 2024 20:50:24 GMT (envelope-from git) Date: Wed, 21 Aug 2024 20:50:24 GMT Message-Id: <202408212050.47LKoOAJ022790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: d48524e21f1a - main - dev_pager: define free_page for mgt devices List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d48524e21f1a49752485418324538755571ed13f Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=d48524e21f1a49752485418324538755571ed13f commit d48524e21f1a49752485418324538755571ed13f Author: Doug Moore AuthorDate: 2024-08-21 20:48:59 +0000 Commit: Doug Moore CommitDate: 2024-08-21 20:48:59 +0000 dev_pager: define free_page for mgt devices Callers of cdev_pager_free_page in the kernel always have object->type == OBJT_MGTDEVICE. Define a function for them to call that skips the runtime type check in cdev_pager_free. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46389 --- sys/arm/nvidia/drm2/tegra_bo.c | 2 +- sys/compat/linuxkpi/common/src/linux_page.c | 2 +- sys/dev/drm2/ttm/ttm_bo_vm.c | 2 +- sys/dev/xen/gntdev/gntdev.c | 2 +- sys/dev/xen/privcmd/privcmd.c | 2 +- sys/vm/device_pager.c | 24 ++++++++++++++++++------ sys/vm/vm_pager.h | 1 + 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/sys/arm/nvidia/drm2/tegra_bo.c b/sys/arm/nvidia/drm2/tegra_bo.c index 08cd3de6a3fe..346118b78c2b 100644 --- a/sys/arm/nvidia/drm2/tegra_bo.c +++ b/sys/arm/nvidia/drm2/tegra_bo.c @@ -62,7 +62,7 @@ tegra_bo_destruct(struct tegra_bo *bo) for (i = 0; i < bo->npages; i++) { m = bo->m[i]; vm_page_busy_acquire(m, 0); - cdev_pager_free_page(bo->cdev_pager, m); + cdev_mgtdev_pager_free_page(bo->cdev_pager, m); m->flags &= ~PG_FICTITIOUS; vm_page_unwire_noq(m); vm_page_free(m); diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index d4f8e75a3251..25243382f9ea 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -436,7 +436,7 @@ retry: continue; if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) goto retry; - cdev_pager_free_page(devobj, page); + cdev_mgtdev_pager_free_page(devobj, page); } VM_OBJECT_WUNLOCK(devobj); vm_object_deallocate(devobj); diff --git a/sys/dev/drm2/ttm/ttm_bo_vm.c b/sys/dev/drm2/ttm/ttm_bo_vm.c index 4f6c66382453..e543b8dfb993 100644 --- a/sys/dev/drm2/ttm/ttm_bo_vm.c +++ b/sys/dev/drm2/ttm/ttm_bo_vm.c @@ -376,7 +376,7 @@ retry: continue; if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) goto retry; - cdev_pager_free_page(vm_obj, m); + cdev_mgtdev_pager_free_page(vm_obj, m); } VM_OBJECT_WUNLOCK(vm_obj); diff --git a/sys/dev/xen/gntdev/gntdev.c b/sys/dev/xen/gntdev/gntdev.c index 4530feb1c76d..49f8aefad62e 100644 --- a/sys/dev/xen/gntdev/gntdev.c +++ b/sys/dev/xen/gntdev/gntdev.c @@ -600,7 +600,7 @@ retry: continue; if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) goto retry; - cdev_pager_free_page(gmap->map->mem, m); + cdev_mgtdev_pager_free_page(gmap->map->mem, m); } VM_OBJECT_WUNLOCK(gmap->map->mem); diff --git a/sys/dev/xen/privcmd/privcmd.c b/sys/dev/xen/privcmd/privcmd.c index 02e268b23d42..c04ac287183b 100644 --- a/sys/dev/xen/privcmd/privcmd.c +++ b/sys/dev/xen/privcmd/privcmd.c @@ -135,7 +135,7 @@ retry: continue; if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) goto retry; - cdev_pager_free_page(map->mem, m); + cdev_mgtdev_pager_free_page(map->mem, m); } VM_OBJECT_WUNLOCK(map->mem); diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 4f8651411851..a5be05efc6d9 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -262,13 +262,25 @@ void cdev_pager_free_page(vm_object_t object, vm_page_t m) { - VM_OBJECT_ASSERT_WLOCKED(object); - if (object->type == OBJT_MGTDEVICE) { - KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("unmanaged %p", m)); - pmap_remove_all(m); - (void)vm_page_remove(m); - } else if (object->type == OBJT_DEVICE) + if (object->type == OBJT_MGTDEVICE) + cdev_mgtdev_pager_free_page(object, m); + else if (object->type == OBJT_DEVICE) dev_pager_free_page(object, m); + else + KASSERT(false, + ("Invalid device type obj %p m %p", object, m)); +} + +void +cdev_mgtdev_pager_free_page(vm_object_t object, vm_page_t m) +{ + + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT((object->type == OBJT_MGTDEVICE && + (m->oflags & VPO_UNMANAGED) == 0), + ("Unmanaged device or page obj %p m %p", object, m)); + pmap_remove_all(m); + (void)vm_page_remove(m); } static void diff --git a/sys/vm/vm_pager.h b/sys/vm/vm_pager.h index 7d6b2e96b38c..d30bf349e411 100644 --- a/sys/vm/vm_pager.h +++ b/sys/vm/vm_pager.h @@ -300,6 +300,7 @@ vm_object_t cdev_pager_allocate(void *handle, enum obj_type tp, vm_ooffset_t foff, struct ucred *cred); vm_object_t cdev_pager_lookup(void *handle); void cdev_pager_free_page(vm_object_t object, vm_page_t m); +void cdev_mgtdev_pager_free_page(vm_object_t object, vm_page_t m); struct phys_pager_ops { int (*phys_pg_getpages)(vm_object_t vm_obj, vm_page_t *m, int count, From nobody Wed Aug 21 21:15:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpzd92k6fz5SrBx; Wed, 21 Aug 2024 21:15:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpzd929Tzz45r5; Wed, 21 Aug 2024 21:15:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724274925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXMcWwR4xio0C0DetbYTt/EJVpZ+TbxsQlVWPUuvJwo=; b=mHBan8n8Wo55mb38uPSWleymHSdqmId29S8fFStlvMdo0Msh6CVnceeqks1LDCQiA5DT0m 1M5E2wm/u2aU95sy4GbSwCNsKzpmzKQmjs3xDSg+W7QroKrc6ISgZMU4BbdYEssbT9WE+0 2MVa4IMFvvTArG629NhIyIaaEMidsoZjLdc8CeADQpuXTscMb8ZL4/pBv1e7ic7kpaJJSC E9UkQc2SdhDN+01SxWL034VcG0HDxRBdto8kx0d5vzjoCKeZsg+fghLqE0czWp0ino5Kj3 FR8QRVSMYqhbrFxVsRIkOiSzihOdbL6E92Vkn0s4e3+lJFKW3GCX6L/lRsJa3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724274925; a=rsa-sha256; cv=none; b=iyyuyqUMbdtPughk5S47AgOOcVLT3DiUm8CC5KxQBhC0XXV3t+bw4l9Mty6vxUd4VIs3Pi ekugZqJO4QbZ6dpi5Y9XpFlRtzSY2hhpS+qkCpMzAqUOJyCL1PNE6VE/ptDs1sr0QbXHaJ qsn3HMy0fLE+AmVpLFBUEMYFvnKVjz98nceemn/a0SzFDqoiaHwkcYbdDdX+hzwq73MN2z I34a0e+buZ0W8ZJmR+BdjarRMyxtcHhvJDgJL7ywLUkyYNWoDYz8xqi5/waSqQlWNrXmp8 bWqTs/SflISZHFAqqEpOgHhA7c4nuWfqJkWDNrCa7ys/qxAbrvf9VVw9YLtagQ== 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=1724274925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXMcWwR4xio0C0DetbYTt/EJVpZ+TbxsQlVWPUuvJwo=; b=vnTBK8TuAsZL3FiyHfKh9HXrUO3CZzYlnwcjbGoPz+aKpGgH2NF8I9opL4lxDRBYoX/8FS wnzAKYaWZux800IMoDT/AqfZbfXyVtZjpCLYGLW8KGC6Jev9tkmc3AVWTLk8yWWYyEqMz/ pOR8vBJg4TSpGHWyxGwQRUp/YWnNhHU5NB89d1jCQg7n1+Nje5z4b11qm5rtVWfKrmc9L5 cMIyyNXB2f976bAidWGZGx9s0lEmlPWire4kFZWyPOpL5IrlsjY1WSVASx8AXpe7dXpCQG NOai38z3KmjyEMGQId8XgmfT+QdczEZpOqV/QUS7v+I6B+iD3DgymvNBBydWBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpzd91mxSz10RN; Wed, 21 Aug 2024 21:15: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 47LLFPY8064438; Wed, 21 Aug 2024 21:15:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LLFPPs064435; Wed, 21 Aug 2024 21:15:25 GMT (envelope-from git) Date: Wed, 21 Aug 2024 21:15:25 GMT Message-Id: <202408212115.47LLFPPs064435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c0c1b1cd899a - main - freebsd32: Fix a few typos in syscalls.conf comments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0c1b1cd899aae5712786ce73469422fd5d3918a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c0c1b1cd899aae5712786ce73469422fd5d3918a commit c0c1b1cd899aae5712786ce73469422fd5d3918a Author: John Baldwin AuthorDate: 2024-08-21 21:14:56 +0000 Commit: John Baldwin CommitDate: 2024-08-21 21:14:56 +0000 freebsd32: Fix a few typos in syscalls.conf comments Sponsored by: AFRL, DARPA --- sys/compat/freebsd32/syscalls.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/freebsd32/syscalls.conf b/sys/compat/freebsd32/syscalls.conf index 055a041cf72a..a6e47cf470f1 100644 --- a/sys/compat/freebsd32/syscalls.conf +++ b/sys/compat/freebsd32/syscalls.conf @@ -18,7 +18,7 @@ abi_ptr_array_t="uint32_t" abi_headers="#include " # -# Variables below this line are exceptions to the ABI changes programatically +# Variables below this line are exceptions to the ABI changes programmatically # detected by makesyscalls.lua. New system calls should not require an entry # here in nearly virtually all cases. New entries are almost certainly # representative of badly designed interfaces. @@ -53,5 +53,5 @@ obsol="getkerninfo" # nlm_syscall - requires significant porting, probably doesn't make sense # nnpfs_syscall - requires significant porting, probably doesn't make sense # ntp_gettime - should be implemented -# thr_create - was unimplemented and appears to be unnecessicary +# thr_create - was unimplemented and appears to be unnecessary unimpl="afs3_syscall kldsym __mac_get_proc __mac_set_proc __mac_get_fd __mac_get_file __mac_set_fd __mac_set_file __mac_get_pid __mac_get_link __mac_set_link __mac_execve nfssvc nlm_syscall ntp_gettime lgetfh nnpfs_syscall thr_create" From nobody Thu Aug 22 00:30:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wq3yK2ySPz5T9Dk; Thu, 22 Aug 2024 00:30: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 4Wq3yK2VPBz4Mgc; Thu, 22 Aug 2024 00:30:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724286633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rCnInUFaiRKQLFnMlvuWEuN+lVcmgccUgJxEBY3toMk=; b=i7F8XLGDZ4lftKgwN6s32+h1FLiA0j//UxJh+j5LlpvqwxsZWlvgV0GEKI/84+GEt6aN0z KMDVRWxUZ6CXICj0O8Wu0VcZI+3BLij55tDuTC0I4Qp04eRMY4yLPV2G3ypAMvzO1UNY7v SeoyKH1FVq4cgOb184tJVH1EiOOLsKqWSxrpbLrSd6iYveUzFEq03+SKa2fMUF+wJJuUEb MxxojDO9YO4Ima+M4t+VGDTvW5/aZwMmu6lG1tPNhlP72F/6ox7HnwqGGkmHG5IViY8BAr 2fKZogWBM6sbEFJE/R6FwzVRgSkIGzllo0/s2VmCNjqUwIHn1E0OcWu8gTzzvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724286633; a=rsa-sha256; cv=none; b=QijTpcd3p/nJkiNBesAkox18p3W4RIe8vbNl2yrG47LBIQcgi99gGQ9QANqfANTPLluu+v +T49hHHjM9BshhpkJie1EbQsVJrC+SeOuZYs9tJSDkgyS3pp5iOB7AJZdetN/DRh2SOisa eZCmwHIHRAlKH/TSMpmGMrPg8SB/cGch7Lee1Y6y1lfZOLUhFsKcg4QMBeNz6UuBqACNh0 MaUKwUCfR6fT094YzWFOnFPJYsyD+ixcG3hIKkZHQWuwPhs9CmilPfOB1hDdezFqfmK5f4 +ND7TuJkaHe1zdAEoI7zcwcu4556hbcqYDwl2vfPyYV7mEadoSNbkRqMl+f9Rg== 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=1724286633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rCnInUFaiRKQLFnMlvuWEuN+lVcmgccUgJxEBY3toMk=; b=ASJAHFzxfSBmRJ7t1AkQNsNWxTlaBh5IdVyCb/BrNlvRWTaOAdqUb24vdACTk7n3XQyNWR voZa9N0BgpZDnQ85GVinw6UEWgtm5XSwezr95qEC4Ki1kU3eeY7fly+rp4Ohiq2IK8Aw+p rmCCfY21B2UMc3Cjxk6nTVqN1Fqjsr+rwQDkGaQ4s+/LGPvZWpBydYn1RyTVECJ906SmvN Wx1uz85SrdP/++Z1G8c5uPj+ZOX7MvXo24KQm0MErX+L1b17i/MeEwkeFeps781ZWtwj1m PUJ7rrOTmQ0Yf/6YMgUAEzt//0OvDiCSjUJpP067bcbDRBHuK9i63b7OPOFt9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wq3yK25pBz14xV; Thu, 22 Aug 2024 00:30: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 47M0UXx8095215; Thu, 22 Aug 2024 00:30:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47M0UXZB095212; Thu, 22 Aug 2024 00:30:33 GMT (envelope-from git) Date: Thu, 22 Aug 2024 00:30:33 GMT Message-Id: <202408220030.47M0UXZB095212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: d399c791b223 - main - bsd-family-tree: NetBSD 8.3 added List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d399c791b223953d230423eff1d56fb45a1be77c Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=d399c791b223953d230423eff1d56fb45a1be77c commit d399c791b223953d230423eff1d56fb45a1be77c Author: Maxim Konovalov AuthorDate: 2024-08-22 00:29:36 +0000 Commit: Maxim Konovalov CommitDate: 2024-08-22 00:29:36 +0000 bsd-family-tree: NetBSD 8.3 added PR: 280983 --- share/misc/bsd-family-tree | 99 ++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 1d8dacf393be..0849e883e2c3 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -413,54 +413,56 @@ FreeBSD 5.2 | | | | | | | | | | | | DragonFly 5.6.3 | | | | | | NetBSD | | | | | | | | 8.2 | | - | | | | | | | DragonFly 5.8.1 - | | | | | | OpenBSD 6.7 | - | | FreeBSD | | | | | - | | 11.4 | | | | | - | | | | | | DragonFly 5.8.2 - | | | | | | DragonFly 5.8.3 - | | | | NetBSD 9.1 OpenBSD 6.8 | - | FreeBSD macOS | | | | - | 12.2 11 | | | | - | | | | | | | - | `------. | | | | | - | | | | | | | - *--FreeBSD | | | | | | - | 13.0 | | | NetBSD 9.2 OpenBSD 6.9 DragonFly 6.0.0 - | | | | | | | | - | | | | | | | DragonFly 6.0.1 - | | | | | | | | - | | FreeBSD macOS | | OpenBSD 7.0 | - | | 12.3 12 | | | | - | | | | | | | DragonFly 6.2.1 - | | | | | | OpenBSD 7.1 | - | FreeBSD | | | | | | - | 13.1 | | | | | | - | | | | | | | DragonFly 6.2.2 - | | | | | NetBSD 9.3 | | - | | | macOS | | OpenBSD 7.2 | - | | | 13 | | | | - | | FreeBSD | | | | | - | | 12.4 | | | | | - | | | | | | DragonFly 6.4.0 - | | | | | OpenBSD 7.3 | - | FreeBSD | | | | | - | 13.2 | | | | | - | | | | | | | - | `------. | | | | | - | | macOS | | | | - | | 14 | | | | - | | | | | OpenBSD 7.4 | - *--FreeBSD | | | | | | - | 14.0 | | | | | | - | | | | | | | | - | | FreeBSD | | NetBSD 9.4 | | - | | 13.3 | | | | - | | | *--NetBSD | | - | | | | 10.0 | | - | | | | | | - | | | | OpenBSD 7.5 | - | FreeBSD | | | | + | | | | | | | | DragonFly 5.8.1 + | | | | | | | OpenBSD 6.7 | + | | FreeBSD | | | | | | + | | 11.4 | | | | | | + | | | | | | | DragonFly 5.8.2 + | | | | | | | DragonFly 5.8.3 + | | | | NetBSD | OpenBSD 6.8 | + | FreeBSD macOS | 9.1 | | | + | 12.2 11 | | | | | + | | | | | | | | + | `------. | | | | | | + | | | | | | | | + *--FreeBSD | | | | | | | + | 13.0 | | | NetBSD | OpenBSD 6.9 DragonFly 6.0.0 + | | | | | 9.2 | | | + | | | | | | | | DragonFly 6.0.1 + | | | | | | | | | + | | FreeBSD macOS | | | OpenBSD 7.0 | + | | 12.3 12 | | | | | + | | | | | | | | DragonFly 6.2.1 + | | | | | | | OpenBSD 7.1 | + | FreeBSD | | | | | | | + | 13.1 | | | | | | | + | | | | | | | | DragonFly 6.2.2 + | | | | | NetBSD | | | + | | | macOS | 9.3 | OpenBSD 7.2 | + | | | 13 | | | | | + | | FreeBSD | | | | | | + | | 12.4 | | | | | | + | | | | | | | DragonFly 6.4.0 + | | | | | | OpenBSD 7.3 | + | FreeBSD | | | | | | + | 13.2 | | | | | | + | | | | | | | | + | `------. | | | | | | + | | macOS | | | | | + | | 14 | | | | | + | | | | | | OpenBSD 7.4 | + *--FreeBSD | | | | | | | + | 14.0 | | | | | | | + | | | | | | | | | + | | FreeBSD | | NetBSD | | | + | | 13.3 | | 9.4 | | | + | | | | | | | + | | | *--NetBSD | | | + | | | | 10.0 | | | + | | | | | | | + | | | | | OpenBSD 7.5 | + | | | | NetBSD | | + | FreeBSD | | 8.3 | | | 14.1 | | | | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current @@ -895,6 +897,7 @@ FreeBSD 13.3 2024-03-05 [FBD] NetBSD 10.0 2024-03-28 [NBD] OpenBSD 7.5 2024-04-05 [OBD] NetBSD 9.4 2024-04-20 [NBD] +NetBSD 8.3 2024-05-04 [NBD] FreeBSD 14.1 2024-06-04 [FBD] Bibliography From nobody Thu Aug 22 07:08:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqDnS38Ffz5TmBD; Thu, 22 Aug 2024 07:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqDnS2cRwz40Vq; Thu, 22 Aug 2024 07:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724310508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9pGr3TaJBZPhanxp0uDJMEaZtrGs/Klcx6E12k45nGE=; b=TSM0s9nNR7YRZ81oBMDu2jXMG1uAESauGvOTmtd2eQOEPc17G34+9srpOa3Vim2s0YSd4L 182MjokWoaMkrDq10UEf9Y8nTzqBum6hREgaUZnbe7CztGvyVH6Avl8m8yoNwqgSr8cN+G boolro0ZKLtcuGECQmK11W5SZ7f1f+1U1wOEHxQgSbFf+RPzCHkNQPWaIHptDIH1ABT7QS MSXlJLh9IAx+DRFBRULeYSV4ONRQrGwtxzidoAkZDum5ZzpbUVj12Mxdo4NdN6YEB1mkdO /5GB0ctzhQvzmzQ/IuGBrVLHJK4E6gq1nLemuy2/jnTBQR59Llu7x63k+ENmaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724310508; a=rsa-sha256; cv=none; b=g5CP45ezhOE1iafykrFGNGZTfuxdj43TEdb2RlPYh5tzJMCmKlWhB4CzX2Qkyjun6IJUOF 3vZo6EuLF4M/2/bWk6QiwVoKuiU6FKkJ6Rc8xG0V6ECORLXTbSTjHyOU4wcj4un8hlCVyD 7gcQV+wx/0J9EoMXrZW4EnPcdODJ7AvqBquonZHOvBjT8CQ0EAsYKCXokc5b4yV94jwqRb ECZEM6FpQDb5RG/zbqJOMigowtHdPijZ0AiM7h11KTNUmdaJIaxP0DuVYPo22Npq6+GaSO yll+9cZ69zOdEGG3QWEDeKWCIXZ8lzd4K1w3MwqiXrd5V8e/86K76eYxevJuNw== 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=1724310508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9pGr3TaJBZPhanxp0uDJMEaZtrGs/Klcx6E12k45nGE=; b=tdFxKPiBFZ4CpXPeTyId5jURenFPjPJRKuJH/uQXDIXSExiRB7aj4pOKeI50RniAppO1b/ 8aMKH0QWact1gi7Zms8bLK3KcUZIBTKBeZ5r/+NHgvItrjSVo2al7HRauQ1A1G6KMpddFl cX744NpFqvXyGlag4Mw6z24lXbghOagDECw+Izkoaa7YQicqt+4IQohycVk2RN6DmCzCck vVEiRSEWLeIKm8K/hs672mapCFDmxUdBxnnUiaGN8ktgnnpnp3McLN2JRZFw8nv9sd5Dbz SNeDnrrde1vg9wl5LC1HMKdRJdLsA7LnS6HgV754XTGCOq5zzKIgQBP2e1YwCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqDnS27jDzJ9y; Thu, 22 Aug 2024 07:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47M78SOl064813; Thu, 22 Aug 2024 07:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47M78Sat064810; Thu, 22 Aug 2024 07:08:28 GMT (envelope-from git) Date: Thu, 22 Aug 2024 07:08:28 GMT Message-Id: <202408220708.47M78Sat064810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: a1d9ce19b13f - main - sctp: fix format of sysctl variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1d9ce19b13f220c5738e6aa58cf0c3750a05526 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a1d9ce19b13f220c5738e6aa58cf0c3750a05526 commit a1d9ce19b13f220c5738e6aa58cf0c3750a05526 Author: Michael Tuexen AuthorDate: 2024-08-22 07:07:27 +0000 Commit: Michael Tuexen CommitDate: 2024-08-22 07:07:27 +0000 sctp: fix format of sysctl variables MFC after: 1 week --- sys/netinet/sctp_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index a4be3471e2fd..a39429ec046e 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -894,7 +894,7 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) return (error); \ } \ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ - sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + sctp_sysctl_handle_##mib_name, "IU", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ From nobody Thu Aug 22 10:01:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqJcl4tvpz5SZ6m; Thu, 22 Aug 2024 10:01: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 4WqJcl4JYBz4JXw; Thu, 22 Aug 2024 10:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724320871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A96mkQTVf/kHjfuA49fZu8N0MrHWBkYbY4oXKUZSP8o=; b=pEi4yig0+uKQf0Io7xuqku3tD2BV2zVsyPS4ZtWsfJ9u47LN7/4/lJnw0wffsfBSBoUXhf jv5C6reOWo8OeJQCmpiZdy3wZyI3QNCx8/m9y9wonQzbc72E7OIu3pvyYG3bND8B+j+Dru ohw3wJT0aWFFR0nKA9tiHLRBdd48x59SEW5H57BQdj9o9vMvP7T842vYaZLhbRHX2f+Fzz c/uNxbEEkJDLv+rf7N9nhGY4JqVzV91iqMJHZUqCM0Ygjh88icayCFAXB6eZBbNVEp6BDa pBAYUGW/LS5L1V96HIfZahIpFcVeQsXB03Xi+qLm7wsn1xsCeAM7hQNOL4I2JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724320871; a=rsa-sha256; cv=none; b=XZrTfMUOAqnF4z089QG4jDA1Ya6Ch7fVTh9H5cv1LBPoQ6vQwMrUpZwxMN+sA9iZO5znsE g1yTGtti/82nBvEGUiwVZGTE4GaEkDW5gjobhQryah4IcxfAG5ShvNrCRWXv8XNKk9NMV2 PCde3kWAH+Wlemh08cbpzVt4tOS+x5E7egVs4oPmDHJsIDXaxwWJKOKLv/OpSNXUqOU7Gk k87KWXjd6hIt3f4JgqXYul0QdKkPxDOYyt+yrdA1BhJmS8S3VIK2PiTxzkwnxgZrISaw8T Cb6/XHY4/YSKuwAWW1aKALV4pk1gMfzxNiOBL0Nn3aLfLT3W4j1npZaw0/+7FQ== 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=1724320871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A96mkQTVf/kHjfuA49fZu8N0MrHWBkYbY4oXKUZSP8o=; b=EFIJg/aNFc/veKr9AwnVIn9okWTBLjNwn1xDO6oBfH/W3BqLTvy3wOZMek+IPnkcImrlBF 74ynkUYpfaH/q8/WZ+4Y+8+Lyumr9ZyLn34jOJ4VWtrv1CIqO5tZplr7Q4BFxwqYJNfbQ1 RTVBAKMBNaxQj5A0WKVTKYAmK4qPaZK8UBWwaJo0Ln/7NFqsOdkfkZCwJvaYojkxCQ8UvB 5qkOFTCLLx9kH1ONh2ZH7GvaUX+b0vZ+FBggKs+MmKSxl/pbq9mYD12cetxBDYjxy16dZN YokTBq1ak5MBgNa2NF1zrP04h35Bras2YwmVJ9E18JnNAwPUIgDufjAwzUpvvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqJcl3srWzNH4; Thu, 22 Aug 2024 10:01: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 47MA1BJ3062858; Thu, 22 Aug 2024 10:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MA1Bxa062855; Thu, 22 Aug 2024 10:01:11 GMT (envelope-from git) Date: Thu, 22 Aug 2024 10:01:11 GMT Message-Id: <202408221001.47MA1Bxa062855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 0f64fc6a3486 - main - kern: Align the declaration of kernconfstring with its definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f64fc6a3486454ad708f517633f930e611fd6d2 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0f64fc6a3486454ad708f517633f930e611fd6d2 commit 0f64fc6a3486454ad708f517633f930e611fd6d2 Author: Zhenlei Huang AuthorDate: 2024-08-22 10:00:34 +0000 Commit: Zhenlei Huang CommitDate: 2024-08-22 10:00:34 +0000 kern: Align the declaration of kernconfstring with its definition It is defined as const char[] in config.c which is auto generated by usr.sbin/config/kernconf.tmpl . While here prefer macro SYSCTL_CONST_STRING to avoid casting. MFC after: 1 week --- sys/kern/kern_mib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index fe6e49865682..0132478aa68a 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -464,10 +464,10 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, #ifdef INCLUDE_CONFIG_FILE /* Actual kernel configuration options. */ -extern char kernconfstring[]; +extern const char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, - kernconfstring, 0, "Kernel configuration file"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, + kernconfstring, "Kernel configuration file"); #endif static int From nobody Thu Aug 22 12:47:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqNJM0zgQz5Srp3; Thu, 22 Aug 2024 12:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqNJM0Q5Cz4cCQ; Thu, 22 Aug 2024 12:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724330835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/yrZcFC0BDK9qDIpyyxlFveFKk39V/d6sRD1rm+1R/I=; b=eANE4iaWAjiIdkB/6fN6mzuqYIJcoNB6w7CwbvUQmxFv/TRMQMu74GK6RaQCBJUsa9yCUF p+wka53If7C/9Hiimgu+3y0Do7NZZnboDL14Id7fy1jD5B4JCWZV55c17boLNwaGeAMK62 oPIsz5SA4TS+/Y4xVmSUjLErwb2H+mvB1URaywsSpaEs4jOZd8hdloIvybcto4TF+sc30t eGBY3y7vO+MN7WKr1cXeXVSIT55rtyn9rtBiScblwRoiMEBA3N/dx+OiA4FV3Ucaxk8cMP GbKJNLkaiZoYCOpXeNAiQraQ9oq0wnN435lO47nD6Z97GJs290NwOJpUtmhR4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724330835; a=rsa-sha256; cv=none; b=xjR4ACctWf25mvK1YRkgRjDphL4sJVw4iEQ8PQ3d7fqLpCILdXE7Be/nTbGCTMyDScj4i+ YgDtaDhgDjvXV6TAbEx7mghFTBDqpG44NuxvIWOG0tbphAGMQvd0EoIQB3DfIaLXi5z1wQ WqDqsEFOgCa3G6Gt28SRXocKGCg9VuxKdHgipT4CyGKoidBAFanh12F0q9mG/YSGS8wH0L 5DfAVW4GS+mcMwDkWx9A3xMSqQOTEQ25MevEPreYak7Mn4qpa0BB6krYoFP0GNW7y/MDLY jp/08TdfgB+W0UcqptimLuOySn0ROAKXhJTbDgk2ijY9f9T//5QPMrw4n/dhvw== 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=1724330835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/yrZcFC0BDK9qDIpyyxlFveFKk39V/d6sRD1rm+1R/I=; b=IgmgINVnfIC0YGgca+w7WLlLIACcNiiosZNeFgGOD3TD/oSqqhhrCoxYliTjVeMXc0utZq OGbkASDIeZeE6vgf7dGf98LDK1sS7BLDwOdlP1fmICelhiC1hDrFse2337j8IPiGgiccAn jh0ZR2chmGfAtelIuzpoKURbBrChIv3pQo7i/Iq/mEYX+PzgTRAt6XeTQbj39ocaOhqeQH hp7t649EXfADfPrYljjkL/IcS/H/rtajpiGRgkWfUf2mBWFjOsWHoEns85PTKKiDeqYsQ5 ZDF7JlAR5BGbii3UeMqM7Uv/Bv4uhSlCW/6d0wNl4B8KGjYgKcndDYEWROx9Hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqNJL70ljzSkW; Thu, 22 Aug 2024 12:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MClEWJ039320; Thu, 22 Aug 2024 12:47:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MClEer039317; Thu, 22 Aug 2024 12:47:14 GMT (envelope-from git) Date: Thu, 22 Aug 2024 12:47:14 GMT Message-Id: <202408221247.47MClEer039317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 498286d4e807 - main - tcp: fix format of sysctl variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 498286d4e807d6b9e4caad22b96ebca7f16e9b18 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=498286d4e807d6b9e4caad22b96ebca7f16e9b18 commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18 Author: Michael Tuexen AuthorDate: 2024-08-22 12:44:47 +0000 Commit: Michael Tuexen CommitDate: 2024-08-22 12:44:47 +0000 tcp: fix format of sysctl variable The format for CTLTYPE_UINT is "IU" instead of "UI" as specified in sysctl.9. Reviewed by: cc, zlei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46408 --- sys/netinet/tcp_syncache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 62a4a5a28878..025b071eb1ca 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -207,7 +207,7 @@ sysctl_net_inet_tcp_syncache_rexmtlimit_check(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_syncache.rexmt_limit), 0, - sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", + sysctl_net_inet_tcp_syncache_rexmtlimit_check, "IU", "Limit on SYN/ACK retransmissions"); VNET_DEFINE(int, tcp_sc_rst_sock_fail) = 1; From nobody Thu Aug 22 14:54:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqR6s1yfpz5T4By; Thu, 22 Aug 2024 14:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqR6s182zz4pQ4; Thu, 22 Aug 2024 14:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724338453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CzXvOdhLyWJv9B+UdoOtinmusO2r4I9FDflJA3BXzcc=; b=NxUga5ChOIU2mqwYeZTCZjUDJ9rBgmGOMSOyvPiTdJ77gTAOFdhnaOtwW75R4LQygBTo8S WfPQUPsFeSfmXeGFyozKiaybP6ehWY2curkhmMQQRFvoUo+82abBlmR0VMXphwIiHXg8Ss dHgstl8ZqijiqPMfV5VwrSNToKzIw2Usp3/rpwzYPn44250BH7X1Nnw72ijMmek40YDtET aszDTB6TamSw8wx3IqSD4bUqXnir75y3hMNQjvMbvCmSoeO9E3A8fLLSdKMz/aZIF6/hJ6 pnP+a2zyOdAy/etZgMYJKoSJXVXHq8MT+7RV4vDyyqNWAP6/9rS/K7SnWRdMyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724338453; a=rsa-sha256; cv=none; b=khuQZah9tASSmt2wfAc62QdciPiuFap+34wwsx/k1m54iCsrzxzSlff3hIzJ+3OoM5c8m2 Q331fBfJpFqDPC+sFzZLxfGR9DNi/MeBML+oz8vrctvTBrpSiZKvA0SDGLP1q3/D2BGxCR sVdkQiy0muoGxq6CNVuqQjxVY8aMB7BiUJ2mUoZaCsqWuPzYVYJ34y/WxXPzirdGEn6+4U MPvkor2uuOnkv8W6AdEKR3nABPdSBFwglHooVijEQDBkRt9rrZWhthq9V91i+FssjJGbTo BavjJl1qNMFvo6uXGlT9b6EE1OcmP2s5CtJ+ZWXYE8ViqnQTiSZ/9JxhAxEQxw== 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=1724338453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CzXvOdhLyWJv9B+UdoOtinmusO2r4I9FDflJA3BXzcc=; b=Ldhf7LzAzpeGyda4Ox0V3a+ZxT7uFOUxRgcLKYrhmJvnReVwUstDiQvECZbacb9A7THfb9 MsKsmiRNAZwIFwtpK9Or854sKaLNJ7Hm5uZDbiaHcWe9mcddZgP9kaW5ZgKF3x/qqnlSbe RoQANSJ3iCnBVNsmqXBvgWXZz+YyiXCZ1KWXlvRvVp703Y0ROWHNHizZcxVz+yPBjFl+8M NOCp3PaN7iaFEimo+gctoFe1F2BJ45wGLrOhbOc5PVjS0BPGvlGac8iqmPTo7ZNBWy0zK7 74pDBbReQOSnZ5rRK8CS70QYXkw54vLl8hg+zkdemv/igc1TJYtbLmgXTZI9eg== Received: from [IPV6:2601:5c0:4200:b830:88c5:d84:653:62c7] (unknown [IPv6:2601:5c0:4200:b830:88c5:d84:653:62c7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WqR6r6gpxz1HnQ; Thu, 22 Aug 2024 14:54:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <4a779668-5060-4bb2-8e61-d593538fd609@FreeBSD.org> Date: Thu, 22 Aug 2024 10:54:12 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 297a9e552b9a - main - libcxxrt: Add a stub implementation of __cxa_call_terminate Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202408211738.47LHc4LV092051@gitrepo.freebsd.org> In-Reply-To: <202408211738.47LHc4LV092051@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/21/24 13:38, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=297a9e552b9a5adf07d195eae9649b0758f395af > > commit 297a9e552b9a5adf07d195eae9649b0758f395af > Author: John Baldwin > AuthorDate: 2024-08-21 17:37:48 +0000 > Commit: John Baldwin > CommitDate: 2024-08-21 17:37:48 +0000 > > libcxxrt: Add a stub implementation of __cxa_call_terminate > > This function is called by GCC 14 if a destructor invoked during > exception unwinding throws an exception. > > Reviewed by: emaste > Obtained from: libcxxrt commit 391a3dcc1054e18c2f0dff4e14d6d79ac95399d7 > Differential Revision: https://reviews.freebsd.org/D46004 This should be the last commit needed to build amd64 with GCC 14 via the amd64-gcc14 package. -- John Baldwin From nobody Thu Aug 22 16:09:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqSnF1FKXz5TBm8; Thu, 22 Aug 2024 16:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqSnD6MFWz41nL; Thu, 22 Aug 2024 16:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724342944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qg5zW3dN1aJFi/i6Wad29NElHO2oAc1QfbGlqiT7V4Y=; b=RnXSDxh6q6DzKGw1X8geRUztJd+QrZv75tiVZqXYEgHQg5Iif4DcnbrPe6Y49nH7PeReyQ SdNpEgIQ0XstTstUhUkdmW8e5OCfimEgiSXNr9hRGA82//UHJXFmZILlz/2MD5gZjsQ9P5 IiVVDMRmugHhQhx2zmQ3ldApWPzx/N7GHQuzVY9n9rCmocSPjBF9SKBT5DmjCXxoquFBSM 5LQtm9HKzHVKQMd7xWA9d0dgcxGVyVIrFNasNE4bEfXk9Kc6X5MoEQnK6kPVBVtCE1fBBB dKEhFjd2UoFDS8+GkIBt13Dzm88LFPhMibVOo5FekB4XPXkJyE3TO2HxR9a/Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724342944; a=rsa-sha256; cv=none; b=msNPn+7pyQLMcNyJb7ms76HapBPaEzpv0WHn5vP5ueDxq+qSzX/67RsZsZWOjqaWcEOOos NquOr2QiHeWUkC0FKNALko3caywWgak6WtOCCJk9J6Y09OJ6EnxRux8uvjRx+8j8ajJoXM IMIWEDQt9m5dCHALjB5ojCTt5h5LwiJRzGKRDAHkLypOy8x2T9UulVDJTXduRd40kh7zLy YzEx1G6UkrvGQy3/60bNg0l1ADuJcw7YOscQNDDPr9yoozwY3V/ljtAHUVsMR84vMPAiwf L4kQ/c5QVWA3UAHVLnawQuAbU0O7Va5VL58DsewAqaIbfcpZx2tbnZppFgZEDQ== 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=1724342944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qg5zW3dN1aJFi/i6Wad29NElHO2oAc1QfbGlqiT7V4Y=; b=pqElT7cNI4pJxKV0jYfCnLbp6j94RXhemZKQheaT7EhPvWm6ocYLdg8TmChYiaMXbYmB3i 4BpYj3Ere5St7BpHvv8yEJwUzyNw3ceZ5XYIHARH/O1Z5B82gOApfZ5f6opNFLx6CDaKRj y2vb86EeXLWqd0ZVuBnAnkdKHQdo7IpIlCev3H8FTyQfCEzwaZcwXhJD1fu3739FzbXt0E 22OQls99pL8UOBeNsAZ9edPs9FzSCqR38xdXrGehRJ5Yj9H8/R6ln6wBVIaSmyu5BNK8ez hLIR/1XV9Fe/8YQe4LTK0Z9kZikIGoPkWs8jJ3XcpN7i7A+IwFcOWqLj+xMU3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqSnD5wy5zZkN; Thu, 22 Aug 2024 16:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MG94ai077725; Thu, 22 Aug 2024 16:09:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MG94i1077722; Thu, 22 Aug 2024 16:09:04 GMT (envelope-from git) Date: Thu, 22 Aug 2024 16:09:04 GMT Message-Id: <202408221609.47MG94i1077722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 5680cf6dc6e2 - main - jemalloc: don't expose 3.0 compat symbols List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5680cf6dc6e25cffa3930e9cb06f6982fcb80209 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=5680cf6dc6e25cffa3930e9cb06f6982fcb80209 commit 5680cf6dc6e25cffa3930e9cb06f6982fcb80209 Author: Brooks Davis AuthorDate: 2024-08-22 16:06:58 +0000 Commit: Brooks Davis CommitDate: 2024-08-22 16:08:24 +0000 jemalloc: don't expose 3.0 compat symbols Don't provide default linkage for jemalloc 3.0 compatability symbols. We stopped declaring these interfaces with the introduction of jemalloc 4.0 prior to FreeBSD 11.0. Any code using them would have had to declare them manually so stop declaring them and export the symbols directly for compatability. Arguably they should be x86 only as they were never declared on other Tier-1 architectures. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D46407 --- .../jemalloc/include/jemalloc/jemalloc_FreeBSD.h | 26 +++++++++++++--------- lib/libc/stdlib/malloc/Symbol.map | 10 --------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h index 00848c0c48e3..dee4679838d8 100644 --- a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h +++ b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h @@ -118,7 +118,6 @@ extern int __isthreaded; #undef je_malloc_stats_print #undef je_allocm #undef je_rallocm -#undef je_sallocm #undef je_dallocm #undef je_nallocm #define je_malloc __malloc @@ -139,11 +138,6 @@ extern int __isthreaded; #define je_mallctlnametomib __mallctlnametomib #define je_mallctlbymib __mallctlbymib #define je_malloc_stats_print __malloc_stats_print -#define je_allocm __allocm -#define je_rallocm __rallocm -#define je_sallocm __sallocm -#define je_dallocm __dallocm -#define je_nallocm __nallocm #define open _open #define read _read #define write _write @@ -183,9 +177,19 @@ __weak_reference(__mallctl, mallctl); __weak_reference(__mallctlnametomib, mallctlnametomib); __weak_reference(__mallctlbymib, mallctlbymib); __weak_reference(__malloc_stats_print, malloc_stats_print); -__weak_reference(__allocm, allocm); -__weak_reference(__rallocm, rallocm); -__weak_reference(__sallocm, sallocm); -__weak_reference(__dallocm, dallocm); -__weak_reference(__nallocm, nallocm); +__weak_reference(je_allocm, weak_allocm); +__weak_reference(je_rallocm, weak_rallocm); +__weak_reference(je_sallocm, weak_sallocm); +__weak_reference(je_dallocm, weak_dallocm); +__weak_reference(je_nallocm, weak_nallocm); +__sym_compat(__allocm, je_allocm, FBSD_1.3); +__sym_compat(__rallocm, je_rallocm, FBSD_1.3); +__sym_compat(__sallocm, je_sallocm, FBSD_1.3); +__sym_compat(__dallocm, je_dallocm, FBSD_1.3); +__sym_compat(__nallocm, je_nallocm, FBSD_1.3); +__sym_compat(allocm, weak_allocm, FBSD_1.3); +__sym_compat(rallocm, weak_rallocm, FBSD_1.3); +__sym_compat(sallocm, weak_sallocm, FBSD_1.3); +__sym_compat(dallocm, weak_dallocm, FBSD_1.3); +__sym_compat(nallocm, weak_nallocm, FBSD_1.3); #endif diff --git a/lib/libc/stdlib/malloc/Symbol.map b/lib/libc/stdlib/malloc/Symbol.map index 15e4f9e6c69c..d3aa7f3f9988 100644 --- a/lib/libc/stdlib/malloc/Symbol.map +++ b/lib/libc/stdlib/malloc/Symbol.map @@ -23,11 +23,6 @@ FBSD_1.3 { sallocx; dallocx; nallocx; - allocm; - rallocm; - sallocm; - dallocm; - nallocm; __malloc; __calloc; __realloc; @@ -40,11 +35,6 @@ FBSD_1.3 { __sallocx; __dallocx; __nallocx; - __allocm; - __rallocm; - __sallocm; - __dallocm; - __nallocm; }; FBSD_1.4 { From nobody Thu Aug 22 18:41:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqX8v4qRBz5TQj4; Thu, 22 Aug 2024 18:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqX8t5nMJz4GNJ; Thu, 22 Aug 2024 18:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724352078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vrjxvmvLK9SrPDffoCds0moqTfpnBmKlJ0vQH9C2X4M=; b=yr/cZl0ZBAvhOVJtCmEdBD7dx7b973A0SZLynM8lxCZ5Dx29a1AB2Qr5guaSCUijfUDF1c 2dXcKjSmfd1Hqj/v+Ieh/HmfU1SRT/v/hduSuic3Y08xPby3l6WRvHRq6ADdELKkAQ0bCp Jh7KYE1fNnpcQNrvqPLgFMCNEXlOY7gLmrlIY85ehVahH2GQxsz6GxicoEuLA0k11ZEmNs VFyq+7nK0tBJ5Cp7ITOwXK1ytubAbdwkNfy4EuHJM3GV08ZVRI1ZbbBvSOgiWLY0g2gufX gLeytUZGtDs2/he1/QzIzvH+fmhpCt1DKUdix+SIpV3OwWKVpSUPUz288G9wiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724352078; a=rsa-sha256; cv=none; b=C5/FXsaE6vo77yzXtQ7nQbE8B4mOr+Pnye5UWK9CErNDzW0gMXze2J+Nea6Ph69cHQNiri pg7KZiwUSuBPbAIdwz6cymVwLAtvnbdae3JC0q+LwprANjGybuhYy70ypHos41NHboOkd5 /kmy0+ITE9HdReXX8DgpwfsA4ks/ui8tek7lX/gxFibyh71/g7TuB/tHcYn4NgdxRwMtu9 7g3Gbf9+1ckut5XyPQMgd27bz75MPmLd0/ysTAZjEpAptDFxlMzkBrM598g4Tvntrz8ce3 FII82tV+pfl6+5r2aNEkU0eYsjPqdVyU13Tpa/tlaaM9E/7z3E05hZDhdoMWeQ== 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=1724352078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vrjxvmvLK9SrPDffoCds0moqTfpnBmKlJ0vQH9C2X4M=; b=AmwyxuAiqxqaDHmY79aD3ZofT+TU2khsmvdWn/xM+XItUNsC7ZD8HeE54ZHNwRAaAkDPe7 jIZcBClyk13Pb59lN7bln1e80dy0zbFZm3TnqTBYKOfvRoOoHbdXp29YlV9NiEBqB8zXlt E2pIs7AvxOElbGjFvfJuvXD6bTpUqroPB03qN5I9EPIqUoim2A6BzuNvYpCoMZAWjs40NQ dFHw6ayjpOIcSZ08JNSnwHx7bl9ZUAOGk+K5jI9Lr8A8k3a7Y8zQ7fIc7U8HsjgyKQiYyj ugVFFwDhaZ7UsgilbuDEsbrr8pQP0PKNDkUlqpV1cnK29pPtD11ojqfP9nvptA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqX8t5NdszfZy; Thu, 22 Aug 2024 18:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MIfICk045604; Thu, 22 Aug 2024 18:41:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MIfIvr045601; Thu, 22 Aug 2024 18:41:18 GMT (envelope-from git) Date: Thu, 22 Aug 2024 18:41:18 GMT Message-Id: <202408221841.47MIfIvr045601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 776cd02b891c - main - vmm ppt: Enable busmastering and BAR decoding while a device is assigned List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 776cd02b891ccd984963c9ec26f9748d213f0b9b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=776cd02b891ccd984963c9ec26f9748d213f0b9b commit 776cd02b891ccd984963c9ec26f9748d213f0b9b Author: John Baldwin AuthorDate: 2024-08-22 18:40:48 +0000 Commit: John Baldwin CommitDate: 2024-08-22 18:40:48 +0000 vmm ppt: Enable busmastering and BAR decoding while a device is assigned Reviewed by: corvink, markj Fixes: f44ff2aba2d6 bhyve: Treat the COMMAND register for PCI passthru devices as emulated Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D46245 --- sys/amd64/vmm/io/ppt.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c index 3451e91d9de1..9fcfdc7cb441 100644 --- a/sys/amd64/vmm/io/ppt.c +++ b/sys/amd64/vmm/io/ppt.c @@ -151,9 +151,13 @@ static int ppt_attach(device_t dev) { struct pptdev *ppt; + uint16_t cmd; ppt = device_get_softc(dev); + cmd = pci_read_config(dev, PCIR_COMMAND, 2); + cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); + pci_write_config(dev, PCIR_COMMAND, cmd, 2); iommu_remove_device(iommu_host_domain(), pci_get_rid(dev)); num_pptdevs++; TAILQ_INSERT_TAIL(&pptdev_list, ppt, next); @@ -176,7 +180,6 @@ ppt_detach(device_t dev) return (EBUSY); num_pptdevs--; TAILQ_REMOVE(&pptdev_list, ppt, next); - pci_disable_busmaster(dev); if (iommu_host_domain() != NULL) iommu_add_device(iommu_host_domain(), pci_get_rid(dev)); @@ -376,11 +379,28 @@ ppt_pci_reset(device_t dev) pci_power_reset(dev); } +static uint16_t +ppt_bar_enables(struct pptdev *ppt) +{ + struct pci_map *pm; + uint16_t cmd; + + cmd = 0; + for (pm = pci_first_bar(ppt->dev); pm != NULL; pm = pci_next_bar(pm)) { + if (PCI_BAR_IO(pm->pm_value)) + cmd |= PCIM_CMD_PORTEN; + if (PCI_BAR_MEM(pm->pm_value)) + cmd |= PCIM_CMD_MEMEN; + } + return (cmd); +} + int ppt_assign_device(struct vm *vm, int bus, int slot, int func) { struct pptdev *ppt; int error; + uint16_t cmd; /* Passing NULL requires the device to be unowned. */ error = ppt_find(NULL, bus, slot, func, &ppt); @@ -392,6 +412,9 @@ ppt_assign_device(struct vm *vm, int bus, int slot, int func) pci_restore_state(ppt->dev); ppt->vm = vm; iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + cmd = pci_read_config(ppt->dev, PCIR_COMMAND, 2); + cmd |= PCIM_CMD_BUSMASTEREN | ppt_bar_enables(ppt); + pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2); return (0); } @@ -400,11 +423,15 @@ ppt_unassign_device(struct vm *vm, int bus, int slot, int func) { struct pptdev *ppt; int error; + uint16_t cmd; error = ppt_find(vm, bus, slot, func, &ppt); if (error) return (error); + cmd = pci_read_config(ppt->dev, PCIR_COMMAND, 2); + cmd &= ~(PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); + pci_write_config(ppt->dev, PCIR_COMMAND, cmd, 2); pci_save_state(ppt->dev); ppt_pci_reset(ppt->dev); pci_restore_state(ppt->dev); From nobody Thu Aug 22 19:36:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqYP563RWz5TWKD; Thu, 22 Aug 2024 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqYP55TkFz4Q5N; Thu, 22 Aug 2024 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724355417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5owFQc08hLO3EsaoRPqQQ/1JoLUqZsWe1LzTAF1TC/U=; b=s+t1/2a6PM95t2+HyNeyTMKcUj8ftPTFYxpQfxNqVbQSimzpxmoV96PQ8FmcFvg1djHaZB +nliP4KI0xBkoQlis/P56XKSOYgxUshaCnASmZy3FUdsQgKV16cVacVJ190xDF1HbCJZ3a skv7htt4xKCnI0yNvgpzb9JONRU631Cg9TmyHjV5iB/Xydz8+kZ5Ox56dDdURYjIZAddRT fafutho5ztuCSKrerXjVAekmnbvCb9bDbvxSSTvOR2q47QtiCK55S8oI0s1Yv3Pxb+uRq3 /9HzCmopk7BpGh1vVsETuJND9ybwqd+zwT0ARjfXmzh2WJMbRinhDXIiZauK7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724355417; a=rsa-sha256; cv=none; b=OPIcBTNQCwWvyvmoWTb3axTDU0/rokLuwSUCHikj+JknIGmu4CR7HHYGnvVmSR6+xpum4M /+32I+ltiOeOmpTuM9DXfBm05edfMWFg9R9ipTX9ojcRVtQIJdWmZjv8swiUCJmgOJv2db DV8DaLktF0IaLWXtDcxHHpXxgyIWqUU9bK4JpZNxDHOaR7SKhm+9CS5sWZ8XofxnD8Fs9m H/MKu8kEqJ6F7RWRdas80HLD3TLCZhAgphUBqAqN1I7UibrITXckBTVBN0xF4P+uig599M HmEO3Pn4ti5NKTjfbBsa4MMl7R/Gn88SqtsbIC7kb4ta4fgzjpbbPCES1bsG2w== 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=1724355417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5owFQc08hLO3EsaoRPqQQ/1JoLUqZsWe1LzTAF1TC/U=; b=rZnR0WZxnqabpZc6Xkm/Jl+egkmuqH+gp5vo8Ilvzm0YicwOuAunV6z5CBpRR4M2P0KzAi ZpEOdMyr0TGDFjvDBYGPDovzBci/V6mpm9qiAsCgOlsyJR2iA3jQCNYh4m3ilQ8AcJtRwV awmJGgjLtO52j85nbKfXvbEd1DjCbReHWxLOm3usx9uIoVhSdH7nIipHyc4IKJJnPKgoBW Ewha7FEGZ0VeEG7o2Rx+hsVrhdXRBYWYt91P74ywL3Wio0qiEKdcm09iZ6JdRuLmdJg9Pk 9HVNwYK7ldcqUwG9fG35P76QbCq7ZP+baQtlewApFGlBLSwEXXe9qViEO/pfYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqYP5528tzh1Z; Thu, 22 Aug 2024 19:36: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 47MJav01034779; Thu, 22 Aug 2024 19:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MJavV9034776; Thu, 22 Aug 2024 19:36:57 GMT (envelope-from git) Date: Thu, 22 Aug 2024 19:36:57 GMT Message-Id: <202408221936.47MJavV9034776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 33658afd4e4d - main - rtld-elf: Pass parsed aux_info to ifunc_init List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33658afd4e4d11cd71d92e52ca9da5381cdd829b Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=33658afd4e4d11cd71d92e52ca9da5381cdd829b commit 33658afd4e4d11cd71d92e52ca9da5381cdd829b Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2024-08-22 19:36:44 +0000 rtld-elf: Pass parsed aux_info to ifunc_init Currently we pass the raw pointer to the on-stack auxargs. This can legitimately have fewer than AT_COUNT entries, so the use of __min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also needlessly forces the callee to iterate over the elements to find the entry for a given type. Instead we can just pass aux_info like we use for everything else. Note that the argument has been left unused by every callee since its introduction in 4352999e0e6c ("Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86.") Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46276 --- libexec/rtld-elf/aarch64/reloc.c | 2 +- libexec/rtld-elf/amd64/reloc.c | 2 +- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/i386/reloc.c | 2 +- libexec/rtld-elf/powerpc/reloc.c | 2 +- libexec/rtld-elf/powerpc64/reloc.c | 2 +- libexec/rtld-elf/riscv/reloc.c | 2 +- libexec/rtld-elf/rtld.c | 2 +- libexec/rtld-elf/rtld.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index f76ce7f4d580..3687c9385326 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -452,7 +452,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 9c5887def356..2e24d6287ea3 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -499,7 +499,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index 4683ebf74fee..b10e6ce844d5 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -442,7 +442,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 04a8354343bc..c91239eb3989 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -464,7 +464,7 @@ rtld_cpuid_count(int idx, int cnt, u_int *p) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; int cpuid_supported; diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 5618efb7f716..82a9669e3e73 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -813,7 +813,7 @@ powerpc_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 2d06d5821d1b..70acd0ac390d 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -710,7 +710,7 @@ powerpc64_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 43522a5a790f..5ea005a813cb 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -376,7 +376,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1f0c59722ac6..a8db1198a899 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -904,7 +904,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) exit (0); } - ifunc_init(aux); + ifunc_init(aux_info); /* * Setup TLS for main thread. This must be done after the diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 656e980c6261..5527671d647e 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -438,7 +438,7 @@ int reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *); int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *); int reloc_iresolve_nonplt(Obj_Entry *, struct Struct_RtldLockState *); int reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *); -void ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]); +void ifunc_init(Elf_Auxinfo *[__min_size(AT_COUNT)]); void init_pltgot(Obj_Entry *); void allocate_initial_tls(Obj_Entry *); From nobody Thu Aug 22 19:36:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqYP6715Qz5TWPt; Thu, 22 Aug 2024 19:36: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 4WqYP66YtCz4QBL; Thu, 22 Aug 2024 19:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724355418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+j5nvK77ZhyFp2t3OcupZG0A9ncMYFXcnW7FmBOKBO0=; b=qQmwUcAsmrclJK5IGrAgdpv6qgjdgUyaLhPJ1QCV68YA9cNhm0cSYK0dvGNGOObgQ7RN5O R9+PRwrwmOOm0WKuOKS3cwrkkk5D4ub0hmlXbenuBSmBLlC6njJRs7EyRHg4O+WQ9QPgG4 fxjWcH1FWEVn6zcwOzzTEMH+vtj8gxfb3HsKyTB2lpAlvap7bSimQa5xhyIfu44VGKhTZz TjplfczA2+zsV18RneSqRRAeCAKSNDAwr0krlPlQFAJTJmgQSzH5nfSj8NRm8/EOCdduDb hQE/h3nZGIL41vGcksmes/8d2T74oFX4DrHSIVUZRiM+qzX99fv2lAWZzTRbUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724355418; a=rsa-sha256; cv=none; b=EUc4O2wU7sM6C+Vpgmzem9gBStWSCrb2i0uM2OqzXeSt+PtikqGCx5hawsZBzFUOHh6wRr C786mfsWBtHmhAvxJQfqy7KmZCy36WpFonNgLne0t0iRGcoX701OYNMgc0/fa0QGS2aMM2 YQ6EbbS1Lw4TdI3pp/6IH03cMy4tTY5ZJISUGDpuFEbzmzFBe+0oA+N3PuJE/JGEkdag8N KXHl5RLgtY5VomM8BCer8pht9Q4Gb5xJoNNiNuW1rIXunOGF/hVYVvJHwV1q5dnwyhBvfk PquVZZYvnLCWCkalSlx1B0gSlM5vjx2EqGqg20cbv45Q9y9Rp0WjA2YSlJulpw== 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=1724355418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+j5nvK77ZhyFp2t3OcupZG0A9ncMYFXcnW7FmBOKBO0=; b=kEQdFRZNGSFrUR2OVIh/9eVyqb6IGvL/op66/Wwq7iZpCTMmyUCQOfz9s33v7QJ6k89lk5 AqJZXFCc6vK/7dHeQ6Zt1f1quQgyUL90YnnTSShelFA/x0jSO9D5bxn5NjMVkH/MjceaNI vgcincrD5N9foonu+Esu1p+roPbMErqeEyy77L5cirx3g1uo06v/U7IljRDBdD++OFDExo gLP2v+TX0+XB93dUicU1qj4IMrztc1DJ92QZlOI1F82haa7GfQ64UlokNKJzp+4f7YkYxU 4XHJ3jrLyOIlAikVCgHw51zhMbaVCMJGSLJrA44TQTRCfSg2d5nnvhSxCIjUHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqYP662jxzgjl; Thu, 22 Aug 2024 19:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MJawM3034824; Thu, 22 Aug 2024 19:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MJawYE034821; Thu, 22 Aug 2024 19:36:58 GMT (envelope-from git) Date: Thu, 22 Aug 2024 19:36:58 GMT Message-Id: <202408221936.47MJawYE034821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 228a3e73e169 - main - riscv: Recognise B extension for AT_HWCAP List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 228a3e73e16983bc7f985b24ef20909500792d3c Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=228a3e73e16983bc7f985b24ef20909500792d3c commit 228a3e73e16983bc7f985b24ef20909500792d3c Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2024-08-22 19:36:44 +0000 riscv: Recognise B extension for AT_HWCAP This was ratified earlier this year as an alias for Zba_Zbb_Zbs. Whilst we don't currently export multi-letter extensions, we can still export this alias in AT_HWCAP. Reviewed by: mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46277 --- sys/riscv/include/elf.h | 1 + sys/riscv/riscv/identcpu.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/riscv/include/elf.h b/sys/riscv/include/elf.h index ff0f36d2efe6..a14d6859902b 100644 --- a/sys/riscv/include/elf.h +++ b/sys/riscv/include/elf.h @@ -82,5 +82,6 @@ __ElfType(Auxinfo); #define HWCAP_ISA_C HWCAP_ISA_BIT('c') #define HWCAP_ISA_G \ (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) +#define HWCAP_ISA_B HWCAP_ISA_BIT('b') #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index c681edfff47b..203edb3689bc 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -245,6 +245,7 @@ parse_riscv_isa(struct cpu_desc *desc, char *isa, int len) while (i < len) { switch(isa[i]) { case 'a': + case 'b': case 'c': case 'd': case 'f': From nobody Thu Aug 22 19:36:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqYP82pGhz5TWD1; Thu, 22 Aug 2024 19:37: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 4WqYP81Bs1z4Q3F; Thu, 22 Aug 2024 19:37:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724355420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ua4Qs4OA+m7rCGvRIeI8jvUlKdtkGP28iORzUfIsTYY=; b=hBTk+3EKhrWAZnaaQvzQbxUN8Ho9IxYAZA16w+Fsiiehx+xEOnc/JhHS1JaoTuIKmi8DF3 0bYHy9SEEnS2ezHa64wgQf7rzI/r4zWJS5p0kShpqi4yBCSj83fC9EbahXu7WUxcVQLIvp 45rl0Lxw0SCVkb46iJy9d/eX/ygo4WbHpKjR2xtMEIn0OLsm4hK4ajzaQvaptAKUsdja7h gaY345njrag0i1nT9ePCl8vMFjL+3/uMeEsMib279ogrrerpRiMxnwAy/yB8d+RD1ZeCh1 nLtgb3OaE1giKX8+AeMCZZIp/KbpIoRcg7riTgtI9qcf8xXyaBvfSKRATzCkuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724355420; a=rsa-sha256; cv=none; b=tgzQu2uXMfQfAA5ag+OctIzk4NZygq9hDhJbrHK7W+ZjZuCykjobi96SZSvGSvexsinWIx eQ/RQQgewjrQGbLYV7DNZCE25cUoAulnnA+ehfUtFA94GUkyOiUAUTwW4IMNFqo3RW5enQ Wki/bfd4n2TNE1rDJcgYnaLXNW33T0IVSmWML6JJ352L71msLTJ/PL0OKhCt8YW25B+Ylt dH97GIJCJiFrIAX0ne+BgNhE8Xlpt7XGeq/LrNOBLIUS7d/JvyyfmzK371NHK0Sk+9kBi7 AWHbIUfoAv3GL7gWPKraztcLfivaPkYrABwm+/gRKAZIecy79tjoya6EKoB0/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724355420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ua4Qs4OA+m7rCGvRIeI8jvUlKdtkGP28iORzUfIsTYY=; b=eBNxMbhoggO4XhGsNJSD9LoqvGAVmm5b/gvdXQybVlTmoM3DUrrI2hynU5MKoxwfifAI3G Lf+EptCVuEeeFHJf8Perq4yg2c3p/I2xl7tg4b3F7ouO+fbOz9yAds+DbepUxBvHQ62nG7 scqoLPzcvg6umAk/bnmKwtbjB+uqzqP7faMeWvfyHY4O3WmWhO8GfmNPkH6mT7XUlKAHAR fSotDyXtOrA2XNkKekAm/irt2f28BjhgTG1KDUYVmZgyKLQC7nM7T4k545JcNbh6keLt8O KubbL0MsacqQV46NvI9kqewzhUv6O03wQw9fOUzkmGhZ8We2YxNfEu9oayUONw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqYP772sVzh1b; Thu, 22 Aug 2024 19:36: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 47MJaxKE034868; Thu, 22 Aug 2024 19:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MJax47034865; Thu, 22 Aug 2024 19:36:59 GMT (envelope-from git) Date: Thu, 22 Aug 2024 19:36:59 GMT Message-Id: <202408221936.47MJax47034865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 729d2b16b74f - main - rtld-elf: Support IFUNCs on riscv List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 729d2b16b74fa5207a12aa1de190bd930432810e Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=729d2b16b74fa5207a12aa1de190bd930432810e commit 729d2b16b74fa5207a12aa1de190bd930432810e Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2024-08-22 19:36:44 +0000 rtld-elf: Support IFUNCs on riscv GNU/Linux has historically had the following two resolver prototypes: 1. Elf_Addr(uint64_t, void *) 2. Elf_Addr(uint64_t, void *, void *) For the former, AT_HWCAP is passed in the first argument, and NULL in the second. For the latter, AT_HWCAP is still passed, and the second argument is a pointer to their home-grown __riscv_hwprobe function. Should they want to use the third argument in future, they'll have to introduce yet another prototype to allow for later expansion, and then all users will have to check whether the second argument is NULL to know if the third argument really exists. This is all rather silly and will surely prove fun in the face of type-checking CFI. Instead, be like arm64 and just define all 8 possible general purpose register arguments up front. To naive source code that forgets non-Linux OSes exist this will be compatible with prototype 1 above, since the second argument will be 0 and it won't look further (though should we start using the second argument for something that wouldn't be true any more and it might think it's __riscv_hwprobe, but that incompatibility is one we can defer committing to, and can choose to never adopt). Until the standard interface for querying extension information[1] is settled and implemented in FreeBSD there's not much you can do in a resolver other than use HWCAP_ISA_B, but this gets the infrastructure in place for when that day comes. [1] https://github.com/riscv-non-isa/riscv-c-api-doc/pull/74 Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46278 --- libexec/rtld-elf/riscv/reloc.c | 140 ++++++++++++++++++++++++++++------ libexec/rtld-elf/riscv/rtld_machdep.h | 5 +- 2 files changed, 122 insertions(+), 23 deletions(-) diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 5ea005a813cb..aa2cc97ae769 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -152,10 +152,20 @@ reloc_plt(Obj_Entry *obj, int flags __unused, RtldLockState *lockstate __unused) for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; - assert(ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT); - where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - *where += (Elf_Addr)obj->relocbase; + + switch (ELF_R_TYPE(rela->r_info)) { + case R_RISCV_JUMP_SLOT: + *where += (Elf_Addr)obj->relocbase; + break; + case R_RISCV_IRELATIVE: + obj->irelative = true; + break; + default: + _rtld_error("Unknown relocation type %u in PLT", + (unsigned int)ELF_R_TYPE(rela->r_info)); + return (-1); + } } return (0); @@ -187,6 +197,11 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) return (-1); } + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + obj->gnu_ifunc = true; + continue; + } + *where = (Elf_Addr)(defobj->relocbase + def->st_value); break; default: @@ -199,30 +214,89 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) return (0); } +static void +reloc_iresolve_one(Obj_Entry *obj, const Elf_Rela *rela, + RtldLockState *lockstate) +{ + Elf_Addr *where, target, *ptr; + + ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend); + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + lock_release(rtld_bind_lock, lockstate); + target = call_ifunc_resolver(ptr); + wlock_acquire(rtld_bind_lock, lockstate); + *where = target; +} + int -reloc_iresolve(Obj_Entry *obj __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; + + if (!obj->irelative) + return (0); - /* XXX not implemented */ + obj->irelative = false; + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_IRELATIVE) + reloc_iresolve_one(obj, rela, lockstate); + } return (0); } int -reloc_iresolve_nonplt(Obj_Entry *obj __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_iresolve_nonplt(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; - /* XXX not implemented */ + if (!obj->irelative_nonplt) + return (0); + + obj->irelative_nonplt = false; + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); + for (rela = obj->rela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_IRELATIVE) + reloc_iresolve_one(obj, rela, lockstate); + } return (0); } int -reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, - struct Struct_RtldLockState *lockstate __unused) +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) { + const Elf_Rela *relalim; + const Elf_Rela *rela; + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; + + if (!obj->gnu_ifunc) + return (0); - /* XXX not implemented */ + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT) { + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) + continue; + + lock_release(rtld_bind_lock, lockstate); + target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); + reloc_jmpslot(where, target, defobj, obj, + (const Elf_Rel *)rela); + } + } + obj->gnu_ifunc = false; return (0); } @@ -232,7 +306,8 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Elf_Rel *rel) { - assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT); + assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT || + ELF_R_TYPE(rel->r_info) == R_RISCV_IRELATIVE); if (*where != target && !ld_bind_not) *where = target; @@ -251,13 +326,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, const Elf_Rela *rela; const Elf_Sym *def; SymCache *cache; - Elf_Addr *where; + Elf_Addr *where, symval; unsigned long symnum; - if ((flags & SYMLOOK_IFUNC) != 0) - /* XXX not implemented */ - return (0); - /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). @@ -285,8 +356,27 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (def == NULL) return (-1); - *where = (Elf_Addr)(defobj->relocbase + def->st_value + - rela->r_addend); + /* + * If symbol is IFUNC, only perform relocation + * when caller allowed it by passing + * SYMLOOK_IFUNC flag. Skip the relocations + * otherwise. + */ + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + if ((flags & SYMLOOK_IFUNC) == 0) { + obj->non_plt_gnu_ifunc = true; + continue; + } + symval = (Elf_Addr)rtld_resolve_ifunc(defobj, + def); + } else { + if ((flags & SYMLOOK_IFUNC) != 0) + continue; + symval = (Elf_Addr)(defobj->relocbase + + def->st_value); + } + + *where = symval + rela->r_addend; break; case R_RISCV_TLS_DTPMOD64: def = find_symdef(symnum, obj, &defobj, flags, cache, @@ -365,6 +455,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, case R_RISCV_RELATIVE: *where = (Elf_Addr)(obj->relocbase + rela->r_addend); break; + case R_RISCV_IRELATIVE: + obj->irelative_nonplt = true; + break; default: rtld_printf("%s: Unhandled relocation %lu\n", obj->path, ELF_R_TYPE(rela->r_info)); @@ -375,10 +468,13 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, return (0); } +unsigned long elf_hwcap; + void -ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)]) { - + if (aux_info[AT_HWCAP] != NULL) + elf_hwcap = aux_info[AT_HWCAP]->a_un.a_val; } void diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index fb5f5643efc6..c6600b583612 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -83,8 +83,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, __asm __volatile("mv gp, %0" :: "r"(old1)); \ }) +extern unsigned long elf_hwcap; #define call_ifunc_resolver(ptr) \ - (((Elf_Addr (*)(void))ptr)()) + (((Elf_Addr (*)(unsigned long, unsigned long, unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long, \ + unsigned long))ptr)(elf_hwcap, 0, 0, 0, 0, 0, 0, 0)) /* * TLS From nobody Thu Aug 22 19:37:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqYP93dFhz5TWD3; Thu, 22 Aug 2024 19:37:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqYP9192Zz4Q3R; Thu, 22 Aug 2024 19:37:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724355421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogYqeeVVGaZ1GurMS35gJkdgm/VkHUT6wtYoBH+IeeA=; b=mz6KSVV4IdMtR+XNobRf4MboI+DYZYmeP8agxGJQzXR1vk+eskOB8LoLKq6SGHjJ4UVrdG n64Nb0+cBzp7NzLGdnA0cW1cgihnRFQWSsWYEpXqpSz6djzZWclGdPfq3TtgSYyf3si/+X bH/06ES7pKYmN8vAZVHJDfzvAvPzQob8Omlk6TYHXNwBr1tlWmxY1TVMhz+aR8Smu5ERm1 0mTxRe1ey7oB9FJUJ3rgF+wiHdiippbp9CFLcc210VDku5E96WDR/p27EoBG+CLioiqgZG 17OaadYMuIjPQUql4FXlohnHQlSjlBW2fGdOPb/I1U/cnF2OK52F3wnbBFE1oA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724355421; a=rsa-sha256; cv=none; b=HwNUovn5Ps/N4mVOn0kcvQ8I8cphGcxdBnAC+mTT7UHtWWoUL6c2FgF9hjtO1baYOkAOy3 9L8Dj/Y65q+O3hULpYGu02/gQNsKCARlt7kwPg+EJCMAbb/WFH2eBfs2qPFJVF+NpsjqHr 0L6z3CXG0XZP4Y8VyVLwZ8a9XlSmdVSTC/e1U1NqqpUzlmbZKis8bKINos1zmH24W6AHiN qTCCl5Og0nwgcpz1HAOJETtUo3oPQnjyBzzf7pMZMoxS0jQjcLQgE/+hJr3PbIB93SFuSg Uca+7Tu+OmhdH3dQKOiAsCbYZHq1Iz9qeQnpPa2QC48LQvTn1KLTeljM7TSMEA== 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=1724355421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogYqeeVVGaZ1GurMS35gJkdgm/VkHUT6wtYoBH+IeeA=; b=umGZlL8i3GSQtQ4OMkroSDLJ1QfXj3rZPmLmBw+lyrdawc7J6swNsIqCT25uTcxzyT0ncT UMTNV8rbhZeOz7KJcX4KSvf7NDCMa8WPP5YI5PxlnCsHW0rwFuRMFztuREdNG4LX7y7mKL Km1cf1qbIqaO344Z+DZC7gyMspBpnkAW2Fn5NUiJWdiH12DDA/m2e1IzOUMm5/Hd4eYIa9 CIu0wquKJ+g7a6W35Dg0Tuz18eeNQyWUEYu4U+j/YvDpja19Vov3gpuvdyBBvU7Xtjovq0 +TItPxxVRf5HAncNWm8gCHPbjyMzDfZiGfAz65VnRz+Qlbi6yKPdKxkxeTZxCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqYP90gnKzh42; Thu, 22 Aug 2024 19:37:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MJb1bP034931; Thu, 22 Aug 2024 19:37:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MJb1OP034928; Thu, 22 Aug 2024 19:37:01 GMT (envelope-from git) Date: Thu, 22 Aug 2024 19:37:01 GMT Message-Id: <202408221937.47MJb1OP034928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 8afae0caf4c4 - main - riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8afae0caf4c4816eb56b732fcd1a4b185e86098a Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8afae0caf4c4816eb56b732fcd1a4b185e86098a commit 8afae0caf4c4816eb56b732fcd1a4b185e86098a Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:45 +0000 Commit: Jessica Clarke CommitDate: 2024-08-22 19:36:45 +0000 riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface Reviewed by: kib, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46279 --- sys/riscv/include/ifunc.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/riscv/include/ifunc.h b/sys/riscv/include/ifunc.h new file mode 100644 index 000000000000..0f9747a2aa14 --- /dev/null +++ b/sys/riscv/include/ifunc.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015-2018 The FreeBSD Foundation + * Copyright (c) 2024 Jessica Clarke + * + * Part of this software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __RISCV_IFUNC_H +#define __RISCV_IFUNC_H + +#define DEFINE_IFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(void))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + static ret_type (*name##_resolver(void))args + +#define DEFINE_UIFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(unsigned long, unsigned long, \ + unsigned long, unsigned long, unsigned long, unsigned long, \ + unsigned long, unsigned long))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + static ret_type (*name##_resolver(unsigned long elf_hwcap __unused, \ + unsigned long _arg2 __unused, unsigned long _arg3 __unused, \ + unsigned long _arg4 __unused, unsigned long _arg5 __unused, \ + unsigned long _arg6 __unused, unsigned long _arg7 __unused, \ + unsigned long _arg8 __unused))args + +#endif From nobody Thu Aug 22 20:21:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqZN13bcGz5TZT5; Thu, 22 Aug 2024 20:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqZN139skz4V4g; Thu, 22 Aug 2024 20:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724358065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmD9dJWyk2IkE8wv0KgLPOUNQu625VuAE3q7sqB4Nig=; b=GN/vaWny3R/iy/jcIgTxjnFdBCLIHJRZCRmuE/jlG4owMUG84zqqxOYFfLSZRFP6JZvuE2 kOBZRUmKkplV2q7LvFLbEDIuiM9Y/dlSApqdlM/OVytppsD0srjJXh3yQdzkKUxy7cJ53+ z36xM8UnHmzOqFhFH+pI0wvPz8BMEgnRCEGUrt/Z9HYThOaXko9vrSvYPZYWAmtbi+/yQ4 Bp1n+6LiND+EIUquNFqHNwZkEKJb+0rEL6oa1kH4UdMq0W5eds+mwljToKDpNu24tGybnV V7Nw8CFVg17Yj81TU0ZrvJdAs07d15E/vis+G+ZAUGu3bgFs7zBjfff1Q1TnUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724358065; a=rsa-sha256; cv=none; b=wCBjyrbKzbpNM1FwPVCa3E996hsgV2o6ILuMfves/FEQqdwS6R06R+qhsbPjDbmSvhBdTn cQXlLx34+2rlpX4ZJ5q9O1yM20/pvoVcgrzMHKS7lnPPSVoD6VWzL57TkdZUHbkiT4aIbP t2g9h04qoaSISI7mb9kT2yNg9AthQl5dRcdij6GxjEP4kMgl+M8dD1sJQ4zUNjL7tJrobw gLsXmM1jyHwEW5Ef+KeWidMGT0xxIiEOjGXaZKNnQZZ+7svNflug8ZhLuBB+T0+Zf8Lslm o7BMLHw82qeEQZQbFkS2R0uRv++jH5/rlu/dCOaxEedxe90IpJwEH2OwuyeZSQ== 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=1724358065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmD9dJWyk2IkE8wv0KgLPOUNQu625VuAE3q7sqB4Nig=; b=Khpobcvq/7iJMlQBgjtxwBO2BeSj7ij85pl/3xGUMBxXq8S4ijQrIgAhO/Il8yBxpeVMgE DfSK2qmUdb8QfbayHNsmScIu9NuMhtCOg5Z6NLnFgtjI0GFLHVqk7ZphGmZ9hhxyRewwRH nTbAJmuRF+Nv9dwIwwzjF8OGOsZwe4ijUQgDceeQY/3ZuvVe598TPy2PqO0hCBidfs5kiz pDIBBceEtva4eBQjyNy/m4Z4U2cRQBlxI4y9riFjR5DQ+CTZW+0mDExDirA0RotEBqNrBR dj8oxUJGtcTceOt+WftELT/w6170SEIEvl5e1L53C37tzd1a5PDVPqydl/lsWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqZN12n3mzhTx; Thu, 22 Aug 2024 20:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MKL5tt012896; Thu, 22 Aug 2024 20:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MKL5O2012893; Thu, 22 Aug 2024 20:21:05 GMT (envelope-from git) Date: Thu, 22 Aug 2024 20:21:05 GMT Message-Id: <202408222021.47MKL5O2012893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e41364711ca3 - main - tcp: improve consistency of SYN-cache handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e41364711ca3f7e214f9607ebedf62e03e51633d Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e41364711ca3f7e214f9607ebedf62e03e51633d commit e41364711ca3f7e214f9607ebedf62e03e51633d Author: Michael Tuexen AuthorDate: 2024-08-22 20:17:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-22 20:17:05 +0000 tcp: improve consistency of SYN-cache handling Originally, a SYN-cache entry was always allocated and later freed, when not needed anymore. Then the allocation was avoided, when no SYN-cache entry was needed, and a copy on the stack was used. But the logic regarding freeing was not updated. This patch doesn't re-check conditions (which may have changed) when deciding to insert or free the entry, but uses the result of the earlier check. This simplifies the code and improves also consistency. Reviewed by: glebius MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46410 --- sys/netinet/tcp_syncache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 025b071eb1ca..33a6a66b7138 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1720,9 +1720,7 @@ skip_alloc: * Do a standard 3-way handshake. */ if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { - if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) - syncache_free(sc); - else if (sc != &scs) + if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); From nobody Thu Aug 22 21:07:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqbPw00d6z5TfHb; Thu, 22 Aug 2024 21:07: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 4WqbPv4dr6z4ZFQ; Thu, 22 Aug 2024 21:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724360867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TOP1lpj6hJ810P8t2KIEVpOnxSpKA2Kp2l/DdoeH4TA=; b=n8jVoD8WwIGSM9Qgkur2/Y1KCwG9o4VZQAd2IanKyNmZqCNIZT+yRzX+Ni9NOTA9UvT5/m HIryCEqX1v7flOVi9Nz0ukO44aNDeP4oM3Vj5BQ6AP8QHOMDCTJ1/8SBb8tYNPhdjhd2Qb GG3JGSdY1DzMUuqdLQI43LRZQLIhgTCuCukVoV7fLssQ/wAIv2oiurxIn5O7lJm58v/+rI urtlIQV6+85jHpqp1zntbiI9CRH11gaWtZDVZ1xGIqPzb/cCETFKaisChG0MhHKZkUoGB3 uwL0974nbE9c9gjUh2lQAVjlzFHplWfaGW9YUu5ZAph1PqMh0gXl7cmv23jWww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724360867; a=rsa-sha256; cv=none; b=DBadTEE1bvteekKH4h+m4462hZ4jc0R3bAaqS5XERZX+ooMtijRLzgRs6GItt31lNExzP8 /WB89q7arjHGoth5GY0pdv2D/Ufi5BSE9Ds0X4gW1pMyWBgNBns5DQtxG2b+ds22O0iO31 y8T0LbSui/adoGCuPZw20YzqchLeQtxfhSh+pAZEjikFwIlERvl15otONwPrMcDlEP4uSm wU56uB+n21pzo0dxCmEw8h/UADLwdJt4AVKaRzkGZVzUL59Ly4vX8D9G+OfZSvTAySepb4 aKIpt61ZWJ5HyHE9zTG4Pz2Vv8j0EGpL7ayZF++DkYiWgB1C2YL/O8h8SRg8Xw== 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=1724360867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TOP1lpj6hJ810P8t2KIEVpOnxSpKA2Kp2l/DdoeH4TA=; b=Ys+oWeo+G8pwWoURqFi1IbVLu8nf1dd8vHkEloXzeXEJjSisMuGsrPLOkMVBc8VzrQvJPz bxX/S8aIME+8F+qmTR/6FLU7llBAzFvoayoeRA/Etu1/hXkaVSiAm/Jyj006Fzr/jIucQv CPeULTxmxZ2PDWFlHkPI1nwWZvkpjJZ1XM4WbpZfvKeVZfKxC5JWe2L/48vSel84j8QBp1 qipep8wZ5zOjvWnT2mb5A3gditJpjmQWCVyxz4McuL5NidDcA7Mb8YduRucAWUU3tpHvKN TdROx8rJKEqBkTi1RPq44oKibBSOLN1RCTy1A9SWDyAXogQRHeli6SkQ0wTUPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqbPv4F30zkKG; Thu, 22 Aug 2024 21:07: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 47ML7lLC088410; Thu, 22 Aug 2024 21:07:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47ML7lpL088407; Thu, 22 Aug 2024 21:07:47 GMT (envelope-from git) Date: Thu, 22 Aug 2024 21:07:47 GMT Message-Id: <202408222107.47ML7lpL088407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 6aee1dc48006 - main - pam_xdg.8: the module option name corrected List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aee1dc48006445b6e062db86c5c3697b04b98f6 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=6aee1dc48006445b6e062db86c5c3697b04b98f6 commit 6aee1dc48006445b6e062db86c5c3697b04b98f6 Author: Maxim Konovalov AuthorDate: 2024-08-22 21:03:59 +0000 Commit: Maxim Konovalov CommitDate: 2024-08-22 21:07:10 +0000 pam_xdg.8: the module option name corrected PR: 280994 --- lib/libpam/modules/pam_xdg/pam_xdg.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.8 b/lib/libpam/modules/pam_xdg/pam_xdg.8 index 1a8b53def051..9b97d3626531 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.8 +++ b/lib/libpam/modules/pam_xdg/pam_xdg.8 @@ -22,7 +22,7 @@ .\" * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" * SUCH DAMAGE. -.Dd February 21, 2024 +.Dd August 22, 2024 .Dt PAM_XDG 8 .Os .Sh NAME @@ -42,8 +42,8 @@ By default the directory is created under .Pa /var/run/xdg/ . .Pp The following option may be passed to the authentication module: -.Bl -tag -width ".Cm runtime_dir" -.It Cm runtime_dir Ns = Ns Ar directory +.Bl -tag -width ".Cm runtime_dir_prefix" +.It Cm runtime_dir_prefix Ns = Ns Ar directory Use an alternate base directory .El .Sh SEE ALSO From nobody Thu Aug 22 23:37:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqfkV5hPqz5TrCt; Thu, 22 Aug 2024 23:37: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 4WqfkV4hRLz4pQn; Thu, 22 Aug 2024 23:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724369842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VeHq6ZltpgZ/kSzxGMbiu7jlnERYiLmGYs1Z6ftlk4U=; b=CXg1nmq/zTYEEBXgNL7AWFgW2DLZaMbGuXYRtlW2DYy+lvOQrp0mvHVx8c4LS286MfY2Qn HbS6BjKzTBQKepcSGe4POGMGV5ABoWWE50xfEsRhAC7Z+aVQLNJC7nMkfsp2P6ixxyKZ9D zNRZM+m0wB8sumK6TIJVEd5qVeqQWjH6w+hQgKo5hBL+w8b5+UmFFb8ihzC894cS6T8mXP NRwYZVHcaYNeopaVEFJneJkBEMyOWDPP9wDDX9ToZz0T/bD8xq/rMUhs74aQ9jRf0Rjbr9 nwHJwPzPP+4KjrM3KSQ1cXjMnyyB7SpOss+aBG0NVf+oG5fBg0vs4K8M19pfXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724369842; a=rsa-sha256; cv=none; b=aeioZB5PfDTeOZ7SpLoostK2KxGsIo4SK0NiEqGffdIIx5iB4FZ/KILUMvWbEsLLj0866p YO9sB/hJ0Cr5LJ3hjIkFaDvUpEgsFUSQ8tmcU861wVU0AdoBoQlTpAz1KCxQQ/Tde5E5IK BIuR8nbedH4OxcsJzX2I7CmTrwYNNmIJrJF081csWvm5wN82isJvVzP83uIHlmlHPBHCp4 SNqnDrNoCNGGialsnzBzHVBTZaIumG+OJv2KC/JGFD/Pxewc36UowwI5SO9XfkyB4ve+en Q8c2LcXzCocd4ivmOptOZFV5WQ11+pmTxkJQiJmzCsO0fhM5PINCbvU6DKIrLQ== 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=1724369842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VeHq6ZltpgZ/kSzxGMbiu7jlnERYiLmGYs1Z6ftlk4U=; b=dwCO6Gi2bMQuakLAIdYax8nMwPxdyWuAN+31VdYSh4bIIL8rmaFYbz2bK7WjAt7ltaNvj2 r9i3i4l/EXYykTQh1uzozgHbqSm+eN4XKD8y7mQJ91VzoaLWcsYp16yvbevbd5Yf2RGB64 QcyBQZlVnE7pnH61eM+7+2Mk4KPHcqr6z+AdARsXu24ckA6KW5ATRoH42vfpNEnH2CchI+ SA4mFt57c+e0aHvkxv7fFecE7tbR5itmdMVN5xUJevwgFF8DWp4TCye7/SiuFRqTQrH19A 5eUfHXCFKaJAuu128pS65TWJLI9gmAvgByGbVfBSUmVBCa+OzVqrj/v4Ee75fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqfkV4B8Jzngr; Thu, 22 Aug 2024 23:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MNbMSG041067; Thu, 22 Aug 2024 23:37:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MNbMeJ041064; Thu, 22 Aug 2024 23:37:22 GMT (envelope-from git) Date: Thu, 22 Aug 2024 23:37:22 GMT Message-Id: <202408222337.47MNbMeJ041064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 101afbc6ee2f - main - loader/menu: tweak for added line List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 101afbc6ee2f06f77e6886f1f3ffe115c579967c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=101afbc6ee2f06f77e6886f1f3ffe115c579967c commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c Author: Warner Losh AuthorDate: 2024-08-22 23:28:51 +0000 Commit: Warner Losh CommitDate: 2024-08-22 23:28:51 +0000 loader/menu: tweak for added line I added a line to the menu, but didn't adjust so things were a line off. Make the necessary adjustments. Fixes: 7cb65be96d47 Sponsored by: Netflix MFC After: 3 days --- stand/lua/drawer.lua | 2 +- stand/lua/menu.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index a009b78164df..3a462930b86b 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -472,7 +472,7 @@ logodefs = { brand_position = {x = 2, y = 1} logo_position = {x = 46, y = 4} menu_position = {x = 5, y = 10} -frame_size = {w = 42, h = 13} +frame_size = {w = 42, h = 14} default_shift = {x = 0, y = 0} shift = default_shift diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 0587e5ae6586..ed84360d93b0 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -535,7 +535,7 @@ end function menu.autoboot(delay) local x = loader.getenv("loader_menu_timeout_x") or 4 - local y = loader.getenv("loader_menu_timeout_y") or 23 + local y = loader.getenv("loader_menu_timeout_y") or 24 local endtime = loader.time() + delay local time local last From nobody Thu Aug 22 23:52:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wqg485h18z5Tsc2 for ; Thu, 22 Aug 2024 23:52:40 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wqg482BFtz4qtG for ; Thu, 22 Aug 2024 23:52:40 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5bef295a429so1990557a12.2 for ; Thu, 22 Aug 2024 16:52:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724370758; x=1724975558; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oE33Jgf4TE10QmS/9xN+8Iu/tuLYDd9dRTDY76Eh+Vw=; b=k+55gXCPRltXWvmqmUkVwoE5L83wsOtAhqvtOPZJ1YlYpoFPxxv1GvdGWs8frNR6yx 6gNlJwLoSF9xItDi/uQ/uaDr/NoALe1pni9esMWFHU/5dt8lizaxSzz14rawahSKd+Zp eaDRPGDm36kpHjvaUSa4B63po9bU1POqhwRhpjSkLHPDBl4c4y28pvyvTOD1nU9HPM5f ZqavmtDT/IuVvU14FiZDQ+ZanpQ+0rn1yx0dkVXFnTTaSa9T47f1Obgmxvf6HrSEZ+TK kdKArJMJ0rVQ8tpu4CcUPcnfNLBi/HPBIVDBOuLRRBrsYlDGQESFOuC0qdUp7iLUcP0J fpCw== X-Forwarded-Encrypted: i=1; AJvYcCUmrAI5peAQkaFszd+tRlxUHwSrgz52QEgcW8u5MLH1RbQS5Ec28+/2Jnb6pdcWqzZUNVQax5QgY41lZSFFHvi39wpg5A==@freebsd.org X-Gm-Message-State: AOJu0Yxg/ketQ0LuaENDV5SRdM7xfvBN3s/8S6uhnu9cpJRBOakAiMXz fZ5vGVkBYnAswFJ7sblKwUAi4WctzKsuXW8Y2gC7LQ8/UOabfSo68npS4XPozOc= X-Google-Smtp-Source: AGHT+IH8HeqAT+7lyA8SDSp9xb3bvsd7sMqEUXtVHyzRhYi4/QTxCnW7ao2jNye4cRmtA9Zuus5kzw== X-Received: by 2002:a17:907:d90:b0:a7a:a06b:eecd with SMTP id a640c23a62f3a-a86a518b32amr21244066b.5.1724370758389; Thu, 22 Aug 2024 16:52:38 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f48afa6sm177927566b.183.2024.08.22.16.52.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2024 16:52:37 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: 101afbc6ee2f - main - loader/menu: tweak for added line From: Jessica Clarke In-Reply-To: <202408222337.47MNbMeJ041064@gitrepo.freebsd.org> Date: Fri, 23 Aug 2024 00:52:27 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <895EA850-1C39-40F6-9710-524C4B7342CA@freebsd.org> References: <202408222337.47MNbMeJ041064@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3776.700.51) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Wqg482BFtz4qtG On 23 Aug 2024, at 00:37, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe115= c579967c >=20 > commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c > Author: Warner Losh > AuthorDate: 2024-08-22 23:28:51 +0000 > Commit: Warner Losh > CommitDate: 2024-08-22 23:28:51 +0000 >=20 > loader/menu: tweak for added line >=20 > I added a line to the menu, but didn't adjust so things were a > line off. Make the necessary adjustments. >=20 > Fixes: 7cb65be96d47 > Sponsored by: Netflix > MFC After: 3 days > --- > stand/lua/drawer.lua | 2 +- > stand/lua/menu.lua | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua > index a009b78164df..3a462930b86b 100644 > --- a/stand/lua/drawer.lua > +++ b/stand/lua/drawer.lua > @@ -472,7 +472,7 @@ logodefs =3D { > brand_position =3D {x =3D 2, y =3D 1} > logo_position =3D {x =3D 46, y =3D 4} > menu_position =3D {x =3D 5, y =3D 10} > -frame_size =3D {w =3D 42, h =3D 13} > +frame_size =3D {w =3D 42, h =3D 14} > default_shift =3D {x =3D 0, y =3D 0} > shift =3D default_shift >=20 > diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua > index 0587e5ae6586..ed84360d93b0 100644 > --- a/stand/lua/menu.lua > +++ b/stand/lua/menu.lua > @@ -535,7 +535,7 @@ end >=20 > function menu.autoboot(delay) > local x =3D loader.getenv("loader_menu_timeout_x") or 4 > - local y =3D loader.getenv("loader_menu_timeout_y") or 23 > + local y =3D loader.getenv("loader_menu_timeout_y") or 24 > local endtime =3D loader.time() + delay > local time > local last Does this mean we no longer fit a standard 80x24 terminal, or does this place it on the 24th row so just fits? Jess From nobody Fri Aug 23 02:03:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wqjyw4zW6z5V3Y7 for ; Fri, 23 Aug 2024 02:03:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wqjyw2wWZz518R for ; Fri, 23 Aug 2024 02:03:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2d3c08541cdso1167902a91.2 for ; Thu, 22 Aug 2024 19:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1724378598; x=1724983398; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rSV3skU007kpQkDpUnBoPAVTvUH36PLn52IBNlj38So=; b=Rel9++hUCWF0Bzcb2EBczjFXm6rGRJCPDIDVx6qxBWPtSYs+4Bb0J39a04qQPWL2Hs wkPSn47G+OmywFlmy/ltrWda3ne2uUx7fSz4bTJtKIPHJZ2oRSIes2rQ6eNl2sjrRmCS CeJ/0V+l973+p4sNG7rKDp4mSp1iUuosv3R7lMZLioEyGO1KsNOeuwR0BINx3IgxIfNl M1XCoIcBeGIQ65ceXGbALq5uP5oDQrDwAYBocawzNH2hHnGbTitZGsauMjd3rUhgI/I0 bYucofD+1BqFDrWlnrYcuBQ4YT9e0TyLLUXUT/7d15y4LDZ/49bhZ5YTzAgmaQlnfZfk Arfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724378598; x=1724983398; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rSV3skU007kpQkDpUnBoPAVTvUH36PLn52IBNlj38So=; b=wzVzRbFkz2QN3ouDKCJLKd+KHc8Gt77H5NxHh3rQQPpch1GZKqlS1JQJtx4yCqtT2d V6zzsEcpM4Ugw54Lnp3PtBz2Xsl7EXQnTHw7y+/dG5jP5N97n6Y3uNXBd3pX2xzMflxI XRSXbAq/TCgcj6kgJsr4I4QJeixmrvArree7BBHgko5L0IKzAg6hvtjoKaoV4BgNMyXM JaPmdpFbQwgfm3ranf2BjI0SOCVctbO2TSotkLZt/jC+AQXxOMTNl+/xHvGAyNS13+vZ GQaKzalgL1VwvMWEqZLyXGFwzZ1cQ4+Yrj+LKs2RfpipjzumXn3XjSl5WliTBSK1hrnZ Pyug== X-Forwarded-Encrypted: i=1; AJvYcCUPegiGMVwONaOcsFQs3E0y57wWYvta+lS9RwWcLuPh8ijoZ6JOZ7v8NuqDfgbCuZSOlzFbGueo3sa5T8U/M8XBAH2qHA==@freebsd.org X-Gm-Message-State: AOJu0YxubVDCcBet2hQhakFzXXAUCYtH79RymQ4F1D81AcqWYhoKVMhw RnEofgH0DdyRUgyno+3zOp2DNGXUjjElTCXgkd6YFXOy+Wbo5id13svbjZx/Mrpa4MEBF8jfB97 +iIOOIDmdk1ashVHXi3oNmBec0BKb/rW28nUK8Q== X-Google-Smtp-Source: AGHT+IG/xj5YViB1QuP0yX7Xy6ah9ZMxl4squGIhxDlIq9TeHd9VQrU9+JayB05V5HREv2Ob8pq7cJsVOQOLNisUGZ8= X-Received: by 2002:a17:90a:77c5:b0:2d0:d82:60ae with SMTP id 98e67ed59e1d1-2d646d6f656mr620728a91.37.1724378597974; Thu, 22 Aug 2024 19:03:17 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202408222337.47MNbMeJ041064@gitrepo.freebsd.org> <895EA850-1C39-40F6-9710-524C4B7342CA@freebsd.org> In-Reply-To: <895EA850-1C39-40F6-9710-524C4B7342CA@freebsd.org> From: Warner Losh Date: Thu, 22 Aug 2024 20:03:06 -0600 Message-ID: Subject: Re: git: 101afbc6ee2f - main - loader/menu: tweak for added line To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000ca83c00620502dc3" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Wqjyw2wWZz518R --000000000000ca83c00620502dc3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 22, 2024 at 5:52=E2=80=AFPM Jessica Clarke = wrote: > On 23 Aug 2024, at 00:37, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe11= 5c579967c > > > > commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c > > Author: Warner Losh > > AuthorDate: 2024-08-22 23:28:51 +0000 > > Commit: Warner Losh > > CommitDate: 2024-08-22 23:28:51 +0000 > > > > loader/menu: tweak for added line > > > > I added a line to the menu, but didn't adjust so things were a > > line off. Make the necessary adjustments. > > > > Fixes: 7cb65be96d47 > > Sponsored by: Netflix > > MFC After: 3 days > > --- > > stand/lua/drawer.lua | 2 +- > > stand/lua/menu.lua | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua > > index a009b78164df..3a462930b86b 100644 > > --- a/stand/lua/drawer.lua > > +++ b/stand/lua/drawer.lua > > @@ -472,7 +472,7 @@ logodefs =3D { > > brand_position =3D {x =3D 2, y =3D 1} > > logo_position =3D {x =3D 46, y =3D 4} > > menu_position =3D {x =3D 5, y =3D 10} > > -frame_size =3D {w =3D 42, h =3D 13} > > +frame_size =3D {w =3D 42, h =3D 14} > > default_shift =3D {x =3D 0, y =3D 0} > > shift =3D default_shift > > > > diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua > > index 0587e5ae6586..ed84360d93b0 100644 > > --- a/stand/lua/menu.lua > > +++ b/stand/lua/menu.lua > > @@ -535,7 +535,7 @@ end > > > > function menu.autoboot(delay) > > local x =3D loader.getenv("loader_menu_timeout_x") or 4 > > - local y =3D loader.getenv("loader_menu_timeout_y") or 23 > > + local y =3D loader.getenv("loader_menu_timeout_y") or 24 > > local endtime =3D loader.time() + delay > > local time > > local last > > Does this mean we no longer fit a standard 80x24 terminal, or does this > place it on the 24th row so just fits? > I've not tested that configuration, so I don't know. It's my guess it will be fine. I wonder if this configuration is relevant, though. 80x25 is the smallest text console in common use in FreeBSD these days. 80x24 used to be very relevant for Serial, first as the typical terminal in the 70s and 80s, then in the default for xterm in the 90s and 2000s. But in 2024, I'm not sure there's many people still confining themselves to that, but maybe I'm ignorant of why my breaking it might be relevant. I'll test it this weekend... Warner --000000000000ca83c00620502dc3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Aug 22, 2024 at 5:52=E2=80=AF= PM Jessica Clarke <jrtc27@freebsd.= org> wrote:
On 23 Aug 2024, at 00:37, Warner Losh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe115c579967c<= /a>
>
> commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-08-22 23:28:51 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-08-22 23:28:51 +0000
>
>=C2=A0 =C2=A0 loader/menu: tweak for added line
>
>=C2=A0 =C2=A0 I added a line to the menu, but didn't adjust so thin= gs were a
>=C2=A0 =C2=A0 line off. Make the necessary adjustments.
>
>=C2=A0 =C2=A0 Fixes: 7cb65be96d47
>=C2=A0 =C2=A0 Sponsored by: Netflix
>=C2=A0 =C2=A0 MFC After: 3 days
> ---
> stand/lua/drawer.lua | 2 +-
> stand/lua/menu.lua=C2=A0 =C2=A0| 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
> index a009b78164df..3a462930b86b 100644
> --- a/stand/lua/drawer.lua
> +++ b/stand/lua/drawer.lua
> @@ -472,7 +472,7 @@ logodefs =3D {
> brand_position =3D {x =3D 2, y =3D 1}
> logo_position =3D {x =3D 46, y =3D 4}
> menu_position =3D {x =3D 5, y =3D 10}
> -frame_size =3D {w =3D 42, h =3D 13}
> +frame_size =3D {w =3D 42, h =3D 14}
> default_shift =3D {x =3D 0, y =3D 0}
> shift =3D default_shift
>
> diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
> index 0587e5ae6586..ed84360d93b0 100644
> --- a/stand/lua/menu.lua
> +++ b/stand/lua/menu.lua
> @@ -535,7 +535,7 @@ end
>
> function menu.autoboot(delay)
> local x =3D loader.getenv("loader_menu_timeout_x") or 4
> - local y =3D loader.getenv("loader_menu_timeout_y") or 23 > + local y =3D loader.getenv("loader_menu_timeout_y") or 24 > local endtime =3D loader.time() + delay
> local time
> local last

Does this mean we no longer fit a standard 80x24 terminal, or does this
place it on the 24th row so just fits?


for Serial, first as the typical terminal in the 70s and 80s, then in the = default

--000000000000ca83c00620502dc3-- From nobody Fri Aug 23 04:52:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WqnjZ55Gtz5VH1L; Fri, 23 Aug 2024 04:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqnjZ4bN4z42yZ; Fri, 23 Aug 2024 04:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724388722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZfFXBmePbT7g7bTXUd0nqd1EUnlmgAmNwsGdYMlQFn4=; b=N8gylc6gSdelZyKnB3S5syc7kpq/CbiLLrwfw6l8VHyg0impuz2vCK6Je9okyq7f0869tF zS557td2LFqiOG18Wg6nqWywRIKHTm9f19XD1hcFVT3hrm93lBaNaOVsU0lLFEDoFbMOIY SRA7THBd86V9m4ozWBaq77TBN/Q+P0wh0e1DC61Q1GqERAW7KugUGpZGWa0u5dxxea/CzJ I/UuGetIYKpFaj6Vqu8McAlqKD9eeD0Tr6MtjzMwaWdtXUuv2lsqTQY+51wl9cSpoVoMMY 8Rs+59D9DXPqT0HdKCTsp0iLHdiVaGsVWHU6gKQ7WiUwzXYaVomUnllJcFqWYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724388722; a=rsa-sha256; cv=none; b=JRi2gQvzKyTOz8OTXSJyE/+e9jjWq1Asa5ywOxrNqOlWUNT16a7zLV/g6quZjbLoZyAEj3 qCIB+fMXt/LSJw62hgIx6HNy6IfAHwG8UfVALKAA/uwbRSR3j46zYrqvl37sn1qPP0Dcug ukMpaXnSulkdYFmHGeLilFoEIZI6V4/0bArSHTOCTafFR/USwkNK0EVTRYBE6AO/NU0Qpk LlgoDGRwNSFAXRRKrxrKucaFol/VIVUurCzUS1JldcMQpB8SDfQTj2j70rZxs54OLDGBPJ QSfjofgsTQtd+CC9ynfntTa4JNzEBNkxDAnVs2Fn1HEneINfbUxOMxF/FxOhZw== 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=1724388722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZfFXBmePbT7g7bTXUd0nqd1EUnlmgAmNwsGdYMlQFn4=; b=FjkJSAPp7dot1dZ6tmIB73nI9wawLfqZdZ+s6Qd7ijuwzZukLhCcmDHSyX0bHv+T0OzMVf NHQO63nLWSLXwMleP9Fh1oCv0Dc3mbgv9Mp5WhxY6HlVrHFRdJ2r7WVZ9KWv9HM0WJ3cYf r47JS1ADz4cuDlXEsSyly7kh97+TUjNjI184UHd0Bi1dFatlRjFLdtTmY0qPwfkv53Mqoq T5rgARBDG9g28sTJ3jAroeRbzxWBz07ECf7AeDUf5jwMnrZLMRvniWRlUz9OmyOL0FxY6v EzmUrOrbCReY+2IQUfa3cHOe6A4t7dRFtMdJq7c7NehNWm5zty7MxjmobV37aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WqnjZ3vqtzxBL; Fri, 23 Aug 2024 04:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47N4q2vK082614; Fri, 23 Aug 2024 04:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47N4q2v1082611; Fri, 23 Aug 2024 04:52:02 GMT (envelope-from git) Date: Fri, 23 Aug 2024 04:52:02 GMT Message-Id: <202408230452.47N4q2v1082611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: ef3f8aa0a049 - main - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef3f8aa0a0492487ac7db839de078b1913f61b4c Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=ef3f8aa0a0492487ac7db839de078b1913f61b4c commit ef3f8aa0a0492487ac7db839de078b1913f61b4c Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-23 04:51:19 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index cb2ddbd86c2e..9a0428608a27 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -60,6 +60,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -115,6 +116,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 9ff7388fd70c..ff9866c6221b 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -115,6 +115,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -141,6 +142,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -873,6 +875,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Fri Aug 23 06:37:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wqr3D23tJz5VPpK; Fri, 23 Aug 2024 06:37:28 +0000 (UTC) (envelope-from rpokala@vdura.com) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.ppe-hosted.com", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wqr3C6fXFz4Cf2; Fri, 23 Aug 2024 06:37:27 +0000 (UTC) (envelope-from rpokala@vdura.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vdura.com; h=cc:cc:content-id:content-id:content-transfer-encoding:content-transfer-encoding:content-type:content-type:date:date:from:from:in-reply-to:in-reply-to:message-id:message-id:mime-version:mime-version:references:references:subject:subject:to:to; s=selector-1713644318; bh=AQ2bulL65aOezW+ztfz4b7lv5Jg/mInYN/AKyihLlOg=; b=gAcVjUDUqdB2z0f2+XpZegmiz9vMLn/eiH0lLRgR47DlHvWC9T0hZinvBFtfBXj7EUYO3jS1O5ZXjwna6rqkBx2vOCtE68qlxrW6MqGyVRWLfGS9BDsd93B28MXz0TV2Fg3Css4Q6JDf1n1udOxCIkf85YqlaA7gPGfIoQtaLNZcAfVZEdTHA4m3SvvfXHNZ8sBmEGPEgRS45+AwtJYRIjFsx7vz1MiBte2uANU3geQt2lxF7d4nGCyj18uI6fW7XoOSMM1AYWdWihB0YJcrrfwMH9JhV9mf8FdTV55yCXsYMl04O/M8wUNaYUjns7EPKnmIvA8of1mI/I18Eh0IbQ== X-Virus-Scanned: Proofpoint Essentials engine Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 68085940061; Fri, 23 Aug 2024 06:37:25 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wtLEj9t7f4IMcnvf0B5k9CsBPSfKU7vPI0SCu85J6h23KRyIvoLLlsulP2Fj6ZME4HdmRpER5KiMOU0ujlk95EZFzPdsX94efuvgln5IvlWUOHdb8hxe5o/vsbQPFDpl6M7AAT2pdQHVrHfC+uu6AQX3BIvKgd++DtZYbcK8cK18Mx4t8g5ZPdPWVVfxnrgbGtq65HVgkQhv5VyXh9V1dbAczOs7eOTtbZVZe6aPXiN48ZCSyoJ2BNv62pWoeUFk7f+LopjE8tlbt6K1zHsvspN3xnI4052g+EkCZfK449eIMwUWEbT90diUFM3uMXh38JlyVnsuWu5unKDrNRmNGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AQ2bulL65aOezW+ztfz4b7lv5Jg/mInYN/AKyihLlOg=; b=xZWCpQ7kzqRhXUMcPcfMuPZLYkWUS+fyeUD4w7Ls/TZx+SjTRWEosZrqip2oyBKZ15kdtdLZo1egwp17TfDGNZcq3byEyamfYnKEud+PdF9of/SmQjjYLee4ynVt44mDjoXBQ3gWgg28+4P3IHXeQ7WAJ8yOPy40SoEpTT7YQuU89M/jn0pGl6BaIKnaUHBJig4lfgtZ6xMzts9K2AJsKzRyHxSulenPQJTxRdIjQKaCGVX0NwPvU3SL+Z231kZhA9jWaL9P6AZX7mUMtP259LtMNgZnRXp++10KLSlSpBj/Qb4RiLNnRRw1mR93TmhtKpzLgkx4zxmzyUedFmqH0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vdura.com; dmarc=pass action=none header.from=vdura.com; dkim=pass header.d=vdura.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vdura.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AQ2bulL65aOezW+ztfz4b7lv5Jg/mInYN/AKyihLlOg=; b=0aZA9kwLDchHlr4DN8MvgpVZ8Zr6QTwb0fbcgZ1Cx6Yxvrz7NCSji3m/eOFzlJpLKJoXpYFxIkqzHlAFNRDjsua2k8gQ3EaSEVonz0d4x9x4YEeHA4b+tjz1KixBXUedCgNoWaztfQ675cakB2Lzzt1ZaTK65kR7z2YLex1Hvz5LSBlgtXvG2KuXmelBhnSMYK4w0qMbxY/pBCLa/t3q0/B09H8AFzXRcGFVbjDNUenZHkRoAIuqpWewIViPsBD5h0Huogchp2koseXilHmpuj7bd0k+SBwY2pM6sVVgrZ1KsR1JNRfh+wOTTM+i4X22+YfKyTKMmYRyI2LX2hLwyw== Received: from DS0PR22MB4096.namprd22.prod.outlook.com (2603:10b6:8:117::14) by LV3PR22MB5164.namprd22.prod.outlook.com (2603:10b6:408:1e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Fri, 23 Aug 2024 06:37:21 +0000 Received: from DS0PR22MB4096.namprd22.prod.outlook.com ([fe80::6b08:6409:e42:2142]) by DS0PR22MB4096.namprd22.prod.outlook.com ([fe80::6b08:6409:e42:2142%6]) with mapi id 15.20.7897.014; Fri, 23 Aug 2024 06:37:21 +0000 From: "Pokala, Ravi" To: Warner Losh , Jessica Clarke CC: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: 101afbc6ee2f - main - loader/menu: tweak for added line Thread-Topic: 101afbc6ee2f - main - loader/menu: tweak for added line Thread-Index: AQHa9Sbn65oEkvmzgkOSMlrtklTQMQ== Date: Fri, 23 Aug 2024 06:37:21 +0000 Message-ID: <98A87469-0F47-4D0C-8F17-382E664C96AB@panasas.com> References: <202408222337.47MNbMeJ041064@gitrepo.freebsd.org> <895EA850-1C39-40F6-9710-524C4B7342CA@freebsd.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/16.88.24081116 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DS0PR22MB4096:EE_|LV3PR22MB5164:EE_ x-ms-office365-filtering-correlation-id: 774f36cb-fe9b-482e-7369-08dcc33e0ac7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?B?MFoyMDRsdG54WVZmTVVydUM2NG5YZHRKdmMxV21XWWhOQXN0MUExYk03WXFX?= =?utf-8?B?NmI4QjVNMTNtYnh3SW9qZUczVldHZytRK3lVSDdWQ2Z1RXdEZmJLVjhDREhE?= =?utf-8?B?ZGRQaWhwcGIyQVlDWmxTL2xSblNyakg4QmZ6WEQwYjh5VDVBR0NNVG9aTFVI?= =?utf-8?B?MWxmZ2pSdVNEK3RRK2hzQlpDd21ST1crLzJwYm1tTEdnTWhNaWJJOUlsektR?= =?utf-8?B?bEFVd1dxY3MzRFQ5cmk0VzFVV1ZYY3RaMW80S0EvbDdQNWt0RUVDMlhpb0t1?= =?utf-8?B?OWgyTWpEM09JMXBvMGJwUVdENjh0VmI4L1pJTDRTY3kydjRwdGVwNzV3T2xw?= =?utf-8?B?ckM3S0tHYjJxcWY1MVF6QysyMTRpMmlsV2Zpd3dGN2hyWTFuMVNxckxCSHkr?= =?utf-8?B?THcwWkNtajNmd3VzWWU5NWlUTjBxS0NzdExHYWs4SGcxM0pYTURXcjdZS2dl?= =?utf-8?B?RmhaTWNlK3B1SmVULzA1WDJxTjJ4Qll1VnNpTkQzclkrYkdCUk9malBFbFZZ?= =?utf-8?B?cy95WG1LZjZEK2FST0VCNk1laFhOOU9KdXo5cmE2ZTdkakhxVFBQTzFXbnFU?= =?utf-8?B?TTZSNzFoRWVTdFpiekx4emJpcGxjWm5OYVg0LzJlTmoxZmVuZGVhZW1LemNw?= =?utf-8?B?ajNTZHQyMnFZZ0tVZHZMRi9QVUp3NE9NS3k0QmkweWVob0lGcGhOcFFPT1J0?= =?utf-8?B?R1hqcVJLRzNSUUdBK2VGcFYvRDUvaEJqZWtML05zNGdqeENJaHJ2S1llUEk5?= =?utf-8?B?WUhBSHNhcXhDeWZyRitJRCszbDBJRmVSM0Q4VVAyZG9MRmVkVFBNa3MydDVl?= =?utf-8?B?QmRPWXgzSzZYUk0wa2RxRm14Nms3VWg2d2JQQkxIeElDb2Z5a2dmeGRqL3Ir?= =?utf-8?B?dDdVSWx1RzhWUGRjOGg3Mkk4ZHZ3SStYOEN6VTRFcGluakpwU1FqbTd2MW9j?= =?utf-8?B?WWlrbEZscklYci9Fc1phbEpvcTk5MmxDcmtTMlA5Nk9RQ1hyWFRrSTZmQXho?= =?utf-8?B?SzhiRm94Y3p1YURtdUVlZDV4YW9ZaWFNc1ExMUpKRTlNNGJoU2lHcTJWeWxK?= =?utf-8?B?clRyVjZaMWVuaWJrRmtHZGREQTE2cHVBMDZXRVVSVDJ3RjJ5MDI3YWl0S09i?= =?utf-8?B?cmgyME1oMDhSQ2M0YUxtNEJlaWh5T3JMeFk5YmZNdnJodFVteVczcmRBQm1z?= =?utf-8?B?UkZuQVVMK1dHMXpXeElaMDl6b2Z4WCtES1V3Q0Qwald0V0hmNTFaUE03RlhE?= =?utf-8?B?TEdXMGd3T290Z3lhcDkzV244clFlYVN5ZTdiZ3RaaUdZKzlINmVDb3UrNllO?= =?utf-8?B?UnJwK0lyNXpPUEU1S3Exb0lkZnh6S0FiUUNUd1JpMTF3YWwrbG52aElQcEVY?= =?utf-8?B?akRNNSs3UmUwcytCMGZiUmhLc3AzMWFUbWEySzVRRitLa013ZlMyVWdFWTNQ?= =?utf-8?B?YTRhdEVMU24vWnVnWlZ4ZHdPSVppbmtaeE5SOTlhZEtQeW04dEFDYXZZbzJZ?= =?utf-8?B?S2NyNlk2VW5PanBVWGEwbDlsRGFycTRuYStTRFArZ2xKVGFVUjg0SXNZVWli?= =?utf-8?B?c2h5YXBNZHFpcWhINGZQOUo3YnFIK25XeE5yK3dQdGxYS1lxTW90ZjNjc2Ew?= =?utf-8?B?U3hHZXZlbDNGUnc2Y0NyUDB3b0JEd2dGU2hEN3BFei9DZDJZc3BDQk1QaU5C?= =?utf-8?B?b2RzVXUrY3dyOTZLUUppWERidDhEZHBSSXpoWllKN0xWVkpCMEZIcVVZSlNk?= =?utf-8?B?cS9BcmREWVRCUFh3RlI0elBQWVY5SWRVUVRwVXYrcSszbmFkZDBwa05NQTdU?= =?utf-8?B?cUFOY3Z5VzM3MGNaS0tPays3NXlZVFdZUGlDMUt4VUNDaWgyRzdIczIrcmdM?= =?utf-8?B?bmlkRHdjcTV6RXgvVVR4OTVaSU9Cc0NKR08wWnNUeWoraFE9PQ==?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR22MB4096.namprd22.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?cXN3T01oY0orekpkKzZjNDk5dEdLM1gyZGFtdEdIU3BSWk5FME9GcjR1U2xR?= =?utf-8?B?eXJDVFZnT1BiVmZRZXZ4Z203d1RnbU9OZVBOSGd6OTJpeGMwcDd4dzB2MEh2?= =?utf-8?B?akp2Wnc3YlhFRjNmM0hiMXpRUy9YOEFtT1A3cnZnT1dWNHBYRTBYS0E4dUht?= =?utf-8?B?WHBJVE9JVytUVzhuS1FoL083ZE9VOWhCUUFjUG80elFReU1WQWNpWlRwWkFa?= =?utf-8?B?WDBxSVNRaHJVMHN0bTJSMGVoSno1R3FPNmZYQmdmZU9aYlpWZGQ0N2FRNjFq?= =?utf-8?B?WDdoZWg2dEZsVllzTVRpeVJ3YzdFR1RpZmJ0b1FudVVoREtsRk9zUFR4RGpS?= =?utf-8?B?RzF2SDhvTnJybExFZXQxVEk2TUMwWG9KK1pPR1o4ZkFYbUZGZGJLa2ZxRlQ3?= =?utf-8?B?NzFWV0VrSnZCY04zUjhON1kyNDFseHpqTjFNWnBVaVFwTjZRZ3pXbGN6UElv?= =?utf-8?B?Z1EzVzFXeWJFU3R6dHZhVUxyeXkwVytvMTA0R09vSlBJSU5jOHNsL3pQdVYy?= =?utf-8?B?Z1pxclV4bU5kcytHNHFiVjZ4Q0VBN0dlemtTL09Hd01rNHF5ZHc1WHRpWTho?= =?utf-8?B?MUFiSHU1d29LaG5NYVRrRTl6d2hSd3cwV1dodk1PZ0JNVEplM1U4blFtanVV?= =?utf-8?B?TmpINHo5aldLcmNYV1V4bEthWnVpa3FFaFBObkwzVENYMDBnMFp6N1B2K1cv?= =?utf-8?B?MXp1TjF3dXVpc3hiOFBWakNodk9EQVN1cmpYTlErcnNwbG9qUURkdTZIYzdU?= =?utf-8?B?L0NhMWpIR0ZWZGY5UCtkaDJaYWY2RVYwVVl5ekZqN1B4d3VHeVBsVlNaWGpC?= =?utf-8?B?Tk9lMEt1dWxIRk4zNGQ4a2h4ejBncHpMTTZWNFQ4VHV1bTB0YXBBcHU1WW9H?= =?utf-8?B?bVdxSisrMk9rV1FxdW5oT1ZKbjFhOURMdXVzZEZudzdxK0pYVHRnUE5FVUNE?= =?utf-8?B?ZVFmUGJkYzFrZFEvS2tQOVJUSTVEVkMwTTFTdW5XdEZIWHRlcTJFWEZIOHNh?= =?utf-8?B?bzVaOGpHTkl0VGgzRjU1N2pNT3l4c2Y3cUJ5S01oVVdpMzJEdFo4aHVLUDFS?= =?utf-8?B?UVVSZXdtL2VORUd2TTlFMnZFV2x3bnNtbXNzNFhYem41UVhpbm5pKytEVDBR?= =?utf-8?B?SWE2c1dhcjZQdGFXYmtFTjJwbGtXMU90TzNXUlN0Z3NEN0xJd3B0MEk0d3Z1?= =?utf-8?B?R3VTa1l3Z0xhSzh1Wk5KcTlJSkw0VW5idWF2ZUEwVW8ycmNPenM0L1hYZHZ0?= =?utf-8?B?RWpjQUpXTlllL2VuWWdkRWMvejd0SHJxNDR4T0Q1ZkJ4aTZkZldESE5LWFVT?= =?utf-8?B?U2NyN1VtN3Y1RlpKVHkzTENYc3hHbmJvQ2YrZ2xiZFBQdGlFTHpCRHVwbUlQ?= =?utf-8?B?MzYzUEJVWHhPcnBnTDB2YXNpL01lSy9aRU1vUmtVSUsyaDdYSzNGbGVaTXdt?= =?utf-8?B?L0Q4aUxJakZaYzBIelprNmtZYUgzTFNnMm5yOHBkaGhiR3lJZHF5dm1TbUxh?= =?utf-8?B?Vi84VmJJd3VjZHZMTzByRXNNb0ZkU2hQYi94OFFaajhMOGtsbUdXVUYvOFRX?= =?utf-8?B?MzFVeEwvNG1iS284Q3krSjcxRWRrTWpVWlZMRTVob3R2RjgyejhGYmtJeHVa?= =?utf-8?B?RWR6aEtQTGFiVmJJaEJyQmRwMWdZL2RQOGNOb2J1V1daOFpmbVZLWUtZQzkv?= =?utf-8?B?KzFOa1hFeWdoSFBkak9VQmhsWHRzWmwzVlJjb0xlc200aDBIUWxlcTVJOFpr?= =?utf-8?B?WG1pMEY2bWQ5dDNXTWZNNElxSVNUVUV0ZUlyeFBqSnI3d1JPcDY0VWJLTXk4?= =?utf-8?B?MUMva1NDcDZtSDBqNy8vYU1LdEZMOVFLb253M0YyZlRaUWNaeTRsYndiUWlz?= =?utf-8?B?bGJISVd5UDJFRnhJVnhvWmdrZC81YjN1Z3NvZ2RFMkFMUWZPNUZlazFuYjRV?= =?utf-8?B?NzAwUU9SL2x6LytDV24rZXpIdXBlbkIvNWgwanpLbnpCVmpMakgzOG41cWFV?= =?utf-8?B?L2JYWTNWdnQwTDU5UmY0UmtJQUF2Nnptd1JFTTA0THNUNHV6azhmM09jSmxU?= =?utf-8?B?UUgrYjAxaVRRMEJqQXpoMDkvYm1BWUJ2a1ZpamxYMW5vSmdVWlUrNGV0Vk80?= =?utf-8?Q?FOPNfo8plvSXZCxkgg0hzxpb6?= Content-Type: text/plain; charset="utf-8" Content-ID: <03D717ED842F68498B0BBDE36A758622@namprd22.prod.outlook.com> Content-Transfer-Encoding: base64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 X-OriginatorOrg: vdura.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS0PR22MB4096.namprd22.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 774f36cb-fe9b-482e-7369-08dcc33e0ac7 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Aug 2024 06:37:21.5625 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: acf01c9d-c699-42af-bdbb-44bf582e60b0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mF/oKbahJkB6VqxDibI1tBVO9QWX879N2VJBmzI4nLw5Z/5FtwF+GUjNqUJkeLTv40xvAN8E5rm3qzZEgRlXaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR22MB5164 X-MDID: 1724395046-QN6L0aXFWAuZ X-MDID-O: us5;at1;1724395046;QN6L0aXFWAuZ;;6a3db727e91f5d5a303e1eb773e13961 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:22843, ipnet:67.231.154.0/24, country:US] X-Rspamd-Queue-Id: 4Wqr3C6fXFz4Cf2 PiA4MHgyNCB1c2VkIHRvIGJlIHZlcnkgcmVsZXZhbnQgZm9yIFNlcmlhbCwgZmlyc3QgYXMgdGhl IHR5cGljYWwgdGVybWluYWwgaW4gdGhlIDcwcyBhbmQgODBzLCB0aGVuIGluIHRoZSBkZWZhdWx0 IGZvciB4dGVybSBpbiB0aGUgOTBzIGFuZCAyMDAwcy4gQnV0IGluIDIwMjQsIEknbSBub3Qgc3Vy ZSB0aGVyZSdzIG1hbnkgcGVvcGxlIHN0aWxsIGNvbmZpbmluZyB0aGVtc2VsdmVzIHRvIHRoYXQs IGJ1dCBtYXliZSBJJ20gaWdub3JhbnQgb2Ygd2h5IG15IGJyZWFraW5nIGl0IG1pZ2h0IGJlIHJl bGV2YW50Lg0KDQpUaGVyZSdzIHN0aWxsIGxvdHMgb2YgZ2VhciBvdXQgdGhlcmUgd2hpY2ggdXNl cyBSUy0yMzIgc2VyaWFsIG92ZXIgREI5LCB3aGljaCB1c2VzIDgweDI0Lg0KDQotUmF2aSAocnBv a2FsYUApDQoNCg0KRnJvbTogPG93bmVyLXNyYy1jb21taXR0ZXJzQGZyZWVic2Qub3JnPiBvbiBi ZWhhbGYgb2YgV2FybmVyIExvc2ggPGltcEBic2RpbXAuY29tPg0KRGF0ZTogVGh1cnNkYXksIEF1 Z3VzdCAyMiwgMjAyNCBhdCAxOTowMw0KVG86IEplc3NpY2EgQ2xhcmtlIDxqcnRjMjdAZnJlZWJz ZC5vcmc+DQpDYzogV2FybmVyIExvc2ggPGltcEBmcmVlYnNkLm9yZz4sICJzcmMtY29tbWl0dGVy c0BmcmVlYnNkLm9yZyIgPHNyYy1jb21taXR0ZXJzQGZyZWVic2Qub3JnPiwgImRldi1jb21taXRz LXNyYy1hbGxAZnJlZWJzZC5vcmciIDxkZXYtY29tbWl0cy1zcmMtYWxsQGZyZWVic2Qub3JnPiwg ImRldi1jb21taXRzLXNyYy1tYWluQGZyZWVic2Qub3JnIiA8ZGV2LWNvbW1pdHMtc3JjLW1haW5A ZnJlZWJzZC5vcmc+DQpTdWJqZWN0OiBSZTogZ2l0OiAxMDFhZmJjNmVlMmYgLSBtYWluIC0gbG9h ZGVyL21lbnU6IHR3ZWFrIGZvciBhZGRlZCBsaW5lDQoNCg0KDQpPbiBUaHUsIEF1ZyAyMiwgMjAy NCBhdCA1OjUy4oCvUE0gSmVzc2ljYSBDbGFya2UgPG1haWx0bzpqcnRjMjdAZnJlZWJzZC5vcmc+ IHdyb3RlOg0KT24gMjMgQXVnIDIwMjQsIGF0IDAwOjM3LCBXYXJuZXIgTG9zaCA8aW1wQEZyZWVC U0Qub3JnPiB3cm90ZToNCj4gDQo+IFRoZSBicmFuY2ggbWFpbiBoYXMgYmVlbiB1cGRhdGVkIGJ5 IGltcDoNCj4gDQo+IFVSTDogaHR0cHM6Ly9jZ2l0LkZyZWVCU0Qub3JnL3NyYy9jb21taXQvP2lk PTEwMWFmYmM2ZWUyZjA2Zjc3ZTY4ODZmMWYzZmZlMTE1YzU3OTk2N2MNCj4gDQo+IGNvbW1pdCAx MDFhZmJjNmVlMmYwNmY3N2U2ODg2ZjFmM2ZmZTExNWM1Nzk5NjdjDQo+IEF1dGhvcjrCoCDCoCDC oFdhcm5lciBMb3NoIDxpbXBARnJlZUJTRC5vcmc+DQo+IEF1dGhvckRhdGU6IDIwMjQtMDgtMjIg MjM6Mjg6NTEgKzAwMDANCj4gQ29tbWl0OsKgIMKgIMKgV2FybmVyIExvc2ggPGltcEBGcmVlQlNE Lm9yZz4NCj4gQ29tbWl0RGF0ZTogMjAyNC0wOC0yMiAyMzoyODo1MSArMDAwMA0KPiANCj7CoCDC oCBsb2FkZXIvbWVudTogdHdlYWsgZm9yIGFkZGVkIGxpbmUNCj4gDQo+wqAgwqAgSSBhZGRlZCBh IGxpbmUgdG8gdGhlIG1lbnUsIGJ1dCBkaWRuJ3QgYWRqdXN0IHNvIHRoaW5ncyB3ZXJlIGENCj7C oCDCoCBsaW5lIG9mZi4gTWFrZSB0aGUgbmVjZXNzYXJ5IGFkanVzdG1lbnRzLg0KPiANCj7CoCDC oCBGaXhlczogN2NiNjViZTk2ZDQ3DQo+wqAgwqAgU3BvbnNvcmVkIGJ5OiBOZXRmbGl4DQo+wqAg wqAgTUZDIEFmdGVyOiAzIGRheXMNCj4gLS0tDQo+IHN0YW5kL2x1YS9kcmF3ZXIubHVhIHwgMiAr LQ0KPiBzdGFuZC9sdWEvbWVudS5sdWHCoCDCoHwgMiArLQ0KPiAyIGZpbGVzIGNoYW5nZWQsIDIg aW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkNCj4gDQo+IGRpZmYgLS1naXQgYS9zdGFuZC9s dWEvZHJhd2VyLmx1YSBiL3N0YW5kL2x1YS9kcmF3ZXIubHVhDQo+IGluZGV4IGEwMDliNzgxNjRk Zi4uM2E0NjI5MzBiODZiIDEwMDY0NA0KPiAtLS0gYS9zdGFuZC9sdWEvZHJhd2VyLmx1YQ0KPiAr KysgYi9zdGFuZC9sdWEvZHJhd2VyLmx1YQ0KPiBAQCAtNDcyLDcgKzQ3Miw3IEBAIGxvZ29kZWZz ID0gew0KPiBicmFuZF9wb3NpdGlvbiA9IHt4ID0gMiwgeSA9IDF9DQo+IGxvZ29fcG9zaXRpb24g PSB7eCA9IDQ2LCB5ID0gNH0NCj4gbWVudV9wb3NpdGlvbiA9IHt4ID0gNSwgeSA9IDEwfQ0KPiAt ZnJhbWVfc2l6ZSA9IHt3ID0gNDIsIGggPSAxM30NCj4gK2ZyYW1lX3NpemUgPSB7dyA9IDQyLCBo ID0gMTR9DQo+IGRlZmF1bHRfc2hpZnQgPSB7eCA9IDAsIHkgPSAwfQ0KPiBzaGlmdCA9IGRlZmF1 bHRfc2hpZnQNCj4gDQo+IGRpZmYgLS1naXQgYS9zdGFuZC9sdWEvbWVudS5sdWEgYi9zdGFuZC9s dWEvbWVudS5sdWENCj4gaW5kZXggMDU4N2U1YWU2NTg2Li5lZDg0MzYwZDkzYjAgMTAwNjQ0DQo+ IC0tLSBhL3N0YW5kL2x1YS9tZW51Lmx1YQ0KPiArKysgYi9zdGFuZC9sdWEvbWVudS5sdWENCj4g QEAgLTUzNSw3ICs1MzUsNyBAQCBlbmQNCj4gDQo+IGZ1bmN0aW9uIG1lbnUuYXV0b2Jvb3QoZGVs YXkpDQo+IGxvY2FsIHggPSBsb2FkZXIuZ2V0ZW52KCJsb2FkZXJfbWVudV90aW1lb3V0X3giKSBv ciA0DQo+IC0gbG9jYWwgeSA9IGxvYWRlci5nZXRlbnYoImxvYWRlcl9tZW51X3RpbWVvdXRfeSIp IG9yIDIzDQo+ICsgbG9jYWwgeSA9IGxvYWRlci5nZXRlbnYoImxvYWRlcl9tZW51X3RpbWVvdXRf eSIpIG9yIDI0DQo+IGxvY2FsIGVuZHRpbWUgPSBsb2FkZXIudGltZSgpICsgZGVsYXkNCj4gbG9j YWwgdGltZQ0KPiBsb2NhbCBsYXN0DQoNCkRvZXMgdGhpcyBtZWFuIHdlIG5vIGxvbmdlciBmaXQg YSBzdGFuZGFyZCA4MHgyNCB0ZXJtaW5hbCwgb3IgZG9lcyB0aGlzDQpwbGFjZSBpdCBvbiB0aGUg MjR0aCByb3cgc28ganVzdCBmaXRzPw0KDQpJJ3ZlIG5vdCB0ZXN0ZWQgdGhhdCBjb25maWd1cmF0 aW9uLMKgc28gSSBkb24ndCBrbm93LiBJdCdzIG15IGd1ZXNzIGl0IHdpbGwgYmUgZmluZS4NCg0K SSB3b25kZXIgaWYgdGhpcyBjb25maWd1cmF0aW9uIGlzIHJlbGV2YW50LCB0aG91Z2guIDgweDI1 IGlzIHRoZSBzbWFsbGVzdCB0ZXh0DQpjb25zb2xlIGluIGNvbW1vbiB1c2UgaW4gRnJlZUJTRCB0 aGVzZSBkYXlzLiA4MHgyNCB1c2VkIHRvIGJlIHZlcnkgcmVsZXZhbnQNCmZvciBTZXJpYWwsIGZp cnN0IGFzIHRoZSB0eXBpY2FsIHRlcm1pbmFsIGluIHRoZSA3MHMgYW5kIDgwcywgdGhlbiBpbiB0 aGUgZGVmYXVsdA0KZm9yIHh0ZXJtIGluIHRoZSA5MHMgYW5kIDIwMDBzLiBCdXQgaW4gMjAyNCwg SSdtIG5vdCBzdXJlIHRoZXJlJ3MgbWFueSBwZW9wbGUNCnN0aWxsIGNvbmZpbmluZyB0aGVtc2Vs dmVzIHRvIHRoYXQsIGJ1dCBtYXliZSBJJ20gaWdub3JhbnQgb2Ygd2h5IG15IGJyZWFraW5nDQpp dCBtaWdodCBiZSByZWxldmFudC4NCg0KSSdsbCB0ZXN0IGl0IHRoaXMgd2Vla2VuZC4uLg0KDQpX YXJuZXINCg0K From nobody Fri Aug 23 11:57:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wqz8m608Dz5T89s; Fri, 23 Aug 2024 11:57: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 4Wqz8m5Hcsz4jj2; Fri, 23 Aug 2024 11:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724414264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S99r0eacNT/wU4uIEEZZ/mxF2sA0M7FEVfIcUm3J8rg=; b=fEdsOpvwRWZXiSSo3o00hd4Bews8UCdVjolPwtx2LtZTRn+BI+/po4Nw5K74wJU1/j26S9 zp4mNoTrQDNltP+23oftKjLkOrKiQZDD0yUSgHmKdYSlEjbLvmyGpvWdkAqqmBJD6XqNJr Acc50bGwO48NzgH7wvMhiclSLr+YWLLut2R9dNoFuifimKsOq2/55YXtTTLl12SgsE6aT5 ocWqZwO3rcPnhsFQNdqgRUa8GvtjY12TAlW/CEKV18yi96fiIR3TOvRqoRGu8AdRZPduLF y8uhJVp9UXMigkgmeN1pGVjABjJjGBaiXZq8+v/0HRUAWG0snn5RM53rcuT2Rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724414264; a=rsa-sha256; cv=none; b=kzuHyoA7YVk1JWY1rQC+lT+ZK2/p+ABYIl6IBTHbYS9u0bYtm4h3BxqYe+k4R2f7xmpOl5 7/E3bg4n7DLKyYgl7Si5rKiMFMnu8XP70llG9EDeC2oAuEaafivX0ywfjdR/re58/9XbJ0 feWmzea0iX4DAyrVKQxdxXc7x7QYfvTlItBVkVyysDg8Z80s6IEPZhPj0ljdtfJYeaKOF1 nrs553VaNmZv730t0l7G60CWAmf2So7mB5AJp24qIJ+ltTfA8APmHVuzKVS9wx/U8cCQn1 fqd0AAfndbc5ZVlhA+iCqjll6iVkWko4NAojEaj//eHc3DFx56iURq3wzDgF3g== 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=1724414264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S99r0eacNT/wU4uIEEZZ/mxF2sA0M7FEVfIcUm3J8rg=; b=kjhQyksoOUEJ3+Fgch+soGhrfZK93ue+gRvUas0zqXQv9cvlQyURGMb9kXl/U2Ucw8mvTg afgSTq/5V3XuDMmPC2V7Xl2v94+xD6gZdRmAMVQXx6Y793SWFviXlJZMGGLXw/CxJz1Zj4 t10wtH92wL3n8Bk0GVyHDiSxhCWqHNhg7C0ExsuoFXcOvW7ZLaLWdSOSyRTCdgIexVGcIv CsN/Jg8GCFTX3j9ca98peBtlOCmVU5aJxk0EWfO2jOpHk/XOXhoR7pG//m9dsom93lelxs Ke/1NmVci0ae16QmiSKHIGvAtBCXEB+p5jvVMYzVlCJ7bP2n2vEePzF03QgrxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wqz8m4vNBz18jn; Fri, 23 Aug 2024 11:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47NBviIT092954; Fri, 23 Aug 2024 11:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47NBvivI092951; Fri, 23 Aug 2024 11:57:44 GMT (envelope-from git) Date: Fri, 23 Aug 2024 11:57:44 GMT Message-Id: <202408231157.47NBvivI092951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: abdc7bb79635 - main - bhyve(8): Remove mention of -A flag, again List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abdc7bb79635d1d680053bb2bc73128e15cbb14a Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=abdc7bb79635d1d680053bb2bc73128e15cbb14a commit abdc7bb79635d1d680053bb2bc73128e15cbb14a Author: Li-Wen Hsu AuthorDate: 2024-08-23 11:57:09 +0000 Commit: Li-Wen Hsu CommitDate: 2024-08-23 11:57:09 +0000 bhyve(8): Remove mention of -A flag, again Follow 107584716cdeaa36c718a42861df1cb4b8b87e62 to remove the mention of -A flag added in b30a7e5418be5c5d27ac967f5ce99461ab79c37c . Sponsored by: The FreeBSD Foundation --- usr.sbin/bhyve/bhyve.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 527ccf720540..8001b5276d51 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -1166,7 +1166,7 @@ for a virtual machine, use .Fl o .Ar config.dump=1 : .Bd -literal -offset indent -/usr/sbin/bhyve -c 2 -m 256 -A -H -P \\ +/usr/sbin/bhyve -c 2 -m 256 -H -P \\ -s 0:0,hostbridge -s 1:0,virtio-net,tap0 \\ -s 2:0,ahci-hd,./vm0.img \\ -s 31,lpc -l com1,stdio \\ From nobody Fri Aug 23 17:32:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wr6ZZ2cxTz5Td0b; Fri, 23 Aug 2024 17:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wr6ZZ23Xqz4Dbh; Fri, 23 Aug 2024 17:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724434326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h42XFSq0o+h9fE/J1lh5v3/3teCinKMRmCKacMjU6fM=; b=cW20JnlBiLlVC/okMlNPPijIG7tMYVX7cAEUmCS3u5Bn74M/IrpgVU8XWbti/S54i+WFUV QmM8sC5HJQCGdHOdecmxYF5oRrDAxL5AvvZItOXBpjyY51jtM4jmlFfqcn9faLI08ca/OD sW1OEdl1nld1OeVHliWCoEKUTZqrReWTXtf9oKYBmO3uVEl/wd2MJUJ2Ywq7/4o+S77P5a C1BNaqGWuBKOOodqDFJgY/BhfUdWimly/PiIbNKgc42ST9bIyAltITfM5GP9tkBM9CVkeu lGbVj8mC62XvT3+0L9Gx7wfw7pYXQDbc9/EpKRnH8DYqxbzjNVkDAG8KIvQKOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724434326; a=rsa-sha256; cv=none; b=KDnOTd5C8uf0yftMUmmYwvPjk74DSjaqj9FHNVnMkRr+8mEfmw5R2uJrq0cYspuTd3F1Ps gxitwBlDLUPQTTQJ9j0mrjIAoKl39HLUUMfWZq8RD/SpdpTRDWk8Apf1D0ONU6w6PfENJM NLe8xZfakHJSTe+VTVIokMHJfTxKThBLPXqXZO2gexRe3YVNZ0SvQ+d8uKYtpCACVsw5Qi 8N9eMwgTMrgvzCp+9oSmxf2fHm67NmiyBd9abwazkC/rb2bwKptmw33T5Fd+atkz1R4tA6 pbBSoW7ZKJJCcRLDh9fVl3+6PLEcATXUaAHqn5mtBeyL7Phi7c96l/bhHKEBPQ== 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=1724434326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h42XFSq0o+h9fE/J1lh5v3/3teCinKMRmCKacMjU6fM=; b=COIfA99PoTZJNTbmOjXtUBQe16UTO6r+VzEnPrk8EuGlIOGyf3azq//E0nyijvocifDtaT 9Dhrgk+JfcUp1EGabndH4mov/DJCZWjczjZ/jYpHiSyVt6tAbPPwMafACOdqJ6g4EzKzUX HmwJ6VcM5rD77Q2gJWFP/4SLJMOkmWINeLHVak0dlqgnDaWRwsUY9rqNOuL4i5hWCAo1fx HAs3HUcE//hdZpUcKY10v1qgvGYRM1H4AsqW1STmYySsDzbjodlyInD2a0TaTRAkCxcymr BE7KY8NigShiaHXZbhmF/SyvtfHw1xzPWrOl1HzxAqrI5f95h9IrA6Ziay+rvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wr6ZZ1flRzKmK; Fri, 23 Aug 2024 17:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47NHW6Ca065806; Fri, 23 Aug 2024 17:32:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47NHW6TT065803; Fri, 23 Aug 2024 17:32:06 GMT (envelope-from git) Date: Fri, 23 Aug 2024 17:32:06 GMT Message-Id: <202408231732.47NHW6TT065803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: bd8486b9fe74 - main - kern.pre.mk include local.kern.pre.mk List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd8486b9fe74775c2579ea758e1bf9563eb3cfba Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bd8486b9fe74775c2579ea758e1bf9563eb3cfba commit bd8486b9fe74775c2579ea758e1bf9563eb3cfba Author: Simon J. Gerraty AuthorDate: 2024-08-23 17:31:16 +0000 Commit: Simon J. Gerraty CommitDate: 2024-08-23 17:31:16 +0000 kern.pre.mk include local.kern.pre.mk Allow for local customization. Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D46423 --- sys/conf/kern.pre.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index e787d023d9a9..c676418aca93 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -17,6 +17,7 @@ _srcconf_included_: .include .include .include "kern.opts.mk" +.-include # The kernel build always occurs in the object directory which is .CURDIR. .if ${.MAKE.MODE:Unormal:Mmeta} From nobody Fri Aug 23 17:58:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wr79H09qTz5TgP3; Fri, 23 Aug 2024 17:58:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wr79G6mzcz4HL3; Fri, 23 Aug 2024 17:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724435923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/nkUUTV61pcLhXiLmb8UQnbtoTXNhaQ0xxfmhGoq00=; b=bylFXZ7iA7vc1wdg4UvN6Ns5OumaiGimbkMDJQHztiO42CM6DB8hrhAlaQjrSPlg1Q6eE4 WW8kCJSfgszzbQLxVq6s7b4gEuAajDRedbgEkk50QvKfrqCMwUcEVdsMhBbe3S5q2YIsYJ Y4Pu+Nct3Q20r98SS5L+AohJC3CxzW+p1eoBVOingrMwQrPBSCXhjuNot+SD0HsBSxDhXT EvmJTaiv0EO7roKHgXl4mVsps3FhDEWDr+HvBuyXtwYCiNmZGCMbO3+IqI3RJhNMZw0r8M J3D3Lsmtb01ddMzmqKxnXdNqLJE6lS0NIoG0a2FkR++IMjW3AjlFSJKWRkGCdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724435922; a=rsa-sha256; cv=none; b=seEILw+eRzAojSMUXAao4Gb1e+5Jdryg+KVxO2pKOWcBagChRFQ+E8YB0YO7queSL99BD7 4lQ2WEJik2Tj9gu10GnDGWUm1pzoxJV+D/iXjEEPc2MQ3+Yqr7esTK5Yjj9v82C469r6i6 yE9xKWKQDyNXKUvnZzUDRC07eWovJQj1HwdklbNZWihCv/owJopkb1AdFXlVuHuDiv5GET PKAaWBEHfT9z0inXj29b6nkoPILhJ4nwpBKR9xK/H0SCuhu4kvITBN39l+3HnYUQ7gFPgQ vlw+uYP5kEiLUoGcVinGbXdp4srxGUpX5j2lnHbTXnCSkt7fVwQ1YVUzGUw9+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=1724435922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/nkUUTV61pcLhXiLmb8UQnbtoTXNhaQ0xxfmhGoq00=; b=VwVM55B+c6MpjfwKhKcoyQ9v1huiFbiJTQsyAVh6qO84eDyL5Wk1sVNoYq52xV6UxWBgXy zhgYB9tS7RnpJhwmDI4tHudUnV2yiI6CGTRhEP9SPMszCdDrmCyBkx7OY1Jz3/mTHgc30L ODUoNqiShCbtZGPpCeJ8Lw/uA/wTh3KGOJGU0/iWJqfCE7s9sClq1XpK9zz+pfFCZosnP0 B3GnkBrWKFu5BvUXcnR2yi0fV7d3K3sBwqJHv9SX9IZbBkDMFd5g6aAB4FWi9vSjhs/IwA 6SUuupXixu2j4DmVU+oFmgrxHfDsJtiORDhIrAvogfIX+jo3rwL9liS/WTFKMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wr79G6D96zLSM; Fri, 23 Aug 2024 17:58: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 47NHwgav002320; Fri, 23 Aug 2024 17:58:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47NHwgLQ002317; Fri, 23 Aug 2024 17:58:42 GMT (envelope-from git) Date: Fri, 23 Aug 2024 17:58:42 GMT Message-Id: <202408231758.47NHwgLQ002317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 70174ef7d2c8 - main - proccontrol: make -s require a target List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70174ef7d2c80abdfca0e3ad9d0bb1af61318542 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=70174ef7d2c80abdfca0e3ad9d0bb1af61318542 commit 70174ef7d2c80abdfca0e3ad9d0bb1af61318542 Author: Brooks Davis AuthorDate: 2024-08-23 17:57:59 +0000 Commit: Brooks Davis CommitDate: 2024-08-23 17:57:59 +0000 proccontrol: make -s require a target Require a command to exec or a pid to target and update usage and the manpage to make this more clear. It makes no sense to invoke a procctl(2) command on the current process only to exit. Users are sometimes confused about how proccontrol works and think it effects their shell environment when invoked without a target. Disallowing this nonsensical behavior and clarifiying usage will hopefully reduce confusion. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46422 --- usr.bin/proccontrol/proccontrol.1 | 7 +++++-- usr.bin/proccontrol/proccontrol.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/usr.bin/proccontrol/proccontrol.1 b/usr.bin/proccontrol/proccontrol.1 index 7ab917e4a61f..ee71c3200b1a 100644 --- a/usr.bin/proccontrol/proccontrol.1 +++ b/usr.bin/proccontrol/proccontrol.1 @@ -34,9 +34,12 @@ .Sh SYNOPSIS .Nm .Fl m Ar mode -.Op Fl s Ar control -.Op Fl q +.Fl s Ar control .Fl p Ar pid | command +.Nm +.Fl m Ar mode +.Fl q +.Op Fl p Ar pid | command .Sh DESCRIPTION The .Nm diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index 4b7543d63793..be78e14fd75e 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -81,10 +81,14 @@ str2pid(const char *str) static void __dead2 usage(void) { - - fprintf(stderr, "Usage: proccontrol -m (aslr|protmax|trace|trapcap|" - "stackgap|nonewprivs|wxmap"KPTI_USAGE LA_USAGE") [-q] " - "[-s (enable|disable)] [-p pid | command]\n"); + fprintf(stderr, "Usage:\n"); + fprintf(stderr, " proccontrol -m mode -s (enable|disable) " + "(-p pid | command)\n"); + fprintf(stderr, " proccontrol -m mode -q [-p pid]\n"); + fprintf(stderr, "Modes: " + "aslr|protmax|trace|trapcap|stackgap|nonewprivs|wxmap" + KPTI_USAGE LA_USAGE + "\n"); exit(1); } @@ -157,6 +161,8 @@ main(int argc, char *argv[]) usage(); pid = getpid(); } else if (pid == -1) { + if (!query) + usage(); pid = getpid(); } From nobody Fri Aug 23 18:00:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wr7CP1qqtz5TgPH; Fri, 23 Aug 2024 18:00: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 4Wr7CP1M5Vz4Hgy; Fri, 23 Aug 2024 18:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724436033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIPEwlCNoS1ZmYOPGAmtgzZ+Enj43lG0qZrprji1Lxo=; b=VYELCnpQ94yrQ2AjktzdC6lVyUI0TocEdlus5IRu16NbUryN54wBMgLwPRx6PRo5ODc2Kx C/uycPeEoSbU+0C/dXjnQIK38G2skJNvrEK7B8pztdsvc1QewfjTllBRm35wl+QNmPPQm+ 6arb2EAVSRdhjREXJnjzJX8GM3uavbiEBH99opdT8W4P6/+cf2iRubS6GwEScaR7kqDT2H 1DSGq/j5j9Ayj0yyIGnvL3oIjp4vBADemkN6HAd8K9jho+P4p+cEU0+9j2JWYRjAWrjYVy F2QrmIg6LEZjFRZJTLlweLpjc4FmYQ/Q5AfWPAoR1PZDcb28Oh/XkCa+uAD8Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724436033; a=rsa-sha256; cv=none; b=ab67tPchjK18DdU12FIaQWegrdpfpMu0n2VuT/V81PsbHjct+jOcLU0NJ5jZTwru9vhQjJ qarP5V7LDouJfsUXYcqyIZEQreirN/CUbaJc4HTwhZMVUv1k4q1xQrxz44GYo3N1i5bhkV 2SrAmfV1qd/iYm+ZJgsJpCGuLJzmdH/m83rLChYygGLyj6wfQPVUVWkdoc8/uKRRqdsC7t Na8hFTEJx6BHylZSsNIBKVEQ0gpAG3ObQ/CgKUo/C3jJ4m3j/rhJbXTAXV7gzEufNr2eHP tTa2dv8CGflMaL9t88HWXRMFAYuy9uKlWDH5jsDRR1UfVUXi3jHVWViClhg8Mg== 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=1724436033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIPEwlCNoS1ZmYOPGAmtgzZ+Enj43lG0qZrprji1Lxo=; b=TXMhoReKeLpump1kcWHTUeI7+/7OGMql75ScoEcNDEkveJ+Ve52G5f4etcRZw6povjwDO3 XQ8ixIQ+cZaRlDKisVAEhmIhN1HSSuw73hocg71nbho8SXErtWICXzmicxZmonvTPy/IVI SZPpsW6qgra/AUFtnNISY4unhqjDcr94OZ98jr/LmPAEH4Me8it7cqJ2+mJGTKHtQSmGHi hLMJ5FOPYd74OEzmQAwEYlfjJP0omDjgpp+599QBExTNd/y/6o/KyN6W+5eLO1CkamXgrp 6EiP4Eg4I90magIEYoaZMFL6SFGfHBLBgkrXLty68rLeHQRs1467xLfaM47ZIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wr7CP0qVJzLbG; Fri, 23 Aug 2024 18:00: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 47NI0XvJ012533; Fri, 23 Aug 2024 18:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47NI0XAT012530; Fri, 23 Aug 2024 18:00:33 GMT (envelope-from git) Date: Fri, 23 Aug 2024 18:00:33 GMT Message-Id: <202408231800.47NI0XAT012530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 5cbb98c8259c - main - proccontrol.1: bump doc date List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cbb98c8259c48ba22c8359f4c14f5438329ce58 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=5cbb98c8259c48ba22c8359f4c14f5438329ce58 commit 5cbb98c8259c48ba22c8359f4c14f5438329ce58 Author: Brooks Davis AuthorDate: 2024-08-23 17:59:46 +0000 Commit: Brooks Davis CommitDate: 2024-08-23 17:59:46 +0000 proccontrol.1: bump doc date Fixes: 70174ef7d2c8 proccontrol: make -s require a target --- usr.bin/proccontrol/proccontrol.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/proccontrol/proccontrol.1 b/usr.bin/proccontrol/proccontrol.1 index ee71c3200b1a..7c4330fb1166 100644 --- a/usr.bin/proccontrol/proccontrol.1 +++ b/usr.bin/proccontrol/proccontrol.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2023 +.Dd August 23, 2024 .Dt PROCCONTROL 1 .Os .Sh NAME From nobody Sat Aug 24 01:54:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrKjz71XMz5Ttf5 for ; Sat, 24 Aug 2024 01:54:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrKjz4y1Pz43fY for ; Sat, 24 Aug 2024 01:54:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7093abb12edso2405592a34.3 for ; Fri, 23 Aug 2024 18:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1724464454; x=1725069254; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vBaYW/V9y60UYRAJpmMyhygakvLdafJlMok3ZG+9BKM=; b=WGnaJOMoqK+EX5PFvm3Y8jdBoQUGj1y8afL88TFTth3lG+4WOS236781amiN3OLXA6 NZP2kpvpvGFd7nRym7DDh42/mz89wdEjkV4EeVGg8nijCfje1V03PEb11XB4lx1PIZPZ PH0EjiGS0GO//f/LVNoMne44HTNhej7MkLnbswkpbCidLsVqqIHYNM26TP+ZshW5yBxE XJybiJQy1/jk7Hi9o/lw291GrbXkjwtjh4c81NQ8+a27Ecv/qt9ja2tVDGTTtgf2f3NZ dJqNUvVM117SCxi98az6kFzYNMjWYNf6l8PLL4Qk8ZVYZ749zrE6tZloiUmOVOg3Ma3H TNwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724464454; x=1725069254; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vBaYW/V9y60UYRAJpmMyhygakvLdafJlMok3ZG+9BKM=; b=Gn/J5Xp1zmJeXunIWC/24TOUM63Psp1uqChC4gQ5VxgEknUyuf+gNBwn6k7e4uLeVu RjrbFCrSyxiWmk1AITncupeauGioxHH/8InElim/qwXCOypAisAeXt54X6QyD6M3qrY/ iz8vY5YfGVugWYeZ6FtsnOq4y8jl5QazcLogbxsMQ0qKKXU8QDYdcsMhONu9KCeOL0By F5f/uJXLGHijnMdE9q6o4rd+v0XOs70lDc4aeZY77zyYTiMYEF/D3s9g8+kOoGXBjkXs HkMTnvaOcTThVmEHYfmaQMG+VrKBIXs5TRUm+W63wthpm2NmdMY0Whf9kVyIPu9CBvev a51Q== X-Forwarded-Encrypted: i=1; AJvYcCU5AGW5EXWp6vAd8QAtuNp7Vke3JabB06IEeXPfFAksoeGewu6shRNJeOlSOyQUE4PrT24GEecVU51uh7684o5RXy9MLw==@freebsd.org X-Gm-Message-State: AOJu0YwFbUzQzAR8IcOLbZWwPejlAfLbxyf6+0Lhk6hLK0G7gFa++JM8 21efPtav+UIb045+vNkdoUhJvIRJ3xiwPbhD1ovxl5ZWErSN3/BmDSXOQQFbH6niT0iOYQn+ECb iEMTcT4J0EJTEvMIYjRs8KuvDdDO2idxl/bEfcg== X-Google-Smtp-Source: AGHT+IFKUfYua5nKyKqPcUeLrlurpxzlPAHDChzwROjS5KaexSpr4CKzWuCCj+YGJHnWsle+OCfK5aBC3qdH6IhkqVQ= X-Received: by 2002:a05:6830:211b:b0:703:67f8:9b3b with SMTP id 46e09a7af769-70e0ec21766mr4184561a34.30.1724464454391; Fri, 23 Aug 2024 18:54:14 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202408222337.47MNbMeJ041064@gitrepo.freebsd.org> <895EA850-1C39-40F6-9710-524C4B7342CA@freebsd.org> <98A87469-0F47-4D0C-8F17-382E664C96AB@panasas.com> In-Reply-To: <98A87469-0F47-4D0C-8F17-382E664C96AB@panasas.com> From: Warner Losh Date: Fri, 23 Aug 2024 19:54:03 -0600 Message-ID: Subject: Re: 101afbc6ee2f - main - loader/menu: tweak for added line To: "Pokala, Ravi" Cc: Jessica Clarke , Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000003b74e30620642bb4" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WrKjz4y1Pz43fY --0000000000003b74e30620642bb4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 23, 2024 at 12:37=E2=80=AFAM Pokala, Ravi w= rote: > > 80x24 used to be very relevant for Serial, first as the typical termina= l > in the 70s and 80s, then in the default for xterm in the 90s and 2000s. B= ut > in 2024, I'm not sure there's many people still confining themselves to > that, but maybe I'm ignorant of why my breaking it might be relevant. > > There's still lots of gear out there which uses RS-232 serial over DB9, > which uses 80x24. > That needs the FreeBSD boot loader to run in menu mode on it? How many 80x24 terminals are there connected to FreeBSD machines as consoles? Or is this some other connection? And can I get a rough idea where they might be deployed? I still need to see if this is an actual problem in 80x24 or not... Warner > -Ravi (rpokala@) > > > From: on behalf of Warner Losh < > imp@bsdimp.com> > Date: Thursday, August 22, 2024 at 19:03 > To: Jessica Clarke > Cc: Warner Losh , "src-committers@freebsd.org" < > src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" < > dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" < > dev-commits-src-main@freebsd.org> > Subject: Re: git: 101afbc6ee2f - main - loader/menu: tweak for added line > > > > On Thu, Aug 22, 2024 at 5:52=E2=80=AFPM Jessica Clarke > wrote: > On 23 Aug 2024, at 00:37, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe11= 5c579967c > > > > commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c > > Author: Warner Losh > > AuthorDate: 2024-08-22 23:28:51 +0000 > > Commit: Warner Losh > > CommitDate: 2024-08-22 23:28:51 +0000 > > > > loader/menu: tweak for added line > > > > I added a line to the menu, but didn't adjust so things were a > > line off. Make the necessary adjustments. > > > > Fixes: 7cb65be96d47 > > Sponsored by: Netflix > > MFC After: 3 days > > --- > > stand/lua/drawer.lua | 2 +- > > stand/lua/menu.lua | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua > > index a009b78164df..3a462930b86b 100644 > > --- a/stand/lua/drawer.lua > > +++ b/stand/lua/drawer.lua > > @@ -472,7 +472,7 @@ logodefs =3D { > > brand_position =3D {x =3D 2, y =3D 1} > > logo_position =3D {x =3D 46, y =3D 4} > > menu_position =3D {x =3D 5, y =3D 10} > > -frame_size =3D {w =3D 42, h =3D 13} > > +frame_size =3D {w =3D 42, h =3D 14} > > default_shift =3D {x =3D 0, y =3D 0} > > shift =3D default_shift > > > > diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua > > index 0587e5ae6586..ed84360d93b0 100644 > > --- a/stand/lua/menu.lua > > +++ b/stand/lua/menu.lua > > @@ -535,7 +535,7 @@ end > > > > function menu.autoboot(delay) > > local x =3D loader.getenv("loader_menu_timeout_x") or 4 > > - local y =3D loader.getenv("loader_menu_timeout_y") or 23 > > + local y =3D loader.getenv("loader_menu_timeout_y") or 24 > > local endtime =3D loader.time() + delay > > local time > > local last > > Does this mean we no longer fit a standard 80x24 terminal, or does this > place it on the 24th row so just fits? > > I've not tested that configuration, so I don't know. It's my guess it wil= l > be fine. > > I wonder if this configuration is relevant, though. 80x25 is the smallest > text > console in common use in FreeBSD these days. 80x24 used to be very releva= nt > for Serial, first as the typical terminal in the 70s and 80s, then in the > default > for xterm in the 90s and 2000s. But in 2024, I'm not sure there's many > people > still confining themselves to that, but maybe I'm ignorant of why my > breaking > it might be relevant. > > I'll test it this weekend... > > Warner > > --0000000000003b74e30620642bb4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
-Ravi (rpokala@)


From: <owner-src-committers@freebsd.org> on behalf of Warner Losh <= imp@bsdimp.com><= br> Date: Thursday, August 22, 2024 at 19:03
To: Jessica Clarke <jrtc27@freebsd.org>
Cc: Warner Losh <im= p@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org<= /a>>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebs= d.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-m= ain@freebsd.org>
Subject: Re: git: 101afbc6ee2f - main - loader/menu: tweak for added line


On Thu, Aug 22, 2024 at 5:52=E2=80=AFPM Jessica Clarke <mailto:jrtc27@freebsd.org>= wrote:
On 23 Aug 2024, at 00:37, Warner Losh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe115c579967c<= /a>
>
> commit 101afbc6ee2f06f77e6886f1f3ffe115c579967c
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-08-22 23:28:51 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-08-22 23:28:51 +0000
>
>=C2=A0 =C2=A0 loader/menu: tweak for added line
>
>=C2=A0 =C2=A0 I added a line to the menu, but didn't adjust so thin= gs were a
>=C2=A0 =C2=A0 line off. Make the necessary adjustments.
>
>=C2=A0 =C2=A0 Fixes: 7cb65be96d47
>=C2=A0 =C2=A0 Sponsored by: Netflix
>=C2=A0 =C2=A0 MFC After: 3 days
> ---
> stand/lua/drawer.lua | 2 +-
> stand/lua/menu.lua=C2=A0 =C2=A0| 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
> index a009b78164df..3a462930b86b 100644
> --- a/stand/lua/drawer.lua
> +++ b/stand/lua/drawer.lua
> @@ -472,7 +472,7 @@ logodefs =3D {
> brand_position =3D {x =3D 2, y =3D 1}
> logo_position =3D {x =3D 46, y =3D 4}
> menu_position =3D {x =3D 5, y =3D 10}
> -frame_size =3D {w =3D 42, h =3D 13}
> +frame_size =3D {w =3D 42, h =3D 14}
> default_shift =3D {x =3D 0, y =3D 0}
> shift =3D default_shift
>
> diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
> index 0587e5ae6586..ed84360d93b0 100644
> --- a/stand/lua/menu.lua
> +++ b/stand/lua/menu.lua
> @@ -535,7 +535,7 @@ end
>
> function menu.autoboot(delay)
> local x =3D loader.getenv("loader_menu_timeout_x") or 4
> - local y =3D loader.getenv("loader_menu_timeout_y") or 23 > + local y =3D loader.getenv("loader_menu_timeout_y") or 24 > local endtime =3D loader.time() + delay
> local time
> local last

Does this mean we no longer fit a standard 80x24 terminal, or does this
place it on the 24th row so just fits?

I've not tested that configuration,=C2=A0so I don't know. It's = my guess it will be fine.

I wonder if this configuration is relevant, though. 80x25 is the smallest t= ext
console in common use in FreeBSD these days. 80x24 used to be very relevant=
for Serial, first as the typical terminal in the 70s and 80s, then in the d= efault
for xterm in the 90s and 2000s. But in 2024, I'm not sure there's m= any people
still confining themselves to that, but maybe I'm ignorant of why my br= eaking
it might be relevant.

I'll test it this weekend...

Warner

--0000000000003b74e30620642bb4-- From nobody Sat Aug 24 05:39:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrQjs1yprz5VBqn; Sat, 24 Aug 2024 05:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrQjs0wsTz4Qpt; Sat, 24 Aug 2024 05:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724477969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2XN7iytTgImA3FKMEIQHAgJ0Mt+eOZ6NScC8lq596Kc=; b=fgUQGFwJ+zlwUEcSjeRCd0gt3vvPxZ5IZi0rsoripbp9ub+mf2btsbVG268vozcfcmL1Zy mAljFw7jElFrxITs355/9KyxEGK3yvxQhR0Y8mcys1XTPqAR6Yf+j2VIc+F8FZgsqupKQ3 kERYt3hZcpXYTEW+hZDBijq2I7RhHIJfkUNqejIuJD8PDAWPUzQM1h2izyTzeZot9lj/ap piq0GsqHgcsfGzFiELvkEA3Mli0cR9iIjwCdO/0PFaKJTrHaGyRnx/yBHqtYbT2fZ8PVV5 uz8RX2AJ+mHtKLK9ZszUxIgpKj5cB5H0Q2U+j23u2eAlqFQS04b5CrUoz5JYnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724477969; a=rsa-sha256; cv=none; b=jvniWNZj4dVSQH+nigHwOMfLkumSzqFp2oBSev6lUzMw1urlsKrcb1Nun8hrUBzljKWN/V XQ7tGb/XAJsxXzqQjT3sEmHJp+UtrDQt9Dh5WlYwaITXJLOQWfajfQdc16rqtJn/Y6BdeL eDKizhzSrERfbj9DAAVTcYFSUxqxEyx/Pt8fqU4kRs5BG52blQgYOv/+BnWrPWiFdsYTKt WWEBL3ZXvm7Wk5Fk0roXiyS6zjNOd9JAN22gu7ZeLykoXZOwhoNuPKJ6aK9D8SF+/dLqIO +nPi0bgs+rovRaPBI2Q3aHUDNpuPRU1WttWELj9flxQMaHz3PiZbRrJDGk1d0g== 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=1724477969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2XN7iytTgImA3FKMEIQHAgJ0Mt+eOZ6NScC8lq596Kc=; b=OcEOR/CocfeZ38nFrdLgg4o6e9NjkSReiovDgcpDbJSM9qI1Mgn0ns8AvCc7BOQ8EBPlTN 1w3TIWDNUHhPdew6NszJggMUw21nILuHE2RLLIOc68K7R2A2N3dSmZJO8S9v/3wWxwWXyv FonCo6py9nVNqN70b0WHoEo3KiUGQmpFSwWjUOPILAhIMjrR6BwOftd94t8BUNqJqhg1GU frF3+9y+G4DGe8AEO6mw2wIdjeR36IQ9FXnsV5LBGtK5IGlNH64UNpN0Cgfrw2Kp+dkjs7 E1FBPrXuoS3dkD/snrDzMoAUyMKPoA0h/+MZ9LcRDWKjlFmBi2oxYUcV6IXEhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrQjs03tKzjWs; Sat, 24 Aug 2024 05:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47O5dSP5088458; Sat, 24 Aug 2024 05:39:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47O5dSq9088455; Sat, 24 Aug 2024 05:39:28 GMT (envelope-from git) Date: Sat, 24 Aug 2024 05:39:28 GMT Message-Id: <202408240539.47O5dSq9088455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: e972e408d19a - main - release: Redirect etcupdate logfile to /dev/null. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e972e408d19a58c4f2855eface487d06ef73b799 Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=e972e408d19a58c4f2855eface487d06ef73b799 commit e972e408d19a58c4f2855eface487d06ef73b799 Author: Gordon Tetlow AuthorDate: 2024-08-24 05:35:07 +0000 Commit: Gordon Tetlow CommitDate: 2024-08-24 05:35:07 +0000 release: Redirect etcupdate logfile to /dev/null. Stop shipping a log file for etcupdate. This is a source of non-reproducability as it uses mktemp thereby guaranteeing the output is different each run. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46317 --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index a03951d17499..6f59647ff5db 100644 --- a/release/Makefile +++ b/release/Makefile @@ -123,7 +123,7 @@ base.txz: sh ${WORLDDIR}/usr.sbin/etcupdate/etcupdate.sh extract -B \ -m "${MAKE}" -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" \ - ${NO_ROOT:D-N} + -L /dev/null ${NO_ROOT:D-N} .if defined(NO_ROOT) echo "./var/db/etcupdate type=dir uname=root gname=wheel mode=0755" >> ${.OBJDIR}/${DISTDIR}/base.meta sed -n 's,^\.,./var/db/etcupdate/current,p' ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG \ From nobody Sat Aug 24 12:09:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMX2c6nz5T0kP; Sat, 24 Aug 2024 12:09: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 4WrbMX2419z543k; Sat, 24 Aug 2024 12:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=odysnduDq2Zk6hoSuOa/J47c0sTdmNLeQwwZrgKCJck=; b=yN2aXTvd3rEc7zxb6fCVRhxHKFMZfgHQUN03U9CaleUcUkVVMvgJJd727M72DWaBS2IqcX qr8D2qLnC25qWQT+j9+3ws1m//aQEJhZcNWxUpJblBkBzLUkBUgo8WhW0w0iJVxuJRgiwC NyAn+aeM2sEMTXpSSJomBDXk/TBbgGmyCuuzxAmztLfxkO7XGf7OAqVUqCamH8QBFr0RJC fdpaitez0TZGTmMrEdwyB4ATUaUPpXvp323c9X5wdRrzuiVdajZbuVxu2DN8w99W/OKqHs 8guG5kzLKT7k/UH7s17xZhcX7XjL9aQ23CNjfL5r5UQ12bqKyL2/ki9UFW8PEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501352; a=rsa-sha256; cv=none; b=JYB1WFliLCNumg2djpBT5N/a3A652Xitxwn1vFmx5Gj1JAu3OvSIai4MJMqIbwnOZ4pb19 ZWCg7gTcH5aIfd81mL1cq/9JiRdl6t3KVUP3AWbU1mouBGtsxpuj0+gQ9+KGgkihK8QlYn CU5B4OxvECzVADl5wzxkALcGjQDWCZ8rKIgAmwJAhI0CYSYPV+chIC6Lq55SRJq3AxZ+WA rcz9344OFIT9XrAR8QmlXDsoeZLWx83VT/8SVf1AqAVujYJ5bkQ9FUqNCjAbipYCz06S12 c4YyaUe8GnWQqUelitl10vZm4JMGtFzpAbcipHme+Y5iwkKNX61bxkoMDcs6eQ== 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=1724501352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=odysnduDq2Zk6hoSuOa/J47c0sTdmNLeQwwZrgKCJck=; b=u244J+PKwob7ywlmxR2fl47XR9NsHsWRe8THzb/fDQ52hYrjlDMrL4rV59uST954sZlFhL hEUEbcNvo96hUjMNcM/E0fxxw44piE7b5W9HS8GziOyOwG7Bv8qVq1ELGHqpra0kBAyWnS beigj0hS94lg9EgrNinVpJ1UQ2Uwi3gIkFoEvs4lISFkCUxuN+iYTGhJwt781obtT3Lve6 ynMqUM2q24IYE4MfI2y1ddnDjNv4lpMsM43muPQbZRICdj/Bk8UztYTuHqyZjg1VCys56P GGrRcLHwhND1e2aNiVTy8Y7puipk5DyJJDSXEXjYPMUPjbP77YQsFDEjvFvQzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMX1g6Zzv0V; Sat, 24 Aug 2024 12:09: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 47OC9CRs048007; Sat, 24 Aug 2024 12:09:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9Cku048004; Sat, 24 Aug 2024 12:09:12 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:12 GMT Message-Id: <202408241209.47OC9Cku048004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2668e76d6e76 - main - sound tests: Add SNDSTIOC_ADD_USER_DEVS test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2668e76d6e764c5c361156ffa3d39eb02ce8e5d9 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2668e76d6e764c5c361156ffa3d39eb02ce8e5d9 commit 2668e76d6e764c5c361156ffa3d39eb02ce8e5d9 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:29 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:29 +0000 sound tests: Add SNDSTIOC_ADD_USER_DEVS test Test whether the SNDSTIOC_ADD_USER_DEVS IOCTL (registers a userland device to /dev/sndstat) works properly. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46228 --- tests/sys/sound/sndstat.c | 187 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 183 insertions(+), 4 deletions(-) diff --git a/tests/sys/sound/sndstat.c b/tests/sys/sound/sndstat.c index 7c030dfa8b58..553c745ec950 100644 --- a/tests/sys/sound/sndstat.c +++ b/tests/sys/sound/sndstat.c @@ -30,8 +30,9 @@ #include #include -#include #include +#include +#include #include #include @@ -59,8 +60,7 @@ ATF_TC_BODY(sndstat_nv, tc) const nvlist_t * const *cdi; struct sndstioc_nv_arg arg; size_t nitems, nchans, i, j; - int fd, rc; - int pchan, rchan; + int fd, rc, pchan, rchan; load_dummy(); @@ -135,7 +135,6 @@ ATF_TC_BODY(sndstat_nv, tc) } #undef NV - /* XXX Do we need to skip the TC? userdevs won't have this list */ if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) continue; @@ -206,9 +205,189 @@ ATF_TC_BODY(sndstat_nv, tc) close(fd); } +#define UDEV_PROVIDER "sndstat_udev" +#define UDEV_NAMEUNIT "sndstat_udev" +#define UDEV_DEVNODE "sndstat_udev" +#define UDEV_DESC "Test Device" +#define UDEV_PCHAN 1 +#define UDEV_RCHAN 1 +#define UDEV_MIN_RATE 8000 +#define UDEV_MAX_RATE 96000 +#define UDEV_FORMATS (AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) +#define UDEV_MIN_CHN 1 +#define UDEV_MAX_CHN 2 + +ATF_TC(sndstat_udev); +ATF_TC_HEAD(sndstat_udev, tc) +{ + atf_tc_set_md_var(tc, "descr", "/dev/sndstat userdev interface test"); +} + +ATF_TC_BODY(sndstat_udev, tc) +{ + nvlist_t *nvl, *di, *dichild; + const nvlist_t * const *rdi; + struct sndstioc_nv_arg arg; + const char *str; + size_t nitems, i; + int fd, rc, pchan, rchan, n; + + load_dummy(); + + if ((fd = open("/dev/sndstat", O_RDWR)) < 0) + atf_tc_skip("/dev/sndstat not found, load sound(4)"); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + di = nvlist_create(0); + ATF_REQUIRE(di != NULL); + + dichild = nvlist_create(0); + ATF_REQUIRE(dichild != NULL); + + nvlist_add_string(di, SNDST_DSPS_PROVIDER, UDEV_PROVIDER); + nvlist_add_string(di, SNDST_DSPS_NAMEUNIT, UDEV_NAMEUNIT); + nvlist_add_string(di, SNDST_DSPS_DESC, UDEV_DESC); + nvlist_add_string(di, SNDST_DSPS_DEVNODE, UDEV_DEVNODE); + nvlist_add_number(di, SNDST_DSPS_PCHAN, UDEV_PCHAN); + nvlist_add_number(di, SNDST_DSPS_RCHAN, UDEV_RCHAN); + + nvlist_add_number(dichild, SNDST_DSPS_INFO_MIN_RATE, UDEV_MIN_RATE); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MAX_RATE, UDEV_MAX_RATE); + nvlist_add_number(dichild, SNDST_DSPS_INFO_FORMATS, UDEV_FORMATS); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MIN_CHN, UDEV_MIN_CHN); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MAX_CHN, UDEV_MAX_CHN); + + nvlist_add_nvlist(di, SNDST_DSPS_INFO_PLAY, dichild); + nvlist_add_nvlist(di, SNDST_DSPS_INFO_REC, dichild); + + nvlist_append_nvlist_array(nvl, SNDST_DSPS, di); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + + arg.buf = nvlist_pack(nvl, &arg.nbytes); + ATF_REQUIRE_MSG(arg.buf != NULL, "failed to pack nvlist"); + + rc = ioctl(fd, SNDSTIOC_ADD_USER_DEVS, &arg); + free(arg.buf); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_ADD_USER_DEVS) failed"); + + nvlist_destroy(di); + nvlist_destroy(dichild); + nvlist_destroy(nvl); + + /* Read back registered values. */ + rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL); + ATF_REQUIRE_EQ(rc, 0); + + arg.nbytes = 0; + arg.buf = NULL; + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#1) failed"); + + arg.buf = malloc(arg.nbytes); + ATF_REQUIRE(arg.buf != NULL); + + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#2) failed"); + + nvl = nvlist_unpack(arg.buf, arg.nbytes, 0); + ATF_REQUIRE(nvl != NULL); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + atf_tc_skip("no soundcards attached"); + + rdi = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item, var) do { \ + ATF_REQUIRE_MSG(nvlist_exists(rdi[i], SNDST_DSPS_ ## item), \ + "SNDST_DSPS_" #item " does not exist"); \ + var = nvlist_get_ ## type (rdi[i], SNDST_DSPS_ ## item); \ +} while (0) + /* Search for our device. */ + NV(string, NAMEUNIT, str); + if (strcmp(str, UDEV_NAMEUNIT) == 0) + break; + } + if (i == nitems) + atf_tc_fail("userland device %s not found", UDEV_NAMEUNIT); + + NV(string, NAMEUNIT, str); + ATF_CHECK(strcmp(str, UDEV_NAMEUNIT) == 0); + + NV(bool, FROM_USER, n); + ATF_CHECK(n); + + NV(string, DEVNODE, str); + ATF_CHECK(strcmp(str, UDEV_DEVNODE) == 0); + + NV(string, DESC, str); + ATF_CHECK(strcmp(str, UDEV_DESC) == 0); + + NV(string, PROVIDER, str); + ATF_CHECK(strcmp(str, UDEV_PROVIDER) == 0); + + NV(number, PCHAN, pchan); + ATF_CHECK(pchan == UDEV_PCHAN); + if (pchan && !nvlist_exists(rdi[i], SNDST_DSPS_INFO_PLAY)) + atf_tc_fail("playback channel list empty"); + + NV(number, RCHAN, rchan); + ATF_CHECK(rchan == UDEV_RCHAN); + if (rchan && !nvlist_exists(rdi[i], SNDST_DSPS_INFO_REC)) + atf_tc_fail("recording channel list empty"); +#undef NV + +#define NV(type, mode, item, var) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(rdi[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item), \ + "SNDST_DSPS_INFO_" #item " does not exist"); \ + var = nvlist_get_ ## type (nvlist_get_nvlist(rdi[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item); \ +} while (0) + if (pchan) { + NV(number, PLAY, MIN_RATE, n); + ATF_CHECK(n == UDEV_MIN_RATE); + + NV(number, PLAY, MAX_RATE, n); + ATF_CHECK(n == UDEV_MAX_RATE); + + NV(number, PLAY, FORMATS, n); + ATF_CHECK(n == UDEV_FORMATS); + + NV(number, PLAY, MIN_CHN, n); + ATF_CHECK(n == UDEV_MIN_CHN); + + NV(number, PLAY, MAX_CHN, n); + ATF_CHECK(n == UDEV_MAX_CHN); + } + if (rchan) { + NV(number, REC, MIN_RATE, n); + ATF_CHECK(n == UDEV_MIN_RATE); + + NV(number, REC, MAX_RATE, n); + ATF_CHECK(n == UDEV_MAX_RATE); + + NV(number, REC, FORMATS, n); + ATF_CHECK(n == UDEV_FORMATS); + + NV(number, REC, MIN_CHN, n); + ATF_CHECK(n == UDEV_MIN_CHN); + + NV(number, REC, MAX_CHN, n); + ATF_CHECK(n == UDEV_MAX_CHN); + } +#undef NV + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, sndstat_nv); + ATF_TP_ADD_TC(tp, sndstat_udev); return (atf_no_error()); } From nobody Sat Aug 24 12:09:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMY3f5Bz5T0XV; Sat, 24 Aug 2024 12:09:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrbMY2kv5z53v1; Sat, 24 Aug 2024 12:09:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eR0CEflgwjXpSju8BN28/m54S2PRCFb00JYijAH32Yo=; b=GqkjkTWp2aFMegGq5WPWUYI/dY/7gJAaSDX/rTQUa+vI8S9QYDmV2Ex4SXdpiM0wVrCAKT KfMzIU1KTfhV10APr+TPlEuOKxEvEaUZtKEZZJRmfFmgblSjGZcuCE3GpQSPs0DQu7kEuy cez45mlLCfESMkurmR2n+Z6LqEvlEOMFjwxM0fP8KBRyW/0eJhlMmGsaZPrQs5C3UiQ5Ry EUY4vJeomZwQpVm5xhXPUnA9kJh/puNPfNtUQBsmY6j1v6pCDBUKOPGXhJ1Th4DtKS2zy8 0sAU5pF8PKrc+V9KbSy1hySv+vzAwlDZ+l3DjgFGtrwNhGzNmzpViTd4R2RoCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501353; a=rsa-sha256; cv=none; b=DpEQ4ElS3WnucCDZXPtD4njGTvLyZAAL2gu3JPr/q9jySR4Q2xvBHYbTyoFvBQYTbFrHfk Q0HMIBU3G1QqgjJa2RYrUGi8jZYP6vesHCSR8xXz2yn/zpXKJ3Mb3OzS8XwFHGnfti3Efs r1JRBlkCQTga1cXqu8momw8BQny0q8Qh61werv+KHGBLyi42l9AF8x73Y7Yt2aClodm6h3 RTNGoovD/8mm9OMi4OuA1geqzpxJbJVAsJLY7wjmimE2CTJjAcadNebeLukMIlrgSVUZ1r xkyrJj4XZKLaOpaDJCnUfK7157xshOTbgHyd+DDLjM8BjaYC47kphIeTiVpLew== 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=1724501353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eR0CEflgwjXpSju8BN28/m54S2PRCFb00JYijAH32Yo=; b=YiNyRWD8DSVVeMHVGqpDIX2p6wCxx9oX7zvydjwqzw8DJ+OQ4MDiiLqXrYFpPUVjQw6t+V 1leEqUDmzxcweWLXtsbrG8o79aL+krNYvVgUaJjYecSXqRe3agijy1C9VkLC8CTOqZdPLL TnrJAH34RILReUyqiZ/Hk6F58XMg8Eczk8eMH98baK5aMYdts6bTA2pYsUuhjCP0Fyhuak kH77/0ovvZl+K85QkNIhpII3GORaey2chjb4MdyDcKAQHkBVI4IDBreLvJdz9jyJ5WSQXD bPZYqbuTlFt172fdiBDxm1DR/WGTYR8N9tJjghNRECnWLHxWJLvuHOeTLk/jkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMY2L9QzvDq; Sat, 24 Aug 2024 12:09: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 47OC9DZU048043; Sat, 24 Aug 2024 12:09:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9Db6048040; Sat, 24 Aug 2024 12:09:13 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:13 GMT Message-Id: <202408241209.47OC9Db6048040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9aac27599aca - main - mixer(8): Implement hot-swapping List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9aac27599acaffa21ff69c5be8a2d71d29cc3d6b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9aac27599acaffa21ff69c5be8a2d71d29cc3d6b commit 9aac27599acaffa21ff69c5be8a2d71d29cc3d6b Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:35 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:35 +0000 mixer(8): Implement hot-swapping Introduce a -V option, which can be used alongside -d (default unit change), in order to hot-swap devices (i.e switch to them on the fly without needing to restart the track), in case virtual_oss(8) exists and is running. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46253 --- usr.sbin/mixer/mixer.8 | 75 +++++++++++++++++++++++++++++++++++++++++++--- usr.sbin/mixer/mixer.c | 81 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 145 insertions(+), 11 deletions(-) diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8 index 75c6a81e3a55..819d8ae73ab1 100644 --- a/usr.sbin/mixer/mixer.8 +++ b/usr.sbin/mixer/mixer.8 @@ -19,7 +19,7 @@ .\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN .\" THE SOFTWARE. .\" -.Dd February 8, 2024 +.Dd August 14, 2024 .Dt MIXER 8 .Os .Sh NAME @@ -28,7 +28,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar device -.Op Fl d Ar pcmN | N +.Op Fl d Ar pcmN | N Op Fl V Ar voss_device:mode .Op Fl os .Op Ar dev Ns Op Cm \&. Ns Ar control Ns Op Cm \&= Ns Ar value .Ar ... @@ -43,7 +43,7 @@ The utility is used to set and display soundcard mixer device controls. .Pp The options are as follows: -.Bl -tag -width "-d pcmN | N" +.Bl -tag -width "-V voss_device:mode" .It Fl a Print the values for all mixer devices available in the system .Pq see Sx FILES . @@ -54,6 +54,30 @@ where N is the unit number (e.g for pcm0, the unit number is 0). See .Sx EXAMPLES on how to list all available audio devices in the system. +.Pp +There is also the possibility of hot-swapping to the new default device if +.Xr virtual_oss 8 +exists in the system and is running, in which case the +.Fl V +option needs to be specified as well. +.Pp +Hot-swapping generally cannot happen with plain +.Xr sound 4 , +so the user has to restart the track in order to get sound coming out of the +new default device. +This is because applications usually open a device at the start of the track +and do not check for default device changes, in order to open the new device +mid-track. +.Xr virtual_oss 8 , +on the other hand, can do hot-swapping, because it creates a virtual device for +applications to open, and then does all the necessary routing and conversions +to the appropriate device(s). +.Pp +Note that hot-swapping will work only for applications that are using +.Xr virtual_oss 8 +devices, and not plain +.Xr sound 4 +ones. .It Fl f Ar device Open .Ar device @@ -66,6 +90,33 @@ Print mixer values in a format suitable for use inside scripts. The mixer's header (name, audio card name, ...) will not be printed. .It Fl s Print only the recording source(s) of the mixer device. +.It Fl V Ar voss_device:mode +Specify a +.Xr virtual_oss 8 +control device, as well as a mode (see below), in order to hot-swap devices. +This option is meant to only be used in combination with the +.Fl d +option. +.Pp +The available modes are as follows: +.Bl -column play +.It Sy Mode Ta Sy Action +.It all Ta Playback and recording +.It play Ta Playback +.It rec Ta Recording +.El +.Pp +The +.Pa mode +part is needed, so that +.Nm +will not accidentally hot-swap both the recording and playback device in +.Xr virtual_oss 8 , +if only one direction is to be hot-swapped. +.Pp +See +.Sx EXAMPLES +on how to use this option. .El .Pp The list of mixer devices that may be modified are: @@ -273,10 +324,26 @@ $ mixer -f /dev/mixer0 -o > info \&... $ mixer -f /dev/mixer0 `cat info` .Ed +.Pp +Suppose +.Xr virtual_oss 8 +is running with +.Pa /dev/vdsp.ctl +as its control device, and +.Pa pcm0 +as the playback device. +Change the default device to +.Pa pcm1 , +and hot-swap to it for both recording and playback in +.Xr virtual_oss 8 : +.Bd -literal -offset indent +$ mixer -d pcm1 -V /dev/vdsp.ctl:all +.Ed .Sh SEE ALSO .Xr mixer 3 , .Xr sound 4 , -.Xr sysctl 8 +.Xr sysctl 8 , +.Xr virtual_oss 8 .Sh HISTORY The .Nm diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 109d3ad09bc5..468130ddaa88 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -20,6 +20,9 @@ * THE SOFTWARE. */ +#include +#include + #include #include #include @@ -40,7 +43,7 @@ static void printall(struct mixer *, int); static void printminfo(struct mixer *, int); static void printdev(struct mixer *, int); static void printrecsrc(struct mixer *, int); /* XXX: change name */ -static int set_dunit(struct mixer *, int); +static int set_dunit(struct mixer *, int, char *); /* Control handlers */ static int mod_volume(struct mix_dev *, void *); static int mod_mute(struct mix_dev *, void *); @@ -54,13 +57,13 @@ main(int argc, char *argv[]) { struct mixer *m; mix_ctl_t *cp; - char *name = NULL, buf[NAME_MAX]; + char *name = NULL, buf[NAME_MAX], *vctl = NULL; char *p, *q, *devstr, *ctlstr, *valstr = NULL; int dunit, i, n, pall = 1, shorthand; int aflag = 0, dflag = 0, oflag = 0, sflag = 0; int ch; - while ((ch = getopt(argc, argv, "ad:f:hos")) != -1) { + while ((ch = getopt(argc, argv, "ad:f:hosV:")) != -1) { switch (ch) { case 'a': aflag = 1; @@ -83,6 +86,9 @@ main(int argc, char *argv[]) case 's': sflag = 1; break; + case 'V': + vctl = optarg; + break; case 'h': /* FALLTHROUGH */ case '?': default: @@ -119,7 +125,7 @@ main(int argc, char *argv[]) initctls(m); if (dflag) { - if (set_dunit(m, dunit) < 0) + if (set_dunit(m, dunit, vctl) < 0) goto parse; else { /* @@ -209,7 +215,8 @@ next: static void __dead2 usage(void) { - fprintf(stderr, "usage: %1$s [-f device] [-d pcmN | N] [-os] [dev[.control[=value]]] ...\n" + fprintf(stderr, "usage: %1$s [-f device] [-d pcmN | N " + "[-V voss_device:mode]] [-os] [dev[.control[=value]]] ...\n" " %1$s [-os] -a\n" " %1$s -h\n", getprogname()); exit(1); @@ -322,9 +329,32 @@ printrecsrc(struct mixer *m, int oflag) } static int -set_dunit(struct mixer *m, int dunit) +set_dunit(struct mixer *m, int dunit, char *vctl) { - int n; + const char *opt; + char *dev, *mode; + char buf[32]; + size_t size; + int n, rc; + + /* + * Issue warning in case of hw.snd.basename_clone being unset. Omit the + * check and warning if the -V flag is used, since the user is most + * likely to be aware of this, and the warning might be confusing. + */ + if (vctl == NULL) { + size = sizeof(int); + if (sysctlbyname("hw.snd.basename_clone", &n, &size, + NULL, 0) < 0) { + warn("hw.snd.basename_clone failed"); + return (-1); + } + if (n == 0) { + warnx("warning: hw.snd.basename_clone not set. " + "/dev/dsp is managed externally and does not " + "change with the default unit change here."); + } + } if ((n = mixer_get_dunit()) < 0) { warn("cannot get default unit"); @@ -336,6 +366,43 @@ set_dunit(struct mixer *m, int dunit) } printf("default_unit: %d -> %d\n", n, dunit); + /* Hot-swap in case virtual_oss exists and is running. */ + if (vctl != NULL) { + dev = strsep(&vctl, ":"); + mode = vctl; + if (dev == NULL || mode == NULL) { + warnx("voss_device:mode tuple incomplete"); + return (-1); + } + if (strcmp(mode, "all") == 0) + opt = "-f"; + else if (strcmp(mode, "play") == 0) + opt = "-P"; + else if (strcmp(mode, "rec") == 0) + opt = "-R"; + else { + warnx("please use one of the following modes: " + "all, play, rec"); + return (-1); + } + snprintf(buf, sizeof(buf), "/dev/dsp%d", dunit); + switch (fork()) { + case -1: + warn("fork"); + break; + case 0: + rc = execl("/usr/local/sbin/virtual_oss_cmd", + "virtual_oss_cmd", dev, opt, buf, NULL); + if (rc < 0) + warn("virtual_oss_cmd"); + _exit(0); + default: + if (wait(NULL) < 0) + warn("wait"); + break; + } + } + return (0); } From nobody Sat Aug 24 12:09:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMb2W98z5T0mP; Sat, 24 Aug 2024 12:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrbMZ4vlnz5460; Sat, 24 Aug 2024 12:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umN6f1T5cut+p/7sXaW3ybZl3dzIxdBIiQSZGEzHdEw=; b=GqMpFJlKjMNJGixNsKmmTzWwgMd5SL+IFeF541G87lf+cTw+OUICtkrafmnvWfdb0QKQ0H 4D3xD7IRwMozdk08GYe8FDhCrZf+A/aac4/WUqiY+Xf1dXBQvCOdA89Py9D+xCqgscaI+D XVQqPlCYLEcaqM40nz3Ji1WFAruf9joS2lSh2M2+hAKk33ZzTOvz2KMeQJLNX/AdhHhkiP VE083MRhff0nthMPfUKfzhAXzDVzZ6XNOpW/bcWdBKJOh+jkQ9kod/PUivvZJ8PdsEq0dn VdEYNHrsOxKB0ZKhX8ihOCgTL0Uq5KDuKUNVugIE8Y41pFZfyNLmHzASysY9Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501354; a=rsa-sha256; cv=none; b=xgdR9APCnOW36f4LR2UNyRVX0O39nJx+12CqCtP2gvHIBQH2sJrLiaD2LsIMBxV6yvk4py v4/juZ24X5KqVyGQhTBTsIprGDdf+xz4KITSH0kXZjh7sAp4tdxkV0FJjb3v/jjoV4Io89 D24mGLd8EBlB9BJyFmtv58PMxU4L0V3n//sMR6Tio8/gxAPeOaFhD9tpHEZNhruf5leMG0 2FHejEp94hytzZL9MiUF/lnjTv8u1y9mdN2s39WUxGXV+Fn5hh33ao5d/m/LHds3wjzLa/ 5EyUdpq6gd3X9KXBKRau7qlIRaWcB2OctZWxMbwVbT4wMY0YsQYFZR94O3Xnng== 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=1724501354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umN6f1T5cut+p/7sXaW3ybZl3dzIxdBIiQSZGEzHdEw=; b=MLdqgGmXTqG2AxPH77Xeit9hH8XUVDixWjoHPH42BrrFESdj5lV1tqHtQudWtUZPYLqLB4 V0WH4K18T01u0j8L/xnMeOC1i/aSUSmv5mm6mwcO+DfoVDfsykDHkdPxQeZtk48ewhijuU dA8TQba51mR2qmonQ5ChyfYWAwXCMhe8K2qh4rm2/HJ+VVt2v0p5K8MwjLsrjwwRQ/OgZx g+Bh9vTVLuBb/gM6pdUyzuqVqIjXVELOGWBEzTgHTjv9dzdATYlp4LzFvk/+h31LFitCug c/E19+CQxmbbTlYN1g6uWz6Xr4wTkrOaMmok2N2Ql0NYV/U2okzhvw8j9VwRkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMZ3fCwzvHH; Sat, 24 Aug 2024 12:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47OC9EvH048092; Sat, 24 Aug 2024 12:09:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9EIF048089; Sat, 24 Aug 2024 12:09:14 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:14 GMT Message-Id: <202408241209.47OC9EIF048089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 0ca4d5d8209c - main - sound examples: Simplify MIDI example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ca4d5d8209cf4d2d0bb37d7f20d95ac3457026d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0ca4d5d8209cf4d2d0bb37d7f20d95ac3457026d commit 0ca4d5d8209cf4d2d0bb37d7f20d95ac3457026d Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:40 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:40 +0000 sound examples: Simplify MIDI example Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D46306 --- share/examples/Makefile | 3 +- share/examples/sound/oss/midi.c | 77 ++++++++++++++++++++++---------------- share/examples/sound/oss/ossmidi.h | 63 ------------------------------- 3 files changed, 46 insertions(+), 97 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 211ec2272c05..d57416112226 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -322,8 +322,7 @@ SE_SOUND_OSS= \ README \ basic.c \ midi.c \ - ossinit.h \ - ossmidi.h + ossinit.h SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/midi.c b/share/examples/sound/oss/midi.c index 6d6ac9aa0fcd..5b001ba537e5 100644 --- a/share/examples/sound/oss/midi.c +++ b/share/examples/sound/oss/midi.c @@ -2,6 +2,10 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2022 Goran Mekić + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,52 +29,61 @@ * SUCH DAMAGE. */ +#include +#include +#include +#include #include -#include "ossmidi.h" +#define CMD_MASK 0xF0 +#define CHANNEL_MASK 0x0F +#define NOTE_ON 0x90 +#define NOTE_OFF 0x80 +#define CTL_CHANGE 0xB0 int -main() +main(int argc, char *argv[]) { - midi_event_t event; - midi_config_t midi_config; - int l = -1; - unsigned char raw; + int fd; + unsigned char raw, type, channel, b1, b2; - midi_config.device = "/dev/umidi1.0"; - oss_midi_init(&midi_config); + if ((fd = open("/dev/umidi0.0", O_RDWR)) < 0) + err(1, "Error opening MIDI device"); - while ((l = read(midi_config.fd, &raw, sizeof(raw))) != -1) { - if (!(raw & 0x80)) { + for (;;) { + if (read(fd, &raw, sizeof(raw)) < sizeof(raw)) + err(1, "Error reading command byte"); + if (!(raw & 0x80)) continue; - } - event.type = raw & CMD_MASK; - event.channel = raw & CHANNEL_MASK; - switch (event.type) { + + type = raw & CMD_MASK; + channel = raw & CHANNEL_MASK; + + if (read(fd, &b1, sizeof(b1)) < sizeof(b1)) + err(1, "Error reading byte 1"); + if (read(fd, &b2, sizeof(b2)) < sizeof(b2)) + err(1, "Error reading byte 2"); + + switch (type) { case NOTE_ON: - case NOTE_OFF: - case CONTROLLER_ON: - if ((l = read(midi_config.fd, &(event.note), sizeof(event.note))) == -1) { - perror("Error reading MIDI note"); - exit(1); - } - if ((l = read(midi_config.fd, &(event.velocity), sizeof(event.velocity))) == -1) { - perror("Error reading MIDI velocity"); - exit(1); - } + printf("Channel %d, note on %d, velocity %d\n", + channel, b1, b2); break; - } - switch (event.type) { - case NOTE_ON: case NOTE_OFF: - printf("Channel %d, note %d, velocity %d\n", event.channel, event.note, event.velocity); + printf("Channel %d, note off %d, velocity %d\n", + channel, b1, b2); break; - case CONTROLLER_ON: - printf("Channel %d, controller %d, value %d\n", event.channel, event.controller, event.value); + case CTL_CHANGE: + printf("Channel %d, controller change %d, value %d\n", + channel, b1, b2); break; default: - printf("Unknown event type %d\n", event.type); + printf("Unknown event type %d\n", type); + break; } } - return 0; + + close(fd); + + return (0); } diff --git a/share/examples/sound/oss/ossmidi.h b/share/examples/sound/oss/ossmidi.h deleted file mode 100644 index 99a6bacffe73..000000000000 --- a/share/examples/sound/oss/ossmidi.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include - -#define CMD_MASK 0xF0 -#define NOTE_ON 0x90 -#define NOTE_OFF 0x80 -#define CHANNEL_MASK 0xF -#define CONTROLLER_ON 0xB0 - -typedef struct midi_event { - unsigned char type; - unsigned char channel; - union { - unsigned char note; - unsigned controller; - }; - union { - unsigned char velocity; - unsigned char value; - }; -} midi_event_t; - -typedef struct midi_config { - char *device; - int fd; -} midi_config_t; - -void -oss_midi_init(midi_config_t *config) -{ - if ((config->fd = open(config->device, O_RDWR)) == -1) { - perror("Error opening MIDI device"); - exit(1); - } -} From nobody Sat Aug 24 12:09:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMb6tDSz5T0XX; Sat, 24 Aug 2024 12:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrbMb5DSpz5444; Sat, 24 Aug 2024 12:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+uuqGxwp9fdoU9QEz8nXejBPwBnM2FNJ0xeofnoYz1k=; b=PVvYdRygYwRCUoPJ+rGB5PuOtVBbsCIQ2jkkqR3gjMpAM8rJZnWfgjuBNOat08/q8hM5cO Eax0wVhLT3AJOH8k3t/PjG/UE6HBSGkgVVI7E/PFRloLHRiSwlBbAZZ1cmm+O56HWybqrU dBXsQSeBoC9GkXNaxJsnuSbZWv+WE5kWHqtmf24gms5wOkrI8ryD4pqhDGjD3gbC2PB0qB 7dO8yx0z/j3FHtE4HEkeqTuXdB1CCeb1NgTGeWIom1feu1jpf9z09XJ7L+KF4l3PJffM+t Vwo7NdPCVFUKUFjHyird4eEEO0efSxsQnn5Te5vP9R83YRoGcWTPtI8u4dAtZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501355; a=rsa-sha256; cv=none; b=Taowf8rKItlrx3spB56sUc7A7rCOzeZlOBeRc2mHxPU9vGLbhFN7LicaZGUV4+swqKVQE7 8Mlnqx0ZD/EhA1uLp8+3AT7L0hImHzmPmmf7lnlyCdENT0MoUwHo70H/SCsBMXcdF0VghY GQ/jl0eroYHS6f57+HTaQFnHdHWQYyEkGep1ec2aXPUvYSZPHqw4ri1RKYjtWp2jMJMvTd szEyKlpiQXvYraOVb76Iw1/F73FUbyXPm3XRrGbRbEHR61z+D7bTo2pa0mqDmFVrtRPlsx gsdvokcNN5vvN6i33+tXZfwwtbvfuhpBk+JbVdvpl5Zr9wUOTsmNJia9yTjA1w== 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=1724501355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+uuqGxwp9fdoU9QEz8nXejBPwBnM2FNJ0xeofnoYz1k=; b=uLJGgUkFayMlZPJbbUjDJZFG/y/GqUjWCHtJKuNJCot1+j/S+Qovq0SkJHpwCYHYj8X504 C3CU5myYyCvxeHsSTHwmlGQIp1vRBZmn1WytvrO1aGRv+DZ222/iE+Lmce8gmT4r+QEydm 0QM4V4/bCvb3wvwBsjLFDrt4fxE43JGxOpdlQoKrKaje/2ls6Jd/GFOk99I7SW2IHPLAYv 0XUhl5ozyepZPSc4M1iggdRYvxLG88yMDZhRJ9QATUW27btKRczbEpzzS9Jhayg2UlRDJE +HriwkPSwAabf6OsuYkLGjv9G8zFIG3xP8GFQP/6+9UxcTkJAszHxrEqlrn4Yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMb4Yk1zvBp; Sat, 24 Aug 2024 12:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47OC9Fng048134; Sat, 24 Aug 2024 12:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9FL0048131; Sat, 24 Aug 2024 12:09:15 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:15 GMT Message-Id: <202408241209.47OC9FL0048131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 3decd659a788 - main - sound examples: Simplify audio example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3decd659a7887e83c2c8af35053301dc7d6f7be2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3decd659a7887e83c2c8af35053301dc7d6f7be2 commit 3decd659a7887e83c2c8af35053301dc7d6f7be2 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:45 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:45 +0000 sound examples: Simplify audio example - Merge ossinit.h and basic.c. - Rename basic.c to audio.c. - Use err(3) instead of fprintf(3) + exit(3). - Some style(9) improvements. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46307 --- share/examples/Makefile | 5 +- share/examples/sound/oss/audio.c | 310 +++++++++++++++++++++++++++++++++++++++ share/examples/sound/oss/basic.c | 99 ------------- 3 files changed, 312 insertions(+), 102 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index d57416112226..65b261157b7a 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -320,9 +320,8 @@ SE_SOUND= \ SE_DIRS+= sound/oss SE_SOUND_OSS= \ README \ - basic.c \ - midi.c \ - ossinit.h + audio.c \ + midi.c SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/audio.c b/share/examples/sound/oss/audio.c new file mode 100644 index 000000000000..4dd3c8b82575 --- /dev/null +++ b/share/examples/sound/oss/audio.c @@ -0,0 +1,310 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Goran Mekić + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifndef SAMPLE_SIZE +#define SAMPLE_SIZE 16 +#endif + +/* Format can be unsigned, in which case replace S with U */ +#if SAMPLE_SIZE == 32 +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Signed 32bit native endian format */ +#elif SAMPLE_SIZE == 16 +typedef int16_t sample_t; +int format = AFMT_S16_NE; /* Signed 16bit native endian format */ +#elif SAMPLE_SIZE == 8 +typedef int8_t sample_t; +int format = AFMT_S8_NE; /* Signed 8bit native endian format */ +#else +#error Unsupported sample format! +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Not a real value, just silencing + * compiler errors */ +#endif + +/* + * Minimal configuration for OSS + * For real world applications, this structure will probably contain many + * more fields + */ +typedef struct config { + char *device; + int channels; + int fd; + int format; + int frag; + int sample_count; + int sample_rate; + int sample_size; + int chsamples; + int mmap; + oss_audioinfo audio_info; + audio_buf_info buffer_info; +} config_t; + +/* + * Error state is indicated by value=-1 in which case application exits with + * error + */ +static inline void +check_error(const int value, const char *message) +{ + if (value == -1) + err(1, "OSS error: %s\n", message); +} + + +/* Calculate frag by giving it minimal size of buffer */ +static inline int +size2frag(int x) +{ + int frag = 0; + + while ((1 << frag) < x) + ++frag; + + return (frag); +} + +/* + * Split input buffer into channels. Input buffer is in interleaved format + * which means if we have 2 channels (L and R), this is what the buffer of 8 + * samples would contain: L,R,L,R,L,R,L,R. The result are two channels + * containing: L,L,L,L and R,R,R,R. + */ +static void +oss_split(config_t *config, sample_t *input, sample_t *output) +{ + int channel, index, i; + + for (i = 0; i < config->sample_count; ++i) { + channel = i % config->channels; + index = i / config->channels; + output[channel * index] = input[i]; + } +} + +/* + * Convert channels into interleaved format and place it in output + * buffer + */ +static void +oss_merge(config_t *config, sample_t *input, sample_t *output) +{ + int channel, index; + + for (channel = 0; channel < config->channels; ++channel) { + for (index = 0; index < config->chsamples; ++index) { + output[index * config->channels + channel] = + input[channel * index]; + } + } +} + +static void +oss_init(config_t *config) +{ + int error, tmp, min_frag; + + /* Open the device for read and write */ + config->fd = open(config->device, O_RDWR); + check_error(config->fd, "open"); + + /* Get device information */ + config->audio_info.dev = -1; + error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); + check_error(error, "SNDCTL_ENGINEINFO"); + printf("min_channels: %d\n", config->audio_info.min_channels); + printf("max_channels: %d\n", config->audio_info.max_channels); + printf("latency: %d\n", config->audio_info.latency); + printf("handle: %s\n", config->audio_info.handle); + if (config->audio_info.min_rate > config->sample_rate || + config->sample_rate > config->audio_info.max_rate) { + errx(1, "%s doesn't support chosen samplerate of %dHz!\n", + config->device, config->sample_rate); + } + if (config->channels < 1) + config->channels = config->audio_info.max_channels; + + /* + * If device is going to be used in mmap mode, disable all format + * conversions. Official OSS documentation states error code should not + * be checked. + * http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 + */ + if (config->mmap) { + tmp = 0; + ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); + } + + /* + * Set number of channels. If number of channels is chosen to the value + * near the one wanted, save it in config + */ + tmp = config->channels; + error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); + check_error(error, "SNDCTL_DSP_CHANNELS"); + /* Or check if tmp is close enough? */ + if (tmp != config->channels) { + errx(1, "%s doesn't support chosen channel count of %d set " + "to %d!\n", config->device, config->channels, tmp); + } + config->channels = tmp; + + /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ + tmp = config->format; + error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); + check_error(error, "SNDCTL_DSP_SETFMT"); + if (tmp != config->format) { + errx(1, "%s doesn't support chosen sample format!\n", + config->device); + } + + /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ + tmp = config->sample_rate; + error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); + check_error(error, "SNDCTL_DSP_SPEED"); + + /* Get and check device capabilities */ + error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); + check_error(error, "SNDCTL_DSP_GETCAPS"); + if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) + errx(1, "Device doesn't support full duplex!\n"); + + if (config->mmap) { + if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) + errx(1, "Device doesn't support triggering!\n"); + if (!(config->audio_info.caps & PCM_CAP_MMAP)) + errx(1, "Device doesn't support mmap mode!\n"); + } + + /* + * If desired frag is smaller than minimum, based on number of channels + * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer + * size is 2^frag, but the real size of the buffer will be read when + * the configuration of the device is successful + */ + min_frag = size2frag(config->sample_size * config->channels); + + if (config->frag < min_frag) + config->frag = min_frag; + + /* + * Allocate buffer in fragments. Total buffer will be split in number + * of fragments (2 by default) + */ + if (config->buffer_info.fragments < 0) + config->buffer_info.fragments = 2; + tmp = ((config->buffer_info.fragments) << 16) | config->frag; + error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); + check_error(error, "SNDCTL_DSP_SETFRAGMENT"); + + /* When all is set and ready to go, get the size of buffer */ + error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); + check_error(error, "SNDCTL_DSP_GETOSPACE"); + if (config->buffer_info.bytes < 1) { + errx(1, "OSS buffer error: buffer size can not be %d\n", + config->buffer_info.bytes); + } + config->sample_count = config->buffer_info.bytes / config->sample_size; + config->chsamples = config->sample_count / config->channels; +} + +int +main(int argc, char *argv[]) +{ + int ret, bytes; + int8_t *ibuf, *obuf; + config_t config = { + .device = "/dev/dsp", + .channels = -1, + .format = format, + .frag = -1, + .sample_rate = 48000, + .sample_size = sizeof(sample_t), + .buffer_info.fragments = -1, + .mmap = 0, + }; + + /* Initialize device */ + oss_init(&config); + + /* + * Allocate input and output buffers so that their size match frag_size + */ + bytes = config.buffer_info.bytes; + ibuf = malloc(bytes); + obuf = malloc(bytes); + sample_t *channels = malloc(bytes); + + printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, " + "samples: %d\n", + bytes, config.buffer_info.fragments, + config.buffer_info.fragsize, config.buffer_info.fragstotal, + config.sample_count); + + /* Minimal engine: read input and copy it to the output */ + for (;;) { + ret = read(config.fd, ibuf, bytes); + if (ret < bytes) { + fprintf(stderr, "Requested %d bytes, but read %d!\n", + bytes, ret); + break; + } + oss_split(&config, (sample_t *)ibuf, channels); + /* All processing will happen here */ + oss_merge(&config, channels, (sample_t *)obuf); + ret = write(config.fd, obuf, bytes); + if (ret < bytes) { + fprintf(stderr, "Requested %d bytes, but wrote %d!\n", + bytes, ret); + break; + } + } + + /* Cleanup */ + free(channels); + free(obuf); + free(ibuf); + close(config.fd); + + return (0); +} diff --git a/share/examples/sound/oss/basic.c b/share/examples/sound/oss/basic.c deleted file mode 100644 index 83ecbe6ea9a7..000000000000 --- a/share/examples/sound/oss/basic.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2021 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "ossinit.h" - -int -main() -{ - config_t config = { - .device = "/dev/dsp", - .channels = -1, - .format = format, - .frag = -1, - .sample_rate = 48000, - .sample_size = sizeof(sample_t), - .buffer_info.fragments = -1, - .mmap = 0, - }; - - /* Initialize device */ - oss_init(&config); - - /* - * Allocate input and output buffers so that their size match - * frag_size - */ - int ret; - int bytes = config.buffer_info.bytes; - int8_t *ibuf = malloc(bytes); - int8_t *obuf = malloc(bytes); - sample_t *channels = malloc(bytes); - - printf( - "bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, samples: %d\n", - bytes, - config.buffer_info.fragments, - config.buffer_info.fragsize, - config.buffer_info.fragstotal, - config.sample_count - ); - - /* Minimal engine: read input and copy it to the output */ - for (;;) { - ret = read(config.fd, ibuf, bytes); - if (ret < bytes) { - fprintf( - stderr, - "Requested %d bytes, but read %d!\n", - bytes, - ret - ); - break; - } - oss_split(&config, (sample_t *)ibuf, channels); - /* All processing will happen here */ - oss_merge(&config, channels, (sample_t *)obuf); - ret = write(config.fd, obuf, bytes); - if (ret < bytes) { - fprintf( - stderr, - "Requested %d bytes, but wrote %d!\n", - bytes, - ret - ); - break; - } - } - - /* Cleanup */ - free(channels); - free(obuf); - free(ibuf); - close(config.fd); - return (0); -} From nobody Sat Aug 24 12:09:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMd29FYz5T0VT; Sat, 24 Aug 2024 12:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrbMc5jzCz546L; Sat, 24 Aug 2024 12:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z7HBsWxqUl7TvLSuQqQnqM7vv3IouJdsRc+OGTTfrCE=; b=Fo1zC3SfGJ4/92QPZpgSpgRQmuj8pvaYV7NKr9cFP1BfUuPHVtHdnFmCUPedXjkrAMMkJE olHp8/DrV5bMQEggMeVEOz/ybLkRbhHgFjkqVvsubxaV1Jc0O8QroM2kCnOyH3AViv+bgZ lcN+oSI6my5MVo8lWw586U+WeCEutD4OUws4VxOK8+VqoSBdb1lfs2GHsd1LmV5xavxb1I lb+6vA8Ehi/9oVy2vy1rR54TGhLrJNhZrndewsf8BOOe4BfReF756cQmQDGjfNZ4rwyLxj oNgivx/hiB6OXMEaJaq/FvKDeFKMVT3iy5UAlQLRwO5/34hX7Q2PsQppoxfw6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501356; a=rsa-sha256; cv=none; b=xD9bZZFI+WFrcClGPgZDG5Ou0vS05pHqtqqOvHoztGinQTnmgJsU/3jeBeumsuxtep/4nM i/IkXjHyH9QmABd8oQBKL42VoHjm1tKTVrMbmYAoUlNmy0KeixTz9YeesE/yJU8f7CrQvF q/3tB1zfNlgq7OcatRfbNT9+dwszV7+T9hNCO4/mDVU9peTlM3ZUGtdcgTHg/mZyDNemY5 HxWdSo8X+ywqtu+qqPOumCFgm592LL6eq/xTLMQJev1PJN4vCbZXsNaiivfjAOUlRESmot OoaIG7M13t0zUt4fzxfAHFRDO/owpDGFUaZvt7uX8BIzlafYsLSJxtE0Z6hNkA== 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=1724501356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z7HBsWxqUl7TvLSuQqQnqM7vv3IouJdsRc+OGTTfrCE=; b=a8JQndiK4I1z3bQNAvc0Q2ksE3pxGr4SopameG5id1TtN9zCkICZ7UVV97M0bMr2ftN6vH KJjszJF1oFx48Q2NGy4V2rr5QARpXth8gtI4U7z1DkrjF0fXuiTjyXT0aGDY86Z+Htxjo/ Od5FNUW7D/DAouLpC097zWq6xTkVVcWJ4OSqsHsvWqcViUSQ37KcwEl76yzX8z9CBtKU5G BCeHarZwjrIjel6pZHnBHQU1SyyQmA9+dCo/ET9BwuotXuASjj/EVCB7Ujm6oyZmXYPCNT njRmThzXz9qiUoJ+sjmfTA6moMjW8l/bZ/uR33q8iF+EKvX3kCM1Vbk0T5SkaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMc5KZBzvBq; Sat, 24 Aug 2024 12:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47OC9Gor048188; Sat, 24 Aug 2024 12:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9GsN048185; Sat, 24 Aug 2024 12:09:16 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:16 GMT Message-Id: <202408241209.47OC9GsN048185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 6747b1a8218f - main - sound examples: Move MIDI example out of OSS directory List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6747b1a8218f229c7593cdb02e4b41e2b1186e26 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6747b1a8218f229c7593cdb02e4b41e2b1186e26 commit 6747b1a8218f229c7593cdb02e4b41e2b1186e26 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:49 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:49 +0000 sound examples: Move MIDI example out of OSS directory This example is not related to OSS. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, meka_tilda.center Differential Revision: https://reviews.freebsd.org/D46308 --- share/examples/Makefile | 6 +++--- share/examples/sound/{oss => }/midi.c | 0 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 65b261157b7a..58f5a2109ec3 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -315,13 +315,13 @@ SE_SCSI_TARGET= \ SE_DIRS+= sound SE_SOUND= \ - sndstat_nv.c + sndstat_nv.c \ + midi.c SE_DIRS+= sound/oss SE_SOUND_OSS= \ README \ - audio.c \ - midi.c + audio.c SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/midi.c b/share/examples/sound/midi.c similarity index 100% rename from share/examples/sound/oss/midi.c rename to share/examples/sound/midi.c From nobody Sat Aug 24 12:09:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMf11qLz5T0dS; Sat, 24 Aug 2024 12:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrbMd72v7z546V; Sat, 24 Aug 2024 12:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mk5veE56TxfkFEeM3E0C9h2G2Z0jK+YVk+XqhM4aS44=; b=jQb8sz1ogO6tvE6vMD79XwVDW3Ytwc90vI/AxyXF51qund7SONAezlvZf6mWG2Om/GXEFD ccFkno5g6Jcpoo4ImX7bkOQ3ofpjStmxhMma4Pj+iwDZta25ZLZ/qxmtiW1KrKQ4P0LWCA m+n2GpGrR+EtD9KS5dmbBz3LUICGh+hPwu2iV3JOPINJOieOtEHDLRYq7979vQIGvhDNp8 XG5RV9BOS9yq4ymvBcH1NhlD4NZG5kQeLmrXT1YtfkknOgAOllo2biAiQfEaz6s2lt6VW2 EEAOyDA1H94hrPb+P/eRdd82oOzMDBlaI/rPvqOGDbEAD7Ux6+PkKyxXk/3GJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501358; a=rsa-sha256; cv=none; b=KOwhHuLmxW6EPX+oVYxpbfZnVoee5CGolp3jka9aSdVQGcxkejxFBAPWTFYqxCsxdaJHfT g84Uj5MXyDUl5hD/zW8jdqf2BxtQtnFVOnx1Thlwl30JAzlXySDwSM4gvhI+zlEvs3gBtb ukjZ2Nq+8ud5J7eQqaIv5qtwpUds+TJH6GPWyGzdqP2GsEcbN3OIgx1D2pNYOP8FcvHsOU QV5+1VvGYicOV6IU3NpeDO7NO8H4XP15H7Azyd3AxgcV86Y9CUj/gejUe0m/dewaYs5Y9Q xyOb5AUoOHcw2rrHT060INhvFhnvN8zKwKwFqPWdrEMe8gYrw/7ehw/1p5JEfw== 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=1724501358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mk5veE56TxfkFEeM3E0C9h2G2Z0jK+YVk+XqhM4aS44=; b=JxHXXtnqk+HKineSRA4pex699wNKGlR14HQgzKvf8Yw34JI6A/fLiisrV9OECgEtk+7kSb c3Fkn9U6zl5vYh9sh8OiLTVtXupv/T7fCHF1V7o0/bLJLNj9C7OFqXvEAmwmstOWRQvTEl sFz2eBHK0RGaqL+sFvk2hhhpci+bJtl7uXWUCVbneFUYnu9JAMb7DCxhH9SNQ2ywaxzaTg bEd1EwIp4M6s0GfAD8MB6T/dM7vhnUXjeoCXZDFslHUoPI5dJWT9BPu/mjvtfNLQyWW8Be y/jh7H0EFVL5OzEv8AgllpSEHp6lgRcCHvffplC1iPQsnar7B0k65FxExbZ8WA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMd6fVPzvHJ; Sat, 24 Aug 2024 12:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47OC9HDx048233; Sat, 24 Aug 2024 12:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9H03048230; Sat, 24 Aug 2024 12:09:17 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:17 GMT Message-Id: <202408241209.47OC9H03048230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 0864dfe6299b - main - sound: Improve sndstat nvlist feederchain format List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0864dfe6299b75e424b845c0d0e1a593da905ae3 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0864dfe6299b75e424b845c0d0e1a593da905ae3 commit 0864dfe6299b75e424b845c0d0e1a593da905ae3 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:54 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:54 +0000 sound: Improve sndstat nvlist feederchain format - Use snd_afmt2str() to display format conversions in feeder_format, instead of the plain hex value. - Simplify feeder_rate contents. - Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix. - Use snd_afmt2str() instead of a plain hex for the the rest of the feeder classes. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46309 --- sys/dev/sound/pcm/sndstat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 4fac6a97a3f0..4c5efb72cc0a 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -388,6 +388,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; + char buf[AFMTSTR_LEN]; di = nvlist_create(0); if (di == NULL) { @@ -531,10 +532,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) while (f != NULL) { sbuf_printf(&sb, "%s", f->class->name); if (f->desc->type == FEEDER_FORMAT) { - sbuf_printf(&sb, "(0x%08x -> 0x%08x)", - f->desc->in, f->desc->out); + snd_afmt2str(f->desc->in, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s -> ", buf); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "%s)", buf); } else if (f->desc->type == FEEDER_MATRIX) { - sbuf_printf(&sb, "(%d.%d -> %d.%d)", + sbuf_printf(&sb, "(%d.%dch -> %d.%dch)", AFMT_CHANNEL(f->desc->in) - AFMT_EXTCHANNEL(f->desc->in), AFMT_EXTCHANNEL(f->desc->in), @@ -542,15 +545,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) AFMT_EXTCHANNEL(f->desc->out), AFMT_EXTCHANNEL(f->desc->out)); } else if (f->desc->type == FEEDER_RATE) { - sbuf_printf(&sb, - "(0x%08x q:%d %d -> %d)", - f->desc->out, - FEEDER_GET(f, FEEDRATE_QUALITY), + sbuf_printf(&sb, "(%d -> %d)", FEEDER_GET(f, FEEDRATE_SRC), FEEDER_GET(f, FEEDRATE_DST)); } else { - sbuf_printf(&sb, "(0x%08x)", - f->desc->out); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s)", buf); } sbuf_printf(&sb, " -> "); f = f->parent; From nobody Sat Aug 24 12:09:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbMg25g5z5T0Xb; Sat, 24 Aug 2024 12:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrbMg0lWBz54LQ; Sat, 24 Aug 2024 12:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zn2b0vkdnmcmvNFBtlXkD4Ybi2yt0h+8uCctdbFQ4KI=; b=HAeRj5MZgkmrLFwvBTt2YUxz9hdZ82o9I/LVtDYKe21lgF2DSy2IQC/8mHN4Q546x30QhT mHWvdvBQpg7tsSP37IA2wRRI1YCvqeHQx1oDxG5FPzwMK/r6z9QTrOrPafimJx6IoUeARy Rkn7Iui0azG1/1cV7x/fdR70MPDBZ1rSZiMxquqsVPOk7kyKg2txfxDEtO+EGnRcX3+1Oo iifEOVNDiL96ZMTawvSXBoOZRMaRBkG97oUG0+Dm3vukA/EinlsuuEN+/L/lILOSdSPgWQ WEB+osv6EUvEuHheIaX8SeUMvUdGE6zyhSOxsfroFhJnTtvaMmrRd6gqWQA0mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501359; a=rsa-sha256; cv=none; b=eVLme/Oex0az3IXxhQpo5bwcDjtfpP3ukGN74pmOC9yhpMZVPCEQHb+HuS6xDS0QU8z51w 7ek0nQdXGXGtBRiKpSexquvYUdvhwaSW2ULMfR8r71Ujgz9buA8HXbErwiQ0Xmmodou/K7 i/D/4vhVgDy/jlnwV/ZEs1oh6Hb6L+ckEUTMWjhCwX2nP49QLfiq23KArZy6yaZZdComjh LAsbxZqbshdD6y6bHwdSG+Ya9c4MruWdyrIpAtDAtKHvuBjFEMv4e/h3stjp67zoR/zA1A 8eychRAFhnYG5RmSKoHUKYevfTQyeq4IcuBMgkxFcK/eOBrQMyfs+sp1Lp5bsw== 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=1724501359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zn2b0vkdnmcmvNFBtlXkD4Ybi2yt0h+8uCctdbFQ4KI=; b=P0UIVxqNoXMymeQut3r5bxOgnCCiefB8Z7HodAvSPLodRcI+vjwvTf6jdWtfRCQB0+Otgl CF+o1gDkbZyf+wOrIuVVXCFTLZTtmOZ/IqmJV6nXe6iOosMYj0eWGOOG323CV1ogLiWaFG Ndag8VpJ6K9xlEpZ+A5RPathDc+dKtky+uGDXZzMwfo9NTlzlTrrAfrvQIX/o+L8ppd6cq Q4c2GrXSphhDvl1sRl5efikDnPsglSC5BTu+j2KDqHu8mg0gAC3nby1wFxfL4j8eJBpOlS rUXyqM9D4umwJs+nTtEWmtiC7NNYETZscpjJbWKIMZZUp2/AlQ2xeO2KNyg+UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbMg0M9Jztnv; Sat, 24 Aug 2024 12:09: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 47OC9IA3048277; Sat, 24 Aug 2024 12:09:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9IrC048274; Sat, 24 Aug 2024 12:09:18 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:18 GMT Message-Id: <202408241209.47OC9IrC048274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: c3516c6533a1 - main - ObsoleteFiles.inc: Update after sound changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3516c6533a17dbd980b5a2a8f566ada99c4b72d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c3516c6533a17dbd980b5a2a8f566ada99c4b72d commit c3516c6533a17dbd980b5a2a8f566ada99c4b72d Author: Christos Margiolis AuthorDate: 2024-08-24 12:08:15 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:08:15 +0000 ObsoleteFiles.inc: Update after sound changes Sponsored by: The FreeBSD Foundation --- ObsoleteFiles.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index afd22301a39c..5ce960fdca82 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,16 @@ # xargs -n1 | sort | uniq -d; # done +# 20240824: sound examples: midi.c moved out of oss/ +OLD_FILES+=share/examples/sound/oss/midi.c + +# 20240824: sound examples: Remove ossinit.h and rename basic.c to audio.c +OLD_FILES+=share/examples/sound/oss/ossinit.h +OLD_FILES+=share/examples/sound/oss/basic.c + +# 20240824: sound examples: Remove ossmidi.h +OLD_FILES+=share/examples/sound/oss/ossmidi.h + # 20240729: rename quick_exit_test to libc_exit_test OLD_FILES+=usr/tests/lib/libc/stdlib/quick_exit_test From nobody Sat Aug 24 12:16:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WrbX55Hz3z5T1Qm; Sat, 24 Aug 2024 12:16: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 4WrbX54mcmz56Sq; Sat, 24 Aug 2024 12:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DBYD6DN/c1NuH2DYNQg3jEaKlNWQbql+wGJxdRjk7co=; b=q4vHCE/R75uLc2BtqI11Uu/1SOrmr0aPIH27oTOF8Ym3wr2GiJXA5dPJB8xQ82/sPnK3Xj gFE8pmRuCLaZIz9BjVJ7xeet/GTojQ8l2JyQqC2iBK1op7l3hKt9vBcyzvVbh4jnuiwSxl C4WEunqlYVPDtu3TUk6qo+d8Avw1Dj7tUu6HtUkMvEtZIwadr89850hQ7csGj7wCym+raG hBuG+OyArKcGFMCw2lr+2Fg3wtI9yM6NxdNfU2hdjiDqiBMQ+y8xo4Ex9vU9jZuKBTmJOI t0ZxobD5mBYJU7xNMRGtrqogLiGpJRjfwyNTIqgww85DxXvzxsh5icUD9sEk7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501797; a=rsa-sha256; cv=none; b=fuUGKxkJtXOy/oemnZI+zBdM4BwFCA2nsahcDdKhx4YgHd4cOx7c0eA3TFDX8e5io4t1rh J3beEoSNMgYCCZUUngsGchrQMP9Zgn9vI0wfU4dLkslJ0JVvrMtelZDY74KeVxbrDoDt5n 7kdVT6HS01mgkyHmBSbBQGKUHvvCMQC0jAdsEdaasXiJUjb+VRwVXo4/QMjmHWRzSKgo+k em4kHuDB39Jq8z/XXjSyS8flb77FUkTVfp06kJpymcJK1XtyzrAxUMVEVj8OFNUt4SUiyX Fno7KJc4iX7gvtCh25wvkGnyP++WKgxjaJ+0gjZpd0b6TajzjjRPYT4xZtFKtQ== 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=1724501797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DBYD6DN/c1NuH2DYNQg3jEaKlNWQbql+wGJxdRjk7co=; b=gQ3DtV03BGNd22UagQ5Uj24ba9aK2bgA15/dcZVicnm3ubIvDp2iGvFhBF8D9F5E6yCpWv Zgj4wxjs9PERK7iksIJUn0vsrjMXqRmG9/NvS0Lgf+NcCte7udxKcMpvEq4qhElxuLffgC d2DUdzcXVeTaj2xAjXMcuHD+7sc6px9x1gc37sCY8kQ4fFdveUuD+yuHmwOzYPvRAoyqN3 0+28NbvKvtZ0cvOujSaBRpfYHuFHY1MWM7udKJn87+oXHOYwlQDyxbhazirwrYKzyUG0sL ta3o22DkdZ00AIeU3rRNIjB8q8iJfEc1KFaVdtocNFf2js4AjPoXOC6QYEXQww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WrbX54GqszvJ0; Sat, 24 Aug 2024 12:16: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 47OCGbRF065074; Sat, 24 Aug 2024 12:16:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OCGbSm065071; Sat, 24 Aug 2024 12:16:37 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:16:37 GMT Message-Id: <202408241216.47OCGbSm065071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 7ae4868a9a1a - main - sound examples: Delete stale ossinit.h file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ae4868a9a1ad255e03529f5872c78f14f215f25 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7ae4868a9a1ad255e03529f5872c78f14f215f25 commit 7ae4868a9a1ad255e03529f5872c78f14f215f25 Author: Christos Margiolis AuthorDate: 2024-08-24 12:16:21 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:16:21 +0000 sound examples: Delete stale ossinit.h file Fixes: 3decd659a788("sound examples: Simplify audio example") Sponsored by: The FreeBSD Foundation MFC after: 2 days --- share/examples/sound/oss/ossinit.h | 262 ------------------------------------- 1 file changed, 262 deletions(-) diff --git a/share/examples/sound/oss/ossinit.h b/share/examples/sound/oss/ossinit.h deleted file mode 100644 index 83920712286d..000000000000 --- a/share/examples/sound/oss/ossinit.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2021 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include - - -#ifndef SAMPLE_SIZE -#define SAMPLE_SIZE 16 -#endif - -/* Format can be unsigned, in which case replace S with U */ -#if SAMPLE_SIZE == 32 -typedef int32_t sample_t; -int format = AFMT_S32_NE; /* Signed 32bit native endian format */ -#elif SAMPLE_SIZE == 16 -typedef int16_t sample_t; -int format = AFMT_S16_NE; /* Signed 16bit native endian format */ -#elif SAMPLE_SIZE == 8 -typedef int8_t sample_t; -int format = AFMT_S8_NE; /* Signed 8bit native endian format */ -#else -#error Unsupported sample format! -typedef int32_t sample_t; -int format = AFMT_S32_NE; /* Not a real value, just silencing - * compiler errors */ -#endif - - - -/* - * Minimal configuration for OSS - * For real world applications, this structure will probably contain many - * more fields - */ -typedef struct config { - char *device; - int channels; - int fd; - int format; - int frag; - int sample_count; - int sample_rate; - int sample_size; - int chsamples; - int mmap; - oss_audioinfo audio_info; - audio_buf_info buffer_info; -} config_t; - - -/* - * Error state is indicated by value=-1 in which case application exits - * with error - */ -static inline void -check_error(const int value, const char *message) -{ - if (value == -1) { - fprintf(stderr, "OSS error: %s %s\n", message, strerror(errno)); - exit(1); - } -} - - - -/* Calculate frag by giving it minimal size of buffer */ -static inline int -size2frag(int x) -{ - int frag = 0; - - while ((1 << frag) < x) { - ++frag; - } - return frag; -} - - -/* - * Split input buffer into channels. Input buffer is in interleaved format - * which means if we have 2 channels (L and R), this is what the buffer of - * 8 samples would contain: L,R,L,R,L,R,L,R. The result are two channels - * containing: L,L,L,L and R,R,R,R. - */ -void -oss_split(config_t *config, sample_t *input, sample_t *output) -{ - int channel; - int index; - - for (int i = 0; i < config->sample_count; ++i) { - channel = i % config->channels; - index = i / config->channels; - output[channel * index] = input[i]; - } -} - - -/* - * Convert channels into interleaved format and place it in output - * buffer - */ -void -oss_merge(config_t *config, sample_t *input, sample_t *output) -{ - for (int channel = 0; channel < config->channels; ++channel) { - for (int index = 0; index < config->chsamples; ++index) { - output[index * config->channels + channel] = input[channel * index]; - } - } -} - -void -oss_init(config_t *config) -{ - int error; - int tmp; - - /* Open the device for read and write */ - config->fd = open(config->device, O_RDWR); - check_error(config->fd, "open"); - - /* Get device information */ - config->audio_info.dev = -1; - error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); - check_error(error, "SNDCTL_ENGINEINFO"); - printf("min_channels: %d\n", config->audio_info.min_channels); - printf("max_channels: %d\n", config->audio_info.max_channels); - printf("latency: %d\n", config->audio_info.latency); - printf("handle: %s\n", config->audio_info.handle); - if (config->audio_info.min_rate > config->sample_rate || config->sample_rate > config->audio_info.max_rate) { - fprintf(stderr, "%s doesn't support chosen ", config->device); - fprintf(stderr, "samplerate of %dHz!\n", config->sample_rate); - exit(1); - } - if (config->channels < 1) { - config->channels = config->audio_info.max_channels; - } - - /* - * If device is going to be used in mmap mode, disable all format - * conversions. Official OSS documentation states error code should not be - * checked. http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 - */ - if (config->mmap) { - tmp = 0; - ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); - } - - /* - * Set number of channels. If number of channels is chosen to the value - * near the one wanted, save it in config - */ - tmp = config->channels; - error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); - check_error(error, "SNDCTL_DSP_CHANNELS"); - if (tmp != config->channels) { /* or check if tmp is close enough? */ - fprintf(stderr, "%s doesn't support chosen ", config->device); - fprintf(stderr, "channel count of %d", config->channels); - fprintf(stderr, ", set to %d!\n", tmp); - } - config->channels = tmp; - - /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ - tmp = config->format; - error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); - check_error(error, "SNDCTL_DSP_SETFMT"); - if (tmp != config->format) { - fprintf(stderr, "%s doesn't support chosen sample format!\n", config->device); - exit(1); - } - - /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ - tmp = config->sample_rate; - error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); - check_error(error, "SNDCTL_DSP_SPEED"); - - /* Get and check device capabilities */ - error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); - check_error(error, "SNDCTL_DSP_GETCAPS"); - if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) { - fprintf(stderr, "Device doesn't support full duplex!\n"); - exit(1); - } - if (config->mmap) { - if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) { - fprintf(stderr, "Device doesn't support triggering!\n"); - exit(1); - } - if (!(config->audio_info.caps & PCM_CAP_MMAP)) { - fprintf(stderr, "Device doesn't support mmap mode!\n"); - exit(1); - } - } - - /* - * If desired frag is smaller than minimum, based on number of channels - * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer size - * is 2^frag, but the real size of the buffer will be read when the - * configuration of the device is successful - */ - int min_frag = size2frag(config->sample_size * config->channels); - - if (config->frag < min_frag) { - config->frag = min_frag; - } - - /* - * Allocate buffer in fragments. Total buffer will be split in number - * of fragments (2 by default) - */ - if (config->buffer_info.fragments < 0) { - config->buffer_info.fragments = 2; - } - tmp = ((config->buffer_info.fragments) << 16) | config->frag; - error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); - check_error(error, "SNDCTL_DSP_SETFRAGMENT"); - - /* When all is set and ready to go, get the size of buffer */ - error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); - check_error(error, "SNDCTL_DSP_GETOSPACE"); - if (config->buffer_info.bytes < 1) { - fprintf( - stderr, - "OSS buffer error: buffer size can not be %d\n", - config->buffer_info.bytes - ); - exit(1); - } - config->sample_count = config->buffer_info.bytes / config->sample_size; - config->chsamples = config->sample_count / config->channels; -} From nobody Sun Aug 25 14:46:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsGpY6dbsz5SwDS; Sun, 25 Aug 2024 14:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsGpY4RwNz4k2x; Sun, 25 Aug 2024 14:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724597189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrCcAKoUtJdzITms7OJiwTEP+tXH4idGN7n0VcKtdYE=; b=VnkJWHTyA7ZuME3lza/lTPkFaQHF0tguEoSsLkhjbQcUmJQkkT9ow6XWVuPDDMtTQJg+mQ T1ehi1PcUA8ahlgY2c/k09SRYSNkF9giMtoWYwEHELut6pkbzESGjMk2/sO/Xq5z3hukUs qPnSvztI/gAE6kqPpmccvzYSSS8R2jNdyqbyj8EvV6K84uvXU/JOthSPf031EHCQGhK4U2 fHAMlerz+tqCn2BjJkWtI/oaIvghy48uT17gYXuBqghedIITHu6lYrIDGmwQ2m/6/2IdAz jXUWmh6VTOcZ2q0z43broZpQvsmJ6PqTMOV02ylT1EiyQIMQgSYseEzF05oGug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724597189; a=rsa-sha256; cv=none; b=jxRbR1vQq/kkFRR0aTYEa1fhxDmFLtlCCZ6JxR0Q1xpGA3AgmZHyoqxY7wXJUa0LhwkYW8 Sb/aK3wWz6YdBgInBvIHp+oC4xD/o8b6Cb3L6mZcQfItF02QmumAPI8gHx+JNbu+KuP50F bKTV0kiNh+q5VnRn0a7gK2evS1Gk9wsUbbY4X1Mx32BvAT8jga44DUC79pYOGmqyowffsh fgHHDheXtHB31/1wJrLbrRNHcboiJf5jqE/BibiMugK7z3z7sCGxdAlL0NiDGI5e4YKDmB MqhvZB6bNHu12HCXUDL5iT6Lm0k9OKmq2CLtMZNtopKEyFnLHTQZNZn/peOAEg== 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=1724597189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrCcAKoUtJdzITms7OJiwTEP+tXH4idGN7n0VcKtdYE=; b=PRAvOys232ww/b6cTKUyUNUB/mOmd3W7Drk4lDTpCxGxejiug29QSx5kkBd/+VAo4wyw1O V9Vuvy0ix2MOjdRXvf0bnm3HQAj8tiBebS8pn6omuu4/mltml5cwMoLbQr7I1yyBpcchB5 SvgOQje6X7c4Xw5sC13yOk9vjgpsa4DifVkgQf8MqEdv4UUkPVmhcifLfPLCsPOrR34L3V yHX4y5B/CNn83oDfAXsYrqifzyKU+YVq6tQ46Tp4szETbBbEpL+UlOtoJoBCWCcsuuy63R ny+G8vT8MiPYGZjaJxhD8vYjJTCFoeJY8Aw9Liv+8kYASyb8xH6Lu2Wv/MGsmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsGpY43JDzRN8; Sun, 25 Aug 2024 14:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47PEkTNV059896; Sun, 25 Aug 2024 14:46:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47PEkTlN059893; Sun, 25 Aug 2024 14:46:29 GMT (envelope-from git) Date: Sun, 25 Aug 2024 14:46:29 GMT Message-Id: <202408251446.47PEkTlN059893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4f39ff1ea0a0 - main - setkey(8): document -hwif extension List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f39ff1ea0a037a3c7751a74cf7ffa02e969d061 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4f39ff1ea0a037a3c7751a74cf7ffa02e969d061 commit 4f39ff1ea0a037a3c7751a74cf7ffa02e969d061 Author: Konstantin Belousov AuthorDate: 2024-08-25 14:45:37 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-25 14:46:09 +0000 setkey(8): document -hwif extension Sponsored by: NVidia networking --- sbin/setkey/setkey.8 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8 index 23a838f76541..e3bcf10b9a9a 100644 --- a/sbin/setkey/setkey.8 +++ b/sbin/setkey/setkey.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 31, 2023 +.Dd August 25, 2024 .Dt SETKEY 8 .Os .\" @@ -343,6 +343,11 @@ not indication of the optional components. Configure NAT-T fragment size. .It Fl esn Enable Extended Sequence Number extension for this SA. +.It Fl hwif Ar ifname +Request hardware offload to the specified interface +.Ar ifname +(only). +By default offload occurs to all capable interfaces. .El .\" .Pp From nobody Sun Aug 25 15:02:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsH8y3bF9z5SxwZ; Sun, 25 Aug 2024 15:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsH8y391lz4lK1; Sun, 25 Aug 2024 15:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724598146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yiy3woQYQdQ6b+eDY6UC8u4noejQab4LfUuAkTuG88c=; b=IZxvPSSwO2LFbjpJConir0hiGAoIVLE6m+kM4KwIL8rHvTdpj0JEWvqaygjlqR7Lg3H9X3 /oXw7iKdZzX5wfJOErb6hEhE2xDUzA1GXmxpLJcdqZ6DGIcXVDIvpUm9nXFSIpo57+/LAo 9XDj4k+138ejQrjK3VByY+a2Rjocug6EUcwdLVitx7UVsZoNzzOL7tFU+WXTHK1DKnOm3w Ek4mTUPa7iZXX+uzFOX+I75Sp/Ti2bWfCuiddVn8YE6QuWabrFiqhlzgEXxet5E9G7hqtT eyGEdHKEwLiIvrfAGqv8eFqJq8IjxYyK80jl9G2/jOdwzj9ZBH6Rc3RKTJeRZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724598146; a=rsa-sha256; cv=none; b=WtiqeCMBoUykyxT9kIdZKT8RY6hIEHVYqVrb1tYRMNMvFxBUfunmfKl/LjtZ/0YuXyNTrt 0mz6xEU/prdI8xPeo8KImv0pPuUHzFn/SCEx1y1VXJuNk7y5YZqohnVlVtS/XdF87IlhRL tfxmX1KdGjd2GfIbXaWUwLx+kqJExuLkSqvdDy7nGUe5IghsaR2cupa9aZk8EsPrL3jWqf TAmuBFA+4x9ER9aQVczvPXF3DVpsX5HotEZcMhiLdW8x/sG7/qz0Hl/pAtZ3hcBQ2OI51A 94Mq1aCw9fKjGC0jjVvwHB6MRUc5N3pnzHYy7jFWkj1CDF7SaNT3/i05DzXViA== 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=1724598146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yiy3woQYQdQ6b+eDY6UC8u4noejQab4LfUuAkTuG88c=; b=AGboEQSllsop0YwB1zokywVzPks09/QEON8pQS/uClOfFK4xz050fnMSbkJx1If0+IB5AP ZDeLjVd8bYg2JPg5nQ82OD05BnDotU9f7G/e8Uaffr3DikMjS+Nwqw++y5IDQPg+hQtE9W SEkp20Mxu1KS4QYSTUtzaeDHlBoNmtQ1Ar8+p/hsiw3zCw5qWGvY3FfkQr1B8gfHahBFSa BlgDR/y307gvo3xUEFisNKzsF1JnJGBjnQniKBXcAM4COAOqeqhYkFDU00wrzNA3Oz8HHS LkOWDyorXlvgOZ6hUXh1s4UoY3RMPKshyhi98prcokhyYF8HEZn5BDIZ8vklNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsH8y2mfmzS4K; Sun, 25 Aug 2024 15:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47PF2Qv9093953; Sun, 25 Aug 2024 15:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47PF2QDo093950; Sun, 25 Aug 2024 15:02:26 GMT (envelope-from git) Date: Sun, 25 Aug 2024 15:02:26 GMT Message-Id: <202408251502.47PF2QDo093950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0b2c159c8faa - main - msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b2c159c8faa3ca155412a1b2e57b3d6bcf91880 commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880 Author: Jose Luis Duran AuthorDate: 2024-08-25 14:50:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-25 14:50:53 +0000 msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE and keep reporting EINVAL for CREATE or RENAME lookups. The reasoning is that non-corrupted filesystem cannot have invalid dirents anyway, so returning ENOENT is more in-line with the natural behavior. PR: 281033 MFC after: 1 week --- sys/fs/msdosfs/msdosfs_lookup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 2a90339d0878..e799a5ce05f6 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -198,7 +198,9 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname switch (unix2dosfn((const u_char *)cnp->cn_nameptr, dosfilename, cnp->cn_namelen, 0, pmp)) { case 0: - return (EINVAL); + if (nameiop == CREATE || nameiop == RENAME) + return (EINVAL); + return (ENOENT); case 1: break; case 2: From nobody Sun Aug 25 20:05:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsPv84VjYz5TRJJ; Sun, 25 Aug 2024 20:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsPv83ygLz4Hq4; Sun, 25 Aug 2024 20:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724616356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TfFIN1YXywbstZi7ivgQtd8/g2mti5hXfj9x7QFGupM=; b=KVN9LKyzRPr4+uStnzb3W2j0cjPfJWWzSeGmRXkuc/ItKl1MW2TCTvO2p7IE1D1eCghWLc N1b/GVb0BrEV0qBgKz4BTQnq3ylHBV0z1VqRrqLHcvmTLCR73yAMp2s/eDygMaj8y4Trbr Sg1pTOEdJYeGsL0Xd8dhRx7bkkEU4yto3nkV0vIX/Ya+So0ZXnpWlaU283PLh+tp1GyukT dMuB1srymx0GTGBhArE1evF+EKJOSqlV4BTG5s7wGLC3CpI/0Utbdg2y3Ued2364QXuWIv ON2WN6sC+h2DHhAXPobEa4nzhWapk0kyB0rM+NtHvfYbh9wVKnx0hItPMBzShA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724616356; a=rsa-sha256; cv=none; b=XeexNPV4U0KP2R6vTEdaAGsnahchKyFh9peoeUvvUQSRM52Iokyzww+kZ9HaVE9Uwo5730 1HIdbxraFcQHz1fQwZJRxYo4qpwvCi7yV47tMFEoS+vyUDPBVrI45EsdYizs4cPMm9YpRA zVAfsxH/80m4vqef5/85VUoF3oAH+1P18TnMY98c3fARokNGgVObmaT0VF/tdLW2NKLUaa tDiVsSqRSkv/98SNDm8siUlPJ6cxiqQUky7D14yabZG6bububpQD4QA5O+cjUs+iVoshjD Jr3aZNUTYQGv6dec82uJczKkgLk5hts2P5NEzs5avuqj+hl7yWBjqOS97XCD4A== 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=1724616356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TfFIN1YXywbstZi7ivgQtd8/g2mti5hXfj9x7QFGupM=; b=pR63lNs+KM/dU3JAooLqhn8xaDtUO53ANFPqKN6pi2snu8oxubDqo329JGc5s5Sxf4N5SO ubzeerlU3q+s567qqzVNOdTX0STTaHRNPZbk7sUvaD2VAo19WbNm9MxAmpYiPxHn5TgBZr dx1fVyDfoCwvvyq5/NnJAacynnFb73To3B50W37ZbXbFevRX8H4gry6UGSlZ6k1jqAwMAp V8jQH3X0+MJ5B9DGFDlYW186VjjvJYxVLqQhsmGV4Fr+GMW2XohweEiXEoddxtxwkPu147 akM6kfawSafUt7RsrvNp5606xol3xuUwU9fcOhYYgt7L76aP6EoKv3RbJ1UZxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsPv83S4czcJM; Sun, 25 Aug 2024 20:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47PK5uDi002108; Sun, 25 Aug 2024 20:05:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47PK5uNE002105; Sun, 25 Aug 2024 20:05:56 GMT (envelope-from git) Date: Sun, 25 Aug 2024 20:05:56 GMT Message-Id: <202408252005.47PK5uNE002105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 6e7581236ed7 - main - tcp: whitespace cleanup in enum tcp_log_events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e7581236ed78ef7494467e5f089619b2b22ff5c Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6e7581236ed78ef7494467e5f089619b2b22ff5c commit 6e7581236ed78ef7494467e5f089619b2b22ff5c Author: Michael Tuexen AuthorDate: 2024-08-25 20:04:13 +0000 Commit: Michael Tuexen CommitDate: 2024-08-25 20:05:41 +0000 tcp: whitespace cleanup in enum tcp_log_events No functional change intended. Sponsored by: Netflix, Inc. --- sys/netinet/tcp_log_buf.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index bd40bf35539a..9ee2d97d47c2 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -201,14 +201,14 @@ enum tcp_log_events { TCP_LOG_OUT, /* Transmit (without other event) 2 */ TCP_LOG_RTO, /* Retransmit timeout 3 */ TCP_LOG_SB_WAKE, /* Awaken socket buffer 4 */ - TCP_UNUSED_5, /* Detected bad retransmission 5 */ + TCP_UNUSED_5, /* Detected bad retransmission 5 */ TCP_LOG_PRR, /* Doing PRR 6 */ - TCP_UNUSED_7, /* Detected reorder 7 */ + TCP_UNUSED_7, /* Detected reorder 7 */ TCP_LOG_HPTS, /* Hpts sending a packet 8 */ BBR_LOG_BBRUPD, /* We updated BBR info 9 */ BBR_LOG_BBRSND, /* We did a slot calculation and sending is done 10 */ BBR_LOG_ACKCLEAR, /* A ack clears all outstanding 11 */ - TCP_UNUSED_12, /* The tcb had a packet input to it 12 */ + TCP_UNUSED_12, /* The tcb had a packet input to it 12 */ BBR_LOG_TIMERSTAR, /* Start a timer 13 */ BBR_LOG_TIMERCANC, /* Cancel a timer 14 */ BBR_LOG_ENTREC, /* Entered recovery 15 */ @@ -245,7 +245,7 @@ enum tcp_log_events { BBR_LOG_REDUCE, /* old bbr log reduce for 4.1 and earlier 46*/ TCP_LOG_RTT, /* A rtt (in useconds) is being sampled and applied to the srtt algo 47 */ BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ - TCP_UNUSED_49, /* SRTT gaining -- now not used 49 */ + TCP_UNUSED_49, /* SRTT gaining -- now not used 49 */ TCP_LOG_REASS, /* Reassembly buffer logging 50 */ TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) 51 */ BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ @@ -255,7 +255,7 @@ enum tcp_log_events { TCP_SACK_FILTER_RES, /* Results of SACK Filter 56 */ TCP_UNUSED_57, /* Sack Attack Detection 57 */ TCP_TIMELY_WORK, /* Logs regarding Timely CC tweaks 58 */ - TCP_UNUSED_59, /* User space event data 59 */ + TCP_UNUSED_59, /* User space event data 59 */ TCP_LOG_SENDFILE, /* sendfile() logging for TCP connections 60 */ TCP_LOG_REQ_T, /* logging of request tracking 61 */ TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */