From nobody Mon Sep 16 05:33:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6YVF5V65z5W379; Mon, 16 Sep 2024 05:33: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 4X6YVF3Njsz47D8; Mon, 16 Sep 2024 05:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726464805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vdXDsL3OwJhtPxhgwa4wmrDuHerFb7MDKK91XmotWLI=; b=y0kYIhMtBhMPJS+BJR1QJgQc4vTGI095zyGoQtwNEF4zulcwuIMFJh0J2QHCKq7xcnMITH by/gBgbw67NIg9BPg3eXkxB2clH5dQudmZqVWOfFJIKr6hnK1R7MnOeZUadA2G1iPvOnTS LGeiWCwSNLfrVvzJHGE/1Z3WJII5XI5ZWMtSbecq55kXCc7+wn2su8zEQojyOM8CiJN17E CpYHWzTSryf0KfOuUk1GUYxpFBlkE+UNyBk+Z3Vt4w1atSNnGprEOtjMtHLbdoD12RPJNt Zqbim96wMvl+hOyyCHJ4hSGmN0haoJRncH/r4Vm1o+anaOKMYrrDgh0DEAne6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726464805; a=rsa-sha256; cv=none; b=ruqkXPkIdNHzihKEXpnCE5BKUlUzOBYb10/lba9vLLteVgHF8lpTsOIWBX+6+GlXZiA3pB AQuVtxZem6A+xRxEMo1KrtS7RU6JGMgMVPuroDpJ0k9cdGrsPchPVBpsPVqB+4qCLcIuOP 9OgsVY7DSu6cJQU1h0xgcrMlUCD6oEUJ/j9YZc6ZysYxAf9awi6W8KlyN/3KXseujMvh4o m8fEVI0ej6w6qYZwazvi8oArff0SmE68dJQJleLUlYPXMLdcYQ4o2g0NaBnXlo1wSx4FKt bqm4CzoAE2oAjnqgwAkx/J/FqILDJmoxjY61aFtEttbOq0qTUDDCckg4iPleDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726464805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vdXDsL3OwJhtPxhgwa4wmrDuHerFb7MDKK91XmotWLI=; b=jFwWctA5Dm6+6mshqbSGIlZYnV0ZyBT3sXIyoURapOLFWXa18v7ofR8sJxVcf+5NL9C6Cv 5OI1hXokAN86AKOZGxQIK1XAJu0OrU0v8QfEVgj0OSmhKj0PnuBcjV+Fe8DBVJBh+yFi3x hkax8EdIYA3reWJKFlfNUx80ne6tsHQxtOxwsq+dXe5JXSBVK8JVBY1+QmU95UtO1VtPQt 7I18E9SG/mie+OQ1AMjGHOKSRlejHQNjhLUcU6MK9HoiJHoDZLlGQA/BQm4VQDGDFEVC/C E1BjymeD5hj2EI9u1iad2qrzxG2WIc9yqKRFL+G43QS3zy3Y7T5amJo4qzAbnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6YVF30cGzhmV; Mon, 16 Sep 2024 05:33: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 48G5XPj0053844; Mon, 16 Sep 2024 05:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G5XPs7053841; Mon, 16 Sep 2024 05:33:25 GMT (envelope-from git) Date: Mon, 16 Sep 2024 05:33:25 GMT Message-Id: <202409160533.48G5XPs7053841@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: bae517022c9a - main - swap_pager: enhance meta_transfer comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bae517022c9a5945cb059cc59b0eb322e561d7c0 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=bae517022c9a5945cb059cc59b0eb322e561d7c0 commit bae517022c9a5945cb059cc59b0eb322e561d7c0 Author: Doug Moore AuthorDate: 2024-09-16 05:31:11 +0000 Commit: Doug Moore CommitDate: 2024-09-16 05:31:11 +0000 swap_pager: enhance meta_transfer comments Clarify comments about what happens to source blocks in swp_pager_meta_transfer. No functional changes. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D46682 --- sys/vm/swap_pager.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 64ae4ad78786..44fe4f34bb39 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2190,8 +2190,8 @@ allocated: * SWP_PAGER_META_TRANSFER() - transfer a range of blocks in the srcobject's * swap metadata into dstobject. * - * This routine will free swap metadata structures as they are cleaned - * out. + * Blocks in src that correspond to holes in dst are transferred. Blocks + * in src that correspond to blocks in dst are freed. */ static void swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, @@ -2235,8 +2235,10 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, */ d[i] = blk; d_mask |= 1 << i; - } else if (blk != SWAPBLK_NONE) + } else if (blk != SWAPBLK_NONE) { + /* Dst has a block at pindex, so free block. */ swp_pager_update_freerange(&range, sb->d[i]); + } sb->d[i] = SWAPBLK_NONE; } if (swp_pager_swblk_empty(sb, 0, start) && From nobody Mon Sep 16 08:15:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4l4p2fz5Wk7J; Mon, 16 Sep 2024 08:15: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 4X6d4l3bs3z4Rt7; Mon, 16 Sep 2024 08:15:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qjlwW001Phvu+aRlKlAhxq6jHbsZuh8kIbjJtu727i8=; b=kroy5cGk2TGz6lSftrNt/AGZXeKXb4gcWcjRpS/VypZlgmftNcmLE3yj7us5M7apu71XH3 FowZd3CobKZluc4GQ9CJAO+OrRXlqVXfumQPlwLkMZcGdITvP/njCpyI7gB5Q2BA90SLEo N1k0EYrvZO24MViWioqldUfkVP6bxle4DMDN1qmegg1V4BEYdn4P4LalRr0kET+hQ7RyCn ubebtQppBUQNstih7axlSH+gntM8/BpATed6RcDrztJhNbtx/zbT+TV8rqOOOskFV8kG7n rqB9CiBLOcpqQrZdMA19QKVO17helACOCAYmRWpwd/CAaS2aAEEFEyoLrGU25w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474503; a=rsa-sha256; cv=none; b=jPO3i7jcJlVwrWPRXjMvCdvrBHTrp5iBmCftMoH9C9mv66WyjWNXV71/44pTYrBuW7STk6 lO2SBkTkN2Ry4qeJ2DAqgSttLa3x5RVyXVoZY2aOGYKqLPvXUsO9Notx7PpJOLNtW6RWZj rRU1CeZ1pP/pTGogI5hfguv8GNpeB86wL0HJzEWyuB8XsoDKcYhGloEr+/a+E62WQLvw6N fxYoeIVcu9C2FAZBzoZfVCXOHWV4KV1mMu950RksYIwnxzY5AVEeHwKl0yUiT6XCvnsE07 SvRzNXXX9Wl58rBwbEibZ7OoJu199otB7H4+2VEko6Vy9jK2NPiio9CBYYsxlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qjlwW001Phvu+aRlKlAhxq6jHbsZuh8kIbjJtu727i8=; b=a3V6G7EdLqJVXRU2d9cyPprU1kJqaY7s+HfVKmDOdEnH2DWDCWHlAz084/9BVLiWE2wdIV QS4Pya9JFAMu82m8hXQi2XGN9letJJaflj7I/wK7ppJXt0wkqxK5ZcT1O0ERsgB9D6D6EV 4+5dYsMerl3P783rZo5uWZWEWTMWzmV65wbTGrp6eBVWvk+g/NghHXRPgQEr48FYdMZ+Qe YXcXUIVEvQVYDduTO34cfobaX3od5YgosmCwV6bjS5T+dpUOHVV5H0XlSrEvuhWtNnX0Jn JPaC/bzdHu1IPtgICJTg95mEFSLtjJuAP64htE03gRzaMaTDpVCW9U/w4P0qHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4l3ChMzn5g; Mon, 16 Sep 2024 08:15: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 48G8F3K7026982; Mon, 16 Sep 2024 08:15:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8F303026979; Mon, 16 Sep 2024 08:15:03 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:03 GMT Message-Id: <202409160815.48G8F303026979@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: 787259bfe564 - main - amd64 pmap: flush whole TLB after LA57 trampoline is installed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 787259bfe56478b9aa0699f2516d00722b9cc309 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=787259bfe56478b9aa0699f2516d00722b9cc309 commit 787259bfe56478b9aa0699f2516d00722b9cc309 Author: Konstantin Belousov AuthorDate: 2021-11-06 06:11:57 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:08:53 +0000 amd64 pmap: flush whole TLB after LA57 trampoline is installed Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 568301344e86..b513c0c9c957 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2245,7 +2245,7 @@ pmap_bootstrap_la57(void *arg __unused) *(u_long *)(v_code + 2 + (la57_trampoline_gdt_desc - la57_trampoline)) = la57_trampoline_gdt - la57_trampoline + VM_PAGE_TO_PHYS(m_code); la57_tramp = (void (*)(uint64_t))VM_PAGE_TO_PHYS(m_code); - invlpg((vm_offset_t)la57_tramp); + pmap_invalidate_all(kernel_pmap); if (bootverbose) { printf("entering LA57 trampoline at %#lx\n", (vm_offset_t)la57_tramp); From nobody Mon Sep 16 08:15:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4p0d8qz5WkPg; Mon, 16 Sep 2024 08:15: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 4X6d4n4zVWz4RrJ; Mon, 16 Sep 2024 08:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vi2Vmeql1DFWKF8Bzb86pKhOsCGMA3/YA+wdgUKyMLI=; b=GoJMFeNZGb39JQ4n/oT4P2TYfXM1Q/ZI4JxHcBDlK5EmybGDnfU0nwDYDd83dONm0dscVd B6pIvOxHGc7okDxXJqh7I9XwSJ4Ibto9ibl0TMrdxkBTmzwlCx3CPeGLlbMBNvA8FqHUSt Gv5hxKLB+KLuymbC0j3X2nWPfiGzeedlhqL5OKMzvPuZnHeVpjfXofK2BGmjk8rothm2fU eM21hsQ259hiqYjJFmQRki8w//JfwYN/80MJmJRu2V38MrHXAvrcPKrUITEhnqc68i5zjc TfVnxgtRQ0wMPgHTzaplZPbb+P8J3Mboo4Weu8lnf+2PiQNkLhRqPvFdNSDRhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474505; a=rsa-sha256; cv=none; b=U4b4CRr9BMyTezNy/XFK27rCXuXmvzK6VMAoo/N0gbA7rVww0f1pKWyuE64JWMlk2NYLye DoLrmD1FFsY0j7w3gq/JFaVZ1qnd35hmvnub3Ol3PKdGVLZsutdccHyffxcpjIWOqXvISQ ugJCNShb1hOy6oq8Q6U9lTtQ3DS55ufdCQoD2m+0eN6lT45rJPK02qaEe767a8mRkSABqW xJQfJwonOZicI+HSIJViUtagnxygmY2Ab2Z5u1Kniq7Gm6hcv2Q6VQEUJtVhMrE0rFGcrb fn5Au4OLqFXallVlzQwdmffI59X2NoGoNYuj32X6kbmkRIj8+IkO7EMNlCvXCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vi2Vmeql1DFWKF8Bzb86pKhOsCGMA3/YA+wdgUKyMLI=; b=C0Xgu2EIQgUP9OOwLiEL4mJODTGLnjQ4fUcZ2LoZ4/Ng1BRa4Za6TnZzPC3g2iXB58aSv+ YzdcIGmqLMY6hoPvEH8USwocrNOWI/Aa38eFAnV2RdvZoJ4P6NPUL1EDj9mGpU1cSrIYrS dpsWekiZ17unO61UJNZ85tvfFRsVRP0qbFqg/PO8xEl4laBqFA7BrAhu3a3YnyJ7EmBLyt UilUKh0kXMgkvTYL+KQWSOlX6Yr9nju8GArptgz7H8kLvfp0gfyjE+nddeOIyG/L21RA/Y ZpMQpVLlLXkIoryNYf/0sHsqdcUTskzZtbmm3x7rYZh7Fw3fJwLN+puq+4oDtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4n4XlLznQV; Mon, 16 Sep 2024 08:15: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 48G8F53Q027092; Mon, 16 Sep 2024 08:15:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8F5Ec027089; Mon, 16 Sep 2024 08:15:05 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:05 GMT Message-Id: <202409160815.48G8F5Ec027089@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: 9a49c98bafbe - main - amd64 la57_trampoline: stop using %rdx to remember original %cr0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a49c98bafbea2a896f72defe7d9f2b65a474c41 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9a49c98bafbea2a896f72defe7d9f2b65a474c41 commit 9a49c98bafbea2a896f72defe7d9f2b65a474c41 Author: Konstantin Belousov AuthorDate: 2024-09-11 00:35:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:09:20 +0000 amd64 la57_trampoline: stop using %rdx to remember original %cr0 Store %cr0 in %ebp. %rdx is needed for MSR access. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/locore.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index a51e5047fe54..86db0f76b22b 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -93,9 +93,10 @@ ENTRY(btext) ENTRY(la57_trampoline) movq %rsp,%r11 movq %rbx,%r10 + movq %rbp,%r9 leaq la57_trampoline_end(%rip),%rsp - movq %cr0,%rdx + movq %cr0,%rbp lgdtq la57_trampoline_gdt_desc(%rip) pushq $(2<<3) @@ -109,7 +110,7 @@ ENTRY(la57_trampoline) l1: movl $(3<<3),%eax movl %eax,%ss - movl %edx,%eax + movl %ebp,%eax andl $~CR0_PG,%eax movl %eax,%cr0 @@ -118,7 +119,7 @@ l1: movl $(3<<3),%eax movl %eax,%cr4 movl %edi,%cr3 - movl %edx,%cr0 + movl %ebp,%cr0 jmp 1f 1: pushl $(1<<3) @@ -128,6 +129,7 @@ l1: movl $(3<<3),%eax l2: movq %r11,%rsp movq %r10,%rbx + movq %r9,%rbp retq .p2align 4,0 ENTRY(la57_trampoline_gdt_desc) From nobody Mon Sep 16 08:15:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4n3Rftz5WkLt; Mon, 16 Sep 2024 08:15: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 4X6d4m4DDkz4Rr7; Mon, 16 Sep 2024 08:15:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1ENwwx/bj/rH9spvkLNCdPxWJXM/HK1OFAtnCkgJ3A=; b=ALDGcVWswcWmpg1bk/hCExA+Yk8T8HXlmCW70Kqlqaa5bRGSdBtry8xTINRVyrKiEdfr6O wlg70v2iy8RT37cejDu824bHaSn4Hiy7tEVKBTP+OndbjeuzDxPFrvfuEQadp5YavbaGtO QmwVgS6OHhLYH6m6Bmo8UKHWYVePoMguL7a8EMCInTpi45uhGaRD+lJuUl/APbtfXJwSD2 SsF6+Ugr31ZzqYpWKCVBj6SDWViH5lrjkSn+z0ACbh6XHCGwmGoMp34Q6707lwQR4xjMWa whujswXec/dwFg0FpQQPbCKyBDXU/NAtXns8QionV+b5b81tKM7EKbI4v8tong== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474504; a=rsa-sha256; cv=none; b=OwnMAA0niRSWpff5KVzbGQ7wOoEg91AY4cmC5tzh8gPoE/f3OeO61qz9C8mS+yxddDoFF/ +OlIfmusH3uRbymQXwCPK+FzEsn2/+vTJCwhFapUCY4bnPVVaSic7rocTPRfU1wtcfektn rapGmw3QLhHKCUWf82UOVFePenMI+i85H6UbLRWiV/uUhXtvQbEE+hK4RvJRg1aGaqb6Hh 5Zod17DcMNQN+9nVa6ztdwA+Qvk+KwG3K33ZIJGZYRNmiFrTdWrpYdX6ApYjmB75Dy5Lh4 Q1ivMG1by4paCzfiB2TZsGqhidUiFBVs0AI+rCsd5Y4G+7xaNJtYyyykYWxJFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1ENwwx/bj/rH9spvkLNCdPxWJXM/HK1OFAtnCkgJ3A=; b=mbvVNmKnRabFLEDxUDHGZgh8pZiTZw7q4otvCpfplPEkliHuwdVd6voqtnWv6PAxMqlf7H HwfCvXZ4LLvAvgqVBSR0tOu3euigwPuZBZlni8jogJjVDgvMadvjzA6bjhEtTP5tDwwbs8 Xy1PsnKj08BPplLW5+oyxct4xCyNDsXk3B3IRGL9uMCLzBGg69GWUOsbxAarJuo9tZn/Pw UjXMFto0v/a18sAhyQmfbsUq00Qo3cTSdHe7ioOtMpUsYLxNUTpI5yuLffQCUARIXTpf7+ irbYvulr+VKBI4MKSrDQ97kQNTCRD//fXk4YYhwoTKS2ga6hrchkYjQKgEjl7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4m3Zchzn7b; Mon, 16 Sep 2024 08:15: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 48G8F4EC027035; Mon, 16 Sep 2024 08:15:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8F4xg027032; Mon, 16 Sep 2024 08:15:04 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:04 GMT Message-Id: <202409160815.48G8F4xg027032@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: 180c8ab07995 - main - amd64 la57_trampoline: jump immediately after re-enabling paging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 180c8ab079950acb15c6629ce293055ea0117b39 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=180c8ab079950acb15c6629ce293055ea0117b39 commit 180c8ab079950acb15c6629ce293055ea0117b39 Author: Konstantin Belousov AuthorDate: 2022-09-17 01:35:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:09:03 +0000 amd64 la57_trampoline: jump immediately after re-enabling paging Literally follow requirements from SDM and execute jmp right after %cr0 CR0_PG bit is toggled back. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/locore.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index e52d36125afd..a51e5047fe54 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -119,8 +119,9 @@ l1: movl $(3<<3),%eax movl %edi,%cr3 movl %edx,%cr0 + jmp 1f - pushl $(1<<3) +1: pushl $(1<<3) pushl %ebx lretl .code64 From nobody Mon Sep 16 08:15:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4q3X4Zz5WkMF; Mon, 16 Sep 2024 08:15: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 4X6d4q0m2wz4RtN; Mon, 16 Sep 2024 08:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJAG2HiWU0O47JzOumxzF6adfeKV8YeDGpzVJLcRp30=; b=FTyQCQIE4hh2muLKyc8Us0t1Oq041mq7afZbA2TFEPPQO4zdpL/ITVOE8taLvkt2FAzK3C qrte838UwrtX4/uU3HEeC6FeZFqXG2AMyE09DUJWV0Zv3CyMDX9vBJMS9BGcAWlE1XzcXQ CVAorljPc2oiuc0PsyUWdzmmr8zgOd3AlK4KY8JSstglsmblIvNoaStfQAbxK6GABco9fn RSxo3+snFRTNI61IAp5F6cN+qDu/Wa9YmSy66RgA51TuDdZXLub7Ucr0UTGhJkGWnYN4Li PuN5knYqWs9OWQKrv77A6JRLFQwl8401sD3tG5vEI9COE0rYSrHj9YK1TtId/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474507; a=rsa-sha256; cv=none; b=IfBcTg+u+xmdu+d/obDu5QheiSF71lkQiBjCagS4CCJ/rTMurn8xaxcrjDyLa/ASaDsaOn 72rVhPjZZICTTbFJ3eJDZbI7KEx/n0roxMX6k5O2ldKSeQGjKsh/DxN2XKHbKVvUp5t2dl ONVHQacohkrXKvmdvJKalH9iSOFukVzI/DxLa7ezz5YC3dQ5OgsEpm/p3x8f/Ivhpzj1Gz traMb1vOqerp3AOeg/LHWA6gIbvPh1ZeS0ZvcbKLaSyUrY2x2SjMSMYT6gYvvTh4QzFoy/ sSQXSdA1LyQehvsoeTnbUb4B5D4/+XOCF/iho8YJCAvz9Vudz78524TeovFJgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJAG2HiWU0O47JzOumxzF6adfeKV8YeDGpzVJLcRp30=; b=XjYqBOrCGqaV5qR/DpDdiJxMkn2jz5yIKT5aNgUhwrE8hAhYxHAh6haW5PIQwq+uA/5xlh QJpcCpOYUjgbwmcRBEYLKFeM3B5LboQNlhsLc+FjbUkpsBYq3pvLwFbWcP8GM4Nt4ENMKK Vou/5yI2vqYLtmefScehYWeXQYUZWyitE0oy9xozy/aBhSphoDeQ8sODjiw69RRIjbwtFp R1I8zesnisT7rZwCYTgCt7Zeqs2FpHeEQmHIW1cGR4dPyfIrg9LUfV6hemgYvE0NyNUzuf EbzzDKVYdcY7Tu+6fzJJuAAFkRAq0PX7DjhmVFMvUEkRUNPCaNCcyBs7WlX6gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4p5Yn0zmtv; Mon, 16 Sep 2024 08:15: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 48G8F6GQ027146; Mon, 16 Sep 2024 08:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8F6Kc027143; Mon, 16 Sep 2024 08:15:06 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:06 GMT Message-Id: <202409160815.48G8F6Kc027143@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: b7ea2b69ef66 - main - amd64 la57_trampoline: disable EFER.LME around setting CR4.LA57 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7ea2b69ef666ee8cdc6dcc814d610df0a7f0999 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b7ea2b69ef666ee8cdc6dcc814d610df0a7f0999 commit b7ea2b69ef666ee8cdc6dcc814d610df0a7f0999 Author: Konstantin Belousov AuthorDate: 2024-09-11 00:39:30 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:09:38 +0000 amd64 la57_trampoline: disable EFER.LME around setting CR4.LA57 Changing paging mode while LME is set seems to be not allowed. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: jThe FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/locore.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 86db0f76b22b..9a991402cdc2 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -114,11 +114,21 @@ l1: movl $(3<<3),%eax andl $~CR0_PG,%eax movl %eax,%cr0 + movl $MSR_EFER,%ecx + rdmsr + andl $~EFER_LME,%eax + wrmsr + movl %cr4,%eax orl $CR4_LA57,%eax movl %eax,%cr4 movl %edi,%cr3 + + rdmsr + orl $EFER_LME,%eax + wrmsr + movl %ebp,%cr0 jmp 1f From nobody Mon Sep 16 08:15:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4v5NSnz5WkY2; Mon, 16 Sep 2024 08:15: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 4X6d4v35xzz4RTj; Mon, 16 Sep 2024 08:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uyDimxQlkhX5ISDSLaYvr8Td/wPUrK4lKfXNYZgUsAM=; b=GYy13yoX8guqX8VburQ+MgkMw6akOsCtD+MHoTmv3brpBL7oGlg1zpz4oBWs6vL7ojQy0Q aWqWkl1B6dxDzuWvWuJZcmLj7RCSvzdeyIzsVuvEEYLqg/E8F4kdeKYRSAPNeL+MI/9DHP aKmVx5cXfBl6IAvNhyVDYn77wA+Le9dEPzd0X9zBFqRYvHlwEKMSN8Ffh8yEpu0yC5CvxJ ck5ZAUkry3MR2drQxFEIoRt1TZcTpZlbp+RZZLfFhozXcG70VbtGI7n9OL9zC3QsSpKX7Z ZiXPZHwoSfXZkgNPaE8B2fXOA69geyv9DTM7qExQEQAfwApNXca+B3LxbzIJtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474511; a=rsa-sha256; cv=none; b=Rw+asC7d/kvb6ZIfxac/kogvxWiF7ThqYoWsmmPVihvvYfsaKM56BAHGR4v1V2BDjEE7h3 WyhRNtVNc4xpi2WR/uUB1KdsKnuYnsDjBIsE/rEGWMLE/9Gmirv0kzLklFrWUyCcSOkRBv +3vaVHxwxZgvYeQJprzybX6qWgRyaWIPNQLMDb+IoShjlHQCFJp/ScgB6AWx7zI1bpKd5Q f4WXNgqakfJeLTeni9XxENmuKt9JsUj80bxXCaTHXK4LI4SsqwUC9Z4pZEfppyguXmZ/Eb JZYzjsO0Th0i98rEC10L2/Jm7AaMVIDrlZrYcHL8RHe1XJNI90XD6e5RP3napg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uyDimxQlkhX5ISDSLaYvr8Td/wPUrK4lKfXNYZgUsAM=; b=UzCcrf3JSLpXKDh6ve/jGCZBsXVzFd0njAj3ueCFa5sfRinDsou5ndCgRGqVXID1QzEyVS aU341dywiBVyiXo/RBF0BL2AP9RAlzwRaGAaLOLycMixan25sMkQRPwR/1vtzf0mLFLS76 B+X/vde0t79yxtvwwXuzm1HFcY5HBcUDNMy7/gGdbeIAheYZIgl2BwRDGthiadnUH0Ha1M y95bg5l2AuQ/UIQMdJ06Jw4t2El5FbkyOtLeHjJ0Qf7GbAGsDWL3PXNbvVTjfO28cbBVYs Ll17kpJi2j8KW7KV/yf6VpNeNnacaqG1Xr2ghuomdHolmbUdtH4g8vYtR6Antg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4v2PBPznB7; Mon, 16 Sep 2024 08:15: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 48G8FBZQ027378; Mon, 16 Sep 2024 08:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8FBYf027375; Mon, 16 Sep 2024 08:15:11 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:11 GMT Message-Id: <202409160815.48G8FBYf027375@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: 678bc2281c37 - main - la57: do not set global bit for PML5 entry List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 678bc2281c3727e920604545240d9115de3d1bd3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=678bc2281c3727e920604545240d9115de3d1bd3 commit 678bc2281c3727e920604545240d9115de3d1bd3 Author: Konstantin Belousov AuthorDate: 2024-09-14 17:15:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:13:51 +0000 la57: do not set global bit for PML5 entry The bit is reserved for PLM5, causing #PF on KVA access on real hardware, unlike QEMU. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b513c0c9c957..eadcb726b6c2 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2226,7 +2226,7 @@ pmap_bootstrap_la57(void *arg __unused) * entering all existing kernel mappings into level 5 table. */ v_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M | pg_g; + X86_PG_RW | X86_PG_A | X86_PG_M; /* * Add pml5 entry for 1:1 trampoline mapping after LA57 is turned on. From nobody Mon Sep 16 08:15:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4t3kcRz5WkQ1; Mon, 16 Sep 2024 08:15: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 4X6d4t1zSFz4RcW; Mon, 16 Sep 2024 08:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IxwUrho96MYaeZeVYvVvyDB0hGiPBOZZAlnPCfn7hWo=; b=KjJy5e3yH+f0NW+Sy/bp+amwzXquvY+IVmX9cvx5BGTNvh/ExmAxFFDTeM1Wn+2RQ5Et/h N9QKnxbTqz9zNGIXPhdQmrTTEwQBjBop7In0K3hpgLq4e8Yf5OVpZaNp4BbrlT9nNw1umC CXkTiiBLZqHNUYYzrl9pYFFrzMqq8OYTp4QNvLBYGE2MdsCJcrf3TmjuoxlwNeEkXdYYrr 803oelcIxmiX22ZgV2lZGZLC2L3S1RTmodrF/2W8HEGOK4powuwY+DFg+/nD/eoFqGrSvU B5I0Nqq/mj5CNbk+JuRiFktAosLcOxssmtot/RtIscpapKTLOrgWsDkZIwLViQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474510; a=rsa-sha256; cv=none; b=gRB5zLZbcM6hIiuv0KlVgfdmKasrc/5lADiEf8xdXHuqFP+1R+RAkmBPiukIdSEvDwhgnA 4HJO3PWlHLcJS24MgaGoQp9HAvoOKeMtDJuvKIibDm91aUV+dDe3h+COZgKCTBPWJ3BM+7 7oQCc2+2hPA2n1g+my/CpNLp4JrOdrkJPbckE/3ctiVoBglUNaoFoxg52TJzijnAtZvn+m c8WT5qfMTakAONkd5KXXE5iIJWySeJT/df9XDnp0gsovZMgDGOuceGQzTpmaAk0nRa22pU qXMkdYscUvC+IsJkDTX40rraxNDq0Nexx9VkajaZ5Za2mdQiy9Kq5PDp/w6+PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IxwUrho96MYaeZeVYvVvyDB0hGiPBOZZAlnPCfn7hWo=; b=jnMeRNdHVpyMYo4ffjigyQDhg2K7ld9dESDJHlUOgigPkwxYXHqwcmsnl2IVzG+YNQi/wE EoZBDPtPI9NjLpTDwU5ZY/U5/ZNiSNfKDEwdc++XxP9CVDxb/R67mSSnzTmGRkOI7jbDj9 Xb8auqrGxq1DoWVk3U6wvQjf0t24X8K5ZdDWkRy78Ls70XTMSV6wA4k1NIjz6AmHiz+SI/ fsCnQKcssPnSPspFG9h7HVj4ePl3V0+gtEZqGuxPXvdufbj4Bi0QXT6cnC5DBB2ECJUmnW 6dUFLHQoyjW7x1R/dptQ9YPIKUnD+sXm+t0P96ohNLOL5KPphRaqfrUAwPd+rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4t1bRTzmty; Mon, 16 Sep 2024 08:15: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 48G8FAPN027316; Mon, 16 Sep 2024 08:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8FAXP027313; Mon, 16 Sep 2024 08:15:10 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:10 GMT Message-Id: <202409160815.48G8FAXP027313@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: 280e50461a1f - main - amd64 la57_trampoline: save registers in memory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 280e50461a1f638088e7a0b9116976821c374b56 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=280e50461a1f638088e7a0b9116976821c374b56 commit 280e50461a1f638088e7a0b9116976821c374b56 Author: Konstantin Belousov AuthorDate: 2024-09-12 05:43:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:12:25 +0000 amd64 la57_trampoline: save registers in memory AMD64 ARM states that 64bit part of the architectural state is undefined after 32<->64 mode switching. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/locore.S | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 3df3dd722f45..1ed9085e655c 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -91,11 +91,12 @@ ENTRY(btext) /* la57_trampoline(%rdi pml5) */ ENTRY(la57_trampoline) - movq %rsp,%r11 - movq %rbx,%r10 - movq %rbp,%r9 - movq %cr4,%r8 - orl $CR4_LA57,%r8d + movq %rsp,lst(%rip) + movq %rbx,lst+8(%rip) + movq %rbp,lst+0x10(%rip) + movq %cr4,%rax + orq $CR4_LA57,%rax + movq %rax,lst+0x18(%rip) leaq la57_trampoline_end(%rip),%rsp movq %cr0,%rbp @@ -143,12 +144,14 @@ l1: movl $(3<<3),%eax lretl .code64 -l2: movq %r11,%rsp - movq %r10,%rbx - movq %r9,%rbp - movq %r8,%cr4 +l2: movq lst(%rip),%rsp + movq lst+8(%rip),%rbx + movq lst+0x10(%rip),%rbp + movq lst+0x18(%rip),%rax + movq %rax,%cr4 retq .p2align 4,0 +lst: .quad 0,0,0,0 ENTRY(la57_trampoline_gdt_desc) .word la57_trampoline_end - la57_trampoline_gdt .long 0, 0 /* filled by pmap_bootstrap_la57 */ From nobody Mon Sep 16 08:15:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4r3B7Mz5WkXl; Mon, 16 Sep 2024 08:15: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 4X6d4q6gPGz4RrR; Mon, 16 Sep 2024 08:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A8uxeFsQZTxcGBeiq2ixsjHWd0P0Xlg5nru41gwz3hs=; b=YLeMsDQlQW+24q3bSU2DsiWKO/du57/wZPdyRNUp5jPqNFJDP//XIsdHZi34jkOCFqInk7 wCZQUXXpgaOdHzlczDZO16nzIE0wYgBhw4t+B2D/WGOw1HCniTZfv3VGNgUlk5FpgJU8gU x42yIWoFGYcoFFvG3hzkLmunqOaapQ4f1OMTtHjUo6AShuXRZtKPRuXL42FF5sCWrsVxAm A2h+efJ1QtizOaGYNbcguSU1sd0uet9Tai4WA/UAYuyHdM6UTbMCEmGQC3GYqpRNaHO1wF eXbfNegKJS3MEW+JRTW1mjSRCLwHpspDoTMgYfh0+nOZu1XW1cMV9hUNpZkZRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474507; a=rsa-sha256; cv=none; b=OnKRKI93O1Q5dEHn69WlZxIneJWb8F9+j91aDvqZHbbhuNQLF8Qg8RL9Gn0EPtnm9ebzMA p+Olp2MWOXn3CBKyGaLOFdOtXpvs5OsB+Wz7FeO59a4zAiesYXkYI2HsODbEWFtD9Xl79J 4fg3QVxKxlythwYBRLmJq63gD+qgn0umWOfEvWxIBiKlYpQI5NPpWH7a6nnOlVbYOG46vY 3t3eft2LGBamsaNtmou0ByTTi670vSba9KFmIvu0LoH46bNgKjh/tO8spx1YCg8fbDcead UKxvXgm9Bl8a0fE65Ds0jULpf0cvVH21TiRuhMNjiy3Dd+h1PBo2vlcOEZjmhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A8uxeFsQZTxcGBeiq2ixsjHWd0P0Xlg5nru41gwz3hs=; b=JiYJsp/wo5ElA5wULYFd24Vft61hN4UjUY2/BR/Rwg7aMYKj2H/8Qq7izBH6Do5ll9NOYD jmdP9gkvuAWGFoGfMk0HyW/odnZFJSzNlZc7Ilv1aLcJ4HU0v03FMiYrT5w8esBVWy52n1 +KEpiC4h8S2W7plDnXvB8qRfuXQ+MuyDmgHD4x5llLRXBD4jxfTuzqjmBHqVSlnUiciV6Y RLqhoNLAcZRlu07fOOFE2NI48zLV9IvAeSxutWjtQcDyT7ORfcK8Jj9DRXtAkZfsfhAWD7 dM7cvo9uMz/re9SI8j7gijRwOkli9uJoUOrDGb+iUoNH5d3IEIONCyKvdWMdaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4q6HbWzmtw; Mon, 16 Sep 2024 08:15: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 48G8F79j027209; Mon, 16 Sep 2024 08:15:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8F7UI027206; Mon, 16 Sep 2024 08:15:07 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:07 GMT Message-Id: <202409160815.48G8F7UI027206@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: 1be58e67eb24 - main - amd64 la57_trampoline: turn off global pages and PCID before turning off paging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1be58e67eb24024bc808357771579d396679ecb0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1be58e67eb24024bc808357771579d396679ecb0 commit 1be58e67eb24024bc808357771579d396679ecb0 Author: Konstantin Belousov AuthorDate: 2024-09-12 02:42:23 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:10:16 +0000 amd64 la57_trampoline: turn off global pages and PCID before turning off paging SDM is explicit that having CR4.PCID=1 while toggling CR3.PG causes #GP. To be safe and to avoid some more effects, also turn off CR4.PGE. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/locore.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 9a991402cdc2..d05f38dbba05 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -94,6 +94,8 @@ ENTRY(la57_trampoline) movq %rsp,%r11 movq %rbx,%r10 movq %rbp,%r9 + movq %cr4,%r8 + orl $CR4_LA57,%r8d leaq la57_trampoline_end(%rip),%rsp movq %cr0,%rbp @@ -110,6 +112,10 @@ ENTRY(la57_trampoline) l1: movl $(3<<3),%eax movl %eax,%ss + movl %cr4,%eax + andl $~(CR4_PGE | CR4_PCIDE),%eax + movl %eax,%cr4 + movl %ebp,%eax andl $~CR0_PG,%eax movl %eax,%cr0 @@ -140,6 +146,7 @@ l1: movl $(3<<3),%eax l2: movq %r11,%rsp movq %r10,%rbx movq %r9,%rbp + movq %r8,%cr4 retq .p2align 4,0 ENTRY(la57_trampoline_gdt_desc) From nobody Mon Sep 16 08:15:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d4s45jYz5WkK3; Mon, 16 Sep 2024 08:15: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 4X6d4s0ZTJz4RgL; Mon, 16 Sep 2024 08:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MetvNB9iMQ//vzbZz3N6crbFyjVf8I/kDVGsHQ5emIs=; b=VKNLBF3gxXrJpXKWrGdT1GeVx6g9fRwLsp9uujlM2HW1/2dVzGfxdA/fchrAS5YpOS1lvr T9WbzP5wi0nuoyEufm+XKdcWw+mMS1hAfH+zWqp58TX0g3wnfS0bjuxvJaCQbUZg+iTOZ1 8a2+u5PRz1Gr0MVUTIVn00hilPjdwKA7o52uaopUopI1BJb2otIlwluprVwwZnySKRgNMW iqroGfgDci4ifZzv9Zpjuk1fAHhN2NUEiXJ8h4J3J5EVLqoKbTQc+mSK8lqclQ1zHY9L3f ZF/ikH+c4fxYP22Un9yiOAqXdJNNn/cnyzhj9VSiKy0dMXcdVYLzUA3fPfRnlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474509; a=rsa-sha256; cv=none; b=Lq9U2hoELWyfnupPQllszBFLjyVNFyuSs7F41uQ3XGQJJcF1EZujPcyOE+RMkgIEo2Zl4z zKGt/tMycCokqjxXm91bZ9AV5xoaPmVvg3KL3/8QeycPAO0d8l7ANO+pVyVV4wVJJ+e/3k lGLOk7Az8Flsu4owQ8SH9q+FiwHhW1Lu98mVwgA//20gmAPSVBqZyRWmKi6c+79QqfGoGf 3FBtEJlYtVWKtRM6QaIT12P6NQKHfa4+Cl68dTIKFMDOED4c31RLvFgcgUVineb4T3FXfV +7kMxxIqRSK2PydHewDCSa3itPJXalSdDo6wANWt+k8PW2oIajxpLbEu1TqQtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MetvNB9iMQ//vzbZz3N6crbFyjVf8I/kDVGsHQ5emIs=; b=JczrMKP2yWxPbnGQrJb+pHco397F1iCVY1tE8SR54qiMTqPZ2cmp1XclaZMT79uwU1yWpS jyfhJ7M06ZtzlhoxyM6Q2M/DOF9TudBVjNnpHC6skICKPCiFP84+cTGZqA4NZ6XlVUal1f rnzvGTAjrFymCT9DpRGyqCvBmvYX3AUgrqCllY9lccihkt8NBpOYpaE6eZENcPtGSSdQD6 4/9Vw14loxLDToNCmlcg5W1GdO/j332VEEd8YdFi7uKa9lnV6HOS/nQiq1gUHNIlPNymGb GRcBxGUCkOtpU/BJ4DzeyGiqhS4T+7Fawf+ruadgqsSs3Myg5tqjj3uWngQP4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d4s0ByNzmtx; Mon, 16 Sep 2024 08:15: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 48G8F8O8027269; Mon, 16 Sep 2024 08:15:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8F8lp027266; Mon, 16 Sep 2024 08:15:08 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:15:08 GMT Message-Id: <202409160815.48G8F8lp027266@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: 687b896f8ea5 - main - amd64 la57_trampoline: lgdt descriptor is always 10 bytes in long mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 687b896f8ea58e67c3a0bfbd3af3041733e57dcf Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=687b896f8ea58e67c3a0bfbd3af3041733e57dcf commit 687b896f8ea58e67c3a0bfbd3af3041733e57dcf Author: Konstantin Belousov AuthorDate: 2024-09-12 03:33:48 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 08:11:54 +0000 amd64 la57_trampoline: lgdt descriptor is always 10 bytes in long mode Extend its storage to be compliant. This is currently nop due to padding and nul gdt descriptor right after the lgdt descriptor. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/locore.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index d05f38dbba05..3df3dd722f45 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -151,7 +151,7 @@ l2: movq %r11,%rsp .p2align 4,0 ENTRY(la57_trampoline_gdt_desc) .word la57_trampoline_end - la57_trampoline_gdt - .long 0 /* filled by pmap_bootstrap_la57 */ + .long 0, 0 /* filled by pmap_bootstrap_la57 */ .p2align 4,0 ENTRY(la57_trampoline_gdt) .long 0x00000000 /* null desc */ From nobody Mon Sep 16 08:18:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6d8X5Dxdz5Wkw1; Mon, 16 Sep 2024 08:18: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 4X6d8X4j1Dz4VZZ; Mon, 16 Sep 2024 08:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QCGzapN5g+GjMEY+DZGh9uUnTJR2yXvjPfasCkVFezY=; b=qvewvm2LAs4iGNEQIFNLsael6Pncdi/gDYdS0VVgt6BuOqGpwTuWSMh2YXN6fS+pp/YZCR 8kw9GGSl9av4bSSAY6t627EPtiL+SsVlxEjo8qXFHcKrdKGC+ofQ5bShmdq3vzRFlKbV6s ZzLCqoHPFEe9pFfzXL/YLddrLLrp7T2NRAAQMPGbQ007YGc3slZ6jM8ngMoBPLXzjYm2pz btTo1XvWDZZKOO/WZQ9EysAnwG8Zra9rWipfHUOI6bV5beY+xxDosell2B/Cba56XNLD+k jCqG1djyUSoAf+3aoX5pgYMLVIHkmCNaX7BqF4wQucz0hEnCVWsDO7+B/tjadw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726474700; a=rsa-sha256; cv=none; b=VkDSDbr+SCu9J4YFUuIOiVE9hkCmQWxT7gSmdlL1QRndu3UiucykWPBLH0UaZHY1f89D0j kzwfXy23DhIWRce6ZrD2Let/nWxy4b2DQBBr6paQJAb4AOBuCMZS/vlHPlJSES2fUnlShi BbHrKYN5M9cxVDpBZi8lEF2udq5aH9Vjf2PuGB5UeRiaAuIqNZrUuC0TODOumWzjNFIunA 2KWyZi7T4RWPygMZ3ta8hAOFl8gjk9ieaZIWDhmKWXuGyEKBy5yeXLmHVdzc9hoZsNCCDm eY0H25PRr6eyYZew97Tb/BZTJxCEqq6gUrlmnhXDz2847DZTm5tAxxU0WJ+33g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726474700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QCGzapN5g+GjMEY+DZGh9uUnTJR2yXvjPfasCkVFezY=; b=YObptCSupg1URu7P2kpo3lR1uWidf3XtiBgVHoubPoXBhbIoXWOgJ+wtgMfloVkHfB2q0C fIipGwJuw/EMvJTlmab6JX9BVifFgCvnNM3BAFeCMKiJUVGul/mzLTo/f/wlkdljjqR6Ku GaGBpqkpxiUsEoipP2UZUnhecw7bdszPhiHiEm7bR9xOtviTbnbRMSUfQyJfgoPcJ9X2Dh bA2tcMekrLEl4JtDpUx81NUJquNQgN7g1YO0weg14sOEw4EfusvXpuRUloWBEWv4QMe26a WWnhZcnnrto4vM5IkRQR64hebKs8MYl9jZjVVsXGTE4a1FD6ekEfIF5jZsZH3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6d8X49cpznQX; Mon, 16 Sep 2024 08:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48G8IKPM028019; Mon, 16 Sep 2024 08:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8IKhP028016; Mon, 16 Sep 2024 08:18:20 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:18:20 GMT Message-Id: <202409160818.48G8IKhP028016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 4f4b483d3100 - main - stress2: Added a comment about a problem found and fixed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f4b483d310058bd45323e3721e374724c1ccf0c Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=4f4b483d310058bd45323e3721e374724c1ccf0c commit 4f4b483d310058bd45323e3721e374724c1ccf0c Author: Peter Holm AuthorDate: 2024-09-16 08:17:50 +0000 Commit: Peter Holm CommitDate: 2024-09-16 08:17:50 +0000 stress2: Added a comment about a problem found and fixed --- tools/test/stress2/misc/mount7.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/test/stress2/misc/mount7.sh b/tools/test/stress2/misc/mount7.sh index d85c91529e83..2489421c544d 100755 --- a/tools/test/stress2/misc/mount7.sh +++ b/tools/test/stress2/misc/mount7.sh @@ -28,6 +28,14 @@ # Another parallel mount(8) test scenario +# Seen: +# UID PID PPID C PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND +# 0 37225 99871 1 32 0 13280 3116 sdstart D+ 0 0:00.04 mount /dev/md21 /mnt21 +# 0 37236 99550 9 68 0 13280 3112 sdstart D+ 0 0:00.04 mount /dev/md19 /mnt19 + +# https://people.freebsd.org/~pho/stress/log/log0549.txt +# Fixed by kib@ in 4b273a7fb9e6 + . ../default.cfg mounts=15 From nobody Mon Sep 16 08:30:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6dQW6D9Yz5WmS4; Mon, 16 Sep 2024 08:30: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 4X6dQW443Sz4X28; Mon, 16 Sep 2024 08:30:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6mFJydXjjf2R6fXi/1eGc0ToQ9pSAxfPy0iOsJRccto=; b=ylbDCbtl9s8ZpItpuaSD+j4tKrEgax7cbcta7HW0WRyY4WPY6vpuQZxenV49CskqM7Uhot CJcNtUDIQX4FdmInpYdo9+h7thkfMKmzG9w9wvGnDFakszt3XcSwO+G7qanOcq24Brj63Y N8nJkduyBFvZYWSTh9vr4yYAshHhvHBN/0wh/tfIm0J/ucdwprOw+Vfn1yiE7bpYx7TGzA vYfWo6ewbkTrnI5R+xjf+3+jf+OysHmxxDJwCP+E2Nb4t3lxbe1Erzo3ZBKaz5iSkX2jwX wvms/qdOuGUASU7zVxJi5vxNPwwR6Irs/92cBlBoBwdeSjkZAyg4cI7T89CGvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726475427; a=rsa-sha256; cv=none; b=SChiXh0S0/YGl1sTec1006be2kYWbTs1Zv4EiQBcIAIq+V+nJxTv9b+p2OjK0+bKQvV8Dg UZV7MlEzQmSmQ85+MwCiDjIB2yn0169W23Ch/+I0CGAPfQf2501ERYb5gtxBV1O7ytxh5S 6UOXbpOKZthfFSimhS5YUDolT1VhxzKfNVSl6zFLdbDP1HQw1l5sUf3s31cDqvtiv+Ta1w mpDhhAMwc1nX5UqiGoXFAPDCXq0O0qFY8I4ye+z3/spxIUcaq21kbewARCwTMZe0dZi6zP ukyAkD2uSUb7Qlzmm0ojcQIfOsnTWPdF2GmxpOpgaVhgvYOHMjmQ3DzDs/nhBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6mFJydXjjf2R6fXi/1eGc0ToQ9pSAxfPy0iOsJRccto=; b=psTAo3gxqIG9q/lnghRpJBR8bRmLJ/X9IoLbIe1ElihoWC1935Dc+kqSXIE+8VOalmN/f9 16s4YUfYMIPS56LXwB//ZJ7nIfJ5uP8HTVTM8SgzdzHXuSuhL8E7SXYg4hRVtNeU2ivFkA wE6CJvBrjVNaTtS3YKztPxM8TXl9+QTYJBecP7qE3dnFFM88DrQcSKwk/LIxe3G9ckFtNr qFtTCDwY35UGC4X1GUwXf86rVylJOlUDg+ZfgPmsC10B6foLq2kkgPBeloQahuw5mcXkuQ 0rSC+zPrl4nx42NllgotL4/Qjr2yw6NZmIqPlZDFmMclITzGcefEimsIAk0YBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6dQW3YnwznF6; Mon, 16 Sep 2024 08:30: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 48G8UR7o053665; Mon, 16 Sep 2024 08:30:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8URSA053662; Mon, 16 Sep 2024 08:30:27 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:30:27 GMT Message-Id: <202409160830.48G8URSA053662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: a213882b9c41 - stable/14 - stale-symlink-buildworld.sh: improve documentation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a213882b9c4141bb5635eea2ddc2b4f1190cf219 Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=a213882b9c4141bb5635eea2ddc2b4f1190cf219 commit a213882b9c4141bb5635eea2ddc2b4f1190cf219 Author: Wolfram Schneider AuthorDate: 2024-09-09 14:55:29 +0000 Commit: Wolfram Schneider CommitDate: 2024-09-16 08:30:06 +0000 stale-symlink-buildworld.sh: improve documentation (cherry picked from commit c77ca9a72c9934c407852f00d88cba09f5c9e31f) --- tools/build/stale-symlink-buildworld.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh index a4515db3fccb..ee918d1c9cd9 100755 --- a/tools/build/stale-symlink-buildworld.sh +++ b/tools/build/stale-symlink-buildworld.sh @@ -4,8 +4,17 @@ # # stale-symlink-buildworld.sh - check for stale symlinks on a FreeBSD system # -# You can run the script before or after `make installworld' +# The purpose of this script is to detect stale symlinks, report them to +# stderr and exit with a non-zero status. All other cases are ignored, +# such as no symlinks, missing directories, permission problems, etc. # +# You can run the script before or after `make installworld', or any other +# make targets thats installs files. +# +# You can also check your local ports with: +# +# env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh + PATH="/bin:/usr/bin"; export PATH From nobody Mon Sep 16 08:30:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6dQX5CMhz5WmKR; Mon, 16 Sep 2024 08:30: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 4X6dQX4C60z4Wrd; Mon, 16 Sep 2024 08:30:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O6y/xUTw0zhd0q4+a/N+bEGA6LRUxqWyRT+m5HW/r+c=; b=JMbuRqTqbLUkYoCNUzGiRCgeIO+4ouWesw74il0UUm2aipjC1tyywEmmP1ItKpyjXOlh9e GUuZa6b+22eAPVaZiNyaH1zV08DmzGBeyccjMqiNp2+g1Tjoe1kXD/LFLqNpyfU4/7AoU/ CK+jPE6AEuvszwCgeYGSRSH7m+sUfg6O1+MYkPHlvDI95E0TjFcm8nFCMNb4imiaUiIaa1 twM2eb3Bx9ukXw7Fef++Qp1M53oVmigVxL5yv9kZ4ryiyLLsrJmFHT/29Dy8rt/4djCynd zWYWfSu910HZwMS/AxnIAlNj9/aYJRSSLnf37l/+pPLd8ohnKaphj7UGLjnqrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726475428; a=rsa-sha256; cv=none; b=AnWC3iTRH2uevt3ei1WUVh/AmYHJru944FMekLJJzGPq/LNNeO0Uu0ct86kV5Udsj3d20D eWJrmjfY9iFSrAC7dbhORfsxC+MT1K+GFXHmj0cJnpPg/9zpyiRcrp3BJycaHXVK7e5Ap5 qkqpKSKu5KIOROoFtDg+CCfhCRSY9z1VbUkw7sQJow/mYUs38pYpSShath9ObprWCWm5Cf PdL/IRoX7pn6jxP4vnsU65L0Y8XArfOkp+LUj5OPrB+ktqkjpPHNN9QWOwlMskaKyTMsT5 T3CPkWzCmgLnupfa8la7AGDuVhTb0yg6tv7VE/UXyRr0clnmNbuC4L541giUAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O6y/xUTw0zhd0q4+a/N+bEGA6LRUxqWyRT+m5HW/r+c=; b=sMCayHNHgOiyQd06zmxCqe81JxKyDXP3Ef/VfU2jDnRoYiawwpDZsQeoz5hDSGWAeybLmu rCWsAUeQlcpfGrXGlavtub3NDJOTF+A7qj3zfoU2GRuskvBTzBH5S0S8lXvukCfWZj/t78 ff134fZAE4r+CUBlWJKdw8LvMMZhMgpn5Ael7b9wSDNO3T2Y93F9YESBc10iCIluki5tPs 9Jg96kjbqWb+DEe8rao1bqzjgavzzAFkEZ6GWlHM2l8un6viaeZSmyFZbJZTTMvRvpBg/G LJqCJL/Rm9ObjDCBtkIBQ5vTJrNoNDKkid4uAZH952I0aCLp1ziFHP1Dwf03zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6dQX3pGkznF7; Mon, 16 Sep 2024 08:30: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 48G8USYN053716; Mon, 16 Sep 2024 08:30:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8USeh053713; Mon, 16 Sep 2024 08:30:28 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:30:28 GMT Message-Id: <202409160830.48G8USeh053713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 9ff3c094fde3 - stable/14 - stale symlinks: configurable obj dir prefix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9ff3c094fde3b51b031d19a4f847122fdbb459ac Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=9ff3c094fde3b51b031d19a4f847122fdbb459ac commit 9ff3c094fde3b51b031d19a4f847122fdbb459ac Author: Wolfram Schneider AuthorDate: 2024-08-12 19:34:43 +0000 Commit: Wolfram Schneider CommitDate: 2024-09-16 08:30:06 +0000 stale symlinks: configurable obj dir prefix Use $MAKEOBJDIRPREFIX if set, otherwise /usr/obj (cherry picked from commit ccb0365643dc5e8d37ada3789bbe370b81ba5b3c) --- tools/build/stale-symlink-buildworld.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh index ee918d1c9cd9..acc3fb0baaf2 100755 --- a/tools/build/stale-symlink-buildworld.sh +++ b/tools/build/stale-symlink-buildworld.sh @@ -20,8 +20,10 @@ PATH="/bin:/usr/bin"; export PATH : ${ncpu=$(nproc)} +obj_dir_prefix=${MAKEOBJDIRPREFIX:="/usr/obj"} + # check other directories as well -: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} +: ${STALE_SYMLINK_BUILDWORLD_DIRS=$obj_dir_prefix} trap 'rm -f $script' 0 script=$(mktemp -t stale-symlink) From nobody Mon Sep 16 08:35:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6dX60jgpz5Wn0l; Mon, 16 Sep 2024 08:35: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 4X6dX56KYTz4YJM; Mon, 16 Sep 2024 08:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJDS0ok23LfNFPT906/rHpLujnhhMDL4pCBRzLYwUP4=; b=TSz1k8kFsrO4UrH9aVlfVx8Qj+0zScQyej3MSGLPz80tD5WqikbQgvjvNnLiueietu4EGj QGeqM8ettHKeewyszk7MPnX6upSTVaKXFNKihDJaXHoWuRMf9PwTWIW3VvOzPZIhaW/Ck1 /lucyelo8cM4H6TRMQiVSsliZruoP+1B3f4j8+Sj+RClPMQ0S4nN0apkg4vB70OAq2HDNi Px4fHDR033UnCMVd5L9DRGy6A3wnyDq/PIcBRbqORwsBmCMcKJ7nK+/2K5KfRSY+m1DNQE g7etxEIy0esnP+q+a+iP2F4cnrbJxhKItz2L46qRvk4tF34n+h9GwXLDpo+YYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726475717; a=rsa-sha256; cv=none; b=UrQdFspy4aepy0TpfQf+9frNX2/ZEWzIBWchMoM2Q8kvs9LN70NScMQjDC5JbNEaMrWPJ2 NZqidrJ9iKtqhD5S0BgdqPfrl7pzWig9yBFB+KrLd3BFpTT5+ClUsFRzs2+vcEXiRf6Stb 1X6h6LeuCoVlRwGu2clNdlR1LLyDrIzUaNwEMFx40gxz8gneE+C5FFCuf9g9I9exlWBI25 txlfbCt8ZyJ+BO9BHzWgXWWHu/2DzJAi5Ah0Y7BazJ+BipOKZvgCxkzPmIkpVQTJfPQnmo VZ2WIaZwAsUKVTgwAUka6wOg8f2WDkBDfeF3apT2y7mYsoRSkzXoBMAUvMiAiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJDS0ok23LfNFPT906/rHpLujnhhMDL4pCBRzLYwUP4=; b=P98uA9bX2c7SPVoroxCfkvrf7ppPtZcNSiLxhp2uHEuNESGyzCDwE4N7LADph3VpGO8L0f wOpFsQA405gQB/LDuSla+Vbv1dVJhbH+p/BKmHLs52J7aXDdEqLkT6nZhk4QyOVyphD40A FUgvt0qkl94QQSYyh4uQkPBfR2TU7TdQfw15QQJCABoGvQ4/4Y0UCTEZS2uZOE0cxccC+i 4bgWudQ1g15F4K/N2cmamQMWaGbrpJXLptLLJznrsUlSs5//aNm0gAmL3+Ry2aqNGYNxl3 qa4pf6gAXKwmGnQzXKHOTo8KeP/jb17K9GmYyxnEG9BtLxqdAbmGqKLbNzhRJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6dX55fSZzn8N; Mon, 16 Sep 2024 08:35: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 48G8ZHTR062558; Mon, 16 Sep 2024 08:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8ZHKb062555; Mon, 16 Sep 2024 08:35:17 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:35:17 GMT Message-Id: <202409160835.48G8ZHKb062555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 009c3c55b31c - stable/13 - stale symlinks: configurable obj dir prefix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 009c3c55b31cb70a16744b7f179913da1be24c7f Auto-Submitted: auto-generated The branch stable/13 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=009c3c55b31cb70a16744b7f179913da1be24c7f commit 009c3c55b31cb70a16744b7f179913da1be24c7f Author: Wolfram Schneider AuthorDate: 2024-08-12 19:34:43 +0000 Commit: Wolfram Schneider CommitDate: 2024-09-16 08:32:37 +0000 stale symlinks: configurable obj dir prefix Use $MAKEOBJDIRPREFIX if set, otherwise /usr/obj (cherry picked from commit ccb0365643dc5e8d37ada3789bbe370b81ba5b3c) --- tools/build/stale-symlink-buildworld.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh index a4515db3fccb..32ebc1f9d66d 100755 --- a/tools/build/stale-symlink-buildworld.sh +++ b/tools/build/stale-symlink-buildworld.sh @@ -11,8 +11,10 @@ PATH="/bin:/usr/bin"; export PATH : ${ncpu=$(nproc)} +obj_dir_prefix=${MAKEOBJDIRPREFIX:="/usr/obj"} + # check other directories as well -: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} +: ${STALE_SYMLINK_BUILDWORLD_DIRS=$obj_dir_prefix} trap 'rm -f $script' 0 script=$(mktemp -t stale-symlink) From nobody Mon Sep 16 08:35:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6dX73mgYz5WmmZ; Mon, 16 Sep 2024 08:35: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 4X6dX70qNbz4Y6w; Mon, 16 Sep 2024 08:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0nO98ytmyA/NRtYBD10CJDksSqBxFO+oRNvlPBjJeKk=; b=YD71kK5QMgDbMCAEtNnhspu6DUbTH0aUA5YMtpFbL+SrLb9nA7YtMNzLOT8YfRAVQQjQSR 3MCA9N4XL/AQ0f80KOfT3VIP65VXCSjn+Qn2xe+/+5GCEwRZlIjuKPOip3LLeBV3uioyFy r1XSoZJI6eYvIglkRYTzPOgPG4dNSJd2NR7+BnQKF5Z2CG3zX8BA0+6Pa17rW/c+Cr8mj+ KwTHcNCKOUEywnLePe6Ojl7zI8tkqt8gTA+uLVloygZY3PUQYQaTnYd/3VxRgb94+m2Gs4 DCRQq9NEWtmyYg00OmmUwBF8K5sq92e7tu24HRq2btAARRnaZQ29LswhXHMSjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726475719; a=rsa-sha256; cv=none; b=h2cSGI9lTSVqIM9aFFVOpy7xKOP+AQ5V0A38CQKsk5lB8cgAEdIfBC3cgsel/QbHOKropW 6YfwhoTaEHeej45e3ykkAvjKFc25RulOaAq9xxrokYLcpTjyVR9280g80iKoHQlrVnEJYt ykIuK4JbxSWLlQBmsM8xi2EcQqeIxguMOWkejSCbePO7v/r6q7Wx4BRd6NJgbr/wBFT+9e Ec3JNfZm1UpTtI7TxE0FrJCWLoEfoY9q4tG2S3p9Dkm2LP9ik85KlhoFH9R39h7Q/vtRFA qvDrM7Qxfs7mr4WOVso7X1Ih0pmaskiunavApnaTGvgcwtXXzoPeYsyxtwPFRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726475719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0nO98ytmyA/NRtYBD10CJDksSqBxFO+oRNvlPBjJeKk=; b=Zy7mI9fEzLhGUx8KLHEWl+K++M0OFsnCoEWuemd4EibbbhAgEExUPrSFwvTXVf0Dd4hbsl FO02Wz1sjakY+CkFDwkJeOJaBUj2c9ScGQOtPyR6z5zG2qMHkmyUkwUjfKrUOice/Ltwnz xMSlQhkcx+cOpqIKfeEjLN/kIiooGWxvGaWp/Fv4w/SePI2R2lBlMciJzvKI3jlTp4ZmQM Zr2Ehcx16RhLj6jTnPyuT1INxpVPc4+MN87t9h4m6pWMUhOD9unKRgdkdxujk7a1Fr4F5J avUq1LaTOxfuKd5t5kRFtTQdp3XssvM1fgd8dw7uARK1T31mkVZOXhRocnL2jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6dX66JhvznSM; Mon, 16 Sep 2024 08:35: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 48G8ZInR062598; Mon, 16 Sep 2024 08:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48G8ZIti062595; Mon, 16 Sep 2024 08:35:18 GMT (envelope-from git) Date: Mon, 16 Sep 2024 08:35:18 GMT Message-Id: <202409160835.48G8ZIti062595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 28d35ab6fabd - stable/13 - stale-symlink-buildworld.sh: improve documentation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 28d35ab6fabde24a88bd533965b2793732a0ee9e Auto-Submitted: auto-generated The branch stable/13 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=28d35ab6fabde24a88bd533965b2793732a0ee9e commit 28d35ab6fabde24a88bd533965b2793732a0ee9e Author: Wolfram Schneider AuthorDate: 2024-09-09 14:55:29 +0000 Commit: Wolfram Schneider CommitDate: 2024-09-16 08:32:45 +0000 stale-symlink-buildworld.sh: improve documentation (cherry picked from commit c77ca9a72c9934c407852f00d88cba09f5c9e31f) --- tools/build/stale-symlink-buildworld.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh index 32ebc1f9d66d..acc3fb0baaf2 100755 --- a/tools/build/stale-symlink-buildworld.sh +++ b/tools/build/stale-symlink-buildworld.sh @@ -4,8 +4,17 @@ # # stale-symlink-buildworld.sh - check for stale symlinks on a FreeBSD system # -# You can run the script before or after `make installworld' +# The purpose of this script is to detect stale symlinks, report them to +# stderr and exit with a non-zero status. All other cases are ignored, +# such as no symlinks, missing directories, permission problems, etc. # +# You can run the script before or after `make installworld', or any other +# make targets thats installs files. +# +# You can also check your local ports with: +# +# env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh + PATH="/bin:/usr/bin"; export PATH From nobody Mon Sep 16 10:56:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6hgQ3mnVz5X8fG; Mon, 16 Sep 2024 10:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X6hgQ30c5z4psQ; Mon, 16 Sep 2024 10:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726484210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fma71yPJi5DriRDQqkrnCVOOdWRuXNhRnCoGoKgpuHk=; b=ysS3sBn8WUDsQf9u9fNQqr3uh27NwTgTvX0BXhODMxoCoqkLu8UqK0bdKuu+zN6VxO8Pem modoQgB175hKqC3WA76tYW9vUNq+2kgKXAe1l7BaAqKW7hQ6vqVeflr/oT02KUwLuBq1M7 QloR57xRAcSIr2qiGPh1vGRZEwjaXLxu+2hb3rfv9EY3RNoF3lEVjPnevL2q0OsaQDkDDw eqeexNNApsNB2VX3S1Lo/KAex/P2f4wKMUp/gNsuexRqBReozeQeHGZATBhP2BA31cSsiZ wmsM5lhEXNtYK7C6cvnBqwcSe3Z7CAGycFIDaCCFmnpnTKBr5A9COwMFYXXMzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726484210; a=rsa-sha256; cv=none; b=Br548syjnUwkHXR/oDofdMOqM4m/RLLyKkMu8XrBiQQjIlCudM6WOenuasSdh1U4yBcvei mJkCLNRn820i+wGEQlbSj5w2ilRkRMut0Uy9XvTiLnGLkxoSm1rAUsVI53/+ABrLJBTqef fCvMP6Sk0KMSasxXFLDuvF6lky8McctALByeeDKv7sO8mm/GUmuhg84L/L8MlCL2jIMqUM IABW5Bkym/Ld8v7xdH9O5AcmsunAVCoXrY02y0jNdbuFoQb9OEmKSowQhKkyBpuAmKKypW 2SQmUxhgYdN2R74/rbzXzgoHIWaGGeH/U7ioEXpo6skFIH3Zv6qGPP5mchnm4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726484210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fma71yPJi5DriRDQqkrnCVOOdWRuXNhRnCoGoKgpuHk=; b=oqg2zpS2mE12fggSZ5VW1vcL1DSCHxvlWn0jQ77VRoH8uNDzle2IEX2GY4gLtrjxpVXs4b WKIOnorIMoZNqvPx/HJYealgXFREr+APAGuYzRZZAMd5QxjBg8z4qYg5asmVlzvq9mslgB uLfOZXW0r0FBq2+CnjdGOcZ286u0M1Zp0Oaoa5jLukGOFB1WUVpMEF0ERJxO4CevC1Ur+3 xwJxws9cytersNNZGPBL0+7QRXvNHncKdVbrTh8/36i9o8TTqBKlOyj1dC6DNz9hNeHHc2 T1uHhTURscHpLUOmtATogWSXSqj8WF2zt14cFA9VPYF8ooB0c3Gyy5wbqVGpQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6hgQ1HJnzrsq; Mon, 16 Sep 2024 10:56: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 48GAuoP7099066; Mon, 16 Sep 2024 10:56:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GAuolv099063; Mon, 16 Sep 2024 10:56:50 GMT (envelope-from git) Date: Mon, 16 Sep 2024 10:56:50 GMT Message-Id: <202409161056.48GAuolv099063@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: 1c6bb4c5789c - main - tcp: remove TCP_OFFLOAD_DISABLE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 1c6bb4c5789c180d09653c04c6267cee5844b287 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1c6bb4c5789c180d09653c04c6267cee5844b287 commit 1c6bb4c5789c180d09653c04c6267cee5844b287 Author: Michael Tuexen AuthorDate: 2024-09-15 09:44:49 +0000 Commit: Michael Tuexen CommitDate: 2024-09-15 09:44:49 +0000 tcp: remove TCP_OFFLOAD_DISABLE TCP_OFFLOAD_DISABLE is nowhere else used or defined. So remove it. No functional change intended. Reviewed by: np MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46669 --- sys/netinet/tcp_syncache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.h b/sys/netinet/tcp_syncache.h index e6485f42c0e4..55e062e35a54 100644 --- a/sys/netinet/tcp_syncache.h +++ b/sys/netinet/tcp_syncache.h @@ -67,7 +67,7 @@ struct syncache { u_int8_t sc_requested_s_scale:4, sc_requested_r_scale:4; u_int16_t sc_flags; -#if defined(TCP_OFFLOAD) || !defined(TCP_OFFLOAD_DISABLE) +#if defined(TCP_OFFLOAD) struct toedev *sc_tod; /* entry added by this TOE */ void *sc_todctx; /* TOE driver context */ #endif From nobody Mon Sep 16 11:51:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6jtX5dzPz5XGg0; Mon, 16 Sep 2024 11:51:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X6jtW6mH2z4vvb; Mon, 16 Sep 2024 11:51:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 48GBpOt5055696; Mon, 16 Sep 2024 14:51:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 48GBpOt5055696 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 48GBpOJo055695; Mon, 16 Sep 2024 14:51:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Sep 2024 14:51:24 +0300 From: Konstantin Belousov To: Kyle Evans Cc: Robert Clausecker , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 76c2b331bcd9 - main - lib/libc/amd64/string: add timingsafe_bcmp(3) scalar, baseline implementations Message-ID: References: <202310151931.39FJVIpF088761@gitrepo.freebsd.org> <46ddb4e7-2dfe-4f00-9210-1d482e03ef27@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46ddb4e7-2dfe-4f00-9210-1d482e03ef27@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: - X-Spamd-Result: default: False [-1.38 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.62)[0.623]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; ARC_NA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; HAS_XAW(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4X6jtW6mH2z4vvb On Thu, Sep 12, 2024 at 10:14:36AM -0500, Kyle Evans wrote: > On 10/15/23 14:31, Robert Clausecker wrote: > > The branch main has been updated by fuz: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=76c2b331bcd9f73c5c8c43a06e328fa0c7b8c39a > > > > commit 76c2b331bcd9f73c5c8c43a06e328fa0c7b8c39a > > Author: Robert Clausecker > > AuthorDate: 2023-08-30 15:37:26 +0000 > > Commit: Robert Clausecker > > CommitDate: 2023-10-15 19:19:04 +0000 > > > > lib/libc/amd64/string: add timingsafe_bcmp(3) scalar, baseline implementations > > Very straightforward and similar to memcmp(3). The code has > > been written to use only instructions specified as having > > data operand independent timing by Intel. > > Sponsored by: The FreeBSD Foundation > > Approved by: security (cperciva) > > Differential Revision: https://reviews.freebsd.org/D41673 > > Hi Robert, > > I only just noticed this, but I have to admit that I'm pretty uncomfortable > with the idea of rolling our own timingsafe assembly implementations in > general. > > My main concern is that, e.g., auditing timingsafe_bcmp.S will clearly take > a lot longer than auditing the C counterpart, but also the audit > requirements have gone up for every architecture you want to support that > might be using this from a single simple C implementation to C + however > many architectures end up rolling their own implementation in assembly after > this. > > Are these really used in enough perf-critical context to justify the > additional complexity? Did anyone *actually* verify the constant-time > properties of these implementations? I didn't really find any written > confirmation of that, which I was really hoping for- we should have a much > higher bar for changes like this. Is such audit/ensurance is even possible at all for C implementation? It can be only done against specific version of C compiler, and cannot be extended to other compilers, at least with the current state of C definition. While CPU vendors do provide time-invariant guarantees for ISA. For instance, Intel published a guidance https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/data-operand-independent-timing-isa-guidance.html that makes the property part of ISA. I.e. for me it seems that only an assembler version can be timingsafe ATM. From nobody Mon Sep 16 13:05:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWh1zpZz5Vxv6; Mon, 16 Sep 2024 13:05: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 4X6lWh1TGSz549C; Mon, 16 Sep 2024 13:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EJoYKReHN65PAIJzfGw25WVC4PUzt0LZDLA2JSVyboo=; b=CQSC+zr6ohVdV8e/EJrOZZmWuy7aUAb5rnoqjEdIROOtb1wunQY0G3SWfGa8SGhDNvVe7D m6zvR06n98m2KqCHG62CTFF6lzJKcI9qN8FUgPMcccYMV/g0S1WTO3Xr1adw30cB4uHktc cVcvCkbwimSbZ87pZIzyUvAZ6e9TDPx7rzzL3Rrezntnm45d2AHeVCIVVWZVH/tvNchC2G W91NEwIR0Z05ox4fZN6lh917xWfBahF1EVCkgKQ2PfrJPhWC2LFtzkhyw6KTG3OCTu548q nUSWyqNZJMTTxi+DQC6iBSeZeeZeV6azh8eP9GRCdueMQxLDp0ZT1/K3RalaNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491920; a=rsa-sha256; cv=none; b=oKLwk8plGdKJ5dko1dQ+PvPSqHAclvSpNzwYci68t1AH7WsSfm+Bkzz1WJGmu6YKSJMLJW UYYfOgF3kWWftt1P7UGvgSWqXPh06l7LPzQ6MB/NjbjH0nvqqzDNAnJ9hayhrV5OvkmxW4 ewF92ELkCU2ZzQ1zo3rNoOG07xU+74K8BP4RBxXB5JqbKGAXLXT7DEoSdFGovpulWDZJuX fiwRNZ3JlPqCm5sI/OkbAijqc37P6qg3Y9in/okybuaJo0kOiJ+iK8oYxeDtm30d4CRYih gGUSrMr6acdPmdu4BFmuRUAtgmbR55oF4sal1SI8ES61R03Xvu2UKJyWK0cRjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EJoYKReHN65PAIJzfGw25WVC4PUzt0LZDLA2JSVyboo=; b=uKchX0GHljemtV7/gLrepLgF5PyuuqEj/JQhSNgMAzxtXgGGL415f/rnpEUZhpZ9bYfUtC U+cDk07nWyCZ7uw75e5auDeGQPSkgl+BMBEwX10ZUuQ25xA4aywk1729Lzk3gjxYYtOXt/ BwkFW7+b6dOe8Io9E0Boy4texm3X5r7rE6OweM4DU/9p44KP4DuXjFwTqZtBVUrHKhmvIT lBKC32JRhf4D6coIhh4A6VzTB+m333lLtNB6k3yTKuYpxmFmD7sGq1c7uR5Q/AZH1Ew9wj IsMH7o+SJpUB+63KZto2565yPLJuPy4Dg4H75IiBWDDQrqImhKmq2MEBKweCag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWh14ZKzwVj; Mon, 16 Sep 2024 13:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48GD5KgH020597; Mon, 16 Sep 2024 13:05:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5KIe020594; Mon, 16 Sep 2024 13:05:20 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:20 GMT Message-Id: <202409161305.48GD5KIe020594@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: 2ca286d0d260 - main - pf: always drop ICMPv6 in IPv4 datagrams List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ca286d0d2609bbb021f6eaecc6a6b864705719e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ca286d0d2609bbb021f6eaecc6a6b864705719e commit 2ca286d0d2609bbb021f6eaecc6a6b864705719e Author: Kristof Provost AuthorDate: 2024-08-28 13:17:57 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:46:09 +0000 pf: always drop ICMPv6 in IPv4 datagrams Not only when compiled with INET6. Suggested by Max Laier. ok henning@ Reviewed by: zlei Obtained from: OpenBSD, jsing , 0ba1e6e32b9 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46575 --- sys/netpfil/pf/pf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2066cfbeccff..cb404b93946e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8828,14 +8828,12 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, break; } -#ifdef INET6 case IPPROTO_ICMPV6: { action = PF_DROP; DPFPRINTF(PF_DEBUG_MISC, ("pf: dropping IPv4 packet with ICMPv6 payload\n")); goto done; } -#endif default: action = pf_test_state_other(&s, kif, m, &pd); From nobody Mon Sep 16 13:05:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWj37j6z5VxPh; Mon, 16 Sep 2024 13:05: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 4X6lWj2XkRz54Qy; Mon, 16 Sep 2024 13:05:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EJRhGTSI+KKMC6mMjEKidCzXNTQGI96nnqqxKEDJw0U=; b=M/yQiv7kcR7Zp03UWSS83QpWzX0ZqAwVHnxcyXdH94djeI6Gc3lOrPojNkJM8oInxtXSMn VtuFOfyLn+oycQPeE5M6LYP7mW6/LG7msTR8nRC5aGLgTHOr5DUBg6hywCcWkspINyOj5X UHNzC3odlbjlAKfuXLqJ1AG/NY3N1toUXXT2xtOfWS1E/zfK+byrlBlR+jzY9FgNe9VpFz xVo+B5gUsyPo8Q4a3NIpYT39VBaU5YTsWo68S7hDSWCSdhZ4hLUXsGwTLOK/H5mS7HVqjJ xU1/slz4E0khry0+PJv5QZv+Esls3b0qg/HJM0aBmQZBVSTtqkATuzA4lpuwHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491921; a=rsa-sha256; cv=none; b=Q7M5mMz+07+XRaWFZ0jXo/I3mRGBNYf6ZDty17lAcRQo+h4nW0GIj6WEaN6bQZykKM9Zzh iR5CwOIdGvSdM4kl5CQFg0j4LXFE316e6EqYkFE9Q6QUGd4hqaK/E2/8VNmisqHYB5262v Q8wVyuICZiGVR9phw2wtWgDvwrB0HehWSNmDeY+ww7tS2NeHSiOB5eTesBwDHAd442EnTI WWhQl5ame9Ow/ju/y8H76+DVksMvrhYGs5NLYiDo4Jr4d1wZ9MieTyZLmdNDY8Fiu6t2Q9 QCG9eZnBjU8b64Hf0Bl14IEpuujePfbFWu1IWM7A5E/gcGh19gV042JcIQyDiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EJRhGTSI+KKMC6mMjEKidCzXNTQGI96nnqqxKEDJw0U=; b=XcsscOO/J+Lyb89zJUKEc/5Y4kjDzXvVrs2CtviHUDfX24cxFbKViKXTuNr2+uHFr6RTYR f+Lr+JNLELcxT0oeVFOa9YLdyrtiSJCPbGTmMLSR6T08+JRTeO++99x35RLQj/4mx0mNSv k9rVbmnxC/mCjQ5aUzcEzCV2yLb5KgGCAbB7x5GUAkGoLyi/8eOeuY9hixASpLTxlbFbRz BIRIHGq352vHYxN+zGERltpWoMN3Kz98kTa+qzP73JltvHrZ2beEXYLDeeXTShLn8wspUL ctfBfwe63cCXA818TijryxCLGyO1wzQwo+pVaSof/2AFz4rCan7je2mlqcAiBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWj257Czw5v; Mon, 16 Sep 2024 13:05: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 48GD5Lqt020645; Mon, 16 Sep 2024 13:05:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5LJg020642; Mon, 16 Sep 2024 13:05:21 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:21 GMT Message-Id: <202409161305.48GD5LJg020642@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: 50ecaf1bd46a - main - pf: use AF_INET6 when comparing IPv6 addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50ecaf1bd46a834c4fdaf483eb39df7bb62501e3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=50ecaf1bd46a834c4fdaf483eb39df7bb62501e3 commit 50ecaf1bd46a834c4fdaf483eb39df7bb62501e3 Author: Kristof Provost AuthorDate: 2024-08-28 13:40:42 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:46:14 +0000 pf: use AF_INET6 when comparing IPv6 addresses Reviewed by: zlei MFC after: 1 week Obtained from: OpenBSD, henning , cf7c0bf78a Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46576 --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cb404b93946e..d675c5381e8a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7648,10 +7648,10 @@ pf_test_state_other(struct pf_kstate **state, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case AF_INET6: - if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], AF_INET)) + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], AF_INET6)) PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af); - if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], AF_INET)) + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], AF_INET6)) PF_ACPY(pd->dst, &nk->addr[pd->didx], pd->af); #endif /* INET6 */ } From nobody Mon Sep 16 13:05:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWk6blzz5VxPm; Mon, 16 Sep 2024 13:05: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 4X6lWk3hYXz549Q; Mon, 16 Sep 2024 13:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mYzJUowmIFi7mqcOahXx/EANPgXDydf7kvbH5J/KUTU=; b=xxFd1u8eW2THLnRCoapPbeRR4NAolY2s2uXyxvgiTHNM9T64hDKMRhedtt7KRc26Xq0wnB fNG05X1xtk8N7+7Jz00+ixKxUWEhAul8xCT1Fevu++3rURBlqcICoAogVAHdD4P4rkyVau 9Hy1xCvhBtYuqi13ioLXeG4CUqYWlcpBTR60bjWtesZ6cBhApgi+nLC7Wt54x8T5OHUG7V gdx/yQPGZJZg8Cl4AaX3z+yhLqKsV4mI80MCKylsW/YjVNfDfOjd8JFlHzf67009fIJaUC 6Lp1MjNqEUDxBQOwQC1dJm3NQ2zqH4hEbmmCQnXsktG7o5xElU+5YPRCBWP2Og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491922; a=rsa-sha256; cv=none; b=Gba+mn9JK8ZZZMuphdz1BE6eAF7VRqhDE35lvX7YbSdRciShYAyN4kHZI7B3UQhbH3jBF+ HeS2lSuqfKgCS9xRkzs292zuBq9WAtARR7lUxPGQj55XSXd15dZEs6ckoKBGLIMlFeLSEw 4Oht6zVXoeXrQ1vAiekEGsCMxH2a5nW/AekB898hqqjC6oVlMErCWverjQcwCnHwBNC4jF Fz0reScYroRGmOzodFR7ejgpnzGzCKlCswGn7BwQpdPK/FH6jA2FLyd1QbZ0VwgH5Ftl6d G5rc/BuFDedPqeDnykTQvugPErCcRQUnD5eOSsTMfXLf8CcJ+sdhxxYOmhqVBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mYzJUowmIFi7mqcOahXx/EANPgXDydf7kvbH5J/KUTU=; b=KOLV6kOgt2GZDE7d0AIixJvYlh/HRYGy/WZwQAsziMkd1jLPf2DFj66AsaeFeUXz3Ggxd0 cv0OUj5zL6pLVQZXCGCjPXQWqRRy/leGv//IX4XQnCz/zYgFMRVviEDCvEdxp0Fp6Q9Tnx B2bdKZBNaVPLCOKMV1f+OkCH00HacH7yDr6DmhlzVEf9jqfpwz1Q6FoVdtcZNd/Pm591NT MIL2h7xtqicG2PVMj0hz+pRTyLVOpBOtv2hS26Gt1OQ/6E3VgLSk7mJ90FrIeJ5ProbyPd VO/Qi+KkqcoxWhfcAm3+Bu9X+1xZbvAHiKpn9LEnWOUYoIxRARQLr58M1/ZhDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWk3GmWzw3D; Mon, 16 Sep 2024 13:05: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 48GD5Mew020693; Mon, 16 Sep 2024 13:05:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5MPC020690; Mon, 16 Sep 2024 13:05:22 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:22 GMT Message-Id: <202409161305.48GD5MPC020690@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: 2339ead6384e - main - pf: allow filtering on the receive interface List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2339ead6384e95af83b9aa482a61f645b5931b2e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2339ead6384e95af83b9aa482a61f645b5931b2e commit 2339ead6384e95af83b9aa482a61f645b5931b2e Author: Kristof Provost AuthorDate: 2024-08-29 07:41:42 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:47:07 +0000 pf: allow filtering on the receive interface add support to pf for filtering a packet by the interface it was received on. use the received-on IFNAME filter option on a pf.conf rule to restrict which packet the interface had to be received on. eg: pass out on em0 from $foo to $bar received-on fxp0 ive been running this in production for a week now. i find it particularly usefull with interface groups. no objections, and a few "i like"s from henning, claudio, deraadt, mpf Obtained from: OpenBSD, dlg , 95b4320893 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46577 --- lib/libpfctl/libpfctl.c | 2 ++ lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/parse.y | 37 +++++++++++++++++++++++++------------ sbin/pfctl/pfctl_parser.c | 2 ++ sys/net/pfvar.h | 2 ++ sys/netpfil/pf/pf.c | 24 ++++++++++++++++++++++++ sys/netpfil/pf/pf_ioctl.c | 15 ++++++++++++++- sys/netpfil/pf/pf_nl.c | 3 +++ sys/netpfil/pf/pf_nl.h | 1 + 9 files changed, 74 insertions(+), 13 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index c7b2cd17bc29..11984a301336 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1252,6 +1252,7 @@ snl_add_msg_attr_pf_rule(struct snl_writer *nw, uint32_t type, const struct pfct snl_add_msg_attr_uid(nw, PF_RT_UID, &r->uid); snl_add_msg_attr_uid(nw, PF_RT_GID, (const struct pf_rule_uid *)&r->gid); + snl_add_msg_attr_string(nw, PF_RT_RCV_IFNAME, r->rcv_ifname); snl_add_msg_attr_u32(nw, PF_RT_RULE_FLAG, r->rule_flag); snl_add_msg_attr_u8(nw, PF_RT_ACTION, r->action); @@ -1656,6 +1657,7 @@ static struct snl_attr_parser ap_getrule[] = { { .type = PF_RT_STATES_TOTAL, .off = _OUT(r.states_tot), .cb = snl_attr_get_uint64 }, { .type = PF_RT_SRC_NODES, .off = _OUT(r.src_nodes), .cb = snl_attr_get_uint64 }, { .type = PF_RT_ANCHOR_CALL, .off = _OUT(anchor_call), .arg = (void*)MAXPATHLEN, .cb = snl_attr_copy_string }, + { .type = PF_RT_RCV_IFNAME, .off = _OUT(r.rcv_ifname), .arg = (void*)IFNAMSIZ, .cb = snl_attr_copy_string }, }; static struct snl_field_parser fp_getrule[] = {}; #undef _OUT diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 33d7d0f113ac..6088e18554b3 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -220,6 +220,7 @@ struct pfctl_rule { struct pf_rule_uid uid; struct pf_rule_gid gid; + char rcv_ifname[IFNAMSIZ]; uint32_t rule_flag; uint8_t action; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index f54f24a14a7c..0c551d2ef49f 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -241,6 +241,7 @@ static struct filter_opts { #define FOM_FRAGCACHE 0x8000 /* does not exist in OpenBSD */ struct node_uid *uid; struct node_gid *gid; + struct node_if *rcv; struct { u_int8_t b1; u_int8_t b2; @@ -367,7 +368,7 @@ void expand_rule(struct pfctl_rule *, struct node_if *, struct node_host *, struct node_proto *, struct node_os *, struct node_host *, struct node_port *, struct node_host *, struct node_port *, struct node_uid *, struct node_gid *, - struct node_icmp *, const char *); + struct node_if *, struct node_icmp *, const char *); int expand_altq(struct pf_altq *, struct node_if *, struct node_queue *, struct node_queue_bw bwspec, struct node_queue_opt *); @@ -516,7 +517,7 @@ int parseport(char *, struct range *r, int); %token STICKYADDRESS ENDPI MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS -%token DIVERTTO DIVERTREPLY BRIDGE_TO +%token DIVERTTO DIVERTREPLY BRIDGE_TO RECEIVEDON %token STRING %token NUMBER %token PORTBINARY @@ -1073,7 +1074,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto expand_rule(&r, $5, NULL, $7, $8.src_os, $8.src.host, $8.src.port, $8.dst.host, $8.dst.port, - $9.uid, $9.gid, $9.icmpspec, + $9.uid, $9.gid, $9.rcv, $9.icmpspec, pf->astack[pf->asd + 1] ? pf->alast->name : $2); free($2); pf->astack[pf->asd + 1] = NULL; @@ -1096,7 +1097,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto expand_rule(&r, $3, NULL, $5, $6.src_os, $6.src.host, $6.src.port, $6.dst.host, $6.dst.port, - 0, 0, 0, $2); + 0, 0, 0, 0, $2); free($2); } | RDRANCHOR string interface af proto fromto rtable { @@ -1138,7 +1139,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto expand_rule(&r, $3, NULL, $5, $6.src_os, $6.src.host, $6.src.port, $6.dst.host, $6.dst.port, - 0, 0, 0, $2); + 0, 0, 0, 0, $2); free($2); } | BINATANCHOR string interface af proto fromto rtable { @@ -1461,7 +1462,7 @@ scrubrule : scrubaction dir logquick interface af proto fromto scrub_opts expand_rule(&r, $4, NULL, $6, $7.src_os, $7.src.host, $7.src.port, $7.dst.host, $7.dst.port, - NULL, NULL, NULL, ""); + NULL, NULL, NULL, NULL, ""); } ; @@ -1626,7 +1627,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { if (h != NULL) expand_rule(&r, j, NULL, NULL, NULL, h, NULL, NULL, NULL, NULL, NULL, - NULL, ""); + NULL, NULL, ""); if ((i->ifa_flags & IFF_LOOPBACK) == 0) { bzero(&r, sizeof(r)); @@ -1648,7 +1649,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { if (h != NULL) expand_rule(&r, NULL, NULL, NULL, NULL, h, NULL, NULL, - NULL, NULL, NULL, NULL, ""); + NULL, NULL, NULL, NULL, NULL, ""); } else free(hh); } @@ -2802,7 +2803,7 @@ pfrule : action dir logquick interface route af proto fromto expand_rule(&r, $4, $5.host, $7, $8.src_os, $8.src.host, $8.src.port, $8.dst.host, $8.dst.port, - $9.uid, $9.gid, $9.icmpspec, ""); + $9.uid, $9.gid, $9.rcv, $9.icmpspec, ""); } ; @@ -2937,6 +2938,13 @@ filter_opt : USER uids { filter_opts.match_tag = $3; filter_opts.match_tag_not = $1; } + | RECEIVEDON if_item { + if (filter_opts.rcv) { + yyerror("cannot respecify received-on"); + YYERROR; + } + filter_opts.rcv = $2; + } | PROBABILITY probability { double p; @@ -4882,7 +4890,7 @@ natrule : nataction interface af proto fromto tag tagged rtable expand_rule(&r, $2, $9 == NULL ? NULL : $9->host, $4, $5.src_os, $5.src.host, $5.src.port, $5.dst.host, - $5.dst.port, 0, 0, 0, ""); + $5.dst.port, 0, 0, 0, 0, ""); free($9); } ; @@ -6034,8 +6042,8 @@ expand_rule(struct pfctl_rule *r, struct node_proto *protos, struct node_os *src_oses, struct node_host *src_hosts, struct node_port *src_ports, struct node_host *dst_hosts, struct node_port *dst_ports, - struct node_uid *uids, struct node_gid *gids, struct node_icmp *icmp_types, - const char *anchor_call) + struct node_uid *uids, struct node_gid *gids, struct node_if *rcv, + struct node_icmp *icmp_types, const char *anchor_call) { sa_family_t af = r->af; int added = 0, error = 0; @@ -6138,6 +6146,10 @@ expand_rule(struct pfctl_rule *r, r->gid.op = gid->op; r->gid.gid[0] = gid->gid[0]; r->gid.gid[1] = gid->gid[1]; + if (rcv) { + strlcpy(r->rcv_ifname, rcv->ifname, + sizeof(r->rcv_ifname)); + } r->type = icmp_type->type; r->code = icmp_type->code; @@ -6381,6 +6393,7 @@ lookup(char *s) { "rdr-anchor", RDRANCHOR}, { "realtime", REALTIME}, { "reassemble", REASSEMBLE}, + { "received-on", RECEIVEDON}, { "reply-to", REPLYTO}, { "require-order", REQUIREORDER}, { "return", RETURN}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index a9416534626b..2e6a1d1cb1c5 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -960,6 +960,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer } print_fromto(&r->src, r->os_fingerprint, &r->dst, r->af, r->proto, verbose, numeric); + if (r->rcv_ifname[0]) + printf(" received-on %s", r->rcv_ifname); if (r->uid.op) print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user", UID_MAX); diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index c123da37d2cb..4bb09d637def 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -776,6 +776,7 @@ struct pf_krule { char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; uint32_t ridentifier; char ifname[IFNAMSIZ]; + char rcv_ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; char tagname[PF_TAG_NAME_SIZE]; @@ -792,6 +793,7 @@ struct pf_krule { time_t *timestamp; struct pfi_kkif *kif; + struct pfi_kkif *rcv_kif; struct pf_kanchor *anchor; struct pfr_ktable *overload_tbl; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index d675c5381e8a..1182c5dd0c30 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -375,6 +375,7 @@ static void pf_patch_8(struct mbuf *, u_int16_t *, u_int8_t *, u_int8_t, static struct pf_kstate *pf_find_state(struct pfi_kkif *, const struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_kstate **); +static int pf_match_rcvif(struct mbuf *, struct pf_krule *); static void pf_overload_task(void *v, int pending); static u_short pf_insert_src_node(struct pf_ksrc_node **, struct pf_krule *, struct pf_addr *, sa_family_t); @@ -3951,6 +3952,27 @@ pf_match_tag(struct mbuf *m, struct pf_krule *r, int *tag, int mtag) (r->match_tag_not && r->match_tag != *tag)); } +static int +pf_match_rcvif(struct mbuf *m, struct pf_krule *r) +{ + struct ifnet *ifp = m->m_pkthdr.rcvif; + struct pfi_kkif *kif; + + if (ifp == NULL) + return (0); + + kif = (struct pfi_kkif *)ifp->if_pf_kif; + + if (kif == NULL) { + DPFPRINTF(PF_DEBUG_URGENT, + ("pf_test_via: kif == NULL, @%d via %s\n", r->nr, + r->rcv_ifname)); + return (0); + } + + return (pfi_kkif_match(r->rcv_kif, kif)); +} + int pf_tag_packet(struct mbuf *m, struct pf_pdesc *pd, int tag) { @@ -5155,6 +5177,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag ? pd->pf_mtag->tag : 0)) r = TAILQ_NEXT(r, entries); + else if (r->rcv_kif && !pf_match_rcvif(m, r)) + r = TAILQ_NEXT(r, entries); else if (r->os_fingerprint != PF_OSFP_ANY && (pd->proto != IPPROTO_TCP || !pf_osfp_match( pf_osfp_fingerprint(pd, m, off, th), diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 8d18da6cf0db..e205c5ca0c38 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -603,6 +603,8 @@ pf_free_rule(struct pf_krule *rule) pfr_detach_table(rule->overload_tbl); if (rule->kif) pfi_kkif_unref(rule->kif); + if (rule->rcv_kif) + pfi_kkif_unref(rule->rcv_kif); pf_kanchor_remove(rule); pf_empty_kpool(&rule->rpool.list); @@ -1306,6 +1308,7 @@ pf_hash_rule_rolling(MD5_CTX *ctx, struct pf_krule *rule) for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) PF_MD5_UPD_STR(rule, label[i]); PF_MD5_UPD_STR(rule, ifname); + PF_MD5_UPD_STR(rule, rcv_ifname); PF_MD5_UPD_STR(rule, match_tagname); PF_MD5_UPD_HTONS(rule, match_tag, x); /* dup? */ PF_MD5_UPD_HTONL(rule, os_fingerprint, y); @@ -2068,7 +2071,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, struct pf_kruleset *ruleset; struct pf_krule *tail; struct pf_kpooladdr *pa; - struct pfi_kkif *kif = NULL; + struct pfi_kkif *kif = NULL, *rcv_kif = NULL; int rs_num; int error = 0; @@ -2081,6 +2084,8 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); + if (rule->rcv_ifname[0]) + rcv_kif = pf_kkif_create(M_WAITOK); pf_counter_u64_init(&rule->evaluations, M_WAITOK); for (int i = 0; i < 2; i++) { pf_counter_u64_init(&rule->packets[i], M_WAITOK); @@ -2143,6 +2148,13 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, } else rule->kif = NULL; + if (rule->rcv_ifname[0]) { + rule->rcv_kif = pfi_kkif_attach(rcv_kif, rule->rcv_ifname); + rcv_kif = NULL; + pfi_kkif_ref(rule->rcv_kif); + } else + rule->rcv_kif = NULL; + if (rule->rtableid > 0 && rule->rtableid >= rt_numfibs) error = EBUSY; @@ -2242,6 +2254,7 @@ errout: PF_RULES_WUNLOCK(); PF_CONFIG_UNLOCK(); errout_unlocked: + pf_kkif_free(rcv_kif); pf_kkif_free(kif); pf_krule_free(rule); return (error); diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 6e752159b4bd..510aac2af48a 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -730,6 +730,7 @@ static const struct nlattr_parser nla_p_rule[] = { { .type = PF_RT_SET_PRIO_REPLY, .off = _OUT(set_prio[1]), .cb = nlattr_get_uint8 }, { .type = PF_RT_DIVERT_ADDRESS, .off = _OUT(divert.addr), .cb = nlattr_get_in6_addr }, { .type = PF_RT_DIVERT_PORT, .off = _OUT(divert.port), .cb = nlattr_get_uint16 }, + { .type = PF_RT_RCV_IFNAME, .off = _OUT(rcv_ifname), .arg = (void *)IFNAMSIZ, .cb = nlattr_get_chara }, }; NL_DECLARE_ATTR_PARSER(rule_parser, nla_p_rule); #undef _OUT @@ -941,6 +942,8 @@ pf_handle_getrule(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_rule_uid(nw, PF_RT_UID, &rule->uid); nlattr_add_rule_uid(nw, PF_RT_GID, (const struct pf_rule_uid *)&rule->gid); + nlattr_add_string(nw, PF_RT_RCV_IFNAME, rule->rcv_ifname); + nlattr_add_u32(nw, PF_RT_RULE_FLAG, rule->rule_flag); nlattr_add_u8(nw, PF_RT_ACTION, rule->action); nlattr_add_u8(nw, PF_RT_DIRECTION, rule->direction); diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index cfe81cf142ab..bd173c0137ce 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -257,6 +257,7 @@ enum pf_rule_type_t { PF_RT_STATES_TOTAL = 70, /* u64 */ PF_RT_SRC_NODES = 71, /* u64 */ PF_RT_ANCHOR_CALL = 72, /* string */ + PF_RT_RCV_IFNAME = 73, /* string */ }; enum pf_addrule_type_t { From nobody Mon Sep 16 13:05:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWm0dYsz5Vxv9; Mon, 16 Sep 2024 13:05: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 4X6lWl5C2Lz54RJ; Mon, 16 Sep 2024 13:05:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7LEpULdVULkmllDQBzUrRhk1CkNUkjKsiF/Rg0g+MNY=; b=dA+gGOQhn8CaIHrKGvNBpxIswQF+HoE/S4AR8OlDxSu+8sG1TEBfi1Bjv+/5CuKg4b5Bxe vD/4FS3lS3dPWHViAVadaFEoAu/kPZT+wT/kBaanuJ1Kb5v93XF5Kwe2L9FQiSK/uNLEko 9+TYH+UwNPsBTzaJCzfp6dUeTBxgKiUiLQKHuC4k1wcr/1KCq61QOQigJ54vS+lhxcqnB2 aHT6sf4Y6O1h/Af2hweihq86MKjRQKsVKw7XZ+1Jta3DQRnJtaFHS8cKKIiV/eqzcF48W2 8m7dEFHlvQW+OT9MIKeor5CwkiqaTcgoRvWMbcdWWgFJqZ2xGH79xcw1hZ9kOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491923; a=rsa-sha256; cv=none; b=aqmmUKYybN2WJAoVYIQkfR0MMxUkPYIiilnKT4Q3X7onWJbqNevN11zz9FCc3GXaXuQKNm heULMCD8bjLH1w5QOpERaRWsBWdxBlBXrRmQ9Axf94gP4kShNmLgdSK2Y5JJiyjizIZvIQ ewIC3Zmo/ZJW69BhMFYUoZgPGKlxlHtOxXm37YBoxhKBQbVCFAxZLgc2D79tFXqV7e1VTR llsih8xu03q3xhzJAjboMmdG1Ye5iSXJ8l9V1YArW++sQ/zb1/oSGo6iqRnCoy2babX32e OAS61f/I7D2NchVEsMPAEiPaGTnOeBZiu4T73pvCjfXMXjOgwTwazLpRMr8b6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7LEpULdVULkmllDQBzUrRhk1CkNUkjKsiF/Rg0g+MNY=; b=DHmuHaxLTnDnw/12UpRq10tjYLtnM0bsuIA21F6esIdFHVOEmmOYVIyns3zuUJCZNA9QMO S6Ropoc166PUzBoEVcM+cJMboYAikHrSmcYQTwLOFEmX+eKBIykFDvT4MQk+T099Mv8Vk3 NVYJ1ZDn2pvfAd3MMPVoiXqIyGsGpvY8vrToQgNj12vPjlyKcDcq8DxoPcex2XyE8a8N4B YJXBeXE/ghXyAwVWUigFJB+5spAkPAb74LXZjhBtvamZ0byWhf7H2I5lQIGs8ew2Iz4WfJ K0QACV44p1ubVj8YUbZuDP6YlmTT4ZPIiYKpJ+BoJ6Hp9D/9lAqHPK7wFGAhSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWl4J6qzw5w; Mon, 16 Sep 2024 13:05: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 48GD5NBs020741; Mon, 16 Sep 2024 13:05:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5NcR020738; Mon, 16 Sep 2024 13:05:23 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:23 GMT Message-Id: <202409161305.48GD5NcR020738@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: 661d0031bbc6 - main - pf tests: test the new received-on feature List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 661d0031bbc6b5623eb11234a9c4f20c6a1a5972 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=661d0031bbc6b5623eb11234a9c4f20c6a1a5972 commit 661d0031bbc6b5623eb11234a9c4f20c6a1a5972 Author: Kristof Provost AuthorDate: 2024-09-06 13:06:35 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:48:20 +0000 pf tests: test the new received-on feature Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46578 --- sbin/pfctl/tests/files/pf1022.in | 1 + sbin/pfctl/tests/files/pf1022.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + tests/sys/netpfil/pf/pass_block.sh | 82 ++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+) diff --git a/sbin/pfctl/tests/files/pf1022.in b/sbin/pfctl/tests/files/pf1022.in new file mode 100644 index 000000000000..640eb1334100 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1022.in @@ -0,0 +1 @@ +pass out on em0 from 192.0.2.1 to 198.51.100.1 received-on fxp0 diff --git a/sbin/pfctl/tests/files/pf1022.ok b/sbin/pfctl/tests/files/pf1022.ok new file mode 100644 index 000000000000..2f7b4a5bd616 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1022.ok @@ -0,0 +1 @@ +pass out on em0 inet from 192.0.2.1 to 198.51.100.1 received-on fxp0 flags S/SA keep state diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 1fd31de6ccc4..0ab336ec100d 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -130,3 +130,4 @@ PFCTL_TEST(1018, "Test dynamic address mask") PFCTL_TEST(1019, "Test pflow option") PFCTL_TEST(1020, "Test hashmark and semicolon comment") PFCTL_TEST(1021, "Endpoint-independent") +PFCTL_TEST(1022, "Test received-on") diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index faf5c2de4de2..36218d8e673f 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -292,6 +292,87 @@ urpf_cleanup() pft_cleanup } +atf_test_case "received_on" "cleanup" +received_on_head() +{ + atf_set descr 'Test received-on filtering' + atf_set require.user root +} + +received_on_body() +{ + pft_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + epair_route=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair_one}b ${epair_two}b ${epair_route}a + vnet_mkjail srv ${epair_route}b + + ifconfig ${epair_one}a 192.0.2.2/24 up + ifconfig ${epair_two}a 198.51.100.2/24 up + route add 203.0.113.2 192.0.2.1 + route add 203.0.113.3 198.51.100.1 + + jexec alcatraz ifconfig ${epair_one}b 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair_two}b 198.51.100.1/24 up + jexec alcatraz ifconfig ${epair_route}a 203.0.113.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + jexec srv ifconfig ${epair_route}b 203.0.113.2/24 up + jexec srv ifconfig ${epair_route}b inet alias 203.0.113.3/24 up + jexec srv route add default 203.0.113.1 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 198.51.100.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 203.0.113.2 + atf_check -s exit:0 -o ignore \ + ping -c 1 203.0.113.3 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block in" \ + "pass received-on ${epair_one}b" + + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + atf_check -s exit:2 -o ignore \ + ping -c 1 198.51.100.1 + + # And ensure we can check the received-on interface after routing + atf_check -s exit:0 -o ignore \ + ping -c 1 203.0.113.2 + atf_check -s exit:2 -o ignore \ + ping -c 1 203.0.113.3 + + # Now try this with a group instead + jexec alcatraz ifconfig ${epair_one}b group test + pft_set_rules alcatraz \ + "block in" \ + "pass received-on test" + + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + atf_check -s exit:2 -o ignore \ + ping -c 1 198.51.100.1 + + # And ensure we can check the received-on interface after routing + atf_check -s exit:0 -o ignore \ + ping -c 1 203.0.113.2 + atf_check -s exit:2 -o ignore \ + ping -c 1 203.0.113.3 +} + +received_on_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "enable_disable" @@ -300,4 +381,5 @@ atf_init_test_cases() atf_add_test_case "noalias" atf_add_test_case "nested_inline" atf_add_test_case "urpf" + atf_add_test_case "received_on" } From nobody Mon Sep 16 13:05:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWp1ZWwz5Vy1q; Mon, 16 Sep 2024 13:05: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 4X6lWp05xNz54B3; Mon, 16 Sep 2024 13:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CeHqDoPrHLp/pneRuGGZJtgkHE697XhN2GsVYxQzFv0=; b=fh4FYcor0FFj2jNMDGVnMhWTYOcnjDsVZyx8MFMQJGt94QfDhVF3nTtU102Ee8Bm8oTdGc +sZf/oGBAtbjK4/GYd51IKqMP4wsiXDEUuA1SI5tUh5TkU1zK94wq41iBLfr+k/OD2XURE q0Tgcw2Shln6VnI67bdgleMgSdS6jIzI9qyAPklvFMJjjpHmFo6z1Z8RuFnO5Utb4hsDJ0 /SZn1bwLNzIE//pPQB+6W2Zi+0VFIWBJlK44GyuZ1niKErxapiwKBXLkcNAU3LztuxVy+G GU9H/zZ/W6UtoEC7bBsGzn+Fha0NXQXgJb+eo4qmOtOEx44pHICUATFQakIweg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491926; a=rsa-sha256; cv=none; b=QpnNLYF90pRfW93f/7XLl5CBYQPa3t21m2UcfMid97BhOK0noxYebmuqItie1rEOyTG7T3 lpROZ+lRJTh0tJWgR/V+PcUboXvwtv+Kn8xuxynBUY6H6occ6Ncs1SOvr/w2bYBGeFok7U jMtvMz4PnOqG1o8hXjO+VLSB6IZgvBVay1MK7tZ/EcnSrB7SAJnnK+6CRnyTFslezRcbPu D/YKQfTfiK1v+83idw6B3v3MG4hkzpjg8xq8XuRsXTik0Zd8orPqkEyK8Pk6Y/dlGW44XK HsshMps5Vl7jnCuC2cMB1dyNGZXJHUys/ChBYjCjUfuGmY9gjAqekw6iKuJ7YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CeHqDoPrHLp/pneRuGGZJtgkHE697XhN2GsVYxQzFv0=; b=UMLBVxshLuDLp5OGlDD+92pwmeHtgwvJi+4pzF5Dpx/Nxd53pqEp6wBSuSpBF3/kRFmkxL 2AbsQIQ6nKAa1BoYkQ0ojaA0ln8UnkLPNfjSFefCav9hehEEu8ounJRQT7OvDj/AVb/qKN F+kVLenBOfB8RFVesfsMziLdBvMl0ExA3oq5+vqO3oMNwHJ8ygUhVu6C/IOqgUFQ59g10+ 0Zn5a5G26oTmU6SAoLg2TPRGj77Pt0dKkkj/rncLHiL2+dZKnQAxdpIjd3lilOcT/HmqYf uSZ9OfNUy6s8hWIL/XN0ntpjbmUa9zCXvMVuy/9Tf/sg0mzcpO8sR5+5TMbwfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWn6FZWzwVk; Mon, 16 Sep 2024 13:05: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 48GD5PWa020827; Mon, 16 Sep 2024 13:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5Pho020824; Mon, 16 Sep 2024 13:05:25 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:25 GMT Message-Id: <202409161305.48GD5Pho020824@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: 637d81c52d21 - main - pfctl: fix incorrect optimization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 637d81c52d2153fabbc72e2644199176e1042ab5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=637d81c52d2153fabbc72e2644199176e1042ab5 commit 637d81c52d2153fabbc72e2644199176e1042ab5 Author: Kristof Provost AuthorDate: 2024-08-29 10:02:51 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:48:49 +0000 pfctl: fix incorrect optimization In the non-optimized case, an address list containing "any" (ie. { any 10.0.0.1 }) should be folded in the parser to any, not to 10.0.0.1. How long this bug has been with us is unclear. ok guenther mcbride Obtained from: OpenBSD, deraadt , e3b4bc25a0 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46580 --- sbin/pfctl/parse.y | 14 +++++++++++--- sbin/pfctl/pfctl_parser.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 0c551d2ef49f..55b5310b61e3 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3572,11 +3572,13 @@ toipspec : TO ipspec { $$ = $2; } host_list : ipspec optnl { $$ = $1; } | host_list comma ipspec optnl { - if ($3 == NULL) + if ($1 == NULL) { + freehostlist($3); $$ = $1; - else if ($1 == NULL) + } else if ($3 == NULL) { + freehostlist($1); $$ = $3; - else { + } else { $1->tail->next = $3; $1->tail = $3->tail; $$ = $1; @@ -6270,6 +6272,12 @@ expand_skip_interface(struct node_if *interfaces) return (0); } +void +freehostlist(struct node_host *h) +{ + FREE_LIST(struct node_host, h); +} + #undef FREE_LIST #undef LOOP_THROUGH diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 6de998b34e52..550005508f40 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -137,6 +137,8 @@ struct node_host { struct node_host *tail; }; +void freehostlist(struct node_host *); + struct node_mac { u_int8_t mac[ETHER_ADDR_LEN]; u_int8_t mask[ETHER_ADDR_LEN]; From nobody Mon Sep 16 13:05:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWn2WRvz5VxxT; Mon, 16 Sep 2024 13:05: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 4X6lWm5dRGz549q; Mon, 16 Sep 2024 13:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vOzQ4xKSLVLiaHE4kXnjq0BDY6rqZBzwl3dOWdBqXjA=; b=jtlsN2SWQIX7nYrnL+fqBQn6Fn8+z3olUcw19MErb0S4nWvhyyaxk1wr29CeAo0DeIB1AN 3mL/5if7qFC1PSpMiX+Hl+PotKdgwE9eloGzIpV1ECvcG0WBsXagdt4mXpIgzxkp9OF3hs i22TJddAk+wI2mDVwhy1IC4xa0yq3uKC9NgqjVphEAv3B7JXirCAOiLiSm6z72WOuMONtl g2m8zHjEPIZMNgm4rh2U/2bwlvgj2wPYfyx/18h4i/n44/KVSA8IDqmDFq0npr42XA9bI2 fIY1/T8Py1iHbSICltJaXMXkTMLN+qwXNcZ9041C2FdsXKzmgDPGHvba5KzlHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491924; a=rsa-sha256; cv=none; b=y2RRej6mq3nrJMK6C0cyNZCXqjjFHJSH+UIDnw4xequiKbnDJ1Wq3r9crIdYvumnANEAZD v606Wi54nTRu9RN+vx4eonCLs3qYXH6YcN/ffX4PZxxXw767XSK5/mzn9vYopb8aB+Dcsp lEQK6hpgpcViefHYApeE6BP1CH9por2OSQv8TFbbWjRFl801GV9FYhQ1fstOJ+QixPAbaA 37CmEGVw5N6BdlZM25Ap21MLycN7Y2WwlELqz9HMjLu5x2S9ES6hywI3pXOu//b6mFlfR0 9J7J3sMdoP28PgqTY4+xcezXCutSXuw38I5+7ca6IGhKiGgjVNB0iRMVf2Hk0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vOzQ4xKSLVLiaHE4kXnjq0BDY6rqZBzwl3dOWdBqXjA=; b=NCsSEzqaDFgOplm/jghGlLSMQXeJUPd+fCrj5eR323rNMuYFeG2hb5LnVN4JUgx7Z6Vf0F qgGAWYUv7nkXP/oKCgcISzo114mVTQUP1/Ifpg82PxK2zoBn9NxbROAmeN5N8X8QU85OhT 5pHDgEDKz2XeYVUC0+9OxBfvoXTf/p2OV8r2ak1O03f21VJB65MPEr1KMX4oRVAyG2NhBc +gHQnDd878g3BxOjlrJo+esI3jfXlzzh9C23N1ZbgOYo8YQzPKG2wTBaJMYYk+OZfXrvv5 GsYAAWm4d9bxcB0htVWZl8aQ8pgny4g6Y2DVkKNKdfti6kX2xet7pWoZseEZ0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWm5FrVzwSn; Mon, 16 Sep 2024 13:05: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 48GD5Oqe020786; Mon, 16 Sep 2024 13:05:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5OEw020783; Mon, 16 Sep 2024 13:05:24 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:24 GMT Message-Id: <202409161305.48GD5OEw020783@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: e80f2a1087a3 - main - pf.conf.5: document received-on List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e80f2a1087a38ad09f89263bc925f5580c556f26 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e80f2a1087a38ad09f89263bc925f5580c556f26 commit e80f2a1087a38ad09f89263bc925f5580c556f26 Author: Kristof Provost AuthorDate: 2024-08-29 09:23:51 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:48:40 +0000 pf.conf.5: document received-on Reviewed by: zlei Obtained from: OpenBSD, dlg , 456093dddc Obtained from: OpenBSD, jmc , 2bf0158fa8 Obtained from: OpenBSD, deraadt , be785dc6e2 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46579 --- share/man/man5/pf.conf.5 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 733b00cc6732..bfa79b928b69 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 September 4, 2024 +.Dd September 6, 2024 .Dt PF.CONF 5 .Os .Sh NAME @@ -2118,6 +2118,11 @@ For example: pass in proto tcp to port 25 set prio 2 pass in proto tcp to port 22 set prio (2, 5) .Ed +.It Ar received-on Aq Ar interface +Only match packets which were received on the specified +.Ar interface +(or interface group). +.Ed .It Ar tag Aq Ar string Packets matching this rule will be tagged with the specified string. @@ -3231,7 +3236,8 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | "rtable" number | "probability" number"%" | "prio" number | "dnpipe" ( number | "(" number "," number ")" ) | "dnqueue" ( number | "(" number "," number ")" ) | - "ridentifier" number + "ridentifier" number | + "received-on" ( interface-name | interface-group ) nat-rule = [ "no" ] "nat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "on" ifspec ] [ af ] From nobody Mon Sep 16 13:05:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWq3zRCz5Vy0Z; Mon, 16 Sep 2024 13:05: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 4X6lWq0J5Wz54Pl; Mon, 16 Sep 2024 13:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mgu9C7tO72fe9+Tb3xMtyCWDWLcWFkkLCMkKsW77yyM=; b=HK4LDhxMglCcTh4KOHKCGHsZFugACXeYfbnRBT8JaKSydY3iAVnX1cPv4A3FKjC5envyGX HY4h2gNptvRNkJftFBwGcB31xNK5cubLHVe4tYYiWyTJ99s52o3iY+jen+koxhYxE5lJtG IZGZtSGBz/X8BQnznYCUrRxbKSzUj8Rl29gfDNaMtG4+RnDd4Z2boD9dsWoSirC4cmSTO7 4bfhdiZSL9Ql6dFuAybFfy5U4M9b2offM4Xx0aDQYFPxZ+a/HESSAS6svxaxWuQCdNib/M 0pqCSRgWUUvCv20adExZbPkJGSsl3PEQ/eRxpvI0Gy+b9y+vPuaMk8481YzBsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491927; a=rsa-sha256; cv=none; b=rIvDHvbcBorOXV/aevRLKOXJLH5rjGnovSCuGyYO+Dh1+4HIlqg3VWG0HWPnNsf7Hdv9Ce PRs1VZVgaSKpgNmq1rM6sQv1fWx4VPied/5pgAQcqMDlaOmjBXq/awi8hYMX6PM6T1fpfH d8gQQNZkYnaWMbiRDrfFtUg8rDHugfRX7uX7/XlRT05/VcF2gYPO4F+hPeoZlZqYcmFfHY LNgdotIASpD4eA71iz0MVXCk+WGbKY7uSqBQmT1tOmK+WQwYVKzp9bHsKUYDahQPFa/ikv juHoC7pTAU4ZQ/0t3hjGXuJWWTkcEdC8SO9FCuStShng13VBm7YrgTgpSW+4rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mgu9C7tO72fe9+Tb3xMtyCWDWLcWFkkLCMkKsW77yyM=; b=bj70yMJsXdPulFrTRcq7Sc26Ph9phX4J7A6+fJOMyq0U6T7kXjl/Hzi7hXt/fcEy217jZL jurkreZ1Q13HEEN8lI+68o93QFJbGnkxTxcdfsaF8KoS52AakernRDehuAJYot8OsSVqqE bqD80dmorfHDdk+81yyxD2JmXutr+kxnhNDWXjsipC6b+3ELPSaklS9ad2h40yNaj8CaxV vU93bixHxM814rBi2K4fGdYpnkEQYY4cWiohqmeqMT0iFQrNIUfhXls3k0ESW728XPMUkF cyY0GmpcFM0claB6nnL8wqyKyVfx12uvbTnbclMrCVyW/1oTK997kyoJxvoXMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWp6zNCzwVl; Mon, 16 Sep 2024 13:05: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 48GD5QGw020884; Mon, 16 Sep 2024 13:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5Qrl020881; Mon, 16 Sep 2024 13:05:26 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:26 GMT Message-Id: <202409161305.48GD5Qrl020881@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: 357c95ea4663 - main - pf tests: ensure we correctly optimize { any, 192.0.2.3 } List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 357c95ea4663225803e6f1fa89499286a018eb89 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=357c95ea4663225803e6f1fa89499286a018eb89 commit 357c95ea4663225803e6f1fa89499286a018eb89 Author: Kristof Provost AuthorDate: 2024-08-29 10:03:49 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:48:54 +0000 pf tests: ensure we correctly optimize { any, 192.0.2.3 } Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46581 --- tests/sys/netpfil/pf/pass_block.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index 36218d8e673f..abd303bae6e6 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -373,6 +373,41 @@ received_on_cleanup() pft_cleanup } +atf_test_case "optimize_any" "cleanup" +optimize_any_head() +{ + atf_set descr 'Test known optimizer bug' + atf_set require.user root +} + +optimize_any_body() +{ + pft_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "pass in inet from { any, 192.0.2.3 }" + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 +} + +optimize_any_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "enable_disable" @@ -382,4 +417,5 @@ atf_init_test_cases() atf_add_test_case "nested_inline" atf_add_test_case "urpf" atf_add_test_case "received_on" + atf_add_test_case "optimize_any" } From nobody Mon Sep 16 13:05:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6lWr5mSWz5Vxxh; Mon, 16 Sep 2024 13:05: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 4X6lWr3ZGYz54XH; Mon, 16 Sep 2024 13:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sJI8it8hDbXC67RwcluUtRGrw6qTzuapMYBJbiKChI=; b=Ez9BpH4NsQugI1OZtY+oAuQtHtF5x8dRS+6CTPT93Ohlc3Bscj1iVjjB2XkbmiIFoGAnOm 7I/4Yk9lWe7IBw+3ye92vfMjUdSlLw/ojZJaVTmrWgGYh+LXZOlbu0/0Go9FyuLGT47qNi JiNksrxyDwHLwL86VpCuQGVM65qUk1j7h1Jmc4g5+FxJsM2VPKX3s9tUx8pO73iFc2WGcR LNnu5SZuJ4QQ+iXopIzXN/LorUarCradsn5z2Ku810/U2Rgvr68Yq2QFffi3MiqcNxiWb5 7MfUiNBYMWUvt49TzO3LSmefMkC9dujZ6QpHBBgd8jYIu54i0z8P0u0moTQeVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491928; a=rsa-sha256; cv=none; b=vfUsqhZvXt++vWJjIRCp8sq42jFkDpzrPnhj2XuZ1/W3vkVtNUyDjmUEU9OUIkbewhrLNE R+S0fNVQGCCkK9+uvss6oP23QFnLWABSnGNRNYV03lbs1jvBm3bGcCyl+tlH2xYOTK/A1k /Qkyr/BE0+5si44gZ6vxnhy/WhfhYSqNEwWc96ySd7JSAAUQjJP2NXNZ4/XEymdYjgRilw U32ylxzXmjnwyLCgXRFaUaKpALhWTfE6GDyIjuDq0dJooEeNhf06ShiQ4te6kKf7GtgxLl MNheNRmXCCLKZrR8R78+Jj4MkN3m3Qmny4Dk6MjkWd71KD+kk7KB6YMjx4EhbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sJI8it8hDbXC67RwcluUtRGrw6qTzuapMYBJbiKChI=; b=GWtersxNtDn9v9ffD7rT2IlNuGJpaMJLNBLjOVEs1voaQk7FBeRO+uD2o8H2EbKFmdLcXs a8mfYWJqYtRl2ayf5MmMJ7BrczN6Vknz70bbXwD+KLcwHkDw6K+1kpxH3eVO772plK/CvL NuOn3jNUdXpb0laARP9lAzw0QXZY0+dvIMq+d3b2KU5TxLu8xQ8euWVxS03wj/8iyRqW76 Ha4PBosxpU121TDh1PjmQrpEY/pxt2aZr62Rk+0IrXpMmP/Cvp7U2Ti1CvW0y+oNnctELP GwQqFcXpXLRyUBnIkMXhpRyWM8CwmFKH5lJ2ps6xxAbEoX2Q51o5KVIzW9W/rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6lWr0t1PzwFn; Mon, 16 Sep 2024 13:05: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 48GD5S3d020941; Mon, 16 Sep 2024 13:05:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5SMG020938; Mon, 16 Sep 2024 13:05:28 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:28 GMT Message-Id: <202409161305.48GD5SMG020938@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: 80eb861dc2a7 - main - pfctl: lex <=, >=, and != into a single token List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80eb861dc2a7960e1acc74796cf0c937472a5dba Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=80eb861dc2a7960e1acc74796cf0c937472a5dba commit 80eb861dc2a7960e1acc74796cf0c937472a5dba Author: Kristof Provost AuthorDate: 2024-08-29 10:08:32 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:48:58 +0000 pfctl: lex <=, >=, and != into a single token lex <=, >=, and != into a single token for correctness and to reduce the lookahead in the parser ok henning otto Reviewed by: zlei Obtained from: OpenBSD, deraadt , e6e3ecf338 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46582 --- sbin/pfctl/parse.y | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 55b5310b61e3..cfa6c85b5c0a 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -517,7 +517,7 @@ int parseport(char *, struct range *r, int); %token STICKYADDRESS ENDPI MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS -%token DIVERTTO DIVERTREPLY BRIDGE_TO RECEIVEDON +%token DIVERTTO DIVERTREPLY BRIDGE_TO RECEIVEDON NE LE GE %token STRING %token NUMBER %token PORTBINARY @@ -5249,10 +5249,10 @@ yesno : NO { $$ = 0; } ; unaryop : '=' { $$ = PF_OP_EQ; } - | '!' '=' { $$ = PF_OP_NE; } - | '<' '=' { $$ = PF_OP_LE; } + | NE { $$ = PF_OP_NE; } + | LE { $$ = PF_OP_LE; } | '<' { $$ = PF_OP_LT; } - | '>' '=' { $$ = PF_OP_GE; } + | GE { $$ = PF_OP_GE; } | '>' { $$ = PF_OP_GT; } ; @@ -6630,12 +6630,19 @@ top: if (yylval.v.string == NULL) err(1, "yylex: strdup"); return (STRING); + case '!': + next = lgetc(0); + if (next == '=') + return (NE); + lungetc(next); + break; case '<': next = lgetc(0); if (next == '>') { yylval.v.i = PF_OP_XRG; return (PORTBINARY); - } + } else if (next == '=') + return (LE); lungetc(next); break; case '>': @@ -6643,7 +6650,8 @@ top: if (next == '<') { yylval.v.i = PF_OP_IRG; return (PORTBINARY); - } + } else if (next == '=') + return (GE); lungetc(next); break; case '-': From nobody Mon Sep 16 14:45:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6nlg2gJsz5WB8t; Mon, 16 Sep 2024 14:45: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 4X6nlg0gD0z47Xx; Mon, 16 Sep 2024 14:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726497951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OG+ngt8ZEU3jNPQeJ1m9VJC2ufuoTbTlSvt1wNrQPMg=; b=V9+O1yD2j4Li6mguOTVj1L1QAWh5cG31oziGxLetz2fRhODKbt65S/xpSOae62IxfU3QNL 012qeYH3VR8GtrWS6ov8oXfKLWgvxrWdjw9oSIpsWGIdNBxyi49ZTCKwwKyGrtpZOSrRjB ljZVxF+HIGAhcTQWErPmJJB1bkMJ3EsocUbByNTGICl9M20M7/21AWkocRVf8e5NbSvinf Xmyjwshu73nnf6+7ITlqHc76OflV9d9L3RJr00L+pVwdrScSLbEMs7BlmgV6ZAags5qiQo 9hW1Y3VV5iuEED7krhsF5If1KgUHCSZO7XQqqyIZKm0CMrxjeuXmYJn6Nf0fcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726497951; a=rsa-sha256; cv=none; b=eo9PCjK0Fwzej0W9pkYDhhblHwe5cnLM/idh7zC2RdNpaLABR3Y1KSqL9yP+GT2ifvuKPV o3JDM5/4KOPv3CpuBvxMZaQvtC3wdj3lm4neRr/xYhzLqkeclIjE4nEXnDmBZNHcRWEf0h yyq6v10OCJ5iOfn0HAB1I3uZYayeWlsuoKU/Gz6pD7gdJplpcZ+CZgioAa/nD5/3Ono3CX nmM4La+pOKijBfCqpgkDnwkadfc+25QdyEwSK/nEJS+clspIAD51BT0OVCCgrwGZjN68Ov hsAV9W42HrSbB+egJgq+eweqptkGtqUOzwI5MuetbJQwcg156aUhcHkGyJ82Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726497951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OG+ngt8ZEU3jNPQeJ1m9VJC2ufuoTbTlSvt1wNrQPMg=; b=YYrISpXBZ247Z07HJqDtP1reju6JXW1NQ3c95ndirUzrrwu1oDAtCpXQ0SNzaZAbx7YnK1 4Wf1aBgMsoe5QBKwUi7ITdI8JC5d8Mkv2r343hHHcYZP0S0ScBK0L2C3oTshw6XfuhMhPM 0UptnEH6T1nkZi3cdiOqVQ+UdavqqaQd34ydjGuuNbOk9cK9Qt4pxwfzFw2oN3YrO+V7xo LFuINn6hKR+eJcKE8f/QEwi7TLGAIUj/yuBQLLAlnlA3hqDfAPdIgXws6bJLIxYkqD7Dtk po6U1LKwSVO6wuguJsDRiTqfnGOdcwCB0wdpJMZCiXxDpfRIwgfOV+6HUplc8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6nlg08kyzyLs; Mon, 16 Sep 2024 14:45: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 48GEjocJ090647; Mon, 16 Sep 2024 14:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GEjolf090644; Mon, 16 Sep 2024 14:45:50 GMT (envelope-from git) Date: Mon, 16 Sep 2024 14:45:50 GMT Message-Id: <202409161445.48GEjolf090644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 855c3dacfc6a - main - imx clk: Skip reconfiguring the clock if we don't have a new best_parent List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 855c3dacfc6a1565a75086e64a154dece3ccf5fa Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=855c3dacfc6a1565a75086e64a154dece3ccf5fa commit 855c3dacfc6a1565a75086e64a154dece3ccf5fa Author: Tom Jones AuthorDate: 2024-09-16 14:43:31 +0000 Commit: Tom Jones CommitDate: 2024-09-16 14:45:26 +0000 imx clk: Skip reconfiguring the clock if we don't have a new best_parent imx_clk_composite_find_best_parent can fail, when it does for all the clocks checked we attempt to configure an uninitialized best_parent leading to a panic. Initialize best_parent and skip reconfiguring the clock if we don't find a new best_parent to use. Reviewed By: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46662 --- sys/arm64/freescale/imx/clk/imx_clk_composite.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm64/freescale/imx/clk/imx_clk_composite.c b/sys/arm64/freescale/imx/clk/imx_clk_composite.c index 1d5ab5908d8c..3d2ef06fb8a2 100644 --- a/sys/arm64/freescale/imx/clk/imx_clk_composite.c +++ b/sys/arm64/freescale/imx/clk/imx_clk_composite.c @@ -217,6 +217,7 @@ imx_clk_composite_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout p_names = clknode_get_parent_names(clk); best_diff = 0; + best_parent = -1; for (p_idx = 0; p_idx != clknode_get_parents_num(clk); p_idx++) { p_clk = clknode_find_by_name(p_names[p_idx]); @@ -243,6 +244,10 @@ imx_clk_composite_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout if (best_diff == INT64_MAX) return (ERANGE); + /* If we didn't find a new best_parent just return */ + if (best_parent == -1) + return (0); + if ((flags & CLK_SET_DRYRUN) != 0) { *fout = best; return (0); From nobody Mon Sep 16 19:00:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6vPB4vFcz5WjP5; Mon, 16 Sep 2024 19:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X6vPB3fdpz4k9D; Mon, 16 Sep 2024 19:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726513214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Ne9RYZMTBvQYyNVGd8/RFfjPfUTkZg5DZwgnumiLoc=; b=tOENNXbVPtoIER261YUa7CN8HQHz3N9/E65BdOkLT2V/jgIwfJ8DrnpTdkR4pjnyn+Rg9b J6rBmREynbkepBtG8PE6DLDmwTp32pffb8xwZTMAjYbatCS0NEbJF1/4d2c3KkW/MsLbkh GSCRVTU+VjYt3Ipd/jRjEqY1TdlWvsVcHFM925vyhByyrefTYVeTUwbaFOfyTfyu/sVGr/ 1LKaCj/WmIipsKFkfCY49u5EQ4X6Afky2jjaQSPM02CzWo4QBYd1CrM7YiUHFLF74KoWao 8TNm333YjOxt31wg+axykJqyG6ZtHa+wrrbZwomc9cCuyea3EpxQ3Mw6zckDHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726513214; a=rsa-sha256; cv=none; b=jxi2j4VltK20gtK6ukhkg3kkJinokBDBF8iBRRqkTQ2c7TqGORh0kaoF0lJIfoIV8STPus iBVw3W1+wy3/JKTl5fMqXAnucwRJF2DRdoHUdGAI9++MpuI0Qu1i5mKMFAzOhGIr8SQT/q Jgnq0j5xtmZoJzkXL10JNvjZCrK1kwWFcDaUhbASDlNIFY+Aa1+Fbz/hN65YS+WTOtJYBr NU4QvYzRr1Z+yxeb0kzMY6bkpbKll9GH7nAjUDhyh32VmEpbfJYFupP5JBNqllcfrM5QHA AR1KrcQkKO4dC2c+dAMM/f2lnNDoauatG/kSLdYaLoT0OJYIDtWwTfXbrrMzeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726513214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Ne9RYZMTBvQYyNVGd8/RFfjPfUTkZg5DZwgnumiLoc=; b=mV+9Gu3fVYNiUyj7D9m83G/FyoOoudm0Fecho5Ev59irZp4qMIZNZA4sMCWzR7Up9MfJVU agcfCxzhKOB+9UbQgwawCsB6vCClMg5qB7nxKtVo+qWayIpdFE3gG7AfpwhHBgeDylLMlx izREA4LvsJMQk9uOvXODGU3OwiqFrjDxtT4PvQ0+GPXMA6iSUxJYTjHKtzU9/sfz9dMROE mOIhJSvDBoF1mmiQ2D3UZQs9trsC9Puf78c7t+CWMFA9kf/4fwPgB8Cts1J05TLaAobwL9 3XRq0G1bMpyRo52EWIJ9+9NxpUSth8cZyW1wjyFgiAP4iW7ywcj7HTFc0h8sQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6vPB2kzrz15Yj; Mon, 16 Sep 2024 19:00: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 48GJ0ECh022779; Mon, 16 Sep 2024 19:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GJ0Ewo022771; Mon, 16 Sep 2024 19:00:14 GMT (envelope-from git) Date: Mon, 16 Sep 2024 19:00:14 GMT Message-Id: <202409161900.48GJ0Ewo022771@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: 07f47e8850d0 - main - cxgbe/t4_tom: completely avoid L2T entries during stop/suspend. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 07f47e8850d0639d474026b203013072aeb32c81 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=07f47e8850d0639d474026b203013072aeb32c81 commit 07f47e8850d0639d474026b203013072aeb32c81 Author: Navdeep Parhar AuthorDate: 2024-09-14 04:23:23 +0000 Commit: Navdeep Parhar CommitDate: 2024-09-16 17:24:32 +0000 cxgbe/t4_tom: completely avoid L2T entries during stop/suspend. 1. Mark the L2T entry valid only if t4_write_l2e succeeds, which won't happen if the adapter is stopped. This prevents L2T entries from sometimes getting (re)promoted to VALID on Tx activity during stop. 2. Discard a work request immediately instead of enqueueing it to the arp queue if the adapter is stopped. Fixes: c1c524852f62 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_tom_l2t.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index 749e5704863e..be42a887323f 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -212,20 +212,18 @@ update_entry(struct adapter *sc, struct l2t_entry *e, uint8_t *lladdr, e->state = L2T_STATE_STALE; - } else { - - if (e->state == L2T_STATE_RESOLVING || - e->state == L2T_STATE_FAILED || - memcmp(e->dmac, lladdr, ETHER_ADDR_LEN)) { + } else if (e->state == L2T_STATE_RESOLVING || + e->state == L2T_STATE_FAILED || + memcmp(e->dmac, lladdr, ETHER_ADDR_LEN)) { - /* unresolved -> resolved; or dmac changed */ + /* unresolved -> resolved; or dmac changed */ - memcpy(e->dmac, lladdr, ETHER_ADDR_LEN); - e->vlan = vtag; - t4_write_l2e(e, 1); - } + memcpy(e->dmac, lladdr, ETHER_ADDR_LEN); + e->vlan = vtag; + if (t4_write_l2e(e, 1) == 0) + e->state = L2T_STATE_VALID; + } else e->state = L2T_STATE_VALID; - } } static int @@ -291,7 +289,10 @@ again: mtx_unlock(&e->lock); goto again; } - arpq_enqueue(e, wr); + if (adapter_stopped(sc)) + free(wr, M_CXGBE); + else + arpq_enqueue(e, wr); mtx_unlock(&e->lock); if (resolve_entry(sc, e) == EWOULDBLOCK) From nobody Mon Sep 16 23:02:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X70mm6GQCz5WLMy; Mon, 16 Sep 2024 23:02: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 4X70mm4pRHz4S5M; Mon, 16 Sep 2024 23:02:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tNffi2Q3KW8+1oTvVjLXlDssiGn34iB11scn61jJVJk=; b=orjL2svyol3UIVrOuoRd/h6S4X95O+1byIBxyQyo3sODhjHWCeU84msNIAc/u0Ua4JOyEs jejAJpEyPfEVa+23Wz7UkKKIckgZur2HihgAdi/vZPaMbW1hdaeYP7bvoMO4awBzvXS3PE Pqxu2JeLhxPtEEM+NhOLUnsIXnp2MhMTU7cAc2k252Vao0Ok5WI0O0BmKpn+DPxBWHybuu 9yrKryLlaJ4JgNOUxwAYTx/dw7F9oPKZl2Ljj4RtSo0B/PkV7gN4T22K7gJ8wZ+bEXLoYQ 2l2tjgHiuzfCX74Dmj6y/Vx9nOYfunvrq/Iv8L76e1kE0Y3av2EURGHadifeJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726527752; a=rsa-sha256; cv=none; b=Nyt3zDPTaXmSjjTt1y5EvswOqMpvU5LdeUq6R7+R5JRpRHeqeu32kQY2/2tgSI0pDdYN4u tIAvBsDsmiywjfs89whOKjx9Ucl6u8nyxcIlgxr3VcfQvgCiOPe+71QIcB2MQu4ZYd3hrx W3jhLCWFEWbT7DnjzuNY34GptBX7Q73jeGZha0EAX19/57SqNelNTNPbI3UaiFkytBGZAo 9oVhO11VoP6ubjIrwIw6h8uLPd3GlXxfHXpyPfVv+tYnqAvqP3RmfyPo8cVBrDN+99oMCU Fg1sSrIves/OYzVlz+TGaTcg6L1gHWcqAv3VVtwADL811FdaVxYevht49m3XEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tNffi2Q3KW8+1oTvVjLXlDssiGn34iB11scn61jJVJk=; b=BELq1oSOy9B+MSCg9RftlDCT+xbrAHGmlM20/RE44v9OkLMS/XOPTHiihPr5ZECI/R2Lev DdZl9lX6TRR2qfG8oytvV7q4VkhdmpV2Wldhij7A0icjfq21EdrxHjxkIYtTGwSXBFLYNo LorqYclegjE8P1viMgxBbqpxjYSORlVgbys7An/ZdfmQU3XE8r/9pzJz43zI2xBR6eItfA E0JMIZlFmP5/VA2h9DXOmQzGvaKi2kboWua8eEdGMfzpbrl76Dc0CcectpvrrXaIyNANCi pb7lZX4yHHbPWZ5jd+cIUlNBQoHFELq5aX6vszDIBvaL5PsXuQSR4LRBEKr76g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X70mm4PbYz1CvM; Mon, 16 Sep 2024 23:02: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 48GN2WXq042993; Mon, 16 Sep 2024 23:02:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GN2W5G042990; Mon, 16 Sep 2024 23:02:32 GMT (envelope-from git) Date: Mon, 16 Sep 2024 23:02:32 GMT Message-Id: <202409162302.48GN2W5G042990@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: bbb00b1719f1 - main - pmap_bootstrap_la57(): reload IDT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbb00b1719f11c58efd5375aebc30ccd13bf0906 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb00b1719f11c58efd5375aebc30ccd13bf0906 commit bbb00b1719f11c58efd5375aebc30ccd13bf0906 Author: Konstantin Belousov AuthorDate: 2024-09-16 16:36:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 23:02:14 +0000 pmap_bootstrap_la57(): reload IDT after the trip through protected mode. This is required by AMD64 ARM. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index eadcb726b6c2..f7e3ef4233ee 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2263,6 +2263,7 @@ pmap_bootstrap_la57(void *arg __unused) ssdtosyssd(&gdt_segs[GPROC0_SEL], (struct system_segment_descriptor *)&__pcpu[0].pc_gdt[GPROC0_SEL]); ltr(GSEL(GPROC0_SEL, SEL_KPL)); + lidt(&r_idt); if (bootverbose) printf("LA57 trampoline returned, CR4 %#lx\n", rcr4()); From nobody Mon Sep 16 23:02:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X70mp1CfNz5WLQR; Mon, 16 Sep 2024 23:02: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 4X70mn6BtRz4S5N; Mon, 16 Sep 2024 23:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8X87GIMGXHGPLhXC1Ma3v5aHXbVa7cdwxFlAaszRB9U=; b=Z+Rwbuws6sRExLyi/e37tA5aV2h/vpaSA/irLOOfGoBQqmVXrQ6lb8qnymi8rT1jFEofLn lB/bF43Thc2EAPfdN1F02M6eDDfgFofxFAjoEUTHb9WFJJTymuo6kVJjKIZNbQPHN8WDzT Ug4EUttiMg31XxKgqb/mzr0p+YrUCcwc3PNTznh9hm5UCKSnHnAigErvOK0r5TZNuH3d3J HS3amV2LkD1JnnPLXJFdr3ivbwtFYCacgiYLgTEk2XOYM8v7hhna2S9WmwKN86UWj6j/L+ Q2FVIVDNHnZXWYbtYskaZgxo7KifkLCEASbWaW5VjUI2jVcBHIuQEPXAkDfQVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726527753; a=rsa-sha256; cv=none; b=Dc96s1crZZ3xFj8E1/8vSs5cuBDiE1mdA1mY5oWQPAVMHEH2YPxE3uyPf4kOPrZJ/k9BCv 1FFIsEVT++TkkZJ5DYYIx973cjt92uSgQblySPlVRSKdH4BvQ5tcp4tWYiBLKrzPpIUItf fX9t3NXHMPucs8bD9GxlIlgoq3TyWoZxbisLYnk2LeUTXqCfFf7rxuSOEatUzmR9c+4Wfl 0uWwm0fNZWRFSBvylRr2MiiTj36eNPJ2U0iDGtvYmugYHLqptN9To7yOhsHGMJuTN5JCY9 Mgwzr6gPPIHCe6pQlRbKJPh7qNGQ9rfs4JFStBm9W4LnhsJJc7v13RdbvwQwdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8X87GIMGXHGPLhXC1Ma3v5aHXbVa7cdwxFlAaszRB9U=; b=QA0vmXVfPp4mXdB9njxuF9IZqxkeqOd4qrA+FDjy6A4gcsl54ne7B/yGVusNMU3XHxeXRd Oo85WjjUlLk7kCtFswCGnS88wxFoq1EdORF+zd7EhH2e6wMdr7VO4/bVMsRfIPKRTGivYH S/zawEUGiJqB6/PPQcGrvx8mcWAU+gVBRSGuPwq4Uvq5jNkqci71uaup5IyWjT4A5UlUKY kahWLh7a5uA//s5Hm9NpiDcJMZOhQWzcm1cImSeNyfHUhYK6stHKrZD2x1GxnQNqKkdzBt RvDKFd+T9TWXhxJB1PJZJbCuiPXEwiBRXI5autji7AEQbxRQb2IpqQR0ruJRbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X70mn5pFHz1CxX; Mon, 16 Sep 2024 23:02: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 48GN2X6j043065; Mon, 16 Sep 2024 23:02:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GN2X87043062; Mon, 16 Sep 2024 23:02:33 GMT (envelope-from git) Date: Mon, 16 Sep 2024 23:02:33 GMT Message-Id: <202409162302.48GN2X87043062@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: 4f82af24f111 - main - amd64 pmap: do not set PG_G for usermode pmap pml5 kernel entry List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f82af24f1113a7df224daded227d4e9de582c0b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4f82af24f1113a7df224daded227d4e9de582c0b commit 4f82af24f1113a7df224daded227d4e9de582c0b Author: Konstantin Belousov AuthorDate: 2024-09-16 17:57:23 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 23:02:14 +0000 amd64 pmap: do not set PG_G for usermode pmap pml5 kernel entry Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f7e3ef4233ee..fd4697a266e3 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4375,7 +4375,7 @@ pmap_pinit_pml5(vm_page_t pml5pg) * entering all existing kernel mappings into level 5 table. */ pm_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M | pg_g | + X86_PG_RW | X86_PG_A | X86_PG_M | pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, false); /* @@ -4412,7 +4412,7 @@ pmap_pinit_pml5_pti(vm_page_t pml5pgu) */ pm_pml5u[pmap_pml5e_index(UPT_MAX_ADDRESS)] = pmap_kextract((vm_offset_t)pti_pml4) | - X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M | pg_g | + X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M | pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, false); } From nobody Mon Sep 16 23:02:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X70mq0sfqz5WLT7; Mon, 16 Sep 2024 23:02: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 4X70mp6s2Fz4Rgm; Mon, 16 Sep 2024 23:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMby74+B2nwO+RWXelnaOxl2WsG/wYhaMcsNOlJfcno=; b=ANKYPd50EpyQ9zmQ52WLlLCd0NgO5fxGsPGOIzeh0CrO+P57oj52hgtJKw6cBABbH+sJvM sL9ukl1+RcGFIrreRHABYIgL0JjDnNV2lHXYk34pPTrn91+mD+u0jTyb+ZBqUv73fNJMjO oq0sRWHAUPsWfr3YlITuDH8wZEug8sErgRxuRt5QPmHaNT+gnASUClTQdPm83qybLcNEaX yK2oGQZ3RJ3Ne3XhJ8fMiUAwwoC3fGzx8Xh2EFq1lSAZ3Y5KFPMtlaboSy6/FY4Lii6D2i GdEb+Wy2G7rtgJ2wroT+XJx0DO2M+jxcT7ydFq+kEFs+Ne3G2uMi+XMvWYQLoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726527755; a=rsa-sha256; cv=none; b=fnZZtEOVT6n/98itX4GiGv/57XDSwV8lq9p2OynXaPTbakqQ6Mnr07D18OFGJ5hvH/S6PN rQrvEm/hRpHnT4TugFHYPQk7h8O/MurzJBwEXEJz2BIj1zITVHiTqs3shYvAVLjF5nNd52 5+sLh+wsIJiT78FjWYJ2geSBFonkceMR3nMNP9FGLVZGr9oRiJPdjpq/7xWggej2Ggdult HvwqI5BEspsOmh8bRiDNAlcg3qdOHA8Kt3bXZqRbG7HgDwfQB0cd3/C1o7xPHuMhiI5Nh4 WsX67BgsRdVcE7tjeXlkjO7CVxbb4+ZSV8wki3vlU9ZHzq6nK6RRQTLLZAceFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QMby74+B2nwO+RWXelnaOxl2WsG/wYhaMcsNOlJfcno=; b=bK2JELpKNlH+tEDVkJYun6UrFbut0ejoxLYsCXAQ6jCmJj/ILahS629DNZtS50BMg8cX4d tqVqxbHJjYz/aXfpBi8pxuUWMYEUwdnKEYk3Lj5cPEAFV/aOqosdqnMC9q7gQ54AM4XIS+ 2rVIJwj3LB0LGApjDm1rOsNkPTzDsVEwHlBhy9xC7YGPwXH2eWY+kqwcogY4TjlwI+4r6i FZqGCbpsXK/qLq3dGYPahpJ5Qy5VwhuVTMdJ2FjkkSn9t03nC+9UvJN9A1Jsik+1wT6vkS AEz8dUBGC/L2lbixfYuQrjPG/glKGAJVNaTdCNg8f3T4miW4F+i+CQ4vpMtI8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X70mp6S5Fz1ClS; Mon, 16 Sep 2024 23:02: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 48GN2YHQ043117; Mon, 16 Sep 2024 23:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GN2YTM043114; Mon, 16 Sep 2024 23:02:34 GMT (envelope-from git) Date: Mon, 16 Sep 2024 23:02:34 GMT Message-Id: <202409162302.48GN2YTM043114@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: e134cd9580ad - main - amd64: pml5 entries do not support PAT bits List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e134cd9580ad62e87c8e8678bdbc45936b11ee86 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e134cd9580ad62e87c8e8678bdbc45936b11ee86 commit e134cd9580ad62e87c8e8678bdbc45936b11ee86 Author: Konstantin Belousov AuthorDate: 2024-09-16 18:34:47 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 23:02:14 +0000 amd64: pml5 entries do not support PAT bits Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index fd4697a266e3..4cb833757489 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4375,15 +4375,13 @@ pmap_pinit_pml5(vm_page_t pml5pg) * entering all existing kernel mappings into level 5 table. */ pm_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M | - pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, false); + X86_PG_RW | X86_PG_A | X86_PG_M; /* * Install self-referential address mapping entry. */ pm_pml5[PML5PML5I] = VM_PAGE_TO_PHYS(pml5pg) | - X86_PG_RW | X86_PG_V | X86_PG_M | X86_PG_A | - pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, false); + X86_PG_RW | X86_PG_V | X86_PG_M | X86_PG_A; } static void @@ -4412,8 +4410,7 @@ pmap_pinit_pml5_pti(vm_page_t pml5pgu) */ pm_pml5u[pmap_pml5e_index(UPT_MAX_ADDRESS)] = pmap_kextract((vm_offset_t)pti_pml4) | - X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M | - pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, false); + X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; } /* Allocate a page table page and do related bookkeeping */ From nobody Mon Sep 16 23:02:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X70mr55Nrz5WLN4; Mon, 16 Sep 2024 23:02: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 4X70mr1VL7z4Rts; Mon, 16 Sep 2024 23:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6EbSzbd5GS5eI3c7/bR4jpLbcDfQ7diQ3UAFyfApt4c=; b=Q5fgXl0/Lb87cXTdLlPPFTNOhMfxsmoF6IitLkLeoxmOqD7xS+AM7cVdftA7Bc20Pwr4Pq SP+3z6k351ejuhK06JUN1H6XR+EjWc7v1EfN9As8jp6s229oglTaYZes+SZ4qz/hzV8vhK 4/l65wRK7z5gCe2LJVeTBgR9SiUdRw4JtiFbPDjunL6EjKcv8I7kV5loo0tfk7sGBg9RC1 EaQT3FubyfFKfcCGCFi8UW5Pz5Np4xYlZBRo3P+7+4LrfRD0JtnlR2UhxU2hBA093Y9K3+ kJ1JyccdGllawmDmQIFsjKhiVScUeZpIyuAw5U3k4i21t2biXF41iYCOVook5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726527756; a=rsa-sha256; cv=none; b=CeoZ8KbrnyoRi6wwu2CQ+bN9l54ptwWrxtoCygeJ+t23RirCC0th5qxx0SfBPrLBJ5CeOQ /F/3KmX6RVFyeLCfG1AEe42ePprHYn7dlEpkRTzANz3NIiDW7H7l8TFpl7ocNJzNx/u2/9 Q01XAZe+NU0mVYBR1U4PqmBrQsLh+h5rv18MOPl4ybqU47MgQjDZmPesKuQmMe0bFPjMOd qs6jA6Q2X/0SISojibNiBYvNT9Mu2yDxlCGfXw/EFO2d36kvZyQOb6KrJXjYQ9e4CAFduh DbcFJsLQeOeuv19uV7hbbYtyuq8UFID4vUAGrOWE5W2kT5qb3OSLwrC3gjmPaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6EbSzbd5GS5eI3c7/bR4jpLbcDfQ7diQ3UAFyfApt4c=; b=tg3Dz3yaLQv9moXNmy01sMvZB/pGO1kJuH/yr6v8Lse192yNZIPWSTsVlQeMfT9jnVqDGx RLx1mD8xdO0DF4m4EHDxvIt+1QA1+NZmaU3A048j8OPH8UgxwA3oDsnitgILJqGDxiwiK6 hyU2Wul4Db7Inz5viKXunBO88O/FZHzrD4n1Ar0V+/GY5ajfjrvrp+5NuxsVulJjl+Al5J 1JGwhHf+gWntZKvIIPaFIUJVIAG55LPxLK/MnN3DzmJaAF/mcEtR7x4jl0hutfpVHW4qCV nTG3GlbPOp5y229v8illG1+fkypbHyZzOIA6FFNUvU5vpOfzNOpM8+H/n9qgmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X70mr0NmXzDwM; Mon, 16 Sep 2024 23:02: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 48GN2ZC2043156; Mon, 16 Sep 2024 23:02:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GN2ZkU043153; Mon, 16 Sep 2024 23:02:35 GMT (envelope-from git) Date: Mon, 16 Sep 2024 23:02:35 GMT Message-Id: <202409162302.48GN2ZkU043153@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: 29a0a720c33f - main - amd64 sysarch(2): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29a0a720c33fc70601ea85f813d982a99c3e7896 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=29a0a720c33fc70601ea85f813d982a99c3e7896 commit 29a0a720c33fc70601ea85f813d982a99c3e7896 Author: Konstantin Belousov AuthorDate: 2024-09-16 19:54:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 23:02:14 +0000 amd64 sysarch(2): style Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/sys_machdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index b626925e1ea1..887c8f05b00d 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -284,7 +284,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case I386_SET_FSBASE: error = copyin(uap->parms, &i386base, sizeof(i386base)); - if (!error) { + if (error == 0) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = i386base; td->td_frame->tf_fs = _ufssel; @@ -298,7 +298,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case I386_SET_GSBASE: error = copyin(uap->parms, &i386base, sizeof(i386base)); - if (!error) { + if (error == 0) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = i386base; td->td_frame->tf_gs = _ugssel; @@ -313,7 +313,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_FSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); - if (!error) { + if (error == 0) { if (a64base < VM_MAXUSER_ADDRESS) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = a64base; @@ -331,7 +331,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_GSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); - if (!error) { + if (error == 0) { if (a64base < VM_MAXUSER_ADDRESS) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = a64base; From nobody Mon Sep 16 23:02:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X70ms5T0Jz5WLLT; Mon, 16 Sep 2024 23:02: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 4X70ms1lTQz4SBC; Mon, 16 Sep 2024 23:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a1+T2iuvM7FOXDwt5VwHYbz+dRxwsHkzWv8H14Ky6fI=; b=fD+OAP9K9Fg5zshhWaJmL2cJK/SoE9x8INaZpehz/5wqulNejIo4GFLIYVP0fVmDz3qUuJ NxDjyJSgXaIaTNubYpHQOcM//Ql2R/G/3usgaoxlIUynkb84UouEsOyjaEDZrW6Dvmh9XD yQ9tBwEXHp1li19Xvvg8o2gvHMWbWpcXkpJlOg3oqekn3S/hEzflor9YAkWxtQw1fl2Yck 1LzbnvyHxTSlIKnF2IPbyK8CLCB9vO2YWviP4pIMitlxL/13P4eONw+cIFb/gxxci1gFSv 79Xh5v10+oSIESBJIxspPFhKcTy8K6CRzPIy8Lemk1UVLS5tBL1J0I+96qu66A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726527757; a=rsa-sha256; cv=none; b=S5O7Ldwg4n3GPQVVbB/XaARQuX0ksrRmUuzN6EGgJEB+K9qglG0exnv7drDuFESm/fgiAn m7HRYpMpJfqJuQNxPT/IvIEwcRL3/oHteS43uI4hAAwrMHfX1qVZxflyX2OjL0B9O5kWAQ b1zWryrmT5Nr1kX3Yr4r8fzMx1LJH9ZDmDaLq8JVlVqruZ2/qi021+sfPdOAyU6hGJbABv FGOZ0PMkrIHtkw3EkYCWpTAJIWdSvXxQL8PiDSZ88jG3/U1mxpJRzARnr4QQZCdZDHY7tB Zh2RWdaudJJ1PKoZf2lCBTLlk1jpKgvlo1IAQMVBbwhgiLEVvJiN6+IZICFHWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726527757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a1+T2iuvM7FOXDwt5VwHYbz+dRxwsHkzWv8H14Ky6fI=; b=S2SmUr+sXtgF+zVf8MUFxjJH5cJ8AQcfqdx0C3nueDUL8kUFQyBQJmTTZUgLCuk4OgloMH NBSeqObcAC81t9eWI/7ZXeNL+eIkgLlUBxWba9AgTz0hBmw4/pmgiTj7nhrkymovUBH3eE DU8XCFDg3vWiBpgwLFYAxIjROzwdgFPt8nkhraDu7OdBItphSIlDlS32BwhiFwJHu6meEB tsF6SZCIg/98xFSNNt2KVTNUTupBtQwQWeUmfNAEva5txOcjkbxIxBEq6fKumhxH4t9YXQ 3jIRaUdiKgIqlZMQikjds0glq8xxkbY6w2A4+M3zd34DkCfGbAQkqgostbDd9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X70ms1Mh7zDvM; Mon, 16 Sep 2024 23:02: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 48GN2baw043204; Mon, 16 Sep 2024 23:02:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GN2bZE043201; Mon, 16 Sep 2024 23:02:37 GMT (envelope-from git) Date: Mon, 16 Sep 2024 23:02:37 GMT Message-Id: <202409162302.48GN2bZE043201@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: 666303f59808 - main - sysarch: improve checks for max user address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 666303f5980896346c455bc949e49952220d02b7 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=666303f5980896346c455bc949e49952220d02b7 commit 666303f5980896346c455bc949e49952220d02b7 Author: Konstantin Belousov AuthorDate: 2024-09-16 19:55:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-16 23:02:14 +0000 sysarch: improve checks for max user address making LA48 processes have the same limit as with the pre-LA57 kernels. Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/sys_machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 887c8f05b00d..c8bddb0acb19 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -314,7 +315,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_FSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (error == 0) { - if (a64base < VM_MAXUSER_ADDRESS) { + if (a64base < curproc->p_sysent->sv_maxuser) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = a64base; td->td_frame->tf_fs = _ufssel; @@ -332,7 +333,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_GSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (error == 0) { - if (a64base < VM_MAXUSER_ADDRESS) { + if (a64base < curproc->p_sysent->sv_maxuser) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = a64base; td->td_frame->tf_gs = _ugssel; From nobody Tue Sep 17 13:57:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7Nd12Yd0z59THb; Tue, 17 Sep 2024 13:57: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 4X7Nd124Lkz4g6Z; Tue, 17 Sep 2024 13:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726581429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YyB15FidvKNnhy10GT5IIyuInVshpMzeOyi3C/dIMxA=; b=N+dwljbvnQi5SEfYmUXD6IZCaaAw4yvLOyr5SJETCc1yF5sR3ZhdMVrpxexyRd4PzS8D7O 9yAh1t2b/JMx4EMhjgEdNR60fI9RMSRrHVD2B79qmrl2T7xrbZ2cJbTOWynhWEDEXp2yZw PUr361B5A0gqnLilV0cUhieTWoirhOnmLo292DuQ+tW1Vyi97nTc9jav0N4+gESZbTHtUX 8Jcq5PSfyM6qJ/R+Lxhajyc5mhm6gQhghZhOetR39zAf2GGlLxTftzec7a4jYVVjAOz3+i DRyxdFkcJaOwSNdP6i4qN/RSCirXdT1bthasNFe8QCBlJSLSDbfCctI0PoVWFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726581429; a=rsa-sha256; cv=none; b=wdVR1J9cDiYwT2JBFyLftJNCWK5QgMsCDnsbsjds1jPk8tPuKt5P67Ja+L9UAg44QvhGum OIgAs2LxNMXANaKdIsBSGp9LsHlchHMtuHETWqtbeYCWmJGXsIqImaZCJsRjGHURwP9Lnz V1SfRouTobkJX2p+fHJqSn/Ak/aTGgrTIuz+S+Ou9hbUAysFOVxpBR11GlXDRBiN/SKxSX gsVj/pTp3fYiEXhGNGncosGPUt9mI0ORkdseVI1ZKc4wCAbt52hakS9qx/4T6DgYUwu5dx M4KGBAy4SVmJum0reIJkDvycbb5Wg/3uHyr95QzCCoSaz9cvCQVCVKtHXqTysQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726581429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YyB15FidvKNnhy10GT5IIyuInVshpMzeOyi3C/dIMxA=; b=d7k7XuIsmCvgPb2zS4Cgd/UlqSx5VC06t4MOMitQtUZHVRuqXRdK/KQ1+ixRySAbpG2iRA 3zHbX4+IEyNa3WI71USGiHv+a09Tp7LX2h0EZ6O0nYo1jjxvB4sp+FPgnJ2mlUS0IWL4HW iq+wPaWA3DzL6ttRzOZr4ymUTwxJGj2PHPi1zo2Pp16SdJwx3VvmxndneKP8ztWTamvo/+ FQ5dPO33nOJTSw/ZGX5sFX6K9WxpKuB28TyyIcMrSt9udgGEhgwqIabRtzihOWctmvZtqs 11FlHGUcoDFPk5TBymq101NPh3Q3ThEAXK4DtVavPIqDQwYH9//lDFlKOaEP/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 4X7Nd11gjlzhDj; Tue, 17 Sep 2024 13:57: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 48HDv9Ka059548; Tue, 17 Sep 2024 13:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48HDv9VU059545; Tue, 17 Sep 2024 13:57:09 GMT (envelope-from git) Date: Tue, 17 Sep 2024 13:57:09 GMT Message-Id: <202409171357.48HDv9VU059545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: b6c137de0af1 - main - tcp cc: re-organize newreno functions into parts that can be re-used List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6c137de0af1a2bbd4c73bbc9cd96325268f3b0e Auto-Submitted: auto-generated The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=b6c137de0af1a2bbd4c73bbc9cd96325268f3b0e commit b6c137de0af1a2bbd4c73bbc9cd96325268f3b0e Author: Cheng Cui AuthorDate: 2024-09-17 13:44:37 +0000 Commit: Cheng Cui CommitDate: 2024-09-17 13:54:17 +0000 tcp cc: re-organize newreno functions into parts that can be re-used Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D46046 --- sys/netinet/cc/cc.c | 188 ++++++++++++++++++++++++++++++++-------------------- sys/netinet/cc/cc.h | 3 + 2 files changed, 118 insertions(+), 73 deletions(-) diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index 16d27a868bd3..c628be250abf 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -449,15 +449,14 @@ newreno_cc_after_idle(struct cc_var *ccv) } /* - * Perform any necessary tasks before we enter congestion recovery. - */ -void -newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) + * Get a new congestion window size on a multiplicative decrease event. + * */ +u_int +newreno_cc_cwnd_on_multiplicative_decrease(struct cc_var *ccv, uint32_t mss) { - uint32_t cwin, factor, mss, pipe; + uint32_t cwin, factor; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->tp); /* * Other TCP congestion controls use newreno_cong_signal(), but * with their own private cc_data. Make sure the cc_data is used @@ -465,12 +464,24 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) */ factor = V_newreno_beta; + return max(((uint64_t)cwin * (uint64_t)factor) / (100ULL * (uint64_t)mss), 2) * mss; +} + +/* + * Perform any necessary tasks before we enter congestion recovery. + */ +void +newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) +{ + uint32_t cwin, mss, pipe; + + mss = tcp_fixed_maxseg(ccv->tp); + /* Catch algos which mistakenly leak private signal types. */ KASSERT((type & CC_SIGPRIVMASK) == 0, ("%s: congestion signal type 0x%08x is private\n", __func__, type)); - cwin = max(((uint64_t)cwin * (uint64_t)factor) / (100ULL * (uint64_t)mss), - 2) * mss; + cwin = newreno_cc_cwnd_on_multiplicative_decrease(ccv, mss); switch (type) { case CC_NDUPACK: @@ -506,78 +517,109 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) } } -void -newreno_cc_ack_received(struct cc_var *ccv, ccsignal_t type) +u_int +newreno_cc_cwnd_in_cong_avoid(struct cc_var *ccv) { - if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && - (ccv->flags & CCF_CWND_LIMITED)) { - u_int cw = CCV(ccv, snd_cwnd); - u_int incr = CCV(ccv, t_maxseg); + u_int cw = CCV(ccv, snd_cwnd); + u_int incr = CCV(ccv, t_maxseg); + + KASSERT(cw > CCV(ccv, snd_ssthresh), + ("congestion control state not in congestion avoidance\n")); + /* + * Regular in-order ACK, open the congestion window. + * The congestion control state we're in is congestion avoidance. + * + * Check if ABC (RFC 3465) is enabled. + * cong avoid: cwnd > ssthresh + * + * cong avoid and ABC (RFC 3465): + * Grow cwnd linearly by maxseg per RTT for each + * cwnd worth of ACKed data. + * + * cong avoid without ABC (RFC 5681): + * Grow cwnd linearly by approximately maxseg per RTT using + * maxseg^2 / cwnd per ACK as the increment. + * If cwnd > maxseg^2, fix the cwnd increment at 1 byte to + * avoid capping cwnd. + */ + if (V_tcp_do_rfc3465) { + if (ccv->flags & CCF_ABC_SENTAWND) + ccv->flags &= ~CCF_ABC_SENTAWND; + else + incr = 0; + } else + incr = max((incr * incr / cw), 1); + /* ABC is on by default, so incr equals 0 frequently. */ + if (incr > 0) + return min(cw + incr, TCP_MAXWIN << CCV(ccv, snd_scale)); + else + return cw; +} + +u_int +newreno_cc_cwnd_in_slow_start(struct cc_var *ccv) +{ + u_int cw = CCV(ccv, snd_cwnd); + u_int incr = CCV(ccv, t_maxseg); + + KASSERT(cw <= CCV(ccv, snd_ssthresh), + ("congestion control state not in slow start\n")); + + /* + * Regular in-order ACK, open the congestion window. + * The congestion control state we're in is slow start. + * + * slow start: cwnd <= ssthresh + * + * slow start and ABC (RFC 3465): + * Grow cwnd exponentially by the amount of data + * ACKed capping the max increment per ACK to + * (abc_l_var * maxseg) bytes. + * + * slow start without ABC (RFC 5681): + * Grow cwnd exponentially by maxseg per ACK. + */ + if (V_tcp_do_rfc3465) { /* - * Regular in-order ACK, open the congestion window. - * Method depends on which congestion control state we're - * in (slow start or cong avoid) and if ABC (RFC 3465) is - * enabled. - * - * slow start: cwnd <= ssthresh - * cong avoid: cwnd > ssthresh - * - * slow start and ABC (RFC 3465): - * Grow cwnd exponentially by the amount of data - * ACKed capping the max increment per ACK to - * (abc_l_var * maxseg) bytes. - * - * slow start without ABC (RFC 5681): - * Grow cwnd exponentially by maxseg per ACK. - * - * cong avoid and ABC (RFC 3465): - * Grow cwnd linearly by maxseg per RTT for each - * cwnd worth of ACKed data. + * In slow-start with ABC enabled and no RTO in sight? + * (Must not use abc_l_var > 1 if slow starting after + * an RTO. On RTO, snd_nxt = snd_una, so the + * snd_nxt == snd_max check is sufficient to + * handle this). * - * cong avoid without ABC (RFC 5681): - * Grow cwnd linearly by approximately maxseg per RTT using - * maxseg^2 / cwnd per ACK as the increment. - * If cwnd > maxseg^2, fix the cwnd increment at 1 byte to - * avoid capping cwnd. + * XXXLAS: Find a way to signal SS after RTO that + * doesn't rely on tcpcb vars. */ - if (cw > CCV(ccv, snd_ssthresh)) { - if (V_tcp_do_rfc3465) { - if (ccv->flags & CCF_ABC_SENTAWND) - ccv->flags &= ~CCF_ABC_SENTAWND; - else - incr = 0; - } else - incr = max((incr * incr / cw), 1); - } else if (V_tcp_do_rfc3465) { - /* - * In slow-start with ABC enabled and no RTO in sight? - * (Must not use abc_l_var > 1 if slow starting after - * an RTO. On RTO, snd_nxt = snd_una, so the - * snd_nxt == snd_max check is sufficient to - * handle this). - * - * XXXLAS: Find a way to signal SS after RTO that - * doesn't rely on tcpcb vars. - */ - uint16_t abc_val; - - if (ccv->flags & CCF_USE_LOCAL_ABC) - abc_val = ccv->labc; - else - abc_val = V_tcp_abc_l_var; - if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) - incr = min(ccv->bytes_this_ack, - ccv->nsegs * abc_val * - CCV(ccv, t_maxseg)); - else - incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); + uint16_t abc_val; + if (ccv->flags & CCF_USE_LOCAL_ABC) + abc_val = ccv->labc; + else + abc_val = V_tcp_abc_l_var; + if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) + incr = min(ccv->bytes_this_ack, + ccv->nsegs * abc_val * CCV(ccv, t_maxseg)); + else + incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); + } + /* ABC is on by default, so incr equals 0 frequently. */ + if (incr > 0) + return min(cw + incr, TCP_MAXWIN << CCV(ccv, snd_scale)); + else + return cw; +} + +void +newreno_cc_ack_received(struct cc_var *ccv, ccsignal_t type) +{ + if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && + (ccv->flags & CCF_CWND_LIMITED)) { + if (CCV(ccv, snd_cwnd) > CCV(ccv, snd_ssthresh)) { + CCV(ccv, snd_cwnd) = newreno_cc_cwnd_in_cong_avoid(ccv); + } else { + CCV(ccv, snd_cwnd) = newreno_cc_cwnd_in_slow_start(ccv); } - /* ABC is on by default, so incr equals 0 frequently. */ - if (incr > 0) - CCV(ccv, snd_cwnd) = min(cw + incr, - TCP_MAXWIN << CCV(ccv, snd_scale)); } } diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index d78c61bde2fe..890bea69a14b 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -231,6 +231,9 @@ void newreno_cc_post_recovery(struct cc_var *); void newreno_cc_after_idle(struct cc_var *); void newreno_cc_cong_signal(struct cc_var *, ccsignal_t); void newreno_cc_ack_received(struct cc_var *, ccsignal_t); +u_int newreno_cc_cwnd_on_multiplicative_decrease(struct cc_var *ccv, uint32_t mss); +u_int newreno_cc_cwnd_in_cong_avoid(struct cc_var *ccv); +u_int newreno_cc_cwnd_in_slow_start(struct cc_var *ccv); /* Called to temporarily keep an algo from going away during change */ void cc_refer(struct cc_algo *algo); From nobody Tue Sep 17 14:37:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7PWv307zz5R8MX; Tue, 17 Sep 2024 14:37: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 4X7PWv2JGYz4mV9; Tue, 17 Sep 2024 14:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726583867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4I1VkdGXeQ8TvAIvrr7f/462X1QYa2fk+cVgAHBimhU=; b=s2OcvLM6246EaVJkaOgVJxIqQJtDkg3K/NtO4FG9nn5OyPjuPCZIAwUZyJ6pAazuK+pJ9t 0V6uGaOlR3cmroTVc8gh+fiHI+UM/q3NHJ4jjblnyz6HZA+7uAAaM8QGMcF/iF7SNkiHid /LGtjYvakmyvoLv1Gb/14eXcEhA9UsIdOJRhWTSvpbrix2XO3FSaAcNrOMBhx4GYMq8d06 s1JHZ6ZmfayK8OFdHzj6EwxPo0nVvxnCkrQ0jJecmMBP5aVsaTM17BMD6LuD7UD3kWJfeF fr35wHkgyWZ8nDLFUlA8B/mMDyf+TcUgVKbmEe/ToBsGgWmr/2U4ooPjcbLB7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726583867; a=rsa-sha256; cv=none; b=doXbCJINSy/EytkTDkFx8yFdPDbqL2qRXeSC6JjKyw4smA5KJSms/s1t1kDIFI1rhwJS+2 PVij5X+TPZVL+T/nHXyoEnOV+5mb/T/HXdRNT/9zTXUKO7nMIRDjZ4UiVsP7AIUf2cxTCs 7lukwAaBMPAwevpEW/e8TlNH9YS/uad7QNdOfMZ01gX2Jk2wwVAf90MD+JOm3b1JEvFym+ Fp0lrL8j2DYwT9+PLn9e4PBAKPqZbPsF7fFUNvHjW1NkMMZXdsPW8RLDVs1uvkaKU/Wg6g MBcJnQd2JhikS5atpLtMbkBGD1nFb/zOLGdRohF66XvzGldt2DOiyz8Wtmm7bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726583867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4I1VkdGXeQ8TvAIvrr7f/462X1QYa2fk+cVgAHBimhU=; b=fQmrLZwzS2bCQyc9rPv2Qoi5kfrplGEjsMkT/7bepw3s6hKU8S72yiLylEjvwXgq6SCrov p2vkp3AlCshbvlVeoTLT5L+2Xbxp2xWnXV7Hh1wa9w85vRycn9yo9ZLVoTd8PONcyZdOkI OHKnSbQjxBVW9SQ3qP3b0RzDP1TdD6lSCj6t61fBaFEeXKN0qmZU3FDp3xjIEkNrgzj0g2 wExWOkToIUDkS0eHvA73gbBUOdlgOzUarbnnRZEptF36bMCOlI70x+ZmVAnHFPqkQ/XBFI id66dnUtoJZtcBiPhH7P1QOSnO+LBqIvRoyAeAmKobV9FX51j7qq6bzKnMt+UA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7PWv1wRHzj1C; Tue, 17 Sep 2024 14:37: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 48HEbljL028736; Tue, 17 Sep 2024 14:37:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48HEbl8c028733; Tue, 17 Sep 2024 14:37:47 GMT (envelope-from git) Date: Tue, 17 Sep 2024 14:37:47 GMT Message-Id: <202409171437.48HEbl8c028733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: ee4506105171 - main - cc_cubic: use newreno to emulate AIMD in TCP-friendly region List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee45061051715be4704ba22d2fcd1c373e29079d Auto-Submitted: auto-generated The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=ee45061051715be4704ba22d2fcd1c373e29079d commit ee45061051715be4704ba22d2fcd1c373e29079d Author: Cheng Cui AuthorDate: 2024-09-05 18:52:57 +0000 Commit: Cheng Cui CommitDate: 2024-09-17 14:37:00 +0000 cc_cubic: use newreno to emulate AIMD in TCP-friendly region Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D46546 --- sys/netinet/cc/cc_cubic.c | 44 ++++++++++++++++++++++---------------------- sys/netinet/cc/cc_cubic.h | 18 +++++------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index 45f75efe5ae7..c4b44d5c3660 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -288,31 +288,26 @@ cubic_ack_received(struct cc_var *ccv, ccsignal_t type) usecs_since_epoch = INT_MAX; cubic_data->t_epoch = ticks - INT_MAX; } + + W_est = tf_cwnd(ccv); + /* * The mean RTT is used to best reflect the equations in - * the I-D. Using min_rtt in the tf_cwnd calculation - * causes W_est to grow much faster than it should if the - * RTT is dominated by network buffering rather than - * propagation delay. + * the I-D. */ - W_est = tf_cwnd(usecs_since_epoch, cubic_data->mean_rtt_usecs, - cubic_data->W_max, CCV(ccv, t_maxseg)); - W_cubic = cubic_cwnd(usecs_since_epoch + cubic_data->mean_rtt_usecs, cubic_data->W_max, CCV(ccv, t_maxseg), cubic_data->K); - ccv->flags &= ~CCF_ABC_SENTAWND; - if (W_cubic < W_est) { /* * TCP-friendly region, follow tf * cwnd growth. */ - if (CCV(ccv, snd_cwnd) < W_est) - CCV(ccv, snd_cwnd) = ulmin(W_est, INT_MAX); + CCV(ccv, snd_cwnd) = ulmin(W_est, INT_MAX); + cubic_data->flags |= CUBICFLAG_IN_TF; } else if (CCV(ccv, snd_cwnd) < W_cubic) { /* * Concave or convex region, follow CUBIC @@ -320,6 +315,7 @@ cubic_ack_received(struct cc_var *ccv, ccsignal_t type) * Only update snd_cwnd, if it doesn't shrink. */ CCV(ccv, snd_cwnd) = ulmin(W_cubic, INT_MAX); + cubic_data->flags &= ~CUBICFLAG_IN_TF; } /* @@ -644,19 +640,23 @@ cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg) cubic_data->undo_W_max = cubic_data->W_max; cubic_data->W_max = cwnd; - /* - * On the first congestion event, set ssthresh to cwnd * 0.5 - * and reduce W_max to cwnd * beta. This aligns the cubic concave - * region appropriately. On subsequent congestion events, set - * ssthresh to cwnd * beta. - */ - if ((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) { + if (cubic_data->flags & CUBICFLAG_IN_TF) { + /* If in the TCP friendly region, follow what newreno does */ + ssthresh = newreno_cc_cwnd_on_multiplicative_decrease(ccv, maxseg); + + } else if ((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) { + /* + * On the first congestion event, set ssthresh to cwnd * 0.5 + * and reduce W_max to cwnd * beta. This aligns the cubic + * concave region appropriately. + */ ssthresh = cwnd >> 1; - cubic_data->W_max = ((uint64_t)cwnd * - CUBIC_BETA) >> CUBIC_SHIFT; + cubic_data->W_max = ((uint64_t)cwnd * CUBIC_BETA) >> CUBIC_SHIFT; } else { - ssthresh = ((uint64_t)cwnd * - CUBIC_BETA) >> CUBIC_SHIFT; + /* + * On subsequent congestion events, set ssthresh to cwnd * beta. + */ + ssthresh = ((uint64_t)cwnd * CUBIC_BETA) >> CUBIC_SHIFT; } CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * maxseg); } diff --git a/sys/netinet/cc/cc_cubic.h b/sys/netinet/cc/cc_cubic.h index 592703906d1a..b4773618e6f8 100644 --- a/sys/netinet/cc/cc_cubic.h +++ b/sys/netinet/cc/cc_cubic.h @@ -83,6 +83,7 @@ #define CUBICFLAG_RTO_EVENT 0x00000008 /* RTO experienced */ #define CUBICFLAG_HYSTART_ENABLED 0x00000010 /* Hystart++ is enabled */ #define CUBICFLAG_HYSTART_IN_CSS 0x00000020 /* We are in Hystart++ CSS */ +#define CUBICFLAG_IN_TF 0x00000040 /* We are in TCP friendly region */ /* Kernel only bits */ #ifdef _KERNEL @@ -286,22 +287,13 @@ reno_cwnd(int usecs_since_epoch, int rtt_usecs, unsigned long wmax, } /* - * Compute an approximation of the "TCP friendly" cwnd some number of usecs - * after a congestion event that is designed to yield the same average cwnd as - * NewReno while using CUBIC's beta of 0.7. RTT should be the average RTT - * estimate for the path measured over the previous congestion epoch and wmax is - * the value of cwnd at the last congestion event. + * Compute the "TCP friendly" cwnd by newreno in congestion avoidance state. */ static __inline unsigned long -tf_cwnd(int usecs_since_epoch, int rtt_usecs, unsigned long wmax, - uint32_t smss) +tf_cwnd(struct cc_var *ccv) { - - /* Equation 4 of I-D. */ - return (((wmax * CUBIC_BETA) + - (((THREE_X_PT3 * (unsigned long)usecs_since_epoch * - (unsigned long)smss) << CUBIC_SHIFT) / (TWO_SUB_PT3 * rtt_usecs))) - >> CUBIC_SHIFT); + /* newreno is "TCP friendly" */ + return newreno_cc_cwnd_in_cong_avoid(ccv); } #endif /* _NETINET_CC_CUBIC_H_ */ From nobody Tue Sep 17 15:41:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7Qxx6j43z5RHlw; Tue, 17 Sep 2024 15:41:57 +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 4X7Qxx28gJz4sgM; Tue, 17 Sep 2024 15:41:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id qYQwsfDlC9TOUqaKys6ja0; Tue, 17 Sep 2024 15:41:56 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id qaKwsramuKHV8qaKxs863g; Tue, 17 Sep 2024 15:41:56 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=66e9a344 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=Pdw83E70McimEklNttYA:9 a=CjuIK1q_8ugA:10 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 478A2AD; Tue, 17 Sep 2024 08:41:54 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 36CCD201; Tue, 17 Sep 2024 08:41:54 -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: Cheng Cui cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ee4506105171 - main - cc_cubic: use newreno to emulate AIMD in TCP-friendly region In-reply-to: <202409171437.48HEbl8c028733@gitrepo.freebsd.org> References: <202409171437.48HEbl8c028733@gitrepo.freebsd.org> Comments: In-reply-to Cheng Cui message dated "Tue, 17 Sep 2024 14:37:47 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 17 Sep 2024 08:41:54 -0700 Message-Id: <20240917154154.36CCD201@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCSdm7tH5tUGIBG7yDdvh6X1FNEZfxLtplLvQ1WVBVAMIi2EEEwjnFqANqr4HPHWzpdsQU4UfEgYLuZL/5ggEncZwQosoXrbKVgcpQNDJkoWs9THl1n0 fTaHTnAJm9VkgTevNUs1WYIopZ/Xxd/5GFB+XjK1bo2brkEU7PPIRX5lqjqgRp4P+GP25VKS1E3BfJGTDvWabgDA7G0agX/b6NiS2xaz/g+Y7coq/MV3gQ9r 0bcOMdMhqIWDtWwImaOEblbP4FGeLPems5PZPXUGzSa+MdvmN6tV0UxxUbau0f4ard9EVXMEo8SQWsqPixkqfb5d/YjCr2qQTUuMDNsJTGk= 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: 4X7Qxx28gJz4sgM In message <202409171437.48HEbl8c028733@gitrepo.freebsd.org>, Cheng Cui writes: > The branch main has been updated by cc: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ee45061051715be4704ba22d2fcd1c37 > 3e29079d > > commit ee45061051715be4704ba22d2fcd1c373e29079d > Author: Cheng Cui > AuthorDate: 2024-09-05 18:52:57 +0000 > Commit: Cheng Cui > CommitDate: 2024-09-17 14:37:00 +0000 > > cc_cubic: use newreno to emulate AIMD in TCP-friendly region > > Reviewed by: rscheff, tuexen > Differential Revision: https://reviews.freebsd.org/D46546 The description listed in the phabricator review provided an excellent summary of why and what was being changed. Can we cut & paste these descriptions into the commit log too? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Sep 18 02:11:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7hwX1rx9z5WjYy; Wed, 18 Sep 2024 02:11:40 +0000 (UTC) (envelope-from zlei@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 4X7hwX1HFpz4kWk; Wed, 18 Sep 2024 02:11:40 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726625500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fSOmCQ0K29Fl5siT0cX6Qcne0nSogxgFF/8b1CD0nbE=; b=JXHHJAIdyOotDeNd/CSiucB7tDg1Mujvmmmzh/V0XsWXd6ulEhbUzudeEc6/Pf0t5u7yNw 4bRqyxihhdR6f7LNiW2ojSX83I2Ea2f9SROgp3w/3GGNFPP9zeoH04E5ufx6xy+6gEs/JZ pGTIs1bOgCpaxEZKjdlHt+AbKRheZ5WJRlkn1RS0XCrh2L1v6iLuGA22L6c6zpFa5dv7I1 Ap+5pyUn1XVyQPQmW53HQG1k9uV3Yyfr39TcCqb/f6AQLmj2gWWrWIdUoJ8InCOFHxOhSP 7votIgLA8AKbSxzLkmb0ievLJbI35WhO2n5beAG61egOidIjZ5q5T549wTlBzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726625500; a=rsa-sha256; cv=none; b=fijXmVoSdcVFJZIDDIYa1vFrUsO1bda3pe2jvRic5fsltIW3ltbkoa7uqo3G6wVts+QDUy +PgI7h9bBUq5EKbqPSNORmGkJATgWTqkwNS3fYgevkuikiXN6NzNuXQ5rqg/JofA2/oYTr ALDF0qcufnvMwjkoBeBULXABnHBWnSJizsSXD9pzp5IQpecwZn1uDLHTib7yuhi4XR/I4u vuKWk1RVef8kg+g4dOqKwYZKFrPzN231EBgK7iUJ9llS3XEcKBNK8AUPiIR93oPwnZ4hNv BoCbMw8yLODC6OeCSSrwoc0DFs3CUamV9vitZZY/8l35ho0a6T3EZ3o+4Po9Gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726625500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fSOmCQ0K29Fl5siT0cX6Qcne0nSogxgFF/8b1CD0nbE=; b=ewc8mcztFIRaKWYlXZlx9Dj8Bz+4kJL253pEnI5JCFYQh9D4Wrtja9S1NohOnjSXuXh/j8 VM1JdOFDrGUom/VP95zIYDyFyh5dlSiP6DdamF7tiIzf2coggvov927zmGGjgHI5j51DYX f5/1/0I43dt0z4G1HKnyriNUt5n35WbhH0Rwf5rujpg+YRKtNf5H6Ckjp5tHd4f4mYQiqC 0uc2iJ1Zngpb5DLL6DjjcEcGyYDfk/f4cGkBo8piUsGxuquklcKbPSVtT9I8bri/0Vy9yt pUAafUdbO/EXq3UwFWOd83hH1AlhIhui1FR+sLwBFnoBv+Z2wd5zzvM+hQ4GQQ== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X7hwT6KHzz1GBg; Wed, 18 Sep 2024 02:11:37 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_79EAB0C4-F8B4-437F-9750-E2B34C97925D" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: ee4506105171 - main - cc_cubic: use newreno to emulate AIMD in TCP-friendly region Date: Wed, 18 Sep 2024 10:11:32 +0800 In-Reply-To: <20240917154154.36CCD201@slippy.cwsent.com> Cc: Cheng Cui , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Cy Schubert References: <202409171437.48HEbl8c028733@gitrepo.freebsd.org> <20240917154154.36CCD201@slippy.cwsent.com> X-Mailer: Apple Mail (2.3696.120.41.1.10) --Apple-Mail=_79EAB0C4-F8B4-437F-9750-E2B34C97925D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Sep 17, 2024, at 11:41 PM, Cy Schubert = wrote: >=20 > In message <202409171437.48HEbl8c028733@gitrepo.freebsd.org = >, Cheng Cui=20 > writes: >> The branch main has been updated by cc: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dee45061051715be4704ba22d2fcd1c37= >> 3e29079d >>=20 >> commit ee45061051715be4704ba22d2fcd1c373e29079d >> Author: Cheng Cui >> AuthorDate: 2024-09-05 18:52:57 +0000 >> Commit: Cheng Cui >> CommitDate: 2024-09-17 14:37:00 +0000 >>=20 >> cc_cubic: use newreno to emulate AIMD in TCP-friendly region >>=20 >> Reviewed by: rscheff, tuexen >> Differential Revision: https://reviews.freebsd.org/D46546 >=20 > The description listed in the phabricator review provided an excellent=20= > summary of why and what was being changed. Can we cut & paste these=20 > descriptions into the commit log too? +1 for that. >=20 >=20 > --=20 > Cheers, > Cy Schubert > > FreeBSD UNIX: > Web: = https://FreeBSD.org > NTP: > Web: = https://nwtime.org >=20 > e^(i*pi)+1=3D0 --Apple-Mail=_79EAB0C4-F8B4-437F-9750-E2B34C97925D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Sep 17, 2024, at 11:41 PM, Cy Schubert <Cy.Schubert@cschubert.com> wrote:

In message <202409171437.48HEbl8c028733@gitrepo.freebsd.org>, Cheng = Cui 
writes:
The branch main has been updated by = cc:

URL: https://cgit.FreeBSD.org/src/commit/?id=3Dee45061051715be4704ba= 22d2fcd1c37
3e29079d

commit= ee45061051715be4704ba22d2fcd1c373e29079d
Author: =     Cheng Cui <cc@FreeBSD.org>
AuthorDate: 2024-09-05 = 18:52:57 +0000
Commit:     Cheng Cui = <cc@FreeBSD.org>CommitDate: 2024-09-17 14:37:00 +0000

   cc_cubic: use newreno to emulate AIMD in = TCP-friendly region

   Reviewed by: rscheff, tuexen
   Differential Revision: https://reviews.freebsd.org/D46546

The description listed in the phabricator review provided an = excellent 
summary of = why and what was being changed. Can we cut & paste these 
descriptions = into the commit log too?

+1 for that.



-- Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org> =   Web:  https://FreeBSD.org
NTP: =           <cy@nwtime.org> =    Web:  https://nwtime.org

= e^(i*pi)+1=3D0



= --Apple-Mail=_79EAB0C4-F8B4-437F-9750-E2B34C97925D-- From nobody Wed Sep 18 02:34:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7jQP0bTBz5Wn7H; Wed, 18 Sep 2024 02:34: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 4X7jQN6JGxz4mkS; Wed, 18 Sep 2024 02:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726626844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ypYR771GD/V8hsJgNKqDFgkyu0XZFqM3wjrV0slyZuM=; b=J8lrLE+2o6gU0Wxugk4raynUMFK02sqOjd+GOpVgtgZ3d6gprbzzNaiNpwerkIqjlxoq2g qKGT8yb77Nh4rEWrzti1BoaJyq1FoLF/BsTb2zIjO0mQzMgQV6N5D3CnaYFzvVRNcI2sHv 1iPm/WhSoP4ne96NqjUBlsrwgoJ5SOU59AsoVVVN5Ri0WqeLpkr0eapCwMjmv0VEI23IKb b2E3pR+T7WJtAX/TzFB5Zo+Js8/oD2bnfudo+nqclASHlFHzx5jCgvBGvgsaNqkZ7iNawq 5s8AH6DYv0Y0p0n32PLnSJirjk5ERUCNPouEYfEDM2q4nf/4+PGXpWLuvfAKuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726626844; a=rsa-sha256; cv=none; b=IbB81cfLUI53JEqHwGIioeaKKWAKFn63Mt1xfYizASwsPQkQewmw+aVQgiLIexnr3q2jr9 zVY/MJT45i3K092myVSfh9JFAx2ykGgORCeE41NgNorikTXCMKFSU5spqYJJNgNYzUQLCi sKyFB0IO9J+0MWSRSOSDWnKZZ8lxbV68mMXkux5stPKkoQL3lS99cm6PalfpVhUCcqx8d3 Ao2CUK8zNB83WHkbkHstMILmN071v1NV5Ffefp/a5xtqYxVjYGk5QEa7DdM5Yzc6unA0TQ +B3B/XlvzfGOYyNAvIymTLdR/kG3T/a3OtOaDk0MySKWZ73CuGP8e4lQvU24Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726626844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ypYR771GD/V8hsJgNKqDFgkyu0XZFqM3wjrV0slyZuM=; b=mtGx4v7Acke/NcPRnWHUPt3oXPbv3EnKLMQZJUlSfSrNjidHIoIZxtMh9lhA5SLq5SFxH8 8aXApDXfDiSi8xYNy1mIYZE/F9nIz54E2aOYluMqwHrl0D5qf5gHJNTbEzgyUwh+N8DLsB 85m/d2bvMwAOLu7kguGRsvFNU9JRNNRTWmrZxLHJqn77aZ8tsRW8e4kZqvgvApwv8Ng8vx 9UmnJkLqD06fVN3rYG4hgLObz794Uptm/3kYfcfXY5+G9phi4NHQiO/R4xmhqq+3cNbzSm FBx2dfQ+YhG6JJ0DUhbSqvX41fJYyyMdmGHdMfTThkKaty4z2HxojF607zljxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7jQN5vhbz13hH; Wed, 18 Sep 2024 02:34: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 48I2Y4KI050094; Wed, 18 Sep 2024 02:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I2Y4n0050091; Wed, 18 Sep 2024 02:34:04 GMT (envelope-from git) Date: Wed, 18 Sep 2024 02:34:04 GMT Message-Id: <202409180234.48I2Y4n0050091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 3e614fb600f2 - main - e1000: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e614fb600f233097ee5e007cbffdb3001aa110b Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=3e614fb600f233097ee5e007cbffdb3001aa110b commit 3e614fb600f233097ee5e007cbffdb3001aa110b Author: Gordon Bergling AuthorDate: 2024-09-18 02:32:41 +0000 Commit: Gordon Bergling CommitDate: 2024-09-18 02:32:41 +0000 e1000: Fix a typo in a source code comment - s/chekcsums/checksums/ MFC after: 3 days --- sys/dev/e1000/e1000_82575.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index fded5dc2b04e..a33aa9eb2903 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -2425,7 +2425,7 @@ static s32 e1000_validate_nvm_checksum_82580(struct e1000_hw *hw) } if (nvm_data & NVM_COMPATIBILITY_BIT_MASK) { - /* if chekcsums compatibility bit is set validate checksums + /* if checksums compatibility bit is set validate checksums * for all 4 ports. */ eeprom_regions_count = 4; } From nobody Wed Sep 18 06:01:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7p1H047nz5VwKT for ; Wed, 18 Sep 2024 06:01: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 4X7p1G6mLmz49Rs; Wed, 18 Sep 2024 06:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726639266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXAVqP1x9OLY62sHtdKpsfEHXYB0MaDJxrmEtEG9Mfk=; b=Kp+TEdxxGy3R5ZUC0sWomTzdcjWqVdRNgrUkRHlN9/aa5NAPgnzP6AfCzOPV4JQh0Bvmpd D9yfQoJg+Pc3bo1YkA+N8fpq4LspiDYPgXF9NzZsB4T77L65N4nZqBTia0cYOvVmHg0ugY fHD6ogqeLFSBY4107b60zY1vkDhS5KgtdGItJmcsqjlNAn5lgM8HsdPRDbmPZE3pFn5FAE o0oX+i9w0Qm/LZq4SQHJw00DKNPNp5y6mzuD2y/gVrkGzFLBgIYUgtG9loOlcqFTq0plMh y7QflxNdkIJdU0hXiFBbJdsW3yY0Ytaw7EwbyxHPPcODlxw0voD1kT36WUvx1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726639266; a=rsa-sha256; cv=none; b=GfCK5r9SOprEbbfy2dOBRrd6vjj2QqOAh8govK1bno+9cRwGnDpsgcUgdA9Zu+wGk4oioM QQcWOEox0NGW/29s5Zj7qI3/e7XDvD4FrCegte4pKxYlDht8VnHMl7o2ZkSTeWdXHlMKPT 4ONvNtUGxHMfMEWpJIshLOpva8ql35qj4OR3aBvdf/LtaEWCk64ynt4JOmuuqQFiXoiEL6 r4OYcc/1yiam1b63Nv+v1k5r5p7fnaFi/fXGSHDokyIt1Vid+lyHFuKa3lac/7Uo44Eqsy k6OAtFTuSgk0KjojmggDLoyw9O6SV0jJJlf1jGdk/U7cGqIHQRtwM49D8t+UFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726639266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXAVqP1x9OLY62sHtdKpsfEHXYB0MaDJxrmEtEG9Mfk=; b=dKNWJfVqqk2wkjZHUoVn1OaacBmv/3bCrn2tSWDPND/gE1GbEbrlnhIVel6hlK342Xs0CB tLGRs2f+x4PYspKad+Y9eJIB/22GjzK9UxevIu5LHGbqmCtbDg83XSSG7wvGIHHCXTLQJU DS+teAxTKqJmpbcXZx4zyFPIVT6MsMXIxQ1ErfoOEVw61CNTM669vjcNKsMJIJ3bZxN6sM dpUV01a8NVycoyQNgTVqw4tV/CQzsSdFLI4TzLRU+fUXtbRGzYyDa1VoOKsjaDzNNq8uN0 0b50nhtLJlmxHY8MvvNb+itjAmHbyX9WXp9QvQvzWV9wy73E3vr8JnSCAaRs1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7p1G64K7z18xp; Wed, 18 Sep 2024 06:01: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 48I616cv005336; Wed, 18 Sep 2024 06:01:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I616qK005335; Wed, 18 Sep 2024 06:01:06 GMT (envelope-from git) Date: Wed, 18 Sep 2024 06:01:06 GMT Message-Id: <202409180601.48I616qK005335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 1e19146fc769..c2c85f88902d - vendor/bc - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bc X-Git-Reftype: branch X-Git-Commit: c2c85f88902d18d2e9702381f1628112e15a5c3c X-Git-Oldrev: 1e19146fc7692f59e8dfc5da7957e938cd0b81b8 X-Git-Newrev: c2c85f88902d18d2e9702381f1628112e15a5c3c Auto-Submitted: auto-generated The branch vendor/bc has been updated by se: URL: https://cgit.FreeBSD.org/src/log/?id=1e19146fc769..c2c85f88902d c2c85f88902d vendor/bc: upgrade to version 7.0.2 From nobody Wed Sep 18 06:08:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7p9p5C8Yz5Vx9Z for ; Wed, 18 Sep 2024 06:08: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 4X7p9p3lfDz4BsR; Wed, 18 Sep 2024 06:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726639710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06qSGV7z0MKChP2Ql+RyIgzWut3EjqpDdt2zQuxbyC4=; b=OrJ2BCVZLTm1Bhkai9iFNAlaKl9Nqh6PBlfmAok3pHvdvYFqmMod0MQimigweoK8thusyo zEi4lXeKqmOgakxYwrhnOxZDLmtXmrFRUrpvqTOD2oSSM9ltj8IXP3hGCmtmVCzlF0aemP FXBUGsxJH+VLbZ68UfPo2dmyJihL1ZzhBBA4z6fmA4fk/J1+I+wHidEldYSajIZ2AUUrTx +Lg8GrAxCTWkrMsL28skpJfVez8cHEcWGznw8G7pu3LfdrksXfD6ocOohZiFaZUndevvvU 7Vi959iTcwXzjj01Yteapd27Bd1wJbkRKVT+Hl8XUy3N9YrzSP8ymYQGYfAvvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726639710; a=rsa-sha256; cv=none; b=cFKXBqNDyXNZQ/5opAxhn3YAvw9dsgMn3WQREpPr8kIT52Aut9FkOpacuoHXRiG2daQlDV AA0ibgQiJhmc4tv6EOalo1MHJjDgKh1rdR42P4k54zgWG/igLtDWaLdA+WRLRrUX6e/NNY gRLdKLkz3fcHxzY57EkK4ahD0qHUmeu65U926DLjkda+Tm46oBHLoOBkCiGouTeFFc7e1u OchrXKOox7C0CjhwIXGPeqEehK1bPnE2XTui/oMbnFL+jCMBl4olx8PLSCbQOvpvl4o6RB RsUVVO2AncSa0q1S/QQM2JQDGzEXDD2VpnfdiVH3t4aJDuSCbhE5so7NsflH5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726639710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06qSGV7z0MKChP2Ql+RyIgzWut3EjqpDdt2zQuxbyC4=; b=usWsdYWsdCgKkOph9lWxLqG414EhYZCU3AUqxN/yYeIP7Y6RFI0B24EcUlc0fZR/i34cvp KWqyzo7KOXn6X4hnQzu31gsygFeJ8dMaO50NDZ3A9DQQsHrpy4K/bw6qtPW1v6tWeBxLvt i3eMFL19fEfEoq9HXBT1UlEN3Sa6AvmcFFLSKGktBIt+o/DIOmWUV3FlI4ovH2fuKWsrDV wHxXE27serdJ+fc7D+vt6ZTkn0iyED1IpJzLCNwA1RdCIVvfjv4PPYAqDmsp2DnLTCGr7c rqHOb0vQh93Lhj7mLjqYVquYXe3qdWm89s0sAsRULvY5tjkJ9VbyowoqqZpeZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7p9p3M2lz19MY; Wed, 18 Sep 2024 06:08: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 48I68UO6009810; Wed, 18 Sep 2024 06:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I68U51009809; Wed, 18 Sep 2024 06:08:30 GMT (envelope-from git) Date: Wed, 18 Sep 2024 06:08:30 GMT Message-Id: <202409180608.48I68U51009809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 1eca39000753 - Create tag vendor/bc/7.0.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/tags/vendor/bc/7.0.2 X-Git-Reftype: annotated tag X-Git-Commit: 1eca39000753bb0b725146c434ab095ccfcf4934 Auto-Submitted: auto-generated The annotated tag vendor/bc/7.0.2 has been created by se: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bc/7.0.2 tag vendor/bc/7.0.2 Tagger: Stefan Eßer TaggerDate: 2024-09-18 06:00:18 +0000 Tag version 7.0.2 commit c2c85f88902d18d2e9702381f1628112e15a5c3c Author: Stefan Eßer AuthorDate: 2024-09-18 05:55:46 +0000 Commit: Stefan Eßer CommitDate: 2024-09-18 05:55:46 +0000 vendor/bc: upgrade to version 7.0.2 This update fixes exiting from an interactive bc session with ^D on FreeBSD and Linux when using editline. This bug was caused by the macOS fix for editline in version 7.0.0, which has been reverted in this version. From nobody Wed Sep 18 06:14:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7pJQ5N4jz5Vxtf; Wed, 18 Sep 2024 06:14: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 4X7pJQ4V7Mz4CNN; Wed, 18 Sep 2024 06:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726640054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4FS+kuqYAmKNx0FHXt4jyNqlE25BNRGKtS/zVmXFMc=; b=TEVmjUO1jDWtoi71UZzf6puB69fCLRyNP1FTdxsIfuwPKnP29lJqlw7knzhPwE48whiAWl DSO02K/tdIjfNoKb27T0gG/b17zVvKvU2/OEljKjtGpej2/B64ZdNpgvWSC+koUq0DdP0J W91WV5fuJY43Gnor3k4pAHvxHe6Kb1k27TJ/vPgJ7ZClCxlPCBRf0qRAAvVssowV6LZpWJ OQv/bMdRLh0MQVEg3JeGFc7X0VsqQiycM7Zs80kUkYrxc3QrjIsCGV2xe+W+z7x6+2y5fH yYPCuYW49DRDOsXYrcAcgQ27FHNQRPK/cHvtr+JRnoyhr7XXBM+taXckTpo9ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726640054; a=rsa-sha256; cv=none; b=kEnBcsXipGnpkIEZ8M3brAx2jFnAEYUNuOOqRtdZkdYR0KdimCRL13BOcp4l/MuAATuZHE QQtgjtYXFs9lODit4rWtcq+o1BraTqcLyZT7mMJUhFmsC0BvTm9wOgtehhIbnI2nfLD6Nu arsiSnPaor2kgKzsHL+AqMQ7l4YzTCdTf2pjSwrhKLRRu510S+SD3MxF0GjEUgm+LjFgg6 1/QEGWA/z/+tsmQ7nrxJBzKvqEi6SRuw4FMw3v9vYz9MuWV/RqqmGxnZsAyWp86ny79Ji5 cr0uEqTHtiai/1dvdi9b/0WnuXuc1/lRV2H9MMyuK6vUkycyHODf9MGGNfcMow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726640054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4FS+kuqYAmKNx0FHXt4jyNqlE25BNRGKtS/zVmXFMc=; b=N2B4mRKNo354pkM2XvG4p0I8P0IkWrynpE3Kf/02I6BJcInLGSVBbsrFrax4f+24ntNOBH 2YUlbnsxG3132fwvCH5i7ukbmcwlcVWyOKP5z/QaVGpRSB968Srvd1Zdcw18BsErtj3Wv4 CKNkdJdqnZsfq9FaAHZrIpCOMTo7Bmj4mgvVlpXaw3S7MvBzkjeYK3wJ22Bv0TAjjezsxC +1c4JcTnm129spbVjm7HANuyldAamNgTzE26tRmm1rdk5A6AQLClqx5/BqQVrQAVQ3Vp8Q aQclBC3vVDI6fULN31U5vF2w2ZIcTbTiCGjLMiD92WS71D77eF8wOSvNp3HeiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7pJQ2X0sz19Kb; Wed, 18 Sep 2024 06:14: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 48I6EEGn026170; Wed, 18 Sep 2024 06:14:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I6EE5G026167; Wed, 18 Sep 2024 06:14:14 GMT (envelope-from git) Date: Wed, 18 Sep 2024 06:14:14 GMT Message-Id: <202409180614.48I6EE5G026167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 9b04aee86ccd - main - vendor/bc: upgrade to version 7.0.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b04aee86ccd58a6f3c936e0cd95bb9305a69848 Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=9b04aee86ccd58a6f3c936e0cd95bb9305a69848 commit 9b04aee86ccd58a6f3c936e0cd95bb9305a69848 Author: Stefan Eßer AuthorDate: 2024-09-18 05:55:46 +0000 Commit: Stefan Eßer CommitDate: 2024-09-18 06:12:19 +0000 vendor/bc: upgrade to version 7.0.2 This update fixes exiting from an interactive bc session with ^D on FreeBSD and Linux when using editline. This bug was caused by the macOS fix for editline in version 7.0.0, which has been reverted in this version. (cherry picked from commit c2c85f88902d18d2e9702381f1628112e15a5c3c) MFC after: 3 days Reported by: mack@macktronics.com --- contrib/bc/NEWS.md | 8 ++++++++ contrib/bc/include/history.h | 24 ++++++++++++++++++++++++ contrib/bc/include/version.h | 2 +- contrib/bc/manuals/bc/A.1 | 6 +++--- contrib/bc/manuals/bc/A.1.md | 4 ++-- contrib/bc/manuals/bc/E.1 | 2 +- contrib/bc/manuals/bc/EH.1 | 2 +- contrib/bc/manuals/bc/EHN.1 | 2 +- contrib/bc/manuals/bc/EN.1 | 2 +- contrib/bc/manuals/bc/H.1 | 6 +++--- contrib/bc/manuals/bc/H.1.md | 4 ++-- contrib/bc/manuals/bc/HN.1 | 6 +++--- contrib/bc/manuals/bc/HN.1.md | 4 ++-- contrib/bc/manuals/bc/N.1 | 6 +++--- contrib/bc/manuals/bc/N.1.md | 4 ++-- contrib/bc/src/history.c | 13 ++++++++++++- 16 files changed, 69 insertions(+), 26 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 8156b673ce04..e3b1f9ecb7bc 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,13 @@ # News +## 7.0.2 + +This is a production release that fixes `Ctrl+d` on FreeBSD and Linux when using +`editline`. + +This bug was caused by the macOS fix in `7.0.0`. Unfortunately, this means that +macOS does not respond properly to `Ctrl+d`. + ## 7.0.1 This is a production release that fixes a warning using GCC on FreeBSD. diff --git a/contrib/bc/include/history.h b/contrib/bc/include/history.h index 460524bd7b87..13f6dc6e985c 100644 --- a/contrib/bc/include/history.h +++ b/contrib/bc/include/history.h @@ -120,6 +120,30 @@ typedef struct BcHistory extern const char bc_history_editrc[]; extern const size_t bc_history_editrc_len; +#ifdef __APPLE__ + +/** + * Returns true if the line is a valid line, false otherwise. + * @param line The line. + * @param len The length of the line. + * @return True if the line is valid, false otherwise. + */ +#define BC_HISTORY_INVALID_LINE(line, len) \ + ((line) == NULL && ((len) == -1 || errno == EINTR)) + +#else // __APPLE__ + +/** + * Returns true if the line is a valid line, false otherwise. + * @param line The line. + * @param len The length of the line. + * @return True if the line is valid, false otherwise. + */ +#define BC_HISTORY_INVALID_LINE(line, len) \ + ((line) == NULL && (len) == -1 && errno == EINTR) + +#endif // __APPLE__ + #else // BC_ENABLE_EDITLINE #if BC_ENABLE_READLINE diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 4d2f6acfb433..a4fb8def5024 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 7.0.1 +#define VERSION 7.0.2 #endif // BC_VERSION_H diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index 4750598b55fc..adeb62f82e6a 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index 56f7c52fb2cd..e89305b1af44 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index 62b18165fe92..e2f1b034e69a 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index 69f28e875990..c132a0b76a49 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index fb453b05363d..e3395b1cc20d 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index 4833e3e70ddc..c1ccbec567ec 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1 index 4787435ae052..9dc46ee50dee 100644 --- a/contrib/bc/manuals/bc/H.1 +++ b/contrib/bc/manuals/bc/H.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md index aa313cd14b63..fbc0658d8171 100644 --- a/contrib/bc/manuals/bc/H.1.md +++ b/contrib/bc/manuals/bc/H.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1 index 73c243310d5c..7b4577f2dbd3 100644 --- a/contrib/bc/manuals/bc/HN.1 +++ b/contrib/bc/manuals/bc/HN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md index dc537ffe4cfa..015035c14daf 100644 --- a/contrib/bc/manuals/bc/HN.1.md +++ b/contrib/bc/manuals/bc/HN.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1 index f66ae06d9c3a..193e0d15f6fb 100644 --- a/contrib/bc/manuals/bc/N.1 +++ b/contrib/bc/manuals/bc/N.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md index ad1e603392ae..859c32e3e774 100644 --- a/contrib/bc/manuals/bc/N.1.md +++ b/contrib/bc/manuals/bc/N.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/src/history.c b/contrib/bc/src/history.c index 6ae9785d9a79..32a19f71d777 100644 --- a/contrib/bc/src/history.c +++ b/contrib/bc/src/history.c @@ -264,7 +264,18 @@ bc_history_line(BcHistory* h, BcVec* vec, const char* prompt) errno = EINTR; // Get the line. - while (line == NULL && (len == -1 || errno == EINTR)) + // + // XXX: Why have a macro here? Because macOS needs to be special. Honestly, + // it's starting to feel special like Windows at this point. Anyway, the + // second SIGWINCH signal of multiple will return a valid line length on + // macOS, so we need to allow for that on macOS. However, FreeBSD's editline + // is different and will mess up the terminal if we do it that way. + // + // There is one limitation with this, however: Ctrl+D won't work on macOS. + // But it's because of macOS that this problem exists, and I can't really do + // anything about it. So macOS should fix their broken editline; once they + // do, I'll fix Ctrl+D on macOS. + while (BC_HISTORY_INVALID_LINE(line, len)) { line = el_gets(h->el, &len); bc_history_use_prompt = false; From nobody Wed Sep 18 06:48:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7q3n1kSHz5WMBY; Wed, 18 Sep 2024 06:48: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 4X7q3n0HyJz44Xh; Wed, 18 Sep 2024 06:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726642101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AOpv6uEyVisM1Mkkt46QG7WfJF4GgwJT8qtAvys6Axs=; b=A6LTYeW9T26HMdQN9TY1aELmsbm+n89EhbTYf+EHJqTOFMdfsScFuaIZRuKhmKk9o4d+Eo SkyWw3l2oqYm14OhUANGAGUVETKEXuh4sVWxrsn/XJBvDmV6V2XY5aeaNeTn/ZsV60JDJO QnukyjkmyAuhTXPTN8U6q5EBEc/U/LTcc/4uUVOr12Altzkrw87ifBQh1rNv7KrvAxI+Wm 3fWrTveXEfsG1sFsxUTF0t2RXrJTctUw7dTxJRubLwer6N8tR4mEuJCBsNB36hK1eBsC+O f4YCgZNdWKppj2tBr5/2J1HLJpXD1nUKjZHNZQ8alVeADyqhq+Vg4YC6ViS23g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726642101; a=rsa-sha256; cv=none; b=DBTkfE2ipky3+LYh1UrZq8GyveokfvWXyH7zSKXVDn4K9YWyki7pdv6Kz8pGx4yzcTSY/4 guPsHTPSEx4wvNCn83/4CIG0l0rrEvzcebcJReXhk5nMa2I/6P0B5419UIuZTkhcIEsiSv D+SwE3r5WVXeeSfTuudfBIQ5y4nGTxwCWThntC27kmlGsVADNauR9iqRU6etgQgfMZbbLp hhZzsW+hN8RYG0bMlMRZ0zDmpq4Ytmr9eXN8J2RiGbL0w14RdlWGd6z/UdChPeW9Dn3EX7 DAXQkwOPesaO1dJ4z+DvjuUNbnLrCSjnP1LYaEskfRQflbm/fiUoFAcyJQx0EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726642101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AOpv6uEyVisM1Mkkt46QG7WfJF4GgwJT8qtAvys6Axs=; b=b/asXhFofczlX9VAD/P6WYfOtmx95jtv2dJKGzve7uzeSw47jJ7Yi83g2dv8mFbVwJdQ6m IJEoTtZsxlpn3MFUFlDQBP3v0Zh1YbdL0EuGeH0P3UDQGEQkjNzRiVFqgsiNybEXaYjory qOwz5KnlbnYMJTQSH4xag2Vc955S+hN5W5yR+D0x92ZjPpg+O0vv8CuS0WvxTug2qpR/NF +pDJ8rL139S5eJP/ECjA0c3xIhjlz5u54VMQP/a82A7L7Y0V156Cho4INWy/a83Np/UqW7 f3G/wv/NEOzZ8leQRAIvXtvGMmfEDtOFJ0/d3zGjbsqIKDFDI5Z7zsB+08bEIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7q3m60tXz1B2Q; Wed, 18 Sep 2024 06:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48I6mK41004235; Wed, 18 Sep 2024 06:48:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I6mKNj004233; Wed, 18 Sep 2024 06:48:20 GMT (envelope-from git) Date: Wed, 18 Sep 2024 06:48:20 GMT Message-Id: <202409180648.48I6mKNj004233@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: 0aabcd75dbc2 - main - EC2: Disable RSA host key generation for sshd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0aabcd75dbc2457be65e3c3c46948761ac5e50ed Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0aabcd75dbc2457be65e3c3c46948761ac5e50ed commit 0aabcd75dbc2457be65e3c3c46948761ac5e50ed Author: Colin Percival AuthorDate: 2024-09-11 05:00:07 +0000 Commit: Colin Percival CommitDate: 2024-09-18 06:47:58 +0000 EC2: Disable RSA host key generation for sshd These are largely obsolete, and generating them is responsible for over 10% of the total boot time of EC2 instances. Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46638 --- release/tools/ec2.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 2cca5fa713af..34434f86a0b1 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -71,6 +71,9 @@ ec2_common() { 's/^#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/' \ ${DESTDIR}/etc/ssh/sshd_config + # RSA host keys are obsolete and also very slow to generate + echo 'sshd_rsa_enable="NO"' >> ${DESTDIR}/etc/rc.conf + # Use FreeBSD Update mirrors hosted in AWS sed -i '' -e 's/update.FreeBSD.org/aws.update.FreeBSD.org/' \ ${DESTDIR}/etc/freebsd-update.conf From nobody Wed Sep 18 06:52:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7q8M6m77z5WMKW; Wed, 18 Sep 2024 06:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X7q8M66pbz4501; Wed, 18 Sep 2024 06:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726642339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6D3fhTn6RQJTo25ZgIGEjKbtf5flvHI3Z/FcSryI1g0=; b=x21mmMGMMeNWIWViKGRL3zpp98Ozb5/K3dLNVe0xw+nJAnv4u9Ab7/G6OUrw608p0roQy8 VJIYpDbHTXAsEG3PFGKgs95evI2h+IN2pFRyeQIvCEUMjz6y+efDOhu7w4r68g0bX01/kU fDRKL788vn89GN+gjPKmFPWUcepWXiIlI4Tvglt18VaKMVe0SEdYlCzL3n4+cRLdujeEFx IGVNdIDtoVSraPZqfGyMhgvGdp5Fe5EA5RMI54WS75lyVWBfLDYi3bMcoy4ctLRogpWXQS hrC+JFTiIZ2wGoxrREp2iGNWyydgw0hz5r3+uQU2mHZgunegFuWvfqwTBtaKzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726642339; a=rsa-sha256; cv=none; b=ViseZNwkZHEmP6+QFZlAwD15kcUJJI61s6T2Rn5ep+6SCbWZo8j3/Jfax3Mou6WyDrf35q cjm3l8ZCcv6mSTi7xysBMoV4nzDCG15xUkrHcy3B1mLgw+C/mSB6FO7J5+K1fEYkxR+D8l AYYCQADaoFeneVZR0h7CPeQEJEzqeOjfNhq1yc31RWS2zhXklIhtiAZCxoTgfXYFUAHdH3 twAf8rk3zHUkgJiTw+guJ06xMKm8jICYl8EJD94a19wznnDnsNwVE9QeZ5K+J0MN82hOOA LCNztSFPB1LVrBpskIEYknFyIpe4mK12br++kjZOjIN7bWHpQRBulClQWz4OIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726642339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6D3fhTn6RQJTo25ZgIGEjKbtf5flvHI3Z/FcSryI1g0=; b=nOYF3DA6YhnqwpVmKD7t9b5EiAzI0FMI3BL2ctKZ2NCQHOrtIT04wIwzokqSq5rDjUCWib gVIxie5WNay9xJ6wOcZpGUPBbZGcfPir3qc57RP2tCIspgflJUYoeirZsiqh/Ry88WEYEy rXlh+CTExfhr6zcmF1w2W3KowvaNg2r1BJwohFibwatk+pFPy/lIGDiWQ65s0pjgMpjITw 3WDC0iEPHbsbmZGKwRvpk9M9xrlv8v1BCGqWhLKeFsjTxQYLky5rVbbb3b6+lF4L7VymVr bHXwITKayfvsIK9eWRqudU1Veq+Z5fdAhhBdYZDiSQmwmFxqwl2Uo8V6mTy0Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7q8M5jnvz1BBB; Wed, 18 Sep 2024 06:52: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 48I6qJrk018834; Wed, 18 Sep 2024 06:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I6qJ0w018831; Wed, 18 Sep 2024 06:52:19 GMT (envelope-from git) Date: Wed, 18 Sep 2024 06:52:19 GMT Message-Id: <202409180652.48I6qJ0w018831@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: 279734be11fc - main - RELNOTES: Document EC2 SSH RSA host key desupport. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 279734be11fcdc90d7857b744f3503964e167219 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=279734be11fcdc90d7857b744f3503964e167219 commit 279734be11fcdc90d7857b744f3503964e167219 Author: Colin Percival AuthorDate: 2024-09-18 06:51:53 +0000 Commit: Colin Percival CommitDate: 2024-09-18 06:51:53 +0000 RELNOTES: Document EC2 SSH RSA host key desupport. Sponsored by: Amazon --- RELNOTES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELNOTES b/RELNOTES index bf0fc174e212..0daff902d4fd 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +0aabcd75dbc2: + EC2 AMIs no longer generate RSA host keys by default for SSH. RSA + host key generation can be re-enabled by setting sshd_rsa_enable="YES" + in /etc/rc.conf if it is necessary to support very old SSH clients. + a1da7dc1cdad: The SO_SPLICE socket option was added. It allows TCP connections to be spliced together, enabling proxy-like functionality without the From nobody Wed Sep 18 08:13:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7ryb65Kqz5WZcn; Wed, 18 Sep 2024 08:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X7ryb5X61z4Gjh; Wed, 18 Sep 2024 08:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wpz61AzX+JN/a8vGIYbKVAuWyGbC+II4yROwy1bznMI=; b=ZhnYxxkwelZbAw6aWv1Tdf9Y87TxlWWPjUQPapYRlLbIOkQXoLnArDjGVucdWv3fJ1FG2a 4uGOid8AUz1Lc1+S5BYmTYuDQX0I3gY6IbScL3Siy7sCqltPBjN3cJPmPbIGEuLjJVg2k/ DJkjYcLUlB1rjE07bam5MhLvr+hm6+JC6S7XK1+JDEPjFflsyo6PSkfXjq88pKGrMMM9FA Kih5o/Zw/3MxfOp61biDS+ZugldVpaDEvcIw/Sy45hWcBkeKaOrXKGH3NdZ5GxvoOZDVui rdEvlD3/wi8nAnaPFlPs69Jwj6oNVt2vSJfXqkm9AIR/VCCuGhZpwvI0TK4/Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726647239; a=rsa-sha256; cv=none; b=YSe2JfxRQtOIfHb8smwYrIfE/9t5PlKPNznB+JN/oEIy7u+XozeYBbatXaOBN+iJL+C/Bd JwmRW5dfltjkJFk+tqzeNf264sNqBu82QUjeqs3EKP4adrvbg9saiesJYlBEoVrKVVEmlb PmnTnad74xSOiXvttN4yF4o3fzdV7XAzavRVMl9Maf02xSl0diaFas1iOFTXMuXEio3V9m R25JF1wDofErdPKSeMmwu64IKROnCwdJ5uxx9AkmogY4sbeAb0MAfVtWaadFXiKjTBNdEt Q9K/qqiBjynE8WDCg45Wu0nWpmzT1X5ICp0lMfvNlk0W+RDp4ssxAd/ekzVmYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wpz61AzX+JN/a8vGIYbKVAuWyGbC+II4yROwy1bznMI=; b=MWymrdnaJraIq52kmCPuAlf/hCtoif2V9fxqJWttc5qIqxZTYuJdU/9ckvmrQyNyIMVNQT 9+7MxH9mEvt7t1lxIO02zEhQWgvkiw+v6BeRnm7rKkDk5nbgbiC8yqOn2RkHGP5BsadGVY AXS/oF7Feu938aGGKFpvVdyAQR+nynmNBWEaWls9Emq9+91vYCemWpm9Ay9UqvlezUnDyG PcCb79xzGj33stCiClCEhBXYKGYtgzvgdMyaXFlTrYEFsTwQ4L1oECDdLOfKF1Vj/XCuNC CgfPewClJ4BsI4Onp8TcsG1hoFnEZlFdZEgPepp9676nq8DramSH6sGm3+fJVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7ryb4f7jzDnP; Wed, 18 Sep 2024 08:13: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 48I8Dxgn056969; Wed, 18 Sep 2024 08:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I8Dxai056966; Wed, 18 Sep 2024 08:13:59 GMT (envelope-from git) Date: Wed, 18 Sep 2024 08:13:59 GMT Message-Id: <202409180813.48I8Dxai056966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 5d54e2539429 - stable/14 - MFC: ng_ipfw(4): add missing change after previous commit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5d54e2539429f348dac20428e8b5349e9d34a675 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=5d54e2539429f348dac20428e8b5349e9d34a675 commit 5d54e2539429f348dac20428e8b5349e9d34a675 Author: Eugene Grosbein AuthorDate: 2024-09-12 19:09:28 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-18 08:12:34 +0000 MFC: ng_ipfw(4): add missing change after previous commit The function ng_ipfw_input() used to enjoy implicit 32->16 bits truncation of ng_ipfw_findhook1's second argument. Make it explicit to recover from the breakage. PR: 281082 Reported by: Ruben van Staveren Tested by: Ruben van Staveren Fixes: 20e1f207cc789a28783344614d6d1d1c639c5797 (cherry picked from commit becd0079c052cb87e7649b78733b99abae8861ee) --- sys/netgraph/ng_ipfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_ipfw.c b/sys/netgraph/ng_ipfw.c index 01592a4bbb7d..9a6bb90412fa 100644 --- a/sys/netgraph/ng_ipfw.c +++ b/sys/netgraph/ng_ipfw.c @@ -291,7 +291,7 @@ ng_ipfw_input(struct mbuf **m0, struct ip_fw_args *fwa, bool tee) * Node must be loaded and corresponding hook must be present. */ if (fw_node == NULL || - (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) + (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info & IPFW_INFO_MASK)) == NULL) return (ESRCH); /* no hook associated with this rule */ /* From nobody Wed Sep 18 08:14:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7rzM0L8Nz5WZp2; Wed, 18 Sep 2024 08:14: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 4X7rzL6mVLz4HZH; Wed, 18 Sep 2024 08:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8oMYjc++B3SDTxwleHTgFJRkvP9dm+6zDS0valSRdxE=; b=rEcQTRz18GPwDf77AtNSwKkQ5ofqMpBjLdoESyT8XNhp5D0tlbcNzUXeNPpq5wlEy4uGL1 TSujmbfjfFGcdFoKnvDhRBT4HJV5IsIu9/MvozHsqSQX8hYK5rdb6W6TwlWOj/Y1Yp17D0 LkeD8iLhONkoobiEzSDooxcJshukipvbNDbR8sKwBLMRN+Xg+zWPWqNHP7jIsob5IwNbhF SnQ7HyXmQ0VqbsEDTMzQpXRnYTOHetvt7sLohY9OqrG2rFnieP33LnElOyK2U5DjymP/yP jhQVeGO3HCR/dWrig8BNyGsvWWEThRKQRUBsHyghwhwuJ/4H42dgJef0A7LBrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726647278; a=rsa-sha256; cv=none; b=QSmg/IBVJFdk7ftLegIuDtlb8JPyVsdb53jbTtVVdvnTTnZnZQNyTdxEhuyy4jwTmOYpD3 PjjQ6C9/tXWOUO1C2wIbu074VQ5ovkeuI+a8DfXTa5yT1jdAYZ/kII7Ife7MD5HEjDM0x9 VbLGTirvJrcnWWhOEgCmgQzVNl0k6F/zlJUD31ifOs8atN6Qrg3c7AB1Xmb2JezaQMucvn r6gkWrzbpSmqiEr2flOhfbnfd/xyFQ3Qy47xZwQbTFGZKOY3XnXY0V6SyCIP7nSZgc8qZ8 QZD3v9OIJkrL4ocFxZjaIv/e0hYxBd4DxKlM+PDoyLhkUaiUFAxtNd8TvxEFZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8oMYjc++B3SDTxwleHTgFJRkvP9dm+6zDS0valSRdxE=; b=rum6KjnpiVOk+piTnKPKDxl25pe5DMcCcrD9fbtot3cJ/hI389E6RX03FnyVj5mD6Lj+wD +0W4Cpl/YyF03IlGwVOPTkK1suhPfbpqSpSyQx6wj6+YoLtojdP162hwUhohEZo6SAi0Qz WbJhF4hJ5ti/YbRNzUT526mYL2hQ8aYi9hrPyJ96+0L6exX/hVf5tSpcm8G4U6m6Aq5Fde oaZwlP7ZMP57VMvgRDIjNQLixYpdHfezmQaYT2KMJzg9ZHJxLJLzD09koMbzlgXzr8UIDD beUsNpdutr9Pr1U+HzGGtxZ2e6d9jPz1jy8b4D0Q6tQWeK1lhpjf5t7KKmEIIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7rzL6MxDzF5J; Wed, 18 Sep 2024 08:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48I8EcBY057229; Wed, 18 Sep 2024 08:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I8EcIk057226; Wed, 18 Sep 2024 08:14:38 GMT (envelope-from git) Date: Wed, 18 Sep 2024 08:14:38 GMT Message-Id: <202409180814.48I8EcIk057226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 784817824bb4 - stable/13 - ng_ipfw(4): add missing change after previous commit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 784817824bb4447eeda21f9ed55340def93deb29 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=784817824bb4447eeda21f9ed55340def93deb29 commit 784817824bb4447eeda21f9ed55340def93deb29 Author: Eugene Grosbein AuthorDate: 2024-09-12 19:09:28 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-18 08:14:06 +0000 ng_ipfw(4): add missing change after previous commit The function ng_ipfw_input() used to enjoy implicit 32->16 bits truncation of ng_ipfw_findhook1's second argument. Make it explicit to recover from the breakage. PR: 281082 Reported by: Ruben van Staveren Tested by: Ruben van Staveren Fixes: 20e1f207cc789a28783344614d6d1d1c639c5797 (cherry picked from commit becd0079c052cb87e7649b78733b99abae8861ee) --- sys/netgraph/ng_ipfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_ipfw.c b/sys/netgraph/ng_ipfw.c index 01592a4bbb7d..9a6bb90412fa 100644 --- a/sys/netgraph/ng_ipfw.c +++ b/sys/netgraph/ng_ipfw.c @@ -291,7 +291,7 @@ ng_ipfw_input(struct mbuf **m0, struct ip_fw_args *fwa, bool tee) * Node must be loaded and corresponding hook must be present. */ if (fw_node == NULL || - (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) + (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info & IPFW_INFO_MASK)) == NULL) return (ESRCH); /* no hook associated with this rule */ /* From nobody Wed Sep 18 08:24:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7sC71VyCz5WcF3; Wed, 18 Sep 2024 08:24: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 4X7sC6652Jz4Jnt; Wed, 18 Sep 2024 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXthKTGqdPAxE68IGP7wDf2toqGAgHjR0ErsnrwL4vo=; b=Qbhc8GQ/qipqDCMHcnFbZc89D+S9PfZlFyyURUqGXuXS952ZdPqT8bRkKrKflL7plihCHH 1NjE8Hzpr6dzWqvd6mRc2bI0QX3B96kmjKrOmijKVsBzptPILLz5nOoIuueP7144ZWpQqV R346kPLOfRtx3Do+wcBC1gDZSNnW2jh0oe4GV3Xrx4X7zKHYPq9JRTYA6+6HbXM7ib/nDP X/M7MYJokWlUlIFtbdf07VSz8bC9hEsRt5eoqBbFXrPYaDZKOJEwObTMCGO2MDoUtjX4qa Kne5RXuEoaqLExCBh6fK5CbvuhHmA4uZGk3+iLgJcVdFE7pSIt4lWWFrP2k6tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726647890; a=rsa-sha256; cv=none; b=wNr2UrzY/UUTAFx35a9sQwGexHAmzYHuH8M8sWD468i2vsqzxOrVd9xxSJCUk9hI0UEtYO R0RUpS83eit0ofSYNnV/pJbK08KH/G5CF3qdThAV1uVx8NZyOk7k1e0BEw0jX0wiLvztac 57uB2gfwGWpsnWTIeZbNwHl24hE9nbsS1bLV+YgtKZzOyvUFzg/lO1ZSEeYOrOCMn9J2F5 op64qSD23vhDI2rzszemKMT+vRelLBY2C0sRHdJLCyqExOqTvSAOaf06rhAxOTxZlIEVSe zJacrqwWQR57cVzspHhRFbP83vDaa13r/kWXGbSGIgnsFfZKulqnz6W3WY1NLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXthKTGqdPAxE68IGP7wDf2toqGAgHjR0ErsnrwL4vo=; b=ZY/tkY6EAf7n1ugUiqGoWP4Pd//L9In+IuWU4N+CmmINm2DRPpkZqUKU/xhAm1zDkTg17I fUFq463e0y9WMWMdFNdJBxdhwHKuYwiVrVkqxGP3XXkB8MqY2KAI2yMSu4VOIErmzi3uZB rW7TCnigndSebnrSDekW7oEr7WSxxIJJueNPdJczK3oHI/dpI3bjwHsfFgHIqe/2q8/gj/ +vSHi3OI4Wj9IRCHVzUXXeVD2jPEqToB4kcyu9FBiyv3jj7JKzOqKltOnLxS6v4851D67Z yVtBdhG3qlHFUL8GgM5ib9gVDtRugipaS/rZ8iKxEtiGsjrwpRalWPeQGxbIWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7sC65hrqzFNL; Wed, 18 Sep 2024 08:24: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 48I8OojW075165; Wed, 18 Sep 2024 08:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I8OoEi075162; Wed, 18 Sep 2024 08:24:50 GMT (envelope-from git) Date: Wed, 18 Sep 2024 08:24:50 GMT Message-Id: <202409180824.48I8OoEi075162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ebb3a73d0669 - stable/13 - pf: fix debug printf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ebb3a73d0669bd3a7ab91d3c2fa43b8547c205c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ebb3a73d0669bd3a7ab91d3c2fa43b8547c205c7 commit ebb3a73d0669bd3a7ab91d3c2fa43b8547c205c7 Author: Kristof Provost AuthorDate: 2024-08-28 12:42:33 +0000 Commit: Kristof Provost CommitDate: 2024-09-18 08:22:45 +0000 pf: fix debug printf MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46574 (cherry picked from commit db11a048282d268e19510b9f566903ed0509e698) --- 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 b95ef59a3250..f940950a2479 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6108,7 +6108,7 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", - icmp_dir, pd->dir); + ntohs(type), icmp_dir); pf_print_state(*state); printf("\n"); } From nobody Wed Sep 18 08:24:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7sC91pfSz5Wc9W; Wed, 18 Sep 2024 08:24: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 4X7sC90gGxz4JXY; Wed, 18 Sep 2024 08:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DcTOY84UV6pYFn/QM/47NS+L0CUZrDV0eLn/6G/R+W8=; b=SgPQ/4eWsNGvDgETfHzWe1h887O6w7eEyx51FzlucHgSyYfbbrVY8Y5N8vvxkuxNCtY4LC bRl8ZQobFZrDSFD7qjA++oR8C3bCgOwenzfWuDf5HjhXC558pyLq4GbZ0rqM62YMhLTfjb EUF5v/ZRdBpxCFB/AmGpfksyrlDL0EhB1JbHzYU770TIsQkfNo4vZeQy6nvfqRNZ8qk8QE O8UgeQv71a6NjF+p5m935jAwsz9n0nEVdSzWfafgln5XdhL7Dvx9fKnvJ29N9WfuWLvFh4 yIkPQZ0ECPE/hxxS9Y7XB8emHOEFOM+lHPw4I+IaiNiiKo2G3j/BFY6A6hldbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726647893; a=rsa-sha256; cv=none; b=p/3nnvzx+Td+/rZQCjmUpPrvSGhlzPYKg+SsEwBuMyOMz8b/kAUFesMsPU9jHepbMuHAXk SRXE829/UpGn+LuGvEflOCN+He4fFa1M3xtFD+gKEJI7w/cdGStQ9kcdPvVJEKlyu7btuz PrxfRU1PpbwqiR06vTxy3O8g88TkT2JsGNbuZ5nFqzo4zN1GtRJDV7cR414KqP2ARLV4HH ZGPlxIURWbLhBJUHHUpwEma6KObULHfnjNh+YhZQduYhRvZkwUqEtiJHbBO9eSEcE2agA0 aLi34C1csvXqhx9SbVz4H6rwnv8gD6YQLtB6bL1MV2Aiy8x0gDwSfhH7u2E/PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DcTOY84UV6pYFn/QM/47NS+L0CUZrDV0eLn/6G/R+W8=; b=BicrRPAkx/fYMJPBmBP0SLghdI8DRxUlAZTlgi/s1Qbt3J32NDHXj5jtBWxHO5qBIyYpAn 4YuYnesk/HFz7lHHvU0c85pKPcE8O0OnAWAieoC3domb0wq3uw1jO3OtwegXGtVVLCYbQZ qrDbODzsBygobVV2DM0jw2C/s5vjezXh1m4y/oe9yG0SXQ4gSSJtOxLAHP/A06ivVg/o4S 3VEi1UhYp7PgGMCelSyQVW+3x5A7fQEybcVs4erDd5dV2xsjUvTDOgN7BRPmzaHddwBsjE acqinP59S3staikBuvRxazVAzJ3keSgLYOJHg4dtXEziq/tAx92scKZnCauAsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7sC90HbhzF65; Wed, 18 Sep 2024 08:24: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 48I8OqtE075296; Wed, 18 Sep 2024 08:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I8OqEs075293; Wed, 18 Sep 2024 08:24:52 GMT (envelope-from git) Date: Wed, 18 Sep 2024 08:24:52 GMT Message-Id: <202409180824.48I8OqEs075293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 72706300b6e5 - stable/14 - pf: fix debug printf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72706300b6e5c33985fd3cd0062e6a07becf8529 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=72706300b6e5c33985fd3cd0062e6a07becf8529 commit 72706300b6e5c33985fd3cd0062e6a07becf8529 Author: Kristof Provost AuthorDate: 2024-08-28 12:42:33 +0000 Commit: Kristof Provost CommitDate: 2024-09-18 08:22:38 +0000 pf: fix debug printf MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46574 (cherry picked from commit db11a048282d268e19510b9f566903ed0509e698) --- 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 e39abc7e7ad2..f4ee8fb3344a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6700,7 +6700,7 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", - icmp_dir, pd->dir); + ntohs(type), icmp_dir); pf_print_state(*state); printf("\n"); } From nobody Wed Sep 18 08:24:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7sCB3My9z5WcHv; Wed, 18 Sep 2024 08:24: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 4X7sCB1gx3z4JXd; Wed, 18 Sep 2024 08:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+YhvUYrEjCllhgnB5IXnhSHJwK4dKxsX/dusKqa8pY4=; b=apgFCVA2ndjDtaueQy49zuBsSb2+mGNPosYT/nEvQt9113gAxKN+Tw4w4kaWvtr3usKfzR Y06LgrYS4Bkn29/GcDRF9d+MxJsPOEf+0gWPkHe6h2BNXCjmvevv7+qr/Z0+hGXc0LZraa MK6wOYl2kjpbGdjk7b6uCCq4ZF6xelPBiVbD2T0HZqeWUtc9RHPKL9toBVbNmB/KlK+GiW VbIOUeyl1I1WOoAxapccuFoV0TFfBXVBOW8ls3HsyEP8xkOS5cFLIBE2fRepJ2Z0hzg+ix 1Zi3nHTekX+XVBvSFEP3Ot4P8kUaTJUiwaYHmgMCNy/SfCQldVvkFVKQqfKzGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726647894; a=rsa-sha256; cv=none; b=XzQ6A9b7Y1fDiD8pMDG5onBzDPRDkK2CP1iTaqr0NiqCJv6phk7+hucrv99+cdz7xdjG9R 5gnRqx4pK+w0MDdzN0wwBv1StPhBgNrUWonCeduFWyS3nfST7QCeAvnRscpxiZGIWI+0jU 1BM6GXfNftxJGWhUIQmtjotmIKfQSnBcfVQQZl6EvCZ8YGovfEd7FTBcpWwWvinarlzk0a Rf44pjMJOx3OvKBmCOYTste71WdXH8Sude194EaeBhpTm3YYJhNpNL3WzePxSJhAJVE1kK 1T1hGZapfI3SmLEdnAvUK5QBs7/0W4MXBl33A9cJ227lNvFiFGWpXK/XcuOJjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726647894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+YhvUYrEjCllhgnB5IXnhSHJwK4dKxsX/dusKqa8pY4=; b=gZmfryI/hsnzdPBuo0H/+/w9W2VREospaHPEFlbHGtar/aP+PsKWsndzUoTD3/5V/Bapw6 0bPHdgy/dE93MIF/OOjEa6UmbisUzEeEVXd5DjGweQsJDdwINngJbXSGgD3sUlzrP9zhV4 hcpxvNYjyWGDLrLBSM8pEiCesxOt4+R5+XAcjupozTUDEX5LdLXp+D8/wsc8T07c1Fz0TX 0XFWIJm/+bvccbs+owrRdDd+sjchha+Ngz12m2+jlcT7l9O8cKwIWKjkHnaBw8GVXkPLUM 5twN6zgNZl0mdJzTpVLBMIGOsRDmwXaQkXIxe+1IUH5jIoETVH2j3/IzrDxjkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7sCB1JBGzFJb; Wed, 18 Sep 2024 08:24: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 48I8Osft075349; Wed, 18 Sep 2024 08:24:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I8OscX075346; Wed, 18 Sep 2024 08:24:54 GMT (envelope-from git) Date: Wed, 18 Sep 2024 08:24:54 GMT Message-Id: <202409180824.48I8OscX075346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 79c34d704f31 - stable/14 - if_ovpn: declare our dependency on the crypto module List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79c34d704f3121cb7f3748ec6b7a5c7f787633bf Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=79c34d704f3121cb7f3748ec6b7a5c7f787633bf commit 79c34d704f3121cb7f3748ec6b7a5c7f787633bf Author: Kristof Provost AuthorDate: 2024-09-12 15:51:04 +0000 Commit: Kristof Provost CommitDate: 2024-09-18 08:22:39 +0000 if_ovpn: declare our dependency on the crypto module PR: 281460 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 17c9ac457cf16c1251afa7364bc47ed52ec29057) --- sys/net/if_ovpn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index e550fb9921dc..be75eff74d34 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2598,3 +2598,4 @@ static moduledata_t ovpn_mod = { DECLARE_MODULE(if_ovpn, ovpn_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(if_ovpn, 1); +MODULE_DEPEND(if_ovpn, crypto, 1, 1, 1); From nobody Wed Sep 18 09:49:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7v4v6h8Rz5Vbbw; Wed, 18 Sep 2024 09:49: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 4X7v4v68WQz4bjl; Wed, 18 Sep 2024 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726652975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYktfKQ3DzSkanDSqkOM2zxL9Ft1r5lZusqkxw3lyWs=; b=BBdT/9sKP1X6qOfaVG/hhYnAgl5PnRsQ0dk/rLsadEjOu6SCEjt86mmgelibGSMpUebyFY htvYFySgxzAwvEbj/JHk5XERzEKfTgmT6fAhEeudgnPlMQXjvrUf4P+8qW7HREaLFpN56U bEHTKXzH3ROCes6gAmxwueXtf4imGFDVuV97+66XgCgPov4/BFnnMiR1eN0IQ8Kp7dlebv /wsdYfdp5BPfSO5x5BjG/kuzHJtHEgATs4yj9LFsbokPj2i1MSGB1tQ5sXefbgFyPDSY9R 7YUBWfOe/U00gQ3RzQ7cgnzQNiT2LcoZoDkaskbkL6/kymatC9iuDktV8LRXNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726652975; a=rsa-sha256; cv=none; b=DJR4B4GN+Zkza0qqKU6nKv2pbVpn3BWxhrMAlhPoHMqM8/KGoTY3SPoZhRvdIEpbBnshUw p00BtnQVaR0WUbNy9oH+yZ4j352q9Q/IP9PIszOyvwlGVqQ2EdKIPWwOFuymnY5JVKq8A0 ARPwVLOD0lP5sQFL9P47LOfEahnaaSfob9ZaX32HrTYrOwsivi553pmZzQKdG0/SJFD9u0 NVqEYjTvn3lzLqRW13PY4RSHXqdcvlQtww+ad04cksn6J1BjHawMokIaGD/w0U6pjx1omx 6Ca6QED6n0DDr7wHGX3qw9DzsN8B8uYST9BoYcoSp07CVQ+ilqPxNFibE0YD0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726652975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYktfKQ3DzSkanDSqkOM2zxL9Ft1r5lZusqkxw3lyWs=; b=I4zAOhawleFjJSwn5PzlHQF7O92D45YlGinlMpoAwAgoAVe4QJ5kdlL/6JLaFB181RLvRt Dw+az8ys/hoGR3q2TJVdDPXVbl1nA3CTvKeRGYwn8nI3HxUB0uyN3ZtdvKz85Scq6PPK2c 0KwSp+WDKpIIJJ1FfCTiEW1IxrNxo1yIQIr7YCSh1JXwNB0y7Bw6hyFyj0NvCRI+R5LjZ7 Zo8/2gnISV7FSDhgNVtgytVwttCtCVT/VCe0NZ4Xo77DyPdrHttbsaCPCdSpHhQy0lzbL0 dpKIVaTHf6hM02UIEsDpzcPil0mKszsW2tNLIrGP7DR+ldBJK2VfLkNwgCxFuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X7v4v5g73zH6P; Wed, 18 Sep 2024 09:49: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 48I9nZu5011811; Wed, 18 Sep 2024 09:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48I9nZku011808; Wed, 18 Sep 2024 09:49:35 GMT (envelope-from git) Date: Wed, 18 Sep 2024 09:49:35 GMT Message-Id: <202409180949.48I9nZku011808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 0a05ea1f56e6 - main - tcp: keep syncache flags when updating ECN info List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a05ea1f56e65ec0477d56daf5ed623087464082 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=0a05ea1f56e65ec0477d56daf5ed623087464082 commit 0a05ea1f56e65ec0477d56daf5ed623087464082 Author: Richard Scheffenegger AuthorDate: 2024-09-18 09:18:00 +0000 Commit: Richard Scheffenegger CommitDate: 2024-09-18 09:18:30 +0000 tcp: keep syncache flags when updating ECN info While processing the ECN flags of an incoming packet, incorrectly cleared all other syncache flags. Reported by: tuexen Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D46694 --- 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 d0a7690256f4..80bf12474c1c 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1538,7 +1538,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ if (sc->sc_flags & SCF_ECN_MASK) { sc->sc_flags &= ~SCF_ECN_MASK; - sc->sc_flags = tcp_ecn_syncache_add(tcp_get_flags(th), iptos); + sc->sc_flags |= tcp_ecn_syncache_add(tcp_get_flags(th), iptos); } #ifdef MAC /* From nobody Wed Sep 18 09:07:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7wqr6hdBz5VpW9 for ; Wed, 18 Sep 2024 11:08:24 +0000 (UTC) (envelope-from julia@trilink.fr) Received: from nf121.mxout.mta2.net (nf121.mxout.mta2.net [141.95.129.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X7wqr1JTwz4m3m for ; Wed, 18 Sep 2024 11:08:24 +0000 (UTC) (envelope-from julia@trilink.fr) Authentication-Results: mx1.freebsd.org; dkim=none ("invalid DKIM record") header.d=trilink.fr header.s=api header.b=KpFeOVb3; dkim=pass header.d=elasticemail.com header.s=api header.b="X71qIpT/"; dmarc=permerror reason="Multiple policies defined in DNS" header.from=trilink.fr (policy=permerror); spf=softfail (mx1.freebsd.org: 141.95.129.121 is neither permitted nor denied by domain of julia@trilink.fr) smtp.mailfrom=julia@trilink.fr DKIM-Signature: v=1; a=rsa-sha256; d=trilink.fr; s=api; c=relaxed/simple; t=1726650437; h=from:date:subject:reply-to:to:list-unsubscribe:list-unsubscribe-post: mime-version; bh=yZkqE6BvVmpZuhHOu2fTqTgn1ayetQpb55yyIW8vhpo=; b=KpFeOVb3XR9fTefMvk7Bwl56o42IRjGovR5Vo5M/IZky8r3JRnBGB5R52Nv6Xv4AiGBYpShWtzl UPamhNt66YDaz1b4MaYckte1c3lYPD/eNUpR7GvwVacJhmiuEjMdpPy2cwQB8VBM58kuRaMDOVrLR hSVVEAbzGioRWW0sHQ4= DKIM-Signature: v=1; a=rsa-sha256; d=elasticemail.com; s=api; c=relaxed/simple; t=1726650437; h=from:date:subject:reply-to:to:list-unsubscribe:list-unsubscribe-post; bh=yZkqE6BvVmpZuhHOu2fTqTgn1ayetQpb55yyIW8vhpo=; b=X71qIpT/Hq3bhlJb9xZRzvMoKq5b8xoVrz1l2HXPzAmSUu/i5Hnf1cfX8F5lHyEBbWoWSa2gY6S R6uaFbzK4G9g8LIdz09LoUPehbtW3lL8Uu4DtzhSAQBN4YoTP5p3DAsqjAGfr3MUqltdq40cxFU8V Wmrx6UZgsmKZ8bEjeaU= From: julia@trilink.fr Date: Wed, 18 Sep 2024 09:07:17 +0000 Subject: Seize the Opportunity with Our Influencer Marketing Message-Id: <4uo4rtnxeviw.kW7mX0GkC3_C7gdhWgZi5w2@1HC6U.trk.elasticemail.com> Reply-To: julia@trilink.fr To: dev-commits-src-all@freebsd.org List-Unsubscribe: =?us-ascii?q?=3Cmailto=3Aunsubscribe+kW7mX0GkC3=5FC7gdhWgZi5w2=40bounces=2Eelasticem?= =?us-ascii?q?ail=2Enet=3Fsubject=3Dunsubscribe=3E=2C?= =?us-ascii?q?_=3Chttps=3A=2F=2F1HC6U=2Etrk=2Eelasticemail=2Ecom=2Ftracking=2Funsubscribe=3Fmsgi?= =?us-ascii?q?d=3DkW7mX0GkC3=5FC7gdhWgZi5w2&c=3D1836331150851921943=3E?= List-Unsubscribe-Post: List-Unsubscribe=One-Click X-Msg-EID: kW7mX0GkC3_C7gdhWgZi5w2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-eZCfD1WC8x2cAMy9OfYMPi7F2jNl7/dw23WKzQ==" X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.89 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; URIBL_GREY(1.50)[elasticemail.com:url,elasticemail.com:dkim]; URI_COUNT_ODD(1.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_BASE64_TEXT_BOGUS(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.995]; R_DKIM_ALLOW(-0.20)[elasticemail.com:s=api]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_BASE64_TEXT(0.10)[]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DMARC_BAD_POLICY(0.00)[trilink.fr : Multiple policies defined in DNS]; GREYLIST(0.00)[pass,meta]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; R_DKIM_PERMFAIL(0.00)[trilink.fr:s=api]; RCVD_IN_DNSWL_NONE(0.00)[141.95.129.121:from]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[trilink.fr:~,elasticemail.com:+]; HAS_REPLYTO(0.00)[julia@trilink.fr]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_NO_DN(0.00)[]; ASN(0.00)[asn:16276, ipnet:141.95.128.0/17, country:FR]; DKIM_MIXED(0.00)[]; MISSING_XM_UA(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4X7wqr1JTwz4m3m --=-eZCfD1WC8x2cAMy9OfYMPi7F2jNl7/dw23WKzQ== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 CkRlYXIgU2lyL01hZGFtLAoKSW4gdG9kYXkncyBjb21wZXRpdGl2ZSBtYXJrZXQsIHN0YW5k aW5nIG91dCBpcyBjcnVjaWFsLiBJbiAyMDI0LCBpbmZsdWVuY2VyIG1hcmtldGluZyByZXBy ZXNlbnRzIGEgc2lnbmlmaWNhbnQgb3Bwb3J0dW5pdHkgZm9yIGJ1c2luZXNzZXMuCgpBdCBU cmlsaW5rLCB3ZSBvZmZlciBhIGNvbXBsZXRlIHNvbHV0aW9uOiB3ZSBtYW5hZ2UgMTAwJSBv ZiB5b3VyIGluZmx1ZW5jZXIgbWFya2V0aW5nIGNhbXBhaWducywgZnJvbSBjcmVhdGlvbiB0 byBpbmZsdWVuY2VyIHJlbGF0aW9ucyBtYW5hZ2VtZW50LCBhbmQgcmVzdWx0IG1lYXN1cmVt ZW50LgoKV2l0aCB0aGUgbGFyZ2VzdCBwb3J0Zm9saW8gb2YgaW5mbHVlbmNlcnMgYXQgb3Vy IGRpc3Bvc2FsLCB3ZSBjYW4gcHJvcGVsIHlvdXIgYnJhbmQgdG8geW91ciB0YXJnZXQgYXVk aWVuY2Ugd2l0aCB1bnBhcmFsbGVsZWQgcHJlY2lzaW9uLgoKTWFrZSBzdXJlIDIwMjQgaXMg bm90IGp1c3QgYW5vdGhlciB5ZWFyLiBCZWNvbWUgdGhlIGxlYWRlciBpbiB5b3VyIG1hcmtl dC4gTGV0J3MgZXhwbG9yZSBob3cgd2UgY2FuIGFjaGlldmUgeW91ciBnb2FscyB0b2dldGhl ci4KCkZvciBtb3JlIGluZm9ybWF0aW9uOgotIENvbnRhY3QgdXMgZGlyZWN0bHkgYXQ6IA0K PG1haWx0bzpqdWxpYUB0cmlsaW5rLmZyPg0KanVsaWFAdHJpbGluay5mcgotIFJlYWNoIG91 dCB2aWEgV2hhdHNBcHA6IA0KPGh0dHBzOi8vMUhDNlUudHJrLmVsYXN0aWNlbWFpbC5jb20v dHJhY2tpbmcvY2xpY2s/ZD1QaE9LQXZDMGJELTNlVEsya0gyLWJwcTFsMDg0QnFqa2g0bkdY NHlCNWU2Ymh0UjluQmdLd0lVallFZUJsSmQ5dllhYkFkQ2tWTkVLLXdvOHprZFZRMkFRbFpt RFpWTmpMT0RpYzU3Z1cyem5XV2NyeHpuN2hhMjdnQkVEaDBwbGxDTFdSVHZoSE5iVXRyZDRm UWZQc0lyMFJTdlVsY1E5dGd4RGJnMmVkMGlmMD4NCkNvbnRhY3QgdXMgb24gV2hhdHNBcHAK Ckxvb2tpbmcgZm9yd2FyZCB0byB5b3VyIHJlc3BvbnNlIQoKQmVzdCByZWdhcmRzLApKdWxp YSAtIENNTywgVHJpbGluawogICAgDQo8aHR0cHM6Ly8xSEM2VS50cmsuZWxhc3RpY2VtYWls LmNvbS90cmFja2luZy91bnN1YnNjcmliZT9kPURKTnJ1TEludjVYbDRLQm92VF8xcDc2VVJD R2tJbFhnSW9EcDMtVE5CYm5BNXZwYlg1bGRxYm9BWlBGdk9nTVdBQWU3bS1YRHh6ZzVKSjJs MmJrTk1hSlhZd28wLTNSZEVFdXNQU3BMOGJ6bzA+DQpVTlNVQlNDUklCRQ0KPGh0dHBzOi8v MUhDNlUudHJrLmVsYXN0aWNlbWFpbC5jb20vdHJhY2tpbmcvYm90Y2xpY2s/bXNnaWQ9a1c3 bVgwR2tDM19DN2dkaFdnWmk1dzImYz0xODM2MzMxMTUwODUxOTIxOTQzPg0K --=-eZCfD1WC8x2cAMy9OfYMPi7F2jNl7/dw23WKzQ== Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 CkRlYXIgU2lyL01hZGFtLAoKSW4gdG9kYXkncyBjb21wZXRpdGl2ZSBtYXJrZXQsIHN0YW5k aW5nIG91dCBpcyBjcnVjaWFsLiBJbiAyMDI0LCBpbmZsdWVuY2VyIG1hcmtldGluZyByZXBy ZXNlbnRzIGEgc2lnbmlmaWNhbnQgb3Bwb3J0dW5pdHkgZm9yIGJ1c2luZXNzZXMuCgpBdCBU cmlsaW5rLCB3ZSBvZmZlciBhIGNvbXBsZXRlIHNvbHV0aW9uOiB3ZSBtYW5hZ2UgMTAwJSBv ZiB5b3VyIGluZmx1ZW5jZXIgbWFya2V0aW5nIGNhbXBhaWducywgZnJvbSBjcmVhdGlvbiB0 byBpbmZsdWVuY2VyIHJlbGF0aW9ucyBtYW5hZ2VtZW50LCBhbmQgcmVzdWx0IG1lYXN1cmVt ZW50LgoKV2l0aCB0aGUgbGFyZ2VzdCBwb3J0Zm9saW8gb2YgaW5mbHVlbmNlcnMgYXQgb3Vy IGRpc3Bvc2FsLCB3ZSBjYW4gcHJvcGVsIHlvdXIgYnJhbmQgdG8geW91ciB0YXJnZXQgYXVk aWVuY2Ugd2l0aCB1bnBhcmFsbGVsZWQgcHJlY2lzaW9uLgoKTWFrZSBzdXJlIDIwMjQgaXMg bm90IGp1c3QgYW5vdGhlciB5ZWFyLiBCZWNvbWUgdGhlIGxlYWRlciBpbiB5b3VyIG1hcmtl dC4gTGV0J3MgZXhwbG9yZSBob3cgd2UgY2FuIGFjaGlldmUgeW91ciBnb2FscyB0b2dldGhl ci4KCkZvciBtb3JlIGluZm9ybWF0aW9uOgotIENvbnRhY3QgdXMgZGlyZWN0bHkgYXQ6IDxh IGhyZWY9Im1haWx0bzpqdWxpYUB0cmlsaW5rLmZyIj5qdWxpYUB0cmlsaW5rLmZyPC9hPgot IFJlYWNoIG91dCB2aWEgV2hhdHNBcHA6IDxhIGhyZWY9Imh0dHBzOi8vMUhDNlUudHJrLmVs YXN0aWNlbWFpbC5jb20vdHJhY2tpbmcvY2xpY2s/ZD1QaE9LQXZDMGJELTNlVEsya0gyLWJw cTFsMDg0QnFqa2g0bkdYNHlCNWU2Ymh0UjluQmdLd0lVallFZUJsSmQ5dllhYkFkQ2tWTkVL LXdvOHprZFZRMkFRbFptRFpWTmpMT0RpYzU3Z1cyem5XV2NyeHpuN2hhMjdnQkVEaDBwbGxD TFdSVHZoSE5iVXRyZDRmUWZQc0lyMFJTdlVsY1E5dGd4RGJnMmVkMGlmMCI+Q29udGFjdCB1 cyBvbiBXaGF0c0FwcDwvYT4KCkxvb2tpbmcgZm9yd2FyZCB0byB5b3VyIHJlc3BvbnNlIQoK QmVzdCByZWdhcmRzLApKdWxpYSAtIENNTywgVHJpbGluawogICAgPGltZyBzcmM9Imh0dHBz Oi8vMUhDNlUudHJrLmVsYXN0aWNlbWFpbC5jb20vdHJhY2tpbmcvb3Blbj9tc2dpZD1rVzdt WDBHa0MzX0M3Z2RoV2daaTV3MiZjPTE4MzYzMzExNTA4NTE5MjE5NDMiIHN0eWxlPSJ3aWR0 aDoxcHg7aGVpZ2h0OjFweCIgYWx0PSIiIC8+PGRpdiBzdHlsZT0idGV4dC1hbGlnbjpjZW50 ZXI7IGJhY2tncm91bmQtY29sb3I6I2ZmZjtwYWRkaW5nLXRvcDoxMHB4O3BhZGRpbmctYm90 dG9tOjEwcHg7Zm9udC1zaXplOjhwdDtmb250LWZhbWlseTpzYW5zLXNlcmlmOyI+PGEgaHJl Zj0iaHR0cHM6Ly8xSEM2VS50cmsuZWxhc3RpY2VtYWlsLmNvbS90cmFja2luZy91bnN1YnNj cmliZT9kPURKTnJ1TEludjVYbDRLQm92VF8xcDc2VVJDR2tJbFhnSW9EcDMtVE5CYm5BNXZw Ylg1bGRxYm9BWlBGdk9nTVdBQWU3bS1YRHh6ZzVKSjJsMmJrTk1hSlhZd28wLTNSZEVFdXNQ U3BMOGJ6bzAiIHN0eWxlPSJ0ZXh0LWFsaWduOmNlbnRlcjt0ZXh0LWRlY29yYXRpb246bm9u ZTtjb2xvcjojNjY2OyI+VU5TVUJTQ1JJQkU8L2E+PC9kaXY+PGEgc3R5bGU9ICJkaXNwbGF5 IDogbm9uZTsiIGhyZWY9Imh0dHBzOi8vMUhDNlUudHJrLmVsYXN0aWNlbWFpbC5jb20vdHJh Y2tpbmcvYm90Y2xpY2s/bXNnaWQ9a1c3bVgwR2tDM19DN2dkaFdnWmk1dzImYz0xODM2MzMx MTUwODUxOTIxOTQzIj48L2E+ --=-eZCfD1WC8x2cAMy9OfYMPi7F2jNl7/dw23WKzQ==-- From nobody Wed Sep 18 14:37:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X81T02L9tz5WWX7; Wed, 18 Sep 2024 14:37: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 4X81T01sl7z4DjY; Wed, 18 Sep 2024 14:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726670244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9zQyQYyNhWXbBw8xJxVsFHwPSra1cWaCxulmBXkJ/ok=; b=gwOqSzO5kH9zbxmkxGHxTlM1ZRdZwnd+ukf7xurWLWxgNHtdyTzHSIf1IWXGJSoo3g6bSf LxGZvwrlSLq4kEIa3BfyAF4MXpDJb7457V3XXnd+LoCrFnxp/Cxsh222Nbvx776WGY6ZX+ b3EVZeb1pgdmm7JGUDwLPkD0VgPMWC4dtmhC5WnheM5EU4RyWKeQDfFEh0FlOGJD9S91Aj Yw0VMv5M0wiHiJzSAd1j9g+2UNXYwJ+7uEVINwqEj/18UjuVkdH5jLwOv/n6iZxvUxcGQ3 mLgo2w1wkT+MYAL5Y2x0nxqNNGstIa012ItsWV09UUZm/3rTxJ8DgrY4qsD+zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726670244; a=rsa-sha256; cv=none; b=s6KqAC8fWJSrSk1EIfJwBJMfKqph1XGlzjDLkFbjJGIQCtDAZQBeqrow+egUttq307BjgE T4TucxsK3rTUI6flhhnNWPob3TBSielqWEnRE3deEdX1/EcxmUk+XMaST/OS/Hyb/czear O6vCDzykOkEcBvvAth6OQJfnV5bEdiROvGEG9V98kpqHZ004ecsTuPdltkzmo8HGxxWgZi 9mBJW4bT7fvnJHTI0gCwoYe0EHir9scNL1m5sCPNLzjX73Cc1XhUT62xwnJzlnbuh9oVgw H5NHKUR4Xea7Tw0gjaTe7mSp2kS7q2bXWUCqeG8jVqQVnmITTszj5OP7Hc26gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726670244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9zQyQYyNhWXbBw8xJxVsFHwPSra1cWaCxulmBXkJ/ok=; b=D/RJUS0oqggj2XWgT11Qjz7w+Ue/kJdzlqpnVtgSHisa0AjzIlNi5+v9t8EJ6QK32xbHt0 250NQPYQUsxaFgx8z/2b0YFQMsndLJwXB+uRoPN0Tvtou21gsFZk98zznKdhIOjWNdvGIF Sqo4OFTWTLJmDLBN9J/sRlmjVone19BBRuSB2qIbwo19Lux7Qnxj6UBHIreo6mfnGpYawL ut0IS9AGhcdSMthgLCasGN5j05D7UCAkseFBdVzhqkoH2C+R5/fgP45aRyJ4wJU2vUaLdP bNn43yxYj/8xTsEOuSoYd6+i78XkOq0t/Vq8zbe3z01nzAU/0WEnqRBeMBHZoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X81T018nNzQkf; Wed, 18 Sep 2024 14:37: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 48IEbONd003811; Wed, 18 Sep 2024 14:37:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IEbOC2003808; Wed, 18 Sep 2024 14:37:24 GMT (envelope-from git) Date: Wed, 18 Sep 2024 14:37:24 GMT Message-Id: <202409181437.48IEbOC2003808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 996a832d2e01 - main - mca: Allow for passing ECC error record to memory controller driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 996a832d2e01fceb5a3bbfd33df585bd778e6288 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=996a832d2e01fceb5a3bbfd33df585bd778e6288 commit 996a832d2e01fceb5a3bbfd33df585bd778e6288 Author: Stephen J. Kiernan AuthorDate: 2024-09-18 14:37:14 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 14:37:14 +0000 mca: Allow for passing ECC error record to memory controller driver Added (de)registration functions for memory controller driver to be notified when ECC errors occur. This allows for decoding of the specific error by the driver. Submitted by: Lakshman Likith Nudurupati Sponsored by: Juniper Networks, Inc. Obtained from: Semihalf --- sys/x86/include/mca.h | 5 +++++ sys/x86/x86/mca.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/sys/x86/include/mca.h b/sys/x86/include/mca.h index 183480625f6d..d8b8da86523d 100644 --- a/sys/x86/include/mca.h +++ b/sys/x86/include/mca.h @@ -46,6 +46,11 @@ struct mca_record { #ifdef _KERNEL +typedef void (*mca_decode_func)(void *, const struct mca_record *); + +int mca_register_decode_func(mca_decode_func func, void *aux); +int mca_deregister_decode_func(mca_decode_func func); + void cmc_intr(void); void mca_init(void); void mca_intr(void); diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c index b293fcedbd84..89ab59639882 100644 --- a/sys/x86/x86/mca.c +++ b/sys/x86/x86/mca.c @@ -99,6 +99,8 @@ static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); static volatile int mca_count; /* Number of records stored. */ static int mca_banks; /* Number of per-CPU register banks. */ static int mca_maxcount = -1; /* Limit on records stored. (-1 = unlimited) */ +static mca_decode_func mca_func; +static void *mca_decode_arg; static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Machine Check Architecture"); @@ -421,6 +423,50 @@ mca_mute(const struct mca_record *rec) return (0); } +/* + * Pass mca_record to a memory controller driver so that it can decode + * the address and possibly do some more work. + */ +static void +mca_decode_record(const struct mca_record *rec) +{ + + if (mca_func != NULL) + mca_func(mca_decode_arg, rec); +} + +int +mca_register_decode_func(mca_decode_func func, void *aux) +{ + int error; + + if (func == NULL) + return (EINVAL); + + error = 0; + mtx_lock_spin(&mca_lock); + if (mca_func != NULL) + error = EEXIST; + + if (error == 0) { + mca_func = func; + mca_decode_arg = aux; + } + + mtx_unlock_spin(&mca_lock); + return (error); +} + +int +mca_deregister_decode_func(mca_decode_func func) +{ + if (func == NULL || func != mca_func) + return (EINVAL); + + mca_func = NULL; + return (0); +} + /* Dump details about a single machine check. */ static void mca_log(const struct mca_record *rec) @@ -613,6 +659,8 @@ mca_log(const struct mca_record *rec) } if (rec->mr_status & MC_STATUS_MISCV) printf("MCA: Misc 0x%llx\n", (long long)rec->mr_misc); + + mca_decode_record(rec); } static bool From nobody Wed Sep 18 14:44:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X81dc1yQcz5WX6m; Wed, 18 Sep 2024 14:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X81dc1MjMz4Fq3; Wed, 18 Sep 2024 14:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726670692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OfXaCyTv2tQLx3by6H8DLb6IzgWHnrgjBaLvdKtq59E=; b=reURRRG4ZC97EBUGGCpt/OPtc5BzUT5MztAZ5OVFnFvD7ZmDbdY6I5a5VFQe1S6M+G7khs 5mTShEWjsBt4l7NvxM7Ja+aG1xjNJgqcwpzCHKS6oIw9a9z2TFoVzQ7pXmzAaKvCKfk4Pl DjfYrdt2KBDb0CVODVqmhgZtU4elAFP5Dc6WeC4ic/H4VHQBJj4jG4pD578ZuPKj+eATvK 680/Un1xctp/ysT6EiQAxEQSOBZw7KFPKxTr3cza0XMjO31ORQiQgtsFAvwsOJjkYoOj37 CzbOSphITfxbjBtjH+MeMEMZcpRwI2bGXsiQwxEFlfZk7PcvuSV4BhElfqKzFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726670692; a=rsa-sha256; cv=none; b=bdZEh78J5HMcEKan56tsZuOGCs5A1Mx6+Kvh1xpTmcmCb4nZ4ON6ux1GUp/e6xIEVEKzNT 79OQur3BTpjKgn50TQWu2d0i26Lb2jTanFpSAiAso+HaP+h1ojpmmQQB0+u9V46MGC9CCK MCw5PB2c0D8tBQlJmFcQR5m2n2rr6ueEgiu1nhqvF8+6SirLc1FkLckwKKIzTXoI3gg+TI EWGYe8WL/lsgvDqnusmZWclMnVEM1mnLIa0ocMfEm71nJQ94pCSZFaYUE6VL2djOyjOPgu gLamk/ak/zGMCiSuTouUrYVm6q2G58Sqm2+c4IdOVLlir/D9vEn82ZJOl9xCIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726670692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OfXaCyTv2tQLx3by6H8DLb6IzgWHnrgjBaLvdKtq59E=; b=rv5VcSUxKeN8VYcTaE1SYp6LpxJr0bA9ZKOtrqAxjJpvsiK/3n59RbYn7aWF5DL/uQhZw4 R6UxxqNLUpDe3tDiD8yUfeQ19xj6L2q+YMhd1fKKGjkCMJ/gKlRCXan37c8ZY8mGcYKXYx pTy7sGTMfOFffUL4elvhIaMaMHKDlmOXl2k0kBu9KPFnThRl2OyPSkckyFrywZK0/A3J34 I/3om4VInF99xsjL/S34g5UXZtkTpiC8VdgGC8J10Im6WrphSEuu9VmuEA8te8m5H4GCtE cPCZ3t5VSAJfs68iXI+/9L+QoTOrHKaAIm/NmCXfT3QDIME5cCpMLP58MmzXdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X81dc0rQFzQYr; Wed, 18 Sep 2024 14:44: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 48IEipCr020115; Wed, 18 Sep 2024 14:44:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IEiphJ020112; Wed, 18 Sep 2024 14:44:51 GMT (envelope-from git) Date: Wed, 18 Sep 2024 14:44:51 GMT Message-Id: <202409181444.48IEiphJ020112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 77d7da1dc85a - main - Revert "mca: Allow for passing ECC error record to memory controller driver" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77d7da1dc85a8037ac385824bafcd06abcdcbcfa Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=77d7da1dc85a8037ac385824bafcd06abcdcbcfa commit 77d7da1dc85a8037ac385824bafcd06abcdcbcfa Author: Stephen J. Kiernan AuthorDate: 2024-09-18 14:44:37 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 14:44:37 +0000 Revert "mca: Allow for passing ECC error record to memory controller driver" This reverts commit 996a832d2e01fceb5a3bbfd33df585bd778e6288. --- sys/x86/include/mca.h | 5 ----- sys/x86/x86/mca.c | 48 ------------------------------------------------ 2 files changed, 53 deletions(-) diff --git a/sys/x86/include/mca.h b/sys/x86/include/mca.h index d8b8da86523d..183480625f6d 100644 --- a/sys/x86/include/mca.h +++ b/sys/x86/include/mca.h @@ -46,11 +46,6 @@ struct mca_record { #ifdef _KERNEL -typedef void (*mca_decode_func)(void *, const struct mca_record *); - -int mca_register_decode_func(mca_decode_func func, void *aux); -int mca_deregister_decode_func(mca_decode_func func); - void cmc_intr(void); void mca_init(void); void mca_intr(void); diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c index 89ab59639882..b293fcedbd84 100644 --- a/sys/x86/x86/mca.c +++ b/sys/x86/x86/mca.c @@ -99,8 +99,6 @@ static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); static volatile int mca_count; /* Number of records stored. */ static int mca_banks; /* Number of per-CPU register banks. */ static int mca_maxcount = -1; /* Limit on records stored. (-1 = unlimited) */ -static mca_decode_func mca_func; -static void *mca_decode_arg; static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Machine Check Architecture"); @@ -423,50 +421,6 @@ mca_mute(const struct mca_record *rec) return (0); } -/* - * Pass mca_record to a memory controller driver so that it can decode - * the address and possibly do some more work. - */ -static void -mca_decode_record(const struct mca_record *rec) -{ - - if (mca_func != NULL) - mca_func(mca_decode_arg, rec); -} - -int -mca_register_decode_func(mca_decode_func func, void *aux) -{ - int error; - - if (func == NULL) - return (EINVAL); - - error = 0; - mtx_lock_spin(&mca_lock); - if (mca_func != NULL) - error = EEXIST; - - if (error == 0) { - mca_func = func; - mca_decode_arg = aux; - } - - mtx_unlock_spin(&mca_lock); - return (error); -} - -int -mca_deregister_decode_func(mca_decode_func func) -{ - if (func == NULL || func != mca_func) - return (EINVAL); - - mca_func = NULL; - return (0); -} - /* Dump details about a single machine check. */ static void mca_log(const struct mca_record *rec) @@ -659,8 +613,6 @@ mca_log(const struct mca_record *rec) } if (rec->mr_status & MC_STATUS_MISCV) printf("MCA: Misc 0x%llx\n", (long long)rec->mr_misc); - - mca_decode_record(rec); } static bool From nobody Wed Sep 18 15:24:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X82W05sw4z5Wbmp; Wed, 18 Sep 2024 15:24: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 4X82W05F7Lz4L62; Wed, 18 Sep 2024 15:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726673052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uwoja4B21F17yIefl9Je+LXhKOpkvMEjXCJeQ6Enb5M=; b=goTL3VCgH5/6+OlNQ4ZH4/7iMbuCjWTsM10/a+eI/2Gmnmj39FIM2pJeaF2MRpTyuArq/X K9MvGGizFy1H7DBJUPljJ5r+Z9GZjORlezR295+1FrvHucQwWwgIw7y8oz8bC5maraNBen tWjXsz3KiQ174ix3DmnSwlEiZy1f925x8Nvyis3C1GKyJa3W+VYboP351+gFAg3YVEs/z+ t4kzNXScQTz6dAK2pLBEZldnm3EPtRbn2xwzcKETGX0e1tQZ0rVkq5AxyIwhmN6egTZf+J 72oT5n+Fm4YI8YvpycEkD8zlZhJJky0Z4X4I+P+7aUydniG/ZNSCzGS96OLlgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726673052; a=rsa-sha256; cv=none; b=GlKTKQ3MAO/bTaKniCQB2rwsHSZM0BrfSNAZPMHfBHO7M0NpVu6wJXPSdmqd9jUPj5mfgs xyxtUAZ8xMc0hmYOSFcpheMg8KYys+k8DKwN8daSG4SXF/OVMzLeFp0MWBP+1EHrHt+eQ0 Em94VJj52P8KXF7jb+eBxg6DO/8sZqnjmRvHk9t8H2HA+vmH3c9gdNdoUKN8K2TUENljB1 q2m8G+E8xlyVojhLt8U+vlAftUClwuWgivm9CG0E9vPYvLl0KnxVbCrT4CLqO8T19UmQsv 8oIlOqgEmhCzr8cQupWl2+vb6vMmVDAF+pe/OazMWgNtyuzJyng22dtOBU0r8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726673052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uwoja4B21F17yIefl9Je+LXhKOpkvMEjXCJeQ6Enb5M=; b=KZMGDHpGQcmHUXB3IgPIqsj1J+G/WqQ1v0IsEx78cK9GJpFFBIDWzeAzOT8AvrTF2PL9hK qmIgBd4/9LW71H+BecCIIXZi8H61l2Al/IvgEvt9el5x6mXOLbIii/XU2SSo+hgtCKg9dm Qgwfi2ZnR43Bc9kWqexz9n/89XKWwoOKg7YgkSYkNPuvT/AvYsBH3EYd82INCRWf82XKsl oeLsS/UPx9O4PUvYPAbvOrKLXA9DZcZ6c0dIVzA2rJcrigME3Z0KXbvBwD3QKn6FMa+7C6 ixdnh2TWfCRnWcW4Tq1WWJzWPMsvTrWTHw13x2Zf75fUlnzi/kFobR/EdB5qhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X82W04rdJzRbQ; Wed, 18 Sep 2024 15:24: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 48IFOCHG088678; Wed, 18 Sep 2024 15:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IFOCWt088675; Wed, 18 Sep 2024 15:24:12 GMT (envelope-from git) Date: Wed, 18 Sep 2024 15:24:12 GMT Message-Id: <202409181524.48IFOCWt088675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: e47161e5f1f0 - main - loader: update dependencies for dirdeps build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e47161e5f1f01ef300c6e7efdb9c92e3a6c497ff Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=e47161e5f1f01ef300c6e7efdb9c92e3a6c497ff commit e47161e5f1f01ef300c6e7efdb9c92e3a6c497ff Author: Stephen J. Kiernan AuthorDate: 2023-04-19 17:48:53 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 15:22:34 +0000 loader: update dependencies for dirdeps build Add dependencies for MK_FDT and MK_FORTH knobs Update dependencies for MK_LOADER_LUA knob --- stand/efi/loader/Makefile.depend.options | 10 +++++++++- stand/uboot/Makefile.depend | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stand/efi/loader/Makefile.depend.options b/stand/efi/loader/Makefile.depend.options index 20292bab9bcd..33c99a773af5 100644 --- a/stand/efi/loader/Makefile.depend.options +++ b/stand/efi/loader/Makefile.depend.options @@ -1,7 +1,15 @@ # options that impact our dependencies -DIRDEPS_OPTIONS = LOADER_LUA +DIRDEPS_OPTIONS = FDT FORTH LOADER_LUA + +DIRDEPS.FDT.yes += \ + stand/fdt \ + stand/efi/fdt \ + +DIRDEPS.FORTH.yes += \ + stand/ficl \ DIRDEPS.LOADER_LUA.yes += \ stand/liblua \ + stand/lua \ .include diff --git a/stand/uboot/Makefile.depend b/stand/uboot/Makefile.depend index ce51494084aa..4f7d14fe96fe 100644 --- a/stand/uboot/Makefile.depend +++ b/stand/uboot/Makefile.depend @@ -3,6 +3,7 @@ DIRDEPS = \ stand/fdt \ + stand/libsa \ .include From nobody Wed Sep 18 16:30:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X83zC2cNxz5WlC5; Wed, 18 Sep 2024 16:30: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 4X83zC1B5nz4S0W; Wed, 18 Sep 2024 16:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726677015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xPJtYPPmy9Sib3x8pLq9dYaSSgxBzMsoH49BzGMgNpw=; b=PMvp9Zi1iSoYR14BLyxRKZPQSNMxlHNev8RgiVmMH7sJuLSXg9EV/nv38XsOaqht+J08nQ o2K9vIiLn/FF0I6dFBx1jZ0XVSBECnJuTklO9jYR80tFAOmteldzabX9ARvI6+xUcnB8kA +4KB8bQ44gOkoHeOY0XhNWuIDFCOp0ure5htHbUVwRm2w7uoXk+UaK4rZEgP3a7GulzRqV ikzgSTUjoIY7LuiUjv98pBmfjoWfJG0N9petGw+nUAhAy1qnFHS//laJRYJOc+5kyxKBWn DiY8kOJOLw9IS5gU9sRRYnVytiQJU5R7YIBxSMrL5hvEPlCpCZfrV+r5ArV4xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726677015; a=rsa-sha256; cv=none; b=J92ifjuZQvwyYtNf3d4fayf+yz6KKg8OEHclvqhALrPGmZyvvBvHR9EmkNATWs5kbwrsVN jnUqbgikZgCYEC8Blfz7AqaRYusMaUhVi1x4De7MTkd9nlV2JeGMSnjteCTCkkO6D/M/d6 eNmEWct6JnoPfI1Xdxqv/357ra4mhPEiEZojGIZfl4w/5+f8WqKfJKX+GcMHQTcrCi9p77 hF2X59MHpD3KVA3rXLyBL58/879sAdiY2fqJ2WlmvaOFlKJLTfulwqKy1kLucaXgmzpPS5 h0oIH90qs1tCxKjPBWQQ5uLHGPVwi9RLXmWeMmkHgtXlMTqxpytMFny1U7p8Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726677015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xPJtYPPmy9Sib3x8pLq9dYaSSgxBzMsoH49BzGMgNpw=; b=G0hrSUAHeOqMzFzo6MuRmtbfUWQFia2AjZ5Iu/Lbbo3jXSQ8DYunQDx7kzySQd8kBpTk4x Oehg3cxAuUtzRjWGchZwRykgT+UW/Frx2exdhlGiLTN07BjXjpXOBaH5S18CmV0No+wYoO TSuKBCgo9X3A+nk7+glWovPvIj9PaDcF5EJPrzDB3esTHdPh+f6URfyxOJ8r+Hj7NQxZan UKXS+roo4HQYUBtKGTuC1UVZnxxxzgRWo+8RKMNwxNw0aePpxrweZG8LRe6tAI6v49x2Sb 9HF6IncLoDxiubqmN0wojCYewXOunN207Xiuc0RqL+FKQanjsQ2LmJLUgrmhbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X83zC0npVzTm2; Wed, 18 Sep 2024 16:30: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 48IGUF1Y098806; Wed, 18 Sep 2024 16:30:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IGUFZS098803; Wed, 18 Sep 2024 16:30:15 GMT (envelope-from git) Date: Wed, 18 Sep 2024 16:30:15 GMT Message-Id: <202409181630.48IGUFZS098803@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: abed32f91d01 - main - realpath(3): Minor style issues. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abed32f91d01d91faa709622e3279e9baec37272 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=abed32f91d01d91faa709622e3279e9baec37272 commit abed32f91d01d91faa709622e3279e9baec37272 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-18 16:29:55 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-18 16:29:55 +0000 realpath(3): Minor style issues. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D46695 --- lib/libc/stdlib/realpath.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 554d70b43a29..28348ea9e226 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -33,10 +33,10 @@ #include #include +#include #include #include #include -#include #include #include "un-namespace.h" #include "libc_private.h" @@ -146,13 +146,14 @@ realpath1(const char *path, char *resolved) return (NULL); } slen = readlink(resolved, symlink, sizeof(symlink)); - if (slen <= 0 || slen >= (ssize_t)sizeof(symlink)) { - if (slen < 0) - ; /* keep errno from readlink(2) call */ - else if (slen == 0) - errno = ENOENT; - else - errno = ENAMETOOLONG; + if (slen < 0) + return (NULL); + if (slen == 0) { + errno = ENOENT; + return (NULL); + } + if ((size_t)slen >= sizeof(symlink)) { + errno = ENAMETOOLONG; return (NULL); } symlink[slen] = '\0'; @@ -173,7 +174,7 @@ realpath1(const char *path, char *resolved) */ if (p != NULL) { if (symlink[slen - 1] != '/') { - if (slen + 1 >= (ssize_t)sizeof(symlink)) { + if ((size_t)slen + 1 >= sizeof(symlink)) { errno = ENAMETOOLONG; return (NULL); } From nobody Wed Sep 18 16:45:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X84K40mM7z5Wn63; Wed, 18 Sep 2024 16:45:44 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X84K40Cdzz4T93; Wed, 18 Sep 2024 16:45:44 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726677944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G+FFZ5brmp4NuOqhwf092DHQU6jsAVylSJNGY9W9piU=; b=I1aw1QD5XQlQvBw455hBsmIntLO0ljo+Gd9ONjfgZBa4e9ClHMoPg/DIwj07H+OVhPSIuY HweBAgzwVn25I0idlI+3k+jODvrBEFJvSsWYdqDhBgv58jZOaPEgd7uQlhD5OFh1Ejv5Ij JMZBeO3OCU1ahv3GCLV+4/JGyMAIwfAPGnJQgICgkIiifBYBZThbmSPdHHx68Zmd7gIfYa yaW8Aj7mgXqJaoRZ2igM3JVTh7ow2QqKJHib2hqNrorWXsOTfbBCgPNRpADs+O+V0oKlmC BQ7X5vLGGGw+lkID30wur9+tD2/wdmLTMv80l1664UVzZArioowNcx9IxSo1Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726677944; a=rsa-sha256; cv=none; b=hGMUxboZND4J7vs9UeNJxH5LV74zqu2B/4fM9ZgnmQ2nBzO4z207O3ElOpBMVq0SzAMAhY 2l7Fp1hSZBuqJs6YFKuMzTseqXSxCT+P8SZpAoMDHK3fv/8icD4wILx/dmiyxR4oc/Wlvz hWMkA/V8PbmHQwGmbZVKxzH4jbmvZYAGBR0UASdgbj2UwH5bkvq+cb/MXpeMO52RSHiPtS OoTShTEwzCknU8ZG+21s5ovRVqzc/F+vSHxxvrIpt2hi5jItffdI9s+v7kO1OKBmfnpnHg Laa8iAgFGbryMWxccat4fgH+L2VmZtiF4jN8unFapq2Q3cnl4yTIJgOuRvMn3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726677944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G+FFZ5brmp4NuOqhwf092DHQU6jsAVylSJNGY9W9piU=; b=K2or3qFFJR4+WIawvp45EdQ1abB8sXk1F/Ig2RwqXiXmbnLnv//+C95RQzzI+9Zynb5Oit wYvm6vxhPxItS7T6uRkehj5NvUDvBW0b7izIZwHy7BzyEkvnbXUVi38YGaaFIaUr/Qinhe c0nVX621PBEI4guMpoiyRnvcksnSdykI6zoeAzG8c9ARb6eitdrINLnnUli+kUbTm3lGD6 gcLqMqgS9WBm/u4FhIQ7T76SV1DFcx5mt7ebOzWxxyNsx/hcIPvOGvD5O+ACJKMgUaX3FK v7/6Vo8RK+gpck5UJF53FNT/aB+69kfL4hxCPTj8omZs8Jk5KBYinTzYeQjs4A== Received: by freefall.freebsd.org (Postfix, from userid 1033) id D1B1619A93; Wed, 18 Sep 2024 16:45:43 +0000 (UTC) Date: Wed, 18 Sep 2024 16:45:43 +0000 From: Alexey Dokuchaev To: "Stephen J. Kiernan" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 77d7da1dc85a - main - Revert "mca: Allow for passing ECC error record to memory controller driver" Message-ID: References: <202409181444.48IEiphJ020112@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409181444.48IEiphJ020112@gitrepo.freebsd.org> On Wed, Sep 18, 2024 at 02:44:51PM +0000, Stephen J. Kiernan wrote: > commit 77d7da1dc85a8037ac385824bafcd06abcdcbcfa > > Revert "mca: Allow for passing ECC error record to memory controller driver" > > This reverts commit 996a832d2e01fceb5a3bbfd33df585bd778e6288. Why? ./danfe From nobody Wed Sep 18 17:02:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X84hp0TzSz5WpVJ; Wed, 18 Sep 2024 17:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X84hn6rj4z4Wxr; Wed, 18 Sep 2024 17:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726678970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4DDGUhkYxzIbKh0WQvtJqLF7Y0dFSNuqwTOTq1wVFE=; b=lg8bd2Fr4scfKBFMeOz6cuiFAWBrIINet0AlaNXwkydRP1IxaelTMeq7ahUerToT2j4edu Z/b3wEE68WDAN0878oj4lHzuBGnkGv2uvcmwxgY2Yva1wwsz6DTmBoxZeu+Tdn9DefYpnn KWtRVGF/xpT8TLYjasMTptBTZozThnLGLZ68+gAZtRh+9F2V+hmmHYPIVb0lVVQUQiKYr+ gIbmgvuczpP+yW1Db3pHXFfwz1aRssmJW6OXLB88xmK029zmMyPt3DiPtkpvakQStS/hZ7 6w/MG2+PtyDoRqb2Fc9/U5Usu/00+g9IR47ssOu8NRTJdDcLPlxKxsj92Nas0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726678970; a=rsa-sha256; cv=none; b=gMeDSwTcePT69G8OTNuan/UXkcfrkyz+Ue+HU0B2MtDffol/8MCKNiIYPaszP10U6wK7fO CiTtr+lEeI3NL/vDRtmRQJWGdCC4lnaDLknER19ahneW/tDLlhbisX34+MDTWIBSQoNc62 XIPlkkXwLkyICbx9fZZ6sCPDsFdQvR1F/tdKJRHOJmy9Kzrgo0Mb5LWXd3RganASi2TD3P fQCS5eCJNiNeTNGORBEBwAoi1yi6QTZFk9v2lckxBNShPaBnLlkhAL6+bTWCV48P9Jzy0A 0e/NcFYjpaAxRobpAPWjms+aICG84TFEjAOFokRwcChYhRAJAv7pnGKcXRt1SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726678970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4DDGUhkYxzIbKh0WQvtJqLF7Y0dFSNuqwTOTq1wVFE=; b=OC0BGjlVa+ZD9t5Kv1zwEsczUw+lfzu1g9IQQVq0uwvYUenwNRc8V+AQfncFGMf7+3q9wA Z2g+Euy5L5Wh2B2XfdOkTiGXJATSuO/Y8sKrv/Wnva7aruzTsPsKz3oxNc8ZS6U5/Wd1/0 BBVsKMVqfztau4kr9/Y9mHsAWTYqfunIaMdYDz142gO4lIaVQzPVn0/q9v3JcCnNrPRcJC KR0qtZij9V6Mea7TM36+5alur5cZkncRwNlyV6Ybf7/ZOQN4d+JtIYnJkYQ/e7bi8NFbSM d8TxhvNPBd2TN8JY/gyA7NKfyNB4e7Mip+VPz2l8KZUB/br51KCIMg2AgVsKFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X84hn6PFDzVnB; Wed, 18 Sep 2024 17:02: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 48IH2ndv059239; Wed, 18 Sep 2024 17:02:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IH2nM7059236; Wed, 18 Sep 2024 17:02:49 GMT (envelope-from git) Date: Wed, 18 Sep 2024 17:02:49 GMT Message-Id: <202409181702.48IH2nM7059236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 9e2b87207ba1 - main - Allow additional "options" files to be specified in kernel config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e2b87207ba1949f402e169416f63ab5cdbf3dd4 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=9e2b87207ba1949f402e169416f63ab5cdbf3dd4 commit 9e2b87207ba1949f402e169416f63ab5cdbf3dd4 Author: Stephen J. Kiernan AuthorDate: 2024-09-18 17:02:42 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 17:02:42 +0000 Allow additional "options" files to be specified in kernel config The "includeoptions" directive can be used to specify an additional options file to be used. This is useful in conjunction with the "files" directive for build environments to be able to add custom files and options. Add "-v" flag to enable verbose mode. Added some additional error messages when in verbose mode. Obtained from: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D39540 --- usr.sbin/config/config.5 | 9 +++++++++ usr.sbin/config/config.8 | 4 +++- usr.sbin/config/config.h | 2 ++ usr.sbin/config/config.y | 22 ++++++++++++++++++++++ usr.sbin/config/lang.l | 1 + usr.sbin/config/main.cc | 7 ++++++- usr.sbin/config/mkoptions.cc | 21 +++++++++++++++++++-- 7 files changed, 62 insertions(+), 4 deletions(-) diff --git a/usr.sbin/config/config.5 b/usr.sbin/config/config.5 index f77b79a31510..8c2c62b706bd 100644 --- a/usr.sbin/config/config.5 +++ b/usr.sbin/config/config.5 @@ -239,6 +239,15 @@ Read subsequent text from file and return to the current file after .Ar filename is successfully processed. +.\" -------- INCLUDEOPTIONS -------- +.Pp +.It .Ic includeoptions Ar filename +Specifies a file containing a list of additional options +specific to that kernel configuration file. +This is useful for build environments that need to add +custom options and is often used in conjunction with the +.Ic makeoption +directive. .\" -------- MACHINE -------- .Pp .It Ic machine Ar arch Op Ar cpuarch diff --git a/usr.sbin/config/config.8 b/usr.sbin/config/config.8 index ccb61cdf2786..e0912a4bc104 100644 --- a/usr.sbin/config/config.8 +++ b/usr.sbin/config/config.8 @@ -33,7 +33,7 @@ .Nd build system configuration files .Sh SYNOPSIS .Nm -.Op Fl CVgp +.Op Fl CVgpv .Op Fl I Ar path .Op Fl d Ar destdir .Op Fl s Ar srcdir @@ -99,6 +99,8 @@ file. This option makes sense only if .Cd "options INCLUDE_CONFIG_FILE" entry was present in your configuration file. +.It Fl v +Turns on verbose output. .It Ar SYSTEM_NAME Specify the name of the system configuration file containing device specifications, configuration options diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index 16562a7f8210..6085c52d1b95 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -260,9 +260,11 @@ extern const char *yyfile; extern STAILQ_HEAD(file_list_head, file_list) ftab; extern STAILQ_HEAD(files_name_head, files_name) fntab; +extern STAILQ_HEAD(options_files_name_head, files_name) optfntab; extern int debugging; extern int found_defaults; +extern int verbose; extern int maxusers; extern int versreq; diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 4120ffa54b1c..15139197dbb6 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -24,6 +24,7 @@ %token NOMAKEOPTION %token SEMICOLON %token INCLUDE +%token INCLUDEOPTIONS %token FILES %token ENVLINE @@ -83,6 +84,7 @@ int yyline; const char *yyfile; struct file_list_head ftab; struct files_name_head fntab; +struct options_files_name_head optfntab; char errbuf[80]; int maxusers; @@ -93,6 +95,7 @@ int yywrap(void); static void newdev(char *name); static void newfile(char *name); +static void newoptionsfile(char *name); static void newenvvar(char *name, bool is_file); static void rmdev_schedule(struct device_head *dh, char *name); static void newopt(struct opt_head *list, char *name, char *value, int append, int dupe); @@ -135,6 +138,10 @@ Spec: include($2, 0); }; | + INCLUDEOPTIONS PATH SEMICOLON { newoptionsfile($2); }; + | + INCLUDEOPTIONS ID SEMICOLON { newoptionsfile($2); }; + | FILES ID SEMICOLON { newfile($2); }; | SEMICOLON @@ -335,6 +342,21 @@ newfile(char *name) STAILQ_INSERT_TAIL(&fntab, nl, f_next); } +/* + * Add a new options file to the list of options files. + */ +static void +newoptionsfile(char *name) +{ + struct files_name *nl; + + nl = (struct files_name *) calloc(1, sizeof *nl); + if (nl == NULL) + err(EXIT_FAILURE, "calloc"); + nl->f_name = name; + STAILQ_INSERT_TAIL(&optfntab, nl, f_next); +} + static void newenvvar(char *name, bool is_file) { diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l index a6558237db5a..2052d98d1fdd 100644 --- a/usr.sbin/config/lang.l +++ b/usr.sbin/config/lang.l @@ -80,6 +80,7 @@ struct kt { { "nooption", NOOPTION }, { "nooptions", NOOPTION }, { "include", INCLUDE }, + { "includeoptions", INCLUDEOPTIONS }, { "files", FILES }, { 0, 0 }, }; diff --git a/usr.sbin/config/main.cc b/usr.sbin/config/main.cc index 0c0b9bb27dc3..1e89cbf3230a 100644 --- a/usr.sbin/config/main.cc +++ b/usr.sbin/config/main.cc @@ -78,6 +78,7 @@ char srcdir[MAXPATHLEN]; int debugging; int found_defaults; int incignore; +int verbose; /* * Preserve old behaviour in INCLUDE_CONFIG_FILE handling (files are included @@ -130,7 +131,8 @@ main(int argc, char **argv) STAILQ_INIT(&ftab); STAILQ_INIT(&hints); STAILQ_INIT(&envvars); - while ((ch = getopt(argc, argv, "Cd:gI:mps:Vx:")) != -1) + STAILQ_INIT(&optfntab); + while ((ch = getopt(argc, argv, "Cd:gI:mps:Vvx:")) != -1) switch (ch) { case 'C': filebased = 1; @@ -165,6 +167,9 @@ main(int argc, char **argv) case 'V': printf("%d\n", CONFIGVERS); exit(0); + case 'v': + verbose++; + break; case 'x': kernfile = optarg; break; diff --git a/usr.sbin/config/mkoptions.cc b/usr.sbin/config/mkoptions.cc index 1580700dc08d..3b5ed17e455c 100644 --- a/usr.sbin/config/mkoptions.cc +++ b/usr.sbin/config/mkoptions.cc @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "config.h" #include "y.tab.h" @@ -71,7 +72,9 @@ options(void) } if (maxusers == 0) { - /* fprintf(stderr, "maxusers not specified; will auto-size\n"); */ + if (verbose) + fprintf(stderr, + "maxusers not specified; will auto-size\n"); } else if (maxusers < users.u_min) { fprintf(stderr, "minimum of %d maxusers assumed\n", users.u_min); @@ -363,8 +366,15 @@ read_option_file(const char *fname, int flags) char genopt[MAXPATHLEN]; fp = fopen(fname, "r"); - if (fp == NULL) + if (fp == NULL) { + if (verbose) { + getcwd(genopt, sizeof(genopt)); + fprintf(stderr, "Unable to open options file: %s\n", + fname); + fprintf(stderr, "CWD: %s\n", genopt); + } return (0); + } while (!(wd = get_word(fp)).eof()) { if (wd.eol()) continue; @@ -417,6 +427,7 @@ static void read_options(void) { char fname[MAXPATHLEN]; + struct files_name *nl, *tnl; SLIST_INIT(&otab); read_option_file("../../conf/options", 0); @@ -426,6 +437,12 @@ read_options(void) (void)snprintf(fname, sizeof fname, "options.%s", machinename); read_option_file(fname, 0); } + for (nl = STAILQ_FIRST(&optfntab); nl != NULL; nl = tnl) { + read_option_file(nl->f_name, 0); + tnl = STAILQ_NEXT(nl, f_next); + free(nl->f_name); + free(nl); + } read_option_file("../../conf/options-compat", OL_ALIAS); } From nobody Wed Sep 18 17:04:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X84kh2ZwFz5X4jc; Wed, 18 Sep 2024 17:04: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 4X84kh23PXz4XVb; Wed, 18 Sep 2024 17:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726679068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0wKpZTmrnOL1kBGpd3mVnYFmqBCw6w/jPcxU+HwTvuQ=; b=O+kjIKfPiBM1V/zRtPs2lWaZnRo75xxyEb3icz/kRh1kz3ha0BOjr/txCcZofGJVUHEK4f go6VNlO8HoTPT2lFskaZxqP38TIJSqZVa0vZp2vH7sMNG5WLRP1X8WNZn/FmpRWc3wKU6x DWff15YPsqe6I7ee5T36K1VKPHN56GM9GuogtteUGo/4BXjZCBNwmv2JcX4ChIxpiuNZ/D nRgR3Vq4ptyC8kQFDomKmf2ZUP5JhVBUlEg8x+hRUa8kQLMt6HMuFi4crKjsNlvbPJ975M AavC3Z8J0AupXZOX5aMJ/SM5NnPOJdkmAf6kUJVSRo/CGUStmZPWuVvqDUeMmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726679068; a=rsa-sha256; cv=none; b=wz+ktdRKY/LTnhMtK0ZlDMmxr+wn1lkbjK25hMjm66emVLhzgAMMouAr40x4psNmpHZSFh 4Nx9Qk4qlnPKUXhwtjd2EIUfJ1l08d8jThghQkk+6vBJhnmorjqZXdYU6GBkTlpocy3xSq hPj8kNyqR1aqEKvHSh20WryPf3sW+N5A1GwqHWfUwAnXluLxOjxBaoPg79tYxap23a62LL dlw5EOCxUeEbPXcip1IGTPQXmBrBsZfiz6wX4o7B6uyizqkYp16QIr+UlvSPCR88MdnZLx Volx+kpYxRGYxJpZb9dpci+Mk9qtvQh8RkxPDZGGRsgdXcqqLNk+fKCSbok4Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726679068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0wKpZTmrnOL1kBGpd3mVnYFmqBCw6w/jPcxU+HwTvuQ=; b=kHp4Sj6N+Mev4sIGU9F3V5XF7PAaweXuY5dM4dyvuBF9R4rrtUKZQyYb4oB+8L9eDQs5bq sWPW4367fKdoXkEZtl+ORz4uxhQo3XfpzBy5rQlXXOAV37g407c7ESfo1ugFUXDhWr8OPu tGfI561oUq5XW8IXORf14GLq6EyBol+yvIj9MwQro8zl9GNBR4dJLeV6PtXrzWr71Ixzo2 zVgAY34WrUbkAhKHxG4zqheFXx4dKa8cVmniEE2wi2QrspfES3MfLnyFEdQUIHzi3ozEy0 gY7JIvxmZuNdFF4uZQFAIzb0vEEmJF+kYsW28JAOwunMUHN8IHDany5ptoMbOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X84kh1fxHzW65; Wed, 18 Sep 2024 17:04: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 48IH4SKL059584; Wed, 18 Sep 2024 17:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IH4SMc059581; Wed, 18 Sep 2024 17:04:28 GMT (envelope-from git) Date: Wed, 18 Sep 2024 17:04:28 GMT Message-Id: <202409181704.48IH4SMc059581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: c644d3d8967d - main - libsys: Add dependencies for dirdeps build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c644d3d8967d77a39d5ee7dfa9a8a1d84facf40c Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=c644d3d8967d77a39d5ee7dfa9a8a1d84facf40c commit c644d3d8967d77a39d5ee7dfa9a8a1d84facf40c Author: Stephen J. Kiernan AuthorDate: 2024-09-18 17:03:42 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 17:03:42 +0000 libsys: Add dependencies for dirdeps build --- lib/libc/Makefile.depend | 1 + lib/libsys/Makefile.depend | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/libc/Makefile.depend b/lib/libc/Makefile.depend index 69e7d1f9c9fd..fc708c6794b9 100644 --- a/lib/libc/Makefile.depend +++ b/lib/libc/Makefile.depend @@ -6,6 +6,7 @@ DIRDEPS = \ include/rpcsvc \ lib/${CSU_DIR} \ lib/libcompiler_rt \ + lib/libsys \ usr.bin/awk.host \ usr.bin/yacc.host \ diff --git a/lib/libsys/Makefile.depend b/lib/libsys/Makefile.depend new file mode 100644 index 000000000000..b623a86fc1ce --- /dev/null +++ b/lib/libsys/Makefile.depend @@ -0,0 +1,15 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libcompiler_rt \ + usr.bin/awk.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From nobody Wed Sep 18 17:05:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X84ly1x8Jz5X4kL; Wed, 18 Sep 2024 17:05: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 4X84ly0tf5z4Y8q; Wed, 18 Sep 2024 17:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726679134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QvDAggqbaYPv8zu2NGKSAjckLrVOKVz/F/iZKokQ+Rw=; b=kNe6AUBN+ov6wyJxxEQFtPfRSfOrf1mQHgRmaZv9U40umXOj20dvrsnMRSgti6V7LBF1Cl WIG6xdmwf+wc6xVaCcSPRDvh/HVOt9xy+9+cEyeIoUZniRRPV5Q4176C/kzJy3W7EqqwGT ERKWC70zpBzm0o/oiMrSHbEFr2WnpnTWxQyDR0/nrvMXuPmXFZwkxfyzriwZN+X2fR1YTN thsHmT6ahC4JdRc/DcQgR1P+IY2vfdm8huQkp1t9QZo/SGoHT3P+BrAccXjdoE9C+uZ8Q0 xInO71QmktG1t/wjwXI73YpOSv/3vfE8ow6ai1g95arTGmTXxqkRui6+7Lv/1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726679134; a=rsa-sha256; cv=none; b=oIRVmO6VijrIeoBsI/wnv+tS5XFGkToUw/XeacvR5yiXqbnMYbI/tuMEE3JFEvLmUlOEPM ohDfmGaD0bwNkRPG2v9e5LYsCYfhjBtysXyjwGDhGL9OCVb0czyPQFYhuCP/rvZ1fE4g2G 1bGPoEOOSv8rO8riPcwz0Y8nIRlXZDUwBTIZ1Gk2Q8Iexyn7J/RjBFvEI3R3qLxfmg2MnS hEbnpB0R4+797nnjx3z+hddowHZObzThulbmL5ou/oWKGs1xYFWBMp2Dy0aB0WzHDr7CO4 2+6pRdnYyw//lERUzZg6JimlBo5PUkIwdRgdo4uUFq1rAVltqipUvsSSXIRbsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726679134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QvDAggqbaYPv8zu2NGKSAjckLrVOKVz/F/iZKokQ+Rw=; b=lwLlzClvwuUVfnKkABIZ6t6FT+6AtOjmOZ87+NBLfItOXmkGEFPJgCpUrIEOT4oAXGG9NZ FktSiL/J5LPDUFR1tuFqIhCivQCOVU6FbhC5HQ+jAlCVdrr8yyn+4sRbTmZYZk80LTP74a Qf0pcdT8Umndz4RYi0ASBEKxgpU7krp+QeRQjZ57qqU3axdC/TPlhHpdWIOE+fllVg8dnw JCE22X7HqN4IsxOabrckmNNk0tksp8/rOuMec5ipgstozk2jz4LhXj84gnn88PVFwqQ9pX 9SWVHIAXRqkx0x5E7gt0yyr4MIjh2893v7eAk3aSjKyHadVOOTTtfJEaCvfMXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X84lx6bY6zW66; Wed, 18 Sep 2024 17:05: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 48IH5XoX059886; Wed, 18 Sep 2024 17:05:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IH5XXA059883; Wed, 18 Sep 2024 17:05:33 GMT (envelope-from git) Date: Wed, 18 Sep 2024 17:05:33 GMT Message-Id: <202409181705.48IH5XXA059883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 0a88678fcabc - main - awk: update dependencies for dirdeps build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a88678fcabcb895f62879b7c9d87522ad3ae9b6 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=0a88678fcabcb895f62879b7c9d87522ad3ae9b6 commit 0a88678fcabcb895f62879b7c9d87522ad3ae9b6 Author: Stephen J. Kiernan AuthorDate: 2024-09-18 17:04:43 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 17:04:43 +0000 awk: update dependencies for dirdeps build When building "awk" for the host, we need yacc to also exist --- usr.bin/awk/Makefile.depend.host | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/awk/Makefile.depend.host b/usr.bin/awk/Makefile.depend.host index 11aba52f82cf..bcfd629f3335 100644 --- a/usr.bin/awk/Makefile.depend.host +++ b/usr.bin/awk/Makefile.depend.host @@ -1,6 +1,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + usr.bin/yacc \ .include From nobody Wed Sep 18 19:54:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X88VW2d2jz52Dg9; Wed, 18 Sep 2024 19:54: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 4X88VW1k51z4rDw; Wed, 18 Sep 2024 19:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726689251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y+smNCLm3TKM27dI+RWFsKl+CCAcLwaoDtdKnSC0DI=; b=L1lZmR4myt8YUHfAzZdoRwALdIGy77NUO1nGS0+pR9b68Ww80I8fvUtzw4VB2o0t0K8IqY x/1lz/evv0LF38JtFmV7IgkrPHE9imuVbZdSM9k2eSzEjJx1YdDKj+2G11qA3TWIMAc2pR 74M5lLb3Fm14XMCpYfQ9uSoUmtT73EGLLj5W20YsXm1ArytvvPzk2HYJCudQN6zoZtr27c 1Mk9eocSPgPFvf5bEbNFy9pinFLgT2Mgd9FrfYZ88uvmnwKNYhCBlE2FK/ZrYtnhhTKuoh wWyDOX9QGAHF/cKqgM8fKML0e9qYDoubCG0dNeoKf/g7yf8e8jJ/q5XG7saSig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726689251; a=rsa-sha256; cv=none; b=SWAK/bZv00RWy0A2BUE2z/eKYDRZMD6/fOoGg7Mhcu0trfkyhXH4g1MX24f35ZNtvtlCYM BSzend2qSrGJU+24kfWIFIdNr+qG75M8COe/LLECya0x8rSevUOnitv/ZVpqTpvkGCLE6h VjQD7w6sg3sjFQfx+SJ06V2QG7wPtpSl8Rn145YOjzHKIvy8teQn9Hsljp62XvfiRtGuaB pkjkv0+73m5dktDYCZiDZp7r+XUpDCHwXVKmZDITAE5QpNO20LnSAEFRd69OyqY6lo7icg /QhXbfojV14gKizPU0gFW9Hk609dTtbgeqcDZJPJRqoHIi2OkoYakNC5RIg3ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726689251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y+smNCLm3TKM27dI+RWFsKl+CCAcLwaoDtdKnSC0DI=; b=tIjZJdIN6yEHkPizCN1QvST4M9CcBMoZcGVXY2jP1YRs2E0vnbelPDVNB9J/E6pvOek9v6 cnTHC5LaOJEItasW80y2KdXEonqg1gN/yc6uWyS5zyxPhyfWXEEN71cMrAqk12T4Vr3jTa CPOe3hRCcLNnaPD+s2FI/4iikTh1EWCGtXcXByo+pg5KXoP6jBWq2pk2eOGX5iEAFwMs5e +M5f/EL1YwlWl4F+fj/d6tJyJDd4P1aESF0rm68sFuEz+zeaLEkdfgYpF7IJUU+AlCwJBz 6kmsTG1/XZthIOK1zD5n4SQLg7n86pw9ZLYngh2x1JgRXpq3ogFXqL5PNNwqEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X88VW1KBHzbsF; Wed, 18 Sep 2024 19:54: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 48IJsBLD047461; Wed, 18 Sep 2024 19:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IJsBgL047458; Wed, 18 Sep 2024 19:54:11 GMT (envelope-from git) Date: Wed, 18 Sep 2024 19:54:11 GMT Message-Id: <202409181954.48IJsBgL047458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: ce9c3abf69c2 - main - config: Search include paths for files to be read (options, files) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 commit ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 Author: Stephen J. Kiernan AuthorDate: 2024-09-18 19:49:46 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 19:49:46 +0000 config: Search include paths for files to be read (options, files) This is useful for downstream consumers to add their own kernel config files in another directory other than the default ones. Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D44538 --- usr.sbin/config/mkmakefile.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc index 060f08230550..a102b2b59767 100644 --- a/usr.sbin/config/mkmakefile.cc +++ b/usr.sbin/config/mkmakefile.cc @@ -384,13 +384,25 @@ read_file(char *fname) struct file_list *tp; struct device *dp; struct opt *op; + struct includepath *ipath; configword wd; - char *rfile, *compilewith, *depends, *clean, *warning; + char *rfile, *compilewith, *depends, *clean, *fnamebuf, *warning; const char *objprefix; int compile, match, nreqs, std, filetype, negate, imp_rule, no_ctfconvert, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); + if (fp == NULL) { + SLIST_FOREACH(ipath, &includepath, path_next) { + asprintf(&fnamebuf, "%s/%s", ipath->path, fname); + if (fnamebuf != NULL) { + fp = fopen(fnamebuf, "r"); + if (fp != NULL) + break; + free(fnamebuf); + } + } + } if (fp == NULL) err(1, "%s", fname); next: From nobody Wed Sep 18 20:54:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X89qt3Qv4z52Mx9; Wed, 18 Sep 2024 20:54:18 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X89qt0b9Jz4xWG; Wed, 18 Sep 2024 20:54:18 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=citron; t=1726692849; x=1727359515; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: author:from:subject:date:to:cc:resent-author:resent-date:resent-from: resent-sender:resent-to:resent-cc:resent-reply-to:resent-message-id: in-reply-to:references:mime-version:content-type: content-transfer-encoding:content-disposition:content-id: content-description:message-id:mail-followup-to:openpgp:blahblahblah; bh=562pfqT0mwNfmp5kWUcklCQ+C58h4obAUwoHUKsyyyE=; b=EMlhce26RQ+dnSZwuJhEVLWOafhpntfCFgq3rYGvDSEvcupPCvVct6RnxkM4hafoUfFNEDnq K6gjbLH1+8b7A0SGllT0tgLdRfxuc0A8Uo2SfeXzbKEhI9IkAm0M2rOCeFqaUMAxpRYWeZZ35B h5uhEuUhalJ97esLMRrc6d2AYVd0ha/pqN4inqrPXedPc3TWs4JZOpSCHbucnP/VVxNfU4DqP7 qBcO8YM3iPeCKK/nJjmAtN9iBseo+NQTZaQXT24rk0be6//infxk5TJfXj22LEJWaBZkh8H8WD CWE2CuJgEXMamOXIPyC8UK5J6tuJspL3+oOf0kinmYE32/pA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=orange; t=1726692849; x=1727359515; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: author:from:subject:date:to:cc:resent-author:resent-date:resent-from: resent-sender:resent-to:resent-cc:resent-reply-to:resent-message-id: in-reply-to:references:mime-version:content-type: content-transfer-encoding:content-disposition:content-id: content-description:message-id:mail-followup-to:openpgp:blahblahblah; bh=562pfqT0mwNfmp5kWUcklCQ+C58h4obAUwoHUKsyyyE=; b=6Dm3/oblu0ds+zQtrmUcz4hFxDY5TU0ZmABIYKWuuMo44uI3cT5OIxLRbbd/verGi6COILac vLywJJXrUmvhAg== Date: Wed, 18 Sep 2024 22:54:08 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: "Stephen J. Kiernan" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ce9c3abf69c2 - main - config: Search include paths for files to be read (options, files) Message-ID: <20240918205408.TbriDa0K@steffen%sdaoden.eu> In-Reply-To: <202409181954.48IJsBgL047458@gitrepo.freebsd.org> References: <202409181954.48IJsBgL047458@gitrepo.freebsd.org> Mail-Followup-To: "Stephen J. Kiernan" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org User-Agent: s-nail v14.9.25-608-ge479530e8d OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Queue-Id: 4X89qt0b9Jz4xWG X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Hello. Stephen J. Kiernan wrote in <202409181954.48IJsBgL047458@gitrepo.freebsd.org>: ... |URL: https://cgit.FreeBSD.org/src/commit/?id=ce9c3abf69c2044c1aab0aa62e4\ |a73f8eb13d787 | |commit ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 |Author: Stephen J. Kiernan |AuthorDate: 2024-09-18 19:49:46 +0000 |Commit: Stephen J. Kiernan |CommitDate: 2024-09-18 19:49:46 +0000 | | config: Search include paths for files to be read (options, files) | | This is useful for downstream consumers to add their own kernel config | files in another directory other than the default ones. | | Obtained from: Juniper Networks, Inc. | Differential Revision: https://reviews.freebsd.org/D44538 ... |- char *rfile, *compilewith, *depends, *clean, *warning; |+ char *rfile, *compilewith, *depends, *clean, *fnamebuf, *warning; ^fnamebuf is new ... |+ asprintf(&fnamebuf, "%s/%s", ipath->path, fname); |+ if (fnamebuf != NULL) { |+ fp = fopen(fnamebuf, "r"); |+ if (fp != NULL) |+ break; ^ and surely leaked in case the fopen(3) succeeds. Given the reviewers of the patch however i would assume it does not really hurt. |+ free(fnamebuf); |+ } |+ } |+ } | if (fp == NULL) | err(1, "%s", fname); Having said that. Why is that file marked .cc aka C++? This is so pure basic C Mr. Somers surely gets goose pimples, and then comes back complaining that a memory safe language would not have had this problem. File pointer, asprintf (horrors!), lots of char pointers, SLIST_FOREACH() not some object encapsulating possible difficulties, and what not. In short -- this changeset is surely meant to buy Rust some buffalo nickels, and whereas some maybe smile, the Rust gets armored steel .. and in the end we have to use this merde (imho). --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Thu Sep 19 01:27:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8HvR0rF6z5VbwY; Thu, 19 Sep 2024 01:27: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 4X8HvR0Flkz4JYm; Thu, 19 Sep 2024 01:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726709267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=THptknwXTq7Gv3m8Hg1vth/GO/b1hOOHCLbMdoKKy7A=; b=r/dHc36OYc6XVh8KgF3vTHB+jT5amoi6uyI9nVsdPfXYIpb/j5VEvauyEqXScVrNWXje2c gmWPeqPf88imcO6/cB4Vxep5/S/CS0Dr/YkuPF19pr4Qts5HkzX4Z3Q11CHWT9jHbw7ZVt TQAJl1mSFvoanS/oPqUpM5QoJpayjO0e3++U2+LPM4994vxu0tXmpIsH46ezTIUq2zOf1f BJbag7vdqcA3B47AaePWbaDABN+yAJy3vXy50TkLMM3VbQSiefDfpg4G9GcniOFhB/39ON 1QFkR8tj4qSBUqyLwlx6bTKXvMbqyiySFfNeE7gjE0lZlusASICyMn/qIEV5Eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726709267; a=rsa-sha256; cv=none; b=kM1DOyVHLGlMIwC9a2ACtfMpg0HrwgZeRuD4SLhIdXTXEdmy0xlsUPIhCCGaODLUPtKJVm RUj5sFAqH1WxmtKo0i7WQQEpd92Y7L8R5u3UuJW92INxUkjmucNDBeoR0yXz3AHjGVDBEa SZOgKNsR7L1tjT72CzxfBpa1hpKBVTUveAGg4yOh307ocEYCOWcxVtLoODt82/Marq788J GTu7e4q59olQznIlpp2IGXYvhF35gSYF80LQ7cfIJNB/XTQHXAGuWeOqJtBCzScw6Uyr/f nL1Rd85yEx8Ud/z1to8GLcQTam8ssNejOcqg7Zy4d9psMwVZuNDLbmRi83jGTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726709267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=THptknwXTq7Gv3m8Hg1vth/GO/b1hOOHCLbMdoKKy7A=; b=sdT443EBmYQmo5hFRUVmh5UbStEhE1ZhVyiI72yUM5j9kU+u9MVBDG6z6Lw8lgkJOc8Avh 9fc7ass+x7eWefLkfd81XGxl5w0UwNEQ4bMNXQnTiW3hvZLRLOGGdOI8LPE9N1KJBtPuuh WbdC3eDx+KuMxYGCBfOdZYNMtlaNN+mAH8MmnM3jH1jrqNIu14s3Gf6P9eQEOnMhpXce0a 6/v21UDHt5dgBEiYNO5DfkGNJ+oDVR9zEKjrJ9cq/BUT8nhEIXHQsmXQXTz5QrA7o8oZFN ozWp5+vMcU7VBRmC/Hmh6PWyhDqOFxIJrrerz8hr9QAzeBPzha/LNqUY2gnxBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8HvQ6qvgzllY; Thu, 19 Sep 2024 01:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48J1Rk7Q007698; Thu, 19 Sep 2024 01:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J1RkCu007695; Thu, 19 Sep 2024 01:27:46 GMT (envelope-from git) Date: Thu, 19 Sep 2024 01:27:46 GMT Message-Id: <202409190127.48J1RkCu007695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 5f89aea7b74a - main - ctld: fix several process setup/teardown bugs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f89aea7b74aa4605b25af62e31303097a4a48cc Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5f89aea7b74aa4605b25af62e31303097a4a48cc commit 5f89aea7b74aa4605b25af62e31303097a4a48cc Author: Alan Somers AuthorDate: 2024-08-07 15:21:08 +0000 Commit: Alan Somers CommitDate: 2024-09-18 20:06:31 +0000 ctld: fix several process setup/teardown bugs All of the below bugs could result in a system where ctld is not running, but LUNs and targets still exist in the kernel; a difficult situation to recover from. * open the pidfile earlier. Open the pidfile before reading the kernel's current state, so two racing ctld processes won't step on each others' toes. * close the pidfile later. Close it after tearing down the configuration, for the same reason. * If the configured pidfile changes, then rename it on SIGHUP rather than remove and recreate it. * When running in debug mode, don't close the pidfile while handling a new connection. Only do that in non-debug mode, in the child of the fork. * Register signal handlers earlier. Otherwise a SIGTERM signal received during startup could kill ctld without tearing down the configuration. MFC after: 2 weeks PR: 271460 Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1370 --- usr.sbin/ctld/ctld.c | 70 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 805648f0465f..346d1908aa6f 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1915,7 +1915,6 @@ conf_apply(struct conf *oldconf, struct conf *newconf) struct portal *oldp, *newp; struct port *oldport, *newport, *tmpport; struct isns *oldns, *newns; - pid_t otherpid; int changed, cumulated_error = 0, error, sockbuf; int one = 1; @@ -1924,32 +1923,25 @@ conf_apply(struct conf *oldconf, struct conf *newconf) log_init(newconf->conf_debug); } - if (oldconf->conf_pidfh != NULL) { - assert(oldconf->conf_pidfile_path != NULL); - if (newconf->conf_pidfile_path != NULL && - strcmp(oldconf->conf_pidfile_path, - newconf->conf_pidfile_path) == 0) { - newconf->conf_pidfh = oldconf->conf_pidfh; - oldconf->conf_pidfh = NULL; - } else { - log_debugx("removing pidfile %s", - oldconf->conf_pidfile_path); - pidfile_remove(oldconf->conf_pidfh); - oldconf->conf_pidfh = NULL; - } - } - - if (newconf->conf_pidfh == NULL && newconf->conf_pidfile_path != NULL) { - log_debugx("opening pidfile %s", newconf->conf_pidfile_path); - newconf->conf_pidfh = - pidfile_open(newconf->conf_pidfile_path, 0600, &otherpid); - if (newconf->conf_pidfh == NULL) { - if (errno == EEXIST) - log_errx(1, "daemon already running, pid: %jd.", - (intmax_t)otherpid); - log_err(1, "cannot open or create pidfile \"%s\"", - newconf->conf_pidfile_path); + if (oldconf->conf_pidfile_path != NULL && + newconf->conf_pidfile_path != NULL) + { + if (strcmp(oldconf->conf_pidfile_path, + newconf->conf_pidfile_path) != 0) + { + /* pidfile has changed. rename it */ + log_debugx("moving pidfile to %s", + newconf->conf_pidfile_path); + if (rename(oldconf->conf_pidfile_path, + newconf->conf_pidfile_path)) + { + log_err(1, "renaming pidfile %s -> %s", + oldconf->conf_pidfile_path, + newconf->conf_pidfile_path); + } } + newconf->conf_pidfh = oldconf->conf_pidfh; + oldconf->conf_pidfh = NULL; } /* @@ -2471,8 +2463,8 @@ handle_connection(struct portal *portal, int fd, close(fd); return; } + pidfile_close(conf->conf_pidfh); } - pidfile_close(conf->conf_pidfh); error = getnameinfo(client_sa, client_sa->sa_len, host, sizeof(host), NULL, 0, NI_NUMERICHOST); @@ -2807,6 +2799,7 @@ main(int argc, char **argv) struct isns *newns; const char *config_path = DEFAULT_CONFIG_PATH; int debug = 0, ch, error; + pid_t otherpid; bool dont_daemonize = false; bool test_config = false; bool use_ucl = false; @@ -2846,7 +2839,6 @@ main(int argc, char **argv) kernel_init(); TAILQ_INIT(&kports.pports); - oldconf = conf_new_from_kernel(&kports); newconf = conf_new_from_file(config_path, use_ucl); if (newconf == NULL) @@ -2855,6 +2847,22 @@ main(int argc, char **argv) if (test_config) return (0); + assert(newconf->conf_pidfile_path != NULL); + log_debugx("opening pidfile %s", newconf->conf_pidfile_path); + newconf->conf_pidfh = pidfile_open(newconf->conf_pidfile_path, 0600, + &otherpid); + if (newconf->conf_pidfh == NULL) { + if (errno == EEXIST) + log_errx(1, "daemon already running, pid: %jd.", + (intmax_t)otherpid); + log_err(1, "cannot open or create pidfile \"%s\"", + newconf->conf_pidfile_path); + } + + register_signals(); + + oldconf = conf_new_from_kernel(&kports); + if (debug > 0) { oldconf->conf_debug = debug; newconf->conf_debug = debug; @@ -2870,8 +2878,6 @@ main(int argc, char **argv) conf_delete(oldconf); oldconf = NULL; - register_signals(); - if (dont_daemonize == false) { log_debugx("daemonizing"); if (daemon(0, 0) == -1) { @@ -2926,6 +2932,10 @@ main(int argc, char **argv) error = conf_apply(oldconf, newconf); if (error != 0) log_warnx("failed to apply configuration"); + if (oldconf->conf_pidfh) { + pidfile_remove(oldconf->conf_pidfh); + oldconf->conf_pidfh = NULL; + } conf_delete(newconf); conf_delete(oldconf); oldconf = NULL; From nobody Thu Sep 19 01:59:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8Jc85bj8z5Vh9M; Thu, 19 Sep 2024 01:59: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 4X8Jc851Sgz4MZ5; Thu, 19 Sep 2024 01:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726711176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsiSCofPeOTWZDn/Cd3Q55/pDGgZ6OK3iuZWAW2slaU=; b=cotpE9DePPz+HImUBT5DJkTPrd0V9Lvdd43rtufUCYLuBsqMgqwvqejk1jSqqQfw2KBcPa 2VI8p0moYAlMooaPOaPuUUJVk6moIFmLHrcRqSxcNCtymmvw7RSmj85WrVAnVqBLIYxNCw Q4m/siaR0Aado7k6NkLHdjXHc359OOgGOLlF/pI3uI1bXEuvVsYxB73QRvW2qyxEHENdT5 l0w2HWCp+yN7l7z7BhI7oAz4qj7mjRvQkg8YCmmJLusqd66DhjdtqJklaCbQQ9/z7QTIbw jew4vVK3NVpy06SYTOJ2OJWeosaMxKnl2N7ajd3Sec50Yi1piBT+z8FeG0HY/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726711176; a=rsa-sha256; cv=none; b=DUzne8ied5s5lfNGohxQT7/B1XPcKdncubpfl1mwU+96yqnDgB0NQEgmv7h++nsVb9c2yP uHBqzp5hZToVLLmP2popFux93GUJ2wGrXSRCi2mPREO47D5Y5cfxddxVmDDHzC/NnBIGTR Dkc+9nBHiO8d0fH+G7XFHMLymqiViN38JxvHMuvPVEWq1mEoc6VDGulPmH/B0z4BKdvrUm 6mTaa9HzXq8wMXhGV43a3+ky/It9TuktKgj7BZbMYJIdlnpYoUQN8xl3tY0bQnVOStdGlZ A7zjCsM8c2wrgrSeqHh284F7AvtlM+I9BwxmT4ZqeKCbYrRGOHregAj5DwfoGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726711176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsiSCofPeOTWZDn/Cd3Q55/pDGgZ6OK3iuZWAW2slaU=; b=eijvZ54m2x0+OQuFMtM+qL7mpJ474Uy8ntVClNCllOif3OIvkdbsQXcxoQAnGWyvxpey77 hPBFFooWyM5QRA8r26di+yEC0FCiSrSwr/odvL7slv+hK8Tcf5eGa8D2B9iO/CdQFDumOy j9fvH5PAo8d1AlndgeoyQ7XL+9HJU9Rs8x2JKbCC4M74GJf8lfIv71JrEA8hT6tx4Pu8ZD 1hA6uuuQvn9b7SgcbMEPHMwQZv5AfSnO5CZL02YvNA7VQZvPB+PcnlIpzRdLbFwxQf+cyB 9Xayy5ql3Kvb5O+pFVl+JvJhrPlML907IEP2+Drp7OGWcCYVUMvzhew+0dzkpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8Jc84csmzm9r; Thu, 19 Sep 2024 01:59: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 48J1xas3058407; Thu, 19 Sep 2024 01:59:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J1xaYX058404; Thu, 19 Sep 2024 01:59:36 GMT (envelope-from git) Date: Thu, 19 Sep 2024 01:59:36 GMT Message-Id: <202409190159.48J1xaYX058404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: a1bb5bdb0ab6 - main - ure(4): Add ID for LAN port in Thinkpad OneLink+ dock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1bb5bdb0ab69bc3ce1f6051b6abc0cbaab83faa Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a1bb5bdb0ab69bc3ce1f6051b6abc0cbaab83faa commit a1bb5bdb0ab69bc3ce1f6051b6abc0cbaab83faa Author: Alexander Motin AuthorDate: 2024-09-19 01:55:24 +0000 Commit: Alexander Motin CommitDate: 2024-09-19 01:55:24 +0000 ure(4): Add ID for LAN port in Thinkpad OneLink+ dock That's a pretty old dock for Thinkpad X1 Carbon Gen4 and few others. MFC after: 1 week --- sys/dev/usb/net/if_ure.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index 3f72adb21aea..8e307daccfad 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -100,6 +100,7 @@ static const STRUCT_USB_HOST_ID ure_devs[] = { URE_DEV(LENOVO, TBT3LANGEN2, 0), URE_DEV(LENOVO, ONELINK, 0), URE_DEV(LENOVO, RTL8153_04, URE_FLAG_8153), + URE_DEV(LENOVO, ONELINKPLUS, URE_FLAG_8153), URE_DEV(LENOVO, USBCLAN, 0), URE_DEV(LENOVO, USBCLANGEN2, 0), URE_DEV(LENOVO, USBCLANHYBRID, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 27126b52e243..861e5ad73a2e 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2828,6 +2828,7 @@ product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet product LENOVO RTL8153 0x7205 USB 3.0 Ethernet product LENOVO ONELINK 0x720a USB 3.0 Ethernet product LENOVO RTL8153_04 0x720c USB 3.0 Ethernet +product LENOVO ONELINKPLUS 0x3054 LAN port in Thinkpad OneLink+ dock product LENOVO TBT3LAN 0x3069 LAN port in Thinkpad TB3 dock product LENOVO USBCLAN 0x3062 LAN port in Thinkpad USB-C dock product LENOVO TBT3LANGEN2 0x3082 LAN port in Thinkpad TB3 dock gen2 From nobody Thu Sep 19 02:15:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8Jyw4pVwz5VkJq; Thu, 19 Sep 2024 02:15:52 +0000 (UTC) (envelope-from kevans@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 4X8Jyw2s6mz4PQW; Thu, 19 Sep 2024 02:15:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726712152; h=from:from:reply-to:subject: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=FYMVQNPZqfjPD41KRFPewJwgHaTix+cg3OgIvpjwbMY=; b=mmsKMlBjURKZzOvG1h6H2OrQRASjAaoDlOZV3SPYMAtyjSzm+8vryCdRa/NyVsGkDSxgkM f/RjZM7EBPAynCQKmAftimCPKZGbjXEpaypp6JZ2IO28aHXRky5ye+z/sFE5RK9q62C1nB mRTuWlCaalnkQThUhgSAfY+HbFPxqQ7XaHm6Izhpa0bJSf+eqb134u2EICFrPh32c7I50u JdRCaTIEELKu1wDDcsri6bxw1VqPXRMXuFPKIy/C/bFsTwZPp79AoyYVtYIiTSTMrehESE H77Jz663qAZ13s2F3pzAPCp2UmiPweurq4zZsLZU29fGWftCrGPCRZdvIlYw9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726712152; a=rsa-sha256; cv=none; b=XhFFF6rn1WrVtrc/8iBwdVWNaAjsmIBjd2JDAoSICAW+XGx/YYp/K4hOjcSZAXVDguT5Kw rCgOmtGhq6mBkdgOrMtC34FRHBe+AZC06vLFXr8gm1/8j/YCz66S+7rYEyyAqfxY6Gc3rk M4M8kVVT+krpXeE7ET2CLjWlWrfzIBfhcitMWAsBqzWrlDBIyNW6TXjBZvLLZyoO6QKg4y WdvJ2P3xABlFqeuMF1QFztK87hplCcTE5D+1ijhKjf0ScpFgdbPJoVg9sfSZAva5YO1iRV iV4nnd3MH6pPj/OKcJQDUGSf78whOI9MPA73CNo8K12CnkBr3aViLh1qgHJY7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726712152; h=from:from:reply-to:subject: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=FYMVQNPZqfjPD41KRFPewJwgHaTix+cg3OgIvpjwbMY=; b=u9DYUmNNR5Li2jwYl59EJ01sQJkkxZvIHrDnC507kTTFSXFC5Xf0/hLjZQN7wwPOBiEhNd wcVAYjqzcmT6K/ulN4NUgjFM71haVve+10ppsTH9+RxRaBqEYngBH5h4N5AGbJw4qF6qVJ nCOzW/saUzp5xxcbR2h3K7GX9yilHj3FNhGzC6byZ1pD3/HZEXFZsDfj7y47n4Xr4MjNOt HTe2hwIndRyIG4b5QXXzHY444TYcCEd1lyoxV5RQVGC1mkA2F13odgPTzfqeKMoZ61YayC 17pVVmbfTLsUoaE1IwQOiJkyoO8qn1YfGBfX6tEa0Y5vBz7hsdD5eVBt+DKKVQ== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X8Jyv6hlczTS6; Thu, 19 Sep 2024 02:15:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Wed, 18 Sep 2024 21:15:50 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ce9c3abf69c2 - main - config: Search include paths for files to be read (options, files) To: "Stephen J. Kiernan" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202409181954.48IJsBgL047458@gitrepo.freebsd.org> <20240918205408.TbriDa0K@steffen%sdaoden.eu> Content-Language: en-US From: Kyle Evans In-Reply-To: <20240918205408.TbriDa0K@steffen%sdaoden.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/18/24 15:54, Steffen Nurpmeso wrote: > Hello. > > Stephen J. Kiernan wrote in > <202409181954.48IJsBgL047458@gitrepo.freebsd.org>: > ... > |URL: https://cgit.FreeBSD.org/src/commit/?id=ce9c3abf69c2044c1aab0aa62e4\ > |a73f8eb13d787 > | > |commit ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 > |Author: Stephen J. Kiernan > |AuthorDate: 2024-09-18 19:49:46 +0000 > |Commit: Stephen J. Kiernan > |CommitDate: 2024-09-18 19:49:46 +0000 > | > | config: Search include paths for files to be read (options, files) > | > | This is useful for downstream consumers to add their own kernel config > | files in another directory other than the default ones. > | > | Obtained from: Juniper Networks, Inc. > | Differential Revision: https://reviews.freebsd.org/D44538 > ... > [... snip ...] > |+ free(fnamebuf); > |+ } > |+ } > |+ } > | if (fp == NULL) > | err(1, "%s", fname); > > Having said that. Why is that file marked .cc aka C++? > This is so pure basic C Mr. Somers surely gets goose pimples, and > then comes back complaining that a memory safe language would not > have had this problem. File pointer, asprintf (horrors!), lots of > char pointers, SLIST_FOREACH() not some object encapsulating > possible difficulties, and what not. > In short -- this changeset is surely meant to buy Rust some > buffalo nickels, and whereas some maybe smile, the Rust gets > armored steel .. and in the end we have to use this merde (imho). > Because it uses a C++ feature. Notably, I had no interest in implementing the equivalent of std::unordered_map when I can quickly convert it to .cc and expect it to work. Thanks, Kyle Evans From nobody Thu Sep 19 05:33:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8PMT2h9Nz5X72X; Thu, 19 Sep 2024 05:33: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 4X8PMT08XSz4p3H; Thu, 19 Sep 2024 05:33:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726724037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQU+54zaHMECZGAvQcBIJywC3jDfeM1h5oBsfyUMBAo=; b=gE6P9hYFGEB11PeNqfND8Ne2/dL0J9BvqRRajGci9iBy6bhCvB765UJLXKF4oBzoTlzcr7 U/fAddUTi+kp8fPkeJXAb0WdPxDQDgqIYjMu82fqqCglrwj3+46ovOhbRzzQgE8+le2bkR z5W5ts8qVU+7WHqwalwYiS51Uh7K8ZT0Y6JGpi3bcwY9OOyTT1GGqUjwLoR2TF8/3WluqJ EX6hO8pkErCd4w56Y0ZAyweTeJRNqzpbmvJw3kYJogujBDZLz2ORbIpUqPispEuQc5EXDL gmWYrn7W+t3ZivSiewYnaQJmOIxucN6mPp0U0Hdv7DFAUbHk87tuWXCz0ccsvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726724037; a=rsa-sha256; cv=none; b=rqlJZ692F3MKZnWxlzZiAUcdwJynULxtKkb9QxvPdwuJL1pftnqK9TLhJBY9C5g/GK0TS1 o3WjxQKhA4SRPu/b3UMhwElMZXB7xDnMwQba6Iz/A2R2LCUz62o3unBh0NjEetApBHGIrC M3nsHOiW4inbWCPU4gaa+65R77FZiFTMfl55RsZfSG8utYrLAInMwCiRbF1lNLoUGUyI+X SwLjV6r2BSLf1xbDEqxURd5MTqF4E+DvEV2ddaMrhRIceZ0hoWS9plnbndL2HKeUhqtxZ2 oKbrYIS+qyEs9BaTi48dN5iuXiN78xz/T1QnpMFiRukdhXKoT4RrVglH4rZwKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726724037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQU+54zaHMECZGAvQcBIJywC3jDfeM1h5oBsfyUMBAo=; b=ahPfAJROhtqXTwUS6EtOtNRoEXjH+Im+eB0M8waZPzy04V9e77HM4XFlMLS8uA+UDIwVGK 6y55qj78PH0o6SY0pzPdhbPPAHnQtBUdGeKLTNjwNRFFUALo0YplZMxZT9q+T89fwEUhtU LYp/+7H7POsx/k6ZzcmJad29dqyKOYCq62zcOLKzuksBr6iVuzgh0BaBNwSK69e5rFDIYH sHTz39F4xLjs08kAkeHyXZI6wZfrvN8QDhIFMungAIbHj66hhlV4bm8W97I+rM/qRj0kC5 35TgbT46KanGHRbnRAmqc0D0rvVfCQXuurzIC7pdMSIbwB0AurF71XQ7yU4M1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8PMS6tZlztCv; Thu, 19 Sep 2024 05:33: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 48J5Xus7033656; Thu, 19 Sep 2024 05:33:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J5XuUW033653; Thu, 19 Sep 2024 05:33:56 GMT (envelope-from git) Date: Thu, 19 Sep 2024 05:33:56 GMT Message-Id: <202409190533.48J5XuUW033653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 14561f1eda85 - main - ixl: Increase tx/rx ring size to 8160 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14561f1eda85fabfba2d764ca11e064ed871224e Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=14561f1eda85fabfba2d764ca11e064ed871224e commit 14561f1eda85fabfba2d764ca11e064ed871224e Author: Kevin Bowling AuthorDate: 2024-09-19 05:30:24 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 05:30:24 +0000 ixl: Increase tx/rx ring size to 8160 I've verified the tx queue (table 8-22) in addition. DPDK commit message net/i40e: increase max descriptor queue length According to the Intel X710/XXV710/XL710 Datasheet, the maximum receive queue descriptor length is 0x1FE0 (8160 in base 10). This is specified as QLEN in table 8-12, page 1083. I've tested this change with an XXV710 NIC and it has positive effect on performance under high load scenarios. Where previously I'd get ~2000 packets/sec miss rate, now I get only ~40 packets/sec miss rate. Signed-off-by: Igor Gutorov Acked-by: Morten Brørup Acked-by: Bruce Richardson Obtained from: DPDK (ce9470f) MFC after: 1 week --- sys/dev/ixl/ixl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index f45354d29300..042e4e3e6e1a 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -122,7 +122,7 @@ * The driver currently always uses 32 byte Rx descriptors. */ #define IXL_DEFAULT_RING 1024 -#define IXL_MAX_RING 4096 +#define IXL_MAX_RING 8160 #define IXL_MIN_RING 64 #define IXL_RING_INCREMENT 32 From nobody Thu Sep 19 09:53:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8W715PsJz5Vn9p; Thu, 19 Sep 2024 09:53: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 4X8W714YmFz4QBt; Thu, 19 Sep 2024 09:53:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RE7dNBg5exOCSEjeW+YWBxICahjawxMCHgembS6HxTA=; b=NUHwCQROhKrrMvmqdWhCBg9sZnC/krRtwG7++WhtoHYZGAmgnPgeuuIN5+ijBbYx0RsuMD rqPDs6Ml+WkVyV5GCj5CicwAC0ymQgNZN6fAcoREuPUTeJyrxKU+vPyGVERKCiC3WOi0/Y fSov8yTjc4NyoqV/V3poFy7bCQIBbVArl5KXvLI3UZjIsCOlDlngc/Xm/qpTW92jaRC2wN 7tUqhdTQkRca5w+V+j78Qs1LkFv2UYGUx1hn4hG1ZwL3qBfKwauKWgoJuLE+XbnRePg3jG NiXf7v4GxXarKIVs8E0A8so3CEfPbnVoXfbuMA+6RPkHUWv3Ad1tKPUYJfIDug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739613; a=rsa-sha256; cv=none; b=HxJtfToYUvdij2TgpdtS4FbfNDxb9zDdyOFDTbavAZo/9J/uU/yKZ+nHnvYCd3pepoqNub bzvi3hJ4z7V8BWJjmHleS38EFKTRR4DJX3MCRBNvUAAYWJYHuLFHlhsAsuwR9RIm2rvvpy sy5gsf+eSZaPvgx+Y9OSCG+zThP173ia7VkkUk36fIBSDtfcvvsdP+krsEPdnSdR3GK94l RWu968JphzZBscUwK4Xh9RQoZqKLj8jmgEGde23pS5fJ1Dw/mr/4w9UTo5JxOC3u8tbDzB E06ybdfDIIY7HzLjUnZhIuo1ny5jY6Y7Ja/Iww9/XV4IyQ82DPGnnNwkBEsxqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RE7dNBg5exOCSEjeW+YWBxICahjawxMCHgembS6HxTA=; b=NSTQa+p8pPTYqJ9C/cB1wrm1M9H81irM7qrdc2ImzVUG+1ocgSyerLDWnUZU2rOOrE5gIo QoCdM3aKZfoitAEUtBGiyp9uAJEtb+95e/IDbf0EjUOcl/pb4N8XuGntCiM9yGQYO4hVdm 4iiCGOQklUhZhoO1rB4llJ9r7Vmv0H+fimZXkCEILlgZW5PqIc27p6Mb+ljwQ5kq+64roH 6meDnEaikaGDi3hnd+hyPcv4WJ077qo/TikQoGicN0h0R6V750Myhzid6LcIMaeTC7GjXg jeRo3fkkzsg2Mp660dANzVuOUZOaS1b0z07XAVvR0CULi3FuHbmVAAzZGOSL7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8W7148qKz11Kc; Thu, 19 Sep 2024 09:53: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 48J9rX1n075195; Thu, 19 Sep 2024 09:53:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9rXHs075192; Thu, 19 Sep 2024 09:53:33 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:53:33 GMT Message-Id: <202409190953.48J9rXHs075192@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: 1f903953fbf8 - main - bhyve: Add raw tcp to uart backend List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f903953fbf8615bb611db059417177f6cee07bd Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1f903953fbf8615bb611db059417177f6cee07bd commit 1f903953fbf8615bb611db059417177f6cee07bd Author: SHENG-YI HONG AuthorDate: 2024-09-10 14:28:27 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:20:25 +0000 bhyve: Add raw tcp to uart backend This feature is required by OpenStack Nova that needs a serial output through tcp socket. When enable this feature, a tcp server will be started and wait for connection on specified port under capsicum's protection. We only accept one connection at the same time. Other connection try to connect will fail. Reviewed by: corvink, markj MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D45120 --- usr.sbin/bhyve/bhyve.8 | 19 +++- usr.sbin/bhyve/bhyve_config.5 | 8 +- usr.sbin/bhyve/uart_backend.c | 221 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 228 insertions(+), 20 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 8001b5276d51..6c725537f97a 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 26, 2024 +.Dd August 21, 2024 .Dt BHYVE 8 .Os .Sh NAME @@ -620,6 +620,13 @@ the process. .It Ar /dev/xxx Use the host TTY device for serial port I/O. +.It Ar tcp=ip:port +Use the TCP server for serial port I/O. +Configuring this option will start a TCP server that waits for connections. +Only one connection is allowed at any time. Other connection try to connect +to TCP server will be disconnected immediately. Note that this feature +allows unprivileged users to access the guest console, so ensure that +access is appropriately restricted. .El .Ss TPM device backends .Bl -bullet @@ -1118,7 +1125,8 @@ cd:/images/install.iso \\ .Ed .Pp Run a UEFI virtual machine with a display resolution of 800 by 600 pixels -that can be accessed via VNC at: 0.0.0.0:5900. +that can be accessed via VNC at: 0.0.0.0:5900 or via serial console over +TCP at: 127.0.0.1:1234 (unsafe if you expose serial console without protection). .Bd -literal -offset indent bhyve -c 2 -m 4G -w -H \\ -s 0,hostbridge \\ @@ -1127,13 +1135,14 @@ bhyve -c 2 -m 4G -w -H \\ -s 5,virtio-net,tap0 \\ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\ -s 30,xhci,tablet \\ - -s 31,lpc -l com1,stdio \\ + -s 31,lpc -l com1,tcp=127.0.0.1:1234 \\ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ uefivm .Ed .Pp Run a UEFI virtual machine with a VNC display that is bound to all IPv6 -addresses on port 5900. +addresses on port 5900 and a serial I/O port bound to TCP port 1234 of +loopback address (unsafe if you expose serial console without protection). .Bd -literal -offset indent bhyve -c 2 -m 4G -w -H \\ -s 0,hostbridge \\ @@ -1141,7 +1150,7 @@ bhyve -c 2 -m 4G -w -H \\ -s 5,virtio-net,tap0 \\ -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\ -s 30,xhci,tablet \\ - -s 31,lpc -l com1,stdio \\ + -s 31,lpc -l com1,tcp=[::1]:1234 \\ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ uefivm .Ed diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index 25185e2ef1b4..7b99737c3baa 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 August 13, 2024 +.Dd August 21, 2024 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -460,6 +460,12 @@ Either the pathname of a character device or to use standard input and output of the .Xr bhyve 8 process. +.It Va tcp Ta Oo Ar IP Ns : Oc Ns Ar port Ta Ta +TCP address to listen on for remote connections. +The IP address must be given as a numeric address. +IPv6 addresses must be enclosed in square brackets and +supports scoped identifiers as described in +.Xr getaddrinfo 3 . .El .Ss Host Bridge Settings .Bl -column "pcireg.*" "integer" "Default" diff --git a/usr.sbin/bhyve/uart_backend.c b/usr.sbin/bhyve/uart_backend.c index 51844cbf1170..a09764190137 100644 --- a/usr.sbin/bhyve/uart_backend.c +++ b/usr.sbin/bhyve/uart_backend.c @@ -28,13 +28,18 @@ */ #include +#include #include #include +#include + +#include #include #include #include +#include #include #include #include @@ -49,6 +54,7 @@ struct ttyfd { bool opened; + bool is_socket; int rfd; /* fd for reading */ int wfd; /* fd for writing, may be == rfd */ }; @@ -70,9 +76,17 @@ struct uart_softc { pthread_mutex_t mtx; }; +struct uart_socket_softc { + struct uart_softc *softc; + void (*drain)(int, enum ev_type, void *); + void *arg; +}; + static bool uart_stdio; /* stdio in use for i/o */ static struct termios tio_stdio_orig; +static void uart_tcp_disconnect(struct uart_softc *); + static void ttyclose(void) { @@ -97,20 +111,22 @@ ttyopen(struct ttyfd *tf) } static int -ttyread(struct ttyfd *tf) +ttyread(struct ttyfd *tf, uint8_t *ret) { - unsigned char rb; + uint8_t rb; + int len; - if (read(tf->rfd, &rb, 1) == 1) - return (rb); - else - return (-1); + len = read(tf->rfd, &rb, 1); + if (ret && len == 1) + *ret = rb; + + return (len); } -static void +static int ttywrite(struct ttyfd *tf, unsigned char wb) { - (void)write(tf->wfd, &wb, 1); + return (write(tf->wfd, &wb, 1)); } static bool @@ -179,14 +195,24 @@ rxfifo_putchar(struct uart_softc *sc, uint8_t ch) void uart_rxfifo_drain(struct uart_softc *sc, bool loopback) { - int ch; + uint8_t ch; + int len; if (loopback) { - (void)ttyread(&sc->tty); + if (ttyread(&sc->tty, &ch) == 0 && sc->tty.is_socket) + uart_tcp_disconnect(sc); } else { - while (rxfifo_available(sc) && - ((ch = ttyread(&sc->tty)) != -1)) + while (rxfifo_available(sc)) { + len = ttyread(&sc->tty, &ch); + if (len <= 0) { + /* read returning 0 means disconnected. */ + if (len == 0 && sc->tty.is_socket) + uart_tcp_disconnect(sc); + break; + } + rxfifo_putchar(sc, ch); + } } } @@ -196,7 +222,9 @@ uart_rxfifo_putchar(struct uart_softc *sc, uint8_t ch, bool loopback) if (loopback) { return (rxfifo_putchar(sc, ch)); } else if (sc->tty.opened) { - ttywrite(&sc->tty, ch); + /* write returning -1 means disconnected. */ + if (ttywrite(&sc->tty, ch) == -1 && sc->tty.is_socket) + uart_tcp_disconnect(sc); return (0); } else { /* Drop on the floor. */ @@ -259,6 +287,62 @@ done: } #endif +/* + * Listen on the TCP port, wait for a connection, then accept it. + */ +static void +uart_tcp_listener(int fd, enum ev_type type __unused, void *arg) +{ + const static char tcp_error_msg[] = "Socket already connected\n"; + struct uart_socket_softc *socket_softc = (struct uart_socket_softc *) + arg; + struct uart_softc *sc = socket_softc->softc; + int conn_fd; + + conn_fd = accept(fd, NULL, NULL); + if (conn_fd == -1) + goto clean; + + if (fcntl(conn_fd, F_SETFL, O_NONBLOCK) != 0) + goto clean; + + pthread_mutex_lock(&sc->mtx); + + if (sc->tty.opened) { + (void)send(conn_fd, tcp_error_msg, sizeof(tcp_error_msg), 0); + pthread_mutex_unlock(&sc->mtx); + goto clean; + } else { + sc->tty.rfd = sc->tty.wfd = conn_fd; + sc->tty.opened = true; + sc->mev = mevent_add(sc->tty.rfd, EVF_READ, socket_softc->drain, + socket_softc->arg); + } + + pthread_mutex_unlock(&sc->mtx); + return; + +clean: + if (conn_fd != -1) + close(conn_fd); +} + +/* + * When a connection-oriented protocol disconnects, this handler is used to + * clean it up. + * + * Note that this function is a helper, so the caller is responsible for + * locking the softc. + */ +static void +uart_tcp_disconnect(struct uart_softc *sc) +{ + mevent_delete_close(sc->mev); + sc->mev = NULL; + sc->tty.opened = false; + sc->tty.rfd = sc->tty.wfd = -1; +} + static int uart_stdio_backend(struct uart_softc *sc) { @@ -324,6 +408,108 @@ uart_tty_backend(struct uart_softc *sc, const char *path) return (0); } +/* + * Listen on the address and add it to the kqueue. + * + * If a connection is established (e.g., the TCP handler is triggered), + * replace the handler with the connected handler. + */ +static int +uart_tcp_backend(struct uart_softc *sc, const char *path, + void (*drain)(int, enum ev_type, void *), void *arg) +{ +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif + int bind_fd = -1; + char addr[256], port[6]; + int domain; + struct addrinfo hints, *src_addr = NULL; + struct uart_socket_softc *socket_softc = NULL; + + if (sscanf(path, "tcp=[%255[^]]]:%5s", addr, port) == 2) { + domain = AF_INET6; + } else if (sscanf(path, "tcp=%255[^:]:%5s", addr, port) == 2) { + domain = AF_INET; + } else { + warnx("Invalid number of parameter"); + goto clean; + } + + bind_fd = socket(domain, SOCK_STREAM, 0); + if (bind_fd < 0) + goto clean; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = domain; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE; + + if (getaddrinfo(addr, port, &hints, &src_addr) != 0) { + warnx("Invalid address %s:%s", addr, port); + goto clean; + } + + if (bind(bind_fd, src_addr->ai_addr, src_addr->ai_addrlen) == -1) { + warn( + "bind(%s:%s)", + addr, port); + goto clean; + } + + freeaddrinfo(src_addr); + src_addr = NULL; + + if (fcntl(bind_fd, F_SETFL, O_NONBLOCK) == -1) + goto clean; + + if (listen(bind_fd, 1) == -1) { + warnx("listen(%s:%s)", addr, port); + goto clean; + } + + /* + * Set the connection softc structure, which includes both the softc + * and the drain function provided by the frontend. + */ + if ((socket_softc = calloc(sizeof(struct uart_socket_softc), 1)) == + NULL) + goto clean; + + sc->tty.is_socket = true; + + socket_softc->softc = sc; + socket_softc->drain = drain; + socket_softc->arg = arg; + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_ACCEPT, CAP_RECV, CAP_SEND, + CAP_FCNTL, CAP_IOCTL); + if (caph_rights_limit(bind_fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (caph_ioctls_limit(bind_fd, cmds, nitems(cmds)) == -1) + errx(EX_OSERR, "Unable to apply ioctls for sandbox"); + if (caph_fcntls_limit(bind_fd, CAP_FCNTL_SETFL) == -1) + errx(EX_OSERR, "Unable to apply fcntls for sandbox"); +#endif + + if ((sc->mev = mevent_add(bind_fd, EVF_READ, uart_tcp_listener, + socket_softc)) == NULL) + goto clean; + + return (0); + +clean: + if (bind_fd != -1) + close(bind_fd); + if (socket_softc != NULL) + free(socket_softc); + if (src_addr) + freeaddrinfo(src_addr); + return (-1); +} + struct uart_softc * uart_init(void) { @@ -344,9 +530,16 @@ uart_tty_open(struct uart_softc *sc, const char *path, if (strcmp("stdio", path) == 0) retval = uart_stdio_backend(sc); + else if (strncmp("tcp", path, 3) == 0) + retval = uart_tcp_backend(sc, path, drain, arg); else retval = uart_tty_backend(sc, path); - if (retval == 0) { + + /* + * A connection-oriented protocol should wait for a connection, + * so it may not listen to anything during initialization. + */ + if (retval == 0 && !sc->tty.is_socket) { ttyopen(&sc->tty); sc->mev = mevent_add(sc->tty.rfd, EVF_READ, drain, arg); assert(sc->mev != NULL); From nobody Thu Sep 19 09:53:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8W726jc2z5Vmns; Thu, 19 Sep 2024 09:53: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 4X8W725Yb0z4Q5V; Thu, 19 Sep 2024 09:53:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bZPMqfKplfBj9YuE2oLQeMDKFG8HBYqruJF8hpwbXAk=; b=xTNvoqbQ+eux2yvvTvPs1FW9spcNvm0GUd5wUQuHZ3gTlfEFWeXB5VsdRHRqEJ7hF4pMdg EiWHNisGMaJNtg6nVMuklcTQjIwS6ltr782KiKGE4WqD9dsLl0pSQQp1g8GEjmkXFhrMjW mg5z2vwWotndF6rFUI+rvfXx/xAE4E8J12YLGGKJWC1c3MgGehMyTBuGlXExrtJEMqho7Q HHDGAyX9jkUwWoFcDyjUVLXzsb/9lTDVg72tZJ3Abd0dpicn3JTG9LJfNto2+OcxQ2HH7B gEOMQMa1CtCfJfKtpO+D2nuh0Z4A8tJoyD/OkQZY9w/sYz22xGf+3BhPZ/RKXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739614; a=rsa-sha256; cv=none; b=pu/MS0dkguFMLS19nfp+bD6uztxCca7nfCP23ca2/52eS6AZvC6RAjoKaDw9gd7H+6w6E0 qKJJwfEnBmOXmyGkpdKWRbfK7Nqd2/2vPh3zpLwHf/2Y539B3pYxtWxe7Nbf0NvrHpNhC8 8wkJ1qyQ6Ad/bvD1lt7o8i1djQVNDpXIfVT7I+xGZxrbak9W32I8aZJg/yWc/q2t++fx+D yK6v6/58i5cdzmXIWdbVX0VxyVMVpI0FofpYUJRGpTrAiZo2EM8AqDWy1q973DSWz+g5PS QhNLXFpsFX5upgpfVGeW0nD3OyzuWPJlWFmJ1jGHKpVC2hd/ZlRYWKpuZZWfaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bZPMqfKplfBj9YuE2oLQeMDKFG8HBYqruJF8hpwbXAk=; b=SkCBPl8rtoAyK6EDFGBnb4UcnI4vWD/TVjLniKnwpUatPAUhoISZ4oe9SrIyd+EzKA8wUu /+HNDq4oLfxazPWd5K6TAeCY6td9afUxEgT4fqPJo644NJ7my7ImNfWgFNYcfiNwoQhkoR kD7vocNU1EF7k5uz9MV4oq1CmyAfzarEvxgVWMaFdxrk2pmNxU+tVdAxzgGUrjV3upVitl uee7ICvv2bDGLZJob1pSMBRRoefJz+z1yH/Sqf9PUfH/U67CCOmpaKCZFB2JWWoSpZy1zW nHkGPG+HsZC4e5kJuAwvAO/6LpfylOgWLqvShVPqkoTz1SRmn1i/CcYkyIVh4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8W7258xBz11lC; Thu, 19 Sep 2024 09:53: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 48J9rYOh075246; Thu, 19 Sep 2024 09:53:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9rYK5075243; Thu, 19 Sep 2024 09:53:34 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:53:34 GMT Message-Id: <202409190953.48J9rYK5075243@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: 767723ddebe9 - main - iflib: Use if_alloc_dev() to allocate the ifnet List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 767723ddebe9c76a2d4a45a50d9b0efc9f2f91d7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=767723ddebe9c76a2d4a45a50d9b0efc9f2f91d7 commit 767723ddebe9c76a2d4a45a50d9b0efc9f2f91d7 Author: Mark Johnston AuthorDate: 2024-09-19 09:21:05 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:21:05 +0000 iflib: Use if_alloc_dev() to allocate the ifnet This ensures that the ifnet's NUMA affinity is accurate. Reviewed by: kbowling MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46667 --- sys/net/iflib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index c6a01624436c..a595a5f2dd0f 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5750,7 +5750,7 @@ iflib_register(if_ctx_t ctx) CTX_LOCK_INIT(ctx); STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); - ifp = ctx->ifc_ifp = if_alloc(IFT_ETHER); + ifp = ctx->ifc_ifp = if_alloc_dev(IFT_ETHER, dev); /* * Initialize our context's device specific methods From nobody Thu Sep 19 09:53:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8W741gjTz5VnDF; Thu, 19 Sep 2024 09:53: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 4X8W736S9cz4Q5l; Thu, 19 Sep 2024 09:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dr6oJwghEWLPVq1paVBamX/HoNRa8mvdGnmBRaiOFfw=; b=kXhqj69EuzGgHMnwt12S2f8UsezSPpkbVdO+UJkfZXTlrG9IZXsqpYYb/qzZm1muG5xJPU u6P7b6k3/JbxAdeKVCiJo90PZeE8rIBAJzmxhfCRdGX4ltZ1nbM/6YDz3NwmvE5OIPz59b NK3LGHtWTn6zG+/qDpvPPSb/T9C9QeIoAWuQiR6hIz+0vk2f0QOA44ocbspoFDusHJnTlb JbwnG25Fc4DRfFBHOPvcDaiCXsGCyu7yPD8JGrLD7LndirJu/5gDBlBWv9mxMmYa6RtaRe G8Zhf/XvzDRzREIbeGAY0r2NwburWIyQ/6UMkkajdN2TNqSfT8EzvB3h1+AwgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739615; a=rsa-sha256; cv=none; b=LNfatVUSZy84OwFk+PbeznaQKyjNpcXZdnKBHvlUkxS4hPNCIcRBv4j0lXzyL3jcd3PJ5O btliGcDI+LI7AuopP16uXaAovSfAFOI8C9n+2G3pIclCxo+vhlJYwha5A81odsoWf6neje EwEcDE8AkAMvRWVk208NRmGFcSVzThlazwzQyFzDiPthEHqY9vETxa65GSEs/7JzzesxqM 2rWAHoGc6GpfwYI6z3vqz4Y9y9hgKcwj5Z3E5u5pAUsa94E9rRn42JD0zsXxLyEGuidX8v HlES0bCXlT5ohpUobwqyMJHkBqXo4IIua4hyVGLvPCxDp4N4sPi0Hl5MTI+9jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dr6oJwghEWLPVq1paVBamX/HoNRa8mvdGnmBRaiOFfw=; b=Arz6QiO70lFPn/qA13rnq9BGzAf/SbT9yPXmtA4AAoliNmmGHKFZSyKk3seVEqDNffjH2V 72M1YKqtulN/qpsRehN2U0jfLsB+fwQTiheLO5J+seRfETF4YHFzeQ5ZxIv74XLxbdxre0 /edIzyEQrghM3uFuQnGGCPHMNvD4VTLCsxGfAnTNRYXsj6qNjCxn9vWzl5Z3q7L5YGBqY6 cjvnUecuoOIiiVzoEiRaMsN63oIKc9cZ9H/NRg9htck9b9oU/JI+iceJ34zeaHV35W/+wZ iIV2eu0GpCWz6N/qYb1furSOFWOAJJyUWh4WEpy0VDAhd9D3aghSFlbbleePoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8W735vfmz11lD; Thu, 19 Sep 2024 09:53: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 48J9rZIV075298; Thu, 19 Sep 2024 09:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9rZw2075295; Thu, 19 Sep 2024 09:53:35 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:53:35 GMT Message-Id: <202409190953.48J9rZw2075295@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: 9aabab09c4e1 - main - dtrace/amd64: Fix probe argument fetching List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9aabab09c4e163fa8187b265d6836d822516b1c9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9aabab09c4e163fa8187b265d6836d822516b1c9 commit 9aabab09c4e163fa8187b265d6836d822516b1c9 Author: Mark Johnston AuthorDate: 2024-09-19 09:21:38 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:21:38 +0000 dtrace/amd64: Fix probe argument fetching dtrace_getarg() previously walked the call stack looking for a frame matching the dtrace_invop_callsite symbol, in order to look for a trapframe corresponding to an invop (i.e., FBT or kinst) probe. Commit 3ba8e9dc4a0e broke this in some cases by breaking the expected alignment of the dtrace_invop_callsite symbol. Rather than groveling around the stack to find invop probe arguments, simply use the trapframe reference saved by dtrace_invop(). This is simpler and less fragile. Reported by: avg Reviewed by: avg MFC after: 2 weeks Fixes: 3ba8e9dc4a0e ("dtrace/amd64: Implement emulation of call instructions") Differential Revision: https://reviews.freebsd.org/D46672 --- sys/cddl/dev/dtrace/amd64/dtrace_isa.c | 77 ++++++++++++++-------------------- 1 file changed, 31 insertions(+), 46 deletions(-) diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c index 9db5a16190db..83d34abbd270 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c @@ -32,6 +32,8 @@ #include #include +#include + #include #include #include @@ -355,6 +357,7 @@ zero: uint64_t dtrace_getarg(int arg, int aframes) { + struct thread *td; uintptr_t val; struct amd64_frame *fp = (struct amd64_frame *)dtrace_getfp(); uintptr_t *stack; @@ -366,57 +369,39 @@ dtrace_getarg(int arg, int aframes) */ int inreg = 5; - for (i = 1; i <= aframes; i++) { - fp = fp->f_frame; - - if (roundup2(fp->f_retaddr, 16) == - (long)dtrace_invop_callsite) { - /* - * In the case of amd64, we will use the pointer to the - * regs structure that was pushed when we took the - * trap. To get this structure, we must increment - * beyond the frame structure, and then again beyond - * the calling RIP stored in dtrace_invop(). If the - * argument that we're seeking is passed on the stack, - * we'll pull the true stack pointer out of the saved - * registers and decrement our argument by the number - * of arguments passed in registers; if the argument - * we're seeking is passed in registers, we can just - * load it directly. - */ - struct trapframe *tf = (struct trapframe *)&fp[1]; - - if (arg <= inreg) { - switch (arg) { - case 0: - stack = (uintptr_t *)&tf->tf_rdi; - break; - case 1: - stack = (uintptr_t *)&tf->tf_rsi; - break; - case 2: - stack = (uintptr_t *)&tf->tf_rdx; - break; - case 3: - stack = (uintptr_t *)&tf->tf_rcx; - break; - case 4: - stack = (uintptr_t *)&tf->tf_r8; - break; - case 5: - stack = (uintptr_t *)&tf->tf_r9; - break; - } - arg = 0; - } else { - stack = (uintptr_t *)(tf->tf_rsp); - arg -= inreg; + /* + * Did we arrive here via dtrace_invop()? We can simply fetch arguments + * from the trap frame if so. + */ + td = curthread; + if (td->t_dtrace_trapframe != NULL) { + struct trapframe *tf = td->t_dtrace_trapframe; + + if (arg <= inreg) { + switch (arg) { + case 0: + return (tf->tf_rdi); + case 1: + return (tf->tf_rsi); + case 2: + return (tf->tf_rdx); + case 3: + return (tf->tf_rcx); + case 4: + return (tf->tf_r8); + case 5: + return (tf->tf_r9); } - goto load; } + arg -= inreg; + stack = (uintptr_t *)tf->tf_rsp; + goto load; } + for (i = 1; i <= aframes; i++) + fp = fp->f_frame; + /* * We know that we did not come through a trap to get into * dtrace_probe() -- the provider simply called dtrace_probe() From nobody Thu Sep 19 09:53:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8W752DlTz5VnDH; Thu, 19 Sep 2024 09:53: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 4X8W750hHDz4QMC; Thu, 19 Sep 2024 09:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wc7QCgaoNHfKHanhi7x4Fsw1DLu/yqBjlZNejQc7l4U=; b=E01kIQaHBoKSzhQEkzVuqzSNt4pBd+3An8IzdfbKX83L53gQdLRrjXpvWzP05H2h2l1wqU Ix7AmLm2+wfshSKgtdKUcO59FAHykPtsP2JzZDczekVzp9crnHpL61rqeDxMaOPI+kLVW6 u7R3sJOJzl+WhdSRSCwWeS4ofRl38wDFSSFs8HCPU0GV4dTncJuEIex4sH04yOmRBUQoeH 8QY4Fdg+oOxyjtD1+QiFucrYXqk3x/AcSLHrUC80pxLMZes3OizkkMjctHX4ozpSkGxXUA YYCSv81MJklb8pI5JN7GusR1wWijB3UVXAE0B6YRwTuWepmmNWGBgmVelCIg2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739617; a=rsa-sha256; cv=none; b=oobaHuYO4SKotFcSyrgZYJ007Vr3F9Um6CLNK/Q9PYQNLWvfHXbpGVpLB1yHcD/w28KaiJ l8+7wkz5LttbBteN+oWo1WLGzyWW5swmSySWTl6rHBJmhxm08oUIcCI3icl0RFg0QaPeOS Aa3NIBid5BttAGPErJ1Vb44zvB04Cc2kOXmdbCmUvJoATZaJ4G/RA8R0CotfHdaBF2ggSr fElVkYdGj0uj9CkpzyoXy5UmnZUxKhNRuammGmaOmWSf7oNh0EWkWyc828317Xqq4sL+C1 twzBeKHFY7EK1VRWq+bq1C2wLE6E0xxmxYeOFhsSpX79yY/7L3CR66BEBFOX1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wc7QCgaoNHfKHanhi7x4Fsw1DLu/yqBjlZNejQc7l4U=; b=NGJhfctKZmB2LJeB8NeFlyzT5kAGPARYQBoXqG9JP0+rFfSgB0J6Zl4X3wk/9AQimBkLjk QfRMww6PNyin+KKyFZZxrdC8dCBeN8VTcEYpgFHDftMlDkoX2XrnwRw9bklMZ+O7c1Kg/w VgdZ3QaIa/UNttQEKjWKHicFHbXCa3LD+/3GSLbSuWReqrqYAVVwldtlRzqrKDdaSpSUak HhxbEKfiGpoBUXVCffeY12zQA7Y/nMW+zwpE++FNVZ5C8CsCJVe2fNnMFJutR8RVWD9eCT Ae6XdT2+98d+XihcBYdthzyFWYYXpXY9YfdppJtqXXoimzMXN8uaBmoRRM0Luw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8W75015rz11bh; Thu, 19 Sep 2024 09:53: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 48J9raW6075344; Thu, 19 Sep 2024 09:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9raMh075341; Thu, 19 Sep 2024 09:53:36 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:53:36 GMT Message-Id: <202409190953.48J9raMh075341@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: 5bd7b976c121 - main - dtrace_test: Remove the dependency on dtraceall List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5bd7b976c1214cd6357b74f491753a331f9b7c99 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5bd7b976c1214cd6357b74f491753a331f9b7c99 commit 5bd7b976c1214cd6357b74f491753a331f9b7c99 Author: Mark Johnston AuthorDate: 2024-09-19 09:21:55 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:21:55 +0000 dtrace_test: Remove the dependency on dtraceall FBT refuses to create probes in modules which depend on dtrace(all), but dtrace_test is a convenient place to add functions specifically for testing dtrace. The dependency on dtraceall is not needed, so just remove it. In fact, it can be useful to test SDT probe creation by loading dtrace_test with and without dtraceall loaded. Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46673 --- sys/cddl/dev/dtrace/dtrace_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/cddl/dev/dtrace/dtrace_test.c b/sys/cddl/dev/dtrace/dtrace_test.c index c77448670917..e36debc27a49 100644 --- a/sys/cddl/dev/dtrace/dtrace_test.c +++ b/sys/cddl/dev/dtrace/dtrace_test.c @@ -106,4 +106,3 @@ dtrace_test_modevent(module_t mod, int type, void *data) DEV_MODULE(dtrace_test, dtrace_test_modevent, NULL); MODULE_VERSION(dtrace_test, 1); -MODULE_DEPEND(dtrace_test, dtraceall, 1, 1, 1); From nobody Thu Sep 19 09:53:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8W762PjXz5Vn9p; Thu, 19 Sep 2024 09:53: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 4X8W761R23z4QKl; Thu, 19 Sep 2024 09:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EZ/4si/044I4A+N4EELbgB45zrlGposJufOkzw6xo6Y=; b=dk3RYFwYuCKqZluibZ3nMJjAeHMjKDoDWc/3/cpRbT81++fNtscaFclqwA5VAdScHPfw+r eaK4q3+PentuU3TP0a8wFNWpE2YLaQdtUAntdbhKBOe+vA7v8oEK3NVz9VmFu1M+mAXVwc I9u8rbv1rVbcQPWzMluZPrtkzSrwhQA16eLnV56QWq7ixRt5hluVJcKElmAgh1jtJ7/fbY ZfsHIIH5ArE042LhCLsvNm7i4E4ECs9VnOQc+hzBpybv46pYf3/C52T8CzfzEh0wxKgrHy SdB+5qxqu2QdDDXTXlGz8Tt+whqoxESNsWM4AhwagFvc5yCqdrogpN7SuRKK4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739618; a=rsa-sha256; cv=none; b=GkkL/ZQ2uWZ56mAcq3vTIdVrXOLPhnp95MbwLkupdv+OijVdXhGa89ePNtqwO/nuKqtDhh nS0PUcB9afjXv1f5X9PXtHLrUgmQ+3w0S/upbOE+M1EfDUKirrPQ4u7V+81ATX9VR66SWq qIPKOYer5/EpsC5MfCqFENL9CZBbqQx2HRln5Icc+xeVsZLY/3rZwl7arUpnU9diIk+dwC bQCHJ++jW6q+1qYDMUzJQZgy+EiWJRdDwM0mZX673tZ8v7qJQgSlcpvmJF+su0bXLyb5eX TN0m8vqSqTILREy4diJdeW+lSLVqZcwno6zdPFxagTkAYh90uaWIRu0/wGWQlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EZ/4si/044I4A+N4EELbgB45zrlGposJufOkzw6xo6Y=; b=AtTbzxluXZ5Lh0GFaobb+xOtAn7o3mNEj40zWOPUd9uCoXF6nthP8Ac9lw77CdpOBGk81V LtWAiydeDXyhfmW8PHaTLrNtPtVt+x+IQq1iZgDwyb/Gy+JJCFjTaxhLxulSBYOa8RfAfO e5X671a8f+bajlXfh+ECkImQx0uZJlReL62szdmdxHLIKzeEiXYtgOBCStAdIPWBcOoFQ4 iRrgcKzke52DBlaDWFPAmNfAAs1vZXYEDdD4dpgwp9tCUsuvatMY4LwppZxWD5uZ2cT6Hp MOy00NZL/aUg28L8AWbxJUXMVef4eqKzgqLBHCxhIVEuJB3nzpTpOhIqVvBRHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8W761301z11lF; Thu, 19 Sep 2024 09:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48J9rcOk075404; Thu, 19 Sep 2024 09:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9rcQO075401; Thu, 19 Sep 2024 09:53:38 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:53:38 GMT Message-Id: <202409190953.48J9rcQO075401@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: d439598dd0d3 - main - dtrace tests: Add a test case which validates FBT probe arguments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d439598dd0d341b0c0b77151ba904e09c42f8421 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d439598dd0d341b0c0b77151ba904e09c42f8421 commit d439598dd0d341b0c0b77151ba904e09c42f8421 Author: Mark Johnston AuthorDate: 2024-09-19 09:22:03 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:22:03 +0000 dtrace tests: Add a test case which validates FBT probe arguments Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46674 --- .../test/tst/common/fbtprovider/tst.argtest.ksh | 34 ++++++++++++++++++++++ .../tst/common/fbtprovider/tst.argtest.ksh.out | 3 ++ .../dtrace/tests/common/fbtprovider/Makefile | 2 ++ sys/cddl/dev/dtrace/dtrace_test.c | 28 ++++++++++++++++-- 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.argtest.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.argtest.ksh new file mode 100644 index 000000000000..dc3641b01101 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.argtest.ksh @@ -0,0 +1,34 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2024 Mark Johnston +# + +dtrace=$1 + +$dtrace -q -s /dev/stdin -c "sysctl debug.dtracetest.fbttest=1" <<__EOF__ +fbt:dtrace_test:fbttest:entry +{ + printf("%d %d %d %d %d %d %d %d %d %d\n", args[0], args[1], args[2], + args[3], args[4], args[5], args[6], args[7], args[8], args[9]); +} +__EOF__ diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.argtest.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.argtest.ksh.out new file mode 100644 index 000000000000..301e154b3339 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.argtest.ksh.out @@ -0,0 +1,3 @@ +debug.dtracetest.fbttest: 0 -> 0 +1 2 3 4 5 6 7 8 9 10 + diff --git a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile index 3ca540fd77f1..0dee8f807065 100644 --- a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile @@ -6,6 +6,8 @@ PACKAGE= tests ${PACKAGE}FILES= \ err.D_PDESC_ZERO.notreturn.d \ + tst.argtest.ksh \ + tst.argtest.ksh.out \ tst.basic.d \ tst.functionentry.d \ tst.functionreturnvalue.d \ diff --git a/sys/cddl/dev/dtrace/dtrace_test.c b/sys/cddl/dev/dtrace/dtrace_test.c index e36debc27a49..a61958d9184a 100644 --- a/sys/cddl/dev/dtrace/dtrace_test.c +++ b/sys/cddl/dev/dtrace/dtrace_test.c @@ -51,13 +51,27 @@ typedef struct vnode vnode_t; vnode_t dummy; vnode_t *rootvp = &dummy; +enum argtest { + ARGTEST_SDT, + ARGTEST_FBT, +}; + +extern void fbttest(int, int, int, int, int, int, int, int, int, int); + +void __noinline +fbttest(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j) +{ + printf("fbttest(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)\n", + a, b, c, d, e, f, g, h, i, j); +} + /* * Test SDT probes with more than 5 arguments. On amd64, such probes require * special handling since only the first 5 arguments will be passed to * dtrace_probe() in registers; the rest must be fetched off the stack. */ static int -dtrace_test_sdttest(SYSCTL_HANDLER_ARGS) +dtrace_test_argtest(SYSCTL_HANDLER_ARGS) { int val, error; @@ -68,7 +82,10 @@ dtrace_test_sdttest(SYSCTL_HANDLER_ARGS) else if (val == 0) return (0); - SDT_PROBE6(test, , , sdttest, 1, 2, 3, 4, 5, 6); + if (arg2 == ARGTEST_SDT) + SDT_PROBE6(test, , , sdttest, 1, 2, 3, 4, 5, 6); + else + fbttest(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); return (error); } @@ -78,8 +95,13 @@ static SYSCTL_NODE(_debug, OID_AUTO, dtracetest, ""); SYSCTL_PROC(_debug_dtracetest, OID_AUTO, sdttest, - CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, dtrace_test_sdttest, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, ARGTEST_SDT, + dtrace_test_argtest, "I", "Trigger the SDT test probe"); +SYSCTL_PROC(_debug_dtracetest, OID_AUTO, fbttest, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, ARGTEST_FBT, + dtrace_test_argtest, + "I", "Trigger the FBT test probe"); static int dtrace_test_modevent(module_t mod, int type, void *data) From nobody Thu Sep 19 09:53:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8W775L8Sz5VnDR; Thu, 19 Sep 2024 09:53: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 4X8W772SCFz4QL2; Thu, 19 Sep 2024 09:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U4jtx5WNNZcrvEzcufy8dYIc7TCmys90DnTojzlmadI=; b=X7KepHkXNK26CiAbVZo2ej0C6qZG2uMrQj3C3FoV6BMKJRcEH7GxUzf1tHwnFNq3R/QTiL Upl4scGtpyJt47jcYJQWh5E4Cy6iR42IWaaFf/DS7fjqaX7qi2emRFKyxl6K5BH6ncAvxV 09g4XPzSqfr6TL9Df6zN1z7gPKxiH+hiNJrWo6d5Iiks9BSz0Y2bYvQp/4V3p6p7wPsABO /mGxHUqtsOFqt76St4U9BtzHYFDonGjMTblozvQ1p4zBY1eHX9j+Ra6l69sQktC+/n6yCP 9pmnJ5e5M/Y3Y8jKA6vo5yrXxotPpcpH1FvvCZhpSbpjc/swKgjMCLGScSt9+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739619; a=rsa-sha256; cv=none; b=eu7QY7Tnpq60pVc7bKuq9JiZrZde1H2K+jlOIx4EXqSFk7uh+L/s2FtrXNA+dgDv3r40hp oha3iULqxzjvwlgxN+Fnvt4G+g8LNoXCw5yeOryinljtzPwRi+r6HoNLZN4g5220VqYF5B Q9Mhl8PcFceE3LcCkQMqkdOrZaEoVqVGfBCWtP6uyCMDqEDly4bUOJTAvjpVjLhGPVpuIS 08xC1yxWxNmOQx5MzlZjJrNVGx2q/SYG+t+wBWWv6Tin+4I2rz1MyZyDcWCakhkjVdF0Fe o8isJ7n6GKfBInPld3gt6fOhDQeZDyfMdeJRueH/rVPG6NfDgLhk8r1d/oE82Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U4jtx5WNNZcrvEzcufy8dYIc7TCmys90DnTojzlmadI=; b=UwpEClRuaUfTCAgLMw4AdDzMdhK6AASchfi4gIAaQrHTmL2tT8yWwx14yaF4FUepmYlmlb EqI+/Zadiok0u+tTSvcJcIrBIr+kws3tEOgl68bFj7qYh1ImbkKUJKJ0+gtTALOiFHaEqG b56zkAx+q8VvMxruK3FkBkWiV+5vCM99hmaB1i8CELeI+qOgK9I7S5iHEQNs/wMNPRa+bX xvmVprF9Q3DrNi2WV8dF6hWVFtvFfeviQzJRcLFRCToNUOU70IAFGZOa29G1S4KMzsoZq/ lt2dJl/L18DtAoIvTwahiRyoiR0RQOeq4O3xZjNYFdp92f0OxCTevbDg04HpAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8W7723tmz11W6; Thu, 19 Sep 2024 09:53: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 48J9rdBr075446; Thu, 19 Sep 2024 09:53:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9rd7O075443; Thu, 19 Sep 2024 09:53:39 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:53:39 GMT Message-Id: <202409190953.48J9rd7O075443@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: 06e7bc83f6a4 - main - dtrace/amd64: Remove the dtrace_invop_callsite symbol List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06e7bc83f6a49b99f87ad1a6034e2fad54ebe7f3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=06e7bc83f6a49b99f87ad1a6034e2fad54ebe7f3 commit 06e7bc83f6a49b99f87ad1a6034e2fad54ebe7f3 Author: Mark Johnston AuthorDate: 2024-09-19 09:22:13 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:22:13 +0000 dtrace/amd64: Remove the dtrace_invop_callsite symbol It is not needed after commit 7e80fd5ef397. No functional change intended. Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46675 --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h | 2 ++ sys/cddl/dev/dtrace/amd64/dtrace_asm.S | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 98ae9eba120a..263b254b9021 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -2400,8 +2400,10 @@ extern int dtrace_mach_aframes(void); #if defined(__i386) || defined(__amd64) extern int dtrace_instr_size_isa(uint8_t *, model_t, int *); +#ifdef __i386 extern void dtrace_invop_callsite(void); #endif +#endif extern void dtrace_invop_add(int (*)(uintptr_t, struct trapframe *, uintptr_t)); extern void dtrace_invop_remove(int (*)(uintptr_t, struct trapframe *, uintptr_t)); diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_asm.S b/sys/cddl/dev/dtrace/amd64/dtrace_asm.S index 0c8cd9a83d01..4c18fbf08220 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_asm.S +++ b/sys/cddl/dev/dtrace/amd64/dtrace_asm.S @@ -56,9 +56,6 @@ swapgs; \ 1: addq $TF_RIP,%rsp; -.globl dtrace_invop_callsite -.type dtrace_invop_callsite,@function - ENTRY(dtrace_invop_start) /* @@ -78,7 +75,6 @@ movq %rsp, %rdx call dtrace_invop -dtrace_invop_callsite: addq $16, %rsp cmpl $DTRACE_INVOP_PUSHL_EBP, %eax From nobody Thu Sep 19 09:57:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8WCS37gGz5Vng8; Thu, 19 Sep 2024 09:57: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 4X8WCS1rpMz4SCL; Thu, 19 Sep 2024 09:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GhDfCwz7AgFzlawxwhjiilv8K2mSMUI+rikxS9KLlPc=; b=NyCgoVEGGQx371Xm4O4HNc9g+S86vHiHs0VUcDwZlBobKqVIgXqOE3St9c+bgUueloBfh7 5jM0rAzUs/RGjQ6mU7WBBJW0blmVmw0j7GdKyIrLhZbClH9WnxnCcBV5DpSr/0o+ENhZhn SLhDlS1/fm6wAfx9EZMmI9wxvWDQcPDHfX/Ku5EIKoyJzAngQ8/HC706MG9MwXAwMiaux8 K+yDy3xmrPPfoFfmITZqm++W7Sq2ZN613egtLUvL5Bsqnxzd5yy6ltnxqEmLuHCXnSaK3d sqbJtNS1xUVv4aMaRGm/XfdqSGV209j30/LqYnHacAlnNH3rkp2xWISoE7jWsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726739844; a=rsa-sha256; cv=none; b=Ep64KpjKO3x6DEL1XsUR7NMFKI0unD84jl380zk1kgi/fpf2hFwpO1ic98WJUyI1uZ7HFe BZ++QAdI0x7ZRnWuwAyxVBJuQqL/0CPtPwjTr3ckLc6FcmRY6Wc/YWtWeqSAXGQW83fDbm DLEPytqsiS9AIuMTMXkcJX52tecDKggAuiwnakCnulUyKTZG82pt9oexjmt3sb0TPyRqO0 ks86QkIEwh/BJTPh7EUBDZHzxRiK7HTMJzvOHCjI/fm0KITrYHeVNNGoPQRTiTZRaQl48g lUDxU6fS/UGOTpa9oUm5bUxdqqnHF2S3eJjsa0uhwCC55SWdzz6c3EatiVszEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726739844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GhDfCwz7AgFzlawxwhjiilv8K2mSMUI+rikxS9KLlPc=; b=ZlqmfQi3UCGv5KIIQKTxHA3fRLX1Owt3fvxy0+d8K+QmGslejawmB6RVWX0DHiX1cjPafs UnlLTeUfUF93t0WZQpFwsik8i04FQE6fw0vxuZ8UNng/ypzr0SxJzwSRFt/bi4w9AaGRK3 u0fKX7Ux9NrZXF1PC8BbjOLwAsioq3ybO5OQI/QMWG/Wx7UbmAClu1SvVoUrpWhD3W6q7f lkBNVb8tsblJFRhhIOjD5IOfMoPnvmGyeHUQI0CoLdJ6FCHHtmvQlPRXi1GmXHF4eNAXP5 6LwRPqdFQXu52rfbYSpViMRrtc1uOvaB0Wyhi32C1oEEas6r3If0KM67RVXPTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8WCS0w0Zz11Kj; Thu, 19 Sep 2024 09:57: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 48J9vOKu076211; Thu, 19 Sep 2024 09:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48J9vO4P076208; Thu, 19 Sep 2024 09:57:24 GMT (envelope-from git) Date: Thu, 19 Sep 2024 09:57:24 GMT Message-Id: <202409190957.48J9vO4P076208@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: 1ae4951ba7bb - main - netmap: Make the memory ops function pointer table const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ae4951ba7bb203d9a29892792960f0869759d35 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1ae4951ba7bb203d9a29892792960f0869759d35 commit 1ae4951ba7bb203d9a29892792960f0869759d35 Author: Mark Johnston AuthorDate: 2024-09-19 09:56:30 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 09:56:30 +0000 netmap: Make the memory ops function pointer table const No functional change intended. Reviewed by: vmaffione MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46664 --- sys/dev/netmap/netmap_mem2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c index 473b252e7329..3cd3422b10ce 100644 --- a/sys/dev/netmap/netmap_mem2.c +++ b/sys/dev/netmap/netmap_mem2.c @@ -179,7 +179,7 @@ struct netmap_mem_d { /* list of all existing allocators, sorted by nm_id */ struct netmap_mem_d *prev, *next; - struct netmap_mem_ops *ops; + const struct netmap_mem_ops *ops; struct netmap_obj_params params[NETMAP_POOLS_NR]; @@ -533,7 +533,7 @@ static struct netmap_obj_params netmap_min_priv_params[NETMAP_POOLS_NR] = { * running in netmap mode. * Virtual (VALE) ports will have each its own allocator. */ -extern struct netmap_mem_ops netmap_mem_global_ops; /* forward */ +extern const struct netmap_mem_ops netmap_mem_global_ops; /* forward */ struct netmap_mem_d nm_mem = { /* Our memory allocator. */ .pools = { [NETMAP_IF_POOL] = { @@ -1667,7 +1667,7 @@ error: */ static void * _netmap_mem_private_new(size_t size, struct netmap_obj_params *p, int grp_id, - struct netmap_mem_ops *ops, uint64_t memtotal, int *perr) + const struct netmap_mem_ops *ops, uint64_t memtotal, int *perr) { struct netmap_mem_d *d = NULL; int i, err = 0; @@ -2174,7 +2174,7 @@ netmap_mem2_deref(struct netmap_mem_d *nmd, struct netmap_adapter *na) } -struct netmap_mem_ops netmap_mem_global_ops = { +const struct netmap_mem_ops netmap_mem_global_ops = { .nmd_get_lut = netmap_mem2_get_lut, .nmd_get_info = netmap_mem2_get_info, .nmd_ofstophys = netmap_mem2_ofstophys, From nobody Thu Sep 19 10:02:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8WKH4hyqz5Vp02; Thu, 19 Sep 2024 10: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 4X8WKH4GnTz4TSJ; Thu, 19 Sep 2024 10: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=1726740147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qKiTRbEaaJUGo7tQgRjerBXg/vcE3TJnEniz1I+7z8c=; b=Z0S2UmvGrhiRbF6QZ/2zMLmtKb31MOvVI4i6wWiUSiMpIJK80fxHFQgN3LqSxxk0vVBkw8 7AfVerTugR+Hgfr3vp+Oc/Ar4TbflTGq0p4oKuG5sPaJkOOO78HOt4ODk9q9nIWd2Oqx9n mW6m3ZEhvwpKWJiiWy6GK1Pi0wvNlyJsCIvXQ4fn7auJ3KMQiNF+He7dYwTRn6f45EOrqu R32M/FbacOwefjLdd7evfg0QYM90rNDFPpi1LI/8Wskg8U5Slg8pq37qor/7u/stFEngyE RFaojeZMI2iRtea8WQ1fSXYjIQWTknatFPVVMzrHYXmfinaEZSoTofqIRaPDng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726740147; a=rsa-sha256; cv=none; b=q7mCIjWK3zilILFcV4ekE2nPirOpQZCiDctHF5daRCXCYdPTXuSHB6jdoLfG322FJ6Yb89 cqnASSyFsMU/KPbP48XzTaXtTXvuxmBwEwxdQABs73NwcYOznGu7au0Az14fGU0034QA7n s4cEX6YdAHNwVJsTWdqYKsYztLEpbAYWygNWcyeoTVl/FHKod6i1A8GkNO1jm9pDDwEqha ZrGpcQPVvaRUeMHCeV7Fmer6GksN7RsUuKts30K30hGFrWGHrpggd9N+zH/+s5q+iydjOA fDApsRA3I6zGoQI1h9ORVqYPBSP2yDfEHt3KsxQ5UeccHhgNfqbHD1AIsWRiiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726740147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qKiTRbEaaJUGo7tQgRjerBXg/vcE3TJnEniz1I+7z8c=; b=gJipmLGNFN232G+3ymfbN4jvAG1NUtCY4wzVbOa3zpWHR8wDyLh/Yis+tQgZwmR4B570hy J5vjm8Sh/tQvIV+TYYFSjMjt9GYwL61qLmC31CpNiYABabpVrjKT64vmeQzDkrZEOIwMWI kvPR8bm3a5ry3NLdTlb4o/OPlae66a12PSEaInGLdrQX3cJMwT6PJknd4SLd52eAEzG9v1 pywQHEvVsSPxUjgtfMh3Oxd0qFGLUmfR6bKaoDO3/1T6iV+QjMcKB7Ch64iWQNlJz1Hj7p up0e5EVrsBtN1t1c95UhXMZ4K1TfxbMH02kLF07Ca7pyXL9mbHUimBLT1PjRGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8WKH3m6wz11lq; Thu, 19 Sep 2024 10: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 48JA2RCR093169; Thu, 19 Sep 2024 10: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 48JA2RIo093166; Thu, 19 Sep 2024 10:02:27 GMT (envelope-from git) Date: Thu, 19 Sep 2024 10:02:27 GMT Message-Id: <202409191002.48JA2RIo093166@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: 5d045d556b1c - main - syslogd: Ignore getaddrinfo() errors if -ss is specified List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d045d556b1cfeb1487d49017b536afb3df105d3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5d045d556b1cfeb1487d49017b536afb3df105d3 commit 5d045d556b1cfeb1487d49017b536afb3df105d3 Author: Mark Johnston AuthorDate: 2024-09-19 10:00:33 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 10:01:37 +0000 syslogd: Ignore getaddrinfo() errors if -ss is specified This can arise if the jail doesn't have networking configured, and if -ss is specified, syslogd won't listen on port 514 anyway. Add a regression test case for this as well. PR: 238006 MFC after: 1 month --- usr.sbin/syslogd/syslogd.c | 8 ++++++++ usr.sbin/syslogd/tests/syslogd_test.sh | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 7770e97e7a2d..12fa61b01bad 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -548,6 +548,14 @@ addsock(const char *name, const char *serv, mode_t mode) if (serv == NULL) serv = "syslog"; error = getaddrinfo(name, serv, &hints, &res0); + if (error == EAI_NONAME && name == NULL && SecureMode > 1) { + /* + * If we're in secure mode, we won't open inet sockets anyway. + * This failure can arise legitimately when running in a jail + * without networking. + */ + return; + } if (error) { asprintf(&msgbuf, "getaddrinfo failed for %s%s: %s", name == NULL ? "" : name, serv, diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh b/usr.sbin/syslogd/tests/syslogd_test.sh index e4927868e47f..08e6d76b9ba6 100644 --- a/usr.sbin/syslogd/tests/syslogd_test.sh +++ b/usr.sbin/syslogd/tests/syslogd_test.sh @@ -22,7 +22,13 @@ readonly SYSLOGD_LOCAL_PRIVSOCKET="${PWD}/logpriv.sock" # Start a private syslogd instance. syslogd_start() { - syslogd \ + local jail + + if [ "$1" = "-j" ]; then + jail="jexec $2" + shift 2 + fi + $jail syslogd \ -b ":${SYSLOGD_UDP_PORT}" \ -C \ -d \ @@ -288,6 +294,31 @@ pipe_action_cleanup() syslogd_stop } +atf_test_case "jail_noinet" "cleanup" +jail_noinet_head() +{ + atf_set descr "syslogd -ss can be run in a jail without INET support" + atf_set require.user root +} +jail_noinet_body() +{ + local logfile + + atf_check jail -c name=syslogd_noinet persist + + logfile="${PWD}/jail_noinet.log" + printf "user.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start -j syslogd_noinet -ss + + syslogd_log -p user.debug -t "test" -h "${SYSLOGD_LOCAL_SOCKET}" \ + "hello, world" + atf_check -s exit:0 -o match:"test: hello, world" cat "${logfile}" +} +jail_noinet_cleanup() +{ + jail -r syslogd_noinet +} + atf_init_test_cases() { atf_add_test_case "basic" @@ -296,4 +327,5 @@ atf_init_test_cases() atf_add_test_case "host_filter" atf_add_test_case "prop_filter" atf_add_test_case "pipe_action" + atf_add_test_case "jail_noinet" } From nobody Thu Sep 19 12:30:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8Zbb6M6zz5WShQ; Thu, 19 Sep 2024 12:30: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 4X8Zbb5rQxz4l6D; Thu, 19 Sep 2024 12:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726749003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UYIwCICLZ56sV8hTWoD315gvt5/E+cWZo4prPG/Z1aY=; b=ciTLw5p/kPpYN39R/y/C9rocm9MT0IKPZMg0sfh9io4Tz8Zk+UvN5kbqNZ/hxxOnYxo+sg NjFKgabjYV82ICxZpJTprnqbkKcnHAqIgkFyDmc6mSLhu4ItKxPJDIbMOFPSl80HuipSbL lGkl0LR3VDQyoxhfCqLqjkZjpfYZ9ZW6Xjq6IXCa1o6L9o594rQs8w6a15OZF1ycLVbX3f mUHQU1a4OUPX5nVY1XbSzuRjs+Epaf2klEfJjc6pj07vdNK/oxRiGIykHNShBmerByR/i7 ZBMsovvJnbh+Qp0lFgRyr/gvDHxB/Z+bcRMs2xcOrwFMD7AfXP+X6MjnvFRGRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726749003; a=rsa-sha256; cv=none; b=Ch4HtlEJVS/ADHvEcmOLHvZIAgKvKobDc6VWe4Y5fIbt4OPLoqhiHjAxI5b6/lmio2Qs3W aZsdaYfF3Z4910NNOa+Uv4RDRP6pytyCEL9//eA5/9K1CWzdBCXaIOJJzqtTeAqXWUgiYc 3rwrkoR70pChsHB9JZXB+gerr4xWc+p4l8zii1jaQmLIC1qIKrrmQFWva2h046fdkSc0Mo p2ukL5hy84VS5qeKh1dHjD4qZ0KU9waUeMGScqEX9HzJwLb8rMpaqdV1qc/L0Th6JDGh1R Wa6NRZTkuDu8udYNzIebtEsju22T87uzAbJAM0jSnsYUrSlRJcKGco7PBYcheQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726749003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UYIwCICLZ56sV8hTWoD315gvt5/E+cWZo4prPG/Z1aY=; b=FflmXM4/Csi188HqSxv8rvK3GEElD9Fo1g4GnKrgOAN4/tmtMAHcLptf7TEGaPkAZzGPKh B82e9bckfclVEadfdI/Kt2zbdE4u5bl1N4jlN+7my4wgoC3MaqTD4TAlPfk4h4BBjmplTK Q0cGSB5yZ0tfVd4IVi4wZrzxwgaINZpTArCfqj9BTQ0nitRKlDpHvhqdGZaVhAAQNloSIP Ga6rXawujo7eM4G3HY2VNIk/UJ6fHU/dvej7sWVheIYpmWn9Cg3tJWMvp4XjZ3P1XHbL4B wsTNDDTtndiyh4Wfoq0lgwWmb29mH3O+CHXeapcCVJ/XE/BbkFuwxmEIbOXkJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8Zbb5LpJz156L; Thu, 19 Sep 2024 12:30: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 48JCU35b033690; Thu, 19 Sep 2024 12:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JCU3Wv033685; Thu, 19 Sep 2024 12:30:03 GMT (envelope-from git) Date: Thu, 19 Sep 2024 12:30:03 GMT Message-Id: <202409191230.48JCU3Wv033685@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: e72d86ad9c62 - main - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e72d86ad9c62c8054d7977a71f08e68ef755c132 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e72d86ad9c62c8054d7977a71f08e68ef755c132 commit e72d86ad9c62c8054d7977a71f08e68ef755c132 Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Ed Maste CommitDate: 2024-09-19 12:26:07 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index b72c839c807b..2399cb4fc9b8 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -580,7 +580,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -853,7 +853,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -889,6 +892,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -897,6 +908,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -957,8 +972,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1019,6 +1046,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1032,6 +1067,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1138,11 +1177,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1227,6 +1274,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1325,8 +1380,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1555,8 +1622,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 12:40:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ZqP58cRz5WVTH; Thu, 19 Sep 2024 12:40: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 4X8ZqP4f83z4lv3; Thu, 19 Sep 2024 12:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726749617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0BRxhiReR+RyJR4nrzvBQ1ceTtdMw/Jet85pBJoNIDI=; b=mYUjHrncq7JrVePxaMmKe4T85UXEOYSL/QO5B5GAppQ0PaK1RzTiLYUcxDixhuymKy/bUx cM4CiEE8/rJbaE5lDpPAyfBywPwQj8vcm1MP4sJvrB3JxucCrZfMbBEWqsNbIId7QM04a6 pda6EdEdRU1877u0K0rGM8iK/f15RHUUoz8tpsdBwSaxz5zSYWxqp4lTRryNQH88kAQ1vP 3LsTsbNOfwFnRta5/LBhqu2z+8toPl/BX6iMxqfF1LW1b0LLxk67TN3OwVDFgIkzfUS5gp n975XDKdMeXtdVVFk/jWXsaoo9ZRNlG9bYDqi0HHM2HpeWBY7lGDsMHVK6ZiFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726749617; a=rsa-sha256; cv=none; b=wD66H9VqX6YyHKmBJ2M4JGx6vsdm82kSb9cex+Aj0leoiP7Uuxov4yHY7FWqgrPU7PrInS UhOEVMrZf9Mi5qBjltr3jytD18CXf2e3aehAnOqnRUQ0qECJ0cPzMLN+lqFXr5IYnBOO59 ysbmSwQiJ0fyb2zrIsoC18aYS48XxVwwLeoEgX2HYJfn4qGQXM9PHePjGIJhFHKFtVHeYk YWQsP4Rqj9iEa73ssCghdNhfNzbcpwcsmkNgrEMfZoFqOCx/Bh/YEgW1IUwla0TC9LEUCo sy/p23qr1QJqZipWMu/0PJaFM/9IEh00ImMzb0dPpBTaeTHyQgt8cf0Uvjv/DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726749617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0BRxhiReR+RyJR4nrzvBQ1ceTtdMw/Jet85pBJoNIDI=; b=lj1Q39jJv9lywBb/NPvmWaYaOXeYoiMgQYh/X/6huqGj1B/104h9HUstDt8vqnkc2H0cAU dHRDDqQg4IyHRq43zbbAbiP2J97EGHKv88k3/NQFoWU1NmAjO7gmj32xQMggzEnofqvPTB 9aO7q/Q8Rz/TNoZd8Pidn5VzykVUuG3ksYQiBGU8NUi90rzJEJGbJnxEDqIlMmY8yDBNzo pTgdSXE5M76+sTpHNv5rhYwTnH1b3juR812GWblJcZEJsh42rH4M6yXBj/PWVCHIFFTakB /Yfqe0W3ijarbGd/RtDHul+Ki8qrD334ZYBWnn2CNqiIzItj/foESw3EIArz4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ZqP4DnFz15Zy; Thu, 19 Sep 2024 12:40: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 48JCeHTq056607; Thu, 19 Sep 2024 12:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JCeHYf056598; Thu, 19 Sep 2024 12:40:17 GMT (envelope-from git) Date: Thu, 19 Sep 2024 12:40:17 GMT Message-Id: <202409191240.48JCeHYf056598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 419da61f8203 - stable/14 - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 419da61f8203ac475550ae4b0971dbef10f811f2 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=419da61f8203ac475550ae4b0971dbef10f811f2 commit 419da61f8203ac475550ae4b0971dbef10f811f2 Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Ed Maste CommitDate: 2024-09-19 12:36:29 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 (cherry picked from commit e72d86ad9c62c8054d7977a71f08e68ef755c132) --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 791c56a45f0b..77b17d525bdd 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -580,7 +580,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -853,7 +853,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -889,6 +892,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -897,6 +908,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -957,8 +972,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1019,6 +1046,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1032,6 +1067,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1138,11 +1177,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1227,6 +1274,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1325,8 +1380,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1555,8 +1622,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 12:48:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8b1K3VWHz5WWN4; Thu, 19 Sep 2024 12:48: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 4X8b1K1Nx0z4mw5; Thu, 19 Sep 2024 12:48:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TcrQoBgNQ61EheokNvZcGccFqZPPpu2O1Duwa/PL0mI=; b=JffPN/JsuXgEebPDsqM6To64WZlG6Cf+JYySPPpzH7U+k2kWH2s9UxHzB/aKJV9Q46+XGq urs0dZ1hCWj426ysRxoaOqZCBL/U8h+f/QJc+UCK55g41rK2HuYXsGbJblB+jIij31p1W4 /o1zSajAksfrQhQLb+HTZBtcoMp/ARfR7VinQROLg7mGc8hubLYEl8WArsHbboo1XUufla DCFcuRR5jNySHIdasqhRGLjT60ndbmYrwZXp9PS5ATQvRmUfMQ5IHD5ZialKG5Mo+UjNvU //2+5cFh0eutJ3toiKUXN1u5B1ieo1pdCQU++u5NRo0RV0FmgdCJ0kBSbVNggA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750133; a=rsa-sha256; cv=none; b=LWZFnx5MlfdYU8aNYIpCFLYxRxeCQLKvPfkESrjAtcBP8xqbZWHeZvvQaWjQ3icVJRKZ0D +X+jPMdfnUHNpmuxSSK3uk8nKPwy79XYVJqzhhLdsY6hgbSfzItQreSARw5bCM72ppNMeF MuEbJoFt/GthL71hRICaM8iYKibLg7lcYkeA4MyxEPa72P+S9OGShdGBkyLcv5/YTJ6JXO XwxfpGbGzdZZ0qIKcu2njpIsVdKA53RMYAkJkXe1rsfuklvi4s2sgEPHVBTEjBUvi2Dypk y1WnMMug5Zgd3czk0vgGyylpHXcA3lwAAFv1YVo2hu5VBxAuRUGMekugOl02Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TcrQoBgNQ61EheokNvZcGccFqZPPpu2O1Duwa/PL0mI=; b=ns3p6LW+BF//24ZGY18dICptoMAajvFPuUHG1IhyIiC2jaThBnJwQ4nfv7FNBH42qmEVbD YjqScQS0samwV7W5S9jQqciHzNS3oApAgMda59Axwfku6BYmzudK2PuTflLgoY1AD2/Jil haNRzE6X4e7fjhUJr2zKAIuh1vn+mWReYmaewy7ljNTpZLg4TRmPNjN6KkM0T/vSTUOGA0 YDi6++4zr+2S1+Y+rLBHvi2MdpZVMHUuRcF/uOCfK4zUiTJ8p7OVwOtRbim80/wxy9tDrG 8RHWojQlbRUitMYRMk1OgHZy268znaLLuCihLhh8bsAsXVx00lpjy3SvyLjTsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8b1K0tfWz15mF; Thu, 19 Sep 2024 12:48: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 48JCmqgJ065431; Thu, 19 Sep 2024 12:48:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JCmqB3065428; Thu, 19 Sep 2024 12:48:52 GMT (envelope-from git) Date: Thu, 19 Sep 2024 12:48:52 GMT Message-Id: <202409191248.48JCmqB3065428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2abd2ad64899 - stable/13 - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2abd2ad648994e8444f479e54773a36311f522e5 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2abd2ad648994e8444f479e54773a36311f522e5 commit 2abd2ad648994e8444f479e54773a36311f522e5 Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Ed Maste CommitDate: 2024-09-19 12:40:49 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 (cherry picked from commit e72d86ad9c62c8054d7977a71f08e68ef755c132) (cherry picked from commit 419da61f8203ac475550ae4b0971dbef10f811f2) --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 93161affd732..06c71a6643a6 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -579,7 +579,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -852,7 +852,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -888,6 +891,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -896,6 +907,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -956,8 +971,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1018,6 +1045,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1031,6 +1066,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1137,11 +1176,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1226,6 +1273,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1324,8 +1379,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1554,8 +1621,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 13:02:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bKT3D2tz5WY81; Thu, 19 Sep 2024 13:02: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 4X8bKT2kQpz4pcG; Thu, 19 Sep 2024 13:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNUUCL9daelcbdDJp3/1L2JjuM+3rhchtDj6vSLtBO4=; b=oiVI09B3v5NK8EyY2NFLglAQJp5w7J1qur+Qp9uAgJhN0egKecQ/lImq9+7yIBxcyqt6y+ pNtHGrYkSqE4pygMYdf+r8t3zTJ3BmDln65GkQwextnMw03NF47ixrst0Y773D4vzwT38k rxf28s0oJ6ypaurrq3+w/CRIw6CkExlSc2pdN9VRnoFNi0tHx7Ud7ZG06naRMv+olvdio9 oWC2gF4ga11qqMzdXX7AZrgUkJVmGmicG7vAT7kGact21U8Hl4h601PPSfcR26ega6VYCQ I1VobDoKeU3in14dJOqwqIps+0+r8OK1/4L7L4S2sFum3aManoQgGYmnMJVVvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750973; a=rsa-sha256; cv=none; b=oRrHW47Au7jc1Ajrf/bEqbweg1gRtkAkswv1wSCLXkYZVDBg9xldABurPtrehXrY8l/6WP KteCAS48ugA22mNuIxGteqw5XuC4xpn6viCbTadt5pJkTDJobhQY5Yz2UVkof5pdG1aTGn dup0xZADWZztz+dQa6+/MS2thV762IZkZHbTjuC8AYme5dfCMRKSdqkUbrIGeVAc7krRtl 7v5GqAjw2AjJ5fwKM//Aa2Hhz1NTzFB12vr+WRGDR/wwG6phVkyu5mXDTNVM4N3FMSYsXn BWn+A4e7gp5n1WIhBFkfQIod2GiKDTUCCpci+H2WGMe2nWIQCssKLqEOvIykbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNUUCL9daelcbdDJp3/1L2JjuM+3rhchtDj6vSLtBO4=; b=PUBtsvOF+wJiEvgRYLFT5ft6gMg4IJxU/cWmMZzoIMZB5uLsHWB8yfDoTMsUCwTZFEYie3 ZqCCVDnrk2DIvMbFlGOIsBdq8sMnRXuWDiaEn+UIlOqSV7d6w4IP5tCGHdcVNqmfvFBR66 JdTMXRilbdzWRolGJmry2iRm2OHxngLzcG9MToIEC1SQ15DjsARDeTcpYCA78VaY6AYbYz 5bYrP+7tC177Bd5S74FaTMCRQjLmLd6rPtCeZ+LkYhlXOkWm6rq4LuM+37p6/pd7Xt2zaO 686mqcWNRK1ii6oRP0rws2qIUqF1hnN0UXPy+5o+z1lJd8rSRpd6FAnAasXrVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bKT2KbQz16JL; Thu, 19 Sep 2024 13:02: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 48JD2r3A099555; Thu, 19 Sep 2024 13:02:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD2rMR099552; Thu, 19 Sep 2024 13:02:53 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:02:53 GMT Message-Id: <202409191302.48JD2rMR099552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fb925cf0a4b3 - releng/14.1 - pf: fix icmp-in-icmp state lookup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fb925cf0a4b38bffc4c9733bae3212f07a481931 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fb925cf0a4b38bffc4c9733bae3212f07a481931 commit fb925cf0a4b38bffc4c9733bae3212f07a481931 Author: Kristof Provost AuthorDate: 2024-08-12 14:07:35 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:54:47 +0000 pf: fix icmp-in-icmp state lookup In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP error packets potentially being dropped incorrectly. Specially, it copied the ICMP header into a separate variable, not into the pf_pdesc. Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup. Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 2da98eef1f352c496ffd458b4c68ddee972bb903) (cherry picked from commit 27a1a56b0d2e6ffa6ab1de69ef84fe66b7fd41e0) --- sys/netpfil/pf/pf.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 1cc85edfe3dc..edfa7a450054 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7076,9 +7076,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, } #ifdef INET case IPPROTO_ICMP: { - struct icmp iih; + struct icmp *iih = &pd2.hdr.icmp; - if (!pf_pull_hdr(m, off2, &iih, ICMP_MINLEN, + if (!pf_pull_hdr(m, off2, iih, ICMP_MINLEN, NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short i" @@ -7086,12 +7086,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - icmpid = iih.icmp_id; - pf_icmp_mapping(&pd2, iih.icmp_type, + icmpid = iih->icmp_id; + pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, - pd->dir, kif, virtual_id, virtual_type, + pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); if (ret >= 0) return (ret); @@ -7105,10 +7106,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || (virtual_type == htons(ICMP_ECHO) && - nk->port[iidx] != iih.icmp_id)) + nk->port[iidx] != iih->icmp_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP_ECHO)) ? - &iih.icmp_id : NULL, + &iih->icmp_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP_ECHO)) ? nk->port[iidx] : 0, NULL, @@ -7124,7 +7125,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); - m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih); + m_copyback(m, off2, ICMP_MINLEN, (caddr_t)iih); } return (PF_PASS); break; @@ -7132,9 +7133,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: { - struct icmp6_hdr iih; + struct icmp6_hdr *iih = &pd2.hdr.icmp6; - if (!pf_pull_hdr(m, off2, &iih, + if (!pf_pull_hdr(m, off2, iih, sizeof(struct icmp6_hdr), NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short " @@ -7142,8 +7143,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - pf_icmp_mapping(&pd2, iih.icmp6_type, + pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); @@ -7171,10 +7174,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || ((virtual_type == htons(ICMP6_ECHO_REQUEST)) && - nk->port[pd2.sidx] != iih.icmp6_id)) + nk->port[pd2.sidx] != iih->icmp6_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP6_ECHO_REQUEST)) - ? &iih.icmp6_id : NULL, + ? &iih->icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? nk->port[iidx] : 0, NULL, @@ -7192,7 +7195,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, (caddr_t)&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), - (caddr_t)&iih); + (caddr_t)iih); } return (PF_PASS); break; From nobody Thu Sep 19 13:02:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bKV4Qkzz5WY92; Thu, 19 Sep 2024 13:02: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 4X8bKV3qDPz4plR; Thu, 19 Sep 2024 13:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QM1JuxaNON0LbyUAlvUpaLVrl6NQDtl0MhSwkNe5HxI=; b=EP+WebIy4axBouhGHZ07BVb3HVIx+QTd00G+gn7oJGKLcy/ugWIwnGIKqLmx3QOX9GsUwh h5R5klUICtSPYgFpt98QCorIAs6eKo0/zwMF/9teFWZXcWfU2t9zv49hKxP1mr3NjmkHQW JfOr4qf3Vq0t2oD24a2A0bTDHLbQZGYXWXU5p2Oy/xjOar+unzmnBlVdSDpM2ZjSX0+Cky bRYAQ7K1qzhTCxTAaYvmInaRazctbj43fVrKZF7UwxjUJaSfWyuX9o7mnrGm5vQl3BoJoH 6I5Kd5A1fB3h9zlm9avet1BCqyljXsImSymFq1+5yXf4VEeOwxlAjtFXI1g8mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750974; a=rsa-sha256; cv=none; b=n6iZIF7Z63FiIkFtaqseWidoJFUvRDrj4JkxI4LAPJq11ALtRa2xtKuidlvcMRn3dCtL3q 7WRSNd42WYusxsWev3OFTF/0aaWBjpRyOfESo5ueUB5Yih2yrqzdi1JLfVL/tBNgDBew6E hv6M089fhWn08bro4IHrbLCY6IlE0tCUswxKui2hIyM5jMxlMRF1c7qPtc5boYf2MPPaJQ muNyz6qrgArzQ9DwxDSomWHVLSM+jVWkz2rsnpSQkWbSvnyVNdu41lDGnkfuMNysVMRk9V FcxO/IKM1NvtIu+LrAGn58gznTZKJsNBVGh+05AifsQpym+/Ye/LO+BFI5ElDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QM1JuxaNON0LbyUAlvUpaLVrl6NQDtl0MhSwkNe5HxI=; b=pLxZO8+WFiZa4QSWqfZBGv/DTzhKjNsxQVLm2aHHXhC8GfejU2tMjyYURqQuD43Al9GXAV DT/4qx8p1PXszd8yDFzggpgbMzU+A8DctiLjBxq3jmBHA10jFDSN3IB97uGo/O5VM8XmMp gcA9Gsy4rBQIcjl3z/upVz04br8qkY6Cys+T3LktpIK6UYiI3/nPIkoIq9HN58ytVhXSio S7N9qUs36ZLwltKlcxHEhaVcScx/87sSbTafW5BF/NVMyxyHd2sPVVXA0SOUOsIqcCRkoJ O+mX3vXR5MLftanzii1p7NJfO58ZAy65v2Udu/h498CpZjtS+9PW+k0f9IUPGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bKV3R0Sz16W8; Thu, 19 Sep 2024 13:02: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 48JD2sim099609; Thu, 19 Sep 2024 13:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD2sut099606; Thu, 19 Sep 2024 13:02:54 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:02:54 GMT Message-Id: <202409191302.48JD2sut099606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 84b57a4c5b84 - releng/14.1 - pf: invert direction for inner icmp state lookups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 84b57a4c5b848d44ec0918c28d8c27bec948a151 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=84b57a4c5b848d44ec0918c28d8c27bec948a151 commit 84b57a4c5b848d44ec0918c28d8c27bec948a151 Author: Kristof Provost AuthorDate: 2024-08-14 09:29:30 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:55:09 +0000 pf: invert direction for inner icmp state lookups (e.g. traceroute with icmp) ok henning, jsing Also extend the test case to cover this scenario. Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 Obtained from: OpenBSD MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 89f6723288b0d27d3f14f93e6e83f672fa2b8aca) (cherry picked from commit 46c4fc50d3012ca3c8756df243589add36b70830) --- sys/netpfil/pf/pf.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index edfa7a450054..43f32f673842 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -342,7 +342,7 @@ static int pf_test_state_udp(struct pf_kstate **, int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, int, struct pfi_kkif *, u_int16_t, u_int16_t, - int, int *, int); + int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -6582,7 +6582,8 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi) + u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, + int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6619,7 +6620,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && - (((*state)->direction == direction) ? + (((!inner && (*state)->direction == direction) || + (inner && (*state)->direction != direction)) ? PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", @@ -6677,7 +6679,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, */ ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, - PF_ICMP_MULTI_NONE); + PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -6685,7 +6687,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 0); if (ret >= 0) return (ret); } else @@ -6769,6 +6771,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, int off2 = 0; pd2.af = pd->af; + pd2.dir = pd->dir; /* Payload packet is from the opposite direction. */ pd2.sidx = (pd->dir == PF_IN) ? 1 : 0; pd2.didx = (pd->dir == PF_IN) ? 0 : 1; @@ -7090,10 +7093,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd2.dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) return (ret); @@ -7146,10 +7148,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -7158,7 +7159,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 1); if (ret >= 0) return (ret); } else From nobody Thu Sep 19 13:02:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bKW5nxNz5WYC4; Thu, 19 Sep 2024 13:02: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 4X8bKW4XL2z4pWy; Thu, 19 Sep 2024 13:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pURf+oeWdBMhZT2b0eH3gaDxW6XnymWSiTNhhwYFmnE=; b=NOScNAAKChJZexXnKkMTUaENICPf0kh0sM4PVsF0dsOQWreaGGPgSYyAHynbszUaBUSIxs vHfX6av1cIqHmORWWvh93ilKWHhA/F4d3W5eeauvT7VokmNBR7ypsalo2mMheoNB1oYf5v 82inStPQj4Otbs1HQ5wVd8kTygcfPbl9nKMybzuUlBITG8G+cLia/TNbPyxr5dzXqApiE2 zYycxxsQR/9SvjyTH2v/6ClKcsMdWg1xAkfl8ad/3WON32yJL+qN9nTzpWFbdgDWZiP/Ty QJFS2gSLHPEM0lkWQMAxKQnM0CQpVOwcTPIgmUQmWoz8bKPcWaLHYB+52Yu7PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750975; a=rsa-sha256; cv=none; b=UQFPuyhrW0J09LXeqhjEi7eo0phEm+6wQbXAe+x3TOpm7ekSrCNWKGAHIa9/1MK228GC6a QQ2SrISThvjtuBs9jF+ESyQ7m67lgiAK/wKZehygU6DB421klMnJkWgI+2sZm7JLHw7q3q m5PFFSGYdPwXrw+k7JQDRc9ivGk18FkGpTIuvpnKsAEDva2tQflm6rKh8zOx057/xVrp3z UnbairuudipgbMtdy0Ay4z3hH+RkPpxZDZ3iJRMrdqDrj6ZjHNKPK5DEl8Hpn8pw137Xhi GY3s+Qmus8l1Wcho8Ybdn3rfJkFbbhgPGq3s3IiHJYjApDvRcjo7G0ECzm+ofw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pURf+oeWdBMhZT2b0eH3gaDxW6XnymWSiTNhhwYFmnE=; b=rcyavCa08H3Y6KcKJ/aaYk9WsVy9oIc53WOl6ECYSAEwrc+iMgTUh+GE9f0vJWm+qpsla/ BADHOKckEP2t/RkKUyAcw1Pv2EHXOrk+fyNJvM7WcJ3eGs+x4RxWuBcC5lErLle40YJTYA gNJ+mwyXKqQzmOJi6ilEhmprfPW18TliM4s0YagZYouPvScaTHgF2RA1iMqBxfwVxcsL7W vGkfVmTO8op8pwY0Jp9NbDW94r8mHetU9cxE2oyNaMOTJtwvYBiQr8kVIqa1nuW5G5GNdh nRop8HJnwpdG7TjtJgljLxp0Z2uHEPN2Rd4S1cbXa+5FkXNEtX2sD+jd5vp1gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bKW47zqz16JM; Thu, 19 Sep 2024 13:02: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 48JD2tw1099658; Thu, 19 Sep 2024 13:02:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD2tmR099655; Thu, 19 Sep 2024 13:02:55 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:02:55 GMT Message-Id: <202409191302.48JD2tmR099655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fdc0afd4391e - releng/14.1 - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fdc0afd4391ef45b5dcba33238b37f135972d71a Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fdc0afd4391ef45b5dcba33238b37f135972d71a commit fdc0afd4391ef45b5dcba33238b37f135972d71a Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:55:21 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82) (cherry picked from commit 0121a4baaca09049d130d830aa9179e3cb9c9e88) --- sys/net/pfvar.h | 4 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 27428ad161f8..6a01f3eb6988 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2512,8 +2512,8 @@ struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, - struct pf_addr *, u_int16_t, u_int16_t); +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, + struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(struct pf_state_key *); void pf_rule_to_actions(struct pf_krule *, struct pf_rule_actions *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 43f32f673842..2fdd092a6dc9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -325,6 +325,9 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, u_int16_t, u_int16_t, int *, struct pfi_kkif *, struct pf_kstate **, int, u_int16_t, u_int16_t, int, struct pf_krule_slist *); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_test_fragment(struct pf_krule **, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); @@ -341,7 +344,7 @@ static int pf_test_state_udp(struct pf_kstate **, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, @@ -395,7 +398,7 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s) \ do { \ @@ -1457,9 +1460,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1467,8 +1527,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -5152,7 +5216,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -6581,9 +6645,9 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6596,25 +6660,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, *state, pd); @@ -6677,7 +6725,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6685,7 +6733,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -7093,7 +7141,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -7148,7 +7196,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -7157,7 +7205,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 4fcad7e578a8..06c82569ad6c 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -633,7 +633,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, return (NULL); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (NULL); *nkp = pf_state_key_clone(*skp); From nobody Thu Sep 19 13:02:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bKY1Gp6z5WXwJ; Thu, 19 Sep 2024 13:02: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 4X8bKX60p0z4pwl; Thu, 19 Sep 2024 13:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0CkXiXf8XaoUkjJ+SmSc30ck55464tpY1weVCAF1RhU=; b=ntOni4pABu3VFYU0ELanWh9UC6KN5eYpyQ3TM7WMRXwup9aErLG2uN7yNH5PjfxuNwWLPM My/uwrgQjgXSZ0kObQRS9JzTJ7t71beovBHvvJX2yjN1ivzDPzrd0ufxYblTYMgQ2re0/k Fgv5vSncqkyUuNk5T0sI9NWEHrvT05UFp98zPFStpLTUHtVMUwjg9CpGBoZ1Egmxz3MHWG GCBZHY9UcgCf9u89axXBV1a5LS+AZsy8+TZA+KcTtIO3MIJyZGeupDOF9tBHzbOnEszhOZ XJ5gYgkx9H/IJ4KYWKXNj+A4byeVTbHPHd2ZvBVHCNmPxJPgyESBWpt7MSl0LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750976; a=rsa-sha256; cv=none; b=qgY1mxypwxmpLf2lOZ6SNm5RNUMUWpWPD0cWx15sIfRnEGl9N5D0ebeBNAPKy4MfDO+ITI QXiVEby0O9gCSoBuOqkCjb8Y1rvoi2CvDKvuv0PDDN/8Of2RTxYYHITj2kiNaYu2ivUHh7 zvh9QuyR6KC9/HoQ2iPigErSnlnqqwyvhtIpZOoGJEyShcGfQN7+D+ITZTazgcMouZpnSX j+pCThHwtJmldSfSCFs9/WIua/4ny//B5bfYA8FUVg/pPd9jo5KFFG19SVu6VbdLNyrWbu BLPGuCIn7441ppX1p5IsZoQDd09DiB2GWHcXW5WjmCssoFabHly5ib6rO4zzzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0CkXiXf8XaoUkjJ+SmSc30ck55464tpY1weVCAF1RhU=; b=uX3vSCzVQza/er3mFtNIFi4MlUu3VVDIq1urbSiMVKfITqJX7K2n8Jy0xAqK+dgT/z4o02 Ls8LIAkQqpsgl7c1ti7vY5BF1eYoepIwPznzF0xLxFlAiBGKNVOLpznPUowL0O9j294Ww5 XBvmLiDffVLf8n/m3lXueo7Ev2Ywumk8lomHoHymcVWREcNG/83XA9rYZG2mq32yMg525E GSZWYOKYL1Upk4evh9D1Nj6WMFRniwxBaYOtfxsq2nr4zinvI2a6GZ3EcUvG6HjXMZD7aA 9TpDL5mdhrIcqnnW2pQf8FZzxHvAOPWA+kHCEIANOTbU0Y6i8WjbpPBrH47l0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bKX5XTzz16Rd; Thu, 19 Sep 2024 13:02: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 48JD2unj099724; Thu, 19 Sep 2024 13:02:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD2uDa099721; Thu, 19 Sep 2024 13:02:56 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:02:56 GMT Message-Id: <202409191302.48JD2uDa099721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 95a1a22a835f - releng/14.1 - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 95a1a22a835f8824acf1c7d7edd6953ad7f83ab2 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=95a1a22a835f8824acf1c7d7edd6953ad7f83ab2 commit 95a1a22a835f8824acf1c7d7edd6953ad7f83ab2 Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:55:33 +0000 pf: try to lookup the icmp state based on a correct packet descriptor Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b8cd169efa6ac0899b4998898129765ae5c685a6) (cherry picked from commit f40b0e735177b25ce67fb488a93834168f4c16e1) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2fdd092a6dc9..b057c75dc51c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7200,11 +7200,11 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Thu Sep 19 13:02:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bKZ3D83z5WYHt; Thu, 19 Sep 2024 13:02: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 4X8bKY7314z4q05; Thu, 19 Sep 2024 13:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h4dZjQCYLeNfxvIWMGtA1yVJWUwmqVM3HZdWzsXO740=; b=DZJ3D0lGh+YGIsLfpFfF/uOQ5veX0kbGJQ5ba/C6gAy7QkouMZAyWWct7GW8aSiDcVU2gA 2Fo5guTpwQURSOeDUmtMPOaU22sfx6Tv4/cqKwIr9BulOK/q7JHlf7pXM57Y3r0rah7eWW BI1l0f8xCIYx3Y+ntqqNlk5lmdRWQxHrCHB/SyPw8E8d21PPDd2btm5N+s9DnUK8WKpqHf 3svwtLQJrNWDGQrBIi/J9qvLEG1ePdtj/cnYz1nmXX1Ie18UlqqiMc+QYn/R/q0mT1VTP4 nE7lEUllvpWGnGRVWEdDQpBiBLAHnJI2JKE3sKT/dLWgmDGuHBLgFXF/dM6DXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750978; a=rsa-sha256; cv=none; b=B+rZdEEr+J30sSoiXW8fhEnLDM55Eq3FwyuwbLbYEQzQgECFZh4Z/OpUVKe9Zh/jo6co5X kdYRQPcbvCasb2a796xZsh3vBkkZZ4sBZ12GYS2+JjfFYa5hpGnFRkpG0FKWCncDLtTlSs xU4X5IlTSZOTUfNtMcMTmUwJsf1bwf+Iuf2bXD1e3rjdp6CEuc6uqC+Mqi+gx9bXwLBCo+ Pa9fQ2BCEPGCtrBPtM/8HnlI8YRzEp19dES+2D7+Bcqml0hzdT1/4lG91yTaR97eOYPz5+ L2IxCIIP7PALjYjohcH9bMj56u4j+RVIs2KEZB/d3YN4OGtVWZ3jS7eBfRv3Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h4dZjQCYLeNfxvIWMGtA1yVJWUwmqVM3HZdWzsXO740=; b=W4n3ciHcTqJ7znvjbNksreQ8oE2x/ukJCAKd9f89eJv3cnXvIod6Ga3cRJ7TXLkjwjyxHl 1VeGRQs5qHpXlvPk59CdSExKDeQCfdxTT4H7rCGMgBmdTT8sovvvUYh1TBfaRTSza8Ej4R W5nkLxiOa6JTtslvrAirSIN1Fqia/cFVaYBLd4F5+vH4qyVrz5bpNh0XI4WxhKS3/aUkdZ cuXVT6dP6ptn1F+aqgjMb10Ks8trmMf0Lf4fC7aP1JXHCcOm1pBJXIqWOOQ7sszAvkgA77 HjViViH9Wxkn9hw5rmaRuiCuDR4roWzM+ZUVRiE2gxqfA/saDdbjLZzhKZD1gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bKY6dkVz16Bf; Thu, 19 Sep 2024 13:02: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 48JD2vIN099787; Thu, 19 Sep 2024 13:02:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD2vpw099784; Thu, 19 Sep 2024 13:02:57 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:02:57 GMT Message-Id: <202409191302.48JD2vpw099784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 94c6c986f3c4 - releng/14.1 - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 94c6c986f3c4f2f9bef47b02659cfb2591d837cf Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=94c6c986f3c4f2f9bef47b02659cfb2591d837cf commit 94c6c986f3c4f2f9bef47b02659cfb2591d837cf Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:55:44 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5) (cherry picked from commit b822e3fab468ffbe941d0758d960e1aa46069a38) --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index b057c75dc51c..ed278a5526be 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6666,6 +6666,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Thu Sep 19 13:02:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bKb2QXhz5WYWK; Thu, 19 Sep 2024 13:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8bKb0jNCz4pmP; Thu, 19 Sep 2024 13:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fsq/bKquo9um0StxRFXs5NRn5Jes6upjBfZfCaFzx+A=; b=ps9P1zK6/UCFRAf23iUJlREuUkcg710f1foBcsl6QqxWu/EZryHOAWcaLIX2GrrQoztPBH CSaiKGzJq72/yMF5oI0dF1AvQaAKuDEeuF/VlCSRfisvNJK3raLZKNdRaS8HQm9PZ+SPNo opi4E0VsPwcVc7IWkBYSYWm2kWHc5gG492Uu1A2QjdT48ztz/moGdXaX2GnwkXKamnTygN sOp47U9UPj3p3NlzqBNUl2TpkoL3Wt71mcgF+dvMAMsTR/EoLZeovjiezYOqPhCrwYhb71 QyOFbq+ZYO8uZYIuY5gDovpFHEMJJaGMzKdQgnBVAkVrc89VhPlBStfzry0U4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726750979; a=rsa-sha256; cv=none; b=j1yRVMt+YDZVh5C9M9XQgEl/QTvkpgKRg+l9GESzASRCQfuGDqbeOV4eO+H+bvN5Q6h6dQ DiOifXglJ+wrbdEHyP097fmmWEj1QhsT/xHJO4NoZ9Le6b1EWrB1GeHa9VYXo9Hubj4rut AvxkWOTnLD3KaIUKG8ocnlZZkzN7Gz9ddASbcFgzlmSBL0oquD/nyxpDDFHxwZuRM6F9Od 7Gpt/sUnTICp3bgjVoWjydkYsql0VTP9W5RjSWBARbOAxpKJLPrdLA8vlZgMay6DnF6Jw/ pmnMpwEBrvcvIdTmSCYE/wveXyT7VnJOwgjL6tm1M9ClNWYiZvXLfX3dfle8Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726750979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fsq/bKquo9um0StxRFXs5NRn5Jes6upjBfZfCaFzx+A=; b=ALgNamvZH9NRIeOXG0VVcXwxeUEcat0kGDTWaJ+fwsKlXtIzjBZneUQBCFeO+rwJKgOCgX r+1rSslPyeZS1Zm7AKzs53t/JpnRqmyB6LmfpVX4qWDI+UA8gFqdMfoZ6jYokqGqmulpzM cm+UE9YhHRye285IfyoVN3+q+CXXFioXApAo1uOA4VkUe7gAjWt/Q0kAbP6hzaCsFnibXd R6FfcP9/eVlX25bufxN8NHJM5PaguxC++O5i2YcWXvOgrlDbGSKQ/fmakVGjNzzb+k0RaH KZzHy2588XkKJ89uEbzWAWlgYC/J9qPqWwu0z6aHZrCmuYstL7RVtNicDlyjrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bKb0JGbz16Bg; Thu, 19 Sep 2024 13:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JD2wiD099829; Thu, 19 Sep 2024 13:02:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD2wOG099826; Thu, 19 Sep 2024 13:02:58 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:02:58 GMT Message-Id: <202409191302.48JD2wOG099826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1e965d5399e1 - releng/14.1 - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 1e965d5399e18c42441c90778333a1a5f24a105c Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e965d5399e18c42441c90778333a1a5f24a105c commit 1e965d5399e18c42441c90778333a1a5f24a105c Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:55:55 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0578fe492284ded4745167060be794032e6e22f0) (cherry picked from commit 38f74de7184ac3ad7acc48055551aaa9ec9cded9) --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 6a01f3eb6988..676cf05cab8d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -359,8 +359,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ed278a5526be..7c31f1fc0fd0 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6680,6 +6680,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6732,15 +6734,16 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -7147,8 +7150,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -7203,16 +7208,17 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Thu Sep 19 13:03:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bL35Mp6z5WYWn; Thu, 19 Sep 2024 13: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 4X8bL34d6kz4rDb; Thu, 19 Sep 2024 13:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hqsDZNPQn51e2r0Q2dtvZr/h7l7/es/ylC0rReoKyWo=; b=RvzpAvokWRxWDdepGqTvwDqEyzXeLP8W+WUCI960/osyma6ABY+wmme29F1d9V56pK+8dt F5FA4Ty02lfmkVoO1tB65UM9xBaWJ6iFfo6pruMLVvPlwSAEKc4+icNEnl0AGGPAsYrm6d k6Rq39ZYwjn9+/4jc6To/YDGKwnDlN7DQQHJZ3v/biSk33ze+LhiomAR5LVL621ivozhC6 Yw9qZnNLq3ZdB6VcutWw/gAJdvOfjEF3E0VNvDGjfoTfXmX0te/UyuveqKsB+w3nw5utE0 zGW6Lvok1xSq0sy3Z+F8wUMbl1MmeDSAJdUKTAqiYD/61UslXfJs/ISofpx2Qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751003; a=rsa-sha256; cv=none; b=PAhgok+Xmgn6pGiDW75SGq2h2E9cyQcgDf28kHQRYHmJmvgFtrUWwLQwXPmPaSvdpbjcVI sj+6/N5nH3rtpJKC/1iBdvI2BfTyd26YcmWIKxTj2xD/VIPto75av/d4zedr7kLpApeFSA AkgOhdznkEp6Rj81F/+0CiXQ9RXPet4eMp5nCzAPb4z2y7NvLEGL2sWVJRE2Ks0+j5ntpa DByJ1MHzFG0AFppR6auBI4sxC/6QXBq+CuVRrk1XxJjJ3AJw/XTkOTbQTqpTWUk16uyG+2 k08QeQUY9KcUlXOiZq/dtLCeW4IoM64OwWfj7yJNfrWQsHVayPGU7aPCrkWhjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hqsDZNPQn51e2r0Q2dtvZr/h7l7/es/ylC0rReoKyWo=; b=XhRdgCCXpWr1trRgh94fEmE1SHpdmk4+P2rUxXNs1W6mhIcthSi0jUqxhCJ0DfmaNUpJ5q QcE9nqTndZgH+wGTjXDaj/1LGIhnnB4TC+GIlhXE/AOStBW21RWMgZIZ5w0frJy/XKLj+C xBhekKEPZPRqRyWydHPjrnQhS+CzrZes1D9vYxFMCYaodjHC8mQg9H25o05CJloDWUn2ey L5tGi0J/zSTdRmLTWA65AlAXZmV1fhPRXKE7H70CffkVoTQiDQ361vZY2LrG4JWRx3FcAc cTeZslVEmqk7QQaOEbghzeLs1MbiUwMcnt5JkQKfGXJmLlndvuz1L5dfTqUI5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bL34BRxz16JN; Thu, 19 Sep 2024 13:03: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 48JD3NBG000127; Thu, 19 Sep 2024 13:03:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD3NoK000124; Thu, 19 Sep 2024 13:03:23 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:23 GMT Message-Id: <202409191303.48JD3NoK000124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d1c4f6decb10 - releng/14.0 - pf: fix icmp-in-icmp state lookup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: d1c4f6decb10c7dc826d4a3a27763dc3f531ffe5 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d1c4f6decb10c7dc826d4a3a27763dc3f531ffe5 commit d1c4f6decb10c7dc826d4a3a27763dc3f531ffe5 Author: Kristof Provost AuthorDate: 2024-08-12 14:07:35 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:57:46 +0000 pf: fix icmp-in-icmp state lookup In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP error packets potentially being dropped incorrectly. Specially, it copied the ICMP header into a separate variable, not into the pf_pdesc. Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup. Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 2da98eef1f352c496ffd458b4c68ddee972bb903) (cherry picked from commit 27a1a56b0d2e6ffa6ab1de69ef84fe66b7fd41e0) --- sys/netpfil/pf/pf.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cf1c83aceff7..ac6c64ec1fa2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6585,9 +6585,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, } #ifdef INET case IPPROTO_ICMP: { - struct icmp iih; + struct icmp *iih = &pd2.hdr.icmp; - if (!pf_pull_hdr(m, off2, &iih, ICMP_MINLEN, + if (!pf_pull_hdr(m, off2, iih, ICMP_MINLEN, NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short i" @@ -6595,12 +6595,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - icmpid = iih.icmp_id; - pf_icmp_mapping(&pd2, iih.icmp_type, + icmpid = iih->icmp_id; + pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, - pd->dir, kif, virtual_id, virtual_type, + pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); if (ret >= 0) return (ret); @@ -6614,10 +6615,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || (virtual_type == htons(ICMP_ECHO) && - nk->port[iidx] != iih.icmp_id)) + nk->port[iidx] != iih->icmp_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP_ECHO)) ? - &iih.icmp_id : NULL, + &iih->icmp_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP_ECHO)) ? nk->port[iidx] : 0, NULL, @@ -6633,7 +6634,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); - m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih); + m_copyback(m, off2, ICMP_MINLEN, (caddr_t)iih); } return (PF_PASS); break; @@ -6641,9 +6642,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: { - struct icmp6_hdr iih; + struct icmp6_hdr *iih = &pd2.hdr.icmp6; - if (!pf_pull_hdr(m, off2, &iih, + if (!pf_pull_hdr(m, off2, iih, sizeof(struct icmp6_hdr), NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short " @@ -6651,8 +6652,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - pf_icmp_mapping(&pd2, iih.icmp6_type, + pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); @@ -6680,10 +6683,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || ((virtual_type == htons(ICMP6_ECHO_REQUEST)) && - nk->port[pd2.sidx] != iih.icmp6_id)) + nk->port[pd2.sidx] != iih->icmp6_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP6_ECHO_REQUEST)) - ? &iih.icmp6_id : NULL, + ? &iih->icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? nk->port[iidx] : 0, NULL, @@ -6701,7 +6704,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, (caddr_t)&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), - (caddr_t)&iih); + (caddr_t)iih); } return (PF_PASS); break; From nobody Thu Sep 19 13:03:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bL474cZz5WYCK; Thu, 19 Sep 2024 13: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 4X8bL45bQpz4rBY; Thu, 19 Sep 2024 13: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=1726751004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1MN+OWurJt4koMP8ZRVZudr0gSW5i5ECdEYom/mhgE=; b=exy5X+ubBRHd/suffgfa/KSt82BCTB+unIXejX8yTRk6443lMujlpDIjWgmGZ0EfFOnQ9s EgRMjnwlhBPIrQGKI0l2Ec74fOmWbiPAFYpKUB8bclvopAVgxEDcJAVW4EW9ifEBN8QLwL E9hSXhea7gFTGXsJlLCzlnZA432sA4EZgP9WDHAJ5OazqC0FmeRNhLHW0mpi0A6EzuZP8A NHg+2+T2OYlsbORFmoOunsb0tfdrJvgXrtfVkoS/j0mRhPbPn1NqFVx+orZhE5i+cKJbV+ wgyspGEuW2mxjCsaYq4B3/PaLK0MyJdA5s9ZPhJy9BmhbE90HDbuQmiw2LXogg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751004; a=rsa-sha256; cv=none; b=knRXQMXwxHJSqdTGqmay8kxmW9eIvF+ZNFQI05FiSdW38oFEJdeY8FsJ9kftcyrViSQX+y PiQVbVmhKtCnZsOcWrPYjiy1uOQt/z5Lu52C0qozWFhwPECvXdAlMUJ19ZrlYtxWBMSQ86 xK2Fsi41waA4/6OmTlSmUqpPP45/CPLIjQj0c5bCdvfqCseiu8TvYcYrhpU4enbeigphGc a0W8SGOWbn8G83Xqn1NpQNVHXpOOe6RQ4fLSW5uYF5hw3AxUwGq75/zKX2Qd7bHSiraPMC xPPovKADvUVuwYPU8qcaC9txT1yzw6YJwoC7t1HsuGsk8arPfoYxX17J7ssOow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1MN+OWurJt4koMP8ZRVZudr0gSW5i5ECdEYom/mhgE=; b=JBfwwFjWTieo55MYdBLdtFN9AZtw6RcweP4q5T3VxQVpEOOa5s7jcaUhn7iH3FVRpMiy07 J+ZyxMO4hhuEura7xA+dRjpX0mB08qDvXf8igDvbMErN+h6cQOSGAAxcNMwHgMzq7pMn1e 20p698E5pq5uR/JIwLbu3wcDPE4KLRA8qU3gxLPqsaTg5QLtMP63Kce3VA5pU996HqjA9X WQJL17eIZSwiqqwTZM2CfTt8X1UNjY5oc8kJOzNyK3x8pU5BXkhLE1CqEvoLH0ZjnO5CBe fVpFIRl2TifactJDKsVVTTybFp/x+KL/Nyx6j4LnyW1E8mfHj/8FSCpi2luX3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bL45Cqsz15tn; Thu, 19 Sep 2024 13: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 48JD3OLI000184; Thu, 19 Sep 2024 13: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 48JD3Oxj000181; Thu, 19 Sep 2024 13:03:24 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:24 GMT Message-Id: <202409191303.48JD3Oxj000181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0b3294327ae3 - releng/14.0 - pf tests: ensure we don't confuse different ICMP types List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 0b3294327ae3f91c3638a985fe1513dee74a2582 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0b3294327ae3f91c3638a985fe1513dee74a2582 commit 0b3294327ae3f91c3638a985fe1513dee74a2582 Author: Kristof Provost AuthorDate: 2024-07-09 09:22:18 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:58:04 +0000 pf tests: ensure we don't confuse different ICMP types When creating a state for ICMP (v4 or v6) packets we only used the ID, which means that we could confuse different ICMP types. For example, if we allowed neighbour discovery but not ICMPv6 echo requests an ND packet could create a state that the echo request would match. Test that this is now fixed. Approved by: so Security: FreeBSD-EN-24:16.pf Reported by: Enrico Bassetti MFC after: 1 day Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b9f0dbc3d006e0b904ee4275d54459f4edd65bb8) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/icmp6.sh | 89 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 70c0c300d7ad..2c47cd367748 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -13,6 +13,7 @@ ATF_TESTS_SH+= altq \ fragmentation_pass \ get_state \ icmp \ + icmp6 \ killstate \ macro \ map_e \ diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh new file mode 100644 index 000000000000..35d20c83cc4f --- /dev/null +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -0,0 +1,89 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "zero_id" "cleanup" +zero_id_head() +{ + atf_set descr 'Test ICMPv6 echo with ID 0 keep being blocked' + atf_set require.user root + atf_set require.progs scapy +} + +zero_id_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set block-policy drop" \ + "antispoof quick for { egress ${epair}b }" \ + "block all" \ + "pass out" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 135" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 136" \ + "pass out quick inet6 proto IPV6 from self to any" + + # Now we can't ping + atf_check -s exit:2 -o ignore \ + ping -c 1 2001:db8::1 + + # Force neighbour discovery + ndp -d 2001:db8::1 + + # Verify that we don't confuse echo request with ID 0 for neighbour discovery + atf_check -s exit:1 -o ignore \ + ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 2001:db8::1 \ + --replyif ${epair}a + + jexec alcatraz pfctl -ss -vv + jexec alcatraz pfctl -sr -vv +} + +zero_id_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "zero_id" +} From nobody Thu Sep 19 13:03:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bL62cf6z5WYWt; Thu, 19 Sep 2024 13:03: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 4X8bL60tnHz4rKg; Thu, 19 Sep 2024 13: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=1726751006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VroX58U0Cn9YVzHmCqxPQRqM2rhJIgTiAN9jeAcRCo=; b=peba7667EYqVzN//tccOoROVy59q56/7YtFClXfjo1iwMQBtDmbVdbSwR0/drW6A58WieS mLeyKuvakaCl3K5Cw+B1hl9ydMYkrRCnOZuRkO44hrthjpWiMrR4+mOa3goI0IfA+q2yYb XTENyWOcqJ6gGineJoY5QD66J7hEZudtDlVZol6k+hc9+753acFhZy27QNQrusbyYj+4lJ VqMc1f0Z3vG8J34ftW+SetJ12YnCf2xdybajlb0757jjW2uQzsGEsnVJpewED2MACi8KtV aycM3BxVPGSt+MigssltGa2El7J0XhH6akncif1Z+o87IiccunmNOmoBGJKVkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751006; a=rsa-sha256; cv=none; b=DxRM+bcEkM/4q6ohzlaGws8w0kB3Bw7bSsuQ89Z4izM5WDIyqNC7ztenRmv/EiPpVV/UIo lBZ9TtWcoCCFAdk7bq6oe+ysFmgPx+Ikd5Gw6GKMRQr82E1yUVVrFGb8Aq68dAkuHFkw9n q1bpN9rC3yKNPvN++Fiezw8zdkSqV16UBE9a8sxfr6j8keKAjrBwzMmpkvcIGuuN1WxcMD LX/3osLj86TGY+ZPJ6aBCT7I2Ec9swgXiRxiX6E9g5yQF3UGyZKu1KgIGivOTq/Ru5cdBy QqbI5uJee4ixRKLVxAb5kNPtwX+b7ZUSTolF2M1RQkx3vCO7CzKdmOFizzmPZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VroX58U0Cn9YVzHmCqxPQRqM2rhJIgTiAN9jeAcRCo=; b=k2Jgsw5KNXNEHX1JXLhNMj7H3BN+hm9TMRoXDODbXPwdJ3MNeqZgbbFf98yo5y4F2Wk21X lL3KLn3zygkV7rwutbxICpkaJsDD4IVupWNnaXh71Q2arFefSdxL5v4pvYvGhkE6gQsURS px8aJXi8JiH200KevpqNiLuOsd+QqaCP/5UKGrEOLdll8X8B/sHlriXxmDOETpxjRN35cd 8g4lr8Ze5cLsiAJlW8CzKxg5/SmOHjm4aug51PqCIZklQi6UQfIVU08eM/tanmna+blgSe aEHa2t3fDFAFEPHogVYCU1FlSnXQbqexbv5w9i8E/ShvZFeydpaPLDdA3CnXYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bL56GP8z16Bk; Thu, 19 Sep 2024 13: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 48JD3PlK000236; Thu, 19 Sep 2024 13: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 48JD3Pou000233; Thu, 19 Sep 2024 13:03:25 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:25 GMT Message-Id: <202409191303.48JD3Pou000233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9481d7a26082 - releng/14.0 - pf: invert direction for inner icmp state lookups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 9481d7a260822d20d60d582bfff20bdd754c49c5 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9481d7a260822d20d60d582bfff20bdd754c49c5 commit 9481d7a260822d20d60d582bfff20bdd754c49c5 Author: Kristof Provost AuthorDate: 2024-08-14 09:29:30 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:58:15 +0000 pf: invert direction for inner icmp state lookups (e.g. traceroute with icmp) ok henning, jsing Also extend the test case to cover this scenario. Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 Obtained from: OpenBSD MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 89f6723288b0d27d3f14f93e6e83f672fa2b8aca) (cherry picked from commit 46c4fc50d3012ca3c8756df243589add36b70830) --- sys/netpfil/pf/pf.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ac6c64ec1fa2..1cf13d4d642e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -309,7 +309,7 @@ static int pf_test_state_udp(struct pf_kstate **, int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, int, struct pfi_kkif *, u_int16_t, u_int16_t, - int, int *, int); + int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -6091,7 +6091,8 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi) + u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, + int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6128,7 +6129,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && - (((*state)->direction == direction) ? + (((!inner && (*state)->direction == direction) || + (inner && (*state)->direction != direction)) ? PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", @@ -6186,7 +6188,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, */ ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, - PF_ICMP_MULTI_NONE); + PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -6194,7 +6196,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 0); if (ret >= 0) return (ret); } else @@ -6278,6 +6280,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, int off2 = 0; pd2.af = pd->af; + pd2.dir = pd->dir; /* Payload packet is from the opposite direction. */ pd2.sidx = (pd->dir == PF_IN) ? 1 : 0; pd2.didx = (pd->dir == PF_IN) ? 0 : 1; @@ -6599,10 +6602,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd2.dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) return (ret); @@ -6655,10 +6657,9 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -6667,7 +6668,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 1); if (ret >= 0) return (ret); } else From nobody Thu Sep 19 13:03:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bL7262Lz5WYZM; Thu, 19 Sep 2024 13: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 4X8bL70ZMXz4rQ3; Thu, 19 Sep 2024 13:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k601swaJ/VVNz/JXObg9FTXInBZmFLA5RuyFqsnnbpI=; b=IM4sQ+Nq+Z1SLEWY/0h2xN0+A5ffNISV7qy7KPWyHEw81wrxaJiXF6M/eFDir1Qko6dNRg YcXwoO37533nB1syzdBg7yV1NILixreAeGF33z3tiuS6bvaXjSsjOVOiO/7H6ff9aepajs EMsbDeDwbjsl3sIhxdIRI9VaoMnkfSsbGKRj6MwzwJJYJ1nvDpnDy567b1KPI+yR4OPn0W PC+QEVrCmZHcu2LXTGC8bMUgOScsjnV0hodFT0IS+sroD3MbRyu2nUAYZF3vZS0hCFiBYG D6zYYuW1wyH+GKGeQZJZgHl/ua/2Vrtr0xifHcpCB6WD6I2xJ3APsqVfuxSRmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751007; a=rsa-sha256; cv=none; b=hKnEsY2rukA3hFQ+yT6nTL0pPEVJWq1N+igf+AbWLVy7+5taae/1u4TEvetCXDjUVYr1Fj 8XcYZ1kzvbh1aNgBxtYEMUgHrFYVhGZYQgHvKy3o9gqgs/Pkb/2dwHCGgYCFVNk/1rsF2u MgrMIY0rcpioi/PQ7iO9Lc3/zxM7E1DAHVrQpcdmkgW57j4Jj483KJhAqkzAziEfD6+WTk h+CMr6HP/3EABuTTLQRIPjp9XOTBS+fccK79Zzqi64qgRNC6HLV5bbXBj1L0aDOqOCXaud IMjNmGKWusIYSCbCuOnwL420LtxLPXRW+tW+W0cRRGhM6RRmesIz8r671jiq/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=1726751007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k601swaJ/VVNz/JXObg9FTXInBZmFLA5RuyFqsnnbpI=; b=DGMx/URiUn9HWnJWltq2+urvWZr/63Y2TqknHVZJ9GRoCiatpyEpk7dlaJGBojJGFEZl4e AcKuemfl76R2L8o2UrnuCxRrmvoZ5/egiCOs/e3gWr7nPr7p0aFoxixi0KrZrNQY6CXkcK ugETlmiGz2TCwouGCm2NJ04KW6K5Me6h7/zzlTSa/zSUpyPRIuC0spJ6mmV2tvGYsXyW2q jgbBLBL8zkWfViyuLPBTxwaOuibDksQYYmpHRKrMxxsrcoaoHY9rVJ7fTzvJdsaGo+Okmr znYyxLJSUHvwKeLPAV02ixpdL51tRU5l3r1AR+dOCqC1G988ZBEUovm0DP28Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bL70BkCz16Rf; Thu, 19 Sep 2024 13:03: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 48JD3Qn6000281; Thu, 19 Sep 2024 13: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 48JD3Qot000278; Thu, 19 Sep 2024 13:03:26 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:26 GMT Message-Id: <202409191303.48JD3Qot000278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2fd8437daed5 - releng/14.0 - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 2fd8437daed57e34e50beb50013910b64b456f91 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2fd8437daed57e34e50beb50013910b64b456f91 commit 2fd8437daed57e34e50beb50013910b64b456f91 Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:58:25 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82) (cherry picked from commit 0121a4baaca09049d130d830aa9179e3cb9c9e88) --- sys/net/pfvar.h | 4 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f9cb45f696d3..4edbf0c51ff8 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2482,8 +2482,8 @@ struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, - struct pf_addr *, u_int16_t, u_int16_t); +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, + struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(struct pf_state_key *); void pf_rule_to_actions(struct pf_krule *, struct pf_rule_actions *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 1cf13d4d642e..7b501cc54b27 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -292,6 +292,9 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, u_int16_t, u_int16_t, int *, struct pfi_kkif *, struct pf_kstate **, int, u_int16_t, u_int16_t, int, struct pf_krule_slist *); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_test_fragment(struct pf_krule **, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); @@ -308,7 +311,7 @@ static int pf_test_state_udp(struct pf_kstate **, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, @@ -359,7 +362,7 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s) \ do { \ @@ -1418,9 +1421,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1428,8 +1488,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -5110,7 +5174,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -6090,9 +6154,9 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6105,25 +6169,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, *state, pd); @@ -6186,7 +6234,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6194,7 +6242,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -6602,7 +6650,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -6657,7 +6705,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -6666,7 +6714,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 4fcad7e578a8..06c82569ad6c 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -633,7 +633,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, return (NULL); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (NULL); *nkp = pf_state_key_clone(*skp); From nobody Thu Sep 19 13:03:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bL83QmRz5WYFp; Thu, 19 Sep 2024 13: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 4X8bL81VLVz4rSc; Thu, 19 Sep 2024 13: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=1726751008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YHbG/R7n3nWgpmr0QwXHbLEYxfEAsVV0EZxLOGyZcBc=; b=QBW95/3voI+Xifwr5wYHx4oZM4UiBnxb1XaPdFooFtnKoi05q9tVdTUF1IDOSJOwbSaAey a6N7hDDUBxhSaPWdgRNvLj+7G825CzYF0/8IfAHIv51yNJJ2Edod1DAYjNr7r0tyCY2yOF skyKyZg7o5a/9Gq1tSftohl/9mU+GHzIH6k/DySAhLUwSvy3kM5HvRN9SwNsNWWyL5K7Dg /qZkVUBD3WbJnNnO2ih7GWuYCoI1hG1R98b47eCMyi7TOEnPRUMTpF9NcmMO2/6bVqYYAm 4gu64+NBnFcy/cxnTFtsMKcZRwUTi5i4R6YOdl5hPqQ+GaUo07gFR29DyQBz7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751008; a=rsa-sha256; cv=none; b=PctqO5QaDNupxNIPV+AjlB3Ky7J+e1OhBs7jy+6NaLKlMTAkQpXORtX3D6S56V2Lxnj0jK x3aKeW23q3La040wp+YTzeCLnQ+dwfcINO5idT13UuoeIoY78lRub/B9Dk2YTYzJX5Ti9v hvpt7xlKE4j6qG5QChzoanoENefBjRxeGdj4X5Y2fuHsniied1kn4/9FgfwURAgQyLLnHc QXOmH7hM5Vd7xLgYq2juEOyljatcKY1AU4mZi7f8wTw+Dd/B7s/YEMZh64WaAwjZEkSvG1 bnaG2YdyCG0AVZNsk1vavDLzcCZlDgUR1PXGwbyJbmFJJFCTuoPnXo7BPwuyhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YHbG/R7n3nWgpmr0QwXHbLEYxfEAsVV0EZxLOGyZcBc=; b=IlkSgeiKUKwoP0dgUGvcKrGsGmvAeuLFQfDdFrRWNgAY9njYWvceRK79DTOy1egvGIqzZJ ZjMt9v6QCPJKy3c6PkkzTX9gl6uSzuJtOchEW9wvNP+OqXyV06m27Ysa3DsC+3PtjG1lU+ 8VlW6MibCN/rzCOH0hU6RbKrkykLeCBQxa+PxduUD5nLYycfhdmB84HSeUJJvAxIkycyq2 NUzzOQ1dmyu2jt2ugf3rgRYndlS669vW6SchbFmZ8niOfZJv+NzARcIEBiGbiarepZYkFn 0jyFkJ4GjJZH6B1ZGrHQ4edEZp5rMKT5Smuugn3jOCYYFAOwFWfxwW02AgYAXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bL815ynz16Bm; Thu, 19 Sep 2024 13: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 48JD3S2C000347; Thu, 19 Sep 2024 13:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD3SNR000344; Thu, 19 Sep 2024 13:03:28 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:28 GMT Message-Id: <202409191303.48JD3SNR000344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e3773ad4716f - releng/14.0 - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: e3773ad4716f975b8e8dc4e013bcb044278d8d27 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e3773ad4716f975b8e8dc4e013bcb044278d8d27 commit e3773ad4716f975b8e8dc4e013bcb044278d8d27 Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:58:34 +0000 pf: try to lookup the icmp state based on a correct packet descriptor Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b8cd169efa6ac0899b4998898129765ae5c685a6) (cherry picked from commit f40b0e735177b25ce67fb488a93834168f4c16e1) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7b501cc54b27..49bfefa2b6ed 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6709,11 +6709,11 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Thu Sep 19 13:03:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bL95kTMz5WY8b; Thu, 19 Sep 2024 13: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 4X8bL92NmRz4rFN; Thu, 19 Sep 2024 13: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=1726751009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W32ZUwLf5E5jq4JA+3OriNmX/EUH23WCkeq2sAkpirA=; b=tJPvqB3pJ6EOs9G+Cm4yrwaeSd8qv03LPE+0yFeJKYMKG2AWpgi5dKN66V5Jx/wxfgiOPx ppE/qQNXQqqbMonSznEp1L5LgwwB3ppwIS9CgQBfIh8BPuAVIBURzVTxyML7Ye5AL5l2st 2Sq0J6Km3DY6xi7+G1qV44hdKDFs29WSjHLgntPfWbeC69CHKI5OuLuRSMwD8ii4aFBl2s IpBml5CHbc/rWUdp165W3Cwy9jFiLBE/fkXX0fkZePK5IRN+Ygw9wWRSFc5IpJBkBa66YU uScOYfiWwvhO12YeRsA1FQeo0XcR55qulBRz7qbCnmL/JbNtETxxuPCUx1/InQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751009; a=rsa-sha256; cv=none; b=aTHVbQ/5kKe4IXcOg/zz4JsNxFKbIP8kGQhqH15a/eW50zz81ylGjg3nD8g06JSWtGpgCx svmEHspDjPmTqYCDIKVrshMwMIOs2BmRiTJA6n1oPJzww7z69YYzbUgmTaX/UvkIYpgUjX kafLU6V8Nd6V3xnT9+3QPu4HJCz70axczMi1ywKf8OBoU06NQAqVNsXuKWCj9yNvUkmPTk aftzG/WyNUV2/ajEUdWc8mPbXqr4J3iukW24kZ5e22vZ9c/VTcS6e3qIT3uQuAjwo/0Blt 3LAIK/G5d4YmjyltnexrpKnMEwDQbVqpB7og53Eo1aoFot5/AkzAOaR37G6jEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W32ZUwLf5E5jq4JA+3OriNmX/EUH23WCkeq2sAkpirA=; b=wq5Sf0NesUoJZQHQG8vkeGnQFqPIpIEoow6scbCKLwNFNCt/Vp9erYx9r7FcqKdOs9irQF kptirDJIm0Yj9Buwqtwr5crW00Q7mcVVW4nSybqSkXqknE/ox9c9YVgQSScE+TZMrI2pAb fj7CO1j/WcMjVzo3xjVCyb+4/QRP0qK460rZanrKoh09htbjQ0oQtkW8/H03IF28UdJMgT wk4vFW0xUxye6OnTaOcakmAoacLD5PY3euFujqTHxuU/QHtSeijAVjGTaEOa5Z9IsIl0NZ DVNbmfTNlzbexHXsBFKR/fs6Gex3OkVtOfbzqeqLZPI0b2DVturjr/mDrTpVMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bL91zCMz15tq; Thu, 19 Sep 2024 13: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 48JD3T0u000411; Thu, 19 Sep 2024 13: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 48JD3TdU000407; Thu, 19 Sep 2024 13:03:29 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:29 GMT Message-Id: <202409191303.48JD3TdU000407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e854c92f30aa - releng/14.0 - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: e854c92f30aa96a8a3a7f8edd8be9e5ba8a20deb Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e854c92f30aa96a8a3a7f8edd8be9e5ba8a20deb commit e854c92f30aa96a8a3a7f8edd8be9e5ba8a20deb Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:58:44 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5) (cherry picked from commit b822e3fab468ffbe941d0758d960e1aa46069a38) --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 49bfefa2b6ed..5a7a6563d355 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6175,6 +6175,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Thu Sep 19 13:03:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLB5Q8sz5WYX7; Thu, 19 Sep 2024 13: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 4X8bLB33Mbz4rVX; Thu, 19 Sep 2024 13: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=1726751010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pJfsHvc5qJnSv2v/iuBCtccqnOYCttnQ4XfInHChPI0=; b=iGQiw6VMBw9EKHRJANhD/ozfMaa7/QqGNJhmpz9tKbjhwXQAdZXSaUMs/K1L6CTtiVRj7m gJ6wdPkh/pkMo8yjpT100FgqWtZNW1QjrM7QQIS7IJ1PP+vZxigPVGbeabywc6E/KcfxIO z3BncyoDvJHsq11JVLi1ALlsssFNQb90ynUCwIDHItF7eccZYdpNduAJTke0dtCE9LkOia 7tFU39oL5eI5sdrW6I0O5hAMmuKnfRLdq2hAdAGwmJ8Tz8hlxZfBXkJqRVSwWTipt6e+zw 5S1dyjSmBOwRIK6peBBRGTgIyoTlV3YN0TUAOc/raVlcklvd0KpKDBJfCisqpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751010; a=rsa-sha256; cv=none; b=QyZiWrk54i9dsidNTREFTTWwysEa/w+E8sGwLmCpMqb5sJFN0WecQte7fmhcR1lfahP9ny tWyYe92Ou4rbfzx3dZkZg7qV0tB/uZdpK63BY/nTVVMNCNrmTSuUjbOX8HWAVa8vc/1aJT 6XJiAR0T7x17Q/QhZ040G1wbHsQByQoOys/rFfSigw1Qwb3H284DOOF7c042QFYQGgvpyc VNWOs0PUAWIFc7kzriD7zmLPOp/RW/KyHaoGI3X7qJPUVghlx8d1EjLrdSyRfD2Wq9fAdr ffzAKHgMfs4UnRVzWv9jbKwxkWxlXTe0CCfoKwyC/xsOJ2YQqazdoLHGSiZjRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pJfsHvc5qJnSv2v/iuBCtccqnOYCttnQ4XfInHChPI0=; b=CE7Nfy3EOcm0P++iMNqTcRKWaGFErRSiZPe6DQwzH9ayDHTl4ZHgmtMyw+CkOw8Eze5ra8 FfEUXiJjOWLI4ODSOV9CkJ+YVu3kU4MEUJYtq0WttYEuNbhc8DW84cXD2btBsRib/aqGyT mHHcsjz+zvUn/gNPYPq/zTb0LWalfKPDVzGd7Ch88TeqjHuO+477NElix0Pu2EwfsltUYU yb0I0cZmOAyow5nLns7wZRvRgKnvDtMfDcWlO2csscTASS+8BI0/LPrJKT11ZmDYpecCyG XTeyuBfax/+1/bk7NFP8BLlf1rMqGGEfeE3Jv2LkvljfM6L8gTtBoW8xW+4R3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLB2d5Xz15tr; Thu, 19 Sep 2024 13: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 48JD3Ugr000458; Thu, 19 Sep 2024 13: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 48JD3UEE000455; Thu, 19 Sep 2024 13:03:30 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:30 GMT Message-Id: <202409191303.48JD3UEE000455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 413ae023b056 - releng/14.0 - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 413ae023b0563b7d51ab7aa1d69900886db66497 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=413ae023b0563b7d51ab7aa1d69900886db66497 commit 413ae023b0563b7d51ab7aa1d69900886db66497 Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 12:58:55 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0578fe492284ded4745167060be794032e6e22f0) (cherry picked from commit 38f74de7184ac3ad7acc48055551aaa9ec9cded9) --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 4edbf0c51ff8..f24103c25960 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -359,8 +359,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5a7a6563d355..8ff0fbb3c4ae 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6189,6 +6189,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6241,15 +6243,16 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -6656,8 +6659,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6712,16 +6717,17 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Thu Sep 19 13:03:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLk1GVxz5WYXr; Thu, 19 Sep 2024 13:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8bLk0nkvz4sT2; Thu, 19 Sep 2024 13:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xQBoWnq44WRcx/vUGh8SEUoEbLPT5KVllOdcJm/lU5g=; b=fyUgJyVQpv7Pyj8Ug4aOGs3rvGVQDGA0npZz3jbIvr/0BWdlH1nvlsTQrsrhU52iqgHawJ RJuMO8AMu1/TOUB/+75GdjQIU8O7AygSfYk4Hwj+5+ntl2Zoye10RdUpTRESqoTIlskRVm oCFZ7P7cvq+WFHZSzznYimDiDwnFubHKq2/QgtThNaabdjhSqBf/eQ3tHN+/2dSf2YgAP1 1iVEauhf84BQAwU1AoZzS95HvT5PKlT06YUkqNFFDqyflP5+D0l5Q2OIwHGTH6qhZnNHDG A8GUID4QaFT3D9K050DKB7QjtAj4AmnHgprwj9YxO84wZpEYCy3rLySEjXAUhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751038; a=rsa-sha256; cv=none; b=PMsNQQVvBd/AhEkeWSPnTxNcQqBO7TiNEp2xKyNgB1skdpkHTf1gxuzPX1LFMLKQ3ZEHGR 9er5G42Zqqvrra0BuUr8vbn3kBoOK8Z0GrOXJGWp0tx5GcD+ALBxiUVrPMz91uXVdQ6jAU EpdG3IRP9K8mYwNQ69XAjFZsh5iaqp1RrOSw4W9LcP4XWQt1EaygVHLwly3aLw+CJQUrWb UTG6DjQtAy8ViwJunbU/olT7g9kLgWzYhYVGoSa/trVXTY352HA/pOIZychS8nDvQmIVxE 0DzvxZBHXIL8NLUNFwRjeDEHxgj8ba0h/ue2vaqbpLGfD4sYuTk2ZdKtKdqfAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xQBoWnq44WRcx/vUGh8SEUoEbLPT5KVllOdcJm/lU5g=; b=wbqOBo4A5/+WlvfJfNZhqn/ywh9AN2AAaIJsbKhthK5cCo0MIKjSEzTUpxtMc3OvHf1+Ly 8qAyNcbqNK/CYH+FW2PlxPaQ9qh0QzQYvBcdoDH/b/vFBF8nKTp9P8DPOK6zEGV6q+2h2+ a3ndJewCo7LRVyHBT1u6MR2NxO5Kp0FFciym3qdZizIn7ztxPZjx7FvTRpriOmUcP+VF4I d8WzP8EukowoZaf1q2fVl/RNLvT85kCuq2EfBwMFenxgPbFFpVsBGumS0zAOkJhRqGaiA1 OWaXPtCV/kx0gAkKxixDBYnwMvgRAG51jxArtYsAjCTNr9cz5JaMzPfxtm1Nfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLk0NRkz16C4; Thu, 19 Sep 2024 13:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JD3vO5000728; Thu, 19 Sep 2024 13:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD3vnW000724; Thu, 19 Sep 2024 13:03:57 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:57 GMT Message-Id: <202409191303.48JD3vnW000724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f51f7cb8997f - releng/13.3 - pf: fix icmp-in-icmp state lookup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: f51f7cb8997f2e43047a84e937144c2ac7e84587 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f51f7cb8997f2e43047a84e937144c2ac7e84587 commit f51f7cb8997f2e43047a84e937144c2ac7e84587 Author: Kristof Provost AuthorDate: 2024-08-12 14:07:35 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:00:07 +0000 pf: fix icmp-in-icmp state lookup In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP error packets potentially being dropped incorrectly. Specially, it copied the ICMP header into a separate variable, not into the pf_pdesc. Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup. Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 2da98eef1f352c496ffd458b4c68ddee972bb903) (cherry picked from commit 0d8d4cc3ea47f1ee61d749b22b135eb73c7d33cd) --- sys/netpfil/pf/pf.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 96d67d906a4e..48db6512eee1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6485,9 +6485,9 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif } #ifdef INET case IPPROTO_ICMP: { - struct icmp iih; + struct icmp *iih = &pd2.hdr.icmp; - if (!pf_pull_hdr(m, off2, &iih, ICMP_MINLEN, + if (!pf_pull_hdr(m, off2, iih, ICMP_MINLEN, NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short i" @@ -6495,12 +6495,13 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif return (PF_DROP); } - icmpid = iih.icmp_id; - pf_icmp_mapping(&pd2, iih.icmp_type, + icmpid = iih->icmp_id; + pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, - pd->dir, kif, virtual_id, virtual_type, + pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); if (ret >= 0) return (ret); @@ -6514,10 +6515,10 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || (virtual_type == htons(ICMP_ECHO) && - nk->port[iidx] != iih.icmp_id)) + nk->port[iidx] != iih->icmp_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP_ECHO)) ? - &iih.icmp_id : NULL, + &iih->icmp_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP_ECHO)) ? nk->port[iidx] : 0, NULL, @@ -6533,7 +6534,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); - m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih); + m_copyback(m, off2, ICMP_MINLEN, (caddr_t)iih); } return (PF_PASS); break; @@ -6541,9 +6542,9 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: { - struct icmp6_hdr iih; + struct icmp6_hdr *iih = &pd2.hdr.icmp6; - if (!pf_pull_hdr(m, off2, &iih, + if (!pf_pull_hdr(m, off2, iih, sizeof(struct icmp6_hdr), NULL, reason, pd2.af)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: ICMP error message too short " @@ -6551,8 +6552,10 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif return (PF_DROP); } - pf_icmp_mapping(&pd2, iih.icmp6_type, + pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); + + pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE); @@ -6580,10 +6583,10 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || ((virtual_type == htons(ICMP6_ECHO_REQUEST)) && - nk->port[pd2.sidx] != iih.icmp6_id)) + nk->port[pd2.sidx] != iih->icmp6_id)) pf_change_icmp(pd2.src, (virtual_type == htons(ICMP6_ECHO_REQUEST)) - ? &iih.icmp6_id : NULL, + ? &iih->icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? nk->port[iidx] : 0, NULL, @@ -6601,7 +6604,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif (caddr_t)&pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), - (caddr_t)&iih); + (caddr_t)iih); } return (PF_PASS); break; From nobody Thu Sep 19 13:03:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLl3Jzqz5WYXs; Thu, 19 Sep 2024 13:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8bLl1WJJz4scD; Thu, 19 Sep 2024 13:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G1Aw6OE0rMyr66AsFl7bIKhqlwaqRG2G7mUlxtkhdVw=; b=S5jeP5ifsYG16ZnCFUdx0GcDn7/joVspLy3YPoKOycKsyB7o8BdFlmQviFzbRZcXG0a2/h eK0AngatcVw0uPJPAE4CKioyAMN+2xwIMI+DQ2q1XeZfRbvntqjZfZtO+9K3YLaQwuKd3/ sfYkuVY8juapiDHOdw88YN//UEngCtDYRnAlhC3RCNerFMzQXaOsFGXoSfgpXvQBnLvLC4 WkcHNENuCNhVoT+LeHepN61u6Y7TFJLM+4C/8WhSV0aVaNHghw617nvjIgJzmKP1nYQYGF 3F86LHeQWEXLwdQmrf/bNjPaG5OoWYB6G8NVN11QEcaNdaqju4uS0aeFXgNKLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751039; a=rsa-sha256; cv=none; b=s0JKmrwz09TS2NS1KZJyexe9rMrcGPIfQIkOZ408M6Ca4FzKCrGfRdnHLRCd5iqif9fi4u d6ehNC9aDtZJ3CCY4ZIvw7vJZJPz4smyzV4auBKPKHGpa27XqqAuaF1Mm4+YGeZ8niECvq CobcZqvO76Jvc3qoxjCUA5xBsd5mlGI2g5HUaObSZseLi562HedN1DXpNE11EJdM0GP7rk WB2uH9EPC5bnyt5ZxS1gwr/0imNhwTZF3BSm4iRYhjfcM3EAiwpNhm5+bl/dWsL/N3U1O/ KCFvDbgAZ64QlylHaqSpYX4saSNiqG+vGIKKjf9QQQKRTk3ga5GZ2rQld3i6kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G1Aw6OE0rMyr66AsFl7bIKhqlwaqRG2G7mUlxtkhdVw=; b=taojE0Yx8L8hk1QncvAIM/0JgmGvEDC7XFdYVS838rfvcf01oHEPjtkPrSNuFj/yXZWR7J uYAZcPVbXToCY6yY+v9LnC/CtHD37vZGTzlUHsOiWtgBLetWQtJcvs6HYl6r9Pxy51Vhbf TEOlD1s7p/TcjOj0QBIT8PEpno4KKXuPoysHdLCs/rHJMixApQZY5RX4neZAt/woF4Wg1f YBPPSnUHCQdvswnpOOSADqBHCQY9f0iGNqxCZQcqkOh8Uyu1rBvb+VpxxRCMUJjSKYKX51 pbs8dsy3g6/CHtKxohwad4WVhXIv+dwK/plrEKhdMgdMNjQUhdpJvK3V3SkQ4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLl16VXz15v2; Thu, 19 Sep 2024 13:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JD3xmk000787; Thu, 19 Sep 2024 13:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD3xM1000784; Thu, 19 Sep 2024 13:03:59 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:03:59 GMT Message-Id: <202409191303.48JD3xM1000784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 49c896761e2e - releng/13.3 - pf tests: ensure we don't confuse different ICMP types List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 49c896761e2ed6025767a2fea0ed4dbeb2834001 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49c896761e2ed6025767a2fea0ed4dbeb2834001 commit 49c896761e2ed6025767a2fea0ed4dbeb2834001 Author: Kristof Provost AuthorDate: 2024-07-09 09:22:18 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:00:32 +0000 pf tests: ensure we don't confuse different ICMP types When creating a state for ICMP (v4 or v6) packets we only used the ID, which means that we could confuse different ICMP types. For example, if we allowed neighbour discovery but not ICMPv6 echo requests an ND packet could create a state that the echo request would match. Test that this is now fixed. Approved by: so Security: FreeBSD-EN-24:16.pf Reported by: Enrico Bassetti MFC after: 1 day Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b9f0dbc3d006e0b904ee4275d54459f4edd65bb8) (cherry picked from commit 4ebd7fc30ab779b87c055b0d54eabdd97a9fc730) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/icmp6.sh | 89 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index ea0d5cb151a2..f033940b4564 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -12,6 +12,7 @@ ATF_TESTS_SH+= altq \ fragmentation \ get_state \ icmp \ + icmp6 \ killstate \ macro \ map_e \ diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh new file mode 100644 index 000000000000..35d20c83cc4f --- /dev/null +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -0,0 +1,89 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "zero_id" "cleanup" +zero_id_head() +{ + atf_set descr 'Test ICMPv6 echo with ID 0 keep being blocked' + atf_set require.user root + atf_set require.progs scapy +} + +zero_id_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set block-policy drop" \ + "antispoof quick for { egress ${epair}b }" \ + "block all" \ + "pass out" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 135" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 136" \ + "pass out quick inet6 proto IPV6 from self to any" + + # Now we can't ping + atf_check -s exit:2 -o ignore \ + ping -c 1 2001:db8::1 + + # Force neighbour discovery + ndp -d 2001:db8::1 + + # Verify that we don't confuse echo request with ID 0 for neighbour discovery + atf_check -s exit:1 -o ignore \ + ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 2001:db8::1 \ + --replyif ${epair}a + + jexec alcatraz pfctl -ss -vv + jexec alcatraz pfctl -sr -vv +} + +zero_id_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "zero_id" +} From nobody Thu Sep 19 13:04:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLm5dS2z5WY9Y; Thu, 19 Sep 2024 13:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8bLm2Dlnz4sml; Thu, 19 Sep 2024 13:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L24fDoxPjyg0iNJCaxpOgSKl79lGKDLv7hhMZqlDLbU=; b=Orp0CqB8qDPqvibtkUMGO2v4x4v/yLrjUbHrp9A3O5bDvZ1VL1YvPNQWLmy2VH9OVNrLpv JnOf5H7dpaH58jidUobbnUcmDrQICaXVPb8DzfB8yO6jO5DICHAsJ1cPCww25eTI49jCuM lh6hulhGvxIaY+rQd3tW8xghGVw293FOtlW7OMeKcxKnOlrbDxMf+acCpgXu/H1C0OYOdq n0ICKEtYw7XOLUChJMfBfCWdEHB5k6Kr7soyKbY0WI2fHn0H599D4BttEHHDXjjhIQex+X h0KJ+RHomSZEi9Gw0U9gzovYOebJdtwzgo7Tgy21EFoKWzCLvt3II8e46eFHHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751040; a=rsa-sha256; cv=none; b=sw7oDCTkXbx4TSTwUNRifODXQm7QEh/Q61crcyZIy0np1Hu8cPYM/igRbKZLuZAhHXLwq0 cI/ct+Hc5JN/YzBa6jqN4Sq5WZ5uyKLRaneoK0ZgUsbx9xROF/c3B7eT27yTtuxN3EQUcL 4MAHdv0pVmsMFT1Js/hI5Ol6uWoFqkZYhpiIIH2QfsyhVOUNO/WJhkcoMb9+CTCoV0tnCI 2NpGAR2BcCOBDGeuU35u2Y2GkrfZThsPRGOTIs66XD/vw41nY4r4w0trDrEKzy2jYcU7yH WRqKSzopdZdIfxxuRrC7DC8g7iFvio3ELX8X0fIurXsrcqJRg7+zDuroU/j0TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L24fDoxPjyg0iNJCaxpOgSKl79lGKDLv7hhMZqlDLbU=; b=v8JDf1Q3Sg52aEtaa/y22yNSewLWmTGuH+B577MZS5jzKeFBwieyLYxI0owvkbbidI9I0j piuJRDO+eYZWmSbEPqGrMbOUpJPh4zVc8pzGo/vLR8q4xP2ejMufWPCBxWUkVsXP9SU3IA hkH1nz02GNPIru55Bgxi7ANcP2LzRbokmqxMAnXb/K0szfaDWNkJ5l6baoGHN7Y7JVpe7C FAb3Zfz243fpKwR2Ois3bVydQWLX2uFaESUR4as7jUvljtGVIXxPk4gZkDoh8iE4euv7Ft KpsWjSrj5kHJUvBjbpOB2KlWVUxLRl36gYxcxmC9HVy2p2yOiyG9xT5Jqjhl5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLm1r67z15v3; Thu, 19 Sep 2024 13:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JD40RJ000844; Thu, 19 Sep 2024 13:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD40bV000841; Thu, 19 Sep 2024 13:04:00 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:04:00 GMT Message-Id: <202409191304.48JD40bV000841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a16cd5ff50ea - releng/13.3 - pf tests: ensure that traceroutes using ICMP work List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: a16cd5ff50ea2e5954958d90ef6de18e0f1aa4bc Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a16cd5ff50ea2e5954958d90ef6de18e0f1aa4bc commit a16cd5ff50ea2e5954958d90ef6de18e0f1aa4bc Author: Kristof Provost AuthorDate: 2024-08-12 10:14:43 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:00:40 +0000 pf tests: ensure that traceroutes using ICMP work Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 34063cb714602972b6d985ad747fc8f66a8daae1) (cherry picked from commit 7024e1066d5aba76dbbc85eb191357da7d32c619) --- tests/sys/netpfil/pf/icmp.sh | 65 +++++++++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/icmp6.sh | 65 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/tests/sys/netpfil/pf/icmp.sh b/tests/sys/netpfil/pf/icmp.sh index 72b531b08c51..16c4123b8dfe 100644 --- a/tests/sys/netpfil/pf/icmp.sh +++ b/tests/sys/netpfil/pf/icmp.sh @@ -71,7 +71,72 @@ cve_2019_5598_cleanup() pft_cleanup } +atf_test_case "ttl_exceeded" "cleanup" +ttl_exceeded_head() +{ + atf_set descr 'Test that we correctly translate TTL exceeded back' + atf_set require.user root +} + +ttl_exceeded_body() +{ + pft_init + + epair_srv=$(vnet_mkepair) + epair_int=$(vnet_mkepair) + epair_cl=$(vnet_mkepair) + + vnet_mkjail srv ${epair_srv}a + jexec srv ifconfig ${epair_srv}a 192.0.2.1/24 up + jexec srv route add default 192.0.2.2 + + vnet_mkjail int ${epair_srv}b ${epair_int}a + jexec int sysctl net.inet.ip.forwarding=1 + jexec int ifconfig ${epair_srv}b 192.0.2.2/24 up + jexec int ifconfig ${epair_int}a 203.0.113.2/24 up + + vnet_mkjail nat ${epair_int}b ${epair_cl}b + jexec nat ifconfig ${epair_int}b 203.0.113.1/24 up + jexec nat ifconfig ${epair_cl}b 198.51.100.2/24 up + jexec nat sysctl net.inet.ip.forwarding=1 + jexec nat route add default 203.0.113.2 + + vnet_mkjail cl ${epair_cl}a + jexec cl ifconfig ${epair_cl}a 198.51.100.1/24 up + jexec cl route add default 198.51.100.2 + + jexec nat pfctl -e + pft_set_rules nat \ + "nat on ${epair_int}b from 198.51.100.0/24 -> (${epair_int}b)" \ + "pass" + + # Sanity checks + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 203.0.113.1 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 203.0.113.2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 192.0.2.1 + + echo "UDP" + atf_check -s exit:0 -e ignore -o match:".*203.0.113.2.*" \ + jexec cl traceroute 192.0.2.1 + jexec nat pfctl -Fs + + echo "ICMP" + atf_check -s exit:0 -e ignore -o match:".*203.0.113.2.*" \ + jexec cl traceroute -I 192.0.2.1 +} + +ttl_exceeded_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "cve_2019_5598" + atf_add_test_case "ttl_exceeded" } diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index 35d20c83cc4f..c54b54c20a87 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -83,7 +83,72 @@ zero_id_cleanup() pft_cleanup } +atf_test_case "ttl_exceeded" "cleanup" +ttl_exceeded_head() +{ + atf_set descr 'Test that we correctly translate TTL exceeded back' + atf_set require.user root +} + +ttl_exceeded_body() +{ + pft_init + + epair_srv=$(vnet_mkepair) + epair_int=$(vnet_mkepair) + epair_cl=$(vnet_mkepair) + + vnet_mkjail srv ${epair_srv}a + jexec srv ifconfig ${epair_srv}a inet6 2001:db8:1::1/64 no_dad up + jexec srv route add -6 default 2001:db8:1::2 + + vnet_mkjail int ${epair_srv}b ${epair_int}a + jexec int sysctl net.inet6.ip6.forwarding=1 + jexec int ifconfig ${epair_srv}b inet6 2001:db8:1::2/64 no_dad up + jexec int ifconfig ${epair_int}a inet6 2001:db8:2::2/64 no_dad up + + vnet_mkjail nat ${epair_int}b ${epair_cl}b + jexec nat ifconfig ${epair_int}b inet6 2001:db8:2::1 no_dad up + jexec nat ifconfig ${epair_cl}b inet6 2001:db8:3::2/64 no_dad up + jexec nat sysctl net.inet6.ip6.forwarding=1 + jexec nat route add -6 default 2001:db8:2::2 + + vnet_mkjail cl ${epair_cl}a + jexec cl ifconfig ${epair_cl}a inet6 2001:db8:3::1/64 no_dad up + jexec cl route add -6 default 2001:db8:3::2 + + jexec nat pfctl -e + pft_set_rules nat \ + "nat on ${epair_int}b from 2001:db8:3::/64 -> (${epair_int}b:0)" \ + "pass" + + # Sanity checks + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:3::2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:2::1 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:2::2 + atf_check -s exit:0 -o ignore \ + jexec cl ping -c 1 2001:db8:1::1 + + echo "UDP" + atf_check -s exit:0 -e ignore -o match:".*2001:db8:2::2.*" \ + jexec cl traceroute6 2001:db8:1::1 + jexec nat pfctl -Fs + + echo "ICMP" + atf_check -s exit:0 -e ignore -o match:".*2001:db8:2::2.*" \ + jexec cl traceroute6 -I 2001:db8:1::1 +} + +ttl_exceeded_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "zero_id" + atf_add_test_case "ttl_exceeded" } From nobody Thu Sep 19 13:04:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLn5lfqz5WYZs; Thu, 19 Sep 2024 13:04: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 4X8bLn3r8Jz4sn1; Thu, 19 Sep 2024 13:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X/MWeINaGXS/H0h1WFBqTGIhfBqCyucp7O5HqGIMK3k=; b=Rw8lkbh7RveDV/hC7eZH1zEoNoDHN0c+wlVCo6dxqzK48xfYhyqCjg8Yf2BmnQqTqTds35 Kom5/yyhKevjR55mJQGM7o1OpYsIozPR+NNXsRI0jUCRwUOt1lWcwxkL4cWcd2a/OoSmjZ naGMk86SolvvD76pvW01SPC1y87SMGs5OGUH12m/AUmEcVhd2BksrIiTUUEiMsdLB+JYjE 4xwiHwCpEQPdQzyQrsX5eJ1zhkNA64cmKUpwHvPpdaAKIYf9Qwjg2i1dUqzYex/O+LQvWa LmmzrSAFKw4D0B+v/jnUy0aa28R7fh/irLHJimi0t1Naiunbv8VksN8ut1Z3cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751041; a=rsa-sha256; cv=none; b=v49W2kOgF8fzOgl5DpZRI7bfKSUBRKB7tdTMiaOR0PVLeATbVMXJDSh4jICxC+vqv2yMYE Ay9DF11sxNny/cfIb9XoJ46hsSMbUsmgG5zXMiA8i25iahhZ6iIGaX08Ivi3CRUtpxihWE j5cZFPcGvDJmtD3SippLyNelSjMPYUyUqZcbYh4RYF60dboSac9YhxY0XgMBFvUsSfExrE BExWFh05ZE3oQJ3K2uilJLiFw3Aptj7P3OSfOFNWvVDCvWWw9r9t+MnIvYMYQm1HDZAKH8 y33Wa3MbDEmJdQjWIQme8V2ewe9nqW/LYCnNnLQVCY6qaxTHmIVg/1Hl1YugXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X/MWeINaGXS/H0h1WFBqTGIhfBqCyucp7O5HqGIMK3k=; b=V6tQdfDbfeD0y/ebKvV1J2uMRQCUipFO5LmGdaBvthQSObQwcnA1HbTJ/MssN2Uhv+vuvj qTgbODJxSngbEOq86rc3T8dBh37cCt0JGAgOQpeDi3D4K80B/XQkbLb613enTcMhAgcrSE pFNcKToOlgK0P8Doqql4eCkCWxOlkYb7dn1/nzBi1X1oQq+Dbo2N9jzqEoaD+iDAjBDTLs 5xg4Kw4u494sl8gTtyUdchtMBCpxkSsnpD50Rew5QHmk5L4zT4KWP/WeF9xb3MivZ4DWvW L68XYrMe5J/3xEJ0qdj1xx+Y2usVQCjSHtJFzAaxUJVPiQQ3w8O6UjyF6I5PCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLn39lCz168T; Thu, 19 Sep 2024 13:04: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 48JD418x000897; Thu, 19 Sep 2024 13:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD41jP000894; Thu, 19 Sep 2024 13:04:01 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:04:01 GMT Message-Id: <202409191304.48JD41jP000894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 36265a707dc5 - releng/13.3 - pf: invert direction for inner icmp state lookups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 36265a707dc51189843498e059361010ea3c9718 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=36265a707dc51189843498e059361010ea3c9718 commit 36265a707dc51189843498e059361010ea3c9718 Author: Kristof Provost AuthorDate: 2024-08-14 09:29:30 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:00:48 +0000 pf: invert direction for inner icmp state lookups (e.g. traceroute with icmp) ok henning, jsing Also extend the test case to cover this scenario. Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 Obtained from: OpenBSD MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 89f6723288b0d27d3f14f93e6e83f672fa2b8aca) (cherry picked from commit 5f3f07397a7909e8f9449d1aa0b465159cbf0d60) --- sys/netpfil/pf/pf.c | 21 +++++++++++---------- tests/sys/netpfil/pf/icmp.sh | 4 +++- tests/sys/netpfil/pf/icmp6.sh | 4 +++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 48db6512eee1..247a20bf953b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -321,7 +321,7 @@ static int pf_test_state_udp(struct pf_kstate **, int, int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, int, struct pfi_kkif *, u_int16_t, u_int16_t, - int, int *, int); + int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -5991,7 +5991,8 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi) + u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, + int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6028,7 +6029,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && - (((*state)->direction == direction) ? + (((!inner && (*state)->direction == direction) || + (inner && (*state)->direction != direction)) ? PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", @@ -6086,7 +6088,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif */ ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, - PF_ICMP_MULTI_NONE); + PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -6094,7 +6096,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 0); if (ret >= 0) return (ret); } else @@ -6178,6 +6180,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif int off2 = 0; pd2.af = pd->af; + pd2.dir = pd->dir; /* Payload packet is from the opposite direction. */ pd2.sidx = (direction == PF_IN) ? 1 : 0; pd2.didx = (direction == PF_IN) ? 0 : 1; @@ -6499,10 +6502,9 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd2.dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) return (ret); @@ -6555,10 +6557,9 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - pd2.dir = icmp_dir; ret = pf_icmp_state_lookup(&key, &pd2, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { @@ -6567,7 +6568,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); + icmp_dir, &iidx, multi, 1); if (ret >= 0) return (ret); } else diff --git a/tests/sys/netpfil/pf/icmp.sh b/tests/sys/netpfil/pf/icmp.sh index 16c4123b8dfe..f4c8ec5e5836 100644 --- a/tests/sys/netpfil/pf/icmp.sh +++ b/tests/sys/netpfil/pf/icmp.sh @@ -108,7 +108,9 @@ ttl_exceeded_body() jexec nat pfctl -e pft_set_rules nat \ "nat on ${epair_int}b from 198.51.100.0/24 -> (${epair_int}b)" \ - "pass" + "block" \ + "pass inet proto udp" \ + "pass inet proto icmp icmp-type { echoreq }" # Sanity checks atf_check -s exit:0 -o ignore \ diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index c54b54c20a87..b9b60a484afc 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -120,7 +120,9 @@ ttl_exceeded_body() jexec nat pfctl -e pft_set_rules nat \ "nat on ${epair_int}b from 2001:db8:3::/64 -> (${epair_int}b:0)" \ - "pass" + "block" \ + "pass inet6 proto udp" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv, echoreq }" # Sanity checks atf_check -s exit:0 -o ignore \ From nobody Thu Sep 19 13:04:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLp6tQWz5WY9Z; Thu, 19 Sep 2024 13:04: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 4X8bLp4Wlfz4sss; Thu, 19 Sep 2024 13:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YH1wI0h6I1Kie6SKprJEFgIkHjZTzr1aQFS3+dwD89k=; b=ql02jpw5lDRZz8jagUws40oAxIvPI5iRepHVJAzjAGpaA596t/OPwhduk+kN50w0pRebEv X8MxKmXzOu3otrsUAAOHR8HtLInxg8Kns9M32x773i58Ub0AOxkV5gW4emuhPM5k6MbMIj myNZSczXR41XmZ5dBXqGcEesjJG5RDlud5r9Jy4xm14HveE9VZf/POCrMsLrus0+9pEMz3 jsPtbj4mkYvp6x/oP94ssHQKdYHCysf4O+1Vtwn973pHue9mMlbm+k19qSBKHaM5WI67dU oCpp3TvivCvMPmMRnmf7AWd65wgIGcnRwXjeJikHvrziyZ6dWSgfPtfYIpVqfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751042; a=rsa-sha256; cv=none; b=aE3JeA9k5/QPfzj1TMS8IL6nnimoldrYE0lsfEdeXl8XzDh8vmEdce4uWj4KVpg+m/01Cq v9JGfitN4Bvxyb1as0jg3N8B3mQ3YwS1p7ldJXm0gbM3y8t4epPp+a5otb90DPGU65RHob f9b88IzDiv4a0lyZB3ruy/0QdMiKIaocUsAKeQRVK0aam4pG1wRK/DzvJIkhaYV/Xx+hNU UE4H4z/Ih3bzUimVaWX2jOh9wJxlun7I+qfT6hTfVt6vWsyU+vDNAzXkHm7vuX1t5FOsec LIM4+FBqPnVIcmQYLCFp7pLFND0RFjoNalYl1l7HK/+Q3xuE8gNy8pLKsfzUag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YH1wI0h6I1Kie6SKprJEFgIkHjZTzr1aQFS3+dwD89k=; b=N8qPjQQV0zbdQ3wF2neYQwa4Qw9pdMKYdmFmKgxwzgceFhrdgqLHVHdC3knd4onaBgKRCk vssAxvHir0llKqL/qzpkiwSvkq78RwNNgLzL92IISUYQQXtu0lCSHkfhGuje8yvA+A5Q1G aNzQUeJkUaID1/ezikd2ImEc8EbXxHI9e4j8H/CsY9TNUfqcWKlsvpoHq16gIx/jqffClh YkBz8jreRR6Tw0kTH587dSnRroQCj1GlWSLd07ayhOIy7MqVTapNIT6BMIb0aZM3S05s8P VY6R/zo4XdpEk1lq+bt3Wi2CwAfSDRsSfaAOlbCY+rPpcol/ANhcI2Aa6YcSIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLp3yqkz15v4; Thu, 19 Sep 2024 13:04: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 48JD42Gw000945; Thu, 19 Sep 2024 13:04:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD42np000942; Thu, 19 Sep 2024 13:04:02 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:04:02 GMT Message-Id: <202409191304.48JD42np000942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7dabb892096e - releng/13.3 - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 7dabb892096e4e3ba7526914b94f97218d9690d3 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7dabb892096e4e3ba7526914b94f97218d9690d3 commit 7dabb892096e4e3ba7526914b94f97218d9690d3 Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:00:57 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm Approved by: so Security: FreeBSD-EN-24:16.pf PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82) (cherry picked from commit b84344206721ed2803d5da68585289d5880efe3f) --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 84 insertions(+), 36 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 11bde6224eb3..b3b8074cbe17 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2222,7 +2222,7 @@ struct pf_krule *pf_get_translation(struct pf_pdesc *, struct mbuf *, struct pf_addr *, struct pf_addr *, uint16_t, uint16_t, struct pf_kanchor_stackframe *); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(struct pf_state_key *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 247a20bf953b..c8c3d96a72bc 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -307,6 +307,9 @@ static int pf_test_fragment(struct pf_krule **, int, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_tcp_track_full(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, struct pf_pdesc *, u_short *, int *); @@ -320,7 +323,7 @@ static int pf_test_state_udp(struct pf_kstate **, int, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, int, @@ -375,7 +378,7 @@ extern int pf_end_threads; extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s, _dir) \ do { \ @@ -1414,9 +1417,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1424,8 +1484,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -4579,7 +4643,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -5990,9 +6054,9 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6005,25 +6069,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, direction, *state, pd); @@ -6086,7 +6134,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6094,7 +6142,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -6502,7 +6550,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -6557,7 +6605,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -6566,7 +6614,7 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 46d3ea8f508d..2571a0c5312e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -606,7 +606,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction, return (NULL); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (NULL); *nkp = pf_state_key_clone(*skp); From nobody Thu Sep 19 13:04:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLr0x92z5WYcf; Thu, 19 Sep 2024 13:04: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 4X8bLq5jgrz4stC; Thu, 19 Sep 2024 13:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbbZQ8ZYva3JhzAG5gibE+wgv5oIwY2C2n9bAq7/QnI=; b=txeerpZ7cJ8V2WetTqp93OGIUI4u1xydiKs5UzhYGGJOX/eqhmRcEqwzJRtKMdO2GydaAc 2qb4XndYiJg9OKcHWZ8w0LaJoM+sRHEoNvyEInhWZcR3X1w1JMSvso+qLBkasTHegho+iD /F7rC7iyXgAVie7YOa/qUPDOT6/PnqHJz5DnQA1l34yvXX1sAOob415hcEkASvmxXwKb0g KOam/BOJeB+U1UG8Ng6WZxFvJnCRDnRDj5w4OVsDNO17DI6TMfBhHM56iblZvbG53C+Y8w I0+L7Df/PZz0XVqloCfRG+O+bNsZlrv5WSbx9peWI/IzGWxzlvinhk+Z6iiK/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751043; a=rsa-sha256; cv=none; b=fYgmp4wyuegOB7AJ5zgO10lco1/ipxjNo2Avd5yiK/OL5UbhyKXknqfCO8oyrDTKqC+vBd NU3/aaOhngWrkJM5Q0bqc7RtwqHDnpPbuSeNv14Zjvzc3Rd+5ddMqORsq2Wp3h5WZxiOtn JdiHyQZLqHBAxssgKkiVCtVGLGxlGUvQkAvlygo5A4IPLX1z8iWPTRqol8HGWAL4BpfBtI kikCRrZYRO956GthZQvgnC3uu1+FCexMR0IK2QxwKm0FSGo/jlOtPqZfQa544GGQulMsrU EEk9vx+gGZZ8lCOTKO//uS4wQVZWZHtxeVhSQkogN1HaOKDKN1DZK/oeUPE+tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbbZQ8ZYva3JhzAG5gibE+wgv5oIwY2C2n9bAq7/QnI=; b=oYgFgR3W53CIcy6wLeJPngYPtWPiX0pof0Nuav/2O98CVNB9JboIK4g9WYleSw3X2Bti5k JzqQnLTp4YmAoY8GHVMXqWnqNrq+1l30YP9tx9lV3cUaTkvSW0xtZv+QK04Fdy9eeKccF9 P93Btlbr17+IIK9rd3aVJq+OmqOmkS29QUrmXrF9sbmQvILI82mMjBOJXPptOq7OayZs5r sx5OfpAEr7pxFJMMIDA0rpeZwPCHzD4LA9U4YLCw7ChdJROr3sBaVwmAOgfymbtEu+c81G ezORAd5TB33js0PmG4qVkK/xgwZmzntC1G2kyfNwohXcvTx3S84K7QJd55aBvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLq5Jbwz168V; Thu, 19 Sep 2024 13:04: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 48JD43QA001011; Thu, 19 Sep 2024 13:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD43d9001008; Thu, 19 Sep 2024 13:04:03 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:04:03 GMT Message-Id: <202409191304.48JD43d9001008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fceeab39e9b1 - releng/13.3 - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: fceeab39e9b16035f0a8c017c3ad64f1bf3e1d72 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fceeab39e9b16035f0a8c017c3ad64f1bf3e1d72 commit fceeab39e9b16035f0a8c017c3ad64f1bf3e1d72 Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:01:05 +0000 pf: try to lookup the icmp state based on a correct packet descriptor Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b8cd169efa6ac0899b4998898129765ae5c685a6) (cherry picked from commit fa4b64836183c33631d92dadb073a9e435c5bf6d) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index c8c3d96a72bc..ecad3c274d74 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6609,11 +6609,11 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Thu Sep 19 13:04:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLs0yZYz5WYch; Thu, 19 Sep 2024 13:04: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 4X8bLr6mNkz4srG; Thu, 19 Sep 2024 13:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kDNpwgeRgahfzVunSI+q7JcNUkVgAzHyW8Kwdqi5ljU=; b=awg73G8DYl6+4OmbgXy37JddovVEz0P9q80s3IdaCYEXH34xB/j1oVwfI39JRlrFmwW5s/ U2P57bWw0uNU9ABi0o/zXJNok3axkAc9uh5tKrUVuKyuEGnghNa4oe8O0jrWctNtMcHL4+ bFs9xxnB5AuiD/3+ZfoBymThXRdUnqBDTminBUvdRphzCbPhkOSOMq8dkr22V2b1dpzgRK b0Z6UIqE6eOcaGyCvpA9YdSTS7pVEbC1p2/R/A8xRbAVgBZyMf4paAaQfL3DISGFpaqfzY Z+xrDVxBe2rGrUYoygqYG0fOGQkcsiNc6mya3kF3vCaz9KNDyEFKSXMSXTz1yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751045; a=rsa-sha256; cv=none; b=vKBV1umNBs+5TWnB0J3OU9b52IJGoFn0tXgQhpBvP47fdqHY9LdtAMvEl67AjdLPYqKgjv ieufOnLcLZXBPBfGQw4+N272lxv4mMid+adhdLmmtDT+yjKgJyZVcH61hRFqUcHOWQ3Gaa GWA9qqZxavRtWIbAa4BuCQsXDv7I8H0b9N+jKImXB5+gVYHew9eEm0j23+7Hbd4OCgXpKG r+gAuncwbwzRDSOux/rzuHysd+B1iyDDtvZWtY0nQxJ7VuzBwrFl+PBgdsDGGe9iyG9B++ +JF0y12DiMyPQiVvnW/v4MRIk3lZMBc+CfwnzxJLQtZCF2fDlGiWpv2Z1Bof+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kDNpwgeRgahfzVunSI+q7JcNUkVgAzHyW8Kwdqi5ljU=; b=CWhmH9m1wcIjCTAXCwAistpibpuPmD2KlP2/Z1k6voA+LAtl2/AidxkTSnPkjmuWpnryQJ v9EZMFS/+OCkHQfZ1zedggfZdat6/3kMpejjC1To0dwb7AQoTXbNczrZQVnMuBkcEf8OKp afKznGmMxCq5vrMqMhpI5vb4Rp2pbynE4rtI0mxpd/q9jETMukyw6OUZe5Wmg/+aw8Aybi F85XOg7Eq/ysaOtumbfIrYUjV1rovvdkGYjSQCdaMvOoeZZ3pJEehDHPuS9WkZAhGHvoc+ BrKHi/OltejzSi9knoO/DvlidqwZkVpOAascQL+F6qR21Av82pwP0ObWzyMUGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLr6NFgz168W; Thu, 19 Sep 2024 13:04: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 48JD440L001087; Thu, 19 Sep 2024 13:04:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD44kb001084; Thu, 19 Sep 2024 13:04:04 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:04:04 GMT Message-Id: <202409191304.48JD44kb001084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: aca9955aec8f - releng/13.3 - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: aca9955aec8f339c003d977e113594d99be153f8 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aca9955aec8f339c003d977e113594d99be153f8 commit aca9955aec8f339c003d977e113594d99be153f8 Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:01:36 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5) (cherry picked from commit b4b8b2fc9bd25d10eab0afdbd06a7ef8735b7b6b) --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ecad3c274d74..100302ab2ca5 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6075,6 +6075,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, direction, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Thu Sep 19 13:04:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bLt1rmzz5WYGW; Thu, 19 Sep 2024 13:04: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 4X8bLt0g7Yz4t2t; Thu, 19 Sep 2024 13:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wNE4k91HyvhHZ+uIeWliDpNw/eeHqzRB1EC+7yp+Grs=; b=N4diy85nQY/9/pj3uYGw/fqFmD7862mScVmHh9lzCllDJW8K8bUSYDxhw3U+maoaXbP/Nt +c3FAXRE00q03909EgUESMBngz5XX8vMT0qqoYVGYkw/6l3WMLrizWx3NdIFbwGDtQ3BKi ivUEBjXxlbDQR18r/C6s8Xc8mu2AhQQsjW0+GNvhDJcSa84Z01viy5VlRbeAkHYNP8AAl3 7xjuws2sXzGVes7SSCb5WbJd6vesLTvzj1xp4Dg0C+7csGu+zVwxaMdqLqZvcJ8czK0MhZ Pw1ogxyUkBLRfAB7z9j7ZWkJ/aKO1omCoft7plZ1QwkckVCweNnZVnd6PkKrlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726751046; a=rsa-sha256; cv=none; b=FYyA+MykZhhmeRyiumWOaO9Qhaz61u3+sIcrb+a/QwYO7P7sh4q456+e7EqPKF9PRUGkIR f9TrtidydJStdrSIt+qvDBG+/NJU5WX2ge/lf2KRK267heEPzEa3/Amm957enmX8DMCYEw KTGTSI/Psvw5OGLVH2WdBPmf/kmb5ZWaUKJrLq1Dljd6zn66QxcfeFK/lKjO93HAiLQ/95 GEn93pD1F6pt64M58+96hE0o2hgK/zVLaMvz38Wop246jEFgp7xMdM+d8BOtwY2MfqpOqu yXts/GF19rNr09plwlK+98188KaIkf75ywkjt/CST8ibhVMQm66g12jb6zZs8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726751046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wNE4k91HyvhHZ+uIeWliDpNw/eeHqzRB1EC+7yp+Grs=; b=czodg9kOOaD685udVa1qKhixWa15Hbqw11PGeZNMGWz4GUt2m7H3WIGY5u11f5Lz1j0tpQ 8HR3a8r5iAavwU3ar7xeJhgL1L68XwUfJFmH6PZE4xnpyrdgQ+uSfnYU9VtdUiluh97nU+ ZmbK2btjZ8BvJo/M9huENPMusgN1+oy/c/BaZRph6Lcw80iRphFgOu4uqhKaWzkBV/0sCi 1mLu9eMOP4mutucSFJ9Nj0TWK0XQHKoEtQFzS0Ty4p76/KLbDeMVNYx/+DxjkQhqXQOv3P Pqu6wCxR169D599Ct2yoYBMDVCzqyKvlODfW9WukAHtpk3gpJv045O4QKQ7iXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bLt0HDTz16Jb; Thu, 19 Sep 2024 13:04: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 48JD45P7001129; Thu, 19 Sep 2024 13:04:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JD45Cj001126; Thu, 19 Sep 2024 13:04:05 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:04:05 GMT Message-Id: <202409191304.48JD45Cj001126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ea9257bcd0e1 - releng/13.3 - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: ea9257bcd0e1ae178fa4266017bd1db7dae4e780 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ea9257bcd0e1ae178fa4266017bd1db7dae4e780 commit ea9257bcd0e1ae178fa4266017bd1db7dae4e780 Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Mark Johnston CommitDate: 2024-09-19 13:01:45 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. Approved by: so Security: FreeBSD-EN-24:16.pf MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0578fe492284ded4745167060be794032e6e22f0) (cherry picked from commit d6e5f8643d37e925aa51fc8224cfc05aba0813f7) --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b3b8074cbe17..0f2ad39fec94 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -330,8 +330,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 100302ab2ca5..27918a6fd909 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6089,6 +6089,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6141,15 +6143,16 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -6556,8 +6559,10 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6612,16 +6617,17 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Thu Sep 19 13:30:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bx71Rj6z5WcB3; Thu, 19 Sep 2024 13:30: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 4X8bx70xHZz463V; Thu, 19 Sep 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WSM9ty4emSQjATayp1mi8OjbMVTe8iexLYo/9TUxNDc=; b=QfRx4yGe7EW8gvMctnPZMol3/zSLvgE4yOFLhAmn1vJLn+dTRu5AkecfpyZrRr9l5/64JF 8o5VI9ug2L8gCnmnpgDXcenP4zo7ylZIppGjVjcg3gOplpoX9fY18iExyhAsqmDezJ775k C3/IOmSEZ99AzY+TyD1Z0anWjdLkrbomnkUdNfh3HMWzM72iOLXGzCvJl+TAd/Gcf5WNTC B8MXbLRF7Cv4mqvGV4xHtAzB6jw53/PSOyA9ibPAvHvaHC0b16dttnqOS5ZMKnxroHHXGe FODsJtKnxUXYLAk2qU8HX3dikPy0NRUCnrckRZvo+bbAy3obodkqA5nKx+wyzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752619; a=rsa-sha256; cv=none; b=VhOYEKwKV15mbO2V5MrUYvrr0flVFFW8hy8LmRF16LRQ/gqjr8Is2F2dBLW4W19hhv2Koa m067keR1/DxtzmO0kD8jbpNNLWltrbNtOx+aH6RaCixWbhbEqGuzrh/7YS+6iGcXMd6sCx d72ytHxCtTf3XA4hMnHr6aN8kg/NajLkBv8bjpd6WbKf6qnREbUMlt/cDhi4qzjRK6etgl yeDMNEssK+bAo05h5XozjvyheRVAXF5BJY+83+0fnzbGSWk43JW82Xc4BXUfX6nW7AKrsi MH7Ns3CynwG3LAMRfOnDXBeI+DfY8y1V4VnVFwNKFiwJBp8om9ErwbHu5ubY/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=1726752619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WSM9ty4emSQjATayp1mi8OjbMVTe8iexLYo/9TUxNDc=; b=pU+txcfIAK/vkhz5qbjQ4rO3Ksm7wzG4iYdgGXx388WwGn8pDGp3QIPB4Nj3VnrM4Q/ZbE orGVM/ETnKyrxn8TNgdrXddPijORlIBZz6xF3AX1HeeV3kZKc2/TbZzvSNqh8n2H6SQOGf Vi0sNl8upso7YOjjxCiNZ3hbdhvmKALBvec9nUjaJb/Wj5r39kKq14zIEV/Vb6Y5yo/8fY TJryJnMw1LWA2FJpxQnl2gv1gmqY68omnfi/qSFCbmsCvCRRX+GwC4fkw2AQNWmdWRTZo+ Scig8/KTgWgbmG5KmWwA1jMCPt954/pC/kGmFQHWKA+iwuyWUvD08va4hu4AIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bx706Vjz16sS; Thu, 19 Sep 2024 13:30: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 48JDUInO045428; Thu, 19 Sep 2024 13:30:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDUI1Y045425; Thu, 19 Sep 2024 13:30:18 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:30:18 GMT Message-Id: <202409191330.48JDUI1Y045425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 3c6c0dcb5acb - releng/14.1 - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 3c6c0dcb5acbc4c98633006322281c592e4e4e24 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6c0dcb5acbc4c98633006322281c592e4e4e24 commit 3c6c0dcb5acbc4c98633006322281c592e4e4e24 Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:07:18 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Approved by: so Security: FreeBSD-SA-24:15.bhyve Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 (cherry picked from commit e72d86ad9c62c8054d7977a71f08e68ef755c132) (cherry picked from commit 419da61f8203ac475550ae4b0971dbef10f811f2) --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 791c56a45f0b..77b17d525bdd 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -580,7 +580,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -853,7 +853,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -889,6 +892,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -897,6 +908,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -957,8 +972,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1019,6 +1046,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1032,6 +1067,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1138,11 +1177,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1227,6 +1274,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1325,8 +1380,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1555,8 +1622,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 13:30:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bx824Nrz5WcM1; Thu, 19 Sep 2024 13:30: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 4X8bx81CjPz45sG; Thu, 19 Sep 2024 13:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgSmvRIlMb9Ikw9Sv+Vn3nCj6GKOCL+W7wjovrEr9Qk=; b=Vg1ewrVg5SLqGLR1ogb4QgXOmdN7c6QJh3awK1M5/+pAYMRcGfoSlc5PjSYTmZCfVYVIKs GELtxljZaOTHd1NOSL4lkxaupD89fiD909s8hT90WsO3y3B08K40GzHx0fxOrL7RQ407sd tAD3jIx+pKRcpOcMxgxdlMCnNrN8jZ3DU1yUthUMqi+m9xqZrThu5C3jvrtxCbtyAylH5P IvUrdncnVCjOg5JaRcgz+/mMnGONYrcFyCNIMqnM3MNWgQJxBOsVx58ZZlXox93932sNRr bji5UjjOUluNQIbSmM+lluwAI7JgErs8qrqBb3+X3FN4veipqp4ubdv/0/ILsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752620; a=rsa-sha256; cv=none; b=Ye7eEhGfbhd3/CfslyPGwaTn2nBsVQLAu1ctRI5sximRqb4/mgBOe3voHb4gQ1FU0v7yjn vUZYYdCcTAepeirKS20US2oLTAAXNvzovdnbojdjrfWq+qjLUIole22cy7+CR/oNoQCBvv mQE3tvIe+TDw2KPM66se7xOKiT19TBh3nQxJ3GQrjwiS0annkj4arQlTfCQ/ZjRVb9lluD q71EG48BUHmGeorlJykmJ3S/AJKR6W7hFE7Pv+N76Cg2A9SvUPczNbs12ImyQtbeUHsIxz evlJdp+qfnnCllfg7EeM7K++Ie6glY83Gz4qG4yNx8Rr1gjKwXILmFGM97fJNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgSmvRIlMb9Ikw9Sv+Vn3nCj6GKOCL+W7wjovrEr9Qk=; b=bPcI96H730XswnD4OX4b3C3DhXhk/xY2o3mpowO0mG/NbtQpsJbt5n5wUBaJLZuhnvh8Oz c8gjyzVNytxU9u9yzAREAR2sG2Jf6f2mHaLJRTikjO9IvneEsNkN0yej5ldJMRVPiR6X6t HB9X9gWqjB4sO2le9yhEj4ZtSMqQvJaxjxxP0ABl0xIThi7cAVPO1i1ZsQHHZjNRH0rvXc Yi+IHjsd+S4J/UBUauzpXT0JYZaE/Ck+l2fwX6tFvHfa28SHkFZslFlIFS/ECBgT8YLvrw VC9BdtRciE6dynadC1sTZW1twFjNRvZF2p2XY9BKxVObvXY9pCR5pXN5xxhkXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bx80qG3z16yp; Thu, 19 Sep 2024 13:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JDUKe6045479; Thu, 19 Sep 2024 13:30:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDUKXZ045476; Thu, 19 Sep 2024 13:30:20 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:30:20 GMT Message-Id: <202409191330.48JDUKXZ045476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f67468e6e5e2 - releng/14.1 - libnv: correct the calculation of the structure's size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: f67468e6e5e27661e18561a3bcff9448d055b95e Auto-Submitted: auto-generated The branch releng/14.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f67468e6e5e27661e18561a3bcff9448d055b95e commit f67468e6e5e27661e18561a3bcff9448d055b95e Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:10:29 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski Approved by: so Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 64078b10973e..92d6e655876a 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1029,7 +1029,7 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { - if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) { ERRNO_SET(EINVAL); return (false); } From nobody Thu Sep 19 13:30:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bx93Qh6z5WcM5; Thu, 19 Sep 2024 13:30: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 4X8bx91nrvz466B; Thu, 19 Sep 2024 13:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QN/Ld1bgEaON9KepwiChclYAFuZGZFgygMdC2pQ7k6E=; b=E7B61E84/U4w+JKZgqSGVTKmzwTI8BOvLios3lzrUAauDZevLU8iaKtWEj3T6HbttL0mjG dDZZwJD/CjU4OKnePYVGMQ0Kv9TCnM4rjQ33p1ZSscZqatirJHscbqcZt+2JDVDo1/WHrz 7iIA/Uau5+mMjx6AqpdleyTAy4unlxFk66Rc8P/JwacKo8c3qEiRSF6HIgibKEq3qyny+d RGSow5JW7+MyOVrvuZBKRxSqq9zeh19y7z7AdGkAjYRwts473FlAW1/L1ayN2dXMY5pB+O siU9AirG5krfBjHjuFQWhqm3oF/5RSkXlU1EqTq/nFGoV4Zs+5cFgZi1sRYtOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752621; a=rsa-sha256; cv=none; b=wKD5FJ0EzFM4+ANnPzrDZcystcBoRo7r/rqLhxf8v94Ji04PMH57IWPsEaTG0MxBbhyuuZ k2WatHfvIGqQ1gEW0V6tW8xEojA484dZxHxK1AdTlawDyltI5jARVVs04VH9ESH9OVkxf7 tv2aKyG1e6WDeDo7zGDOdO0RNZFiNcFScfgZaa5eM89fSssgtkxxMXzNc6xfIy8nVfn5J0 OOxrgyIIamdl/H4UkEO7kXUTc8bnW3mOJlY4uP9vFMaEhbzynKcxhfKc5FXRBSND/YkEVi iTOma6kF7ssKROiMCVB1t8Lza+F1pJVnQdtGxFO1qCgUqZElmBDuNrCH5jM2dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QN/Ld1bgEaON9KepwiChclYAFuZGZFgygMdC2pQ7k6E=; b=RlRDqN1czKw62XCZvzyKnaGqruQVXOJHUgvt5DSxXjGgKAG3QoMVeApIQ/WL0qosbiESXN /CJzFgbSSwHC0Zp2hJJMqBHfzMn6Pplx2LhZVfQKRIvtmRKqOdvZj4w2uEQNNy5yq3ui7E jsdNnA3pipBqDFNpDLxX9yivNpO9Hhip4qm9URZIB++t1nRv80CzToZOtVF+GK8C5shYoM DcrqKf/GcXtllbPVHOhEaxpm+RjeevvNyPByJgDmSSLei8PXgjSasgeLkbRUvBUMoDFY/Q hoVR+Iw7DSYmykIwdiVU8rjh38QTOSwsUIaqx17Mj/MSkw/4WYDtKiV18Snjtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bx91Q7dz16bK; Thu, 19 Sep 2024 13:30: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 48JDULuo045532; Thu, 19 Sep 2024 13:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDULS8045529; Thu, 19 Sep 2024 13:30:21 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:30:21 GMT Message-Id: <202409191330.48JDULS8045529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 524a425d30fc - releng/14.1 - Add UPDATING entries and bump revision. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 524a425d30fce3d5e47614db796046830b1f6a83 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=524a425d30fce3d5e47614db796046830b1f6a83 commit 524a425d30fce3d5e47614db796046830b1f6a83 Author: Gordon Tetlow AuthorDate: 2024-09-19 13:18:19 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:18:19 +0000 Add UPDATING entries and bump revision. Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 37ff6f2d53e1..c77a09fdf81b 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,17 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240919: + 14.1-RELEASE-p5 EN-24:16.pf + SA-24:15.bhyve + SA-24:16.libnv + + Fix incorrect ICMPv6 state handling in pf [EN-24:16.pf] + + Fix bhyve(8) out-of-bounds read access via XHCI emulation [SA-24:15.bhyve] + + Fix integer overflow in libnv [SA-24:16.libnv] + 20240904: 14.1-RELEASE-p4 EN-24:15.calendar SA-24:09.libnv diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index fec4520f5fb7..f611c7d0229d 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Sep 19 13:30:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bxc5l0kz5WcMB; Thu, 19 Sep 2024 13:30: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 4X8bxc5JM4z4717; Thu, 19 Sep 2024 13:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zRFbPZLXxTu5LdMOM8t1ksQRVCKGI0Pd1QsviOYLly4=; b=E1CPGgWbn83P3e69sAJID9evwIeIiQmzdKd7fVL+rV1QsqSmsO/rktU6ZLwlXN5fns/YWO R5aCbwGnphPfC1DA9qraZJHE/kta0TUgx21yPUa0PQnPinolbpnUPzQ8JeRs1jm3U6G7uV VlfckjBhek4BvGMGRNkT4VCBU/HhoDtxKsdGqR6cVXpXnL6j2Gl1tKYHhUQtYeBL/fokaO ihsYu+pQ5io3GRlxxUKcEdk6jy4YqObcVdfUqBM+CkdEUCgeF3qtAu3p1k8PMSRg58t/fI d/foE5ZXB6lA280tkH28nRXy/OkbFncuknHmFid2CztmT7PO7ior2pVQh2CLpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752644; a=rsa-sha256; cv=none; b=WwGSAvhnNqIpkKD0Kp5svMfwc9D6o4R63RsIWOUH4uYHUV4DIzYbIvLtSs1NmVdvbVVty4 0mgj0XQXnmGOx8w6q1+ncz5rJgaEdjmlUfN5c6gD3otwdOTEiiGJb1BgXVKQ4LlFQihIPc WbgkeylrRpNnhcgKNuJztnRu9t5F6O4duwE4W7e8v0mwpgvwZfaaX2jhkLioXHo0pIM4md B5FIu7wFVkeqb7sWo8U8KqSR/zj+jul34/6k3RcRHYFEj0L7TtDMmyD2Dm+DCTzvEFxo1y eZkul5ucKIGJneoIJw4y1kdeIsRXVJEVnaZ3A+vsA+Hh9Rn3ZX2jV2+iaubSVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zRFbPZLXxTu5LdMOM8t1ksQRVCKGI0Pd1QsviOYLly4=; b=uv5wOevIDQzf+s3oPJ/pz4UIaroKSkgt1zBqudMdl1xgtI/N4SDw9OpgCMUnj3XCevIHdo dKOcrJeizzx7sEppCahv4I/r3Gt8WKFvd2B4XwDykX45Zem6E31tkcJDE3JAWaCI9jgfTL aIp9k0qSlXQSJtKfxuoF/RggL0C1pq9eDPp3pkq6yh1gRx6Y4eqH7GjafrqsXnimook68/ 18ByqfFrXTDQqsXjmezv3vihersytRfLhYh1vc+wcFRDFCV4VZXJpR0OjuK9Urt6P+Iiz2 c/5C/y5794+BE9EXoeBx0FOyoCM1W0kmncP0QKK3McsFuJjpRuvgQlwdCwZtAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bxc4dXDz16YQ; Thu, 19 Sep 2024 13:30: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 48JDUiSG045730; Thu, 19 Sep 2024 13:30:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDUi5L045727; Thu, 19 Sep 2024 13:30:44 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:30:44 GMT Message-Id: <202409191330.48JDUi5L045727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: ba46f1174972 - releng/14.0 - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: ba46f11749729c8abe1236d5cd72020955b41e93 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=ba46f11749729c8abe1236d5cd72020955b41e93 commit ba46f11749729c8abe1236d5cd72020955b41e93 Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:08:03 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Approved by: so Security: FreeBSD-SA-24:15.bhyve Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 (cherry picked from commit e72d86ad9c62c8054d7977a71f08e68ef755c132) (cherry picked from commit 419da61f8203ac475550ae4b0971dbef10f811f2) --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 3550dc1872ae..9a6d8d5ef120 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -580,7 +580,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -853,7 +853,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -889,6 +892,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -897,6 +908,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -957,8 +972,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1019,6 +1046,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1032,6 +1067,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1138,11 +1177,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1227,6 +1274,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1325,8 +1380,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1555,8 +1622,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 13:30:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bxd6gNfz5WcGr; Thu, 19 Sep 2024 13:30: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 4X8bxd62Tnz46qP; Thu, 19 Sep 2024 13:30:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7IZWHVEjeniWcrmiX/l/pspOW7BY4TmokL8JAq1txx4=; b=T91jyCqn2c7l8JQxIuK49nU15kzUAx5xYbzjXiz0rJ5cvrNapZZsc4D0vTENKLdGceUkS9 2ZmoierTsxDcJOM9OstkU8oqOADopjn0naqlv9TjykzrWcYc+jNDBvcQbpngDPWpr6e+Do WKgxJFgSqbHcejDgv00MsThS1d0rv/0d/gWst/GotD0+fQzBu8c6f2jmrmOcEVWoN8Xz1j RvgTPH5BWamwC7u/fMNLLZCIC+URT1xlnjLzp2WwRTc2Pj5NvO8IK+aM5I8FoxcMG33uT5 aQqjvo6PT0iIUyJSTZ0nzfdhsE0t1Z0hcavNQIqZDxLZHQLS4zTPG4gqov/RZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752645; a=rsa-sha256; cv=none; b=e9KbTdeyeP/UszxbVU6Me+mMmVZICp5XuW6+sVQExA+CSL0UU241DP6LdVJ63r+4BB6DoZ Vf8sNvg3XxHnlXyCXBpSik7dWGs8MJgHxUpswPt6rsa5a+PZjO681erJFbxUT2wcutHFgl LAw6w2SRtllNOxFova/AKFtw991IQx22AuQ1bX4mtD1MNfb6vRESPmyt6HQJ5zIOblmHC9 o8MxHIP/toN4pceeo4Lvs7J4kuiAckYdGJ+nuWneGgHGrHZBw/GTaR7W9e7Gkt2uFXMRPZ LgN3bJIOpU4KGNO5eXGAsY6zRqIrHPRfQLwAACRzTLx/N1bpu1SuCY4e+16mNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7IZWHVEjeniWcrmiX/l/pspOW7BY4TmokL8JAq1txx4=; b=U1Xk615L2IwztcHj8PzEVU3CJIwdPh1fOs7mxI6ABISfNfukmpkj0s+F+NKFBEyjlXw+kG t5q61I3MuCRTWG2dOnAJcEfgTUWkbo2NuLm4l7rNHaiaKztTv61/Bls5WfwFpKnuNAvXvD pCT01l3JEb/LLT1bNibK1hqE285epMlST1jaMVsVYHxt/7qXkXFiwA8rgCqtKTT3huXhR9 rR4PjMWB9dtqyyt85L6eMwpckd53ys0mTvUkDA5LfDqSvN1DzURPsXceWaGFJi/Ypwu6Uu Dz1xJHYBD9EqG5AEnq1BIAxml9mFB5+GTLssmSYNx0fCxZlMhMjYt3hWZYsWWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bxd5fY8z178Z; Thu, 19 Sep 2024 13:30: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 48JDUjbE045786; Thu, 19 Sep 2024 13:30:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDUj74045783; Thu, 19 Sep 2024 13:30:45 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:30:45 GMT Message-Id: <202409191330.48JDUj74045783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: e9d57be06e23 - releng/14.0 - libnv: correct the calculation of the structure's size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: e9d57be06e23685c4f7e5045dd4959cb735f7dda Auto-Submitted: auto-generated The branch releng/14.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=e9d57be06e23685c4f7e5045dd4959cb735f7dda commit e9d57be06e23685c4f7e5045dd4959cb735f7dda Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:11:22 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski Approved by: so Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 64078b10973e..92d6e655876a 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1029,7 +1029,7 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { - if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) { ERRNO_SET(EINVAL); return (false); } From nobody Thu Sep 19 13:30:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8bxg4CPFz5WcMG; Thu, 19 Sep 2024 13:30: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 4X8bxf6pnrz46sj; Thu, 19 Sep 2024 13:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bi669PwAdJl70Xrw4bvoZM5GTRYXVz+xXMJ+P55Ap+g=; b=d9dXeapcJOMxgDr72ZYsDdo5Fj6Odnex0yN1ckXvzC+XLEgWcXs7DAS3eijarPiG8e4ux2 liGa99U/QUl5j4AmRPd3X9gtQ3sTyBEh8ipGm9x4+dNzy2VV2w7HTQR4AW+b+CWEhByh4u sGDw6Xx5O65+Y0t4fa5hDb/PWBg4fiUHc+SI+AGRmb1M35tFv0NCcU4GGtB/UaMtqEe+if 0W2bwPwuQHpffRJmdD0S90Mx/Hg74rvPwXl+0Zn5K/YSGr7MDxcP8T7gfHgfe1CIlGk6qK r1HlrvEJbA26Hm9msfVneC5xSo5ahWrHJhOCr+BlvTtWvAx7pOwLREsKWwp3gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752647; a=rsa-sha256; cv=none; b=DWQLNSHi1KgBDD+AhpJKqQQ6bh6SkSBOBakjis7PbtFixYrrbMxysj4Qxne5cTzs7y0V6L mlKYc7Afx9beZFhXEbE9CB0gD/W6KvrYeI78muvML0eA4XvAwXvDGQp9vJrxGQ2EESQs7G NvxgXot+96inKKV4uP+chli1oybnJ8815Ra1e1dzh5osCXqsaUuq8B9hqE9oYJV5c4GtwJ bpv+0HcLO/BuXrIA1mw2C6N9yhVBQ3BtO6YRcQlKGl7xHoSPgJY2A5ZMTtwn32I6GhzabN cfXxHLW7hIXXEVK7e4WifKuYCngkTQrPyNlIgfPpb/MQEXAcrrJMpAH/CmGeoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bi669PwAdJl70Xrw4bvoZM5GTRYXVz+xXMJ+P55Ap+g=; b=Bp/2xxIpWZU9vFMQL5eA3HEyh7TwQnerPgJA1ToRLBN4/6Rpd6QsC+OtFqgSpqT1iwEmCX 3dgNJmxu0yQDWjexH1JVxvyH3wh7gsxJMPMPTQ6VkOXmD4ZzGkxohqHr/58k8SwDBbMuUf dKuPI9+RCAN7vXxqns7rspVqBrXW05xzo1lDB5CNkMGibNSgaAv7s5x30bcO7+9S0PHxHy uD/pnyn/50Xc53ookYtivLrw2s12LW6FxvJLJuPUm8tkPPnOS3TMGWyOp8zoA0iiE7JCgn vx9l7VXq9w1ZcTRinKc5CONsDgsSXco7DHRguKVaepH02xwUB3eBLjNrMZhoTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8bxf6PBYz16n4; Thu, 19 Sep 2024 13:30: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 48JDUk40045831; Thu, 19 Sep 2024 13:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDUkMN045828; Thu, 19 Sep 2024 13:30:46 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:30:46 GMT Message-Id: <202409191330.48JDUkMN045828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: f10e328cb192 - releng/14.0 - Add UPDATING entries and bump revision. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: f10e328cb1921d2f5f0253565f38e0daa667db69 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=f10e328cb1921d2f5f0253565f38e0daa667db69 commit f10e328cb1921d2f5f0253565f38e0daa667db69 Author: Gordon Tetlow AuthorDate: 2024-09-19 13:18:39 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:18:39 +0000 Add UPDATING entries and bump revision. Approved by: so --- UPDATING | 13 ++++++++++++- sys/conf/newvers.sh | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 89961db5fabb..b46752e16669 100644 --- a/UPDATING +++ b/UPDATING @@ -12,8 +12,19 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240919: + 14.0-RELEASE-p10 EN-24:16.pf + SA-24:15.bhyve + SA-24:16.libnv + + Fix incorrect ICMPv6 state handling in pf [EN-24:16.pf] + + Fix bhyve(8) out-of-bounds read access via XHCI emulation [SA-24:15.bhyve] + + Fix integer overflow in libnv [SA-24:16.libnv] + 20240904: - 14.2-RELEASE-p10 EN-24:15.calendar + 14.0-RELEASE-p10 EN-24:15.calendar SA-24:09.libnv SA-24:10.bhyve SA-24:11.ctl diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 3fde4ce763f6..0cf05e707063 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.0" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Sep 19 13:35:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8c2f6Q95z5Wcj1; Thu, 19 Sep 2024 13:35: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 4X8c2f4Fs8z48BG; Thu, 19 Sep 2024 13:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UAX9TZyIQTUSGI2kdofMvbZBztqCx80xDYcfjv7CpFY=; b=R04sM+LwAp3wE3GxglMAAC7hFL7FBYeblXR1VvM0QIJsqPvdd+PelKxLHjYNhynaq9VEZA M1XOjv6qvwBYzHfpbDYvMLYBKmkv7STOtD+UGIDwblYOhQ/crLGmhcsmTf77EMLuKT76Rh QB5JT2L0c+g8cHz2sZAHa9UQ/Ecl8OL/FmnHiILOhPjJPo2a4PK+zSzmigqc6ems6Za0jr yib8Vfq975wvQ6KLPiE7qW0AZsU+as1krB6x6ZIqVPvvQNgQ6Jqq4RdenhUwsuTLkVRSFD JUVtOQD4PbFbK2GEHgLLI6pzpZ91cz1+bwTd1kagEUOoeaDp0nyy4kEPkrI3Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752906; a=rsa-sha256; cv=none; b=gfYCPV4bzESDUKKGEHTGytomBOmWWpJHtIyM848GJxs8qeOOD7ue0BiCLxtvk3igwPy+kK +nkWoW9EB+dlFLZ17QT4GkEKWV03iE96KDeQOSw96SPLuGTpTzjPB+vx/48/E8JPIkrDAn ejIokLZxSDOVj5F3D2jocfGDAnZQTnwg5k7egEsY6mL04L2nxnv1cA39UJOnS0xgScx2ji mICTXbxWDmK1JXuwiab9MnB09i6vRDxa4yJePyzfrcDv3oX7f/wjaBFeUS0IXRHiBlEVzz 2k9HRZc4AEQdB7IBs9yrKqzONYSQlM7EFcXxnsWetLetemszAc4hP4jSTnwqdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UAX9TZyIQTUSGI2kdofMvbZBztqCx80xDYcfjv7CpFY=; b=Q0eRQsEp59r9K3Mxsje3ulWuy+sdHGbaGGCmZytWTjeAIcxu+/MQtlo6wKyqg/5T3M72j2 avXZXIhf/jEMIiQ/wG/EOl4r9JvUc7wW+30VTEzvsqLMxSJFxeBlubVAkZVXHIXmLAAYDD LeljPxPpqyC3hD26UGoW1sISa1LPaIhFfJAN5jwKZT9gokkh7wGQyvSwEZ2UDej4VgGN9O oDd9uSyhvDoqka08naTSYaaXERYbQ7jWbL3AabCezWygCJ66lyZMWvf5gkyEfvtPvlocIQ 1mMFP31RwtJH+u4YiB8j/dSdFmj8c7wvpEz5Aidrhlizm5hl3uaO/htSzLRw7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8c2f3sCCz170b; Thu, 19 Sep 2024 13:35: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 48JDZ6QL053559; Thu, 19 Sep 2024 13:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZ6Uv053556; Thu, 19 Sep 2024 13:35:06 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:06 GMT Message-Id: <202409191335.48JDZ6Uv053556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 5f035df278cc - releng/13.4 - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 5f035df278ccb4ac0b87ad38eb5dc20b8dfbf48e Auto-Submitted: auto-generated The branch releng/13.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=5f035df278ccb4ac0b87ad38eb5dc20b8dfbf48e commit 5f035df278ccb4ac0b87ad38eb5dc20b8dfbf48e Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:33:55 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Approved by: so Approved by: re (cperciva) Security: FreeBSD-SA-24:15.bhyve Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 (cherry picked from commit e72d86ad9c62c8054d7977a71f08e68ef755c132) (cherry picked from commit 419da61f8203ac475550ae4b0971dbef10f811f2) (cherry picked from commit 2abd2ad648994e8444f479e54773a36311f522e5) --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 93161affd732..06c71a6643a6 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -579,7 +579,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -852,7 +852,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -888,6 +891,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -896,6 +907,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -956,8 +971,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1018,6 +1045,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1031,6 +1066,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1137,11 +1176,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1226,6 +1273,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1324,8 +1379,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1554,8 +1621,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 13:35:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8c2h02CGz5Wcqm; Thu, 19 Sep 2024 13:35: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 4X8c2g5DTjz483x; Thu, 19 Sep 2024 13:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8cqpVVmNlFLG2SS0BGmU0q9n8mKiHNc5ZTTk82VFWX0=; b=g7bJAHEj6m7p+5gZWrOIrrxuNDeAxXlop5I5JDY0Z6dUwg5TcNes/OH7tpEJUgl593s6ES J7O1RA8IbPWVOWXpNipkzXBRbrUDb6VQZ1FoHqWKeeZNQ6h/O1cbSL+TNay9RdUwJHMBCp mAflXQGED9vWAbUAq2HdBw1mMwN+byqUbDJ8JVHXKr3yTNTqWTEOl2+Iq/sU198JsbRPlG 71cqcxeVOPVZQepGjbiZ1OucYM8UrBZ+4m3RHnzH55sbIaht1u61PkZE3MyJ+n7acUTz8h NeF6gN1sTuCrZJxGOodrdJIPxMrFjZrGv1BjS1EPioRHnjN6xssspRcFnsDtUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752907; a=rsa-sha256; cv=none; b=wEZY2rh3+k+E4/IAUyda+X3O5aakCmEszmDR3HQK2JTHHGs1so2mVyLXm6OzEuAkaRirtp GgFb1UUhnPTDdss5qUvfVLDAi2hkCeh2GTsSc79gn+mysu3OUCz+XjIVp89fdmJKuxbAO3 NttHQKnIgZJf8bTsgzve66C+cb6cDelnhWdZq9PQ1RYq+K93W1HiXsDFI7aNPJM/I4R4g7 yqv0MCRKBFJDjcRWBm/weAQKn8oKBw+Vs5JO434k7bOs7S1CX6keM7DUrtCleRt6zODgkq CWtIfVYaXVY2Rrpae+J4klOVlIN3J1h0xF0W8iNLMi+D/O2Xy9J93yVrq2j3Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8cqpVVmNlFLG2SS0BGmU0q9n8mKiHNc5ZTTk82VFWX0=; b=mYEzdpj3J8vh1DA/OOQrNKtvotBn/4IDxkJo6eqU/eRj3sTlIsds22I0T6f1Z286uH0zl5 bwim5Rt8BENkAOZ0p1f5Sqa6/sZAaizJeRTGreqVwTHXGKABRkiyjs9vqvLBfgy8GAmI1v uURlwMz7mS0hPexrIILeYPwliKQYAcxvdZei6NqYNOqaja0FECB0s/AABYZLKb2CMIQO7b MEKszg5+CyyzFv8T0/vIY9b/BbiRZP/9HKCf73A/N7dLuwq3rozYuSkG3b8iHO/2TN7bWG E/PrnlehvJxDaqGsnNxJ/NmbgHzEM62B/RBxWx0ankTXH0STHPdkuIORgKSfFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8c2g4qYWz170c; Thu, 19 Sep 2024 13:35: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 48JDZ76D053610; Thu, 19 Sep 2024 13:35:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZ7cq053607; Thu, 19 Sep 2024 13:35:07 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:07 GMT Message-Id: <202409191335.48JDZ7cq053607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 2cffa6354d9f - releng/13.4 - libnv: correct the calculation of the structure's size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 2cffa6354d9f9180b865a5bc210ab78f9f8ec00b Auto-Submitted: auto-generated The branch releng/13.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=2cffa6354d9f9180b865a5bc210ab78f9f8ec00b commit 2cffa6354d9f9180b865a5bc210ab78f9f8ec00b Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:34:07 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski Approved by: so Approved by: re (cperciva) Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) (cherry picked from commit d84fced6b468a637b5a47bad747730fa344d68d8) --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index e399d610a7ce..6934da0df00a 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1029,7 +1029,7 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { - if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) { ERRNO_SET(EINVAL); return (false); } From nobody Thu Sep 19 13:35:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8c2j1XNTz5Wd3Y; Thu, 19 Sep 2024 13:35: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 4X8c2h6sZrz47rv; Thu, 19 Sep 2024 13:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jrlutHng9IgeLlw92X9ofNeo59nWbMOjOi+P84XwtI=; b=Ang/HTC4yKnx4zDIYpaMceeZgg5SP46YRKi502IfeuST+00u+fM+0u0jlo7vWKn8t3NOn5 X1pEDdXhe9ooDT/hNESzmO0myWuXud/jBjTprONMkEoFfyho+oSnps3fYik+gvXwEd4/99 t9GzDd/0QR/e0orHECVkJsL1nfMLWp1bCivHPcIl+bC9M7wqgegHLzP3CEbBwL9T3HkhIU aJYyURcN0g5yf6K+6IW/SI+5Rk5PYeTfsmvqPtO72leLY0YYtgd7fS96bcqlia5hHv7sc8 oO7wtMUladIea4KB/qo3rjh8STB+jbkocv27nykW9NsDOmhzdQSH9VjHNMs/qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752909; a=rsa-sha256; cv=none; b=OA1L3i7dponNqsNhuaaWeVk3eI5jwaZou5Uos26ObpDfze6Z3K4SwZzz0KwEDa/YrJv1G2 Vfg/8ZSiDmR/0PNxTMS3mi5W6FWuyEslOeqs/74eRXbfseh0waGFQeHSzX5fmlJBEtmavD X/vRfCKqGLEqvjmDSFKJMmCk7LcWERjUFTU1MYoCMdLInuLQi+Q2b11iR2y3i9Mj/ZyPK+ Wh7M9NcCUzMkvuw3+LcKmqUNTaOpf2993zVEyz2QVlxuW6wEmHSwOQQfqfTQxxC2+RUyBo X7qh+6WvLf1MuyrE0OwVNyY21QjDM7phmWA9zdeVseCoi5D3xx7OI5k1Y7zuVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jrlutHng9IgeLlw92X9ofNeo59nWbMOjOi+P84XwtI=; b=FMC9PyzIen6YnoZVOP1mq9vNAyVwkR2NiDiSXp6xdWHh3orVjnfhwsH/0Ulf44xy0ZPac8 lYn5mWKf8sYmiXwF2CkaCoaVoZhxY3k4jXu3xiSMHuQl9qr+TW4GHafCZ/z4lsLmVuNHRO eE6stp/sCQmLpVgaLvFSqKhUK7DERl7UuU5TzOfvlAtY7J0fEAU12NLyG/GuossyCrpZ0h xuH0ktaHz5S3nIc6MWya8bPNqzDv74A+fgrW5H1+8gaMa9MSWPdtzlcXbVFpeffzjlJKOs hFoOBiQq1YUa58j9J7/MwU2+O/NxTIDSENGIOy/1z37O8p6WeSRuh23ozKxt1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8c2h5qYzz178F; Thu, 19 Sep 2024 13:35: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 48JDZ82P053664; Thu, 19 Sep 2024 13:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZ8cj053661; Thu, 19 Sep 2024 13:35:08 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:08 GMT Message-Id: <202409191335.48JDZ8cj053661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: bc3877972ebd - releng/13.4 - Add UPDATING entries and bump revision. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/13.4 X-Git-Reftype: branch X-Git-Commit: bc3877972ebd569804a7843535fcf18b676ea1ec Auto-Submitted: auto-generated The branch releng/13.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=bc3877972ebd569804a7843535fcf18b676ea1ec commit bc3877972ebd569804a7843535fcf18b676ea1ec Author: Gordon Tetlow AuthorDate: 2024-09-19 13:18:55 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:34:16 +0000 Add UPDATING entries and bump revision. Approved by: so Approved by: re (cperciva) --- UPDATING | 8 ++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 3080a1e5b420..df70c7ce5904 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240919: + 13.4-RELEASE-p1 SA-24:15.bhyve + SA-24:16.libnv + + Fix bhyve(8) out-of-bounds read access via XHCI emulation [SA-24:15.bhyve] + + Fix integer overflow in libnv [SA-24:16.libnv] + 20240917: 13.4-RELEASE. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index dd9ff3795158..5d096d99c9aa 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Sep 19 13:35:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8c3F50zgz5Wd7m; Thu, 19 Sep 2024 13:35: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 4X8c3F27jBz49m0; Thu, 19 Sep 2024 13:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bbDql1CZxqYQpUEtFXHeACyKrSI4WD2HyXVpJiKX5xM=; b=daSyV4FeeBFYYScNPfo8VHDr6qgt+MgKVuie1xugwDqYeVU08+3HOy1zIXRfQNk36xXB2s nKCj5s/rmUwfk6816uhFtUHM2eZQlDWbwMtOSK14Jcbl3rgP0/0fViE6L/ldtMHosjOyZU XQfxDyTGVQZT2IG4yZTfvXwk+FNRL3myAMUftZ5IVYHovZxU7XANdWkuHHZpBpxLYeZmel rI8RcfxtTZQNSs+8a31rm89YDI1LLu3jWgerkdI1FoRTOqupsgPn5DrLiBDWBDBc8ix6X5 +vjrPWHmCYl4J4ER8Luh89nJiLz0uUyuq/JkZQlYYXud9BdmHVuaAdBv7VkBXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752937; a=rsa-sha256; cv=none; b=w1GBnSh4UiUgIrlLGJKLHa75X0M6ZKUrccutP8wWb53UIQC7Y4ajOWRyeVvUJMsy9iUzqc 8SZwE4EzL5gOO/j05XuK4Olu236thLr7+iOmWqA/jiw/l+esg5CNMQmzvfdnqvBtPi8aOk ti+buorXPFhGpXMV3gXrYaC0E0/IgvTz4aD0klBPgNXBuSTaHE+/l15/2lk6ez8qbTyI0u zq8qqUACjIA19tAutgu1y4G/EUV7mBF05azwpUxWad3NcpMCLOU4onLc4wb0X20XDOyck5 TNEjQuY19ehESYRFOUO76QC5R0Q9uDPG3bJlnmKygXFYNzFeWmejdwAS3s2qYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bbDql1CZxqYQpUEtFXHeACyKrSI4WD2HyXVpJiKX5xM=; b=cixWk6P2RxdOUlmh/C9zCaK6uG7YF5Y4U89o809BZ07DTDZcQaCI76TPcuutyjgEYtSDxE sktbK+Soi4pN6j4yKgrhI58fxzyOUjYSFluDqUPRg0abX59olLXuJoikNvRnAQtiv0nNwm faPNUPrF0bkwtjNY2MFRPkCUJafM8ftgbP2legYFvbWw+cUgdY5IciipT0a3xJWQJUeMaB gAsGWZt/Ia6UrYDBarV0EZMjNjS8OX1D0oTKfTK+FNIrywqmWg8c9OnIpRjmjP7xQdb5UA L7bpFTAwokQHHDABBOiiwxp85fAirEGFlGyMDpBAwTRKS/5v+OkWaRBTnFh8EQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8c3F1l3Kz16sm; Thu, 19 Sep 2024 13:35: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 48JDZb9E053877; Thu, 19 Sep 2024 13:35:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZbJN053874; Thu, 19 Sep 2024 13:35:37 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:37 GMT Message-Id: <202409191335.48JDZbJN053874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: e7a790dc3ffe - releng/13.3 - bhyve: improve input validation in pci_xhci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: e7a790dc3ffe1f2aa2b40b0d21a6f80be9915679 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=e7a790dc3ffe1f2aa2b40b0d21a6f80be9915679 commit e7a790dc3ffe1f2aa2b40b0d21a6f80be9915679 Author: Pierre Pronchery AuthorDate: 2024-07-17 15:04:23 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:09:47 +0000 bhyve: improve input validation in pci_xhci Several functions did not validate the slot index resulting in OOB read on the heap of the slot device structure which could lead to arbitrary reads/writes and potentially code execution. Reported by: Synacktiv Reviewed by: markj (earlier), jhb Approved by: so Security: FreeBSD-SA-24:15.bhyve Security: CVE-2024-41721 Security: HYP-02 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45996 (cherry picked from commit e72d86ad9c62c8054d7977a71f08e68ef755c132) (cherry picked from commit 419da61f8203ac475550ae4b0971dbef10f811f2) (cherry picked from commit 2abd2ad648994e8444f479e54773a36311f522e5) --- usr.sbin/bhyve/pci_xhci.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 93161affd732..06c71a6643a6 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -579,7 +579,7 @@ pci_xhci_get_dev_ctx(struct pci_xhci_softc *sc, uint32_t slot) uint64_t devctx_addr; struct xhci_dev_ctx *devctx; - assert(slot > 0 && slot <= XHCI_MAX_DEVS); + assert(slot > 0 && slot <= XHCI_MAX_SLOTS); assert(XHCI_SLOTDEV_PTR(sc, slot) != NULL); assert(sc->opregs.dcbaa_p != NULL); @@ -852,7 +852,10 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) if (sc->portregs == NULL) goto done; - if (slot > XHCI_MAX_SLOTS) { + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; goto done; } @@ -888,6 +891,14 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci reset device slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; @@ -896,6 +907,10 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* slot state */ dev_ctx->ctx_slot.dwSctx3 = FIELD_REPLACE( @@ -956,8 +971,20 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: address device, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1018,6 +1045,14 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci config_ep slot %u", slot)); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1031,6 +1066,10 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, dev->hci.hci_address = 0; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } /* number of contexts */ dev_ctx->ctx_slot.dwSctx0 = FIELD_REPLACE( @@ -1137,11 +1176,19 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; - type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); + type = XHCI_TRB_3_TYPE_GET(trb->dwTrb3); + if (type == XHCI_TRB_TYPE_STOP_EP && (trb->dwTrb3 & XHCI_TRB_3_SUSP_EP_BIT) != 0) { /* XXX suspend endpoint for 10ms */ @@ -1226,6 +1273,14 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, cmderr = XHCI_TRB_ERROR_SUCCESS; + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1324,8 +1379,20 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } + if (slot == 0) { + cmderr = XHCI_TRB_ERROR_TRB; + goto done; + } else if (slot > XHCI_MAX_SLOTS) { + cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + goto done; + } + /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); + if (dev_ctx == NULL) { + cmderr = XHCI_TRB_ERROR_PARAMETER; + goto done; + } DPRINTF(("pci_xhci: eval ctx, dev ctx")); DPRINTF((" slot %08x %08x %08x %08x", @@ -1554,8 +1621,9 @@ pci_xhci_xfer_complete(struct pci_xhci_softc *sc, struct usb_data_xfer *xfer, dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); - - assert(dev_ctx != NULL); + if (dev_ctx == NULL) { + return XHCI_TRB_ERROR_PARAMETER; + } ep_ctx = &dev_ctx->ctx_ep[epid]; From nobody Thu Sep 19 13:35:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8c3G3l22z5Wcfl; Thu, 19 Sep 2024 13:35: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 4X8c3G2wHvz49rc; Thu, 19 Sep 2024 13:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4LnjSTVxTKdhAFcvbuWRnkPkfzd3x4WDmV2+puzy+s=; b=xN/EIfDiJxwDMPl4QeMWSssQUTmAR3qYqzHwe8odUQkgjAXapduAE2+w16MWQmjDgP9rQi i1DoFKP5uhJzcYNx/82wnswCwwJcmR5mrLcrlHIZoRD8zRnarw6rtTBdYopbfH8Zw7TuC7 I3cKodotkZHnzR9cAuua8DydjpMS3pseO0Cl8mcSDtCEKfAz9YZ7b/wOjqsXQdVJmX4eSE oeMALzP9NUgefyuzeHmNrN3IhtqlpcASa2Iw9124aOmu/R9Q0Gv1QvFUMt3G+IpFSxj8tZ 54e71PjPRnw/7Xr+f3mHxwhYhIjqxj2qaE8x8woqHV8JGMnCXAC26r42hlBnuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752938; a=rsa-sha256; cv=none; b=ekqpOBhd2MC2FgD/AaUmO9E11f4GbaJ4qBggHfrhEvCR4SU6QZMli1c6ya6689eVKjFBJY qIvlfu7jwxOba42XLRmwo4C+z49I2v55JRsY1FKSGi/a9/+U3egwuSdkBsFIa2Ou9fXrQX Pm/IdFjScl6ZSxrFpoLaFadagLd9RUGIi/WLfqjxj9hhMHbKFzp6LhLGmooAYAc0FNzWRa QxbQAWhGTRlUehlYwZrbm8bxemtqpK2ARopcAxbNpxHHoTdnqb9iwVYwDZxWuvE7zbsxYw AQh8DJvgI7c0dO3KenpCdMXPjGTDi1yHIqhUSIUL1gt/pnzKiEOkWzaz6li/XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4LnjSTVxTKdhAFcvbuWRnkPkfzd3x4WDmV2+puzy+s=; b=QUq0OeRuJi4oXnGB1jQd4jqTwc39c2eHMJ3SxtM0b1IiYbNV0fyBIkZ9YrwQpAYx4KR8gs rM4pdS6XJ6PAfQSNtWzkbVImYRAVbRANEbunQVftCRntNOEG7Mz0phBiwN9iFvKonbIC9R wJyDf8DttYpmwQhUV48D7HGMHeMiimUFcQcQz/VPjlWQ/XzUoTQG2lHwgczVOjq+nAgQ9W HLBbHl8jQuPiVdl7Q65tQGUYpkWzms1bQyH1RgTIL/LuKqNk2dxeSbT8FIBrN9i+gchrS4 ythX1b+R9JhSjrMmcpv/lLa3avNkqf5FYUG+U6dxZq7s1sIKlGMzwQUfVu9Y6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8c3G2X37z170d; Thu, 19 Sep 2024 13:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JDZcxt053931; Thu, 19 Sep 2024 13:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZcmL053928; Thu, 19 Sep 2024 13:35:38 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:38 GMT Message-Id: <202409191335.48JDZcmL053928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 417e81a40091 - releng/13.3 - libnv: correct the calculation of the structure's size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 417e81a40091f7744c55139bfcad093c75426229 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=417e81a40091f7744c55139bfcad093c75426229 commit 417e81a40091f7744c55139bfcad093c75426229 Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:12:37 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski Approved by: so Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) (cherry picked from commit d84fced6b468a637b5a47bad747730fa344d68d8) --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index e399d610a7ce..6934da0df00a 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1029,7 +1029,7 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { - if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) { ERRNO_SET(EINVAL); return (false); } From nobody Thu Sep 19 13:35:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8c3J0DjHz5WcpZ; Thu, 19 Sep 2024 13:35: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 4X8c3H4Cbnz49pD; Thu, 19 Sep 2024 13:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t88yxeL1xUotzXE59NVWm+EO0Z8/LVFPNFKCmX++NtI=; b=MatkMs5+m1wmGbZXd1ZXi4cvwRsHGY5EvHjllyvXNJHq5fabFrJTjsiqKctYSIqGe1tpjB IfzZgljJ5pZugQshORCWf3avTCdA+svZpZA4Y8UnYQtIw1Cs4eqFrCl/HsLCDp8CzLKN4S RM6cG63+GBN0CXDCEyJGRJyLQDaoiyoH8hN4kSiKhWiEH2r1GWcIPAgqEq6gm8HCG0rlBE 9FNm9WArPVruHTXCO0jwwAonnHdQscJUJtJhvEP3UeM4JSIE5mnfVF3e7EN4mfsvD4ubmI mb8/FwKT72MICqtw1qXuz4Fubx4NwRDZ4AIefy7Gyee3qGTc2jZFB1uBCgUCAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752939; a=rsa-sha256; cv=none; b=F3VTtTcZQ/PZ8AumssnUA5nFxWzi5s/uzCt083KAXxwq84H6yysLxgimEGEhmZrmWLujdC TUnZGX7wAArY0KGvJEu0xOLbiMRmXle1unYeyYnBuZauZdFjAMxL9PKlUtQgUL0p05iLjD HcbC1McCoU6l6UPq0hXC/H1OIyM3F3tE2fhpi+8tWcgNQpzivsGSZNtgfpMw2tq9QRa839 9DyXWhhJBUuPNMoKlS4qt65EuQErTzf1sQ0+LmVxH66h5xsrgN02055gnpNkofNy42nzbO j3de+c3TWYheqSsqXgAQKr6/hM2IGhzcSBqTzD8G+Lx77nF6s0WGnBjkAHVvvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t88yxeL1xUotzXE59NVWm+EO0Z8/LVFPNFKCmX++NtI=; b=KpTVzRUea6yOjoA8/iNRVnLZY3PTscpkaO4O+XxS53adpR38zQ+AV27OoucGTC78GgRE91 rMLtcn4NmfVqDxcYEkqPDY8Ck2DlZIMeWhgn8VE/OCt2F5PUbWrBoirZbLJ9jBRKSW+PI+ kzciQfYijYhommvN6fuMoQLwAiQFwvYgoXMj9IHu8+Ox8nIWvKdskKOs02+AujcY8O2Ill FfmCutbMHadHqzVvfLV+9PsrpPHPs+BHc9SMcnAk16lbmtnBP5tuNaJ42FgH6ou4nwECap 1Z3Kdhqz7kXqSpEWr6jjxW9oDE49uMXkg+YPBkUbWq4oJY74o+VDbeVupcJEIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8c3H3rJfz170f; Thu, 19 Sep 2024 13:35: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 48JDZdLJ053976; Thu, 19 Sep 2024 13:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZdmk053973; Thu, 19 Sep 2024 13:35:39 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:39 GMT Message-Id: <202409191335.48JDZdmk053973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c31be7380af7 - releng/13.3 - Add UPDATING entries and bump revision. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: c31be7380af7fe71392dd4a1a853780143038ce5 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c31be7380af7fe71392dd4a1a853780143038ce5 commit c31be7380af7fe71392dd4a1a853780143038ce5 Author: Gordon Tetlow AuthorDate: 2024-09-19 13:19:04 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:19:04 +0000 Add UPDATING entries and bump revision. Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index d062be76c45c..56a2afbd487a 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,17 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240919: + 13.3-RELEASE-p7 EN-24:16.pf + SA-24:15.bhyve + SA-24:16.libnv + + Fix incorrect ICMPv6 state handling in pf [EN-24:16.pf] + + Fix bhyve(8) out-of-bounds read access via XHCI emulation [SA-24:15.bhyve] + + Fix integer overflow in libnv [SA-24:16.libnv] + 20240904: 13.3-RELEASE-p6 EN-24:15.calendar SA-24:09.libnv diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e5e1d3897a35..6985018b0afe 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.3" -BRANCH="RELEASE-p6" +BRANCH="RELEASE-p7" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Sep 19 16:50:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8hNY0szzz5XJKq; Thu, 19 Sep 2024 16:50: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 4X8hNY0Nrxz3y1P; Thu, 19 Sep 2024 16:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726764653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7BaregfzyCdVy9HRaflFlXIV74IdTQtEYiIkLWNp/yE=; b=X805nB1/o3B2wRlMhymJ3XFjvSn+JWltDTV4kYznOIMXkiFyNIIdb11zZitkuKX872MUWS 2Ul/4DNvpy9PaVf5wB47gFNF/AVnvaVRNyOIXheZs5jWZy7BOKYkzf+eDkp0177Qr8Rc6Q sblLQaZxmlyyeRPtHKbiKrlvJWPLQeXk88FBislO0Ei6g35Bgu930UsI7k+zxEIXzq/cTd UZbA2z53uaiU+RLWepjYoXrOOB1VNXRoiOJtqbwta9qVlrrARREyLCiPpQqyoZ6Jir+Pb+ ZWFEaREEMFSap4c+M4X+aF2avAwqMX1oHtLtLVaUJT03VxwqzRwCqzCXMHOo8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726764653; a=rsa-sha256; cv=none; b=yo3QMIbWZf047B0Xp7t8esw5NhAnyXnzrREGsL069X2s1wUG7lf1wMiM0FNFqFIJN8cdAh bFp50S48kjnvIHA3363/tGlJAwcYOH91g2IdGDk/1oC1FrcdzwNQ/QNvVoKMwbJgNWJGPP UxRnk8VZn9WxQhJQ3D+P0lVYd0RT6Vn5LRP6kts3NE9vUlDiAobrhgmKuoVQ+wiEmyKF7+ AD1ltq9U92RJO/yTETaja36jr/zkQEn8u/kx5dxxGg/qlzfcML76d0ZUNl9ucSKRu8UP5r jL06D+/vTibVUTWz8snqqY9k6eAS/PtBMD3a75pY9qNMyQgTDpUehpvHnJBN2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726764653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7BaregfzyCdVy9HRaflFlXIV74IdTQtEYiIkLWNp/yE=; b=p0fjVVgFNJjLHOmVHLAJG2ZSreEK5E+L5Is5nvneoU41Lbwb4drSJj43sBPzStG7nWc6DZ 2M1ooQuIcSvdRPI9bzgGp1XUBRVfdx0RrgF5gtnnA0d7o5c7i9jL35p8P3MJaUVk7aJq9n JncL0CxeJHum33qC0WjtQOV+vvHwxnh7s1dosJcCen/JcWVRtXULKa0YMSbzPk71Z5Lqv0 bDKIHVPYs1HmjV9T09mxAUgUYVCMROZnGpaDIBbP1bvdNPiz9MucgSmxbXqHZjEA/qGQhG 0EtjTSKEmCfyZcPPIYVIEmdq+vaHsNmmUrPu556NFqcoH1suo+hmBtUgOHf3lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8hNY003bz1CcK; Thu, 19 Sep 2024 16:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JGoq9U085692; Thu, 19 Sep 2024 16:50:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JGoqn5085689; Thu, 19 Sep 2024 16:50:52 GMT (envelope-from git) Date: Thu, 19 Sep 2024 16:50:52 GMT Message-Id: <202409191650.48JGoqn5085689@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: 450a6690f557 - main - vm_radix: offer pctrie_iterator access List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 450a6690f557493bd33d8f3666b22ddc5150703b Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=450a6690f557493bd33d8f3666b22ddc5150703b commit 450a6690f557493bd33d8f3666b22ddc5150703b Author: Doug Moore AuthorDate: 2024-09-19 16:49:40 +0000 Commit: Doug Moore CommitDate: 2024-09-19 16:49:40 +0000 vm_radix: offer pctrie_iterator access Add to the vm_radix and vm_page interfaces methods to use pctrie iterators with vm_radix tries. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46663 --- sys/vm/vm_page.c | 58 +++++++++++++++++++++++++ sys/vm/vm_page.h | 5 +++ sys/vm/vm_radix.h | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 183 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index d21cc38f5e39..ba32a9eb9e63 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1706,6 +1706,48 @@ vm_page_lookup(vm_object_t object, vm_pindex_t pindex) return (vm_radix_lookup(&object->rtree, pindex)); } +/* + * vm_page_iter_init: + * + * Initialize iterator for vm pages. + */ +void +vm_page_iter_init(struct pctrie_iter *pages, vm_object_t object) +{ + + VM_OBJECT_ASSERT_LOCKED(object); + vm_radix_iter_init(pages, &object->rtree); +} + +/* + * vm_page_iter_init: + * + * Initialize iterator for vm pages. + */ +void +vm_page_iter_limit_init(struct pctrie_iter *pages, vm_object_t object, + vm_pindex_t limit) +{ + + VM_OBJECT_ASSERT_LOCKED(object); + vm_radix_iter_limit_init(pages, &object->rtree, limit); +} + +/* + * vm_page_iter_lookup: + * + * Returns the page associated with the object/offset pair specified, and + * stores the path to its position; if none is found, NULL is returned. + * + * The iter pctrie must be locked. + */ +vm_page_t +vm_page_iter_lookup(struct pctrie_iter *pages, vm_pindex_t pindex) +{ + + return (vm_radix_iter_lookup(pages, pindex)); +} + /* * vm_page_lookup_unlocked: * @@ -1790,6 +1832,22 @@ vm_page_find_least(vm_object_t object, vm_pindex_t pindex) return (m); } +/* + * vm_page_iter_lookup_ge: + * + * Returns the page associated with the object with least pindex + * greater than or equal to the parameter pindex, or NULL. Initializes the + * iterator to point to that page. + * + * The iter pctrie must be locked. + */ +vm_page_t +vm_page_iter_lookup_ge(struct pctrie_iter *pages, vm_pindex_t pindex) +{ + + return (vm_radix_iter_lookup_ge(pages, pindex)); +} + /* * Returns the given page's successor (by pindex) within the object if it is * resident; if none is found, NULL is returned. diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 07a6c98c8ee8..a69155e50723 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -471,6 +471,7 @@ extern struct mtx_padalign pa_lock[]; #include #include +struct pctrie_iter; /* * Each pageable resident page falls into one of five lists: @@ -642,6 +643,7 @@ void vm_page_deactivate_noreuse(vm_page_t); void vm_page_dequeue(vm_page_t m); void vm_page_dequeue_deferred(vm_page_t m); vm_page_t vm_page_find_least(vm_object_t, vm_pindex_t); +vm_page_t vm_page_iter_lookup_ge(struct pctrie_iter *, vm_pindex_t); void vm_page_free_invalid(vm_page_t); vm_page_t vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); @@ -651,6 +653,9 @@ int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); void vm_page_invalid(vm_page_t m); void vm_page_launder(vm_page_t m); vm_page_t vm_page_lookup(vm_object_t, vm_pindex_t); +void vm_page_iter_init(struct pctrie_iter *, vm_object_t); +void vm_page_iter_limit_init(struct pctrie_iter *, vm_object_t, vm_pindex_t); +vm_page_t vm_page_iter_lookup(struct pctrie_iter *, vm_pindex_t); vm_page_t vm_page_lookup_unlocked(vm_object_t, vm_pindex_t); vm_page_t vm_page_next(vm_page_t m); void vm_page_pqbatch_drain(void); diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h index dcacf1a5d3fc..f2e297b10641 100644 --- a/sys/vm/vm_radix.h +++ b/sys/vm/vm_radix.h @@ -56,8 +56,8 @@ vm_radix_is_empty(struct vm_radix *rtree) return (pctrie_is_empty(&rtree->rt_trie)); } -PCTRIE_DEFINE_SMR(VM_RADIX, vm_page, pindex, vm_radix_node_alloc, vm_radix_node_free, - vm_radix_smr); +PCTRIE_DEFINE_SMR(VM_RADIX, vm_page, pindex, vm_radix_node_alloc, + vm_radix_node_free, vm_radix_smr); /* * Inserts the key-value pair into the trie. @@ -111,6 +111,49 @@ vm_radix_lookup_unlocked(struct vm_radix *rtree, vm_pindex_t index) return (VM_RADIX_PCTRIE_LOOKUP_UNLOCKED(&rtree->rt_trie, index)); } +/* + * Initialize an iterator for vm_radix. + */ +static __inline void +vm_radix_iter_init(struct pctrie_iter *pages, struct vm_radix *rtree) +{ + pctrie_iter_init(pages, &rtree->rt_trie); +} + +/* + * Initialize an iterator for vm_radix. + */ +static __inline void +vm_radix_iter_limit_init(struct pctrie_iter *pages, struct vm_radix *rtree, + vm_pindex_t limit) +{ + pctrie_iter_limit_init(pages, &rtree->rt_trie, limit); +} + +/* + * Returns the value stored at the index. + * Requires that access be externally synchronized by a lock. + * + * If the index is not present, NULL is returned. + */ +static __inline vm_page_t +vm_radix_iter_lookup(struct pctrie_iter *pages, vm_pindex_t index) +{ + return (VM_RADIX_PCTRIE_ITER_LOOKUP(pages, index)); +} + +/* + * Returns the value stored 'stride' steps beyond the current position. + * Requires that access be externally synchronized by a lock. + * + * If the index is not present, NULL is returned. + */ +static __inline vm_page_t +vm_radix_iter_stride(struct pctrie_iter *pages, int stride) +{ + return (VM_RADIX_PCTRIE_ITER_STRIDE(pages, stride)); +} + /* * Returns the page with the least pindex that is greater than or equal to the * specified pindex, or NULL if there are no such pages. @@ -146,7 +189,7 @@ vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index) } /* - * Remove and free all the nodes from the radix tree. + * Reclaim all the interior nodes from the radix tree. */ static __inline void vm_radix_reclaim_allnodes(struct vm_radix *rtree) @@ -154,6 +197,80 @@ vm_radix_reclaim_allnodes(struct vm_radix *rtree) VM_RADIX_PCTRIE_RECLAIM(&rtree->rt_trie); } +/* + * Initialize an iterator pointing to the page with the least pindex that is + * greater than or equal to the specified pindex, or NULL if there are no such + * pages. Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_lookup_ge(struct pctrie_iter *pages, vm_pindex_t index) +{ + return (VM_RADIX_PCTRIE_ITER_LOOKUP_GE(pages, index)); +} + +/* + * Update the iterator to point to the page with the least pindex that is 'jump' + * or more greater than or equal to the current pindex, or NULL if there are no + * such pages. Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_jump(struct pctrie_iter *pages, vm_pindex_t jump) +{ + return (VM_RADIX_PCTRIE_ITER_JUMP_GE(pages, jump)); +} + +/* + * Update the iterator to point to the page with the least pindex that is one or + * more greater than the current pindex, or NULL if there are no such pages. + * Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_step(struct pctrie_iter *pages) +{ + return (VM_RADIX_PCTRIE_ITER_STEP_GE(pages)); +} + +/* + * Update the iterator to point to the page with the pindex that is one greater + * than the current pindex, or NULL if there is no such page. Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_next(struct pctrie_iter *pages) +{ + return (VM_RADIX_PCTRIE_ITER_NEXT(pages)); +} + +/* + * Update the iterator to point to the page with the pindex that is one less + * than the current pindex, or NULL if there is no such page. Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_prev(struct pctrie_iter *pages) +{ + return (VM_RADIX_PCTRIE_ITER_PREV(pages)); +} + +/* + * Return the current page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_page(struct pctrie_iter *pages) +{ + return (VM_RADIX_PCTRIE_ITER_VALUE(pages)); +} + /* * Replace an existing page in the trie with another one. * Panics if there is not an old page in the trie at the new page's index. From nobody Thu Sep 19 18:18:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8kL92kp3z5Wn2K; Thu, 19 Sep 2024 18:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8kL92BSFz4FKB; Thu, 19 Sep 2024 18:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726769937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9SOZZML7OTsbv0h8s9nFcVglapFY+5Y+B3QfGD1mNg=; b=a9Nhw5oTXYcD2iUHM4wPht6ETgXNE4aT2N1/us7xH6PzAK5gBvz6ZQPPRqwN+4filC3pUl wxtY5H5WbH/WPCIj9ohH0RbI2q/X5STTRUWPw5+U6a9Sw5am/gnvYPM5nDeEp8IDksO1bt cNfi605g3fiKsgDWkWnTdy/QBF/8Jn2KkJ9gcQLLQaoLNoiPb9defeZsJQ44eVcP8clxle piArceYUYpoV99CEcy3s+pqXMA6QwsbdoI9GxMbQ3Y4wyv6/GCZXwN4q4iKZti2GaM8leQ U56XTs6zrG/y7kooYuEXdZWlmbpZ2kuJRP+DiB533652JrOWPe7Jmbi8Y/9VWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726769937; a=rsa-sha256; cv=none; b=C4zjmL+Rqx1cDdNjmun26ObuC0iHx/Ea2DfD68p91W7BN2o9T5obLHHDUvuKCoT8i+SYLT O8U3s7Xu+6STBxeIfkInzJpF+gOdtQfKz4rOlp5DZFr59MNWDIu6QCuio48gxy7KS1YrF5 8JQ41OfK5r7G2pX3CeSxrja51BrpZI7jR4a/MZfuLvZoA1S8/Ety9cvjthWXlyGOUAmsk/ ISijKxcjde5UM56jpu61SeSaF/Lh0khko+LsGHezyDBrKO1It88y3Tz+fAEM135zr+Z9RF lv+cVgWywerIbrLqwYcigneKhNlV7OFHU+SCAb2aRIanbbSsVYJEySxm/1rn+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=1726769937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9SOZZML7OTsbv0h8s9nFcVglapFY+5Y+B3QfGD1mNg=; b=TFi8mbK+rh1nF5tjguniHWcz5LVvTZc3q8bdyQgTUh1CQoit8qf2f4JePaPd18HkQ+CwWD PYm/i4aKXIFPWij3yraiqXZ0I45xuZ/JtOfWiOiFu2lpfZ7fGAef4qrd58t6xZdH7bQ3Ns YvKGLJ1wx0hFcp81bIWpc1hwCSU59LKt8WZ+GxaC5hqINldinZ6S1Y8w8FDYsCtVNqDhKg q9qO3UrFKkQDYxFkHirETZ/O/hPIV29jomoFTW9s+qjYjxfNZstIr3WcvzMeUrUVQ98tn7 HDkNG7YkeFEycx8a+7BJKMXKVeYKiICzbkWX1IBb+HLqopRpY3FPDe+73RVCAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8kL91fxTzGHm; Thu, 19 Sep 2024 18:18: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 48JIIv24030371; Thu, 19 Sep 2024 18:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JIIvdJ030368; Thu, 19 Sep 2024 18:18:57 GMT (envelope-from git) Date: Thu, 19 Sep 2024 18:18:57 GMT Message-Id: <202409191818.48JIIvdJ030368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oskar Holmlund Subject: git: ad7c98797bcc - main - Remove TI reference from arm/GENERIC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad7c98797bcc119f05c6d67c550442340a82c6ba Auto-Submitted: auto-generated The branch main has been updated by oh: URL: https://cgit.FreeBSD.org/src/commit/?id=ad7c98797bcc119f05c6d67c550442340a82c6ba commit ad7c98797bcc119f05c6d67c550442340a82c6ba Author: Oskar Holmlund AuthorDate: 2024-09-19 18:15:47 +0000 Commit: Oskar Holmlund CommitDate: 2024-09-19 18:15:47 +0000 Remove TI reference from arm/GENERIC Approved by: imp, manu (mentor) Differential revision: https://reviews.freebsd.org/D46702 --- sys/arm/conf/GENERIC | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index b5321daa235a..7394f3842d43 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -57,8 +57,6 @@ options SOC_BCM2836 options SOC_BRCM_BCM2837 options SOC_MV_ARMADA38X options SOC_MV_ARMADAXP -options SOC_TI_AM335X -options SOC_OMAP4 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores @@ -168,9 +166,6 @@ device zy7_qspi # Xilinx Zynq QSPI controller device pwm # Watchdog support -# If we don't enable the watchdog driver, the BeagleBone could potentially -# reboot automatically because the boot loader might have enabled the -# watchdog. device imxwdt # Watchdog. WARNING: can't be disabled!!! device aw_wdog # Allwinner Watchdog From nobody Thu Sep 19 18:54:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8l7C5Dwcz5X7RL; Thu, 19 Sep 2024 18:54: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 4X8l7C4S4Lz4JlF; Thu, 19 Sep 2024 18:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726772071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8FpBJgotnt7SZeHgpR0fr39WSCjTaq9Q0nINM4y9SgU=; b=T0ZkOEVvJko6GG66o7yNxNQ40ZDU0d+dRfYAvHMXxsv6x5yHV7GFrAYqpX4rMFc3k797qQ /E9gx4OLpNDZpLp5PU0Per8BWBoifAE5iRQtVyEfMEtiED1pLCcz+PgmM3YIAk4j3N1wcv T2xs/yB+0flaxl/hCJ20ciOZ3E31FKYsGKc9YTS+OChQjAQusCmzRGKMXzRuzfgwkLKfHt Q8SDliYT4PnNuetAvrjgscQy+arlPBqtwyd2hlj39GcXTw2NqFqRkL7mMqq9z+JlRQRzA8 La9QqNBabbr+zWBRZg7JjPoE2l940RrmBLzSDKf5NOsz39oMem/UJMDOuCkz0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726772071; a=rsa-sha256; cv=none; b=KOcLv4PYTBTqWFOsKpj+FbMYdhBHP+Q+lYPfrj6qMVs0t989L/Utc5c/VV36O045upfT5o d3QBEM1cUAnxepYKEiMd+TRP7dN/Frw09nKv4SYWUts/kIAzwIiJnhV72WbIcA8XKMd3j1 l260E47m58/3jQbxhdmvdaEqOcGJmCtuVbJa/AYL2hNyxVs7xnXGAl2GyvmYNTFFgp8emT 7vmjTPQQ7SIqH6jrN37Jr9OtmeRiu+n/xiqtzY3P0BDe/IQoYgOIvQKNIIDi71HTN2R33I sVQnkAlo18rBu9RXVSN1wvApC75AxaAprjHfuX/efOPzATvNsGBSZqeL9RVP0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726772071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8FpBJgotnt7SZeHgpR0fr39WSCjTaq9Q0nINM4y9SgU=; b=WkC0YZGZTNg/66fkf/v/Z8RK2HlNrBz2WAHtPDgAWEbbxb3Mz5rMaGOif4sAHfI7osqF8n ihB4AobjuBA1kXTGLNYcslXVZiGt8aPvsthoGKQbiAuuMmkuU6LLcY+nobY5/qlJMXTDDF ByGQrKFp2qrngu52tjos5o1fqEUq9sk5i9gr2KEaJXNnBSBlrgnFIzZwh6p2oHWp2F1e1H 0RkxS5tgU5ztSVh6MpwCq0gSQohxRmk2NHWq0cU87R04mKevXLgdO7TBJ+PVq5pP3EiIPE 78jAU1d7k1q1rn4//xhDYaADpXfAdc2R7+Hg9SPr4eWOSaZgw6nwEMmR0aGk1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8l7C43B0zHSK; Thu, 19 Sep 2024 18:54: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 48JIsVYs096596; Thu, 19 Sep 2024 18:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JIsVZH096593; Thu, 19 Sep 2024 18:54:31 GMT (envelope-from git) Date: Thu, 19 Sep 2024 18:54:31 GMT Message-Id: <202409191854.48JIsVZH096593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 624a521c1885 - stable/14 - ctladm.8: fix several errors in the "port" section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 624a521c1885f58690ac9291f10d7b9f9545f219 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=624a521c1885f58690ac9291f10d7b9f9545f219 commit 624a521c1885f58690ac9291f10d7b9f9545f219 Author: Alan Somers AuthorDate: 2024-06-05 20:13:04 +0000 Commit: Alan Somers CommitDate: 2024-09-19 18:53:44 +0000 ctladm.8: fix several errors in the "port" section * Document the "-d" option. * Add the "-c" and "-r" options to the summary. * Correct the list of required options. * Clarify that the "-t" option is only for use with "-o", "-w", and "-W" * Replace references to the nonexistent "-n" with "-p". Also, fix a few related error strings in the ctladm command. Sponsored by: Axcient Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45503 (cherry picked from commit 60107d23d8f2c05f418c024000a31a6148d2f7de) --- usr.sbin/ctladm/ctladm.8 | 32 ++++++++++++++++++++++++++++---- usr.sbin/ctladm/ctladm.c | 7 ++++--- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index ba2712cb278c..4e7288dac6b6 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -35,7 +35,7 @@ .\" .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" -.Dd December 27, 2023 +.Dd June 5, 2024 .Dt CTLADM 8 .Os .Sh NAME @@ -162,6 +162,7 @@ .Nm .Ic port .Op Fl c +.Op Fl d Ar driver .Op Fl o Ar on|off .Op Fl w Ar wwpn .Op Fl W Ar wwnn @@ -591,6 +592,10 @@ The serial number is returned when the error is injected. Perform one of several CTL frontend port operations. Either get a list of frontend ports .Pq Fl l , +create a new frontend port +.Pq Fl c , +destroy a frontend port +.Pq Fl r , turn one or more frontends on or off .Pq Fl o Ar on|off , @@ -600,6 +605,8 @@ or World Wide Port Name .Pq Fl W Ar wwpn for a given port. One of +.Fl c , +.Fl r , .Fl l , .Fl o , or @@ -612,6 +619,18 @@ combined with enabling/disabling or listing ports. .Bl -tag -width 12n .It Fl c Create new frontend port using free pp and vp=0. +.It Fl d Ar driver +Specify the name of the frontend driver used by the +.Pq Fl c +or +.Pq Fl r +subcommands. +Valid driver names include +.Dq ioctl , +.Dq iscsi , +and +.Dq nvmf , +but more can be added by external kernel modules. .It Fl o Ar on|off Turn the specified CTL frontend ports on or off. If no port number or port type is specified, all ports are turned on or @@ -626,7 +645,12 @@ The port numbers can be found in the frontend port list. Remove port specified with .Pq Fl p Ar targ_port . .It Fl t Ar fe_type -Specify the frontend type. +Specify the frontend type used by the +.Pq Fl o , +.Pq Fl w , +and +.Pq Fl W +subcommands. Currently defined port types are .Dq fc (Fibre Channel), @@ -640,7 +664,7 @@ and .It Fl w Ar wwnn Set the World Wide Node Name for the given port. The -.Fl n +.Fl p argument must be specified, since this is only possible to implement on a single port. As a general rule, the WWNN should be the same across all ports on the @@ -648,7 +672,7 @@ system. .It Fl W Ar wwpn Set the World Wide Port Name for the given port. The -.Fl n +.Fl p argument must be specified, since this is only possible to implement on a single port. As a general rule, the WWPN must be different for every port in the system. diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 4426274fdd44..91469aef40a7 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -541,7 +541,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) * we'll throw an error, since that only works on one port at a time. */ if ((port_type != CTL_PORT_NONE) && (targ_port != -1)) { - warnx("%s: can only specify one of -t or -n", __func__); + warnx("%s: can only specify one of -t or -p", __func__); retval = 1; goto bailout; } else if ((targ_port == -1) && (port_type == CTL_PORT_NONE)) @@ -625,7 +625,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) } case CCTL_PORT_MODE_SET: if (targ_port == -1) { - warnx("%s: -w and -W require -n", __func__); + warnx("%s: -w and -W require -p", __func__); retval = 1; goto bailout; } @@ -674,7 +674,8 @@ bailout: return (retval); bailout_badarg: - warnx("%s: only one of -l, -o or -w/-W may be specified", __func__); + warnx("%s: only one of -c, -r, -l, -o or -w/-W may be specified", + __func__); return (1); } From nobody Thu Sep 19 19:05:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8lMf1mwKz5X8Ny; Thu, 19 Sep 2024 19:05: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 4X8lMf0myXz4KHW; Thu, 19 Sep 2024 19:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726772718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNP/VT+dRBOeeFv9Q2VYNSc2R+NalO6z1B6A63Fnpv8=; b=rAjhiMGbXWfMrWeLCjFzhjHRkXpJnF9mZCOl61ef4vkU7qa8Ob5PWPEoL7Ke4b1Z3a66g1 P2LgCJful8uS5zvDCHDbN3Or3SQ0E+w536JwpaFIk4azHJninYWEgSIbfLoid93Ye9gYTk ESpg6nkrv9rdICKjqLgpgjyz8bihs6T9bOM7aMlesNNGYdGXDso5PF4Uyn5YfbM0quWGlF wkL4HOWgSvKbn93NgI/DgSzPRU/2eRwvfPHruuJKOQjY6K3143C/vAu/2Rw86q5ybxXYzH SegjTyw9WalUV+2IEVNL+Q3yVT2XxQbqVjNgJsL/gwLThlDLYD+HbNivsWkqXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726772718; a=rsa-sha256; cv=none; b=jCcf+Kmce+6oKWhno3qM0Xmn5UR9J1sCZWjX1HgW2iR0UR7KNyyyPcLkMnakyFfWAxJn5d 1+o1qUGgjYHu4zNkEpedoiM9hnZaJjyx2t8s9+CugEtz4v0Hje86rVwf6ifyZ6d8iVi3jX 0/nbXvEoiLsaxJsFg74kKfOWiSzGWj2/6YNF1JbdwgQo9vNNsYhiWbmfv1+joiaHlnZJ3Q 1ERCkARg9sM6swu9+WBPsmM1IXkhOfJoCd0F6wPj3CzfRwKZdHcTfxcS37Cn6T7ip7SHyZ nAZzImEaefjmTn9czG1v60DgTgT6Sf2fym+x+uLOCYr0mz/dSql5ZdczKdUDeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726772718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNP/VT+dRBOeeFv9Q2VYNSc2R+NalO6z1B6A63Fnpv8=; b=tRzNbEWww7NM12OTw5cQk90AVIG/8Qc0h5UJshX9zxkl+KT4hZuhnZ6ompTloMmxT7iG1j Skrd+0Fd3c6H0bCxSNYREpOoVUfOlFJ4nHtRbUVeiffJXYUafTZQyKeoA3O7+DKEcC75rV dn8++I2tZs851gynYmLr2wN85OlAKbZ8ujDBlt5FsW5zeGf7pl1DYVkwRxhRM+qrfliFgT hITu5uHAKZJHYL4fCO4UzYsYqlXXeZU1TlArrLzGE3ddhmfoAwrvYjWpuB4/ibq5oUSgAG DcZRRBnTIJlur0sF/RJczcQkHuuCVCMg9Tb4wtlDj/R9Ip2pd24jVHFz31UE+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8lMf0GlnzJCB; Thu, 19 Sep 2024 19:05: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 48JJ5HNp014392; Thu, 19 Sep 2024 19:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JJ5HMc014388; Thu, 19 Sep 2024 19:05:17 GMT (envelope-from git) Date: Thu, 19 Sep 2024 19:05:17 GMT Message-Id: <202409191905.48JJ5HMc014388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 811912c46b58 - main - e1000: fix link power down List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 811912c46b5886f1aa3bb7a51a6ec1270bc947a8 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=811912c46b5886f1aa3bb7a51a6ec1270bc947a8 commit 811912c46b5886f1aa3bb7a51a6ec1270bc947a8 Author: Anatoly Burakov AuthorDate: 2024-09-19 05:38:32 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 19:04:47 +0000 e1000: fix link power down DPDK commit message net/e1000/base: fix link power down Current code is a result of work to reduce duplication between various device models. However, the logic that was replaced did not exactly match the new logic, and as a result the link power down was not working correctly for some NICs, and the link remained up even when the interface is down. Fix it to correctly power down the link under all circumstances that were supported by old logic. Fixes: 44dddd1 ("net/e1000/base: remove duplicated codes") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson Obtained from: DPDK (a8218d0) MFC after: 1 week --- sys/dev/e1000/e1000_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_base.c b/sys/dev/e1000/e1000_base.c index ff810821d9e9..d83dc48c4d4d 100644 --- a/sys/dev/e1000/e1000_base.c +++ b/sys/dev/e1000/e1000_base.c @@ -137,7 +137,7 @@ void e1000_power_down_phy_copper_base(struct e1000_hw *hw) return; /* If the management interface is not enabled, then power down */ - if (phy->ops.check_reset_block(hw)) + if (!(e1000_enable_mng_pass_thru(hw) || phy->ops.check_reset_block(hw))) e1000_power_down_phy_copper(hw); } From nobody Thu Sep 19 19:36:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8m492KMqz5XDdg; Thu, 19 Sep 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 4X8m491n0Zz4P41; Thu, 19 Sep 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=1726774617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dNdtNDEc2hfMyQ9EmHgCugacx0L2QkfxgHEAauBuTN8=; b=dJ/w/yptQ9gCAUg6Uji44Ft02W3R3oRBb2MRkE5fV6ttDvCSRjDlXjh7VjY5/dy1M406nl Yw1fTSKmFxaIgTRL9/sYWNX/odVf39X0sBqHSKlcXcCmqlB3OvEHyAluYpZIDFe5ncol4q TzpNpLfFUvzMgNRbYlGnEsoeJz5RUZ7/G4/blJPe/cUddCHKOcFlXRHp0NowzyEDh9E+XF m6xpMDGZGAmbeTEOUZHQz2JFfbofw0RKwD1fu6UO0ANQmS5jwUVEQEK+hvnuiinVy0t+bA 7M6WVfnuCFi6qU/eyE3gq0stWPd5cp0o4OQoH+n2vE4okA0KVIAiqyR5cvmfoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726774617; a=rsa-sha256; cv=none; b=ImC0WpvlC0dH2ZJX/y/SH3n+zvv1QwtPdC88bmUKkK8unY17erjVMQSPr8gnocbOEhJl6v GvyW9Q4rvSfEQFBL0Vqtg5+JiC6/yS+xr++SEqaXDyqAcCRdOi/T6vDSIDSaAAh8oObvLO G9pj4tUba6aY693xSLqsRp/YuWjRXwyGc9fGux5crihCRx4ySxC0QVlEVIBnMrf0epbFv8 UQjwRwRl2MVXe+IlnwLRRLxE6LkYb6flds5ou3TA+1ySn3XsS2AodJibjUBsaE9l6W/Jt7 8+Ah8GNRW5i5/QCL7vTlto7XerUa9wvtDRE+oOsFBjLByerVBpvBDqvz2sVSnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726774617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dNdtNDEc2hfMyQ9EmHgCugacx0L2QkfxgHEAauBuTN8=; b=HADdj6yJky90IVdZuO40nGvyNxedHlFRmTXrPWYF4LogMieTm5gCkt7Qk/8k6tObpWzWhF OWpETSU3miqWcb8zbH7K9aniIed7z1pB/BvAplIb+0fwjidqOPOtfgF49qEZ5sd0egbcoR JAuLbQCDjvVOFgt06OwZoXgZWdjTVw7Hpz1+WZn1r9zChSa+V+YpxjmjlSkOwo0Scmz3nU G4wQ/oLSji3rJvC9a/2OLFdeziBqy/rrUs7l9HO+cTcBFgpXuWL9b79diq800vdwhIxCK/ GePvY/m5Bc/oLnKheM6NtqiP71/drCGqe2yrOpty0K0+FH1n/auPHJDIFm38RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8m490y1gzJk1; Thu, 19 Sep 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 48JJav3K065714; Thu, 19 Sep 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 48JJavqi065711; Thu, 19 Sep 2024 19:36:57 GMT (envelope-from git) Date: Thu, 19 Sep 2024 19:36:57 GMT Message-Id: <202409191936.48JJavqi065711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 567d9fe8adf0 - main - csu: add include path to CFLAGS to be able to find libsys.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 567d9fe8adf057eb26f57cd615b2a89cd213371a Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=567d9fe8adf057eb26f57cd615b2a89cd213371a commit 567d9fe8adf057eb26f57cd615b2a89cd213371a Author: Stephen J. Kiernan AuthorDate: 2024-09-19 19:33:52 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-19 19:36:38 +0000 csu: add include path to CFLAGS to be able to find libsys.h In order to ensure we get the correct libsys.h, we need to add lib/libsys to the includes search path. --- lib/csu/Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc index 1509a1ece2c3..9903b25b7011 100644 --- a/lib/csu/Makefile.inc +++ b/lib/csu/Makefile.inc @@ -22,7 +22,8 @@ ACFLAGS+= -DLOCORE CFLAGS+= -DSTRIP_FBSDID CFLAGS+= -fno-omit-frame-pointer CFLAGS+= -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include + -I${SRCTOP}/lib/libc/include \ + -I${SRCTOP}/lib/libsys \ CFLAGS_CRTS= -DSHARED ${PICFLAG} From nobody Thu Sep 19 19:49:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8mM04SjKz5XGBs; Thu, 19 Sep 2024 19:49: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 4X8mM03yDSz4QpV; Thu, 19 Sep 2024 19:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726775388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4EmlkdwfGAmozZ5TbUkswx/Mw48eDMTcXsnL8WOpyU=; b=AhgzBSScX/w2lOsjkDW5ndx3rm/C1YoWCgQIOavx4USw3tMwbWeIWXZXtkQEG0/dJmNH3x GqFUIpbwd/+QJzwyOWSj6tbn1E/F4QB6MBf1ZIiRC7nZqxjBetgTkptlp29MsvLFuhsePW NjGZgCYglYrV2qirjQLlQG9TmrzTqe1mmEeO1mnKFIofkZzZDbt2Zr4u/7c+E1GFNq4GiO jejrgECB1NH99Ln1KFVX5lQDdEqNNDrDOepQwOoyNNRJs7DrYz7CV9+VBIipmLsM2zgCXB qXubuCFpUumaxesauB/s01/7v4njQKQwAVXOPU1HVXlKCqXJ5pkVhhLaUK3y5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726775388; a=rsa-sha256; cv=none; b=QbkPFlYA5qh682oHn9ZhuHbs9pS6eK/v9BP1V/7L7lzJYGu+rN5ZdePwlAwgs0p2lOcY5c Mj05hSEUqrEJpu/8FWBTQnfgZnlp1iFjgTagd6t58CBhOS26Pds3u8/K+oRmLM/VmRLGVb Pffbw2Mci1i3NhwfdbWh+KhwYZsyWzDHGYAAdfOTwPPANwq4kpMdiIDLNRsL8KUz0LleXz PVQp5BHSJFSR/adg3sFZfXhA+DanQUfzmxT3Jj8Mv3SS6lN+YeTXKkmfS/H61vPRgnBaxJ ok8XKw56FxWY7PLekuwYazW5NaqYrJ/HUbM7sKYU/hRD2//lno2pFvA85m/IHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726775388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4EmlkdwfGAmozZ5TbUkswx/Mw48eDMTcXsnL8WOpyU=; b=FTAZVL8jMyVCc1LETqa843t7cLBcH+4W45L/8eq0Uuj7BDQgYH7qI6AQ7kgJ5SX5zJTcY9 lVhqPklmqQod/9cbNnw45YnBeyB8I8jD9CGPhCdfVk0szB+gfu6xXLMnnB7UGhsawgD3PJ Vnb2kpMfq4FBGTa+LrOMzjltYfz2al4DXuuoPgD0xTybtGyNTXFNmd3wIjMI2pY6qMpgS+ HGzhf4o1NeprTgBbllraksrQd4k2UXd0mm/hODdliyLxUd0XMC4xGpFZ0r5c0y8EZkxRsb ELiRoUKYrN2xLxAt69maELqNF5vFBSnlKuQS4CX42SxRe7+VEU1Qtzi4pE+M3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8mM038bjzJfc; Thu, 19 Sep 2024 19:49: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 48JJnm6p083534; Thu, 19 Sep 2024 19:49:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JJnmdK083531; Thu, 19 Sep 2024 19:49:48 GMT (envelope-from git) Date: Thu, 19 Sep 2024 19:49:48 GMT Message-Id: <202409191949.48JJnmdK083531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: ae1a0648b05a - main - jail: unbreak the zfs.mount_snapshot option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae1a0648b05acf798816e7b83b3c10856de5c8e5 Auto-Submitted: auto-generated The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=ae1a0648b05acf798816e7b83b3c10856de5c8e5 commit ae1a0648b05acf798816e7b83b3c10856de5c8e5 Author: Jamie Gritton AuthorDate: 2024-09-19 19:49:01 +0000 Commit: Jamie Gritton CommitDate: 2024-09-19 19:49:01 +0000 jail: unbreak the zfs.mount_snapshot option The change of its description from integer to boolean didn't actually change it to a boolean, but only made it impossible to set as either a boolean or an integer. Rather than make it work as a boolean parameter should, just revert to the old (working) integer parameter, and change the documentation to match. PR: 274263 Reported by: andrew.hotlab at hotmail --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 2 +- usr.sbin/jail/jail.8 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 23dc03cdac92..b96393df4626 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -100,7 +100,7 @@ static struct zfs_jailparam zfs_jailparam0 = { static int zfs_jailparam_slot; SYSCTL_JAIL_PARAM_SYS_NODE(zfs, CTLFLAG_RW, "Jail ZFS parameters"); -SYSCTL_JAIL_PARAM(_zfs, mount_snapshot, CTLTYPE_INT | CTLFLAG_RW, "B", +SYSCTL_JAIL_PARAM(_zfs, mount_snapshot, CTLTYPE_INT | CTLFLAG_RW, "I", "Allow mounting snapshots in the .zfs directory for unjailed datasets"); SYSCTL_NODE(_vfs_zfs, OID_AUTO, version, CTLFLAG_RD, 0, "ZFS versions"); diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 19e89ce661a9..881d07b1b626 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 12, 2024 +.Dd September 19, 2024 .Dt JAIL 8 .Os .Sh NAME @@ -789,8 +789,8 @@ Allow access to SYSV IPC semaphore and shared memory primitives, in the same manner as .Va sysvmsg . .It Va zfs.mount_snapshot -Allow jailed users to access the contents of ZFS snapshots under the -filesystem's +When set to 1, jailed users may access the contents of ZFS snapshots +under the filesystem's .Pa .zfs directory. If From nobody Thu Sep 19 20:07:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8mkz2RNJz5XJCF; Thu, 19 Sep 2024 20:07: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 4X8mkz1t9jz4SGX; Thu, 19 Sep 2024 20:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tW64fGPjxlHHtskdiLeQubxQyX+wW+RDf3nSDr7hW/g=; b=iFckQPPqWf4Qc1t84vfmGxAouuNmlrJZdQ0zvb3BSSFoYxrO98OXnv8VQN3ohEZhljdYvL 09PlrOXVWISS7kZXmojZFc8Mq3GW7T6wrr2Dl4xXY/obrgufD83ESAYv3vQKTFv4y/VKGw cxj/mPFXjOCz/8lhzRlMxxPENvAxuXbM1Zp2h+RmH2LA0HEMKTfuWrA+b5XhC8idYB7vg5 FsEah9RywAwIrrmusmXXhCbnrlLJPYTvVzjE6AdrLBhygNXGnrOQudHYrq54dIR7BjEJmK pPGLBWrSJ0SJ1brpCOVT2G+STqj+ion5EV1Kr5mOaQWMhL2ye/eH2l+AkkeOHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776427; a=rsa-sha256; cv=none; b=Vtor1X/+TeRl32S5dOu5GzaDa3QuDrMsGZ1TdQbVRWot0kSF6UMrtjcEjcD/RcT7b38QGw MoiX7b9KjEw5eQWNWWX5LA4At6UbvqZ/hA6U8tDH1Qs6AvXhysi70AdrTj2G489g6uPYMD Xi7hPAfjG+Hsz5CCHZ33VD/q9K9iwWbE9/hhJ8Y/X44VzyGMJaEZnMy4KNIjMnfI9LODlX KMyh7zruqi46lbomf0WgfjYZBPtk7/0CWmdlpal2JhEQnBIQ3jCLLfxOsG9BsJSMfpMToj I5lInfDVg1lQhEVhipkWCr8qO0Z35NZvfi5sh/FnclB1srTtYdUWfeLnO3vQlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tW64fGPjxlHHtskdiLeQubxQyX+wW+RDf3nSDr7hW/g=; b=sb1gkMNGQ5RIgJf5FgARJ2PJBJBf0P1+Rmp25nP3Aku595ZEvj1DJdl3hCOnXj/J4aRXVg AfGts4/0+KcYCkWhOWiU7j+QK4tXSCGzRhoGoWIWjgNVrIZ848f0+lEmcPlZdjVnq5+BYF SOu+d9Uc3GqxJ6QxcLXhRk7+TkFTZkGhO6HBszwHktmarJqUJScEU7dfHD2/TLg0yTOaOb XDasCZAE/gvjWIoTjt/TPyNZULOuOXTaeit+JFBIGj2R9F6Z13hHMkfUSDM0yXG28HQ7aP Xiv4l3OuIytfqK3WZg1i42xNclGyrcEOmaVsYHMy9JcainUFFFdLL3I8r6fXbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8mkz1TMvzK3T; Thu, 19 Sep 2024 20:07: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 48JK77GJ017725; Thu, 19 Sep 2024 20:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JK77cL017722; Thu, 19 Sep 2024 20:07:07 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:07:07 GMT Message-Id: <202409192007.48JK77cL017722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: bc4240ed3b23 - stable/14 - Add some ATF tests for ctladm List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc4240ed3b232420f2f38b74ec1db0cb524a52c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=bc4240ed3b232420f2f38b74ec1db0cb524a52c6 commit bc4240ed3b232420f2f38b74ec1db0cb524a52c6 Author: Alan Somers AuthorDate: 2024-06-05 20:16:25 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:03:09 +0000 Add some ATF tests for ctladm So far only "ctladm port -c" and "ctladm port -r" are covered. Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1279 (cherry picked from commit 9747d11d91642cb9b81602d88e8aebeb388543c7) Fix mtree entry for ctladm tests Sponsored by: Axcient (cherry picked from commit 81ef0a89fcc055bdf3d0f1affbadb643412ebce9) ctladm: add a copyright header to the port test [skip ci] Reported by: markj Sponsored by: Axcient (cherry picked from commit a1608e8854da7f3b5734c2fcb85dd740733a08e6) --- etc/mtree/BSD.tests.dist | 2 + usr.sbin/ctladm/Makefile | 3 + usr.sbin/ctladm/tests/Makefile | 10 +++ usr.sbin/ctladm/tests/port.sh | 180 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 195 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 9f0f59eb923d..95328d6d293f 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1175,6 +1175,8 @@ usr.sbin chown .. + ctladm + .. daemon .. etcupdate diff --git a/usr.sbin/ctladm/Makefile b/usr.sbin/ctladm/Makefile index f9ddd251f96c..69dc727deaf4 100644 --- a/usr.sbin/ctladm/Makefile +++ b/usr.sbin/ctladm/Makefile @@ -23,4 +23,7 @@ MAN= ctladm.8 CFLAGS+= -DWANT_ISCSI .endif +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.sbin/ctladm/tests/Makefile b/usr.sbin/ctladm/tests/Makefile new file mode 100644 index 000000000000..73ac94d77d21 --- /dev/null +++ b/usr.sbin/ctladm/tests/Makefile @@ -0,0 +1,10 @@ + +PACKAGE= tests + +ATF_TESTS_SH= port + +# "ctladm port" does not report the name of the port just created, so we can't +# cleanup unless we assume that no other test created a port too. +TEST_METADATA+= is_exclusive="true" + +.include diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh new file mode 100644 index 000000000000..110b89bd965b --- /dev/null +++ b/usr.sbin/ctladm/tests/port.sh @@ -0,0 +1,180 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``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 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. + +# Things that aren't tested due to lack of kernel support: +# * Creating camsim ports +# * Creating tpc ports +# * Creating camtgt ports +# * Creating umass ports + +# TODO +# * Creating iscsi ports +# * Creating nvmf ports +# * Creating ha ports +# * Creating fc ports + +skip_if_ctld() { + if service ctld onestatus > /dev/null; then + # If ctld is running on this server, let's not interfere. + atf_skip "Cannot run this test while ctld is running" + fi +} + +cleanup() { + driver=$1 + + if [ -e after-ports ]; then + diff before-ports after-ports | awk "/$driver/ {print \$2}" | xargs -n1 ctladm port -r -d ioctl -p + fi +} + +atf_test_case create_ioctl cleanup +create_ioctl_head() +{ + atf_set "descr" "ctladm can create a new ioctl port" + atf_set "require.user" "root" +} +create_ioctl_body() +{ + skip_if_ctld + + atf_check -o save:before-ports ctladm portlist -qf ioctl + atf_check ctladm port -c -d "ioctl" + atf_check -o save:after-ports ctladm portlist -qf ioctl + if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then + atf_fail "Did not create a new ioctl port" + fi +} +create_ioctl_cleanup() +{ + cleanup ioctl +} + +atf_test_case create_ioctl_options cleanup +create_ioctl_options_head() +{ + atf_set "descr" "ctladm can set options when creating a new ioctl port" + atf_set "require.user" "root" +} +create_ioctl_options_body() +{ + skip_if_ctld + + atf_check -o save:before-ports ctladm portlist -qf ioctl + atf_check ctladm port -c -d "ioctl" -O pp=101 -O vp=102 + atf_check -o save:after-ports ctladm portlist -qf ioctl + if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then + atf_fail "Did not create a new ioctl port" + fi + if ! egrep -q '101[[:space:]]+102' after-ports; then + ctladm portlist + atf_fail "Did not create the port with the specified options" + fi +} +create_ioctl_options_cleanup() +{ + cleanup ioctl +} + + +atf_test_case disable_ioctl cleanup +disable_ioctl_head() +{ + atf_set "descr" "ctladm can disable an ioctl port" + atf_set "require.user" "root" +} +disable_ioctl_body() +{ + skip_if_ctld + + atf_check -o save:before-ports ctladm portlist -qf ioctl + atf_check ctladm port -c -d "ioctl" + atf_check -o save:after-ports ctladm portlist -qf ioctl + if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then + atf_fail "Did not create a new ioctl port" + fi + portnum=`diff before-ports after-ports | awk '/ioctl/ {print $2}'`; + atf_check -o ignore ctladm port -o off -p $portnum + atf_check -o match:"^$portnum *NO" ctladm portlist -qf ioctl +} +disable_ioctl_cleanup() +{ + cleanup ioctl +} + +atf_test_case enable_ioctl cleanup +enable_ioctl_head() +{ + atf_set "descr" "ctladm can enable an ioctl port" + atf_set "require.user" "root" +} +enable_ioctl_body() +{ + skip_if_ctld + + atf_check -o save:before-ports ctladm portlist -qf ioctl + atf_check ctladm port -c -d "ioctl" + atf_check -o save:after-ports ctladm portlist -qf ioctl + if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then + atf_fail "Did not create a new ioctl port" + fi + portnum=`diff before-ports after-ports | awk '/ioctl/ {print $2}'`; + atf_check -o ignore ctladm port -o off -p $portnum + atf_check -o ignore ctladm port -o on -p $portnum + atf_check -o match:"^$portnum *YES" ctladm portlist -qf ioctl +} +enable_ioctl_cleanup() +{ + cleanup ioctl +} + +atf_test_case remove_ioctl +remove_ioctl_head() +{ + atf_set "descr" "ctladm can remove an ioctl port" + atf_set "require.user" "root" +} +remove_ioctl_body() +{ + skip_if_ctld + + atf_check -o save:before-ports ctladm portlist -qf ioctl + atf_check ctladm port -c -d "ioctl" + atf_check -o save:after-ports ctladm portlist -qf ioctl + if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then + atf_fail "Did not create a new ioctl port" + fi + portnum=`diff before-ports after-ports | awk '/ioctl/ {print $2}'`; + atf_check ctladm port -r -d ioctl -p $portnum +} + +atf_init_test_cases() +{ + atf_add_test_case create_ioctl + atf_add_test_case create_ioctl_options + atf_add_test_case disable_ioctl + atf_add_test_case enable_ioctl + atf_add_test_case remove_ioctl +} From nobody Thu Sep 19 20:07:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ml043jpz5XJCH; Thu, 19 Sep 2024 20:07: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 4X8ml02n8hz4SJg; Thu, 19 Sep 2024 20:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GUdfKieL/0rJpCZUsbxjd4KDghUmD3ZZLUX85uun+Hk=; b=FIV9vY+8vwINuStLzkgA+9KgILu2b4TlKkwKHxNPxkl6TQTLTa9O5xqxNWct6DQH+GCOIo kkUIGAuMwoYQWPhE5ghTxdirk82GOQWsKQmdpbhLVQ/I9bIAI4qA+X1p/m7vsxfkRFrb3Y v6WkVo6HRAH9XYuHon/83XdtkXQdFoJKo2seQCXK7lfgouV0Oq++I2Vx5kcn6fv1z4XxyM kyuKHrZaX92475c/+GqlgYAEBU3UbpnRo8Zh+YJdC34xplGf3WKXx01+cItS7uMxhNcyeH 8ZrbXLj66GQ9EkeVM6ye6p8MTnTs3X2mg/n4c/yBesPEJ8AExHxzABJ2tdW3dg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776428; a=rsa-sha256; cv=none; b=pC6k21rQwpIVtS4tuA50MYaseQCW/9Qo0eeJ8YZt95CVxgnwrVgQ2Un8WZpxvH45UgLIg1 +M8lPvTXCW9tNZZFg0+jcSNlRmps074MshQ+5uujUQgb/goewliXDlnCOGu+GqcPTR3njT /lwuD1uDUQvhdnHRR3WQzvvxpMhxJI4jY3i0z3NE4wCHCEs1GZu5ldej4poPH4SXTHdSuh +w9hQtfOWu1Cr+fYq7CuYv8A0hmDo3C+gIwk1u35gF/z0bWxSMMv5rjotQ0/XDsu1XEc7p GavytqpuIUDbstJNcS05vTqjm5n5spQBUqiwJCUawS0fuhJvVaLudQm89HZfMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GUdfKieL/0rJpCZUsbxjd4KDghUmD3ZZLUX85uun+Hk=; b=dW8LrD92JWIGE8cZ9KeDSkq7KUyXPLJGeJFbCaKdB0ORvpWDZeA1wQRvwnsA6RdrasKRA9 2XmWxrBvzf30+fuIdWbS9WFZJx/YV6xTmdnktSqS9KVWU2DjbAMSLfmg+uyV/lqkKAPJaD rpu8OyBbuI4ut9kVGAxKP9cwP0iSvH22ZOts/hImDEx8CXP21KaHXk0BalzMhA9fkTMPM6 51yvsmLciQ3gC46wEgb4i8D5SJmiR7BHlHnrxt/VHZ5cSmomog4/83qU/oVrznzv2zdh0M nziloXopKVS6V9G6QA4WNH+Grc7LBFGcSa1LYj5SOdrcEWSrvjWhgavT0KXYpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ml02NqBzKcp; Thu, 19 Sep 2024 20:07: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 48JK78u3017783; Thu, 19 Sep 2024 20:07:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JK78dh017780; Thu, 19 Sep 2024 20:07:08 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:07:08 GMT Message-Id: <202409192007.48JK78dh017780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 2217ab27adfe - stable/14 - ctladm: print port number with a succesful "port -c" command List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2217ab27adfe6febabee27399333b8cac1370f06 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=2217ab27adfe6febabee27399333b8cac1370f06 commit 2217ab27adfe6febabee27399333b8cac1370f06 Author: Alan Somers AuthorDate: 2024-06-05 23:54:46 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:03:29 +0000 ctladm: print port number with a succesful "port -c" command Make "ctladm port -c" print the port number of the newly successful port. This way it won't have to be guessed by a subsequent "ctladm portlist" command. That means it's safe to use it concurrently with other ctladm processes. In particular, this allows the tests to be run in parallel. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1279 (cherry picked from commit 591de7534fb3acb2e6eef94a1e5e92000d2cf83d) --- usr.sbin/ctladm/ctladm.c | 18 +++++++++++ usr.sbin/ctladm/tests/Makefile | 4 --- usr.sbin/ctladm/tests/port.sh | 70 ++++++++++++++++++++---------------------- 3 files changed, 52 insertions(+), 40 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 91469aef40a7..a7e2fb05ddb8 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -392,7 +392,9 @@ static struct ctladm_opts cctl_fe_table[] = { static int cctl_port(int fd, int argc, char **argv, char *combinedopt) { + char result_buf[1024]; int c; + uint64_t created_port = -1; int32_t targ_port = -1; int retval = 0; int wwnn_set = 0, wwpn_set = 0; @@ -582,6 +584,8 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) case CCTL_PORT_MODE_CREATE: { bzero(&req, sizeof(req)); strlcpy(req.driver, driver, sizeof(req.driver)); + req.result = result_buf; + req.result_len = sizeof(result_buf); if (port_mode == CCTL_PORT_MODE_REMOVE) { req.reqtype = CTL_REQ_REMOVE; @@ -614,6 +618,20 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) warnx("warning: %s", req.error_str); break; case CTL_LUN_OK: + if (port_mode == CCTL_PORT_MODE_CREATE) { + req.result_nvl = nvlist_unpack(result_buf, req.result_len, 0); + if (req.result_nvl == NULL) { + warnx("error unpacking result nvlist"); + break; + } + created_port = nvlist_get_number(req.result_nvl, "port_id"); + printf("Port created successfully\n" + "frontend: %s\n" + "port: %ju\n", driver, + (uintmax_t) created_port); + nvlist_destroy(req.result_nvl); + } else + printf("Port destroyed successfully\n"); break; default: warnx("unknown status: %d", req.status); diff --git a/usr.sbin/ctladm/tests/Makefile b/usr.sbin/ctladm/tests/Makefile index 73ac94d77d21..825e38e6c6e3 100644 --- a/usr.sbin/ctladm/tests/Makefile +++ b/usr.sbin/ctladm/tests/Makefile @@ -3,8 +3,4 @@ PACKAGE= tests ATF_TESTS_SH= port -# "ctladm port" does not report the name of the port just created, so we can't -# cleanup unless we assume that no other test created a port too. -TEST_METADATA+= is_exclusive="true" - .include diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh index 110b89bd965b..782a8ee5b6c1 100644 --- a/usr.sbin/ctladm/tests/port.sh +++ b/usr.sbin/ctladm/tests/port.sh @@ -45,8 +45,9 @@ skip_if_ctld() { cleanup() { driver=$1 - if [ -e after-ports ]; then - diff before-ports after-ports | awk "/$driver/ {print \$2}" | xargs -n1 ctladm port -r -d ioctl -p + if [ -e port-create.txt ]; then + portnum=`awk '/port:/ {print $2}' port-create.txt` + ctladm port -r -d $driver -p $portnum fi } @@ -60,12 +61,13 @@ create_ioctl_body() { skip_if_ctld - atf_check -o save:before-ports ctladm portlist -qf ioctl - atf_check ctladm port -c -d "ioctl" - atf_check -o save:after-ports ctladm portlist -qf ioctl - if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then - atf_fail "Did not create a new ioctl port" - fi + atf_check -o save:port-create.txt ctladm port -c -d "ioctl" + atf_check egrep -q "Port created successfully" port-create.txt + atf_check egrep -q "frontend: *ioctl" port-create.txt + atf_check egrep -q "port: *[0-9]+" port-create.txt + portnum=`awk '/port:/ {print $2}' port-create.txt` + atf_check -o save:portlist.txt ctladm portlist -qf ioctl + atf_check egrep -q "$portnum *YES *ioctl *ioctl" portlist.txt } create_ioctl_cleanup() { @@ -82,13 +84,13 @@ create_ioctl_options_body() { skip_if_ctld - atf_check -o save:before-ports ctladm portlist -qf ioctl - atf_check ctladm port -c -d "ioctl" -O pp=101 -O vp=102 - atf_check -o save:after-ports ctladm portlist -qf ioctl - if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then - atf_fail "Did not create a new ioctl port" - fi - if ! egrep -q '101[[:space:]]+102' after-ports; then + atf_check -o save:port-create.txt ctladm port -c -d "ioctl" -O pp=101 -O vp=102 + atf_check egrep -q "Port created successfully" port-create.txt + atf_check egrep -q "frontend: *ioctl" port-create.txt + atf_check egrep -q "port: *[0-9]+" port-create.txt + portnum=`awk '/port:/ {print $2}' port-create.txt` + atf_check -o save:portlist.txt ctladm portlist -qf ioctl + if ! egrep -q '101[[:space:]]+102' portlist.txt; then ctladm portlist atf_fail "Did not create the port with the specified options" fi @@ -109,13 +111,9 @@ disable_ioctl_body() { skip_if_ctld - atf_check -o save:before-ports ctladm portlist -qf ioctl - atf_check ctladm port -c -d "ioctl" - atf_check -o save:after-ports ctladm portlist -qf ioctl - if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then - atf_fail "Did not create a new ioctl port" - fi - portnum=`diff before-ports after-ports | awk '/ioctl/ {print $2}'`; + atf_check -o save:port-create.txt ctladm port -c -d "ioctl" + portnum=`awk '/port:/ {print $2}' port-create.txt` + atf_check -o save:portlist.txt ctladm portlist -qf ioctl atf_check -o ignore ctladm port -o off -p $portnum atf_check -o match:"^$portnum *NO" ctladm portlist -qf ioctl } @@ -134,13 +132,9 @@ enable_ioctl_body() { skip_if_ctld - atf_check -o save:before-ports ctladm portlist -qf ioctl - atf_check ctladm port -c -d "ioctl" - atf_check -o save:after-ports ctladm portlist -qf ioctl - if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then - atf_fail "Did not create a new ioctl port" - fi - portnum=`diff before-ports after-ports | awk '/ioctl/ {print $2}'`; + atf_check -o save:port-create.txt ctladm port -c -d "ioctl" + portnum=`awk '/port:/ {print $2}' port-create.txt` + atf_check -o save:portlist.txt ctladm portlist -qf ioctl atf_check -o ignore ctladm port -o off -p $portnum atf_check -o ignore ctladm port -o on -p $portnum atf_check -o match:"^$portnum *YES" ctladm portlist -qf ioctl @@ -160,14 +154,18 @@ remove_ioctl_body() { skip_if_ctld - atf_check -o save:before-ports ctladm portlist -qf ioctl - atf_check ctladm port -c -d "ioctl" - atf_check -o save:after-ports ctladm portlist -qf ioctl - if test `wc -l before-ports | cut -w -f2` -ge `wc -l after-ports | cut -w -f2`; then - atf_fail "Did not create a new ioctl port" + # Specify exact pp and vp to make the post-removal portlist check + # unambiguous + atf_check -o save:port-create.txt ctladm port -c -d "ioctl" -O pp=10001 -O vp=10002 + portnum=`awk '/port:/ {print $2}' port-create.txt` + atf_check -o save:portlist.txt ctladm portlist -qf ioctl + atf_check -o inline:"Port destroyed successfully\n" ctladm port -r -d ioctl -p $portnum + # Check that the port was removed. A new port may have been added with + # the same ID, so match against the pp and vp numbers, too. + if ctladm portlist -qf ioctl | egrep -q "^${portnum} .*10001 *10002"; then + ctladm portlist -qf ioctl + atf_fail "port was not removed" fi - portnum=`diff before-ports after-ports | awk '/ioctl/ {print $2}'`; - atf_check ctladm port -r -d ioctl -p $portnum } atf_init_test_cases() From nobody Thu Sep 19 20:07:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ml20Tljz5XJ9J; Thu, 19 Sep 2024 20:07: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 4X8ml13xGRz4SVd; Thu, 19 Sep 2024 20:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+DRysDkudu/QcQGmOWrzDBzYg9c33e+abim/8uLPyo=; b=mVR7wWOr7G4n400IYhM1qJ52fIvTbVjAQlghLqisiHNT9TN2FaJYmkDh4mtixkJY6xYEDi 7ua8nr4Demfj1b/GlJrmkBtdx3lB/X1egZffC08lERjXmyGJSWxB1LXDRrtGJAVf4Ymmj0 Zk/SbAuG/adE2jerK9V5SEL37l0ZNY2OhLLJL9F1TtupYXW9K4ofhISZx3OcPuXg6WczF9 63mN0dEME+C2lWTZPLvDCNwnHEwFj5D6jCbcegdOKIWzAwZKB0e3UmgPhPVqI+IiiAIbiN L4iIuMCMlHPWASoZDfz4qwH1KkhzpEIQjokYPwSVeVQPACEoIhs1QDwPRdLJgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776429; a=rsa-sha256; cv=none; b=O9mf6sgFHi2UuuaeRqVT0w+APgv/KW3MKp7MvwdX04gQXL052VgoH0M8tMIaJ6Uuxgrj7+ 9X0gvV3H09b2ki9jgXi+s+fQ4vVj9gmLD7noOTZ1A5+e3IW9viCPLPBIPXi2oiJtChVF5a xzyltdRO8JfWto6bVeWEmRI6Y5SLudKsfxnmyJaNyZV7JaSf5pxrMWEpY4dJR/f0ri9qkN bG5QrV9NtjH5LoEC/PNG2vBAFAE0iKOXxv9FKfcCNtSNuTVeCa2lmMRksFQwvDmhFhJlYd KdJndoxWixr14WLc+eXGZBzAuI6XBF3loZaGYzHG8myJqCW/9I7ghl9DW7qm1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+DRysDkudu/QcQGmOWrzDBzYg9c33e+abim/8uLPyo=; b=NZFyFqhmKoeywZZBf6R+JJ9hZYo9pX0MTuIZxXcbQtVAQE4uSGepXgLv1RnJCd8aXn5FtJ YVq00KWiLidfRTb/XtHBz63jmiJtAnlBMdPUrXqQtt2lBVMquyZmH6NXZIBXoO50JZJcvX XthfnZIVXtZtiBcKab8APF7kBu8xb4yDjQ2j/0egfmiMZp2iwE1WW97/7ly3QVfgM9jRBf QJb/HuqhWq+9TfYg8zkiL3XnyxC5TxfAW23/a9Z86dTfa2/KwXzWkoEfKcK1Tcf2R9TGgy 6vhzDFWgIsJ5Xii4v2TAKnWZCfcVPLEUvbAF1z3EkQSAmUUi6L7Nrb7uYU/2Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ml13R1yzKSW; Thu, 19 Sep 2024 20:07: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 48JK79XR017844; Thu, 19 Sep 2024 20:07:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JK79qX017841; Thu, 19 Sep 2024 20:07:09 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:07:09 GMT Message-Id: <202409192007.48JK79qX017841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e48e80fcb71a - stable/14 - ctladm: better documentation for adding and removing cfiscsi ports List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e48e80fcb71ade5d76c3fda7331db0708c63b81d Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e48e80fcb71ade5d76c3fda7331db0708c63b81d commit e48e80fcb71ade5d76c3fda7331db0708c63b81d Author: Alan Somers AuthorDate: 2024-06-06 17:19:19 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:03:29 +0000 ctladm: better documentation for adding and removing cfiscsi ports MFC after: 2 weeks Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1279 (cherry picked from commit afecc74cd7158da8e89c26c5267bc715c2417fe7) --- sys/cam/ctl/ctl_frontend_iscsi.c | 27 ++++++-- usr.sbin/ctladm/ctladm.8 | 32 +++++++-- usr.sbin/ctladm/tests/port.sh | 146 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 191 insertions(+), 14 deletions(-) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 5c7cdaf0770e..89528d94170c 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2150,17 +2150,24 @@ cfiscsi_ioctl_port_create(struct ctl_req *req) uint16_t tag; target = dnvlist_get_string(req->args_nvl, "cfiscsi_target", NULL); - alias = dnvlist_get_string(req->args_nvl, "cfiscsi_target_alias", NULL); + if (target == NULL) { + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Missing required argument: cfiscsi_target"); + return; + } + val = dnvlist_get_string(req->args_nvl, "cfiscsi_portal_group_tag", NULL); - - if (target == NULL || val == NULL) { + if (val == NULL) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "Missing required argument"); + "Missing required argument: cfiscsi_portal_group_tag"); return; } + alias = dnvlist_get_string(req->args_nvl, "cfiscsi_target_alias", NULL); + tag = strtoul(val, NULL, 0); ct = cfiscsi_target_find_or_create(&cfiscsi_softc, target, alias, tag); if (ct == NULL) { @@ -2251,13 +2258,19 @@ cfiscsi_ioctl_port_remove(struct ctl_req *req) uint16_t tag; target = dnvlist_get_string(req->args_nvl, "cfiscsi_target", NULL); + if (target == NULL) { + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Missing required argument: cfiscsi_target"); + return; + } + val = dnvlist_get_string(req->args_nvl, "cfiscsi_portal_group_tag", NULL); - - if (target == NULL || val == NULL) { + if (val == NULL) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "Missing required argument"); + "Missing required argument: cfiscsi_portal_group_tag"); return; } diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index 4e7288dac6b6..a7eb1d58cbbf 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -35,7 +35,7 @@ .\" .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" -.Dd June 5, 2024 +.Dd June 6, 2024 .Dt CTLADM 8 .Os .Sh NAME @@ -166,7 +166,7 @@ .Op Fl o Ar on|off .Op Fl w Ar wwpn .Op Fl W Ar wwnn -.Op Fl O Ar pp|vp +.Op Fl O Ar name=value .Op Fl p Ar targ_port .Op Fl r .Op Fl t Ar fe_type @@ -618,7 +618,7 @@ The WWNN and WWPN may both be specified at the same time, but cannot be combined with enabling/disabling or listing ports. .Bl -tag -width 12n .It Fl c -Create new frontend port using free pp and vp=0. +Create new frontend port. .It Fl d Ar driver Specify the name of the frontend driver used by the .Pq Fl c @@ -637,7 +637,31 @@ If no port number or port type is specified, all ports are turned on or off. .It Fl O Ar pp|vp Specify generic options on the ioctl frontend port. -At present, only pp and vp port numbers can be set. +The list of recognized options is driver-dependent. +The +.Dq ioctl +driver recognizes +.Dq pp +and +.Dq vp . +The +.Dq iscsi +driver recongizes +.Dq cfiscsi_portal_group_tag , +.Dq cfiscsi_target , +and +.Dq cfiscsi_target_alias . +The +.Dq nvmf +driver recognizes +.Dq subnqn , +.Dq portid , +.Dq max_io_qsize , +.Dq enable_timeout , +.Dq ioccsz , +.Dq nn , +and +.Dq serial . .It Fl p Ar targ_port Specify the frontend port number. The port numbers can be found in the frontend port list. diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh index 782a8ee5b6c1..161759ec14d0 100644 --- a/usr.sbin/ctladm/tests/port.sh +++ b/usr.sbin/ctladm/tests/port.sh @@ -30,11 +30,20 @@ # * Creating umass ports # TODO -# * Creating iscsi ports # * Creating nvmf ports # * Creating ha ports # * Creating fc ports +# The PGTAG can be any 16-bit number. The only constraint is that each +# PGTAG,TARGET pair must be globally unique. +PGTAG=30257 + +load_cfiscsi() { + if ! kldstat -q -m cfiscsi; then + kldload cfiscsi || atf_skip "could not load cfscsi kernel mod" + fi +} + skip_if_ctld() { if service ctld onestatus > /dev/null; then # If ctld is running on this server, let's not interfere. @@ -46,8 +55,18 @@ cleanup() { driver=$1 if [ -e port-create.txt ]; then - portnum=`awk '/port:/ {print $2}' port-create.txt` - ctladm port -r -d $driver -p $portnum + case "$driver" in + "ioctl") + PORTNUM=`awk '/port:/ {print $2}' port-create.txt` + ctladm port -r -d $driver -p $PORTNUM + ;; + "iscsi") + TARGET=`awk '/target:/ {print $2}' port-create.txt` + # PORTNUM is ignored, but must be set + PORTNUM=9999 + ctladm port -r -d $driver -p "$PORTNUM" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET + ;; + esac fi } @@ -74,6 +93,75 @@ create_ioctl_cleanup() cleanup ioctl } +atf_test_case create_iscsi cleanup +create_iscsi_head() +{ + atf_set "descr" "ctladm can create a new iscsi port" + atf_set "require.user" "root" +} +create_iscsi_body() +{ + skip_if_ctld + load_cfiscsi + + TARGET=iqn.2018-10.myhost.create_iscsi + atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" + echo "target: $TARGET" >> port-create.txt + atf_check egrep -q "Port created successfully" port-create.txt + atf_check egrep -q "frontend: *iscsi" port-create.txt + atf_check egrep -q "port: *[0-9]+" port-create.txt + atf_check -o save:portlist.txt ctladm portlist -qf iscsi + # Unlike the ioctl driver, the iscsi driver creates ports in a disabled + # state, so the port's lunmap may be set before enabling it. + atf_check egrep -q "$portnum *NO *iscsi *iscsi.*$TARGET" portlist.txt +} +create_iscsi_cleanup() +{ + cleanup iscsi +} + +atf_test_case create_iscsi_alias cleanup +create_iscsi_alias_head() +{ + atf_set "descr" "ctladm can create a new iscsi port with a target alias" + atf_set "require.user" "root" +} +create_iscsi_alias_body() +{ + skip_if_ctld + load_cfiscsi + + TARGET=iqn.2018-10.myhost.create_iscsi_alias + ALIAS="foobar" + atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" -O cfiscsi_target_alias="$ALIAS" + echo "target: $TARGET" >> port-create.txt + atf_check egrep -q "Port created successfully" port-create.txt + atf_check egrep -q "frontend: *iscsi" port-create.txt + atf_check egrep -q "port: *[0-9]+" port-create.txt + atf_check -o save:portlist.txt ctladm portlist -qvf iscsi + atf_check egrep -q "cfiscsi_target_alias=$ALIAS" portlist.txt +} +create_iscsi_alias_cleanup() +{ + cleanup iscsi +} + +atf_test_case create_iscsi_without_required_args +create_iscsi_without_required_args_head() +{ + atf_set "descr" "ctladm will gracefully fail to create an iSCSI target if required arguments are missing" + atf_set "require.user" "root" +} +create_iscsi_without_required_args_body() +{ + skip_if_ctld + load_cfiscsi + + TARGET=iqn.2018-10.myhost.create_iscsi + atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_target" ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG + atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_portal_group_tag" ctladm port -c -d "iscsi" -O cfiscsi_target=$TARGET +} + atf_test_case create_ioctl_options cleanup create_ioctl_options_head() { @@ -168,11 +256,63 @@ remove_ioctl_body() fi } +atf_test_case remove_iscsi +remove_iscsi_head() +{ + atf_set "descr" "ctladm can remove an iscsi port" + atf_set "require.user" "root" +} +remove_iscsi_body() +{ + skip_if_ctld + load_cfiscsi + + TARGET=iqn.2018-10.myhost.remove_iscsi + atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" + portnum=`awk '/port:/ {print $2}' port-create.txt` + atf_check -o save:portlist.txt ctladm portlist -qf iscsi + atf_check -o inline:"Port destroyed successfully\n" ctladm port -r -d iscsi -p 9999 -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" + # Check that the port was removed. A new port may have been added with + # the same ID, so match against the target and tag, too. + PGTAGHEX=0x7631 # PGTAG in hex + if ctladm portlist -qf iscsi | egrep -q "^${portnum} .*$PGTAG +[0-9]+ +$TARGET,t,$PGTAGHEX"; then + ctladm portlist -qf iscsi + atf_fail "port was not removed" + fi +} + +atf_test_case remove_iscsi_without_required_args cleanup +remove_iscsi_without_required_args_head() +{ + atf_set "descr" "ctladm will gracefully fail to remove an iSCSI target if required arguments are missing" + atf_set "require.user" "root" +} +remove_iscsi_without_required_args_body() +{ + skip_if_ctld + load_cfiscsi + + TARGET=iqn.2018-10.myhost.remove_iscsi_without_required_args + atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" + echo "target: $TARGET" >> port-create.txt + atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_portal_group_tag" ctladm port -r -d iscsi -p 9999 -O cfiscsi_target="$TARGET" + atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_target" ctladm port -r -d iscsi -p 9999 -O cfiscsi_portal_group_tag=$PGTAG +} +remove_iscsi_without_required_args_cleanup() +{ + cleanup iscsi +} + atf_init_test_cases() { atf_add_test_case create_ioctl + atf_add_test_case create_iscsi + atf_add_test_case create_iscsi_without_required_args + atf_add_test_case create_iscsi_alias atf_add_test_case create_ioctl_options atf_add_test_case disable_ioctl atf_add_test_case enable_ioctl atf_add_test_case remove_ioctl + atf_add_test_case remove_iscsi + atf_add_test_case remove_iscsi_without_required_args } From nobody Thu Sep 19 20:07:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ml262g8z5XHZP; Thu, 19 Sep 2024 20:07: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 4X8ml24lSLz4SbJ; Thu, 19 Sep 2024 20:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=29SCUGUnua7cYSzfMwGqguyP5VwdgNyCchctiHjAML0=; b=PrxbDpGpOiDpq8ZzaUFvlYab9dfXimIR9KTwtrB//X5iat+dj76v6Z4CU+6e5dhaouVwLQ hpPVV7DdRAjlsxFDzrUR2rT1ySUE/1GfJ3N14Y99yJ+xHfFPKTphUQVTvNZdY9z44ezrwJ 8tA0QyHP+GqGuLB3xBjeILlnNYjdCVawT0zTK1F/4XzwNI45VbzsRlGr/VVR+QjQg5/A6p Z7luLgvMS71DUL+4vy4hz4sRq/4WIqxacoDHjEUu8jP1xcWyhSBmmtkfSYtBIA1f2U7f7G IF0GBxp5uj7iPJhaViVgvsu+UwSLFZDCJLce7EMZA0enza1W6OMfRm0/m9EJdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776430; a=rsa-sha256; cv=none; b=Knv2TF4tr3XrqMlwxgKsBEGZ5B9ZpF+5F9L9zpzZGSOHBf3RX709oL7ZQNnMCuHg+UDsck GWl2CGvmXUS/v5jV/nU3y3TCjNC1dUUBNXcUo58Vx+v2/oTZGprqpaF/nUsT2kZ3irNCy5 1QnoOp5K7dmCpN82WC9PnowBgG8JiP2+l2IKGcRGnkFBwvm0cCnYMLa3TJ1Euw2pKWej58 7LRwZrWpGYYBVd/NRxu9oUMvk8W/eA9clFNnw3+LW4cWS6qdtQpzqmVRS64F3ZbdqNRUO7 CjWSdl0uKDSQppvW/k3KUdmybRYSgm7l7L1ekUDdnykEAxwl1ZR+IuP3JdwdLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=29SCUGUnua7cYSzfMwGqguyP5VwdgNyCchctiHjAML0=; b=qXaM65X9NUWSgVIbNIsJe6WvW0pvynwCXucHxf1LKcCcukrVirzjJSQzHIPbgtRD6fTC+f jI/kcN+0nTQ3jxE9wlrgPqYRYL6Rz1QHtueUXk1LjXlGiIgAwfLk5p4juIWriKm8393kCq WwqiRVVbLZLLlP/OdsxFVzuWjRyJBko3qesuuq9s3N80tn3pGxZNhAsS8i875ong+r4107 mQbJKOGFzrzPSz/IshMpSOr1BSiyvI9Z3zeP/zBx0nA9bEfRiMWPqpia5guAaNDIU/vfBd 08F+2ynx5fjchaQjTP2aj1E6T2mvUx5ykipI8hZVW3pJ2+sGRoXRJgHjgNYcCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ml24M9NzKcq; Thu, 19 Sep 2024 20:07: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 48JK7AHZ017901; Thu, 19 Sep 2024 20:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JK7AbQ017898; Thu, 19 Sep 2024 20:07:10 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:07:10 GMT Message-Id: <202409192007.48JK7AbQ017898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: f07fc92df041 - stable/14 - ctladm: don't require the use of "-p" with "port -r" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f07fc92df041ba020c138b0de77b0704bc9ef087 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f07fc92df041ba020c138b0de77b0704bc9ef087 commit f07fc92df041ba020c138b0de77b0704bc9ef087 Author: Alan Somers AuthorDate: 2024-06-06 19:14:43 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:03:30 +0000 ctladm: don't require the use of "-p" with "port -r" When removing a port, the ioctl frontend requires the "-p" argument. But other frontends, like cfiscsi, do not. So don't require that argument in the ctladm command. The frontend driver will report an error if any required argument is missing. Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1279 (cherry picked from commit edbd489d09babebdc6c03924a912013be584c409) ctladm: don't require the use of "-p" with "port -r", part 2 * Remove a now superfluous FALLTHROUGH hint * Don't specify "-p" with an empty argument in the tests Reported by: jhb (cherry picked from commit 7f50027321db3b08477f6236abded0297e9e5ed8) --- sys/cam/ctl/ctl_frontend_ioctl.c | 2 +- usr.sbin/ctladm/ctladm.8 | 3 +-- usr.sbin/ctladm/ctladm.c | 11 +++-------- usr.sbin/ctladm/tests/port.sh | 30 ++++++++++++++++++++++++------ 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/sys/cam/ctl/ctl_frontend_ioctl.c b/sys/cam/ctl/ctl_frontend_ioctl.c index 428fb9983b9f..a93f6cd5a4c5 100644 --- a/sys/cam/ctl/ctl_frontend_ioctl.c +++ b/sys/cam/ctl/ctl_frontend_ioctl.c @@ -268,7 +268,7 @@ cfi_ioctl_port_remove(struct ctl_req *req) if (port_id == -1) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "port_id not provided"); + "Missing required argument: port_id"); return; } diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index a7eb1d58cbbf..6470f5d5a8ee 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -666,8 +666,7 @@ and Specify the frontend port number. The port numbers can be found in the frontend port list. .It Fl r -Remove port specified with -.Pq Fl p Ar targ_port . +Remove a port. .It Fl t Ar fe_type Specify the frontend type used by the .Pq Fl o , diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index a7e2fb05ddb8..8538d8311332 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -575,12 +575,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) break; } case CCTL_PORT_MODE_REMOVE: - if (targ_port == -1) { - warnx("%s: -r requires -p", __func__); - retval = 1; - goto bailout; - } - /* FALLTHROUGH */ case CCTL_PORT_MODE_CREATE: { bzero(&req, sizeof(req)); strlcpy(req.driver, driver, sizeof(req.driver)); @@ -589,8 +583,9 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) if (port_mode == CCTL_PORT_MODE_REMOVE) { req.reqtype = CTL_REQ_REMOVE; - nvlist_add_stringf(option_list, "port_id", "%d", - targ_port); + if (targ_port != -1) + nvlist_add_stringf(option_list, "port_id", "%d", + targ_port); } else req.reqtype = CTL_REQ_CREATE; diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh index 161759ec14d0..a9ff609d3f4c 100644 --- a/usr.sbin/ctladm/tests/port.sh +++ b/usr.sbin/ctladm/tests/port.sh @@ -62,9 +62,7 @@ cleanup() { ;; "iscsi") TARGET=`awk '/target:/ {print $2}' port-create.txt` - # PORTNUM is ignored, but must be set - PORTNUM=9999 - ctladm port -r -d $driver -p "$PORTNUM" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET + ctladm port -r -d $driver -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET ;; esac fi @@ -93,6 +91,25 @@ create_ioctl_cleanup() cleanup ioctl } +atf_test_case remove_ioctl_without_required_args cleanup +remove_ioctl_without_required_args_head() +{ + atf_set "descr" "ctladm will gracefully fail to remove an ioctl target if required arguments are missing" + atf_set "require.user" "root" +} +remove_ioctl_without_required_args_body() +{ + skip_if_ctld + + atf_check -o save:port-create.txt ctladm port -c -d "ioctl" + atf_check egrep -q "Port created successfully" port-create.txt + atf_check -s exit:1 -e match:"Missing required argument: port_id" ctladm port -r -d "ioctl" +} +remove_ioctl_without_required_args_cleanup() +{ + cleanup ioctl +} + atf_test_case create_iscsi cleanup create_iscsi_head() { @@ -271,7 +288,7 @@ remove_iscsi_body() atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" portnum=`awk '/port:/ {print $2}' port-create.txt` atf_check -o save:portlist.txt ctladm portlist -qf iscsi - atf_check -o inline:"Port destroyed successfully\n" ctladm port -r -d iscsi -p 9999 -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" + atf_check -o inline:"Port destroyed successfully\n" ctladm port -r -d iscsi -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" # Check that the port was removed. A new port may have been added with # the same ID, so match against the target and tag, too. PGTAGHEX=0x7631 # PGTAG in hex @@ -295,8 +312,8 @@ remove_iscsi_without_required_args_body() TARGET=iqn.2018-10.myhost.remove_iscsi_without_required_args atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" echo "target: $TARGET" >> port-create.txt - atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_portal_group_tag" ctladm port -r -d iscsi -p 9999 -O cfiscsi_target="$TARGET" - atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_target" ctladm port -r -d iscsi -p 9999 -O cfiscsi_portal_group_tag=$PGTAG + atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_portal_group_tag" ctladm port -r -d iscsi -O cfiscsi_target="$TARGET" + atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_target" ctladm port -r -d iscsi -O cfiscsi_portal_group_tag=$PGTAG } remove_iscsi_without_required_args_cleanup() { @@ -313,6 +330,7 @@ atf_init_test_cases() atf_add_test_case disable_ioctl atf_add_test_case enable_ioctl atf_add_test_case remove_ioctl + atf_add_test_case remove_ioctl_without_required_args atf_add_test_case remove_iscsi atf_add_test_case remove_iscsi_without_required_args } From nobody Thu Sep 19 20:07:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ml37358z5XJLM; Thu, 19 Sep 2024 20:07: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 4X8ml35g4Dz4SmJ; Thu, 19 Sep 2024 20:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UwH+gLnn3PQnd1xwdedVZgi8d3RSyB96ZELzRzcywyc=; b=fDssBiSFq+NyeV6Xs8lrBeaR80/Q4XTTnYP1z/veGcNLZ6EpxDTwxf+EIO9nG2AN7Z+Pau 5EJx/mtDHiRcmNbOoB/0OJW3m6tVMuei26lyXQKBeWbS8oRKvVyE+HzMApYWuFPrUrpCLt E2OuXk6Jz7UIYQVW+SUIWrcDVu8k8W97R0ht2hHt6jtEl6oE2WRrr+0nW6QvYZnpH4nkt3 QkVYlxgErso78elz/BtESfu0MZxgqJ9VeyI3UI/PU2J5eVx+Mphmx0Of1i0lMGxVvDsZ7V rcsIv4aJMVjTQfJxtNuJ7+sWQgpwKVUlyt268nxn74mP2w2XKbba0UEyUfXUQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776431; a=rsa-sha256; cv=none; b=QTdB9t13u8auKfMugoDbAKCopUwiPCtNpihza3/w1AaZidjY/RP+gFzTDtAspgTTagOkxP Mbf+BmRK/wf3J/yZpvie+ij4cSpgndoUxzisZO36f4ZALjjszjOqYbTt2CJvP/WFkvF67Y cfB7vt1cNxCXJM+9lpSvIQjsWKqWTP8TOQUxLXYpheBAVX31ZkKRM/TZDyiFyonaepPMSh RV3xqsb7AHcSEFOYp6jg17KiP0ajQab7dDH2BOBo9vLjVPxfqiGf/TqpExEi20raJ5XOAz 2GiLnQTWk520KDHz/qfeSA0rKO/dtW5nof56d+rqMkLSynCwNJM88MZavP14Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UwH+gLnn3PQnd1xwdedVZgi8d3RSyB96ZELzRzcywyc=; b=wUhKUVddRD7vc5EeqnqLIzyLd2W0/VDll3iIyZDMVC6qgGPTiLYzwgZhdkaE+gSBPYYmLT Jevgwtv2RQt0FJKksuS9UHlFRgp0Qf5d+BuGhKoFkVBfkwX2uZiOEt4VBmMhO0qyJcAgcG nAPQ2ZSnRoWQ9U+TNJMYmi2JE3ZNHKCkX4j0XCyf3aF5Oki+HyfwBMayxFIncvLdkNhIZk H2vyrztjhhrbIsZVPajMp7l6RDQ1ldFqcFeUmWrMAsXWhHOH1nFNnrrT48P45UJ0aL6Iq+ x7/aZSJByQhki5LLKeMI1oEpxMYMhm6GQwg240eIwpsXExQdrUh5nHIU7kmlTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ml35CprzKfL; Thu, 19 Sep 2024 20:07: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 48JK7B4f017949; Thu, 19 Sep 2024 20:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JK7BGJ017946; Thu, 19 Sep 2024 20:07:11 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:07:11 GMT Message-Id: <202409192007.48JK7BGJ017946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 95fbdf9df5b0 - stable/14 - ctladm: deprecate the undocumented "port -l" option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 95fbdf9df5b0918668517298d3ca77b65361b756 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=95fbdf9df5b0918668517298d3ca77b65361b756 commit 95fbdf9df5b0918668517298d3ca77b65361b756 Author: Alan Somers AuthorDate: 2024-06-06 21:09:38 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:03:39 +0000 ctladm: deprecate the undocumented "port -l" option It was mostly removed from the man page in 9c887a4f86f5fd4f51c23443dc8435e52783a782, but left in the command. Fully remove it from the man page, and warn if anybody uses it. Remove it entirely for FreeBSD 16. PR: 279546 Reviewed by: mav Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D45522 (cherry picked from commit bb95fbf634b3459363a136899e9b241a2f6c49cd) --- usr.sbin/ctladm/ctladm.8 | 5 +---- usr.sbin/ctladm/ctladm.c | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index 6470f5d5a8ee..c8c013852246 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -590,9 +590,7 @@ The serial number is returned when the error is injected. .El .It Ic port Perform one of several CTL frontend port operations. -Either get a list of frontend ports -.Pq Fl l , -create a new frontend port +Either create a new frontend port .Pq Fl c , destroy a frontend port .Pq Fl r , @@ -607,7 +605,6 @@ for a given port. One of .Fl c , .Fl r , -.Fl l , .Fl o , or .Fl w diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 8538d8311332..67beef1e041e 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -180,7 +180,11 @@ static struct ctladm_opts option_table[] = { {"lunmap", CTLADM_CMD_LUNMAP, CTLADM_ARG_NONE, "p:l:L:"}, {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:o:s:"}, +#if (__FreeBSD_version < 1600000) {"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:O:d:crp:qt:w:W:x"}, +#else + {"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "o:O:d:crp:t:w:W:"}, +#endif {"portlist", CTLADM_CMD_PORTLIST, CTLADM_ARG_NONE, "f:ilp:qvx"}, {"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"}, {"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"}, @@ -405,7 +409,9 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) char *driver = NULL; nvlist_t *option_list; ctl_port_type port_type = CTL_PORT_NONE; +#if (__FreeBSD_version < 1600000) int quiet = 0, xml = 0; +#endif option_list = nvlist_create(0); if (option_list == NULL) @@ -413,12 +419,22 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { +#if (__FreeBSD_version < 1600000) case 'l': + warnx("ctladm port -l is deprecated. " + "Use ctladm portlist instead"); if (port_mode != CCTL_PORT_MODE_NONE) goto bailout_badarg; port_mode = CCTL_PORT_MODE_LIST; break; + case 'q': + quiet = 1; + break; + case 'x': + xml = 1; + break; +#endif case 'c': port_mode = CCTL_PORT_MODE_CREATE; break; @@ -478,9 +494,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) case 'p': targ_port = strtol(optarg, NULL, 0); break; - case 'q': - quiet = 1; - break; case 't': { ctladm_optret optret; ctladm_cmdargs argnum; @@ -524,9 +537,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) wwpn = strtoull(optarg, NULL, 0); wwpn_set = 1; break; - case 'x': - xml = 1; - break; } } @@ -558,6 +568,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) entry.targ_port = targ_port; switch (port_mode) { +#if (__FreeBSD_version < 1600000) case CCTL_PORT_MODE_LIST: { char opts[] = "xq"; char argx[] = "-x"; @@ -574,6 +585,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) cctl_portlist(fd, argcx, argvx, opts); break; } +#endif case CCTL_PORT_MODE_REMOVE: case CCTL_PORT_MODE_CREATE: { bzero(&req, sizeof(req)); @@ -675,7 +687,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) fprintf(stdout, "Front End Ports disabled\n"); break; default: - warnx("%s: one of -l, -o or -w/-W must be specified", __func__); + warnx("%s: one of -c, -r, -o or -w/-W must be specified", __func__); retval = 1; goto bailout; break; @@ -3954,7 +3966,6 @@ usage(int error) "port options:\n" "-c : create new ioctl or iscsi frontend port\n" "-d : specify ioctl or iscsi frontend type\n" -"-l : list frontend ports\n" "-o on|off : turn frontend ports on or off\n" "-O pp|vp : create new frontend port using pp and/or vp\n" "-w wwnn : set WWNN for one frontend\n" @@ -3962,8 +3973,6 @@ usage(int error) "-t port_type : specify fc, scsi, ioctl, internal frontend type\n" "-p targ_port : specify target port number\n" "-r : remove frontend port\n" -"-q : omit header in list output\n" -"-x : output port list in XML format\n" "portlist options:\n" "-f frontend : specify frontend type\n" "-i : report target and initiators addresses\n" From nobody Thu Sep 19 20:11:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8mqj1NkBz5XK3F; Thu, 19 Sep 2024 20:11: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 4X8mqj0f37z4VgR; Thu, 19 Sep 2024 20:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cH+cQhLWuELlpMjQw8pfcgQxn8D6T/mHF8yqZGX0DTE=; b=h6D257KAEx+U++1fnfxDW1KaiOi8xk1kfaPkxfY6SUjilrfo7Azidx4pflIsyYdrBWnw1H rpI/7HwDM4mFwx9V2LFRcWIjWRO0yyWecI7k8tjT2nZLb/ZlCUYIlWnBwTub6kPk2c6H/l wkdCEi9bTtyeFsQjl1Unhi8UyBV5f4to8MmCStX9aG3ICgSblieN38Iav2uNqQnS/FFdth Uu2/Es2o7DIGDnjnjMP487MLWuvEHDX4Jl0vgzXK8GHt/2v9kLy2rT4YIDGhoNjOt4yH+W ra3PnwlLSBuCYhkpxnAlQma1Eipss98sr7xTa4HDlOoyqE3zR/JDxGAU7qbyjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776673; a=rsa-sha256; cv=none; b=QYW1II0/NrK4iYvu2pGrIs/u/X3TdXz5Ze9ARxeQSwBxxWU5K1h7Avo3ZK+R8FZSaBNRez lZtzMN12lkk9H3RrDk2PdRM1DZXPabeZk518Q+ItJ/UGkhg97YfraxR2wOFJlZikMPMUa3 c1Kw/1WzDCeg0r5oGmVRWsDPZ5TvrxahQV3j/14XkJeFti04FSQ5ROe/bNwBEiv9HwrRpj y6ho6kcMweXV3oOINJOlP/n1B/9UZ4FVR7tcOhFNiZqf9xkqNaLbZsgU1WIfXluVVioXG0 NvImESvqTZoQaDl0s5+7EZDZuT/RgNHxj3RLhk7nJc2GKMBBocGB3TnVR+Hgkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cH+cQhLWuELlpMjQw8pfcgQxn8D6T/mHF8yqZGX0DTE=; b=TjsmVyA1h5WOGjcBjLFHFrAFw0WS/gi4bsqhaO4N41avBE/MbvQXZ2XAedlSn5Jhq+Iu9x t5D1X2ugqZ6Iu+4sVrmaaKgEB4RoPALmJacY33UrkN9bdYSR/XTRQS4dWsJpSxXjlgieEg WOxDXYDJcUQWmqjAdowvU1If4Drpn6H1yAiwmB9TT1613ZKY6r3sIq77ToWr6Du1J3MSnA j70HsAE718fgt5h1vTk2JH9uB+0Gkvl2CIDj/ZHxSN1p+PyHrkl/W6otV7ujbRzmSvTNHS 6b9r33P3KeftOjSUVpWBnq0M+NQHhESMagVRLOPxS3OEuesp/HIWfuonKt7sGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8mqj05cLzKsG; Thu, 19 Sep 2024 20:11: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 48JKBCSW030828; Thu, 19 Sep 2024 20:11:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKBCr5030825; Thu, 19 Sep 2024 20:11:12 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:11:12 GMT Message-Id: <202409192011.48JKBCr5030825@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: 4a5fa1086184 - main - procfs require PRIV_PROC_MEM_WRITE to write mem List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a5fa1086184f7450f63d4a8e403b16f40a78fce Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4a5fa1086184f7450f63d4a8e403b16f40a78fce commit 4a5fa1086184f7450f63d4a8e403b16f40a78fce Author: Simon J. Gerraty AuthorDate: 2024-09-19 20:10:27 +0000 Commit: Simon J. Gerraty CommitDate: 2024-09-19 20:10:27 +0000 procfs require PRIV_PROC_MEM_WRITE to write mem Add a priv_check for PRIV_PROC_MEM_WRITE which will be blocked by mac_veriexec if being enforced, unless the process has a maclabel to grant priv. Reviewed by: stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D46692 --- sys/fs/procfs/procfs_mem.c | 3 +++ sys/kern/kern_priv.c | 4 +++- sys/security/mac_grantbylabel/mac_grantbylabel.c | 2 ++ sys/security/mac_veriexec/mac_veriexec.c | 1 + sys/sys/priv.h | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 6ef725ee0ee7..159b40785172 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -61,6 +62,8 @@ procfs_doprocmem(PFS_FILL_ARGS) PROC_LOCK(p); error = p_candebug(td, p); + if (error == 0 && uio->uio_rw == UIO_WRITE) + error = priv_check(td, PRIV_PROC_MEM_WRITE); PROC_UNLOCK(p); if (error == 0) error = proc_rwmem(p, uio); diff --git a/sys/kern/kern_priv.c b/sys/kern/kern_priv.c index c146f9e6f8d5..83fd246eef9b 100644 --- a/sys/kern/kern_priv.c +++ b/sys/kern/kern_priv.c @@ -242,7 +242,9 @@ priv_check_cred(struct ucred *cred, int priv) * but non-root users are expected to be able to read it (provided they * have permission to access /dev/[k]mem). */ - if (priv == PRIV_KMEM_READ) { + switch (priv) { + case PRIV_KMEM_READ: + case PRIV_PROC_MEM_WRITE: /* we already checked candebug */ error = 0; goto out; } diff --git a/sys/security/mac_grantbylabel/mac_grantbylabel.c b/sys/security/mac_grantbylabel/mac_grantbylabel.c index 848131e54590..4d14577820eb 100644 --- a/sys/security/mac_grantbylabel/mac_grantbylabel.c +++ b/sys/security/mac_grantbylabel/mac_grantbylabel.c @@ -218,6 +218,7 @@ mac_grantbylabel_priv_grant(struct ucred *cred, int priv) return rc; /* not interested */ switch (priv) { + case PRIV_PROC_MEM_WRITE: case PRIV_KMEM_READ: case PRIV_KMEM_WRITE: break; @@ -244,6 +245,7 @@ mac_grantbylabel_priv_grant(struct ucred *cred, int priv) if (label & GBL_IPC) rc = 0; break; + case PRIV_PROC_MEM_WRITE: case PRIV_KMEM_READ: case PRIV_KMEM_WRITE: if (label & GBL_KMEM) diff --git a/sys/security/mac_veriexec/mac_veriexec.c b/sys/security/mac_veriexec/mac_veriexec.c index 7ac09e2acf0f..490601863197 100644 --- a/sys/security/mac_veriexec/mac_veriexec.c +++ b/sys/security/mac_veriexec/mac_veriexec.c @@ -435,6 +435,7 @@ mac_veriexec_priv_check(struct ucred *cred, int priv) error = 0; switch (priv) { case PRIV_KMEM_WRITE: + case PRIV_PROC_MEM_WRITE: case PRIV_VERIEXEC_CONTROL: /* * Do not allow writing to memory or manipulating veriexec, diff --git a/sys/sys/priv.h b/sys/sys/priv.h index a61de8d32fe0..7a5773da220f 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -513,6 +513,7 @@ */ #define PRIV_KMEM_READ 680 /* Open mem/kmem for reading. */ #define PRIV_KMEM_WRITE 681 /* Open mem/kmem for writing. */ +#define PRIV_PROC_MEM_WRITE 682 /* Open /proc//mem for writing. */ /* * Kernel debugger privileges. From nobody Thu Sep 19 20:21:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3G3mjfz5XLF3; Thu, 19 Sep 2024 20:21: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 4X8n3G3J8Nz4Wsc; Thu, 19 Sep 2024 20:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yIsZgk8s9TuRSJ0hg5oXK0xE8ULHxnUn8tU2h9Y6MbI=; b=qD6vIzRfLLNQbPAOLIhgnYPAR/1hx8vSj0fmMMF2cB/e4USnF0o3KzS+MLIXXAN0xmH+5V 65S1uNo7uTyc2SFsFEIRCKBaYPlV8SLN7gPeAQr1s8slxhnFriPRaE/z48mSPw00Y07Cyv tlKdnZTwzaCeclNUD3Sk8LcpHG33ndLyrVpTq29s019lb6QZDINmQuAsg4t2o2mVExfju8 2UTTB58OeRwwYgbqNFAqhyJkQxOJGxjL6OCa+k/THCK1qb6cxUO21Om5pCsK/lU9IkFkNU FJ0w/coL3Jo3YjI3YAyiJ4QXBvvUIIeFfYLIfGvgLlnB69QfroduRLks6Ual9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777274; a=rsa-sha256; cv=none; b=m2M1LnV1RMWFGPMkvKgt151+mnDGRtCrqtYaHT91nt22M+cj4fRPqioWVGiDIAXrcjsWug iFbrIivhK9R1kr4eom3aUunD17XHkBMc9/m6H3ol2KgHXNDQjezAzo4C14AQEqOlCwNynS 06SFKTfF+mdp7DkgFTMdlYlE/xx/rp7csXfAtOZwHSEukO8FOsCEhTwMqd7LMMiRmaZ40t 3NLSWhmIdZttdTi0MPOPJvoqB7FAaX1tE9QmMlBxlxd2/ox7Er8Lk1Akb4Xq727Xac0jlp FjuiUpZkCnh1ZG15URG0533BTXioCYSpdKPkijsESvEB29FTckvmx7CAqezA5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yIsZgk8s9TuRSJ0hg5oXK0xE8ULHxnUn8tU2h9Y6MbI=; b=xEh7ZvQofrw9jcvhiM6qh793FUVizwNUdTUz3rXWuLMY9uce6WSAaclMb27g21Y8usvOFt kJ9jD+8KZpiulLULWto+5mTw49RRppVKt1IlvYiRC1xxpLmJ8MBKoMlIMFBJZt1GZpkAD+ DAXVH8IgsYBRti7qZDXs9Qp+Pkbd6Q4Gk//c9zsHk2OCkJBJefouLWckMC80kZfPQAkKNI 6AUzg2mo2gqy8bBAvOSp4puNFKaD0EGw2AKx4+KlNYphg98A2VfR+XA3Ma+nXTWIcmAEQD w22r8vdWf8SowyYrIPDxHwplxa4l4oy/8Lq67oxyIWAqeQbBp6vEZvtJ/Kk5sA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3G2vP7zKTQ; Thu, 19 Sep 2024 20:21: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 48JKLEM9046220; Thu, 19 Sep 2024 20:21:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLEkn046217; Thu, 19 Sep 2024 20:21:14 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:14 GMT Message-Id: <202409192021.48JKLEkn046217@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: 03d11291d8ec - main - pf: fix potential memory leaks in pf_create_state() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03d11291d8ec39a040205966a25144d6b33fbbd0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=03d11291d8ec39a040205966a25144d6b33fbbd0 commit 03d11291d8ec39a040205966a25144d6b33fbbd0 Author: Kristof Provost AuthorDate: 2024-08-29 11:31:54 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:12 +0000 pf: fix potential memory leaks in pf_create_state() If we fail to init TCP (or SCTP) initialization we have to remember to free state keys as well. They will not be freed for us when we free the state until we've inserted the state (i.e. pf_insert_state()). Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46583 --- sys/netpfil/pf/pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 1182c5dd0c30..0484a7ee5056 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5456,7 +5456,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (s->state_flags & PFSTATE_SCRUB_TCP && pf_normalize_tcp_init(m, off, pd, th, &s->src, &s->dst)) { REASON_SET(&reason, PFRES_MEMORY); - goto drop; + goto csfailed; } if (s->state_flags & PFSTATE_SCRUB_TCP && s->src.scrub && pf_normalize_tcp_stateful(m, off, pd, &reason, th, s, @@ -5465,13 +5465,13 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, DPFPRINTF(PF_DEBUG_URGENT, ("pf_normalize_tcp_stateful failed on first " "pkt\n")); - goto drop; + goto csfailed; } } else if (pd->proto == IPPROTO_SCTP) { if (pf_normalize_sctp_init(m, off, pd, &s->src, &s->dst)) - goto drop; + goto csfailed; if (! (pd->sctp_flags & (PFDESC_SCTP_INIT | PFDESC_SCTP_ADD_IP))) - goto drop; + goto csfailed; } s->direction = pd->dir; From nobody Thu Sep 19 20:21:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3H4psDz5XL16; Thu, 19 Sep 2024 20:21: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 4X8n3H3x3Hz4WT5; Thu, 19 Sep 2024 20:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pM4lFGHD8LDbnMqgQeFWCr+R4/O1i/cheykxGfbGBQE=; b=dZnIA5jY+cxq3VbxH4b7OPvE1dAXMe+c+aSM05w556KXAbF5esxRV6AjcnaxnRZ4GZ0GK+ N0OB20m+wli7ToGC7kk5J5UIBDJDSTKiytykgjbddG4ZpHPnJazR3jqSlzX2AxfhKN8jA4 9iYm29Qe/rZLHyWBs83ML19u6n7TXH6WUOimUE9Wz66GcQT/3ZIw5GL9mUHcB6dg/i3gsq z569GEp0ehUyBzD1RX1tEXadZk1SsMdKN5yJl3UPl9FEe+RBIQTZLgba4OhGr57YyUR/4X f5YpAWR0pxld9XUVCD1lDk1YVzALk17XuO/Sjz+m7JALCKaCqPQb7J/1P3PdZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777275; a=rsa-sha256; cv=none; b=InlAvujmEl9wmsOo/zVgK6V4ItJDpmRigEbzraoCH+HONXQ3EZAkwGfGVKXoCtrP7qCxjl mhMV+6+WASTEFf6wgHNPOVgZxMma0aiZeAGmHaFbgC7tXvhlstlQVL4uJsUL4EgZxwpOye +kpFRTWBCrP2p6KZlexcdtevt0ZQ0x0VUvn0jguPzPZmf9mBRbTpeWUN6jHNLFrqh1Vr+t i3SAyQXh6FQ83WyILHmiu1VTzQd/twDIv55+hd11YY+0rXv7AgKAHA1N4MK7/z/geZASP0 C2Gx2oGsQ3QI4mHBDD5aySnmFsS8COSuRjakfAz2o01gQS9r10AJpZR0umzjaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pM4lFGHD8LDbnMqgQeFWCr+R4/O1i/cheykxGfbGBQE=; b=P4TKcTNXKLMPjkSfueWtOQnbqXGJEESBz7ctQ9+7UNOhrKFXpU4hyiM9Js91J+fYVx1vYb oKQ+nAtpkytFJ3NKSC1mvwv8S209ZbCie+R6CLwhRB5Lb2glU9CWtykaR+xjgsuCxqjYp5 h8VzZJmO2IoLMVDAQlTlEIpUmV02wGE9pOcAiC3ra88rLMoMUIHCl3eEK7cUUpjfTZ9fSC G/pTwmbVBxYgcTIM3tdOQEi+6U2mCZz8mVJX2l4pnTIQezl81W8K3fsquki9PqDKh8IooD sRYBCzbV4OyVtADRHmhNfw3IO1ifuv/AnFna0rsC6ZQm2CuDS69GE2+VT4LIcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3H3Wr8zKsX; Thu, 19 Sep 2024 20:21: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 48JKLF8R046263; Thu, 19 Sep 2024 20:21:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLFie046260; Thu, 19 Sep 2024 20:21:15 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:15 GMT Message-Id: <202409192021.48JKLFie046260@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: e044f67a66c8 - main - pfctl: improve bitmask printing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e044f67a66c82721b419949132fc48261ee39555 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e044f67a66c82721b419949132fc48261ee39555 commit e044f67a66c82721b419949132fc48261ee39555 Author: Kristof Provost AuthorDate: 2024-08-29 11:48:41 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:12 +0000 pfctl: improve bitmask printing In some cases the netmask gets set to a full 128 bit mask even if no address family is selected; don't print the v6 mask if it's a v4 address. Obtained from: OpenBSD, mcbride , f6d7b41f07 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46584 --- sbin/pfctl/pf_print_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index 0b862273fab3..96da1e109fa8 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -128,7 +128,7 @@ print_addr(struct pf_addr_wrap *addr, sa_family_t af, int verbose) PF_AZERO(&addr->v.a.mask, AF_INET6))) { int bits = unmask(&addr->v.a.mask, af); - if (bits != (af == AF_INET ? 32 : 128)) + if (bits < (af == AF_INET ? 32 : 128)) printf("/%d", bits); } } From nobody Thu Sep 19 20:21:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3J74D5z5XL3g; Thu, 19 Sep 2024 20:21: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 4X8n3J51XDz4Ww5; Thu, 19 Sep 2024 20:21:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HNQXiS3M2Xq1v79KG9osqWa6xDglx1TSEMelDFbEjKA=; b=YvYid3ffTL6FxqNCPKE020HSHWAh22URrJtlOUjwhLe7p74JYwxhSEpkdU5GDDAs5EaZrk aujpBNcWm/5Kw7aTLq6vNocizSx9D+Ij9cI8il2Xkipd07r+tSLv9pmxj/KkfIbTjNYxpK twFO+ahiYQi3AaTiSfz15imuUGPx34JezRWfW4oeAcFIVHLXJNH/sJrlvuKxZCN59Ywbs0 O7bKLfTBBgGIag4qVHxIxR7EiGllgzvOkMps41bUaOyJ9AQ7/CB/Ykd1en4e1sgJQMDbvm bO8q9avPZp6CidayLmurQyS3jFzJp5DjNRLIdxtSPZVfZxojJtibSL0Z2y6hBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777276; a=rsa-sha256; cv=none; b=xGNwMw0/JWaA1qb+7EGSRV+XWueX7/y4MyYMwjoHX8crQ5YA+Unbl8FNZvIJ2eKuHJFJDr F9RR+jv4zpnK01S8XWivuX3SkgPq4V+AaUKYGjam/VX7oDnK3JzkMEmk8eo+ugg9UD3ggh a3MxZDYsUgqkRuWuDS6FHBH6+++R/EU9aKJqOvI72sPItzoW8SBTGc61Fk4AAAZZYErxBr ZIzWa7aLg7ctTdcw/a8uuFiCB2VB0PbswGYhuMK9v+TqwlJH/xGfjTG24bsEVSyR8Ua4v+ TLU8SQpc132F63btb3rBNxQG6G/qhlMwOmjj1pAwhQmWLZaQyD2X0MwazYjOKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HNQXiS3M2Xq1v79KG9osqWa6xDglx1TSEMelDFbEjKA=; b=FcodCu89Jhj3wQWNUKBQ+eCRJXmcV1e8fA+BUfLpb8H4uCRMltwhiJrqRsNF1IHS66xOqA UdJF53TdaYsPaRTVyBbv+JAB9xqjHBueIN6Ms+T9+wJuQ/beVGWnp6WFwb0AuAc3oph1F6 LFgUeDpoVtbVS5UjBhnOZNJW4zyIFzAjSJTF/XeWVa1107btwiLCSK38kp8uMRxC0NwBs8 84aAkxkAZZvSrrMSfu2GAk7kSeEypOAlZ/NcJ+ZmikC68xaiiYY4asPAKniIykpB0lQ+ta VzHniglBRV2kzQw2DvFKaJd1MTDTbAVpEJKRfgeHI94xSZO/MUtGA2FpArL+Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3J4bQzzKvG; Thu, 19 Sep 2024 20:21: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 48JKLG6c046311; Thu, 19 Sep 2024 20:21:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLGIA046308; Thu, 19 Sep 2024 20:21:16 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:16 GMT Message-Id: <202409192021.48JKLGIA046308@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: 650dcb48b06f - main - pf: print rule number in debug output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 650dcb48b06fc517abe15f4794a54a6d96ebceb4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=650dcb48b06fc517abe15f4794a54a6d96ebceb4 commit 650dcb48b06fc517abe15f4794a54a6d96ebceb4 Author: Kristof Provost AuthorDate: 2024-08-29 12:03:49 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:12 +0000 pf: print rule number in debug output When printing states in debug output, print the rule number that created it if we have it. Requested by dlg, ok henning. Obtained from: OpenBSD, mcbride , c06d1661a6 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46585 --- sys/netpfil/pf/pf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0484a7ee5056..58bcd1f2ee71 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -2889,6 +2889,8 @@ pf_print_state_parts(struct pf_kstate *s, printf("]"); } printf(" %u:%u", s->src.state, s->dst.state); + if (s->rule.ptr) + printf(" @%d", s->rule.ptr->nr); } } From nobody Thu Sep 19 20:21:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3L181kz5XKpw; Thu, 19 Sep 2024 20:21: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 4X8n3K5RV8z4Whn; Thu, 19 Sep 2024 20:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uvzNCo2RokzXXSADU3l0gvp/YMuANjS+XDumaN5s8LA=; b=i75paV68vgNSwCHxOYqJiU9mB6JyH91CL8S0iBGm4X0yNux7Oblzp8RPlCB/EgcG6r+8VV 32VuQqJSRKgZCm3Qjml8KzJamb6Yz6UcQDrOg7TxJvXpADSfs4ctIaGVlY1523z6Wzp6rI Mg5HdnllOMnLpZCtKajCKnAXgR5TqQA0uLD+jCf9bGjjnbdFIRV2TsKZKhKperGk+vdFoq k7c2Qs8aD1tHl7gh8TT6MzSASWohwS64FuXIlPqY43cGhnj1OA6xm3h2SSMgl/Oswhuz2D GriEYcNLJJ89AgYkZrSotHoxJhkovGk3YYoOtUIjmxRFbolejB2NPUuanzZf0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777277; a=rsa-sha256; cv=none; b=GuK9C/SROkgsMWUM7XNzTsmPrvm7ePPcHwWOIKMWc+GUTsE19CkdoBAx3SwPYKV7RoB0Lx 2JPqCPqeRAk3OL6T2AWXim9WOpOscLikzGnTtZFdR4ES29n3Rabjy3rddn6vejnGDieJgf /PC4t6HSiXwbzlQjyft7GjiBS+eVYy8kBUKb2arpt3/SOL8564I+YI+bIzJKXgKvXSgKDN PtBdDgoJJ9JaMsLzVF5doJ63KF5jwL3kfT7jaxoUGoCkLX3XqQI0vhPOV9Xswo9KPvizma pIRJPTXsjG3ZAhsM/6EPj2aOoNlWTRR4OpnU5NHsmHnvyZcIfmttnLPob6v9Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uvzNCo2RokzXXSADU3l0gvp/YMuANjS+XDumaN5s8LA=; b=iSwU08YL7ClirMCHAIQndes9feSRAYV7CZ6XmsjJpzhgPLHMfgui12Sl+w/3vu0aumLuWm G6oW2oG7ijNFYKvF5peVQPmn7qINfD1hvDpBVEzqwB4PFg5/wJfvi6JSFd9kH+KbVFNhWX GcWvxfvIOrBTlOk0UIFZqZHQJ4L0+vwxXbF7BA+zxrlQjDOeZjBHlrC4LADgz5fjibMbyE qmBEp51R0yhSB2w+DDh33ofcVoZg0Sk6vcqFqH/w4ccdqOY8EhW/jrHBVw99EgmtmWX/cw kTSjcDZeNRKr0fL7ScVoumVcVEF7LNTdPmBl4J8K1e+NZ9bWYbWB52VRT1+pqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3K5138zKTV; Thu, 19 Sep 2024 20:21: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 48JKLH2I046350; Thu, 19 Sep 2024 20:21:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLHBQ046347; Thu, 19 Sep 2024 20:21:17 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:17 GMT Message-Id: <202409192021.48JKLHBQ046347@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: 9ec74b675e04 - main - pf: factor out pf_setup_pdesc() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ec74b675e04304df3e29eec80d8d259a1254c17 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ec74b675e04304df3e29eec80d8d259a1254c17 commit 9ec74b675e04304df3e29eec80d8d259a1254c17 Author: Kristof Provost AuthorDate: 2024-09-02 14:24:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:13 +0000 pf: factor out pf_setup_pdesc() factor our the code to set up pf_pdesc, a central structure in pf carrying information about the packet we're currently dealing with, into its own function. ok ryan dlg and additional testing sthen Obtained from: OpenBSD, henning , c4202972a3 Obtained from: OpenBSD, claudio , 78d25123ea Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46586 --- sys/net/pfvar.h | 8 + sys/netpfil/pf/pf.c | 624 +++++++++++++++++++++++++++-------------------- sys/netpfil/pf/pf_norm.c | 9 +- 3 files changed, 363 insertions(+), 278 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 4bb09d637def..9a0130dbf487 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1610,6 +1610,7 @@ struct pf_pdesc { struct pf_rule_actions act; u_int32_t p_len; /* total length of payload */ + u_int32_t rh_cnt; /* Route header count */ u_int16_t *ip_sum; u_int16_t *proto_sum; @@ -2350,8 +2351,15 @@ VNET_DECLARE(struct pf_krule, pf_default_rule); extern void pf_addrcpy(struct pf_addr *, struct pf_addr *, sa_family_t); void pf_free_rule(struct pf_krule *); +int pf_setup_pdesc(sa_family_t, int, + struct pf_pdesc *, struct mbuf *, + u_short *, u_short *, struct pfi_kkif *, + struct pf_krule **, struct pf_krule **, + struct pf_kruleset **, int *, int *, + struct pf_rule_actions *); int pf_test_eth(int, int, struct ifnet *, struct mbuf **, struct inpcb *); +int pf_scan_sctp(struct mbuf *, int, struct pf_pdesc *, struct pfi_kkif *); #ifdef INET int pf_test(int, int, struct ifnet *, struct mbuf **, struct inpcb *, struct pf_rule_actions *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 58bcd1f2ee71..59db6fd96953 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -324,7 +324,7 @@ static int pf_test_eth_rule(int, struct pfi_kkif *, static int pf_test_rule(struct pf_krule **, struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, struct pf_pdesc *, struct pf_krule **, - struct pf_kruleset **, struct inpcb *); + struct pf_kruleset **, struct inpcb *, int); static int pf_create_state(struct pf_krule *, struct pf_krule *, struct pf_krule *, struct pf_pdesc *, struct pf_ksrc_node *, struct pf_state_key *, @@ -4865,7 +4865,7 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0) static int pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, struct mbuf *m, int off, struct pf_pdesc *pd, struct pf_krule **am, - struct pf_kruleset **rsm, struct inpcb *inp) + struct pf_kruleset **rsm, struct inpcb *inp, int hdrlen) { struct pf_krule *nr = NULL; struct pf_addr * const saddr = pd->src; @@ -4879,7 +4879,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, struct tcphdr *th = &pd->hdr.tcp; struct pf_state_key *sk = NULL, *nk = NULL; u_short reason, transerror; - int rewrite = 0, hdrlen = 0; + int rewrite = 0; int tag = -1; int asd = 0; int match = 0; @@ -4905,23 +4905,19 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, case IPPROTO_TCP: sport = th->th_sport; dport = th->th_dport; - hdrlen = sizeof(*th); break; case IPPROTO_UDP: sport = pd->hdr.udp.uh_sport; dport = pd->hdr.udp.uh_dport; - hdrlen = sizeof(pd->hdr.udp); break; case IPPROTO_SCTP: sport = pd->hdr.sctp.src_port; dport = pd->hdr.sctp.dest_port; - hdrlen = sizeof(pd->hdr.sctp); break; #ifdef INET case IPPROTO_ICMP: if (pd->af != AF_INET) break; - hdrlen = sizeof(pd->hdr.icmp); icmptype = pd->hdr.icmp.icmp_type; icmpcode = pd->hdr.icmp.icmp_code; state_icmp = pf_icmp_mapping(pd, icmptype, @@ -4939,7 +4935,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, case IPPROTO_ICMPV6: if (af != AF_INET6) break; - hdrlen = sizeof(pd->hdr.icmp6); icmptype = pd->hdr.icmp6.icmp6_type; icmpcode = pd->hdr.icmp6.icmp6_code; state_icmp = pf_icmp_mapping(pd, icmptype, @@ -4955,7 +4950,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, break; #endif /* INET6 */ default: - sport = dport = hdrlen = 0; + sport = dport = 0; break; } @@ -6662,7 +6657,8 @@ again: * That's why we pass V_pfi_all rather than kif. */ ret = pf_test_rule(&r, &sm, V_pfi_all, - j->m, off, &j->pd, &ra, &rs, NULL); + j->m, off, &j->pd, &ra, &rs, NULL, + sizeof(j->pd.hdr.sctp)); PF_RULES_RUNLOCK(); SDT_PROBE4(pf, sctp, multihome, test, kif, r, j->m, ret); if (ret != PF_DROP && sm != NULL) { @@ -8540,6 +8536,290 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, return (0); } +int +pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, + u_short *action, u_short *reason, struct pfi_kkif *kif, struct pf_krule **a, + struct pf_krule **r, struct pf_kruleset **ruleset, int *off, int *hdrlen, + struct pf_rule_actions *default_actions) +{ + + TAILQ_INIT(&pd->sctp_multihome_jobs); + if (default_actions != NULL) + memcpy(&pd->act, default_actions, sizeof(pd->act)); + pd->pf_mtag = pf_find_mtag(m); + + if (pd->pf_mtag && pd->pf_mtag->dnpipe) { + pd->act.dnpipe = pd->pf_mtag->dnpipe; + pd->act.flags = pd->pf_mtag->dnflags; + } + + pd->af = af; + + switch (af) { +#ifdef INET + case AF_INET: { + struct ip *h; + + h = mtod(m, struct ip *); + *off = h->ip_hl << 2; + if (*off < (int)sizeof(*h)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + pd->src = (struct pf_addr *)&h->ip_src; + pd->dst = (struct pf_addr *)&h->ip_dst; + pd->sport = pd->dport = NULL; + pd->ip_sum = &h->ip_sum; + pd->proto_sum = NULL; + pd->proto = h->ip_p; + pd->dir = dir; + pd->sidx = (dir == PF_IN) ? 0 : 1; + pd->didx = (dir == PF_IN) ? 1 : 0; + pd->tos = h->ip_tos; + pd->tot_len = ntohs(h->ip_len); + pd->act.rtableid = -1; + + /* fragments not reassembled handled later */ + if (h->ip_off & htons(IP_MF | IP_OFFMASK)) + return (0); + + switch (h->ip_p) { + case IPPROTO_TCP: { + struct tcphdr *th = &pd->hdr.tcp; + + if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, + reason, AF_INET)) + return (-1); + *hdrlen = sizeof(*th); + pd->p_len = pd->tot_len - *off - (th->th_off << 2); + pd->sport = &th->th_sport; + pd->dport = &th->th_dport; + break; + } + case IPPROTO_UDP: { + struct udphdr *uh = &pd->hdr.udp; + + if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, + reason, AF_INET)) + return (-1); + *hdrlen = sizeof(*uh); + if (uh->uh_dport == 0 || + ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || + ntohs(uh->uh_ulen) < sizeof(struct udphdr)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + pd->sport = &uh->uh_sport; + pd->dport = &uh->uh_dport; + break; + } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), + action, reason, AF_INET)) { + return (-1); + } + *hdrlen = sizeof(pd->hdr.sctp); + pd->p_len = pd->tot_len - *off; + + pd->sport = &pd->hdr.sctp.src_port; + pd->dport = &pd->hdr.sctp.dest_port; + if (pd->hdr.sctp.src_port == 0 || pd->hdr.sctp.dest_port == 0) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + if (pf_scan_sctp(m, *off, pd, kif) != PF_PASS) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + break; + } + case IPPROTO_ICMP: { + if (!pf_pull_hdr(m, *off, &pd->hdr.icmp, ICMP_MINLEN, + action, reason, AF_INET)) + return (-1); + *hdrlen = ICMP_MINLEN; + break; + } + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: { + struct ip6_hdr *h; + int terminal = 0; + + h = mtod(m, struct ip6_hdr *); + pd->src = (struct pf_addr *)&h->ip6_src; + pd->dst = (struct pf_addr *)&h->ip6_dst; + pd->sport = pd->dport = NULL; + pd->ip_sum = NULL; + pd->proto_sum = NULL; + pd->dir = dir; + pd->sidx = (dir == PF_IN) ? 0 : 1; + pd->didx = (dir == PF_IN) ? 1 : 0; + pd->tos = IPV6_DSCP(h); + pd->tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr); + *off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); + pd->proto = h->ip6_nxt; + pd->act.rtableid = -1; + + do { + switch (pd->proto) { + case IPPROTO_FRAGMENT: + if (kif == NULL || r == NULL) /* pflog */ + *action = PF_DROP; + else + *action = pf_test_fragment(r, kif, + m, h, pd, a, ruleset); + if (*action == PF_DROP) + REASON_SET(reason, PFRES_FRAG); + return (-1); + case IPPROTO_ROUTING: { + struct ip6_rthdr rthdr; + + if (pd->rh_cnt++) { + DPFPRINTF(PF_DEBUG_MISC, + ("pf: IPv6 more than one rthdr")); + *action = PF_DROP; + REASON_SET(reason, PFRES_IPOPTIONS); + return (-1); + } + if (!pf_pull_hdr(m, *off, &rthdr, sizeof(rthdr), + NULL, reason, pd->af)) { + DPFPRINTF(PF_DEBUG_MISC, + ("pf: IPv6 short rthdr")); + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + if (rthdr.ip6r_type == IPV6_RTHDR_TYPE_0) { + DPFPRINTF(PF_DEBUG_MISC, + ("pf: IPv6 rthdr0")); + *action = PF_DROP; + REASON_SET(reason, PFRES_IPOPTIONS); + return (-1); + } + /* FALLTHROUGH */ + } + case IPPROTO_AH: + case IPPROTO_HOPOPTS: + case IPPROTO_DSTOPTS: { + /* get next header and header length */ + struct ip6_ext opt6; + + if (!pf_pull_hdr(m, *off, &opt6, sizeof(opt6), + NULL, reason, pd->af)) { + DPFPRINTF(PF_DEBUG_MISC, + ("pf: IPv6 short opt")); + *action = PF_DROP; + return (-1); + } + if (pd->proto == IPPROTO_AH) + *off += (opt6.ip6e_len + 2) * 4; + else + *off += (opt6.ip6e_len + 1) * 8; + pd->proto = opt6.ip6e_nxt; + /* goto the next header */ + break; + } + default: + terminal++; + break; + } + } while (!terminal); + + switch (pd->proto) { + case IPPROTO_TCP: { + struct tcphdr *th = &pd->hdr.tcp; + + if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, + reason, AF_INET6)) + return (-1); + *hdrlen = sizeof(*th); + pd->p_len = pd->tot_len - *off - (th->th_off << 2); + pd->sport = &th->th_sport; + pd->dport = &th->th_dport; + break; + } + case IPPROTO_UDP: { + struct udphdr *uh = &pd->hdr.udp; + + if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, + reason, AF_INET6)) + return (-1); + *hdrlen = sizeof(*uh); + if (uh->uh_dport == 0 || + ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || + ntohs(uh->uh_ulen) < sizeof(struct udphdr)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + pd->sport = &uh->uh_sport; + pd->dport = &uh->uh_dport; + break; + } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), + action, reason, AF_INET6)) { + return (-1); + } + *hdrlen = sizeof(pd->hdr.sctp); + pd->p_len = pd->tot_len - *off; + + pd->sport = &pd->hdr.sctp.src_port; + pd->dport = &pd->hdr.sctp.dest_port; + if (pd->hdr.sctp.src_port == 0 || pd->hdr.sctp.dest_port == 0) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + if (pf_scan_sctp(m, *off, pd, kif) != PF_PASS) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } + break; + } + case IPPROTO_ICMPV6: { + size_t icmp_hlen = sizeof(struct icmp6_hdr); + + if (!pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, + action, reason, AF_INET6)) + return (-1); + /* ICMP headers we look further into to match state */ + switch (pd->hdr.icmp6.icmp6_type) { + case MLD_LISTENER_QUERY: + case MLD_LISTENER_REPORT: + icmp_hlen = sizeof(struct mld_hdr); + break; + case ND_NEIGHBOR_SOLICIT: + case ND_NEIGHBOR_ADVERT: + icmp_hlen = sizeof(struct nd_neighbor_solicit); + break; + } + if (icmp_hlen > sizeof(struct icmp6_hdr) && + !pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, + action, reason, AF_INET6)) + return (-1); + *hdrlen = icmp_hlen; + break; + } + } + break; + } +#endif + default: + panic("pf_setup_pdesc called with illegal af %u", af); + } + return (0); +} + #ifdef INET int pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, @@ -8554,7 +8834,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct pf_kstate *s = NULL; struct pf_kruleset *ruleset = NULL; struct pf_pdesc pd; - int off, dirndx, use_2nd_queue = 0; + int off, hdrlen, dirndx, use_2nd_queue = 0; uint16_t tag; uint8_t rt; @@ -8591,11 +8871,31 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, return (PF_DROP); } + 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")); + PF_RULES_RUNLOCK(); + return (PF_DROP); + } + memset(&pd, 0, sizeof(pd)); - TAILQ_INIT(&pd.sctp_multihome_jobs); - if (default_actions != NULL) - memcpy(&pd.act, default_actions, sizeof(pd.act)); - pd.pf_mtag = pf_find_mtag(m); + pd.dir = dir; + + if (pf_normalize_ip(m0, kif, &reason, &pd) != PF_PASS) { + /* We do IP header normalization and packet reassembly here */ + action = PF_DROP; + goto done; + } + m = *m0; /* pf_normalize messes with m0 */ + h = mtod(m, struct ip *); + + if (pf_setup_pdesc(AF_INET, dir, &pd, m, &action, &reason, kif, &a, &r, + &ruleset, &off, &hdrlen, default_actions) == -1) { + if (action != PF_PASS) + pd.act.log |= PF_LOG_FORCE; + goto done; + } if (pd.pf_mtag != NULL && (pd.pf_mtag->flags & PF_MTAG_FLAG_ROUTE_TO)) { pd.pf_mtag->flags &= ~PF_MTAG_FLAG_ROUTE_TO; @@ -8614,11 +8914,6 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, return (PF_PASS); } - if (pd.pf_mtag && pd.pf_mtag->dnpipe) { - pd.act.dnpipe = pd.pf_mtag->dnpipe; - pd.act.flags = pd.pf_mtag->dnflags; - } - if (ip_dn_io_ptr != NULL && pd.pf_mtag != NULL && pd.pf_mtag->flags & PF_MTAG_FLAG_DUMMYNET) { /* Dummynet re-injects packets after they've @@ -8633,24 +8928,6 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, return (PF_PASS); } - pd.sport = pd.dport = NULL; - pd.proto_sum = NULL; - pd.dir = dir; - pd.sidx = (dir == PF_IN) ? 0 : 1; - pd.didx = (dir == PF_IN) ? 1 : 0; - pd.af = AF_INET; - pd.act.rtableid = -1; - - 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")); - PF_RULES_RUNLOCK(); - return (PF_DROP); - } - h = mtod(m, struct ip *); - off = h->ip_hl << 2; - if (__predict_false(ip_divert_ptr != NULL) && ((mtag = m_tag_locate(m, MTAG_PF_DIVERT, 0, NULL)) != NULL)) { struct pf_divert_mtag *dt = (struct pf_divert_mtag *)(mtag+1); @@ -8672,28 +8949,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, mtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); if (mtag != NULL) m_tag_delete(m, mtag); - } else if (pf_normalize_ip(m0, kif, &reason, &pd) != PF_PASS) { - /* We do IP header normalization and packet reassembly here */ - action = PF_DROP; - goto done; } - m = *m0; /* pf_normalize messes with m0 */ - h = mtod(m, struct ip *); - - off = h->ip_hl << 2; - if (off < (int)sizeof(struct ip)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - pd.act.log = PF_LOG_FORCE; - goto done; - } - - pd.src = (struct pf_addr *)&h->ip_src; - pd.dst = (struct pf_addr *)&h->ip_dst; - pd.ip_sum = &h->ip_sum; - pd.proto = h->ip_p; - pd.tos = h->ip_tos & ~IPTOS_ECN_MASK; - pd.tot_len = ntohs(h->ip_len); /* handle fragments that didn't get reassembled by normalization */ if (h->ip_off & htons(IP_MF | IP_OFFMASK)) { @@ -8703,16 +8959,6 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, switch (h->ip_p) { case IPPROTO_TCP: { - if (!pf_pull_hdr(m, off, &pd.hdr.tcp, sizeof(pd.hdr.tcp), - &action, &reason, AF_INET)) { - if (action != PF_PASS) - pd.act.log = PF_LOG_FORCE; - goto done; - } - pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); - - pd.sport = &pd.hdr.tcp.th_sport; - pd.dport = &pd.hdr.tcp.th_dport; /* Respond to SYN with a syncookie. */ if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == TH_SYN && @@ -8768,28 +9014,13 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, break; } else { action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); } } break; } case IPPROTO_UDP: { - if (!pf_pull_hdr(m, off, &pd.hdr.udp, sizeof(pd.hdr.udp), - &action, &reason, AF_INET)) { - if (action != PF_PASS) - pd.act.log = PF_LOG_FORCE; - goto done; - } - pd.sport = &pd.hdr.udp.uh_sport; - pd.dport = &pd.hdr.udp.uh_dport; - if (pd.hdr.udp.uh_dport == 0 || - ntohs(pd.hdr.udp.uh_ulen) > m->m_pkthdr.len - off || - ntohs(pd.hdr.udp.uh_ulen) < sizeof(struct udphdr)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - goto done; - } action = pf_test_state_udp(&s, kif, m, off, h, &pd); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -8798,26 +9029,11 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, a = s->anchor.ptr; } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); break; } case IPPROTO_SCTP: { - if (!pf_pull_hdr(m, off, &pd.hdr.sctp, sizeof(pd.hdr.sctp), - &action, &reason, AF_INET)) { - if (action != PF_PASS) - pd.act.log |= PF_LOG_FORCE; - goto done; - } - pd.p_len = pd.tot_len - off; - - pd.sport = &pd.hdr.sctp.src_port; - pd.dport = &pd.hdr.sctp.dest_port; - if (pd.hdr.sctp.src_port == 0 || pd.hdr.sctp.dest_port == 0) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - goto done; - } action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) goto done; @@ -8830,18 +9046,12 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, a = s->anchor.ptr; } else if (s == NULL) { action = pf_test_rule(&r, &s, kif, m, off, - &pd, &a, &ruleset, inp); + &pd, &a, &ruleset, inp, hdrlen); } break; } case IPPROTO_ICMP: { - if (!pf_pull_hdr(m, off, &pd.hdr.icmp, ICMP_MINLEN, - &action, &reason, AF_INET)) { - if (action != PF_PASS) - pd.act.log = PF_LOG_FORCE; - goto done; - } action = pf_test_state_icmp(&s, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -8850,7 +9060,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, a = s->anchor.ptr; } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); break; } @@ -8870,7 +9080,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, a = s->anchor.ptr; } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); break; } @@ -9141,7 +9351,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb struct pf_kstate *s = NULL; struct pf_kruleset *ruleset = NULL; struct pf_pdesc pd; - int off, terminal = 0, dirndx, rh_cnt = 0, use_2nd_queue = 0; + int off, hdrlen, dirndx, use_2nd_queue = 0; uint16_t tag; uint8_t rt; @@ -9189,11 +9399,33 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb return (PF_DROP); } + 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); + } + memset(&pd, 0, sizeof(pd)); - TAILQ_INIT(&pd.sctp_multihome_jobs); - if (default_actions != NULL) - memcpy(&pd.act, default_actions, sizeof(pd.act)); - pd.pf_mtag = pf_find_mtag(m); + pd.dir = dir; + + /* We do IP header normalization and packet reassembly here */ + if (pf_normalize_ip6(m0, kif, &reason, &pd) != PF_PASS) { + action = PF_DROP; + goto done; + } + m = *m0; /* pf_normalize messes with m0 */ + h = mtod(m, struct ip6_hdr *); + off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); + + if (pf_setup_pdesc(AF_INET6, dir, &pd, m, &action, &reason, kif, &a, &r, + &ruleset, &off, &hdrlen, default_actions) == -1) { + if (action != PF_PASS) + pd.act.log |= PF_LOG_FORCE; + goto done; + } if (pd.pf_mtag != NULL && (pd.pf_mtag->flags & PF_MTAG_FLAG_ROUTE_TO)) { pd.pf_mtag->flags &= ~PF_MTAG_FLAG_ROUTE_TO; @@ -9213,11 +9445,6 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb return (PF_PASS); } - if (pd.pf_mtag && pd.pf_mtag->dnpipe) { - pd.act.dnpipe = pd.pf_mtag->dnpipe; - pd.act.flags = pd.pf_mtag->dnflags; - } - if (ip_dn_io_ptr != NULL && pd.pf_mtag != NULL && pd.pf_mtag->flags & PF_MTAG_FLAG_DUMMYNET) { pf_dummynet_flag_remove(m, pd.pf_mtag); @@ -9228,35 +9455,6 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb return (PF_PASS); } - pd.sport = pd.dport = NULL; - pd.ip_sum = NULL; - pd.proto_sum = NULL; - pd.dir = dir; - pd.sidx = (dir == PF_IN) ? 0 : 1; - pd.didx = (dir == PF_IN) ? 1 : 0; - 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); - - /* We do IP header normalization and packet reassembly here */ - if (pf_normalize_ip6(m0, kif, &reason, &pd) != PF_PASS) { - action = PF_DROP; - goto done; - } - m = *m0; /* pf_normalize messes with m0 */ - h = mtod(m, struct ip6_hdr *); - off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr); - /* * we do not support jumbogram. if we keep going, zero ip6_plen * will do something bad, so drop the packet for now. @@ -9267,94 +9465,12 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb goto done; } - pd.src = (struct pf_addr *)&h->ip6_src; - pd.dst = (struct pf_addr *)&h->ip6_dst; - pd.tos = IPV6_DSCP(h); - pd.tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr); - - pd.proto = h->ip6_nxt; - do { - switch (pd.proto) { - case IPPROTO_FRAGMENT: - action = pf_test_fragment(&r, kif, m, h, &pd, &a, - &ruleset); - if (action == PF_DROP) - REASON_SET(&reason, PFRES_FRAG); - goto done; - case IPPROTO_ROUTING: { - struct ip6_rthdr rthdr; - - if (rh_cnt++) { - DPFPRINTF(PF_DEBUG_MISC, - ("pf: IPv6 more than one rthdr\n")); - action = PF_DROP; - REASON_SET(&reason, PFRES_IPOPTIONS); - pd.act.log = PF_LOG_FORCE; - goto done; - } - if (!pf_pull_hdr(m, off, &rthdr, sizeof(rthdr), NULL, - &reason, pd.af)) { - DPFPRINTF(PF_DEBUG_MISC, - ("pf: IPv6 short rthdr\n")); - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - pd.act.log = PF_LOG_FORCE; - goto done; - } - if (rthdr.ip6r_type == IPV6_RTHDR_TYPE_0) { - DPFPRINTF(PF_DEBUG_MISC, - ("pf: IPv6 rthdr0\n")); - action = PF_DROP; - REASON_SET(&reason, PFRES_IPOPTIONS); - pd.act.log = PF_LOG_FORCE; - goto done; - } - /* FALLTHROUGH */ - } - case IPPROTO_AH: - case IPPROTO_HOPOPTS: - case IPPROTO_DSTOPTS: { - /* get next header and header length */ - struct ip6_ext opt6; - - if (!pf_pull_hdr(m, off, &opt6, sizeof(opt6), - NULL, &reason, pd.af)) { - DPFPRINTF(PF_DEBUG_MISC, - ("pf: IPv6 short opt\n")); - action = PF_DROP; - pd.act.log = PF_LOG_FORCE; - goto done; - } - if (pd.proto == IPPROTO_AH) - off += (opt6.ip6e_len + 2) * 4; - else - off += (opt6.ip6e_len + 1) * 8; - pd.proto = opt6.ip6e_nxt; - /* goto the next header */ - break; - } - default: - terminal++; - break; - } - } while (!terminal); - /* if there's no routing header, use unmodified mbuf for checksumming */ if (!n) n = m; switch (pd.proto) { case IPPROTO_TCP: { - if (!pf_pull_hdr(m, off, &pd.hdr.tcp, sizeof(pd.hdr.tcp), - &action, &reason, AF_INET6)) { - if (action != PF_PASS) - pd.act.log |= PF_LOG_FORCE; - goto done; - } - pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); - pd.sport = &pd.hdr.tcp.th_sport; - pd.dport = &pd.hdr.tcp.th_dport; - /* Respond to SYN with a syncookie. */ if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == TH_SYN && pd.dir == PF_IN && pf_synflood_check(&pd)) { @@ -9408,28 +9524,13 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb break; } else { action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); } } break; } case IPPROTO_UDP: { - if (!pf_pull_hdr(m, off, &pd.hdr.udp, sizeof(pd.hdr.udp), - &action, &reason, AF_INET6)) { - if (action != PF_PASS) - pd.act.log |= PF_LOG_FORCE; - goto done; - } - pd.sport = &pd.hdr.udp.uh_sport; - pd.dport = &pd.hdr.udp.uh_dport; - if (pd.hdr.udp.uh_dport == 0 || - ntohs(pd.hdr.udp.uh_ulen) > m->m_pkthdr.len - off || - ntohs(pd.hdr.udp.uh_ulen) < sizeof(struct udphdr)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - goto done; - } action = pf_test_state_udp(&s, kif, m, off, h, &pd); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -9438,24 +9539,11 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb a = s->anchor.ptr; } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); break; } case IPPROTO_SCTP: { - if (!pf_pull_hdr(m, off, &pd.hdr.sctp, sizeof(pd.hdr.sctp), - &action, &reason, AF_INET6)) { - if (action != PF_PASS) - pd.act.log |= PF_LOG_FORCE; - goto done; - } - pd.sport = &pd.hdr.sctp.src_port; - pd.dport = &pd.hdr.sctp.dest_port; - if (pd.hdr.sctp.src_port == 0 || pd.hdr.sctp.dest_port == 0) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - goto done; - } action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); if (action == PF_DROP) goto done; @@ -9468,7 +9556,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb a = s->anchor.ptr; } else if (s == NULL) { action = pf_test_rule(&r, &s, kif, m, off, - &pd, &a, &ruleset, inp); + &pd, &a, &ruleset, inp, hdrlen); } break; } @@ -9481,12 +9569,6 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb } case IPPROTO_ICMPV6: { - if (!pf_pull_hdr(m, off, &pd.hdr.icmp6, sizeof(pd.hdr.icmp6), - &action, &reason, AF_INET6)) { - if (action != PF_PASS) - pd.act.log |= PF_LOG_FORCE; - goto done; - } action = pf_test_state_icmp(&s, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { if (V_pfsync_update_state_ptr != NULL) @@ -9495,7 +9577,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb a = s->anchor.ptr; } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); break; } @@ -9508,7 +9590,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb a = s->anchor.ptr; } else if (s == NULL) action = pf_test_rule(&r, &s, kif, m, off, &pd, - &a, &ruleset, inp); + &a, &ruleset, inp, hdrlen); break; } @@ -9520,7 +9602,7 @@ done: } /* handle dangerous IPv6 extension headers. */ - if (action == PF_PASS && rh_cnt && + if (action == PF_PASS && pd.rh_cnt && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; REASON_SET(&reason, PFRES_IPOPTIONS); diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 295377bef3e8..aaeb027ca8bd 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2066,8 +2066,8 @@ pf_normalize_mss(struct mbuf *m, int off, struct pf_pdesc *pd) return (0); } -static int -pf_scan_sctp(struct mbuf *m, int ipoff, int off, struct pf_pdesc *pd, +int +pf_scan_sctp(struct mbuf *m, int off, struct pf_pdesc *pd, struct pfi_kkif *kif) { struct sctp_chunkhdr ch = { }; @@ -2203,11 +2203,6 @@ pf_normalize_sctp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, PF_RULES_RASSERT(); - /* Unconditionally scan the SCTP packet, because we need to look for - * things like shutdown and asconf chunks. */ - if (pf_scan_sctp(m, ipoff, off, pd, kif) != PF_PASS) - goto sctp_drop; - r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); /* Check if there any scrub rules. Lack of scrub rules means enforced * packet normalization operation just like in OpenBSD. */ From nobody Thu Sep 19 20:21:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3M0BjGz5XL1B; Thu, 19 Sep 2024 20:21: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 4X8n3L68Rtz4X1x; Thu, 19 Sep 2024 20:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KATDa1dX/Qw2BDisAcvT5YUMU44/psrbYzGRrTjXlHs=; b=fvs36BH/+NWEPCN8+Z/nI33WzQRzpYW1IfUxaeplnyWGmH6phuZGyDCkKTratOM+g3Zptr QT2nKoHx5NdbxY7gntcY+kghkmg1kDlZT+n1rfw5yhp2lGGDo3ubJKJb+cp0CbiMJwoWJQ J63ejOjVH7MYSkgMSUB+MUzYavx1gciDy+31JYztPjWlu2q9hfxmCjxZfd8EJV1i7C/R4W AScTXG4yuG3xtrLfDEKVVcHY9PsotW3PoijbXIzJIws7MLcVZ65diN/1HlKreMY544ZC44 o/tFKHQ195aRby8LcA9k7r67C15pQ1B0rN9B8HiQJE5e/Nt5l6mw7Borfceljw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777278; a=rsa-sha256; cv=none; b=aXcZTdZlLLGA/f5o2T8qsWu2a6+D68kwiTC0XscW36fyJEzFqlnNcGwQnGYclQ1wXX2gdF 1NImQryDTJO86qGC+izjoTS5GhGLZ453OIPkzDykiSWgFTAy7N/B2TeBoqPvw7wANjK4Ct KGwZTq2c7mi72PSxufxmjpJknfiNbg3jnXF+lLGrh5cLf1/WHltlCBrL/1adR8C1hTbMVH 0lIlXGGezjm3je5XKTab2BiaeMyxHIQznSJZhRbx7cg9/SPECfHNprfdu8dRW7pq3Vp08B CTKZC3XVYX+vguxZMez3mfDOZ6y1Fj2uOJgDzkawRuMK7+kV3zLzaYxZ5Y2ubA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KATDa1dX/Qw2BDisAcvT5YUMU44/psrbYzGRrTjXlHs=; b=deR569uB/WC0KqetAa0H9KNoOU/pbfrLEXd+R2bOPRfCLXwUqfKZo7R33v2snDo4NBuSoB uakDspVecw/ZuIyvroVHTqpU9qB3uaVT9z6ieyj8D0+2SXIg/2mR6I/2jrXoc6H9lUSRXr 3xnk9QmrCixubvPnzsnrpJwVJYg+70HnYJ4fBIfDg7Y9zL2NhCmv3l5DIm4HQAygFvfUrQ WKhdguNdJLuPVqs5ePwsApPgdWIu6xcRL8xCeAURsMpadb7r9AlRj2fD8oWI9nKw9BNZAb GSutQeo/Ei7zdhnEw11m0Nn11z0qw/H/tWNHEcIf7vF6EQSbwv+vYW5l/8t8zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3L5l1gzKgY; Thu, 19 Sep 2024 20:21: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 48JKLIhi046395; Thu, 19 Sep 2024 20:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLIaH046392; Thu, 19 Sep 2024 20:21:18 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:18 GMT Message-Id: <202409192021.48JKLIaH046392@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: 589c67771edf - main - pf: drop packets if pullup fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 589c67771edf71fbc14bd33f6b8b90f4f327ad25 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=589c67771edf71fbc14bd33f6b8b90f4f327ad25 commit 589c67771edf71fbc14bd33f6b8b90f4f327ad25 Author: Kristof Provost AuthorDate: 2024-09-03 08:45:37 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:13 +0000 pf: drop packets if pullup fails Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46587 --- sys/netpfil/pf/pf.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 59db6fd96953..f340c76da40e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8589,8 +8589,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, struct tcphdr *th = &pd->hdr.tcp; if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, - reason, AF_INET)) + reason, AF_INET)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } *hdrlen = sizeof(*th); pd->p_len = pd->tot_len - *off - (th->th_off << 2); pd->sport = &th->th_sport; @@ -8601,8 +8604,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, struct udphdr *uh = &pd->hdr.udp; if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, - reason, AF_INET)) + reason, AF_INET)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } *hdrlen = sizeof(*uh); if (uh->uh_dport == 0 || ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || @@ -8618,6 +8624,8 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, case IPPROTO_SCTP: { if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), action, reason, AF_INET)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); } *hdrlen = sizeof(pd->hdr.sctp); @@ -8639,8 +8647,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, } case IPPROTO_ICMP: { if (!pf_pull_hdr(m, *off, &pd->hdr.icmp, ICMP_MINLEN, - action, reason, AF_INET)) + action, reason, AF_INET)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } *hdrlen = ICMP_MINLEN; break; } @@ -8738,8 +8749,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, struct tcphdr *th = &pd->hdr.tcp; if (!pf_pull_hdr(m, *off, th, sizeof(*th), action, - reason, AF_INET6)) + reason, AF_INET6)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } *hdrlen = sizeof(*th); pd->p_len = pd->tot_len - *off - (th->th_off << 2); pd->sport = &th->th_sport; @@ -8750,8 +8764,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, struct udphdr *uh = &pd->hdr.udp; if (!pf_pull_hdr(m, *off, uh, sizeof(*uh), action, - reason, AF_INET6)) + reason, AF_INET6)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } *hdrlen = sizeof(*uh); if (uh->uh_dport == 0 || ntohs(uh->uh_ulen) > m->m_pkthdr.len - *off || @@ -8767,6 +8784,8 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, case IPPROTO_SCTP: { if (!pf_pull_hdr(m, *off, &pd->hdr.sctp, sizeof(pd->hdr.sctp), action, reason, AF_INET6)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); } *hdrlen = sizeof(pd->hdr.sctp); @@ -8790,8 +8809,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, size_t icmp_hlen = sizeof(struct icmp6_hdr); if (!pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, - action, reason, AF_INET6)) + action, reason, AF_INET6)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } /* ICMP headers we look further into to match state */ switch (pd->hdr.icmp6.icmp6_type) { case MLD_LISTENER_QUERY: @@ -8805,8 +8827,11 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, } if (icmp_hlen > sizeof(struct icmp6_hdr) && !pf_pull_hdr(m, *off, &pd->hdr.icmp6, icmp_hlen, - action, reason, AF_INET6)) + action, reason, AF_INET6)) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); return (-1); + } *hdrlen = icmp_hlen; break; } From nobody Thu Sep 19 20:21:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3P42D5z5XKmx; Thu, 19 Sep 2024 20:21: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 4X8n3P1PZrz4X6n; Thu, 19 Sep 2024 20:21:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6CsIAHbfiqeOOZuB46xsHmkNVvVkcYxbVd2d9mB6aRU=; b=VHbAx6150f1SjvkaZ0WXnaecFnQq5+sf7VqyXT3JcWfOvbwC6ZWoB/9W6JUKqvcDw6BfVa WbkUuXmDP8pyNA2KHFbTQovSO7H4nRkmtbB8u5pMSg/b73X7Q1NbAtnNQQrDxWPXpplBMK Z/8wo7S99lUenx83KwDAsNYiKCikhnGHdDsCZO7ypjjyUsnrDX0b/VLR/SxtTvw11aq4Kl 32l5lmOcR6eF10o2CVy+PB4d9ayhzbd0skstG6tgVudVoEuCrmCAPWtN6gK4zIBjHem2OQ FieJr6RQxS0OD9vx4E3nK6BzG+KrD7PfprUs8fjrtxDyAzRxCy1/8dnXd7Xsyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777281; a=rsa-sha256; cv=none; b=YGkr0VpHdFtnFa7naVM7FSNCAJZwJtXkRVxLKgYYss2QN3GXmSTzzAIrK14FzYMnOGaFfz RfM/zYz4phb3uuUQeqz17AvqohfvWqcMe6RmS0IcKaBIfoI7WjYpCdOA360hdgJ3CaKpYj PxI/UyvI1qrXvAH3K0JS82wN/dQs6/ds/+wbOiSpo8h7KAZT5kD1qsDbT/dBhYqbIBPp0F Ju5cXGPBfx+gxl+KQ4wjlkLXEdutcLWlPVa3xceq/dYoli7It865j1Mr9s4n7V3hOTq5J9 KNfQTMCfUzRU65uf4WrEti4/S+6rml2KgstCagJDsLsmkugJ/LySK4dkN87yUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6CsIAHbfiqeOOZuB46xsHmkNVvVkcYxbVd2d9mB6aRU=; b=OulmBvRGEB5ZPvzVN2qIH/mDBvQ3lBEvG4hT1qBlXXNiPKp4sdBb2GY6Iy16GVLJr70uh2 BzwDnbatWgDRPfwPlTO6pwB7e1n5SqGydWUBC0GuBoKLa7GO2YPGhM39zfWxaEWm8G7fES Iqv/wLoN50gSWXpWeNS6poN7/yBThPtbTMvoW5LSzgnqfTEegrCjM+wN4FMUb+hz17BpaK xF0aOHuA2ZbA0Z/wEul+W1gcl1f1VbTw4LL6pnV4m1TnupLEcYdhzGijwR20YKcHD97S0d 7Jp71lHqKtFhPn1uqMAWSJ/1+u3zmvrGN5Ty1hficrH9GwY82KHGT2jecb66FQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3P0dntzKsY; Thu, 19 Sep 2024 20:21: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 48JKLKGj046500; Thu, 19 Sep 2024 20:21:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLKRn046497; Thu, 19 Sep 2024 20:21:20 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:20 GMT Message-Id: <202409192021.48JKLKRn046497@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: 7309c551a56e - main - pf tests: test the new log(matches) feature List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7309c551a56edeb2e3d35639ecb20b5a70885924 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7309c551a56edeb2e3d35639ecb20b5a70885924 commit 7309c551a56edeb2e3d35639ecb20b5a70885924 Author: Kristof Provost AuthorDate: 2024-09-03 15:59:44 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:13 +0000 pf tests: test the new log(matches) feature Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46589 --- sbin/pfctl/tests/files/pf1023.in | 3 ++ sbin/pfctl/tests/files/pf1023.ok | 3 ++ sbin/pfctl/tests/pfctl_test_list.inc | 1 + tests/sys/netpfil/pf/pflog.sh | 54 ++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/sbin/pfctl/tests/files/pf1023.in b/sbin/pfctl/tests/files/pf1023.in new file mode 100644 index 000000000000..4855ae0f339e --- /dev/null +++ b/sbin/pfctl/tests/files/pf1023.in @@ -0,0 +1,3 @@ +match log(matches) inet proto tcp +match log(matches) inet from 192.0.2.0/24 +pass diff --git a/sbin/pfctl/tests/files/pf1023.ok b/sbin/pfctl/tests/files/pf1023.ok new file mode 100644 index 000000000000..63fa40113ecf --- /dev/null +++ b/sbin/pfctl/tests/files/pf1023.ok @@ -0,0 +1,3 @@ +match log (matches) inet proto tcp all +match log (matches) inet from 192.0.2.0/24 to any +pass all flags S/SA keep state diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 0ab336ec100d..413599252f64 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -131,3 +131,4 @@ PFCTL_TEST(1019, "Test pflow option") PFCTL_TEST(1020, "Test hashmark and semicolon comment") PFCTL_TEST(1021, "Endpoint-independent") PFCTL_TEST(1022, "Test received-on") +PFCTL_TEST(1023, "Test match log(matches)") diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index 75b7c5c217bb..f5a1241cb5a8 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -79,7 +79,61 @@ malformed_cleanup() pft_cleanup } +atf_test_case "matches" "cleanup" +matches_head() +{ + atf_set descr 'Test the pflog matches keyword' + atf_set require.user root +} + +matches_body() +{ + pflog_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}a + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + pft_set_rules alcatraz \ + "match log(matches) inet proto icmp" \ + "match log(matches) inet from 192.0.2.2" \ + "pass" + + jexec alcatraz tcpdump -n -e -ttt --immediate-mode -l -U -i pflog0 >> ${PWD}/pflog.txt & + sleep 1 # Wait for tcpdump to start + + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + echo "Rules" + jexec alcatraz pfctl -sr -vv + echo "States" + jexec alcatraz pfctl -ss -vv + echo "Log" + cat ${PWD}/pflog.txt + + atf_check -o match:".*rule 0/0\(match\): match in on ${epair}a: 192.0.2.2 > 192.0.2.1: ICMP echo request.*" \ + cat pflog.txt + atf_check -o match:".*rule 1/0\(match\): match in on ${epair}a: 192.0.2.2 > 192.0.2.1: ICMP echo request.*" \ + cat pflog.txt +} + +matches_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "malformed" + atf_add_test_case "matches" } From nobody Thu Sep 19 20:21:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3N4CjSz5XKxx; Thu, 19 Sep 2024 20:21: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 4X8n3N00lXz4WjD; Thu, 19 Sep 2024 20:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cMqizNUQkEbBEDwwo0U0Mom2fIGUJyHJ80wqZe/xZIk=; b=vNmQk2/lNzMlP+bipLUPoPHXth/ZeQELPHYl1ioC6x8F8XBboSQJ2uOn0bmVaISFDJhkAd j6qoeQ3HQHs4BgoIHOasImSnW/1demRo3WOdfkH52PJRCSwx5i9HBUeR85F/dfKnTw+5TT JtDN2LvtONkwR+7n+IODjcUR5LkEdhLWqDZxzZ4GSTf6IYtWn4v5fBdkRlFvBGPG1/2kW5 k8G9ZdBa8tPVK7t/J6ihxhixHCsa2GxuPi08t4xpTUHVWa7DsSVxbVmC+4/43soYrgNOsz YcoJOWDjBXdevSQm/EeWNnHWlSI1xfJuM1e17W2YsnUBa5v5GPuuCspxglbVRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777280; a=rsa-sha256; cv=none; b=xesta6b8hQf0ziIQtYulvrPawEY2PJhbD9hPWk7ZZ44gkhl7ScEZ5AuB/6t3BV+cig82hG LoglaovYe2xsEOkQPRKLyCAYkZmB/M5vZ1Mpvd1ktONm10yxVCEIBFzHkhrtrHNqZt9bA+ 6zuUyVJVrYyu95aJGRNIY4qfCJhWgrmXUiVs2LZZPIvPqvvuI69OsVOjP3R3BWVslzfWEl oNibK0slH86ohHBdXVazCMELS4+MNue3gMd9xppRX+Ldt0SvOYLXYfYw6xSv/Qsvaa5rwe aAsLlN+l8l0m2t4J7NmPBiGcO1X9kHOLauJ8j9KS+OWIzAgZNFsraaob0KcLgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cMqizNUQkEbBEDwwo0U0Mom2fIGUJyHJ80wqZe/xZIk=; b=Eqd/bTCxW6HnY0XVHAzHLkJYr5X2hEkFUR/m4z5BTEiKJTNsDro6OStDyrgFJsZJMsLhDX FU99aQ/iN8ZuvzIZhSTTdqiL3ufRmd4C8xDsocyA35baCvhG6d73O70vQym3fSkVsgX66O CC6XdHt13wzUdTBJQJ2gzz1qrXl91PLrFBhZyxKUw+Kt66Cz8KopaQBmMeBQE4rWkhRdvq 5P1tR290FWXXxeUkzEiD8ePMuAJ1UzA+RYm73Zaur0OX9zEyh5Uw3wVoCdNE96h9TbBN5q EP8+9hql+xdjkNg0psjmwZ9jza22dVxmktpN8Q82a2BUhZqqlLjPOOeA8R9lhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3M6jL5zKvH; Thu, 19 Sep 2024 20:21: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 48JKLJ9c046444; Thu, 19 Sep 2024 20:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLJAv046441; Thu, 19 Sep 2024 20:21:19 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:19 GMT Message-Id: <202409192021.48JKLJAv046441@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: f3ab00c2b607 - main - pf: add a new log opt PF_LOG_MATCHES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3ab00c2b607f80f69963f8a38a8d1910ed4e593 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f3ab00c2b607f80f69963f8a38a8d1910ed4e593 commit f3ab00c2b607f80f69963f8a38a8d1910ed4e593 Author: Kristof Provost AuthorDate: 2024-09-03 13:32:57 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:13 +0000 pf: add a new log opt PF_LOG_MATCHES forces logging on all subsequent matching rules new log opt "matches" awesome for debugging, a rule like match log(matches) from $testbox will show you exactly which subsequent rules match on that packet real ok theo assumed oks ryan & dlg bikeshedding many Obtained from: OpenBSD, henning , 1603e01ae4 Obtained from: OpenBSD, henning , f496e91672 Obtained from: OpenBSD, henning , 07481a9fee Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46588 --- sbin/pfctl/parse.y | 4 +++- sbin/pfctl/pfctl_parser.c | 2 ++ share/man/man5/pf.conf.5 | 4 +++- sys/netpfil/pf/pf.c | 8 ++++++-- sys/netpfil/pf/pf.h | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index cfa6c85b5c0a..9d95122f9826 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -507,7 +507,7 @@ int parseport(char *, struct range *r, int); %token REASSEMBLE ANCHOR NATANCHOR RDRANCHOR BINATANCHOR %token SET OPTIMIZATION TIMEOUT LIMIT LOGINTERFACE BLOCKPOLICY FAILPOLICY %token RANDOMID REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID -%token ANTISPOOF FOR INCLUDE KEEPCOUNTERS SYNCOOKIES L3 +%token ANTISPOOF FOR INCLUDE KEEPCOUNTERS SYNCOOKIES L3 MATCHES %token ETHER %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY MAPEPORTSET %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME @@ -3222,6 +3222,7 @@ logopts : logopt { $$ = $1; } ; logopt : ALL { $$.log = PF_LOG_ALL; $$.logif = 0; } + | MATCHES { $$.log = PF_LOG_MATCHES; $$.logif = 0; } | USER { $$.log = PF_LOG_SOCKET_LOOKUP; $$.logif = 0; } | GROUP { $$.log = PF_LOG_SOCKET_LOOKUP; $$.logif = 0; } | TO string { @@ -6365,6 +6366,7 @@ lookup(char *s) { "loginterface", LOGINTERFACE}, { "map-e-portset", MAPEPORTSET}, { "match", MATCH}, + { "matches", MATCHES}, { "max", MAXIMUM}, { "max-mss", MAXMSS}, { "max-src-conn", MAXSRCCONN}, diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 2e6a1d1cb1c5..70c2ad42ca55 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -918,6 +918,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" ("); if (r->log & PF_LOG_ALL) printf("%sall", count++ ? ", " : ""); + if (r->log & PF_LOG_MATCHES) + printf("%smatches", count++ ? ", " : ""); if (r->log & PF_LOG_SOCKET_LOOKUP) printf("%suser", count++ ? ", " : ""); if (r->logif) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index bfa79b928b69..28cd2407b41a 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -1684,6 +1684,8 @@ As with .Ar log , packets are logged to .Xr pflog 4 . +.It Ar log (matches) +Used to force logging of this packet on all subsequent matching rules. .It Ar log (user) Logs the .Ux @@ -3217,7 +3219,7 @@ pf-rule = action [ ( "in" | "out" ) ] hosts [ filteropt-list ] logopts = logopt [ "," logopts ] -logopt = "all" | "user" | "to" interface-name +logopt = "all" | "matches" | "user" | "to" interface-name etherfilteropt-list = etherfilteropt-list etherfilteropt | etherfilteropt etherfilteropt = "tag" string | "tagged" string | "queue" ( string ) | diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f340c76da40e..4d0cee4d0c4a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5198,7 +5198,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, pf_counter_u64_add_protected(&r->bytes[pd->dir == PF_OUT], pd->tot_len); pf_counter_u64_critical_exit(); pf_rule_to_actions(r, &pd->act); - if (r->log) + if (r->log || pd->act.log & PF_LOG_MATCHES) PFLOG_PACKET(kif, m, af, r->action, PFRES_MATCH, r, a, ruleset, pd, 1); @@ -5207,6 +5207,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, *rm = r; *am = a; *rsm = ruleset; + if (pd->act.log & PF_LOG_MATCHES) + PFLOG_PACKET(kif, m, af, + r->action, PFRES_MATCH, r, + a, ruleset, pd, 1); } if ((*rm)->quick) break; @@ -5229,7 +5233,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, /* apply actions for last matching pass/block rule */ pf_rule_to_actions(r, &pd->act); - if (r->log) { + if (r->log || pd->act.log & PF_LOG_MATCHES) { if (rewrite) m_copyback(m, off, hdrlen, pd->hdr.any); PFLOG_PACKET(kif, m, af, r->action, reason, r, a, ruleset, pd, 1); diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 6370164cb291..063abe83274b 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -137,6 +137,7 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, #define PF_LOG_ALL 0x02 #define PF_LOG_SOCKET_LOOKUP 0x04 #define PF_LOG_FORCE 0x08 +#define PF_LOG_MATCHES 0x10 /* Reasons code for passing/dropping a packet */ #define PFRES_MATCH 0 /* Explicit match of a rule */ From nobody Thu Sep 19 20:21:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3Q6F5Jz5XKvZ; Thu, 19 Sep 2024 20:21: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 4X8n3Q1nBdz4Wtd; Thu, 19 Sep 2024 20:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/h4bu0Lzhyr4nejljS7wRS/I1yd8Q98n25Vt+3Iob8=; b=q1OZpLcHineRoIuCUtr4vL0203W0n4QlPs6TY49H+1bFkEsqC5Xh9M6aeCFqdrKsLRYbCx LzcgvRpyOK0bXA9qnOn1YQQj1jIX/hh244k30USB5DU+itgiRAAkrEJZyACkcoxS3gixVB Cas9k+pHqg1ZadaD7J2WjtpXHVF8QHoPgXMmMhVdeE+f69JgQ+AbaEBHcaNJnXm4Nf1wer AWbwze6DE1vWEvydnLba4fVW6NpHR5s3doI/Py925fsmzxKqSyKEXOFxqFQG7MKSR0dpWt Q90Wm2PHXJVYPQQcD0uOQv0+39nDNKegH7MVAMryGgAzOC6r7oCnxRNK8d4R9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777282; a=rsa-sha256; cv=none; b=opCw3uM4NkFH+9MO7K2/BI4Lo6G1Lp4Zx7V8MMWMMc+8pqT02ByedSO9WWaUMPEBZFLvWp VzcIyuohKHX9E5fsBN282HNWX1m3oXw3YC1zKEalVOPMMFYRTDVSGq/GkPupS/unDPNZij 8qJ4gfAM9lQG++l+kDUM21pXUEYG0GbOvuvzuzCbi7Wtq2U070yfdbQ3zmaQPguf0WC1A7 /Qy63+cer4lDgnNVvziIPPs2F0Qvy7GLtfIulgXvOCV/KHZoNEZvC0egUBF0z12fTmmKo3 b/d4TXHx1ZRbgWAglurBSQ2ym8CeAzmUMBk1F4WK++zBh3/0p5bXe8kBdgLrQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/h4bu0Lzhyr4nejljS7wRS/I1yd8Q98n25Vt+3Iob8=; b=wGqRtuxgXogTfYwDArMSBXgdGJpwqZWJPweA3GiB8l2uG3zEn/cLtSavrVE9vISHLiaIr+ Ts3hEVbUtyFbN3XjiaGy45g3gqCQh/wNRCP1F7Rrxi46lQbaa5qVnsR59pcJ5MuVH2nk5F 56qr50PbW0OttTAdV3VxdQNAMKgbsmA1IjlRi/oEpv08YkUDOSsGqsP4MTCR9VDTeDzh/+ t7dsr7bkKHfUB9BnP0z8s8zrZQlq9FIMPD3lF2prUZU4fqzW+Jo7DzuW29rpakuF52giqX EEwzvItCrj/DVM3cbKQUsNXN7Q9ajlqdDHusJZZgdz8RDbxyAOU35KaOw3SmuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3Q14BNzKvJ; Thu, 19 Sep 2024 20:21: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 48JKLMT6046549; Thu, 19 Sep 2024 20:21:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLM4V046546; Thu, 19 Sep 2024 20:21:22 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:22 GMT Message-Id: <202409192021.48JKLM4V046546@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: 1fd02d1e1522 - main - pf: factor out rule counter update code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fd02d1e1522fdcbb31f07edcab8aacf477111a0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1fd02d1e1522fdcbb31f07edcab8aacf477111a0 commit 1fd02d1e1522fdcbb31f07edcab8aacf477111a0 Author: Kristof Provost AuthorDate: 2024-09-04 12:39:09 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:14 +0000 pf: factor out rule counter update code Break out rule counter update code into a separate function, makes the behaviour consistent between IPv4 and IPv6. From martin.pelikan@gmail.com Obtained from: OpenBSD, mcbride , ce38da5678 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46590 --- sys/netpfil/pf/pf.c | 213 ++++++++++++++++++++++------------------------------ 1 file changed, 89 insertions(+), 124 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4d0cee4d0c4a..2544045c5bbb 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -376,6 +376,10 @@ static struct pf_kstate *pf_find_state(struct pfi_kkif *, const struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_kstate **); static int pf_match_rcvif(struct mbuf *, struct pf_krule *); +static void pf_counters_inc(int, + struct pf_pdesc *, struct pfi_kkif *, + struct pf_kstate *, struct pf_krule *, + struct pf_krule *); static void pf_overload_task(void *v, int pending); static u_short pf_insert_src_node(struct pf_ksrc_node **, struct pf_krule *, struct pf_addr *, sa_family_t); @@ -8849,6 +8853,85 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m, return (0); } +static void +pf_counters_inc(int action, struct pf_pdesc *pd, + struct pfi_kkif *kif, struct pf_kstate *s, + struct pf_krule *r, struct pf_krule *a) +{ + struct pf_krule *tr, *nr; + int dir = pd->dir; + int dirndx; + + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected( + &kif->pfik_bytes[pd->af == AF_INET6][dir == PF_OUT][action != PF_PASS], + pd->tot_len); + pf_counter_u64_add_protected( + &kif->pfik_packets[pd->af == AF_INET6][dir == PF_OUT][action != PF_PASS], + 1); + + if (action == PF_PASS || r->action == PF_DROP) { + dirndx = (dir == PF_OUT); + pf_counter_u64_add_protected(&r->packets[dirndx], 1); + pf_counter_u64_add_protected(&r->bytes[dirndx], pd->tot_len); + pf_update_timestamp(r); + + if (a != NULL) { + pf_counter_u64_add_protected(&a->packets[dirndx], 1); + pf_counter_u64_add_protected(&a->bytes[dirndx], pd->tot_len); + } + if (s != NULL) { + struct pf_krule_item *ri; + + if (s->nat_rule.ptr != NULL) { + pf_counter_u64_add_protected(&s->nat_rule.ptr->packets[dirndx], + 1); + pf_counter_u64_add_protected(&s->nat_rule.ptr->bytes[dirndx], + pd->tot_len); + } + if (s->src_node != NULL) { + counter_u64_add(s->src_node->packets[dirndx], + 1); + counter_u64_add(s->src_node->bytes[dirndx], + pd->tot_len); + } + if (s->nat_src_node != NULL) { + counter_u64_add(s->nat_src_node->packets[dirndx], + 1); + counter_u64_add(s->nat_src_node->bytes[dirndx], + pd->tot_len); + } + dirndx = (dir == s->direction) ? 0 : 1; + s->packets[dirndx]++; + s->bytes[dirndx] += pd->tot_len; + + SLIST_FOREACH(ri, &s->match_rules, entry) { + pf_counter_u64_add_protected(&ri->r->packets[dirndx], 1); + pf_counter_u64_add_protected(&ri->r->bytes[dirndx], pd->tot_len); + } + } + tr = r; + nr = (s != NULL) ? s->nat_rule.ptr : pd->nat_rule; + if (nr != NULL && r == &V_pf_default_rule) + tr = nr; + if (tr->src.addr.type == PF_ADDR_TABLE) + pfr_update_stats(tr->src.addr.p.tbl, + (s == NULL) ? pd->src : + &s->key[(s->direction == PF_IN)]-> + addr[(s->direction == PF_OUT)], + pd->af, pd->tot_len, dir == PF_OUT, + r->action == PF_PASS, tr->src.neg); + if (tr->dst.addr.type == PF_ADDR_TABLE) + pfr_update_stats(tr->dst.addr.p.tbl, + (s == NULL) ? pd->dst : + &s->key[(s->direction == PF_IN)]-> + addr[(s->direction == PF_IN)], + pd->af, pd->tot_len, dir == PF_OUT, + r->action == PF_PASS, tr->dst.neg); + } + pf_counter_u64_critical_exit(); +} + #ifdef INET int pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, @@ -8859,11 +8942,11 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct mbuf *m = *m0; struct ip *h = NULL; struct m_tag *mtag; - struct pf_krule *a = NULL, *r = &V_pf_default_rule, *tr, *nr; + struct pf_krule *a = NULL, *r = &V_pf_default_rule; struct pf_kstate *s = NULL; struct pf_kruleset *ruleset = NULL; struct pf_pdesc pd; - int off, hdrlen, dirndx, use_2nd_queue = 0; + int off, hdrlen, use_2nd_queue = 0; uint16_t tag; uint8_t rt; @@ -9257,71 +9340,7 @@ done: } } - pf_counter_u64_critical_enter(); - pf_counter_u64_add_protected(&kif->pfik_bytes[0][dir == PF_OUT][action != PF_PASS], - pd.tot_len); - pf_counter_u64_add_protected(&kif->pfik_packets[0][dir == PF_OUT][action != PF_PASS], - 1); - - if (action == PF_PASS || r->action == PF_DROP) { - dirndx = (dir == PF_OUT); - pf_counter_u64_add_protected(&r->packets[dirndx], 1); - pf_counter_u64_add_protected(&r->bytes[dirndx], pd.tot_len); - pf_update_timestamp(r); - - if (a != NULL) { - pf_counter_u64_add_protected(&a->packets[dirndx], 1); - pf_counter_u64_add_protected(&a->bytes[dirndx], pd.tot_len); - } - if (s != NULL) { - struct pf_krule_item *ri; - - if (s->nat_rule.ptr != NULL) { - pf_counter_u64_add_protected(&s->nat_rule.ptr->packets[dirndx], - 1); - pf_counter_u64_add_protected(&s->nat_rule.ptr->bytes[dirndx], - pd.tot_len); - } - if (s->src_node != NULL) { - counter_u64_add(s->src_node->packets[dirndx], - 1); - counter_u64_add(s->src_node->bytes[dirndx], - pd.tot_len); - } - if (s->nat_src_node != NULL) { - counter_u64_add(s->nat_src_node->packets[dirndx], - 1); - counter_u64_add(s->nat_src_node->bytes[dirndx], - pd.tot_len); - } - dirndx = (dir == s->direction) ? 0 : 1; - s->packets[dirndx]++; - s->bytes[dirndx] += pd.tot_len; - SLIST_FOREACH(ri, &s->match_rules, entry) { - pf_counter_u64_add_protected(&ri->r->packets[dirndx], 1); - pf_counter_u64_add_protected(&ri->r->bytes[dirndx], pd.tot_len); - } - } - tr = r; - nr = (s != NULL) ? s->nat_rule.ptr : pd.nat_rule; - if (nr != NULL && r == &V_pf_default_rule) - tr = nr; - if (tr->src.addr.type == PF_ADDR_TABLE) - pfr_update_stats(tr->src.addr.p.tbl, - (s == NULL) ? pd.src : - &s->key[(s->direction == PF_IN)]-> - addr[(s->direction == PF_OUT)], - pd.af, pd.tot_len, dir == PF_OUT, - r->action == PF_PASS, tr->src.neg); - if (tr->dst.addr.type == PF_ADDR_TABLE) - pfr_update_stats(tr->dst.addr.p.tbl, - (s == NULL) ? pd.dst : - &s->key[(s->direction == PF_IN)]-> - addr[(s->direction == PF_IN)], - pd.af, pd.tot_len, dir == PF_OUT, - r->action == PF_PASS, tr->dst.neg); - } - pf_counter_u64_critical_exit(); + pf_counters_inc(action, &pd, kif, s, r, a); switch (action) { case PF_SYNPROXY_DROP: @@ -9376,11 +9395,11 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb struct mbuf *m = *m0, *n = NULL; struct m_tag *mtag; struct ip6_hdr *h = NULL; - struct pf_krule *a = NULL, *r = &V_pf_default_rule, *tr, *nr; + struct pf_krule *a = NULL, *r = &V_pf_default_rule; struct pf_kstate *s = NULL; struct pf_kruleset *ruleset = NULL; struct pf_pdesc pd; - int off, hdrlen, dirndx, use_2nd_queue = 0; + int off, hdrlen, use_2nd_queue = 0; uint16_t tag; uint8_t rt; @@ -9726,61 +9745,7 @@ done: } } - pf_counter_u64_critical_enter(); - pf_counter_u64_add_protected(&kif->pfik_bytes[1][dir == PF_OUT][action != PF_PASS], - pd.tot_len); - pf_counter_u64_add_protected(&kif->pfik_packets[1][dir == PF_OUT][action != PF_PASS], - 1); - - if (action == PF_PASS || r->action == PF_DROP) { - dirndx = (dir == PF_OUT); - pf_counter_u64_add_protected(&r->packets[dirndx], 1); - pf_counter_u64_add_protected(&r->bytes[dirndx], pd.tot_len); - if (a != NULL) { - pf_counter_u64_add_protected(&a->packets[dirndx], 1); - pf_counter_u64_add_protected(&a->bytes[dirndx], pd.tot_len); - } - if (s != NULL) { - if (s->nat_rule.ptr != NULL) { - pf_counter_u64_add_protected(&s->nat_rule.ptr->packets[dirndx], - 1); - pf_counter_u64_add_protected(&s->nat_rule.ptr->bytes[dirndx], - pd.tot_len); - } - if (s->src_node != NULL) { - counter_u64_add(s->src_node->packets[dirndx], - 1); - counter_u64_add(s->src_node->bytes[dirndx], - pd.tot_len); - } - if (s->nat_src_node != NULL) { - counter_u64_add(s->nat_src_node->packets[dirndx], - 1); - counter_u64_add(s->nat_src_node->bytes[dirndx], - pd.tot_len); - } - dirndx = (dir == s->direction) ? 0 : 1; - s->packets[dirndx]++; - s->bytes[dirndx] += pd.tot_len; - } - tr = r; - nr = (s != NULL) ? s->nat_rule.ptr : pd.nat_rule; - if (nr != NULL && r == &V_pf_default_rule) - tr = nr; - if (tr->src.addr.type == PF_ADDR_TABLE) - pfr_update_stats(tr->src.addr.p.tbl, - (s == NULL) ? pd.src : - &s->key[(s->direction == PF_IN)]->addr[0], - pd.af, pd.tot_len, dir == PF_OUT, - r->action == PF_PASS, tr->src.neg); - if (tr->dst.addr.type == PF_ADDR_TABLE) - pfr_update_stats(tr->dst.addr.p.tbl, - (s == NULL) ? pd.dst : - &s->key[(s->direction == PF_IN)]->addr[1], - pd.af, pd.tot_len, dir == PF_OUT, - r->action == PF_PASS, tr->dst.neg); - } - pf_counter_u64_critical_exit(); + pf_counters_inc(action, &pd, kif, s, r, a); switch (action) { case PF_SYNPROXY_DROP: From nobody Thu Sep 19 20:21:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3R492zz5XKsK; Thu, 19 Sep 2024 20:21: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 4X8n3R2qFBz4Wtp; Thu, 19 Sep 2024 20:21:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J5Y9QDfyL+VWoeXNdr3aBqWEhepwZ+CtNxlPwDb/+mk=; b=xfDLiZsVGCY0yEcQ2OG4cXzZmIfyvvVJDG2rG3X1WfFEaORiXrVWrkaNytRfYvvwWL2jrV i5QPYpIIfaahvb/8LirlKYK5KqbNJE3qjVVa2xywG21R6o0oD+TMEFwp1Tab0fXHkIwF2n voMzmiby81VG+ebHQkViDFr/+S7ArYpAVCm7W6cSUOc9bjxUaI/RvJBL941broPBTquQzA zdwhoKKWer21h+UxZK0mw4F9MW26q4ypzjszrAxJtrvao2WR73zSHWb+pDvHsyO+VWZf/S Tk4Vz4cD9F7n3Njws4vzsb0B2BP25O5y/LT38OLobMwDFl24u9sDVwAmtf/udA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777283; a=rsa-sha256; cv=none; b=qXp2leEOo3FyKlRRbuGh3dKTsiq7QFq8vzLC/XE2zDGRUXN9dk9t7vruMOogG/Xn2kdUo/ Iq5MGI6aV0BqzsTpCSvySCbbj0W2aRrZ/Jbf6rjrPoL7A3WtseZRfxx0xrCzkmZiw/39tE SzIPWmLILEjPtwTf+SlM8xQkG5yuO/gXE9Y+qNNH4602oxaXlthp+LwT0eJH9O+yqdf2rv yTlOtd4QVWEjkbvjusy2Lfutxv7I07bnWxh/R9M3QPjICTkmtz+E1aDphYdcxxdt66HoMD sZtqawnqa7ctOBlAWySVt/9Rj3rHp9BLUkfDb56IRUoYgc77fQQzQyOMMCCGjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J5Y9QDfyL+VWoeXNdr3aBqWEhepwZ+CtNxlPwDb/+mk=; b=OrN7HSltiO6N9buEaEiwu4YXYo8uHXV0ZlE6U2o4uN5j8RijYxwP/s1+fxwAGwtkg8P2jo XBEWD8MLP5zMQUrfaqIA8A1HU755+utdO+9OI2zdccYLmzdKsBOypgw/hV4LXLrc6CIIlN ZscCICZtnWKeLUr8PEONRbhsPByVeui6H3BeBnN5NlvqOSnRCwEonpyGyEj291pL+ps35l Mfi1oPJDVttNT50JKE+57w/6QqBuQ7sktVRF84uKtCkKT4C4cakHF/xjmo3Ax0wbK1hQIa ef+0+QsBU2NuB2W5cwzEktydb6QZmpW1kSrj+CgJbJILL2ieq0sjFNzyIk7vkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3R2PtRzKjF; Thu, 19 Sep 2024 20:21: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 48JKLN6s046591; Thu, 19 Sep 2024 20:21:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLN9q046588; Thu, 19 Sep 2024 20:21:23 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:23 GMT Message-Id: <202409192021.48JKLN9q046588@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: 5130165be136 - main - pf: remove redundant checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5130165be13684e97125a96763f7c930cae53a2d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5130165be13684e97125a96763f7c930cae53a2d commit 5130165be13684e97125a96763f7c930cae53a2d Author: Kristof Provost AuthorDate: 2024-09-04 14:43:08 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:14 +0000 pf: remove redundant checks pf_test() and pf_test6() drop IPv4-ICMP6 and IPv6-ICMP packets. Do not do the same check in pf_test_rule() again. ok henning Reviewed by: zlei Obtained from: OpenBSD, bluhm , de5c2bfb74 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46591 --- sys/netpfil/pf/pf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2544045c5bbb..b0e857e55deb 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4920,8 +4920,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, break; #ifdef INET case IPPROTO_ICMP: - if (pd->af != AF_INET) - break; + MPASS(af == AF_INET); icmptype = pd->hdr.icmp.icmp_type; icmpcode = pd->hdr.icmp.icmp_code; state_icmp = pf_icmp_mapping(pd, icmptype, @@ -4937,8 +4936,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: - if (af != AF_INET6) - break; + MPASS(af == AF_INET6); icmptype = pd->hdr.icmp6.icmp6_type; icmpcode = pd->hdr.icmp6.icmp6_code; state_icmp = pf_icmp_mapping(pd, icmptype, From nobody Thu Sep 19 20:21:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3S6f58z5XKsP; Thu, 19 Sep 2024 20:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8n3S3WhDz4Wv5; Thu, 19 Sep 2024 20:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogV+2u2nA0KO049a5fzOq0eb/x2tSwA9ZIe6tvLWcVQ=; b=M2ZAs8q57H4/Gfet+33pEIq6/jSvUeiGjuxrnHFrsI7/WBFFKhi7kse02sa5TZLPb8La7J ERBDJxXlQykG0xm12hB6noe51R7WBOTfE5qy7GHCqeIi4w2Oac9r3mr330XpxirTIuN/+g xsT+6nTYcWYEjFHuUYVXQUueEA00Z8UOCVNVKmpC0mJWbMaA+M5a3Eu6Y/FB3arNFWSHDR oS9PjU9vsM9wDx9he6IMh7e+iIDf417s3OOjo1eyG77FoukGOg+L6e/LU6qMgu+UH+OwK/ sxvIOBkgtMTf06/tQ0BSaFNT5u2DPzI4VojtlFsUmT+jxXsru4D2iBGyh+U9dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777284; a=rsa-sha256; cv=none; b=JXLxF4rIsfYjqC6jl+8SnPSbBmEEW7xtUJ4xgH/F7bw6+POGjlIjf+VQDhHVqz8jyq1xyq kw3IuaKIczQpqK44z5IUPRW/w5V8Pcrv3n0zZ4QmE0NCR+D/ohChQnv8YEZFwVwztGyOfy U0gaUSxgod90eIhPEXYaNVLYVq3PotqAD2b6nS1aWQwx/7TdXAdwTIQjx6gLaYFBdMwI0D UOJxxO5KnrNEn7BQ7dKf/P7clGV9uZim9QSs22Y5iZX4s0eI5oyNlUluxH4YDTDezpFru+ VSvnf2BcV2qvR2k0qHt9fP/NfGlqSMYF9TRJe2Sr0oScc8p7HLep9rrBRfcclQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogV+2u2nA0KO049a5fzOq0eb/x2tSwA9ZIe6tvLWcVQ=; b=Z9w5Ztuz28pGVVFOWdeOo4q/2Fsnl+/uI7yOLH3f8DFj7oNnCv+nXCSXgIcxQu3PHZWBJX gMm40JQash3j/jUSVBf6L0nUVPg3LkaQQ53iw+RX57kchtWDL5SbX5AHdqex8cQQBJAhri BuakHQ3sGtzX0Lqiww9Z9agiJ0HY55to6b9vGojLt+SOwiCNEBEzlXlj2a8cPlr0MzrlNi 118HPpuWXcnjRXM6Nf0Uu2CJuakImMSCHScTGCl8Ri6I76kKPPUIRF5L+fsqd0wFzy1jXJ PvsTpimWgv9eQ2eIv1eq9A5grKsLnYxtnXmKeOXZiujNnjLGdQAnsPS33pjTQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3S36HJzL2n; Thu, 19 Sep 2024 20:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JKLOGq046642; Thu, 19 Sep 2024 20:21:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLO7j046639; Thu, 19 Sep 2024 20:21:24 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:24 GMT Message-Id: <202409192021.48JKLO7j046639@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: dea41633e509 - main - pf: handle ACK prioritization for v6 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dea41633e509489087b1d3e0fcb7404e4dbc5129 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dea41633e509489087b1d3e0fcb7404e4dbc5129 commit dea41633e509489087b1d3e0fcb7404e4dbc5129 Author: Kristof Provost AuthorDate: 2024-09-04 15:09:28 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:14 +0000 pf: handle ACK prioritization for v6 Obtained from: OpenBSD, sthen , 1a3657e9c6 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46592 --- sys/netpfil/pf/pf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index b0e857e55deb..c85c2e784cd9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9525,6 +9525,9 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb break; } + if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) + use_2nd_queue = 1; + action = pf_normalize_tcp(kif, m, 0, off, h, &pd); if (action == PF_DROP) goto done; @@ -9701,7 +9704,7 @@ done: } else { if (s != NULL) pd.pf_mtag->qid_hash = pf_state_hash(s); - if (pd.tos & IPTOS_LOWDELAY) + if (use_2nd_queue || (pd.tos & IPTOS_LOWDELAY)) pd.pf_mtag->qid = pd.act.pqid; else pd.pf_mtag->qid = pd.act.qid; From nobody Thu Sep 19 20:21:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3W0wvfz5XKyC; Thu, 19 Sep 2024 20:21: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 4X8n3V588nz4XD9; Thu, 19 Sep 2024 20:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg0X9wCl4dKKgSdcF4iZmesTuAoJlPinTjUqEq3Rdqg=; b=jTrnJ5Qo5KLf2KiKg/2Fu4f7pCaVZ6ycFNCFB0/s8Z8Zun4rFf7XKECdjd1LqSLLrP96gV NFSQNjVwoM3kXeSjlg50GDsrUiQEpoPMs2t8tP6/z4N4XXeNJWBc8HNASUFN3WhZwBt/xz +D3w/pPvinzVhCsGHAOYwIZBVph2+mmf0efZcEJR6WMaSM/5hbyOP0MnQdXjlereU5pcmJ 3930FI3snvcWTZ2Z1CccFpNbsSxmqKl5Xe6+mmtFuUZoc+H9Qj52/zIe2ciZT4HE/+izu9 7LKjxZ7b/1c4mIJ6AXlApZvM6cVK9fh1FZ0plF1eNLoIKvf4FBlONyjbB8vIZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777286; a=rsa-sha256; cv=none; b=xlv1RpDQWnm+VjxSMXEWFSqqlgzNjnKIdZKOWPpEOh4sltyE8L7hYL10QGfw1qVu3fRH9b qp7Sh4oRmNxb/lo56Y/6+iAMgfsZv8zIPruxebvy4xKvy76aKOTggKyaFFqe22HYFc0h/9 X9DssaiRA4r4W64YDhaLDryjKYi8ivLkkyrM7wEOrLlBVWlapitSkAr/oEcaqoH6Cy3JqQ uuh3lDzrVh01A+HVFzB+FkyA7lIN4oARf6hCnLfW8VbDPuR4T2EqVr3Tml+mQqePX53eEo FpF6auawP89zW0qJPGQMTroEZcM1FaGootVnBHZvYxLUu6+rEKX9fHxquPLPBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pg0X9wCl4dKKgSdcF4iZmesTuAoJlPinTjUqEq3Rdqg=; b=FNhEDPdEnG7sXBAqgKTIaRTDk8rxXPz8R0pLUFkoRU5o1yKDR+HyIrCgcj7AGZaspDT5dO RvSPERZXUyL3PK8L/hW8kGus9NnrDn+NImMszuT46IcwPWmEh2fEkaye1oYM9HZ785bbTN c/ecde01x3OpbbuxnycM0fz4AOsTy6dKRdOaTB1GLWpbdpMeYrArFjgIN4Gft/JnggFdQL 9KJLHKX89P0s/UwyXzxEuI2lnND29W7ZPAgkW318i1inIRqiC+8tRc773ogyd4mASaNOgQ 2/IDKtmj2IcTEg7OQWN5Wr73ISeZoWVNIfp6ekvYsQyTJwQBi87yHXHu3mjcgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3V4mP1zKt2; Thu, 19 Sep 2024 20:21: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 48JKLQDt046761; Thu, 19 Sep 2024 20:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLQHm046758; Thu, 19 Sep 2024 20:21:26 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:26 GMT Message-Id: <202409192021.48JKLQHm046758@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: 7d381d0a5b50 - main - pf: exclude link local address from the dynamic interface address pool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d381d0a5b50539638a2460c9ae2213af5c3fad8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7d381d0a5b50539638a2460c9ae2213af5c3fad8 commit 7d381d0a5b50539638a2460c9ae2213af5c3fad8 Author: Kristof Provost AuthorDate: 2024-09-05 15:38:20 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:14 +0000 pf: exclude link local address from the dynamic interface address pool so that rules like "pass out on vr1 inet6 nat-to (vr1)" won't map to the non routable ipv6 link local address; with suggestions and ok claudio, henning Reviewed by: zlei Obtained from: OpenBSD, mikeb , e41548933f Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46594 --- sys/net/pfvar.h | 4 +++- sys/netpfil/pf/pf_lb.c | 17 +++++++++++++---- sys/netpfil/pf/pf_table.c | 9 ++++++++- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 8335fbfaedb8..a5a0ed257ef3 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1228,6 +1228,7 @@ typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_kstate *, struct mbuf *); typedef void pfsync_detach_ifnet_t(struct ifnet *); typedef void pflow_export_state_t(const struct pf_kstate *); +typedef bool pf_addr_filter_func_t(const sa_family_t, const struct pf_addr *); VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); #define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) @@ -2429,7 +2430,8 @@ void pfr_cleanup(void); int pfr_match_addr(struct pfr_ktable *, struct pf_addr *, sa_family_t); void pfr_update_stats(struct pfr_ktable *, struct pf_addr *, sa_family_t, u_int64_t, int, int, int); -int pfr_pool_get(struct pfr_ktable *, int *, struct pf_addr *, sa_family_t); +int pfr_pool_get(struct pfr_ktable *, int *, struct pf_addr *, sa_family_t, + pf_addr_filter_func_t); void pfr_dynaddr_update(struct pfr_ktable *, struct pfi_dynaddr *); struct pfr_ktable * pfr_attach_table(struct pf_kruleset *, char *); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 6541a42aa236..b322bd65cfd3 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -71,6 +71,7 @@ static int pf_get_sport(sa_family_t, uint8_t, struct pf_krule *, struct pf_addr *, uint16_t, struct pf_addr *, uint16_t, struct pf_addr *, uint16_t *, uint16_t, uint16_t, struct pf_ksrc_node **, struct pf_udp_mapping **); +static bool pf_islinklocal(const sa_family_t, const struct pf_addr *); #define mix(a,b,c) \ do { \ @@ -401,6 +402,14 @@ failed: return (1); /* none available */ } +static bool +pf_islinklocal(const sa_family_t af, const struct pf_addr *addr) +{ + if (af == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&addr->v6)) + return (true); + return (false); +} + static int pf_get_mape_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, struct pf_addr *saddr, uint16_t sport, struct pf_addr *daddr, @@ -585,11 +594,11 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (!pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af)) + &rpool->tblidx, &rpool->counter, af, NULL)) goto get_addr; } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { if (!pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af)) + &rpool->tblidx, &rpool->counter, af, pf_islinklocal)) goto get_addr; } else if (pf_match_addr(0, raddr, rmask, &rpool->counter, af)) goto get_addr; @@ -602,7 +611,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (rpool->cur->addr.type == PF_ADDR_TABLE) { rpool->tblidx = -1; if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af)) { + &rpool->tblidx, &rpool->counter, af, NULL)) { /* table contains no address of type 'af' */ if (rpool->cur != acur) goto try_next; @@ -612,7 +621,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { rpool->tblidx = -1; if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af)) { + &rpool->tblidx, &rpool->counter, af, pf_islinklocal)) { /* table contains no address of type 'af' */ if (rpool->cur != acur) goto try_next; diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 4d248e40443d..690cb6d9ab90 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2240,7 +2240,7 @@ pfr_detach_table(struct pfr_ktable *kt) int pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, - sa_family_t af) + sa_family_t af, pf_addr_filter_func_t filter) { struct pf_addr addr, cur, mask, umask_addr; union sockaddr_union uaddr, umask; @@ -2299,6 +2299,10 @@ _next_block: if (!KENTRY_NETWORK(ke)) { /* this is a single IP address - no possible nested block */ + if (filter && filter(af, &addr)) { + idx++; + goto _next_block; + } PF_ACPY(counter, &addr, af); *pidx = idx; pfr_kstate_counter_add(&kt->pfrkt_match, 1); @@ -2319,12 +2323,15 @@ _next_block: /* no need to check KENTRY_RNF_ROOT() here */ if (ke2 == ke) { /* lookup return the same block - perfect */ + if (filter && filter(af, &addr)) + goto _next_entry; PF_ACPY(counter, &addr, af); *pidx = idx; pfr_kstate_counter_add(&kt->pfrkt_match, 1); return (0); } +_next_entry: /* we need to increase the counter past the nested block */ pfr_prepare_network(&umask, AF_INET, ke2->pfrke_net); pfr_sockaddr_to_pf_addr(&umask, &umask_addr); From nobody Thu Sep 19 20:21:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3T6pWYz5XKy8; Thu, 19 Sep 2024 20:21: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 4X8n3T4tJ6z4XCw; Thu, 19 Sep 2024 20:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TuoB/NuIXQ0aXL79ahXxF28a0DLe0y03ufVmWybex6E=; b=mtv+AdzkyiPeeeHu+nnDb6XXqtuz+LU9bukelQtYgQXrz/Dm1dKobSNen3ityJRZKE8A9I Tz9P/3FgJ3gufKB9kiBurBB1Xmv0+VeaUA//mSJOGGzkJR6DuGUt8poL7TVd50oakdSbyq GdeaH10psGpKXf0XtiX+YeggI/rqBLmWLu2hvlsEXYqZBP0R9yho10zGFE9GZxrb/u0NFz uxEXyUkmNXRhLaROL2HV/8TmUlKnZTistEFvd+O1vBX3ivWF9VkCjcqSJpB/ED+F99oEeu bbq6REA/1fDztyYV2d0bDCg3dwfviKNsAE8PNvPzfDDstFWF1KQNDsL5tj45Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777285; a=rsa-sha256; cv=none; b=mdqao0LdYn5cJZaFtvfHER63+UlzVeDhCIRdN4nhOD8tVpOBP/NuSVmDrPjml9Bq60o2dL sTPcWTGNG6ln8U5t3HEhX3sjQrWxdbekTR8jvCm79SXYrE21TYx9edgidJwNH3jadhlILf BSS7K7vIuFEK80oVqKBPS9/PovlmlJO2QpzRLI5bwcSr9ftVw+22sg4UBzo34K5dv8J01L hAWJOKZoGATlPIj3F1oIquVLVYJoU5otFAy4A++WawtKaIbMKZr6ieNGbQxZQySG9P+z2r v7R5uX2X4TdLDp04GgFNH/zAx6/W9jisgbvtHyhdJxL7y5OhbWIa3IhBjF1veA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TuoB/NuIXQ0aXL79ahXxF28a0DLe0y03ufVmWybex6E=; b=RZyEiydbydvuGOs6tO4Y+joQZHfhFPuZEZK4pV3Za+V28aFcfCO6kK9obxMqapUrSEsHnf 0cw2d+bDuulDUzrD+/48nesByWJ844JVq37Kb8nTDvqBQ00jhISoLpBsHaA4JfoZElYyQS ZySiOTjA7R0VeV+v99aB13/ipjmEloBeRyKsy1J7eq9kKVpbKkOGL/cXwPzzhdp7LXnKTd VjrHNFblu5V66+Va1U+WFduzC0rZif8fd8CoveyPKQe+2+ppn716aZK/dxfxntiSiT2UT6 9C3CjLCkehwKswKv/arEML4QrA6OjlivGL936gfXFgsUewHG11SiQ0IkGnYEWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3T4CJNzL2v; Thu, 19 Sep 2024 20:21: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 48JKLPUK046695; Thu, 19 Sep 2024 20:21:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLPIH046692; Thu, 19 Sep 2024 20:21:25 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:25 GMT Message-Id: <202409192021.48JKLPIH046692@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: b450a0f928d6 - main - pf: remove unneeded double pointer to pf_scrub_ip(6)() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b450a0f928d640f823ba31779cd492e7d5d1c38c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b450a0f928d640f823ba31779cd492e7d5d1c38c commit b450a0f928d640f823ba31779cd492e7d5d1c38c Author: Kristof Provost AuthorDate: 2024-09-04 15:19:44 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:14 +0000 pf: remove unneeded double pointer to pf_scrub_ip(6)() pf_scrub_ip() does not modify the given mbuf pointer. So don't pass a pointer to a pointer to make the code in pf_test() clearer. ok henning@ Reviewed by: zlei Obtained from: OpenBSD, bluhm , aac78b59b9 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46593 --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 4 ++-- sys/netpfil/pf/pf_norm.c | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9a0130dbf487..8335fbfaedb8 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2641,10 +2641,10 @@ void pf_rule_to_actions(struct pf_krule *, int pf_normalize_mss(struct mbuf *m, int off, struct pf_pdesc *pd); #ifdef INET -void pf_scrub_ip(struct mbuf **, struct pf_pdesc *); +void pf_scrub_ip(struct mbuf *, struct pf_pdesc *); #endif /* INET */ #ifdef INET6 -void pf_scrub_ip6(struct mbuf **, struct pf_pdesc *); +void pf_scrub_ip6(struct mbuf *, struct pf_pdesc *); #endif /* INET6 */ struct pfi_kkif *pf_kkif_create(int); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index c85c2e784cd9..916657c7af15 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9221,7 +9221,7 @@ done: REASON_SET(&reason, PFRES_MEMORY); } - pf_scrub_ip(&m, &pd); + pf_scrub_ip(m, &pd); if (pd.proto == IPPROTO_TCP && pd.act.max_mss) pf_normalize_mss(m, off, &pd); @@ -9676,7 +9676,7 @@ done: REASON_SET(&reason, PFRES_MEMORY); } - pf_scrub_ip6(&m, &pd); + pf_scrub_ip6(m, &pd); if (pd.proto == IPPROTO_TCP && pd.act.max_mss) pf_normalize_mss(m, off, &pd); diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index aaeb027ca8bd..8bc9bb4914db 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2269,9 +2269,8 @@ sctp_drop: #ifdef INET void -pf_scrub_ip(struct mbuf **m0, struct pf_pdesc *pd) +pf_scrub_ip(struct mbuf *m, struct pf_pdesc *pd) { - struct mbuf *m = *m0; struct ip *h = mtod(m, struct ip *); /* Clear IP_DF if no-df was requested */ @@ -2313,9 +2312,8 @@ pf_scrub_ip(struct mbuf **m0, struct pf_pdesc *pd) #ifdef INET6 void -pf_scrub_ip6(struct mbuf **m0, struct pf_pdesc *pd) +pf_scrub_ip6(struct mbuf *m, struct pf_pdesc *pd) { - struct mbuf *m = *m0; struct ip6_hdr *h = mtod(m, struct ip6_hdr *); /* Enforce a minimum ttl, may cause endless packet loops */ From nobody Thu Sep 19 20:21:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3X1hVrz5XL3y; Thu, 19 Sep 2024 20:21: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 4X8n3W5xN5z4Ws9; Thu, 19 Sep 2024 20:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BZbmRm6om2OZbiewhovFt4NShjxHnfSvsidOwrmB0jw=; b=DXebetSsyXR3SUJYoBvS7BB1MUx92ubM++Vcb5hGi4KuQP/FnmJ7zY3gyGs8+068ax7uw5 L1PVJvNSdJUzGEbWGYW1k7wpiZj9jKsi9KeSq6tRT+GqIjFNLiUcs1yt/J68Ggs6wRjGzx UFvDBWyt6luF//cP3N6wYLjJueLmkYkFIjQo3JJSYcqHblHMLsOXCdxh61Hd1+3N6JViDK arYyQUe1bCXBEFER6Goa6d6l2CE8bZswDEgEoFRTrqBa0iYblq9IX+ZrwwF6I1IZbRHoL6 YJ4GXXnyaobt//aiOSWUNiy595RtyFi7OdLOmPeRD2DQvJXHAbxAbE4EuCSTPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777287; a=rsa-sha256; cv=none; b=to4MtuTav5KddnxosvrdtBTZxYthl0bERd5iCn5K1DIUbOUoDMKsAUocPrk4Dtg+muuN2v jvDoYFzuQbaEamMgEvc4WdEnNhe5zCV7/baw0EnE+XncmZHTV/wFdehCbqC94jUiRCNoA9 JmXblf3PzyybAL4QFB/spBZ8cN7NI/SGDU8UlA0dej7V8sL9fBi3VYXeYbVQWFEzGKf6Yj APkP/rAYcqjUinsJV0CHPtJHbEBrmmaq8D0Amk6cXh3Za8TajW+oQNSzTRqFwFCILCD20j a222Lf0mFxCcDJ3Sl/NwOG0sxf52+lT1L1Ru8v6LXfLI3I5cz2ZCokpQMW6xsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BZbmRm6om2OZbiewhovFt4NShjxHnfSvsidOwrmB0jw=; b=aPaujbFiqAhZ4Qm78iLr2gdK8MwDN0G2EdsgHremcv5+ibOMn/exeCnf/qBBGCSl9VbE0G ihuDMN41xlwt+ng34hmFFq7FHqf1KPAS8Weu24cNIdiKxRK1f9iVikuwmz7m6zXb3KJ+Cb gFLZcYCyniNHGrDuBRBwdUhQwYdJ5b0KCMdBeBIQkA8YkpNl21JFJralBLYkRzKzodnLi2 QiTrA3q8ZbFnd5Gw1sQTVtilB/qRz7optd4p2TPyT5YAJHF6AhwNJKQf7MFaFFbxmyLnzP 5XOwbojk8q/i0PTMLrvPIhi7tGMU9ultYF8cbkOe5MUaSq/fyD9z2szngoGpKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3W5QqWzL8G; Thu, 19 Sep 2024 20:21: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 48JKLR64046815; Thu, 19 Sep 2024 20:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLRm1046812; Thu, 19 Sep 2024 20:21:27 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:27 GMT Message-Id: <202409192021.48JKLRm1046812@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: 9746c1e28877 - main - pf tests: ensure we don't NAT to link-local addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9746c1e28877ffb5fd9dc60bb6524df9fa1b6918 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9746c1e28877ffb5fd9dc60bb6524df9fa1b6918 commit 9746c1e28877ffb5fd9dc60bb6524df9fa1b6918 Author: Kristof Provost AuthorDate: 2024-09-05 15:23:57 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:15 +0000 pf tests: ensure we don't NAT to link-local addresses Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46595 --- tests/sys/netpfil/pf/nat.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index aaa49805c772..19dd39fe5848 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -250,9 +250,61 @@ nested_anchor_cleanup() pft_cleanup } +atf_test_case "nat6_nolinklocal" "cleanup" +nat6_nolinklocal_head() +{ + atf_set descr 'Ensure we do not use link-local addresses' + atf_set require.user root +} + +nat6_nolinklocal_body() +{ + pft_init + + epair_nat=$(vnet_mkepair) + epair_echo=$(vnet_mkepair) + + vnet_mkjail nat ${epair_nat}b ${epair_echo}a + vnet_mkjail echo ${epair_echo}b + + ifconfig ${epair_nat}a inet6 2001:db8::2/64 no_dad up + route add -6 -net 2001:db8:1::/64 2001:db8::1 + + jexec nat ifconfig ${epair_nat}b inet6 2001:db8::1/64 no_dad up + jexec nat ifconfig ${epair_echo}a inet6 2001:db8:1::1/64 no_dad up + jexec nat sysctl net.inet6.ip6.forwarding=1 + + jexec echo ifconfig ${epair_echo}b inet6 2001:db8:1::2/64 no_dad up + # Ensure we can't reply to link-local pings + jexec echo pfctl -e + pft_set_rules echo \ + "pass" \ + "block in inet6 proto icmp6 from fe80::/10 to any icmp6-type echoreq" + + jexec nat pfctl -e + pft_set_rules nat \ + "nat pass on ${epair_echo}a inet6 from 2001:db8::/64 to any -> (${epair_echo}a)" \ + "pass" + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -6 -c 1 2001:db8::1 + for i in `seq 0 10` + do + atf_check -s exit:0 -o ignore \ + ping -6 -c 1 2001:db8:1::2 + done +} + +nat6_nolinklocal_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "exhaust" atf_add_test_case "nested_anchor" atf_add_test_case "endpoint_independent" + atf_add_test_case "nat6_nolinklocal" } From nobody Thu Sep 19 20:21:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n3Y0tDHz5XL42; Thu, 19 Sep 2024 20:21: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 4X8n3X6Zhfz4XBf; Thu, 19 Sep 2024 20:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h9/de7w79uxeQ3eob46vZmi25NwOeghMLGcxnA1Jpz0=; b=FunNEYm7JCtlM2w7FgwxdNNBECirPd4Ivt+HrqRseo1xZkHAYKHnx+CmBCoafUWH4HN0Qa IDyW0nuM1JPDGsgmIlUsTheftMUdw02wr71Lu85WyoQQ0DhEV+TVejGiGRPSxL8JBxh7T7 ctP3YRMqxCfWukDSz66MLeAwpmJ4nymmI6FA8WNGS835/pRsyPfk/4qPl3vNHGTJ+kXQps HMqeyp/++0dFls77QzufdGmgATiU/vZxB9BSF5DDuX6atqKo70yFwiP1CO8UGPuHcRCoKK aP6MF1qo+WTvso4xn1LGnFe1n4uuua2+QEV92jcJS2V+cYdW3KAp29D35tosPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777288; a=rsa-sha256; cv=none; b=DFOscLVckSFrHF2IAZCu2m1aAiXwRxwRhLY7KVIi01GGc7oyqgCocepALF0OyBobdACuC7 SV0bi3CoSSKinhYzva+p3Ls+JrxYx7PP31GG7B5jb/b2WkAcOrOMcpkZLVXuZVTShc9Gbp ovHLKtOXSB8cyfMDcFWqq/mnFxoB8A6fOqWQhwEIpc8z8ZawvYwgAHlnH1rscnj2O/iRKd C2ALh5mzy76Ju4gOdG6iK/r+TsT9G9LW8t3hjz0JgWEOs/ocT53AtHAFAp/cXKM+4AgBdk UgQRlhv58LpPgS1DdlbPvAca5mkmzc5KnU/8+2iYqtBi4LUcORNQfG2YEBA8qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h9/de7w79uxeQ3eob46vZmi25NwOeghMLGcxnA1Jpz0=; b=BIKxCjU4sS7YGH7G2ktZo4iqxkS7CkTpK1iA7nLcKPAe5zg8HdGaW86VEvhStFp4U4U/Mu mwuPF8Sxr/8LkmQWEulfiQ9j9WWQ/74M6srp33h+4T9PwqfTLdSYZX3rSkykJ3wy77340z CV/7U7HEPrlGWY5AETeqHiertp3ruNzoOJak01FGZjqMhqHjYS/x0maQwmyUiY7Cq0DpFW fUZgKfZjcbAk+x3SxmqHGFtNDAGYdWwekoLOWOpSWlhDUxcDSxkEszq3Sn7luBuc5Siu29 4/VSec039uXbNNBJiMV6+qFY1XTEDRIV/JsdOokuB1Y/Y6tNlruIiR0MzfIiKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n3X6C9JzKt4; Thu, 19 Sep 2024 20:21: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 48JKLSSS046864; Thu, 19 Sep 2024 20:21:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKLSR3046861; Thu, 19 Sep 2024 20:21:28 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:21:28 GMT Message-Id: <202409192021.48JKLSR3046861@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: bc4b0defb012 - main - pf: do not pass af to PFLOG_PACKET List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc4b0defb012b5b47f2b3e315446b3dc1889b596 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bc4b0defb012b5b47f2b3e315446b3dc1889b596 commit bc4b0defb012b5b47f2b3e315446b3dc1889b596 Author: Kristof Provost AuthorDate: 2024-09-06 08:55:52 +0000 Commit: Kristof Provost CommitDate: 2024-09-19 20:20:15 +0000 pf: do not pass af to PFLOG_PACKET Do not pass AF specific information to pf_test_rule() and PFLOG_PACKET() because either the info is already available in struct pd or easy to figure out. Makes pf_test() and pf_test6() even more similar (with the target to remove one of them in the near future). OK henning@ Reviewed by: zlei Obtained from: OpenBSD, claudio , 5480721ed1 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46596 --- sys/net/if_pflog.h | 4 ++-- sys/net/pfvar.h | 2 +- sys/netpfil/pf/if_pflog.c | 6 +++--- sys/netpfil/pf/pf.c | 20 ++++++++++---------- sys/netpfil/pf/pf_norm.c | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index fb0d971d490c..58c178e3798a 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -69,9 +69,9 @@ struct pf_ruleset; struct pfi_kif; struct pf_pdesc; -#define PFLOG_PACKET(i,a,b,t,c,d,e,f,g,di) do { \ +#define PFLOG_PACKET(i,a,b,t,c,d,e,f,g) do { \ if (pflog_packet_ptr != NULL) \ - pflog_packet_ptr(i,a,b,t,c,d,e,f,g,di); \ + pflog_packet_ptr(i,a,b,t,c,d,e,f,g); \ } while (0) #endif /* _KERNEL */ #endif /* _NET_IF_PFLOG_H_ */ diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index a5a0ed257ef3..0dfa58979f16 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1254,7 +1254,7 @@ void pf_state_export(struct pf_state_export *, /* pflog */ struct pf_kruleset; struct pf_pdesc; -typedef int pflog_packet_t(struct pfi_kkif *, struct mbuf *, sa_family_t, +typedef int pflog_packet_t(struct pfi_kkif *, struct mbuf *, uint8_t, u_int8_t, struct pf_krule *, struct pf_krule *, struct pf_kruleset *, struct pf_pdesc *, int); extern pflog_packet_t *pflog_packet_ptr; diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 6035ba635116..9276b472a845 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -213,7 +213,7 @@ pflogioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } static int -pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, +pflog_packet(struct pfi_kkif *kif, struct mbuf *m, uint8_t action, u_int8_t reason, struct pf_krule *rm, struct pf_krule *am, struct pf_kruleset *ruleset, struct pf_pdesc *pd, int lookupsafe) { @@ -229,7 +229,7 @@ pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, bzero(&hdr, sizeof(hdr)); hdr.length = PFLOG_REAL_HDRLEN; - hdr.af = af; + hdr.af = pd->af; hdr.action = action; hdr.reason = reason; memcpy(hdr.ifname, kif->pfik_name, sizeof(hdr.ifname)); @@ -262,7 +262,7 @@ pflog_packet(struct pfi_kkif *kif, struct mbuf *m, sa_family_t af, hdr.dir = pd->dir; #ifdef INET - if (af == AF_INET && pd->dir == PF_OUT) { + if (pd->af == AF_INET && pd->dir == PF_OUT) { struct ip *ip; ip = mtod(m, struct ip *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 916657c7af15..d4adf1363cdf 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4974,7 +4974,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, KASSERT(nk != NULL, ("%s: null nk", __func__)); if (nr->log) { - PFLOG_PACKET(kif, m, af, PF_PASS, PFRES_MATCH, nr, a, + PFLOG_PACKET(kif, m, PF_PASS, PFRES_MATCH, nr, a, ruleset, pd, 1); } @@ -5201,7 +5201,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, pf_counter_u64_critical_exit(); pf_rule_to_actions(r, &pd->act); if (r->log || pd->act.log & PF_LOG_MATCHES) - PFLOG_PACKET(kif, m, af, + PFLOG_PACKET(kif, m, r->action, PFRES_MATCH, r, a, ruleset, pd, 1); } else { @@ -5210,7 +5210,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, *am = a; *rsm = ruleset; if (pd->act.log & PF_LOG_MATCHES) - PFLOG_PACKET(kif, m, af, + PFLOG_PACKET(kif, m, r->action, PFRES_MATCH, r, a, ruleset, pd, 1); } @@ -5238,7 +5238,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, if (r->log || pd->act.log & PF_LOG_MATCHES) { if (rewrite) m_copyback(m, off, hdrlen, pd->hdr.any); - PFLOG_PACKET(kif, m, af, r->action, reason, r, a, ruleset, pd, 1); + PFLOG_PACKET(kif, m, r->action, reason, r, a, ruleset, pd, 1); } if ((r->action == PF_DROP) && @@ -5659,7 +5659,7 @@ pf_test_fragment(struct pf_krule **rm, struct pfi_kkif *kif, pf_counter_u64_critical_exit(); pf_rule_to_actions(r, &pd->act); if (r->log) - PFLOG_PACKET(kif, m, af, + PFLOG_PACKET(kif, m, r->action, PFRES_MATCH, r, a, ruleset, pd, 1); } else { @@ -5690,7 +5690,7 @@ pf_test_fragment(struct pf_krule **rm, struct pfi_kkif *kif, pf_rule_to_actions(r, &pd->act); if (r->log) - PFLOG_PACKET(kif, m, af, r->action, reason, r, a, ruleset, pd, 1); + PFLOG_PACKET(kif, m, r->action, reason, r, a, ruleset, pd, 1); if (r->action != PF_PASS) return (PF_DROP); @@ -9328,12 +9328,12 @@ done: lr = r; if (pd.act.log & PF_LOG_FORCE || lr->log & PF_LOG_ALL) - PFLOG_PACKET(kif, m, AF_INET, action, reason, lr, a, + PFLOG_PACKET(kif, m, action, reason, lr, a, ruleset, &pd, (s == NULL)); if (s) { SLIST_FOREACH(ri, &s->match_rules, entry) if (ri->r->log & PF_LOG_ALL) - PFLOG_PACKET(kif, m, AF_INET, action, + PFLOG_PACKET(kif, m, action, reason, ri->r, a, ruleset, &pd, 0); } } @@ -9736,12 +9736,12 @@ done: lr = r; if (pd.act.log & PF_LOG_FORCE || lr->log & PF_LOG_ALL) - PFLOG_PACKET(kif, m, AF_INET6, action, reason, lr, a, ruleset, + PFLOG_PACKET(kif, m, action, reason, lr, a, ruleset, &pd, (s == NULL)); if (s) { SLIST_FOREACH(ri, &s->match_rules, entry) if (ri->r->log & PF_LOG_ALL) - PFLOG_PACKET(kif, m, AF_INET6, action, reason, + PFLOG_PACKET(kif, m, action, reason, ri->r, a, ruleset, &pd, 0); } } diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 8bc9bb4914db..284660767224 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1199,7 +1199,7 @@ pf_normalize_ip(struct mbuf **m0, struct pfi_kkif *kif, u_short *reason, REASON_SET(reason, PFRES_FRAG); drop: if (r != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET, PF_DROP, *reason, r, NULL, NULL, pd, 1); + PFLOG_PACKET(kif, m, PF_DROP, *reason, r, NULL, NULL, pd, 1); return (PF_DROP); } @@ -1372,13 +1372,13 @@ again: shortpkt: REASON_SET(reason, PFRES_SHORT); if (r != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET6, PF_DROP, *reason, r, NULL, NULL, pd, 1); + PFLOG_PACKET(kif, m, PF_DROP, *reason, r, NULL, NULL, pd, 1); return (PF_DROP); drop: REASON_SET(reason, PFRES_NORM); if (r != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET6, PF_DROP, *reason, r, NULL, NULL, pd, 1); + PFLOG_PACKET(kif, m, PF_DROP, *reason, r, NULL, NULL, pd, 1); return (PF_DROP); } #endif /* INET6 */ @@ -1504,7 +1504,7 @@ pf_normalize_tcp(struct pfi_kkif *kif, struct mbuf *m, int ipoff, tcp_drop: REASON_SET(&reason, PFRES_NORM); if (rm != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET, PF_DROP, reason, r, NULL, NULL, pd, 1); + PFLOG_PACKET(kif, m, PF_DROP, reason, r, NULL, NULL, pd, 1); return (PF_DROP); } @@ -2261,7 +2261,7 @@ pf_normalize_sctp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, sctp_drop: REASON_SET(&reason, PFRES_NORM); if (rm != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET, PF_DROP, reason, r, NULL, NULL, pd, + PFLOG_PACKET(kif, m, PF_DROP, reason, r, NULL, NULL, pd, 1); return (PF_DROP); From nobody Thu Sep 19 20:24:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n6r1BYhz5XLMr; Thu, 19 Sep 2024 20:24: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 4X8n6r0KrJz4cZT; Thu, 19 Sep 2024 20:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2pEs6NUkdsZFhgV44dHqOFgltX6loHy0Cc+t15t2sSM=; b=deJkIKJSd9IKav3UZvdEP3EWN65+tg6lIJxYsg10gQvrEAkH49SsJn7Gkussua2ke3DRI9 jg1w/iNRg6uW2Q7zwnFVx9RgF5NeTNohu8dCq2nPIbM9+KrW1uOSKHv4JtQiNLxu0NQAOM A4LBB1cTtItFAT4Bl35EXFS50skK085LHFfO8pV/S7kQSdn+4Izy4hcwO/aY14GMEyYTMx R6Ht0OZtDnpotv/uqmv57c1838uFtTUSltsyHu/U0UCqPIrBIHxX6mzByq2yxNK0XE6PdE DRdmq5SJPn0ebxRu93vGjMCDd4MVoRb9Ssp/BxsokZTlyKxtChvzBs+F43QlSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777460; a=rsa-sha256; cv=none; b=U6Zr4CcpDwDXZc1NbQSKrFjJ4kWz83DGQCtkQrcCKY08HU9p8OGrU+CAZiJ8wyxwr38MyP jmGn0frNPtEmkDQES65+0lijmnPjyAhyGn7BdzhtuS3bOAPdortaY9q9rJWTt8kuSejBry KGmd6W5C9rIgPKwoCmHoFCr3QM/L7hnffhG38Wkdd4U4FItRdHailX0zhT7KDoCb4i0yfu f/eHHHfPWETWeggv1p1NiUQRbrSPrp8vQ6ScZE4Qc36cHswMq4XW3/jpQhfaqu++T6y3I3 0t+zzXaMORpVkOj0yCKOdJfVSPOPVikdOaoqEKbqDVPKSU1Qx0z7VwMRBN9Jnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2pEs6NUkdsZFhgV44dHqOFgltX6loHy0Cc+t15t2sSM=; b=P/jNPieVApWNdIgNEAWVBvLdRH9CbRynukDe+BWj1q2Xx9EuitXkIypM+FWx37kxfPsjx0 WkeufMPSTDin8vwbztJnh98Y5m/XsWnMaUWe3++/SCLq46o4W+fX55RaZcVyvT6Thm2IGH Zrzu2Z0wRl3qyFOQ4raApRSm5uFCWfqJKVFuMZBg+83rH53Ls4wQtbUa9qE9/wE5ZhQKJV aYsQlCmULQ+u4XUTfXgJAxFFyHm3hmE+d6sq2BVhvGzkznPJYeEoG+w5ExagaC477oHnIk NCpHsIfctj1hwiCkbvrdfkz+GHnjf4mRZajFKy3pThBSuuRkIVM/EjV58A1xWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n6q72zPzL8R; Thu, 19 Sep 2024 20:24: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 48JKOJCu052570; Thu, 19 Sep 2024 20:24:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKOJ1U052567; Thu, 19 Sep 2024 20:24:19 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:24:19 GMT Message-Id: <202409192024.48JKOJ1U052567@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: c3d743a67a7c - main - vm_object: use reclaim callback to free pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3d743a67a7c238645efe2979c40e423ae32f2ed Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c3d743a67a7c238645efe2979c40e423ae32f2ed commit c3d743a67a7c238645efe2979c40e423ae32f2ed Author: Doug Moore AuthorDate: 2024-09-19 20:23:19 +0000 Commit: Doug Moore CommitDate: 2024-09-19 20:23:19 +0000 vm_object: use reclaim callback to free pages Instead of iterating over object->memq to free pages, use a callback in VM_RADIX_PCTRIE_RECLAIM_CALLBACK to do it. Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D45588 --- sys/vm/vm_object.c | 62 ++++++++++++++++++++++++++++-------------------------- sys/vm/vm_radix.h | 10 +++++---- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 7b3950b6f3bc..86f9271341df 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -876,6 +876,27 @@ vm_object_backing_collapse_wait(vm_object_t object) return (backing_object); } +/* + * vm_object_terminate_single_page removes a pageable page from the object, + * and removes it from the paging queues and frees it, if it is not wired. + * It is invoked via callback from vm_object_terminate_pages. + */ +static void +vm_object_terminate_single_page(vm_page_t p, void *objectv) +{ + vm_object_t object __diagused = objectv; + + vm_page_assert_unbusied(p); + KASSERT(p->object == object && + (p->ref_count & VPRC_OBJREF) != 0, + ("%s: page %p is inconsistent", __func__, p)); + p->object = NULL; + if (vm_page_drop(p, VPRC_OBJREF) == VPRC_OBJREF) { + VM_CNT_INC(v_pfree); + vm_page_free(p); + } +} + /* * vm_object_terminate_pages removes any remaining pageable pages * from the object and resets the object to an empty state. @@ -883,41 +904,22 @@ vm_object_backing_collapse_wait(vm_object_t object) static void vm_object_terminate_pages(vm_object_t object) { - vm_page_t p, p_next; - VM_OBJECT_ASSERT_WLOCKED(object); - /* - * Free any remaining pageable pages. This also removes them from the - * paging queues. However, don't free wired pages, just remove them - * from the object. Rather than incrementally removing each page from - * the object, the page and object are reset to any empty state. - */ - TAILQ_FOREACH_SAFE(p, &object->memq, listq, p_next) { - vm_page_assert_unbusied(p); - KASSERT(p->object == object && - (p->ref_count & VPRC_OBJREF) != 0, - ("vm_object_terminate_pages: page %p is inconsistent", p)); - - p->object = NULL; - if (vm_page_drop(p, VPRC_OBJREF) == VPRC_OBJREF) { - VM_CNT_INC(v_pfree); - vm_page_free(p); - } - } - /* * If the object contained any pages, then reset it to an empty state. - * None of the object's fields, including "resident_page_count", were - * modified by the preceding loop. + * Rather than incrementally removing each page from the object, the + * page and object are reset to any empty state. */ - if (object->resident_page_count != 0) { - vm_radix_reclaim_allnodes(&object->rtree); - TAILQ_INIT(&object->memq); - object->resident_page_count = 0; - if (object->type == OBJT_VNODE) - vdrop(object->handle); - } + if (object->resident_page_count == 0) + return; + + vm_radix_reclaim_callback(&object->rtree, + vm_object_terminate_single_page, object); + TAILQ_INIT(&object->memq); + object->resident_page_count = 0; + if (object->type == OBJT_VNODE) + vdrop(object->handle); } /* diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h index f2e297b10641..d35c9a171d4b 100644 --- a/sys/vm/vm_radix.h +++ b/sys/vm/vm_radix.h @@ -187,14 +187,16 @@ vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index) { return (VM_RADIX_PCTRIE_REMOVE_LOOKUP(&rtree->rt_trie, index)); } - + /* - * Reclaim all the interior nodes from the radix tree. + * Reclaim all the interior nodes of the trie, and invoke the callback + * on all the pages, in order. */ static __inline void -vm_radix_reclaim_allnodes(struct vm_radix *rtree) +vm_radix_reclaim_callback(struct vm_radix *rtree, + void (*page_cb)(vm_page_t, void *), void *arg) { - VM_RADIX_PCTRIE_RECLAIM(&rtree->rt_trie); + VM_RADIX_PCTRIE_RECLAIM_CALLBACK(&rtree->rt_trie, page_cb, arg); } /* From nobody Thu Sep 19 20:24:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n7R0ktBz5XLQX; Thu, 19 Sep 2024 20:24: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 4X8n7Q68z6z4cn6; Thu, 19 Sep 2024 20:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxp091VgpZFu9vdCr4iFEg+hbM4P5ylKFU/Jg2yXTik=; b=KrgotSkfbe5xQIoKPwDBtMOtZIBjEX5scau3jCERMjSTrqwWnmuK3JqtvpSuC2egFYVS5Z z8quuDUMT2SKVoXV92Nm0RJCPJwVtjrPJcpGtsAcHo+FxPSSDp4ktzd25bJq8JH4DsxAfr IjtvkAzTRmWvGM+U5tYXpAaOnzvQx4ussQJuqdPMcYFN2tOwCp3aXFdJWwMjB8tCHh6UNc X0hMu6WaavIGfAd8nkgE7CA8meqAm50uLMNH1DaNmkBjNX3qyS90PkYpy6qGxkyFZC60x0 MnPZqzxPZRGFtfZyYe955EHBYkT0HcQocmpF4V4hLrQqffd8w8TOJ13mjfNC0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777490; a=rsa-sha256; cv=none; b=M5oJPdh2DYzRCC66yqi80wXaZ+yVQyYVTDZqJzrusYCklQBunGMFk11ZITQ/PDtNKjUJyr yc/UzXHdeOxudE5mAcJ6OHCdf41fpSFZkXL+CpTx0vGsDmC/UKLhtKzb1bZnG+0YrkfS1u 4lCwnwV0sRG12w4o00HYVmhXJb0ms7cBh4LtCgN2srem/rfupqbLW+KOsICsAPCinRFmB4 /Bnh5LniuT05Hc2pYv6iJIgLMMD31cDePMtse80fWuF1ilPAdYdDGc1ZeY7ix6dzkONq+S 2ks4Oxte9cAsdTNi5rfFeTht7Hg0ucTBVaNzQtopw+fw7dEp3kXrq51iVGFIDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxp091VgpZFu9vdCr4iFEg+hbM4P5ylKFU/Jg2yXTik=; b=Cudrqn0mdxgCj7EBzE+kBeQmbiytqcynWYHV4My2xuSLz5Cfuo08MfZnAkIZIAKaR5zRce 33oHe6Tq6bJ/ZMYzl8HSDEYJWc97+dYuP02nSq9dZr+zANtwf5PI6izoEVhcctwpmJ2WOc ++e95SzrBZe8D6kvCQGzDcixfeufSKy/ei0TZ2wVsztdWrOgqDzMb95V7WD/vP8UGj3YAl 0aPQ6AlpwQVD9Wt87MRFNK+qcXv5MWtobKxjUg1uuG8OBRllZW2+q5zDgZwEoNnroHZCnM obaVfhOSnxS1GR0pFDPZrTymY+/M5OLBL+iHpwbHQjj7ewDfbk11ADh3oSlrYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n7Q5mnVzKhD; Thu, 19 Sep 2024 20:24: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 48JKOoWl052785; Thu, 19 Sep 2024 20:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKOoeB052782; Thu, 19 Sep 2024 20:24:50 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:24:50 GMT Message-Id: <202409192024.48JKOoeB052782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 0cc98ae442ba - stable/14 - ctld: plug memory leaks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0cc98ae442ba4e7764d0d56899fc39f4229a3175 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0cc98ae442ba4e7764d0d56899fc39f4229a3175 commit 0cc98ae442ba4e7764d0d56899fc39f4229a3175 Author: Alan Somers AuthorDate: 2024-06-12 21:34:05 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:23:53 +0000 ctld: plug memory leaks Reviewed by: mav Sponsored by: Axcient Reported by: valgrind Pull Request: https://github.com/freebsd/freebsd-src/pull/1288 (cherry picked from commit 2909ddd17cb4d750852dc04128e584f93f8c5058) --- usr.sbin/ctld/ctld.c | 1 + usr.sbin/ctld/kernel.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index f2b2de5b9a57..f3d8d5807856 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -2874,6 +2874,7 @@ main(int argc, char **argv) error = conf_apply(oldconf, newconf); if (error != 0) log_warnx("failed to apply configuration"); + conf_delete(newconf); conf_delete(oldconf); oldconf = NULL; diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index ec46a9b765a8..5f61188aa5d6 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -615,6 +615,22 @@ retry_port: } cp->p_ctl_port = port->port_id; } + while ((port = STAILQ_FIRST(&devlist.port_list))) { + struct cctl_lun_nv *nv; + + STAILQ_REMOVE_HEAD(&devlist.port_list, links); + free(port->port_frontend); + free(port->port_name); + free(port->cfiscsi_target); + free(port->ctld_portal_group_name); + while ((nv = STAILQ_FIRST(&port->attr_list))) { + STAILQ_REMOVE_HEAD(&port->attr_list, links); + free(nv->value); + free(nv->name); + free(nv); + } + free(port); + } free(name); STAILQ_FOREACH(lun, &devlist.lun_list, links) { @@ -665,6 +681,18 @@ retry_port: cl->l_name); } } + while ((lun = STAILQ_FIRST(&devlist.lun_list))) { + struct cctl_lun_nv *nv; + + STAILQ_REMOVE_HEAD(&devlist.lun_list, links); + while ((nv = STAILQ_FIRST(&lun->attr_list))) { + STAILQ_REMOVE_HEAD(&lun->attr_list, links); + free(nv->value); + free(nv->name); + free(nv); + } + free(lun); + } return (conf); } @@ -742,12 +770,14 @@ kernel_lun_add(struct lun *lun) req.args = nvlist_pack(req.args_nvl, &req.args_len); if (req.args == NULL) { + nvlist_destroy(req.args_nvl); log_warn("error packing nvlist"); return (1); } } error = ioctl(ctl_fd, CTL_LUN_REQ, &req); + free(req.args); nvlist_destroy(req.args_nvl); if (error != 0) { @@ -825,12 +855,14 @@ kernel_lun_modify(struct lun *lun) req.args = nvlist_pack(req.args_nvl, &req.args_len); if (req.args == NULL) { + nvlist_destroy(req.args_nvl); log_warn("error packing nvlist"); return (1); } } error = ioctl(ctl_fd, CTL_LUN_REQ, &req); + free(req.args); nvlist_destroy(req.args_nvl); if (error != 0) { @@ -1053,6 +1085,7 @@ kernel_port_add(struct port *port) req.args = nvlist_pack(req.args_nvl, &req.args_len); if (req.args == NULL) { + nvlist_destroy(req.args_nvl); log_warn("error packing nvlist"); return (1); } @@ -1060,6 +1093,7 @@ kernel_port_add(struct port *port) req.result = result_buf; req.result_len = sizeof(result_buf); error = ioctl(ctl_fd, CTL_PORT_REQ, &req); + free(req.args); nvlist_destroy(req.args_nvl); if (error != 0) { @@ -1203,11 +1237,13 @@ kernel_port_remove(struct port *port) req.args = nvlist_pack(req.args_nvl, &req.args_len); if (req.args == NULL) { + nvlist_destroy(req.args_nvl); log_warn("error packing nvlist"); return (1); } error = ioctl(ctl_fd, CTL_PORT_REQ, &req); + free(req.args); nvlist_destroy(req.args_nvl); if (error != 0) { From nobody Thu Sep 19 20:24:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n7S0jW9z5XLdp; Thu, 19 Sep 2024 20:24: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 4X8n7S08Crz4cqR; Thu, 19 Sep 2024 20:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5pi2tBhl8ZZy/bJwzA9VEnwMkAHn+hRBskXVTM2l1Ao=; b=gknRmrS0Z3anmTDQD+6uTDEuAlBLOLv7IyExk327LlYLqpf6A4tfyD0Hq+CHC+ZLRGqskH a21Oq1AML3easABZgJBGuIS4x2euSKyjKaYwg40sllNZ9MDvtBD31x3K4CeAAGpc8Vv9C/ FYEi+XCP8YorhXcW2wmaO4BTfFl7DA7S80JIWnwLBnGcQW/4ekbiJ+3fslmE607YJzfPy3 pXeeXYRGjPgZmc/FaIpX20gOZDEAxkV0q9O8wP47baxL3v4L200eAOdJ6TPHdR80jbnEgl CZ/HuFnPADEO7luQ5dLUKfGFfMC1impAcUH/aLwg9XkudUKOa2uTPHYTFLwdKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777492; a=rsa-sha256; cv=none; b=nBMmmAU9DLlWTVauzcDmUlcSj9XI8FG/9GdTvNgsN4LOrh8cc6DoI4lvpKeNz7nRfHu0SU tpA2yq5Pc9PKYjkML4LPYJ8T2zQnhVGhyR7CN0eOAREHdNSyxaPvQZpAR4p+IAfOT1MzHU EiHmhD2qT2wildhT4Vn964gjphN88NCp/dcRyEaPGRTTWCEB4wppsBP0bjkZBuRgNF/dqB ocLJ8M8WGQXlimylvGO9FVkTMRO/ZfXsus23bP2fPA2t1hWUEync9AjtjhBq5zAs14asLZ HpV4W1gbKxFUlW+mIoyXENHSWBcFNhs+lIRFx+KbKSHT8feK/HhIFgH3+b25cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5pi2tBhl8ZZy/bJwzA9VEnwMkAHn+hRBskXVTM2l1Ao=; b=im7lBkQ4aGLWBqQQJzB4MWBMWehvOuNCJOJRpFoFDhHybT987fFT6IHak7UCLepdrOf30A zP0WOFIoVHDISS/A0Njsm7l9U8c5qM57M73fheg54wcsepqG2iyCGUnsMlXRxoKzqJMh7W 6cDF/sjCjZFabWRCojrsvtGA3xFfJnBW8SnwIYzDhHkTzaQdCHYhJ5Qm2e+3jHkxcm5Jar dZhr32eULmoDrUhMwTR3z5ydfFTXdiZnBRkK6lt4w58M+6iKuKc0gg0R+7QbuubZLuCvAy njisVF7CN1vnMc7qiRzRWTkyv048Tgkj3d/2CIlaSJcI58vYcDB9b6cpwgbcoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n7R6s7lzLBc; Thu, 19 Sep 2024 20:24: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 48JKOpc1052839; Thu, 19 Sep 2024 20:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKOphE052836; Thu, 19 Sep 2024 20:24:51 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:24:51 GMT Message-Id: <202409192024.48JKOphE052836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 0062ba53df13 - stable/14 - ctld: parse config file independently of getting kernel info List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0062ba53df13d93c3611e28cb10613d0d8e6a03c Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0062ba53df13d93c3611e28cb10613d0d8e6a03c commit 0062ba53df13d93c3611e28cb10613d0d8e6a03c Author: Alan Somers AuthorDate: 2024-06-10 23:48:49 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:23:56 +0000 ctld: parse config file independently of getting kernel info Separate the parsing of the config file from the reading of kernel port information. This has three benefits: * Separation of concerns makes future changes easier. * Allows the config file to be read earlier, which is necessary for fixing PR 271460. * Reduces total line count, by eliminating duplication between parse.y (for traditional config file) and uclparse.c (for UCL config file). Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1287 (cherry picked from commit 969876fcee57ea1cb1c7b4d2ee757793cbfbe353) --- usr.sbin/ctld/ctld.c | 99 +++++++++++++++++++++++++++++++++++++----------- usr.sbin/ctld/ctld.h | 25 ++++++++---- usr.sbin/ctld/kernel.c | 6 +-- usr.sbin/ctld/parse.y | 37 +----------------- usr.sbin/ctld/uclparse.c | 37 ++---------------- 5 files changed, 100 insertions(+), 104 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index f3d8d5807856..fdd3a49f8a48 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -99,7 +99,6 @@ conf_new(void) TAILQ_INIT(&conf->conf_auth_groups); TAILQ_INIT(&conf->conf_ports); TAILQ_INIT(&conf->conf_portal_groups); - TAILQ_INIT(&conf->conf_pports); TAILQ_INIT(&conf->conf_isns); conf->conf_isns_period = 900; @@ -118,7 +117,6 @@ conf_delete(struct conf *conf) struct target *targ, *tmp; struct auth_group *ag, *cagtmp; struct portal_group *pg, *cpgtmp; - struct pport *pp, *pptmp; struct isns *is, *istmp; assert(conf->conf_pidfh == NULL); @@ -131,8 +129,6 @@ conf_delete(struct conf *conf) auth_group_delete(ag); TAILQ_FOREACH_SAFE(pg, &conf->conf_portal_groups, pg_next, cpgtmp) portal_group_delete(pg); - TAILQ_FOREACH_SAFE(pp, &conf->conf_pports, pp_next, pptmp) - pport_delete(pp); TAILQ_FOREACH_SAFE(is, &conf->conf_isns, i_next, istmp) isns_delete(is); assert(TAILQ_EMPTY(&conf->conf_ports)); @@ -1178,27 +1174,27 @@ valid_iscsi_name(const char *name) } struct pport * -pport_new(struct conf *conf, const char *name, uint32_t ctl_port) +pport_new(struct kports *kports, const char *name, uint32_t ctl_port) { struct pport *pp; pp = calloc(1, sizeof(*pp)); if (pp == NULL) log_err(1, "calloc"); - pp->pp_conf = conf; + pp->pp_kports = kports; pp->pp_name = checked_strdup(name); pp->pp_ctl_port = ctl_port; TAILQ_INIT(&pp->pp_ports); - TAILQ_INSERT_TAIL(&conf->conf_pports, pp, pp_next); + TAILQ_INSERT_TAIL(&kports->pports, pp, pp_next); return (pp); } struct pport * -pport_find(const struct conf *conf, const char *name) +pport_find(const struct kports *kports, const char *name) { struct pport *pp; - TAILQ_FOREACH(pp, &conf->conf_pports, pp_next) { + TAILQ_FOREACH(pp, &kports->pports, pp_next) { if (strcasecmp(pp->pp_name, name) == 0) return (pp); } @@ -1206,11 +1202,11 @@ pport_find(const struct conf *conf, const char *name) } struct pport * -pport_copy(struct pport *pp, struct conf *conf) +pport_copy(struct pport *pp, struct kports *kports) { struct pport *ppnew; - ppnew = pport_new(conf, pp->pp_name, pp->pp_ctl_port); + ppnew = pport_new(kports, pp->pp_name, pp->pp_ctl_port); return (ppnew); } @@ -1221,7 +1217,7 @@ pport_delete(struct pport *pp) TAILQ_FOREACH_SAFE(port, &pp->pp_ports, p_ts, tport) port_delete(port); - TAILQ_REMOVE(&pp->pp_conf->conf_pports, pp, pp_next); + TAILQ_REMOVE(&pp->pp_kports->pports, pp, pp_next); free(pp->pp_name); free(pp); } @@ -1256,7 +1252,8 @@ port_new(struct conf *conf, struct target *target, struct portal_group *pg) } struct port * -port_new_ioctl(struct conf *conf, struct target *target, int pp, int vp) +port_new_ioctl(struct conf *conf, struct kports *kports, struct target *target, + int pp, int vp) { struct pport *pport; struct port *port; @@ -1270,7 +1267,7 @@ port_new_ioctl(struct conf *conf, struct target *target, int pp, int vp) return (NULL); } - pport = pport_find(conf, pname); + pport = pport_find(kports, pname); if (pport != NULL) { free(pname); return (port_new_pp(conf, target, pport)); @@ -1425,6 +1422,7 @@ target_delete(struct target *targ) port_delete(port); TAILQ_REMOVE(&targ->t_conf->conf_targets, targ, t_next); + free(targ->t_pport); free(targ->t_name); free(targ->t_redirection); free(targ); @@ -2687,21 +2685,17 @@ check_perms(const char *path) } static struct conf * -conf_new_from_file(const char *path, struct conf *oldconf, bool ucl) +conf_new_from_file(const char *path, bool ucl) { struct conf *conf; struct auth_group *ag; struct portal_group *pg; - struct pport *pp; int error; log_debugx("obtaining configuration from %s", path); conf = conf_new(); - TAILQ_FOREACH(pp, &oldconf->conf_pports, pp_next) - pport_copy(pp, conf); - ag = auth_group_new(conf, "default"); assert(ag != NULL); @@ -2756,9 +2750,60 @@ conf_new_from_file(const char *path, struct conf *oldconf, bool ucl) return (conf); } +/* + * If the config file specifies physical ports for any target, associate them + * with the config file. If necessary, create them. + */ +static int +new_pports_from_conf(struct conf *conf, struct kports *kports) +{ + struct target *targ; + struct pport *pp; + struct port *tp; + int ret, i_pp, i_vp; + + TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { + if (!targ->t_pport) + continue; + + ret = sscanf(targ->t_pport, "ioctl/%d/%d", &i_pp, &i_vp); + if (ret > 0) { + tp = port_new_ioctl(conf, kports, targ, i_pp, i_vp); + if (tp == NULL) { + log_warnx("can't create new ioctl port " + "for target \"%s\"", targ->t_name); + return (1); + } + + continue; + } + + pp = pport_find(kports, targ->t_pport); + if (pp == NULL) { + log_warnx("unknown port \"%s\" for target \"%s\"", + targ->t_pport, targ->t_name); + return (1); + } + if (!TAILQ_EMPTY(&pp->pp_ports)) { + log_warnx("can't link port \"%s\" to target \"%s\", " + "port already linked to some target", + targ->t_pport, targ->t_name); + return (1); + } + tp = port_new_pp(conf, targ, pp); + if (tp == NULL) { + log_warnx("can't link port \"%s\" to target \"%s\"", + targ->t_pport, targ->t_name); + return (1); + } + } + return (0); +} + int main(int argc, char **argv) { + struct kports kports; struct conf *oldconf, *newconf, *tmpconf; struct isns *newns; const char *config_path = DEFAULT_CONFIG_PATH; @@ -2801,8 +2846,9 @@ main(int argc, char **argv) log_init(debug); kernel_init(); - oldconf = conf_new_from_kernel(); - newconf = conf_new_from_file(config_path, oldconf, use_ucl); + TAILQ_INIT(&kports.pports); + oldconf = conf_new_from_kernel(&kports); + newconf = conf_new_from_file(config_path, use_ucl); if (newconf == NULL) log_errx(1, "configuration error; exiting"); @@ -2815,6 +2861,9 @@ main(int argc, char **argv) newconf->conf_debug = debug; } + if (new_pports_from_conf(newconf, &kports)) + log_errx(1, "Error associating physical ports; exiting"); + error = conf_apply(oldconf, newconf); if (error != 0) log_errx(1, "failed to apply configuration; exiting"); @@ -2842,17 +2891,21 @@ main(int argc, char **argv) if (sighup_received) { sighup_received = false; log_debugx("received SIGHUP, reloading configuration"); - tmpconf = conf_new_from_file(config_path, newconf, - use_ucl); + tmpconf = conf_new_from_file(config_path, use_ucl); if (tmpconf == NULL) { log_warnx("configuration error, " "continuing with old configuration"); + } else if (new_pports_from_conf(tmpconf, &kports)) { + log_warnx("Error associating physical ports, " + "continuing with old configuration"); + conf_delete(tmpconf); } else { if (debug > 0) tmpconf->conf_debug = debug; oldconf = newconf; newconf = tmpconf; + error = conf_apply(oldconf, newconf); if (error != 0) log_warnx("failed to reload " diff --git a/usr.sbin/ctld/ctld.h b/usr.sbin/ctld/ctld.h index bcc3c1956dc4..e1bab1a8e3b8 100644 --- a/usr.sbin/ctld/ctld.h +++ b/usr.sbin/ctld/ctld.h @@ -131,10 +131,11 @@ struct portal_group { uint16_t pg_tag; }; +/* Ports created by the kernel. Perhaps the "p" means "physical" ? */ struct pport { TAILQ_ENTRY(pport) pp_next; TAILQ_HEAD(, port) pp_ports; - struct conf *pp_conf; + struct kports *pp_kports; char *pp_name; uint32_t pp_ctl_port; @@ -190,6 +191,8 @@ struct target { char *t_name; char *t_alias; char *t_redirection; + /* Name of this target's physical port, if any, i.e. "isp0" */ + char *t_pport; }; struct isns { @@ -206,7 +209,6 @@ struct conf { TAILQ_HEAD(, auth_group) conf_auth_groups; TAILQ_HEAD(, port) conf_ports; TAILQ_HEAD(, portal_group) conf_portal_groups; - TAILQ_HEAD(, pport) conf_pports; TAILQ_HEAD(, isns) conf_isns; int conf_isns_period; int conf_isns_timeout; @@ -224,6 +226,11 @@ struct conf { bool conf_kernel_port_on; }; +/* Physical ports exposed by the kernel */ +struct kports { + TAILQ_HEAD(, pport) pports; +}; + #define CONN_SESSION_TYPE_NONE 0 #define CONN_SESSION_TYPE_DISCOVERY 1 #define CONN_SESSION_TYPE_NORMAL 2 @@ -247,11 +254,11 @@ struct ctld_connection { struct chap *conn_chap; }; -int parse_conf(struct conf *conf, const char *path); +int parse_conf(struct conf *newconf, const char *path); int uclparse_conf(struct conf *conf, const char *path); struct conf *conf_new(void); -struct conf *conf_new_from_kernel(void); +struct conf *conf_new_from_kernel(struct kports *kports); void conf_delete(struct conf *conf); int conf_verify(struct conf *conf); @@ -305,15 +312,17 @@ void isns_register(struct isns *isns, struct isns *oldisns); void isns_check(struct isns *isns); void isns_deregister(struct isns *isns); -struct pport *pport_new(struct conf *conf, const char *name, +struct pport *pport_new(struct kports *kports, const char *name, uint32_t ctl_port); -struct pport *pport_find(const struct conf *conf, const char *name); -struct pport *pport_copy(struct pport *pport, struct conf *conf); +struct pport *pport_find(const struct kports *kports, + const char *name); +struct pport *pport_copy(struct pport *pp, struct kports *kports); void pport_delete(struct pport *pport); struct port *port_new(struct conf *conf, struct target *target, struct portal_group *pg); -struct port *port_new_ioctl(struct conf *conf, struct target *target, +struct port *port_new_ioctl(struct conf *conf, + struct kports *kports, struct target *target, int pp, int vp); struct port *port_new_pp(struct conf *conf, struct target *target, struct pport *pp); diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index 5f61188aa5d6..fdd1b7c87db6 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -415,7 +415,7 @@ cctl_char_handler(void *user_data, const XML_Char *str, int len) } struct conf * -conf_new_from_kernel(void) +conf_new_from_kernel(struct kports *kports) { struct conf *conf = NULL; struct target *targ; @@ -560,13 +560,13 @@ retry_port: if (port->cfiscsi_target == NULL) { log_debugx("CTL port %u \"%s\" wasn't managed by ctld; ", port->port_id, name); - pp = pport_find(conf, name); + pp = pport_find(kports, name); if (pp == NULL) { #if 0 log_debugx("found new kernel port %u \"%s\"", port->port_id, name); #endif - pp = pport_new(conf, name, port->port_id); + pp = pport_new(kports, name, port->port_id); if (pp == NULL) { log_warnx("pport_new failed"); continue; diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index 8909df2a8345..d8274b623d3a 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -832,42 +832,7 @@ target_portal_group: PORTAL_GROUP STR STR target_port: PORT STR { - struct pport *pp; - struct port *tp; - int ret, i_pp, i_vp = 0; - - ret = sscanf($2, "ioctl/%d/%d", &i_pp, &i_vp); - if (ret > 0) { - tp = port_new_ioctl(conf, target, i_pp, i_vp); - if (tp == NULL) { - log_warnx("can't create new ioctl port for " - "target \"%s\"", target->t_name); - free($2); - return (1); - } - } else { - pp = pport_find(conf, $2); - if (pp == NULL) { - log_warnx("unknown port \"%s\" for target \"%s\"", - $2, target->t_name); - free($2); - return (1); - } - if (!TAILQ_EMPTY(&pp->pp_ports)) { - log_warnx("can't link port \"%s\" to target \"%s\", " - "port already linked to some target", - $2, target->t_name); - free($2); - return (1); - } - tp = port_new_pp(conf, target, pp); - if (tp == NULL) { - log_warnx("can't link port \"%s\" to target \"%s\"", - $2, target->t_name); - free($2); - return (1); - } - } + target->t_pport = strdup($2); free($2); } diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index 8bd1ca88d166..e9e42bdf953e 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -853,41 +853,10 @@ uclparse_target(const char *name, const ucl_object_t *top) } if (!strcmp(key, "port")) { - struct pport *pp; - struct port *tp; - const char *value = ucl_object_tostring(obj); - int ret, i_pp, i_vp = 0; - - ret = sscanf(value, "ioctl/%d/%d", &i_pp, &i_vp); - if (ret > 0) { - tp = port_new_ioctl(conf, target, i_pp, i_vp); - if (tp == NULL) { - log_warnx("can't create new ioctl port " - "for target \"%s\"", target->t_name); - return (1); - } + const char *value; - continue; - } - - pp = pport_find(conf, value); - if (pp == NULL) { - log_warnx("unknown port \"%s\" for target \"%s\"", - value, target->t_name); - return (1); - } - if (!TAILQ_EMPTY(&pp->pp_ports)) { - log_warnx("can't link port \"%s\" to target \"%s\", " - "port already linked to some target", - value, target->t_name); - return (1); - } - tp = port_new_pp(conf, target, pp); - if (tp == NULL) { - log_warnx("can't link port \"%s\" to target \"%s\"", - value, target->t_name); - return (1); - } + value = ucl_object_tostring(obj); + target->t_pport = strdup(value); } if (!strcmp(key, "redirect")) { From nobody Thu Sep 19 20:24:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n7T3bHkz5XLcF; Thu, 19 Sep 2024 20:24: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 4X8n7T0bqJz4cqd; Thu, 19 Sep 2024 20:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NFmUvHHuWrKTKd5DiTKt+OZGxLNBsE/0vku+Y7Fjtl4=; b=PAnHuxhe0sQr2SHahqIkXMvJc41Y+8BvclBEStsi7g0SFBOZ0Pz/Gh1+LCKpkdrYDaamrq Ly5K3nSEBaHc4MQK5sY87THUrq/60z53gKsCvmzcejLtX2Jk8xJ9RGSvqQKJZFg5wq9Y/J jlAAOJJeFyVAsbSlUigJsXLB4SUz2gLPXfPhqDeEA3WsI61TqcKVpzbQBHIWxvsWWXWz/X +8YCB/Muz3rEVT0MnvGk2gKRhj82mD1WQCVjvYy2wgflr7pqLwcHG1w/dy4N6ThBFUf4dn ZyXWaX3gbrixsEZJ+XOJpBN5AYrHBoYk80BeJusQs38KwLY37tMd8DaDUQ7AzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777493; a=rsa-sha256; cv=none; b=FpdJFnNz1ehYQ7UP6WGUTamKBHNcG8ppjKmC01VUp7ZWuWq7nJfjv7HeZKrwuWtJs7OUrg +7w0zdNvpQR1x4i57GxucdoqjOBASgglskwg6MjhKZY+T6tyq7xCWqW/AG5+0HDYZeKmrV a1wVezL7QYIpP6hM7nq54uEYeSNTEWedqAt8OzbN2gpoLZ7Yuqvumn/LemgFFK6AB6pTWT TaIaMSbuz7tRUQyGi7FJb+9PpUwRcsEWRGrRZ/gjEJCGaQ/meJf2n7jZY5Q0qn89GIAeyd 4xq5GQx7WAPkYUm4BK/P7kpA5bTFy8ZQw8bQSxpfBJfmNgaT8rzg6i0QzQOW6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NFmUvHHuWrKTKd5DiTKt+OZGxLNBsE/0vku+Y7Fjtl4=; b=dV5XvPvcfdgUghjfcmzE9Pas0ClHCWeWMs19C95d+PtlXkrJBXAhwHW+yRmpNi4HhYBatG dMVuRKikjladE7+QZpLkxPZx+fFhvnwZxttNnbobaaAVmkadHdSt99WFRpbo1EcRdGNPf2 4ZSfHqrhQHAdT3pyhEuiqCj7KhwLAqvDuIfa4ruuYKoW3ah+xMAvVKW4V6I2EcQhO886OC 7ZrZ00O/87j+xyAWMiwg1haNTwh65GSqouR+m4OC875wWJqnK3dexPWuOXytVvImQx7K/j eJu0JfQhJ/GLYwd6TzDz0QQW+6Z/vX97yK3KCVZKnPEdH4rRwthXpWA5VzEwOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n7T0CdZzL6N; Thu, 19 Sep 2024 20:24: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 48JKOqDS052895; Thu, 19 Sep 2024 20:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKOq3R052892; Thu, 19 Sep 2024 20:24:52 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:24:52 GMT Message-Id: <202409192024.48JKOq3R052892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 37357ba28a6d - stable/14 - ctl: add tests for START STOP UNIT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37357ba28a6dd984043a60e16084bd79071d95e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=37357ba28a6dd984043a60e16084bd79071d95e2 commit 37357ba28a6dd984043a60e16084bd79071d95e2 Author: Alan Somers AuthorDate: 2024-08-23 20:51:32 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:23:59 +0000 ctl: add tests for START STOP UNIT Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 (cherry picked from commit fe1755fa6bb4039c1e00f5226c473a024685005b) --- tests/sys/cam/ctl/Makefile | 5 +- tests/sys/cam/ctl/ctl.subr | 94 ++++++++++++++++++++++ tests/sys/cam/ctl/read_buffer.sh | 72 +++-------------- tests/sys/cam/ctl/start_stop_unit.sh | 150 +++++++++++++++++++++++++++++++++++ 4 files changed, 257 insertions(+), 64 deletions(-) diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile index 0e6f39a1a56f..1b857bb0c291 100644 --- a/tests/sys/cam/ctl/Makefile +++ b/tests/sys/cam/ctl/Makefile @@ -2,9 +2,12 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/cam/ctl +${PACKAGE}FILES+= ctl.subr + ATF_TESTS_SH+= read_buffer +ATF_TESTS_SH+= start_stop_unit # Must be exclusive because it disables/enables camsim -TEST_METADATA.read_buffer+= is_exclusive="true" +TEST_METADATA+= is_exclusive="true" .include diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr new file mode 100644 index 000000000000..18991e0fa144 --- /dev/null +++ b/tests/sys/cam/ctl/ctl.subr @@ -0,0 +1,94 @@ +# vim: filetype=sh + +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``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 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. + +load_modules() { + if ! kldstat -q -m ctl; then + kldload ctl || atf_skip "could not load ctl kernel mod" + fi + if ! ctladm port -o on -p 0; then + atf_skip "could not enable the camsim frontend" + fi +} + +find_device() { + LUN=$1 + + # Rescan camsim + # XXX camsim doesn't update when creating a new device. Worse, a + # rescan won't look for new devices. So we must disable/re-enable it. + # Worse still, enabling it isn't synchronous, so we need a retry loop + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 + retries=5 + ctladm port -o off -p 0 >/dev/null + ctladm port -o on -p 0 >/dev/null + HEXLUN=`printf %x $LUN` + while true; do + dev=`camcontrol devlist | awk -v lun=$HEXLUN '/FREEBSD CTL/ && $9==lun {split($10, fields, /[,]/); print fields[1];}' | sed 's:[()]::'` + if [ -z "$dev" -o ! -c /dev/$dev ]; then + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + cat lun-create.txt + camcontrol devlist + atf_fail "Could not find GEOM device" + fi + sleep 0.1 + continue + fi + break + done + # Ensure that it's actually ready. camcontrol may report the disk's + # ident before it's actually ready to receive commands. Maybe that's + # because all of the GEOM providers must probe it? + while true; do + dd if=/dev/$dev bs=4096 count=1 of=/dev/null >/dev/null 2>/dev/null && break + retries=$(( $retries - 1 )) + if [ $retries -eq 0 ]; then + atf_fail "Device never became ready" + fi + sleep 0.1 + done +} + +# Create a CTL LUN +create_ramdisk() { + EXTRA_ARGS=$* + + atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 $EXTRA_ARGS + atf_check egrep -q "LUN created successfully" lun-create.txt + LUN=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + if [ -z "$LUN" ]; then + atf_fail "Could not find LUN id" + fi + find_device $LUN +} + +cleanup() { + if [ -e "lun-create.txt" ]; then + lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + ctladm remove -b ramdisk -l $lun_id > /dev/null + fi +} diff --git a/tests/sys/cam/ctl/read_buffer.sh b/tests/sys/cam/ctl/read_buffer.sh index 4a84eb6b9725..e54b0dadc134 100644 --- a/tests/sys/cam/ctl/read_buffer.sh +++ b/tests/sys/cam/ctl/read_buffer.sh @@ -28,61 +28,7 @@ # * Buffer ID other than 0. We don't support those. # * The Mode Specific field. We don't support it. -load_modules() { - if ! kldstat -q -m ctl; then - kldload ctl || atf_skip "could not load ctl kernel mod" - fi - if ! ctladm port -o on -p 0; then - atf_skip "could not enable the camsim frontend" - fi -} - -find_da_device() { - SERIAL=$1 - - # Rescan camsim - # XXX camsim doesn't update when creating a new device. Worse, a - # rescan won't look for new devices. So we must disable/re-enable it. - # Worse still, enabling it isn't synchronous, so we need a retry loop - # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281000 - retries=5 - ctladm port -o off -p 0 >/dev/null - ctladm port -o on -p 0 >/dev/null - while true; do - - # Find the corresponding da device - da=`geom disk list | awk -v serial=$SERIAL ' /Geom name:/ { devname=$NF } /ident:/ && $NF ~ serial { print devname; exit } '` - if [ -z "$da" ]; then - retries=$(( $retries - 1 )) - if [ $retries -eq 0 ]; then - cat lun-create.txt - geom disk list - atf_fail "Could not find da device" - fi - sleep 0.1 - continue - fi - break - done -} - -# Create a CTL LUN -create_ramdisk() { - atf_check -o save:lun-create.txt ctladm create -b ramdisk -s 1048576 - atf_check egrep -q "LUN created successfully" lun-create.txt - SERIAL=`awk '/Serial Number:/ {print $NF}' lun-create.txt` - if [ -z "$SERIAL" ]; then - atf_fail "Could not find serial number" - fi - find_da_device $SERIAL -} - -cleanup() { - if [ -e "lun-create.txt" ]; then - lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` - ctladm remove -b ramdisk -l $lun_id > /dev/null - fi -} +. $(atf_get_srcdir)/ctl.subr atf_test_case basic cleanup basic_head() @@ -98,10 +44,10 @@ basic_body() # Write to its buffer cp /etc/passwd input len=`wc -c input | cut -wf 2` - atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$dev # Read it back - atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l $len --raw /dev/$dev # And verify if ! diff -q input output; then @@ -126,7 +72,7 @@ desc_body() { create_ramdisk - atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$da + atf_check -o inline:" 00 00 04 00 00\n" sg_read_buffer --hex --mode desc /dev/$dev } desc_cleanup() { @@ -147,10 +93,10 @@ length_body() # Write to its buffer atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 atf_check -o ignore -e ignore dd if=input bs=2048 count=1 of=expected - atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$dev # Read it back - atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l 2048 --raw /dev/$dev # And verify if ! diff -q expected output; then @@ -176,10 +122,10 @@ offset_body() # Write to its buffer atf_check -o ignore -e ignore dd if=/dev/random of=input bs=4096 count=1 atf_check -o ignore -e ignore dd if=input iseek=2 bs=512 count=1 of=expected - atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$da + atf_check -o ignore sg_write_buffer --mode data --in=input /dev/$dev # Read it back - atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l 512 -o 1024 --raw /dev/$dev # And verify if ! diff -q expected output; then @@ -203,7 +149,7 @@ uninitialized_body() create_ramdisk # Read an uninitialized buffer - atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$da + atf_check -o save:output sg_read_buffer --mode data -l 262144 --raw /dev/$dev # And verify atf_check -o ignore -e ignore dd if=/dev/zero bs=262144 count=1 of=expected diff --git a/tests/sys/cam/ctl/start_stop_unit.sh b/tests/sys/cam/ctl/start_stop_unit.sh new file mode 100644 index 000000000000..163011c8f574 --- /dev/null +++ b/tests/sys/cam/ctl/start_stop_unit.sh @@ -0,0 +1,150 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``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 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. + +. $(atf_get_srcdir)/ctl.subr + +# TODO: +# * format layer +# * IMM bit +# * LOEJ +# * noflush +# * power conditions + +# Not Tested +# * Power Condition Modifier (not implemented in CTL) + +atf_test_case eject cleanup +eject_head() +{ + atf_set "descr" "START STOP UNIT can eject a CDROM device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +eject_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + # Verify that the device is online + # Too bad I don't know of any other way to check that it's stopped but + # by using sg_readcap. + atf_check -o ignore -e not-match:"Device not ready" sg_readcap /dev/$dev + + # eject the device + atf_check sg_start --eject /dev/$dev + + # Ejected, it should now return ENXIO + atf_check -s exit:1 -o ignore -e match:"Device not configured" dd if=/dev/$dev bs=4096 count=1 of=/dev/null +} +eject_cleanup() +{ + cleanup +} + +atf_test_case load cleanup +load_head() +{ + atf_set "descr" "START STOP UNIT can load a CDROM device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +load_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + # eject the device + atf_check sg_start --eject /dev/$dev + + # Verify that it's offline it should now return ENXIO + atf_check -s exit:1 -o ignore -e match:"Device not configured" dd if=/dev/$dev bs=4096 count=1 of=/dev/null + + # Load it again + atf_check sg_start --load /dev/$dev + + atf_check -o ignore -e ignore dd if=/dev/$dev bs=4096 count=1 of=/dev/null + atf_check -o ignore -e not-match:"Device not ready" sg_readcap /dev/$dev +} +load_cleanup() +{ + cleanup +} + +atf_test_case start cleanup +start_head() +{ + atf_set "descr" "START STOP UNIT can start a device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +start_body() +{ + create_ramdisk + + # stop the device + atf_check sg_start --stop /dev/$dev + + # And start it again + atf_check sg_start /dev/$dev + + # Now sg_readcap should succeed. Too bad I don't know of any other way + # to check that it's stopped. + atf_check -o ignore -e not-match:"Device not ready" sg_readcap /dev/$dev +} +start_cleanup() +{ + cleanup +} + +atf_test_case stop cleanup +stop_head() +{ + atf_set "descr" "START STOP UNIT can stop a device" + atf_set "require.user" "root" + atf_set "require.progs" sg_start sg_readcap +} +stop_body() +{ + create_ramdisk + + # Stop the device + atf_check sg_start --stop /dev/$dev + + # Now sg_readcap should fail. Too bad I don't know of any other way to + # check that it's stopped. + atf_check -s exit:2 -e match:"Device not ready" sg_readcap /dev/$dev +} +stop_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case eject + atf_add_test_case load + atf_add_test_case start + atf_add_test_case stop +} From nobody Thu Sep 19 20:24:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n7V5HwTz5XLZB; Thu, 19 Sep 2024 20:24: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 4X8n7V1tN8z4csf; Thu, 19 Sep 2024 20:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lxDATMmRlQh60Yq1irFjz/gAV5iPba4I7O7MIxpOrGc=; b=fly3mJhdD8cD9Baaf8kbyjkolp/9e1zP+beh3f17c9eefVNReXOgvMe2sMmEWWVeHY7Emf RHphiVXR9zBXxWHNuoLrb6Ff6g0j26vDeUZmOyOJ07rsdxUvcw1TA+RMgFlUNa+3OWyqcE r29zkRwQbHrRfVdH6X/xoa5tceeY8zvIRfD6pQfERm3KsoW8FWrVXJIpaW30CFqFVcyG0E FQudLULZ0OpEA9dvgQqnjpvupjdAkpDwMC/UspXIKCJ3pgKYlqYC2LzLpdllJ6RqgLGUI8 5kUtrU2NcXIqQ3b20VRE/brMD/cB3nN4W7m3Z3vEc97WjSwuc98Afqlo2F13Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777494; a=rsa-sha256; cv=none; b=IgKReYIRDglt6G/6InYtuCfD8bpeLTseSHwVHtcjhAj1pJ6TPEcVzPRjH+pONiv3ls5DnT DVZ5qjGALd+mLMrxJnXn7Ye5JxMU4zqVxK4nMZrlgYJpTxOBc4E8+Iiymzb2WCu/a9F7D9 qyDFj3MCxSYV7PEtJ9Q7tiK1S70FjGdcieKnhvcZU2CQSE/ljHcPDPrLNs6Gd2HNe0fhoh VhPOLja6jA0grXnLVT8bQQKDHC1zcF91Vxy6wYstUIp4mwRLynwHvS8dOwfRWhQk9NHyUG zSTXxmdPTvis6WTB5FOjKVmPTDi1iosH4x495bLwjQOmvUwqdTLkoWrvHFwOeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lxDATMmRlQh60Yq1irFjz/gAV5iPba4I7O7MIxpOrGc=; b=VIH1v4B5w5HuqnU4HVcAGtvYhlBOrdI7aoCtHrLNJl+Pu1YE+V71jS8FP5mGMmX0NHE1EI bj+DVENUTlfF0Nt47rwwgVXOFAQDLNcfqJZbL9kjypD+8RUAimnQDiuNRMwprf48eq3+EX olZS/r7VtefsR2Z6uJZJ/EwYF2zxkzNvdcb40E47VmYguzcEUOVl7VFxCufIfCVxvgDZWa 0rY2Pf91Dp2+SeTjiE1lM5yXDmHGbunr1hU5fGkUHGEGx+jFCeay9BLJooi+N0rlbAQJX9 mRF8T22LuQiEUzQ4Wpj7BAMr6TIAk8UEPptxt26YjbBJtW28LuVltLePJJoDgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n7V1NLNzKtL; Thu, 19 Sep 2024 20:24: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 48JKOsaU052953; Thu, 19 Sep 2024 20:24:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKOsbN052950; Thu, 19 Sep 2024 20:24:54 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:24:54 GMT Message-Id: <202409192024.48JKOsbN052950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e2217f809732 - stable/14 - ctl: add tests for PREVENT ALLOW MEDIUM REMOVAL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e2217f809732666a1124147b8cab1aef334acaa5 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e2217f809732666a1124147b8cab1aef334acaa5 commit e2217f809732666a1124147b8cab1aef334acaa5 Author: Alan Somers AuthorDate: 2024-08-26 20:01:44 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:24:02 +0000 ctl: add tests for PREVENT ALLOW MEDIUM REMOVAL Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 (cherry picked from commit e234a72bb8c0e8e25ea8a879582e85bb2e09f096) --- tests/sys/cam/ctl/Makefile | 1 + tests/sys/cam/ctl/prevent.sh | 161 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile index 1b857bb0c291..1333397af464 100644 --- a/tests/sys/cam/ctl/Makefile +++ b/tests/sys/cam/ctl/Makefile @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/cam/ctl ${PACKAGE}FILES+= ctl.subr +ATF_TESTS_SH+= prevent ATF_TESTS_SH+= read_buffer ATF_TESTS_SH+= start_stop_unit diff --git a/tests/sys/cam/ctl/prevent.sh b/tests/sys/cam/ctl/prevent.sh new file mode 100644 index 000000000000..a5a187dad8ff --- /dev/null +++ b/tests/sys/cam/ctl/prevent.sh @@ -0,0 +1,161 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``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 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. + +. $(atf_get_srcdir)/ctl.subr + +# TODO +# * multiple initiators may block removal + +# Not Tested +# * persistent removal (not implemented in CTL) + +atf_test_case allow cleanup +allow_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL will prevent a CD from being ejected" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +allow_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --prevent 1 /dev/$dev + + # Now sg_start --eject should fail + atf_check -s exit:5 -e match:"Illegal request" sg_start --eject /dev/$dev + + atf_check sg_prevent --allow /dev/$dev + + # Now sg_start --eject should work again + atf_check -s exit:0 sg_start --eject /dev/$dev +} +allow_cleanup() +{ + cleanup +} + +atf_test_case allow_idempotent cleanup +allow_idempotent_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL is idempotent when run from the same initiator" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +allow_idempotent_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --allow /dev/$dev + atf_check sg_prevent --allow /dev/$dev + atf_check sg_prevent --prevent 1 /dev/$dev + + # Even though we ran --allow twice, a single --prevent command should + # suffice to prevent ejecting. Multiple ALLOW/PREVENT commands from + # the same initiator don't have any additional effect. + atf_check -s exit:5 -e match:"Illegal request" sg_start --eject /dev/$dev +} +allow_idempotent_cleanup() +{ + cleanup +} + +atf_test_case nonremovable cleanup +nonremovable_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL may not be used on non-removable media" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent +} +nonremovable_body() +{ + # Create a HDD, not a CD, device + create_ramdisk -t 0 + + atf_check -s exit:9 -e match:"Invalid opcode" sg_prevent /dev/$dev +} +nonremovable_cleanup() +{ + cleanup +} + +atf_test_case prevent cleanup +prevent_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL will prevent a CD from being ejected" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +prevent_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --prevent 1 /dev/$dev + + # Now sg_start --eject should fail + atf_check -s exit:5 -e match:"Illegal request" sg_start --eject /dev/$dev +} +prevent_cleanup() +{ + cleanup +} + +atf_test_case prevent_idempotent cleanup +prevent_idempotent_head() +{ + atf_set "descr" "SCSI PREVENT ALLOW MEDIUM REMOVAL is idempotent when run from the same initiator" + atf_set "require.user" "root" + atf_set "require.progs" sg_prevent sg_start +} +prevent_idempotent_body() +{ + # -t 5 for CD/DVD device type + create_ramdisk -t 5 + + atf_check sg_prevent --prevent 1 /dev/$dev + atf_check sg_prevent --prevent 1 /dev/$dev + atf_check sg_prevent --allow /dev/$dev + + # Even though we ran prevent idempotent and allow only once, eject + # should be allowed. Multiple PREVENT commands from the same initiator + # don't have any additional effect. + atf_check sg_start --eject /dev/$dev +} +prevent_idempotent_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case allow + atf_add_test_case allow_idempotent + atf_add_test_case nonremovable + atf_add_test_case prevent + atf_add_test_case prevent_idempotent +} From nobody Thu Sep 19 20:24:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n7W3Rnmz5XLZF; Thu, 19 Sep 2024 20:24: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 4X8n7W2V1jz4csr; Thu, 19 Sep 2024 20:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IWqZeopkFMJRbRxfJ3NuT89FAXHuhvIZrQpGajOc3M=; b=nsIGKc/oKGtGjfXmMd8M6D9O2QQXbc3mHMje2FIioHru1I+XntazcXLPvi2Gev48dTDmEQ t18r2CxbfWGdqhmHiEX/rNFs5LC2YRMzCrJ5PXLjyjO/HXSLP1TV3l7E7wlm9m9YSneTfz QQ9eSb5EA4PG866hECaVwEpQCQPjUGToT42dF5l1HZbKLBhgkhQmu5YSqhR8k5Xo5q4DnM 6Id7aRFPn04QMiLxfeIbycctBbYsSwzZVNu/cRp3jiYvAcYrQhW4U1DDwvJTIvWxXiVt29 iEfsD/2KcYdi8fUP6DX8DqdzfsxlI+v4mg5/PifEGWnZqugxa1I+wbq8MJyHxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777495; a=rsa-sha256; cv=none; b=MsbU5c4kvhasKJ0BMKiAUdw92xBJTnG2thm8UMFbxGgghQqyrZ1FpgV/rXcAFe3Z1ibuVI ETbU3iMavwLQVYhvuSwK9emmra808sJ7rEjaTFxY3KuVk0hLXlfO/zMZb+HEzd21R4QKBf zANbviTuY1f3JkYFAyECGrBKb6D6tPrE67oa4bvTAtrdBzjgwQoby6P8fodskVhDXYyZWH z3oztMUjc9dfF+B+38ocy0s4Thdsr+C2m/D13Ct1WCfp9lnVcLoxBb4I9cDsP9dlMcleCE 77GjyvkF35IV/NsLh7TlfQGQ0Cz0NPQQqW9IazF0f4M7YKJ8dbPwnmQ2CeAKZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IWqZeopkFMJRbRxfJ3NuT89FAXHuhvIZrQpGajOc3M=; b=qZOWqJMv9pihNECDtjXKQU5Ip1jr67HHoQryPe0vCNnVuBRkwPPCzJ0OgePQ8zwNR4c6rq kdG8XeYLcW4jjHzga975QYcqraixEoaJUhdIKtF8OmlCU13MIswVphqgALA6ZMloLBXVNK xZZrwBNksxRnWsgsA+VRMs8wNtvPdScK/tv7BsE/IUEWzkyJc7UyNO26ozyMHLjjYaZ/2S m7ejo/F/e9yt+LS7je/zHKNQfLBOOo8q7uGnL76S5NfZ+BlcUcopnNH3hwpjz9rhoJHPuL d2ah5hTkgeze+rY6BmmYk1wi6ugi7wPSUyd8yyW5m0y66NCIjLBsLWDUkBAYWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n7W25lkzL8S; Thu, 19 Sep 2024 20:24: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 48JKOt9S053010; Thu, 19 Sep 2024 20:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKOtKa053007; Thu, 19 Sep 2024 20:24:55 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:24:55 GMT Message-Id: <202409192024.48JKOtKa053007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: c6d11ae455a9 - stable/14 - ctl: fix uninitialized data used by PREVENT ALLOW MEDIUM REMOVAL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6d11ae455a9c5b6e927ac0a5d63570081074208 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=c6d11ae455a9c5b6e927ac0a5d63570081074208 commit c6d11ae455a9c5b6e927ac0a5d63570081074208 Author: Alan Somers AuthorDate: 2024-08-26 20:44:24 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:24:04 +0000 ctl: fix uninitialized data used by PREVENT ALLOW MEDIUM REMOVAL Zero-initialize the bitmap of preventers. Otherwise, the START STOP UNIT command may not have the intended effect. Sponsored by: Axcient Reviewed by: emaste, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1409 (cherry picked from commit 0f2b2276abc305905e7d88619a7abca26b0dd7eb) --- sys/cam/ctl/ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 0e0d79d15d8f..9a99823a5c1c 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -4771,7 +4771,7 @@ fail: ctl_tpc_lun_init(lun); if (lun->flags & CTL_LUN_REMOVABLE) { lun->prevent = malloc((CTL_MAX_INITIATORS + 31) / 32 * 4, - M_CTL, M_WAITOK); + M_CTL, M_WAITOK | M_ZERO); } /* From nobody Thu Sep 19 20:25:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8n8W1S2hz5XLkK; Thu, 19 Sep 2024 20:25: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 4X8n8W0DBmz4f6P; Thu, 19 Sep 2024 20:25:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGht8E1QUoZcVZCLM9eW5pchdC9+XgDF41uLXw74Eo0=; b=SSQPt0z5Qq/+zFOikw0I7f3/AUZBVKNDpaVVgmvKdhignzF0fl3vPjzLOot+AzkmHM7E3q BMojlQMWXa80olfx9+Zuy0whVVOwzQPvZaiLsK/nB3nfiDvJDa8t171gddToYG8skqjL5U Jutqn9R0Dnw0ltHK4opXCVYSD7V+z541ZMGF6Pb5AmcY2caSAyHH/nK8SqDbf5K6bjMqfE fXCt7tGN7RJAttvT9bFvd2KGNYbPlQtvyO/loFUuQ2KIxbttlRR452UU4zMvhNXES6WWsX /qclE3TNKMIP8h+6al42vGeGVw7zeazMgHzTZtlhowRmD/wNPvz61F5+EzZhxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777547; a=rsa-sha256; cv=none; b=LX3PUJ6HKRBj1w1MDc2aOa41COKFLeivizpwaQjuD4LnPM6k94DhOBm7MLgX5hhlTfQqMV fJ0aGDJOyVcF2vW0OQ57O3hkT0+6mfoCU4dgUUWeGpp5cbF0gzZMHoj9tQ7hG+N7zvYKpi 5JVsSR2RinTeZ+s1L+Z9rfiwD9/XU8xPjZFlakBmQVMn1ZwdTZhf1tKDfcimVnRfGDZC82 qbxZzFiY9zQdcwIDAGnmuwfJ02GQ3tHCX1NdOO5dUO2sUnsgjfhb1qfPihdv7elvu+Cz6d XEwLmtMPFpQaEQGK7GCo8itb7FtdI72JxhNa5Ifbcfou4Jq+1aMK0AAkwiVGdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGht8E1QUoZcVZCLM9eW5pchdC9+XgDF41uLXw74Eo0=; b=tsUMHCtKkig4X2KQH0qVMIys3p2RIt7Dggxv79smUYeSphP3HVLQ56gg4LTTdBJdB+cYwE w9QdbLiyMk9KP6dNRbixondwGTQbFzMnt5riyYbYk7Kz8zRdc47GhvhkRvuX55TWwSzJ1Y 606KwN0P36FbFBJ5/XYUGA4zQqPZBD1yJjCYpjvfqbfCujoPYXfk6gVxUmzsP+QpmzNWv6 4PW9VnwRs8y8E4U8eiER45b9vu4k2znMehPtKa3NrmOA+84coTvRA0Hlk4uCzqlHHa1ZV0 cu3qdryvkRwnR3mDZc7qxTg6/zdv+Mun5hVPu8l3xbOO9bQVN5pvP0zHoVp+DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8n8V6x9LzKxq; Thu, 19 Sep 2024 20:25: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 48JKPkIB053296; Thu, 19 Sep 2024 20:25:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKPk38053293; Thu, 19 Sep 2024 20:25:46 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:25:46 GMT Message-Id: <202409192025.48JKPk38053293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 001d66bb189d - stable/14 - targ: fix compiling the example List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 001d66bb189d17dbe1cb31ba971e04b72c4fa602 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=001d66bb189d17dbe1cb31ba971e04b72c4fa602 commit 001d66bb189d17dbe1cb31ba971e04b72c4fa602 Author: Alan Somers AuthorDate: 2024-06-19 00:17:31 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:25:09 +0000 targ: fix compiling the example The targ example program doesn't compile with current clang, and probably hasn't for multiple releases. Fix the build. I don't have the right hardware to test it, though. Sponsored by: Axcient (cherry picked from commit 873881b7dbb72077f3723f49a9f10a432231c532) --- share/examples/scsi_target/Makefile | 6 +++++- share/examples/scsi_target/scsi_cmds.c | 6 +----- share/examples/scsi_target/scsi_target.c | 32 ++++++++++++++++++-------------- share/examples/scsi_target/scsi_target.h | 6 +++++- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/share/examples/scsi_target/Makefile b/share/examples/scsi_target/Makefile index 39950b8c0ac1..1e2c076591bf 100644 --- a/share/examples/scsi_target/Makefile +++ b/share/examples/scsi_target/Makefile @@ -4,7 +4,11 @@ FILESDIR=${SHAREDIR}/examples/${PROG} PROG= scsi_target SRCS= scsi_target.h scsi_target.c scsi_cmds.c DPADD= ${LIBCAM} ${LIBSBUF} -LDADD= -lcam -lsbuf +LIBADD+= cam +LIBADD+= sbuf +# cast-qual is triggered only in a code path where the volatile keyword doesn't +# matter +CFLAGS.scsi_cmds.c= -Wno-cast-qual MAN= scsi_target.8 diff --git a/share/examples/scsi_target/scsi_cmds.c b/share/examples/scsi_target/scsi_cmds.c index 43217a562aba..122d4dec6287 100644 --- a/share/examples/scsi_target/scsi_cmds.c +++ b/share/examples/scsi_target/scsi_cmds.c @@ -102,10 +102,6 @@ static struct targ_cdb_handlers cdb_handlers[] = { static struct scsi_inquiry_data inq_data; static struct initiator_state istates[MAX_INITIATORS]; -extern int debug; -extern off_t volume_size; -extern u_int sector_size; -extern size_t buf_size; cam_status tcmd_init(u_int16_t req_inq_flags, u_int16_t sim_inq_flags) @@ -553,7 +549,7 @@ tcmd_rdwr_decode(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio) tcmd_illegal_req(atio, ctio); return (0); } - if (blkno + count > volume_size) { + if (((off_t)(blkno + count)) > volume_size) { warnx("Attempt to access past end of volume"); tcmd_sense(ctio->init_id, ctio, SSD_KEY_ILLEGAL_REQUEST, 0x21, 0); diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c index b8f3ed6a8a81..ee0a94e7a2a0 100644 --- a/share/examples/scsi_target/scsi_target.c +++ b/share/examples/scsi_target/scsi_target.c @@ -77,7 +77,9 @@ static struct ccb_queue work_queue; static struct ioc_enable_lun ioc_enlun = { CAM_BUS_WILDCARD, CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD + CAM_LUN_WILDCARD, + 0, + 0 }; /* Local functions */ @@ -208,7 +210,7 @@ main(int argc, char *argv[]) if (argc != 2) usage(); - sscanf(argv[0], "%u:%u:%u", &ioc_enlun.path_id, &ioc_enlun.target_id, + sscanf(argv[0], "%u:%u:%ju", &ioc_enlun.path_id, &ioc_enlun.target_id, &ioc_enlun.lun_id); file_name = argv[1]; @@ -258,10 +260,12 @@ main(int argc, char *argv[]) if (notaio == 0) { struct aiocb aio, *aiop; + void *aio_buf; /* See if we have we have working AIO support */ memset(&aio, 0, sizeof(aio)); - aio.aio_buf = malloc(sector_size); + aio_buf = malloc(sector_size); + aio.aio_buf = aio_buf; if (aio.aio_buf == NULL) err(1, "malloc"); aio.aio_fildes = file_fd; @@ -278,7 +282,7 @@ main(int argc, char *argv[]) assert(aiop == &aio); signal(SIGSYS, SIG_DFL); } - free((void *)aio.aio_buf); + free(aio_buf); if (debug && notaio == 0) warnx("aio support tested ok"); } @@ -331,7 +335,7 @@ main(int argc, char *argv[]) } static void -cleanup() +cleanup(void) { struct ccb_hdr *ccb_h; @@ -358,7 +362,7 @@ cleanup() /* Allocate ATIOs/INOTs and queue on HBA */ static int -init_ccbs() +init_ccbs(void) { int i; @@ -395,7 +399,7 @@ init_ccbs() } static void -request_loop() +request_loop(void) { struct kevent events[MAX_EVENTS]; struct timespec ts, *tptr; @@ -535,10 +539,10 @@ request_loop() /* CCBs are ready from the kernel */ static void -handle_read() +handle_read(void) { union ccb *ccb_array[MAX_INITIATORS], *ccb; - int ccb_count, i, oo; + int ccb_count, i; ccb_count = read(targ_fd, ccb_array, sizeof(ccb_array)); if (ccb_count <= 0) { @@ -590,7 +594,7 @@ handle_read() /* Queue on the appropriate ATIO */ queue_io(ctio); /* Process any queued completions. */ - oo += run_queue(c_descr->atio); + run_queue(c_descr->atio); break; } case XPT_IMMEDIATE_NOTIFY: @@ -840,7 +844,7 @@ send_ccb(union ccb *ccb, int priority) /* Return a CTIO/descr/buf combo from the freelist or malloc one */ static struct ccb_scsiio * -get_ctio() +get_ctio(void) { struct ccb_scsiio *ctio; struct ctio_descr *c_descr; @@ -938,7 +942,7 @@ get_sim_flags(u_int16_t *flags) } static void -rel_simq() +rel_simq(void) { struct ccb_relsim crs; @@ -953,7 +957,7 @@ rel_simq() /* Cancel all pending CCBs. */ static void -abort_all_pending() +abort_all_pending(void) { struct ccb_abort cab; struct ccb_hdr *ccb_h; @@ -976,7 +980,7 @@ abort_all_pending() } static void -usage() +usage(void) { fprintf(stderr, "Usage: scsi_target [-AdSTY] [-b bufsize] [-c sectorsize]\n" diff --git a/share/examples/scsi_target/scsi_target.h b/share/examples/scsi_target/scsi_target.h index a873c050b7c6..57b6696d2e77 100644 --- a/share/examples/scsi_target/scsi_target.h +++ b/share/examples/scsi_target/scsi_target.h @@ -115,7 +115,11 @@ extern void free_ccb(union ccb *ccb); static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); } /* Global Data */ -extern int notaio; +extern int notaio; +extern int debug; +extern off_t volume_size; +extern u_int sector_size; +extern size_t buf_size; /* * Compat Defines From nobody Thu Sep 19 20:30:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8nGH5MVFz5XMDX; Thu, 19 Sep 2024 20:30: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 4X8nGH2GcWz4fwP; Thu, 19 Sep 2024 20:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726777847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IOYDB1tBeqVU3LQJ3dQ8jHQoGsspPGGs9PZGOa0X4KU=; b=SpU236FY0BUDL1iAS/YBHiCbvopJRvyXh8O3mn+iAaRHYfrBf5O8/OqNELp65jv95ILtA9 5WmEI2odIIltjRIJu5mzoJ+ictMZ8pY1ZYh3+MDN/yVdev4cPwpiKt/3z2o+62YVSiUOL4 CL9JxnMkiw1tv8xc2gyu5cpIPpvQALFYOyb1ktSNzZzVRjBk03NYG3WCbBeo/KFfJ4+TV4 iWEyn+JDU+3gUHqRoL474qehC/SBgTfhF4NjCvV4HUv6stlXmWgu1UFqx522tb0fhtWJdF AMgUET25h6VciCc2XTqi5ncYE61GBD3kOPbyJDt8lFO5mFWsOFu6rHsvB9vgQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726777847; a=rsa-sha256; cv=none; b=py8g12uauGDbINB/OCXdCk0N8I/qEGbU1j6Y9RnNmccLYyuwXOWM4uz5wCvB7umLL8afsk fqKSv7MeyRkx2uqNe1VTrqCNUbRaxwOxn1lcs6WrxqAGRk3CDNVilhOOHR/YH7+m/EF10Q yZsiJ1g2HEd7YUot+KFKrpCK+qJAVm9j4RvTWGoeAErF8TAZ5yQ50XJV1J+1/YuXWTgr6x 4oKKN7Uu5B0Xk2w1hrYm0I8SSEB82Km0Du8Aw+SSd/D6VflUxSsPoFN5E/StbfFjhVfI9G gCO2hsRre/LsMaINoE+cmvlSsw73DZvn/9I+t7jyrIAa1mvAHc1rZUK+F+HR/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=1726777847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IOYDB1tBeqVU3LQJ3dQ8jHQoGsspPGGs9PZGOa0X4KU=; b=m8WLMTWbNZQxO4Fbk7QhGQQ2cNO79Lys0HtA5hPuSKoiZgnKBSOTs1YFg9HpCsOaJRiyZB uA+/H/+75/6N/qnU4d7NAC8HsRRhhRA+WfXzz4vbyRLhNjHEDIC59/bTNUusWanCM+mxYU V8QCYmSazj9DIyFZYdiqGHNTuZXta+SVfhDRFossYY9VOnQAey5l9V/+ueIeac6zSBaSLM naImrvCwrgQrwuzTrARxc+5NzCVgwUhobTkaT905UbJ+j0tTk0hPjupgjRcwbA1DwnUAr7 rsR7rDrMypkKxWetQpuMqhnflSbGH4KhiKFkH9PbJxycFCOvV3Y6xp+LB/iyFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8nGH1BYwzKvm; Thu, 19 Sep 2024 20:30: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 48JKUk5W063729; Thu, 19 Sep 2024 20:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKUksC063726; Thu, 19 Sep 2024 20:30:46 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:30:46 GMT Message-Id: <202409192030.48JKUksC063726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 28fdb212adc0 - main - ixgbe: increase VF reset timeout List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28fdb212adc0431fff683749a1307038e25ff58e Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=28fdb212adc0431fff683749a1307038e25ff58e commit 28fdb212adc0431fff683749a1307038e25ff58e Author: Kevin Traynor AuthorDate: 2024-09-19 20:29:34 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 20:29:34 +0000 ixgbe: increase VF reset timeout DPDK commit meesage When VF issues a reset to PF there is a 50 msec wait plus an additional max of 1 msec (200 * 5us) for the PF to indicate the reset is complete before timeout. In some cases, it is seen that the reset is timing out, in which case the reset does not complete and an error is returned. In order to account for this, continue to wait an initial 50 msecs, but then allow a max of an additional 50 msecs (10,000 * 5us) for the command to complete. Fixes: af75078 ("first public release") Cc: stable@dpdk.org Signed-off-by: Kevin Traynor Acked-by: Vladimir Medvedkin Obtained from: DPDK (64e714f) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index b8aeaf51f86c..deb68fa03312 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1832,7 +1832,7 @@ enum { /* VFRE bitmask */ #define IXGBE_VFRE_ENABLE_ALL 0xFFFFFFFF -#define IXGBE_VF_INIT_TIMEOUT 200 /* Number of retries to clear RSTI */ +#define IXGBE_VF_INIT_TIMEOUT 10000 /* Number of retries to clear RSTI */ /* RDHMPN and TDHMPN bitmasks */ #define IXGBE_RDHMPN_RDICADDR 0x007FF800 From nobody Thu Sep 19 20:33:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8nKv0p6yz5XMY1; Thu, 19 Sep 2024 20:33: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 4X8nKv0K3Kz4hF3; Thu, 19 Sep 2024 20:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726778035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f9LIsDxx1mnzji/1Cxq7rcSVw2E0AKtgqsMtaT/fbUA=; b=EJ3FANfkNQocmlkK2hZGgmW4JtBaunalSP6s3xg36jkDJ2M8TQPLdkvTWOEeb5uDGhi2Ta fLwxdxPm6soQyvrpr8OKcaRKqw85L4iqQxN7KRr6vT4PI2hlNcpgg5vyQNIrO/Fd0UwZAD WY+0PKIUShJWVfLkST4wpjfEnDpq0ONlAFI4646D2E0Fbd4rc5Ljpzj2FJ3noiutP1fl3K VxMUKXJ1iWyRLABNAOmfGPhOxsHd3Hc4SS0ilzmyZxdoLTnqNFUC0c3oJNtt/gpyuiUDbp d/ZAQre9mS/vwxBd5YEq2tLNXl2l7ji+sDZBOk/oErSphFLTDRUzd1fHNHtAoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726778035; a=rsa-sha256; cv=none; b=VrhlFGsqRIkVUSfhbSfCd0Np8u591FdAHnVyMcFCMcs8NxbUO+vn1eflJO46dZhuObUWLE iqEUvAQGiSW7k9ZQFSEzwszMSGkML2JsNrOV7HvFNN8svxj3JsjbWBQD9KY40rc65jSpJa 5+jnvOck/1AKhTPkJSjGfzNzQo/dup8pyq7jUDmXVxk5ycYOP3I7N74M1Ul+oDGSFPhlMR tuJBh/Yzv3pNgas//ezePdRQD0DYhFqI3KO5rSbIhNhmKe1VIPSjYft1pfcpMZ9idzXUlR 6Mx+NgVJqTdd8cxld+k3e5SYs1eOeV0RVpVjxDYbVzRP6WdkSX1CA2tHTj0J8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726778035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f9LIsDxx1mnzji/1Cxq7rcSVw2E0AKtgqsMtaT/fbUA=; b=i2QRmaUyfgHremn0P9CzKGQ+qGsSdALwn0N3ZyXonRkyw+UVsOr+AnoxVeZLrwW+UJNQy2 COLYLmlHqSRvoJMqaIHpPJVVKbw6SASeaPNskMdIVX0L/t0kY9++4cblK31ILQNO54u8oU NGqqBfRXYA8Yfw6vd6P/p0pATMsKtO/GMaDpI5aA84ohyD9N2588eLZUd2Ihbr2FL58QIz ROn8DzA2pq+wUbR6FmkNlFEMsOUczndxW8OnO+6ydXlg2vk7FZYB7C8lLmKxKUQNnDizcF Opuy5039HqN/CpDzHQdmHFd/I3r3sApFtEqDR8udFfIuFgUmW9R28SqNKBSc3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8nKt7291zLCB; Thu, 19 Sep 2024 20:33: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 48JKXsuG070059; Thu, 19 Sep 2024 20:33:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKXsLD070056; Thu, 19 Sep 2024 20:33:54 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:33:54 GMT Message-Id: <202409192033.48JKXsLD070056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 4bb8e26c262c - stable/14 - fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4bb8e26c262c03757dd1db8d7964bc44ccc83d6a Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4bb8e26c262c03757dd1db8d7964bc44ccc83d6a commit 4bb8e26c262c03757dd1db8d7964bc44ccc83d6a Author: Alan Somers AuthorDate: 2024-04-03 19:57:44 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:27:41 +0000 fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE Background: If a user does pathconf(_, _PC_MIN_HOLE_SIZE) on a fusefs file system, the kernel must actually issue a FUSE_LSEEK operation in order to determine whether the server supports it. We cache that result, so we only have to send FUSE_LSEEK the first time that _PC_MIN_HOLE_SIZE is requested on any given mountpoint. Problem 1: Unlike fpathconf, pathconf operates on files that may not be open. But FUSE_LSEEK requires the file to be open. As described in PR 278135, FUSE_LSEEK cannot be sent for unopened files, causing _PC_MIN_HOLE_size to wrongly report EINVAL. We never noticed that before because the fusefs test suite only uses fpathconf, not pathconf. Fix this bug by opening the file if necessary. Problem 2: On a completely sparse file, with no data blocks at all, FUSE_LSEEK with SEEK_DATA would fail to ENXIO. That's correct behavior, but fuse_vnop_pathconf wrongly interpreted that as "FUSE_LSEEK not supported". Fix the interpretation. PR: 278135 Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D44618 (cherry picked from commit 6efba04df3f8c77b9b12f1df3e5124a7249b82fc) --- sys/fs/fuse/fuse_vnops.c | 48 ++++++++++++---- tests/sys/fs/fusefs/lseek.cc | 129 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+), 10 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index b5e177dac376..8eb37423618c 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -396,6 +396,9 @@ fuse_vnop_do_lseek(struct vnode *vp, struct thread *td, struct ucred *cred, err = fdisp_wait_answ(&fdi); if (err == ENOSYS) { fsess_set_notimpl(mp, FUSE_LSEEK); + } else if (err == ENXIO) { + /* Note: ENXIO means "no more hole/data regions until EOF" */ + fsess_set_impl(mp, FUSE_LSEEK); } else if (err == 0) { fsess_set_impl(mp, FUSE_LSEEK); flso = fdi.answ; @@ -1755,6 +1758,9 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) { struct vnode *vp = ap->a_vp; struct mount *mp; + struct fuse_filehandle *fufh; + int err; + bool closefufh = false; switch (ap->a_name) { case _PC_FILESIZEBITS: @@ -1784,22 +1790,44 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) !fsess_not_impl(mp, FUSE_LSEEK)) { off_t offset = 0; - /* Issue a FUSE_LSEEK to find out if it's implemented */ - fuse_vnop_do_lseek(vp, curthread, curthread->td_ucred, - curthread->td_proc->p_pid, &offset, SEEK_DATA); + /* + * Issue a FUSE_LSEEK to find out if it's supported. + * Use SEEK_DATA instead of SEEK_HOLE, because the + * latter generally requires sequential scans of file + * metadata, which can be slow. + */ + err = fuse_vnop_do_lseek(vp, curthread, + curthread->td_ucred, curthread->td_proc->p_pid, + &offset, SEEK_DATA); + if (err == EBADF) { + /* + * pathconf() doesn't necessarily open the + * file. So we may need to do it here. + */ + err = fuse_filehandle_open(vp, FREAD, &fufh, + curthread, curthread->td_ucred); + if (err == 0) { + closefufh = true; + err = fuse_vnop_do_lseek(vp, curthread, + curthread->td_ucred, + curthread->td_proc->p_pid, &offset, + SEEK_DATA); + } + if (closefufh) + fuse_filehandle_close(vp, fufh, + curthread, curthread->td_ucred); + } + } if (fsess_is_impl(mp, FUSE_LSEEK)) { *ap->a_retval = 1; return (0); - } else { - /* - * Probably FUSE_LSEEK is not implemented. It might - * be, if the FUSE_LSEEK above returned an error like - * EACCES, but in that case we can't tell, so it's - * safest to report EINVAL anyway. - */ + } else if (fsess_not_impl(mp, FUSE_LSEEK)) { + /* FUSE_LSEEK is not implemented */ return (EINVAL); + } else { + return (err); } default: return (vop_stdpathconf(ap)); diff --git a/tests/sys/fs/fusefs/lseek.cc b/tests/sys/fs/fusefs/lseek.cc index 5ffeb4b33cbd..2a1cb198bcce 100644 --- a/tests/sys/fs/fusefs/lseek.cc +++ b/tests/sys/fs/fusefs/lseek.cc @@ -112,6 +112,75 @@ TEST_F(LseekPathconf, already_seeked) leak(fd); } +/* + * Use pathconf on a file not already opened. The server returns EACCES when + * the kernel tries to open it. The kernel should return EACCES, and make no + * judgement about whether the server does or does not support FUSE_LSEEK. + */ +TEST_F(LseekPathconf, eacces) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 1 << 30; /* 1 GiB */ + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.entry_valid = UINT64_MAX; + out.body.entry.attr.mode = S_IFREG | 0644; + out.body.entry.nodeid = ino; + out.body.entry.attr.size = fsize; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_OPEN && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(2) + .WillRepeatedly(Invoke(ReturnErrno(EACCES))); + + EXPECT_EQ(-1, pathconf(FULLPATH, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EACCES, errno); + /* Check again, to ensure that the kernel didn't record the response */ + EXPECT_EQ(-1, pathconf(FULLPATH, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EACCES, errno); +} + +/* + * If the server returns some weird error when we try FUSE_LSEEK, send that to + * the caller but don't record the answer. + */ +TEST_F(LseekPathconf, eio) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 1 << 30; /* 1 GiB */ + int fd; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK); + }, Eq(true)), + _) + ).Times(2) + .WillRepeatedly(Invoke(ReturnErrno(EIO))); + + fd = open(FULLPATH, O_RDONLY); + + EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EIO, errno); + /* Check again, to ensure that the kernel didn't record the response */ + EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EIO, errno); + + leak(fd); +} + /* * If no FUSE_LSEEK operation has been attempted since mount, try once as soon * as a pathconf request comes in. @@ -141,6 +210,34 @@ TEST_F(LseekPathconf, enosys_now) leak(fd); } +/* + * Use pathconf, rather than fpathconf, on a file not already opened. + * Regression test for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278135 + */ +TEST_F(LseekPathconf, pathconf) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 1 << 30; /* 1 GiB */ + off_t offset_out = 1 << 29; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, lseek); + out.body.lseek.offset = offset_out; + }))); + expect_release(ino, FuseTest::FH); + + EXPECT_EQ(1, pathconf(FULLPATH, _PC_MIN_HOLE_SIZE)) << strerror(errno); +} + /* * If no FUSE_LSEEK operation has been attempted since mount, try one as soon * as a pathconf request comes in. This is the typical pattern of bsdtar. It @@ -177,6 +274,38 @@ TEST_F(LseekPathconf, seek_now) leak(fd); } +/* + * If the user calls pathconf(_, _PC_MIN_HOLE_SIZE) on a fully sparse or + * zero-length file, then SEEK_DATA will return ENXIO. That should be + * interpreted as success. + */ +TEST_F(LseekPathconf, zerolength) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 0; + int fd; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK && + in.header.nodeid == ino && + in.body.lseek.whence == SEEK_DATA); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnErrno(ENXIO))); + + fd = open(FULLPATH, O_RDONLY); + EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + /* Check again, to ensure that the kernel recorded the response */ + EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + + leak(fd); +} + /* * For servers using older protocol versions, no FUSE_LSEEK should be attempted */ From nobody Thu Sep 19 20:34:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8nLf42qVz5XMjv; Thu, 19 Sep 2024 20:34: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 4X8nLf1nKhz4hTj; Thu, 19 Sep 2024 20:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726778074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vFAd4KKlihW3LXUID9lp7IV5lGXwyY81XqeTS0/3KKM=; b=SgpyWsSpFdCJa9EGB6E7KFLu693tRMKzEfsy1OUMYCxFfM7GVSEHajlQ34PNWzBQFTbeWJ vdyX7fRkqROlDETBPr188FUXF4JFA/DnivpMdHiwSaZ+2kyNZXMA84I2uN4cmfw5OpQYHZ NUrSy2OE6vfBDSzWfLLrw8GdjvRaNslocMutTVOephKxeno0Q8RCvs1fWajqqu8aGSDIvx laWiHSMKOgwJbXK2QIBwaMMNk81JozqyOUpkcJxnUFwK+pyk7lAl4QTreRdtV06As3SDyO feJH76/OBw12wCaD0D4g2DS8r97YAX7BWk+8CIHo/OWVO9K10QgWIpImFihE0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726778074; a=rsa-sha256; cv=none; b=GEcJ1xdRP0QdqiYZ9V99TF7Z//aN9Ja2vVM7+ir3aKg/Eu9OJgr3vLxINbfCDMAJ0RD3Wh ePEOUWVEGakhUYWMTpX7WJ4sNp4scChIu/HwPF3YIHReI5qWKAswIWeqbtm/JvBop4CaoE y3pU4efBw5B+7whi/Kuo9WhVODEpzZZA+eykKdyuNtuAT8998NlMd9RK0bMdev7D5PpWpn lcXy5PdMB9ZG4I9Pqa7H04penvX/RZEYTe4NOqZ6L/nR7wMJFO2IrbRGP66VMbzaebF6JG lqjKdew7wrJLrVBOWv+Q+baevV/5uI+6vBtpM5j/JnTbOzpVRphQZQzMLz0LUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726778074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vFAd4KKlihW3LXUID9lp7IV5lGXwyY81XqeTS0/3KKM=; b=f6+fFgS6w6VG7Vwo5ZVJp8U8DzyPCyWNmd35BJt+aaCfUowfycYO5ULasvi9XCnCcqMCnE B/smO4oDIY7OYajfXvP6PTIkXhZuqN2vexrcpNhwxTdDevJC3Ar1AiM9Rykpq57bcRXoEd XbPMWM2yvoCcmEzrXy5F0urhmcYtk1NqBeiw7dQzFNbpqeLsoGtlDcUCsx52D2GwIZGu6H /mNbp2BpJ4xr2PLNvPF2pkbzZG/xbWMT3auN1lYoWH4CWVwf5hyiY88t+l9H6WdF9CNXpf JgVbdMnxEMqzttc+l39nYB4nS609QBfjQUlDPK9WC8NRkKpMHL9bJFyaL9Qu0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8nLf1PKyzLCC; Thu, 19 Sep 2024 20:34: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 48JKYYHL070429; Thu, 19 Sep 2024 20:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKYYm9070426; Thu, 19 Sep 2024 20:34:34 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:34:34 GMT Message-Id: <202409192034.48JKYYm9070426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: ab92cab02633 - main - ixv: fix x550 VF link speed reported List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab92cab02633580f763a38a329a5b25050bb4fbf Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=ab92cab02633580f763a38a329a5b25050bb4fbf commit ab92cab02633580f763a38a329a5b25050bb4fbf Author: Piotr Skajewski AuthorDate: 2024-09-19 20:31:45 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 20:32:24 +0000 ixv: fix x550 VF link speed reported DPDK commit message net/ixgbe/base: fix 5G link speed reported on VF When 5000 Base-T was set on PF the VF reported 100 Base-T. This patch changes ixgbe_check_mac_link_vf function where there was an incorrect conditional which checks using PF mac types, now it is correctly using VF mac types. Fixes: 12e2090 ("net/ixgbe/base: include new speeds in VFLINK interpretation") Cc: stable@dpdk.org Signed-off-by: Piotr Skajewski Reviewed-by: Radoslaw Tyl Reviewed-by: Slawomir Mrozowicz Reviewed-by: Alice Michael Obtained from: DPDK (9eb7fdb) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_vf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 91df9b7dd1c3..beef259de339 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -642,7 +642,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed, switch (links_reg & IXGBE_LINKS_SPEED_82599) { case IXGBE_LINKS_SPEED_10G_82599: *speed = IXGBE_LINK_SPEED_10GB_FULL; - if (hw->mac.type >= ixgbe_mac_X550) { + if (hw->mac.type >= ixgbe_mac_X550_vf) { if (links_reg & IXGBE_LINKS_SPEED_NON_STD) *speed = IXGBE_LINK_SPEED_2_5GB_FULL; } @@ -652,7 +652,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed, break; case IXGBE_LINKS_SPEED_100_82599: *speed = IXGBE_LINK_SPEED_100_FULL; - if (hw->mac.type == ixgbe_mac_X550) { + if (hw->mac.type == ixgbe_mac_X550_vf) { if (links_reg & IXGBE_LINKS_SPEED_NON_STD) *speed = IXGBE_LINK_SPEED_5GB_FULL; } @@ -660,7 +660,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed, case IXGBE_LINKS_SPEED_10_X550EM_A: *speed = IXGBE_LINK_SPEED_UNKNOWN; /* Since Reserved in older MAC's */ - if (hw->mac.type >= ixgbe_mac_X550) + if (hw->mac.type >= ixgbe_mac_X550_vf) *speed = IXGBE_LINK_SPEED_10_FULL; break; default: From nobody Thu Sep 19 20:43:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8nXp0N0bz5XNZf; Thu, 19 Sep 2024 20:43: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 4X8nXn6WdTz4jTF; Thu, 19 Sep 2024 20:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726778601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d9t9rHK7ecRLAhYgViuqLMR807VIfXsM3ZV5ua/ZREU=; b=sicK6yBd+AxGKI/NevCIZvcW2NZFUYyha3hgo7dqQIarNLKQHCiwqsJj1pFnie4zNUgml3 xnYTtySyNbf0YKUFt+M+TBC4FOhPN8f07ob1hFP5hlgj62okC9VfzJqViqJGxCC9KUGwg1 XeQq8+JgG5wyxdLYAgIQMh0r1ls1OB+LzfPUCyLV9mJDaUaB31ZJ5V0Ne+C6AP2pYV30Ta 3p2eu7n6037705heJ5YQww5eYqDeSQEjAX+ZyojLJ50+9mcbU6RssPAZGKFPrnbLBdVV+U +nABCr0vIcXPf0+LGnf+gWlqWnmiK6WQNaKO8HeaEWfneJkvajIkIrYDrQvInQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726778601; a=rsa-sha256; cv=none; b=P161pPm3ksaEia75JQJQY1OWXDnoCQ4FuriVJt76w1G3Dk4D1e5KO7hpdgFmJtO1QusY2I PO/RM9NOg6Y3KXIoJJcXzSTCAQA664KrJsaaUZLvUA3M0dQ4DxNnsraLjpou5PESu3snot yYRnaK1wxB0Vycg8lNZsaZ0OiJgWF1Z+ccFrAeEUpNWuCCVI8AaNCIfxg/xbWGYySo4rLF 7jNg5ZiDnPMEc529EIQNRxlntkn26npaJoVrsA1P4w3vBNwRIVmHL7kIs2MhM92hj81Sl4 jTGBf+Psj0XV7gH2wWa+Mad73gFXTUn2NFSV7y0Vhie2gtGOHg00hcAxZ6tTeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726778601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d9t9rHK7ecRLAhYgViuqLMR807VIfXsM3ZV5ua/ZREU=; b=fELPlFJpg4kRzQyPhdb+3gctc1jiwCZHwzyDqhX+RNoClkobVJYDkAuRFbFIUxf5funNWd em1r9AA0cEtiLIwVZxvseWutSfMopOkFB0ava9woGUynU2p5ck0zHOepIbhCl4vtHMcaNt F75FgO/LkbNuOnEDRU1+S0Bb/Ck4nUL288cyYjq6qrfASp6t5W5u8Dpm6fVjjhpFN8xFNS ChZim9fGAYVbqFv/tUgi2GlLRyRYQo3Tq+8QJZ4xeMyFXF2D6/+inZ0fE9JBT7RaTH68uX dcqbZiBYTDOp2aGQmoWbSiWGtRl0NCRBmYxt298bjHL88acfTE/L5cxbxJ0w5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8nXn66ynzLhl; Thu, 19 Sep 2024 20:43: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 48JKhLsB086777; Thu, 19 Sep 2024 20:43:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JKhLIe086774; Thu, 19 Sep 2024 20:43:21 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:43:21 GMT Message-Id: <202409192043.48JKhLIe086774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9b56dfd27c64 - main - ixgbe: fix PHY ID for X550 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b56dfd27c64fcaf2dfbaa1eb3e2bd2b163fa56c Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9b56dfd27c64fcaf2dfbaa1eb3e2bd2b163fa56c commit 9b56dfd27c64fcaf2dfbaa1eb3e2bd2b163fa56c Author: Radoslaw Tyl AuthorDate: 2024-09-19 20:42:14 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 20:42:14 +0000 ixgbe: fix PHY ID for X550 DPDK commit message net/ixgbe/base: fix PHY ID for X550 Function ixgbe_get_phy_type_from_id() for X550_PHY_ID2 and X550_PHY_ID3 always return ixgbe_phy_unknown instead of ixgbe_phy_aq because phy ID's last 4 bits are always masked, and should not be taken into account when selecting phy type. This patch adds default PHY ID for X550 devices with mask on last 4 bits (0xFFFFFFF0), and fixes the switch statement to use it. Fixes: 58ddc80 ("ixgbe/base: add new X550 PHY ids") Cc: stable@dpdk.org Signed-off-by: Radoslaw Tyl Reviewed-by: Piotr Skajewski Reviewed-by: Alice Michael Obtained from: DPDK (a9f5a3b) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_phy.c | 3 +-- sys/dev/ixgbe/ixgbe_type.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index f4bee6c34f53..00f396283879 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -462,8 +462,7 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id) case TN1010_PHY_ID: phy_type = ixgbe_phy_tn; break; - case X550_PHY_ID2: - case X550_PHY_ID3: + case X550_PHY_ID: case X540_PHY_ID: phy_type = ixgbe_phy_aq; break; diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index deb68fa03312..1b447f42f17a 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1696,6 +1696,7 @@ struct ixgbe_dmac_config { #define TN1010_PHY_ID 0x00A19410 #define TNX_FW_REV 0xB #define X540_PHY_ID 0x01540200 +#define X550_PHY_ID 0x01540220 #define X550_PHY_ID2 0x01540223 #define X550_PHY_ID3 0x01540221 #define X557_PHY_ID 0x01540240 From nobody Thu Sep 19 21:03:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8p0F2xJNz5XQjF; Thu, 19 Sep 2024 21:03: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 4X8p0F2SbYz4lVD; Thu, 19 Sep 2024 21:03:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726779821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ls6YbuG0UwSjX3BtjlNsG9TVUU4fxr1Okl52A6992Xc=; b=E8krGvS5VCT7E5IO9B49YPPh4bxx/Crk0Tw50pJdThNGyJemM5mFlDKezORS2KsUF84BdA Wo7KVb1kuln7P4iK2yTTn+GQKNBhrvDqbQJyZyDu+EcHlF4FXx3+hCjsRTrYBmwifgsQbQ DSzO6pHayn3kKdCDVf+eGpoU1DBLJRBDOvsT4jyhpyZMQl2HHzRYS2b9upA6Z/+lKUXNAm QBL5I+94tq/K23ywB3m8cbfCGbO4ZzZQVCn02VN5adXwKvAPs0gch3yz0XIs3Roup2mnxb eZsGRv+zwRLTHbnbK8Y7KQ8st/Wuco89cpFC01XwoGa2mnubEHCMo33vsT0Cmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726779821; a=rsa-sha256; cv=none; b=NtrpZBKGpBz7ecqiYO9Jz9noG8gowsT5N8QnM9Z71tfp+LdE+qnmZHlYm0vqsEljSvVD47 Z2zQOhPRz1UNRPFw9ikAdrhUD5olAt+TxB/tKOe7Qr7E2A8dMM5gotr1OwFeOHYlHoPjyH G4xy7aT6hOiT8Em6hpkUiAs72GrL4lGylPaAdFYU6pPnIvRCZB8VHCO9ddCq313mvvyF7f 8mK3fgEqzb7b15VRPl//pz7v33BtTA08QDg4eUjzBL/zGMHuZfPf7ZsO23V08qsNKNu/NM CQmiBRDW0t3D6AFKuv5+Ji4wQls+C7hkj9bTsoNL8hOypVLV2HxkQ4DagWYAuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726779821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ls6YbuG0UwSjX3BtjlNsG9TVUU4fxr1Okl52A6992Xc=; b=K3GYrQxBkzP7Lp9Sdc4NjCL4CWh+/xg/bU4Dth2+n3LyVx9Yb+SnGpFTLhE985PURk0iDF Kvp2L6G+wFjuPyYSUtkXYhnebmdtNQnRfR7Xd6xn0U2LAdSy7adW0sA2M1dLIT58B2TA0U mAtRbplO7BgOi6C0hmxOq8HyhnnNY6q/qbdaTikA4mVjVi2lBAqbVJnDc9CCSJUnY6d2zb 6vcojVrZ6zNWra5HKSvcQw3VwW6um8o3h+ByydQoRGUZuCkgJWtXPWHFIt6U5m9SdfAgwG 7lpYThj7JteYK+ZAjj3PH3F/gD3O0rCUAfwngTxnGLzaLjBxaj621md9cRvM/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8p0F2395zMB6; Thu, 19 Sep 2024 21:03: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 48JL3fiQ022102; Thu, 19 Sep 2024 21:03:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JL3ffi022099; Thu, 19 Sep 2024 21:03:41 GMT (envelope-from git) Date: Thu, 19 Sep 2024 21:03:41 GMT Message-Id: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 10746040820e - main - ixgbe: rename VF message type macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10746040820ee5186caf4d4d61cf88196ec213ba Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=10746040820ee5186caf4d4d61cf88196ec213ba commit 10746040820ee5186caf4d4d61cf88196ec213ba Author: Jakub Chylkowski AuthorDate: 2024-09-19 21:02:06 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 21:03:18 +0000 ixgbe: rename VF message type macros DPDK commit message There is name similarity within IXGBE_VT_MSGTYPE_ACK and PFMAILBOX.ACK / VFMAILBOX.ACK which may cause confusion. Rename MSGTYPE macros to SUCCESS and FAILURE as they are not specified in datasheet and now will be easily distinguishable. Signed-off-by: Jakub Chylkowski Reviewed-by: Marek Zalfresso-jundzillo Reviewed-by: Alice Michael Reviewed-by: Piotr Skajewski Reviewed-by: Slawomir Mrozowicz Tested-by: Piotr Skajewski Tested-by: Alice Michael Obtained from: DPDK (4f675c9) MFC after: 1 week --- sys/dev/ixgbe/if_sriov.c | 10 +++++----- sys/dev/ixgbe/ixgbe_mbx.h | 14 +++++++------- sys/dev/ixgbe/ixgbe_vf.c | 34 ++++++++++++++++++---------------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 7cdd287b85bf..a16092c9f688 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -107,14 +107,14 @@ static inline void ixgbe_send_vf_ack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_ACK); + ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_SUCCESS); } static inline void ixgbe_send_vf_nack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_NACK); + ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_FAILURE); } static inline void @@ -362,9 +362,9 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&sc->hw, vf->rar_index, vf->ether_addr, vf->pool, true); - ack = IXGBE_VT_MSGTYPE_ACK; + ack = IXGBE_VT_MSGTYPE_SUCCESS; } else - ack = IXGBE_VT_MSGTYPE_NACK; + ack = IXGBE_VT_MSGTYPE_FAILURE; ixgbe_vf_enable_transmit(sc, vf); ixgbe_vf_enable_receive(sc, vf); @@ -556,7 +556,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) return; } - resp[0] = IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_ACK | + resp[0] = IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_SUCCESS | IXGBE_VT_MSGTYPE_CTS; num_queues = ixgbe_vf_queues(sc->iov_mode); diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 47b9327bb896..fa407c4969d1 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -68,14 +68,14 @@ /* If it's a IXGBE_VF_* msg then it originates in the VF and is sent to the * PF. The reverse is true if it is IXGBE_PF_*. - * Message ACK's are the value or'd with 0xF0000000 + * Message results are the value or'd with 0xF0000000 */ -#define IXGBE_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with - * this are the ACK */ -#define IXGBE_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with - * this are the NACK */ -#define IXGBE_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still - * clear to send requests */ +#define IXGBE_VT_MSGTYPE_SUCCESS 0x80000000 /* Messages or'd with this + * have succeeded */ +#define IXGBE_VT_MSGTYPE_FAILURE 0x40000000 /* Messages or'd with this + * have failed */ +#define IXGBE_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still + * clear to send requests */ #define IXGBE_VT_MSGINFO_SHIFT 16 /* bits 23:16 are used for extra info for certain messages */ #define IXGBE_VT_MSGINFO_MASK (0xFF << IXGBE_VT_MSGINFO_SHIFT) diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index beef259de339..4624c2b5c0a3 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -223,11 +223,11 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) if (ret_val) return ret_val; - if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK) && - msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_NACK)) + if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS) && + msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_INVALID_MAC_ADDR; - if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK)) + if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS)) memcpy(hw->mac.perm_addr, addr, IXGBE_ETH_LENGTH_OF_ADDRESS); hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD]; @@ -356,9 +356,9 @@ s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; - /* if nacked the address was rejected, use "perm_addr" */ + /* if we had failure, the address was rejected, use "perm_addr" */ if (!ret_val && - (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_NACK))) { + (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_FAILURE))) { ixgbe_get_mac_addr_vf(hw, hw->mac.addr); return IXGBE_ERR_MBX; } @@ -447,7 +447,7 @@ s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) return err; msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; - if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_NACK)) + if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_FEATURE_NOT_SUPPORTED; return IXGBE_SUCCESS; } @@ -470,7 +470,7 @@ s32 ixgbe_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state) err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2); - if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK)) { + if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) { ret_val = IXGBE_ERR_MBX; } else { ret_val = IXGBE_SUCCESS; @@ -503,10 +503,10 @@ s32 ixgbe_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT; ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2); - if (!ret_val && (msgbuf[0] & IXGBE_VT_MSGTYPE_ACK)) + if (!ret_val && (msgbuf[0] & IXGBE_VT_MSGTYPE_SUCCESS)) return IXGBE_SUCCESS; - return ret_val | (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK); + return ret_val | (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE); } /** @@ -571,7 +571,7 @@ s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr) if (!ret_val) { msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; - if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_NACK)) + if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_OUT_OF_MEM; } @@ -674,8 +674,10 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed, goto out; if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) { - /* msg is not CTS and is NACK we must have lost CTS status */ - if (in_msg & IXGBE_VT_MSGTYPE_NACK) + /* msg is not CTS and is FAILURE, + * we must have lost CTS status. + */ + if (in_msg & IXGBE_VT_MSGTYPE_FAILURE) ret_val = -1; goto out; } @@ -713,7 +715,7 @@ s32 ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size) if (retval) return retval; if ((msgbuf[0] & IXGBE_VF_SET_LPE) && - (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK)) + (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_MBX; return 0; @@ -739,7 +741,7 @@ int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api) msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; /* Store value and return 0 on success */ - if (msg[0] == (IXGBE_VF_API_NEGOTIATE | IXGBE_VT_MSGTYPE_ACK)) { + if (msg[0] == (IXGBE_VF_API_NEGOTIATE | IXGBE_VT_MSGTYPE_SUCCESS)) { hw->api_version = api; return 0; } @@ -775,11 +777,11 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; /* - * if we we didn't get an ACK there must have been + * if we we didn't get a SUCCESS there must have been * some sort of mailbox error so we should treat it * as such */ - if (msg[0] != (IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_ACK)) + if (msg[0] != (IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_SUCCESS)) return IXGBE_ERR_MBX; /* record and validate values from message */ From nobody Thu Sep 19 21:43:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8pt96y4mz5XWSl; Thu, 19 Sep 2024 21:43: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 4X8pt96N8Tz4pjN; Thu, 19 Sep 2024 21:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726782209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtm2i8PFr6vMDRxJzAxkLXHBJqrM6JZrY0UAPOzKyA8=; b=ZWswtpVDdhegjoenV+DKtYun7cCboO0n4EGdL8DPE6NeM0pcywRSyUAGbzhC6Bp5kAwcrl vAz7/JQWYuQSpBol+/I66gxpOSPB+qCXpgHSNEOjxpb5Mnsc8DxGUni1OKWnprg/DbGwh3 w88d5mT5MyK856qUWObSpJKE8zUR9JZsyAnqn0Con4xhXwclchpTWIvut0QKv6yswkNldx 7Wg3RLm9L6WnXgyaqTAitoYJBvDJbN8xVoFhH70dxiib0vd3PLk5qPqXY4Qo5b1GJvEFSl nN+CjgzM/Ok1hsoVLwr7WDmmtQ4NXyBWbaq9xe3CIbVxtLiv4/JkVbkJF/7NLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726782209; a=rsa-sha256; cv=none; b=aqFkDRVC8TOHbNTPZ69sEGZbPs40JEd1VcoSeaAz69PgpOsUmIXOZLxvKr5rThicVIUtCM EuvBitI3YAZrlOGsNzkUafixBtGSIE37pBJaloD80VwWrsfEbVTE6IW75AgK17oRIG/ov5 Q165+v3F+w4zd5GyL/P0v8CF09mF+S7WSa8IensKsCELyD1sa3eSVocqp2V+/FtiONHGQ6 GjQ+xVMidYs4LyFEmPunTqbAV5+SWEVwmRFt/HNKKIYTHYIuudZQk1fsFjyx5yVn/PfyRi 8f1KTuZKVnciy2xjL8Y6LEOKi3y+5483W28D9uhoS5gOd5oj5/RtpFNTpDjlmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726782209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtm2i8PFr6vMDRxJzAxkLXHBJqrM6JZrY0UAPOzKyA8=; b=AY2pjESB994BLZeFy1B3Yd5OG70cGC/3jVjz0OkxbqoKpUA6u7z2woSP/a09If/1gAJfKM LT7u8VP6ZKCMvMwVXRQRs6BWZHTBQljkaFPQmU4lIMJTmbUt3sQyRv/jRJpbfRBxTQHL3D tM64VQvXo3ENOJCD1Aixr7dwwYt/8swyyu/r1AqJPsy6xBtwU5yCWYO5iSbYKt5bqS4Jh/ ZYTvWHKXQePq0Ny+UjmT+AbACUdZa+0WIBksZZRCeEKJHDfShvpgpcXLnszq1rCg6k72XV cvZQkHxTa926Se4t+Rxx5R68ZbddSyXf5anvrOYh4gv9fxoqcxGCbJfNRCoLgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8pt95ymrzMYW; Thu, 19 Sep 2024 21:43: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 48JLhTZX089182; Thu, 19 Sep 2024 21:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JLhTmM089179; Thu, 19 Sep 2024 21:43:29 GMT (envelope-from git) Date: Thu, 19 Sep 2024 21:43:29 GMT Message-Id: <202409192143.48JLhTmM089179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: b21881d8c421 - stable/14 - ums(4): fix incorrect mouse button reporting via evdev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b21881d8c42132fca37f361c0baa2fd08b51f9e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b21881d8c42132fca37f361c0baa2fd08b51f9e2 commit b21881d8c42132fca37f361c0baa2fd08b51f9e2 Author: Niko Sonack AuthorDate: 2024-07-02 19:27:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-09-19 21:41:43 +0000 ums(4): fix incorrect mouse button reporting via evdev when ums driver receives non-mouse HID report. This results in unexpected button release event. Reuse existing sysmouse logic to keep button pressed. Reviewed by: imp, wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45838 (cherry picked from commit d6888e211b07be79dd8de3145ac41b365f482ae8) --- sys/dev/usb/input/ums.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 8416be656f81..067feed13e92 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -320,11 +320,12 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (++info != &sc->sc_info[UMS_INFO_MAX]) goto repeat; + /* keep old button value(s) for non-detected buttons */ + buttons |= sc->sc_status.button & ~buttons_found; + #ifdef EVDEV_SUPPORT buttons_reported = buttons; #endif - /* keep old button value(s) for non-detected buttons */ - buttons |= sc->sc_status.button & ~buttons_found; if (dx || dy || dz || dt || dw || (buttons != sc->sc_status.button)) { From nobody Thu Sep 19 21:44:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8pvd6Mf1z5XWW2; Thu, 19 Sep 2024 21:44: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 4X8pvd5p96z4q7C; Thu, 19 Sep 2024 21:44:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726782285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh8598+fdRhNsqFFNYazgWW/4nqHIbPg+BsqTjOc6ZM=; b=KOjcsu00Ksg+fzRUXfUR7tUQUZKqD1HCztwmNXer0rJuNFWx9hVee2mQwWpMaaM8IrcGbo 1EgRDFCMaMLPpZNM7hg3qj9V6QkHoemMe0/7hVs33WJxKzUGur/wumtcqWqLsIqQ0jEhfw hu12BBv5TYmjeLh+kh0EHKDpeoQ23qQnkS9Gyj8KhwoDWJWsx0OQAAp89jMHmcf1f8YN5D yjlqe9PxD/j+wGNu+/A4yvEgm/KWvMFhaRNn+V0oLA2VJcIKTq/QgfHs9ztlSzqLmnFPNW 50XF8QumAnvmWurbAnMwAlY5SI3zRDmAUr/6Z62ig2PkNnYP0ULfofQauCliiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726782285; a=rsa-sha256; cv=none; b=e88GqB4Q5FjFedtxA3hUOav2e4TjfcUymcIqGhFuZ0yzimUGT8o60u4sxelhBhs9G00qld Wcb1IlQhlhaOlotoekS2OLVzzEWcM8vWBtTTzSAvwbQ20BQ89+3QLHfT0m2lVpCoys0TyG n/PjvMBIDvPUBoLQcbYgqB+5hGo+6eg8zrYadD4N2HkAyUIkzA4ve7yms3ubgMDj2gxwem 6o9UjflTni3leSNTX4CyKO15XnZoGGHS6wYKJKtLkgR3XHTglYwtCimTqfBxbCxocOyxIJ fS3jk276MJIOTfvBiuR3L2Y+1qd+TXMgUmK4RPd+9KLFJ/nTFO1ijGurMG7Z2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726782285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oh8598+fdRhNsqFFNYazgWW/4nqHIbPg+BsqTjOc6ZM=; b=TMNO5N6ahe0y8hpxjEKKtdsAaOZpPtSBcUO4mTNbTgASJ5v28FdaaOvGXxl5CHqvoo6iCo DRStQfpeXrt7FYy4ybWNnbq/aRp2j7nh0wZGsN9o26Hfih65upZ7QRdH/VIMUgcDNwvuSa HKM1lAZzinAN2o1w6QykPIrwDfJH2WqLR4lD+RAI4aG6G69fRd0ywy+DYdI9+XOPKiMoe8 YnwusVsz6sIyfQLXBl0u1eympfGTVER0ApiltwSNWW3mh8ZB0yewrxj8yeJfYMNvOksCLR HSkzIxZy5hXzfFeIG3ygEOh26v77X9U1Pv67136OHxGMtMTyL1Ge3NNi9V+qxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8pvd5K7MzMYX; Thu, 19 Sep 2024 21:44: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 48JLij5U089515; Thu, 19 Sep 2024 21:44:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JLijqM089512; Thu, 19 Sep 2024 21:44:45 GMT (envelope-from git) Date: Thu, 19 Sep 2024 21:44:45 GMT Message-Id: <202409192144.48JLijqM089512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 66292e70e84d - stable/13 - ums(4): fix incorrect mouse button reporting via evdev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66292e70e84d01f24d8d571e14f31f8793ce8d89 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=66292e70e84d01f24d8d571e14f31f8793ce8d89 commit 66292e70e84d01f24d8d571e14f31f8793ce8d89 Author: Niko Sonack AuthorDate: 2024-07-02 19:27:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-09-19 21:44:02 +0000 ums(4): fix incorrect mouse button reporting via evdev when ums driver receives non-mouse HID report. This results in unexpected button release event. Reuse existing sysmouse logic to keep button pressed. Reviewed by: imp, wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45838 (cherry picked from commit d6888e211b07be79dd8de3145ac41b365f482ae8) --- sys/dev/usb/input/ums.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index d8dc2e8f19c3..68a5a33e5e5c 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -320,11 +320,12 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (++info != &sc->sc_info[UMS_INFO_MAX]) goto repeat; + /* keep old button value(s) for non-detected buttons */ + buttons |= sc->sc_status.button & ~buttons_found; + #ifdef EVDEV_SUPPORT buttons_reported = buttons; #endif - /* keep old button value(s) for non-detected buttons */ - buttons |= sc->sc_status.button & ~buttons_found; if (dx || dy || dz || dt || dw || (buttons != sc->sc_status.button)) { From nobody Thu Sep 19 23:26:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8s8b4bKNz5XmkR; Thu, 19 Sep 2024 23:26: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 4X8s8b3qXhz51m1; Thu, 19 Sep 2024 23:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726788367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZqLl+23zWTCMJEnV9pWxl2ThkhjNkNzWGkH3Fz/ccOk=; b=lZn+YbZ53cCVOH9nTmttaJNHCBVVXHyHdSV48m9QSAYYM3UKLvUUP7GnM21srABMwmfCKZ +hFHvrMmQbPCVwRZKWvaozaIRH+3fr25CqECM9bESI2vH791i0d4/7qjafoIM3ksa2PwdD UpAwrNiUTkmR8IbRRpthFOeoMJJ2Df7YTPOOXEYiCKWHg0jqcp742lmVoBbCgx7Xa6CrKe BHm75koxAuw4x4VUBk+66jL5+d2j6AHLAIxdUnEa3vcelLf8obrrBp1irZKewWrYcEzwBH DJtInoKmFiD2zvt4hPRCDz+r7KqNT1MFgK1kkshIZrWf003xEuo8OhLnN+Yorw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726788367; a=rsa-sha256; cv=none; b=fWOMr2PRT6Rp3DZdc3Q18Cd+o8l30ktedLe2HlzC5Zw3ucPtOUqGocyLS5V5Z8SZh3IeCe MUhztVNG7S2cGnK0Rekw4+zhxkC7pj4n0YN8kgDIiA82X7TYzYI/HAL5nPQDXX5LtvZiKg ox3aXa3JTI0wkzo034UAJb7m8w3mFErCSrBquMLe7BmpbNdOp0nslQf3txZeSZKijRPq1j 5qGswKdG3bOyn0okFrgwWnqZpj+O+j7SvHRL8SvkAdzI1bFitDhdqMT6xtvSUQNvVS7Qvr TskV4GECdB11gggR/UuPirWSoT95jXgQu1zhJnPG65RvKhSsurK0007q9MHjlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726788367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZqLl+23zWTCMJEnV9pWxl2ThkhjNkNzWGkH3Fz/ccOk=; b=aDwzhppa/P8DMzTzDH4I1YTdAnvrwD9GrY5q2fOBqcZEZNljkk68U6pftiz7DVwNAYSWsb 9wf+Ev0CUmP06N7YxTszaIoVC+2lDaJ7cIpuV3QEYF7WLVeROj/kO/rjlctGMQEn64oRBS Is9W+Q4Kv6FFH47KFh6zpDbrn9/dcOpkbT/0W6oYQvSf/yGv+cpfSgZc+PybNRdFNmiXvX H3+seglEdBEGIidV5H5tEMqB76q+Kc0tNXot4cilo5WeCygG6fx3a7uzMlkPpGvUvjZP9N R/rKeBrJGF9aG2uephnlSxqxBXIIVQp6CUoo9+IZBnQmsx0Gr/Mc82BqCw7cgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8s8b3QL4zQGJ; Thu, 19 Sep 2024 23:26: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 48JNQ7cN060181; Thu, 19 Sep 2024 23:26:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JNQ7lr060178; Thu, 19 Sep 2024 23:26:07 GMT (envelope-from git) Date: Thu, 19 Sep 2024 23:26:07 GMT Message-Id: <202409192326.48JNQ7lr060178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b3c7fde6fe91 - main - ixgbe: correct register names to match datasheet List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3c7fde6fe9113f849232604523878b4b68df0cc Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b3c7fde6fe9113f849232604523878b4b68df0cc commit b3c7fde6fe9113f849232604523878b4b68df0cc Author: Jakub Chylkowski AuthorDate: 2024-09-19 23:25:09 +0000 Commit: Kevin Bowling CommitDate: 2024-09-19 23:25:09 +0000 ixgbe: correct register names to match datasheet DPDK commit message net/ixgbe/base: correct registers names to match datasheet Some of mailbox-related registers have different names than it is specified in datasheet. Correct these names to correspond to their datasheet counterparts. Additionally, several calculations are changed to no longer use magic numbers but dedicated macros instead. Signed-off-by: Jakub Chylkowski Reviewed-by: Marek Zalfresso-jundzillo Reviewed-by: Alice Michael Reviewed-by: Piotr Skajewski Reviewed-by: Slawomir Mrozowicz Tested-by: Piotr Skajewski Tested-by: Alice Michael Obtained from: DPDK (10fd55e) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_mbx.c | 30 +++++++++++++++--------------- sys/dev/ixgbe/ixgbe_mbx.h | 8 ++++---- sys/dev/ixgbe/ixgbe_type.h | 11 ++++++----- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index d12aadea7097..c8f839fce85a 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -527,12 +527,12 @@ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) { - u32 mbvficr = IXGBE_READ_REG(hw, IXGBE_MBVFICR(index)); + u32 pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); s32 ret_val = IXGBE_ERR_MBX; - if (mbvficr & mask) { + if (pfmbicr & mask) { ret_val = IXGBE_SUCCESS; - IXGBE_WRITE_REG(hw, IXGBE_MBVFICR(index), mask); + IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), mask); } return ret_val; @@ -547,13 +547,13 @@ static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) **/ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) { + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); + s32 index = IXGBE_PFMBICR_INDEX(vf_number); s32 ret_val = IXGBE_ERR_MBX; - s32 index = IXGBE_MBVFICR_INDEX(vf_number); - u32 vf_bit = vf_number % 16; DEBUGFUNC("ixgbe_check_for_msg_pf"); - if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFREQ_VF1 << vf_bit, + if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFREQ_VF1 << vf_shift, index)) { ret_val = IXGBE_SUCCESS; hw->mbx.stats.reqs++; @@ -571,13 +571,13 @@ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) **/ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) { + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); + s32 index = IXGBE_PFMBICR_INDEX(vf_number); s32 ret_val = IXGBE_ERR_MBX; - s32 index = IXGBE_MBVFICR_INDEX(vf_number); - u32 vf_bit = vf_number % 16; DEBUGFUNC("ixgbe_check_for_ack_pf"); - if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFACK_VF1 << vf_bit, + if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFACK_VF1 << vf_shift, index)) { ret_val = IXGBE_SUCCESS; hw->mbx.stats.acks++; @@ -595,22 +595,22 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) **/ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) { - u32 reg_offset = (vf_number < 32) ? 0 : 1; - u32 vf_shift = vf_number % 32; - u32 vflre = 0; + u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_number); + u32 index = IXGBE_PFVFLRE_INDEX(vf_number); s32 ret_val = IXGBE_ERR_MBX; + u32 vflre = 0; DEBUGFUNC("ixgbe_check_for_rst_pf"); switch (hw->mac.type) { case ixgbe_mac_82599EB: - vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset)); + vflre = IXGBE_READ_REG(hw, IXGBE_PFVFLRE(index)); break; case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: case ixgbe_mac_X540: - vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset)); + vflre = IXGBE_READ_REG(hw, IXGBE_PFVFLREC(index)); break; default: break; @@ -618,7 +618,7 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) if (vflre & (1 << vf_shift)) { ret_val = IXGBE_SUCCESS; - IXGBE_WRITE_REG(hw, IXGBE_VFLREC(reg_offset), (1 << vf_shift)); + IXGBE_WRITE_REG(hw, IXGBE_PFVFLREC(index), (1 << vf_shift)); hw->mbx.stats.rsts++; } diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index fa407c4969d1..fc4d58e1c0db 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -60,10 +60,10 @@ #define IXGBE_PFMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ #define IXGBE_PFMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */ -#define IXGBE_MBVFICR_VFREQ_MASK 0x0000FFFF /* bits for VF messages */ -#define IXGBE_MBVFICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ -#define IXGBE_MBVFICR_VFACK_MASK 0xFFFF0000 /* bits for VF acks */ -#define IXGBE_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ +#define IXGBE_PFMBICR_VFREQ_MASK 0x0000FFFF /* bits for VF messages */ +#define IXGBE_PFMBICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ +#define IXGBE_PFMBICR_VFACK_MASK 0xFFFF0000 /* bits for VF acks */ +#define IXGBE_PFMBICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ /* If it's a IXGBE_VF_* msg then it originates in the VF and is sent to the diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 1b447f42f17a..2fc500c9329c 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -483,8 +483,14 @@ struct ixgbe_nvm_version { #define IXGBE_PFMAILBOX(_i) (0x04B00 + (4 * (_i))) /* 64 total */ /* 64 Mailboxes, 16 DW each */ #define IXGBE_PFMBMEM(_i) (0x13000 + (64 * (_i))) +#define IXGBE_PFMBICR_INDEX(_i) ((_i) >> 4) +#define IXGBE_PFMBICR_SHIFT(_i) ((_i) % 16) #define IXGBE_PFMBICR(_i) (0x00710 + (4 * (_i))) /* 4 total */ #define IXGBE_PFMBIMR(_i) (0x00720 + (4 * (_i))) /* 4 total */ +#define IXGBE_PFVFLRE(_i) ((((_i) & 1) ? 0x001C0 : 0x00600)) +#define IXGBE_PFVFLREC(_i) (0x00700 + ((_i) * 4)) +#define IXGBE_PFVFLRE_INDEX(_i) ((_i) >> 5) +#define IXGBE_PFVFLRE_SHIFT(_i) ((_i) % 32) #define IXGBE_VFRE(_i) (0x051E0 + ((_i) * 4)) #define IXGBE_VFTE(_i) (0x08110 + ((_i) * 4)) #define IXGBE_VMECM(_i) (0x08790 + ((_i) * 4)) @@ -2899,11 +2905,6 @@ enum { #define IXGBE_RX_DESC_SPECIAL_PRI_SHIFT 0x000D /* Priority in upper 3 of 16 */ #define IXGBE_TX_DESC_SPECIAL_PRI_SHIFT IXGBE_RX_DESC_SPECIAL_PRI_SHIFT -/* SR-IOV specific macros */ -#define IXGBE_MBVFICR_INDEX(vf_number) (vf_number >> 4) -#define IXGBE_MBVFICR(_i) (0x00710 + ((_i) * 4)) -#define IXGBE_VFLRE(_i) (((_i & 1) ? 0x001C0 : 0x00600)) -#define IXGBE_VFLREC(_i) (0x00700 + ((_i) * 4)) /* Translated register #defines */ #define IXGBE_PVFCTRL(P) (0x00300 + (4 * (P))) #define IXGBE_PVFSTATUS(P) (0x00008 + (0 * (P))) From nobody Fri Sep 20 01:41:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8w8Q6BpZz5WGS2; Fri, 20 Sep 2024 01:41: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 4X8w8Q5xqDz44QY; Fri, 20 Sep 2024 01:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726796470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vuUsrkWE8x/yJW52VK0EeEK2Ub0D1LIhQAu+rxuoY+E=; b=YqCJTdHr0ru8b+GweywOkb8y6LixkesDJbMEH/HQsyRAM35l5uADOsAs4TWsi1imu/9g+P xHcBJlcf9jxPufW+pu4POwEdW0fLiVnbJqZokRWOqwZpzfcNKkDwVT2ybA7umer2TrJv5a wH1o3Y8qL5WxVmiZQk7lcnYQHQN5mOEHwfPXOndjT9lbQ+8GYZ/ZJnBMdw03cvNezoAcrt fWtZVaO/wPbU7uekiyP+hayA4DPj1TQTzRpffQW8AaBSPsFLa2ay+AYevnA3n/4yxjskIh Fr+JhRG6DXogkZWRVM0aaQv3gCc344ho4owF+YBekAkETxxBOkQ8wlLjhY33Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726796470; a=rsa-sha256; cv=none; b=OpaI0pSqDkRa3hWheg0eUW/6Q1Kfr6VDJ0sadFxaxBFTSusm3jqxRWHI3Emn4o+lZxSPPN z7mHPchHfvo7FGboxq3PwIRrdraRIv1dU5+dU9HM4QRLhUgT5uU01Ssq6ChTVr8bkbRQP7 i4TkjAa/UphkldX5OrGFKedlOZoUCC6gI/JNEweGOFOG8VqmRmOpa2AzxzESJ4Y/T7c95g 3u/+6Zrtj77GsK8keYzXVRH/5MtaRkcyxzwng9taD/asfHKKU8+PBc/VV1nMl4A3HkvTwZ d+WN0I52m9Njneww8wrboSyZU+5GpDwDNO3530SnX60BESd2tfM9q2m2YZovYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726796470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vuUsrkWE8x/yJW52VK0EeEK2Ub0D1LIhQAu+rxuoY+E=; b=u5E6p1CsFg05YA8QAWQGz1QqMmf6ET2rG+T7+6Vhn75R0q+AYugFj+IfSlZGsx6Wtdp9Y2 BYJmMwHgCZKCY+7mNLDqE6tAhfgTJcDcuRu/KEbfnhewAr/tmUMMXy5LE4kIppN3c9Qsso 2jr3g143lCYwKBbixAQVeZ/ZXEg1EQ9co0MFdyPGQ+YsapmbRobqxn9FHSeN0FoD6yJzw6 pkxNTvuSIEB8wYnsnt71nBXbP/ZghJhuNK40vGr4et3KJSVyNJrUCb4e+Rqpr8g3UT6nbn oQBPE75ZptltGquQmuia7driWGCs4llmaiGyT+W+C9VExKLKzAc1dRU15IrPrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8w8Q5YNWzVg1; Fri, 20 Sep 2024 01:41: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 48K1fAvD089087; Fri, 20 Sep 2024 01:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K1fAUu089084; Fri, 20 Sep 2024 01:41:10 GMT (envelope-from git) Date: Fri, 20 Sep 2024 01:41:10 GMT Message-Id: <202409200141.48K1fAUu089084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 68ba3eabd486 - main - ixgbe: introduce new mailbox API List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68ba3eabd4869577bf11c03a6ec6f472502be07d Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=68ba3eabd4869577bf11c03a6ec6f472502be07d commit 68ba3eabd4869577bf11c03a6ec6f472502be07d Author: Jakub Chylkowski AuthorDate: 2024-09-20 01:39:35 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 01:39:35 +0000 ixgbe: introduce new mailbox API DPDK commit message Current mailbox API does not work as described in documentation and is prone to errors (for example, it is doing locks on read). Introduce new mailbox API and provide compatibility functions with old API. New error codes have been introduced: - IXGBE_ERR_CONFIG - ixgbe_mbx_operations is not correctly set - IXGBE_ERR_TIMEOUT - mailbox operation, e.g. poll for message, timedout - IXGBE_ERR_MBX_NOMSG - no message available on read In addition, some refactoring has been done: mailbox structures were defined twice: in ixgbe_type.h and ixgbe_vf.h. Move them into ixgbe_mbx.h as this header is dedicated for mailbox. Signed-off-by: Jakub Chylkowski Reviewed-by: Alice Michael Reviewed-by: Piotr Pietruszewski Tested-by: Alice Michael Tested-by: Piotr Skajewski Obtained from: DPDK (6d243d2) MFC after: 1 week --- sys/dev/ixgbe/if_ix.c | 7 +- sys/dev/ixgbe/ixgbe_82599.c | 4 +- sys/dev/ixgbe/ixgbe_mbx.c | 839 ++++++++++++++++++++++++++++++++------------ sys/dev/ixgbe/ixgbe_type.h | 32 +- sys/dev/ixgbe/ixgbe_vf.c | 42 ++- sys/dev/ixgbe/ixgbe_x540.c | 4 +- 6 files changed, 650 insertions(+), 278 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 17f1f73a526e..ed41f6b66e09 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -879,6 +879,7 @@ ixgbe_if_attach_pre(if_ctx_t ctx) struct ixgbe_hw *hw; int error = 0; u32 ctrl_ext; + size_t i; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -928,8 +929,10 @@ ixgbe_if_attach_pre(if_ctx_t ctx) goto err_pci; } - if (hw->mbx.ops.init_params) - hw->mbx.ops.init_params(hw); + if (hw->mbx.ops[0].init_params) { + for (i = 0; i < sc->num_vfs; i++) + hw->mbx.ops[i].init_params(hw); + } hw->allow_unsupported_sfp = allow_unsupported_sfp; diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 8c3df0fd4f59..70b4cdc5c6ca 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -324,6 +324,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) struct ixgbe_phy_info *phy = &hw->phy; struct ixgbe_eeprom_info *eeprom = &hw->eeprom; s32 ret_val; + u16 i; DEBUGFUNC("ixgbe_init_ops_82599"); @@ -385,7 +386,8 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) mac->arc_subsystem_valid = !!(IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)) & IXGBE_FWSM_MODE_MASK); - hw->mbx.ops.init_params = ixgbe_init_mbx_params_pf; + for (i = 0; i < 64; i++) + hw->mbx.ops[i].init_params = ixgbe_init_mbx_params_pf; /* EEPROM */ eeprom->ops.read = ixgbe_read_eeprom_82599; diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index c8f839fce85a..0a0c5abde157 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -35,6 +35,9 @@ #include "ixgbe_type.h" #include "ixgbe_mbx.h" +static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id); +static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id); + /** * ixgbe_read_mbx - Reads a message from the mailbox * @hw: pointer to the HW structure @@ -47,42 +50,91 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_read_mbx"); /* limit read to size of mailbox */ - if (size > mbx->size) + if (size > mbx->size) { + ERROR_REPORT3(IXGBE_ERROR_ARGUMENT, + "Invalid mailbox message size %u, changing to %u", + size, mbx->size); + size = mbx->size; + } + + if (mbx->ops[mbx_id].read) + return mbx->ops[mbx_id].read(hw, msg, size, mbx_id); + + return IXGBE_ERR_CONFIG; +} + +/** + * ixgbe_poll_mbx - Wait for message and read it from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfully read message from buffer + **/ +s32 ixgbe_poll_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val; + + DEBUGFUNC("ixgbe_poll_mbx"); + + if (!mbx->ops[mbx_id].read || !mbx->ops[mbx_id].check_for_msg || + !mbx->timeout) + return IXGBE_ERR_CONFIG; + + /* limit read to size of mailbox */ + if (size > mbx->size) { + ERROR_REPORT3(IXGBE_ERROR_ARGUMENT, + "Invalid mailbox message size %u, changing to %u", + size, mbx->size); size = mbx->size; + } - if (mbx->ops.read) - ret_val = mbx->ops.read(hw, msg, size, mbx_id); + ret_val = ixgbe_poll_for_msg(hw, mbx_id); + /* if ack received read message, otherwise we timed out */ + if (!ret_val) + return mbx->ops[mbx_id].read(hw, msg, size, mbx_id); return ret_val; } /** - * ixgbe_write_mbx - Write a message to the mailbox + * ixgbe_write_mbx - Write a message to the mailbox and wait for ACK * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully copied message into the buffer + * returns SUCCESS if it successfully copied message into the buffer and + * received an ACK to that message within specified period **/ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_SUCCESS; + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_write_mbx"); + /* + * exit if either we can't write, release + * or there is no timeout defined + */ + if (!mbx->ops[mbx_id].write || !mbx->ops[mbx_id].check_for_ack || + !mbx->ops[mbx_id].release || !mbx->timeout) + return IXGBE_ERR_CONFIG; + if (size > mbx->size) { - ret_val = IXGBE_ERR_MBX; + ret_val = IXGBE_ERR_PARAM; ERROR_REPORT2(IXGBE_ERROR_ARGUMENT, - "Invalid mailbox message size %d", size); - } else if (mbx->ops.write) - ret_val = mbx->ops.write(hw, msg, size, mbx_id); + "Invalid mailbox message size %u", size); + } else { + ret_val = mbx->ops[mbx_id].write(hw, msg, size, mbx_id); + } return ret_val; } @@ -97,12 +149,12 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_ERR_CONFIG; DEBUGFUNC("ixgbe_check_for_msg"); - if (mbx->ops.check_for_msg) - ret_val = mbx->ops.check_for_msg(hw, mbx_id); + if (mbx->ops[mbx_id].check_for_msg) + ret_val = mbx->ops[mbx_id].check_for_msg(hw, mbx_id); return ret_val; } @@ -117,12 +169,12 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_ERR_CONFIG; DEBUGFUNC("ixgbe_check_for_ack"); - if (mbx->ops.check_for_ack) - ret_val = mbx->ops.check_for_ack(hw, mbx_id); + if (mbx->ops[mbx_id].check_for_ack) + ret_val = mbx->ops[mbx_id].check_for_ack(hw, mbx_id); return ret_val; } @@ -137,12 +189,12 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_ERR_CONFIG; DEBUGFUNC("ixgbe_check_for_rst"); - if (mbx->ops.check_for_rst) - ret_val = mbx->ops.check_for_rst(hw, mbx_id); + if (mbx->ops[mbx_id].check_for_rst) + ret_val = mbx->ops[mbx_id].check_for_rst(hw, mbx_id); return ret_val; } @@ -161,22 +213,23 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id) DEBUGFUNC("ixgbe_poll_for_msg"); - if (!countdown || !mbx->ops.check_for_msg) - goto out; + if (!countdown || !mbx->ops[mbx_id].check_for_msg) + return IXGBE_ERR_CONFIG; - while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) { + while (countdown && mbx->ops[mbx_id].check_for_msg(hw, mbx_id)) { countdown--; if (!countdown) break; usec_delay(mbx->usec_delay); } - if (countdown == 0) + if (countdown == 0) { ERROR_REPORT2(IXGBE_ERROR_POLLING, - "Polling for VF%d mailbox message timedout", mbx_id); + "Polling for VF%u mailbox message timedout", mbx_id); + return IXGBE_ERR_TIMEOUT; + } -out: - return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; + return IXGBE_SUCCESS; } /** @@ -193,115 +246,71 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) DEBUGFUNC("ixgbe_poll_for_ack"); - if (!countdown || !mbx->ops.check_for_ack) - goto out; + if (!countdown || !mbx->ops[mbx_id].check_for_ack) + return IXGBE_ERR_CONFIG; - while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) { + while (countdown && mbx->ops[mbx_id].check_for_ack(hw, mbx_id)) { countdown--; if (!countdown) break; usec_delay(mbx->usec_delay); } - if (countdown == 0) + if (countdown == 0) { ERROR_REPORT2(IXGBE_ERROR_POLLING, - "Polling for VF%d mailbox ack timedout", mbx_id); + "Polling for VF%u mailbox ack timedout", mbx_id); + return IXGBE_ERR_TIMEOUT; + } -out: - return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; + return IXGBE_SUCCESS; } /** - * ixgbe_read_posted_mbx - Wait for message notification and receive message + * ixgbe_read_mailbox_vf - read VF's mailbox register * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully received a message notification and - * copied it into the receive buffer. + * This function is used to read the mailbox register dedicated for VF without + * losing the read to clear status bits. **/ -s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; - - DEBUGFUNC("ixgbe_read_posted_mbx"); - - if (!mbx->ops.read) - goto out; + u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); - ret_val = ixgbe_poll_for_msg(hw, mbx_id); + vf_mailbox |= hw->mbx.vf_mailbox; + hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; - /* if ack received read message, otherwise we timed out */ - if (!ret_val) - ret_val = mbx->ops.read(hw, msg, size, mbx_id); -out: - return ret_val; + return vf_mailbox; } -/** - * ixgbe_write_posted_mbx - Write a message to the mailbox, wait for ack - * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to write - * - * returns SUCCESS if it successfully copied message into the buffer and - * received an ack to that message within delay * timeout period - **/ -s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static void ixgbe_clear_msg_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; - - DEBUGFUNC("ixgbe_write_posted_mbx"); - - /* exit if either we can't write or there isn't a defined timeout */ - if (!mbx->ops.write || !mbx->timeout) - goto out; - - /* send msg */ - ret_val = mbx->ops.write(hw, msg, size, mbx_id); + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - /* if msg sent wait until we receive an ack */ - if (!ret_val) - ret_val = ixgbe_poll_for_ack(hw, mbx_id); -out: - return ret_val; + if (vf_mailbox & IXGBE_VFMAILBOX_PFSTS) { + hw->mbx.stats.reqs++; + hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFSTS; + } } -/** - * ixgbe_init_mbx_ops_generic - Initialize MB function pointers - * @hw: pointer to the HW structure - * - * Setups up the mailbox read and write message function pointers - **/ -void ixgbe_init_mbx_ops_generic(struct ixgbe_hw *hw) +static void ixgbe_clear_ack_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - mbx->ops.read_posted = ixgbe_read_posted_mbx; - mbx->ops.write_posted = ixgbe_write_posted_mbx; + if (vf_mailbox & IXGBE_VFMAILBOX_PFACK) { + hw->mbx.stats.acks++; + hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFACK; + } } -/** - * ixgbe_read_v2p_mailbox - read v2p mailbox - * @hw: pointer to the HW structure - * - * This function is used to read the v2p mailbox without losing the read to - * clear status bits. - **/ -static u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw) +static void ixgbe_clear_rst_vf(struct ixgbe_hw *hw) { - u32 v2p_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); - - v2p_mailbox |= hw->mbx.v2p_mailbox; - hw->mbx.v2p_mailbox |= v2p_mailbox & IXGBE_VFMAILBOX_R2C_BITS; + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - return v2p_mailbox; + if (vf_mailbox & (IXGBE_VFMAILBOX_RSTI | IXGBE_VFMAILBOX_RSTD)) { + hw->mbx.stats.rsts++; + hw->mbx.vf_mailbox &= ~(IXGBE_VFMAILBOX_RSTI | + IXGBE_VFMAILBOX_RSTD); + } } /** @@ -314,15 +323,12 @@ static u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw) **/ static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) { - u32 v2p_mailbox = ixgbe_read_v2p_mailbox(hw); - s32 ret_val = IXGBE_ERR_MBX; + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - if (v2p_mailbox & mask) - ret_val = IXGBE_SUCCESS; + if (vf_mailbox & mask) + return IXGBE_SUCCESS; - hw->mbx.v2p_mailbox &= ~mask; - - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -334,17 +340,13 @@ static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) **/ static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id) { - s32 ret_val = IXGBE_ERR_MBX; - UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_msg_vf"); - if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.reqs++; - } + if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) + return IXGBE_SUCCESS; - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -356,17 +358,16 @@ static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id) { - s32 ret_val = IXGBE_ERR_MBX; - UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_ack_vf"); if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.acks++; + /* TODO: should this be autocleared? */ + ixgbe_clear_ack_vf(hw); + return IXGBE_SUCCESS; } - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -378,18 +379,17 @@ static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id) { - s32 ret_val = IXGBE_ERR_MBX; - UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_rst_vf"); - if (!ixgbe_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD | - IXGBE_VFMAILBOX_RSTI))) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.rsts++; + if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_RSTI | + IXGBE_VFMAILBOX_RSTD)) { + /* TODO: should this be autocleared? */ + ixgbe_clear_rst_vf(hw); + return IXGBE_SUCCESS; } - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -400,20 +400,114 @@ static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) { + struct ixgbe_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; s32 ret_val = IXGBE_ERR_MBX; + u32 vf_mailbox; DEBUGFUNC("ixgbe_obtain_mbx_lock_vf"); - /* Take ownership of the buffer */ - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); + if (!mbx->timeout) + return IXGBE_ERR_CONFIG; - /* reserve mailbox for vf use */ - if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) - ret_val = IXGBE_SUCCESS; + while (countdown--) { + /* Reserve mailbox for VF use */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox |= IXGBE_VFMAILBOX_VFU; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); + + /* Verify that VF is the owner of the lock */ + if (ixgbe_read_mailbox_vf(hw) & IXGBE_VFMAILBOX_VFU) { + ret_val = IXGBE_SUCCESS; + break; + } + + /* Wait a bit before trying again */ + usec_delay(mbx->usec_delay); + } + + if (ret_val != IXGBE_SUCCESS) { + ERROR_REPORT1(IXGBE_ERROR_INVALID_STATE, + "Failed to obtain mailbox lock"); + ret_val = IXGBE_ERR_TIMEOUT; + } return ret_val; } +/** + * ixgbe_release_mbx_lock_dummy - release mailbox lock + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read + **/ +static void ixgbe_release_mbx_lock_dummy(struct ixgbe_hw *hw, u16 mbx_id) +{ + UNREFERENCED_2PARAMETER(hw, mbx_id); + + DEBUGFUNC("ixgbe_release_mbx_lock_dummy"); +} + +/** + * ixgbe_release_mbx_lock_vf - release mailbox lock + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read + **/ +static void ixgbe_release_mbx_lock_vf(struct ixgbe_hw *hw, u16 mbx_id) +{ + u32 vf_mailbox; + + UNREFERENCED_1PARAMETER(mbx_id); + + DEBUGFUNC("ixgbe_release_mbx_lock_vf"); + + /* Return ownership of the buffer */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox &= ~IXGBE_VFMAILBOX_VFU; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); +} + +/** + * ixgbe_write_mbx_vf_legacy - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +static s32 ixgbe_write_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val; + u16 i; + + UNREFERENCED_1PARAMETER(mbx_id); + DEBUGFUNC("ixgbe_write_mbx_vf_legacy"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = ixgbe_obtain_mbx_lock_vf(hw); + if (ret_val) + return ret_val; + + /* flush msg and acks as we are overwriting the message buffer */ + ixgbe_check_for_msg_vf(hw, 0); + ixgbe_clear_msg_vf(hw); + ixgbe_check_for_ack_vf(hw, 0); + ixgbe_clear_ack_vf(hw); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + + /* interrupt the PF to tell it a message has been sent */ + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); + + return IXGBE_SUCCESS; +} + /** * ixgbe_write_mbx_vf - Write a message to the mailbox * @hw: pointer to the HW structure @@ -426,6 +520,7 @@ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { + u32 vf_mailbox; s32 ret_val; u16 i; @@ -436,11 +531,11 @@ static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* lock the mailbox to prevent pf/vf race condition */ ret_val = ixgbe_obtain_mbx_lock_vf(hw); if (ret_val) - goto out_no_write; + goto out; /* flush msg and acks as we are overwriting the message buffer */ - ixgbe_check_for_msg_vf(hw, 0); - ixgbe_check_for_ack_vf(hw, 0); + ixgbe_clear_msg_vf(hw); + ixgbe_clear_ack_vf(hw); /* copy the caller specified message to the mailbox memory buffer */ for (i = 0; i < size; i++) @@ -449,15 +544,22 @@ static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* update stats */ hw->mbx.stats.msgs_tx++; - /* Drop VFU and interrupt the PF to tell it a message has been sent */ - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); + /* interrupt the PF to tell it a message has been sent */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox |= IXGBE_VFMAILBOX_REQ; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); + + /* if msg sent wait until we receive an ack */ + ixgbe_poll_for_ack(hw, mbx_id); + +out: + hw->mbx.ops[mbx_id].release(hw, mbx_id); -out_no_write: return ret_val; } /** - * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf + * ixgbe_read_mbx_vf_legacy - Reads a message from the inbox intended for vf * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer @@ -465,19 +567,19 @@ out_no_write: * * returns SUCCESS if it successfully read message from buffer **/ -static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static s32 ixgbe_read_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) { - s32 ret_val = IXGBE_SUCCESS; + s32 ret_val; u16 i; - DEBUGFUNC("ixgbe_read_mbx_vf"); + DEBUGFUNC("ixgbe_read_mbx_vf_legacy"); UNREFERENCED_1PARAMETER(mbx_id); /* lock the mailbox to prevent pf/vf race condition */ ret_val = ixgbe_obtain_mbx_lock_vf(hw); if (ret_val) - goto out_no_read; + return ret_val; /* copy the message from the mailbox memory buffer */ for (i = 0; i < size; i++) @@ -489,34 +591,73 @@ static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* update stats */ hw->mbx.stats.msgs_rx++; -out_no_read: - return ret_val; + return IXGBE_SUCCESS; +} + +/** + * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfully read message from buffer + **/ +static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + u32 vf_mailbox; + s32 ret_val; + u16 i; + + DEBUGFUNC("ixgbe_read_mbx_vf"); + UNREFERENCED_1PARAMETER(mbx_id); + + /* check if there is a message from PF */ + ret_val = ixgbe_check_for_msg_vf(hw, 0); + if (ret_val != IXGBE_SUCCESS) + return IXGBE_ERR_MBX_NOMSG; + + ixgbe_clear_msg_vf(hw); + + /* copy the message from the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i); + + /* Acknowledge receipt */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox |= IXGBE_VFMAILBOX_ACK; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + + return IXGBE_SUCCESS; } /** * ixgbe_init_mbx_params_vf - set initial values for vf mailbox * @hw: pointer to the HW structure * - * Initializes the hw->mbx struct to correct values for vf mailbox + * Initializes single set the hw->mbx struct to correct values for vf mailbox + * Set of legacy functions is being used here */ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) { struct ixgbe_mbx_info *mbx = &hw->mbx; - /* start mailbox as timed out and let the reset_hw call set the timeout - * value to begin communications */ - mbx->timeout = 0; + mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY; mbx->size = IXGBE_VFMAILBOX_SIZE; - mbx->ops.read = ixgbe_read_mbx_vf; - mbx->ops.write = ixgbe_write_mbx_vf; - mbx->ops.read_posted = ixgbe_read_posted_mbx; - mbx->ops.write_posted = ixgbe_write_posted_mbx; - mbx->ops.check_for_msg = ixgbe_check_for_msg_vf; - mbx->ops.check_for_ack = ixgbe_check_for_ack_vf; - mbx->ops.check_for_rst = ixgbe_check_for_rst_vf; + /* VF has only one mailbox connection, no need for more IDs */ + mbx->ops[0].release = ixgbe_release_mbx_lock_dummy; + mbx->ops[0].read = ixgbe_read_mbx_vf_legacy; + mbx->ops[0].write = ixgbe_write_mbx_vf_legacy; + mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; + mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; + mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; @@ -525,54 +666,110 @@ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) mbx->stats.rsts = 0; } +/** + * ixgbe_upgrade_mbx_params_vf - set initial values for vf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for vf mailbox + */ +void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + + mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; + mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY; + + mbx->size = IXGBE_VFMAILBOX_SIZE; + + /* VF has only one mailbox connection, no need for more IDs */ + mbx->ops[0].release = ixgbe_release_mbx_lock_vf; + mbx->ops[0].read = ixgbe_read_mbx_vf; + mbx->ops[0].write = ixgbe_write_mbx_vf; + mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; + mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; + mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; + mbx->ops[0].clear = NULL; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; +} + +static void ixgbe_clear_msg_pf(struct ixgbe_hw *hw, u16 vf_id) +{ + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); + u32 pfmbicr; + + pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); + + if (pfmbicr & (IXGBE_PFMBICR_VFREQ_VF1 << vf_shift)) + hw->mbx.stats.reqs++; + + IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), + IXGBE_PFMBICR_VFREQ_VF1 << vf_shift); +} + +static void ixgbe_clear_ack_pf(struct ixgbe_hw *hw, u16 vf_id) +{ + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); + u32 pfmbicr; + + pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); + + if (pfmbicr & (IXGBE_PFMBICR_VFACK_VF1 << vf_shift)) + hw->mbx.stats.acks++; + + IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), + IXGBE_PFMBICR_VFACK_VF1 << vf_shift); +} + static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) { u32 pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); - s32 ret_val = IXGBE_ERR_MBX; if (pfmbicr & mask) { - ret_val = IXGBE_SUCCESS; - IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), mask); + return IXGBE_SUCCESS; } - return ret_val; + return IXGBE_ERR_MBX; } /** * ixgbe_check_for_msg_pf - checks to see if the VF has sent mail * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_id) { - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); - s32 index = IXGBE_PFMBICR_INDEX(vf_number); - s32 ret_val = IXGBE_ERR_MBX; + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); DEBUGFUNC("ixgbe_check_for_msg_pf"); if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFREQ_VF1 << vf_shift, - index)) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.reqs++; - } + index)) + return IXGBE_SUCCESS; - return ret_val; + return IXGBE_ERR_MBX; } /** * ixgbe_check_for_ack_pf - checks to see if the VF has ACKed * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_id) { - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); - s32 index = IXGBE_PFMBICR_INDEX(vf_number); + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_ack_pf"); @@ -580,7 +777,8 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFACK_VF1 << vf_shift, index)) { ret_val = IXGBE_SUCCESS; - hw->mbx.stats.acks++; + /* TODO: should this be autocleared? */ + ixgbe_clear_ack_pf(hw, vf_id); } return ret_val; @@ -589,14 +787,14 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) /** * ixgbe_check_for_rst_pf - checks to see if the VF has reset * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_id) { - u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_number); - u32 index = IXGBE_PFVFLRE_INDEX(vf_number); + u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_id); + u32 index = IXGBE_PFVFLRE_INDEX(vf_id); s32 ret_val = IXGBE_ERR_MBX; u32 vflre = 0; @@ -628,121 +826,268 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) /** * ixgbe_obtain_mbx_lock_pf - obtain mailbox lock * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * return SUCCESS if we obtained the mailbox lock **/ -static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_id) { + struct ixgbe_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; s32 ret_val = IXGBE_ERR_MBX; - u32 p2v_mailbox; + u32 pf_mailbox; DEBUGFUNC("ixgbe_obtain_mbx_lock_pf"); *** 576 LINES SKIPPED *** From nobody Fri Sep 20 02:18:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8wzz1nbZz5WPhW; Fri, 20 Sep 2024 02:18: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 4X8wzz0vyFz48tx; Fri, 20 Sep 2024 02:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726798735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mJMpcZ7ToE1An1cN2tCpbfpaVWFjXYa3DdadKPVayxY=; b=lzTpMh4Q5mtigshiY8LMePs8x8fzcIBcr9wDorEHN3Nsw+gFMq9IEk7CRUrENp2proINGs jOqD8E5vc5sWSTrLh2oyOkEo33ghxpAv/kAactOtNP6uSSqu2Sopl5oHN4Tm2Fj08DXxIt tS1VC4ttRmcIyCecIlOG8SzXU9kRLCtyPpCjqU081TnxdRVVJdcUy6T0UfEINOp8OGuCRW hctSgaZgFdOVLnsZjYr9nGznvGZQ3UBDcT3tZe7qPzkHG9P2/2ezRF94wjUSxbS5sCKQ2u rGzQrDmv4LlcstoIAYnYNcE5uLCqg4xCvw6RWCIjx2G1ADLHP/PT0f/T4OGRBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726798735; a=rsa-sha256; cv=none; b=ho6AzWzhEW0Yw81Wri+hRHIJQFqizxH/BvMj2yqw/klLXw4079IYoK9A4YNerq/Wik3AqT Iy96kuHTd1t9cviPFvU3la4ooa6QzHMHLfD6/46p1wp48kncDjvtNg5mi9sw+rgVJRxFQ+ QqiLSK5AMvofOOP4HLDvtzxiDCUexgwq/+NDBGBXmioFUtEA5jvO+U4yFurnfA3j79cQlA TRNLlw1DY+tLxE0VP0q8beGzh6WZXC6+kshc4ZVWXDcoflf5gEowbZ6TnQGHe8F9SN5qGf doO1MgIjOO0ehirlaE1+hS5E+pBZ/dezj/rCoqMr1KbSmhrC9MFbCoJx4ynLXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726798735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mJMpcZ7ToE1An1cN2tCpbfpaVWFjXYa3DdadKPVayxY=; b=tJgtRxZhIc9xt/kSkp7q/lj/Tk3INs9OAJ7PlNemKVntddgFtdwdkLEULCdfJL0oJoMZdq Aiqz24ofi09V+VM+P3xnFQ6UJoEbBoeJPL0te54gWosIW82I/6jrx9mMHLwoEldZTeB+Zh 6Jl+BjpRWiGWcVQMKNejDkNTziJXDElHymI6JURuUNzKY5jMbcXJt/hnS4ksqIMFJNE1qG WzWz0kP2/s/W8JUYwAKMfjEG8ikDcCwzyj8+dxrYnGwMjFequAoIfHvCcd2wf+wOipZxjF mMHb1ekbtpAzg8q3EPp8/JZWgG+1WSjNvpPigxr//Pck/pS/yFjkaiQl38ITZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8wzz0WWvzX5L; Fri, 20 Sep 2024 02:18: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 48K2It2D048591; Fri, 20 Sep 2024 02:18:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K2It2I048588; Fri, 20 Sep 2024 02:18:55 GMT (envelope-from git) Date: Fri, 20 Sep 2024 02:18:55 GMT Message-Id: <202409200218.48K2It2I048588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: d80c12ba682a - main - Revert "ixgbe: introduce new mailbox API" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d80c12ba682a6f23791f3d6e657f9e603b152aa2 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=d80c12ba682a6f23791f3d6e657f9e603b152aa2 commit d80c12ba682a6f23791f3d6e657f9e603b152aa2 Author: Kevin Bowling AuthorDate: 2024-09-20 02:18:25 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 02:18:25 +0000 Revert "ixgbe: introduce new mailbox API" This is missing the ixgbe_mbx.h changes, revert so it can be committed atomically. This reverts commit 68ba3eabd4869577bf11c03a6ec6f472502be07d. --- sys/dev/ixgbe/if_ix.c | 7 +- sys/dev/ixgbe/ixgbe_82599.c | 4 +- sys/dev/ixgbe/ixgbe_mbx.c | 839 ++++++++++++-------------------------------- sys/dev/ixgbe/ixgbe_type.h | 32 +- sys/dev/ixgbe/ixgbe_vf.c | 42 +-- sys/dev/ixgbe/ixgbe_x540.c | 4 +- 6 files changed, 278 insertions(+), 650 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index ed41f6b66e09..17f1f73a526e 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -879,7 +879,6 @@ ixgbe_if_attach_pre(if_ctx_t ctx) struct ixgbe_hw *hw; int error = 0; u32 ctrl_ext; - size_t i; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -929,10 +928,8 @@ ixgbe_if_attach_pre(if_ctx_t ctx) goto err_pci; } - if (hw->mbx.ops[0].init_params) { - for (i = 0; i < sc->num_vfs; i++) - hw->mbx.ops[i].init_params(hw); - } + if (hw->mbx.ops.init_params) + hw->mbx.ops.init_params(hw); hw->allow_unsupported_sfp = allow_unsupported_sfp; diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 70b4cdc5c6ca..8c3df0fd4f59 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -324,7 +324,6 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) struct ixgbe_phy_info *phy = &hw->phy; struct ixgbe_eeprom_info *eeprom = &hw->eeprom; s32 ret_val; - u16 i; DEBUGFUNC("ixgbe_init_ops_82599"); @@ -386,8 +385,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) mac->arc_subsystem_valid = !!(IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)) & IXGBE_FWSM_MODE_MASK); - for (i = 0; i < 64; i++) - hw->mbx.ops[i].init_params = ixgbe_init_mbx_params_pf; + hw->mbx.ops.init_params = ixgbe_init_mbx_params_pf; /* EEPROM */ eeprom->ops.read = ixgbe_read_eeprom_82599; diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 0a0c5abde157..c8f839fce85a 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -35,9 +35,6 @@ #include "ixgbe_type.h" #include "ixgbe_mbx.h" -static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id); -static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id); - /** * ixgbe_read_mbx - Reads a message from the mailbox * @hw: pointer to the HW structure @@ -50,91 +47,42 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id); s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_read_mbx"); /* limit read to size of mailbox */ - if (size > mbx->size) { - ERROR_REPORT3(IXGBE_ERROR_ARGUMENT, - "Invalid mailbox message size %u, changing to %u", - size, mbx->size); - size = mbx->size; - } - - if (mbx->ops[mbx_id].read) - return mbx->ops[mbx_id].read(hw, msg, size, mbx_id); - - return IXGBE_ERR_CONFIG; -} - -/** - * ixgbe_poll_mbx - Wait for message and read it from the mailbox - * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to read - * - * returns SUCCESS if it successfully read message from buffer - **/ -s32 ixgbe_poll_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) -{ - struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val; - - DEBUGFUNC("ixgbe_poll_mbx"); - - if (!mbx->ops[mbx_id].read || !mbx->ops[mbx_id].check_for_msg || - !mbx->timeout) - return IXGBE_ERR_CONFIG; - - /* limit read to size of mailbox */ - if (size > mbx->size) { - ERROR_REPORT3(IXGBE_ERROR_ARGUMENT, - "Invalid mailbox message size %u, changing to %u", - size, mbx->size); + if (size > mbx->size) size = mbx->size; - } - ret_val = ixgbe_poll_for_msg(hw, mbx_id); - /* if ack received read message, otherwise we timed out */ - if (!ret_val) - return mbx->ops[mbx_id].read(hw, msg, size, mbx_id); + if (mbx->ops.read) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); return ret_val; } /** - * ixgbe_write_mbx - Write a message to the mailbox and wait for ACK + * ixgbe_write_mbx - Write a message to the mailbox * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully copied message into the buffer and - * received an ACK to that message within specified period + * returns SUCCESS if it successfully copied message into the buffer **/ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_SUCCESS; DEBUGFUNC("ixgbe_write_mbx"); - /* - * exit if either we can't write, release - * or there is no timeout defined - */ - if (!mbx->ops[mbx_id].write || !mbx->ops[mbx_id].check_for_ack || - !mbx->ops[mbx_id].release || !mbx->timeout) - return IXGBE_ERR_CONFIG; - if (size > mbx->size) { - ret_val = IXGBE_ERR_PARAM; + ret_val = IXGBE_ERR_MBX; ERROR_REPORT2(IXGBE_ERROR_ARGUMENT, - "Invalid mailbox message size %u", size); - } else { - ret_val = mbx->ops[mbx_id].write(hw, msg, size, mbx_id); - } + "Invalid mailbox message size %d", size); + } else if (mbx->ops.write) + ret_val = mbx->ops.write(hw, msg, size, mbx_id); return ret_val; } @@ -149,12 +97,12 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_CONFIG; + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_msg"); - if (mbx->ops[mbx_id].check_for_msg) - ret_val = mbx->ops[mbx_id].check_for_msg(hw, mbx_id); + if (mbx->ops.check_for_msg) + ret_val = mbx->ops.check_for_msg(hw, mbx_id); return ret_val; } @@ -169,12 +117,12 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_CONFIG; + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_ack"); - if (mbx->ops[mbx_id].check_for_ack) - ret_val = mbx->ops[mbx_id].check_for_ack(hw, mbx_id); + if (mbx->ops.check_for_ack) + ret_val = mbx->ops.check_for_ack(hw, mbx_id); return ret_val; } @@ -189,12 +137,12 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_CONFIG; + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_rst"); - if (mbx->ops[mbx_id].check_for_rst) - ret_val = mbx->ops[mbx_id].check_for_rst(hw, mbx_id); + if (mbx->ops.check_for_rst) + ret_val = mbx->ops.check_for_rst(hw, mbx_id); return ret_val; } @@ -213,23 +161,22 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id) DEBUGFUNC("ixgbe_poll_for_msg"); - if (!countdown || !mbx->ops[mbx_id].check_for_msg) - return IXGBE_ERR_CONFIG; + if (!countdown || !mbx->ops.check_for_msg) + goto out; - while (countdown && mbx->ops[mbx_id].check_for_msg(hw, mbx_id)) { + while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) { countdown--; if (!countdown) break; usec_delay(mbx->usec_delay); } - if (countdown == 0) { + if (countdown == 0) ERROR_REPORT2(IXGBE_ERROR_POLLING, - "Polling for VF%u mailbox message timedout", mbx_id); - return IXGBE_ERR_TIMEOUT; - } + "Polling for VF%d mailbox message timedout", mbx_id); - return IXGBE_SUCCESS; +out: + return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; } /** @@ -246,71 +193,115 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) DEBUGFUNC("ixgbe_poll_for_ack"); - if (!countdown || !mbx->ops[mbx_id].check_for_ack) - return IXGBE_ERR_CONFIG; + if (!countdown || !mbx->ops.check_for_ack) + goto out; - while (countdown && mbx->ops[mbx_id].check_for_ack(hw, mbx_id)) { + while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) { countdown--; if (!countdown) break; usec_delay(mbx->usec_delay); } - if (countdown == 0) { + if (countdown == 0) ERROR_REPORT2(IXGBE_ERROR_POLLING, - "Polling for VF%u mailbox ack timedout", mbx_id); - return IXGBE_ERR_TIMEOUT; - } + "Polling for VF%d mailbox ack timedout", mbx_id); - return IXGBE_SUCCESS; +out: + return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; } /** - * ixgbe_read_mailbox_vf - read VF's mailbox register + * ixgbe_read_posted_mbx - Wait for message notification and receive message * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write * - * This function is used to read the mailbox register dedicated for VF without - * losing the read to clear status bits. + * returns SUCCESS if it successfully received a message notification and + * copied it into the receive buffer. **/ -static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) +s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) { - u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; + + DEBUGFUNC("ixgbe_read_posted_mbx"); + + if (!mbx->ops.read) + goto out; - vf_mailbox |= hw->mbx.vf_mailbox; - hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; + ret_val = ixgbe_poll_for_msg(hw, mbx_id); - return vf_mailbox; + /* if ack received read message, otherwise we timed out */ + if (!ret_val) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); +out: + return ret_val; } -static void ixgbe_clear_msg_vf(struct ixgbe_hw *hw) +/** + * ixgbe_write_posted_mbx - Write a message to the mailbox, wait for ack + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer and + * received an ack to that message within delay * timeout period + **/ +s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) { - u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; - if (vf_mailbox & IXGBE_VFMAILBOX_PFSTS) { - hw->mbx.stats.reqs++; - hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFSTS; - } + DEBUGFUNC("ixgbe_write_posted_mbx"); + + /* exit if either we can't write or there isn't a defined timeout */ + if (!mbx->ops.write || !mbx->timeout) + goto out; + + /* send msg */ + ret_val = mbx->ops.write(hw, msg, size, mbx_id); + + /* if msg sent wait until we receive an ack */ + if (!ret_val) + ret_val = ixgbe_poll_for_ack(hw, mbx_id); +out: + return ret_val; } -static void ixgbe_clear_ack_vf(struct ixgbe_hw *hw) +/** + * ixgbe_init_mbx_ops_generic - Initialize MB function pointers + * @hw: pointer to the HW structure + * + * Setups up the mailbox read and write message function pointers + **/ +void ixgbe_init_mbx_ops_generic(struct ixgbe_hw *hw) { - u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); + struct ixgbe_mbx_info *mbx = &hw->mbx; - if (vf_mailbox & IXGBE_VFMAILBOX_PFACK) { - hw->mbx.stats.acks++; - hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFACK; - } + mbx->ops.read_posted = ixgbe_read_posted_mbx; + mbx->ops.write_posted = ixgbe_write_posted_mbx; } -static void ixgbe_clear_rst_vf(struct ixgbe_hw *hw) +/** + * ixgbe_read_v2p_mailbox - read v2p mailbox + * @hw: pointer to the HW structure + * + * This function is used to read the v2p mailbox without losing the read to + * clear status bits. + **/ +static u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw) { - u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); + u32 v2p_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); - if (vf_mailbox & (IXGBE_VFMAILBOX_RSTI | IXGBE_VFMAILBOX_RSTD)) { - hw->mbx.stats.rsts++; - hw->mbx.vf_mailbox &= ~(IXGBE_VFMAILBOX_RSTI | - IXGBE_VFMAILBOX_RSTD); - } + v2p_mailbox |= hw->mbx.v2p_mailbox; + hw->mbx.v2p_mailbox |= v2p_mailbox & IXGBE_VFMAILBOX_R2C_BITS; + + return v2p_mailbox; } /** @@ -323,12 +314,15 @@ static void ixgbe_clear_rst_vf(struct ixgbe_hw *hw) **/ static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) { - u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); + u32 v2p_mailbox = ixgbe_read_v2p_mailbox(hw); + s32 ret_val = IXGBE_ERR_MBX; - if (vf_mailbox & mask) - return IXGBE_SUCCESS; + if (v2p_mailbox & mask) + ret_val = IXGBE_SUCCESS; - return IXGBE_ERR_MBX; + hw->mbx.v2p_mailbox &= ~mask; + + return ret_val; } /** @@ -340,13 +334,17 @@ static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) **/ static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id) { + s32 ret_val = IXGBE_ERR_MBX; + UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_msg_vf"); - if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) - return IXGBE_SUCCESS; + if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) { + ret_val = IXGBE_SUCCESS; + hw->mbx.stats.reqs++; + } - return IXGBE_ERR_MBX; + return ret_val; } /** @@ -358,16 +356,17 @@ static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id) { + s32 ret_val = IXGBE_ERR_MBX; + UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_ack_vf"); if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) { - /* TODO: should this be autocleared? */ - ixgbe_clear_ack_vf(hw); - return IXGBE_SUCCESS; + ret_val = IXGBE_SUCCESS; + hw->mbx.stats.acks++; } - return IXGBE_ERR_MBX; + return ret_val; } /** @@ -379,17 +378,18 @@ static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id) { + s32 ret_val = IXGBE_ERR_MBX; + UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_rst_vf"); - if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_RSTI | - IXGBE_VFMAILBOX_RSTD)) { - /* TODO: should this be autocleared? */ - ixgbe_clear_rst_vf(hw); - return IXGBE_SUCCESS; + if (!ixgbe_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD | + IXGBE_VFMAILBOX_RSTI))) { + ret_val = IXGBE_SUCCESS; + hw->mbx.stats.rsts++; } - return IXGBE_ERR_MBX; + return ret_val; } /** @@ -400,114 +400,20 @@ static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; - int countdown = mbx->timeout; s32 ret_val = IXGBE_ERR_MBX; - u32 vf_mailbox; DEBUGFUNC("ixgbe_obtain_mbx_lock_vf"); - if (!mbx->timeout) - return IXGBE_ERR_CONFIG; - - while (countdown--) { - /* Reserve mailbox for VF use */ - vf_mailbox = ixgbe_read_mailbox_vf(hw); - vf_mailbox |= IXGBE_VFMAILBOX_VFU; - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); - - /* Verify that VF is the owner of the lock */ - if (ixgbe_read_mailbox_vf(hw) & IXGBE_VFMAILBOX_VFU) { - ret_val = IXGBE_SUCCESS; - break; - } - - /* Wait a bit before trying again */ - usec_delay(mbx->usec_delay); - } + /* Take ownership of the buffer */ + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); - if (ret_val != IXGBE_SUCCESS) { - ERROR_REPORT1(IXGBE_ERROR_INVALID_STATE, - "Failed to obtain mailbox lock"); - ret_val = IXGBE_ERR_TIMEOUT; - } + /* reserve mailbox for vf use */ + if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) + ret_val = IXGBE_SUCCESS; return ret_val; } -/** - * ixgbe_release_mbx_lock_dummy - release mailbox lock - * @hw: pointer to the HW structure - * @mbx_id: id of mailbox to read - **/ -static void ixgbe_release_mbx_lock_dummy(struct ixgbe_hw *hw, u16 mbx_id) -{ - UNREFERENCED_2PARAMETER(hw, mbx_id); - - DEBUGFUNC("ixgbe_release_mbx_lock_dummy"); -} - -/** - * ixgbe_release_mbx_lock_vf - release mailbox lock - * @hw: pointer to the HW structure - * @mbx_id: id of mailbox to read - **/ -static void ixgbe_release_mbx_lock_vf(struct ixgbe_hw *hw, u16 mbx_id) -{ - u32 vf_mailbox; - - UNREFERENCED_1PARAMETER(mbx_id); - - DEBUGFUNC("ixgbe_release_mbx_lock_vf"); - - /* Return ownership of the buffer */ - vf_mailbox = ixgbe_read_mailbox_vf(hw); - vf_mailbox &= ~IXGBE_VFMAILBOX_VFU; - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); -} - -/** - * ixgbe_write_mbx_vf_legacy - Write a message to the mailbox - * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to write - * - * returns SUCCESS if it successfully copied message into the buffer - **/ -static s32 ixgbe_write_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) -{ - s32 ret_val; - u16 i; - - UNREFERENCED_1PARAMETER(mbx_id); - DEBUGFUNC("ixgbe_write_mbx_vf_legacy"); - - /* lock the mailbox to prevent pf/vf race condition */ - ret_val = ixgbe_obtain_mbx_lock_vf(hw); - if (ret_val) - return ret_val; - - /* flush msg and acks as we are overwriting the message buffer */ - ixgbe_check_for_msg_vf(hw, 0); - ixgbe_clear_msg_vf(hw); - ixgbe_check_for_ack_vf(hw, 0); - ixgbe_clear_ack_vf(hw); - - /* copy the caller specified message to the mailbox memory buffer */ - for (i = 0; i < size; i++) - IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]); - - /* update stats */ - hw->mbx.stats.msgs_tx++; - - /* interrupt the PF to tell it a message has been sent */ - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); - - return IXGBE_SUCCESS; -} - /** * ixgbe_write_mbx_vf - Write a message to the mailbox * @hw: pointer to the HW structure @@ -520,7 +426,6 @@ static s32 ixgbe_write_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { - u32 vf_mailbox; s32 ret_val; u16 i; @@ -531,11 +436,11 @@ static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* lock the mailbox to prevent pf/vf race condition */ ret_val = ixgbe_obtain_mbx_lock_vf(hw); if (ret_val) - goto out; + goto out_no_write; /* flush msg and acks as we are overwriting the message buffer */ - ixgbe_clear_msg_vf(hw); - ixgbe_clear_ack_vf(hw); + ixgbe_check_for_msg_vf(hw, 0); + ixgbe_check_for_ack_vf(hw, 0); /* copy the caller specified message to the mailbox memory buffer */ for (i = 0; i < size; i++) @@ -544,22 +449,15 @@ static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* update stats */ hw->mbx.stats.msgs_tx++; - /* interrupt the PF to tell it a message has been sent */ - vf_mailbox = ixgbe_read_mailbox_vf(hw); - vf_mailbox |= IXGBE_VFMAILBOX_REQ; - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); - - /* if msg sent wait until we receive an ack */ - ixgbe_poll_for_ack(hw, mbx_id); - -out: - hw->mbx.ops[mbx_id].release(hw, mbx_id); + /* Drop VFU and interrupt the PF to tell it a message has been sent */ + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); +out_no_write: return ret_val; } /** - * ixgbe_read_mbx_vf_legacy - Reads a message from the inbox intended for vf + * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer @@ -567,19 +465,19 @@ out: * * returns SUCCESS if it successfully read message from buffer **/ -static s32 ixgbe_read_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) { - s32 ret_val; + s32 ret_val = IXGBE_SUCCESS; u16 i; - DEBUGFUNC("ixgbe_read_mbx_vf_legacy"); + DEBUGFUNC("ixgbe_read_mbx_vf"); UNREFERENCED_1PARAMETER(mbx_id); /* lock the mailbox to prevent pf/vf race condition */ ret_val = ixgbe_obtain_mbx_lock_vf(hw); if (ret_val) - return ret_val; + goto out_no_read; /* copy the message from the mailbox memory buffer */ for (i = 0; i < size; i++) @@ -591,104 +489,34 @@ static s32 ixgbe_read_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, /* update stats */ hw->mbx.stats.msgs_rx++; - return IXGBE_SUCCESS; -} - -/** - * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf - * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to read - * - * returns SUCCESS if it successfully read message from buffer - **/ -static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) -{ - u32 vf_mailbox; - s32 ret_val; - u16 i; - - DEBUGFUNC("ixgbe_read_mbx_vf"); - UNREFERENCED_1PARAMETER(mbx_id); - - /* check if there is a message from PF */ - ret_val = ixgbe_check_for_msg_vf(hw, 0); - if (ret_val != IXGBE_SUCCESS) - return IXGBE_ERR_MBX_NOMSG; - - ixgbe_clear_msg_vf(hw); - - /* copy the message from the mailbox memory buffer */ - for (i = 0; i < size; i++) - msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i); - - /* Acknowledge receipt */ - vf_mailbox = ixgbe_read_mailbox_vf(hw); - vf_mailbox |= IXGBE_VFMAILBOX_ACK; - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); - - /* update stats */ - hw->mbx.stats.msgs_rx++; - - return IXGBE_SUCCESS; +out_no_read: + return ret_val; } /** * ixgbe_init_mbx_params_vf - set initial values for vf mailbox * @hw: pointer to the HW structure * - * Initializes single set the hw->mbx struct to correct values for vf mailbox - * Set of legacy functions is being used here - */ -void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) -{ - struct ixgbe_mbx_info *mbx = &hw->mbx; - - mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; - mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY; - - mbx->size = IXGBE_VFMAILBOX_SIZE; - - /* VF has only one mailbox connection, no need for more IDs */ - mbx->ops[0].release = ixgbe_release_mbx_lock_dummy; - mbx->ops[0].read = ixgbe_read_mbx_vf_legacy; - mbx->ops[0].write = ixgbe_write_mbx_vf_legacy; - mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; - mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; - mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; - - mbx->stats.msgs_tx = 0; - mbx->stats.msgs_rx = 0; - mbx->stats.reqs = 0; - mbx->stats.acks = 0; - mbx->stats.rsts = 0; -} - -/** - * ixgbe_upgrade_mbx_params_vf - set initial values for vf mailbox - * @hw: pointer to the HW structure - * * Initializes the hw->mbx struct to correct values for vf mailbox */ -void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw) +void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) { struct ixgbe_mbx_info *mbx = &hw->mbx; - mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; + /* start mailbox as timed out and let the reset_hw call set the timeout + * value to begin communications */ + mbx->timeout = 0; mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY; mbx->size = IXGBE_VFMAILBOX_SIZE; - /* VF has only one mailbox connection, no need for more IDs */ - mbx->ops[0].release = ixgbe_release_mbx_lock_vf; - mbx->ops[0].read = ixgbe_read_mbx_vf; - mbx->ops[0].write = ixgbe_write_mbx_vf; - mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; - mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; - mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; - mbx->ops[0].clear = NULL; + mbx->ops.read = ixgbe_read_mbx_vf; + mbx->ops.write = ixgbe_write_mbx_vf; + mbx->ops.read_posted = ixgbe_read_posted_mbx; + mbx->ops.write_posted = ixgbe_write_posted_mbx; + mbx->ops.check_for_msg = ixgbe_check_for_msg_vf; + mbx->ops.check_for_ack = ixgbe_check_for_ack_vf; + mbx->ops.check_for_rst = ixgbe_check_for_rst_vf; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; @@ -697,79 +525,54 @@ void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw) mbx->stats.rsts = 0; } -static void ixgbe_clear_msg_pf(struct ixgbe_hw *hw, u16 vf_id) -{ - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); - s32 index = IXGBE_PFMBICR_INDEX(vf_id); - u32 pfmbicr; - - pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); - - if (pfmbicr & (IXGBE_PFMBICR_VFREQ_VF1 << vf_shift)) - hw->mbx.stats.reqs++; - - IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), - IXGBE_PFMBICR_VFREQ_VF1 << vf_shift); -} - -static void ixgbe_clear_ack_pf(struct ixgbe_hw *hw, u16 vf_id) -{ - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); - s32 index = IXGBE_PFMBICR_INDEX(vf_id); - u32 pfmbicr; - - pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); - - if (pfmbicr & (IXGBE_PFMBICR_VFACK_VF1 << vf_shift)) - hw->mbx.stats.acks++; - - IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), - IXGBE_PFMBICR_VFACK_VF1 << vf_shift); -} - static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) { u32 pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); + s32 ret_val = IXGBE_ERR_MBX; if (pfmbicr & mask) { - return IXGBE_SUCCESS; + ret_val = IXGBE_SUCCESS; + IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), mask); } - return IXGBE_ERR_MBX; + return ret_val; } /** * ixgbe_check_for_msg_pf - checks to see if the VF has sent mail * @hw: pointer to the HW structure - * @vf_id: the VF index + * @vf_number: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_id) +static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) { - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); - s32 index = IXGBE_PFMBICR_INDEX(vf_id); + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); + s32 index = IXGBE_PFMBICR_INDEX(vf_number); + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_msg_pf"); if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFREQ_VF1 << vf_shift, - index)) - return IXGBE_SUCCESS; + index)) { + ret_val = IXGBE_SUCCESS; + hw->mbx.stats.reqs++; + } - return IXGBE_ERR_MBX; + return ret_val; } /** * ixgbe_check_for_ack_pf - checks to see if the VF has ACKed * @hw: pointer to the HW structure - * @vf_id: the VF index + * @vf_number: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_id) +static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) { - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); - s32 index = IXGBE_PFMBICR_INDEX(vf_id); + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); + s32 index = IXGBE_PFMBICR_INDEX(vf_number); s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_ack_pf"); @@ -777,8 +580,7 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_id) if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFACK_VF1 << vf_shift, index)) { ret_val = IXGBE_SUCCESS; - /* TODO: should this be autocleared? */ - ixgbe_clear_ack_pf(hw, vf_id); + hw->mbx.stats.acks++; } return ret_val; @@ -787,14 +589,14 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_id) /** * ixgbe_check_for_rst_pf - checks to see if the VF has reset * @hw: pointer to the HW structure - * @vf_id: the VF index + * @vf_number: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_id) +static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) { - u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_id); - u32 index = IXGBE_PFVFLRE_INDEX(vf_id); + u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_number); + u32 index = IXGBE_PFVFLRE_INDEX(vf_number); s32 ret_val = IXGBE_ERR_MBX; u32 vflre = 0; @@ -826,268 +628,121 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_id) /** * ixgbe_obtain_mbx_lock_pf - obtain mailbox lock * @hw: pointer to the HW structure - * @vf_id: the VF index + * @vf_number: the VF index * * return SUCCESS if we obtained the mailbox lock **/ -static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_id) +static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number) { - struct ixgbe_mbx_info *mbx = &hw->mbx; - int countdown = mbx->timeout; s32 ret_val = IXGBE_ERR_MBX; - u32 pf_mailbox; + u32 p2v_mailbox; DEBUGFUNC("ixgbe_obtain_mbx_lock_pf"); - if (!mbx->timeout) - return IXGBE_ERR_CONFIG; - - while (countdown--) { - /* Reserve mailbox for PF use */ - pf_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_id)); - pf_mailbox |= IXGBE_PFMAILBOX_PFU; - IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_id), pf_mailbox); - - /* Verify that PF is the owner of the lock */ - pf_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_id)); - if (pf_mailbox & IXGBE_PFMAILBOX_PFU) { - ret_val = IXGBE_SUCCESS; - break; - } + /* Take ownership of the buffer */ + IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_PFU); - /* Wait a bit before trying again */ *** 557 LINES SKIPPED *** From nobody Fri Sep 20 02:39:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8xSC1587z5WTdT; Fri, 20 Sep 2024 02:39: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 4X8xSB6TBxz4CrV; Fri, 20 Sep 2024 02:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726799994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DsoYaQt3TnpFhEzSN1/jjadLHrgHqawSjdVLmC8ivws=; b=TPTEMlXwKP879zLhww5KkWqoH9jn8LNNPOy0Cn1pg7IUz3nNjox0lhiwdUTLxgcswwApEY wMFuc/McVxSZmwp+91GLxqQ+47nsfNzReg5CouMd80kqQDOiuIs4QqkFHAjB0I5y0SuNTp 4820XwKjAWbEaA5syL5dLi2lxA/LM9C1ZAvtRwAmcJ6BEbRoPNdY8t+9EYWqfacAfF575k gDyiRrp9Qz0laxxR1IyCLos1p1A+1To7B18IKU9t8WJnuGnYTvVpzRvxfemPvzIJ9uMqUU jcsV32xwd/YM+WcSqKYSkkeONo25a4tGLwZKRDNxMa+bCMghOjg4s4J7a7Jqlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726799994; a=rsa-sha256; cv=none; b=Xsq3f7Vys7DKeFB04BsD4BYVHUN7eDNSbi4pkLffonj4S/GiM9KQi/nLT6/jEBlwhtzHn8 7+3DDsqpivHGWCi5uvwY1tgd50zG2OJlZcrdx6/gKScP/pWLgXgeT9PJ/8iOev+FV9kyvW 1dMTkQbSZ63ISplvmvHyZYdBHX0+ZmHonWZdGI1QyfpLVg9n1v+EIHVlNn5i9TGD37p51K dGe433c2kerMTc3mrhCawh6iTtPFJAjL5StkxNW1sbCXnM7R2frOyXLUffAHIcxygaAZAx 5pM+RP+LyOgrvYy5++aHX7UsRN1oZysiggnBJ2Ib6j7AJPCZIWZb4KKnzPogWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726799994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DsoYaQt3TnpFhEzSN1/jjadLHrgHqawSjdVLmC8ivws=; b=WoXqWwbn3fTM3qzUut6iUz71FNT9YfDvLpTjsZbUTS0bqvwapo6KkqrnqnECH5mODTv85+ sbuDCU3weCGRLIWyoYFgs184i2vGoJuRQ1tNXmvONpsZOUhqJ7uwlANzu569uVcnDlFHmQ fqbm7hWCNtQuMVxiJXmxH2lEzOJBjCtgEgLfsrVHyEAL+7gRjRuHIuFgOyh4trkYHi93WR sy4j8fG0/0KundZvIn9b0A2kJqKA6WHO4OdWu3cU37xqXr0FvAJMabOUmYNecc+dNkyZqo XbiJkzKblrCRrvocOLx6ERBNIHwYGvrEFwib8YCUFQrioeZUVCM1LpifmeOefA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8xSB5K9czXLX; Fri, 20 Sep 2024 02:39: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 48K2ds4g082142; Fri, 20 Sep 2024 02:39:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K2dsar082139; Fri, 20 Sep 2024 02:39:54 GMT (envelope-from git) Date: Fri, 20 Sep 2024 02:39:54 GMT Message-Id: <202409200239.48K2dsar082139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 7234c3099947 - main - ixgbe: introduce new mailbox API List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7234c3099947d202702e98d844ecd2d649c834d2 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=7234c3099947d202702e98d844ecd2d649c834d2 commit 7234c3099947d202702e98d844ecd2d649c834d2 Author: Jakub Chylkowski AuthorDate: 2024-09-20 02:30:39 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 02:38:59 +0000 ixgbe: introduce new mailbox API DPDK commit message Current mailbox API does not work as described in documentation and is prone to errors (for example, it is doing locks on read). Introduce new mailbox API and provide compatibility functions with old API. New error codes have been introduced: - IXGBE_ERR_CONFIG - ixgbe_mbx_operations is not correctly set - IXGBE_ERR_TIMEOUT - mailbox operation, e.g. poll for message, timedout - IXGBE_ERR_MBX_NOMSG - no message available on read In addition, some refactoring has been done: mailbox structures were defined twice: in ixgbe_type.h and ixgbe_vf.h. Move them into ixgbe_mbx.h as this header is dedicated for mailbox. Signed-off-by: Jakub Chylkowski Reviewed-by: Alice Michael Reviewed-by: Piotr Pietruszewski Tested-by: Alice Michael Tested-by: Piotr Skajewski Obtained from: DPDK (6d243d2) MFC after: 1 week Reapply message This reverts commit d80c12ba682a6f23791f3d6e657f9e603b152aa2. --- sys/dev/ixgbe/if_ix.c | 8 +- sys/dev/ixgbe/ixgbe_82599.c | 4 +- sys/dev/ixgbe/ixgbe_mbx.c | 839 ++++++++++++++++++++++++++++++++------------ sys/dev/ixgbe/ixgbe_mbx.h | 59 +++- sys/dev/ixgbe/ixgbe_type.h | 32 +- sys/dev/ixgbe/ixgbe_vf.c | 42 ++- sys/dev/ixgbe/ixgbe_x540.c | 4 +- 7 files changed, 699 insertions(+), 289 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 17f1f73a526e..f2b41e19a15e 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -879,6 +879,7 @@ ixgbe_if_attach_pre(if_ctx_t ctx) struct ixgbe_hw *hw; int error = 0; u32 ctrl_ext; + size_t i; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -928,8 +929,11 @@ ixgbe_if_attach_pre(if_ctx_t ctx) goto err_pci; } - if (hw->mbx.ops.init_params) - hw->mbx.ops.init_params(hw); + /* 82598 Does not support SR-IOV, initialize everything else */ + if (hw->mac.type >= ixgbe_mac_82599_vf) { + for (i = 0; i < sc->num_vfs; i++) + hw->mbx.ops[i].init_params(hw); + } hw->allow_unsupported_sfp = allow_unsupported_sfp; diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 8c3df0fd4f59..70b4cdc5c6ca 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -324,6 +324,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) struct ixgbe_phy_info *phy = &hw->phy; struct ixgbe_eeprom_info *eeprom = &hw->eeprom; s32 ret_val; + u16 i; DEBUGFUNC("ixgbe_init_ops_82599"); @@ -385,7 +386,8 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) mac->arc_subsystem_valid = !!(IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)) & IXGBE_FWSM_MODE_MASK); - hw->mbx.ops.init_params = ixgbe_init_mbx_params_pf; + for (i = 0; i < 64; i++) + hw->mbx.ops[i].init_params = ixgbe_init_mbx_params_pf; /* EEPROM */ eeprom->ops.read = ixgbe_read_eeprom_82599; diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index c8f839fce85a..0a0c5abde157 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -35,6 +35,9 @@ #include "ixgbe_type.h" #include "ixgbe_mbx.h" +static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id); +static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id); + /** * ixgbe_read_mbx - Reads a message from the mailbox * @hw: pointer to the HW structure @@ -47,42 +50,91 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_read_mbx"); /* limit read to size of mailbox */ - if (size > mbx->size) + if (size > mbx->size) { + ERROR_REPORT3(IXGBE_ERROR_ARGUMENT, + "Invalid mailbox message size %u, changing to %u", + size, mbx->size); + size = mbx->size; + } + + if (mbx->ops[mbx_id].read) + return mbx->ops[mbx_id].read(hw, msg, size, mbx_id); + + return IXGBE_ERR_CONFIG; +} + +/** + * ixgbe_poll_mbx - Wait for message and read it from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfully read message from buffer + **/ +s32 ixgbe_poll_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val; + + DEBUGFUNC("ixgbe_poll_mbx"); + + if (!mbx->ops[mbx_id].read || !mbx->ops[mbx_id].check_for_msg || + !mbx->timeout) + return IXGBE_ERR_CONFIG; + + /* limit read to size of mailbox */ + if (size > mbx->size) { + ERROR_REPORT3(IXGBE_ERROR_ARGUMENT, + "Invalid mailbox message size %u, changing to %u", + size, mbx->size); size = mbx->size; + } - if (mbx->ops.read) - ret_val = mbx->ops.read(hw, msg, size, mbx_id); + ret_val = ixgbe_poll_for_msg(hw, mbx_id); + /* if ack received read message, otherwise we timed out */ + if (!ret_val) + return mbx->ops[mbx_id].read(hw, msg, size, mbx_id); return ret_val; } /** - * ixgbe_write_mbx - Write a message to the mailbox + * ixgbe_write_mbx - Write a message to the mailbox and wait for ACK * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully copied message into the buffer + * returns SUCCESS if it successfully copied message into the buffer and + * received an ACK to that message within specified period **/ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_SUCCESS; + s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_write_mbx"); + /* + * exit if either we can't write, release + * or there is no timeout defined + */ + if (!mbx->ops[mbx_id].write || !mbx->ops[mbx_id].check_for_ack || + !mbx->ops[mbx_id].release || !mbx->timeout) + return IXGBE_ERR_CONFIG; + if (size > mbx->size) { - ret_val = IXGBE_ERR_MBX; + ret_val = IXGBE_ERR_PARAM; ERROR_REPORT2(IXGBE_ERROR_ARGUMENT, - "Invalid mailbox message size %d", size); - } else if (mbx->ops.write) - ret_val = mbx->ops.write(hw, msg, size, mbx_id); + "Invalid mailbox message size %u", size); + } else { + ret_val = mbx->ops[mbx_id].write(hw, msg, size, mbx_id); + } return ret_val; } @@ -97,12 +149,12 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_ERR_CONFIG; DEBUGFUNC("ixgbe_check_for_msg"); - if (mbx->ops.check_for_msg) - ret_val = mbx->ops.check_for_msg(hw, mbx_id); + if (mbx->ops[mbx_id].check_for_msg) + ret_val = mbx->ops[mbx_id].check_for_msg(hw, mbx_id); return ret_val; } @@ -117,12 +169,12 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_ERR_CONFIG; DEBUGFUNC("ixgbe_check_for_ack"); - if (mbx->ops.check_for_ack) - ret_val = mbx->ops.check_for_ack(hw, mbx_id); + if (mbx->ops[mbx_id].check_for_ack) + ret_val = mbx->ops[mbx_id].check_for_ack(hw, mbx_id); return ret_val; } @@ -137,12 +189,12 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; + s32 ret_val = IXGBE_ERR_CONFIG; DEBUGFUNC("ixgbe_check_for_rst"); - if (mbx->ops.check_for_rst) - ret_val = mbx->ops.check_for_rst(hw, mbx_id); + if (mbx->ops[mbx_id].check_for_rst) + ret_val = mbx->ops[mbx_id].check_for_rst(hw, mbx_id); return ret_val; } @@ -161,22 +213,23 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id) DEBUGFUNC("ixgbe_poll_for_msg"); - if (!countdown || !mbx->ops.check_for_msg) - goto out; + if (!countdown || !mbx->ops[mbx_id].check_for_msg) + return IXGBE_ERR_CONFIG; - while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) { + while (countdown && mbx->ops[mbx_id].check_for_msg(hw, mbx_id)) { countdown--; if (!countdown) break; usec_delay(mbx->usec_delay); } - if (countdown == 0) + if (countdown == 0) { ERROR_REPORT2(IXGBE_ERROR_POLLING, - "Polling for VF%d mailbox message timedout", mbx_id); + "Polling for VF%u mailbox message timedout", mbx_id); + return IXGBE_ERR_TIMEOUT; + } -out: - return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; + return IXGBE_SUCCESS; } /** @@ -193,115 +246,71 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) DEBUGFUNC("ixgbe_poll_for_ack"); - if (!countdown || !mbx->ops.check_for_ack) - goto out; + if (!countdown || !mbx->ops[mbx_id].check_for_ack) + return IXGBE_ERR_CONFIG; - while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) { + while (countdown && mbx->ops[mbx_id].check_for_ack(hw, mbx_id)) { countdown--; if (!countdown) break; usec_delay(mbx->usec_delay); } - if (countdown == 0) + if (countdown == 0) { ERROR_REPORT2(IXGBE_ERROR_POLLING, - "Polling for VF%d mailbox ack timedout", mbx_id); + "Polling for VF%u mailbox ack timedout", mbx_id); + return IXGBE_ERR_TIMEOUT; + } -out: - return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; + return IXGBE_SUCCESS; } /** - * ixgbe_read_posted_mbx - Wait for message notification and receive message + * ixgbe_read_mailbox_vf - read VF's mailbox register * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully received a message notification and - * copied it into the receive buffer. + * This function is used to read the mailbox register dedicated for VF without + * losing the read to clear status bits. **/ -s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; - - DEBUGFUNC("ixgbe_read_posted_mbx"); - - if (!mbx->ops.read) - goto out; + u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); - ret_val = ixgbe_poll_for_msg(hw, mbx_id); + vf_mailbox |= hw->mbx.vf_mailbox; + hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; - /* if ack received read message, otherwise we timed out */ - if (!ret_val) - ret_val = mbx->ops.read(hw, msg, size, mbx_id); -out: - return ret_val; + return vf_mailbox; } -/** - * ixgbe_write_posted_mbx - Write a message to the mailbox, wait for ack - * @hw: pointer to the HW structure - * @msg: The message buffer - * @size: Length of buffer - * @mbx_id: id of mailbox to write - * - * returns SUCCESS if it successfully copied message into the buffer and - * received an ack to that message within delay * timeout period - **/ -s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static void ixgbe_clear_msg_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; - s32 ret_val = IXGBE_ERR_MBX; - - DEBUGFUNC("ixgbe_write_posted_mbx"); - - /* exit if either we can't write or there isn't a defined timeout */ - if (!mbx->ops.write || !mbx->timeout) - goto out; - - /* send msg */ - ret_val = mbx->ops.write(hw, msg, size, mbx_id); + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - /* if msg sent wait until we receive an ack */ - if (!ret_val) - ret_val = ixgbe_poll_for_ack(hw, mbx_id); -out: - return ret_val; + if (vf_mailbox & IXGBE_VFMAILBOX_PFSTS) { + hw->mbx.stats.reqs++; + hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFSTS; + } } -/** - * ixgbe_init_mbx_ops_generic - Initialize MB function pointers - * @hw: pointer to the HW structure - * - * Setups up the mailbox read and write message function pointers - **/ -void ixgbe_init_mbx_ops_generic(struct ixgbe_hw *hw) +static void ixgbe_clear_ack_vf(struct ixgbe_hw *hw) { - struct ixgbe_mbx_info *mbx = &hw->mbx; + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - mbx->ops.read_posted = ixgbe_read_posted_mbx; - mbx->ops.write_posted = ixgbe_write_posted_mbx; + if (vf_mailbox & IXGBE_VFMAILBOX_PFACK) { + hw->mbx.stats.acks++; + hw->mbx.vf_mailbox &= ~IXGBE_VFMAILBOX_PFACK; + } } -/** - * ixgbe_read_v2p_mailbox - read v2p mailbox - * @hw: pointer to the HW structure - * - * This function is used to read the v2p mailbox without losing the read to - * clear status bits. - **/ -static u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw) +static void ixgbe_clear_rst_vf(struct ixgbe_hw *hw) { - u32 v2p_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); - - v2p_mailbox |= hw->mbx.v2p_mailbox; - hw->mbx.v2p_mailbox |= v2p_mailbox & IXGBE_VFMAILBOX_R2C_BITS; + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - return v2p_mailbox; + if (vf_mailbox & (IXGBE_VFMAILBOX_RSTI | IXGBE_VFMAILBOX_RSTD)) { + hw->mbx.stats.rsts++; + hw->mbx.vf_mailbox &= ~(IXGBE_VFMAILBOX_RSTI | + IXGBE_VFMAILBOX_RSTD); + } } /** @@ -314,15 +323,12 @@ static u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw) **/ static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) { - u32 v2p_mailbox = ixgbe_read_v2p_mailbox(hw); - s32 ret_val = IXGBE_ERR_MBX; + u32 vf_mailbox = ixgbe_read_mailbox_vf(hw); - if (v2p_mailbox & mask) - ret_val = IXGBE_SUCCESS; + if (vf_mailbox & mask) + return IXGBE_SUCCESS; - hw->mbx.v2p_mailbox &= ~mask; - - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -334,17 +340,13 @@ static s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask) **/ static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id) { - s32 ret_val = IXGBE_ERR_MBX; - UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_msg_vf"); - if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.reqs++; - } + if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) + return IXGBE_SUCCESS; - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -356,17 +358,16 @@ static s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id) { - s32 ret_val = IXGBE_ERR_MBX; - UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_ack_vf"); if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.acks++; + /* TODO: should this be autocleared? */ + ixgbe_clear_ack_vf(hw); + return IXGBE_SUCCESS; } - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -378,18 +379,17 @@ static s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id) { - s32 ret_val = IXGBE_ERR_MBX; - UNREFERENCED_1PARAMETER(mbx_id); DEBUGFUNC("ixgbe_check_for_rst_vf"); - if (!ixgbe_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD | - IXGBE_VFMAILBOX_RSTI))) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.rsts++; + if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_RSTI | + IXGBE_VFMAILBOX_RSTD)) { + /* TODO: should this be autocleared? */ + ixgbe_clear_rst_vf(hw); + return IXGBE_SUCCESS; } - return ret_val; + return IXGBE_ERR_MBX; } /** @@ -400,20 +400,114 @@ static s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id) **/ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) { + struct ixgbe_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; s32 ret_val = IXGBE_ERR_MBX; + u32 vf_mailbox; DEBUGFUNC("ixgbe_obtain_mbx_lock_vf"); - /* Take ownership of the buffer */ - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); + if (!mbx->timeout) + return IXGBE_ERR_CONFIG; - /* reserve mailbox for vf use */ - if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) - ret_val = IXGBE_SUCCESS; + while (countdown--) { + /* Reserve mailbox for VF use */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox |= IXGBE_VFMAILBOX_VFU; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); + + /* Verify that VF is the owner of the lock */ + if (ixgbe_read_mailbox_vf(hw) & IXGBE_VFMAILBOX_VFU) { + ret_val = IXGBE_SUCCESS; + break; + } + + /* Wait a bit before trying again */ + usec_delay(mbx->usec_delay); + } + + if (ret_val != IXGBE_SUCCESS) { + ERROR_REPORT1(IXGBE_ERROR_INVALID_STATE, + "Failed to obtain mailbox lock"); + ret_val = IXGBE_ERR_TIMEOUT; + } return ret_val; } +/** + * ixgbe_release_mbx_lock_dummy - release mailbox lock + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read + **/ +static void ixgbe_release_mbx_lock_dummy(struct ixgbe_hw *hw, u16 mbx_id) +{ + UNREFERENCED_2PARAMETER(hw, mbx_id); + + DEBUGFUNC("ixgbe_release_mbx_lock_dummy"); +} + +/** + * ixgbe_release_mbx_lock_vf - release mailbox lock + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read + **/ +static void ixgbe_release_mbx_lock_vf(struct ixgbe_hw *hw, u16 mbx_id) +{ + u32 vf_mailbox; + + UNREFERENCED_1PARAMETER(mbx_id); + + DEBUGFUNC("ixgbe_release_mbx_lock_vf"); + + /* Return ownership of the buffer */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox &= ~IXGBE_VFMAILBOX_VFU; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); +} + +/** + * ixgbe_write_mbx_vf_legacy - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +static s32 ixgbe_write_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val; + u16 i; + + UNREFERENCED_1PARAMETER(mbx_id); + DEBUGFUNC("ixgbe_write_mbx_vf_legacy"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = ixgbe_obtain_mbx_lock_vf(hw); + if (ret_val) + return ret_val; + + /* flush msg and acks as we are overwriting the message buffer */ + ixgbe_check_for_msg_vf(hw, 0); + ixgbe_clear_msg_vf(hw); + ixgbe_check_for_ack_vf(hw, 0); + ixgbe_clear_ack_vf(hw); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + + /* interrupt the PF to tell it a message has been sent */ + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); + + return IXGBE_SUCCESS; +} + /** * ixgbe_write_mbx_vf - Write a message to the mailbox * @hw: pointer to the HW structure @@ -426,6 +520,7 @@ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { + u32 vf_mailbox; s32 ret_val; u16 i; @@ -436,11 +531,11 @@ static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* lock the mailbox to prevent pf/vf race condition */ ret_val = ixgbe_obtain_mbx_lock_vf(hw); if (ret_val) - goto out_no_write; + goto out; /* flush msg and acks as we are overwriting the message buffer */ - ixgbe_check_for_msg_vf(hw, 0); - ixgbe_check_for_ack_vf(hw, 0); + ixgbe_clear_msg_vf(hw); + ixgbe_clear_ack_vf(hw); /* copy the caller specified message to the mailbox memory buffer */ for (i = 0; i < size; i++) @@ -449,15 +544,22 @@ static s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* update stats */ hw->mbx.stats.msgs_tx++; - /* Drop VFU and interrupt the PF to tell it a message has been sent */ - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ); + /* interrupt the PF to tell it a message has been sent */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox |= IXGBE_VFMAILBOX_REQ; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); + + /* if msg sent wait until we receive an ack */ + ixgbe_poll_for_ack(hw, mbx_id); + +out: + hw->mbx.ops[mbx_id].release(hw, mbx_id); -out_no_write: return ret_val; } /** - * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf + * ixgbe_read_mbx_vf_legacy - Reads a message from the inbox intended for vf * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer @@ -465,19 +567,19 @@ out_no_write: * * returns SUCCESS if it successfully read message from buffer **/ -static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, - u16 mbx_id) +static s32 ixgbe_read_mbx_vf_legacy(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) { - s32 ret_val = IXGBE_SUCCESS; + s32 ret_val; u16 i; - DEBUGFUNC("ixgbe_read_mbx_vf"); + DEBUGFUNC("ixgbe_read_mbx_vf_legacy"); UNREFERENCED_1PARAMETER(mbx_id); /* lock the mailbox to prevent pf/vf race condition */ ret_val = ixgbe_obtain_mbx_lock_vf(hw); if (ret_val) - goto out_no_read; + return ret_val; /* copy the message from the mailbox memory buffer */ for (i = 0; i < size; i++) @@ -489,34 +591,73 @@ static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, /* update stats */ hw->mbx.stats.msgs_rx++; -out_no_read: - return ret_val; + return IXGBE_SUCCESS; +} + +/** + * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfully read message from buffer + **/ +static s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + u32 vf_mailbox; + s32 ret_val; + u16 i; + + DEBUGFUNC("ixgbe_read_mbx_vf"); + UNREFERENCED_1PARAMETER(mbx_id); + + /* check if there is a message from PF */ + ret_val = ixgbe_check_for_msg_vf(hw, 0); + if (ret_val != IXGBE_SUCCESS) + return IXGBE_ERR_MBX_NOMSG; + + ixgbe_clear_msg_vf(hw); + + /* copy the message from the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i); + + /* Acknowledge receipt */ + vf_mailbox = ixgbe_read_mailbox_vf(hw); + vf_mailbox |= IXGBE_VFMAILBOX_ACK; + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + + return IXGBE_SUCCESS; } /** * ixgbe_init_mbx_params_vf - set initial values for vf mailbox * @hw: pointer to the HW structure * - * Initializes the hw->mbx struct to correct values for vf mailbox + * Initializes single set the hw->mbx struct to correct values for vf mailbox + * Set of legacy functions is being used here */ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) { struct ixgbe_mbx_info *mbx = &hw->mbx; - /* start mailbox as timed out and let the reset_hw call set the timeout - * value to begin communications */ - mbx->timeout = 0; + mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY; mbx->size = IXGBE_VFMAILBOX_SIZE; - mbx->ops.read = ixgbe_read_mbx_vf; - mbx->ops.write = ixgbe_write_mbx_vf; - mbx->ops.read_posted = ixgbe_read_posted_mbx; - mbx->ops.write_posted = ixgbe_write_posted_mbx; - mbx->ops.check_for_msg = ixgbe_check_for_msg_vf; - mbx->ops.check_for_ack = ixgbe_check_for_ack_vf; - mbx->ops.check_for_rst = ixgbe_check_for_rst_vf; + /* VF has only one mailbox connection, no need for more IDs */ + mbx->ops[0].release = ixgbe_release_mbx_lock_dummy; + mbx->ops[0].read = ixgbe_read_mbx_vf_legacy; + mbx->ops[0].write = ixgbe_write_mbx_vf_legacy; + mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; + mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; + mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; @@ -525,54 +666,110 @@ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) mbx->stats.rsts = 0; } +/** + * ixgbe_upgrade_mbx_params_vf - set initial values for vf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for vf mailbox + */ +void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + + mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; + mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY; + + mbx->size = IXGBE_VFMAILBOX_SIZE; + + /* VF has only one mailbox connection, no need for more IDs */ + mbx->ops[0].release = ixgbe_release_mbx_lock_vf; + mbx->ops[0].read = ixgbe_read_mbx_vf; + mbx->ops[0].write = ixgbe_write_mbx_vf; + mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; + mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; + mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; + mbx->ops[0].clear = NULL; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; +} + +static void ixgbe_clear_msg_pf(struct ixgbe_hw *hw, u16 vf_id) +{ + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); + u32 pfmbicr; + + pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); + + if (pfmbicr & (IXGBE_PFMBICR_VFREQ_VF1 << vf_shift)) + hw->mbx.stats.reqs++; + + IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), + IXGBE_PFMBICR_VFREQ_VF1 << vf_shift); +} + +static void ixgbe_clear_ack_pf(struct ixgbe_hw *hw, u16 vf_id) +{ + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); + u32 pfmbicr; + + pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); + + if (pfmbicr & (IXGBE_PFMBICR_VFACK_VF1 << vf_shift)) + hw->mbx.stats.acks++; + + IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), + IXGBE_PFMBICR_VFACK_VF1 << vf_shift); +} + static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) { u32 pfmbicr = IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)); - s32 ret_val = IXGBE_ERR_MBX; if (pfmbicr & mask) { - ret_val = IXGBE_SUCCESS; - IXGBE_WRITE_REG(hw, IXGBE_PFMBICR(index), mask); + return IXGBE_SUCCESS; } - return ret_val; + return IXGBE_ERR_MBX; } /** * ixgbe_check_for_msg_pf - checks to see if the VF has sent mail * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_id) { - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); - s32 index = IXGBE_PFMBICR_INDEX(vf_number); - s32 ret_val = IXGBE_ERR_MBX; + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); DEBUGFUNC("ixgbe_check_for_msg_pf"); if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFREQ_VF1 << vf_shift, - index)) { - ret_val = IXGBE_SUCCESS; - hw->mbx.stats.reqs++; - } + index)) + return IXGBE_SUCCESS; - return ret_val; + return IXGBE_ERR_MBX; } /** * ixgbe_check_for_ack_pf - checks to see if the VF has ACKed * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_id) { - u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_number); - s32 index = IXGBE_PFMBICR_INDEX(vf_number); + u32 vf_shift = IXGBE_PFMBICR_SHIFT(vf_id); + s32 index = IXGBE_PFMBICR_INDEX(vf_id); s32 ret_val = IXGBE_ERR_MBX; DEBUGFUNC("ixgbe_check_for_ack_pf"); @@ -580,7 +777,8 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) if (!ixgbe_check_for_bit_pf(hw, IXGBE_PFMBICR_VFACK_VF1 << vf_shift, index)) { ret_val = IXGBE_SUCCESS; - hw->mbx.stats.acks++; + /* TODO: should this be autocleared? */ + ixgbe_clear_ack_pf(hw, vf_id); } return ret_val; @@ -589,14 +787,14 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) /** * ixgbe_check_for_rst_pf - checks to see if the VF has reset * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * returns SUCCESS if the VF has set the Status bit or else ERR_MBX **/ -static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_id) { - u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_number); - u32 index = IXGBE_PFVFLRE_INDEX(vf_number); + u32 vf_shift = IXGBE_PFVFLRE_SHIFT(vf_id); + u32 index = IXGBE_PFVFLRE_INDEX(vf_id); s32 ret_val = IXGBE_ERR_MBX; u32 vflre = 0; @@ -628,121 +826,268 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) /** * ixgbe_obtain_mbx_lock_pf - obtain mailbox lock * @hw: pointer to the HW structure - * @vf_number: the VF index + * @vf_id: the VF index * * return SUCCESS if we obtained the mailbox lock **/ -static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number) +static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_id) { + struct ixgbe_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; *** 666 LINES SKIPPED *** From nobody Fri Sep 20 02:43:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8xXW11yjz5WVP4; Fri, 20 Sep 2024 02:43: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 4X8xXV5vz7z4Dpt; Fri, 20 Sep 2024 02:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726800218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYD9Wxp9Mx3qPjXTogCk54ZbId/OT27Qsd9RWUuUVwE=; b=EXkZvJXLPVdWnBEbIrfHWFwRiBuNEEVywXne9+NQCBzo8VB393IJr71PEhvIlFipQanIYL ICXuyzQF7cCR+7RwPRVxKJJvmS8BhIsC2fVhQzQ7ftS2E2Dh8Dye0h0XFK4A/F2NqZyznd 68V5K7KGHld/uPXAMCC8XFr0J/4T70zh7WEIAImW/vp371jl9tdL0NLYv1A5elMttN4kt5 2mXktxmEjhMT/HiS6KCK1ZzFwCJFQ7oBY1cOs+qD2w6Lg6mTHnlWYimP1uEs1nA77CXLyh YrIwRjSmlZj+BpJwv74Tgunoz8ajpIvlMzeOIMB0DZtFzrb+f1Cbr3OUG+h7BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726800218; a=rsa-sha256; cv=none; b=v4Yr37lfLgWwOqEsams1J8K6c2h9UQDh3/s3wjmbI0iUa4jQfZ7iUrJS15AiciH3xpaCQ3 SdYGiSsgbRotfYdwMUa5OHqJBqEX/SbVRWnAK9SN7GMBYjQgxx8W2/s8KTd9ZwSTra4FcN RoHDQFW09Z2aF5z2bV7kGoB5IMNyyRIB53U/8W0wQSe7+ifBjcmYTgIBoVGceR6yBpowkj 1LlgfwLWnhGIeOj7440cOGjsW4Pnlbc8BbzX6a+67TyfvSfzEjIOvuPzJCGa8f3H9mFk+a gkYBtmg6hjeVCs4dnSaIkXjlulRqQFoX3yAr1N2x8FSg95dxluY01GEJgS90oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726800218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYD9Wxp9Mx3qPjXTogCk54ZbId/OT27Qsd9RWUuUVwE=; b=tnvGFBpg/b01/BolgU8e66AphimyFlud/HsJ1fm+NZLhtSVVY/TkQ7Y16J8HwAf4353pz/ EobdJyH8hD+MYiUjWuiCGxQ5r7g6iFq2o9WFFrICokU/wNvJOas4gbDsuTHzh5L0dfTvqE yAMeLyA0vtR/btrslWO+7g30Jcf42VGYNbMmJqzDAThCIfhD2QrlaGQ81PCUPy9nozioPx bBWEbQct4fS/hBOqgVOqOsQvX8hVcw9yPqbGBHBgRGh8M6JCLizKGOyTYiYLUKbe6O7+l1 f9cfZrXFfkBhtnVVflX+99pb0fEehblWOdV0vfDIkkcQLEJ2O4oeiKlvCYT6cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8xXV5W1xzXMW; Fri, 20 Sep 2024 02:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48K2hcCM097960; Fri, 20 Sep 2024 02:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K2hcWR097957; Fri, 20 Sep 2024 02:43:38 GMT (envelope-from git) Date: Fri, 20 Sep 2024 02:43:38 GMT Message-Id: <202409200243.48K2hcWR097957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 1b80ac6fa64e - main - ixgbe: increase DCB BW calculation for MTU List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b80ac6fa64eaa575b99521cbd71a3780bf5139b Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1b80ac6fa64eaa575b99521cbd71a3780bf5139b commit 1b80ac6fa64eaa575b99521cbd71a3780bf5139b Author: Radoslaw Tyl AuthorDate: 2024-09-20 02:42:39 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 02:42:39 +0000 ixgbe: increase DCB BW calculation for MTU Change max credit and credit refill to a maximum possible value, 9128. Too small values cause the incorrect calculation of the bandwidth limits to each traffic class for frames larger than 4088 bytes. Signed-off-by: Radoslaw Tyl Reviewed-by: Piotr Skajewski Reviewed-by: Slawomir Mrozowicz Reviewed-by: Alice Michael Tested-by: Piotr Skajewski Obtained from: DPDK (440823f) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_dcb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_dcb.h b/sys/dev/ixgbe/ixgbe_dcb.h index b31dfae0cdfa..54decd4d081d 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.h +++ b/sys/dev/ixgbe/ixgbe_dcb.h @@ -40,9 +40,9 @@ /* DCB defines */ /* DCB credit calculation defines */ #define IXGBE_DCB_CREDIT_QUANTUM 64 -#define IXGBE_DCB_MAX_CREDIT_REFILL 200 /* 200 * 64B = 12800B */ +#define IXGBE_DCB_MAX_CREDIT_REFILL 511 /* 0x1FF * 64B = 32704B */ #define IXGBE_DCB_MAX_TSO_SIZE (32 * 1024) /* Max TSO pkt size in DCB*/ -#define IXGBE_DCB_MAX_CREDIT (2 * IXGBE_DCB_MAX_CREDIT_REFILL) +#define IXGBE_DCB_MAX_CREDIT 4095 /* Maximum credit supported: 256KB * 1024 / 64B */ /* 513 for 32KB TSO packet */ #define IXGBE_DCB_MIN_TSO_CREDIT \ From nobody Fri Sep 20 02:51:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8xjR6NnYz5WWXj; Fri, 20 Sep 2024 02:51: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 4X8xjR3PY4z4FhW; Fri, 20 Sep 2024 02:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726800683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BX70Ck2M15xS6TBqgPm1ea0QX+lXB3xbhpLkVN4/r90=; b=HiyveF1yHRSRGHHk7sX8QxcwWZQ3n7wbeeOw/8dcb/hJsYBKZZqbdPzyWDtLFxF2n49/kM OtKcwlxTtEp/CMQZG07BJifXSTa0GRsqgg2N1eemlLvDIxfdVPSD1ThxS6rnMo5XQpO2fK h1vb7x3IR+ppNdD6b52EIaYWmrnhs1DM2IMXW9DHZg0I/HcX8aF697hb4llqda0aX9t/Ue vHxP4ZRhuA7jOa3RDfLSezda40FK1sYn6+2j0eYLOWSNQvH5sXQQdBsuYGI1QcZ3I7YyA4 yE4Wr8/uY+fWnaIV7NKVkqHnNSvryM6w2aYYh0HYHuMem3snaT3QM8ipGMvO0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726800683; a=rsa-sha256; cv=none; b=fzYGLQ7YiNTi3n4yxiXHluN7Wtx7cJTeT6Hu6QGxrPFZbK5yTkzEi9SR4/23pWZE7oLT0s PYFGUEZDA9kn7KwbB33ooPUIX5cVBAR7CckZKIGjVECQGvvIp3K9+QM2e3YWOiMm45C2FA /Ffz2aRFw+ngBVd4zZzw02jeb6mH6dZsgI0QZIjZ8p9fxYRe2Ojws5QCC+u1Eg2Q9GCiTu 3vlZwoN+3iimbnxxmERcm8T5nfZu/sMPuLW+JIrAzOCi7HZGi6IfDr2QwFl2OPnVxmzCd7 icm7K21QFmME6dRoN70BkJ6IEr5r6TkhIVQKR7D6+gFNtR+fa7ydv8DAAzA+FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726800683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BX70Ck2M15xS6TBqgPm1ea0QX+lXB3xbhpLkVN4/r90=; b=XaUb4EaUbwXZsLSm6tx44viveKotU/nhKj4m1HSI3mH96AfPZMuSuD6KOE4mV8EBbLDPWa cvF0KWzJGY111p4N1ycZHV6MLTZYWTlXpTDXlsbVZPaEgEVrAhbKvPgLKFx+U7UrZwAZ/Q La7EmDy3jTW1p09MSJkZyFwUFnQIPmAoax0spLbPavJg4SOFwwYzIgXYlbK0PEpT26u1UC dJUZ5ahgCDjiXFoP/Obkc4vqqEC5vWXjtI4bCMlqvzROzwxceXnSAeiycIbV4J0t4zAcQn 7Mq4jQvqL/3rwBQmpWic7dxxnmt2DvsgJHJuLxWaRZzlj9xIZvw5lkECJaEaIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8xjR30QLzY4P; Fri, 20 Sep 2024 02:51: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 48K2pNI9009756; Fri, 20 Sep 2024 02:51:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K2pNWV009753; Fri, 20 Sep 2024 02:51:23 GMT (envelope-from git) Date: Fri, 20 Sep 2024 02:51:23 GMT Message-Id: <202409200251.48K2pNWV009753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: edef2769483b - main - ixgbe: improve function comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edef2769483b29457f028a508ea96fc1099a0a21 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=edef2769483b29457f028a508ea96fc1099a0a21 commit edef2769483b29457f028a508ea96fc1099a0a21 Author: Radoslaw Tyl AuthorDate: 2024-09-20 02:50:23 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 02:50:23 +0000 ixgbe: improve function comments Some function comments have mismatches between actual function names and function name in comments, which causes warnings with kernel-doc. Fix comments to match function names. Signed-off-by: Radoslaw Tyl Reviewed-by: Piotr Skajewski Reviewed-by: Slawomir Mrozowicz Reviewed-by: Alice Michael Obtained from: DPDK (7b5bc85) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_82599.c | 2 +- sys/dev/ixgbe/ixgbe_api.c | 2 +- sys/dev/ixgbe/ixgbe_common.c | 11 ++++++----- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 12 ++++++------ 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 70b4cdc5c6ca..a1d8b299bf80 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1537,7 +1537,7 @@ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, } /** - * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter + * ixgbe_fdir_add_signature_filter_82599 - Adds a signature hash filter * @hw: pointer to hardware structure * @input: unique input dword * @common: compressed common input dword diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index eded950e2881..7767e9a5571c 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -904,7 +904,7 @@ s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val) } /** - * ixgbe_eeprom_update_checksum - Updates the EEPROM checksum + * ixgbe_update_eeprom_checksum - Updates the EEPROM checksum * @hw: pointer to hardware structure **/ s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 6c1396ad964f..a7adf079f248 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3866,14 +3866,15 @@ s32 ixgbe_set_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** + * ixgbe_set_vmdq_san_mac_generic - Associate default VMDq pool index with + * a rx address + * @hw: pointer to hardware struct + * @vmdq: VMDq pool index + * * This function should only be involved in the IOV mode. * In IOV mode, Default pool is next pool after the number of * VFs advertized and not 0. * MPSAR table needs to be updated for SAN_MAC RAR [hw->mac.san_mac_rar_index] - * - * ixgbe_set_vmdq_san_mac - Associate default VMDq pool index with a rx address - * @hw: pointer to hardware struct - * @vmdq: VMDq pool index **/ s32 ixgbe_set_vmdq_san_mac_generic(struct ixgbe_hw *hw, u32 vmdq) { @@ -4880,7 +4881,7 @@ static const u8 ixgbe_emc_therm_limit[4] = { }; /** - * ixgbe_get_thermal_sensor_data - Gathers thermal sensor data + * ixgbe_get_thermal_sensor_data_generic - Gathers thermal sensor data * @hw: pointer to hardware structure * * Returns the thermal sensor data structure diff --git a/sys/dev/ixgbe/ixgbe_dcb.c b/sys/dev/ixgbe/ixgbe_dcb.c index 0ebc5456eda5..29ee3117edcb 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.c +++ b/sys/dev/ixgbe/ixgbe_dcb.c @@ -293,7 +293,7 @@ void ixgbe_dcb_unpack_map_cee(struct ixgbe_dcb_config *cfg, int direction, } /** - * ixgbe_dcb_config - Struct containing DCB settings. + * ixgbe_dcb_check_config_cee - Struct containing DCB settings. * @dcb_config: Pointer to DCB config structure * * This function checks DCB rules for DCB settings. diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 00f396283879..c2f23179476b 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -587,7 +587,7 @@ void ixgbe_restart_auto_neg(struct ixgbe_hw *hw) } /** - * ixgbe_read_phy_mdi - Reads a value from a specified PHY register without + * ixgbe_read_phy_reg_mdi - Reads a value from a specified PHY register without * the SWFW lock * @hw: pointer to hardware structure * @reg_addr: 32 bit address of PHY register to read diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index ad7e7abd7a12..65a87883025e 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -750,7 +750,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) } /** - * ixgbe_fc_autoneg_fw _ Set up flow control for FW-controlled PHYs + * ixgbe_fc_autoneg_fw - Set up flow control for FW-controlled PHYs * @hw: pointer to hardware structure * * Called at init time to set up flow control. @@ -1876,7 +1876,7 @@ void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_x550em - Determines link capabilities + * ixgbe_get_link_capabilities_X550em - Determines link capabilities * @hw: pointer to hardware structure * @speed: pointer to link speed * @autoneg: true when autoneg or autotry is enabled @@ -3236,7 +3236,7 @@ out: } /** - * ixgbe_write_ee_hostif_X550 - Write EEPROM word using hostif + * ixgbe_write_ee_hostif_data_X550 - Write EEPROM word using hostif * @hw: pointer to hardware structure * @offset: offset of word in the EEPROM to write * @data: word write to the EEPROM @@ -3704,7 +3704,7 @@ u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw) } /** - * ixgbe_get_bus_info_x550em - Set PCI bus info + * ixgbe_get_bus_info_X550em - Set PCI bus info * @hw: pointer to hardware structure * * Sets bus link width and speed to unknown because X550em is @@ -3769,7 +3769,7 @@ void ixgbe_disable_rx_x550(struct ixgbe_hw *hw) } /** - * ixgbe_enter_lplu_x550em - Transition to low power states + * ixgbe_enter_lplu_t_x550em - Transition to low power states * @hw: pointer to hardware structure * * Configures Low Power Link Up on transition to low power states @@ -3877,7 +3877,7 @@ s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) } /** - * ixgbe_get_lcd_x550em - Determine lowest common denominator + * ixgbe_get_lcd_t_x550em - Determine lowest common denominator * @hw: pointer to hardware structure * @lcd_speed: pointer to lowest common link speed * From nobody Fri Sep 20 02:55:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8xpY6zVvz5WY0R; Fri, 20 Sep 2024 02:55: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 4X8xpY6CgFz4GDh; Fri, 20 Sep 2024 02:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726800949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gk7/W1xWGRbKqWl+neCbL94XYQpz/7lu+LyW8iw8/oE=; b=xUR9O9ArClGVcs1EdlVn6vSZ0xOLjAsBchu6IulIzg15un8PJNY8iainJ2MDiZ28I9d5hI MjiarfHMLYYV3cJofwmGR2iNtSgG3I1fhuU1kS8FBPjwlcGQcoa5cUQ5LxFzUfo02CRpm5 VHozRGyuNvOT3vUcEPD9ngf5CupwteIlCJ2NNrsr6x9sTVmzzJGaEVJpfLucrnYozYZa+T NH49Uom9PTYrimm939TAeZ8x2xiaZhMqFXNe+GniQQ5depkA9BJwDG6zoAturxFdEQx/7o 49qsKimjo4hLsUsLb52YK18WH5kEhxpfIcOlZE4So3vGvU0vLapJvOGWkXvDLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726800949; a=rsa-sha256; cv=none; b=gFkzvY695xhZFwFv6qM38bo/GcMvZoLYHGFrMD5jhFHukz7FcTgEPcbKOWjj6aAo64fUn2 IQ9kS2HXLJxW3Vi+fJtV4NYG0V+BQ+WCyooh7cDgpGwE1JEBSvROBi0fk6DfvYgID+wvcI Zy8vdwXwzgycmHsRRExCpjPHRrbIroxmtcLYJMeSpuA37WHHiToo3aMq/k7zjrxxLcH1wP yyQKoUBfiRmRki7yhWdeJQwSEe08WlmWal0W0OFT07/sgviPkRueNzTfX5zCYVVJy1gEst bbGXQ0wbObIEzIDB6S6CK088sG33BkRlG/OYyQC9aoZFm2Q9wXPDh7fEtZmrzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726800949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gk7/W1xWGRbKqWl+neCbL94XYQpz/7lu+LyW8iw8/oE=; b=pEcXsP3VoFBGrqOuQ8OuqiphWm1Sk2EuszVHXgullO0H65XtaNFEB/cymLbKmvksX9OZWN OkEin10XgCwpHw8DuVs8Knz1fkZE2ENfyQ38wM5+5m7XGtw+iM2OzGlgJDygpLOEXzdswd 7iFB7r9xOlKRBn8HhnVGQwihJDvAbVQxLmNNJV5K+8NQCAvSWx2miqTF0NT/zfQedZ4kP4 hesDEA7XoGTO27h/QWuh7fHOSu7UQfiTA7g+IVKFEVixLJYpjgCQceZaxBB6MxWuBPi8wo MeTjPnM7dfPqVKv8JGOXnctDbYUBuh81g3eyl5xmTCJs7X/gKmYqNCCPkqQFiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8xpY5hrLzXmw; Fri, 20 Sep 2024 02:55: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 48K2tnsk015574; Fri, 20 Sep 2024 02:55:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K2tnsp015571; Fri, 20 Sep 2024 02:55:49 GMT (envelope-from git) Date: Fri, 20 Sep 2024 02:55:49 GMT Message-Id: <202409200255.48K2tnsp015571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 224f7ab8b470 - main - ixgbe: add reset count field to HW struct List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 224f7ab8b4706653c7d3f78e624bc36c97679f30 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=224f7ab8b4706653c7d3f78e624bc36c97679f30 commit 224f7ab8b4706653c7d3f78e624bc36c97679f30 Author: Radoslaw Tyl AuthorDate: 2024-09-20 02:54:21 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 02:55:35 +0000 ixgbe: add reset count field to HW struct DPDK commit message net/ixgbe/base: add reset count field to HW struct Add fw_rst_cnt to store the number of resets after fw update. This value is required to detect if the EICR.MNG event occurred after firmware update reset. Signed-off-by: Radoslaw Tyl Reviewed-by: Piotr Skajewski Reviewed-by: Slawomir Mrozowicz Reviewed-by: Alice Michael Obtained from: DPDK (9ab0e9c) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_type.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index ccfce45500d9..56d4863c8e07 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -4201,6 +4201,7 @@ struct ixgbe_hw { bool allow_unsupported_sfp; bool wol_enabled; bool need_crosstalk_fix; + u32 fw_rst_cnt; }; #define ixgbe_call_func(hw, func, params, error) \ From nobody Fri Sep 20 03:01:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8xxV37vRz5WZLt; Fri, 20 Sep 2024 03:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8xxV25ftz4Gvy; Fri, 20 Sep 2024 03:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726801310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q427a9ena6qaKCj1+5jCDRpd9bTDsaysB15oes8H0es=; b=X8w8+Ko9XSN3NvgrNvepc0pRbLg/he9Uayvh1YELyqS1xN87awWsOxrxNxvUlzEd/7R0TQ 0zp5DQDylxW7W2a1uQsIaqTZzY5N4bFannj1Gl0KgPFxiPZPW9IPlh+v2l3DfmaN81NwIY WZnAqAfUvhFLrESF2iqJ5zQUJxoxAcO/9idIeE4tq+IHYuhCT27MzqgzeTSF0itIEUKqlT wz3XdeuUpXZH5PBTX1EdIVrVPOnueh4D1msT/B2oDILX9Vg996DrPe67HJ9q8O3QuYGM6g Ix3z6Tw6QOJEEFSC2LPLdIVK/r2zm68op5B2EOHTQObAG4S/AjzkFls7QTkFVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726801310; a=rsa-sha256; cv=none; b=HWfqputxBy4BfmUD880UafYm5D7uP03IkvamvGIEwi8Ix92ngP3p1AUUTe9Wf/t+u2u7Co t3tdjIY2yrUz3Yjets1G1stUFBqpyXbjAjeue2cjN4ICPEGFqtme0SqnAP0V76DmMt2O9V E029tcgd/ezNSwAD5cnGx0IpUf5ph+0owBiPztzZOXBqmoPHITEH+iIxz7jJ605cBnHvLW aYxno/1Rlmh8HlbAGYdLuhz7bRkwGO2Xq40Qj1sPSm2aqOslq+whbG3a/xIVPaV+GoQK/y 0G+Ugm3TpB0a4GDmgMIvr4lJJRlOilwGzUa93tL2imeW2k3yXo0nE7tghkhDjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726801310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q427a9ena6qaKCj1+5jCDRpd9bTDsaysB15oes8H0es=; b=hwmzAxZTJ/pWsd+1a7Jp/nqRA/FVcLdnayrA3fByp9ncg2pLaTmFh2VgOysUatFk/Z7cmo tdjJESsLBzI8pL8H+iJvw9hOsMatLebS9BRkKceTEUsLSCe8ZxUY5AhU/RYQRED5EciTDG Rr2b6PVtYKcBk9IsC3eGgTeZPXxEOg/2Bv8P3vDI0S7uNY9LiyEiF8Q4kZVG3OoXFaSIRI UG1Du8w4CSfPtammuSU7AgOFZrWIvnBm7jcp5fyhYYB+dxrqeeS1+JUl2bHcOcZUOa35nQ Ry8hErCGNYlQ/HEw6hsN+Vi3hThQHvOds1KshZVWLmNcSNC0fLb7oB2CKT5Lmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8xxV1jRzzY7y; Fri, 20 Sep 2024 03:01: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 48K31oOt029821; Fri, 20 Sep 2024 03:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K31ogw029818; Fri, 20 Sep 2024 03:01:50 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:01:50 GMT Message-Id: <202409200301.48K31ogw029818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f56311e37d4c - main - ixgbe: Remove Atom C3000 HIC FW access List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f56311e37d4c39b1deab6aa8523f3332c29e1ad3 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f56311e37d4c39b1deab6aa8523f3332c29e1ad3 commit f56311e37d4c39b1deab6aa8523f3332c29e1ad3 Author: Marek Mical AuthorDate: 2024-09-20 02:59:05 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:01:21 +0000 ixgbe: Remove Atom C3000 HIC FW access DPDK commit message net/ixgbe/base: replace HIC with direct register access Unify FW access method to direct register read/writes across all Atom(R) C3000 products. Atom(R) C3000 fiber exhibited an issue with the Host Interface Command execution being locked when another LAN function attempted to acquire the SWFW sync on Manageability Host. This resulted in HIC atomicity break and bogus data being read since the other LAN function cleared all semaphores on timeout whereas HIC execution continued after unlock. Direct register IOSF access showed higher stability and reliability. Signed-off-by: Marek Mical Reviewed-by: Krzysztof Galazka Reviewed-by: Eryk Rybak Reviewed-by: Francis Racicot Reviewed-by: Alice Michael Obtained from: DPDK (e947f1e) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_x550.c | 76 ++-------------------------------------------- sys/dev/ixgbe/ixgbe_x550.h | 4 --- 2 files changed, 2 insertions(+), 78 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 65a87883025e..8fe8d037cf31 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -799,14 +799,8 @@ s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw) /* Start with generic X550EM init */ ret_val = ixgbe_init_ops_X550EM(hw); - if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || - hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) { - mac->ops.read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550; - mac->ops.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550; - } else { - mac->ops.read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550a; - mac->ops.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550a; - } + mac->ops.read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550; + mac->ops.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550; mac->ops.acquire_swfw_sync = ixgbe_acquire_swfw_sync_X550a; mac->ops.release_swfw_sync = ixgbe_release_swfw_sync_X550a; @@ -1287,72 +1281,6 @@ s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) return IXGBE_ERR_FW_RESP_INVALID; } -/** - * ixgbe_write_iosf_sb_reg_x550a - Writes a value to specified register - * of the IOSF device - * @hw: pointer to hardware structure - * @reg_addr: 32 bit PHY register to write - * @device_type: 3 bit device type - * @data: Data to write to the register - **/ -s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, - u32 device_type, u32 data) -{ - struct ixgbe_hic_internal_phy_req write_cmd; - s32 status; - UNREFERENCED_1PARAMETER(device_type); - - memset(&write_cmd, 0, sizeof(write_cmd)); - write_cmd.hdr.cmd = FW_INT_PHY_REQ_CMD; - write_cmd.hdr.buf_len = FW_INT_PHY_REQ_LEN; - write_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM; - write_cmd.port_number = hw->bus.lan_id; - write_cmd.command_type = FW_INT_PHY_REQ_WRITE; - write_cmd.address = IXGBE_CPU_TO_BE16(reg_addr); - write_cmd.write_data = IXGBE_CPU_TO_BE32(data); - - status = ixgbe_host_interface_command(hw, (u32 *)&write_cmd, - sizeof(write_cmd), - IXGBE_HI_COMMAND_TIMEOUT, false); - - return status; -} - -/** - * ixgbe_read_iosf_sb_reg_x550a - Reads specified register of the IOSF device - * @hw: pointer to hardware structure - * @reg_addr: 32 bit PHY register to write - * @device_type: 3 bit device type - * @data: Pointer to read data from the register - **/ -s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, - u32 device_type, u32 *data) -{ - union { - struct ixgbe_hic_internal_phy_req cmd; - struct ixgbe_hic_internal_phy_resp rsp; - } hic; - s32 status; - UNREFERENCED_1PARAMETER(device_type); - - memset(&hic, 0, sizeof(hic)); - hic.cmd.hdr.cmd = FW_INT_PHY_REQ_CMD; - hic.cmd.hdr.buf_len = FW_INT_PHY_REQ_LEN; - hic.cmd.hdr.checksum = FW_DEFAULT_CHECKSUM; - hic.cmd.port_number = hw->bus.lan_id; - hic.cmd.command_type = FW_INT_PHY_REQ_READ; - hic.cmd.address = IXGBE_CPU_TO_BE16(reg_addr); - - status = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd, - sizeof(hic.cmd), - IXGBE_HI_COMMAND_TIMEOUT, true); - - /* Extract the register value from the response. */ - *data = IXGBE_BE32_TO_CPU(hic.rsp.read_data); - - return status; -} - /** * ixgbe_disable_mdd_X550 * @hw: pointer to hardware structure diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index 245e128266aa..45e4cad9f1f7 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -69,10 +69,6 @@ s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, u8 ver, u16 len, const char *str); s32 ixgbe_get_phy_token(struct ixgbe_hw *); s32 ixgbe_put_phy_token(struct ixgbe_hw *); -s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, - u32 device_type, u32 data); -s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, - u32 device_type, u32 *data); void ixgbe_disable_mdd_X550(struct ixgbe_hw *hw); void ixgbe_enable_mdd_X550(struct ixgbe_hw *hw); void ixgbe_mdd_event_X550(struct ixgbe_hw *hw, u32 *vf_bitmap); From nobody Fri Sep 20 03:15:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8yFq4L8Pz5WcNW; Fri, 20 Sep 2024 03:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8yFq3Xdhz4Jsr; Fri, 20 Sep 2024 03:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPr/SDd+8IHnxi5FYYQcz+DOxUyMQgTMbS0eB6DVjm0=; b=uzTeg3dCnX38SDVoWYwZuHslMv0HawafmUIjvD4g3tcBmKuQJnTn0eo3B7Knb4GGOHfpz6 FswkJb52kCGmuzgdznI1OiilpwiOb1XsVXsIL2zlIAj8JOL2cLwxExUmXZSsArdjxYBeLC nYOHNEMEVCmRR12dxSSem/bSuM1EGluWcdyhqdBGGkpkiWAKxn2QB61R66+qjJO8BMsmGb kj7QhXsl7RNYxvyGXOUKzLqDKVXOSBUBs40TSwTzahz7fj97ApJwVhnjHnimT8iOizdwQ6 VKH8R8Z4SQmoR6Uxo+i7oJivzWA62WEuO/FqUFB3F2uVJ58dW7ii0+NkAt0+lA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726802159; a=rsa-sha256; cv=none; b=garbpRzcJ4zsYJNC7GP0ClrTiU3rDGyaA9jStT2fKPUdJNPUd8+L24ngPxm9sniUAKZvF5 pUBvf9adhaSUh6tb1WoCt49O7Hwj8NNQZ7O/AsK4FQvP5TSV8IUjVQG5SYrRtsWGYI4Ja8 6gJId+Qcrl9bq29CdgxH5s2Uc+X6OcaGLFa0BCntGj5PvMnIjld9+3t38YrDoz1bvqrk1L t0345CAAkfp/AsFQqqX6I+bxniuCX+Tz/dSBxuI5wYrfwi2wFdwy8Po6VsbECrZH/0rX8u eCtz1QGEWO8wyx9QVr1ifWJ5xBsBeojVuNKIZUo76szhJ8s51w1Flicyrl57Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPr/SDd+8IHnxi5FYYQcz+DOxUyMQgTMbS0eB6DVjm0=; b=Bwpk4WFulO8oilg7n8TAqdFgfiAs9xr450eLScIzyS+8QXXMP2p+PwJrvV5UpaotgfgVJd ZOCw6eHCwxg4XwNfgFeqtpmIgroBtXThohuWhIgFUnkq1rLIpHqGSNJOI4s4u//wr4jvy/ VPPIzfpRsC+v5O74vlf1SIpcpUIohM2665gHrSuzBdxNM0R00g5Sk9NtyhZLhvBO8SkzIs 1Q/a35Xb0rab45k37yaEUqY7GQTG+59YMza18IklEc7uHH+l6RgS0AeJ+SlcbXMSkqIGND yFN9CH4J2Erj/JO0OpHEmrPZccHFr2JkrJdo4n3x9WaXZMDYdck4qsikraXCgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8yFq38dTzYfQ; Fri, 20 Sep 2024 03:15: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 48K3FxUA052245; Fri, 20 Sep 2024 03:15:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3FxNF052242; Fri, 20 Sep 2024 03:15:59 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:15:59 GMT Message-Id: <202409200315.48K3FxNF052242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 50455f73c281 - main - ixgbe: replace implicit fall-through comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50455f73c28114c665551cba267ec964491ccf21 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=50455f73c28114c665551cba267ec964491ccf21 commit 50455f73c28114c665551cba267ec964491ccf21 Author: Piotr Skajewski AuthorDate: 2024-09-20 03:12:41 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:15:05 +0000 ixgbe: replace implicit fall-through comments DPDK commit message Convert all "fall-through" comments to actual code. This aligns the code with the kernel which no longer allows implicit fallthrough. Signed-off-by: Piotr Skajewski Reviewed-by: Alice Michael Obtained from: DPDK (ae8211f) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_82599.c | 8 ++++++-- sys/dev/ixgbe/ixgbe_common.c | 10 ++++++---- sys/dev/ixgbe/ixgbe_x550.c | 11 +++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index a1d8b299bf80..1ecab83a4e92 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1759,7 +1759,9 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, case 0x0000: /* mask VLAN ID */ fdirm |= IXGBE_FDIRM_VLANID; - /* FALLTHROUGH */ + /* mask VLAN priority */ + fdirm |= IXGBE_FDIRM_VLANP; + break; case 0x0FFF: /* mask VLAN priority */ fdirm |= IXGBE_FDIRM_VLANP; @@ -2049,7 +2051,9 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, DEBUGOUT(" Error on src/dst port\n"); return IXGBE_ERR_CONFIG; } - /* FALLTHROUGH */ + input_mask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK | + IXGBE_ATR_L4TYPE_MASK; + break; case IXGBE_ATR_FLOW_TYPE_TCPV4: case IXGBE_ATR_FLOW_TYPE_TUNNELED_TCPV4: case IXGBE_ATR_FLOW_TYPE_UDPV4: diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index a7adf079f248..ff422a01c741 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -268,8 +268,8 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - /* only backplane uses autoc */ - /* FALLTHROUGH */ + reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA); + break; case ixgbe_media_type_fiber_fixed: case ixgbe_media_type_fiber_qsfp: case ixgbe_media_type_fiber: @@ -4779,8 +4779,10 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb, u32 headroom, rxpktsize <<= IXGBE_RXPBSIZE_SHIFT; for (; i < (num_pb / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); - /* configure remaining packet buffers */ - /* FALLTHROUGH */ + rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; + for (; i < num_pb; i++) + IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); + break; case PBA_STRATEGY_EQUAL: rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; for (; i < num_pb; i++) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 8fe8d037cf31..961d5c285e51 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -355,8 +355,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) /* set up for CS4227 usage */ ixgbe_setup_mux_ctl(hw); ixgbe_check_cs4227(hw); - /* Fallthrough */ - + return ixgbe_identify_sfp_module_X550em(hw); case IXGBE_DEV_ID_X550EM_A_SFP_N: return ixgbe_identify_sfp_module_X550em(hw); break; @@ -1869,7 +1868,9 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, break; } } - /* fall through */ + *speed = IXGBE_LINK_SPEED_10GB_FULL | + IXGBE_LINK_SPEED_1GB_FULL; + break; default: *speed = IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL; @@ -3589,7 +3590,9 @@ u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw) break; } } - /* fall through */ + physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR | + IXGBE_PHYSICAL_LAYER_1000BASE_KX; + break; case ixgbe_phy_x550em_xfi: physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR | IXGBE_PHYSICAL_LAYER_1000BASE_KX; From nobody Fri Sep 20 03:19:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8yL42hQ1z5Wd9B; Fri, 20 Sep 2024 03:19: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 4X8yL40JTGz4KkH; Fri, 20 Sep 2024 03:19:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eoYcvtncC4BdtVVFZD/KjDEyopH5qJWOw9+kS8BQEHw=; b=CMTJQpnt2q6T0WvCGAy99NgwoUHHyPtlpZeWkE4XiLhA37zhEtIqbgr67SWfBqUTe54a+I OjOsrJkkUteRigwSzaoPKFtkxzoSkQgTHRSdkNxuDxLbDL0zgNReLsNErmwoXnjphbNA5G 7lARi9xPDr9G1mo+6yszYft67Bcu4dzk4tPjfho824rQj7O1TULFGmzF3fKYaZLEuvceXy lsVBbwKTZOr3QiuRQzEI5pNawtzbx6iU3kiKh0DqEMaJ23PZJ7j5pdY5E8Y9lszpgugYMH 0CrsE4U05ZmdymX+uXvuge2/wjt3iqlxfxELea5snrDxwJc5VFiQb5h0jT24ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726802380; a=rsa-sha256; cv=none; b=RiD4mFpMuFbIFjZgSFOFtq3Jl7b9HRiP0+RNdhxr6lquchxLBbxrosbMN8WeCVTu+qDpYK wPWBrIyzbj4eCg1E1b3pY89/IMOa9b1SKUGme+USM6zyX1DSQoIdUT6zKtPPZ14LUCwPHE GvGOIfLCjjLQHuoxFgOZtLDNsUyTB+RdXnhk5vG1KlUZiy2FZx1p7kMWKtHV7W2+JlHA4n GwID/B8uOT6ENcbPbQCy+03XRprcFVltutnll7qy21hGfST4DanDquDX9YAGE+3Sti7YY1 9gzdnibI2zF/IEfdOfpPmv3y/ITwldyvlW2nDUqtpuJQaENb7m137z/VFaJlFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eoYcvtncC4BdtVVFZD/KjDEyopH5qJWOw9+kS8BQEHw=; b=NgZ+aYQbq2gt7LVvP1j40KxBDYvjhjZFA/AzQ6/8Ayhh2ZC2aodu0DuoyLAfQhe9fglRNG 02lNBt8gYmxo5yv1NO0zHuZrWDAKI6kxep9BaqrE/tHW0aPZySieeVT4fRvksPP7lRX0SF nGQt4y1Dicpwl9KX7rQgFK47XW1xhU+nwS4BJ75+Ke2UuoB9P+sDfgoMfPjVFSKv/kqK7H JVzI7YKzjLRAnsnwPW/pAGc0KpwewEjUVxi51Zei/2h6n2rSHWi+5y/7egu6hEgLCFzRWk UanWX6m9eew5ix1Vg8fqY2zCDVDQTdhFJrpzyfCkFNVJfKS+7xe5wb3Kb87KVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8yL370X2zYfV; Fri, 20 Sep 2024 03:19: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 48K3JdPN052870; Fri, 20 Sep 2024 03:19:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3JdI6052867; Fri, 20 Sep 2024 03:19:39 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:19:39 GMT Message-Id: <202409200319.48K3JdI6052867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 4530d49e68d3 - main - ixgbe: use primary and block terminology List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4530d49e68d331e9168d3a216d8a4b8e0d547578 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=4530d49e68d331e9168d3a216d8a4b8e0d547578 commit 4530d49e68d331e9168d3a216d8a4b8e0d547578 Author: Marcin Jurczak AuthorDate: 2024-09-20 03:18:00 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:18:00 +0000 ixgbe: use primary and block terminology DPDK commit message net/ixgbe/base: replace non-inclusive language This patch removes non-inclusive language from code, user interface and comments. Signed-off-by: Marcin Jurczak Reviewed-by: Alice Michael Obtained from: DPDK (f12a4bd) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_common.c | 34 +++++++++++++++++----------------- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_type.h | 10 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index ff422a01c741..7cf9b8d05127 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -171,7 +171,7 @@ bool ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw) case ixgbe_media_type_fiber_fixed: case ixgbe_media_type_fiber_qsfp: case ixgbe_media_type_fiber: - /* flow control autoneg black list */ + /* flow control autoneg block list */ switch (hw->device_id) { case IXGBE_DEV_ID_X550EM_A_SFP: case IXGBE_DEV_ID_X550EM_A_SFP_N: @@ -1146,10 +1146,10 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw) msec_delay(2); /* - * Prevent the PCI-E bus from hanging by disabling PCI-E master + * Prevent the PCI-E bus from hanging by disabling PCI-E primary * access and verify no pending requests */ - return ixgbe_disable_pcie_master(hw); + return ixgbe_disable_pcie_primary(hw); } /** @@ -3208,32 +3208,32 @@ static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw) } /** - * ixgbe_disable_pcie_master - Disable PCI-express master access + * ixgbe_disable_pcie_primary - Disable PCI-express primary access * @hw: pointer to hardware structure * - * Disables PCI-Express master access and verifies there are no pending - * requests. IXGBE_ERR_MASTER_REQUESTS_PENDING is returned if master disable - * bit hasn't caused the master requests to be disabled, else IXGBE_SUCCESS - * is returned signifying master requests disabled. + * Disables PCI-Express primary access and verifies there are no pending + * requests. IXGBE_ERR_PRIMARY_REQUESTS_PENDING is returned if primary disable + * bit hasn't caused the primary requests to be disabled, else IXGBE_SUCCESS + * is returned signifying primary requests disabled. **/ -s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw) +s32 ixgbe_disable_pcie_primary(struct ixgbe_hw *hw) { s32 status = IXGBE_SUCCESS; u32 i, poll; u16 value; - DEBUGFUNC("ixgbe_disable_pcie_master"); + DEBUGFUNC("ixgbe_disable_pcie_primary"); /* Always set this bit to ensure any future transactions are blocked */ IXGBE_WRITE_REG(hw, IXGBE_CTRL, IXGBE_CTRL_GIO_DIS); - /* Exit if master requests are blocked */ + /* Exit if primary requests are blocked */ if (!(IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_GIO) || IXGBE_REMOVED(hw->hw_addr)) goto out; - /* Poll for master request bit to clear */ - for (i = 0; i < IXGBE_PCI_MASTER_DISABLE_TIMEOUT; i++) { + /* Poll for primary request bit to clear */ + for (i = 0; i < IXGBE_PCI_PRIMARY_DISABLE_TIMEOUT; i++) { usec_delay(100); if (!(IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_GIO)) goto out; @@ -3241,13 +3241,13 @@ s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw) /* * Two consecutive resets are required via CTRL.RST per datasheet - * 5.2.5.3.2 Master Disable. We set a flag to inform the reset routine - * of this need. The first reset prevents new master requests from + * 5.2.5.3.2 Primary Disable. We set a flag to inform the reset routine + * of this need. The first reset prevents new primary requests from * being issued by our device. We then must wait 1usec or more for any * remaining completions from the PCIe bus to trickle in, and then reset * again to clear out any effects they may have had on our device. */ - DEBUGOUT("GIO Master Disable bit didn't clear - requesting resets\n"); + DEBUGOUT("GIO Primary Disable bit didn't clear - requesting resets\n"); hw->mac.flags |= IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; if (hw->mac.type >= ixgbe_mac_X550) @@ -3269,7 +3269,7 @@ s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw) ERROR_REPORT1(IXGBE_ERROR_POLLING, "PCIe transaction pending bit also did not clear.\n"); - status = IXGBE_ERR_MASTER_REQUESTS_PENDING; + status = IXGBE_ERR_PRIMARY_REQUESTS_PENDING; out: return status; diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index a55003b4cfe4..0ff5c60d40af 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -118,7 +118,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw); s32 ixgbe_validate_mac_addr(u8 *mac_addr); s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask); void ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u32 mask); -s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw); +s32 ixgbe_disable_pcie_primary(struct ixgbe_hw *hw); s32 prot_autoc_read_generic(struct ixgbe_hw *hw, bool *, u32 *reg_val); s32 prot_autoc_write_generic(struct ixgbe_hw *hw, u32 reg_val, bool locked); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 56d4863c8e07..f34bf8dace64 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1488,7 +1488,7 @@ struct ixgbe_dmac_config { #define IXGBE_PSRTYPE_RQPL_SHIFT 29 /* CTRL Bit Masks */ -#define IXGBE_CTRL_GIO_DIS 0x00000004 /* Global IO Master Disable bit */ +#define IXGBE_CTRL_GIO_DIS 0x00000004 /* Global IO Primary Disable bit */ #define IXGBE_CTRL_LNK_RST 0x00000008 /* Link Reset. Resets everything. */ #define IXGBE_CTRL_RST 0x04000000 /* Reset (SW) */ #define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST) @@ -2136,7 +2136,7 @@ enum { /* STATUS Bit Masks */ #define IXGBE_STATUS_LAN_ID 0x0000000C /* LAN ID */ #define IXGBE_STATUS_LAN_ID_SHIFT 2 /* LAN ID Shift*/ -#define IXGBE_STATUS_GIO 0x00080000 /* GIO Master Ena Status */ +#define IXGBE_STATUS_GIO 0x00080000 /* GIO Primary Ena Status */ #define IXGBE_STATUS_LAN_ID_0 0x00000000 /* LAN ID 0 */ #define IXGBE_STATUS_LAN_ID_1 0x00000004 /* LAN ID 1 */ @@ -2546,8 +2546,8 @@ enum { #define IXGBE_PCIDEVCTRL2_4_8s 0xd #define IXGBE_PCIDEVCTRL2_17_34s 0xe -/* Number of 100 microseconds we wait for PCI Express master disable */ -#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800 +/* Number of 100 microseconds we wait for PCI Express primary disable */ +#define IXGBE_PCI_PRIMARY_DISABLE_TIMEOUT 800 /* Check whether address is multicast. This is little-endian specific check.*/ #define IXGBE_IS_MULTICAST(Address) \ @@ -4221,7 +4221,7 @@ struct ixgbe_hw { #define IXGBE_ERR_ADAPTER_STOPPED -9 #define IXGBE_ERR_INVALID_MAC_ADDR -10 #define IXGBE_ERR_DEVICE_NOT_SUPPORTED -11 -#define IXGBE_ERR_MASTER_REQUESTS_PENDING -12 +#define IXGBE_ERR_PRIMARY_REQUESTS_PENDING -12 #define IXGBE_ERR_INVALID_LINK_SETTINGS -13 #define IXGBE_ERR_AUTONEG_NOT_COMPLETE -14 #define IXGBE_ERR_RESET_FAILED -15 From nobody Fri Sep 20 03:24:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8yRS4sB3z5WfMt; Fri, 20 Sep 2024 03:24: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 4X8yRS3wFMz4LZx; Fri, 20 Sep 2024 03:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RYiHMpCYWnMOF64zKhJhaesWZJFd13rkKYpiqX6XWW8=; b=uMIF+yE1vxofwywKAs17nt/BIv1v/OZRn9y+saSgzk1+Fv//R5Lc7IVLd/m6+tNL8Tpb1w QoV5eKKYf7dE0iav8wFHnqOkxECCrAnp5T/4fiXnby0BtStuEOJJMUEc9vXwneLWIeHnHW H48kGm9SwEWbSrzYBw18q7kp/2bNS4MI8AKIJZX+KlpxtFcm9dxRX5Ie4WbrA3hVJ4VCKQ WruxHY9E0Wl4GCZMmJgwja2ynGRFQpPTs4bqekSG3HvB9l/yWK+0cqVmk1nuJy+3RLC9To wpkfA+VquMAQKpCEGZt5kvCkOOg23td5fPd39SMUhp8tJJeDyLQdHnKhtEKv/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726802660; a=rsa-sha256; cv=none; b=uFopIFAKgIkl91iWUutLvxfEhg6W8OhFiPATWg8xDM1i/uNsZp+zDU2AS3934LbrwFIUOd ecAZTq4wioJkw1qNbf8i7gDbwVo0NLmvGRhP8dFeMT7uyJ7yuwjhw3hey0fBW7az+wj9KD 6mbkbSSz2IEJ6F9jNkpVa+xUjVDDSppL6zBff+N4tGRuKwbnPgA3URETaiahtSs83KgLaV zB5Z+9SYWu6JJ841Rjj4rVcuL7Ao4yctmnhFSj9F5hIg6r7/DB72pzrqsJIwJ3Z2IMhnEr nOvvJ7+mI9nFUIFb1SL+wbE4okuCk4SzTwl8ZjI4Jr3SKxATXly77QjqaIqUfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RYiHMpCYWnMOF64zKhJhaesWZJFd13rkKYpiqX6XWW8=; b=RVwyhslwnmEwEdV1L4S7HFJPlEE1QeNqez0qms+od/EYUMntYS6zTu2C2OsLb/YHgYTtWY Ph4XjxYbeoyQ5mZy8hFhJSezlU08+MC+4FASpwLpWt9YlEHclan4PJAMww5Fa630daPijj 02ITYaRYz2IjgrfDLlVXKauuP91RBt647yputzvlV6CBvl3N095vGcE9uLWZKjncmxjZpa h93It0fGtLL2wMORo+YsLhse87UVljJOO0UzAQR/V7Z8ootzdlxBZnvYzXJAqiIsmZdDr2 RV4FM7X+d5D1KEyR405w7GbSUqQxkFStAir6t4iWsjs9GH0eeIXhf9ZK971Oyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8yRS3WLrzYTp; Fri, 20 Sep 2024 03:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48K3OKCM068676; Fri, 20 Sep 2024 03:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3OKZD068673; Fri, 20 Sep 2024 03:24:20 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:24:20 GMT Message-Id: <202409200324.48K3OKZD068673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 3167854b9d21 - main - ixgbe: remove circular dependency in ixgbe_mbx.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3167854b9d2188c4039239f741870e044b7507ac Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=3167854b9d2188c4039239f741870e044b7507ac commit 3167854b9d2188c4039239f741870e044b7507ac Author: Barbara Skobiej AuthorDate: 2024-09-20 03:22:35 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:22:35 +0000 ixgbe: remove circular dependency in ixgbe_mbx.h DPDK commit message net/ixgbe/base: remove circular header dependency Including one header file in second header file should be avoided, so fix it by forward declaring the struct instead. Signed-off-by: Barbara Skobiej Obtained from: DPDK (0bc2af5) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 7a982ce89f93..3a9bd34a137f 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -35,7 +35,7 @@ #ifndef _IXGBE_MBX_H_ #define _IXGBE_MBX_H_ -#include "ixgbe_type.h" +struct ixgbe_hw; struct ixgbe_mbx_operations { void (*init_params)(struct ixgbe_hw *hw); From nobody Fri Sep 20 03:28:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8yWt0BQFz5WgBl; Fri, 20 Sep 2024 03:28: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 4X8yWs6jLrz4MGP; Fri, 20 Sep 2024 03:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NKlSY7QS9TOcvYKzKz8NRqelIs9dbhgIQ3KXmONzRRo=; b=h6k9YwIK7kP1pcg1WmtV30sQz/oZzWigzvKQpUx1jGrtdhNXVPqnpWocd/ankySjyTulHQ gZ8uJR6jDHBKytBT5+b7Na9Q4IQy3JbGy96i7pif4kOtUZ2OQ3ObIk4rjbJyi5olZFCwZq AXxcR2wu2lHvI11HH4QOmpwTNkt2eQ+AsO5enQhGKM1X0d0Wh50UM8oCMlnW0YY8dlieij OECQPQktwULN2JgY1ZRWGFsXuWi2d+DrLZJa29dGclo7OqiQwwxCSZz4YUvasool6HDeor LmTL193G72EeFo00JGpt+yy1OXHeQrnJNbDY9oUoQWKvS5VlKSHjHLQyE46pAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726802889; a=rsa-sha256; cv=none; b=GoCAjtNdyRVRElAbS1kA9SXkzV7FNBJeyZU1m7K+9UbQiOHQ5KCbb5AyKaXbIYGSxPgAjy sPjuxyd13WGMSym0B1TggTHLG9RIBNGzUZyhLvUJ+FwARhaNZFtxOsK2V5KhKq2k6o94YC 46XUxVhitD4OPHT9GOXL/gacmjovmfRznAvqT+z1hWqT0zmx6h95Ez4p4+1fwQvS0Mqvia Ap3kv0DDtBBpxWjkzxBdO7KFuqkCCDKKkwzhOR1oaWz3mxSKCWpw8FVoUdpk9ekxambiAw 7+sBYcAamQly1WKTi8XL1mMLE1XeYj3WdERIuvYYONeboGj9LwtKEn6qWEOrQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726802889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NKlSY7QS9TOcvYKzKz8NRqelIs9dbhgIQ3KXmONzRRo=; b=XMG8dK02yI46fGBTU8bv4qWBCQhmFWKNBkRCv2jBgKJW/QQQOCOG1LMSnHt1CdFOsOyh0K 04bUHjmasLXIDAscywE0ScspZMaEjPkWUFhh67aTlBuIEH4Jm+2tZUc/oz8an/HwrnlApm kEVK2Yk8EaXUxtgp5qISjmoSFcGnSzysqG6BJFlD3RkXMTBmytDSbG72TVZ0lZ1gSZ3YWK XnicHEJ1YFHd7XWKIXTYq8VHqATpxyHOMRA/epLfuEBWzP0zc/48g7SOngVc29rLBHZhaA HOQ4bZQwaCv7AkFgceFlPyXTEoaN5x76PnnEeH/cHBdE7PfIA/O7UqKQWS4EMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8yWs6JPLzYrZ; Fri, 20 Sep 2024 03:28: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 48K3S9sJ069309; Fri, 20 Sep 2024 03:28:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3S9Gl069306; Fri, 20 Sep 2024 03:28:09 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:28:09 GMT Message-Id: <202409200328.48K3S9Gl069306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: bfa48c32bc40 - main - ixgbe: add missing QV defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfa48c32bc4099cb58b9fe7efab7f376475539ef Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=bfa48c32bc4099cb58b9fe7efab7f376475539ef commit bfa48c32bc4099cb58b9fe7efab7f376475539ef Author: Barbara Skobiej AuthorDate: 2024-09-20 03:27:21 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:27:21 +0000 ixgbe: add missing QV defines DPDK commit message net/ixgbe/base: add missing QV defines This patch adds missing QV defines: - offset of ANVM data - Immediate Field module pointer offset - 2.5GBASE-T and 5GBASE-T physical layer types for X550 Signed-off-by: Barbara Skobiej Signed-off-by: Jan Sokolowski Obtained from: DPDK (a730b83) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_type.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index f34bf8dace64..dbcc6544133e 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -3105,6 +3105,7 @@ enum ixgbe_fdir_pballoc_type { #define FW_SHADOW_RAM_DUMP_LEN 0 #define FW_DEFAULT_CHECKSUM 0xFF /* checksum always 0xFF */ #define FW_NVM_DATA_OFFSET 3 +#define FW_ANVM_DATA_OFFSET 3 #define FW_MAX_READ_BUFFER_SIZE 1024 #define FW_DISABLE_RXEN_CMD 0xDE #define FW_DISABLE_RXEN_LEN 0x1 @@ -3176,6 +3177,8 @@ enum ixgbe_fdir_pballoc_type { #define FW_PHY_INFO_ID_HI_MASK 0xFFFF0000u #define FW_PHY_INFO_ID_LO_MASK 0x0000FFFFu +#define IXGBE_SR_IMMEDIATE_VALUES_PTR 0x4E + /* Host Interface Command Structures */ #pragma pack(push, 1) @@ -3479,6 +3482,8 @@ typedef u64 ixgbe_physical_layer; #define IXGBE_PHYSICAL_LAYER_1000BASE_SX 0x04000 #define IXGBE_PHYSICAL_LAYER_10BASE_T 0x08000 #define IXGBE_PHYSICAL_LAYER_2500BASE_KX 0x10000 +#define IXGBE_PHYSICAL_LAYER_2500BASE_T 0x20000 +#define IXGBE_PHYSICAL_LAYER_5000BASE_T 0x40000 /* Flow Control Data Sheet defined values * Calculation and defines taken from 802.1bb Annex O From nobody Fri Sep 20 03:32:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ycM6Bj2z5Wgr2; Fri, 20 Sep 2024 03:32: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 4X8ycM4zmRz4NMw; Fri, 20 Sep 2024 03:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726803123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=te+jYGQkURTOvZZL1WyykuIKfiuoqDoCs5uT3o44QMs=; b=I9gvDImO7jbkHj/E6Z15eKyjRzyeYN8bVJv2M+PaTC1Cu+2wgkLEUEnWZcfI3fPMf0xEAC g+aQIGdoARSmuhPDceloJF1a3sBYj4yb6X/ulipPICIUKvDpi13Ng4p2MU06RMq2tj6dvx xcxPqCgSEIVa5UKwdx28jF8y2PuBYJEIDwthrBtKeTL0aJ8oK2geut90kp7Rqn1mYoh9RR BmVkil9IizkvO4hQr5m/oWWrl+FDsb+Pd7JpHXMAU5KBu7MJCuubGByO0J90qMjY/aHxaS MQ+k30TXRUgyfOb9xTvjiy6t5A9PlzQR4uU1e8NSI9nKZcKurGCwS+vvftnKjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726803123; a=rsa-sha256; cv=none; b=jpRdLM5oDZBiwwesnJpfBajy4dpg2g69XP25EE3nbsa7b+C/tvqLgv46qGETNclmZ2eicl I8KKVrjHcSuo0FLdvyPdFPownXiCBkY7r0EU3VghGKfcNlW8vmGwv6qyar2RIAuelFYSTj Dp0NNr7a/qe94DdF0rNu+JAhXc6Wg/SVidW9YolGMNeTpyu7aCvAgSrqKQvXc+eECdsIbL AEJRK6SMN7EAHIq69/KD0hndl6+AQjZFOW0PtWyjUf92Anbboj2wwjGxQ4YQS7p2tNF9bF lx4BOX5iwmjj9/zamf3DymTi6r9T43nKAHrcXxF8STtJ3Py1N6XdcrOt+02dFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726803123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=te+jYGQkURTOvZZL1WyykuIKfiuoqDoCs5uT3o44QMs=; b=rlT9Poyk/bGJubz4krHnFaUtTVCrUIw6N8goqUh5sZtUBKaQg9pJL6GYoVZ/6qZ/oOT9d8 DEhkeDID9YdceHB6SriNY63GvUJbaGEshKG5Ew8A8+DGVZWhKN32SacjlT8SDaq4Cidven ThvTOfFcyVvf3DsbU2YC+IqsE8wYO48f/ErQ6GwuTTyNrtOTibQ8rw0BdpCUIKG77R2K1y 0puNDgetI7S/CzfpvqLutbzqUEBt3BntyBu6hj9ym7MRrzUIYCvXmX7DP03hifYDdX43I6 EWnFoxst9cIV4DZS4kD05sFQAQbJwFczYNM2Fht7a8ROOsEL2UWTEIf6bojjmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ycM4bCzzYVd; Fri, 20 Sep 2024 03:32: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 48K3W3hW081218; Fri, 20 Sep 2024 03:32:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3W33B081215; Fri, 20 Sep 2024 03:32:03 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:32:03 GMT Message-Id: <202409200332.48K3W33B081215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: cc9944183187 - main - ixgbe: improve Atom C3000 SWFW semaphore acq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc9944183187308a71489651b11342d293aac7d1 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=cc9944183187308a71489651b11342d293aac7d1 commit cc9944183187308a71489651b11342d293aac7d1 Author: Barbara Skobiej AuthorDate: 2024-09-20 03:29:36 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:31:18 +0000 ixgbe: improve Atom C3000 SWFW semaphore acq DPDK commit message net/ixgbe/base: improve SWFW semaphore acquisition HWSW semaphore acquisition in Atom C3000 NIC is a two stage process. Each time two semaphore acquisitions are required. Each second semaphore failure requires re-acquisition of first semaphore. This patch decouples the two acquisitions preventing potentially hundreds of thousands of unnecessary loop iterations. Signed-off-by: Barbara Skobiej Obtained from: DPDK (99f960c) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_x550.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 961d5c285e51..ba72b5d1366e 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -4242,36 +4242,39 @@ static s32 ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask) DEBUGFUNC("ixgbe_acquire_swfw_sync_X550a"); - while (--retries) { - status = IXGBE_SUCCESS; - if (hmask) - status = ixgbe_acquire_swfw_sync_X540(hw, hmask); - if (status) { - DEBUGOUT1("Could not acquire SWFW semaphore, Status = %d\n", - status); - return status; - } - if (!(mask & IXGBE_GSSR_TOKEN_SM)) - return IXGBE_SUCCESS; + status = IXGBE_SUCCESS; + if (hmask) + status = ixgbe_acquire_swfw_sync_X540(hw, hmask); + + if (status) { + DEBUGOUT1("Could not acquire SWFW semaphore, Status = %d\n", status); + return status; + } + + if (!(mask & IXGBE_GSSR_TOKEN_SM)) + return IXGBE_SUCCESS; + while (--retries) { status = ixgbe_get_phy_token(hw); - if (status == IXGBE_ERR_TOKEN_RETRY) - DEBUGOUT1("Could not acquire PHY token, Status = %d\n", - status); if (status == IXGBE_SUCCESS) return IXGBE_SUCCESS; - if (hmask) - ixgbe_release_swfw_sync_X540(hw, hmask); - if (status != IXGBE_ERR_TOKEN_RETRY) { - DEBUGOUT1("Unable to retry acquiring the PHY token, Status = %d\n", - status); + DEBUGOUT1("Retry acquiring the PHY token failed, Status = %d\n", status); + if (hmask) + ixgbe_release_swfw_sync_X540(hw, hmask); return status; } + + if (status == IXGBE_ERR_TOKEN_RETRY) + DEBUGOUT1("Could not acquire PHY token, Status = %d\n", + status); } + if (hmask) + ixgbe_release_swfw_sync_X540(hw, hmask); + DEBUGOUT1("Semaphore acquisition retries failed!: PHY ID = 0x%08X\n", hw->phy.id); return status; From nobody Fri Sep 20 03:34:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ygd6ZbJz5Whpb; Fri, 20 Sep 2024 03:34: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 4X8ygd5sLnz4P6h; Fri, 20 Sep 2024 03:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726803293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cSmpvv4ppG52qGNKx7DJtpaEkY/FN8i3ejiItKC5Vac=; b=sM/+kNpTypcSy5Anis+hwYg6m14mShbTt76cVoNv1B0UwVrzlq7K7zPOeVYbpcTxsk+lEd WxKtbfIJPOiPzXK2dTJI/0ZkjBykWO1XvzFtEMzWET1asLXNUynbYQl6EVAn7GqeaP/zSz /Wi8oo8uq8B+QviAXCSo0FjdW++xHhnM0z+9rFI3WcITLU5RxBXrVUrtgYFwBV2ZhfHAjb y3pYbQMfBD4r0KCm5q8D4zWpH/s/gRef0XbMRF7tYkP7OkBzinaN3ONc85mw2443HJPKrh SO96/GxLXcfjU7q/GJ7oOnSc362mw5n/xHhw23r9d57w9U7KAKlfzMDWIPGTiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726803293; a=rsa-sha256; cv=none; b=gyG/nHiNhNQsk7ETcJ46c3usY4FSBhzcXWErN69N0IAE+0jOP4pQ7KyI6wR0PKlSeWFTd4 hjl/nwm0L7NPaEqwMJckx2BlN/qtFm8Ump47JpNVijyE9E47FKu9EoZNMIYBFGR8zPt/Vq hHYh/iv92JVIkHpaEq0PsK6q47NsnllpIhx0/xK/ImU+4O9NMq2C713oNatk+qzz+QZ0rP BJ9gBLt64IeDXiBlE3jkVKdCzAJ4DWi9O2u3WW87iQ0CISl3DQ2Y+xaf/SRTOg9Tie7p9h DPyXHHm5XGDnlcHqM136ER5fKe54zlUWoAUbCiZZ2Oqz2E6tQK/3IpqE+IAuUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726803293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cSmpvv4ppG52qGNKx7DJtpaEkY/FN8i3ejiItKC5Vac=; b=CLRr8ZBHaWvbiayhGBnA5BPx8WfsDmu9VqgdTBAGAe+odx2ZePT7++gaJof/o3S4lAryzh p2kbBi2VpqAkTuKgDLf1N+4ssN9DhelsGd7U7LX0ZSbwnVg2tUr7tDKSdFoNvxOrb05e49 gjxjjqB36GQpV6shY+XezOFxN7sln/3dj/P5vBye9vytA33pw7uug0wQnFOg33nZIzPXiW sET9IJeA4OON29nHlFK/GG35s0QKKjm2gdvzXzeuICLOIrzE8ui8NJlxRFIv4F9MMYkFPZ jSnzU/F+ITRCTw618/4Li4BzJPPxG6pHn0B3ScJ7ZTMgONKMxcCOc21HiyG0pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ygd5SV3zYs1; Fri, 20 Sep 2024 03:34: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 48K3YrAK085988; Fri, 20 Sep 2024 03:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K3Yrqa085985; Fri, 20 Sep 2024 03:34:53 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:34:53 GMT Message-Id: <202409200334.48K3Yrqa085985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 25771c8c1ae6 - main - ixgbe: prevent PBA read over eeprom word size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25771c8c1ae606436823854de01fc2b23178e353 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=25771c8c1ae606436823854de01fc2b23178e353 commit 25771c8c1ae606436823854de01fc2b23178e353 Author: Dawid Zielinski AuthorDate: 2024-09-20 03:33:37 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:33:37 +0000 ixgbe: prevent PBA read over eeprom word size DPDK commit message net/ixgbe/base: prevent untrusted loop bound Added length check against EEPROM size in words to prevent untrusted loop bound reported by static code analysis. Signed-off-by: Dawid Zielinski Obtained from: DPDK (6b58617) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 7cf9b8d05127..7643d4028529 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -713,7 +713,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, return ret_val; } - if (length == 0xFFFF || length == 0) { + if (length == 0xFFFF || length == 0 || length > hw->eeprom.word_size) { DEBUGOUT("NVM PBA number section invalid length\n"); return IXGBE_ERR_PBA_SECTION; } From nobody Fri Sep 20 03:37:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ykp2yG5z5Wj9f; Fri, 20 Sep 2024 03: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 4X8ykp298cz4Phr; Fri, 20 Sep 2024 03: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=1726803458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cvzSWTt4j2+hWshoDNjnQ2KzHWR4lEotl0EaDO/VXxw=; b=g7cpkCWHkT0WJuaSlJEDjSGXo/ObkbOr1x0bW6omB7EG2B4Z6Vg0itUUYbX2pmJ1cTAZgW KnAWvYMhQC93aSseyDsnpLI5tSat/CXqy4ynIcXPc2GYN9sbVryT3MvCVN68yTJZ1Ou+U9 hcP+VOxAm0XnDe51mJI8ef/j747fLHisSnQPoYc4fF00tGAucBei2zUpq9LFHFvXULPkWQ bUzrMeAQ88o3iqHYXJeZLlMxr/iUQN36g1mq6dDZLDEFzWw9eydjlP0mx3G3pMBWSNmgA3 wu/RJZ2OiC3cjCYFL5+T+u84Yk2rtiTgUktU+Y73bv/0PNLRs/tMF1lbSYOWiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726803458; a=rsa-sha256; cv=none; b=k/Bgpggo14o7mA8isETd+HTuDOiXBLjDnBjWLddueVuWmawzlD0OJVXdjWpv5QpkJZqTZ+ g39+goUe0ne013EmYyy//qaf4Mj5OmTf7kT/9NFJp/mTpTTLLpOigRUni5XvSWA3EUPoMY 8dtPJiJ6bJHaAENIwGscaoPJ8j83PfpTN/LAdcBXPp0HNq0NkCtDlGV4r1kMoFBY74Pk0Q kAFeq2UUGfm5WdqPNi8ZM/PbZYrUbRudWGHR+tbo+P7EizJ30y1PFUJ7s1uEHeLrg6/1Sa j9TK5XWtG7BK/3xt8LiGYkbHpf2/WbHATfbNEUlrNh0zqG7htOwOnOysjFF1kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726803458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cvzSWTt4j2+hWshoDNjnQ2KzHWR4lEotl0EaDO/VXxw=; b=XuVUvaNuIm+kAHOEUmoNaM40C3HglucjodxlCCYG005VynTuE1rVh6hYkD5QXvYFoKNRby b3kuajr2SsDplUOyCbZgCz1v+E8/BP+pVGNTP77tSWyvtb5nhzDzaYmbhfPK5mdmm003L1 scNrKwf3xph0VN8z+y6Ap7LIyI5U5PUgGY+jl3exKCvq4Cbo8fIKcBCC9ewiN98vPJ04pM 7dlNX/YiAzlI9c7dGoPPSRVHeraGw1Uyj3XvM5Dv/52F4G7qr28thVGS77Osm+PcQHCkSA BEuO7aKXGv/Q8yHLsEho7f2uZj5LzYNbF9pLW8+doO9OFy0vLpmWa/YzISIlMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ykp1fFtzYdp; Fri, 20 Sep 2024 03:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48K3bcek086494; Fri, 20 Sep 2024 03: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 48K3bca3086491; Fri, 20 Sep 2024 03:37:38 GMT (envelope-from git) Date: Fri, 20 Sep 2024 03:37:38 GMT Message-Id: <202409200337.48K3bca3086491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 420c98447027 - main - ixgbe: remove unused function prototypes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 420c984470270e0f7200124d8015236584aef243 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=420c984470270e0f7200124d8015236584aef243 commit 420c984470270e0f7200124d8015236584aef243 Author: Chinh Cao AuthorDate: 2024-09-20 03:36:14 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 03:37:07 +0000 ixgbe: remove unused function prototypes DPDK commit message net/ixgbe/base: remove unused function prototypes There are some function prototypes that were introduced at some point but were never implemented, so remove them. Signed-off-by: Chinh Cao Obtained from: DPDK (e9cc1b4) MFC after: 1 week --- sys/dev/ixgbe/ixgbe_api.h | 1 - sys/dev/ixgbe/ixgbe_x550.h | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index 9134971d9c98..33c1cd1baeaf 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -148,7 +148,6 @@ u64 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw); s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval); s32 ixgbe_disable_sec_rx_path(struct ixgbe_hw *hw); s32 ixgbe_enable_sec_rx_path(struct ixgbe_hw *hw); -s32 ixgbe_mng_fw_enabled(struct ixgbe_hw *hw); s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw); s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl); s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index 45e4cad9f1f7..8bff5e3d2bf6 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -103,7 +103,6 @@ s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, u16 phy_data); s32 ixgbe_setup_fc_fiber_x550em_a(struct ixgbe_hw *hw); s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw); -s32 ixgbe_setup_fc_sgmii_x550em_a(struct ixgbe_hw *hw); void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw); void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw); void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw); From nobody Fri Sep 20 03:59:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8zDQ2YPMz5Wplr; Fri, 20 Sep 2024 03:59:50 +0000 (UTC) (envelope-from vishwin@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 4X8zDQ1qsPz4TCs; Fri, 20 Sep 2024 03:59:50 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726804790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=WuHQqsfTL2ipT+h/GE+cz0yOjXvmfHvRsGZsLcs0Fj4=; b=gZVoVhMhvA3TffJhCHPHRGFiDHJvh+7NxyQAEAyk8McsEwQoyAhlJTLis+GqG1LyK854ne XXKTaOoyCWSmGXODgzNqCi7HWJwo24j8YpGnKM3gqA+48OxKl4D0OREeXNmfyQxK/2Vh5K AkTXVJMGHUB6Mf0ApzBJI3YLi57qQc8RD/QWQj4Ky1HUOlqHMLtAtbpsxvaGDzgM/1R/UQ q60nMr07c2NrtV1JzgDfwlOkLRZsSbn9+lHm6GN7b+LOLluoMT0noKmgkTjMiThA5HfDAZ Xe6HGJkdIhghyClXxR2NUo2kIHYwLvpSeEIHwxUSpW7jnXHDYkvhrDScVXMmNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726804790; a=rsa-sha256; cv=none; b=R1ISp0i881bk7xyPV7Om6Huz2Vy8POrlHTw+zrMWeI1uue3bUmG0J3x9vkoMETB61aF52C Kbp4gPoWVR/cDXeE72pObt9JOWEcZe0abAibHX/CGhNbXRHH1TXJZ6x4gquI+gdjlrr6ZA MQ6WRJiyto/aEJ8PEhK1DQqeItLf/AvMWT48ij9ECDaIFRUzQLz2GhkQJs1WNHgX28c3g0 4whGBS2z3L/MFtQK6eVKre5SIEZwz+eYHRe0UTE7bewLHs7FjnKSan93YPS2v3OtATcQgK E5Yj7ASVdwWoBbv2hhoma53ebzPQVxIK8WWBskhy0oD3RW2H6LnVxQJZr4t22Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726804790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=WuHQqsfTL2ipT+h/GE+cz0yOjXvmfHvRsGZsLcs0Fj4=; b=DtnTebzojhojccJfS67zH9UKcXEvrFAJk74N+ywqMzCfg6UcYKWjXcPx9izojW7XN0iK7t RJf3CpU+gwJu4NosBrnmWEEVCjxDZoHqhFJ5q28WlQ+PS8eel4MNsxDl8PuvqXQwi1U8fR 8B80gS/LO8U85/S64UV9mF6vsl5uzLpSpF3ZvXtcC5Y8hnzLjSiBK5RwSyfRIsx5q+Xii0 QSJNCtvLgpG/sg6SrhNhcYaOXuCUk6dCKvaMs/l8HkMy5SccUy42Fdw8dkD1c2GB0ZQ+fk K634H4tvKwjJ0BfoPTd+qv3nti41d9K8j7tbR+Dhz24KVfIcs6Cj9XzHcMeOvQ== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (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: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X8zDP5vnHz1H23; Fri, 20 Sep 2024 03:59:49 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: <084fa85b-7112-4dc5-bdb0-dbf727a28af0@freebsd.org> Date: Thu, 19 Sep 2024 23:59:47 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros To: Kevin Bowling , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEZFWWqBYJKwYBBAHaRw8BAQdAINFDmM+bgGkT1C4nD5a3BxgcH8Xnx5qTJbPuIBxD57LN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbAwUJA+3ogAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRBnj5NgWEFcyllaAP9CGICFEvTUOv5BYh/H8m49VJ87a/wd 0obeQfVBnS464AD9FopTHbjEs0HDV0ZYmJPxzJIznjumsj9gBxX0bBqqTgzOOARkVZaoEgor BgEEAZdVAQUBAQdA6BUWuG5RuT0vmtoDyCUUqiJGdtd78GM5ic3kw2AntSADAQgHwn4EGBYK ACYWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZFWWqAIbDAUJA+3ogAAKCRBnj5NgWEFcyn55 AP9ezKDCUgHqAq6JX976abb9pYdbSjxxNJqnrjgNkfhgIQD/QhR+fgnUHhcGTMBy+pYHZUGH 5DCuITsK1U4+v252uws= Organization: FreeBSD Project In-Reply-To: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------jMLGfcmIVMZYP1yKeDXc1Sw7" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------jMLGfcmIVMZYP1yKeDXc1Sw7 Content-Type: multipart/mixed; boundary="------------lDaYKhqfuvKhGwDlPweCYMHW"; protected-headers="v1" From: Charlie Li To: Kevin Bowling , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <084fa85b-7112-4dc5-bdb0-dbf727a28af0@freebsd.org> Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros References: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> In-Reply-To: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> --------------lDaYKhqfuvKhGwDlPweCYMHW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 S2V2aW4gQm93bGluZyB3cm90ZToNCj4gVGhlIGJyYW5jaCBtYWluIGhhcyBiZWVuIHVwZGF0 ZWQgYnkga2Jvd2xpbmc6DQo+IA0KPiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9z cmMvY29tbWl0Lz9pZD0xMDc0NjA0MDgyMGVlNTE4NmNhZjRkNGQ2MWNmODgxOTZlYzIxM2Jh DQo+IA0KPiBjb21taXQgMTA3NDYwNDA4MjBlZTUxODZjYWY0ZDRkNjFjZjg4MTk2ZWMyMTNi YQ0KPiBBdXRob3I6ICAgICBKYWt1YiBDaHlsa293c2tpIDxqYWt1YnguY2h5bGtvd3NraUBp bnRlbC5jb20+DQo+IEF1dGhvckRhdGU6IDIwMjQtMDktMTkgMjE6MDI6MDYgKzAwMDANCj4g Q29tbWl0OiAgICAgS2V2aW4gQm93bGluZyA8a2Jvd2xpbmdARnJlZUJTRC5vcmc+DQo+IENv bW1pdERhdGU6IDIwMjQtMDktMTkgMjE6MDM6MTggKzAwMDANCj4gDQo+ICAgICAgaXhnYmU6 IHJlbmFtZSBWRiBtZXNzYWdlIHR5cGUgbWFjcm9zDQo+ICAgICAgDQo+ICAgICAgRFBESyBj b21taXQgbWVzc2FnZQ0KPiAgICAgIA0KPiAgICAgIFRoZXJlIGlzIG5hbWUgc2ltaWxhcml0 eSB3aXRoaW4gSVhHQkVfVlRfTVNHVFlQRV9BQ0sgYW5kDQo+ICAgICAgUEZNQUlMQk9YLkFD SyAvIFZGTUFJTEJPWC5BQ0sgd2hpY2ggbWF5IGNhdXNlIGNvbmZ1c2lvbi4gUmVuYW1lIE1T R1RZUEUNCj4gICAgICBtYWNyb3MgdG8gU1VDQ0VTUyBhbmQgRkFJTFVSRSBhcyB0aGV5IGFy ZSBub3Qgc3BlY2lmaWVkIGluIGRhdGFzaGVldCBhbmQNCj4gICAgICBub3cgd2lsbCBiZSBl YXNpbHkgZGlzdGluZ3Vpc2hhYmxlLg0KPiAgICAgIA0KPiAgICAgIFNpZ25lZC1vZmYtYnk6 IEpha3ViIENoeWxrb3dza2kgPGpha3VieC5jaHlsa293c2tpQGludGVsLmNvbT4NCj4gICAg ICBSZXZpZXdlZC1ieTogTWFyZWsgWmFsZnJlc3NvLWp1bmR6aWxsbyA8bWFyZWt4LnphbGZy ZXNzby1qdW5kemlsbG9AaW50ZWwuY29tPg0KPiAgICAgIFJldmlld2VkLWJ5OiBBbGljZSBN aWNoYWVsIDxhbGljZS5taWNoYWVsQGludGVsLmNvbT4NCj4gICAgICBSZXZpZXdlZC1ieTog UGlvdHIgU2thamV3c2tpIDxwaW90cnguc2thamV3c2tpQGludGVsLmNvbT4NCj4gICAgICBS ZXZpZXdlZC1ieTogU2xhd29taXIgTXJvem93aWN6IDxzbGF3b21pcngubXJvem93aWN6QGlu dGVsLmNvbT4NCj4gICAgICBUZXN0ZWQtYnk6IFBpb3RyIFNrYWpld3NraSA8cGlvdHJ4LnNr YWpld3NraUBpbnRlbC5jb20+DQo+ICAgICAgVGVzdGVkLWJ5OiBBbGljZSBNaWNoYWVsIDxh bGljZS5taWNoYWVsQGludGVsLmNvbT4NCj4gICAgICANCj4gICAgICBPYnRhaW5lZCBmcm9t OiAgRFBESyAoNGY2NzVjOSkNCj4gICAgICBNRkMgYWZ0ZXI6ICAgICAgMSB3ZWVrDQo+IC0t LQ0KPiAgIHN5cy9kZXYvaXhnYmUvaWZfc3Jpb3YuYyAgfCAxMCArKysrKy0tLS0tDQo+ICAg c3lzL2Rldi9peGdiZS9peGdiZV9tYnguaCB8IDE0ICsrKysrKystLS0tLS0tDQo+ICAgc3lz L2Rldi9peGdiZS9peGdiZV92Zi5jICB8IDM0ICsrKysrKysrKysrKysrKysrKy0tLS0tLS0t LS0tLS0tLS0NCj4gICAzIGZpbGVzIGNoYW5nZWQsIDMwIGluc2VydGlvbnMoKyksIDI4IGRl bGV0aW9ucygtKQ0KPiANCj4gZGlmZiAtLWdpdCBhL3N5cy9kZXYvaXhnYmUvaWZfc3Jpb3Yu YyBiL3N5cy9kZXYvaXhnYmUvaWZfc3Jpb3YuYw0KPiBpbmRleCA3Y2RkMjg3Yjg1YmYuLmEx NjA5MmM5ZjY4OCAxMDA2NDQNCj4gLS0tIGEvc3lzL2Rldi9peGdiZS9pZl9zcmlvdi5jDQo+ ICsrKyBiL3N5cy9kZXYvaXhnYmUvaWZfc3Jpb3YuYw0KPiBAQCAtMTA3LDE0ICsxMDcsMTQg QEAgc3RhdGljIGlubGluZSB2b2lkDQo+ICAgaXhnYmVfc2VuZF92Zl9hY2soc3RydWN0IGl4 Z2JlX3NvZnRjICpzYywgc3RydWN0IGl4Z2JlX3ZmICp2ZiwgdTMyIG1zZykNCj4gICB7DQo+ ICAgCW1zZyAmPSBJWEdCRV9WVF9NU0dfTUFTSzsNCj4gLQlpeGdiZV9zZW5kX3ZmX21zZyhz YywgdmYsIG1zZyB8IElYR0JFX1ZUX01TR1RZUEVfQUNLKTsNCj4gKwlpeGdiZV9zZW5kX3Zm X21zZyhzYywgdmYsIG1zZyB8IElYR0JFX1ZUX01TR1RZUEVfU1VDQ0VTUyk7DQo+ICAgfQ0K PiAgIA0KPiAgIHN0YXRpYyBpbmxpbmUgdm9pZA0KPiAgIGl4Z2JlX3NlbmRfdmZfbmFjayhz dHJ1Y3QgaXhnYmVfc29mdGMgKnNjLCBzdHJ1Y3QgaXhnYmVfdmYgKnZmLCB1MzIgbXNnKQ0K PiAgIHsNCj4gICAJbXNnICY9IElYR0JFX1ZUX01TR19NQVNLOw0KPiAtCWl4Z2JlX3NlbmRf dmZfbXNnKHNjLCB2ZiwgbXNnIHwgSVhHQkVfVlRfTVNHVFlQRV9OQUNLKTsNCj4gKwlpeGdi ZV9zZW5kX3ZmX21zZyhzYywgdmYsIG1zZyB8IElYR0JFX1ZUX01TR1RZUEVfRkFJTFVSRSk7 DQo+ICAgfQ0KPiAgIA0KPiAgIHN0YXRpYyBpbmxpbmUgdm9pZA0KPiBAQCAtMzYyLDkgKzM2 Miw5IEBAIGl4Z2JlX3ZmX3Jlc2V0X21zZyhzdHJ1Y3QgaXhnYmVfc29mdGMgKnNjLCBzdHJ1 Y3QgaXhnYmVfdmYgKnZmLCB1aW50MzJfdCAqbXNnKQ0KPiAgIAlpZiAoaXhnYmVfdmFsaWRh dGVfbWFjX2FkZHIodmYtPmV0aGVyX2FkZHIpID09IDApIHsNCj4gICAJCWl4Z2JlX3NldF9y YXIoJnNjLT5odywgdmYtPnJhcl9pbmRleCwgdmYtPmV0aGVyX2FkZHIsDQo+ICAgCQkgICAg dmYtPnBvb2wsIHRydWUpOw0KPiAtCQlhY2sgPSBJWEdCRV9WVF9NU0dUWVBFX0FDSzsNCj4g KwkJYWNrID0gSVhHQkVfVlRfTVNHVFlQRV9TVUNDRVNTOw0KPiAgIAl9IGVsc2UNCj4gLQkJ YWNrID0gSVhHQkVfVlRfTVNHVFlQRV9OQUNLOw0KPiArCQlhY2sgPSBJWEdCRV9WVF9NU0dU WVBFX0ZBSUxVUkU7DQo+ICAgDQo+ICAgCWl4Z2JlX3ZmX2VuYWJsZV90cmFuc21pdChzYywg dmYpOw0KPiAgIAlpeGdiZV92Zl9lbmFibGVfcmVjZWl2ZShzYywgdmYpOw0KPiBAQCAtNTU2 LDcgKzU1Niw3IEBAIGl4Z2JlX3ZmX2dldF9xdWV1ZXMoc3RydWN0IGl4Z2JlX3NvZnRjICpz Yywgc3RydWN0IGl4Z2JlX3ZmICp2ZiwgdWludDMyX3QgKm1zZykNCj4gICAJCXJldHVybjsN Cj4gICAJfQ0KPiAgIA0KPiAtCXJlc3BbMF0gPSBJWEdCRV9WRl9HRVRfUVVFVUVTIHwgSVhH QkVfVlRfTVNHVFlQRV9BQ0sgfA0KPiArCXJlc3BbMF0gPSBJWEdCRV9WRl9HRVRfUVVFVUVT IHwgSVhHQkVfVlRfTVNHVFlQRV9TVUNDRVNTIHwNCj4gICAJICAgIElYR0JFX1ZUX01TR1RZ UEVfQ1RTOw0KPiAgIA0KPiAgIAludW1fcXVldWVzID0gaXhnYmVfdmZfcXVldWVzKHNjLT5p b3ZfbW9kZSk7DQpCdWlsZCBmYWlsczoNCi91c3Ivc3JjL3N5cy9kZXYvaXhnYmUvaWZfc3Jp b3YuYzoxMDM6MTY6IGVycm9yOiBtZW1iZXIgcmVmZXJlbmNlIGJhc2UgDQp0eXBlICdzdHJ1 Y3QgaXhnYmVfbWJ4X29wZXJhdGlvbnNbNjRdJyBpcyBub3QgYSBzdHJ1Y3R1cmUgb3IgdW5p b24NCiAgIDEwMyB8ICAgICAgICAgc2MtPmh3Lm1ieC5vcHMud3JpdGUoJnNjLT5odywgJm1z ZywgMSwgdmYtPnBvb2wpOw0KICAgICAgIHwgICAgICAgICB+fn5+fn5+fn5+fn5+fl5+fn5+ fg0KL3Vzci9zcmMvc3lzL2Rldi9peGdiZS9pZl9zcmlvdi5jOjM3NzoxMzogZXJyb3I6IG1l bWJlciByZWZlcmVuY2UgYmFzZSANCnR5cGUgJ3N0cnVjdCBpeGdiZV9tYnhfb3BlcmF0aW9u c1s2NF0nIGlzIG5vdCBhIHN0cnVjdHVyZSBvciB1bmlvbg0KICAgMzc3IHwgICAgICAgICBo dy0+bWJ4Lm9wcy53cml0ZShodywgcmVzcCwgSVhHQkVfVkZfUEVSTUFERFJfTVNHX0xFTiwg DQp2Zi0+cG9vbCk7DQogICAgICAgfCAgICAgICAgIH5+fn5+fn5+fn5+Xn5+fn5+DQovdXNy L3NyYy9zeXMvZGV2L2l4Z2JlL2lmX3NyaW92LmM6NTY4OjEzOiBlcnJvcjogbWVtYmVyIHJl ZmVyZW5jZSBiYXNlIA0KdHlwZSAnc3RydWN0IGl4Z2JlX21ieF9vcGVyYXRpb25zWzY0XScg aXMgbm90IGEgc3RydWN0dXJlIG9yIHVuaW9uDQogICA1NjggfCAgICAgICAgIGh3LT5tYngu b3BzLndyaXRlKGh3LCByZXNwLCANCklYR0JFX1ZGX0dFVF9RVUVVRVNfUkVTUF9MRU4sIHZm LT5wb29sKTsNCiAgICAgICB8ICAgICAgICAgfn5+fn5+fn5+fn5efn5+fn4NCi91c3Ivc3Jj L3N5cy9kZXYvaXhnYmUvaWZfc3Jpb3YuYzo1ODU6MjE6IGVycm9yOiBtZW1iZXIgcmVmZXJl bmNlIGJhc2UgDQp0eXBlICdzdHJ1Y3QgaXhnYmVfbWJ4X29wZXJhdGlvbnNbNjRdJyBpcyBu b3QgYSBzdHJ1Y3R1cmUgb3IgdW5pb24NCiAgIDU4NSB8ICAgICAgICAgZXJyb3IgPSBody0+ bWJ4Lm9wcy5yZWFkKGh3LCBtc2csIElYR0JFX1ZGTUFJTEJPWF9TSVpFLCANCnZmLT5wb29s KTsNCiAgICAgICB8ICAgICAgICAgICAgICAgICB+fn5+fn5+fn5+fl5+fn5+DQovdXNyL3Ny Yy9zeXMvZGV2L2l4Z2JlL2lmX3NyaW92LmM6NjQ2OjE5OiBlcnJvcjogbWVtYmVyIHJlZmVy ZW5jZSBiYXNlIA0KdHlwZSAnc3RydWN0IGl4Z2JlX21ieF9vcGVyYXRpb25zWzY0XScgaXMg bm90IGEgc3RydWN0dXJlIG9yIHVuaW9uDQogICA2NDYgfCAgICAgICAgICAgICAgICAgICAg ICAgICBpZiAoaHctPm1ieC5vcHMuY2hlY2tfZm9yX3JzdChodywgDQp2Zi0+cG9vbCkgPT0g MCkNCiAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+fn5+fn5+fn5+fl5+ fn5+fn5+fn5+fn5+DQovdXNyL3NyYy9zeXMvZGV2L2l4Z2JlL2lmX3NyaW92LmM6NjQ5OjE5 OiBlcnJvcjogbWVtYmVyIHJlZmVyZW5jZSBiYXNlIA0KdHlwZSAnc3RydWN0IGl4Z2JlX21i eF9vcGVyYXRpb25zWzY0XScgaXMgbm90IGEgc3RydWN0dXJlIG9yIHVuaW9uDQogICA2NDkg fCAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaHctPm1ieC5vcHMuY2hlY2tfZm9yX21z ZyhodywgDQp2Zi0+cG9vbCkgPT0gMCkNCiAgICAgICB8ICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB+fn5+fn5+fn5+fl5+fn5+fn5+fn5+fn5+DQovdXNyL3NyYy9zeXMvZGV2L2l4 Z2JlL2lmX3NyaW92LmM6NjUyOjE5OiBlcnJvcjogbWVtYmVyIHJlZmVyZW5jZSBiYXNlIA0K dHlwZSAnc3RydWN0IGl4Z2JlX21ieF9vcGVyYXRpb25zWzY0XScgaXMgbm90IGEgc3RydWN0 dXJlIG9yIHVuaW9uDQogICA2NTIgfCAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaHct Pm1ieC5vcHMuY2hlY2tfZm9yX2FjayhodywgDQp2Zi0+cG9vbCkgPT0gMCkNCiAgICAgICB8 ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB+fn5+fn5+fn5+fl5+fn5+fn5+fn5+fn5+ DQo3IGVycm9ycyBnZW5lcmF0ZWQuDQoqKiogW2lmX3NyaW92Lm9dIEVycm9yIGNvZGUgMQ0K DQotLSANCkNoYXJsaWUgTGkNCi4uLm5vcGUsIHN0aWxsIGRvbid0IGhhdmUgYW4gZXhpdCBs aW5lLg0KDQo= --------------lDaYKhqfuvKhGwDlPweCYMHW-- --------------jMLGfcmIVMZYP1yKeDXc1Sw7 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQRTQA7vBfo8y1zE1rpnj5NgWEFcygUCZuzzMwUDAAAAAAAKCRBnj5NgWEFcyrl2 AP40wHOPkGaZ4+UJXta9v5df46WtZbvPq7K0NTb+1OUWtgEA/CVVZQfznnioszm76amrJUrrD9d4 0WNTNp39GUdVzgw= =Lt4/ -----END PGP SIGNATURE----- --------------jMLGfcmIVMZYP1yKeDXc1Sw7-- From nobody Fri Sep 20 06:46:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x23bFMz5Wj25; Fri, 20 Sep 2024 06:46: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 4X92x2327mz4r41; Fri, 20 Sep 2024 06:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YO5Y2vhqsqmndQYMT0MDZN9ahawY3AUUpwRXbw+sRuI=; b=wmLcVlMAR8J7xI4wTYgEAkSXsWaNqFNXCm4On/a05TKhI2EfsMY7LtQZKXc7syt8NEgO3/ 2OQrbmDGcVvcWFuGeFL+viwfQJ6ZLWHMc1DAmDtMA5niug+35y5KyXLMhNnwNdHQy/Q78v VLA+FjCt7+jb2jYotMXY8jvHUVa1/ekrZqGWeL6Q8Y/bCP8py5Okj/JgVosn18N6M9/0kL U9+OW0r2wfyHOq8sas7OUnlf/shupu5e+V9rHMyVJQBtoXBPntPBwX3vmPWhDx99tW3v8r qkn68pAQtgLc6bMRstSr7cPvgyHfbP0LwZZ9kj7SZQniH/GS/b2x0jSbk81JHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814806; a=rsa-sha256; cv=none; b=XFcQF6EDjWxOgSrvZrat8fLc+5Xsyqz+rm6gNdTloXLwSbO8QJsdzJqsTJVFXL3wtrd/eN cy5sYk/z9pJ+TSjTlvzi/EnzLy7Dgt92g+RaMhlvqsApSrR9NO2Stla6alf5XcoRw9fPD6 hW4K/0SugQB44Di1U3Ge8MhqnTwBfOEhY1rmjd8ztbq3mJf14JpaXz+9igxEjbLFRrkTaT rKBOp7Tbp+hiEjinP7dft//kI3slLdUlG7l5B6qUoeRhEFwAU5O5Cj3n57rWM/5U7XS/Gh tEKYwWyDihtqCtcFxojLOGYMisaW3Rqx7JTddddd0vIH+gv4WOYtHRJwH2njqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YO5Y2vhqsqmndQYMT0MDZN9ahawY3AUUpwRXbw+sRuI=; b=oNnn3pQpxvdRwFghql9LKNlCXhRgQhw1e1NmcpPaabWwM+ZpR3U+RzYyPKxB0NLKQOBrsK GCtnCz4yrsO98ngZt2QZll12E5Haq44jSsmqaA6ViE6++h7aznfh4fmdx8vIcnU2xI7QyM q6j3sPGc1AOnrRwt+GHRbeSS2vXZaMMvOv1vt7F7hQ8bJi7dJEKBNaJFRnmhfhtfLKTDDg AUPXOvPeadnDlpsa5vzAN3RTr74bjVftKD+XcHwKzxFX3gEUaYWXJL6BtMLNxKTgpOA47c V7OxGPGx4eiHU4mhHhZZy/o6/loYX4OsPqzTB1M9GKg3UAx75/6pArJfQvOr+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x22VvyzdV1; Fri, 20 Sep 2024 06:46: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 48K6kkUO009407; Fri, 20 Sep 2024 06:46:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6kkXv009404; Fri, 20 Sep 2024 06:46:46 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:46 GMT Message-Id: <202409200646.48K6kkXv009404@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: 0ecbb28ce351 - main - vm_map: add vm_map_find_locked(9) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ecbb28ce351652b3a2dae271eedf1eb3aa65400 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0ecbb28ce351652b3a2dae271eedf1eb3aa65400 commit 0ecbb28ce351652b3a2dae271eedf1eb3aa65400 Author: Konstantin Belousov AuthorDate: 2024-09-15 06:29:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:06 +0000 vm_map: add vm_map_find_locked(9) Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46678 --- sys/vm/vm_map.c | 39 ++++++++++++++++++++++++--------------- sys/vm/vm_map.h | 2 ++ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 77297a0e3957..3d82f0835c09 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2117,9 +2117,24 @@ vm_map_find_aligned(vm_map_t map, vm_offset_t *addr, vm_size_t length, */ int vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, - vm_offset_t *addr, /* IN/OUT */ - vm_size_t length, vm_offset_t max_addr, int find_space, - vm_prot_t prot, vm_prot_t max, int cow) + vm_offset_t *addr, /* IN/OUT */ + vm_size_t length, vm_offset_t max_addr, int find_space, + vm_prot_t prot, vm_prot_t max, int cow) +{ + int rv; + + vm_map_lock(map); + rv = vm_map_find_locked(map, object, offset, addr, length, max_addr, + find_space, prot, max, cow); + vm_map_unlock(map); + return (rv); +} + +int +vm_map_find_locked(vm_map_t map, vm_object_t object, vm_ooffset_t offset, + vm_offset_t *addr, /* IN/OUT */ + vm_size_t length, vm_offset_t max_addr, int find_space, + vm_prot_t prot, vm_prot_t max, int cow) { vm_offset_t alignment, curr_min_addr, min_addr; int gap, pidx, rv, try; @@ -2127,7 +2142,7 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || object == NULL, - ("vm_map_find: non-NULL backing object for stack")); + ("non-NULL backing object for stack")); MPASS((cow & MAP_REMAP) == 0 || (find_space == VMFS_NO_SPACE && (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)); if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || @@ -2150,7 +2165,6 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, (map->flags & MAP_ASLR_IGNSTART) != 0) curr_min_addr = min_addr = vm_map_min(map); try = 0; - vm_map_lock(map); if (cluster) { curr_min_addr = map->anon_loc; if (curr_min_addr == 0) @@ -2235,8 +2249,7 @@ again: MPASS(try == 1); goto again; } - rv = KERN_NO_SPACE; - goto done; + return (KERN_NO_SPACE); } } @@ -2250,16 +2263,14 @@ again: try = 0; goto again; } - goto done; + return (rv); } } else if ((cow & MAP_REMAP) != 0) { - if (!vm_map_range_valid(map, *addr, *addr + length)) { - rv = KERN_INVALID_ADDRESS; - goto done; - } + if (!vm_map_range_valid(map, *addr, *addr + length)) + return (KERN_INVALID_ADDRESS); rv = vm_map_delete(map, *addr, *addr + length); if (rv != KERN_SUCCESS) - goto done; + return (rv); } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { rv = vm_map_stack_locked(map, *addr, length, sgrowsiz, prot, @@ -2277,8 +2288,6 @@ again: if (update_anon && rv == KERN_SUCCESS && (map->anon_loc == 0 || *addr < map->anon_loc)) map->anon_loc = *addr; -done: - vm_map_unlock(map); return (rv); } diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index 1862ad48c442..a226f9adaa9a 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -473,6 +473,8 @@ boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t int vm_map_delete(vm_map_t, vm_offset_t, vm_offset_t); int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); +int vm_map_find_locked(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, + vm_size_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); int vm_map_find_min(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, vm_offset_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); int vm_map_find_aligned(vm_map_t map, vm_offset_t *addr, vm_size_t length, From nobody Fri Sep 20 06:46:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x36BWWz5Wj29; Fri, 20 Sep 2024 06:46: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 4X92x33Yfsz4r42; Fri, 20 Sep 2024 06:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qrNPMaKEFyuXis5ox2WDI7w0OukLNxL0fp7txp8hbi8=; b=mLCQj7TvR8x8clDt/QOxYpNZYNlBzHoC7POihCDAhXrKyWrHy1o0zbd8yuvt03opSUIdLV ahTvEirsCHnh1qyVLWXk9Y1D2BA09s4oo3UwpKMIeVJPasilndKWoyZNagxBuLd0FKCDm9 VAUGncVjRqaj0cm8pavWVNLRlgoUaSWNctQyHFnCcSB12tLBhgg3d1ihmhJWcE0wFa2F9L yVVUXQ2hVggb2tGuBZ2LG2Nn+pXYrGgbx4gKVFHmtaqSzK20MJom/ShQAO0VNpiMLA/q9/ nrZRjBy5UDEtfnF2z2mDGWc+fpG7iVoweBz5R+EDdqj+9wj0Pr3XYA5qyvF4pQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814807; a=rsa-sha256; cv=none; b=ce5/PQ4rX7uU5Qi/tX/aUh4BtgbFheaSiHCCBoWXPCVDAqhltp0X9dZBWPx/mEemtkc19/ 5tRqCgdXxudeWGHof8WhVdgmpLe8MF91xa10K3ebCb5YPs3pP/Ybhc2ibtJK4GVr+VcNy3 GaBcCAV+ko1Edjdv+HWIeVYmu2UVaKaCCkSy5rUdZkIQ8wZJUFLBLsZsxK5j4L4R2UyD7I jw2RVwKbk8b6Lowve0DQ52x1cALlA+5PnuPdytXGirJ4pSNPdJyH+kKA+bJUef8GoWEfP+ a374jtIx7DxW8pRIkjditlC7XluitFBIiWBHNRbF2ROVwtjrQ4o59ZWohng2rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qrNPMaKEFyuXis5ox2WDI7w0OukLNxL0fp7txp8hbi8=; b=YgcEdZAh4PBb8ezsHemMaMi66VoPmmC0HA1X30WcdmCP25vJSvB4CK7fUY9TPmT6o8NA9d RpjT2VOAPiJY7UMhBwaUGI9TpkQOdL8BdZwKfY5ZUDM5gjfiIQtKIYmig8DgRWujLfbsK7 ZZqkVNXKj5K2tfrlpwbql9LB4G+8GBl26DnoVbhvjxLqlYjF5UvY6ui0KtdkABtGPO56Lk TtvnWGGnFedRjmQcHKFkUOY36jItu1RR8Yi0vFbQ9UGG1yQsZkYkULc69edmKt01Zuo7hG n/WITRRHxNBXUxJdpxYZq9Dzyk80cJBHt15dh8bY5+UvmMQ06fiepb9c41uVqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x338sqzfnK; Fri, 20 Sep 2024 06:46: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 48K6kleB009444; Fri, 20 Sep 2024 06:46:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6kl8I009441; Fri, 20 Sep 2024 06:46:47 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:47 GMT Message-Id: <202409200646.48K6kl8I009441@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: 3458bbd39778 - main - kernel: add RLIMIT_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3458bbd397783f3bb62713c54ae87f19eeb98dc0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3458bbd397783f3bb62713c54ae87f19eeb98dc0 commit 3458bbd397783f3bb62713c54ae87f19eeb98dc0 Author: Konstantin Belousov AuthorDate: 2024-09-10 03:57:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:06 +0000 kernel: add RLIMIT_PIPEBUF Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- sys/kern/kern_resource.c | 7 +++++++ sys/kern/sys_pipe.c | 16 ++++++++++++++++ sys/sys/pipe.h | 1 + sys/sys/resource.h | 3 ++- sys/sys/resourcevar.h | 2 ++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 2e9cce727bee..d1a1d3ea3811 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1607,3 +1607,10 @@ chgumtxcnt(struct uidinfo *uip, int diff, rlim_t max) return (chglimit(uip, &uip->ui_umtxcnt, diff, max, "umtxcnt")); } + +int +chgpipecnt(struct uidinfo *uip, int diff, rlim_t max) +{ + + return (chglimit(uip, &uip->ui_pipecnt, diff, max, "pipecnt")); +} diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 73b6facec6c7..7ee2b5c76da3 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -375,6 +375,7 @@ pipe_paircreate(struct thread *td, struct pipepair **p_pp) #endif rpipe = &pp->pp_rpipe; wpipe = &pp->pp_wpipe; + pp->pp_owner = crhold(td->td_ucred); knlist_init_mtx(&rpipe->pipe_sel.si_note, PIPE_MTX(rpipe)); knlist_init_mtx(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe)); @@ -408,6 +409,7 @@ pipe_paircreate(struct thread *td, struct pipepair **p_pp) fail: knlist_destroy(&rpipe->pipe_sel.si_note); knlist_destroy(&wpipe->pipe_sel.si_note); + crfree(pp->pp_owner); #ifdef MAC mac_pipe_destroy(pp); #endif @@ -574,9 +576,20 @@ retry: size = round_page(size); buffer = (caddr_t) vm_map_min(pipe_map); + if (!chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, + size, lim_cur(curthread, RLIMIT_PIPEBUF))) { + if (cpipe->pipe_buffer.buffer == NULL && + size > SMALL_PIPE_SIZE) { + size = SMALL_PIPE_SIZE; + goto retry; + } + return (ENOMEM); + } + error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); if (error != KERN_SUCCESS) { + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) { size = SMALL_PIPE_SIZE; @@ -1645,6 +1658,8 @@ pipe_free_kmem(struct pipe *cpipe) if (cpipe->pipe_buffer.buffer != NULL) { atomic_subtract_long(&amountpipekva, cpipe->pipe_buffer.size); + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, + -cpipe->pipe_buffer.size, 0); vm_map_remove(pipe_map, (vm_offset_t)cpipe->pipe_buffer.buffer, (vm_offset_t)cpipe->pipe_buffer.buffer + cpipe->pipe_buffer.size); @@ -1731,6 +1746,7 @@ pipeclose(struct pipe *cpipe) */ if (ppipe->pipe_present == PIPE_FINALIZED) { PIPE_UNLOCK(cpipe); + crfree(cpipe->pipe_pair->pp_owner); #ifdef MAC mac_pipe_destroy(pp); #endif diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index 61fb57480605..0f35316432eb 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -136,6 +136,7 @@ struct pipepair { struct pipe pp_wpipe; struct mtx pp_mtx; struct label *pp_label; + struct ucred *pp_owner; /* to dec pipe usage count */ }; #define PIPE_MTX(pipe) (&(pipe)->pipe_pair->pp_mtx) diff --git a/sys/sys/resource.h b/sys/sys/resource.h index 8c014210aade..c18e45d50b30 100644 --- a/sys/sys/resource.h +++ b/sys/sys/resource.h @@ -114,8 +114,9 @@ struct __wrusage { #define RLIMIT_SWAP 12 /* swap used */ #define RLIMIT_KQUEUES 13 /* kqueues allocated */ #define RLIMIT_UMTXP 14 /* process-shared umtx */ +#define RLIMIT_PIPEBUF 15 /* pipes/fifos buffers */ -#define RLIM_NLIMITS 15 /* number of resource limits */ +#define RLIM_NLIMITS 16 /* number of resource limits */ #define RLIM_INFINITY ((rlim_t)(((__uint64_t)1 << 63) - 1)) #define RLIM_SAVED_MAX RLIM_INFINITY diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h index c9b8cb3989d6..b15dace8cfa0 100644 --- a/sys/sys/resourcevar.h +++ b/sys/sys/resourcevar.h @@ -121,6 +121,7 @@ struct uidinfo { long ui_ptscnt; /* (b) number of pseudo-terminals */ long ui_kqcnt; /* (b) number of kqueues */ long ui_umtxcnt; /* (b) number of shared umtxs */ + long ui_pipecnt; /* (b) consumption of pipe buffers */ uid_t ui_uid; /* (a) uid */ u_int ui_ref; /* (b) reference count */ #ifdef RACCT @@ -142,6 +143,7 @@ int chgsbsize(struct uidinfo *uip, u_int *hiwat, u_int to, rlim_t maxval); int chgptscnt(struct uidinfo *uip, int diff, rlim_t maxval); int chgumtxcnt(struct uidinfo *uip, int diff, rlim_t maxval); +int chgpipecnt(struct uidinfo *uip, int diff, rlim_t max); int kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which, struct rlimit *limp); struct plimit From nobody Fri Sep 20 06:46:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x46nVgz5Whqf; Fri, 20 Sep 2024 06:46: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 4X92x44qgyz4qwL; Fri, 20 Sep 2024 06:46:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uldZAEkPoUPnWQUVDeU9MZYh2NDCoq43nnB8xEpBOR0=; b=Cja6s4o5Tdbwl4w5tx8K62WVkamFrN+xQq8A9BtpOsClHTiTCpRPteLf3xNWR7ZynLvb4S uberKrCnj9rXWiympTA/r0mqQsLEW3H0OTQfUp6p8OpKjiwpwiLjGes2LlDd7urvBXG7i4 Wg2afZHvNxzxW+EoICwVnf6RneBMimGegXO8teIRap1gEcDGtYg2m31UNBjrW8pwH4c6CA aiLENN9aMamX37KJYHW23nFrfgJSui6IpjTVJqmOz0qe0rW4mjD5lAQgB8KALpt1/yR7r9 YL9t9V9VY/6ceIDGm9pgIc+guylmP3HwN+91/hL3fLvgt2c2ZNZkGZs10D3oZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814808; a=rsa-sha256; cv=none; b=R4NYU4HZjN74z9U9iAmT1Afrx9F7BcTcSwgHHF6iXJIqs6v4qDGPeadRabHA/1kK5KSTaW Fztv7RrXcbiifzh1Xb8wODFRSN6EPsyiz49dPqEfeeLvg8LWbbGfSyFVYLslm/l57VyDmc LlRqV4kyMAL8gbSDzZleKai2VDoGopxaFNtouh+MIDXdal1MrFjbGr1j5ZxJyk298areLE YqyLha1t9xJ/ofD7P9fY0RWk1Ansdrz4Jypw9SJs6Mj4oi/d/U5QQP8UsSuqsR8MadARe+ niQnL+lfWAH4rDA4g/qDMAEvLG2WOkmMrE4siKXjGKUyXQN7POaxfcQrg8tByw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uldZAEkPoUPnWQUVDeU9MZYh2NDCoq43nnB8xEpBOR0=; b=BzaGSBU68VM+WqV3WDtRUJcSg3IriqqBJy6J+r81dyY4SeoebhR0lCczLxxUQ4JjOQO1f2 Ny0T1j2jXozY1b6tz5Ix+vv5zFioqU9oLT4/k8f82Mc1hNC5OQVpj2uqQLZhoNsxdl3BWu QHES9lv39wL059NpxhnccHX3jCQqANidR6rGN6qIstoKhRCK0fzUdtscIEKSt5of9XIMUm DooBJyt34GsIZd4kv0gTocxqeiJ9Lq/gVB3clOVdMhB2zuv2geat3Vw3JmEivFKLHIvQaE DeYJeFdjY6grzsn08zl9ncKSXosVNqsSjBK5QPXquQ67L+BnqcJyTT7Ks+ICQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x4479VzfqF; Fri, 20 Sep 2024 06:46: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 48K6kmVX009482; Fri, 20 Sep 2024 06:46:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6kmFA009479; Fri, 20 Sep 2024 06:46:48 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:48 GMT Message-Id: <202409200646.48K6kmFA009479@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: 54a8d1fbbf65 - main - getrlimit(2): document RLIMIT_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54a8d1fbbf65e976132809718525ba051a5525cf Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=54a8d1fbbf65e976132809718525ba051a5525cf commit 54a8d1fbbf65e976132809718525ba051a5525cf Author: Konstantin Belousov AuthorDate: 2024-09-10 04:11:55 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:06 +0000 getrlimit(2): document RLIMIT_PIPEBUF Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- lib/libsys/getrlimit.2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libsys/getrlimit.2 b/lib/libsys/getrlimit.2 index d9b8b7cb896c..d54dc703ada0 100644 --- a/lib/libsys/getrlimit.2 +++ b/lib/libsys/getrlimit.2 @@ -84,6 +84,16 @@ The maximum number of open files for this process. The maximum number of simultaneous processes for this user id. .It Dv RLIMIT_NPTS The maximum number of pseudo-terminals this user id is allowed to create. +.It Dv RLIMIT_PIPEBUF +The maximum total size of in-kernel buffers for bi-directional pipes/fifos +that this user id is allowed to consume. +The buffers for kernel FIFOs created on the first open of a filesystem +object created by +.Pq Xr mkfifo 2 +are also charged to the user ID of the process opening it, +not the FIFO's filesystem owner. +Despite somewhat unexpected, this is in fact fair, since user of the fifo +is not necessary its creator. .It Dv RLIMIT_RSS When there is memory pressure and swap is available, prioritize eviction of a process' resident pages beyond this amount (in bytes). From nobody Fri Sep 20 06:46:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x61902z5Wj2Z; Fri, 20 Sep 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X92x557Pvz4r25; Fri, 20 Sep 2024 06:46:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lf0KyyRCQxPp3EBFKeHOaZ3iy/QFPYqo0T7qIiH2SRs=; b=OaxE8VGZ8dwhEtkMSyZYaRgqqYlfmdHpXANDGtyEEuEWdS3odW4aR2Lx50lPP9kaAtXsex rOmcmHky7RHYUJIjLBlik3i4S7+lsuOJHE1DyYsDEGle6/R1ohfj8iDssnvs5xjp1OebR6 y4Tv9rWhIq2n6ZFHL/8GOwy4FVPTzAfDI5THdmGVgH8WrUGIJj6GpmucffJO1+ZGMtsrt7 XrtYvr7qMwTqUGiEKVmASxrfG6U6b2HhhM4zLx3fK3kwlDGf5lYz1Nwh0Fmdn6yccSI2Gs 0K/Tc/plV7QuEoZi6Qomyl05wvgeBk/vtSKflfZrwx+qeq7q9jSEAbDTWt66WQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814809; a=rsa-sha256; cv=none; b=siz9lwEAkCFl/R87Z2Yhce/FmnBJN0n+5wf6d6T/J1Zwo0DSGHlJFRjR5rLF44PLEkAG/n 5WgR2yxA0I79qlQ42bUZ064PIrTDgLNy+K5h2gI++3wIk1tMvii2oj12dxZ5FcFItC6ak+ G6dKQONig6L0KUcC8Ai+CDIu2WPSKdUdXe4gxCRKgcu4Mu7e2IfLDiDv8XWh5Vd/f/zjJO L+6jLtoQo/ywOQsA1H+MIu6xesQplOPZIO5LLQgSyJGENtYQ9dPvzXYLjca74DpYVI5oG+ pLSZGSnfNGHkV/omQjb/myd5yhPkATDvGNfouainsGojb4+UnlmZjat/9+iokw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lf0KyyRCQxPp3EBFKeHOaZ3iy/QFPYqo0T7qIiH2SRs=; b=d2JVfBBKKNZRiZ1QbfGSoj+D6xp/95AdZH0TtgginukiT62DxpAh9eW4O2QzEQkmvz3Ot1 /M/iSJGzP+ocsFBD8O4H7UwK6UpMNqk8I9zhE+QVGMXqy7wEF2PWf9N8T4lmbM48wK2O5p DWr4G5JlJqZRq0kifBRhlRKMYSgbfoTD9HOao3Q/5unBymbsrrUHESvl6feBQwE6I7sytP Tg7pXQi6FVLLua9rFTpRtbA7Z4t29THVPcUETzhDo/OgxcgEoDi2SXidTJbqWCOHzPYfwF sI5pFPQBJEDCxpEZ3v9f7cFLbPCZJz7MfadFCYtH0IuFb6DbSv2619p2RKWOlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x54lFtzfPy; Fri, 20 Sep 2024 06:46: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 48K6kn8f009518; Fri, 20 Sep 2024 06:46:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6knM7009515; Fri, 20 Sep 2024 06:46:49 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:49 GMT Message-Id: <202409200646.48K6knM7009515@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: a4c04958f526 - main - libutil: support RLIMIT_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4c04958f526a0dba353b54641dc5d2806984d02 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a4c04958f526a0dba353b54641dc5d2806984d02 commit a4c04958f526a0dba353b54641dc5d2806984d02 Author: Konstantin Belousov AuthorDate: 2024-09-10 04:13:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:06 +0000 libutil: support RLIMIT_PIPEBUF Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- lib/libutil/login.conf.5 | 1 + lib/libutil/login_class.3 | 1 + lib/libutil/login_class.c | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index a749fe5519ab..b1e7211e4c18 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -204,6 +204,7 @@ login environment. .It "pseudoterminals number Maximum number of pseudo-terminals." .It "swapuse size Maximum swap space size limit." .It "umtxp number Maximum number of process-shared pthread locks." +.It "pipebuf" size Maximum size of pipe buffers." .El .Pp These resource limit entries actually specify both the maximum diff --git a/lib/libutil/login_class.3 b/lib/libutil/login_class.3 index b67301f5a5a6..46e6a70f8ca8 100644 --- a/lib/libutil/login_class.3 +++ b/lib/libutil/login_class.3 @@ -118,6 +118,7 @@ pseudoterminals RLIMIT_NPTS swapuse RLIMIT_SWAP kqueues RLIMIT_KQUEUES umtxp RLIMIT_UMTXP +pipebuf RLIMIT_PIPEBUF .Ed .It LOGIN_SETPRIORITY Set the scheduling priority for the current process based on the diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 916e69065320..c3c1b0ddda27 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -65,6 +65,7 @@ static struct login_res { { "swapuse", login_getcapsize, RLIMIT_SWAP }, { "kqueues", login_getcapsize, RLIMIT_KQUEUES }, { "umtxp", login_getcapnum, RLIMIT_UMTXP }, + { "pipebuf", login_getcapnum, RLIMIT_PIPEBUF }, { NULL, 0, 0 } }; From nobody Fri Sep 20 06:46:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x70kGBz5Wj2c; Fri, 20 Sep 2024 06:46: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 4X92x66xbxz4r8x; Fri, 20 Sep 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/aZHai99S8hIzqgQhSZkZURP5STeeLkAmldYO+I1lo4=; b=aRtr060ZS00BdjLpgyNK/1vHPFhn3s/wlKukc20Ovk1E3RLhGL7mNCWn+X3F3qlrf0BzkV 6Pxcq8U+Awe+rEebBQ6pcwivHxy5ja+2enVZsRknOJo110J1gC6idyJUtANS3Cch7wIzQu TLjCt9tXItdfKid5yPlqqkY2670immlDAtSb5H8kRZi2lwK8EemLK3biGb3zKsxnCNibwZ Kfrpsrd1pnzwAdDJcGzlXEFTPo7RrHb7XPrEjKMv2/X/ywXi0VEZdB+yqhWuZJt5kePO7d YLVFMhSDuQfp13OUugOlgzW8D1/y5WuJu6G4EZPbIs75C8g4sUBXlnNMGG/5MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814811; a=rsa-sha256; cv=none; b=LsLjgVusyViYj/medr2A55DbfvBfq92zsBwXIylEdKZJan8KbCUlpntw28DTu3HVzkorGd XvKzx7FS3xMY4F8TBSjDMT8ND2DyCR7KjHJgNeZkHVQEkBhCcKrcFS54TI5MpN9z0Lkbqr m9uGFi7PXqPC8HFr9EBMvxfslywp4Ff77eeZaOI4HE+vQsQOO+b5I1qf5+uqq+3DpX7XYP 6IdyH21/fMnh8YKItE3iPr1ifbcBoHHKpw7wDB+5ivsHSg9YJ2cPuVBChEGQdtab+8lyeT sPlomqepg4aH/QlvsFsmdqMm5qNYtf31BlIwhcIhGGMYPV1RFR55G+Npv8JaiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/aZHai99S8hIzqgQhSZkZURP5STeeLkAmldYO+I1lo4=; b=GURSbssXwek2dynfVrKCK45CDBhiRYbJHvppCDdY3WBeatCKbFHlZUSg0dhPA5xPwIEAJl CxnYorpyiu5NjdvzTuqPNpVm0uD5PDO/mrWFusoNXafkVrNltLhXJOaYC/LhA0H3sG2CZG Dp+xWx8e8knlF1YsST1s0qHy0sRhviBA6fg3MWiHP+aO+hvRp4McK10E5iHr2cJkw6BRoH 9zp/gT1oL8CZ4g+qW81FxDyObJ0Hm7RPfPn/fvRcuciyTPUl8GniHnlUBA7WBeg7q2nFjg e8FaS9vmtnu1kqNfSE616FO8QEqlq7LARY6DtB6QybUKocPKvRomRPhZvSqitQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x65h6MzdV2; Fri, 20 Sep 2024 06:46: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 48K6koAB009565; Fri, 20 Sep 2024 06:46:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6koTu009562; Fri, 20 Sep 2024 06:46:50 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:50 GMT Message-Id: <202409200646.48K6koTu009562@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: 5d92f20c7d31 - main - bin/sh: support RLIMIT_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d92f20c7d316aca521d4db4c1dab0f2d0e92c36 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5d92f20c7d316aca521d4db4c1dab0f2d0e92c36 commit 5d92f20c7d316aca521d4db4c1dab0f2d0e92c36 Author: Konstantin Belousov AuthorDate: 2024-09-10 04:12:27 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:07 +0000 bin/sh: support RLIMIT_PIPEBUF Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- bin/sh/miscbltin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index 6364bd10a584..9d0280bb548a 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -483,6 +483,9 @@ static const struct limits limits[] = { #endif #ifdef RLIMIT_UMTXP { "umtx shared locks", (char *)0, RLIMIT_UMTXP, 1, 'o' }, +#endif +#ifdef RLIMIT_PIPEBUF + { "pipebuf", (char *)0, RLIMIT_PIPEBUF, 1024, 'y' }, #endif { (char *) 0, (char *)0, 0, 0, '\0' } }; @@ -519,7 +522,7 @@ ulimitcmd(int argc __unused, char **argv __unused) struct rlimit limit; what = 'f'; - while ((optc = nextopt("HSatfdsmcnuvlbpwko")) != '\0') + while ((optc = nextopt("HSatfdsmcnuvlbpwkoy")) != '\0') switch (optc) { case 'H': how = HARD; From nobody Fri Sep 20 06:46:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x81x7sz5WhyR; Fri, 20 Sep 2024 06:46: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 4X92x800mgz4r97; Fri, 20 Sep 2024 06:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/rstfUyg/VNZmodAgfWJHJksA2TdQown0meAV62bWg=; b=KyFSewQae4fFtH/HS9qowzphd4UnE9Y/l+uceutIX9mvrBRo8Rv+I97rqA0YyGPl1ayZkW nSz5YYwLRZpKFP47AjPdHtFtO5hG7XwyHo0I+z0ecgV/U23iTAcZjbEEqx6zmAORcne1TZ pKRwmT6GNaKZnuT88/nVMyj1lkG8IEGFgH7lie72H+QY/coAoz/PvYUvlvUyyIioKGJawJ d17QivE4Cfg1R5EPTKsk+W+7XUgeZrt11QNO1V3H0AoaubmWkBfY8HLAeXyvpijBhiHI4t bITnq9IxAQ5WxBECBuXPOXjXMAMu4xQi6vnEKCYMqUnEH0h2IBMeelwDJC1W2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814812; a=rsa-sha256; cv=none; b=V2VAZm21v0hM0LBvDa93zdC2Wz6aHYUhl8UhrOdiEpt6ZcU6Nb/bhdq0Til8TK2gkD59Am 4+5l/7tKFQvqA5lx6gcOSYsvDCymfOWQySbQIgjEJ5htrlQ7pokVCm8uNF4K9Dy9S0phjc ytukCPzmdmOQupH+JIWmcPJGQpeqe31xL68sKEZMKdLEHhDv8UYSjKUmHEH+cchz+eJ0OE Z89FBoxI0VfizG+mxBMpNBClFpWK8zYE+ZpQ3WW7K6dJ6EHf9uigHrWg7SBgYHIF7OYcy2 dEfTF1JMkocPysU2YacCySNlBaredt2MkrHwFwfzZRObM3bUQ7yVYc0XopCiEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/rstfUyg/VNZmodAgfWJHJksA2TdQown0meAV62bWg=; b=MgcCYMoi47PQx1DH4fySVA6tVOWFYUlITnyyymq2993a8eSGp4Mxuljm9iBeyA6ZIKQxnM 9Qrta01KA7RnKrqBUYdBOEspnY872DoEvBuVo9xvnhnYQhJwu8TtTAmIY79OmHreivRkCO yVnrdLGDBF7RaHxxZX1v/l0FZS7sFPcgdffsKDPYTVffh0geHEIhqZjA8wynA8pMDbKVV0 ipVRfvdSml7E2Rh6YAhOtNr4COiU1HCWapLu0gsV856QxK77bpYLqtxvv1RKLNN9w6w0z7 00nHXtAMCUnrpsaNKw/c2+yNBvwXm/buAPJVDSRuPpC4vh5LldPWNtJIP3QrSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x76dPvzfnL; Fri, 20 Sep 2024 06:46: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 48K6kp5N009603; Fri, 20 Sep 2024 06:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6kpQb009600; Fri, 20 Sep 2024 06:46:51 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:51 GMT Message-Id: <202409200646.48K6kpQb009600@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: f54f41403d14 - main - usr.bin/limits: support RLIMIT_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f54f41403d149e867b896ae753a0e7e2b0c738b0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f54f41403d149e867b896ae753a0e7e2b0c738b0 commit f54f41403d149e867b896ae753a0e7e2b0c738b0 Author: Konstantin Belousov AuthorDate: 2024-09-10 04:13:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:07 +0000 usr.bin/limits: support RLIMIT_PIPEBUF Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- usr.bin/limits/limits.1 | 6 +++++- usr.bin/limits/limits.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.bin/limits/limits.1 b/usr.bin/limits/limits.1 index 86df08b41058..0e374acd991b 100644 --- a/usr.bin/limits/limits.1 +++ b/usr.bin/limits/limits.1 @@ -32,7 +32,7 @@ .Nm .Op Fl C Ar class | Fl U Ar user .Op Fl SHB -.Op Fl bcdfklmnopstuvw Op Ar val +.Op Fl bcdfklmnopstuvwy Op Ar val .Op Fl E .Oo .Op Ar name Ns = Ns Ar value ... @@ -280,6 +280,10 @@ space. Select or set the .Va swapuse resource limit. +.It Fl y Op Ar val +Select or set the +.Va pipebuf +resource limit. .El .Pp Valid values for diff --git a/usr.bin/limits/limits.c b/usr.bin/limits/limits.c index 68b1853651b9..c53066b52a9f 100644 --- a/usr.bin/limits/limits.c +++ b/usr.bin/limits/limits.c @@ -91,6 +91,7 @@ static struct { { " swapuse%-4s %8s", " kB\n", 1024 }, { " kqueues%-4s %8s", "\n", 1 }, { " umtxp%-4s %8s", "\n", 1 }, + { " pipebuf%-4s %8s", " kB\n", 1024 }, } }, { "sh", "unlimited", "", " -H", " -S", "", @@ -110,6 +111,7 @@ static struct { { "ulimit%s -w %s", ";\n", 1024 }, { "ulimit%s -k %s", ";\n", 1 }, { "ulimit%s -o %s", ";\n", 1 }, + { "ulimit%s -y %s", ";\n", 1024 }, } }, { "csh", "unlimited", "", " -h", "", NULL, @@ -242,6 +244,7 @@ static struct { { "swapuse", login_getcapsize }, { "kqueues", login_getcapnum }, { "umtxp", login_getcapnum }, + { "pipebuf", login_getcapnum }, }; /* @@ -252,7 +255,7 @@ static struct { * to be modified accordingly! */ -#define RCS_STRING "tfdscmlunbvpwko" +#define RCS_STRING "tfdscmlunbvpwkoy" static rlim_t resource_num(int which, int ch, const char *str); static void usage(void) __dead2; @@ -292,7 +295,7 @@ main(int argc, char *argv[]) pid = -1; optarg = NULL; while ((ch = getopt(argc, argv, - ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:o:")) != -1) { + ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:o:y:")) != -1) { switch(ch) { case 'a': doall = 1; @@ -623,6 +626,7 @@ resource_num(int which, int ch, const char *str) case RLIMIT_SBSIZE: case RLIMIT_VMEM: case RLIMIT_SWAP: + case RLIMIT_PIPEBUF: errno = 0; res = 0; while (*s) { From nobody Fri Sep 20 06:46:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92x93Nw0z5Whql; Fri, 20 Sep 2024 06:46: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 4X92x91FHBz4r2m; Fri, 20 Sep 2024 06:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OLYUzZqplxqSNTGXK0f2FtlI8Fe9PzcHaFpVmoaidFM=; b=bh3o7gasOlmdlHFSJlox9uNQxCM9hPxo5SSyHhA9NWM7uCNbkB9MA9UM9w8pdAN9Vy27VQ 2veeFCOiueVFF1rjFosksltiW5yKUbh9yzSuEM3KWryA3tTkFHKSGpc2WQVgXHR8xoouIM qkY/Ec1w61D7Ix0TOZy+xL1JwJZYYg/UYWRiZxaSzHJIIRIk9rIDl8wE7T8FBytdkps7jq wgXjhfSmPgL5eiWqwF+U13FNABjRfEnI2wQ315Ro7Jf5YzLfk6tcQMufbI1IURDs7tdW3y NpWY2mexK08jH9wEhnPE7SzLRh4gsskPb+7JMTdGoytXMFQrzhsrqTGws6V4VQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814813; a=rsa-sha256; cv=none; b=BZ+Xv5+ZOhaimuiLerdxPv4TksDBFTAhCAi8rm2b94ZbUjxpt5JwG+/5ab45KL6gJ6BH7O efxwNcRej+gBKbVUykz6IoxVZkf+rbW5YemIoGEJn7znzn3r8RMfXZlrFcszAysSzqPGJD EnkDCkbPn5I6UeyJNGpFfW9KPEl+A9BU/BYZAu/PJYeMalRCbiv4te81+PtLmffh4xlgWv Lp5zt//UHPs45BwSe3dWNkglz+Q3X9CZV705+kk+mTzBoiVSxmPtqIAFQQc6EnhMYGRMX2 yOG0/ik9RZFGsvYAiZ9+4PjYrL5emAdPA06WlWrezKwj1WVgpK3EtK+zSGvq0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OLYUzZqplxqSNTGXK0f2FtlI8Fe9PzcHaFpVmoaidFM=; b=O5gC+bu0eqM6xd3iOn/+dOui6+135N7OM5n3Q/Ckq4NCykV4+YoXY3RkNWIeu6qQSWKrRg ekfj1OQKDAt/JObjXocGHwb5310GALoYOkc8ajNL0DTmLM5jI+7s2oqK7FL7Rkn8NJ0qKa cDrJ+EQXzfor94L1SUxfJUXeIHZxCHBoBnb6e0mTkcoCAu4D/BYkScj5s8GoL9pE+vm4Va WXqBqMhqQHm6LFMPm5XJZlFKaBa93o/wacCgXmO1yLvAb1hs9tf4gzL0s4gV+iC6TYlXQ8 nCWEZOhxb1QDAy/yLfEt4LRDsyscZnzo2GOmJtRMNmeysLgKbucYgf9ImC/HaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92x90XFNzfnM; Fri, 20 Sep 2024 06:46: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 48K6kqQS009658; Fri, 20 Sep 2024 06:46:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6kqX0009655; Fri, 20 Sep 2024 06:46:52 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:52 GMT Message-Id: <202409200646.48K6kqX0009655@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: b029e29e0d8b - main - login.conf: add a placeholder for the pipebuf limit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b029e29e0d8b928de2da50014d81799dfb5c9047 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b029e29e0d8b928de2da50014d81799dfb5c9047 commit b029e29e0d8b928de2da50014d81799dfb5c9047 Author: Konstantin Belousov AuthorDate: 2024-09-11 14:48:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:07 +0000 login.conf: add a placeholder for the pipebuf limit Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- usr.bin/login/login.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/login/login.conf b/usr.bin/login/login.conf index 50a2ba9ffb5e..1069da17b4db 100644 --- a/usr.bin/login/login.conf +++ b/usr.bin/login/login.conf @@ -44,6 +44,7 @@ default:\ :pseudoterminals=unlimited:\ :kqueues=unlimited:\ :umtxp=unlimited:\ + :pipebuf=unlimited:\ :priority=0:\ :ignoretime@:\ :umask=022:\ From nobody Fri Sep 20 06:46:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92xC1R64z5Wj2m; Fri, 20 Sep 2024 06:46: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 4X92xB1j0Nz4r5K; Fri, 20 Sep 2024 06:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PEH9r32Q64O3LIHZ+wSnJp/KYNAdaS3f26rudLgkHOw=; b=WiZFGNbiKpq5VFhtZ34rrVEr3bOBqPmN+vcb0MUw3Mf82d5RSgptDrS7kJHYgD+Vl5q4Ob TTsWmYNg+P//nfq8whc+BT0hco+RhG/eR3rLVxtvL95sLCo1nW8il2TnAU9QwHzFsN1u3G AMHxu47OVB4a3TeJCAvWioP+S6CWLfpnjaMy2IZx5fPuLFccDy6HMZqQxdQss812L8hrNi Ax+CQgE1Osq9GU9g9ue6SjOldXatz9zCHTNZI1P+s7U7RWez7DKfUiSErnr4efiY8djwF+ 3J2lnivkb5q7TaPD+wA0Q0b2Jr1u1T52PucsfbssgA7ngNBaTZsHKFxLTzLHng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814814; a=rsa-sha256; cv=none; b=lmkDYghO7s5bH7EDc/6EGH/DFR1OJBvl1JhIqhP4QqeasCo0x7NCuLmPBs4LA0F8+yUTOH JxWWEhLDzgNz/LmBZ3LupnUYs/Aa0HzKhm7JExSH+/vsKhUuNwuZim5qqQF1Au5hXgTNfq 2MARn+4lM1rEOAgTv7/ARmzzD2+RMM7kl00/tJR2mTs+esPJZBLDsOWOou8qbsuG1zk+bJ YWRqP7my7vUZbLMpbmbIDjCCC4DrN75MpF7zw7m7CUBBHREb/cbV42R5HXjMdFAo4vqlH7 e3a3Sr1iE/dFyoC1ecOmLeUPqQZ9aTMpZEAdnEqxOrwstkDG2SvRtfwK4X3bHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PEH9r32Q64O3LIHZ+wSnJp/KYNAdaS3f26rudLgkHOw=; b=p9hYR+UfrpKAiYyWmjkRMz19JykKxm7owed31f8DmpAYEiOR5tcQrj5mNRmY7D4jKZd87E MsUkwJw5aB7PogVPP/BzUksLixxQ8vH2/M6zGqw8p78eQWgRwEWJNgQOG9rB32D4UflYf0 N5NxgBfHWZPQtF1r6nOeJlSb7if6IbFwx+s6KDfYvIatmlFX4ixeAoCU8qs/fCo/aekAwE wv9gKMGXZu48G+sCow1hp2yNzv5BnTqss2NLKB8mKQUksVg0UsaXT+cw/WIEF/sd7G5e2t ONAvUs1Iln4IQ4HKVA8v8i+PaBWRI7fpRerJbHI5/cUBCBe8E8pRX9p9dhGZLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92xB1GfdzfDh; Fri, 20 Sep 2024 06:46: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 48K6ksio009694; Fri, 20 Sep 2024 06:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6ksGO009691; Fri, 20 Sep 2024 06:46:54 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:54 GMT Message-Id: <202409200646.48K6ksGO009691@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: 80133d678ecb - main - procstat: support RLIMIT_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80133d678ecbddb382174a4d48305a7b8cb932e5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=80133d678ecbddb382174a4d48305a7b8cb932e5 commit 80133d678ecbddb382174a4d48305a7b8cb932e5 Author: Konstantin Belousov AuthorDate: 2024-09-14 13:13:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:07 +0000 procstat: support RLIMIT_PIPEBUF Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- usr.bin/procstat/procstat_rlimit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/procstat/procstat_rlimit.c b/usr.bin/procstat/procstat_rlimit.c index 3900ef7dcc14..c34550295f05 100644 --- a/usr.bin/procstat/procstat_rlimit.c +++ b/usr.bin/procstat/procstat_rlimit.c @@ -63,6 +63,7 @@ static struct { {"swapuse", "B "}, {"kqueues", " "}, {"umtxp", " "}, + {"pipebuf", "B "}, }; _Static_assert(nitems(rlimit_param) == RLIM_NLIMITS, From nobody Fri Sep 20 06:46:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92xC4krRz5Whkl; Fri, 20 Sep 2024 06:46: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 4X92xC2wwqz4r3K; Fri, 20 Sep 2024 06:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJMX1ZypNSwz0UwRpi/lVrK9jpN8k0+VY3u+dvfQOFI=; b=XwmAuttt+tdIURvxyy977zBCl9VIt1XI2vrtIhHpCFtO9sWI0uk1KlTomGJ8WxikdGzgk/ OIA5c752u8Mje+H75NAoYtTjSWqX2TyI7Pc3MAu6z72FjgDoEZbBXg7ZV8fH+ASIQ+laXW wyrYlRxbDx0xMd1iIFbCINdZ7hJHoCm5AhcjYeIXD3qbVM1m1Tfr9DLDTCD82WEAjFM82L GWLIKjpZB9UPdJMlsBUo0LtASKTZoXhqNC/xL3WWdplNsIWXOqU+8Q7mpF32thcywtQqX6 iGeNESJR2tnWVlRw0Kz7jU+qyleY3pg+bVsd9hA1B3XW2AJ7GMPUcNwnYQ3DAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814815; a=rsa-sha256; cv=none; b=erDc/bvkcnPKl5KL7LrDUJ/qKvk8eWCMGyY8OXmYW03O83OlVkibTivafcAT8vEKfHp/7i Mj9BQG2kY/Jfp2XkzO6UZoZcqcOkBPfjW+zI+QdqNOHzV1ua42i24O8NJo/qijIK7hiWA4 q74rCj9hsIERYqZHlUm1d8mqWNKPoJ8dR1yrJd1H3HokZEZvkJQPUCqElr7b5jw59K3i14 G0rNLirH73NWdvlP/9tkMgTHMJk6F3SI04uAhjhYVarm7WXtTh7cnx73bRT3BO3TlVzSEn Hf5TiT5UHTUvZCxpYtZeKSXKi73tYU0pAE6kzH+2ZJOy8R+OLJDyfkSZSH6eLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJMX1ZypNSwz0UwRpi/lVrK9jpN8k0+VY3u+dvfQOFI=; b=AIrQ2Hq6SGpPNma5+aLdVhpQmtr/32g9f/VS7qd4VuSL0LXpxkgFSfYzWbY00cG2l9Bj8Z pQJ9Y0b2EpVjIn24KxANEw1M7agh7yvLCVE82XGEHU1lRAgn8boG/mqHv5ouCWr3kGihkF Md6yn3gm2umcTjI8naMVfA5mLK3OgSsiC55b0DBzZEHVYDQqHFZjHycfOM2dC6l2NJk8qA Y/ud/sxREdk/4aF55xtVAdkGzY9K6HBZt/lK4s/94HZvM2D34X9OXUEhwPMtJgctq9K3Cp 6gC/ngeQ7QYg6QDXciP4kxRT21sp+jSa1lu039xeHKeA0ANc7SL8M5kWv+HFCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92xC203JzfDj; Fri, 20 Sep 2024 06:46: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 48K6ktbS009732; Fri, 20 Sep 2024 06:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6ktEH009729; Fri, 20 Sep 2024 06:46:55 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:55 GMT Message-Id: <202409200646.48K6ktEH009729@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: 8ae779832c6f - main - privs: add PRIV_PIPEBUF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ae779832c6fee0588274af3c48cc643022787e6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ae779832c6fee0588274af3c48cc643022787e6 commit 8ae779832c6fee0588274af3c48cc643022787e6 Author: Konstantin Belousov AuthorDate: 2024-09-15 06:38:41 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:07 +0000 privs: add PRIV_PIPEBUF a privilege to allocate reserved pipebuf space. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- sys/sys/priv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/sys/priv.h b/sys/sys/priv.h index 7a5773da220f..5e14fee2cce1 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -426,11 +426,13 @@ */ #define PRIV_VM86_INTCALL 550 /* Allow invoking vm86 int handlers. */ +#define PRIV_PIPEBUF 560 /* Allow to allocate reserved pipebuf + space */ + /* * Set of reserved privilege values, which will be allocated to code as * needed, in order to avoid renumbering later privileges due to insertion. */ -#define _PRIV_RESERVED0 560 #define _PRIV_RESERVED1 561 #define _PRIV_RESERVED2 562 #define _PRIV_RESERVED3 563 From nobody Fri Sep 20 06:46:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92xF0WsGz5Whr9; Fri, 20 Sep 2024 06:46: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 4X92xD4cMCz4r8Q; Fri, 20 Sep 2024 06:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qNTDxZNY+aO4wg8wuz+p3jfWgLQJeiOjyuhSu0vdT4=; b=OrcZRoMHqb3nEFjn2DAZKewKY2bDfsROSrO1TgtdIwXLCzHVzif9vWAS9DtyDoX+eLTQxj 1kFF/SGKrqsMN5Hl/jkbZGvay4gBV8ASxeoH/ssMMu0FnMWH0iT725/uBCK1BC0v/JVuKJ +COII7Lh9WJxbNTuE/hJ8N+KdLcGtpfBVVOnVUEww35gvBAMxxAdNAHbvr5BLmKblGFUWJ VLIibumWH1BrNyvGQnew0dhT5Jg0S3VQBB3gPz9CZihTYBcQI9vj7gd3r1VmWxyHc+Drm7 gHWagvXq22rnMuAWYejnFeRSBm8O6aoJKdzWjGlYTdlYa6YPhwG/9y4nBwJpLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814816; a=rsa-sha256; cv=none; b=WDw8ldbTNowEwAFQuVKl53HxinLvXdQd7AjDJlMXcbcFLcPEwZh6DlhHKqfCnQdr3bPwS1 9UoMgFENFELLOjgfjgT/4C5lnVo6Q1GWy4YrRBpezmueVb+h9BH2jukS7HZfD0mqyMWiT7 LeR9T3GIt8G0IhkPYOrWs3/wAGaXiEGifcqkCnoX8i8KcZpRpZfph+avlTjm01lHD2pvdy 8pdAGVKS8iVJX4chojdE58cgwMZRrBmeR7frjqZSdD0EnVldh88iWdfuFPDmoJKktObrJ7 Beyq0tOBm1+WGgRkIIVho2NhtoooMIPeHx88xSfIGBzX5Eazapdr6wBSOb05nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qNTDxZNY+aO4wg8wuz+p3jfWgLQJeiOjyuhSu0vdT4=; b=IfccWeAzY6EJqxSD7FwGz9GkoEHmmOk6F278PZSLxPJY1HrFRwvlP69yOW5eSvvcItufo8 am8aR4//D/mc8hnTTemjy1zQ3AnZnIh9X5tzkpCAld3deZU1USDFBTVBcNXgu05t/D3G6H l4oBWpoWZj8Nz8GsT5HmBWjjjkYvFFZIoUt7SUc8LgfSj0gNKKSi6HPYiODh/CV1J7kiIt tbe9BeXLY5XeZlnOFertWY0rPmDplJ57GbfWOjrpIsUIvozIsEcDwcox5uUz80EXSoKBxI 5Y/fbxxD0EfE2lTQR7cVpDpr10MyMPfjBkSFcod4sTvcSAv1gu5PFSUwSWqaUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X92xD3VkZzfYq; Fri, 20 Sep 2024 06:46: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 48K6kuAJ009787; Fri, 20 Sep 2024 06:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K6ku0O009784; Fri, 20 Sep 2024 06:46:56 GMT (envelope-from git) Date: Fri, 20 Sep 2024 06:46:56 GMT Message-Id: <202409200646.48K6ku0O009784@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: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7672cbef2c1e1267e42bb3aad6a6da9380f4347f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7672cbef2c1e1267e42bb3aad6a6da9380f4347f commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f Author: Konstantin Belousov AuthorDate: 2024-09-15 06:57:34 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 06:46:07 +0000 pipes: reserve configured percentage of buffers zone to superuser Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619 --- sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 7ee2b5c76da3..68b57708d653 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -103,6 +103,7 @@ #include #include #include +#include #include #include #include @@ -206,6 +207,7 @@ static int pipeallocfail; static int piperesizefail; static int piperesizeallowed = 1; static long pipe_mindirect = PIPE_MINDIRECT; +static int pipebuf_reserv = 2; SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxpipekva, 0, "Pipe KVA limit"); @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, CTLFLAG_RD, &piperesizefail, 0, "Pipe resize failures"); SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, &piperesizeallowed, 0, "Pipe resizing allowed"); +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, + &pipebuf_reserv, 0, + "Superuser-reserved percentage of the pipe buffers space"); static void pipeinit(void *dummy __unused); static void pipeclose(struct pipe *cpipe); @@ -586,8 +591,22 @@ retry: return (ENOMEM); } - error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); + vm_map_lock(pipe_map); + if (priv_check(curthread, PRIV_PIPEBUF) != 0 && + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { + vm_map_unlock(pipe_map); + if (cpipe->pipe_buffer.buffer == NULL && + size > SMALL_PIPE_SIZE) { + size = SMALL_PIPE_SIZE; + pipefragretry++; + goto retry; + } + return (ENOMEM); + } + error = vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t *)&buffer, + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); + vm_map_unlock(pipe_map); if (error != KERN_SUCCESS) { chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); if (cpipe->pipe_buffer.buffer == NULL && From nobody Fri Sep 20 06:47:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92xz0SXCz5WjG3; Fri, 20 Sep 2024 06:47:35 +0000 (UTC) (envelope-from yasu@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 4X92xy6VHfz4sr9; Fri, 20 Sep 2024 06:47:34 +0000 (UTC) (envelope-from yasu@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=quEwdqoH8U0q9Qhj7JbJoRgrL7CEU1oTlTgEj6Hiw6s=; b=CYkw0T3+AjZvNZlpl8kKfcNdQcFWw9UTVa597XxHdwv1x+fpWceiQWsx0kV2bFc57Ugs+s di66gCcVjlDm2uOy7Tq6M2mX6nznEXpOvioP0V1ugUfSb9t1nWIx3FNP2Lpz+S6Jt4s6mR MdVwaGRPQjQPgXSXE7ITpqUmWSM1wKxLzX17INWSDCdc6tj/xU8KPjCGd8MD0VflK5NxSh Ym3M9X8HK5QD7mHk0ALWrLuXDjcedr+4Tr11nBGY3qXQ4vB3Gd3VvZ0lGJJMB187EEkBqp 3BigVnJe0mEdI6uDuIFRoSJqPTXoJrDEBYLWlzDWOlCla+ZbzY71C6NSW0IKLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726814854; a=rsa-sha256; cv=none; b=kQSi1xwccNT/S1S0zDqgNA+jCYYFAwunWGnhX2B3ZVJK+qhGUnWzqMiaHu6f20DVXv0D6O wKzsJ0cjRDw6ygpUbNPAZOtQSNShgw7GxO+7xj6+CpbSL+Ht2fqF5QMxkLtD5iThMG3Nkl Rk2Hcr8j7abBi5q/B6Djl4u3DBsSdOAJpzQPN9kEENnEifYGc5nbkdkCpb33GGBle55YBz sUAxzOMtW6eVqlXetJvqrvZ8r6SYNzJsnbpEq66iqyE8cb67PWQLfo/yu9n3j/2IfOwD7c 2UnNFTcqM/fQ2ljv1RORhO5treox2JdxVVZSZ9F3yiRrulaDT1UlnsWXRhO0Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726814854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=quEwdqoH8U0q9Qhj7JbJoRgrL7CEU1oTlTgEj6Hiw6s=; b=tlt4GZyVYR3zExWUr51zsrERPmR5QbMPbe/BzkkJ2GYAyGiA+riCvMrgN7XMnI9DqHJX1i 5crJpOknaPHH2l1PHKBxKU6LBCsLY/HGFUxnZnZS+DSkJmdtRdWX8IalxRKSr1tbMnv4pJ rb+XIXIZIDbHXfCvY+Dv0mtUFTJsuEuvKZQNmjUD/X4yK0AVIyr8UQRnQ2qC1MHeeCcvkU Spuj+68bLgD/73ZhR8pqRnOVmjjRtqNkzdMV42TFZ97UyeTOW0NfIxBYm72bTjE/gKvnG4 vsQYny9qEyRWVG/qJXRu/lo/i914G1lZ/XC+3K8gfrFvB/nICNmmDSbyBtvVtQ== Received: from localhost (unknown [IPv6:240b:11:220:fe00::174:11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: yasu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X92xx3rfRz1MMQ; Fri, 20 Sep 2024 06:47:33 +0000 (UTC) (envelope-from yasu@FreeBSD.org) Date: Fri, 20 Sep 2024 15:47:00 +0900 (JST) Message-Id: <20240920.154700.1207780392961840745.yasu@FreeBSD.org> To: vishwin@freebsd.org Cc: kbowling@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros From: Yasuhiro Kimura In-Reply-To: <084fa85b-7112-4dc5-bdb0-dbf727a28af0@freebsd.org> References: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> <084fa85b-7112-4dc5-bdb0-dbf727a28af0@freebsd.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Charlie Li Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros Date: Thu, 19 Sep 2024 23:59:47 -0400 > Build fails: > /usr/src/sys/dev/ixgbe/if_sriov.c:103:16: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 103 | sc->hw.mbx.ops.write(&sc->hw, &msg, 1, vf->pool); > | ~~~~~~~~~~~~~~^~~~~~ > /usr/src/sys/dev/ixgbe/if_sriov.c:377:13: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 377 | hw->mbx.ops.write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, > vf->pool); > | ~~~~~~~~~~~^~~~~~ > /usr/src/sys/dev/ixgbe/if_sriov.c:568:13: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 568 | hw->mbx.ops.write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, > vf->pool); > | ~~~~~~~~~~~^~~~~~ > /usr/src/sys/dev/ixgbe/if_sriov.c:585:21: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 585 | error = hw->mbx.ops.read(hw, msg, IXGBE_VFMAILBOX_SIZE, > vf->pool); > | ~~~~~~~~~~~^~~~~ > /usr/src/sys/dev/ixgbe/if_sriov.c:646:19: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 646 | if (hw->mbx.ops.check_for_rst(hw, vf->pool) == 0) > | ~~~~~~~~~~~^~~~~~~~~~~~~~ > /usr/src/sys/dev/ixgbe/if_sriov.c:649:19: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 649 | if (hw->mbx.ops.check_for_msg(hw, vf->pool) == 0) > | ~~~~~~~~~~~^~~~~~~~~~~~~~ > /usr/src/sys/dev/ixgbe/if_sriov.c:652:19: error: member reference base > type 'struct ixgbe_mbx_operations[64]' is not a structure or union > 652 | if (hw->mbx.ops.check_for_ack(hw, vf->pool) == 0) > | ~~~~~~~~~~~^~~~~~~~~~~~~~ > 7 errors generated. > *** [if_sriov.o] Error code 1 Same here with: * Commit 420c9844702 * amd64 * Clean build from scratch --- Yasuhiro Kimura From nobody Fri Sep 20 06:49:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X92zn1dgbz5WjVR; Fri, 20 Sep 2024 06:49:09 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 4X92zm6NJvz4vg0; Fri, 20 Sep 2024 06:49:08 +0000 (UTC) (envelope-from unkadoug@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-713892fed01so771747a34.2; Thu, 19 Sep 2024 23:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726814945; x=1727419745; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XYzKVjsUoS8Hepiw8pPsNX+h0mvzngMpsxG+PHNC+w8=; b=lGgssmO+wctIUh0+0NUHaj0aDD+m0lbOj54jEmDDPYUHdNu6++NYVJP6mS+hzQ6vYu VqiHvacJh50Fg++CAtjLl3kwEJ1OsT2o8AV37Sp5bGgOeeXYXFyiCgdZCGGesntARyCp 0UljCroZ/Y0mM9QfFKC6JtSdj3QSaX0Li+/9YsWaAk9X8nvbo1CeUHSU7JrVClv4Df7G roobdknm8fqWTep6bDMW4JvOWUvsTewaErPqs/6lSQxQnMEI1eazSsL0YoOTNz6RvBhC DdVC8BrKGdJA5CLGaWMszo9tFti2dUTevfNXttnUDBS0CGgDnWwDoJMrW2CWVOJhqGWz 0vQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726814945; x=1727419745; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XYzKVjsUoS8Hepiw8pPsNX+h0mvzngMpsxG+PHNC+w8=; b=Z98BGNyeo4snC2TqdGId2r0yWEr+3QCm0KAHRk5l/26AiUzM8MJO0VXgXaAgmaMtTb HknGwQ1V2gRXCHfJ2A6UcyLe0UpCV3kPdySyS8k0wnmeFxmMgFh/1ljBF5nEhbvKG4Gb h5PouaJmFxZa5E7qsp7T2gNwQkOkKP5g0wPKQ+cf8z1UxQxOzrYGnH2GCSKpq0x9RhY5 1dAR/sASwLm5M2vXg/HlyjLyfVzt+8GNLRs61+O2hT+EpSNhLJWL1b+uvWzUSi+iWgd/ QDXUiE5U+tD8KdYBdKAQcILbm/r6+6VtrxkcVCLTbR8bbZSTW3AEf4uzXvS9Yl6m52zM SjRA== X-Forwarded-Encrypted: i=1; AJvYcCUB4xzMzA0JWhtq9KLGZjcqUilN0ishnP7tIPRcSQQyQSvT4sX/micePNQyoZ9Q9LsWFl9PPpuzTopzBSz29AvlHzHtae8=@freebsd.org, AJvYcCUDpX/+xcfELpiSoLT8BOi1dhTDYcycjwim1mO9QIuJs/MHP8C1/b8cclnReH46orajwoUP+T2oX9c71Hv/LyI=@freebsd.org, AJvYcCWoqJD6RBXH6NlgxRhJa568I4sAcwbxNvzrD3s28k82D7cDkgJCHEJrzjA4wlv5EZApO437X9/Zlw==@freebsd.org, AJvYcCWowZrRY2pwpD+KO42CPxL/gtqu3MMRENOGZcTFjE7HD5GJu/6bIpq0efHQefoVI6xPK1Yrt9aSBafF5Z1jMM43yMzX@freebsd.org X-Gm-Message-State: AOJu0YypduH4Mlh0ma4q5SIq9+nLb4blnaFnnBFseds52iT+cH8hNkji jC+xSgArfxLh74YjyNESYpfyW0+u4K2pYaKzfA56fSBHQNdUfIuyonQr9gC/ X-Google-Smtp-Source: AGHT+IFixFnQ3W3yrZorbbLUEqX5/hNU+OfQmVOeC+KVZ20eb8PqCOLz7z1zqPYOAjeh3lIf5hTlEQ== X-Received: by 2002:a05:6830:924:b0:710:f926:7095 with SMTP id 46e09a7af769-71392463c6bmr1135004a34.20.1726814945282; Thu, 19 Sep 2024 23:49:05 -0700 (PDT) Received: from [108.254.203.202] (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71389b590a4sm614777a34.22.2024.09.19.23.49.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2024 23:49:04 -0700 (PDT) Message-ID: Date: Fri, 20 Sep 2024 01:49:03 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros Content-Language: en-US To: Yasuhiro Kimura , vishwin@freebsd.org Cc: kbowling@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> <084fa85b-7112-4dc5-bdb0-dbf727a28af0@freebsd.org> <20240920.154700.1207780392961840745.yasu@FreeBSD.org> From: Doug Moore In-Reply-To: <20240920.154700.1207780392961840745.yasu@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 4X92zm6NJvz4vg0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated https://reviews.freebsd.org/D46708 fixes compilation, if you want to copy it. On 9/20/24 01:47, Yasuhiro Kimura wrote: > From: Charlie Li > Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros > Date: Thu, 19 Sep 2024 23:59:47 -0400 > >> Build fails: >> /usr/src/sys/dev/ixgbe/if_sriov.c:103:16: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 103 | sc->hw.mbx.ops.write(&sc->hw, &msg, 1, vf->pool); >> | ~~~~~~~~~~~~~~^~~~~~ >> /usr/src/sys/dev/ixgbe/if_sriov.c:377:13: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 377 | hw->mbx.ops.write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, >> vf->pool); >> | ~~~~~~~~~~~^~~~~~ >> /usr/src/sys/dev/ixgbe/if_sriov.c:568:13: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 568 | hw->mbx.ops.write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, >> vf->pool); >> | ~~~~~~~~~~~^~~~~~ >> /usr/src/sys/dev/ixgbe/if_sriov.c:585:21: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 585 | error = hw->mbx.ops.read(hw, msg, IXGBE_VFMAILBOX_SIZE, >> vf->pool); >> | ~~~~~~~~~~~^~~~~ >> /usr/src/sys/dev/ixgbe/if_sriov.c:646:19: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 646 | if (hw->mbx.ops.check_for_rst(hw, vf->pool) == 0) >> | ~~~~~~~~~~~^~~~~~~~~~~~~~ >> /usr/src/sys/dev/ixgbe/if_sriov.c:649:19: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 649 | if (hw->mbx.ops.check_for_msg(hw, vf->pool) == 0) >> | ~~~~~~~~~~~^~~~~~~~~~~~~~ >> /usr/src/sys/dev/ixgbe/if_sriov.c:652:19: error: member reference base >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union >> 652 | if (hw->mbx.ops.check_for_ack(hw, vf->pool) == 0) >> | ~~~~~~~~~~~^~~~~~~~~~~~~~ >> 7 errors generated. >> *** [if_sriov.o] Error code 1 > Same here with: > > * Commit 420c9844702 > * amd64 > * Clean build from scratch > > --- > Yasuhiro Kimura From nobody Fri Sep 20 07:58:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X94WV3jNDz5XBJC; Fri, 20 Sep 2024 07:58: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 4X94WV2dh9z44fr; Fri, 20 Sep 2024 07:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726819094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4BxJ0/jNBQsBILQIFcrAW2vLucdk6gdJNuY/ED7QhQ=; b=DfkJ4iq/wc1y/b1vhKhJacIhVKpcTYNye0zIgFbfX19kKdWEvVoJNWaihvukYMP3Ni02ki 7jY2z1sgTScdR6zcZYzbvfQW9GHVP2GyTxY21Q4WGybQIvuh7AXUnoXXSOVagj60DRQjZI dv613vDEr6QOltLAIDovlQ+qzMQCSeQdmS9Q9Y1mtDaIGn1YlZ3B5hBLF/MUAzZrlhav0V YYLmahxjw9EiMOADioFu51U4nk7KKHkmSrD0AXEKOosz9y/NPjM/626LBYOsBOKG5Js4qJ SqtLV9DHxubLzygMEu4c8RczU39B0FeLhrwsKi8x7JsRNJynb3yqeW0V7dUiRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726819094; a=rsa-sha256; cv=none; b=US1sH/dtj6zzoKuKhN3LOh+FqMD+OfnPhA2pLkyWh5FHZnpsvEnQyu4Nq8XISlYmd3hPSj SIETqW01B/EjN8S7+wKmoc4+LaMCdJMgitM6UeDF930zvDDbt1w9Y7O4IsoXpN641B3fVI E/wakSqzLKOlHmCDjZl70OSHa2EvU27E86KDJA5mnTDjtvcr6S7I46MdGuyJlnlM67mhDB /8cbnmdwCukbolPWzlmy+WaX+J7XGbyj+/5zz0nc7c/DdhGccET6C/tznIBa0Vrdb5OJG3 OyaVOUYuvgIxKNKZ6blA95QKmzkPFT/J2VaopTqhAg9uNpGujMJvrb+Eh1jWwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726819094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4BxJ0/jNBQsBILQIFcrAW2vLucdk6gdJNuY/ED7QhQ=; b=W47F5IzATsazJd9WaRbj/JpIVTN6F1ZP14we6fTWBlVw1qDg/vVS1Y3W7XnIJvks9K339c o27QhUbq0FOhtL+Qu6ePETqVY3xEOSovhfOOqQ+nArh/u4Ld7sDvpTtDQG2q/1nSafZNkQ iM3ZadxJ3C7Ytp0XusNh2fdvzp8zJrL73NHO44kkNvxmZR3Y6+2/vNm0qOUs2RSMpVZGMr 8bp3JefDK1ax7iIFtv0MiGx8DenS3E1fOQGTqpRkFbCXNUhel8xE0xj0WqdprONhZbnU5J PGxN0edd0HWmLFS89jThq6il+HP7kDscDvKHWM/cCgH5rRPjO+1m5wlHg++Vgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X94WV2Dptzhf0; Fri, 20 Sep 2024 07:58: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 48K7wEgl029390; Fri, 20 Sep 2024 07:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K7wEDp029387; Fri, 20 Sep 2024 07:58:14 GMT (envelope-from git) Date: Fri, 20 Sep 2024 07:58:14 GMT Message-Id: <202409200758.48K7wEDp029387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 267f223f622f - main - ixgbe: fix compilation for VF List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 267f223f622fdbf779cc43b5a564bb02e2b59ecd Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=267f223f622fdbf779cc43b5a564bb02e2b59ecd commit 267f223f622fdbf779cc43b5a564bb02e2b59ecd Author: Doug Moore AuthorDate: 2024-09-20 07:54:48 +0000 Commit: Kevin Bowling CommitDate: 2024-09-20 07:57:36 +0000 ixgbe: fix compilation for VF The mailbox API changed in version 15 and these array ops were left out of the recent code import as applicable to FreeBSD. Reported by: vishwin, yasu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46708 --- sys/dev/ixgbe/if_sriov.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index a16092c9f688..112c34849e65 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -100,7 +100,7 @@ ixgbe_send_vf_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) if (vf->flags & IXGBE_VF_CTS) msg |= IXGBE_VT_MSGTYPE_CTS; - sc->hw.mbx.ops.write(&sc->hw, &msg, 1, vf->pool); + sc->hw.mbx.ops[0].write(&sc->hw, &msg, 1, vf->pool); } static inline void @@ -374,7 +374,7 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) resp[0] = IXGBE_VF_RESET | ack | IXGBE_VT_MSGTYPE_CTS; bcopy(vf->ether_addr, &resp[1], ETHER_ADDR_LEN); resp[3] = hw->mac.mc_filter_type; - hw->mbx.ops.write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); + hw->mbx.ops[0].write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); } /* ixgbe_vf_reset_msg */ @@ -565,7 +565,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) resp[IXGBE_VF_TRANS_VLAN] = (vf->default_vlan != 0); resp[IXGBE_VF_DEF_QUEUE] = 0; - hw->mbx.ops.write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool); + hw->mbx.ops[0].write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool); } /* ixgbe_vf_get_queues */ @@ -582,7 +582,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) hw = &sc->hw; - error = hw->mbx.ops.read(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); + error = hw->mbx.ops[0].read(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); if (error != 0) return; @@ -643,13 +643,13 @@ ixgbe_handle_mbx(void *context) vf = &sc->vfs[i]; if (vf->flags & IXGBE_VF_ACTIVE) { - if (hw->mbx.ops.check_for_rst(hw, vf->pool) == 0) + if (hw->mbx.ops[0].check_for_rst(hw, vf->pool) == 0) ixgbe_process_vf_reset(sc, vf); - if (hw->mbx.ops.check_for_msg(hw, vf->pool) == 0) + if (hw->mbx.ops[0].check_for_msg(hw, vf->pool) == 0) ixgbe_process_vf_msg(ctx, vf); - if (hw->mbx.ops.check_for_ack(hw, vf->pool) == 0) + if (hw->mbx.ops[0].check_for_ack(hw, vf->pool) == 0) ixgbe_process_vf_ack(sc, vf); } } From nobody Fri Sep 20 08:00:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X94Zc3LdTz5XCFb for ; Fri, 20 Sep 2024 08:00:56 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (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 4X94Zb5l1nz458t for ; Fri, 20 Sep 2024 08:00:55 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3e04b7b3c6dso913218b6e.2 for ; Fri, 20 Sep 2024 01:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; t=1726819254; x=1727424054; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4bONVrDtEJzNCZ0HfN4zoXrGtxdO+/I8PMU4Hetsm/A=; b=M7CPkryNniwL4koZA5+8MwheCKuUgMdTtZmnjqyryj3UbxDidB83IuMlK89Uo+LKw1 k6az1UIKiHm5gFFV3QzLUR6lnxCFT1MO8RJROT8Ka5aHbyO3edzv6vMxrY2zmjC8TgWJ A3ydlmFa+FXjPNcVOF2ZestaZSXi15ohGQMR8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819254; x=1727424054; h=content-transfer-encoding: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=4bONVrDtEJzNCZ0HfN4zoXrGtxdO+/I8PMU4Hetsm/A=; b=JLTPg/S6lVaqj70dnfLU9o1CpscOMoQyzwXn/V2vot2t5Cu+2hiw8JcH/UZINR5Syd 3/ti3lUjlVcEjKpBC9p6LQ/Qm4HKQvLSdkRD7ofcAZ+GkY/rsXrKgw4fmHiulNkrj97a sAlC9k16A055bit7+mtY7QPZdd9CjkQEEiCusdVYc8b1FU14jnLh0QUYldzWrhq1jH9s 9bajSEb7tC3J7tgTJKgZEFvNquu38Tr6Ebz/M5K6oztFhZemGKOcjb9nhRPVh3qS/CFw knTsewidmiWRAtKLfwfGwkGFrxeqVIaFVLsI6L4oAGumeJ5an7+BTRR5ksyXK6FT4nhE k27g== X-Forwarded-Encrypted: i=1; AJvYcCWURZZnFk0Qs4TIJ+KSFjDES0PdPT0Wf9t4KYWEkdYdzvGdIKgAyoyz+yyIyKMJKnbprQ5qRTlShpBtc8eK9/b2k+eb@freebsd.org X-Gm-Message-State: AOJu0YzqB0Lb1HwOoMf6jh120n8RGhs5OwwXi0nh4FaQrwPFQxpug6rc W2JTNPCkmI4VyJqFbB+q9+/o0dNKBK+WL3IxVvrw2sT53d2z23/PLQxMXxMMqk32DSSJ0crl2Q7 HV5Ch3im6GW1fWyVF74oy+xQHckU2mYFnEUd6FuFkDOydNAo= X-Google-Smtp-Source: AGHT+IGCUmhP/Q7KPlesEfYn6QLjYiD4mWkH2QalLlrjC/3fTBQbh3hd0plv5/4zwk8F0lFNVsylAICQ7FTxOj4Gius= X-Received: by 2002:a05:6808:3986:b0:3d6:2da2:2b4e with SMTP id 5614622812f47-3e272941e41mr1196085b6e.14.1726819254578; Fri, 20 Sep 2024 01:00:54 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202409192103.48JL3ffi022099@gitrepo.freebsd.org> <084fa85b-7112-4dc5-bdb0-dbf727a28af0@freebsd.org> <20240920.154700.1207780392961840745.yasu@FreeBSD.org> In-Reply-To: From: Kevin Bowling Date: Fri, 20 Sep 2024 01:00:42 -0700 Message-ID: Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros To: Doug Moore Cc: Yasuhiro Kimura , vishwin@freebsd.org, kbowling@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-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: 4X94Zb5l1nz458t X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Sep 19, 2024 at 11:49=E2=80=AFPM Doug Moore wr= ote: > > https://reviews.freebsd.org/D46708 Your fix is logically correct, thank you Doug. I committed it with your authorship as I would otherwise make the same change to fix the tree now. Pondering aloud, I am uncertain why this did not affect a modular build, I see if_sriov.c in the ix makefile. > > fixes compilation, if you want to copy it. > > On 9/20/24 01:47, Yasuhiro Kimura wrote: > > From: Charlie Li > > Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type m= acros > > Date: Thu, 19 Sep 2024 23:59:47 -0400 > > > >> Build fails: > >> /usr/src/sys/dev/ixgbe/if_sriov.c:103:16: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 103 | sc->hw.mbx.ops.write(&sc->hw, &msg, 1, vf->pool); > >> | ~~~~~~~~~~~~~~^~~~~~ > >> /usr/src/sys/dev/ixgbe/if_sriov.c:377:13: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 377 | hw->mbx.ops.write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, > >> vf->pool); > >> | ~~~~~~~~~~~^~~~~~ > >> /usr/src/sys/dev/ixgbe/if_sriov.c:568:13: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 568 | hw->mbx.ops.write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, > >> vf->pool); > >> | ~~~~~~~~~~~^~~~~~ > >> /usr/src/sys/dev/ixgbe/if_sriov.c:585:21: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 585 | error =3D hw->mbx.ops.read(hw, msg, IXGBE_VFMAILBOX_SIZE, > >> vf->pool); > >> | ~~~~~~~~~~~^~~~~ > >> /usr/src/sys/dev/ixgbe/if_sriov.c:646:19: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 646 | if (hw->mbx.ops.check_for_rst(hw, vf->pool) =3D=3D 0) > >> | ~~~~~~~~~~~^~~~~~~~~~~~~~ > >> /usr/src/sys/dev/ixgbe/if_sriov.c:649:19: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 649 | if (hw->mbx.ops.check_for_msg(hw, vf->pool) =3D=3D 0) > >> | ~~~~~~~~~~~^~~~~~~~~~~~~~ > >> /usr/src/sys/dev/ixgbe/if_sriov.c:652:19: error: member reference base > >> type 'struct ixgbe_mbx_operations[64]' is not a structure or union > >> 652 | if (hw->mbx.ops.check_for_ack(hw, vf->pool) =3D=3D 0) > >> | ~~~~~~~~~~~^~~~~~~~~~~~~~ > >> 7 errors generated. > >> *** [if_sriov.o] Error code 1 > > Same here with: > > > > * Commit 420c9844702 > > * amd64 > > * Clean build from scratch > > > > --- > > Yasuhiro Kimura From nobody Fri Sep 20 09:26:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X96Sp4qFLz5XSCR for ; Fri, 20 Sep 2024 09:26: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 4X96Sp3wX2z4HRb; Fri, 20 Sep 2024 09:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726824362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SC6Y5/g5keMkboEzfmjuox53qjcamcDxMFukF5j196k=; b=I2zC0+XR9KTiR8Q2+wElTpifyg+IfZqvIf/m+ixyMJ3hhb2CDu+goFaIOoKhLy7kKHTBHC F2GPaKkc/vRU2wVYMBaUwaOju/YReSv6ZZbZ26h10AXiFSWprmPrcloXgWNNHiGSrNRK/o GtE276SpgML9CoaU9c+h9ujXwEAfqqCZJZmz7plMDHvWdwATEoYzB80yqMqqtQOD8sBmkz g2giWc3mNLe6IYYhiQVOX2qDTDMv5CBWNfPNFhiW4DTWOl93CyKsfLdSBPSTzGVfNYvUW1 BTx2lYzrvcGDN+BODCum3eZUG/EEGyX1bQf7Xf5IDkP+glHf4UuXCOVrH/hU1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726824362; a=rsa-sha256; cv=none; b=nJhSqRtp1iMmP1z4vm9byqDSkRixH0BZnRY30Y1pU77hn9tnDzl2GV5xP1rGIK5JbHE0Lv VXDB15rwNdAP+QPsF84WWfwV8W6/lGSDm+UtaPB+b7rNN82TGhDadhh0cV+3yAK1c+p0Ry qn1H+LJR9/9bYD/akZAhhplgTrAjFNjz7GZM6y+GvboUZEMKyUE/ANlHqs/4TVdP5Wnjmb IMkLEgUFkjVdqh+SmVLKZna7hJEkWkqTgIcNRHNuQWsizIyTcazuKX/L3CJy+6SFkQ00k1 V9qXTJnB1/aKnXc872VWAQ0mJFabrSId2AaOSRJhXKLVbW0ZIGVlbdbXLVALDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726824362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SC6Y5/g5keMkboEzfmjuox53qjcamcDxMFukF5j196k=; b=N5kjeKZ8h1sohpNZmpi/Yz6EWbE3Lc8EOgj38Ju2ir5DtPOM1dKvr9op8t9k3HXHphT3XF i9Ryeq1D6lgtc8FB5Jn7Kh+pMciZeFb9Huydf1cKor554pMJJVnNxZQxHQZpoHen+cYk+v I17EcEo+HvIyJtLc1tFTJkel+IBwgHVQ36A3n1nhsPasuBntSyWMZrsNaIE0NfY8YZoz4w 08LGYXJ3bCrPRTvE3sxukGCMGjyl/OKDgnG8DBgrrnnLAHgY8lwMfy5ofoHFDbLpdE81WL VkwPrrXRb7v4VNaKOCg3rgtNSdDG9KRQDTn/Gwzi3CDNVYoCdz/6LCvP9ID/gQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X96Sp3CMSzkgg; Fri, 20 Sep 2024 09:26: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 48K9Q2LR082438; Fri, 20 Sep 2024 09:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K9Q2Fd082437; Fri, 20 Sep 2024 09:26:02 GMT (envelope-from git) Date: Fri, 20 Sep 2024 09:26:02 GMT Message-Id: <202409200926.48K9Q2Fd082437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: d565364dadeb..126e0f4f7dcb - vendor/openssh - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssh X-Git-Reftype: branch X-Git-Commit: 126e0f4f7dcb4ed8d46dc373a4d00e022c457db4 X-Git-Oldrev: d565364dadebdaabef4ecead36ae102774e81174 X-Git-Newrev: 126e0f4f7dcb4ed8d46dc373a4d00e022c457db4 Auto-Submitted: auto-generated The branch vendor/openssh has been updated by emaste: URL: https://cgit.FreeBSD.org/src/log/?id=d565364dadeb..126e0f4f7dcb 126e0f4f7dcb Vendor import of OpenSSH 9.9p1 From nobody Fri Sep 20 09:26:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X96T45YJTz5XSRK for ; Fri, 20 Sep 2024 09:26: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 4X96T454RSz4HsB; Fri, 20 Sep 2024 09:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726824376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDB1x/aT+2pcTlQuhQFb8rZY/4tvJDnlUv6wPvpbKoo=; b=Muh6Ns5YXrT9hlqoeEKceW0/CZ4AXDF0lVN1AgYxBg2JqhpBiEwUvCIv0NEp57ahyFKgmy AN20/IMbo+h9G/rgN5eIjfzsAxdgmUdJeiDj55mtN6E92hmaZJRBAblaCx3vSyDVLzKPU3 fa5C+IWRRG+1Xs9lMdw9AcqqcH97Z/r6ccaCAyCymR4BTPgDesuZ1vs/gwldmlEKJANsGI 1UBayqjZqXR8JoDZxGK02923ZONKiVLkMjRa3TYU6MUiVQrsyMu7/33/UKEA9L4F7KBQDC 62Usn82Ml8XZ24mFyXNJSNmr8DTItUt6cNeYsEnrbiP2VniCtuynHAomCTLAyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726824376; a=rsa-sha256; cv=none; b=Ttow1pwTukXPj2eT7jQUOPkln23f+cuZwhM4e5XwvCt/8rSfAXavO7EuRAPypeafhSNuns D6yiHFqJBYmbsZjlzPUXNvoG8DBCP0pab/JgoGgDwHl8JDxu6n9kn/pwugYiLeI306ocVW 3Bkd/FPbIMVPwQhoe2mel6JCIGzxF+Fq0Xuxgswys/I6jbnsSZIYoMyg+BR/rGOJHibEy9 L6TeKJbfM0W8l83nI7dxzVutQlM29sw2Pp6O3YSmnHkhv3BxLueaBtLUCe2KFESzmwJVDx PussHC0qpKzdOAUqfvAQHpvij8ImrzR6Z6XMXxvqDhw6sVa5lRRm941wiQ10KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726824376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDB1x/aT+2pcTlQuhQFb8rZY/4tvJDnlUv6wPvpbKoo=; b=vLwaGI7ZKS7ayAWlwSjfzcxq49PDbVClHkHnSY18WKYH2kBx3/uNox4sZI1/GZqQ1pABAu 4A+rQGN03Ag+YG3DVAysDMV+hhmAsumwNpkabWcJHFVzN5u84N/mAK9O4FYnA9yfku5oqj zlp5Yxa1h+NOiI0TgVLO/nf14sn4zZrXgi66tx/jncczTIoVml47kGleVV5ubwhIuDGamo nUn4de7l04Cnor3p+YNEb9ds/wSrxcMarEr7cF8r0fPdkGoCKvxIVVFRXOOMD95SpfqDio ucWygG8EX4EWQKmLkAcgDXOAuGBtsiWNeS46ys9Lvj/vez0wj26d3rJEC+ZfIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X96T44h2NzkpD; Fri, 20 Sep 2024 09:26: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 48K9QG12082555; Fri, 20 Sep 2024 09:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48K9QGNA082554; Fri, 20 Sep 2024 09:26:16 GMT (envelope-from git) Date: Fri, 20 Sep 2024 09:26:16 GMT Message-Id: <202409200926.48K9QGNA082554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 1b02c07f64db - Create tag vendor/openssh/9.9p1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/tags/vendor/openssh/9.9p1 X-Git-Reftype: annotated tag X-Git-Commit: 1b02c07f64db49cf02396bbc46266f03c4683014 Auto-Submitted: auto-generated The annotated tag vendor/openssh/9.9p1 has been created by emaste: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssh/9.9p1 tag vendor/openssh/9.9p1 Tagger: Ed Maste TaggerDate: 2024-09-20 09:25:29 +0000 Tag OpenSSH 9.9p1 commit 126e0f4f7dcb4ed8d46dc373a4d00e022c457db4 Author: Ed Maste AuthorDate: 2024-09-20 09:24:23 +0000 Commit: Ed Maste CommitDate: 2024-09-20 09:24:26 +0000 Vendor import of OpenSSH 9.9p1 Sponsored by: The FreeBSD Foundation From nobody Fri Sep 20 09:39:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X96mH0d6pz5XVJB; Fri, 20 Sep 2024 09:39:27 +0000 (UTC) (envelope-from yasu@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 4X96mG5Qxyz4Jwg; Fri, 20 Sep 2024 09:39:26 +0000 (UTC) (envelope-from yasu@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726825166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JkziJGblXg7P7NKIFw13gCOoAadv5idIrFE/v9PHB1Y=; b=DJsskqoQZaqUatvNzFlfa1oBUZezfS6CKmoNybyH5V0jOeoCDD8rqKxmTr2gVqCp1KTyNw yNsiF+wjxd5EScuDfT9Hnr/aVmfqTzylXiG7pjlBP7wBZOiTdn/dRq8wt5UjQ76OGLUuyc MkxB24t925ViYBhG3zpffsxVL7Y8W1rA1LJIB86+3R0lUHbx/slnxFY0zNFSms3xl5bUl+ Km3B0TS65n/riq8lrYCzgdaxI0XsdT0dzRQazmzorKjMkuLq7wOA0FZKvrJEuxQ7LZYabb LgqBCgL/yFczy01ssgfQZg//BHpD2jgOoqjiTPloyv5v80IBe2tl51Ubgy3JwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726825166; a=rsa-sha256; cv=none; b=fbRb/SMBv142f3+EL7b/kxYMWeSEtGyFioc3zFqnKvZdshWA0cHHG3Xk3mwtmX617wRoQg PdMqf8XL7KC/BUSPPPKv4sej/M8NmQS1BJJEDEMevKi6y/wMxS7NMUmi0EiRAHj3fEr6Ch +S5h2zJOvSwUMtvv+wcMETul3tnpi4WeaTJ5mRJCLbl7q/U2fU+7mRArO3QqJXCfDxNF// p68ponF/sAhIl/zvHK8x7j+13/30EseWC7assdZuUBUGRr9BigLV6D6f37HJc7ytjp9hvl moqUmW8jJkLdHZXvfqisI5s0/avIhqNH1NhHPTpU7f3BkmtlajEib1YW4ZPtaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726825166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JkziJGblXg7P7NKIFw13gCOoAadv5idIrFE/v9PHB1Y=; b=SS0jCQfGdyiBACgZ65uyY2LYNXmtEoKKP/PeIDwTvkMK9O69OqvG/C/n6uDSTsdBJSN1cn 1QBYxOfjNy8LIxy9diWwzUjpRNh7GiLSpkWBaRYdYmwBo18OGqWzUQkk73k8ysA7mea1Zk hfhiLFkmWd3AuLtDhr7qmURoPEf7zTk0FrXjVyOo/xF1tGrl2XsX8MOn2Op0Whce9JOD6J tykuMiegf/6T6PVPq4/dR0x9aX5efvDRI0ETgIBJmYKJc0BzRPZSC2aOnIaJSivI7lMeYf JQBgpFaOlLK03GpKGXY0bF/3os0JhymsxgbV3ZPhFJ/XgGUTurLSSJo9hiCAJw== Received: from localhost (unknown [IPv6:240b:11:220:fe00::174:11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: yasu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X96mF0Gnbz1QSX; Fri, 20 Sep 2024 09:39:24 +0000 (UTC) (envelope-from yasu@FreeBSD.org) Date: Fri, 20 Sep 2024 18:39:00 +0900 (JST) Message-Id: <20240920.183900.500851687175828331.yasu@FreeBSD.org> To: kevin.bowling@kev009.com Cc: unkadoug@gmail.com, vishwin@freebsd.org, kbowling@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 10746040820e - main - ixgbe: rename VF message type macros From: Yasuhiro Kimura In-Reply-To: References: <20240920.154700.1207780392961840745.yasu@FreeBSD.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: base64 RnJvbTogS2V2aW4gQm93bGluZyA8a2V2aW4uYm93bGluZ0BrZXYwMDkuY29tPg0KU3ViamVjdDog UmU6IGdpdDogMTA3NDYwNDA4MjBlIC0gbWFpbiAtIGl4Z2JlOiByZW5hbWUgVkYgbWVzc2FnZSB0 eXBlIG1hY3Jvcw0KRGF0ZTogRnJpLCAyMCBTZXAgMjAyNCAwMTowMDo0MiAtMDcwMA0KDQo+IE9u IFRodSwgU2VwIDE5LCAyMDI0IGF0IDExOjQ54oCvUE0gRG91ZyBNb29yZSA8dW5rYWRvdWdAZ21h aWwuY29tPiB3cm90ZToNCj4+DQo+PiBodHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcvRDQ2NzA4 DQo+IA0KPiBZb3VyIGZpeCBpcyBsb2dpY2FsbHkgY29ycmVjdCwgdGhhbmsgeW91IERvdWcuICBJ IGNvbW1pdHRlZCBpdCB3aXRoDQo+IHlvdXIgYXV0aG9yc2hpcCBhcyBJIHdvdWxkIG90aGVyd2lz ZSBtYWtlIHRoZSBzYW1lIGNoYW5nZSB0byBmaXggdGhlDQo+IHRyZWUgbm93Lg0KPiANCj4gUG9u ZGVyaW5nIGFsb3VkLCBJIGFtIHVuY2VydGFpbiB3aHkgdGhpcyBkaWQgbm90IGFmZmVjdCBhIG1v ZHVsYXINCj4gYnVpbGQsIEkgc2VlIGlmX3NyaW92LmMgaW4gdGhlIGl4IG1ha2VmaWxlLg0KDQpJ IGNvbmZpcm1lZCBidWlsZGtlcm5lbCBzdWNjZWVkcyB3aXRoIGNvbW1pdCAyNjdmMjIzZjYyMi4N ClRoYW5rcyBmb3IgcXVpY2sgZml4IQ0KDQotLS0NCllhc3VoaXJvIEtpbXVyYQ0K From nobody Fri Sep 20 10:05:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X97L5032Wz5Vbpr; Fri, 20 Sep 2024 10:05: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 4X97L46g92z4SSR; Fri, 20 Sep 2024 10:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726826716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5m4vpSJR3OY5I6zOlGSSxcNF7RRN9AzpGlu6vdSxxWU=; b=BZce+jWpNE2vgVa70ftYrj+D7/RvZ5Gqt3MAUW1svgO+S9JLIPR1ofXCMJ8kYPIFvadY8Y 11h78pIgG+6BQ0mSS0lNPp7asWYYIl5o5WysH8RlcDJsPfPxnEXzW/i0pkhWxTDG0PytWG Dz8/bs9Esh3fLEVuEEYQAftSGSeuJcjS4aRtoBOhBRzzbftKgTSXPwRsWSd1mMWZBItBWQ qVqBx7L9AXbiFY50gPAqP7tuRlIWC7EjJxJDKmvHwPZ37JGs0BOE4ap04HtnI/BPk0YpjY Z3b9rbvxrxhn29MsOqc33slpEwf1FZLpkkLQgjilETkjjv0H1k5xCFpV3782iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726826716; a=rsa-sha256; cv=none; b=D4afVsFGBhFY2ZlhPNoP5y6t3WQmdhM4ok7aAfC2AVJAqHazwNZZVZBf9JnoGFaAC67DYS gb6P72P8NiCMvFnR1vH2IRlU0v0zpAAdD/jyPzfvM5ht1wfR1nvlPeTA2r7TzhJrs9mTgG pwWuN9grc20MB3xXVp180S7Y7W2qbAIrOnVSXgVYHSgAQup2OMiiGVOw0GvWBFNIRIUMbI 12FMPGA97dVoQ+4l4vfAqguhAfzseXFTpaaDHTNQO84vhhfMSeiCjvkCWzMhaKkZYIHhhm tUKJDNLqPVl11err0cR7CSi4TXYczQx+pL6HW5an9Nj35R5eBBJezAUZoFd6xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726826716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5m4vpSJR3OY5I6zOlGSSxcNF7RRN9AzpGlu6vdSxxWU=; b=QSS6N4PWjmNxVb7ZJvJUBXKlxUXWw0FEpf/DmGwmLBx5Hm8KPquuD7gzhlg7NxaCK1D/mM 7cEgXDARP+/KviugkXekAs3bsEaIaOfVwYZCCa0lqaczfBPI996EmfxZ3Of84N45sW9vO6 D4JxNknFvFG2tbnrUI5+DJceEl11fjCo9t8pQq3vpAlFML99bIoa+DTx05F5YVG+WITemH yoAdhLm38zhn+3+ugsNxNZsx1/ro1BI1FbaUIPwt8NT4+850N1zxUSlRZMEMO8wPBWrcFE LHMpJA1y39ZOKcAt1MYDP2ecAJecF6CfKwq5QtNJgeXT/NdWG9cOk/lV9tygQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X97L46869zlQP; Fri, 20 Sep 2024 10:05: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 48KA5GaY050854; Fri, 20 Sep 2024 10:05:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KA5Gs6050851; Fri, 20 Sep 2024 10:05:16 GMT (envelope-from git) Date: Fri, 20 Sep 2024 10:05:16 GMT Message-Id: <202409201005.48KA5Gs6050851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 611d52a19698 - stable/14 - zfs: cherry-pick change from openzfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 611d52a1969892e5d35d5f26ad850a56f351a78e Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=611d52a1969892e5d35d5f26ad850a56f351a78e commit 611d52a1969892e5d35d5f26ad850a56f351a78e Author: Zhenlei Huang AuthorDate: 2024-05-30 16:58:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 10:03:36 +0000 zfs: cherry-pick change from openzfs Vendor PR: #16210 FreeBSD: Add const qualifier to members of struct opensolaris_utsname Obtained from: OpenZFS OpenZFS commit: e2357561b9499296bff758afe4868dbc39735675 Note: this is required by the following up MFC [1]. No functional change. 1. 356be1348dac kernel: Make some compile time constant variables const --- sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h | 10 +++++----- sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h index 2e4efc60544a..894ccd8bf9b1 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h @@ -45,11 +45,11 @@ #define F_SEEK_HOLE FIOSEEKHOLE struct opensolaris_utsname { - char *sysname; - char *nodename; - char *release; - char version[32]; - char *machine; + const char *sysname; + const char *nodename; + const char *release; + char version[32]; + const char *machine; }; #define task_io_account_read(n) diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c index e3653167323b..10d3a7772b11 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include static struct opensolaris_utsname hw_utsname = { + .sysname = ostype, + .nodename = prison0.pr_hostname, + .release = osrelease, .machine = MACHINE }; @@ -52,10 +55,6 @@ utsname(void) static void opensolaris_utsname_init(void *arg) { - - hw_utsname.sysname = ostype; - hw_utsname.nodename = prison0.pr_hostname; - hw_utsname.release = osrelease; snprintf(hw_utsname.version, sizeof (hw_utsname.version), "%d", osreldate); } From nobody Fri Sep 20 10:05:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X97L61xgrz5Vbmn; Fri, 20 Sep 2024 10:05: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 4X97L617jFz4SXs; Fri, 20 Sep 2024 10:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726826718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1vzKxd3DfrxABBDtw6TmHenBgT0OdfbD14eIhWuOCY=; b=dLnzL2VxveXelhhTAs/bRHkWKaDLN9gQDzoj8no3DvJfaohgll7QIyJ+kf/+qbjPJkKlTM YJ2JMHsSMiJ9fAMzoaXbUN8da2r4EyJ0wOWen5/HmO79PXJNKAHXN4dEMWbvE1xMP9x07v vhZqUZ78dj4l7vFqxFvksAWWL+c3pLOQOQ41AKKxAQoR36kkQzx4BFswSgKQkMmgpyzKok T1wACuWnq2P9vCOpiI4M9CaGUEa/UzScmhWEKSBsA4mQP6LkIpPzY+MGoyJfhKarSTGT5K N5KSRCba8Ub2YJBRysOI9MVQ31qvcKAGNzdjSz6Ww8lUUBe9FOugsiGv1ES/WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726826718; a=rsa-sha256; cv=none; b=Ng7k2/bJjOQ4kzZ5NiFrWs4wSgRc5rxK3baE81h8tE1bOs8wpVRW9q8gb65oXeHv7lNxAj AC2dZ4dcjEN7ZN4eo6zdT+7Yd3VHGkDKv2ni5z0krrS0wLL6eW19vfFHdJJ4YVJYxNjTVJ oT/NAn5bI0aCwpW3gLD8AHMsWUN/sK2AOWnSp47kWsO2yMrQSeCeE1ETy5nnRa4VX92Sc2 M9LUCFZ2mpDti4wOVVdfrBNyaVC3PDjx+Ol/ywE7maoJ5a+yE+mWPOW5e6Me0Mvcz4z4w0 UlBr+lz2/Q/lCD6Fion0fdqk8BPnN+zMLA1wqow6TNwiBz+v4YVnAMCqty+LWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726826718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1vzKxd3DfrxABBDtw6TmHenBgT0OdfbD14eIhWuOCY=; b=q+zgg9wDa1B5m0lo8DsD1RmPZch3ON+cYMVgpksQz2KnkuMqUMkTRzo9WEEnq1jkjX+KNl FtN9ZFn0Tp5FjyRTij9J61Vdiy1u6T5gbJfVEd23G+6kHStz5hP3qBQD2CGIWHTCg/V0Nq qarjy1jcWt1y780Egh/prsYn0iYyDIUeXC5n/vI8GJuwF7zuWEA6SQJO9LS6+JJTjHs4eq FC7Snu9Kpxo/ZHSL0pCkUUaSfhEzpMAAwK0q4L496119UmUe3rDaaU6/L20YCNcgZ/fTWn oNYISNUnVzrm9/61od0KmTNmgcLRShffReelH++L77PHUo6hg7OF9NPdSwo/LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X97L56jWCzlLD; Fri, 20 Sep 2024 10:05: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 48KA5HE7050911; Fri, 20 Sep 2024 10:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KA5HZH050908; Fri, 20 Sep 2024 10:05:17 GMT (envelope-from git) Date: Fri, 20 Sep 2024 10:05:17 GMT Message-Id: <202409201005.48KA5HZH050908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 497f577f460b - stable/14 - kernel: Make some compile time constant variables const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 497f577f460ba93dda38910bf49b390fa610480f Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=497f577f460ba93dda38910bf49b390fa610480f commit 497f577f460ba93dda38910bf49b390fa610480f Author: Zhenlei Huang AuthorDate: 2024-08-30 10:26:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 10:04:02 +0000 kernel: Make some compile time constant variables const Those variables are not going to be changed at runtime. Make them const to avoid potential overwriting. This will also help spotting accidental global variables shadowing, since the variable's name such as `version` is short and commonly used. This change was inspired by reviewing khng's work D44760. No functional change intended. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45227 (cherry picked from commit 356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a) --- sys/arm/arm/identcpu-v6.c | 6 +++--- sys/arm64/arm64/identcpu.c | 2 +- sys/conf/newvers.sh | 14 +++++++------- sys/kern/init_main.c | 24 ++++++++++++------------ sys/kern/kern_mib.c | 16 ++++++++-------- sys/powerpc/powerpc/machdep.c | 5 +++-- sys/riscv/riscv/identcpu.c | 6 +++--- sys/sys/copyright.h | 4 ++-- sys/sys/sysctl.h | 8 ++++---- sys/sys/systm.h | 8 ++++---- sys/x86/x86/identcpu.c | 6 +++--- 11 files changed, 50 insertions(+), 49 deletions(-) diff --git a/sys/arm/arm/identcpu-v6.c b/sys/arm/arm/identcpu-v6.c index 6293a5ccaceb..83e3e255d50e 100644 --- a/sys/arm/arm/identcpu-v6.c +++ b/sys/arm/arm/identcpu-v6.c @@ -50,10 +50,10 @@ #include #include -char machine[] = "arm"; +const char machine[] = "arm"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); static char cpu_model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index cc2c95d7cfb6..84ad2d0eb282 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -60,7 +60,7 @@ static void print_cpu_caches(struct sbuf *sb, struct cpu_desc *desc); static u_long parse_cpu_features_hwcap32(void); #endif -char machine[] = "arm64"; +const char machine[] = "arm64"; #ifdef SCTL_MASK32 extern int adaptive_machine_arch; diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index d5ea53664606..3edff3630ae3 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -306,13 +306,13 @@ $COPYRIGHT #define VERSTR "${VERSTR}" #define RELSTR "${RELEASE}" -char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; -char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; -char compiler_version[] = "${compiler_v}"; -char ostype[] = "${TYPE}"; -char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; -int osreldate = ${RELDATE}; -char kern_ident[] = "${i}"; +const char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; +const char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; +const char compiler_version[] = "${compiler_v}"; +const char ostype[] = "${TYPE}"; +const char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; +const int osreldate = ${RELDATE}; +const char kern_ident[] = "${i}"; EOF ) vers_content_old=$(cat vers.c 2>/dev/null || true) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 917c3ea07baf..1575287716ee 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -367,36 +367,36 @@ print_version(const void *data __unused) printf("%s\n", compiler_version); } -SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, +C_SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright); -SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, +C_SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, trademark); -SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL); +C_SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL); #ifdef WITNESS -static char wit_warn[] = +static const char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; -SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, +C_SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, +C_SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, print_caddr_t, wit_warn); #endif #ifdef DIAGNOSTIC -static char diag_warn[] = +static const char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; -SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, +C_SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, +C_SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, diag_warn); #endif #if __SIZEOF_LONG__ == 4 -static char ilp32_warn[] = +static const char ilp32_warn[] = "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n"; -SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, +C_SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); -SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, +C_SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); #endif diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 10bf4cde6489..d60c72a00f63 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -94,20 +94,20 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Regression test MIB"); #endif -SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, - kern_ident, 0, "Kernel identifier"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, + kern_ident, "Kernel identifier"); SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, BSD, "Operating system revision"); -SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, - version, 0, "Kernel version"); +SYSCTL_CONST_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, + version, "Kernel version"); -SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, - compiler_version, 0, "Version of compiler used to compile kernel"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, + compiler_version, "Version of compiler used to compile kernel"); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, - ostype, 0, "Operating system type"); +SYSCTL_CONST_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, + ostype, "Operating system type"); SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxproc, 0, "Maximum number of processes"); diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 638153ba49bc..899fb430e5d9 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -152,8 +152,9 @@ static char init_kenv[2048]; static struct trapframe frame0; -char machine[] = "powerpc"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, ""); +const char machine[] = "powerpc"; +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 385acb29381b..8f1bd7990393 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -60,10 +60,10 @@ #include #endif -char machine[] = "riscv"; +const char machine[] = "riscv"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, - "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); /* Hardware implementation info. These values may be empty. */ register_t mvendorid; /* The CPU's JEDEC vendor ID */ diff --git a/sys/sys/copyright.h b/sys/sys/copyright.h index ee6f5b805164..176e15d21dc2 100644 --- a/sys/sys/copyright.h +++ b/sys/sys/copyright.h @@ -45,5 +45,5 @@ #define COPYRIGHT_UCB \ "Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994\n\tThe Regents of the University of California. All rights reserved.\n" -char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_UCB; -char trademark[] = TRADEMARK_Foundation; +const char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_UCB; +const char trademark[] = TRADEMARK_Foundation; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 76cbae25f4e5..0cfa2a7bd245 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1155,10 +1155,10 @@ SYSCTL_DECL(_regression); SYSCTL_DECL(_security); SYSCTL_DECL(_security_bsd); -extern char machine[]; -extern char osrelease[]; -extern char ostype[]; -extern char kern_ident[]; +extern const char machine[]; +extern const char osrelease[]; +extern const char ostype[]; +extern const char kern_ident[]; /* Dynamic oid handling */ struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 581b981ef9e0..973a7604fe5f 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -53,9 +53,9 @@ __NULLABILITY_PRAGMA_PUSH extern int cold; /* nonzero if we are doing a cold boot */ extern int suspend_blocked; /* block suspend due to pending shutdown */ extern int rebooting; /* kern_reboot() has been called. */ -extern char version[]; /* system version */ -extern char compiler_version[]; /* compiler version */ -extern char copyright[]; /* system copyright */ +extern const char version[]; /* system version */ +extern const char compiler_version[]; /* compiler version */ +extern const char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ extern u_long pagesizes[]; /* supported page sizes */ @@ -113,7 +113,7 @@ struct ucred; }) #define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) -extern int osreldate; +extern const int osreldate; extern const void *zero_region; /* address space maps to a zeroed page */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 36056b85101b..d97c9c47e97d 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -120,7 +120,7 @@ u_int cpu_power_eax; /* 06H: Power management leaf, %eax */ u_int cpu_power_ebx; /* 06H: Power management leaf, %ebx */ u_int cpu_power_ecx; /* 06H: Power management leaf, %ecx */ u_int cpu_power_edx; /* 06H: Power management leaf, %edx */ -char machine[] = MACHINE; +const char machine[] = MACHINE; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, @@ -154,8 +154,8 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); #endif char cpu_model[128]; From nobody Fri Sep 20 10:10:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X97Rx4fgzz5VcL0; Fri, 20 Sep 2024 10:10: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 4X97Rx4BX9z4TKv; Fri, 20 Sep 2024 10:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3EtI/r0h2WMuF7HoRbTn866wQyZ05voHoPvmqsAyv4=; b=IpO2cPrygVUKmkPzJL2JPO/UfxI99zp8nECmtuqjSRLnQd/48lTy6dvEGzRuW6YQ5D3HT+ Fd3ejE9p/N5Om4/yrUjCUUDWIOViPIHiTSxZQYGobd41QM8+bmqvhCDEyyDLVK0NV8GOL+ wHsyDduM2j3MdGVgrA9FO2AWgP768O2B/E1gklMhgVWXEyT627pD93MJOv57WIg4tXlkCq qhs7uhVSsjRVwN1BiNsiBa1as1by09V55IeMg/dOYZubTNH2RXv9KV5UpnB79mRtl+F6Zp v0K5Ab7YccHxZFnAC9hWMXsr+ejeDn1toC6Lzhcc3AwiDxsK4lbgChDDfz3gPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726827021; a=rsa-sha256; cv=none; b=NoQ7s1kVKtQjhZFVkRRh16/HGDC82j5O+nH9QMP/57whINI8BzSe2SQsRH7DZTuxj4AO14 /KUcjdkHm5BXKI9L0gxUN8lNBRiJc8k0Q1P8Jw4JJkBauNtPthe/UM9Kv/WmdZRFaU8bGh vP0fw8F5+9sbAzjZaPrwQukVoLqfxHm5MunQi16CJ1+MhwYvmkUPGMOw1dfkcykDJbIjXl M/u9Mob0Oq0TwaZkyzluZmXoni84QquoQlcBAwBW3WIpTI46fY4EJI9hWUQVQ9gkLTK7km 9EfMzK6z2QnnarRt8bBrUhGnE3qoJ/UUzyrazD+t9zdcky4ON/ohnANTBIKctQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3EtI/r0h2WMuF7HoRbTn866wQyZ05voHoPvmqsAyv4=; b=lDTzEMu41nBH5GzMTSVwTIJnV4+1i3CJDM4FfnN1bJIrarLkto1JQa93d8uf4p4bLzwiG7 rUIGOSDW4Q70tyGjhJqhT6icAzeJSshfd+IQPjOiOniem/rvgGQvxyASZX1mklzFRWb7Y7 P6TqwD+clAOfHDocC+qut7PpCvx/TX2sGA4cILRv5SB5iuC4oFfdGqoKW8rga504vnLnDf wBLaZ+QJAEg6N9ay2jkkhc23GS0id9pGpdhhHyYUBsa/ofYE+0uiQKj+aCr3CuQEXeW7Lu YFasoIAnXU/cDGjJarV9st1RayUfNOVQlfSzc5lta9uXLaGy7JFmfVyCopPCsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X97Rx3QG9zlny; Fri, 20 Sep 2024 10:10: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 48KAALsP060256; Fri, 20 Sep 2024 10:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KAALkS060253; Fri, 20 Sep 2024 10:10:21 GMT (envelope-from git) Date: Fri, 20 Sep 2024 10:10:21 GMT Message-Id: <202409201010.48KAALkS060253@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: e30b58846003 - main - bpf: Add a comment on the large `#ifdef _KERNEL` block List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e30b58846003a54df028686363b5abed59897779 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e30b58846003a54df028686363b5abed59897779 commit e30b58846003a54df028686363b5abed59897779 Author: Zhenlei Huang AuthorDate: 2024-09-20 10:06:22 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 10:06:22 +0000 bpf: Add a comment on the large `#ifdef _KERNEL` block This improves readability a little. MFC after: 3 days --- sys/net/bpf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/bpf.h b/sys/net/bpf.h index e44a7cd2359d..2c227bb2f09d 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -448,7 +448,7 @@ bpf_peers_present(struct bpf_if *bpf) bpf_mtap_if((_ifp), (_m)) #define BPF_MTAP2(_ifp,_data,_dlen,_m) \ bpf_mtap2_if((_ifp), (_data), (_dlen), (_m)) -#endif +#endif /* _KERNEL */ /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). From nobody Fri Sep 20 10:10:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X97Ry5YlJz5VcXr; Fri, 20 Sep 2024 10:10: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 4X97Ry4w9Cz4TQ7; Fri, 20 Sep 2024 10:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfhXMcwhSw2OZVeycf/8JpBHsfc6i9AtQfUvU/lpKXI=; b=u68R/zLNApM21kF53ZSQc+wg9mAb7bFjRyJ5tgOxQpm+VUHUfF3vWGTG92gCW+vp8DqqVW ygoZx/FvgcfOGltyuFreFnD9eojzcDq/RVDyFb7c4j6eROY8ZKXb6NCYLmlAKak2+sCLFQ jtubqUmMgcnH9aq224oMa/CeOOtH8IDm7SaI4FGqcknYpwDxO6ELqpFuw+O3CoPQZTyDr2 rwkniXBSKlJBIxprmvfwAgIYh9y23q+SJMw101MEDs24NeagvSJXsempf4iWk2nrAcQxNM Z1a3up4xFRISKHGWeyu84y8BvFa3Jr2UJ4vMK6S/b68nyvuW/b6h+Pf10OWrMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726827022; a=rsa-sha256; cv=none; b=UDcduvF4ayJO9A1m8ModksHq7yIrR39s0RhAaBfAexiUbQAqXWpdN7mjVuMSjnbwgys2FP Kytz60belHyXMLydff++aueAfdRRdai262fVngqYNqaJhZuUYM5f82epMrNLej1bwE5zOi xKwa/wwHA7e8En7wqm8v9ot0JKwFMveTOWBdNG4IaOHjk27K4EoKm3xJxyrIK+BXRyHwhA UPC0yxwBsSYE64vrml74F7UrQvOVSL55nk6hS7Yxu8043azOq/pR0eznEYuOukTchDFqXn gL7CJvdXXTXAW1/TTWFNRDyk9X7DYGIQc6trogwXUef+12pKgrMFop18SghB0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfhXMcwhSw2OZVeycf/8JpBHsfc6i9AtQfUvU/lpKXI=; b=SW5h3EPHr7mIidStJ+Jw8kQtwjZ4KnIX2AbDHqwskrXJYZck1D0xd660gztO4wO5vA0Kzk aJBcKlecPoEW2BPCLT339RikpxO/m6uzRVgwiolBBGkFaOStd7Mwwbgu+c89XMYlq7hYzx FoImSlpRo3TCQdmcFPTKndJzchb7J4dcRKtt/rLQbLKaxf6aTqSYl2aTmkBjgFHInkDJ6k rVyEXccKibETRqo5xTTTWr9UhLt1m+1szvVcx56M5S7MP4WLiyqZDKek8uJkz+HjXMfGoo LLkptouMkPQfmHqIOuneNfoWlfZnVO2E1TLfIu+dcL07S788ct8h74dRiu9khQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X97Ry3b5xzlp0; Fri, 20 Sep 2024 10:10: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 48KAAMnk060304; Fri, 20 Sep 2024 10:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KAAMGQ060301; Fri, 20 Sep 2024 10:10:22 GMT (envelope-from git) Date: Fri, 20 Sep 2024 10:10:22 GMT Message-Id: <202409201010.48KAAMGQ060301@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: 1baf6164e4d6 - main - bpf: Some style and white space cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c commit 1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c Author: Zhenlei Huang AuthorDate: 2024-09-20 10:06:22 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 10:06:22 +0000 bpf: Some style and white space cleanup MFC after: 3 days --- sys/net/bpf.c | 14 +++++++------- sys/net/bpf.h | 44 ++++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 5dfa6fb30565..f5a2d2c0d7a2 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -172,7 +172,7 @@ struct bpf_dltlist32 { #define BIOCSETFNR32 _IOW('B', 130, struct bpf_program32) #endif -#define BPF_LOCK() sx_xlock(&bpf_sx) +#define BPF_LOCK() sx_xlock(&bpf_sx) #define BPF_UNLOCK() sx_xunlock(&bpf_sx) #define BPF_LOCK_ASSERT() sx_assert(&bpf_sx, SA_XLOCKED) /* @@ -1022,7 +1022,7 @@ bpfread(struct cdev *dev, struct uio *uio, int ioflag) d->bd_state = BPF_IDLE; while (d->bd_hbuf_in_use) { error = mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, - PRINET|PCATCH, "bd_hbuf", 0); + PRINET | PCATCH, "bd_hbuf", 0); if (error != 0) { BPFD_UNLOCK(d); return (error); @@ -1065,7 +1065,7 @@ bpfread(struct cdev *dev, struct uio *uio, int ioflag) BPFD_UNLOCK(d); return (EWOULDBLOCK); } - error = msleep(d, &d->bd_lock, PRINET|PCATCH, + error = msleep(d, &d->bd_lock, PRINET | PCATCH, "bpf", d->bd_rtout); if (error == EINTR || error == ERESTART) { BPFD_UNLOCK(d); @@ -2132,7 +2132,7 @@ bpfpoll(struct cdev *dev, int events, struct thread *td) if (devfs_get_cdevpriv((void **)&d) != 0 || d->bd_bif == NULL) return (events & - (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); + (POLLHUP | POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM)); /* * Refresh PID associated with this descriptor. @@ -3106,7 +3106,7 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) return (error); } -SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,bpf_drvinit,NULL); +SYSINIT(bpfdev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, bpf_drvinit, NULL); #else /* !DEV_BPF && !NETGRAPH_BPF */ @@ -3175,13 +3175,13 @@ bpf_peers_present_if(struct ifnet *ifp) u_int bpf_filter(const struct bpf_insn *pc, u_char *p, u_int wirelen, u_int buflen) { - return -1; /* "no filter" behaviour */ + return (-1); /* "no filter" behaviour */ } int bpf_validate(const struct bpf_insn *f, int len) { - return 0; /* false */ + return (0); /* false */ } #endif /* !DEV_BPF && !NETGRAPH_BPF */ diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 2c227bb2f09d..38c5da0dcb58 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -55,7 +55,7 @@ struct ifnet; * BPF_ALIGNMENT. */ #define BPF_ALIGNMENT sizeof(long) -#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) +#define BPF_WORDALIGN(x) (((x) + (BPF_ALIGNMENT - 1)) & ~(BPF_ALIGNMENT - 1)) #define BPF_MAXINSNS 512 #define BPF_MAXBUFSIZE 0x80000 @@ -367,8 +367,8 @@ struct bpf_insn { /* * Macros for insn array initializers. */ -#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } -#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } +#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } +#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } /* * Structure to retrieve available DLTs for the interface. @@ -414,24 +414,24 @@ struct bpf_if_ext { struct bpfd_list bif_dlist; /* descriptor list */ }; -void bpf_bufheld(struct bpf_d *d); -int bpf_validate(const struct bpf_insn *, int); -void bpf_tap(struct bpf_if *, u_char *, u_int); -void bpf_tap_if(struct ifnet *, u_char *, u_int); -void bpf_mtap(struct bpf_if *, struct mbuf *); -void bpf_mtap_if(struct ifnet *, struct mbuf *); -void bpf_mtap2(struct bpf_if *, void *, u_int, struct mbuf *); -void bpf_mtap2_if(struct ifnet *, void *, u_int, struct mbuf *); -void bpfattach(struct ifnet *, u_int, u_int); -void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); -void bpfdetach(struct ifnet *); -bool bpf_peers_present_if(struct ifnet *); +void bpf_bufheld(struct bpf_d *d); +int bpf_validate(const struct bpf_insn *, int); +void bpf_tap(struct bpf_if *, u_char *, u_int); +void bpf_tap_if(struct ifnet *, u_char *, u_int); +void bpf_mtap(struct bpf_if *, struct mbuf *); +void bpf_mtap_if(struct ifnet *, struct mbuf *); +void bpf_mtap2(struct bpf_if *, void *, u_int, struct mbuf *); +void bpf_mtap2_if(struct ifnet *, void *, u_int, struct mbuf *); +void bpfattach(struct ifnet *, u_int, u_int); +void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); +void bpfdetach(struct ifnet *); +bool bpf_peers_present_if(struct ifnet *); #ifdef VIMAGE -int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); +int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); #endif -void bpfilterattach(int); -u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); +void bpfilterattach(int); +u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); static __inline bool bpf_peers_present(struct bpf_if *bpf) @@ -442,11 +442,11 @@ bpf_peers_present(struct bpf_if *bpf) return (!CK_LIST_EMPTY(&ext->bif_dlist)); } -#define BPF_TAP(_ifp,_pkt,_pktlen) \ - bpf_tap_if((_ifp), (_pkt), (_pktlen)) -#define BPF_MTAP(_ifp,_m) \ +#define BPF_TAP(_ifp, _pkt, _pktlen) \ + bpf_tap_if((_ifp), (_pkt), (_pktlen)) +#define BPF_MTAP(_ifp, _m) \ bpf_mtap_if((_ifp), (_m)) -#define BPF_MTAP2(_ifp,_data,_dlen,_m) \ +#define BPF_MTAP2(_ifp, _data, _dlen, _m) \ bpf_mtap2_if((_ifp), (_data), (_dlen), (_m)) #endif /* _KERNEL */ From nobody Fri Sep 20 10:10:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X97Rz6yGKz5VcXy; Fri, 20 Sep 2024 10:10: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 4X97Rz4yzVz4TN8; Fri, 20 Sep 2024 10:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d8eg3o9fJ51jg3FLWWY2NJImSFtQ2rPi0Imc8mz/9rI=; b=jvZHX4+qez56GIwhFnLW590hrKwR4dJBA5yJO8cLYMgbx7jgZzUdfYHRgRLtHg/RXwu0z3 7bt3+TY5twwebnLdA7ftCJ2oReZp09/fcNym+bRn2oJek2jK6AVKhyueG7xPNvsKgKaI4a Rrn2XoYwSE98yCxjxfIaVjtCsI7tKLEnSlDMaRdcw2pbZi4vSN92nAa355byEZlm3mpM5t 0h4WbpQC6MSxKOtQlY7mJZV/6sKo9WQwMgUjDBSL3/fz1+U/NkMRt/x+O3eSYJVfGI+dMf tJ9fdzQdJeh2l2Q9ooWRr+BXuOzctG5RzNZdl3/WTlmcnVK36Yn7oyjKmF1/Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726827023; a=rsa-sha256; cv=none; b=o0JqTAJJ8BJpN374Iwovi4x6ujB3aH6FSwfsOvyOCo408Leg0cuiTTgOGeYd9P9mY11/fW UlaGha02y6E0Dn//ouabOmxZ6wRWpLDL0tbBFPw6rZEHSB/0KRyIqCpZcKc2/GHEOnxf5H uuSPBULtPvDQ1uRki0XXigCrEe+Cr8Q7ArlJuZZj892Gi6iyhT0FgYFWVKsMEIzoorRZ2T RveMVhmqfCeGD9lHhRkC1bZTNdkw4vyKSTMljM9F4Lw7JydhTyzzsBTnpwRkmVxLTNNYRR QN47oorYIpsrTduNz8IwuSVTfxw8c7p8KaIzxS+OgIV9NIyey/3TaNZGZlThIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d8eg3o9fJ51jg3FLWWY2NJImSFtQ2rPi0Imc8mz/9rI=; b=FsNDO7UnW5i1G7SZJsNMFBpv1274EwpKKc8dxGLauKtibgAISbSEYUz72My6R5iUvzhLqy F/ePmHZOuEGzbYmaf/tY8q/7aJHwQLCz9xN6w6/OPVc4+ZpMZLjirjDzWjekaLY2OUSU/S B8tqcWs2ekIEKIUcr+Ntt7ZbmuWY5zk3Gwsta0CbXWDsMBKsCGTOFeBaS6+r55O1DQC843 VMd+HbpGO++M5h/V18YnrOCsfwOQ+ZWTXVJ7ezYmpjN6vs7RLVp6rhbW+EyMppMLgZDrxe EAXMfmnFLNKZ7gh1lYGIysXVRHl9t81ngj8xzJ2gmA3XTBOsm06g6bQVez0bEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X97Rz3sGyzlp1; Fri, 20 Sep 2024 10:10: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 48KAANmT060346; Fri, 20 Sep 2024 10:10:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KAAND5060343; Fri, 20 Sep 2024 10:10:23 GMT (envelope-from git) Date: Fri, 20 Sep 2024 10:10:23 GMT Message-Id: <202409201010.48KAAND5060343@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: 99215a194483 - main - git-blame-ignore-revs: Ignore 1baf6164e4d6 in blame List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99215a19448343574ff615e382b2525cec597fe7 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=99215a19448343574ff615e382b2525cec597fe7 commit 99215a19448343574ff615e382b2525cec597fe7 Author: Zhenlei Huang AuthorDate: 2024-09-20 10:09:13 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 10:09:13 +0000 git-blame-ignore-revs: Ignore 1baf6164e4d6 in blame --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4764192494f0..9ab3027bffda 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,6 +8,8 @@ # # This file is sorted in git log order (newest commits first). +# style and whitespace fixes for bpf +1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c # whitespace fixes in sys/mman.h b5c95c93fdd47c0764219b8bf293ce54369caf27 # sort OptionalObsoleteFiles.inc blocks From nobody Fri Sep 20 11:05:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X98gk6snTz5Vnb3; Fri, 20 Sep 2024 11:05: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 4X98gk6Fzwz4g4Y; Fri, 20 Sep 2024 11:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726830338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1LjI01F/WM9Fgv7MYxOmg0U6gGeFY/GGXXKhk37TVxk=; b=E7SaoYLtlkVkihNjq7HCpKUYT52M+o7zj7I24rmMVadkCB4K8Vu20YH83tB5WVYTHTw4iU UcZ65nIAoC0FIxknla1ZQUbDe2xGjRs0y93nl+BOovCpQCorh8AmZLuU8DaJiY88lun/3p 8qv/Aj55n/KuA3AkNWu4VIZSFOPPrucAejiJEhrnXc4OYU3RDbogFBkbMHUlFGwFQBzv0F m9aeQNDyK8ZLAG4XvDQjmzQOFey1B1ozJmsCrE+EeMUivsfCIHSaZi4qDhcF6nVwSX9nvy VV/Kqek4rRSX/eSOhqustvwfrrTX9e2ISIXRzYY0zSd6cuaUnFzgXcFmNrVUeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726830338; a=rsa-sha256; cv=none; b=EkRwIN3tqFEt6VA3qfhDGx5VZBvSWakDTHpkD1PcLQDOfVUiUXdU9ZSfbIGnRc9xEvg/0s KCpvO0x6AtvLdakY6E/wWsn+adgM77DjiNKnXCIFsPmjrFvhG8BbrmejO1rJfHlXhNKnE4 yIqSDLjlQS5scM6s1hgYGwn2qWVw6w/InYXRxTF5x0UejAeWfIL5ScLSlKfOXj5s0OcZ3K VzlT93wnBTuQjKv7IaSaGtgSWdOnb3YMkFki65rDlSd3OTKGrYI0yNquNta8p8XsWss4qc ibtyLRPlyNNidgU9GF9QWuyP8o5UY7lc8PVaDusfnDeYOaGorgEhvYdcegXxVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726830338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1LjI01F/WM9Fgv7MYxOmg0U6gGeFY/GGXXKhk37TVxk=; b=WPLXyecIAXwMKZmoV9mU1130emBCnScV8aUG4rJ0tAFu1dczFeeS1NAz+ua93aWEenusRe Br5Jqlu3bQuB5lY7uSR8zU+u1T5sx0pTuwc1EY7MvOIxTxS3Sbq0YhLgRB6CtiH2O0HVG4 l3WO83U0d6G18uFsMH18yfWP82rO1xE/mEbVnncAWHZLL+H16ZpbqSMV1KUvTDtxUHURo8 HxSTyo1gLfjjE/BSop9pBHjd341Ts4rM+/oml3M0e6ob8kshbA46KTEg2ZpIgdUXVk1uOW TZZuE4HNj0ogol9aCH55NQWF1xFsoW7tZTm/dZbvXTS9KL72PL+zCTCjjYWXiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X98gk5s3nznHf; Fri, 20 Sep 2024 11:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KB5c3u053282; Fri, 20 Sep 2024 11:05:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KB5cS2053279; Fri, 20 Sep 2024 11:05:38 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:05:38 GMT Message-Id: <202409201105.48KB5cS2053279@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: 87fbd9fc7fc5 - main - tcp: remove unused socket option names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 87fbd9fc7fc5f8d79fe5e3dcd13ad02b11a67ef0 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=87fbd9fc7fc5f8d79fe5e3dcd13ad02b11a67ef0 commit 87fbd9fc7fc5f8d79fe5e3dcd13ad02b11a67ef0 Author: Michael Tuexen AuthorDate: 2024-09-20 11:03:53 +0000 Commit: Michael Tuexen CommitDate: 2024-09-20 11:03:53 +0000 tcp: remove unused socket option names These IPPROTO_TCP-level socket option names correspond to socket options, which are not implemented. So remove them. Thanks to Peter Lei for suggesting this change. Reviewed by: rscheff, thj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46623 --- sys/netinet/tcp.h | 47 ++++++++++++++++++++------------------------ sys/netinet/tcp_stacks/bbr.c | 2 -- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 6d92f078029b..f789898e5785 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -211,7 +211,7 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags) #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ #define TCP_MAXUNACKTIME 68 /* maximum time without making progress (sec) */ -#define TCP_MAXPEAKRATE 69 /* maximum peak rate allowed (kbps) */ + /* unused; was TCP_MAXPEAKRATE */ #define TCP_IDLE_REDUCE 70 /* Reduce cwnd on idle input */ #define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP tunneling via the specified port */ #define TCP_DELACK 72 /* socket option for delayed ack */ @@ -233,57 +233,53 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags) /* Options for Rack and BBR */ #define TCP_REUSPORT_LB_NUMA 1026 /* set listen socket numa domain */ #define TCP_RACK_MBUF_QUEUE 1050 /* Do we allow mbuf queuing if supported */ -#define TCP_RACK_PROP 1051 /* Not used */ + /* unused; was TCP_RACK_PROP */ #define TCP_RACK_TLP_REDUCE 1052 /* RACK TLP cwnd reduction (bool) */ -#define TCP_RACK_PACE_REDUCE 1053 /* RACK Pacingv reduction factor (divisor) */ + /* unused; was TCP_RACK_PACE_REDUCE */ #define TCP_RACK_PACE_MAX_SEG 1054 /* Max TSO size we will send */ #define TCP_RACK_PACE_ALWAYS 1055 /* Use the always pace method */ -#define TCP_RACK_PROP_RATE 1056 /* Not used */ + /* unused; was TCP_RACK_PROP_RATE */ #define TCP_RACK_PRR_SENDALOT 1057 /* Allow PRR to send more than one seg */ #define TCP_RACK_MIN_TO 1058 /* Minimum time between rack t-o's in ms */ -#define TCP_RACK_EARLY_RECOV 1059 /* Not used */ + /* unused; was TCP_RACK_EARLY_RECOV */ #define TCP_RACK_EARLY_SEG 1060 /* If early recovery max segments */ #define TCP_RACK_REORD_THRESH 1061 /* RACK reorder threshold (shift amount) */ #define TCP_RACK_REORD_FADE 1062 /* Does reordering fade after ms time */ #define TCP_RACK_TLP_THRESH 1063 /* RACK TLP theshold i.e. srtt+(srtt/N) */ #define TCP_RACK_PKT_DELAY 1064 /* RACK added ms i.e. rack-rtt + reord + N */ -#define TCP_RACK_TLP_INC_VAR 1065 /* Does TLP include rtt variance in t-o */ + /* unused; was TCP_RACK_TLP_INC_VAR */ + /* unused */ #define TCP_BBR_IWINTSO 1067 /* Initial TSO window for BBRs first sends */ -#define TCP_BBR_RECFORCE 1068 /* Enter recovery force out a segment disregard pacer no longer valid */ + /* unused; was TCP_BBR_RECFORCE */ #define TCP_BBR_STARTUP_PG 1069 /* Startup pacing gain */ #define TCP_BBR_DRAIN_PG 1070 /* Drain pacing gain */ -#define TCP_BBR_RWND_IS_APP 1071 /* Rwnd limited is considered app limited */ + /* unused; was TCP_BBR_RWND_IS_APP */ #define TCP_BBR_PROBE_RTT_INT 1072 /* How long in useconds between probe-rtt */ -#define TCP_BBR_ONE_RETRAN 1073 /* Is only one segment allowed out during retran */ + /* unused; was TCP_BBR_ONE_RETRAN */ #define TCP_BBR_STARTUP_LOSS_EXIT 1074 /* Do we exit a loss during startup if not 20% incr */ -#define TCP_BBR_USE_LOWGAIN 1075 /* lower the gain in PROBE_BW enable */ -#define TCP_BBR_LOWGAIN_THRESH 1076 /* Unused after 2.3 morphs to TSLIMITS >= 2.3 */ + /* unused; was TCP_BBR_USE_LOWGAIN */ #define TCP_BBR_TSLIMITS 1076 /* Do we use experimental Timestamp limiting for our algo */ -#define TCP_BBR_LOWGAIN_HALF 1077 /* Unused after 2.3 */ #define TCP_BBR_PACE_OH 1077 /* Reused in 4.2 for pacing overhead setting */ -#define TCP_BBR_LOWGAIN_FD 1078 /* Unused after 2.3 */ -#define TCP_BBR_HOLD_TARGET 1078 /* For 4.3 on */ + /* unused; was TCP_BBR_HOLD_TARGET */ #define TCP_BBR_USEDEL_RATE 1079 /* Enable use of delivery rate for loss recovery */ #define TCP_BBR_MIN_RTO 1080 /* Min RTO in milliseconds */ #define TCP_BBR_MAX_RTO 1081 /* Max RTO in milliseconds */ -#define TCP_BBR_REC_OVER_HPTS 1082 /* Recovery override htps settings 0/1/3 */ -#define TCP_BBR_UNLIMITED 1083 /* Not used before 2.3 and morphs to algorithm >= 2.3 */ + /* unused; was TCP_BBR_REC_OVER_HPTS */ #define TCP_BBR_ALGORITHM 1083 /* What measurement algo does BBR use netflix=0, google=1 */ -#define TCP_BBR_DRAIN_INC_EXTRA 1084 /* Does the 3/4 drain target include the extra gain */ -#define TCP_BBR_STARTUP_EXIT_EPOCH 1085 /* what epoch gets us out of startup */ + /* unused; was TCP_BBR_DRAIN_INC_EXTRA */ + /* unused; was TCP_BBR_STARTUP_EXIT_EPOCH */ #define TCP_BBR_PACE_PER_SEC 1086 #define TCP_BBR_PACE_DEL_TAR 1087 #define TCP_BBR_PACE_SEG_MAX 1088 #define TCP_BBR_PACE_SEG_MIN 1089 #define TCP_BBR_PACE_CROSS 1090 -#define TCP_RACK_IDLE_REDUCE_HIGH 1092 /* Reduce the highest cwnd seen to IW on idle */ -#define TCP_RACK_MIN_PACE 1093 /* Do we enforce rack min pace time */ -#define TCP_RACK_MIN_PACE_SEG 1094 /* If so what is the seg threshould */ -#define TCP_RACK_GP_INCREASE 1094 /* After 4.1 its the GP increase in older rack */ + /* unused */ + /* unused; was TCP_RACK_IDLE_REDUCE_HIGH */ + /* unused; was TCP_RACK_MIN_PACE */ + /* unused; was TCP_RACK_GP_INCREASE */ #define TCP_RACK_TLP_USE 1095 -#define TCP_BBR_ACK_COMP_ALG 1096 /* Not used */ #define TCP_BBR_TMR_PACE_OH 1096 /* Recycled in 4.2 */ -#define TCP_BBR_EXTRA_GAIN 1097 + /* unused; was TCP_BBR_EXTRA_GAIN */ #define TCP_RACK_DO_DETECTION 1097 /* Recycle of extra gain for rack, attack detection */ #define TCP_BBR_RACK_RTT_USE 1098 /* what RTT should we use 0, 1, or 2? */ #define TCP_BBR_RETRAN_WTSO 1099 @@ -302,7 +298,6 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags) #define TCP_BBR_POLICER_DETECT 1111 /* Turn on/off google mode policer detection */ #define TCP_BBR_RACK_INIT_RATE 1112 /* Set an initial pacing rate for when we have no b/w in kbits per sec */ #define TCP_RACK_RR_CONF 1113 /* Rack rapid recovery configuration control*/ -#define TCP_RACK_CHEAT_NOT_CONF_RATE TCP_RACK_RR_CONF #define TCP_RACK_GP_INCREASE_CA 1114 /* GP increase for Congestion Avoidance */ #define TCP_RACK_GP_INCREASE_SS 1115 /* GP increase for Slow Start */ #define TCP_RACK_GP_INCREASE_REC 1116 /* GP increase for Recovery */ @@ -325,7 +320,7 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags) #define TCP_REC_ABC_VAL 1134 /* Do we use the ABC value for recovery or the override one from sysctl */ #define TCP_RACK_MEASURE_CNT 1135 /* How many measurements are required in GP pacing */ #define TCP_DEFER_OPTIONS 1136 /* Defer options until the proper number of measurements occur, does not defer TCP_RACK_MEASURE_CNT */ -#define TCP_FAST_RSM_HACK 1137 /* Not used in modern stacks */ + /* unused; was TCP_FAST_RSM_HACK */ #define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ #define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ #define TCP_RACK_TIMER_SLOP 1140 /* Set or get the timer slop used */ diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 3f8c749583b4..866ae29eef45 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -14215,10 +14215,8 @@ bbr_set_sockopt(struct tcpcb *tp, struct sockopt *sopt) case TCP_BBR_ALGORITHM: case TCP_BBR_TSLIMITS: case TCP_BBR_IWINTSO: - case TCP_BBR_RECFORCE: case TCP_BBR_STARTUP_PG: case TCP_BBR_DRAIN_PG: - case TCP_BBR_RWND_IS_APP: case TCP_BBR_PROBE_RTT_INT: case TCP_BBR_PROBE_RTT_GAIN: case TCP_BBR_PROBE_RTT_LEN: From nobody Fri Sep 20 11:39:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RG3pXYz5Wf69; Fri, 20 Sep 2024 11:39: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 4X99RG2zX8z4lZX; Fri, 20 Sep 2024 11:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NVjCYLxyi/q2UGyfYDGaVjMOLpGIABpy8CnLJRsAOu4=; b=lCAYs4LXhwy2+9v+nR/TMfcwrm8wKKTGdjUjD+59RvEZI4xMETcPCWv8JUriLZknDWa5l4 cmIMk04qoT6F1srVO7kgL3BXUb4R4z418/9fFiRQh6RF9dRrxP8m/tsmVWJBA3loZWtg4i 7mTFLFP3j7FLSqwfmAnPoJYJJqkl5dgx6IV9i0Yi0u5dt9IEm/XxPx8At84wDHST9F7Zhb iiBPBe5qZdYavKO7H/hGvGMhI4y7SsyprIJWXL9LD9cj/Eka98FGxjCjNMH5Ac8yZF479D TBzngf5bTnTn571gL+ximsKVY4GIbCpnVkZvVTcXa6fhueyl90RpilG0Aj+nPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832394; a=rsa-sha256; cv=none; b=SMu8lbgqMKUyz5h7s/r4BQaxFcSdHVfGJqt+tWL1m9IKsQ44boq+g1TXUGYuLWosm6jiTP ZOaSiLsTOrXOsf6Y4Irkb2p81iY1jFzL1mqt0GvXbVioluVHMT/xWnaV0cplUo5kJ5/SFT dcm6PYhouxqkOEEUd8rUUx7Bp6DM4eYYOxTUR+Uwhr1Wg+3wYhSTCvrhhfdFMG2sdFvTfs SUKlkFr8h+MYlToC0D+ozh3rL6ptZ/1E0sWy2DfqqujcNLEgzCxtZpHdxspx5WJBDFC7vY /JFGkUxAIzdq/7vF0xgGnoablk6fLsm5pqRtM9MO7P28yWaHHRz+P083FSFYPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NVjCYLxyi/q2UGyfYDGaVjMOLpGIABpy8CnLJRsAOu4=; b=u4dW3Obq8ekaOyd7gMMuBkzJKkazINcDDiDnn0LguK67Nd8u7WseQe00cVcOqarZ5BgB3x wiGYveOazQwrHthGmjl5dRJP91pDkGHACEBqHbi+amLRuftG+vD/UV6C4CzvMQBcmGMPqb KdEgGKan5Ozw2cXybUym6ypCuSLUb+We9h/QH3bDsLNWpueJ9oKJ8y1hzVqc7VnHI8IcXM Wd12nKIagPWQuranElm4l9+PZYPjjlVihJWb1Drvtwd+hOVcI95mysQXwr0YC19fJNGgbZ A7mhRFNzcLZphwvnxIjN2VWqUPheHJW8KAkn8A6nhmanNeRYnm9431Lc+iYRRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RG2Zwtznpq; Fri, 20 Sep 2024 11:39: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 48KBdsB1004251; Fri, 20 Sep 2024 11:39:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBds63004248; Fri, 20 Sep 2024 11:39:54 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:54 GMT Message-Id: <202409201139.48KBds63004248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9512710ddf33 - stable/14 - asmc: Add support for MacbookPro11,4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9512710ddf33c49dd0f9c387393866306225efc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9512710ddf33c49dd0f9c387393866306225efc3 commit 9512710ddf33c49dd0f9c387393866306225efc3 Author: Joshua Rogers AuthorDate: 2024-06-11 19:51:51 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 asmc: Add support for MacbookPro11,4 Signed-off-by: Joshua Rogers MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1366 (cherry picked from commit 49a5fe1a017fc179c79b74f409440e070511a0ab) --- sys/dev/asmc/asmc.c | 6 ++++++ sys/dev/asmc/asmcvar.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index cd13fba72e98..3c63e959fc9f 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -279,6 +279,12 @@ static const struct asmc_model asmc_models[] = { ASMC_MBP113_TEMPS, ASMC_MBP113_TEMPNAMES, ASMC_MBP113_TEMPDESCS }, + { + "MacBookPro11,4", "Apple SMC MacBook Pro Retina Core i7 (mid 2015, 15-inch)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP114_TEMPS, ASMC_MBP114_TEMPNAMES, ASMC_MBP114_TEMPDESCS + }, + /* The Mac Mini has no SMS */ { "Macmini1,1", "Apple SMC Mac Mini", diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 42e3120ff4ff..73a8fc449c2c 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -432,6 +432,40 @@ struct asmc_softc { "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ "Ts1S" } + +#define ASMC_MBP114_TEMPS { "IC0C", "ID0R", "IHDC", "IPBR", "IC0R", \ + "IO3R", "IO5R", "IM0C", "IC1C", "IC2C", \ + "IC3C", "ILDC", "IBLC", "IAPC", "IHSC", \ + "ICMC", "TC0P", "TP0P", "TM0P", \ + "Ta0P", "Th2H", "Th1H", "TW0P", "Ts0P", \ + "Ts1P", "TB0T", "TB1T", "TB2T", "TH0A", "TH0B", \ + "TC1C", "TC2C", "TC3C", "TC4C", "TCXC", \ + "TCGC", "TPCD", "TCSA", "VC0C", "VD0R", \ + "VP0R", "ALSL", "F0Ac", "F1Ac", "PCPC", \ + "PCPG", "PCPT", "PSTR", "PDTR", NULL } + +#define ASMC_MBP114_TEMPNAMES { "IC0C", "ID0R", "IHDC", "IPBR", "IC0R", \ + "IO3R", "IO5R", "IM0C", "IC1C", "IC2C", \ + "IC3C", "ILDC", "IBLC", "IAPC", "IHSC", \ + "ICMC", "TC0P", "TP0P", "TM0P", \ + "Ta0P", "Th2H", "Th1H", "TW0P", "Ts0P", \ + "Ts1P", "TB0T", "TB1T", "TB2T", "TH0A", "TH0B", \ + "TC1C", "TC2C", "TC3C", "TC4C", "TCXC", \ + "TCGC", "TPCD", "TCSA", "VC0C", "VD0R", \ + "VP0R", "ALSL", "F0Ac", "F1Ac", "PCPC", \ + "PCPG", "PCPT", "PSTR", "PDTR" } + +#define ASMC_MBP114_TEMPDESCS { "CPU High (CPU, I/O)", "DC In", "SSD", "Charger (BMON)", "CPU", \ + "Other 3.3V", "Other 5V", "Memory", "Platform Controller Hub Core", "CPU Load Current Monitor", \ + "CPU DDR", "LCD Panel", "LCD Backlight", "Airport", "Thunderbolt", \ + "S2", "CPU Proximity", "Platform Controller Hub", "Memory Proximity", "Air Flow Proximity", \ + "Left Fin Stack", "Right Fin Stack", "Airport Proximity", "Palm Rest", "Palm Rest Actuator", \ + "Battery Max", "Battery Sensor 1", "Battery Sensor 2", "SSD A", "SSD B", \ + "CPU Core 1", "CPU Core 2", "CPU Core 3", "CPU Core 4", "CPU PECI Die", \ + "Intel GPU", "Platform Controller Hub PECI", "CPU System Agent Core", "CPU VCore", "DC In", \ + "Pbus", "Ambient Light", "Leftside", "Rightside", "CPU Package Core", \ + "CPU Package GPU", "CPU Package Total", "System Total", "DC In" } + #define ASMC_MM_TEMPS { "TN0P", "TN1P", NULL } #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ From nobody Fri Sep 20 11:39:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RH5YDrz5Wdsb; Fri, 20 Sep 2024 11:39: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 4X99RH3yxTz4lK7; Fri, 20 Sep 2024 11:39:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkNnv4SWZ38fkY1P8UDnxA4IWYfNYgmHvBH6k/GadbM=; b=ByJlDNWK/Wbaj5YOaSzUw6ujae2/eDGFIf1W0NIuWUpsTKDppzKRpVzknTdCooe4Bmiv+7 fEKhfiQUxYwEcYDerWEEG6YK0sNpITT9TM5JarbjetDiRNwDJpi0PILsrJl+/zu5eeh/a5 fUmV2rPjbZjLv8o9+2AAZRRl3C625tTOM/H+tHPUkGv3c5GM+Es7Utspj2mo3nyLkI253R 0zGEFTAJWFmMN3h4pW/d8+Mtp9v3/TbZTZQNgWFRFpeuncaFHDhWIkwRTRa3Ap6AgNMofl igau2Xm5wlRADK05RISt+zu64Orywzsr/Vd/V9aZ0G0DibDNC2qhzy0DqWZaYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832395; a=rsa-sha256; cv=none; b=FmPpQWC8tL7ZtFAyAoqG63TuKqGWJyGvNdrYb5xM7h5MA2vTjd/RWYuOjtpP3x77aW2F2q HTW/XFNEK1y/eP6OPAv+XEuA0/FA/TSTiQJMxpQT3ImbeeR50PxJxcxym+jzg5L8esQJa8 ucYJ3QP6/0EnOEwfB7GlSsqhxeCCezyqQIeQ23cGPjtUd4Gj0II2REAc2wsHAASbRf56HC sUYD9ZM2E+eKtj5ms9PweI7n8cQJrWam+4vykeLvFsqz8+anZ39ev2VpSDTOqho017ILdg QIw+LJGwNZcxskmsSyYd/BM6F7RUxivssG9POWfsFSQNK5sN7OxrfbDvawwCLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkNnv4SWZ38fkY1P8UDnxA4IWYfNYgmHvBH6k/GadbM=; b=pbTzhMxkq1eSHQ3cxWrSubg5liU0InUYkFOxAHHWVwt08JKLH1wRW77vQaVpGGGiyJhcvO 0qJfTjGvrFV0gNJigEPMf0WnYu2UUp7m8pjVTecLN+U/6wFOkvbFD84Ev4SksKfNwY2ack s7fr6RJnesH/dz909BXC8AMGQAqohesmR38mQSNHgotkk+WhuAkyQ0YfnHToqjhcsEKvSi iCB2eLnP52KbL+G2DVUVtqAj21WdvzmpN+Z7WTbFVNvpyx+B7V5pH1l+uM4nU339zEswCc 53Slw9OaXkJyYah5jqgaa5hY8d0EBxjmsJD/BZM3PLNzAJ9tB8iPNdaxqL0gsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RH3ZP0znXx; Fri, 20 Sep 2024 11:39: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 48KBdtJH004299; Fri, 20 Sep 2024 11:39:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBdthI004296; Fri, 20 Sep 2024 11:39:55 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:55 GMT Message-Id: <202409201139.48KBdthI004296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 246f922d635e - stable/14 - ggate tests: Use unique ports among tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 246f922d635e114c336c1e15ce041a1d8496ea60 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=246f922d635e114c336c1e15ce041a1d8496ea60 commit 246f922d635e114c336c1e15ce041a1d8496ea60 Author: Mark Johnston AuthorDate: 2024-06-15 00:10:42 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 ggate tests: Use unique ports among tests This helps avoid failures when running tests in parallel. MFC after: 1 week (cherry picked from commit b5d3f8252fe8b74249ed49e87981d190c3ec3d05) --- tests/sys/geom/class/gate/ggate_test.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/sys/geom/class/gate/ggate_test.sh b/tests/sys/geom/class/gate/ggate_test.sh index 3ca5c3a2531a..4cbc5d80ae89 100644 --- a/tests/sys/geom/class/gate/ggate_test.sh +++ b/tests/sys/geom/class/gate/ggate_test.sh @@ -1,7 +1,5 @@ - PIDFILE=ggated.pid PLAINFILES=plainfiles -PORT=33080 CONF=gg.exports atf_test_case ggatec_trim cleanup @@ -17,13 +15,14 @@ ggatec_trim_body() { load_ggate + port=33080 us=$(alloc_ggate_dev) work=$(alloc_md) atf_check -e ignore -o ignore dd if=/dev/random of=/dev/$work bs=1m count=1 conv=notrunc echo $CONF >> $PLAINFILES echo "localhost RW /dev/$work" > $CONF - atf_check ggated -p $PORT -F $PIDFILE $CONF - atf_check ggatec create -p $PORT -u $us localhost /dev/$work + atf_check ggated -p $port -F $PIDFILE $CONF + atf_check ggatec create -p $port -u $us localhost /dev/$work ggate_dev=/dev/ggate${us} wait_for_ggate_device ${ggate_dev} @@ -55,6 +54,7 @@ ggated_body() load_ggate + port=33081 us=$(alloc_ggate_dev) work=$(alloc_md) src=$(alloc_md) @@ -67,8 +67,8 @@ ggated_body() echo $CONF >> $PLAINFILES echo "127.0.0.1 RW /dev/$work" > $CONF - atf_check ggated -p $PORT -F $PIDFILE $CONF - atf_check ggatec create -p $PORT -u $us 127.0.0.1 /dev/$work + atf_check ggated -p $port -F $PIDFILE $CONF + atf_check ggatec create -p $port -u $us 127.0.0.1 /dev/$work ggate_dev=/dev/ggate${us} From nobody Fri Sep 20 11:39:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RK1DFlz5WdwT; Fri, 20 Sep 2024 11:39: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 4X99RJ5FVNz4lPR; Fri, 20 Sep 2024 11:39:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVCbZNMiCco4DbNvvZaXBDQXj4mg0j5beNYzWAW0qiE=; b=CrBx4EEUfqA33sr6eu0gTyagE/QEZiV6aLmejDzV5sJBzChAbbhIBkgp1PFdLxqkR0g66m OY+1bL8hfu2+/Un5dAZaxBEu1GDtQHCKbY+EPyGyU84pi81RKm0/sHOslfuASsKIhzFY2h sxHwVonlcuS0yJd5YqcdrHgXs1srkSRN/YqJKGNU4Uq0nVwS1sxvUeW65giPhG31T7sfbK FLgjAI3u/f8Lm1JJv+STLWkbA49/BMj7AHCrf4prDZNrWijb02eB2j/o7ehOyS53N5YXem xFzny/RfhnwckCTN12+wUgNBWeCJpdz4v+AyecPMpJ/i3WX4yG2BC8GOe4lWVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832396; a=rsa-sha256; cv=none; b=J30u6ikJw9kuPQxwrvUic5kgOF7K51EE8Sf0LBtrj28KDXxT5JWNrGkNQmkCzQ5pes/TwZ wIHh36vYilOwvj+9O0uYAyQ/DepzeM01+NwToJtMu//p3tGljTmfkAYKmI+vgYNui/g6nR RrlMgY3aut5FgUpHb5bzW3asioE/Ti05CQm7XRRJ3xNo4EKhT0q+tjT0vPX0s3ncgOJBEm 1bSZUXMlDDKhwT+jgOD7LEmbUhpGNXYt/nVHQl2VGuoCgUqQBang94C6jWRvWdvC/SpMBN /oYK9WnWDKq08DsRXNP0hp/GjznwrYIYdZAtAvErG/KCA9MrApCvavOzkzK1dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVCbZNMiCco4DbNvvZaXBDQXj4mg0j5beNYzWAW0qiE=; b=eFQV8PAmNld0sokYENIu91CbZjwIHxkMx52YgfVmQ5IuzmAJ00bBxwt6guL5t757WibiCV Wn80kI5D3hiqP4MB6Mfa3AZy8wlpwyKjIFuPqyFQmaKssODgV+y3DwUhuU8W7r7kI1JP+X LhJFdzzPJjsTyCuWLcUCLxZESSX0fDcAkFhxCSsGSAhM46vyD6+t+y/991HP/DKJWSObyg AhzSdXBoS+mEvI7yIZkNgyZ0Fs7BIVx6TPqIpGtdEYRV7n000VuCK1S362atxtp5VcKm5v 5x10ErOjAUWjzegtIGjskqT0/56qUQn7jKg12ug/vEp5eUBsCX/qaaday8hn2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RJ4rBrznmR; Fri, 20 Sep 2024 11:39: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 48KBdufP004351; Fri, 20 Sep 2024 11:39:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBdusf004348; Fri, 20 Sep 2024 11:39:56 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:56 GMT Message-Id: <202409201139.48KBdusf004348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6f636541a3b1 - stable/14 - capsicum tests: Serialize functional tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f636541a3b1fe14a6f85f457c12cf8a7159a121 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6f636541a3b1fe14a6f85f457c12cf8a7159a121 commit 6f636541a3b1fe14a6f85f457c12cf8a7159a121 Author: Mark Johnston AuthorDate: 2024-09-03 14:39:02 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 capsicum tests: Serialize functional tests The test suite runs the same tests twice, as different users, and these can trample over each other when run in parallel, causing spurious test failures. MFC after: 1 week (cherry picked from commit 41ece3c036bda3d4da321989ee59d0555c10d603) --- tests/sys/capsicum/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/capsicum/Makefile b/tests/sys/capsicum/Makefile index 542c6720521c..2dc499a14b42 100644 --- a/tests/sys/capsicum/Makefile +++ b/tests/sys/capsicum/Makefile @@ -14,6 +14,10 @@ CFLAGS+= -I${SRCTOP}/tests GTESTS+= capsicum-test GTESTS_WRAPPER_SH.capsicum-test= functional +# This test script runs the same test suite twice, once as root and once as an +# unprivileged user. Serialize them since some tests access global namespaces, +# e.g., mqueuefs, and can trample on each other. +TEST_METADATA.functional+= is_exclusive="true" SRCS.capsicum-test+= \ capsicum-test-main.cc \ From nobody Fri Sep 20 11:39:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RM1l81z5Wf3t; Fri, 20 Sep 2024 11:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X99RL6r9Sz4lVn; Fri, 20 Sep 2024 11:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9wnMn8n7PxKWHGY8vejlKAlw/Z9GFZJ6j/obOfsKWzc=; b=qBsuIXnxM2Jj1n8WJaU4xURkUW7lcwJbFk89oEHeJE/vcVXu3r/g1W9hnXI6T56FmE9ouc 8QAK55C8T2Q01FqGD3sqlLvql2aXk0CJVpLKsmlnKfRYmFJinOjrpo/r9CgU+ICeqTF//Z PQ7IofbzWkTjyUwqR1gWLnnUfK2g3NFnC2s8yco5A9DMnbg00JgcRCl/6RvzbF1xyTkIhu pjVR3zXHJGZ7ggec/w6mhe9yo63zaNE/bKdH7J4uCjXNcvhuyC8abehmnZ9eeBHBInyR16 fuesIrh2WnPvYRDpq3bfN0qy+WQj8NoSmql6XEkUTsgh08VyjFtE8dGn2QqOFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832399; a=rsa-sha256; cv=none; b=TAYX3wo4QnLnl2fNO16PTt/NS+bfh8YcBu7vJlty1ilL2WOLxWtUveIdlapewWVaqZS4vj z6q5k9/kezL8gybvAgwsI/ciD38wKkluHx+KUkv0Pvz4j1UGQnmIGMBcL9YHu5PqzZZxAM EkiSdAoDtfRc3/M+ekNPJixU+ALmgK0E5ba+k4MvUmv3QMksSJ1bspOU3m+td372J4Qg3z hHta9FMTU+i3dkxnDqpFVy9/ClzQJxa/3vYkHGQAUUyxiwCfB+Vymd33hDpefhRocEuPyb IYZIorcIr1fvm0IiTLvzFTdHahcvsPFrLFp1mC6mL5rAH7p7tHHgERjYReSDyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9wnMn8n7PxKWHGY8vejlKAlw/Z9GFZJ6j/obOfsKWzc=; b=PQnDKpZgKCSEMzJ+j9wRPK0F8JZ379Uh7XJYpAfm1VBYNywMoHXdLO4tbcFdr8if5kyxvt n2npEsfRN1oI7L9tWhrVvnJ1mycbrGQ7Y6NI4MPepWUkL1V+jku901hDel/8ub/GtBNmw4 wV7JbHCmfahS0QXSEH987D5mRLTUffYC6y4ytgMXmDW2FF12bRKG+IWbDhRU4AmbMsHmvM GslGBAwTXf6PT1m7B03rfkHRmd6aJ2/UhZi5zMkL38f4xm1eMR2kGC1ArwMfyj2F1EGzJW ofe7pj2aY+b2opD0jNS0aa1BFVbheBtmHRcrd+UeYRGz3nUh3l+Gvr+fBIK6Ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RL6Rq0zp2K; Fri, 20 Sep 2024 11:39: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 48KBdwgW004448; Fri, 20 Sep 2024 11:39:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBdwIF004445; Fri, 20 Sep 2024 11:39:58 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:58 GMT Message-Id: <202409201139.48KBdwIF004445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b513c311d0db - stable/14 - ifnet: Remove if_getamcount() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b513c311d0db5c301c939b1cf44b2826e09011d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b513c311d0db5c301c939b1cf44b2826e09011d3 commit b513c311d0db5c301c939b1cf44b2826e09011d3 Author: Mark Johnston AuthorDate: 2024-09-04 13:07:11 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 ifnet: Remove if_getamcount() All uses of this function were incorrect. if_amcount is a reference count which tracks the number of times the network stack internally set IFF_ALLMULTI. (if_pcount is the corresponding counter for IFF_PROMISC.) Remove if_getamcount() and fix up callers to get the number of assigned multicast addresses instead, since that's what they actually want. Sponsored by: Klara, Inc. Reviewed by: zlei, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46523 (cherry picked from commit 408c909dc64f77d2696d6fec77a2e0b00255cf96) --- sys/dev/bxe/bxe.c | 2 +- sys/dev/liquidio/lio_ioctl.c | 2 +- sys/net/if.c | 6 ------ sys/net/if_var.h | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 05bc22c0c981..45e8f654c36a 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -12174,7 +12174,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) if (if_getflags(ifp) & IFF_PROMISC) { rx_mode = BXE_RX_MODE_PROMISC; } else if ((if_getflags(ifp) & IFF_ALLMULTI) || - ((if_getamcount(ifp) > BXE_MAX_MULTICAST) && + (if_llmaddr_count(ifp) > BXE_MAX_MULTICAST && CHIP_IS_E1(sc))) { rx_mode = BXE_RX_MODE_ALLMULTI; } else { diff --git a/sys/dev/liquidio/lio_ioctl.c b/sys/dev/liquidio/lio_ioctl.c index 10c88b209051..b2fd54f59580 100644 --- a/sys/dev/liquidio/lio_ioctl.c +++ b/sys/dev/liquidio/lio_ioctl.c @@ -481,7 +481,7 @@ lio_get_new_flags(if_t ifp) * Accept all multicast addresses if there are more than we * can handle */ - if (if_getamcount(ifp) > LIO_MAX_MULTICAST_ADDR) + if (if_llmaddr_count(ifp) > LIO_MAX_MULTICAST_ADDR) f |= LIO_IFFLAG_ALLMULTI; } if (if_getflags(ifp) & IFF_BROADCAST) diff --git a/sys/net/if.c b/sys/net/if.c index 110ab73f2aad..9beac09d54c9 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4783,12 +4783,6 @@ if_getifaddr(const if_t ifp) return (ifp->if_addr); } -int -if_getamcount(const if_t ifp) -{ - return (ifp->if_amcount); -} - int if_setsendqready(if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 48a503df7ffe..74692e916558 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -660,7 +660,6 @@ u_int if_lladdr_count(if_t); u_int if_llmaddr_count(if_t); bool if_maddr_empty(if_t); -int if_getamcount(const if_t ifp); struct ifaddr * if_getifaddr(const if_t ifp); typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int); u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg); From nobody Fri Sep 20 11:39:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RK70bFz5WdnD; Fri, 20 Sep 2024 11:39: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 4X99RK5rQdz4lPl; Fri, 20 Sep 2024 11:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KjPAB+LK/oNSQPHPB3HI2mfB+Ey4rqH6rWy1HTO2VBs=; b=vL8eIdOOtUtfylk2Q12ZQ97CIDL8mOJuYMz53zxDpql1KbFZzT0TEeRzs4oUJMBLvqyXtz TDTy35P5IBUnwl9u44s9+5cK+uYaSHHkm/CQYEKtTTmIvCjZVzpqUnd+OmpvvD9LvpNJEY bYpl5APIxlxpoZG6MowNTT2hbUHXU+Abj5+DhTargLwBvunZk6dvaLbhrMfl2KzUNczI0D UMVYjmuoATSqLLsd1s457r2jhNN5bxGNYRmt68eZPNLjQeCoRFXykLzP4BoKAMrc2HG8RH 48gWDCo5J1dDAJ9ynmmx5fthNISMjevYskZODnK+F+GTy72jt8guz5hKgKfHGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832397; a=rsa-sha256; cv=none; b=Xq22H7K2dYt1FPIh+Snrxh67Z+MAqhWLMLOHvhFvlmNjOe6qgdiyDzmNjunsqyGgIBPhF/ nxq+BksYJX2+a3tESnAxZn0yCmgrB8cPemVNv+Rgcz//e6FYRsfCk+xAP6t5z6mY4+2zOz 2BDPlVaGhrFem3Kj2dfs4iWPQWbZQAiaRKIcWY84zCNWPN88EydTaCye6IJti8UhSqDSOR VD4ecgGL5CCIx+0bVCZAg4NJ6EEqdkM4w250ZdSudcVqFoMlCP4k3K5Fv0nGr7AtOWcB7u VupPiXjg0bki9iqAh5yV87PqF5Sk/eXCAfrd8RL8UdILPTXQ3K6rF8EvLDiPlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KjPAB+LK/oNSQPHPB3HI2mfB+Ey4rqH6rWy1HTO2VBs=; b=KUwyBTaqPMxEB39UBdFaF0fYt0NaKNhInzp4aBhGwsCjdtaQT5hAqePNonE7vjlecsyQds AtKYdzXplDXKWaGOhV+daLzPldf9AStpCXeAaaWyd3Ea2T0X63lfE8pcyQqs4F1xcR4MkZ q9SqZiU9XKYSaOErOm7AcrmWrB3WD43v0pBH83ov7j/TdsHy5F1FgWIiVKdB87RM4my0h/ cT1kbYFsTJWrgo7YmOFyu1pu97w1A82hjzyKfaGYTmQBFxGo5XVOsqv8xDdExF/hBD65h5 RPiducgqaQRY1wAsZx6Vk/6e/rFoB4lGvg77hOjDepJLjymGWrikPiTdwp91kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RK5QB4znj6; Fri, 20 Sep 2024 11:39: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 48KBdvNp004404; Fri, 20 Sep 2024 11:39:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBdv6b004401; Fri, 20 Sep 2024 11:39:57 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:57 GMT Message-Id: <202409201139.48KBdv6b004401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 59f3eb3b71d5 - stable/14 - netinet: Explicitly disallow connections to the unspecified address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 59f3eb3b71d5df21882ed95d99ac10911f305b81 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=59f3eb3b71d5df21882ed95d99ac10911f305b81 commit 59f3eb3b71d5df21882ed95d99ac10911f305b81 Author: Mark Johnston AuthorDate: 2024-08-29 13:11:15 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 netinet: Explicitly disallow connections to the unspecified address If the V_connect_ifaddr_wild sysctl says that we shouldn't infer a destination address, return an error. Otherwise it's possible for use of an unspecified foreign address to trigger a subsequent assertion failure, for example in in_pcblookup_hash_locked(). Similarly, if no interface addresses are assigned, fail quickly upon an attempt to connect to the unspecified address. Reported by: Shawn Webb MFC after: 2 weeks Reviewed by: zlei, allanjude, emaste Differential Revision: https://reviews.freebsd.org/D46454 (cherry picked from commit 0c605af3f9d9e66be6af0a3bbc36dbedc5dfe516) --- sys/netinet/in_pcb.c | 2 ++ sys/netinet6/in6_pcb.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 28cd64ccbde6..f6904690deab 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1338,6 +1338,8 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, faddr = satosin(&CK_STAILQ_FIRST( &V_in_ifaddrhead)->ia_broadaddr)->sin_addr; } + } else if (faddr.s_addr == INADDR_ANY) { + return (ENETUNREACH); } if (laddr.s_addr == INADDR_ANY) { error = in_pcbladdr(inp, &faddr, &laddr, cred); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 8046e0fa530d..f7f2ea0b8699 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -370,7 +370,10 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr_in6 *sin6, */ if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) sin6->sin6_addr = in6addr_loopback; + } else if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + return (ENETUNREACH); } + if ((error = prison_remote_ip6(inp->inp_cred, &sin6->sin6_addr)) != 0) return (error); From nobody Fri Sep 20 11:39:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RN4H2Kz5Wf3x; Fri, 20 Sep 2024 11:40: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 4X99RN17tFz4ldK; Fri, 20 Sep 2024 11:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1uhBQI7x7cGpLOlXGMOqHwioVVsdpZmNOZVKiQOjt0Y=; b=HktEz3/fAmR6vM3POKvU6vZP0G7SEhmdQNwGv/CK5Z8JVHZ/UbXR7Yv8LPRFs3Rg1QhtCy +2U9NDETE98y8kO8DbMQJEaet0ZQHdhi2cfu9fuqHK48GuGpyLdlr1ULIgi055dHzOOz9L kMvLSf5KYP1vljdWvrIx79twEYNVPGdUN8v5kxlXvU90HlUBAbNlyq5drFxCPH1A55gszk D/KOATyZd+ThZCbTo3EkK3eRNntfwz+mc1ie3i7iJedXiRiYqUGvJ3FemCyxh03DO9f6aj OvglrPgv59cL/9KzeWi35gxmIjno9J9uZ1lKL+6zOR0OCrTpM3uDDZDsD5368Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832400; a=rsa-sha256; cv=none; b=f6GnzkmCaeU937AgEydcVZ89fnOxFStP65dnfPf6FOsJIGmNK8b9EhGxt9AhBgpAeZ2D7q XM+sMxC5kvySB6bWyfmPc0F7ULatZG0cCJUL0Fhq0mE8q7hKIgPHw4joLDxUI5GgwP9NSH 5D4VIr6UTH2jSD8fu31ZpL/epQBCOs/RiGG6nFW+/NkKmUMNKHCPY9t4sCcoFIZwNPMi1B X9EWDHaGWRJR1x8U7MJUs9IanZ4iiwfMNcbowS2cd6wrLWGwQkqvpUmWMJOz2szaH/6zkx baD763tc8hSx7HLiuldme6oAVbUIEzccllDr2UI6WTOEO890rWVup3hxnqB8VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1uhBQI7x7cGpLOlXGMOqHwioVVsdpZmNOZVKiQOjt0Y=; b=wpTurGYbcIN3Bg+McpS3e5Wrqsnx6m5sq8dFpGPWSU7BfXUS+F4mPUGGHFj0PKUDU9pIde WOGJ3U1oem4Nu4W7C1nBmLTX9RJCrzoKfs8TGLA+If5KW+NAZCAa3/IcLcNjQr6yq9Mlj7 xD1+/mwNJLXSXPCvdivnEWwVSqLiXSTXZoAsrh29WTi+xlG9xsqkPGgXVCsuaXfTQ/Y+/O F7rPwbnQHRhRocJcp3UBGevGyniT2R/f1QCc6E1OL7Z7K3DxYs+JUwPy6eIj1KbNd6IxNQ KEGzHyR1GxrpHJEavXbCbLhqljjSMdyoz+LrDgop7te/fCKGu4oqS9UUk1TQwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RN0R9wznj8; Fri, 20 Sep 2024 11:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KBdxJF004503; Fri, 20 Sep 2024 11:39:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBdxfq004500; Fri, 20 Sep 2024 11:39:59 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:59 GMT Message-Id: <202409201139.48KBdxfq004500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: aab2c431064b - stable/14 - pkgbase: Unify pkg ABI handling for pkgbase targets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aab2c431064bbc74ae643ae111afaa23a090c594 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aab2c431064bbc74ae643ae111afaa23a090c594 commit aab2c431064bbc74ae643ae111afaa23a090c594 Author: Mark Johnston AuthorDate: 2024-08-19 14:07:51 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +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 (cherry picked from commit b118b6eb4cb7520eb348a6ac965b077fc5179fde) --- Makefile.inc1 | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 935421ea3b9a..fd35c724b965 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1970,6 +1970,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 @@ -1982,12 +1986,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 @@ -1997,8 +1995,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/} @@ -2008,7 +2005,6 @@ PKG_VERSION_FROM_DIR= BRANCH_EXT_FROM= .endif .endif -.endif PKGMAKEARGS+= PKG_VERSION=${PKG_VERSION} \ NO_INSTALLEXTRAKERNELS=${NO_INSTALLEXTRAKERNELS} @@ -2180,7 +2176,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 \ @@ -2256,7 +2252,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 \ @@ -2268,20 +2264,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 Fri Sep 20 11:40:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RP4nyYz5Wf41; Fri, 20 Sep 2024 11:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X99RP1KqSz4lkK; Fri, 20 Sep 2024 11:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fMYY3zpSC2WEZsEvEjTRjWRlxmVNtxM/Xyn1JhRUYek=; b=Apo9Ybxf19oNeN1iWeVs6nh6JiQR3qURFFQcfjUMJk2CsumQEvtctX6ChNvlrPEMFrLEvD OJW83iqFwfAt8z9mHUyHLbTinUW0611GWLxIbdYbyCyl+wVidGZXpd84m/iFT5XDN7tSBx Oj08nWvXtJ4gRkfcNbbIAmbgVMyi+RsBoMuctMtrjatO2+xRlQJveqDG41SiL4AhF8FCp6 NwNWkVeZf1ds1Bd0CYRgEegDfsnnIQ23EXJTloSsftZEqgxV9p9a54uyuk2pqMwpVceX1R 6n+18kwLePNflwm1TfrR7cjSrlg5lSDqC+ZYqiAwrkUPSjZylWgkWeIdqP34xQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832401; a=rsa-sha256; cv=none; b=C2D1OSJCdweDuLtywV75TIe449KMGq1c7xO8TLzHsiYZ1OygT8NUWBV+uUoqgc+yx+t8hE lnd7pZyKODE9+gJyy3y8cJG3FMTxKCnllgplQpwI7bc9r+SaBAL4wLopbp0HGfD+zN6L78 2rjXmeTHccMYNKPQIp0iA4iLxGvFFhhLtH89pkNb8TK8/6d0LQhTbhzjrPk2ITZiSdkKZC d5agz1YhZQ7/Dapa/wTly09IVF1WbTQbincyjRa1dr3rUzBdZcrZ5iF5Iw2mHIwKApTwUw 8+K1yE78uhXtCXrwzzlznko94o1Z6w9+oTrgXrBy94aHdL/gvqja6y8yNS/O8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fMYY3zpSC2WEZsEvEjTRjWRlxmVNtxM/Xyn1JhRUYek=; b=HfvFW+OydH4+25lTVbc7+3HrnNXN2Jcvhhf1zgtRIAHYxKFxP2JzQrySLA2RftQs6mvScA qAvjN/BKlxjZwCngDejJXZcEx2+ZYZPGMOy2qadCrTTGxuCAqmMnMuv4KBi7L4uP0Qmnsb 3UOV/paxIpqVsOr2mtsHEEp3XJXMXleZEpQyfTXMW7RZpH4dRjk1M4m3cYKzyMsfyzBqgg OtpocZYPd9OyNdI6+aF0+Zl8S6NPPI4T6haq62zL0bdyTLXOynATXiH9LMEmqzkoHQWgEX nwC8xT57qq9dePDE4YoIUGzz+HWi9n2YioFk25BBRsLJ2zHYijpg2xesTdtWzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RP0w6tznmS; Fri, 20 Sep 2024 11:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KBe1TO006216; Fri, 20 Sep 2024 11:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBe1lN006192; Fri, 20 Sep 2024 11:40:01 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:40:01 GMT Message-Id: <202409201140.48KBe1lN006192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c06e1fdc7948 - stable/14 - pkgbase: Let source packages be built in parallel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c06e1fdc794879cce97b2d2e155e638a49558c58 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c06e1fdc794879cce97b2d2e155e638a49558c58 commit c06e1fdc794879cce97b2d2e155e638a49558c58 Author: Mark Johnston AuthorDate: 2024-08-19 14:08:05 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +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 (cherry picked from commit d7d5c9efef031aa11a841d1836f7c937dcbe4ec8) --- Makefile.inc1 | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index fd35c724b965..28d1a9d76056 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2095,17 +2095,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" \ @@ -2117,6 +2113,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" \ @@ -2128,13 +2140,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} \ @@ -2144,6 +2149,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 Fri Sep 20 11:40:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RQ6NfSz5Wf44; Fri, 20 Sep 2024 11:40: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 4X99RQ1xCBz4lYD; Fri, 20 Sep 2024 11:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dYTI+NAa3/wRcN/y1tF8+3+vLqQYm1xH/9kbXn2D30Q=; b=Lo9z9/xT2Gz24UNeU4alYA/0luXEJ+W/w0eEfBI//J0ZAeu2L7w3NKR8hENwyzLE2zClGR Fdcg9T9XIZiLEFfm/D/XVfBp+HnIqd23+tK212lE633edxxKC0rUgev+jVq0ijBERwd+f0 aMZTCnPZyzlUe0y5Apa7pz54PLlyn4RICpPANw9KD4wLn0iXJWrbyOqfcrECZKHTwA/9hz h+ddrTuiDfazUO8DloEkLJM3XXtBTedrcyS1PwXAtYgwgdaxPcCOxxVZeJ/Pcz9svrdS6E KcgeLDo8C1jnvE8x7tiqUqP0WTz6KDaow509gMf5Iv87CMHrBrUA4fzYCpfYpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832402; a=rsa-sha256; cv=none; b=StWu8358X2bzDpJDCePFROMJjrlOltVjXduNA1ow0qSWZWgC/sKYf9HBOg1Hp2Z7NeBJ+v 2AsV9q56lkqRs+9O003J0zn9YkvHWVsS/zO9XRK/VOazTZ7YpzQ2E/TFR1mrTSP0VZaN8p QL1h9CBQieCzK+AKMREa/kD6BNJ/HrdGSQN5E41oD3LblRDLFWtFgQvfWBLAEQ5uDfM8ox xdMA3m0QuUE5TEPSo12RjB1ApUsRTrd+WGe5yRhbD0x6Nr+WXXc06MfVqLi3uXH5LkW7WS WwGhxDSeRbysDbSrw9n2+D4NjVLazkwBegDx6qGFIvuYwCC8YUHnEV3UN4IxJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dYTI+NAa3/wRcN/y1tF8+3+vLqQYm1xH/9kbXn2D30Q=; b=QrBKCMt7+mY2MYktZcy1orAu+2y/Lbci9arFryKHUxxpcpBSdqnlxGXhMhrJYCL5TcWit2 U/Z+6RVKHzNIc66UIOFBE/aquDZyiPWm76yV2eeWBY8at2ybUBD+eyKaDsoHEVsT0eZ/Wy s2cSz6CZn1/AZ+dorYkJy841ueWnjSS9ZW7WPk+mAshrnzrBQzcJlLsCE6E/Uxfmk9FxcI q1fiBXw4VzJhapN9f/+wr5LhWD4LWLy5z8IcjO5ObZ9+RUi/eKmElcCMGEcfpyGZBz2Z+V 3ln5v5D5qiTHGFIm/l6Cd1ELW7zO7sWpJLdP9OiWy/GQz2x71VcHBds7pSDSVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RQ1X1cznpr; Fri, 20 Sep 2024 11:40: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 48KBe2oR006626; Fri, 20 Sep 2024 11:40:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBe20C006621; Fri, 20 Sep 2024 11:40:02 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:40:02 GMT Message-Id: <202409201140.48KBe20C006621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c8856795d378 - stable/14 - pkgbase: Make src package creation recipes more precise List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c8856795d378ccb839c9f201aeeffb8586c59e96 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c8856795d378ccb839c9f201aeeffb8586c59e96 commit c8856795d378ccb839c9f201aeeffb8586c59e96 Author: Mark Johnston AuthorDate: 2024-08-19 15:22:03 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +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 (cherry picked from commit d02dcf21eea3973a714294b011537c2af6c747fa) --- Makefile.inc1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 28d1a9d76056..605b8098b742 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2096,7 +2096,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" ; \ @@ -2123,7 +2123,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 Fri Sep 20 11:40:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RR3XvVz5Wf6Y; Fri, 20 Sep 2024 11:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X99RR2WlXz4lhc; Fri, 20 Sep 2024 11:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CIue6DGsrEAQPorG9MgKLe0WCeiZ97EB0k5BDPWxSt8=; b=G1RaoU5VLaDM4KHMxj3ypNg5ec8A0APKj8lmIJKX/qG1+g1je3mVVsdRpJx86S/jQhj4gC AHdPYLUwUiicJ7qWoDlX+9l233I5+3FmW0qFh+M68/+Ciehod6CEPKeyK6W5ax9TmsdFn6 GJSDl/IyK+6Ixdj4vo2stTgkPYPijqeAQ0yN9B2zBsht63Sy7nFDIRf5o5ITQK2g8KBL0m OQIdjiNzM4n8LcIxK6rRDsitwRrtnQbPYxuCNvbyAqQJN/p2g4hu6wVIC60jprYsVcKQiE ZSduitvZD4VMXWXbJc/U7LGjSvKcb6WLJEf/h3DFOvm6k0RL42vfxd2nY+bijw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832403; a=rsa-sha256; cv=none; b=JOAoU64fkSOu87Bd1z6YaNzGgUB1gILguoEggygkX5FA0Chp8xoKYUJsEDIPWFVzb7PmpX t4yz5eeFtmSCqM9P7VA5FxQjOjHlEzG5uyzy9vpUCZCHue4oEWuOXf+4vlj7A2/RMAGgSw pCH1B2C5amCIgj72Do+fyY07IfqbKx0/Rd6ZFlSSvbpZXMVf74OeETY2NKHLrpFJwl8fuB fXLJ0Vpox5otWrzJs8jOwDvYwTWf6vqpziVAOzX0mKGFSadl7W5hL+IYbVVSnwciepyFJr p5Yc0Jz9PX5sjXOkuJ6miqn3K/Q67N95kAMfDwjPEpHZzzAp53KySOn0SNvCJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CIue6DGsrEAQPorG9MgKLe0WCeiZ97EB0k5BDPWxSt8=; b=uES5lP/FfH5+p7ZuP2vCY7wStYm+yLtJ5C/IGqJroVaNUfsvG21kBlqTDp6/SQFb7GxlNe QBwl5PwNpAFXwyRtXC8C7Tx1Sr9F65U4c++LmA36yOMBWhvScnSlWz+qfYtsl2b/iqJ68H PICgnozJZRzIoj38xrL28unHKnkN1FbaGN068WAPhTxVpzdoEPN+x4GiCxkqBFo/P6OQhM rujramn32qzwcacMb/sW0mTU8NA41Kn5Cehn3QfGoUEydRq+D1PW9StlcQoHH0rc17SfCw 8xj+0FC4mZ22qVUwQDArFBmsFI5Vnan3CxxODFIo/jK8aaZFpz/CZ+wOiVQLfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RR250Pzp2M; Fri, 20 Sep 2024 11:40: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 48KBe3P4006904; Fri, 20 Sep 2024 11:40:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBe34d006900; Fri, 20 Sep 2024 11:40:03 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:40:03 GMT Message-Id: <202409201140.48KBe34d006900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 20191b71bae1 - stable/14 - src.conf: Add a MK_ZFS_TESTS knob List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 20191b71bae1f86ecc03e67d60ad801a72ea05d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20191b71bae1f86ecc03e67d60ad801a72ea05d2 commit 20191b71bae1f86ecc03e67d60ad801a72ea05d2 Author: Mark Johnston AuthorDate: 2024-09-07 14:36:28 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 src.conf: Add a MK_ZFS_TESTS knob The in-tree ZFS test suite is somewhat outdated and I see a number of failures there. I tend to think that we want to integrate the OpenZFS test suite somehow, replacing the legacy one, though it's also possible to run that as a separate test suite. In any case, if one wants to run the OpenZFS test suite separately, it's useful to be able to disable installation of the legacy ZFS test suite, so let's provide a src.conf option to do that. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46476 (cherry picked from commit 24affded3d4ec5fafb6b22f773ec1e20d73b9b03) --- share/mk/src.opts.mk | 6 ++++++ tests/sys/cddl/Makefile | 2 +- tools/build/options/WITHOUT_ZFS_TESTS | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index a12a748a6055..600daa9ef61b 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -190,6 +190,7 @@ __DEFAULT_YES_OPTIONS = \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ + ZFS_TESTS \ LOADER_ZFS \ ZONEINFO @@ -444,6 +445,11 @@ MK_OFED_EXTRA:= no .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no +MK_ZFS_TESTS:= no +.endif + +.if ${MK_ZFS} == "no" +MK_ZFS_TESTS:= no .endif .if ${MK_TESTS_SUPPORT} == "no" diff --git a/tests/sys/cddl/Makefile b/tests/sys/cddl/Makefile index 80c72ea5ec42..377faae73522 100644 --- a/tests/sys/cddl/Makefile +++ b/tests/sys/cddl/Makefile @@ -5,7 +5,7 @@ TESTSDIR= ${TESTSBASE}/sys/cddl TESTS_SUBDIRS+= ${_zfs} -.if ${MK_ZFS} != "no" +.if ${MK_ZFS_TESTS} != "no" _zfs= zfs .endif diff --git a/tools/build/options/WITHOUT_ZFS_TESTS b/tools/build/options/WITHOUT_ZFS_TESTS new file mode 100644 index 000000000000..ae2ac45ca0f3 --- /dev/null +++ b/tools/build/options/WITHOUT_ZFS_TESTS @@ -0,0 +1 @@ +Do not build and install the legacy ZFS test suite. From nobody Fri Sep 20 11:40:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RS5SVYz5Wdwb; Fri, 20 Sep 2024 11:40: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 4X99RS3JQ4z4lhs; Fri, 20 Sep 2024 11:40:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8q+TOtGjGv8eQnm8wNbnfXBAl5kmAhCbi/SDDZwdw0k=; b=SLyqbIY/0xn5JeagFdn5aTGDroN7WCbv9N69U9025edTeeJAKviIXKtx9FBWKJBJat4Id+ PndT+8G2qZErFGb5cXj/l68luY3f+c/Y2UY8kA03kCjRj5gaBNhaAZCiNsIDHPU3Nm9DqY 0jpgtNbUwFIIuuMv3MfP6eWirGw628TZbultJGTqZNw2+O5c08fOP0URGPOgxnCn407Z96 qhsTPaZrZ8IRq1urLEAuCorLMHl/wjcf5ildhtnJLMJXswmrR3Vlpyd7kn5yRld41XzVTT gKFZxl6IMVXzepywQ5pfi0TGeDJMn/HCYUqNqi5C9ZxAYD67biuAdyJTsUK17w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832404; a=rsa-sha256; cv=none; b=RAXN0isL7dxXCzD2kLGmHpyMztpi6UC735KcTlz+4OllKXfvv/iCJf6jjMQ5rjDBWGxWJY F6iQyPC+zrtcjn+jTkrMhVfVpZfISIvxBuk392TdYn1mLA9Iyw9yeKEHzAQgeoRgGyBe7H BYBuT5R4QHdeh/bphufXpH3bcS0rB8AHdmg/tWhWfDv4JuQ9V5M80oebK70tl/sbk9iQGe hvLaP7KE9GAkGZB7TdDUspHi5jwXgOM40XO8ZsijCguS0VwtZFqnKt/x2gSxSzS9+xZ4OQ NGM1jjDP9z+XuYC4DV/PzIW5VNGg63HaZC9ypuYVR3gq2ZGSfXTbcO/nOpu3DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8q+TOtGjGv8eQnm8wNbnfXBAl5kmAhCbi/SDDZwdw0k=; b=DnyOIqbhFG85mFjcYMMB6U6W2QJccv7Km3gf07aVA0qSYZBALqRakqffTPsnkTSQyXZ5la ykK4va9MR2g12Yh4Qg2bcObiZAT/28pXhNTmWYL0Pnp7j+n7UbuYbOEJ1I8CsEtwIBJABw E6TXCZkgUtcKn9GHYyH18td4eE6rrpQNGeTbZU8szmjkKm5bYYnQtkNahBWLsViUpa5+TA M6EZrMzlSmQWS+oAn401Px/SHZrZ4ZHrYDEGonAeWXLvZbHqEqJ+N1HkXb1ErYGEXGj4/K /EfUP203IMwZ0AxK26fPJLdCrmVLbKw2ZaIN4ETwtDU93Q4CphdP8/zQLxV6pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RS2drJzp2N; Fri, 20 Sep 2024 11:40: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 48KBe4fZ007193; Fri, 20 Sep 2024 11:40:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBe4nP007188; Fri, 20 Sep 2024 11:40:04 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:40:04 GMT Message-Id: <202409201140.48KBe4nP007188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 772e980da4bd - stable/14 - ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 772e980da4bd5d47eceee95e91e8573ecb48be1c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=772e980da4bd5d47eceee95e91e8573ecb48be1c commit 772e980da4bd5d47eceee95e91e8573ecb48be1c Author: Mark Johnston AuthorDate: 2024-09-06 16:55:42 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl() IFF_ALLMULTI has an associated activation counter and so needs special treatment, like IFF_PROMISC. Introduce IFF_PALLMULTI, akin to IFF_PPROMISC, which indicates that userspace requested allmulti mode, and handle it specially in ifhwioctl(). Reviewed by: zlei, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46524 (cherry picked from commit 58f194223ab8578269772a6874a8444e5e03afaf) --- sys/net/if.c | 16 ++++++++++++++-- sys/net/if.h | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 9beac09d54c9..fe51ba5a0b60 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2614,7 +2614,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) (ifp->if_flags & IFF_UP) == 0) { do_ifup = 1; } - /* See if permanently promiscuous mode bit is about to flip */ + + /* + * See if the promiscuous mode or allmulti bits are about to + * flip. They require special handling because in-kernel + * consumers may indepdently toggle them. + */ if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) { if (new_flags & IFF_PPROMISC) ifp->if_flags |= IFF_PROMISC; @@ -2625,6 +2630,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) ((new_flags & IFF_PPROMISC) ? "enabled" : "disabled")); } + if ((ifp->if_flags ^ new_flags) & IFF_PALLMULTI) { + if (new_flags & IFF_PALLMULTI) + ifp->if_flags |= IFF_ALLMULTI; + else if (ifp->if_amcount == 0) + ifp->if_flags &= ~IFF_ALLMULTI; + } ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) | (new_flags &~ IFF_CANTCHANGE); if (ifp->if_ioctl) { @@ -3386,7 +3397,8 @@ int if_allmulti(struct ifnet *ifp, int onswitch) { - return (if_setflag(ifp, IFF_ALLMULTI, 0, &ifp->if_amcount, onswitch)); + return (if_setflag(ifp, IFF_ALLMULTI, IFF_PALLMULTI, &ifp->if_amcount, + onswitch)); } struct ifmultiaddr * diff --git a/sys/net/if.h b/sys/net/if.h index 4c3cfd06ca03..2403b22c191f 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -162,7 +162,7 @@ struct if_data { #define IFF_STICKYARP 0x100000 /* (n) sticky ARP */ #define IFF_DYING 0x200000 /* (n) interface is winding down */ #define IFF_RENAMING 0x400000 /* (n) interface is being renamed */ -#define IFF_SPARE 0x800000 +#define IFF_PALLMULTI 0x800000 /* (n) user-requested allmulti mode */ #define IFF_NETLINK_1 0x1000000 /* (n) used by netlink */ /* From nobody Fri Sep 20 11:40:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99RV082Sz5Wf22; Fri, 20 Sep 2024 11:40: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 4X99RT3msZz4lj8; Fri, 20 Sep 2024 11:40:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frMqBPnm2spisBdfFhsrcmHLvMtezzPjINndkGLJxGo=; b=g7sr98qpckGK4LW/s48RWW1PS0lyKu81vve202+DxCpT1gYrxqF+7CdQJqLM5t9wJnaRsS zqZ39ufPVVFknPFNlnaNtiCxufFgmwG7/qgiE/XEpLfpQS+OWh3dBzLP+Wt1Te3B0mB1RX Q6DPYNaGKZrD0sZZeIjGkpbXh6JrqH52Eu708e+OEu+bPQIk4jiNX6JXodr7wC7Vb4H9nt Ww42l4pBPhdMu4hUozcpe+D267dB3sJ7ljrC+vbJ00RPmYV6T2oTB0BVwyBEHVUmDu00aF tpz7QFWiZisDtd2alAXaoumxppk1WhZ5UZ1cJJ9/dfjipdktKVCUhohLOMieUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832405; a=rsa-sha256; cv=none; b=hf7AgYGGOM60dQ9eu26ETz1pyRFbQ+UufeICPjSu/anNo5nSnsgYo1zMHJYypfdKaFozG3 GCLLVAA02dFsntUD9ptrYvyf0ViiqytPIItarO3BbUKIUo/s29JROGEdwcBKVVlS2x/cGb Aj6FECZc8cagMeeqt21NNk16H5zGUakxxU/frIzu+8VnVW+AK5wxIbQ1sUlFLIknMptDuB susTYFP8m0AuSoTWHN75DtsdKPt6qsXTV0gBOhngglFJbNadQ3RUx80xt+AxhVxBn24N7Q XE9NopUa7iu9mrvEFIBVyrX3eYjOfR8uX74WDEJIBTtvS0VfC1JiCa2orEgV4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frMqBPnm2spisBdfFhsrcmHLvMtezzPjINndkGLJxGo=; b=Ckr9hsZ0aD2kLHMwsA8jXEX7qXHWqLj/oNS9b7DLgPk71KopYnBliD8hkKix8NLUnbTcIk 5iPcOizVh8HNsMzx5G7FGSojToUluTkHN8VQwu2+/Qr+FsD5LiSjSF/qJdZPvNys2ZARvo tNAQju4CAQuBm7ru4YAUkxtsInp/QZzC30drDgo0PROCKDrSVjfIWKOPNBGHXHpa+o55JJ eT+dycYijG/7jOit72xeJcgOlcuE+7ggwnQ5f7nCAr5AhzTccMxhiFRkTmMqk91O0Y1gao 4vh9Geu/bDXu8sNi4WS2Xd4L3M4OMHL74kkT4woctsUeolm6jzroe1MMTB1Z1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RT3KDWznps; Fri, 20 Sep 2024 11:40: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 48KBe5Cr007472; Fri, 20 Sep 2024 11:40:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBe5Fn007467; Fri, 20 Sep 2024 11:40:05 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:40:05 GMT Message-Id: <202409201140.48KBe5Fn007467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f47e5a92edd6 - stable/14 - ifconfig: Add an allmulti verb List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f47e5a92edd6840fca6267649b1304c39fbbcc8f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f47e5a92edd6840fca6267649b1304c39fbbcc8f commit f47e5a92edd6840fca6267649b1304c39fbbcc8f Author: Mark Johnston AuthorDate: 2024-09-06 16:56:58 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 ifconfig: Add an allmulti verb Similar to "promisc", this allows the IFF_ALLMULTI flag to be toggled from userspace if it happens to be useful to disable multicast packet filtering. One use-case is when implementing IPv6 neighbour discovery over netmap. Reviewed by: zlei, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46525 (cherry picked from commit 00c9a6806c9cf3357b62f6708e5acd1ffd166613) --- sbin/ifconfig/ifconfig.8 | 4 ++++ sbin/ifconfig/ifconfig.c | 2 ++ sbin/ifconfig/ifconfig_netlink.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 259be41bf94b..2f87ae8b8a5f 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -502,6 +502,10 @@ Enable driver dependent debugging code; usually, this turns on extra console error logging. .It Fl debug Disable driver dependent debugging code. +.It Cm allmulti +Enable promiscuous mode for multicast packets. +.It Fl allmulti +Disable promiscuous mode for multicast packets. .It Cm promisc Put interface into permanently promiscuous mode. .It Fl promisc diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 402967d405fd..5cf1ae6b79b7 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -2019,6 +2019,8 @@ static struct cmd basic_cmds[] = { DEF_CMD_ARG("descr", setifdescr), DEF_CMD("-description", 0, unsetifdescr), DEF_CMD("-descr", 0, unsetifdescr), + DEF_CMD("allmulti", IFF_PALLMULTI, setifflags), + DEF_CMD("-allmulti", IFF_PALLMULTI, clearifflags), DEF_CMD("promisc", IFF_PPROMISC, setifflags), DEF_CMD("-promisc", IFF_PPROMISC, clearifflags), DEF_CMD("add", IFF_UP, notealias), diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index bb0d242f21f6..03fe1e418082 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -77,7 +77,7 @@ static const char *IFFBITS[] = { "STICKYARP", /* 20:0x100000 IFF_STICKYARP*/ "DYING", /* 21:0x200000 IFF_DYING*/ "RENAMING", /* 22:0x400000 IFF_RENAMING*/ - "NOGROUP", /* 23:0x800000 IFF_NOGROUP*/ + "PALLMULTI", /* 23:0x800000 IFF_PALLMULTI*/ "LOWER_UP", /* 24:0x1000000 IFF_NETLINK_1*/ }; From nobody Fri Sep 20 11:53:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99km6rZXz5Wh15; Fri, 20 Sep 2024 11:53: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 4X99km4gKfz4qd8; Fri, 20 Sep 2024 11:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726833200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hTY1453zMikXWuqgp5G6eb3vf1cdoJ6sYW8DfDkIHlY=; b=v2ojYGKOIJnlLM4Yd3ZB5ozpmFKGQeYoVBbgLjFNAosKPQGMPh/xly2fuTmqUmPi6NEkgQ ReldFSHH1iiQ7kxGfZ9PUckGHkBtl5YCw91GX6yCOvjAZ8/mQ3tOIj3Fn4wqGEwKdbkNza ya/6+WNm5WgK6+/uTryItFrwq4adSuR1oDqpNLZ3HCnO7LxfXxgEWeBslVJj8SeI6bpzLg lqvSxPY2wQPc4SxYrC1ZgYN8LW6n0Xxv9mCYxuOig/jpmAS9/jpcbNBOf6UbuWK9bPYv6S RiqsF/+llW8rMei90ieOLEGpD8z7TdtzTpCDYTSbkYHBrAjuHl6KPNQbpgO/BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726833200; a=rsa-sha256; cv=none; b=XKqX6FhOT0UeXGU/JSUJdBHB6IxMHPO1AhhEf4O4qGEMspKGrAymhORUCBkBnqTdc/5NKH 16U7KhCFSqU23Nga0tZOFLAOqEOfrbS31dcac3c2rLf3aahMCvKKRfvPF9cbQDAjyLzjnA AjRKT3oxsM6eT6tZJb1DY+OK5b6G6ka3NwW7T0FuvYg0SZqlcy5reblizr0O89kFn05FWv xm2rmkOrk1jQ5q1g9g9I2fI2G/Z8i3JOAsrlgr3SSkprQqaJulRlewKL1NUUKgyiRJFlwr WdgF75IySW70EBHE5LFxISgx3BAPALnCv1p8pZTgHjK0sZeh+DVKS4T0+jq/xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726833200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hTY1453zMikXWuqgp5G6eb3vf1cdoJ6sYW8DfDkIHlY=; b=MYSIOLbEUKQUl9rYAmrOJb7GWIRwn1vKv8qNcafmfVy/L1v+aRTjHliwNqjEqLUfFr3PzG og/f83gc6zoNsn+OnuYth2VAaYA3b0TvZ++Kvc2YxJTpCX0l77EEmtdD7TSihWVdB/BO+T qDsZykXA4l77E7RgYq5mgTFH0p05h1DR8JsHsJZHkLIznNmiuW2XSOyZJCQsK5LerYRqEU JQb/XvhP0kX/3qSnv01v1a1ye3+Nf2Ybdk0jQIOgfa0fz77T19goge2Wn+N6udUxKOXJba Ya8YUJVEtmU0GeyN6CfEg7OZ44DyU94h6CJx1PmFgrExP8s3e6NGIR5dS4f2LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99km48bHzpHZ; Fri, 20 Sep 2024 11:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KBrK1n037358; Fri, 20 Sep 2024 11:53:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBrKY5037355; Fri, 20 Sep 2024 11:53:20 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:53:20 GMT Message-Id: <202409201153.48KBrKY5037355@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: 75cd1e534c75 - main - socket: wrap ktrsplice call with KTRACE ifdef List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75cd1e534c75fbdd3294debe6edea27e780bc5f1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=75cd1e534c75fbdd3294debe6edea27e780bc5f1 commit 75cd1e534c75fbdd3294debe6edea27e780bc5f1 Author: Siva Mahadevan AuthorDate: 2024-09-16 01:46:00 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:34:04 +0000 socket: wrap ktrsplice call with KTRACE ifdef This fixes a build error when the kernel is built without KTRACE support. Reviewed by: emaste, markj Fixes: a1da7dc1cdad ("socket: Implement SO_SPLICE") Pull Request: https://github.com/freebsd/freebsd-src/pull/1426 --- sys/kern/uipc_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 071530925892..fb3dc4dfc224 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3954,7 +3954,9 @@ sosetopt(struct socket *so, struct sockopt *sopt) } if (error) goto bad; +#ifdef KTRACE ktrsplice(&splice); +#endif error = splice_init(); if (error != 0) From nobody Fri Sep 20 11:53:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X99kp0xmkz5WhKp; Fri, 20 Sep 2024 11:53: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 4X99kn5vlwz4qS9; Fri, 20 Sep 2024 11:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726833201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uz0OA4IZm3HYhwdPgBL0QUVo+goi0sjkETeA3WPduJY=; b=pTyzBT9NIVYA5HsthQUuNGAR+VYSfM7BzOfX1bKRkkqDO6x0kz/m1NZ/r/4wrcVor79eAh vQHj0j1wwN72jZrrech3125dx1OnQUnYpjNF1yS9BIWE6iz5/f8wtTd4jsjXf5E4sDHtz7 oDIoP72BbZLbvvTK9k0ect4zM5+12E9moCyYRbThSbd1NDK+OTZIpEBe1NkIy645pnBLK1 CTXk10j4KKATf40iWp7lHEMef3VB8cErD7JY9Wm6rlKhykeZU4gVPBY5dQMrsXwsJ2YGAi f35fPQH+nytGDHVLUAxHngYhuRviBdORQ4JkTA3qofi+V+dMl15h37bk3kbq8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726833201; a=rsa-sha256; cv=none; b=SNcFkchr4S4h4f3w90cRLLOkc9t070Cbl/2yEJxsdbDVqJ1iA3GzmxK0XS5ygsaCQo0dAR hwYNpvFvjBtFyCAF6W6e17hDSK+FgmLn3p1HrCMbrvKhnVSYKwC1QAsseyPpUaK07xnBNV IKzFif9PFUPX2pzoYgdMrs8h7VSZblqSgByLw7B6OemE2hU9FaMo6ib4mZ1e6mx7P1BB67 yASP+apPOXhbw/kkE5O69c2FH9lnL82nQbO21U5qkv0vUp+nluMsiGRzJBnBlYyIV87OhM gSY9w55PJjGmwI6J38Erat2t7U5io42+hSLut43R3dp1CFgl/o74gup9C8MaZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726833201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uz0OA4IZm3HYhwdPgBL0QUVo+goi0sjkETeA3WPduJY=; b=UEVt0EP3Dl9nSZXk3WAD9tl5ZSdJbNRIJanpp7QQzduMt70IhzIeYlI1TeSeJpujaaG8qz WBupVFkYShfwO2gjpoW4nZv14mMFYyjKUKcN9JYVJMOsYrU0fjgi9UJaPPLqAguYdoZB2n Np+w2IAMMtOrSELiyUi7w5hCYs4ct5A2TgAVASEpS9YT+KTsU5iM44S4mQlZ4BxVgxTCn/ b/7pCBu/hVwQX+x0DM0I+LrO+HZPHARwMjNjUaeF9ku12duxWonzx4rDS5xWGeROmrKDVz Wa6zI7jORalTZga/Cc/RemQJnLwAgBqIcr0AuEN/ldCRSXhUInMb45ZHE6SPdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99kn5CbxzpHb; Fri, 20 Sep 2024 11:53: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 48KBrLk2037418; Fri, 20 Sep 2024 11:53:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBrLaf037415; Fri, 20 Sep 2024 11:53:21 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:53:21 GMT Message-Id: <202409201153.48KBrLaf037415@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: 283bf3b4b105 - main - socket: Only log splice structs to ktrace if KTR_STRUCT is configured List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 283bf3b4b105ad24e919444ab0e21f3296891283 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=283bf3b4b105ad24e919444ab0e21f3296891283 commit 283bf3b4b105ad24e919444ab0e21f3296891283 Author: Mark Johnston AuthorDate: 2024-09-20 11:40:31 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:40:31 +0000 socket: Only log splice structs to ktrace if KTR_STRUCT is configured Fixes: a1da7dc1cdad ("socket: Implement SO_SPLICE") --- sys/kern/uipc_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index fb3dc4dfc224..e83422e3a29f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3955,7 +3955,8 @@ sosetopt(struct socket *so, struct sockopt *sopt) if (error) goto bad; #ifdef KTRACE - ktrsplice(&splice); + if (KTRPOINT(curthread, KTR_STRUCT)) + ktrsplice(&splice); #endif error = splice_init(); From nobody Fri Sep 20 12:19:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9BKF3wKCz5WmGx; Fri, 20 Sep 2024 12:19: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 4X9BKF22TWz4tvx; Fri, 20 Sep 2024 12:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726834785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bzdwLIg85SrT89aoT/34WLTfPnAMbL3b7Od65ak3O9A=; b=LCLgrM7gbHj0JyUFUFhyOKVpdXWq++iFlBrDYEQ4YSGbwZW4FokXqs8NzYdYt4Yb3941S/ 6MmvpywlpP3ML7V7yQD4eVDDTtZKFtKrOkvqdE6H+m8GIysTa7+KC49SI7qYoBoOhrLxRk mGrhjz2x7GQ+gPYFvO3EwMyDyGjGpDVkjG+Z+Xtghb77JDUpmoujX0/JCAVnUXQCU0q/to FTaM2EHVvIoOXbMRC6SB6rfH0cjLD7KCzhhhp0AJ+tB/DKsox+fMR4M75bivsjOqnDHlRo pGGoyEmIUfQoxNu85n/Ac56DAFDX3dLNaQVRwfO8hZFbexQ3LHNjeR3bmb/xYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726834785; a=rsa-sha256; cv=none; b=Qbhm99anu1c/yCHrTjcFL9p0tZoH5t+mshrCS3KiIs79hlzQnTwGvf6JN94feWg4kdyW/c zMD5uxpsZwbdOylXWPZtUNeay397jbV/9ClPnd+UKbjhymCvPcpqyaW8dkoUnQ7benVX43 0tB0floL+uHUDHPtOJ6A0ls1kRDjplF/ORmVAe98NecnnhO+znDfBO4pE2SFL1e7pt8JS7 NSOdov9C0QZ60obOavARN0I9jKxYftkTCdDYU23NzqTSCgurd7C8yrGp4hPpXETQ9OyRRU 9E+hmtAP1twAjzWk6C/tHhB+3Dti+UTgeJOsRgfIpJcBvbIQfcZhBwCUUUOzLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726834785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bzdwLIg85SrT89aoT/34WLTfPnAMbL3b7Od65ak3O9A=; b=jl+HAxZAJSQ9zDegftQcUfos1GFifUTw/gP0Yrm+Xxqcqzz2VqlqG+ue0t4oWlFJwBbdjH DDyCqJroi/RLzLFcCT/4JUq1+97/QIP+D1cWnJCfWB0MZnhtnQgSVmfAz+VvRx8VCygEHk w5hiMG6tP7bQ7ENzRQjCl4Tk4CH291XeAUVba1rQ1smBfjBc2nWy9oSKhLJLdTvQ1Aa9pP BXhO0yjpz/BSh0iJgr5M+oyp+O56ujXSFRuZDUzj/xwAW41Ij9UsC9IDUV23vMHOp/ovY1 35XBT56K8K0MT3zbz+nZeMggLbr2oYAAR4Tbo71PKCuQNwralSB7ODwfQxcbcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9BKF1XFyzpNx; Fri, 20 Sep 2024 12:19: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 48KCJjQP074031; Fri, 20 Sep 2024 12:19:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KCJjbJ074028; Fri, 20 Sep 2024 12:19:45 GMT (envelope-from git) Date: Fri, 20 Sep 2024 12:19:45 GMT Message-Id: <202409201219.48KCJjbJ074028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f7dd97b7e227 - stable/13 - Allow sysctl hw.machine/hw.machine_arch in capability mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7dd97b7e227016a3fac4616307d871af3011dfe Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f7dd97b7e227016a3fac4616307d871af3011dfe commit f7dd97b7e227016a3fac4616307d871af3011dfe Author: Val Packett AuthorDate: 2023-02-05 20:52:50 +0000 Commit: Ed Maste CommitDate: 2024-09-20 11:19:41 +0000 Allow sysctl hw.machine/hw.machine_arch in capability mode There's no harm in reading strings like 'amd64'. Reviewed by: emaste, manu Sponsored by: https://www.patreon.com/valpackett Differential Revision: https://reviews.freebsd.org/D28703 (cherry picked from commit 4a1c4de232af202aa5fa02c7adaa97174997ae61) --- sys/arm/arm/identcpu-v6.c | 2 +- sys/arm64/arm64/identcpu.c | 3 ++- sys/kern/kern_mib.c | 2 +- sys/powerpc/powerpc/machdep.c | 2 +- sys/riscv/riscv/identcpu.c | 2 +- sys/x86/x86/identcpu.c | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/arm/arm/identcpu-v6.c b/sys/arm/arm/identcpu-v6.c index baae9ac360ad..6293a5ccaceb 100644 --- a/sys/arm/arm/identcpu-v6.c +++ b/sys/arm/arm/identcpu-v6.c @@ -52,7 +52,7 @@ char machine[] = "arm"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, "Machine class"); static char cpu_model[64]; diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index fcbf607b8fef..e913154f9956 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -96,7 +96,8 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | - CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); + CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", + "Machine class"); static char cpu_model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index b2e9e06f5793..ee3e36c0b5a8 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -317,7 +317,7 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, machine_arch, strlen(machine_arch) + 1)); } SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD | - CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A", + CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); #ifndef MACHINE_ARCHES diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 96084aea6fcf..85d741d11b1a 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -149,7 +149,7 @@ static char init_kenv[2048]; static struct trapframe frame0; char machine[] = "powerpc"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, ""); static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 6a63d39d66aa..39bc0e3b91af 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -62,7 +62,7 @@ char machine[] = "riscv"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, "Machine class"); /* Hardware implementation info. These values may be empty. */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 8a5d74ca5a2d..450df6807920 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -152,9 +152,9 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | - CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); + CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, "Machine class"); #endif From nobody Fri Sep 20 12:43:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9BsF41T8z5X5pk; Fri, 20 Sep 2024 12:44:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (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 4X9BsF1Lxzz40Pf; Fri, 20 Sep 2024 12:44:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7a99fd5beb6so260456185a.0; Fri, 20 Sep 2024 05:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726836239; x=1727441039; 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=8Sxg+X2VlMtfQptfCLmBdM1zHS+BKpeeOjjXRp/24mk=; b=Md/LHX6+ZvuH+ykVeX+UfCG3jwh3OmDkh0Tg0LbUKdbBr+OEJb35pus3PDVrFmNVDZ qyu9J61fmVAoK9OIZV7mXFmngjxR+ebButKHVC8LYhACv2MPfEHz4baz7KzAJE8nORgM QIqpsRxHVFyW3bjPrrHJU8HPtRNeRPLrWv2NA1aM2c1HUAhcx1bwS/xIzHrzrz1AxVQ4 JsZrEbO4ItbSVPmq1byyWhPcBHIb690BBbPwBBD63aIAh5eeJnSdhsh/9tM2nN1pMsNg gero7vzkCeRlHZcFCkB0DgDGuzf25CCkKKFPYsb6LwEVpCqjk3eAu4i3GKSN4Fdh0Q8D AhDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726836239; x=1727441039; 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=8Sxg+X2VlMtfQptfCLmBdM1zHS+BKpeeOjjXRp/24mk=; b=Dq/m5corzZ6U/nPgIcJINecz0QGywqynKEi0o/6XPqKeyADF9uyYugFl7WUIrMbYth 5TCFJ+UqItwAhDVw26W+71LmjqmQ98hO5wRpbjwKRXb09zPtn2h2wmvhNJuMgJX/qMCF 6rsP3SObHR7kkgGaNEWxLu/eibkw3/llyyEOqDOZmoJJOTK6/La2tHRVeHS5xlpKPB/4 sa3NFIKk0dBTZp2RINTG4U3LIGaM9AyurEZeirX/r+o3BUKx9mcFKOy89SdwjXzgxkk5 SsfRATSsbO2ZmXR6aiKpLtrao68QAituSJYtuFZi2inc1NMXO6PIHpZd7LtTjXB8M2e0 yw5w== X-Forwarded-Encrypted: i=1; AJvYcCUOAXVO1Acr8cgKmGk7IiRb3ywCeSJGY2FZH4FnghtGww+iY+464jKjpS8S9mOsAzI+zFAyOq2gWQ8z0wFK+JUmRG2pSEU=@freebsd.org, AJvYcCXcHV5nillDTu+ltyNjbRax5/92HJVv7rWd27yguvYVaSozh/607H6OG6w2Zcn07uXyH/FubH72KJZY9N0Dhlujuddx@freebsd.org X-Gm-Message-State: AOJu0Yx2XMqHZFeNDmnQiSkgjhUlj66nedh2dsztjZMIBmmDsITuO+1s TRdsCnxyv81KAJs47V6UjMKku6HxbKyYgd/JEeCEyyNhKEktt6hTF8/VUDkg X-Google-Smtp-Source: AGHT+IHRxrIOYT8BE/3Ood6fW97Gyf1oNjjhlj/NVt8Hl8uE8WwmKZ0FXGDo6TH22wlyIR5eIXhMTA== X-Received: by 2002:a05:620a:1a16:b0:7a1:e341:d543 with SMTP id af79cd13be357-7acaf5b86d5mr1092657585a.28.1726836239483; Fri, 20 Sep 2024 05:43:59 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7acb08dec14sm171855885a.123.2024.09.20.05.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 05:43:58 -0700 (PDT) Date: Fri, 20 Sep 2024 08:43:55 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser Message-ID: References: <202409200646.48K6ku0O009784@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409200646.48K6ku0O009784@gitrepo.freebsd.org> 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: 4X9BsF1Lxzz40Pf X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Fri, Sep 20, 2024 at 06:46:56AM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7672cbef2c1e1267e42bb3aad6a6da9380f4347f > > commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f > Author: Konstantin Belousov > AuthorDate: 2024-09-15 06:57:34 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-09-20 06:46:07 +0000 > > pipes: reserve configured percentage of buffers zone to superuser > > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D46619 > --- > sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > index 7ee2b5c76da3..68b57708d653 100644 > --- a/sys/kern/sys_pipe.c > +++ b/sys/kern/sys_pipe.c > @@ -103,6 +103,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -206,6 +207,7 @@ static int pipeallocfail; > static int piperesizefail; > static int piperesizeallowed = 1; > static long pipe_mindirect = PIPE_MINDIRECT; > +static int pipebuf_reserv = 2; > > SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, > &maxpipekva, 0, "Pipe KVA limit"); > @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, CTLFLAG_RD, > &piperesizefail, 0, "Pipe resize failures"); > SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, > &piperesizeallowed, 0, "Pipe resizing allowed"); > +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, > + &pipebuf_reserv, 0, > + "Superuser-reserved percentage of the pipe buffers space"); > > static void pipeinit(void *dummy __unused); > static void pipeclose(struct pipe *cpipe); > @@ -586,8 +591,22 @@ retry: > return (ENOMEM); > } > > - error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, > - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > + vm_map_lock(pipe_map); > + if (priv_check(curthread, PRIV_PIPEBUF) != 0 && > + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * > + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { > + vm_map_unlock(pipe_map); > + if (cpipe->pipe_buffer.buffer == NULL && > + size > SMALL_PIPE_SIZE) { > + size = SMALL_PIPE_SIZE; > + pipefragretry++; > + goto retry; > + } Don't we need a chgpipecnt() call here too? It looks like the previous increment is leaked. > + return (ENOMEM); > + } > + error = vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t *)&buffer, > + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > + vm_map_unlock(pipe_map); > if (error != KERN_SUCCESS) { > chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); > if (cpipe->pipe_buffer.buffer == NULL && From nobody Fri Sep 20 13:03:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9CHy5dqZz5X8XD; Fri, 20 Sep 2024 13:03: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 4X9CHy56hBz42GC; Fri, 20 Sep 2024 13:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726837422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=64Q0V/hwCFGJBzOFhFgzbhs+MwLfBGKd0/DTch9SY58=; b=K8IyKL3WXcnXnrTN5AEhV3jshVjR36AlJYDaoyGG7cyvF14+8qFkRSZnuei8eJM3wALYSh CX0gTLMufZCvwgLsP4txJrID9ouiN7fIrFTwPMnQdu9/YzVXWh03OwJEgOheCX64cgXRAb aiejebjQgtfH1/AG4e2CeioygSLGzOxXdCiLbzJ5yGA36IAqg9QuYl61yT1p2wkPQq37Qd FISwRRbVsaEuzlz9nHDaVhoNf1VieuQsZH3oh+yIfsaqMSQIZ/d7zZ3aqIoUyqM4KCQ0vD TfdPI27tdtmEU0LKju3yGikU/4YdhH97FRufOJKo/GkArqsVd3l+jx6r9R8tQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726837422; a=rsa-sha256; cv=none; b=DNUthiGAT5CgLGO5ysA/B3cA3kX2ITZ2ECfElgQG+WOHl4LrGrs+SlrrSMIUmz+KYShGBL MaEaGtXOKCv9kWDz7Kuze0F+K45VFpE5x8PlKxKXgnhsJDzgA28IaMH8MBf/wH7I9gg2ac TluE3RC3N+iyMh5+1i0w83ZAT/ikG1B68KWKj23BfnTuP6K635O/N8k4g4UJSZclmT25WC ifIHZFRYxeg7vKb6WZQ1wmVpb7JORY4vZVoYGxIEeAUGDePrJT0kFOcNuOIsOxyn/CmFt4 z0hnj9U21CjASuVib2q9Gwg4Wa/3KFuPVzIM5qkrT1jGuy0PoifvMmnED/mACw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726837422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=64Q0V/hwCFGJBzOFhFgzbhs+MwLfBGKd0/DTch9SY58=; b=VQLRCbbIFNBARQv4mGS5QDuhJl+Y+plhV2aIiOZu/RxmLN5pgGtiEXhTb1ygxbEp02KbFP 3kmKgzQYvzGogTmFnxNBGQXmjE32zYgzy/aqDo2/80hZCFSgUMper5N03OkGez1116SFwI s7EFdBDYcdcgEfS+azn9JqnjYyV4K5JTD2ly0Osddx02uY2hTu8YjZR1E30mWZe9AmWaLX lh5yHoUIuhSc0WcIhzrNxT42p6/o5eQn2xiS2KWTZwNA/IqzIC/jSsneMQ1T+lVNjxC1rw QaGlH3en5HGNBpOMKzky6MtHE0CnvLn0t8wTm3E0Y2Yq1qFBmpWPXWtDyd456A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9CHy4k3lzq5V; Fri, 20 Sep 2024 13:03: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 48KD3gDk059072; Fri, 20 Sep 2024 13:03:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KD3gff059069; Fri, 20 Sep 2024 13:03:42 GMT (envelope-from git) Date: Fri, 20 Sep 2024 13:03:42 GMT Message-Id: <202409201303.48KD3gff059069@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: 0abe2d3903cc - main - agp.4: Add a deprecation notice to the man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0abe2d3903cc4569705d491f8ac6d2edea01c26f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0abe2d3903cc4569705d491f8ac6d2edea01c26f commit 0abe2d3903cc4569705d491f8ac6d2edea01c26f Author: Mark Johnston AuthorDate: 2024-09-19 10:06:49 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 12:24:34 +0000 agp.4: Add a deprecation notice to the man page The driver is giant-locked and thus already prints a deprecation warning when attaching. The device file interface was broken in 14.0 and 14.1, see commit 12500c14281d, but it took a very long time for anyone to notice, and in that case it was only because of some code which probes all device files. Relnotes: yes Reviewed by: imp, jhb, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46542 --- share/man/man4/agp.4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/share/man/man4/agp.4 b/share/man/man4/agp.4 index de19349caa08..2aeb01850085 100644 --- a/share/man/man4/agp.4 +++ b/share/man/man4/agp.4 @@ -30,6 +30,11 @@ .Nd "generic interface to the Accelerated Graphics Port (AGP)" .Sh SYNOPSIS .Cd "device agp" +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed in +.Fx 15.0 . .Sh DESCRIPTION The .Nm From nobody Fri Sep 20 13:04:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9CK40Pq9z5X8d5; Fri, 20 Sep 2024 13:04:40 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Certum Domain Validation CA SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9CK339Vhz42yh; Fri, 20 Sep 2024 13:04:39 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:e81b:47f0:fa2e:761b]) (Authenticated sender: micmac) by drew.franken.de (Postfix) with ESMTPSA id 9C149721BE01C; Fri, 20 Sep 2024 15:04:33 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: git: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser From: tuexen@freebsd.org In-Reply-To: <202409200646.48K6ku0O009784@gitrepo.freebsd.org> Date: Fri, 20 Sep 2024 15:04:33 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org> References: <202409200646.48K6ku0O009784@gitrepo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3818.100.11.1.3) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Queue-Id: 4X9CK339Vhz42yh X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated After building a kernel including these changes, I see a lot of negative pipecnt for uid =3D 0 Installing world also fails due to pipe problems. Is this related to one of these changes? Any configuration change = needed? Best regards Michael > On 20. Sep 2024, at 08:46, Konstantin Belousov = wrote: >=20 > The branch main has been updated by kib: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D7672cbef2c1e1267e42bb3aad6a6da93= 80f4347f >=20 > commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f > Author: Konstantin Belousov > AuthorDate: 2024-09-15 06:57:34 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-09-20 06:46:07 +0000 >=20 > pipes: reserve configured percentage of buffers zone to superuser >=20 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D46619 > --- > sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > index 7ee2b5c76da3..68b57708d653 100644 > --- a/sys/kern/sys_pipe.c > +++ b/sys/kern/sys_pipe.c > @@ -103,6 +103,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -206,6 +207,7 @@ static int pipeallocfail; > static int piperesizefail; > static int piperesizeallowed =3D 1; > static long pipe_mindirect =3D PIPE_MINDIRECT; > +static int pipebuf_reserv =3D 2; >=20 > SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | = CTLFLAG_NOFETCH, > &maxpipekva, 0, "Pipe KVA limit"); > @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, = CTLFLAG_RD, > &piperesizefail, 0, "Pipe resize failures"); > SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, > &piperesizeallowed, 0, "Pipe resizing allowed"); > +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, > + &pipebuf_reserv, 0, > + "Superuser-reserved percentage of the pipe buffers space"); >=20 > static void pipeinit(void *dummy __unused); > static void pipeclose(struct pipe *cpipe); > @@ -586,8 +591,22 @@ retry: > return (ENOMEM); > } >=20 > - error =3D vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, = size, 0, > - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > + vm_map_lock(pipe_map); > + if (priv_check(curthread, PRIV_PIPEBUF) !=3D 0 && > + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * > + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { > + vm_map_unlock(pipe_map); > + if (cpipe->pipe_buffer.buffer =3D=3D NULL && > + size > SMALL_PIPE_SIZE) { > + size =3D SMALL_PIPE_SIZE; > + pipefragretry++; > + goto retry; > + } > + return (ENOMEM); > + } > + error =3D vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t = *)&buffer, > + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > + vm_map_unlock(pipe_map); > if (error !=3D KERN_SUCCESS) { > chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); > if (cpipe->pipe_buffer.buffer =3D=3D NULL && From nobody Fri Sep 20 14:03:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9DdQ6BzYz5XK4g; Fri, 20 Sep 2024 14:03: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 4X9DdQ4ZzVz49ch; Fri, 20 Sep 2024 14:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RlnFKpev3Ra+pgE4lmwed20Fb7HQZW1pKo621rZEruk=; b=INlnQat3LfZLCVagtbxe6HwVHGcTtTTFm07FFJu6pId7K62XU8GItBfmZpi6Fj/GvGUVSf Em9RF34ji/NRnBhzQDPcjmglu7Z+0dxXwqrP7vUX8G7yG6/bV95ppWc339/7cZHAfuql5H 14F1s3ERi9NABGtm9L91KMH2Pc6GJynfWgaWPn525A3Ci7Cft1ZT3NKMF1ia9NspLV52Hq kyhoiuvpenz/ynN7q3kSzMwlvFT59ZJNfKu5mLrVuXhvZhS4oA5Ls3m3NWA+MstHV9PQ+o lMi5wigySl8iQh1rOB9l5qpAw0yDakxUsK0651r2KINAMXuIgDis0CvI5CRUZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726841034; a=rsa-sha256; cv=none; b=uW5NQ0pr6sSQ6YCJ7rTRJrJkbyoUfFvSjwSrVg7Q4w9FVlK4fxs4iPgGnVW89YLXt73RKd xXsy+lY6iH2sEUYqDaoLlwm/Hc4xzkbTvZ7BO1MDghfH7CaBh4/XsOxS6i/RWc6Gf48CvH BVCxmcuUCYvSuzdNrd7tacb6zb/un+KlXCgEppyShR8pV6Q+5Vc6AKI1S1NwvEuQU/nVQb zJG/fh6lZG1y03jxUPV/com6tyCKYwcZ0hWKDbTrvXYj3RKQbdEnF56XpfaWdJ38sbW3q0 JWn671xBiaBLnZ7Kh4Two+dnmcnIB+tyNtFgTbaPAiTzyVv0o4dU2KQG/nm9Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RlnFKpev3Ra+pgE4lmwed20Fb7HQZW1pKo621rZEruk=; b=V8z2R126cPllrjCV67cVUPB7Bw6zgCnwRg1buDOxOiLpsDjH0lITj81Zdj5/FVtUhpOPvs jZFsskWGYGhTyPEQd519Xkrsj2JqAVgqWCKqIkqaXrYaU06mBNcqr+AlVGmoZZ/GSF1Spy HNuUr5afm3NdpQRVBF5+rz8y0/JlOWe3Pvfksgq08B5CfdVbJ7mZICyLPt9mhmXfaLFPl2 N+NRgK6EQFlQAH+nn4M5QI4cHNQJfs8i94Y6wXCbkxB7GvzyDEZ1FCYnq1UB0st+Sd3wVD EJ5skvFrbRBf2DgNorF2qIXtxq5ZXdzC2sd2EMOmVPJSnhdmprdO73YmAZDN3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9DdQ4C0TzsrT; Fri, 20 Sep 2024 14:03: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 48KE3suK061223; Fri, 20 Sep 2024 14:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KE3sXb061220; Fri, 20 Sep 2024 14:03:54 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:03:54 GMT Message-Id: <202409201403.48KE3sXb061220@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: d6074f73af5c - main - pipe: use pipe subsystem KVA counter instead of pipe_map size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6074f73af5c813524022cf6ee7dab9c4cbe44be Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6074f73af5c813524022cf6ee7dab9c4cbe44be commit d6074f73af5c813524022cf6ee7dab9c4cbe44be Author: Konstantin Belousov AuthorDate: 2024-09-20 11:59:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 14:03:45 +0000 pipe: use pipe subsystem KVA counter instead of pipe_map size to calculate the superuser-reserved amount of the pipe space Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/sys_pipe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 68b57708d653..ab045c718e75 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -592,9 +592,8 @@ retry: } vm_map_lock(pipe_map); - if (priv_check(curthread, PRIV_PIPEBUF) != 0 && - (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * - (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { + if (priv_check(curthread, PRIV_PIPEBUF) != 0 && maxpipekva / 100 * + (100 - pipebuf_reserv) < amountpipekva + size) { vm_map_unlock(pipe_map); if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) { From nobody Fri Sep 20 14:03:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9DdR6Zf0z5XJwm; Fri, 20 Sep 2024 14:03: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 4X9DdR5vVQz49X4; Fri, 20 Sep 2024 14:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+RZSX+9Qw4IblT05O0gIWz6b6dro5pFQvNPR2gUu7Q4=; b=AvWia8mZHu7sKLS8lpTiZSirAOGt1p/Ml5BazTdfYqTIivwR/0hxciNNBMEZ39SN9wKoYT 4icGgtBfp0/+YqSjTS14VvTuTZVmbqyNT57+JF3DcdEMzCB4ylIlP/3t0o6n1T/bmvXeQP +m2vo0+KcUvJLTiQrmVxtx6it3YSQnZB2ZDYT7xN5weRJf5giyoT9H40a1ouLQ/5tTLmrV bv7/vtNDfbWI3OAYlen9XJOiZQ3KhOqfNtv3IKhxQ8r/NVdSVdv6gZXk4uharaOtjnYyjy jwaCD3Mq4JrGw6SSkyjLNpiOv2OjeKVe9GK2g/3aNTQA9idGD/xx4dzG+yNtGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726841035; a=rsa-sha256; cv=none; b=u3F2bV6YZ8XW9aUQO5C2r0tIPzJBiafGIwI50XHlnqot3eAZFtvJq2Vq6loPckYFx5QP5M snMRgAaMd017BZUEhtw3Kr54ZBHzq6Lxk3QOnGD6v+Pg1zoHghc2pORFZHRxaskxlSGVMs 2OOj19IguFUbA3NnDAJfEmDVkrTdv+diAzCTOAPQ2rmONEefaGYheseRbHMkEnvhsp6d/m 5Inm0hiapJmlSStYov3CN2DghfOaQKspsfU0IlRnHBgzILWL/ZnrEPNCDnolGSaBljl8mE XxPtB0GYMFvyU8an0nhwepLo6ZLGiK1CwhLmfpZYqwWGKP63gKjVk3vgsq+wlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726841035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+RZSX+9Qw4IblT05O0gIWz6b6dro5pFQvNPR2gUu7Q4=; b=LLtVci8OF7kAPVwTl+82KWVl6PshPnjOts3QFUCHtt84VsLTTW7zTTllBIwqwhTDCJaqsl JSExTfUBar1Ktb7qLz4I7O+czAzY4zAwPD9wPsup70hCiGisWPEnKUyxueOoX7IPINFupf o4d2A1vHF0oeUwLt8XdXaPaN1+vfv64dbbOuuuLH8tUmXkc+Al88diW9LsAhZu4EPXaDIf JjH9ZB1jLYq8UvG0pfRnK6qjCrtHUwroth/cGNVt+129dXjEs20ld6t2eZBDnHSDB8BpIn KVsqgYyXXqzoS2L7ICEnu1E53LrNxdZyMXC/fxXHIgmzrxVdvyBnCXTWQDTMtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9DdR5T4dzsnw; Fri, 20 Sep 2024 14:03: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 48KE3thx061277; Fri, 20 Sep 2024 14:03:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KE3tZ9061274; Fri, 20 Sep 2024 14:03:55 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:03:55 GMT Message-Id: <202409201403.48KE3tZ9061274@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: 40769168a5ee - main - pipespace_new(): decrease uidinfo pipebuf usage if reservation check failed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40769168a5ee227b96ea91768555eef332a0dc26 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=40769168a5ee227b96ea91768555eef332a0dc26 commit 40769168a5ee227b96ea91768555eef332a0dc26 Author: Konstantin Belousov AuthorDate: 2024-09-20 12:58:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 14:03:45 +0000 pipespace_new(): decrease uidinfo pipebuf usage if reservation check failed Submitted by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/sys_pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index ab045c718e75..2b81d08f7077 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -595,6 +595,7 @@ retry: if (priv_check(curthread, PRIV_PIPEBUF) != 0 && maxpipekva / 100 * (100 - pipebuf_reserv) < amountpipekva + size) { vm_map_unlock(pipe_map); + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); if (cpipe->pipe_buffer.buffer == NULL && size > SMALL_PIPE_SIZE) { size = SMALL_PIPE_SIZE; From nobody Fri Sep 20 14:37:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FN30qMVz5XPt7; Fri, 20 Sep 2024 14:37: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 4X9FN26mdwz4JTd; Fri, 20 Sep 2024 14: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=1726843043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmB1SxSX2r6KsbnlLxAr1sJOvpx4S+4XpGL0DAF0KFA=; b=oKEtYQAsA8HxoEonm8YXAdYdliZtFGdFSeiFnDIgjCh/NVVwANxuRkhEWzbCpmT5xnShIZ +H8XKBsAJsKQWywYUfIq4BRc+FXLCZd5Ybhnr4glJL4HH85DIuxzwgWExEg8I+9lFUc7lJ 8QNg+RntKN1iWXqOVl0/j2JnT4xjzDLIikfhOBq71JFfCcjrVIuno1AtheuYaSTXSq5ELo BX1Q/C0REExLvgfTuKAf3HJLUuir12bQ+7PBxDlGcmxkOqi7ZGqlpa7c4cisr9VffVB+pP NkbtompZg4OxRuPZpCCneWfCO5OP9oQpI8t1CHvUq/RWA+I3ihqEn7Sb8e8WTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726843042; a=rsa-sha256; cv=none; b=TpOiii/1JZCGmE3+k+oRHFZCZv+V2sUSNmkvNNC1DkgGTW0Si8KKt5fS8eaCUhp/G37Td8 vyuDNFQo5m2SWYdvG0cpBGvwE4+U7EJ1Z4vYtKuyGV+bnKSS0I3kMr5LJsr2GJ7/iMCmsS PQmFN3kRaKiFM+zviA2EyOcPAODRE8klOBjn5Hgqe8cxGOofxFXyRz7vc+A6PC4SjpMSmg rFIDpl3e6x5vqmGZyMmCuOG3D28aYSCoBhsDzX6OnJXrFXVzC4PwSrFfPtSRvWutc0BbtO tMbaS1uFRiV6Zr18f6RHEGa35NddnHVAaPeDi7yvMDKOa2Y5Srgjh6qxMQY7Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726843042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmB1SxSX2r6KsbnlLxAr1sJOvpx4S+4XpGL0DAF0KFA=; b=rynKBOrjGf1Dm5UhMFHHThJ59Gd5tGkeiHuDNh3s8TKqq+pMClvAT/gFMHzdIrKQEn2RNn k2dpBeVigHJdYMSVMga9z4CwALGfS2zrd9aM2cTtsTiv4yJiWF2xzk0/Z9nGouo36l7Tfx k8Gea8fO36if7Yzsmkl50l8DMbdKsJvt91U5Y+tj3rRPMsnHuVCs7GnIkaXcfLTbrehHqT aUdxvF5yDaLTHGyE5+n7TU3GeLpf2nD08S/GKuKu46/0IjGFbBR6Qv/YYIaQqV1QHVo4dY Oz2DkNdCR1vegEB22x/ip40K0JiKKi7lUp/VdNjhMtMovIMUUicR+qBtZbHWTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FN265JnzswG; Fri, 20 Sep 2024 14: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 48KEbMGT013015; Fri, 20 Sep 2024 14: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 48KEbMqF013012; Fri, 20 Sep 2024 14:37:22 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:37:22 GMT Message-Id: <202409201437.48KEbMqF013012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 650056363bad - main - manuals: Fix errors in .2 pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 650056363baddb83c61c85b0539ee536f3d4b56c Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=650056363baddb83c61c85b0539ee536f3d4b56c commit 650056363baddb83c61c85b0539ee536f3d4b56c Author: Graham Percival AuthorDate: 2024-09-20 01:54:39 +0000 Commit: Mitchell Horne CommitDate: 2024-09-20 14:37:02 +0000 manuals: Fix errors in .2 pages These were reported by `mandoc -T lint ...` as errors. fhlink.2, fhreadlink.2: remove unneeded block closing. getfh.2, procctl.2: add necessary block closing. ptrace.2: -width only takes one argument. swapon.2: and weren't being displayed, because .It is for a list item whereas .In is for included files. Also, we want a blank line between headers and the other one. Signed-off-by: Graham Percival PR: 281597 Reviewed by: mhorne Sponsored by: Tarsnap Backup Inc. --- lib/libsys/fhlink.2 | 1 - lib/libsys/fhreadlink.2 | 2 -- lib/libsys/getfh.2 | 1 + lib/libsys/procctl.2 | 1 + lib/libsys/ptrace.2 | 2 +- lib/libsys/swapon.2 | 5 +++-- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libsys/fhlink.2 b/lib/libsys/fhlink.2 index 332856630879..b7f7d02dd136 100644 --- a/lib/libsys/fhlink.2 +++ b/lib/libsys/fhlink.2 @@ -38,7 +38,6 @@ .Fn fhlink "fhandle_t *fhp" "const char *to" .Ft int .Fn fhlinkat "fhandle_t *fhp" "int tofd" "const char *to" -.Fc .Sh DESCRIPTION The .Fn fhlink diff --git a/lib/libsys/fhreadlink.2 b/lib/libsys/fhreadlink.2 index 23850c6a2117..222142de223e 100644 --- a/lib/libsys/fhreadlink.2 +++ b/lib/libsys/fhreadlink.2 @@ -36,7 +36,6 @@ .In sys/mount.h .Ft int .Fn fhreadlink "fhandle_t *fhp" "char *buf" "size_t bufsize" -.Fc .Sh DESCRIPTION The .Fn fhreadlink @@ -86,7 +85,6 @@ The file handle .Fa fhp is no longer valid .El -.El .Sh SEE ALSO .Xr fhstat 2 , .Xr fhlink 2 , diff --git a/lib/libsys/getfh.2 b/lib/libsys/getfh.2 index a03a3394aabb..d16a34da4f28 100644 --- a/lib/libsys/getfh.2 +++ b/lib/libsys/getfh.2 @@ -212,6 +212,7 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.El .Sh SEE ALSO .Xr fhopen 2 , .Xr open 2 , diff --git a/lib/libsys/procctl.2 b/lib/libsys/procctl.2 index 049568c5fc09..cdb379696401 100644 --- a/lib/libsys/procctl.2 +++ b/lib/libsys/procctl.2 @@ -712,6 +712,7 @@ following statuses: The status is or-ed with the .Va PROC_KPTI_STATUS_ACTIVE in case KPTI is active for the current address space of the process. +.El .Sh NOTES Disabling tracing on a process should not be considered a security feature, as it is bypassable both by the kernel and privileged processes, diff --git a/lib/libsys/ptrace.2 b/lib/libsys/ptrace.2 index ae1770315aa5..9b789a0e45b3 100644 --- a/lib/libsys/ptrace.2 +++ b/lib/libsys/ptrace.2 @@ -830,7 +830,7 @@ value. If the system call completed in an unusual fashion, .Va sr_error is set to a negative value: -.Bl -tag -width Dv EJUSTRETURN -compact +.Bl -tag -width EJUSTRETURN -compact .It Dv ERESTART System call will be restarted. .It Dv EJUSTRETURN diff --git a/lib/libsys/swapon.2 b/lib/libsys/swapon.2 index 78fc94eb6e34..d7694ed48c8e 100644 --- a/lib/libsys/swapon.2 +++ b/lib/libsys/swapon.2 @@ -34,8 +34,9 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.It vm/vm_param.h -.It vm/swap_pager.h +.In vm/vm_param.h +.In vm/swap_pager.h +.Pp .In unistd.h .Ft int .Fn swapon "const char *special" From nobody Fri Sep 20 14:59:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsJ6JJkz5XT6Y; Fri, 20 Sep 2024 14:59: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 4X9FsJ5kzfz4NQL; Fri, 20 Sep 2024 14:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hWupKmhI2fh8/ktarGettIikORqhhLTFZa7wsv0qXBI=; b=CPqhbanMkp9U2bFA0jGOE92kKomV5FXh+PwSER9avnpsY69YD8wU90XMoiRRoY32XtoJWK gsJkJjINg3shET83HRZupNyMpbH72q3mV/NaAYo7ehT+xD1BW3/cqxV+OkEICAW/5e102I SjSiTrVzUiv+AOAQEZhQpd0bmA3hlOSD+SmitfBnPg199JTG5MGygUVqFjbeQ6zFuNLzrL R9rY6TmwBtmydCzJsXBUrzMPvgld3tFdkjxBR9Ke/p0/9fcnZ6fi90x7x3rVKdgm4sfxNA D5HZxzMqpm68dfpRTA+q0n/8YughMK3l5URo0iBkxBTgy0RyA0UF0dJX+a3E1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844356; a=rsa-sha256; cv=none; b=LsGXLsBNp/reYOevX1UpxxymNmqJjlDAEKu1CGtqo3ZAGrz4Xo0d54BHENzjQFJisGpUq6 YBRSVyhM9O6fn5z2Fj9hMri57DIq5m/4DO5mgsezNCHi/GtUP4GvVTVPNSmpkXmR/3txR6 pu2ltn9TaPEm3yDg1ZAzY86Rvf/ULYyU90Teto0hGSlK2OGIuUteuq5c3KLVTD5vDZ1J0m UpDbOMCf/Xy7FO3X7MbbB7zeiuOg8xtpGGDHspLvwdoh4OG5dR6QBKc/WLzWJuw6bzNiCp XyH3fbOStGeC1lv4rpyb7YIXlNhHdk/Iiq+Db0SKR/FCEWE5SbaVE98OLsAV1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hWupKmhI2fh8/ktarGettIikORqhhLTFZa7wsv0qXBI=; b=cA06dhCrmMUaswXnjKYjuoy/Dthi1QXtFp/RoHC68ofGSwKFml2BAh+bOVk8IwtmS+LB+J CqNVUH3KUHoycJaCgyKQTD3wRuYZwnkkE1UULmHK3zancrlUyLiJAkUDydnMgyB2FFjPMJ dQHQAprF+NHfKiFZZJBIlm7GE7+Xfr9I/mYLsUvVr6tXQL1SfZxWQkc+c9q8NLvar5j/vs YvF9fGtWq4ouC9760DH4OGe91CcyB0x0/FrHGxArkbTj9nnIuwF5nkpl4LKBASgvrZ2Rmo 6vVS0/fZ8ughdi5iY+a4HG8WUrA1irWJH8aMOCbIXxXWMM1Yd0++81G0PV6ERg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsJ5Fmpzv3t; Fri, 20 Sep 2024 14:59: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 48KExGgF046571; Fri, 20 Sep 2024 14:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExGxi046568; Fri, 20 Sep 2024 14:59:16 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:16 GMT Message-Id: <202409201459.48KExGxi046568@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: fe3f792f9a29 - main - Add build option for the ia32 loader List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe3f792f9a2982678138e239f5e8d66e8ee71aeb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fe3f792f9a2982678138e239f5e8d66e8ee71aeb commit fe3f792f9a2982678138e239f5e8d66e8ee71aeb Author: Ahmad Khalifa AuthorDate: 2024-05-14 19:27:06 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:05 +0000 Add build option for the ia32 loader In preparation for supporting 64-bit machines with 32-bit UEFI firmware, add a build option for compiling the ia32 loader. Currently unused. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- share/mk/src.opts.mk | 5 +++++ tools/build/options/WITHOUT_LOADER_IA32 | 1 + tools/build/options/WITH_LOADER_IA32 | 1 + 3 files changed, 7 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 179b444a8ec7..f9d94ab663b0 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -132,6 +132,7 @@ __DEFAULT_YES_OPTIONS = \ LOADER_OFW \ LOADER_PXEBOOT \ LOADER_UBOOT \ + LOADER_IA32 \ LOCALES \ LOCATE \ LPR \ @@ -330,6 +331,10 @@ BROKEN_OPTIONS+=LOADER_KBOOT .if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le" BROKEN_OPTIONS+=LOADER_UBOOT .endif +# The 32-bit UEFI loader is only for amd64 +.if ${__T} != "amd64" +BROKEN_OPTIONS+=LOADER_IA32 +.endif # GELI and Lua in loader currently cause boot failures on powerpc. # Further debugging is required -- probably they are just broken on big # endian systems generically (they jump to null pointers or try to read diff --git a/tools/build/options/WITHOUT_LOADER_IA32 b/tools/build/options/WITHOUT_LOADER_IA32 new file mode 100644 index 000000000000..2df947216b8f --- /dev/null +++ b/tools/build/options/WITHOUT_LOADER_IA32 @@ -0,0 +1 @@ +Do not build the 32-bit UEFI loader. diff --git a/tools/build/options/WITH_LOADER_IA32 b/tools/build/options/WITH_LOADER_IA32 new file mode 100644 index 000000000000..2030619dbb85 --- /dev/null +++ b/tools/build/options/WITH_LOADER_IA32 @@ -0,0 +1 @@ +Build the 32-bit UEFI loader. From nobody Fri Sep 20 14:59:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsL1BK5z5XT8f; Fri, 20 Sep 2024 14:59: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 4X9FsK6sRKz4NT0; Fri, 20 Sep 2024 14:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WbCyf2RYWMYwxg470oEHlA1zJ8LokzasWRSU1xTefk0=; b=siCoTByLvFdAD4RkJw+0MXgvh6pjA612o+Z9G5aKCI2ls5FXQNJe8oIWpAWs/86jvck2dF 3TAElYFUKfttj+YSXUrOe6wF13qUtPpheCNINBCHkYyzoMWJDBuIoTZB+HkTpAjGt5SMz/ 4ZtMbb0GyWBnYGKgBlLIEQrH/3pzYf6J+Wr+Niu7eS6095R/5rc2VU3gGe4W/vWE4iBedP iS+vBpm/PrrfX9KQJXJohnqDjwQ1o6fGNe4Nnx/U/OOM8DtaWjqv6AQ4HSI2EzXCzNSROp 3ovIs1vAmjFifaHazF1BHZ9gRBUosmFdA+4bh7aAM443/MkyEBcG8c2MZuVEWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844358; a=rsa-sha256; cv=none; b=PMS3rb0TqRAAmy2CzTv/ZVx0Y8Yq/BFxWv4x+1hpiw1Zk+OZp4Yncklp56QUg56wwepM9k 2s6H4Wr0yjmCQOR0bvy2uPLR7MZcoWl51uCwMSuhzbS6GXtB+0f9ucxH+XyLYO7rDLSX7z tLcYNPhP3ssR+wH8SMZDNnMZ2HiKxlcaO2E6KvksdehCVbWGZT+taUatq3LJQ06AHHs4Da hQn92h0V6au4sBlOWAdA1JXShsHDRNdQ86aIXTblZg1qOSPECLQUiwFKex0+6tzIZCXNKv NDhLk4c0753nt9TJUftpJOfjdPjnwYbyUtGkH9H5xpg9zfQZ1Aa15G/LWvVVnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WbCyf2RYWMYwxg470oEHlA1zJ8LokzasWRSU1xTefk0=; b=q6QTVJHz3g3wX3R5UHoaP/ER1WIhc3TIWthWeufDme8ZvpUBBzS/2NW61lKScfDKiJU5/a xrsnMMw6P5WO0+tZEiQGqRZN9FbJZ9gm0eoEbQbi6X8zB77PgZatYNrF/vKNlUJ5AQ89qh 6DRVGSHe54iNnMK+ANPotr9YWfB0qGbj/2xJ2YWosXGhmnnyMOdBp94Qstp/oxlRh3DcxX BqB1ox2FUJwr/o+rm7bFtKK1u/fYP3kl/SKpOGIX4SgHZ9nX6iMNej312Q/6ElqLMvjKrO D3GTKJHac1wisVaOf9NpZ3UuJIyxM4nKaqJFMqIXPLQt7teFe30Kr3s+ebfRVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsK67kWzv7N; Fri, 20 Sep 2024 14:59: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 48KExHAw046623; Fri, 20 Sep 2024 14:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExHBL046620; Fri, 20 Sep 2024 14:59:17 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:17 GMT Message-Id: <202409201459.48KExHBL046620@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: f0d5b1bdf075 - main - stand/efi: Add a 32-bit variant of libefi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0d5b1bdf075c68ddb1dcfbc5a0eda0214510b5b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f0d5b1bdf075c68ddb1dcfbc5a0eda0214510b5b commit f0d5b1bdf075c68ddb1dcfbc5a0eda0214510b5b Author: Ahmad Khalifa AuthorDate: 2024-05-14 19:37:13 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:05 +0000 stand/efi: Add a 32-bit variant of libefi In preparation for supporting 64-bit machines with 32-bit UEFI firmware, add a 32-bit variant of libefi since we need to compile both the 64-bit version and the 32-bit version at the same time. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- stand/Makefile | 1 + stand/defs.mk | 10 +++++++--- stand/efi/Makefile | 1 + stand/efi/libefi32/Makefile | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/stand/Makefile b/stand/Makefile index 225113384b13..ce91802d4a8b 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -66,6 +66,7 @@ SUBDIR_DEPEND_${MACHINE}+= libofw SUBDIR+=${_x} .if defined(LIB32LIST) && ${LIB32LIST:M${_x}} SUBDIR+=${_x}32 +INTERP_DEPENDS+=${_x}32 .endif .if ${_x} != "libsa" SUBDIR_DEPEND_${_x}+= libsa diff --git a/stand/defs.mk b/stand/defs.mk index bd19c8d8e125..0e84df0f4633 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -40,7 +40,14 @@ WARNS?= 1 BOOTSRC= ${SRCTOP}/stand EFISRC= ${BOOTSRC}/efi EFIINC= ${EFISRC}/include +# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is +# built 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here +# and activate it when DO32 is explicitly defined to be 1. +.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 +EFIINCMD= ${EFIINC}/i386 +.else EFIINCMD= ${EFIINC}/${MACHINE} +.endif FDTSRC= ${BOOTSRC}/fdt FICLSRC= ${BOOTSRC}/ficl LDRSRC= ${BOOTSRC}/common @@ -130,9 +137,6 @@ CFLAGS+= -m32 -mcpu=powerpc -mbig-endian CFLAGS+= -m32 -mcpu=powerpc -mlittle-endian .endif -# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is -# build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here -# and activate it when DO32 is explicitly defined to be 1. .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 CFLAGS+= -m32 # LD_FLAGS is passed directly to ${LD}, not via ${CC}: diff --git a/stand/efi/Makefile b/stand/efi/Makefile index c6ef92b26838..1a9cf68749a1 100644 --- a/stand/efi/Makefile +++ b/stand/efi/Makefile @@ -3,6 +3,7 @@ NO_OBJ=t .include SUBDIR.yes+= libefi +SUBDIR.${MK_LOADER_IA32}+= libefi32 SUBDIR.${MK_FDT}+= fdt SUBDIR.yes+= .WAIT diff --git a/stand/efi/libefi32/Makefile b/stand/efi/libefi32/Makefile new file mode 100644 index 000000000000..779c7e604686 --- /dev/null +++ b/stand/efi/libefi32/Makefile @@ -0,0 +1,4 @@ +DO32=1 + +.PATH: ${.CURDIR}/../libefi +.include "${.CURDIR}/../libefi/Makefile" From nobody Fri Sep 20 14:59:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsN2jHpz5XT43; Fri, 20 Sep 2024 14:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9FsN1qVlz4NkX; Fri, 20 Sep 2024 14:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbxXiAyCqBS0WvWYwRqkBtPKQ0Ec7CVNEipBvi1y2sE=; b=ICva4Nyrd6zDPBxXtPGN13QwAu3L3vXkzRYbouCR8ftcKx1J1izaOq7bngeXxdQgqy2C5B KbIKNqX6rXplIINTQsfi7+cEwvKHKMfB/ZXnoQjGOIwQGbnRf5/GdYPfF50Ky/hGwX2zXr 4Xr+qXakV1GIB6pTJZPWKIWDTKVf61SrOAHMZAi/ydqKO9sHGDnlMGCiorwDe8CrqWPQTh h9reUkvkn0xPK5P8hazwNRgEep4Sp7+AZi1CwLE5gJ/f9cWKU6kjzin8+bL20XO+tYD+nK i4gWUleD44gYa294a0xsMOU8vvvoheKLZ/FmQXZjjSkN0FeZjOSctj7V3hp2Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844360; a=rsa-sha256; cv=none; b=H7m2wd+kptOlZDvthH/K3JqCrQUHNorifenOMlnD7bI133QRoOIWKd8EvMEkJXq/ctGDGb JOJAKQMAh94OXZcwFulm8WBjXmvidIZ+eCGuT9iinloA0Acuggzc+o9KlqJMuDaJKsQwsq REFwAJgF9TrPAFWotwEXRDNJn00xp1m/GWwE8ShIaQzMP19Bch2fXLaJ6CaGvd3qL3fwen kS4As91NeSWa/P4LOKEoLZiBkq/ll6Ts4CRbwtAdVUxMI7oSz/FYx74nlhtsbWLt9e6iQJ GcUvLTIiknjM8WG4jhINEQx/PDhkak72mc60+qJrpzjxdpkQpv1rPnDQRiCnAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbxXiAyCqBS0WvWYwRqkBtPKQ0Ec7CVNEipBvi1y2sE=; b=lfBHAjieK9bz1PKrGnoRg2LExEPKk1NsJNYjmR78q6xHLnlBLO0a7z7LDlmcno25Mj1Fqv iRTMrvUThYfawD76qUVJTQzKP6gInahsdcRo1Xdpb2Q0A7fn2ZP82V6IrLskp/bhxYCANO b2sB8HCNh4iBUjvty6c1HPLAl6DZG8ZQTODCaM/nnCOSRL5zpWu4jepD7F+3HjQTVRU79U k4fLbCwVgFSXtY6icm09Man3uiy3J7mj4eNYbF7g/kHZzqheZejfuF8FxReM/CuR2Wkis8 RXDIPTj2ZhQBHKsdaDm35MWrWI0stn3N51Bbybwb5uy1Z3kF1eXAApReABSeRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsN0TpJzv7P; Fri, 20 Sep 2024 14:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KExKDw046701; Fri, 20 Sep 2024 14:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExKxF046698; Fri, 20 Sep 2024 14:59:20 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:20 GMT Message-Id: <202409201459.48KExKxF046698@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: 6818ff7797c6 - main - loader: Fix 32-bit compatibility List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6818ff7797c6a9ab104e5d7e91d4e422874bf50d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6818ff7797c6a9ab104e5d7e91d4e422874bf50d commit 6818ff7797c6a9ab104e5d7e91d4e422874bf50d Author: Ahmad Khalifa AuthorDate: 2024-05-14 19:29:08 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:07 +0000 loader: Fix 32-bit compatibility main.c - Fix rsdp cast. framebuffer.c - - Use temp variable instead of directly passing pointer when EFI_PHYSICAL_ADDRESS is expected. Also fix FreePages cast. - Mask framebuffer address given to us by UEFI. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- stand/efi/loader/framebuffer.c | 21 +++++++++++++++------ stand/efi/loader/main.c | 3 ++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index c954a2471340..ea4131b751c8 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -149,7 +149,16 @@ efifb_from_gop(struct efi_fb *efifb, EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *mode, { int result; - efifb->fb_addr = mode->FrameBufferBase; + /* + * The Asus EEEPC 1025C, and possibly others, + * require the address to be masked. + */ + efifb->fb_addr = +#ifdef __i386__ + mode->FrameBufferBase & 0xffffffff; +#else + mode->FrameBufferBase; +#endif efifb->fb_size = mode->FrameBufferSize; efifb->fb_height = info->VerticalResolution; efifb->fb_width = info->HorizontalResolution; @@ -555,6 +564,7 @@ efi_has_gop(void) int efi_find_framebuffer(teken_gfx_t *gfx_state) { + EFI_PHYSICAL_ADDRESS ptr; EFI_HANDLE *hlist; UINTN nhandles, i, hsize; struct efi_fb efifb; @@ -651,16 +661,15 @@ efi_find_framebuffer(teken_gfx_t *gfx_state) efifb.fb_mask_blue | efifb.fb_mask_reserved); if (gfx_state->tg_shadow_fb != NULL) - BS->FreePages((EFI_PHYSICAL_ADDRESS)gfx_state->tg_shadow_fb, + BS->FreePages((uintptr_t)gfx_state->tg_shadow_fb, gfx_state->tg_shadow_sz); gfx_state->tg_shadow_sz = EFI_SIZE_TO_PAGES(efifb.fb_height * efifb.fb_width * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, - gfx_state->tg_shadow_sz, - (EFI_PHYSICAL_ADDRESS *)&gfx_state->tg_shadow_fb); - if (status != EFI_SUCCESS) - gfx_state->tg_shadow_fb = NULL; + gfx_state->tg_shadow_sz, &ptr); + gfx_state->tg_shadow_fb = status == EFI_SUCCESS ? + (uint32_t *)(uintptr_t)ptr : NULL; return (0); } diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index e4d62f2e940c..69fee3128569 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -920,7 +921,7 @@ acpi_detect(void) if ((rsdp = efi_get_table(&acpi)) == NULL) return; - sprintf(buf, "0x%016llx", (unsigned long long)rsdp); + sprintf(buf, "0x%016"PRIxPTR, (uintptr_t)rsdp); setenv("acpi.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) From nobody Fri Sep 20 14:59:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsM3cCmz5XSw9; Fri, 20 Sep 2024 14:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9FsM0KXWz4NW9; Fri, 20 Sep 2024 14:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nd8f+lWPv4WMl7ktoqSHxl6L0u14XDuEzrYk36DOdQY=; b=UPVE5U00OYj8kEDzSj2EgXRhwovtBKejPjLS9kUgW1MyuLCzn7h2LuZ7DploWu3hWAsLap Q8KTSwXvA5Xltfad1NMQr9DdNFv5fToe+VYmjfGFZEMt7DZoIP4YktfHvxhUdjqsU5MHvj gopJK2AIxbMMMDsKAwUL5cwznNUV4fYOvW1bvjf06D8e5lwYqmoTiKxm87COYmv0XfvsTc GO0XL0RFyEYuUEdEqeEeBiznrwdwWQRgIX23qPTDDOuBB/AMQ5wN40+vcHqoIvooC8Zamy 9KMu05TbQxFdNu/X3JhoyZmhbyFC5vL3Y8NlfzKwgDCT3LZaQ2nZP8Tgf/0fQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844359; a=rsa-sha256; cv=none; b=NsCFjT6guNFa/9YBQrVpBpFffN9cfh1LNuIbKyR57CZNLkweubFDGkOajH5INSd8I14m/f 2KQm3Sylb3oMPQO0LGO2I6YgGNaI7Sh+fpGHqtISSx14wJHIl3A1KvD0WiebYaag2ai6Xw ElnnYt0WJllpZ5sGHFpprRbhlrjdWh3BKLnEgev2Rvvgv42+fEqlaTvnKdLkOkQU7aV9lA 6D4OU/6He22YZIUQ/KiwpU4cRgBA5X7MjnWV2T+AfYzAn/iPdZqB+ykDNJtGinMUMmjl1E 2p7t+0c3hZ5IBXF45k2F8dKG1cWxkpebHW6YyHAgUTlz6KWrlfKZOaUoL8wgTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nd8f+lWPv4WMl7ktoqSHxl6L0u14XDuEzrYk36DOdQY=; b=mDpGql3kK39yVFvqd9Y20zMBnWvCBnZmeHJ0Xd5LMFZ0l1KNhypCrWFl773/Dg/Da6ucFI epK/vRVCVIwr44H9ldP2P4+YQmUyDedboBzG84SsVclGnxmsDqi0AqZZ7Hm7FZEhN7woh8 j9HDxPEYVCLn1qVKrxsKJoh/H6YWe+oD1iZ3ay+BOK7OuNkiesUqzH9DjJ9oZ2glN04k4w b8Gd88Wj9c76nMwZa3xsrFtJDOPqG5KRIsX4ejcr2IicxegF56LdbtSwN02N7MpB1Lvbbp Z6Jn57Mz8wVRRDCMsu5ZtiOnKbNA3GZ+2/hwrd9gjII8P8G+7uRVs7kUYUKH0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsL6wVnzv54; Fri, 20 Sep 2024 14:59: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 48KExIaU046662; Fri, 20 Sep 2024 14:59:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExIZV046659; Fri, 20 Sep 2024 14:59:18 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:18 GMT Message-Id: <202409201459.48KExIZV046659@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: 95f75b0e6e5f - main - loader: Fix shadow_fb allocation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95f75b0e6e5f71d34e4eef151f43822e33838663 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=95f75b0e6e5f71d34e4eef151f43822e33838663 commit 95f75b0e6e5f71d34e4eef151f43822e33838663 Author: Ahmad Khalifa AuthorDate: 2024-05-31 09:41:32 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:06 +0000 loader: Fix shadow_fb allocation Using AllocateMaxAddress here means that gfx_state->tg_shadow_fb is treated as the highest address we can receive. Since gfx_state->tg_shadow_fb is NULL, we never receive anything. Use AllocateAnyPages instead. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- stand/efi/loader/framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index 2f580309c2f3..c954a2471340 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -656,7 +656,7 @@ efi_find_framebuffer(teken_gfx_t *gfx_state) gfx_state->tg_shadow_sz = EFI_SIZE_TO_PAGES(efifb.fb_height * efifb.fb_width * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); - status = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, + status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, gfx_state->tg_shadow_sz, (EFI_PHYSICAL_ADDRESS *)&gfx_state->tg_shadow_fb); if (status != EFI_SUCCESS) From nobody Fri Sep 20 14:59:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsP2V5Dz5XT8j; Fri, 20 Sep 2024 14:59: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 4X9FsP1v2Yz4Nkl; Fri, 20 Sep 2024 14:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KvfM5uKbg+FUpVoZCL0zHXvPJDh2hPqMRwyPn3BP80I=; b=USjwItJ5CEfzbOOyly0Qm4zbgJovkd3ZDNsu2+V3jQNY0fCx7m84mPqO3Y2PyVfK+3chgB topHXkIZsdAlOhmBqGhVtVpxFMa76/CPBtsCu8O37Z6kRmtNWB5rxDfjkerFkN5N8DmD3k b8zCfX1p0IzJIMvsEGnw7IV35qR3V4lpy4Qv7ZAhcabyNyCyDlxr0MwOJ76xbrayFLed5M jcUsR/xs4ml6byRGTHlrZ1ql7U8C+XKmvoPW4185bSIBKcd9c/XLPEGcrlBK9Z7YohyInb OHA55MBU5+xRePAJhgdNnN1oktizYLUyHpyfLLkBlPCv2n4xZjLInyJDhMW10w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844361; a=rsa-sha256; cv=none; b=bQ+bavhEC2ECByXARQXyK5mJqcYBOkap2QgvixWONYpvwApYs25vsnkWmEXWYPiP//3dtH 4MC8Si534s39sPgmt/+SQjVd3oYpA5oyxhwogmmiqzIkn6wM5U725wyvUzwn57hzI9baEm tq7noAMdiQeWfPVD7qh48riG1Ajx/QF5GZzjZeMYTKM252fDMIlHpMcq/Vfpg6MRth8NVV 7d8PJrI/rqkEEfjXgBBVrcYfvvSEIpruxKRL/wmdxiHckwUUOsWLtDR0dvbLhL5uFZv8yC a9Vf8d06T3dE0qpLoW0JWUwAbtih4FbLWOBwec82unJ8eeH69E4w2a34O5TZFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KvfM5uKbg+FUpVoZCL0zHXvPJDh2hPqMRwyPn3BP80I=; b=SRyvvTeLoraJ+A4lOVgblQ2u2qxqWZBZPPl6aplLcdxJGkKe27Yjry4B6WXR6HitPBpmRA jUrYx12zO+KKPiXzWH2OYCXP7JvT1kIVPeiXWh+U5r8xxw/IB65C50HJRWQKyT2zvOfhm5 BjV+8nXUmKaQcKI/fngfTZnDMeqQ1UUX7Ya4C93LLf3detmmur4o8r4TXyHe4uPFqDuuoH bR66yHrWCeZqvmUdXzSaOq81UdDoKPdUlTtF8t/C2K61cDVTnZUFpLTGCdbs5ymADSDM14 5pDU16U1FTZLh/ZFIZcew9Z6/YFL0ZfNLloJSUcLWE3rj3jPwIQG/LrJgOJbfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsP1KzjztlL; Fri, 20 Sep 2024 14:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KExL18046758; Fri, 20 Sep 2024 14:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExLwl046755; Fri, 20 Sep 2024 14:59:21 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:21 GMT Message-Id: <202409201459.48KExLwl046755@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: f8ca5d45c3c1 - main - stand: Add support for 64-bit machines with 32-bit UEFI implementations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8ca5d45c3c1829759ecd87cb95d53e5ab7d0811 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8ca5d45c3c1829759ecd87cb95d53e5ab7d0811 commit f8ca5d45c3c1829759ecd87cb95d53e5ab7d0811 Author: Ahmad Khalifa AuthorDate: 2024-05-14 19:40:06 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:08 +0000 stand: Add support for 64-bit machines with 32-bit UEFI implementations Some machines have 64-bit capable cpus but are stuck on 32-bit uefi firmware. Add support for them by building a new "loader_ia32" with LOADER_DEFAULT_INTERP along with the 64-bit one. The loader can be disabled using MK_LOADER_IA32. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- stand/common/bootstrap.h | 2 +- stand/common/load_elf.c | 4 +- stand/efi/Makefile | 1 + stand/efi/Makefile.inc | 4 + stand/efi/loader/Makefile | 24 ++- stand/efi/loader/arch/i386/Makefile.inc | 9 + stand/efi/loader/arch/i386/amd64_tramp.S | 100 +++++++++++ stand/efi/loader/arch/i386/elf64_freebsd.c | 274 +++++++++++++++++++++++++++++ stand/efi/loader/arch/i386/i386.ldscript | 55 ++++++ stand/efi/loader/arch/i386/setup.c | 51 ++++++ stand/efi/loader/arch/i386/start.S | 75 ++++++++ stand/efi/loader/bootinfo.c | 13 +- stand/efi/loader/conf.c | 4 +- stand/efi/loader/copy.c | 18 +- stand/efi/loader/loader_efi.h | 2 +- stand/efi/loader/main.c | 2 +- stand/efi/loader_ia32/Makefile | 6 + 17 files changed, 621 insertions(+), 23 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index 09c4832f5855..ab1e5249fc2a 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -239,7 +239,7 @@ struct preloaded_file size_t f_size; /* file size */ struct kernel_module *f_modules; /* list of modules if any */ struct preloaded_file *f_next; /* next file */ -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) bool f_kernphys_relocatable; #endif #if defined(__i386__) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 8877e5f8b7e0..eaa6bef6ee86 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -217,7 +217,7 @@ static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) } #endif -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) static bool is_kernphys_relocatable(elf_file_t ef) { @@ -491,7 +491,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, /* Load OK, return module pointer */ *result = (struct preloaded_file *)fp; err = 0; -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) fp->f_kernphys_relocatable = multiboot || is_kernphys_relocatable(&ef); #endif #ifdef __i386__ diff --git a/stand/efi/Makefile b/stand/efi/Makefile index 1a9cf68749a1..1887b9536a5b 100644 --- a/stand/efi/Makefile +++ b/stand/efi/Makefile @@ -11,6 +11,7 @@ SUBDIR.yes+= boot1 gptboot SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua +SUBDIR.${MK_LOADER_IA32}+= loader_ia32 SUBDIR.yes+= loader_simp .include diff --git a/stand/efi/Makefile.inc b/stand/efi/Makefile.inc index 18751f0e4ecc..b5bd341d1b78 100644 --- a/stand/efi/Makefile.inc +++ b/stand/efi/Makefile.inc @@ -18,7 +18,11 @@ CFLAGS+= -fPIC .endif .if ${MACHINE_CPUARCH} == "amd64" +.if ${DO32:U0} == 1 +EFI_TARGET= efi-app-ia32 +.else EFI_TARGET= efi-app-x86_64 +.endif .else EFI_TARGET= binary .endif diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index 8f6802831824..ae25910da2c5 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -6,7 +6,13 @@ LOADER_EXT2FS_SUPPORT?= no .include +.if ${MACHINE} == "amd64" && ${DO32:U0} == 1 +__arch= i386 +LOADER?= loader_ia32 +.else +__arch= ${MACHINE} LOADER?= loader_${LOADER_INTERP} +.endif PROG= ${LOADER}.sym INTERNALPROG= WARNS?= 3 @@ -52,13 +58,13 @@ CFLAGS.gfx_fb.c += -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib CWARNFLAGS.main.c+= -Wno-format .PATH: ${.CURDIR}/../loader -.PATH: ${.CURDIR}/../loader/arch/${MACHINE} -.include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc" +.PATH: ${.CURDIR}/../loader/arch/${__arch} +.include "${.CURDIR}/../loader/arch/${__arch}/Makefile.inc" CFLAGS+= -I${.CURDIR} -CFLAGS+= -I${.CURDIR}/arch/${MACHINE} +CFLAGS+= -I${.CURDIR}/arch/${__arch} CFLAGS+= -I${EFISRC}/include -CFLAGS+= -I${EFISRC}/include/${MACHINE} +CFLAGS+= -I${EFISRC}/include/${__arch} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DEFI @@ -95,11 +101,11 @@ CLEANFILES+= 8x16.c FILES+= ${LOADER}.efi FILESMODE_${LOADER}.efi= ${BINMODE} -.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} && ${__arch} != "i386" LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi .endif -LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/${MACHINE}.ldscript +LDSCRIPT= ${.CURDIR}/../loader/arch/${__arch}/${__arch}.ldscript LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie .if ${LINKER_TYPE} == "bfd" && ${LINKER_VERSION} >= 23400 LDFLAGS+= -Wl,--no-dynamic-linker @@ -125,8 +131,14 @@ ${LOADER}.efi: ${PROG} --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a +LIBEFI32= ${BOOTOBJ}/efi/libefi32/libefi.a +.if ${__arch} == "i386" +DPADD= ${LDR_INTERP32} ${LIBEFI32} ${LIBSA32} ${LDSCRIPT} +LDADD= ${LDR_INTERP32} ${LIBEFI32} ${LIBSA32} +.else DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBSAFDT} ${LIBEFI_FDT} ${LIBSA} ${LDSCRIPT} LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBSAFDT} ${LIBEFI_FDT} ${LIBSA} +.endif .include diff --git a/stand/efi/loader/arch/i386/Makefile.inc b/stand/efi/loader/arch/i386/Makefile.inc new file mode 100644 index 000000000000..e27b553c6bab --- /dev/null +++ b/stand/efi/loader/arch/i386/Makefile.inc @@ -0,0 +1,9 @@ +SRCS+= amd64_tramp.S \ + start.S \ + setup.c \ + elf64_freebsd.c + +.PATH: ${BOOTSRC}/i386/libi386 +SRCS+= nullconsole.c \ + comconsole.c \ + spinconsole.c diff --git a/stand/efi/loader/arch/i386/amd64_tramp.S b/stand/efi/loader/arch/i386/amd64_tramp.S new file mode 100644 index 000000000000..06f9262014b3 --- /dev/null +++ b/stand/efi/loader/arch/i386/amd64_tramp.S @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * Copyright (c) 2023 Ahmad Khalifa + * + * This software was developed by Benno Rice 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 + + .text + .globl amd64_tramp + +/* + * void amd64_tramp(uint32_t stack, void *copy_finish, uint32_t kernend, + * uint32_t modulep, uint32_t pagetable, uint32_t gdtr, uint64_t entry) + */ +amd64_tramp: + cli /* Make sure we don't get interrupted. */ + + calll *8(%esp) /* Call copy_finish so we're all ready to go. */ + + movl %cr0, %eax /* Paging may be enabled, disable it. */ + andl $0x7FFFFFFF, %eax + movl %eax, %cr0 + + movl %cr4, %eax /* PAE may be disabled, enable it. */ + orl $0x20, %eax + movl %eax, %cr4 + + movl 20(%esp), %eax /* Swap page tables. */ + movl %eax, %cr3 + + movl $0xC0000080, %ecx /* Enable long mode. */ + rdmsr + orl $0x100, %eax + wrmsr + + movl 12(%esp), %edi /* Stash the kernel and GDT values for later. */ + movl 16(%esp), %esi + movl 24(%esp), %ebx + movl 28(%esp), %edx + movl 32(%esp), %ebp + + movl 4(%esp), %esp /* Switch to our temporary stack. */ + + movl %cr0, %eax /* Enable paging and enter compatibility mode. */ + orl $0x80000000, %eax + movl %eax, %cr0 + + lgdtl (%ebx) /* Load GDT. */ + + pushl %edi /* Push kernend. */ + pushl %esi /* Push modulep. */ + pushl $0x0 + pushl %ebp /* Push 64-bit entry address. */ + pushl %edx + + calll 0f /* Find the address of ".longmode". */ +0: popl %eax + addl $(.longmode-0b), %eax + + pushl $0x8 /* Push CS. */ + pushl %eax /* Push the address. */ + lretl /* "Return" to 64-bit code. */ + + .code64 + +.longmode: + retq /* "Return" to kernel entry. */ + + .code32 + + ALIGN_TEXT +amd64_tramp_end: + + .data + .globl amd64_tramp_size +amd64_tramp_size: + .long amd64_tramp_end-amd64_tramp diff --git a/stand/efi/loader/arch/i386/elf64_freebsd.c b/stand/efi/loader/arch/i386/elf64_freebsd.c new file mode 100644 index 000000000000..ba5117b37016 --- /dev/null +++ b/stand/efi/loader/arch/i386/elf64_freebsd.c @@ -0,0 +1,274 @@ +/*- + * Copyright (c) 1998 Michael Smith + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define __ELF_WORD_SIZE 64 +#include +#include +#include + +#include +#include + +#include "bootstrap.h" + +#include "loader_efi.h" + +extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, + bool exit_bs); + +static int elf64_exec(struct preloaded_file *amp); +static int elf64_obj_exec(struct preloaded_file *amp); + +static struct file_format amd64_elf = { + .l_load = elf64_loadfile, + .l_exec = elf64_exec +}; + +static struct file_format amd64_elf_obj = { + .l_load = elf64_obj_loadfile, + .l_exec = elf64_obj_exec +}; + +struct file_format *file_formats[] = { + &amd64_elf, + &amd64_elf_obj, + NULL +}; + +struct gdtr { + uint16_t size; + uint64_t ptr; +} __packed; + +#define PG_V 0x001 +#define PG_RW 0x002 +#define PG_PS 0x080 + +#define GDT_P 0x00800000000000 +#define GDT_E 0x00080000000000 +#define GDT_S 0x00100000000000 +#define GDT_RW 0x00020000000000 +#define GDT_L 0x20000000000000 + +#define M(x) ((x) * 1024 * 1024) +#define G(x) (1ULL * (x) * 1024 * 1024 * 1024) + +typedef uint64_t p4_entry_t; +typedef uint64_t p3_entry_t; +typedef uint64_t p2_entry_t; +typedef uint64_t gdt_t; + +static p4_entry_t *PT4; +static p3_entry_t *PT3; +static p3_entry_t *PT3_l, *PT3_u; +static p2_entry_t *PT2; +static p2_entry_t *PT2_l0, *PT2_l1, *PT2_l2, *PT2_l3, *PT2_u0, *PT2_u1; +static gdt_t *GDT; + +extern EFI_PHYSICAL_ADDRESS staging; + +static void (*trampoline)(uint32_t stack, void *copy_finish, uint32_t kernend, + uint32_t modulep, uint64_t *pagetable, struct gdtr *gdtr, uint64_t entry); + +extern void *amd64_tramp; +extern uint32_t amd64_tramp_size; + +/* + * There is an ELF kernel and one or more ELF modules loaded. + * We wish to start executing the kernel image, so make such + * preparations as are required, and do so. + */ +static int +elf64_exec(struct preloaded_file *fp) +{ + EFI_PHYSICAL_ADDRESS ptr; + EFI_ALLOCATE_TYPE type; + EFI_STATUS err; + struct file_metadata *md; + struct gdtr *gdtr; + Elf_Ehdr *ehdr; + vm_offset_t modulep, kernend, trampstack; + int i; + + switch (copy_staging) { + case COPY_STAGING_ENABLE: + type = AllocateMaxAddress; + break; + case COPY_STAGING_DISABLE: + type = AllocateAnyPages; + break; + case COPY_STAGING_AUTO: + type = fp->f_kernphys_relocatable ? + AllocateAnyPages : AllocateMaxAddress; + break; + } + + if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) + return (EFTYPE); + ehdr = (Elf_Ehdr *)&(md->md_data); + + /* + * Make our temporary stack 32 bytes big, which is + * a little more than we need. + */ + ptr = G(1); + err = BS->AllocatePages(type, EfiLoaderCode, + EFI_SIZE_TO_PAGES(amd64_tramp_size + 32), &ptr); + if (EFI_ERROR(err)) { + printf("Unable to allocate trampoline\n"); + return (ENOMEM); + } + + trampoline = (void *)(uintptr_t)ptr; + trampstack = ptr + amd64_tramp_size + 32; + bcopy(&amd64_tramp, trampoline, amd64_tramp_size); + + ptr = G(1); + err = BS->AllocatePages(type, EfiLoaderData, + EFI_SIZE_TO_PAGES(sizeof(struct gdtr) + sizeof(uint64_t) * 2), &ptr); + if (EFI_ERROR(err)) { + printf("Unable to allocate GDT\n"); + BS->FreePages((uintptr_t)trampoline, 1); + return (ENOMEM); + } + GDT = (gdt_t *)(uintptr_t)ptr; + GDT[1] = GDT_P | GDT_E | GDT_S | GDT_RW | GDT_L; /* CS */ + GDT[0] = 0; + gdtr = (struct gdtr *)&GDT[2]; + gdtr->size = sizeof(uint64_t) * 2 - 1; + gdtr->ptr = (uintptr_t)GDT; + + if (type == AllocateMaxAddress) { + /* Copy staging enabled */ + + ptr = G(1); + err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, + EFI_SIZE_TO_PAGES(512 * 3 * sizeof(uint64_t)), &ptr); + if (EFI_ERROR(err)) { + printf("Unable to allocate trampoline page table\n"); + BS->FreePages((uintptr_t)trampoline, 1); + BS->FreePages((uintptr_t)GDT, 1); + return (ENOMEM); + } + PT4 = (p4_entry_t *)(uintptr_t)ptr; + + PT3 = &PT4[512]; + PT2 = &PT3[512]; + + /* + * This is kinda brutal, but every single 1GB VM + * memory segment points to the same first 1GB of + * physical memory. But it is more than adequate. + */ + for (i = 0; i < 512; i++) { + /* + * Each slot of the L4 pages points to the + * same L3 page. + */ + PT4[i] = (uintptr_t)PT3 | PG_V | PG_RW; + + /* + * Each slot of the L3 pages points to the + * same L2 page. + */ + PT3[i] = (uintptr_t)PT2 | PG_V | PG_RW; + + /* + * The L2 page slots are mapped with 2MB pages for 1GB. + */ + PT2[i] = (i * M(2)) | PG_V | PG_RW | PG_PS; + } + } else { + err = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, + EFI_SIZE_TO_PAGES(512 * 9 * sizeof(uint64_t)), &ptr); + if (EFI_ERROR(err)) { + printf("Unable to allocate trampoline page table\n"); + BS->FreePages((uintptr_t)trampoline, 1); + BS->FreePages((uintptr_t)GDT, 1); + return (ENOMEM); + } + PT4 = (p4_entry_t *)(uintptr_t)ptr; + + PT3_l = &PT4[512]; + PT3_u = &PT3_l[512]; + PT2_l0 = &PT3_u[512]; + PT2_l1 = &PT2_l0[512]; + PT2_l2 = &PT2_l1[512]; + PT2_l3 = &PT2_l2[512]; + PT2_u0 = &PT2_l3[512]; + PT2_u1 = &PT2_u0[512]; + + /* 1:1 mapping of lower 4G */ + PT4[0] = (uintptr_t)PT3_l | PG_V | PG_RW; + PT3_l[0] = (uintptr_t)PT2_l0 | PG_V | PG_RW; + PT3_l[1] = (uintptr_t)PT2_l1 | PG_V | PG_RW; + PT3_l[2] = (uintptr_t)PT2_l2 | PG_V | PG_RW; + PT3_l[3] = (uintptr_t)PT2_l3 | PG_V | PG_RW; + for (i = 0; i < 2048; i++) { + PT2_l0[i] = ((p2_entry_t)i * M(2)) | PG_V | PG_RW | PG_PS; + } + + /* mapping of kernel 2G below top */ + PT4[511] = (uintptr_t)PT3_u | PG_V | PG_RW; + PT3_u[511] = (uintptr_t)PT2_u1 | PG_V | PG_RW; + PT3_u[510] = (uintptr_t)PT2_u0 | PG_V | PG_RW; + /* compat mapping of phys @0 */ + PT2_u0[0] = PG_PS | PG_V | PG_RW; + /* this maps past staging area */ + for (i = 1; i < 1024; i++) { + PT2_u0[i] = (staging + (i - 1) * M(2)) + | PG_V | PG_RW | PG_PS; + } + } + + printf( + "staging %#llx (%scopying) tramp %p PT4 %p GDT %p\n" + "Start @ %#llx ...\n", staging, + type == AllocateMaxAddress ? "" : "not ", trampoline, PT4, GDT, + ehdr->e_entry + ); + + efi_time_fini(); + err = bi_load(fp->f_args, &modulep, &kernend, true); + if (err != 0) { + efi_time_init(); + return (err); + } + + dev_cleanup(); + + trampoline(trampstack, type == AllocateMaxAddress ? efi_copy_finish : + efi_copy_finish_nop, kernend, modulep, PT4, gdtr, ehdr->e_entry); + + panic("exec returned"); +} + +static int +elf64_obj_exec(struct preloaded_file *fp) +{ + return (EFTYPE); +} diff --git a/stand/efi/loader/arch/i386/i386.ldscript b/stand/efi/loader/arch/i386/i386.ldscript new file mode 100644 index 000000000000..dcbbf1b6d609 --- /dev/null +++ b/stand/efi/loader/arch/i386/i386.ldscript @@ -0,0 +1,55 @@ +OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd") +OUTPUT_ARCH(i386) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0; + ImageBase = .; + . = SIZEOF_HEADERS; + . = ALIGN(4096); + .text : { + *(.text .stub .text.* .gnu.linkonce.t.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.plt) + } =0xCCCCCCCC + . = ALIGN(4096); + .data : { + *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.rodata1) + *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) + *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) + *(.opd) + *(.data .data.* .gnu.linkonce.d.*) + *(.data1) + *(.plabel) + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + } + . = ALIGN(4096); + __gp = .; + .sdata : { + *(.got.plt .got) + *(.sdata .sdata.* .gnu.linkonce.s.*) + *(dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + } + . = ALIGN(4096); + .dynamic : { *(.dynamic) } + . = ALIGN(4096); + .rel.dyn : { + *(.rel.*) + *(.relset_*) + } + . = ALIGN(4096); + .reloc : { *(.reloc) } + . = ALIGN(4096); + .hash : { *(.hash) } + . = ALIGN(4096); + .dynsym : { *(.dynsym) } + . = ALIGN(4096); + .dynstr : { *(.dynstr) } +} diff --git a/stand/efi/loader/arch/i386/setup.c b/stand/efi/loader/arch/i386/setup.c new file mode 100644 index 000000000000..5d15e499ddb3 --- /dev/null +++ b/stand/efi/loader/arch/i386/setup.c @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Ahmad Khalifa + * + * 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 AUTHORS 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 AUTHORS 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 + +/* + * Check for long mode then call efi_main + */ +EFI_STATUS +setup(EFI_HANDLE IH, EFI_SYSTEM_TABLE *ST) { + u_int edx; + + asm("cpuid" : "=d"(edx) : "a"(0x80000001) : "ebx", "ecx"); + if ((edx & AMDID_LM) == 0) { + ST->ConOut->OutputString(ST->ConOut, (CHAR16 *) + L"This CPU doesn't support long mode.\r\n" + L"Unable to proceed.\r\n"); + ST->BootServices->Exit(IH, EFI_UNSUPPORTED, 0, NULL); + } + + return (efi_main(IH, ST)); +} diff --git a/stand/efi/loader/arch/i386/start.S b/stand/efi/loader/arch/i386/start.S new file mode 100644 index 000000000000..2754c81e509c --- /dev/null +++ b/stand/efi/loader/arch/i386/start.S @@ -0,0 +1,75 @@ +/*- + * Copyright (C) 1999 Hewlett-Packard Co. + * Contributed by David Mosberger . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Hewlett-Packard Co. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER 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. + */ + +/* + * crt0-efi-ia32.S - x86 EFI startup code. + */ + + .text + .align 4 + + .globl _start +_start: + pushl %ebp + movl %esp, %ebp + + pushl 12(%ebp) + pushl 8(%ebp) + + call 0f +0: popl %eax + movl %eax, %ebx + + addl $ImageBase-0b, %eax + addl $_DYNAMIC-0b, %ebx + + pushl %ebx + pushl %eax + call self_reloc + popl %ebx + popl %ebx + + call setup + +.exit: + leave + ret + + /* + * hand-craft a dummy .reloc section so EFI knows it's a relocatable + * executable: + */ + + .data + .section .reloc, "a" + .long 0 + .long 10 + .word 0 diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 0a53422142e2..5afb4c78353e 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -185,7 +185,7 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) struct efi_map_header *efihdr; bool do_vmap; -#if defined(__amd64__) || defined(__aarch64__) +#if defined(__amd64__) || defined(__aarch64__) || defined(__i386__) struct efi_fb efifb; efifb.fb_addr = gfx_state.tg_fb.fb_addr; @@ -339,7 +339,16 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) vm_offset_t size; char *rootdevname; int howto; +#ifdef __i386__ + /* + * The 32-bit UEFI loader is used to + * boot the 64-bit kernel on machines + * that support it. + */ + bool is64 = true; +#else bool is64 = sizeof(long) == 8; +#endif #if defined(LOADER_FDT_SUPPORT) vm_offset_t dtbp; int dtb_size; @@ -438,7 +447,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) module = *modulep; file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); #endif -#ifdef EFI +#if defined(EFI) && !defined(__i386__) file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); #endif #ifdef LOADER_GELI_SUPPORT diff --git a/stand/efi/loader/conf.c b/stand/efi/loader/conf.c index 3bc74ea6354c..0a0476873fe1 100644 --- a/stand/efi/loader/conf.c +++ b/stand/efi/loader/conf.c @@ -82,7 +82,7 @@ extern struct console eficom; /* Hack for backward compatibility -- but only for a while */ extern struct console comconsole; #endif -#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) extern struct console comconsole; extern struct console nullconsole; extern struct console spinconsole; @@ -94,7 +94,7 @@ struct console *consoles[] = { #if defined(__aarch64__) && __FreeBSD_version < 1500000 &comconsole, #endif -#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) &comconsole, &nullconsole, &spinconsole, diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index a0aea9823632..d34acea4e876 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -182,13 +182,13 @@ out: #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ - defined(__riscv) + defined(__riscv) || defined(__i386__) #define EFI_STAGING_2M_ALIGN 1 #else #define EFI_STAGING_2M_ALIGN 0 #endif -#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) #define EFI_STAGING_SLOP M(8) #else #define EFI_STAGING_SLOP 0 @@ -209,7 +209,7 @@ efi_copy_free(void) stage_offset = 0; } -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) int copy_staging = COPY_STAGING_AUTO; static int @@ -281,7 +281,7 @@ command_staging_slop(int argc, char *argv[]) COMMAND_SET(staging_slop, "staging_slop", "set staging slop", command_staging_slop); -#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) /* * The staging area must reside in the first 1GB or 4GB physical * memory: see elf64_exec() in @@ -320,7 +320,8 @@ efi_copy_init(void) */ if (running_on_hyperv()) efi_verify_staging_size(&nr_pages); - +#endif +#if defined(__amd64__) || defined(__i386__) staging = get_staging_max(); #endif status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderCode, @@ -380,9 +381,10 @@ efi_check_space(vm_offset_t end) end += staging_slop; nr_pages = EFI_SIZE_TO_PAGES(end - staging_end); -#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) /* - * amd64 needs all memory to be allocated under the 1G or 4G boundary. + * The amd64 kernel needs all memory to be allocated under the 1G or + * 4G boundary. */ if (end > get_staging_max()) goto before_staging; @@ -427,7 +429,7 @@ expand: #if EFI_STAGING_2M_ALIGN nr_pages += M(2) / EFI_PAGE_SIZE; #endif -#if defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) new_base = get_staging_max(); #endif status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderCode, diff --git a/stand/efi/loader/loader_efi.h b/stand/efi/loader/loader_efi.h index 249860aa5e91..c9dfefcd4c74 100644 --- a/stand/efi/loader/loader_efi.h +++ b/stand/efi/loader/loader_efi.h @@ -32,7 +32,7 @@ #include #include -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) enum { COPY_STAGING_ENABLE, COPY_STAGING_DISABLE, diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 69fee3128569..790d5c0ce1ad 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -964,7 +964,7 @@ main(int argc, CHAR16 *argv[]) archsw.arch_getdev = efi_getdev; archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) archsw.arch_hypervisor = x86_hypervisor; #endif archsw.arch_readin = efi_readin; diff --git a/stand/efi/loader_ia32/Makefile b/stand/efi/loader_ia32/Makefile new file mode 100644 index 000000000000..003c75f43948 --- /dev/null +++ b/stand/efi/loader_ia32/Makefile @@ -0,0 +1,6 @@ +DO32=1 +INSTALL_LOADER_HELP_FILE=no + +NEWVERSWHAT?= "EFI loader" amd64-ia32 + +.include "../loader/Makefile" From nobody Fri Sep 20 14:59:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsQ5YFZz5XT22; Fri, 20 Sep 2024 14:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9FsQ49RTz4Nl2; Fri, 20 Sep 2024 14:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zrGCSgwKlcJrZafU9aAuaVfOHiLcsEpOU7dNDbZ5MKU=; b=mU49HpKL/s1IQ+IHdGZF/fzuqZbMyUVOaB2sSyn6qLBGhyLf2/Rl2YF0z60KZwAEqOTqK5 TPwQl3OzhYUcYARj4QynqVQAIzoosUKD8HuHr2mOVv1HHzyvTatRSkelAKXIomph9t2wo4 gUgMCuXnMStQkevoqVRdZpWcDJbvJvYlgvVXm3lJOu0IIK3441/U9HHlJTIhRLF8YoGXfT WFIiD2sYnsGLRAprzait/t3VoTecMB2hAboW2oXPdbb6sfj+rU2uZdTldPtIkkUceRpdCX Hcyw9uPey9za2DqXxmU5V8iWpH9BPczOzOWaZPPL1C++uw6AkGtB5E+EHNVi8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844362; a=rsa-sha256; cv=none; b=iFKEQ3+dg+XYKpqWUg4/hF+KldApRvDc4puyh9DRwAcsAndt4PNgXp3ckbwC31XNpY7flB a464QPKtHLdNPzaQXICqgM76KGbVHmPegDW+nRSDkYT8KofH9d0d7P825DV+9+oR8ODNND TQOeMOvJ2oAZlej6c/qQrQ5KICKoTrUJoEP298aFDJSDSTW5v0b8ReeeLWlzKfjrI7mxnv 5AnnNgBybBv5w6NP+5EogT6vd+Gvm5TbyHYxdhDPwQgx8lUNLby+1x8Sh1urEMb8oymkBe 5pNP+qgMo9MJmJjTLnWBW/YxL2eCAqWelJgsKD+pW3YbtyyaTv4hOnUOw6VQ+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zrGCSgwKlcJrZafU9aAuaVfOHiLcsEpOU7dNDbZ5MKU=; b=HDeBPqXxawiqS+mxfPekEBOuZIgYb7ZC67HD+35dsCagQOA7LLOWlGV8GOOrwEDDq4vR5X 2s7n8OsMooZjitvnlBtOdCynL62RURBqOEAjxKpxNWRUX9PhOBaSH7W8pefFU7diVOj9Mb z+kAmvE7HrEZXSi3JqDu/f3xyiWOxHlP881RKvqdrCkRBzYSL0B2A3v2tufwHbE04lDNT0 gn8aIXxFInkeKBWIFiG0frkR/m6uUml6ub7lnuI8682YVEaX0rMe5aNuK98b/CjwVBxi4b Ys1P6LkK1otywLPtgHMesZ083OpRMUodi9KoAxYONdVtv8GqQ4lQ46NCMqD90Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsQ2db6zv3v; Fri, 20 Sep 2024 14:59: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 48KExMrt046816; Fri, 20 Sep 2024 14:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExMDN046813; Fri, 20 Sep 2024 14:59:22 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:22 GMT Message-Id: <202409201459.48KExMDN046813@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: b538d4911004 - main - Add a new sysctl in order to diffrentiate UEFI architectures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b538d4911004ca541507166b8ec9689d2e87d1aa Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b538d4911004ca541507166b8ec9689d2e87d1aa commit b538d4911004ca541507166b8ec9689d2e87d1aa Author: Ahmad Khalifa AuthorDate: 2024-06-03 01:40:43 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:09 +0000 Add a new sysctl in order to diffrentiate UEFI architectures With the new 32-bit UEFI loader, it's convenient to have a sysctl to figure out how we booted. Can be accessed at machdep.efi_arch Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- stand/efi/loader/bootinfo.c | 8 +++++++- sys/amd64/amd64/machdep.c | 21 +++++++++++++++++++++ sys/x86/include/metadata.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 5afb4c78353e..2961b8b97fb7 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -447,9 +447,15 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) module = *modulep; file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); #endif -#if defined(EFI) && !defined(__i386__) +#ifdef EFI +#ifndef __i386__ file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); #endif +#if defined(__amd64__) || defined(__i386__) + file_addmetadata(kfp, MODINFOMD_EFI_ARCH, sizeof(MACHINE_ARCH), + MACHINE_ARCH); +#endif +#endif #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index f4b3b9702e00..5dbc41553452 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1689,6 +1689,27 @@ SYSCTL_PROC(_machdep, OID_AUTO, efi_map, efi_map_sysctl_handler, "S,efi_map_header", "Raw EFI Memory Map"); +static int +efi_arch_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + char *arch; + caddr_t kmdp; + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + + arch = (char *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_ARCH); + if (arch == NULL) + return (0); + + return (SYSCTL_OUT_STR(req, arch)); +} +SYSCTL_PROC(_machdep, OID_AUTO, efi_arch, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + efi_arch_sysctl_handler, "A", "EFI Firmware Architecture"); + void spinlock_enter(void) { diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h index dbc6d3275e53..b3eb4b16c1ba 100644 --- a/sys/x86/include/metadata.h +++ b/sys/x86/include/metadata.h @@ -34,6 +34,7 @@ #define MODINFOMD_EFI_FB 0x1005 #define MODINFOMD_MODULEP 0x1006 #define MODINFOMD_VBE_FB 0x1007 +#define MODINFOMD_EFI_ARCH 0x1008 struct efi_map_header { uint64_t memory_size; From nobody Fri Sep 20 14:59:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9FsR6Nfqz5XT6l; Fri, 20 Sep 2024 14:59: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 4X9FsR4JTLz4NX5; Fri, 20 Sep 2024 14:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4JG0tX7Nz4i5E65PWpA99hcOJono2UzBcrNGdZMW7vs=; b=nL9sle2C4iO2YNHV1oPoHPQ/l/CxNKXbxoTWS5Ijj17fZh3lBXkrj6FRD0Lc3LaBG47HjO cvdC1n3G42PcDo3PmTJ7I6to7FdWDO64Y+HRkwImSdA30odwfVmC8M+viXdW0ZyFF5yoTo 02FOqZGLmosFOjN/ubP2GAfqdEKe3oXd1hnT8SCJsRYvssdYrRRuzVNfNypN2ElNrq8H07 uGgAMqBqXem/AXJfJe3eroMQ08gtU89kRk3FCrjkKb1oJ7EAr3rILu+FZzRIWT+VusQV3M l24yuI8imUc7ll43T8MnindTVaDsxvm5xcVHem7qON1M8QreE04h0cKgXPirAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726844363; a=rsa-sha256; cv=none; b=yaaSDiFvtunSg5EJ/FRy2Le+uhiwaGT8mpDYMCqBsgLquyid9m8HZpDHdmT3suEO06tYhe e5DPwDJZ1PSJ2ooGqOHWJn5X8jpaU6pZcA57RvYrqr9RaUunG/pcyEdWd89RG6IH2nFYXU 2rm4DroaOWXtyq+7uJy3hicT8D+dj4JJhFWaURSO9GdJ0050IKaJomne2H4vwsnNsETe6m a62Fo4Li28RL4WMIvJiCNg7AEIBsHnmmbQXsdyZfxnIZujC61aZcpGM3yw5BsJf1eiHRvw 7BcqZi58YbwbwuHMrEWkrOQjT9vqYK9i2KcGqwQ2Ge6c+uK5tw93zavgDmRN5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726844363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4JG0tX7Nz4i5E65PWpA99hcOJono2UzBcrNGdZMW7vs=; b=HtE6BxwLiPiZAQKH3BBhkrVP4fCane6OEtyLLu+ADNQ2+X9zmMI7GBOZ8Kqq38SvFBltn/ 0gs+dWhMHb5h/VVP4Z6U8mEDTBxK9Mn7/cFwERiZcTeDssMm/S8yuzp3QfYUCpMLDcM/FQ +p+EJHVfBbR51OT0Fe6z5Ep6apdJR/3B5mpTPyuMQ+I1QtxBjivR3ufDmaOfsZnrPl9eHB DLs1UDXFkmRAfjsNckxxIRc6/JsBFD0VdqyoMuVvzC+blcWu+YrJyY6HLoX64TU5ZbOkh4 ZDxldqDfI/ypsAc2JaNf5xWX3JEl5pBpK5ZKJmaql3wIKxeZHcHRPLIKpAVgkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9FsR3bDpztLC; Fri, 20 Sep 2024 14:59: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 48KExNsw046863; Fri, 20 Sep 2024 14:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KExN7H046860; Fri, 20 Sep 2024 14:59:23 GMT (envelope-from git) Date: Fri, 20 Sep 2024 14:59:23 GMT Message-Id: <202409201459.48KExN7H046860@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: 599273f942b8 - main - Copy the new ia32 loader List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 599273f942b8dc6f957487bb28f36694dab9dad2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=599273f942b8dc6f957487bb28f36694dab9dad2 commit 599273f942b8dc6f957487bb28f36694dab9dad2 Author: Ahmad Khalifa AuthorDate: 2024-06-03 01:53:44 +0000 Commit: Warner Losh CommitDate: 2024-09-20 14:45:10 +0000 Copy the new ia32 loader This handles copying in install-boot.sh and bsdinstall's bootconfig. install-boot.sh: make_esp_file now optionally takes extra arguments so it can copy multiple files. This is used by the amd64 release scripts. make_esp_device also takes an extra optional argument for efibootname. This is currently unused, but it can be used in the future to do something like: make_esp_device loader.efi bootx64 make_esp_device loader_ia32.efi bootia32 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 --- release/amd64/make-memstick.sh | 7 ++++- release/amd64/mkisoimages.sh | 7 ++++- tools/boot/install-boot.sh | 52 +++++++++++++++++++++++++--------- usr.sbin/bsdinstall/scripts/bootconfig | 36 ++++++++++++++--------- 4 files changed, 72 insertions(+), 30 deletions(-) diff --git a/release/amd64/make-memstick.sh b/release/amd64/make-memstick.sh index 4c51d7d65af4..cbb80e971343 100755 --- a/release/amd64/make-memstick.sh +++ b/release/amd64/make-memstick.sh @@ -60,7 +60,12 @@ fi # Make an ESP in a file. espfilename=$(mktemp /tmp/efiboot.XXXXXX) -make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi +if [ -f "${BASEBITSDIR}/boot/loader_ia32.efi" ]; then + make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi bootx64 \ + ${BASEBITSDIR}/boot/loader_ia32.efi bootia32 +else + make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi +fi mkimg -s mbr \ -b ${BASEBITSDIR}/boot/mbr \ diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh index 3cc7a6cc919e..245beb660c3f 100644 --- a/release/amd64/mkisoimages.sh +++ b/release/amd64/mkisoimages.sh @@ -64,7 +64,12 @@ if [ "$1" = "-b" ]; then espfilename=$(mktemp /tmp/efiboot.XXXXXX) # ESP file size in KB. espsize="2048" - make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi + if [ -f "${BASEBITSDIR}/boot/loader_ia32.efi" ]; then + make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootx64 \ + ${BASEBITSDIR}/boot/loader_ia32.efi bootia32 + else + make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi + fi bootable="$bootable -o bootimage=i386;${espfilename} -o no-emul-boot -o platformid=efi" shift diff --git a/tools/boot/install-boot.sh b/tools/boot/install-boot.sh index 332756582137..217bf0ff1457 100755 --- a/tools/boot/install-boot.sh +++ b/tools/boot/install-boot.sh @@ -42,11 +42,10 @@ get_uefi_bootname() { } make_esp_file() { - local file sizekb loader device stagedir fatbits efibootname + local file sizekb device stagedir fatbits efibootname file=$1 sizekb=$2 - loader=$3 if [ "$sizekb" -ge "$fat32min" ]; then fatbits=32 @@ -58,8 +57,25 @@ make_esp_file() { stagedir=$(mktemp -d /tmp/stand-test.XXXXXX) mkdir -p "${stagedir}/EFI/BOOT" - efibootname=$(get_uefi_bootname) - cp "${loader}" "${stagedir}/EFI/BOOT/${efibootname}.efi" + + # Allow multiple files to be copied. + # We do this in pairs, e.g: + # make_esp_file ... loader1.efi bootx64 loader2.efi bootia32 + # + # If the second argument is left out, + # determine it automatically. + shift; shift # Skip $file and $sizekb + while [ ! -z $1 ]; do + if [ ! -z $2 ]; then + efibootname=$2 + else + efibootname=$(get_uefi_bootname) + fi + cp "$1" "${stagedir}/EFI/BOOT/${efibootname}.efi" + + shift; shift || : # Ignore failure to shift + done + makefs -t msdos \ -o fat_type=${fatbits} \ -o sectors_per_cluster=1 \ @@ -70,13 +86,20 @@ make_esp_file() { } make_esp_device() { - local dev file mntpt fstype efibootname kbfree loadersize efibootfile + local dev file dst mntpt fstype efibootname kbfree loadersize efibootfile local isboot1 existingbootentryloaderfile bootorder bootentry # ESP device node dev=$1 file=$2 + # Allow caller to override the default + if [ ! -z $3 ]; then + efibootname=$3 + else + efibootname=$(get_uefi_bootname) + fi + dst=$(basename ${file%.efi}) mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) # See if we're using an existing (formatted) ESP @@ -93,7 +116,6 @@ make_esp_device() { echo "Mounted ESP ${dev} on ${mntpt}" - efibootname=$(get_uefi_bootname) kbfree=$(df -k "${mntpt}" | tail -1 | cut -w -f 4) loadersize=$(stat -f %z "${file}") loadersize=$((loadersize / 1024)) @@ -114,7 +136,7 @@ make_esp_device() { fi fi - if [ ! -f "${mntpt}/EFI/freebsd/loader.efi" ] && [ "$kbfree" -lt "$loadersize" ]; then + if [ ! -f "${mntpt}/EFI/freebsd/${dst}.efi" ] && [ "$kbfree" -lt "$loadersize" ]; then umount "${mntpt}" rmdir "${mntpt}" echo "Failed to update the EFI System Partition ${dev}" @@ -126,24 +148,26 @@ make_esp_device() { mkdir -p "${mntpt}/EFI/freebsd" # Keep a copy of the existing loader.efi in case there's a problem with the new one - if [ -f "${mntpt}/EFI/freebsd/loader.efi" ] && [ "$kbfree" -gt "$((loadersize * 2))" ]; then - cp "${mntpt}/EFI/freebsd/loader.efi" "${mntpt}/EFI/freebsd/loader-old.efi" + if [ -f "${mntpt}/EFI/freebsd/${dst}.efi" ] && [ "$kbfree" -gt "$((loadersize * 2))" ]; then + cp "${mntpt}/EFI/freebsd/${dst}.efi" "${mntpt}/EFI/freebsd/${dst}-old.efi" fi echo "Copying loader to /EFI/freebsd on ESP" - cp "${file}" "${mntpt}/EFI/freebsd/loader.efi" + cp "${file}" "${mntpt}/EFI/freebsd/${dst}.efi" - if [ -n "${updatesystem}" ]; then - existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}//EFI/freebsd/loader.efi") + # efibootmgr won't work on systems with ia32 UEFI firmware + # since we only use it to boot the 64-bit kernel + if [ -n "${updatesystem}" ] && [ ${efibootname} != "bootia32" ]; then + existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}//EFI/freebsd/${dst}.efi") if [ -z "$existingbootentryloaderfile" ]; then # Try again without the double forward-slash in the path - existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}/EFI/freebsd/loader.efi") + existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}/EFI/freebsd/${dst}.efi") fi if [ -z "$existingbootentryloaderfile" ]; then echo "Creating UEFI boot entry for FreeBSD" - efibootmgr --create --label FreeBSD --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + efibootmgr --create --label FreeBSD --loader "${mntpt}/EFI/freebsd/${dst}.efi" > /dev/null if [ $? -ne 0 ]; then die "Failed to create new boot entry" fi diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index bd69195f76ff..618a1966095e 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -109,32 +109,40 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines *) die "Unsupported arch $(uname -m) for UEFI install" esac + + if [ `sysctl -n machdep.efi_arch` == i386 ]; then + ARCHBOOTNAME=ia32 + file=loader_ia32.efi + else + file=loader.efi + fi + BOOTDIR="/efi/boot" BOOTNAME="${BOOTDIR}/boot${ARCHBOOTNAME}.efi" FREEBSD_BOOTDIR="/efi/freebsd" - FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/loader.efi" + FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/${file}" mntpt="$BSDINSTALL_CHROOT/boot/efi" - f_dprintf "Installing loader.efi onto ESP" + f_dprintf "Installing ${file} onto ESP" mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" - cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${FREEBSD_BOOTNAME}" + cp "$BSDINSTALL_CHROOT/boot/${file}" "${mntpt}/${FREEBSD_BOOTNAME}" # - # The following shouldn't be necessary. UEFI defines a way to - # specifically select what to boot (which we do via - # efibootmgr). However, virtual environments often times lack - # support for the NV variables efibootmgr sets. In addition, - # some UEFI implementations have features that interfere with - # the setting of these variables. To combat that, we install the - # default removable media boot file as a fallback if it doesn't - # exist. We don't install it all the time since that can - # interfere with other installations on the drive (like rEFInd). + # UEFI defines a way to specifically select what to boot + # (which we do via efibootmgr). However, if we booted from an ia32 + # UEFI environment, we wouldn't have access to efirt. In addition, + # virtual environments often times lack support for the NV variables + # efibootmgr sets, and some UEFI implementations have features that + # interfere with the setting of these variables. To combat that, we + # install the default removable media boot file if it doesn't exist. + # We don't install it all the time since that can interfere with other + # installations on the drive (like rEFInd). # if [ ! -f "${mntpt}/${BOOTNAME}" ]; then - cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}" + cp "$BSDINSTALL_CHROOT/boot/${file}" "${mntpt}/${BOOTNAME}" fi - if [ "$BSDINSTALL_CONFIGCURRENT" ]; then + if [ "$BSDINSTALL_CONFIGCURRENT" ] && [ "$ARCHBOOTNAME" != ia32 ]; then update_uefi_bootentry fi From nobody Fri Sep 20 15:27:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9GVB6BbWz5XYdL; Fri, 20 Sep 2024 15:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9GVB5Pttz4XJ3; Fri, 20 Sep 2024 15:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726846066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A6yQzmpgQSjAuW37NK8p8h1TKck+kIhy1NPscvmPI0Q=; b=sICuo1LxUM45IfSLhvWxvyM8f8mCzx8NOKLA1mrY07uRNODOuPjST1wXBEz0DdtysWVQs1 fxSCqn0w7ht1pAV/7DdL5bgPN656EBAB+mX4W+cEMm92sZ08oqWqe4BdgIXGNcOOVRxDgm 7z4GtVSuxwhaQ8a668aaGVBIzHiqI1BxMDvB6p3wJQvDE+XGxufmLwa7SdM3qXlWntc5qA c5a/xcp+SjZwdAdNjc5M74V2YYoPpefMjgV2A88uyiR8OCdHUclfb3dx8k5hDTkUt92y2h 7B8Q+azTHN3KdUDMdWkyONw6lOjuLyfRWgKOywdZQo1qosQarWigcJx388wjtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726846066; a=rsa-sha256; cv=none; b=Ukeycmd7nNrl1LSaRO51lftJ/knCahKxF/CQGF0UJIXQ/dD6etz3qdfVWHjS5v1bbJuJN5 Cfw0EN0vjfDhoTXCbggfACZWZSWijEmC5C1lGZMvpvGQE47FC9orPE80DJ81su3JaMTuGY 5NIT/oFWtKnpLT5bnMMcZG5610RdoQ2lb8vR/W779qYQw7q64UNUN25UoUgJqrvf+qrQKe F+Kn0QIBuy8Z9VDLHesuR2dw+zFfvxo5DMQ7Hu5smsHF3XLBo86K5yXwyCPMaxDkXSeme9 O+A0qkVdGTqQy4qvdhRPu+TmJn4Lvf4l0Wmv5+Qa7HC6MSKinlr+L+UBKd0fmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726846066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A6yQzmpgQSjAuW37NK8p8h1TKck+kIhy1NPscvmPI0Q=; b=SxOSssClDGIXqLAUqWUg8VYdnLJNnyDagl9OwY7crR6D9LCYcDei5MkKCG3kjYI9cLzf3g RArMRNSL+BfAqTWK8KJNDehxZQrnkfUUdV/ZFoWot1bClChRF5rUEHx1Rw87bZTdnI7vA1 CFRq/C7rtaH9i5sruMQuSNcbAYMsJSzLu2QvaUlHj+c4pagvnG5Z4IqR+C5ibl3sa07ICa s72ed0RasgmNgBhhHdLXROD7wPZoaBXmzMuBdA4Ct20AIGa3lCX7v8WsCWQtT//osk0IX5 0lUsCbIwU7TaligDXdQiC8vgj/r9D/fVdRemLHhtpy8NwZqX+8Zx1FBWy9itrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9GVB527Czv9p; Fri, 20 Sep 2024 15:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KFRkAK098024; Fri, 20 Sep 2024 15:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KFRkQ4098021; Fri, 20 Sep 2024 15:27:46 GMT (envelope-from git) Date: Fri, 20 Sep 2024 15:27:46 GMT Message-Id: <202409201527.48KFRkQ4098021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 313bd4df8b13 - stable/13 - mips: Allow sysctl hw.machine in capability mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 313bd4df8b1304d9a500f40c6ccb46a2b155fac1 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=313bd4df8b1304d9a500f40c6ccb46a2b155fac1 commit 313bd4df8b1304d9a500f40c6ccb46a2b155fac1 Author: Val Packett AuthorDate: 2024-09-20 15:19:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 15:24:29 +0000 mips: Allow sysctl hw.machine in capability mode This is a direct commit to stable/13. Reviewed by: emaste, manu Differential Revision: https://reviews.freebsd.org/D28703 --- sys/mips/mips/machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/mips/mips/machdep.c b/sys/mips/mips/machdep.c index af05e6adb7a5..877216c25b05 100644 --- a/sys/mips/mips/machdep.c +++ b/sys/mips/mips/machdep.c @@ -102,7 +102,8 @@ #define BOOTINFO_DEBUG 0 char machine[] = "mips"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, 0, "Machine class"); char cpu_model[80]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); From nobody Fri Sep 20 15:58:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9H9G5WqFz5Xg7Q; Fri, 20 Sep 2024 15:58: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 4X9H9G3F43z4drV; Fri, 20 Sep 2024 15:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYMa/O/pwptc7DoyS/0x/Ya1S+pdFRlfc3T7Wfpb1Ow=; b=QQvDtxhHSaoTo29uVElMr4Ek7/Jp0BnnbHKmJVEybUDg61pOtoNopf3m6gAgdMAj4qvVbP JU3NSftdW8vb7gLiji2lk23ptKpT3lHtTCm3jTQT7JvkmgJdKURPbLee+a06zd82/M8RYJ ZLZz2ykjSElHY308dUqLlfHK2zds+MHcaWhvmx0yXMiuRHL0jGw/KcVOHTf5caxNFFtW+0 6Y/pvGJjDEBHoIIPiQmCbrAlqoLnTAHru28EuFzD2bZ5n6cUujcY7kKhNyWsOlHrYKQ8Mk RHfKp9t9UVYYfsVos9r6TFos79hfNeP0+uvNacRhddcB6LTwHTR2UXNPgCdxIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726847890; a=rsa-sha256; cv=none; b=dV+cZJtmwvxe8URWql9cSFryWmPbCEbANIP69f5XUfwjZ7h6NuXnNS3WINhs33zOcDORr3 78IwJWmLjYHWq8ztFn1diLiPgZ+qyVZt2ckhW2Wc8FGlzmNzrjYtkX6KretF/VqF6GM2Vy RqCFpt4B0Auu8uFtRBU09ZrpETVhmAj62v3zNS7HSDplK4y+ARliGcIEpJ9UOEtYWgWvn4 XdmnPKmxfVNRueFeNGiljyHwYhGjXs9HMMLs7BpeOmm/yXzgZrs6dJSLGg+88n1JP3k4EZ b6wNe+Bv1giWfLjTtipGYr5ycgKiCP2rOkCIEL7QdBM6lgBF1J+nBnqQfCqD/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYMa/O/pwptc7DoyS/0x/Ya1S+pdFRlfc3T7Wfpb1Ow=; b=QqlZ4EutsupyibZ6q1gOrKTuD2gGTDiZTfz+2VHXmIRNXe8RmMoXgOYNmOVVC/AKTnz1Nf 0FPC0dvmkRwpfkhH7ENJUUzSzZbgYgY50SjQOB2ZtzSxYp/+zJXXkvtbwuFupAUMV9RvDy iiB5A3/i7wz8mTu4awxpf/BhbvDBlXdIwfYt8ygjwlR175Pn2hBXGaMKdFrnl3fc5OE0tN GN9kkinLoEYlAGrLDxHdXVQl+qe1LWiJGn6JFsa3D2VCcIY9QTQiq/+dfERzy7zf0bl+1V jvszhthHqoxWJRM26I6856ublYqeFzXwU4cYeNdDcWfjBKCb9ROcd8+VjFrcMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9H9G2JdDzvwv; Fri, 20 Sep 2024 15:58: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 48KFwAog048838; Fri, 20 Sep 2024 15:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KFwAEN048834; Fri, 20 Sep 2024 15:58:10 GMT (envelope-from git) Date: Fri, 20 Sep 2024 15:58:10 GMT Message-Id: <202409201558.48KFwAEN048834@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: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94567c8641e235763b5b2926416d89d36654cde1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=94567c8641e235763b5b2926416d89d36654cde1 commit 94567c8641e235763b5b2926416d89d36654cde1 Author: Bram AuthorDate: 2024-07-23 08:57:42 +0000 Commit: Warner Losh CommitDate: 2024-09-20 15:06:26 +0000 netstat: Resolve duplicate "dropped-packets" key from libxo output The current libxo output uses the "dropped-packets" key for both incoming and outgoing packets. This commit distinguishes between the two by adding an "in" and "out" suffix. The original "dropped-packets" key is kept for backwards compatibility for now. PR: 244589 Reviewed by: imp, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 --- usr.bin/netstat/if.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 172ea5324ccb..f0af785bce04 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) IFA_STAT(ipackets), link|network, 1); show_stat("lu", nerr_len, "received-errors", IFA_STAT(ierrors), link, 1); + /* Below is kept for backwards compatibility. Will be removed in the future. */ show_stat("lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops), link, 1); + show_stat("lu", nerr_len, "dropped-packets-in", IFA_STAT(iqdrops), + link, 1); if (bflag) show_stat("lu", nbyte_len, "received-bytes", IFA_STAT(ibytes), link|network, 0); @@ -516,7 +519,7 @@ intpr(void (*pfunc)(char *), int af) show_stat("NRSlu", nerr_len, "collisions", IFA_STAT(collisions), link, 1); if (dflag) - show_stat("LSlu", nerr_len, "dropped-packets", + show_stat("LSlu", nerr_len, "dropped-packets-out", IFA_STAT(oqdrops), link, 1); xo_emit("\n"); @@ -705,8 +708,11 @@ loop: new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", new->ift_ie - old->ift_ie, 1, 1); + /* Below is kept for backwards compatibility. Will be removed in the future. */ show_stat("lu", 5, "dropped-packets", new->ift_id - old->ift_id, 1, 1); + show_stat("lu", 5, "dropped-packets-in", + new->ift_id - old->ift_id, 1, 1); show_stat("lu", 10, "received-bytes", new->ift_ib - old->ift_ib, 1, 0); show_stat("lu", 10, "sent-packets", @@ -718,7 +724,7 @@ loop: show_stat("NRSlu", 5, "collisions", new->ift_co - old->ift_co, 1, 1); if (dflag) - show_stat("LSlu", 5, "dropped-packets", + show_stat("LSlu", 5, "dropped-packets-out", new->ift_od - old->ift_od, 1, 1); xo_close_instance("stats"); xo_emit("\n"); From nobody Fri Sep 20 15:58:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9H9H6X56z5Xfxr; Fri, 20 Sep 2024 15:58: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 4X9H9H57mPz4f04; Fri, 20 Sep 2024 15:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3AxjV/9Yae4IyAxzxGmIIwWH/TtAJvsQEwHb0oyJYiM=; b=JkVrUl9w0c7WWRcuHXeR/T13mL6GmoKkP6pigaNK7NwpG9MZhlVU7RVTbfSiOXY8kxXBBJ noP0q9BKBECa2Rt3XKcpW/IrCyoySQ/kiYx0RCsWw8NaOL2AX5NqmZlvHanOpAkRpU+ao2 bMRUB2n+S+DuHn66XWgjytC/0e35ryfTWyB6BCOcW5r6YohWnH0kpb0HIwA4PZo6WHI1yh rL/Ws5/pcJ9vf8d5xHkGPhpYDnXujEOQAXIPGA3WgjJI4MYBLZULBveMP9RnZTg5TTxQgM kij0qmFYFXrh4TFrcMMABd32rIBQonEftsH9VWurRiISU8EmxMjf3EVlHVIrlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726847891; a=rsa-sha256; cv=none; b=sWU2XMMxgul0l3VVe9igEQ4CRXo65Oc1vIWbzP2JhIL6A8cSMACve8GCLWl9kF9wPjP8nz V1A3YgojkQhGYvCgmnck30AAaQ8FBsLmTjfFojKsGd/Id3QbcA0SElHPQuO8XeeTqxEEbl nh6e8/pQZVWkUsXW3xiNZ2Nwm+MpwDRtn1OEsdBEN4sUdMBDkJTZ843z5dbbVhxt2zt1zA NkrnxvvAG9ZdJi01I6S1YywVi+8bT0T+841WQOhzobB79eO9gnRWyLMXx5YZ85hDHecVDr kgIVofu582N0ulQXySuTOUacK3S9M5lKvzWbZxKuYqb3WdtUxNvwf+IFu2jwbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3AxjV/9Yae4IyAxzxGmIIwWH/TtAJvsQEwHb0oyJYiM=; b=JaxhzMOY21E1qOOwA5EOLCVa+3vR1jTTHZ42lUJGbDpOuTeI88ckVcfMWu4PH485TxH63T 4g+5ll27FRzFhxod2Uln0fawb8JfdX5ZAIasFqVcMaMbHDu6oU0mV1CkWAspdcy995NYiC dKwmn8BY/VTV/3JDmGL8CyiELMV8HZt07wP3ZbGxod2DaPsoiGrVGO8G+FS4XekApfXIKt DT9TCvuNC61XusQhiJRbmuCgLUqdixSw1lXRz4CPLKCgg8Ahvoy9mBiZqcNgOnL0aIpEBf sg8w/3XqbxhY4M2mX8zET3wrUG4NCZ4ap7qKd+hGDH5zsZbiBWe46K4gzGO3jA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9H9H2xnGzwc9; Fri, 20 Sep 2024 15:58: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 48KFwBqs048895; Fri, 20 Sep 2024 15:58:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KFwBi4048892; Fri, 20 Sep 2024 15:58:11 GMT (envelope-from git) Date: Fri, 20 Sep 2024 15:58:11 GMT Message-Id: <202409201558.48KFwBi4048892@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: 674b96f58b9c - main - netstat: Add missing "shutdown-ack-timer" key to libxo output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 674b96f58b9c7daabb53ba3180afe4fc26354e27 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=674b96f58b9c7daabb53ba3180afe4fc26354e27 commit 674b96f58b9c7daabb53ba3180afe4fc26354e27 Author: Bram AuthorDate: 2024-07-23 09:05:13 +0000 Commit: Warner Losh CommitDate: 2024-09-20 15:06:50 +0000 netstat: Add missing "shutdown-ack-timer" key to libxo output The key "shutdown-timer" was present twice in the libxo output. The second occurence of "shutdown-time" has been renamed to "shutdown-ack-timer". PR: 254672 Reviewed by: imp, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 --- usr.bin/netstat/if.c | 4 ++-- usr.bin/netstat/sctp.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index f0af785bce04..877c7aa8dd5e 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -501,7 +501,7 @@ intpr(void (*pfunc)(char *), int af) IFA_STAT(ipackets), link|network, 1); show_stat("lu", nerr_len, "received-errors", IFA_STAT(ierrors), link, 1); - /* Below is kept for backwards compatibility. Will be removed in the future. */ + /* Below is kept for backwards compatibility. Will be removed before FreeBSD 16. */ show_stat("lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops), link, 1); show_stat("lu", nerr_len, "dropped-packets-in", IFA_STAT(iqdrops), @@ -708,7 +708,7 @@ loop: new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", new->ift_ie - old->ift_ie, 1, 1); - /* Below is kept for backwards compatibility. Will be removed in the future. */ + /* Below is kept for backwards compatibility. Will be removed before FreeBSD 16. */ show_stat("lu", 5, "dropped-packets", new->ift_id - old->ift_id, 1, 1); show_stat("lu", 5, "dropped-packets-in", diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c index 92c4bf67b2fa..e9fd494e292b 100644 --- a/usr.bin/netstat/sctp.c +++ b/usr.bin/netstat/sctp.c @@ -711,7 +711,7 @@ sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) "secret\n"); p(sctps_timopathmtu, "\t\t{:pmtu-timer/%ju} " "{N:/PMTU timer%s fired}\n"); - p(sctps_timoshutdownack, "\t\t{:shutdown-timer/%ju} " + p(sctps_timoshutdownack, "\t\t{:shutdown-ack-timer/%ju} " "{N:/shutdown ack timer%s fired}\n"); p(sctps_timoshutdownguard, "\t\t{:shutdown-guard-timer/%ju} " "{N:/shutdown guard timer%s fired}\n"); From nobody Fri Sep 20 15:58:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9H9J5X5rz5XgGZ; Fri, 20 Sep 2024 15:58: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 4X9H9J42sqz4dmB; Fri, 20 Sep 2024 15:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=arBqFDIHoE0IyhnLdC8CutR4avnzn+CqrujZPmcXzbc=; b=MEV4LtE0QPXaCIg37WjFqtEq4el7uypIkaeaQa363ffB6xGrK2vp2jKM6yngedHIi+BEYF MrDhhlOoJlXQzKLNc0swPcR1ZSvUr3C391NeeTAPk72L2HOkpFGpQYefIfHtSW4Jj4ISrZ N4IY8fRCKVfKaF52g7yCbfIW3Clq0MjrR3hAN51oP/O6J3iFo2uT4gSBuPqPmwgg6Ifqwm JXz7M0pHPtcYRnA/EZ2fbtUbzKsdoGc/cqygrRjgU96QcPCfm18uSJMAWmi4VpZcj54ANj kyPBeI0iOUWNTOIzRfN0jgDr7k6gbdGI0BBIqK/TUUAe7OPWAFvkeSP5QEij3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726847892; a=rsa-sha256; cv=none; b=YtzLY4dVSKRoYozqIWcK0bgzKehWPMGipaYMq63l9Y4N/Nf3JQ3YHZXJMXxhy9aCxzsmjT g1MV+F9ADZsdmTV0aH2caAIX7ranrTQYZZeN+f27Xt9pUnvl78oGQSb//AktaKAiq+ouBd axWLn4tWtZ6nZc1cjTddwS/9AvbvhDC0j+506CcNemS9xgY8AZEpHseAJcb9SJhUDEBltO Yro3Aav86IKn4kEHhSgQWkdkGI9aJOwce7uQs0FTkrUrWLPXHjyAT7IvVF64CFv6lByskF /coKU2SpQTeBNx+Sh8im017lQJYiQb277KEgjDcjdrwlqiroTiJndNNRByEv2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=arBqFDIHoE0IyhnLdC8CutR4avnzn+CqrujZPmcXzbc=; b=m2VuE9w3S0hDa/1Xe0eR6sgymqW8JpQzeqid1Kc2cLwFbYnXctnxndjW862mmHKff5aDSA OXm7D4Q5bL7lQLtMqtkfPg0135SWAxw7SSoezTtPIeDXTQEchlygEBh5J2Xu4enPPT2omk TYDMiow/3UraNPEQ/dccbsTc4VhDfoGkIcUQ5KMbZ2JAdR63m4QSr3wTZFrQL/q/lw4yct BZLY8pDp+X8SV42WnRBaTj9D1AC4zs7Ou58+J/CXR0q8aNC3IqHI0Zz64lWRaEfJWyckMK xkSw4s0iKhHVAFOzedpp4H0cWa3Eb2p8ZZmToOvDfKoP+Axq/olxX2s1oyiBJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9H9J3YzQzwYp; Fri, 20 Sep 2024 15:58: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 48KFwCf7048937; Fri, 20 Sep 2024 15:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KFwCob048934; Fri, 20 Sep 2024 15:58:12 GMT (envelope-from git) Date: Fri, 20 Sep 2024 15:58:12 GMT Message-Id: <202409201558.48KFwCob048934@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: 6e45b50342d5 - main - mac_veriexec_parser: Fix open_file error handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e45b50342d5adadf9dd08e3476fc90f715be1fc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6e45b50342d5adadf9dd08e3476fc90f715be1fc commit 6e45b50342d5adadf9dd08e3476fc90f715be1fc Author: Heyang Zhou AuthorDate: 2024-07-22 17:43:28 +0000 Commit: Warner Losh CommitDate: 2024-09-20 15:22:56 +0000 mac_veriexec_parser: Fix open_file error handling NDFREE_PNBUF should be called after checking the return value of vn_open(), and should only be called once. Reviewed by: imp, zlei, Kornel Dulęba , Elliott Mitchell Pull Request: https://github.com/freebsd/freebsd-src/pull/1338 --- sys/security/mac_veriexec_parser/mac_veriexec_parser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/security/mac_veriexec_parser/mac_veriexec_parser.c b/sys/security/mac_veriexec_parser/mac_veriexec_parser.c index 26ba573a2130..442f333d5107 100644 --- a/sys/security/mac_veriexec_parser/mac_veriexec_parser.c +++ b/sys/security/mac_veriexec_parser/mac_veriexec_parser.c @@ -241,9 +241,9 @@ open_file(const char *path, struct nameidata *nid) NDINIT(nid, LOOKUP, 0, UIO_SYSSPACE, path); rc = vn_open(nid, &flags, 0, NULL); - NDFREE_PNBUF(nid); if (rc != 0) return (rc); + NDFREE_PNBUF(nid); return (0); } @@ -346,7 +346,6 @@ parse_entry(char *entry, char *prefix) } rc = open_file(path, &nid); - NDFREE_PNBUF(&nid); if (rc != 0) return (rc); From nobody Fri Sep 20 15:58:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9H9K6kf4z5XgDc; Fri, 20 Sep 2024 15:58: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 4X9H9K4R46z4dfs; Fri, 20 Sep 2024 15:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a886d3BbHzJaplr1zZ8R4iVWfkZyfZCiRCEaLX6Smjg=; b=bFSySWz/rCev2Xf8A38HytQdclwPfqWj4SDeBQuN7qMUvAf6RArse4HcZAvQtu01qDLdBb r+jFHzQ+9ButKAoSO7IAAU3gcQxLdoCpExr+F0cIr21uHNwHzYkYdcfqRvJUWXr1KFzvgK Hqx7ctrqXe8AQgQjFDS99JO4p6JWznengy9EYKc/zjhBfbhYcKMzHJkdbAcNnfu2zwGrfq ieZfzWBxuwL1MMM7l53OigpTkfX0Wy9SueKjZlLQQLxYGld98bT0YhN+j03SJEd1SNV8F5 Eg0kV61hFpsHQNNOjlaUI37Zv4DiaX3Hg8u4pQVrC1PH368FxmpEOhaff/qBJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726847893; a=rsa-sha256; cv=none; b=JDj6iczpm29w46OoBDyYlRThufJ4ZjhmFEBvMVB/U2RFDtmiJhH9y0a29ygLfWKYWRwbr+ B1enom3uwukhcbDsmrEjnbIpfowRncl6wYF44bHSfDERFhYTaaeMvU8+RYPMSaY3pIPPR6 /M7FQi0b8CewOLaEfjlzJLntFKjPHJ7+lbbHraumVAsQG7zcLQ5YnjKC/EgPF1Z5YGEw7S JuuQXGdZwqiuBz4zcHR0BpC5wZbPHtq3hRJIIK6vyyrmoeJ/1kHrDREtXLphq+xvju4lRz ZNpi8UON+IK8iJ1SX6JcnELsKC6qxW325vSKIHl9Z2NvNQQpSQQ8j3OGB7zWxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a886d3BbHzJaplr1zZ8R4iVWfkZyfZCiRCEaLX6Smjg=; b=KvNXNfY3P8akMDbv9KsxhZdhSJ10GBg1/S2PyQMAVXP5o2q23ubdDujSMqwu8OUCDZ2wRb u2bUPrye/S/hVKkI/Lry8S93j4ypnzdqXg51F7gXSfzq2cdLZeeR2Pxr7ZczXj4a2H7QwB xmOKEkhqLaXvqNLrZ2n6Ddg8wwES6oOHetjX9XUpQuWYui/KxR0SheUs5uJvGqBgp/BjcD lHZqmyBPfdVzL+Pm4X/dnn7+qhw48iK3H90sAaK5Ly3m/2gG81jDQP8Yhcl1Mk9Wg+d8ey u9838at73D8OaYi4jCz3N5KUgwnm6hNzOXNbSKgWqn62m/Td77S7B6Be3xGOWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9H9K41GPzwDq; Fri, 20 Sep 2024 15:58: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 48KFwDZd048985; Fri, 20 Sep 2024 15:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KFwDev048982; Fri, 20 Sep 2024 15:58:13 GMT (envelope-from git) Date: Fri, 20 Sep 2024 15:58:13 GMT Message-Id: <202409201558.48KFwDev048982@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: 14980d69ff0f - main - i2c: Don't print uninitialized data when verbose List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14980d69ff0fce53cad8188b4d14fd30ad6b93c0 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=14980d69ff0fce53cad8188b4d14fd30ad6b93c0 commit 14980d69ff0fce53cad8188b4d14fd30ad6b93c0 Author: John F. Carr AuthorDate: 2024-05-23 19:50:14 +0000 Commit: Warner Losh CommitDate: 2024-09-20 15:37:58 +0000 i2c: Don't print uninitialized data when verbose i2c -sv or i2c -rv prints an uninitialized field i2c_opt.addr. Suppress the verbose message entirely for scan and reset, where it provides no information, and zero initialize the field. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279261 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1345 --- usr.sbin/i2c/i2c.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/i2c/i2c.c b/usr.sbin/i2c/i2c.c index 12155f1a0663..e4a780ba828f 100644 --- a/usr.sbin/i2c/i2c.c +++ b/usr.sbin/i2c/i2c.c @@ -751,6 +751,7 @@ main(int argc, char** argv) /* Default values */ i2c_opt.off = 0; + i2c_opt.addr = 0; i2c_opt.verbose = 0; i2c_opt.dir = 'r'; /* direction = read */ i2c_opt.width = "8"; @@ -875,12 +876,6 @@ main(int argc, char** argv) return(EX_USAGE); } - if (i2c_opt.verbose) - fprintf(stderr, "dev: %s, addr: 0x%x, r/w: %c, " - "offset: 0x%02x, width: %s, count: %u\n", dev, - i2c_opt.addr >> 1, i2c_opt.dir, i2c_opt.off, - i2c_opt.width, i2c_opt.count); - fd = open(dev, O_RDWR); if (fd == -1) { fprintf(stderr, "Error opening I2C controller (%s): %s\n", @@ -890,6 +885,11 @@ main(int argc, char** argv) switch (do_what) { case 'a': + if (i2c_opt.verbose) + fprintf(stderr, "dev: %s, addr: 0x%x, r/w: %c, " + "offset: 0x%02x, width: %s, count: %u\n", dev, + i2c_opt.addr >> 1, i2c_opt.dir, i2c_opt.off, + i2c_opt.width, i2c_opt.count); error = access_bus(fd, i2c_opt); break; case 's': From nobody Fri Sep 20 16:51:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9JLT5kvSz5W7Lg; Fri, 20 Sep 2024 16:51: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 4X9JLT58F1z4ps3; Fri, 20 Sep 2024 16:51:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726851073; h=from:from:reply-to:subject:subject: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/sgg0cIH5J/pjeh6yzP8UrPJZ99zqz62HXhCtzr9cc=; b=WEr+IdRMixkj7vC1hx+uHg+IQTK+aBVTwARwXbJbwSdrtP48iaKMatFwyMrcnqopBxgSz2 SLsq0XjDBjL1AO2i356PcrN/Kz1m8xtbejPsHHVi77U9sHZs8UZgFKMG7e3oLTxHOgI+le jjTeW/rRkkbUWLD7e4k2ja2owoRk/Ii1Sk15I9dsVlPDJ3H8G+Kr4RVjD9WBuLLgjiJpYh GFnEf5Y0MC7ct2w9h5UBRCkDhKXhw2+W8MK/xnKTuR100nY7avY9IDWfqkuF2znnQWSVVH /DZ1sKMEA7q788Zn50cw1lrF4Jp+7rVFhxxSbTNKWp5X/lEEtEuLcaOcOsnEng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726851073; a=rsa-sha256; cv=none; b=Gd1/jD+z5HB+uI4KEht0TsBkGzW+bIM7LNxw5VKs1ZlOZXB9ZwwDKfCkv+l14nQYx//LIr niMlWIMFEsRLLhsJb801+QtzZZyRH+/4ylQ4wsZ3cVW/f7pcf/Zea1dpB8foaz08KJjJcX gQzxdoXxTGCAgDSUaGqegzF6WlxZ9aIVZA2jKLbEIbWbgVgst1SHR/SW2JZlFyhzrxE/bL S4WCu61d8XZh/VTHxYDiYOmzkDzVhfp99A1pS4nmGdRfecsTiTlVfMjIJBGZ1VLtG767hA uEZdNSzkFmQ1P5Zay9Crgdw11DSCRL4xlGY6yFZyjiUOKbqziQBZNjcNqm2s1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726851073; h=from:from:reply-to:subject:subject: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/sgg0cIH5J/pjeh6yzP8UrPJZ99zqz62HXhCtzr9cc=; b=molqEt5N5LXZDf+/egiJiCG4kMXKlgJwrpDMU4Qt6Fjgzl91+HSFu9ocWphHOmerpfcTOG dh9apjVz+pT3QPzqZSqsYbmXxOYsRR99yTPRO026VUs3O/wATh2CJWd6hsQRCsHKtYSw7V UInBCNvgqhWcMQi9VGWFC6YkPTlAYeldW6MTpaVPdyPjk/DM7kZ7eGNYjYID3s4ZZuNwoT NqBr4TlAl8SEf6g9TSOPLjzTPm+hSxOMxulgI+mN/UuV7i8fbi5QJKV9CtSpCCkbPfitI6 yQFzvXkzJWk13wcFfAzckgzsJft+YfeMhzLthYfo/zctyTOn7BhdUxxveyofYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9JLT4gl4zxqy; Fri, 20 Sep 2024 16:51: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 48KGpDQs046703; Fri, 20 Sep 2024 16:51:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KGpDbt046700; Fri, 20 Sep 2024 16:51:13 GMT (envelope-from git) Date: Fri, 20 Sep 2024 16:51:13 GMT Message-Id: <202409201651.48KGpDbt046700@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: 74f1007fcc83 - main - printf(): Save errno earlier. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74f1007fcc838501c74a633792c3f01833bf65e1 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=74f1007fcc838501c74a633792c3f01833bf65e1 commit 74f1007fcc838501c74a633792c3f01833bf65e1 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-20 16:30:30 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-20 16:30:39 +0000 printf(): Save errno earlier. The manual page says %m is replaced with “the string representation of the error code stored in the errno variable at the beginning of the call”. However, we don't actually save `errno` until fairly late in `__vfprintf()`. Make sure it is saved before we do anything that might perturb `errno`. MFC after: 1 week Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D46718 --- lib/libc/stdio/local.h | 2 +- lib/libc/stdio/snprintf.c | 14 ++++++++------ lib/libc/stdio/vasprintf.c | 5 +++-- lib/libc/stdio/vdprintf.c | 3 ++- lib/libc/stdio/vfprintf.c | 20 ++++++++++---------- lib/libc/stdio/vsnprintf.c | 7 ++++--- lib/libc/stdio/vsprintf.c | 10 ++++++---- 7 files changed, 34 insertions(+), 27 deletions(-) diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h index 4d8212e947d1..da08fa246833 100644 --- a/lib/libc/stdio/local.h +++ b/lib/libc/stdio/local.h @@ -78,7 +78,7 @@ extern int __swsetup(FILE *); extern int __sflags(const char *, int *); extern int __ungetc(int, FILE *); extern wint_t __ungetwc(wint_t, FILE *, locale_t); -extern int __vfprintf(FILE *, locale_t, const char *, __va_list); +extern int __vfprintf(FILE *, locale_t, int, const char *, __va_list); extern int __vfscanf(FILE *, const char *, __va_list); extern int __vfwprintf(FILE *, locale_t, const wchar_t *, __va_list); extern int __vfwscanf(FILE * __restrict, locale_t, const wchar_t * __restrict, diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c index 607bb3770ccd..da5032f10e6a 100644 --- a/lib/libc/stdio/snprintf.c +++ b/lib/libc/stdio/snprintf.c @@ -50,10 +50,11 @@ int snprintf(char * __restrict str, size_t n, char const * __restrict fmt, ...) { + FILE f = FAKE_FILE; + va_list ap; size_t on; + int serrno = errno; int ret; - va_list ap; - FILE f = FAKE_FILE; on = n; if (n != 0) @@ -67,7 +68,7 @@ snprintf(char * __restrict str, size_t n, char const * __restrict fmt, ...) f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n; - ret = __vfprintf(&f, __get_locale(), fmt, ap); + ret = __vfprintf(&f, __get_locale(), serrno, fmt, ap); if (on > 0) *f._p = '\0'; va_end(ap); @@ -77,10 +78,11 @@ int snprintf_l(char * __restrict str, size_t n, locale_t locale, char const * __restrict fmt, ...) { + FILE f = FAKE_FILE; + va_list ap; size_t on; + int serrno = errno; int ret; - va_list ap; - FILE f = FAKE_FILE; FIX_LOCALE(locale); on = n; @@ -95,7 +97,7 @@ snprintf_l(char * __restrict str, size_t n, locale_t locale, f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n; - ret = __vfprintf(&f, locale, fmt, ap); + ret = __vfprintf(&f, locale, serrno, fmt, ap); if (on > 0) *f._p = '\0'; va_end(ap); diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c index c2c6170a2382..62d8f09fc954 100644 --- a/lib/libc/stdio/vasprintf.c +++ b/lib/libc/stdio/vasprintf.c @@ -34,9 +34,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include -#include #include "xlocale_private.h" #include "local.h" @@ -44,6 +44,7 @@ int vasprintf_l(char **str, locale_t locale, const char *fmt, __va_list ap) { FILE f = FAKE_FILE; + int serrno = errno; int ret; FIX_LOCALE(locale); @@ -55,7 +56,7 @@ vasprintf_l(char **str, locale_t locale, const char *fmt, __va_list ap) return (-1); } f._bf._size = f._w = 127; /* Leave room for the NUL */ - ret = __vfprintf(&f, locale, fmt, ap); + ret = __vfprintf(&f, locale, serrno, fmt, ap); if (ret < 0) { free(f._bf._base); *str = NULL; diff --git a/lib/libc/stdio/vdprintf.c b/lib/libc/stdio/vdprintf.c index 3cff85aa9dc5..39fb55420953 100644 --- a/lib/libc/stdio/vdprintf.c +++ b/lib/libc/stdio/vdprintf.c @@ -46,6 +46,7 @@ vdprintf(int fd, const char * __restrict fmt, va_list ap) { FILE f = FAKE_FILE; unsigned char buf[BUFSIZ]; + int serrno = errno; int ret; if (fd > SHRT_MAX) { @@ -62,7 +63,7 @@ vdprintf(int fd, const char * __restrict fmt, va_list ap) f._bf._base = buf; f._bf._size = sizeof(buf); - if ((ret = __vfprintf(&f, __get_locale(), fmt, ap)) < 0) + if ((ret = __vfprintf(&f, __get_locale(), serrno, fmt, ap)) < 0) return (ret); return (__fflush(&f) ? EOF : ret); diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 7048315a8d78..99ed11c6cb1d 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -68,7 +68,8 @@ #include "printflocal.h" static int __sprint(FILE *, struct __suio *, locale_t); -static int __sbprintf(FILE *, locale_t, const char *, va_list) __printflike(3, 0) +static int __sbprintf(FILE *, locale_t, int, const char *, va_list) + __printflike(4, 0) __noinline; static char *__wcsconv(wchar_t *, int); @@ -169,7 +170,7 @@ __sprint(FILE *fp, struct __suio *uio, locale_t locale) * worries about ungetc buffers and so forth. */ static int -__sbprintf(FILE *fp, locale_t locale, const char *fmt, va_list ap) +__sbprintf(FILE *fp, locale_t locale, int serrno, const char *fmt, va_list ap) { int ret; FILE fake = FAKE_FILE; @@ -193,7 +194,7 @@ __sbprintf(FILE *fp, locale_t locale, const char *fmt, va_list ap) fake._lbfsize = 0; /* not actually used, but Just In Case */ /* do the work, then copy any error status */ - ret = __vfprintf(&fake, locale, fmt, ap); + ret = __vfprintf(&fake, locale, serrno, fmt, ap); if (ret >= 0 && __fflush(&fake)) ret = EOF; if (fake._flags & __SERR) @@ -265,8 +266,9 @@ __wcsconv(wchar_t *wcsarg, int prec) */ int vfprintf_l(FILE * __restrict fp, locale_t locale, const char * __restrict fmt0, - va_list ap) + va_list ap) { + int serrno = errno; int ret; FIX_LOCALE(locale); @@ -274,9 +276,9 @@ vfprintf_l(FILE * __restrict fp, locale_t locale, const char * __restrict fmt0, /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) - ret = __sbprintf(fp, locale, fmt0, ap); + ret = __sbprintf(fp, locale, serrno, fmt0, ap); else - ret = __vfprintf(fp, locale, fmt0, ap); + ret = __vfprintf(fp, locale, serrno, fmt0, ap); FUNLOCKFILE_CANCELSAFE(); return (ret); } @@ -301,7 +303,7 @@ vfprintf(FILE * __restrict fp, const char * __restrict fmt0, va_list ap) * Non-MT-safe version */ int -__vfprintf(FILE *fp, locale_t locale, const char *fmt0, va_list ap) +__vfprintf(FILE *fp, locale_t locale, int serrno, const char *fmt0, va_list ap) { char *fmt; /* format string */ int ch; /* character from fmt */ @@ -311,7 +313,6 @@ __vfprintf(FILE *fp, locale_t locale, const char *fmt0, va_list ap) int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ - int saved_errno; int error; char errnomsg[NL_TEXTMAX]; char sign; /* sign prefix (' ', '+', '-', or \0) */ @@ -463,7 +464,6 @@ __vfprintf(FILE *fp, locale_t locale, const char *fmt0, va_list ap) savserr = fp->_flags & __SERR; fp->_flags &= ~__SERR; - saved_errno = errno; convbuf = NULL; fmt = (char *)fmt0; argtable = NULL; @@ -831,7 +831,7 @@ fp_common: break; #endif /* !NO_FLOATING_POINT */ case 'm': - error = __strerror_rl(saved_errno, errnomsg, + error = __strerror_rl(serrno, errnomsg, sizeof(errnomsg), locale); cp = error == 0 ? errnomsg : ""; size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp); diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index 1e25e6757459..45e4fb529be7 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -47,12 +47,13 @@ int vsnprintf_l(char * __restrict str, size_t n, locale_t locale, - const char * __restrict fmt, __va_list ap) + const char * __restrict fmt, __va_list ap) { + FILE f = FAKE_FILE; size_t on; + int serrno = errno; int ret; char dummy[2]; - FILE f = FAKE_FILE; FIX_LOCALE(locale); on = n; @@ -73,7 +74,7 @@ vsnprintf_l(char * __restrict str, size_t n, locale_t locale, f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n; - ret = __vfprintf(&f, locale, fmt, ap); + ret = __vfprintf(&f, locale, serrno, fmt, ap); if (on > 0) *f._p = '\0'; return (ret); diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index 298f969a1318..23c18264fa50 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -37,8 +37,9 @@ * SUCH DAMAGE. */ -#include +#include #include +#include #include "local.h" #include "xlocale_private.h" @@ -46,16 +47,17 @@ int vsprintf_l(char * __restrict str, locale_t locale, - const char * __restrict fmt, __va_list ap) + const char * __restrict fmt, __va_list ap) { - int ret; FILE f = FAKE_FILE; + int serrno = errno; + int ret; FIX_LOCALE(locale); f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; - ret = __vfprintf(&f, locale, fmt, ap); + ret = __vfprintf(&f, locale, serrno, fmt, ap); *f._p = 0; return (ret); } From nobody Fri Sep 20 16:54:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9JPk3HC8z5W8Wd; Fri, 20 Sep 2024 16:54: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 4X9JPk1j6yz4s1Y; Fri, 20 Sep 2024 16:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726851242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pnqRh5FNiRb6nmbOGO0WR3H80pxuLcMvH65e5s8/ViM=; b=KNlGxc6yq7e2katcg2DI/2m5l/3BCakeD5pTcZIo8Dgk/pjeMbRZfZyU+VuatXoqR40Kjf M2ZN2wQP/C9Fue3t157us7w1KmsyDuBDEiDCeE6GlVVCElHj0ieJLrOU8xPlfToKq5o6Qh n2HJUlTjvYCHTxHLGAT36tu949E3Kc4PC71E0sjyRcd5NvN3mMa3Vw3rzPPINnVn1KSZtr iIPkBqInp3qrsPwEJvjKC+NCYRMOauMWuT7Cee/2zPf1tIj/+StvQ3NORi1ESLIg0EMztb xS7ctYhD1CuFZ9ck7jqiZQpqrPIjWDJjeTbg3Q7PBnPJL3ebDNQKQ/bIEnUQ+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726851242; a=rsa-sha256; cv=none; b=bNE6+s5CELCvLDH/9s38DPI9JeGJ9yNm+wyeZz6Kj1gC8a4hD285RljImZZ9fDlcrZiweE S9mUmOJy1FydC492AanzEn09Z2WhlSKhGtuvUoWS+HsIA8p8k0OHvKHlM6BIz/VG4DuUlf xSE/ahu/9AJJC49zSnTRxw5mvGVsTL+Hof8F9zD/VPMOT5W2EaFyIXOAaiPGBH/SjJ8ze7 ydikul6iM9PqJiTj+YXCfFPMv77CgEELRShIt32zQEnjHeBDWj9apuk+hUdqVeDUNGnUk1 qpUPIVk1U6OLPvDDMHDPdwgVW/5oWdr0FMrsFRXhT28B9acW7wJBlwD4RG2zlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726851242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pnqRh5FNiRb6nmbOGO0WR3H80pxuLcMvH65e5s8/ViM=; b=V2HSc1DS2T3kG25t03NyzihtTQX7OP8E9SpCAGF+QJT+VYWFR05Utl5O6P34nzevCJqwP8 EV8eCN5t5gwW2G89b/sqbIjIqdUcZ/1iUijbDBzbTS4VNiOQkZt2K9gqr+j2oqBuXS42wB JnKm0c4Q33ZEWwhnWy1AUHpsr16j2wwTib/U0IEe6yBjBcV2tqwBYfq6IOU0LyCSW6i6Yx 36qOLb6yud1r9m4ANlsx4vin6B83SYkxJk5+1KkUrfAbZ002zjIk8el0lCqt4QRqr20CJP ngNqEGWhWDP67slhHO1fQTOYWWSOqsUfDd/xb4urzlkphs3WrSvvnAz37NebIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9JPk1JDwzxnW; Fri, 20 Sep 2024 16:54: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 48KGs25E050704; Fri, 20 Sep 2024 16:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KGs2i9050701; Fri, 20 Sep 2024 16:54:02 GMT (envelope-from git) Date: Fri, 20 Sep 2024 16:54:02 GMT Message-Id: <202409201654.48KGs2i9050701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: cc4997907714 - main - arm64: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc4997907714ec22498a454736974abfbc123beb Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=cc4997907714ec22498a454736974abfbc123beb commit cc4997907714ec22498a454736974abfbc123beb Author: Gordon Bergling AuthorDate: 2024-09-20 16:53:42 +0000 Commit: Gordon Bergling CommitDate: 2024-09-20 16:53:42 +0000 arm64: Fix a typo in a source code comment - s/parametes/parameters/ MFC after: 3 days --- sys/arm64/arm64/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index c73c6d205c1a..f9885f4d4e0a 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -900,7 +900,7 @@ initarm(struct arm64_bootparams *abp) boot_el = abp->boot_el; - /* Parse loader or FDT boot parametes. Determine last used address. */ + /* Parse loader or FDT boot parameters. Determine last used address. */ lastaddr = parse_boot_param(abp); /* Find the kernel address */ From nobody Fri Sep 20 18:00:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9KtZ0kjsz5WSGX; Fri, 20 Sep 2024 18:00: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 4X9KtY65DXz44ns; Fri, 20 Sep 2024 18:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726855237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dFHgNepelLpHl+OXNjHTtbyIwFtiA2W06EKIquT4oKQ=; b=ZMVBus9g12o0MtwG7OVrKUZD48VlbvWzvNSpUhC+bCdLgC/rWAdOhlIvAAxpbk2z/pCVV4 UodmXSDdZ2kyCugd59ovw+ORcBw9Xbxsmler8D1X+N0VWhZEc9Gh1Xh6q+ZEPY7bmCAGb0 7jVA3mcW5tM5R+Vo8M7BICD7yZ1FzB6RFjrZDVnRw0VdVDdtDuHteDEuSSdFiRJBBnHMiQ u406yimQi6g/SjI3QUiDsN1B67Dl4EImdRkYgtMEDFUSE4ZcW8kCazd8w+BdamNuiBU/gd hQrTDrHg90yxPlrh0ro8xStx14z5cNOQ5a3HZALgsOtWvY3Fm2eEAz6fe53AOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726855237; a=rsa-sha256; cv=none; b=RERnR+UM0v9Fu0oOux3sKgrr+uKZOTPsaQldZVcS/MH+HaLNld24WpP8h9882STCWwbrVw /7SVk3xW+hgQo4raxRgkzNf4dKfKwmKbZ7b9wOhBP39vxyVmMChDlLltCN1edTzEb8RuRu wqWT5s2MwjC6fjHwT1hHI4nv6YfopKsDIHEG04vkQH94DcaXnGQD2PIAt3maBXbqKaTEBb VBUzDGzdFjxy1VBYEB57nJNtq424E35HcNSp/EzYVdSVYlv8ss6vf9ZQAMBUgt+4d7muJI iBXvoHwgnlXJmvbAob57rdw/ohR+E5l9aVOXDm4YTY4UmCzE7NkbHoEOjxS1Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726855237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dFHgNepelLpHl+OXNjHTtbyIwFtiA2W06EKIquT4oKQ=; b=asTjAKCI3W5bB7ss7EnLDnT6CVqZrkHEKgENoTDChKy//f6IPgzFKjALUeRwZ/cMyCRMGh L816vcuir9u6uYI03m9I833QNQLP4wthuvmbe0d/XN0SZUBnqrUDgEZcnASiT9adUlnZMh 06/QH+fRrZF2ocVrAcGu6VhKAQ7/4Q11OT3x5v7PKti6W2/iOl15/4D1k7kXvrN/UMpLkU g73Yw7Y5rqV99fcUn6Os9aMa9YocuM8tEuSCZoI3b9kA5H51KyQHtS81hDj99n9/aKDyau p/F6syUsKLssjNbyJDJFlClvYK5DF+Qb9zgV7Qtt/5zKvECQtTGfDBzO2j+jyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9KtY5hfFz10NH; Fri, 20 Sep 2024 18:00: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 48KI0bKH065350; Fri, 20 Sep 2024 18:00:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KI0bsw065347; Fri, 20 Sep 2024 18:00:37 GMT (envelope-from git) Date: Fri, 20 Sep 2024 18:00:37 GMT Message-Id: <202409201800.48KI0bsw065347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 9046ecff409c - main - bluetooth(3): Fix two typos in source code comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9046ecff409c45205aad34ef8d959d79dd20cf8f Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=9046ecff409c45205aad34ef8d959d79dd20cf8f commit 9046ecff409c45205aad34ef8d959d79dd20cf8f Author: Gordon Bergling AuthorDate: 2024-09-20 18:00:04 +0000 Commit: Gordon Bergling CommitDate: 2024-09-20 18:00:04 +0000 bluetooth(3): Fix two typos in source code comments - s/conficts/conflicts/ MFC after: 3 days --- sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c index ae5405529667..9fc26f53e9c6 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -789,7 +789,7 @@ ng_btsocket_l2cap_process_l2ca_cfg_req_rsp(struct ng_mesg *msg, if (op->result == NG_L2CAP_SUCCESS) { /* * XXX FIXME Actually set flush and link timeout. - * Set QoS here if required. Resolve conficts (flush_timo). + * Set QoS here if required. Resolve conflicts (flush_timo). * Save incoming MTU (peer's outgoing MTU) and outgoing flow * spec. */ @@ -991,7 +991,7 @@ ng_btsocket_l2cap_process_l2ca_cfg_ind(struct ng_mesg *msg, /* * XXX FIXME Actually set flush and link timeout. Set QoS here if - * required. Resolve conficts (flush_timo). Note outgoing MTU (peer's + * required. Resolve conflicts (flush_timo). Note outgoing MTU (peer's * incoming MTU) and incoming flow spec. */ From nobody Fri Sep 20 18:38:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Lk74fvbz5WkHs; Fri, 20 Sep 2024 18:38: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 4X9Lk73fjyz4Gpt; Fri, 20 Sep 2024 18:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726857503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4SyxHMPupN2NhLLxbG8928TVs592JnnuL1KQ/2AFncc=; b=TOHCcrYA2GzCVn802Hew+hmchFtxukanRcFh3SvSxhM8jIutRRFN/+4cIenhfHrMeBIZ9J bnnlxKzGiSEuA8AfdoiWaOzIWX8S9uo+JQSW1w7DqBfTbr2PSyq4IGv1jmunk13S7l8lxJ f3bD6XrzUQaqW2XJY/lKH1MadV/dn6EuF8KBdDwgmgHSxDb64HGlTNuB3BusrfOFm+KFDh zgaUrmzTKnkEWrPR6VEbrT87CusxHkvFTPDFHruPqGPfXm7Tbg4ud9BY7unEDHkk4rQK6/ mqbL1kgROV4t8AIFblVV9jBSFG6rNlcERiIJ18Y2BDisivv9rMJJjmz6OI4EAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726857503; a=rsa-sha256; cv=none; b=Xg3KiYqNNGa9h9VpVndgmxUmM6FaI+u/4wfbgwTfnPHRlp7Gs+Z1PHY7WsppEa0Kygxdew Nxr/P9lzeIjB5BlTCpyw7HiGAOjmyP/0Il21rvIdeTYDZ2Zd1QdsbM8IssG84ghl2O+EZ2 /fAkM2W5uHtgOW9FNrZ7kZD5dUafA+BINaBYnI8liiNUNs4ZPvlFHx0sdZzHa5x2Ghy3FA 4zx+wd6uLHE9lExhhsxeKK5hAB4eXRovBkfU3Q6e3lTfV8TvQ4LH6yoq/3F4soPD4NGxHj tr3djlT6sl529J4BtO+7zGr65zDcpQuZxNyIJ7FNIx/iMBzIHC8+tUiNC/8HBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726857503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4SyxHMPupN2NhLLxbG8928TVs592JnnuL1KQ/2AFncc=; b=ikV2UjnjuJqxWNgWl4H1Yz34QxT4Bhtpb9y85uCwVgBLDXIBH+I9rvGsAinU3Ei2Y5KVRB qcDM7oaQNuux2aeT67Te+vOPj8UsmwkQK39ytm4bF58JfCmzaC3PkJVxwtIY1KC9UzKuIm jTTZbg9WiLMq9Db5xKSTzBUDHSQKxklqgTD2QFT5qUntLHYOUqKBxuUcF8cuxt3eyb3hw6 2NW68e3xlrAJoRdvPNWq02fq6s0KPqCEPayr5MZaDOGK0ZBMR7fxItIB1zav06ms5jrUdp 8b5+mzQEhYeJLAybOE2KujIHu+evc/KPhKATJhGMA3st/XXF8vbwUGgTHR3ZEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9Lk72psCz11PZ; Fri, 20 Sep 2024 18:38: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 48KIcNeS022755; Fri, 20 Sep 2024 18:38:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KIcNgd022752; Fri, 20 Sep 2024 18:38:23 GMT (envelope-from git) Date: Fri, 20 Sep 2024 18:38:23 GMT Message-Id: <202409201838.48KIcNgd022752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 9dc67a70650b - main - rc.8: Remove false information about rc.d/local List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dc67a70650b99872316d7ff95ef45ea4c5b455a Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc67a70650b99872316d7ff95ef45ea4c5b455a commit 9dc67a70650b99872316d7ff95ef45ea4c5b455a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-09-20 09:07:05 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-09-20 18:28:59 +0000 rc.8: Remove false information about rc.d/local It does not handle scripts in /usr/local/etc/rc.d/. Instead, it takes care of /etc/rc.local and /etc/rc.shutdown.local. MFC after: 2 weeks --- share/man/man8/rc.8 | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/share/man/man8/rc.8 b/share/man/man8/rc.8 index fda04bceaf4c..b7bd7b2de1f0 100644 --- a/share/man/man8/rc.8 +++ b/share/man/man8/rc.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 31, 2024 +.Dd September 20, 2024 .Dt RC 8 .Os .Sh NAME @@ -451,18 +451,6 @@ is not set, when going from single-user to multi-user mode for example, the script does not do anything. .Pp The -.Pa /etc/rc.d/local -script can execute scripts from multiple -.Nm rc.d/ -directories. -The default location includes -.Pa /usr/local/etc/rc.d/ , -but these may be overridden with the -.Va local_startup -.Xr rc.conf 5 -variable. -.Pp -The .Pa /etc/rc.d/serial script is used to set any special configurations for serial devices. .Pp From nobody Fri Sep 20 18:38:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Lk86bf1z5WkLD; Fri, 20 Sep 2024 18:38: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 4X9Lk84DPJz4Gpv; Fri, 20 Sep 2024 18:38:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726857504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ari8mWzZdlxBGxnen463hIjZZSCZkSVKLusobHc67k=; b=b08UyGQ7DgV9NmYu+g5OzvCoybir7YIOMS4UVy2/aAI3Cflsp0VDAZJrfz8iaG+bLBMABU 7cLjdQeA2NGys94GRDV5mmZiOgd9+7dgM4xmDZvZlFFX3Tp+8xAjliML6ue4FMbpOYEqSr bw22I9a8BNhXpJiWpX3s3eA94a7IOHVpnYzeHN9A+SOa+HQ1OWlUK0B08cLCxHtnoEsaoQ Bkvg/dbw776SGrvfMUGUy9x0JXgbR92lAIRnYqG1tU0bAhroxDHMDE8KW3kklqvkRLrFQX cKRFV6vK2yIVZ1YaaHWIMcc3AljmoU1fR1xv+awVh1KRGa842++gYlMJpS6UuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726857504; a=rsa-sha256; cv=none; b=SX8TJbYBDKbB49/ogZ+S9Cb3oTB5gwSqJJswhujes7WaTBEpP6skXNY6vDIWAbrrzOT7qZ FFShbDoE8hWk9p6To0AiFcME6fFRXP4khaoVOKJ0i+aoO9gabciXCqCHA/uYp9J2X1STzM E5bTcZIff0+tQImOJDG46mIlp9H4bWUyGwk25RvzUMFhgIlINxIAGMAf4pfd06wp6ONu/l UNHSywB0xfCVB+iFi3d+fPkBQMBPsMX2qoMcr9MV7TfyWq9sZ2nXjzi/sn98NEhn5eU6hz WfM6pcuePFmFfBE35YOq3hWb2+I1Q5GP65Q4Ca6FZ/L569rIPHe6hIDnvdjxVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726857504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ari8mWzZdlxBGxnen463hIjZZSCZkSVKLusobHc67k=; b=oCbU/aFigO7X55PyQrEXddCzSjirmSirBK/nSCQ9K9qSF8YdgBKF8V+jG69/xWMqxVc7ce LnErIUV6x/6fWFfDM6YQIr3aSLXOgWDU4TP7WlhH30k2EBmCCZnmYHm4QU0D3ReZel/1rx 0HQB7vNWg4rMBFtdOmmyPjneo/cczD74JmocCUdJxNUZqAzDwG/QDd/0ZHVUQxbDK+r7Dm pUDrg8kn6T0ugj7dEGnhEyZ74fWPJJ7XAO1yMNAOGAH3lbEaJIzFzWHI7XcnvvckWGxDi/ WlHtVFrHtvUhaqnFhuWRqc3SAuZlLJGtEG/OXE85kybmdw5iL3M8Yjqdu2rQ4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9Lk83qJmz1155; Fri, 20 Sep 2024 18:38: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 48KIcOia022806; Fri, 20 Sep 2024 18:38:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KIcOax022803; Fri, 20 Sep 2024 18:38:24 GMT (envelope-from git) Date: Fri, 20 Sep 2024 18:38:24 GMT Message-Id: <202409201838.48KIcOax022803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 401516dbc54e - main - rc.subr: Consistently use an absolute path for sysrc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 401516dbc54e4a4cba3085cd605fbf6cf8293b79 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=401516dbc54e4a4cba3085cd605fbf6cf8293b79 commit 401516dbc54e4a4cba3085cd605fbf6cf8293b79 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-09-20 09:27:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-09-20 18:28:59 +0000 rc.subr: Consistently use an absolute path for sysrc MFC after: 2 weeks Approved by: christos --- libexec/rc/rc.subr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index df1501707a67..58e30c897897 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1409,8 +1409,8 @@ run_rc_command() delete) _files= - for _file in $(sysrc -lEs "$name"); do - _out=$(sysrc -Fif $_file "$rcvar") && _files="$_files $_file" + for _file in $(/usr/sbin/sysrc -lEs "$name"); do + _out=$(/usr/sbin/sysrc -Fif $_file "$rcvar") && _files="$_files $_file" done /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar deleted in ${_files# }" # delete file in rc.conf.d if desired and empty. From nobody Fri Sep 20 18:56:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9M7021GDz5X4dJ; Fri, 20 Sep 2024 18:56:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (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 4X9M700kmsz4Kcp; Fri, 20 Sep 2024 18:56:28 +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 re8OstTL2MArNrinrsn8Uk; Fri, 20 Sep 2024 18:56:27 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id rinpssFDi2M9qrinqsSLxm; Fri, 20 Sep 2024 18:56:27 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=66edc55b a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=nAJYALVySAJzlLyiudUA:9 a=CjuIK1q_8ugA:10 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 810E511D; Fri, 20 Sep 2024 11:56:25 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 72B3C281; Fri, 20 Sep 2024 11:56:25 -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: tuexen@freebsd.org cc: Konstantin Belousov , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser In-reply-to: <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org> References: <202409200646.48K6ku0O009784@gitrepo.freebsd.org> <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org> Comments: In-reply-to tuexen@freebsd.org message dated "Fri, 20 Sep 2024 15:04:33 +0200." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Sep 2024 11:56:25 -0700 Message-Id: <20240920185625.72B3C281@slippy.cwsent.com> X-CMAE-Envelope: MS4xfM+LbIUO5UgqDyTnbkP4Wau2QFdqoKcUpgszNnsC0q2/JwsJVH5KtIEwPll6/QXS3uz/R5nO65d2CjWN+lmzg6OtIRlSU5w2pCpEm6NMbJOVb6KT7gEs GqiF7Uckefq61o9tQgZDw/M4Ff33EamVqBMtkL2Z4bkkDEW2VJaXHX6udpBhv4deLNdUCOYcfgc6k+CMf+/aR30H8Yk0GRhTHJi73KHgFSd7bo6CgG326FUq WgGspVDYcw4vzk6iC1XxSyZJOZZ4IW17IdL8uh8ZOdWjA/ezyprFS4D/c+cNyMCZtCPL5uNDoWOR2hzp6whbxy+JU35syb5lYfoHybK33QQpGlLmj0BYrj6p Uh8TScwt 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: 4X9M700kmsz4Kcp X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org>, tuexen@freebsd.o rg writes: > After building a kernel including these changes, I see a lot of > negative pipecnt for uid =3D 0 > Installing world also fails due to pipe problems. > Is this related to one of these changes? Any configuration change = > needed? > > Best regards > Michael > I'm seeing the following from my postfix server. It was rejecting email until I reverted this commit. Sep 20 11:00:44 cwfw postfix/proxymap[18650]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:00:59 cwfw postfix/pickup[18651]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:21 cwfw postfix/trivial-rewrite[18653]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:45 cwfw postfix/proxymap[18654]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:45 cwfw postfix/qmgr[18655]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:58 cwfw kernel: negative pipecnt for uid = 1006 Sep 20 11:01:58 cwfw syslogd: last message repeated 1 times -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 > > On 20. Sep 2024, at 08:46, Konstantin Belousov = > wrote: > >=20 > > The branch main has been updated by kib: > >=20 > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D7672cbef2c1e1267e42bb3aad6a6da93= > 80f4347f > >=20 > > commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f > > Author: Konstantin Belousov > > AuthorDate: 2024-09-15 06:57:34 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-09-20 06:46:07 +0000 > >=20 > > pipes: reserve configured percentage of buffers zone to superuser > >=20 > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D46619 > > --- > > sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- > > 1 file changed, 21 insertions(+), 2 deletions(-) > >=20 > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > index 7ee2b5c76da3..68b57708d653 100644 > > --- a/sys/kern/sys_pipe.c > > +++ b/sys/kern/sys_pipe.c > > @@ -103,6 +103,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -206,6 +207,7 @@ static int pipeallocfail; > > static int piperesizefail; > > static int piperesizeallowed =3D 1; > > static long pipe_mindirect =3D PIPE_MINDIRECT; > > +static int pipebuf_reserv =3D 2; > >=20 > > SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | = > CTLFLAG_NOFETCH, > > &maxpipekva, 0, "Pipe KVA limit"); > > @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, = > CTLFLAG_RD, > > &piperesizefail, 0, "Pipe resize failures"); > > SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, > > &piperesizeallowed, 0, "Pipe resizing allowed"); > > +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, > > + &pipebuf_reserv, 0, > > + "Superuser-reserved percentage of the pipe buffers space"); > >=20 > > static void pipeinit(void *dummy __unused); > > static void pipeclose(struct pipe *cpipe); > > @@ -586,8 +591,22 @@ retry: > > return (ENOMEM); > > } > >=20 > > - error =3D vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, = > size, 0, > > - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > + vm_map_lock(pipe_map); > > + if (priv_check(curthread, PRIV_PIPEBUF) !=3D 0 && > > + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * > > + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { > > + vm_map_unlock(pipe_map); > > + if (cpipe->pipe_buffer.buffer =3D=3D NULL && > > + size > SMALL_PIPE_SIZE) { > > + size =3D SMALL_PIPE_SIZE; > > + pipefragretry++; > > + goto retry; > > + } > > + return (ENOMEM); > > + } > > + error =3D vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t = > *)&buffer, > > + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > + vm_map_unlock(pipe_map); > > if (error !=3D KERN_SUCCESS) { > > chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); > > if (cpipe->pipe_buffer.buffer =3D=3D NULL && > From nobody Fri Sep 20 18:40:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9MDt3612z5X5s8; Fri, 20 Sep 2024 19:01:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (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 4X9MDt0yGXz4LPb; Fri, 20 Sep 2024 19:01:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id re78stTGxMArNrisnsn9KH; Fri, 20 Sep 2024 19:01:33 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id rislsCyY7GvSVrismsi0U6; Fri, 20 Sep 2024 19:01:33 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=FpSm/Hrq c=1 sm=1 tr=0 ts=66edc68d a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=nAJYALVySAJzlLyiudUA:9 a=CjuIK1q_8ugA:10 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 B93BDE2; Fri, 20 Sep 2024 12:01:31 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 7CBDE185; Fri, 20 Sep 2024 11:40:19 -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: tuexen@freebsd.org cc: Konstantin Belousov , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser In-reply-to: <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org> References: <202409200646.48K6ku0O009784@gitrepo.freebsd.org> <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org> Comments: In-reply-to tuexen@freebsd.org message dated "Fri, 20 Sep 2024 15:04:33 +0200." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Sep 2024 11:40:19 -0700 Message-Id: <20240920184019.7CBDE185@slippy.cwsent.com> X-CMAE-Envelope: MS4xfOxwRey9RIqX5OK+yOACU+tWFXuFpZcMG8f1MjPN9fwlndbC/YnZyxH6d2oU3BSeFv43wDBj07rbu7IVEBdf9jR+qTXyiZwTnLlBG1Wltu8sDtxyoGdS 9JDf8/57iwWbduWQ7CMB+j1XFBINHu+wpym3RKHnTktyUyBs4Q2S4bhrS7mNhI3umFVXpbuNeFw0Nsg5a0NFwKxbnAUy7NSIX+zA0ttg1VcmLac9J41gNxzj 000np4HEkWFlrYgWFLgiTurQw8jTNdHR2obT25FJ/Hj3OfcvkFvaBLxO6PVLPZMv9h8hGo5dXj24BkdUnN9XPfJKLCd2+KRJDW1B2IR9cXLyEXGaCNV8cP6M zPEp3DPV 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: 4X9MDt0yGXz4LPb X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org>, tuexen@freebsd.o rg writes: > After building a kernel including these changes, I see a lot of > negative pipecnt for uid =3D 0 > Installing world also fails due to pipe problems. > Is this related to one of these changes? Any configuration change = > needed? > > Best regards > Michael I'm seeing the following from my postfix server. It was rejecting email until I reverted this commit. Sep 20 11:00:44 cwfw postfix/proxymap[18650]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:00:59 cwfw postfix/pickup[18651]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:21 cwfw postfix/trivial-rewrite[18653]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:45 cwfw postfix/proxymap[18654]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:45 cwfw postfix/qmgr[18655]: fatal: watchdog_create: pipe: Cannot allocate memory Sep 20 11:01:58 cwfw kernel: negative pipecnt for uid = 1006 Sep 20 11:01:58 cwfw syslogd: last message repeated 1 times -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 > > > On 20. Sep 2024, at 08:46, Konstantin Belousov = > wrote: > >=20 > > The branch main has been updated by kib: > >=20 > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D7672cbef2c1e1267e42bb3aad6a6da93= > 80f4347f > >=20 > > commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f > > Author: Konstantin Belousov > > AuthorDate: 2024-09-15 06:57:34 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-09-20 06:46:07 +0000 > >=20 > > pipes: reserve configured percentage of buffers zone to superuser > >=20 > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D46619 > > --- > > sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- > > 1 file changed, 21 insertions(+), 2 deletions(-) > >=20 > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > index 7ee2b5c76da3..68b57708d653 100644 > > --- a/sys/kern/sys_pipe.c > > +++ b/sys/kern/sys_pipe.c > > @@ -103,6 +103,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -206,6 +207,7 @@ static int pipeallocfail; > > static int piperesizefail; > > static int piperesizeallowed =3D 1; > > static long pipe_mindirect =3D PIPE_MINDIRECT; > > +static int pipebuf_reserv =3D 2; > >=20 > > SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | = > CTLFLAG_NOFETCH, > > &maxpipekva, 0, "Pipe KVA limit"); > > @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, = > CTLFLAG_RD, > > &piperesizefail, 0, "Pipe resize failures"); > > SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, > > &piperesizeallowed, 0, "Pipe resizing allowed"); > > +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, > > + &pipebuf_reserv, 0, > > + "Superuser-reserved percentage of the pipe buffers space"); > >=20 > > static void pipeinit(void *dummy __unused); > > static void pipeclose(struct pipe *cpipe); > > @@ -586,8 +591,22 @@ retry: > > return (ENOMEM); > > } > >=20 > > - error =3D vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, = > size, 0, > > - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > + vm_map_lock(pipe_map); > > + if (priv_check(curthread, PRIV_PIPEBUF) !=3D 0 && > > + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * > > + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { > > + vm_map_unlock(pipe_map); > > + if (cpipe->pipe_buffer.buffer =3D=3D NULL && > > + size > SMALL_PIPE_SIZE) { > > + size =3D SMALL_PIPE_SIZE; > > + pipefragretry++; > > + goto retry; > > + } > > + return (ENOMEM); > > + } > > + error =3D vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t = > *)&buffer, > > + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > + vm_map_unlock(pipe_map); > > if (error !=3D KERN_SUCCESS) { > > chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); > > if (cpipe->pipe_buffer.buffer =3D=3D NULL && > From nobody Fri Sep 20 19:01:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9MFN3cf1z5X6T7; Fri, 20 Sep 2024 19:02:00 +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 4X9MFM5cSHz4Lwb; Fri, 20 Sep 2024 19:01:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=quarantine) header.from=cschubert.com; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.32 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id re31siji69TOUritDsFuTX; Fri, 20 Sep 2024 19:01:59 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id ritBsDjmCKHV8ritCsESjX; Fri, 20 Sep 2024 19:01:59 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=66edc6a7 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=EaEq8P2WXUwA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=QUsjsP8uBRjmw93wkuwA:9 a=CjuIK1q_8ugA:10 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 7AB52E7; Fri, 20 Sep 2024 12:01:57 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 79EE9A9; Fri, 20 Sep 2024 12:01:57 -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: tuexen@freebsd.org, Konstantin Belousov , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 7672cbef2c1e - main - pipes: reserve configured percentage of buffers zone to superuser Comments: In-reply-to Cy Schubert message dated "Fri, 20 Sep 2024 11:56:25 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Sep 2024 12:01:57 -0700 Message-Id: <20240920190157.79EE9A9@slippy.cwsent.com> X-CMAE-Envelope: MS4xfIMLMMj1OqLu97LnWfA75rdOXJIAdabUbNQZP9kYPpikq7fOMyQuSz4e7Di+qiAsfXojZODUnucgFi36z9useh7dlPu/sbp7kAv6yw/9qPNbXyBM/Id6 dE6OR9cZBLF2pS7/gtsPSm10OpZZOh59GR3P4nrDTBz4C+HF7jGXhtNqOdLZd2Nc6arpg/qW3ndT7REki2GA/YPA9JfDMSRxCOL8FYT/DzJNM/FCsh/9fD9T xcfk8NSkohKVvIb9mXTSK0P7uq4e63spjuiboQs6Fbh6nWH4lpujynlPLmuJThJt2WTgz6W+R/HySWdOt+z0cy8RBXgaZDyv2QXWo11f6is1JH0LQ6TH7oUx C0g4vthY X-Spamd-Result: default: False [-0.60 / 15.00]; THREAD_HIJACKING_FROM_INJECTOR(2.00)[]; FAKE_REPLY(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; DMARC_POLICY_ALLOW(-0.50)[cschubert.com,quarantine]; MV_CASE(0.50)[]; RWL_MAILSPIKE_VERYGOOD(-0.20)[3.97.99.32:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31:c]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; RCVD_COUNT_THREE(0.00)[4]; REPLYTO_EQ_FROM(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_NA(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4X9MFM5cSHz4Lwb X-Spamd-Bar: / Probably worse than rejected email. Seems the email was simply lost by postfix. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 Cy Schubert writes: > In message <0A45CDBA-14DF-423E-9A1F-74119AD5C808@freebsd.org>, > tuexen@freebsd.o > rg writes: > > After building a kernel including these changes, I see a lot of > > negative pipecnt for uid =3D 0 > > Installing world also fails due to pipe problems. > > Is this related to one of these changes? Any configuration change = > > needed? > > > > Best regards > > Michael > > > > I'm seeing the following from my postfix server. It was rejecting email > until I reverted this commit. > > Sep 20 11:00:44 cwfw postfix/proxymap[18650]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:00:59 cwfw postfix/pickup[18651]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:01:21 cwfw postfix/trivial-rewrite[18653]: fatal: > watchdog_create: pipe: Cannot allocate memory > Sep 20 11:01:45 cwfw postfix/proxymap[18654]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:01:45 cwfw postfix/qmgr[18655]: fatal: watchdog_create: pipe: > Cannot allocate memory > Sep 20 11:01:58 cwfw kernel: negative pipecnt for uid = 1006 > Sep 20 11:01:58 cwfw syslogd: last message repeated 1 times > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > > > > > On 20. Sep 2024, at 08:46, Konstantin Belousov = > > wrote: > > >=20 > > > The branch main has been updated by kib: > > >=20 > > > URL: = > > https://cgit.FreeBSD.org/src/commit/?id=3D7672cbef2c1e1267e42bb3aad6a6da93= > > 80f4347f > > >=20 > > > commit 7672cbef2c1e1267e42bb3aad6a6da9380f4347f > > > Author: Konstantin Belousov > > > AuthorDate: 2024-09-15 06:57:34 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2024-09-20 06:46:07 +0000 > > >=20 > > > pipes: reserve configured percentage of buffers zone to superuser > > >=20 > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D46619 > > > --- > > > sys/kern/sys_pipe.c | 23 +++++++++++++++++++++-- > > > 1 file changed, 21 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > > index 7ee2b5c76da3..68b57708d653 100644 > > > --- a/sys/kern/sys_pipe.c > > > +++ b/sys/kern/sys_pipe.c > > > @@ -103,6 +103,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -206,6 +207,7 @@ static int pipeallocfail; > > > static int piperesizefail; > > > static int piperesizeallowed =3D 1; > > > static long pipe_mindirect =3D PIPE_MINDIRECT; > > > +static int pipebuf_reserv =3D 2; > > >=20 > > > SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | = > > CTLFLAG_NOFETCH, > > > &maxpipekva, 0, "Pipe KVA limit"); > > > @@ -219,6 +221,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizefail, = > > CTLFLAG_RD, > > > &piperesizefail, 0, "Pipe resize failures"); > > > SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTLFLAG_RW, > > > &piperesizeallowed, 0, "Pipe resizing allowed"); > > > +SYSCTL_INT(_kern_ipc, OID_AUTO, pipebuf_reserv, CTLFLAG_RW, > > > + &pipebuf_reserv, 0, > > > + "Superuser-reserved percentage of the pipe buffers space"); > > >=20 > > > static void pipeinit(void *dummy __unused); > > > static void pipeclose(struct pipe *cpipe); > > > @@ -586,8 +591,22 @@ retry: > > > return (ENOMEM); > > > } > > >=20 > > > - error =3D vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, = > > size, 0, > > > - VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > > + vm_map_lock(pipe_map); > > > + if (priv_check(curthread, PRIV_PIPEBUF) !=3D 0 && > > > + (vm_map_max(pipe_map) - vm_map_min(pipe_map)) * > > > + (100 - pipebuf_reserv) / 100 < pipe_map->size + size) { > > > + vm_map_unlock(pipe_map); > > > + if (cpipe->pipe_buffer.buffer =3D=3D NULL && > > > + size > SMALL_PIPE_SIZE) { > > > + size =3D SMALL_PIPE_SIZE; > > > + pipefragretry++; > > > + goto retry; > > > + } > > > + return (ENOMEM); > > > + } > > > + error =3D vm_map_find_locked(pipe_map, NULL, 0, (vm_offset_t = > > *)&buffer, > > > + size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); > > > + vm_map_unlock(pipe_map); > > > if (error !=3D KERN_SUCCESS) { > > > chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0); > > > if (cpipe->pipe_buffer.buffer =3D=3D NULL && > > > > From nobody Fri Sep 20 21:09:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Q4R5Vvqz5X4hb; Fri, 20 Sep 2024 21:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9Q4R2s6Wz4m26; Fri, 20 Sep 2024 21:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smYR+YBbyB8SzpUuIR4sFkBzTLwqYRNCcAhqTwu/+ws=; b=NVeevzfj+zz3cWu8tXF5Nn4CylKK+JzGBDOLtSSnJdJ+i5WMDJPF70qxXB8Byd9b36H3LW NZsTZ+0NepObm+zHwUBgclBIeGJnFpx702BEhAvABRsAxqg8LIwPeVoNYbYQBzNseeZRH9 2a5fh4+JnTZxf6NJgb7uTyif7siprQI2Dj2TRFgXpwWyqO93SVcwH3Mju6a5WScA8HS0is vqZ4K5LVONcUJ2rnSyTR6/5IX2EmlupDaBXeZXIZSVR/55bNYXGWOyk9K0hOXaY+MxM1JW emqcqPHdWFKBApYs6PzMLQx3Pmd7z+ovA3g+8s2LrE+qa/Rtf6B6XzcwNRYqAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726866567; a=rsa-sha256; cv=none; b=xLJLSMOJkdb4B1gbuF2oUcQF3u9kYsOm1MX7uMc0FU/MFQ2hQXJFcObspwerc9iHeBeoRH Pkjh6USWrOPLStoeL3Vo5IK/EsTxMN2EQxCuTKJtWpH052WtmdCdGU4OkErS74OHIMJq9Y lISakTkmrVgup869wMuy6W/kdn3S2M6b8R/EOLt+r7sd0i/HgRDSe3orj5mbyclifTzGtm 2+GuoK6Zn/7zXS4rC8C8ZQiWKdJqdD+sBIpQNbLpajmMu7VnkB9vkeZV4AvJwDrJMoGrxV LWdGEgPp8GGFJW8V9Nd39SivDycsUDMyIdmhrF98e20iU+oequ9uORzVn1LLPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smYR+YBbyB8SzpUuIR4sFkBzTLwqYRNCcAhqTwu/+ws=; b=nN/rzm129Xxkoq6q9QahqQroo1JBCMQydxlgi6rDF9d13euGj8Bod+XulgvPUrRH29Qsrb wwm1ygg3O/cdlGA10gXRx6X7onZv8S1Ii6i57M4R0kvataM8v+YSH7djysvrOq76PGvkR8 9+iZHtnQnOP+6HpGGzbJCZpTRenmB0nI8oACfcjWlVU19mBdJgmDfQg569XAlqc15BMXsI imcYo3DyiuU3p+PW15mEEhlJoBsqVD/Kd/plLm54MJe6WhWv9SdXvbf5623LPJHa2wI+H6 U4qV1Let3k2B4k4SxSqtPRfBxG84vTTBAWu096qSBjo4YJIjZCnbl9oXvs9Fcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9Q4R2LFxz151X; Fri, 20 Sep 2024 21:09: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 48KL9RMU078680; Fri, 20 Sep 2024 21:09:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KL9RZ1078677; Fri, 20 Sep 2024 21:09:27 GMT (envelope-from git) Date: Fri, 20 Sep 2024 21:09:27 GMT Message-Id: <202409202109.48KL9RZ1078677@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: a52b30ff98cd - main - sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a52b30ff98cdab82af140285fa7fcdf1036fef27 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a52b30ff98cdab82af140285fa7fcdf1036fef27 commit a52b30ff98cdab82af140285fa7fcdf1036fef27 Author: Konstantin Belousov AuthorDate: 2024-09-20 18:48:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 21:08:51 +0000 sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf Tested by: yasu Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/sys_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 2b81d08f7077..6a5d150423bc 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1677,7 +1677,7 @@ pipe_free_kmem(struct pipe *cpipe) if (cpipe->pipe_buffer.buffer != NULL) { atomic_subtract_long(&amountpipekva, cpipe->pipe_buffer.size); - chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -cpipe->pipe_buffer.size, 0); vm_map_remove(pipe_map, (vm_offset_t)cpipe->pipe_buffer.buffer, From nobody Fri Sep 20 21:09:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Q4S5g2cz5X4wD; Fri, 20 Sep 2024 21:09: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 4X9Q4S3S8Zz4llp; Fri, 20 Sep 2024 21:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hEBDjNVthahqVlw9Qro3vw9ruo1I6X+awvBGfe+o41s=; b=sJHNBoV2H9SABTjfpm6CW81o+ehBwmij2aF5pQaDxcXq0pwnDQge3q0794LeC7tns3nv25 W8909BdATSVmglRnukml6s7n7pPqIv6AfJfryw8XcKJek0j5T7VURRvF6yNa43MfW8Qq17 7ehY6WtpWalchZrFH+pzB7sbJJcG5ngCCe2sWElFsNhBBHSgDDm+XlVBkoHg1KESReTQxs aS4++gZ0IX22cxYfBWMWZri0OQvS0V8Pa7FxsyLR34WnMBOJgNvjualdG5grtGNle5N1Dq duiOFjTXpDH8BsB0jOoBg8CspMiAGiGkNtlcmkcpE4IQJBoXrfpWztynIXRJQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726866568; a=rsa-sha256; cv=none; b=Kp3Ut4YYte9YcFb17yjh6EltOFCT2hdMUedxvwxlS6q0QC14KW77kbgPl74M9x1wiU1Qjm v1d5kluYrLdfcU1qytYw/RyyxPPoc2FhSE7PSRRlrskZVHvZQDq/F6goueZIPBKyVHC4T1 Te4j5S1u5fch30f9Ct2dHj42wJwB14yUx+qjrFGu9B1nv3oCQiY9UDQQsBD7cvkoIgAFOn ZT4vTFM5CWkSkp22HGqnqjaSWo42FR9O6C9tsXza86pATsDv55qIFwahlr3VKKyKet0IuH qH1lcB/6kdGo70SzaKR/CW4SYTEhGZ5KH+P4Z+7kQVEvOlWfUcnxgtniwQTIeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hEBDjNVthahqVlw9Qro3vw9ruo1I6X+awvBGfe+o41s=; b=mX4BnZ0jsTxS9ZofLdsJH+I0o+RBNyX5va4fivhH9kouDgRYNCK9Q4RvGuDYxOlU1PHxNs SYIcCbH2W3PVDRR/FZF4w9yTCQr1vKxhRNKv/3pTudYHUv5U3V2Hxza//yLuHqXnJhR7kY 3vu2+kM5J5nR5V0O25HpIIfqnqwy+0Nsmz25KADTM21WM5aUT5nMSwoI5Xb422CBFJG9MX pgA1nrOWMdvwCwqIkvn2ToOhGXOhM0+W9jgwk3YQ2Xi6++A2nw/PTTE9C08J3KfRHHS7Ji ZfbDxsY2W4qGUe7rIrrrIURE9Qw9T3LURetybX498tXzWFY8FjHyA+fS+/HXJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9Q4S33Z8z15Bn; Fri, 20 Sep 2024 21:09: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 48KL9StW078731; Fri, 20 Sep 2024 21:09:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KL9SjD078728; Fri, 20 Sep 2024 21:09:28 GMT (envelope-from git) Date: Fri, 20 Sep 2024 21:09:28 GMT Message-Id: <202409202109.48KL9SjD078728@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: af96ccc6a508 - main - uifree(9): report non-zero values for all shared resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af96ccc6a5083ae9ed62dbb1d72674ca75948707 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=af96ccc6a5083ae9ed62dbb1d72674ca75948707 commit af96ccc6a5083ae9ed62dbb1d72674ca75948707 Author: Konstantin Belousov AuthorDate: 2024-09-20 18:48:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 21:08:51 +0000 uifree(9): report non-zero values for all shared resources Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_resource.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index d1a1d3ea3811..58723289af21 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1510,6 +1510,18 @@ uifree(struct uidinfo *uip) if (uip->ui_vmsize != 0) printf("freeing uidinfo: uid = %d, swapuse = %lld\n", uip->ui_uid, (unsigned long long)uip->ui_vmsize); + if (uip->ui_ptscnt != 0) + printf("freeing uidinfo: uid = %d, ptscnt = %ld\n", + uip->ui_uid, uip->ui_ptscnt); + if (uip->ui_kqcnt != 0) + printf("freeing uidinfo: uid = %d, kqcnt = %ld\n", + uip->ui_uid, uip->ui_kqcnt); + if (uip->ui_umtxcnt != 0) + printf("freeing uidinfo: uid = %d, umtxcnt = %ld\n", + uip->ui_uid, uip->ui_umtxcnt); + if (uip->ui_pipecnt != 0) + printf("freeing uidinfo: uid = %d, pipecnt = %ld\n", + uip->ui_uid, uip->ui_pipecnt); free(uip, M_UIDINFO); } From nobody Fri Sep 20 21:09:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Q4T6XZQz5X4qg; Fri, 20 Sep 2024 21:09: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 4X9Q4T4C2zz4ltj; Fri, 20 Sep 2024 21:09:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Ws0tfPS019+sN7QqeiqKssfBC0ZSEjnyt2gjrunCV0=; b=r9Oy2wlv5pKyyLGWs31hh4JCs0rvnVSJjnHHER7wR5Ea1zLHZ9ppOdpdPthd8HwJQ/v0xY jEfsRYPBhemdBgKxshEYlzJXACVUqBRscHxckPcJdwDiYP7oXt8caH6NEcrXXkxaonw6ae GOMQ652wenOlBAwVSrbbeaY+eH4kLpoThjdT/z9wThssLB87SCoE3ldst4HrEPzbe/PBjZ vz82/A0uiE0CfOtS1scBUb00z50ZMw95RTlY0Ck948y8dDWUD9/k/HXBzPq7yzYFtj8kdd jP6kooQeQ6TNWU33ndh+pZ2U+h6QrDlCBkF1DFqkmR9Rem2Rxr8hjX30YW1SDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726866569; a=rsa-sha256; cv=none; b=j0LgIGfLKbeKFr4dghcJ/pjr5a84+AtjITFh/DnyyIA/xo1Ql3FSe0AQAHTUgzZo+GeYpk FGf6jb8zsSqRyp+RmP/PWo99bS7P2yKnRwb8aadKbRCl4aV3tTl6Y5meai4+yJiGRTFiLt YTjsIBsg5O+TqzDIDGMvRQeEMI+pae77moxndsFwIdv7B83E+KARzoxecLTpdgrN92+X+v I0uN2aeP9eZTU1eeIkqmduGXeNOGsE96XlcIvtfl/Ogc5qh3B5Rn0d23bJ72iWBDQbNelx QU4dprxOM1TkDB4qIJXcgKOjTo6g7qPEwUF1sINX7BqqXl9GGSMQWjJlzIMx2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Ws0tfPS019+sN7QqeiqKssfBC0ZSEjnyt2gjrunCV0=; b=f9HV9K8WQ5IrL2rx6A7JGrrMjCH7XC28u4bnrGhjbcWXzLE2pIFSUZF6NKi9zXlDxAKd/O qJgvkbepjnFDU2mqhMvCKYxS8dTcf7TgTbR1DTV0p8RN7LxI+wlaaALjF1ugWkhMXDRzx2 FO9bpNR55s1XZ7I23Kui1xg24IqHcH4pouHZeL/eb/RPbKBORfBX8Dn4srg+SGj5CBgI9x lDT31JjiFPoDqLBJa51u/LjghkGro1iQDlD58chMUOdiC7khIf7taHyUb+n28BkZ8jFnDX 33ppUS5JTlS3tANOOL2/Ny8Gt0mWyGL/W+vfGVv2dXDbav8E5fBtXXH1R48qkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9Q4T3pX2z15Bp; Fri, 20 Sep 2024 21:09: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 48KL9T3A078776; Fri, 20 Sep 2024 21:09:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KL9T5l078773; Fri, 20 Sep 2024 21:09:29 GMT (envelope-from git) Date: Fri, 20 Sep 2024 21:09:29 GMT Message-Id: <202409202109.48KL9T5l078773@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: 2c1963d46335 - main - procfs rlimit: handle pipebuf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c1963d46335576d29fe21a4e7b424c47b711ef4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2c1963d46335576d29fe21a4e7b424c47b711ef4 commit 2c1963d46335576d29fe21a4e7b424c47b711ef4 Author: Konstantin Belousov AuthorDate: 2024-09-20 15:04:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 21:08:51 +0000 procfs rlimit: handle pipebuf Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/sys/resource.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/resource.h b/sys/sys/resource.h index c18e45d50b30..81346028f1ed 100644 --- a/sys/sys/resource.h +++ b/sys/sys/resource.h @@ -127,7 +127,7 @@ struct __wrusage { */ #ifdef _RLIMIT_IDENT -static const char *rlimit_ident[RLIM_NLIMITS] = { +static const char *rlimit_ident[] = { "cpu", "fsize", "data", @@ -143,6 +143,7 @@ static const char *rlimit_ident[RLIM_NLIMITS] = { "swap", "kqueues", "umtx", + "pipebuf", }; #endif From nobody Fri Sep 20 21:09:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Q4W07jzz5X51J; Fri, 20 Sep 2024 21:09: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 4X9Q4V4xvwz4lrG; Fri, 20 Sep 2024 21:09:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jnyrV4dybYriOs6hnWI3oznzJo2A8VEnxjgOjkVjXoA=; b=FSdM6E+FdhU16Lp41xfgB/Dikxi2ls6PNHjVa8wN33UvkGgNhQrjFGfUa4SjJtCu/dVsxA X30LUuZS3IzhoDW7NeC7umK98HDP7NL6zN6pOCho7noKyfu4P+kdRDEPQIXVhkHV3wJGsF VQ9y+Nj54F6EJ9Q/YEBhTB4ZqrFoRY5z3BxW4vGhQAbSyLHy6rN7spJUH2whiXaFrkbrx5 fNZTZimTWfbsJZLwazC3oqkGLc09tvz4J/wBZWuYILsLW7VexqIeALSo7uOTu1AGDqdn6q /oPanUVvkcPjW5qE6u4LB0+6QA1PBy/WHhQGc8ro9zqgIatwTLSNhQE+YBrlgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726866570; a=rsa-sha256; cv=none; b=rxdi2zYFVGgz0pJrMLit2u5RyZaytDPNkL/lQ3/fOvDA7So3/w13Z2UbAP07FOZoJ0MyMu c2KUF/IDQFaKM1RAnSuVg9ZyCEWaVmLvIwQjPmgF5AJxr1kntJfNs0G7V0YKpVGxnLyzrt J3qZd+uMcEGPhm1leViDITZmIPPMwR922LwcgomRsMRlaq4oAPxFytG4VP2pmuTMVE3YEw e/pd3jQ3cLG8XYkKO/mjafQMEtWunM5Oe0LnXDn69ralFmb5tbDQFlA55aNTbckAMQzQbH gzFqxTi1USDzgevSd2L0xJAgaeHE/n2OrA1vRsS29E3ONKQC6M7OpPfi0UPdCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726866570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jnyrV4dybYriOs6hnWI3oznzJo2A8VEnxjgOjkVjXoA=; b=D0KK1QnbPOfM8nVN6kfR5gnu+xeJ+Pbn+qfLL+3zaEYlQhuasAHYvO2fQHyODH/PVY43X3 GRXLIQOeocpBKt2PeLWRMNGZjXDrhuYcJUBd0IHi/iwc7JeNgpkQE8NvHSSt/GVtGIJKjA OA1ldU5RrT11Au65aboqQYKqroBM32pTHHkVz0smJ2W3m7rjCJXWT/k3jCDgUu7YttWJLN QzHb/FhzMwRGAlICOSNzG6MhBgV3LeqC//dcZmP/gXIP5B0MnZove8fP0EgHcL0ui/gFS2 Rftu/HxZbLrBndh7Pn1TI3iX0UH2SmjL98HiWw/lebohgZHIhOZPNc72s3FBQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9Q4V4Z7Tz15F4; Fri, 20 Sep 2024 21:09: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 48KL9U1U078842; Fri, 20 Sep 2024 21:09:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KL9UXN078839; Fri, 20 Sep 2024 21:09:30 GMT (envelope-from git) Date: Fri, 20 Sep 2024 21:09:30 GMT Message-Id: <202409202109.48KL9UXN078839@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: c84d8db0ab3d - main - procfs: ensure that RLIMIT_IDENT is properly updated when a limit is added List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c84d8db0ab3d02f65422e8dcdc1f911cc15a04ec Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c84d8db0ab3d02f65422e8dcdc1f911cc15a04ec commit c84d8db0ab3d02f65422e8dcdc1f911cc15a04ec Author: Konstantin Belousov AuthorDate: 2024-09-20 15:04:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-20 21:08:51 +0000 procfs: ensure that RLIMIT_IDENT is properly updated when a limit is added Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/fs/procfs/procfs_rlimit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/fs/procfs/procfs_rlimit.c b/sys/fs/procfs/procfs_rlimit.c index 83e11f44b3f8..6be933ac6e44 100644 --- a/sys/fs/procfs/procfs_rlimit.c +++ b/sys/fs/procfs/procfs_rlimit.c @@ -57,6 +57,9 @@ #include #include +_Static_assert(nitems(rlimit_ident) == RLIM_NLIMITS, + "resource.h RLIMIT_IDENT needs update"); + int procfs_doprocrlimit(PFS_FILL_ARGS) { From nobody Fri Sep 20 22:40:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9S5J18Nsz5Xb9h; Fri, 20 Sep 2024 22:40: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 4X9S5H5Mq7z5737; Fri, 20 Sep 2024 22:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726872019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uBiABiyXgA0pyptdEuiG0wr/EV0R5maur28zBFsfxWs=; b=ifwoxmhiDUqsAd499VHrQXqvKCELCog6cdcK6U9T/nIscvvdLOEj/e+6naR4FIlG3gPBRn aJEfwKCQPXhSz8xTLfDp76kxabE4P8Fe8czLXjKjIIDkHQk8o1nd0befYUoqH7Fa58dPmR dLlIuFXKGf4aIzUKzbw5j56DuyJQbF6QuT44X1vFg+PnhSl/EW3HJjcl3UJnWxBHdJEMmx 2f8wVhUpn3uS7mv4ojABG1u1xg/ZE3XGqIcTbPafllzAS5Od0BgE6soLYcXFKEiaVreqp8 X1XZG9mV1ibFpQPUFJZjJywQky1xoHUM5D6yRYchfO0/OaFUzHD6w+LATEJJpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726872019; a=rsa-sha256; cv=none; b=vLUZFacM7sTfe4U7FD/TKcwAg3w6ZweYsfQaRTde3NQdiOU4KsTGPhg/C4thLUEWpImtaG TGFLB0XAkUgkNENdWbW8UJYu6GL3QcBs6PsKF61AVLLD6YuckK7TBVilh+Ht8D3ihz4HK2 YNcpQBCYabG7juXEiDD+DNSE50jVbFiyLU5lVbpnXsBm911d5revPpg+A/tUfxSd/VEDoF bo6WS9y6wghk/AhAIxxUyk+wifHREJ0Sgd12Rn0PBGph16WDSNmCnuD8AYrMtNkTF+o3pa T4CMyMS0GnkMF/i6tohero6YeoN4HDKSGIfmnekjtIPFuklrRCxjYiyCFvQXng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726872019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uBiABiyXgA0pyptdEuiG0wr/EV0R5maur28zBFsfxWs=; b=pogBUjjxIhLhOvF08r4HW9eLMkw/R5bVW1OlzAUKIZIc59CiKiHy8qtziGKwNm0/kKdMCj 4X//vzRewMY50gKe6f9m3azkO4iMN6W23Si37bg/pjaTidTgzdIZ7w4+1BWI/ZDMW1r9KP Ws9ZuwyWxfVlQBZi16dpHTI4TYwKdbRqYpdPOMB2hnOYB+yXcqAGhaCW0ryOenfZQKuzpt 7NC22v+vBu2cHyyNUannlk7FbnZ2rlEBxXxALh3FkEyKS1nrWeMMB/QN+wmGu9sZ7tBrGT /ljfmtwjf2lHHqC25i0uhrntU/au/kGvsoyiTLkEf+mcuABNkNAJvWQ8xRw9zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9S5H4zm0z16P4; Fri, 20 Sep 2024 22:40: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 48KMeJI4040328; Fri, 20 Sep 2024 22:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KMeJRv040325; Fri, 20 Sep 2024 22:40:19 GMT (envelope-from git) Date: Fri, 20 Sep 2024 22:40:19 GMT Message-Id: <202409202240.48KMeJRv040325@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: 66efdefe78bb - main - mfi: Correct a struct member name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66efdefe78bb752de47bae49b72b76c1a79266ca Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=66efdefe78bb752de47bae49b72b76c1a79266ca commit 66efdefe78bb752de47bae49b72b76c1a79266ca Author: WHR AuthorDate: 2024-09-03 04:44:12 +0000 Commit: Warner Losh CommitDate: 2024-09-20 22:22:43 +0000 mfi: Correct a struct member name This 'struct mfi_evt_pd' typed member should be named 'pd' instead of 'ld'. PR: 281155 Reviewed by: imp, delphij Pull Request: https://github.com/freebsd/freebsd-src/pull/1402 --- sys/dev/mfi/mfireg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mfi/mfireg.h b/sys/dev/mfi/mfireg.h index f7e3ebc98cd4..fe5e1be29d38 100644 --- a/sys/dev/mfi/mfireg.h +++ b/sys/dev/mfi/mfireg.h @@ -1028,7 +1028,7 @@ struct mfi_evt_detail { } pd_prog; struct { - struct mfi_evt_pd ld; + struct mfi_evt_pd pd; uint32_t prev_state; uint32_t new_state; } pd_state; From nobody Fri Sep 20 22:40:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9S5K1tfbz5Xb7B; Fri, 20 Sep 2024 22:40: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 4X9S5K0Jj1z573C; Fri, 20 Sep 2024 22:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726872021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iDq0I3BkQQIteZ34BuTx6D+Iz+YHl/eP/Sv5LnVDGGY=; b=cWmbOHQs6EPJhLQb+a8PCsc+M5JnOUympqFH1xw43kAYBhmxS7nXRywrlLsqMB3bFjzBy2 YWsuFdnvThl8Yt6KYLeXclOrkxTsVUU73IWJA5XJsI9HbmuTD+sV+YH+MxNSgb1L1OrLBZ CSuj8FK7ct9QxDFAFRwdkBMA1ii2XzLkInxC7zQ/bicaTA0VlUlDAuclKd+hNaRRJ3EKK/ CY1qE5lcEeog0JySTRn1t+2gnAr87P1uDJGbWQB96eQpzdM1gQfF9XOWV+IBtrnB4RiyX+ MBhrlAE0ccBsGju3gH0MJuKrYYSNtAZe2wmY02kdubQ9Tf/u7SFJ1fkWs3UyRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726872021; a=rsa-sha256; cv=none; b=Tvq2qDMZuZTgtcRSwsWduPncnLIJFbGrpE9NiPHn0kee8InoP2W0jxG31Wdtmyn9JN0htb FNIhq67t2KETvfsFWCocx9zOXO1QNkwQhHrfJEJbk5rNyQdsC3faHwYkqBNZomSqZIlk+1 PlHCWqaUT49IxuOjxDAQgNZ6t5XwSMl2Thl8TSZ8Ie82dmkj4YYlK6XZ8EK3dp9xP3C7uW fq6nG8bILwEaVt2y8c/0MujFU/DaQGWKuNEaFKRrYykZmROAYONED7lUBwlLQH46OXxcfM 4rr1Ai777D3dSXQFZCEXYj6eMkLUIbghiTWVXr/lTj85BXXi6nboKFvbvZIsoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726872021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iDq0I3BkQQIteZ34BuTx6D+Iz+YHl/eP/Sv5LnVDGGY=; b=twd456Nd4N3U9Yh+Up5gZoA/2MVpNB4teXZICUwldbfkfDKaljB4k3q4bQugEgfepjX0g4 anIWelZzQ5v+KYL1VxEmmDqW4q311oyYMpzyBzmJkYQQrWgwnd3Vn2C96fRBOCS0QBVw2K Pdgrs1/DpwBXbLFZ2dbpWVScrveHgggOVpfJjfbsrh0oQvDqCCfzzTIBx07Dk83++xU+V4 MvjrKZmwRYEd6f/d009TeCFUvHZoYuzp6HU0zEcU9BoVZ3/ywCRU93XmDLCxZ+ysZJsjY0 uOHlIgC7Gvgir3t1Ag5GQQFjuHaC0CwdMoIKDwuiKDSRwtT4RN3gjJ1cGXM7tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9S5J5xdHz17PK; Fri, 20 Sep 2024 22:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KMeKwh040398; Fri, 20 Sep 2024 22:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KMeKXf040395; Fri, 20 Sep 2024 22:40:20 GMT (envelope-from git) Date: Fri, 20 Sep 2024 22:40:20 GMT Message-Id: <202409202240.48KMeKXf040395@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: c6ad7dcd9c44 - main - mfiutil: Fix incorrect accesses of an union member in 'struct mfi_evt_detail' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6ad7dcd9c44a49078841e9ec42bf8621ae312c7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c6ad7dcd9c44a49078841e9ec42bf8621ae312c7 commit c6ad7dcd9c44a49078841e9ec42bf8621ae312c7 Author: WHR AuthorDate: 2024-09-03 04:44:48 +0000 Commit: Warner Losh CommitDate: 2024-09-20 22:22:44 +0000 mfiutil: Fix incorrect accesses of an union member in 'struct mfi_evt_detail' PR: 281156 Reviewed by: imp, delphij Pull Request: https://github.com/freebsd/freebsd-src/pull/1402 --- usr.sbin/mfiutil/mfi_evt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mfiutil/mfi_evt.c b/usr.sbin/mfiutil/mfi_evt.c index 9f6c0c2246ca..d4eb48d9dcb4 100644 --- a/usr.sbin/mfiutil/mfi_evt.c +++ b/usr.sbin/mfiutil/mfi_evt.c @@ -395,7 +395,7 @@ mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose) printf(": "); break; case MR_EVT_ARGS_LD_LBA: - printf("VOL %s", volume_name(fd, &detail->args.ld_count.ld)); + printf("VOL %s", volume_name(fd, &detail->args.ld_lba.ld)); if (verbose) { printf(" lba %lld", (long long)detail->args.ld_lba.lba); @@ -403,7 +403,7 @@ mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose) printf(": "); break; case MR_EVT_ARGS_LD_OWNER: - printf("VOL %s", volume_name(fd, &detail->args.ld_count.ld)); + printf("VOL %s", volume_name(fd, &detail->args.ld_owner.ld)); if (verbose) { printf(" owner changed: prior %d, new %d", detail->args.ld_owner.pre_owner, @@ -412,7 +412,7 @@ mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose) printf(": "); break; case MR_EVT_ARGS_LD_LBA_PD_LBA: - printf("VOL %s", volume_name(fd, &detail->args.ld_count.ld)); + printf("VOL %s", volume_name(fd, &detail->args.ld_lba_pd_lba.ld)); if (verbose) { printf(" lba %lld, physical drive PD %s lba %lld", (long long)detail->args.ld_lba_pd_lba.ld_lba, @@ -431,7 +431,7 @@ mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose) printf(": "); break; case MR_EVT_ARGS_LD_STATE: - printf("VOL %s", volume_name(fd, &detail->args.ld_prog.ld)); + printf("VOL %s", volume_name(fd, &detail->args.ld_state.ld)); if (verbose) { printf(" state prior %s new %s", mfi_ldstate(detail->args.ld_state.prev_state), @@ -486,7 +486,7 @@ mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose) case MR_EVT_ARGS_PD_STATE: if (verbose) { printf("PD %s state prior %s new %s: ", - pdrive_location(&detail->args.pd_prog.pd), + pdrive_location(&detail->args.pd_state.pd), mfi_pdstate(detail->args.pd_state.prev_state), mfi_pdstate(detail->args.pd_state.new_state)); } From nobody Sat Sep 21 03:31:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9ZYW6V0Bz5X53F; Sat, 21 Sep 2024 03:31: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 4X9ZYW5wTsz4qwS; Sat, 21 Sep 2024 03:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726889503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WtWFWnl/BfQqEn4KkYFdUiPY5aHviW925WKkYLYgx3A=; b=aYjPEprxvvhNfBq25/emB/EdicqbnlmqAG3qn8JGek9Si2r/VLjkBbxZFjTSKsQUbx85UN KX1UhsjyONmib3fOL5E2d+tJPu9GBuQ8XKallQy4HleBJ+vRev1UeJ5mw/Ko7hP8mvBlcg vSTKwBhp0QVjNI5GGD3sxytknMSK92LOxlkuZmapLCdp43SKz7Otg1GPaiHVkiLGjOOT1q 1OevU1ovyExgTXBUptzn0MltoVTJKpkpLCOxqq5WluUBUk/BKSvNNbViU3FvuCuxp+v21a UT0Y19G73R2Z1Mr/NMEmpSoUnoycGYYxTDOGVG1Klhbb85jd4KpT3wUq/kz/Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726889503; a=rsa-sha256; cv=none; b=yvi8ENXhH9XpW58CTdtcMLcSu8sEko6blyvQVp1V+guwJI73MWLBHIMDmvnaWlNAwB+iEK WuaC0222vx7ndVtlqQIyjf75tLACZtHFGkuGYLRdbgSBb28a+oLLt0HXP3+jxCe55D84M/ ZxBQoW2N7A6MQPUkFDFnlqAVP7LXyyJhx9RwQh7MZJ/6CUN3WNiUynMOE5WT141wLLuGfi KP3NYSbOiqxyoCzoWL8Y6pGghpUwIrUHELfrwlrwOtDq62kftCOpBl/hScsrHvZFRqZ205 xo6jpyPpikUJY6cweyni7h7gLn3QbZSdyf6YP4t7e7AtMLXDTytyr/SCweYzxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726889503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WtWFWnl/BfQqEn4KkYFdUiPY5aHviW925WKkYLYgx3A=; b=YE1kWqhCOzpAHU8u7+Crlz5PKMGC+9XjhBS4lF6a8G3MfUKmtK0Ba8EX991njyiz7CS03b MM7q4gQX/AZFG6pa9BTFinLNawOecrGVWmvfqZsfNeZO7YPhq8cXQrTFE9NRgmfArSXdzk gti/XOX3rMA8Zsj9CMXCFO/eYnfC9vDPs8HkYKL0kxrxZCzZbpTUCeBzyOYC/FA3FehjZa ztdKKuIgN/r4srw2q2vZFg73e91Y81vBna290b1Q9ljGbuv0R/Em5LItaRsFlOpe8/OeFD 0zoCBwEXedlo/CnRBOc1KMFxpu6i+Q+FbCTVVW7z3vfsPCtCg/T/wczRYeIt5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9ZYW5CMDzHBM; Sat, 21 Sep 2024 03:31: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 48L3VhtB036355; Sat, 21 Sep 2024 03:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L3Vhqf036352; Sat, 21 Sep 2024 03:31:43 GMT (envelope-from git) Date: Sat, 21 Sep 2024 03:31:43 GMT Message-Id: <202409210331.48L3Vhqf036352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 36c516b31136 - main - ixgbe: update if_sriov to use the new mailbox apis List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36c516b31136f645472c12d8597534656272acd6 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=36c516b31136f645472c12d8597534656272acd6 commit 36c516b31136f645472c12d8597534656272acd6 Author: Kevin Bowling AuthorDate: 2024-09-21 03:26:42 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 03:26:42 +0000 ixgbe: update if_sriov to use the new mailbox apis This fixes a page fault when creating VFs and updates to the new mailbox API and naming conventions. The functionality works to the same level that it did before my recent changes. In particular on my 82599 it creates both passthru and ixv interfaces. In either case, the PF seems to lose the ability to pass traffic. The ixv driver fails to attach. These issues are present with or without my updates. If you use SR-IOV on ixgbe I would be interested in hearing what does or does not work for you. MFC after: 6 days --- sys/dev/ixgbe/if_sriov.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 112c34849e65..eab5ff8f5da0 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -100,18 +100,18 @@ ixgbe_send_vf_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) if (vf->flags & IXGBE_VF_CTS) msg |= IXGBE_VT_MSGTYPE_CTS; - sc->hw.mbx.ops[0].write(&sc->hw, &msg, 1, vf->pool); + ixgbe_write_mbx(&sc->hw, &msg, 1, vf->pool); } static inline void -ixgbe_send_vf_ack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) +ixgbe_send_vf_success(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_SUCCESS); } static inline void -ixgbe_send_vf_nack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) +ixgbe_send_vf_failure(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_FAILURE); @@ -121,7 +121,7 @@ static inline void ixgbe_process_vf_ack(struct ixgbe_softc *sc, struct ixgbe_vf *vf) { if (!(vf->flags & IXGBE_VF_CTS)) - ixgbe_send_vf_nack(sc, vf, 0); + ixgbe_send_vf_failure(sc, vf, 0); } static inline boolean_t @@ -374,7 +374,7 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) resp[0] = IXGBE_VF_RESET | ack | IXGBE_VT_MSGTYPE_CTS; bcopy(vf->ether_addr, &resp[1], ETHER_ADDR_LEN); resp[3] = hw->mac.mc_filter_type; - hw->mbx.ops[0].write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); + ixgbe_write_mbx(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); } /* ixgbe_vf_reset_msg */ @@ -387,12 +387,12 @@ ixgbe_vf_set_mac(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) /* Check that the VF has permission to change the MAC address. */ if (!(vf->flags & IXGBE_VF_CAP_MAC) && ixgbe_vf_mac_changed(vf, mac)) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } if (ixgbe_validate_mac_addr(mac) != 0) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } @@ -401,7 +401,7 @@ ixgbe_vf_set_mac(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) ixgbe_set_rar(&sc->hw, vf->rar_index, vf->ether_addr, vf->pool, true); - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_mac */ @@ -435,7 +435,7 @@ ixgbe_vf_set_mc_addr(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 *msg) vmolr |= IXGBE_VMOLR_ROMPE; IXGBE_WRITE_REG(&sc->hw, IXGBE_VMOLR(vf->pool), vmolr); - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_mc_addr */ @@ -451,18 +451,18 @@ ixgbe_vf_set_vlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) tag = msg[1] & IXGBE_VLVF_VLANID_MASK; if (!(vf->flags & IXGBE_VF_CAP_VLAN)) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } /* It is illegal to enable vlan tag 0. */ if (tag == 0 && enable != 0) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } ixgbe_set_vfta(hw, tag, vf->pool, enable, false); - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_vlan */ @@ -477,7 +477,7 @@ ixgbe_vf_set_lpe(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) if (vf_max_size < ETHER_CRC_LEN) { /* We intentionally ACK invalid LPE requests. */ - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); return; } @@ -485,7 +485,7 @@ ixgbe_vf_set_lpe(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) if (vf_max_size > IXGBE_MAX_FRAME_SIZE) { /* We intentionally ACK invalid LPE requests. */ - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); return; } @@ -507,7 +507,7 @@ ixgbe_vf_set_lpe(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) IXGBE_WRITE_REG(hw, IXGBE_MHADD, mhadd); } - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_lpe */ @@ -516,7 +516,7 @@ ixgbe_vf_set_macvlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) { //XXX implement this - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); } /* ixgbe_vf_set_macvlan */ @@ -529,11 +529,11 @@ ixgbe_vf_api_negotiate(struct ixgbe_softc *sc, struct ixgbe_vf *vf, case IXGBE_API_VER_1_0: case IXGBE_API_VER_1_1: vf->api_ver = msg[1]; - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); break; default: vf->api_ver = IXGBE_API_VER_UNKNOWN; - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); break; } } /* ixgbe_vf_api_negotiate */ @@ -552,7 +552,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) switch (msg[0]) { case IXGBE_API_VER_1_0: case IXGBE_API_VER_UNKNOWN: - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } @@ -565,7 +565,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) resp[IXGBE_VF_TRANS_VLAN] = (vf->default_vlan != 0); resp[IXGBE_VF_DEF_QUEUE] = 0; - hw->mbx.ops[0].write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool); + ixgbe_write_mbx(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool); } /* ixgbe_vf_get_queues */ @@ -582,7 +582,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) hw = &sc->hw; - error = hw->mbx.ops[0].read(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); + error = ixgbe_read_mbx(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); if (error != 0) return; @@ -595,7 +595,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) } if (!(vf->flags & IXGBE_VF_CTS)) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); return; } @@ -622,7 +622,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) ixgbe_vf_get_queues(sc, vf, msg); break; default: - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); } } /* ixgbe_process_vf_msg */ From nobody Sat Sep 21 04:18:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9bbn2vPkz5XBn5; Sat, 21 Sep 2024 04:18: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 4X9bbn24Bjz40Cb; Sat, 21 Sep 2024 04:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726892325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i+jffjl8Qb4e2gin+ZXoflu8OefwrD6Fy+yV3UqN1q0=; b=xuV6hiaTIBxdXX/enALFzYZZ+ANwNOeSZcSUJscvzD4v11t2enmtfw3RDTXoZTPGxUXxug wW7SuO80xsMKxErIcbWSTsYvO5xJahd0EujHuFaq5MDD/Go31jYErmbesXVYsK454r7qkG qKoeDuRNjmmH8KF2+CHk5LA556cT9vrLxAtKCdPJvMVNdV5dIH0Pvu7GffRtFRZeTaj21T vY3EUUV37YSR520fE+Y6Rb3rgYz7haNAwXIUmTagu5acCFqclLrNqwRmRmmuOaCogAG7W1 xyAYPbb8fCFq3fpT2fG88oz+wIjzUdogTJENKg6Gk/0SsLK2LuwKP+7ODk4qwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726892325; a=rsa-sha256; cv=none; b=jB7HF4IdMMDm75lfPB1TE4RWCDiymZdrTrO6CS0BSqWJTz/nx6x898xwsJze9B/t/sc5rV slheJntQRH0z21z+CmukZsupOd0x15gvDB5QJlzrnbs8rczkN5FIA1/qdLvYMz82QF0a1W K7PowyMY1/Z799AEW8ellF32++Sx311fPvJ5RzyTjBu52sLr6POEi/++s495LTIbaiidDp W+ukrv27ITmVBEn2dS971ZLr2xHGRKJMGZtEZE5uqzXsFgZYBDxW2erHg68l7wpeB5p3JP mlv8foeKy8WhgLqULBsQP9f4MPW0/dlaaHs5W0bX0yOS1Ey7ZAgoZIb21EFwfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726892325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i+jffjl8Qb4e2gin+ZXoflu8OefwrD6Fy+yV3UqN1q0=; b=heQOcY4NvqCBLgn6kXDlHniID2EgAGCU9rREngftyK9IuUYFSr1UqaF7sZcY2TSHqt7jnq EhqVUvqyZDZ2a7riv1+JtX+gkF/iiCP4ED3wxiM8ap0pYPB6rha0XAsiZ0fkVra8aHOAJk NfQ/cwlJDVhF1IBZh+fFbn+3Fslytus9tIc1nVYTVkcmWIw/3dKejjtERhz0gh05oHWFzo bdN3QDnlaiEgRxF3RhnJ0JphX/KAa+qtTqmzskzB6VWGXAy56XROXmbsHBbQHUuexXgUI9 /04SdiZCImFBpI2YfUQmZmzgNBEGcuqEt+qVJbvFzXL1pYhrtS6UH7uxl8PSWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9bbn1bFkzJTD; Sat, 21 Sep 2024 04:18: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 48L4IjbM010072; Sat, 21 Sep 2024 04:18:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L4IjdA010069; Sat, 21 Sep 2024 04:18:45 GMT (envelope-from git) Date: Sat, 21 Sep 2024 04:18:45 GMT Message-Id: <202409210418.48L4IjdA010069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 57f268ccfc66 - stable/13 - zfs: cherry-pick change from openzfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57f268ccfc662d274d82cfc4e0e0ecb2db5d616e Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=57f268ccfc662d274d82cfc4e0e0ecb2db5d616e commit 57f268ccfc662d274d82cfc4e0e0ecb2db5d616e Author: Zhenlei Huang AuthorDate: 2024-05-30 16:58:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-21 04:16:40 +0000 zfs: cherry-pick change from openzfs Vendor PR: #16210 FreeBSD: Add const qualifier to members of struct opensolaris_utsname Obtained from: OpenZFS OpenZFS commit: e2357561b9499296bff758afe4868dbc39735675 Note: this is required by the following up MFC [1]. No functional change. 1. 356be1348dac kernel: Make some compile time constant variables const --- sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h | 10 +++++----- sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h index 3481507d2c33..1c777f5fb91e 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h @@ -45,11 +45,11 @@ #define F_SEEK_HOLE FIOSEEKHOLE struct opensolaris_utsname { - char *sysname; - char *nodename; - char *release; - char version[32]; - char *machine; + const char *sysname; + const char *nodename; + const char *release; + char version[32]; + const char *machine; }; extern char hw_serial[11]; diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c index 0354b986cd5f..0bd7764082b3 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include static struct opensolaris_utsname hw_utsname = { + .sysname = ostype, + .nodename = prison0.pr_hostname, + .release = osrelease, .machine = MACHINE }; @@ -56,10 +59,6 @@ utsname(void) static void opensolaris_utsname_init(void *arg) { - - hw_utsname.sysname = ostype; - hw_utsname.nodename = prison0.pr_hostname; - hw_utsname.release = osrelease; snprintf(hw_utsname.version, sizeof (hw_utsname.version), "%d", osreldate); } From nobody Sat Sep 21 04:18:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9bbp5G62z5XBwR; Sat, 21 Sep 2024 04:18: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 4X9bbp3FB3z40Mj; Sat, 21 Sep 2024 04:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726892326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iqwXvF4QZwGwAWPHMPJogBdwqtdY8+dgK0Hhxx1bKwQ=; b=r+/4dZ/k8N4JZL77Fg03S3CMgMqodjrv0utEI8AL6V2y0X/iiziVYsEqGPHAUUHc9QjMxI XSX+Tx9Thx6BgE0X9gEssDuQdzGJ/5RpJYQdQKt+oHP5YpLvlR7VbsmZ2DbqyQV5dZOF3S vAtrQtb8KGrcwvCkktp9vbXHtsRO8UBHYyJCEpt5noY0s/pBmzG9cK97q6ONfufQCD5tST u3CIFVIMj/u2jt4MBiymc7fcR2HZej2A1q0q1VskcxQLI74beL7e9rZy3uJ6/8xETYBaFi H1ZG+H4rdsgDJzJuCK8Eu91SdwkFODWcGCsE3hml7fs5y5SYEQwbp6nqILZY7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726892326; a=rsa-sha256; cv=none; b=F2sa+chg6zLVte1uPshGt0QUCtEWcID7Z8tDMCR3EGt5cYsEgy1mGlF/GwxcFnahq+L2UO 4pO8bDgc85VMcAwGk4jHfOt2joqDj2rqOJLkeQ5QB7SvLonzlvHqqil+SDIin7w6lZ4kDr J3EpYYHPckFcmGqNvSyw6KnWCbt+KNA/SlM75RBrolKxGjCyrXgoKiaBdHzC6FNAsvCYCD B4gL0pDBiNvMioS2ChIaw3XlSVJ3AgjNe26imUvGDKx96KUaqgp2oN9z5CCONJCmFQCodM YoVetWECQEcoZmwuVIcBgEvLpxH0fF3EzsMm4vbQF1MQ5aL8VQDmK85vYlalpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726892326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iqwXvF4QZwGwAWPHMPJogBdwqtdY8+dgK0Hhxx1bKwQ=; b=wtP7V2GRGWhrjb6Z/VdO2rcLsCXqe0lIhK8aztz7SmnIvNpOceeBDwRBXlPmoxeYVYzWNk MpoWa7QHKM/jdbHNfeBAc6mUvDZbWshqgKBWYB91Co9E4Hr2WABXA/dEOuHWf7Ijha/z+b yiMrYPmc/Mb8Bmtt/zBAQPsdVMk+AKEq5aUj5V4yCWDUWKB4FbvRM6aZUbKfUtqj53YrYp avytKz8+2PfE02LPLtpkCUPbiEWXezt0PIEcXBkeBzMMT0STMnouRR7slHGuTOv0S8lYoF 4IIVblDP1R0vkcpVmdAnw8q1yDvGG5UTbYfpx9H7OKGEs2qOH/S6yMhLm5zTtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9bbp2h8szHgR; Sat, 21 Sep 2024 04:18: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 48L4IkwM010123; Sat, 21 Sep 2024 04:18:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L4IkNV010120; Sat, 21 Sep 2024 04:18:46 GMT (envelope-from git) Date: Sat, 21 Sep 2024 04:18:46 GMT Message-Id: <202409210418.48L4IkNV010120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: e38f24446f09 - stable/13 - kernel: Make some compile time constant variables const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e38f24446f09267647b3d893ae700c4c9e07bc78 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e38f24446f09267647b3d893ae700c4c9e07bc78 commit e38f24446f09267647b3d893ae700c4c9e07bc78 Author: Zhenlei Huang AuthorDate: 2024-08-30 10:26:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-21 04:16:40 +0000 kernel: Make some compile time constant variables const Those variables are not going to be changed at runtime. Make them const to avoid potential overwriting. This will also help spotting accidental global variables shadowing, since the variable's name such as `version` is short and commonly used. This change was inspired by reviewing khng's work D44760. No functional change intended. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45227 (cherry picked from commit 356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a) (cherry picked from commit 497f577f460ba93dda38910bf49b390fa610480f) --- sys/arm/arm/identcpu-v6.c | 6 +++--- sys/arm64/arm64/identcpu.c | 2 +- sys/conf/newvers.sh | 14 +++++++------- sys/kern/init_main.c | 24 ++++++++++++------------ sys/kern/kern_mib.c | 16 ++++++++-------- sys/powerpc/powerpc/machdep.c | 5 +++-- sys/riscv/riscv/identcpu.c | 6 +++--- sys/sys/copyright.h | 4 ++-- sys/sys/sysctl.h | 8 ++++---- sys/sys/systm.h | 8 ++++---- sys/x86/x86/identcpu.c | 6 +++--- 11 files changed, 50 insertions(+), 49 deletions(-) diff --git a/sys/arm/arm/identcpu-v6.c b/sys/arm/arm/identcpu-v6.c index 6293a5ccaceb..83e3e255d50e 100644 --- a/sys/arm/arm/identcpu-v6.c +++ b/sys/arm/arm/identcpu-v6.c @@ -50,10 +50,10 @@ #include #include -char machine[] = "arm"; +const char machine[] = "arm"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); static char cpu_model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index e913154f9956..8cce4b8be409 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -52,7 +52,7 @@ static void print_cpu_caches(struct sbuf *sb, u_int); static u_long parse_cpu_features_hwcap32(void); #endif -char machine[] = "arm64"; +const char machine[] = "arm64"; #ifdef SCTL_MASK32 extern int adaptive_machine_arch; diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b4872c14722a..b9f8da60411e 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -303,13 +303,13 @@ $COPYRIGHT #define VERSTR "${VERSTR}" #define RELSTR "${RELEASE}" -char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; -char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; -char compiler_version[] = "${compiler_v}"; -char ostype[] = "${TYPE}"; -char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; -int osreldate = ${RELDATE}; -char kern_ident[] = "${i}"; +const char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; +const char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; +const char compiler_version[] = "${compiler_v}"; +const char ostype[] = "${TYPE}"; +const char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; +const int osreldate = ${RELDATE}; +const char kern_ident[] = "${i}"; EOF ) vers_content_old=$(cat vers.c 2>/dev/null || true) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index d2c87cf5b777..2c5ba59b92f3 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -362,36 +362,36 @@ print_version(const void *data __unused) printf("%s\n", compiler_version); } -SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, +C_SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright); -SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, +C_SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, trademark); -SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL); +C_SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL); #ifdef WITNESS -static char wit_warn[] = +static const char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; -SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, +C_SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, +C_SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, print_caddr_t, wit_warn); #endif #ifdef DIAGNOSTIC -static char diag_warn[] = +static const char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; -SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, +C_SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, +C_SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, diag_warn); #endif #if __SIZEOF_LONG__ == 4 -static char ilp32_warn[] = +static const char ilp32_warn[] = "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n"; -SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, +C_SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); -SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, +C_SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); #endif diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index ee3e36c0b5a8..7238df89d833 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -94,20 +94,20 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Regression test MIB"); #endif -SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, - kern_ident, 0, "Kernel identifier"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, + kern_ident, "Kernel identifier"); SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, BSD, "Operating system revision"); -SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, - version, 0, "Kernel version"); +SYSCTL_CONST_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, + version, "Kernel version"); -SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, - compiler_version, 0, "Version of compiler used to compile kernel"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, + compiler_version, "Version of compiler used to compile kernel"); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, - ostype, 0, "Operating system type"); +SYSCTL_CONST_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, + ostype, "Operating system type"); SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxproc, 0, "Maximum number of processes"); diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 85d741d11b1a..af57a3c5f641 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -148,8 +148,9 @@ static char init_kenv[2048]; static struct trapframe frame0; -char machine[] = "powerpc"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, ""); +const char machine[] = "powerpc"; +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 39bc0e3b91af..88b0b08c9f2c 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -60,10 +60,10 @@ #include #endif -char machine[] = "riscv"; +const char machine[] = "riscv"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, - "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); /* Hardware implementation info. These values may be empty. */ register_t mvendorid; /* The CPU's JEDEC vendor ID */ diff --git a/sys/sys/copyright.h b/sys/sys/copyright.h index 05e2309edd80..2b4a9f67bdf1 100644 --- a/sys/sys/copyright.h +++ b/sys/sys/copyright.h @@ -43,5 +43,5 @@ #define COPYRIGHT_UCB \ "Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994\n\tThe Regents of the University of California. All rights reserved.\n" -char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_UCB; -char trademark[] = TRADEMARK_Foundation; +const char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_UCB; +const char trademark[] = TRADEMARK_Foundation; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index ff87e32df2b7..45ee1a8b1c36 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1135,10 +1135,10 @@ SYSCTL_DECL(_regression); SYSCTL_DECL(_security); SYSCTL_DECL(_security_bsd); -extern char machine[]; -extern char osrelease[]; -extern char ostype[]; -extern char kern_ident[]; +extern const char machine[]; +extern const char osrelease[]; +extern const char ostype[]; +extern const char kern_ident[]; /* Dynamic oid handling */ struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, diff --git a/sys/sys/systm.h b/sys/sys/systm.h index ee432fb0d864..7dbdec0850eb 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -53,9 +53,9 @@ __NULLABILITY_PRAGMA_PUSH extern int cold; /* nonzero if we are doing a cold boot */ extern int suspend_blocked; /* block suspend due to pending shutdown */ extern int rebooting; /* kern_reboot() has been called. */ -extern char version[]; /* system version */ -extern char compiler_version[]; /* compiler version */ -extern char copyright[]; /* system copyright */ +extern const char version[]; /* system version */ +extern const char compiler_version[]; /* compiler version */ +extern const char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ extern u_long pagesizes[]; /* supported page sizes */ @@ -113,7 +113,7 @@ struct ucred; }) #define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) -extern int osreldate; +extern const int osreldate; extern const void *zero_region; /* address space maps to a zeroed page */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 450df6807920..248be3730a5a 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -120,7 +120,7 @@ u_int cpu_power_eax; /* 06H: Power management leaf, %eax */ u_int cpu_power_ebx; /* 06H: Power management leaf, %ebx */ u_int cpu_power_ecx; /* 06H: Power management leaf, %ecx */ u_int cpu_power_edx; /* 06H: Power management leaf, %edx */ -char machine[] = MACHINE; +const char machine[] = MACHINE; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, @@ -154,8 +154,8 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); #endif char cpu_model[128]; From nobody Sat Sep 21 04:18:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9bbq5zt5z5XBnG; Sat, 21 Sep 2024 04:18: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 4X9bbq43Q0z40Mn; Sat, 21 Sep 2024 04:18:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726892327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tbGAg5dcUq5eVmbfgJsDSsFQcYCr3u52v4B3iA2LN4c=; b=LuICnlklcGpP8jkCBtOCGkCU7gDmqt4Nyuqo2ShuEwT6ze53YxaCd5z+fHxgQmvcfkr9K/ u+Y/I5lBfh8loB/Oc91vZP1/BDvW6VB7kJMuF7n9nS8J8KWGPbY7FOjGZ0TBIgaASXxzfR f7aMp16sl34HhsUdDBXjwoTmv5c0hEO4Xzf5Kong5NYV6ydOyvs/w1qsecPkfmXUS95KiZ 78qLZGCqU+zyQt2ufRTQkrvKnWVf6Ul3RnEOmEDz7h9sNhpIu6qCzL92xCv5e7U9rl3x8D Otf7lg24fRCOA8hNGGw9XArrFcvLG2GbuNqKpRlmPexN00oQdS46iB08LXDjlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726892327; a=rsa-sha256; cv=none; b=l7SQ8d79tFxZCQaGXA9vSqV0/Okn5B+793eKDiUdgXBB8w9O5/F0wkLK6KYIyVh5xe3W0c LJoND56ag1vBBXX/kbzbQGmyASsrOf21jS58IhN+ngMuiTs1+X/YFOwZgheV7969mc8vUv vN6oAhO0c43YGMAn54lxoPEAsu7kRfBScpcM19XBZiuWobtSawJBQ1W93MpqRszMsOqpZl s0JFeD/oRZU7CLjM1XlA8iywxGDqlMK6UCFQ9manUC1Vw8vtgc/6QfJL591lPHx+erLYwo t51TEcWxZJBvwCEaeFB3EfMr1kzbLgfmr9rllHVPR5si/uqLqTy0Jz2E9LFUPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726892327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tbGAg5dcUq5eVmbfgJsDSsFQcYCr3u52v4B3iA2LN4c=; b=pRwWZJxeXZ+tKOiPuaUAUwAXLfDGWKzX+yQp1ZDAk8U5D6K7ppsDmcjNICSlDhePduRYaH YGmaNnW/U/R3IXURA1KGBUtsULbJfyOQxnpMe4QB2bkoTY2K0YBlaTRIE7sT6P8RpyZeDX YeuN8E8XXTZ1abXwsdX4qNQZ/oXER26sUq4LFiw+UrSQ9ejwTFlmsGoGkM7OXP5uqAtZ8I RaqHkiHY1bjDU6CYbfGIIh2ExHx2z/E/HdrQ3Fhg6WBILqmWaURLKwfJYyAKYGNJJb5mcY jfADdRpW3XrO5Oo844Y8H13f1VWXdSc4BEXVy73o/sdV3bNMGGAzXFoUKRAqbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9bbq3gZ4zJ6X; Sat, 21 Sep 2024 04:18: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 48L4IlUd010175; Sat, 21 Sep 2024 04:18:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L4IlYl010172; Sat, 21 Sep 2024 04:18:47 GMT (envelope-from git) Date: Sat, 21 Sep 2024 04:18:47 GMT Message-Id: <202409210418.48L4IlYl010172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 9c3fc1da7b3c - stable/13 - mips: Make the variable machine const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c3fc1da7b3c9e34dfa48f4f4c4e41b16e7a72e7 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9c3fc1da7b3c9e34dfa48f4f4c4e41b16e7a72e7 commit 9c3fc1da7b3c9e34dfa48f4f4c4e41b16e7a72e7 Author: Zhenlei Huang AuthorDate: 2024-09-21 04:17:05 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-21 04:17:05 +0000 mips: Make the variable machine const Unbreaks mips build after MFCing commit [1]. While here prefer macro SYSCTL_CONST_STRING to avoid casting. This is a direct commit to stable/13. 1. 356be1348dac kernel: Make some compile time constant variables const --- sys/mips/mips/machdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/mips/mips/machdep.c b/sys/mips/mips/machdep.c index 877216c25b05..a520700a70a7 100644 --- a/sys/mips/mips/machdep.c +++ b/sys/mips/mips/machdep.c @@ -101,9 +101,9 @@ #define BOOTINFO_DEBUG 0 -char machine[] = "mips"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +const char machine[] = "mips"; +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); char cpu_model[80]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); From nobody Sat Sep 21 06:29:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9fW33SgSz5XPrX; Sat, 21 Sep 2024 06:29: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 4X9fW32T9kz4Cc2; Sat, 21 Sep 2024 06:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726900191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8NyPNpf9VHLoy7pBp2ZBJ63ukbQJAehrs+TyKJBoOPM=; b=NnhfT1qhqsR/sNUnN/wOj0m8tFqj7ZFqgnQNchWa4+Rdjn22eIcnMBkOgOdRxl/hw8ZxgB RTFU2vypYj9ORm9wMzBdjTe5aS3HxzlcZ2T5B0Br1dCUrhK8V5/Bw5jWO9QH5d2s/z6X0a 7CizQurSP2+gWXzOBPih2fVuOi4ask3AUWXDeRtWyCTo2vXnJBPsC38pDAondQlIo3CQFM 1HnZzCaeUVgohsdOqSuowynXite20SbZT1qcu0d6Yltj58XtW9zC/aMG7qpATQnfYL4Dpt V+UZri1Q5loROxAXvTQEXeMiyMRL4HXqlV8Vvx7DX3v2w+6G6qYvmNvYW56X3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726900191; a=rsa-sha256; cv=none; b=EihHwqhch8JTJiakRvecIgjp52cCi59To0pMcta6+az7cxqZnDISaASFrOkRPTDydYDdRo RJAs2gc5tpPG8APp0DMJDibXpL6/iGZEGvr3GSGr/EAqG1wwJvS/5TbuevoSd5CVzt7GSI eJpiMlCekXK37Ov5nCFquK33C8sShsKxStiiDyUC1QycUL2pHoFspjPQD6i/B5Ay5qlPjA CrtF7uVzIUXPSz2oILq0L4U7nLe0CrS5smj4y3KVwJbxaSHFIf63STM+in102LRFtujeDr /LSUxR4h2HGL7+YPkonXnr6x2MWv3k9qJQbVtfuLzFR0TO2jMKZAXwC32/KiYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726900191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8NyPNpf9VHLoy7pBp2ZBJ63ukbQJAehrs+TyKJBoOPM=; b=kZGSzB/8mYyIeyFehizF3hehaaTGpbMcKjg9LZ4NnkRQvpwMNGorMbdGDqaiUNbSwBkX82 F4pc9q741uJfiEHO9/Lw6URMtEuJHW96O9QTxZsTccqC1KtwTSLVrJ2oG00sm/T/fJZdha 0EE2U4X2uVs6h58rn3Cb83tmagwa6YEyUhuT8ALgkiFxrO6ZtHSEWJ7slJbZXXKqBA6ZcE mDTpMx5K5WJjB2OWeFuv7WftZ6B2bOYjUQAwFvTsT49S093RKQEYRtqPu5u+GntJGS9Z+H fiye5Hc9Co4hbtJiJJexzih9K1Y0acELLEzwYOfGttztx+j3XPgUU857/KhfSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9fW31mfqzM69; Sat, 21 Sep 2024 06:29: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 48L6Tpft031263; Sat, 21 Sep 2024 06:29:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L6TpLZ031260; Sat, 21 Sep 2024 06:29:51 GMT (envelope-from git) Date: Sat, 21 Sep 2024 06:29:51 GMT Message-Id: <202409210629.48L6TpLZ031260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: ddfec1fb6814 - main - e1000: Update igb driver version to 2.5.28-fbsd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddfec1fb6814088abc5805f45c4a18c5731d51b9 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=ddfec1fb6814088abc5805f45c4a18c5731d51b9 commit ddfec1fb6814088abc5805f45c4a18c5731d51b9 Author: Kevin Bowling AuthorDate: 2024-09-21 06:27:54 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 06:27:54 +0000 e1000: Update igb driver version to 2.5.28-fbsd Bump to the current out of tree driver version since we only have some gratuitous changes. MFC after: 1 week --- sys/dev/e1000/e1000_base.c | 3 ++- sys/dev/e1000/e1000_i210.c | 14 +++++++------- sys/dev/e1000/e1000_phy.c | 2 +- sys/dev/e1000/if_em.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sys/dev/e1000/e1000_base.c b/sys/dev/e1000/e1000_base.c index d83dc48c4d4d..ae44a0b91aac 100644 --- a/sys/dev/e1000/e1000_base.c +++ b/sys/dev/e1000/e1000_base.c @@ -162,7 +162,8 @@ void e1000_rx_fifo_flush_base(struct e1000_hw *hw) rfctl |= E1000_RFCTL_IPV6_EX_DIS; E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - if (!(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) + if (hw->mac.type != e1000_82575 || + !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) return; /* Disable all Rx queues */ diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index c7ca56914dba..4005034d7d31 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -362,7 +362,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw, E1000_INVM_RECORD_SIZE_IN_BYTES); u32 buffer[E1000_INVM_SIZE]; s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; - u16 version = 0; + u16 nvm_version = 0; DEBUGFUNC("e1000_read_invm_version"); @@ -379,14 +379,14 @@ s32 e1000_read_invm_version(struct e1000_hw *hw, /* Check if we have first version location used */ if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) { - version = 0; + nvm_version = 0; status = E1000_SUCCESS; break; } /* Check if we have second version location used */ else if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) { - version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + nvm_version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; status = E1000_SUCCESS; break; } @@ -397,7 +397,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw, else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) && ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) && (i != 1))) { - version = (*next_record & E1000_INVM_VER_FIELD_TWO) + nvm_version = (*next_record & E1000_INVM_VER_FIELD_TWO) >> 13; status = E1000_SUCCESS; break; @@ -408,16 +408,16 @@ s32 e1000_read_invm_version(struct e1000_hw *hw, */ else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && ((*record & 0x3) == 0)) { - version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + nvm_version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; status = E1000_SUCCESS; break; } } if (status == E1000_SUCCESS) { - invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK) + invm_ver->invm_major = (nvm_version & E1000_INVM_MAJOR_MASK) >> E1000_INVM_MAJOR_SHIFT; - invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK; + invm_ver->invm_minor = nvm_version & E1000_INVM_MINOR_MASK; } /* Read Image Type */ for (i = 1; i < invm_blocks; i++) { diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index 0aaf32125bbe..634f48171c3e 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -1037,7 +1037,7 @@ static s32 e1000_set_master_slave_mode(struct e1000_hw *hw) break; case e1000_ms_auto: phy_data &= ~CR_1000T_MS_ENABLE; - /* FALLTHROUGH */ + break; default: break; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 690d6dfa3218..3d815348f5ec 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -37,7 +37,7 @@ * Driver version: *********************************************************************/ static const char em_driver_version[] = "7.7.8-fbsd"; -static const char igb_driver_version[] = "2.5.19-fbsd"; +static const char igb_driver_version[] = "2.5.28-fbsd"; /********************************************************************* * PCI Device ID Table From nobody Sat Sep 21 09:42:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9knv5pzsz5XkKv; Sat, 21 Sep 2024 09:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9knv3s7zz4XZ1; Sat, 21 Sep 2024 09:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726911779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5zeo7sjg0lcqEZLmb45CYq+f2W2RnWnawcsUEGcaGg=; b=cuHWpfuycZNFTG+S3NQAKcnl9p9EgFsZppVmhJL1+ctSp4O038kWlJUAFPuzA8SloY+ZZj acqseAndzpPF5QU8DsODXBYZZNo+NGxG4+cWSVSC8LxsPKiDxtNcqQDJvoJGfgIk+LxzAK dm76jxKJeG7SDkEit9Ry2oXiBA3esiD8XNuZpzqVUn2cyyal3AGPSW0Wd7imAMoHId1evr N0/lfa3geJANpHCAUTrrhWP7ZUnHf70u8pemFjshkSLkxe6v9EM/PjpDw4Xzi120MP+Kzh UbdApcYTacOoqUc0KhobmDq9eY91zDaAwZdODCKkvwYTDM9C9t28EMub9DupEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726911779; a=rsa-sha256; cv=none; b=lBeucHQ27OsAmgaspIry7LkjmfiCC22jfSDZXRg02l6vQIjy++8BARy65Yr1vA4dt/V2XF i5qcaCEdSr0i/QcBjoKF/br6c/hfactWA/nBOOUwoCzJR1udQMb4rpuaMzPvgypMdt7GRc 9DUNkT/QPeYHuSmQcneKE8425esrPfL+iggQ0Lp6poNXvqHOMJ6bVKzbda7WNkKBSyFoG1 nSVFnJCBLO2yZSl4vJf66ngajN+f40DeF1bGYmu28IYZPE/8z6JZT0cdPl2bvRTiNUti6y 1HWpn50m1BBMUfY9qcdekAmhd/TW9P0W1v4noe7S8+Ky6tUg5NUiUz7tYbpdxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726911779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5zeo7sjg0lcqEZLmb45CYq+f2W2RnWnawcsUEGcaGg=; b=S1TfOwlrzVIK1mN9X910k5s5KNhuBHCmmMrEOf15lpa1RJRwZsot03pXEqDZpm4Cs2p3aM vMopSVUumSalHLdzYai4PPLs2aDMViVfMsnVCGShMHA4oKmVxlILifBZvEMUocF9dFffTl zwmcE9K4lLlen7DwmX8wnTFbieE30ss906fTqdwHPcvnn1qo/+3HFFuz3FAaAz1FipzhZG L8Hf/TCRMlFF7PJoaud0LD7HfU8ZQ+oh6BqeEyqaCeN0iHg5NbHE9WetyMRwQKxahkX2p/ tfL0dFodpnQ37CLCRNSpEvW3L+hSl6DKbSn13IImm7OZ9x2FBG1O9VrnPeA+nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9knv3SkczSYx; Sat, 21 Sep 2024 09:42: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 48L9gxuE068279; Sat, 21 Sep 2024 09:42:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L9gx4H068276; Sat, 21 Sep 2024 09:42:59 GMT (envelope-from git) Date: Sat, 21 Sep 2024 09:42:59 GMT Message-Id: <202409210942.48L9gx4H068276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c41a0eeea0d6 - main - ixgbe: update if_bypass to ix-3.3.38 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c41a0eeea0d69264317401dd3fac46be160081b5 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c41a0eeea0d69264317401dd3fac46be160081b5 commit c41a0eeea0d69264317401dd3fac46be160081b5 Author: Kevin Bowling AuthorDate: 2024-09-21 09:39:54 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 09:42:23 +0000 ixgbe: update if_bypass to ix-3.3.38 Bring if_bypass up to date with changes in the out of tree driver Drop NEEDGIANT as the sysctl handlers have internal mutex for state changes. MFC after: 1 week --- sys/dev/ixgbe/if_bypass.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/sys/dev/ixgbe/if_bypass.c b/sys/dev/ixgbe/if_bypass.c index e9ea77dfb49c..166150d75cc6 100644 --- a/sys/dev/ixgbe/if_bypass.c +++ b/sys/dev/ixgbe/if_bypass.c @@ -530,8 +530,7 @@ ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS) error = IXGBE_BYPASS_FW_WRITE_FAILURE; break; } - error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd); - if (error != 0) { + if (hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd)) { error = IXGBE_ERR_INVALID_ARGUMENT; break; } @@ -745,8 +744,7 @@ ixgbe_bypass_init(struct ixgbe_softc *sc) */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "bypass_log", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "bypass_log", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, ixgbe_bp_log, "I", "Bypass Log"); /* All other setting are hung from the 'bypass' node */ @@ -757,39 +755,39 @@ ixgbe_bypass_init(struct ixgbe_softc *sc) bp_list = SYSCTL_CHILDREN(bp_node); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "version", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + OID_AUTO, "version", CTLTYPE_INT | CTLFLAG_RD, sc, 0, ixgbe_bp_version, "I", "Bypass Version"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_set_state, "I", "Bypass State"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "timeout", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "timeout", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_timeout, "I", "Bypass Timeout"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "main_on", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "main_on", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_main_on, "I", "Bypass Main On"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "main_off", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "main_off", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_main_off, "I", "Bypass Main Off"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "aux_on", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "aux_on", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_aux_on, "I", "Bypass Aux On"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "aux_off", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "aux_off", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_aux_off, "I", "Bypass Aux Off"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "wd_set", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + OID_AUTO, "wd_set", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_bp_wd_set, "I", "Set BP Watchdog"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), bp_list, - OID_AUTO, "wd_reset", CTLTYPE_INT | CTLFLAG_WR | CTLFLAG_NEEDGIANT, + OID_AUTO, "wd_reset", CTLTYPE_INT | CTLFLAG_WR, sc, 0, ixgbe_bp_wd_reset, "S", "Bypass WD Reset"); sc->feat_en |= IXGBE_FEATURE_BYPASS; From nobody Sat Sep 21 09:45:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9ksK1ZTzz5Xl9m; Sat, 21 Sep 2024 09:45: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 4X9ksK0jngz4Xsv; Sat, 21 Sep 2024 09:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726911957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIangeb1Y+finBvu03DzpYJbjKjtr08sq7wVRqz/XOQ=; b=QqZVkNxcRUJAZSW5m3YzlgesZ5LizzCNqn6f2fe8NpHJegjJ45nOLoP2pqBtWFTFfvIXjy MouZMZfVn3bkwRHybagSaemWOXRIqdYZRWPZmpsJaq2yxF6ctgmYunzwqlpwoqlgx7lQvW 32hlVcGhTc3IQstsk5veUdfGRAEqrHZpBnlq81GSvFYDHWeKmEazTfUkbiivoEtfnwmCdb 6WBO63bK3l0fhaOdHT0jh0NArPBRzbTJH5kwqQW1m99sVeu+UDYKdJ/FQAJSN5+aqFFLOv QErM3ABi7cOBFA7S5o4iMVZhykb2HxfaCVV+IutxMwSW8VcsBXj8ESYtgmzNfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726911957; a=rsa-sha256; cv=none; b=TnjbnQjRcRrs2fPs8kuKfcx1pujs+pGiCwuKhlF4iz32t7+qgp3f23ScrhrIP0y0AFz2hS GkLzcvTg5kmXeUN7ZRTnOmgCTYs6PdPApPjnjyMY5ecsZhKw5ZRQHZlBqGzP6Fe3TZl3/Q 24Gc33ETVqj/y1dynH6W4YurpAH4QfEhNKY3jRnpiq+/loNjzyhG861oCEnV3EFKvga5/P ji0CdjbyWUbmLZ9/TnX+/waV0AsWCT5W5YhsqTfD46I7Xmb4d7nB2o7CE2T/Yw2u55BhWi 0KfxSjzUoQPqnJ+4R3ee2knWHw9/B9kkUTc2wLT8Uviz6uIqOrKRKoHZf8PT4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726911957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIangeb1Y+finBvu03DzpYJbjKjtr08sq7wVRqz/XOQ=; b=S76Ja4M0iMQ/zu59nQEy+8lJP9lnxdbp1nFrcS8/6blUppkYr7yd1vI4CRvUiy4I+r7zay 6SzjedIBxgJjj8REMmD9/pOJQH2eoev7UWrci9w9s2x5iG7MlFVPTyWjYBgWUoToH5sNSY 54p7H4vCeS2YHSb6uDFtaWpRWepDvKWnPT8/z67N86fsDNugLz42vL3B7SjrBmrNchiuP5 duNzFz3YJ6zsxWMz2qdRX/FqqKzsoHnkFN4h56uAcwIlZ38D/5w+0X3tStvGXtauenzas5 xA6q66hFWgG+XPA2Bj5wn1ORmHPtKRCo3Koc8/1TC7Ou3nLx857LuO0LrQFOgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9ksK0KJLzSc7; Sat, 21 Sep 2024 09:45: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 48L9juBh068811; Sat, 21 Sep 2024 09:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L9ju5a068808; Sat, 21 Sep 2024 09:45:56 GMT (envelope-from git) Date: Sat, 21 Sep 2024 09:45:56 GMT Message-Id: <202409210945.48L9ju5a068808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e06918b94ac4 - main - ixgbe: update ixgbe_phy with ix-3.3.38 changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e06918b94ac44448272a9d6747dcdba142e18b58 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e06918b94ac44448272a9d6747dcdba142e18b58 commit e06918b94ac44448272a9d6747dcdba142e18b58 Author: Kevin Bowling AuthorDate: 2024-09-21 09:45:12 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 09:45:12 +0000 ixgbe: update ixgbe_phy with ix-3.3.38 changes MFC after: 1 week --- sys/dev/ixgbe/ixgbe_phy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index c2f23179476b..e3f311473c38 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -1487,6 +1487,11 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) hw->phy.type = ixgbe_phy_sfp_intel; break; default: + if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) + hw->phy.type = ixgbe_phy_sfp_passive_unknown; + else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) + hw->phy.type = ixgbe_phy_sfp_active_unknown; + else hw->phy.type = ixgbe_phy_sfp_unknown; break; } @@ -1495,10 +1500,6 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) /* Allow any DA cable vendor */ if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE | IXGBE_SFF_DA_ACTIVE_CABLE)) { - if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) - hw->phy.type = ixgbe_phy_sfp_passive_unknown; - else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) - hw->phy.type = ixgbe_phy_sfp_active_unknown; status = IXGBE_SUCCESS; goto out; } From nobody Sat Sep 21 09:54:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9l2t50wLz5Xlwd; Sat, 21 Sep 2024 09:54: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 4X9l2t4Tzzz4Yk9; Sat, 21 Sep 2024 09:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726912454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BzgcTtdn2bzqZl01t4xFayNJ90dVNjxgo4J/rMWkKk=; b=NYd54BrTeyXsr8Yo2uXS91CyUNA0ZVveoYzQ9kpFJe/YNk5to4S6uQijDJmE/kC50tkz/H rUQxIikyJnezs2+wAJ6XrKFbso2CeRfv5hWUlq21s0BcihZWNjCF7BNhYxom/QlyS/OWKV hFw9e3zsF1ZlGHiURDyBqONo4yuoFj083fEAlcMAvA9trio8jhwrbEdGg1nsjFfYDVvMpl 7NuCNSZo9s+ZEmdk9Ht9G4X8VdTNbHUwI90lvll84sEmBHDsh9IYf1KPTexMGbN2rnb7aU EdAklTfLnV74Ps8NKrCkxjFhiyBRAd+2oI9f0SNK/YoojEvB4xw0RtMXUmwzUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726912454; a=rsa-sha256; cv=none; b=iWW7jdaOwZNjJepXC4HXiIIbpla6D8e1O+Q5vldBfNAxsJnPlpCXZPvKdhGldbZOezAepX QpY7eDSFPNhINpi54E5RNMm2pZM0uSoNLAOnzL+eQ1/9ZyTYCTrMxOhqmrdqe3RVWMCStt L8mY6hG4ojBdnQ5dIJlhNQQsSBlDEzwRmrummQsD1W7/J1D0OI6wqqhRZztDM2lIm2QQx4 IAtl6IWzFDe73p9fIdJ7mlNg5YBNh5kcZ+jl0kVyLe9LGa0EK37l+AbMVIGCuq4WzmiYMV CC9XLAnexTXG05q8O6EKwX+545fMC4Tj7BVobtJQczONBZLvq+D3cdQ+ngSeGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726912454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BzgcTtdn2bzqZl01t4xFayNJ90dVNjxgo4J/rMWkKk=; b=FAm8GwVDd/eMw3mbn8m6NRA0wXh1OGmRME0ExopPyViGYOx+O6idcOVzCNcGhraPrHf+AP R/sAkKs9N/B012YtFEw7PwfcnBkwFYkT2zrFSyZ1LRsuW9lI9ghaUx3hXaG1qt5b6x8TnB Wqgp250sMnBrGAGfSTmU46kuxZb88TLYKX4ezqvnoPZlmgTt/D3bs3QAs9E4LybTJc4Qhh /VyGEMBXDKgX8QJpPLWF9gInMOfjMkmVn6ILWrtwUb/Ld7hE33T8euSm8hQA7Olj7wFBvC /HJ1C6TnTIl8J8aJyarj+KWnYETgemfmRN60UjfEZt/DbEHTLAtVXcdsQgCZtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9l2t459HzSgT; Sat, 21 Sep 2024 09:54: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 48L9sEch085929; Sat, 21 Sep 2024 09:54:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L9sEL4085926; Sat, 21 Sep 2024 09:54:14 GMT (envelope-from git) Date: Sat, 21 Sep 2024 09:54:14 GMT Message-Id: <202409210954.48L9sEL4085926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 0acea458f82d - main - ixgbe: update ixgbe_mbx with ix-3.3.38 changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0acea458f82d95b75193bf6ce6321906032abf40 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=0acea458f82d95b75193bf6ce6321906032abf40 commit 0acea458f82d95b75193bf6ce6321906032abf40 Author: Kevin Bowling AuthorDate: 2024-09-21 09:47:11 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 09:47:11 +0000 ixgbe: update ixgbe_mbx with ix-3.3.38 changes MFC after: 1 week --- sys/dev/ixgbe/ixgbe_mbx.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ sys/dev/ixgbe/ixgbe_mbx.h | 1 + 2 files changed, 45 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 0a0c5abde157..5f1f64e02b82 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -199,6 +199,26 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) return ret_val; } +/** + * ixgbe_clear_mbx - Clear Mailbox Memory + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * Set VFMBMEM of given VF to 0x0. + **/ +s32 ixgbe_clear_mbx(struct ixgbe_hw *hw, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_CONFIG; + + DEBUGFUNC("ixgbe_clear_mbx"); + + if (mbx->ops[mbx_id].clear) + ret_val = mbx->ops[mbx_id].clear(hw, mbx_id); + + return ret_val; +} + /** * ixgbe_poll_for_msg - Wait for message notification * @hw: pointer to the HW structure @@ -658,6 +678,7 @@ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; + mbx->ops[0].clear = NULL; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; @@ -1054,6 +1075,27 @@ static s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size, return IXGBE_SUCCESS; } +/** + * ixgbe_clear_mbx_pf - Clear Mailbox Memory + * @hw: pointer to the HW structure + * @vf_id: the VF index + * + * Set VFMBMEM of given VF to 0x0. + **/ +static s32 ixgbe_clear_mbx_pf(struct ixgbe_hw *hw, u16 vf_id) +{ + u16 mbx_size = hw->mbx.size; + u16 i; + + if (vf_id > 63) + return IXGBE_ERR_PARAM; + + for (i = 0; i < mbx_size; ++i) + IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_id), i, 0x0); + + return IXGBE_SUCCESS; +} + /** * ixgbe_init_mbx_params_pf_id - set initial values for pf mailbox * @hw: pointer to the HW structure @@ -1072,6 +1114,7 @@ void ixgbe_init_mbx_params_pf_id(struct ixgbe_hw *hw, u16 vf_id) mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf; mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf; mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf; + mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf; } /** @@ -1147,6 +1190,7 @@ void ixgbe_upgrade_mbx_params_pf(struct ixgbe_hw *hw, u16 vf_id) mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf; mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf; mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf; + mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 3a9bd34a137f..e6519963242e 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -195,6 +195,7 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id); s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id); s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id); +s32 ixgbe_clear_mbx(struct ixgbe_hw *hw, u16 vf_number); void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw); void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw); void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw); From nobody Sat Sep 21 09:54:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9l2v6S6nz5XmNJ; Sat, 21 Sep 2024 09:54: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 4X9l2v5KS7z4Z3D; Sat, 21 Sep 2024 09:54:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726912455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dOvyytHnUGi9K6C9bTl16/pww02trPqKlkJgfNJEVpY=; b=TcGg520jvcKAi45lFK4igSOR7v/Ajj7czGu119+AjZwxBHmL+BtuXzEd92vZUB99qr+VAM 7M+u+w/mAKy94pVekCnko93FuOrpYrPvdhGtYt9mnJdY87mB0rc6Q0iHnNuAri/6fAf1iL oY1nqL44Obq9ViclDuilkIrTQF3LYa64EL4vWoiSvjQTPLlfz8xtHNLukqS3J13a6RM9Nh nO6SKGstTe1JYDf2dut3Yd8ejv5C+vsSdEBfaias+10c8PL71UQV5NE1zUIboP0XB/BSpB hPW7fnYzjfM+V9MGUjunZzHkGct3FF9+IG141ZNcUXPyfTnoOJLxvSFOOM7QSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726912455; a=rsa-sha256; cv=none; b=xR2TlLwrliqrkFPEWtXelphj5NSKTjgD5rWtzoj/1nC0kpZbZG9ke2CWhWfI+qwGNiz6jA p3Ud15uRZLHFG19RcM+iyuBfwjpbS9C9hoh6zd8RxoWb6KRtYKNlsYoNmlv1MrYSPhMJMQ odnmblg10aV8bs/BqYH64JsIg/9wCkmxeQtXJU2bafe5PPAaC8/I+VdPQ19PX2KJZT8itn QT/bwyaLTw/mIDJrw3pleUNa2x4ImX3RzQoVzEGGgfn7Nli7OrlD4Xdu6Dp5Z2ATiVc2vx aBnR3vEkUAGnKRjpAvEnSS7VSIrrkuhtc3H1ZaleH1dqI1TakKTm7sU6XskYVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726912455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dOvyytHnUGi9K6C9bTl16/pww02trPqKlkJgfNJEVpY=; b=D0+8xkZnGcit1DJ2FPJDhKpAlQfDr0e/BuGDBe2OMPy2TNHvdqCrgG7jCI4ENUBvAKtxuR 3DM35EH5rjnqa76M8EB5fK+ysUEPR+rRZyDeli0Qx21Z++p6aN7nMB4kNaHhKjDajSulKO 8UpGpAqI1YOwPHzBGisuOBpT1Ha9xdq7y98V0a5owYB8wpkVK1Ld/3Rdf2F4ijWP3E8ZEN jGZIH3LPjH9GkUMldk3xR1Mkw7a/qopbni8kjlB1HFWC6TXGey6Wudmlm0h8I3/lGfW1em EIeKjyBUKdGYP1bWQVBRTr64WgmWVFetDcpMK8LpLFIBXSfCJNMrcEkCKZSWEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9l2v4wcWzSKM; Sat, 21 Sep 2024 09:54: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 48L9sFlg085983; Sat, 21 Sep 2024 09:54:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L9sFLl085980; Sat, 21 Sep 2024 09:54:15 GMT (envelope-from git) Date: Sat, 21 Sep 2024 09:54:15 GMT Message-Id: <202409210954.48L9sFLl085980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f72de14ea132 - main - ixgbe: update if_ix and ixgbe api with ix-3.3.38 changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f72de14ea13259db78b06c50da6c864dea698668 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f72de14ea13259db78b06c50da6c864dea698668 commit f72de14ea13259db78b06c50da6c864dea698668 Author: Kevin Bowling AuthorDate: 2024-09-21 09:51:24 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 09:52:21 +0000 ixgbe: update if_ix and ixgbe api with ix-3.3.38 changes MFC after: 1 week --- sys/dev/ixgbe/if_ix.c | 172 ++++++++++++++++++++++++++++++++++------- sys/dev/ixgbe/ixgbe.h | 4 + sys/dev/ixgbe/ixgbe_api.c | 19 ++++- sys/dev/ixgbe/ixgbe_api.h | 1 + sys/dev/ixgbe/ixgbe_common.c | 161 +++++++++++++++++++++++++++++++++++++- sys/dev/ixgbe/ixgbe_common.h | 3 + sys/dev/ixgbe/ixgbe_features.h | 1 + sys/dev/ixgbe/ixgbe_rss.h | 1 + sys/dev/ixgbe/ixgbe_type.h | 52 +++++++++++++ 9 files changed, 378 insertions(+), 36 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index f2b41e19a15e..74bde3497279 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -172,6 +172,7 @@ static void ixgbe_add_media_types(if_ctx_t); static void ixgbe_update_stats_counters(struct ixgbe_softc *); static void ixgbe_config_link(if_ctx_t); static void ixgbe_get_slot_info(struct ixgbe_softc *); +static void ixgbe_fw_mode_timer(void *); static void ixgbe_check_wol_support(struct ixgbe_softc *); static void ixgbe_enable_rx_drop(struct ixgbe_softc *); static void ixgbe_disable_rx_drop(struct ixgbe_softc *); @@ -1141,6 +1142,17 @@ ixgbe_if_attach_post(if_ctx_t ctx) /* Add sysctls */ ixgbe_add_device_sysctls(ctx); + /* Init recovery mode timer and state variable */ + if (sc->feat_en & IXGBE_FEATURE_RECOVERY_MODE) { + sc->recovery_mode = 0; + + /* Set up the timer callout */ + callout_init(&sc->fw_mode_timer, true); + + /* Start the task */ + callout_reset(&sc->fw_mode_timer, hz, ixgbe_fw_mode_timer, 0); + } + return (0); err: return (error); @@ -1639,10 +1651,10 @@ ixgbe_add_hw_stats(struct ixgbe_softc *sc) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, txr, 0, + CTLTYPE_UINT | CTLFLAG_RD, txr, 0, ixgbe_sysctl_tdh_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, txr, 0, + CTLTYPE_UINT | CTLFLAG_RD, txr, 0, ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tso_tx", CTLFLAG_RD, &txr->tso_tx, "TSO"); @@ -1659,7 +1671,7 @@ ixgbe_add_hw_stats(struct ixgbe_softc *sc) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + CTLTYPE_UINT | CTLFLAG_RW, &sc->rx_queues[i], 0, ixgbe_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); @@ -1667,10 +1679,10 @@ ixgbe_add_hw_stats(struct ixgbe_softc *sc) CTLFLAG_RD, &(sc->rx_queues[i].irqs), "irqs on this queue"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, rxr, 0, + CTLTYPE_UINT | CTLFLAG_RD, rxr, 0, ixgbe_sysctl_rdh_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, rxr, 0, + CTLTYPE_UINT | CTLFLAG_RD, rxr, 0, ixgbe_sysctl_rdt_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", CTLFLAG_RD, &rxr->rx_packets, "Queue Packets Received"); @@ -1799,6 +1811,10 @@ ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS) if (!txr) return (0); + + if (atomic_load_acq_int(&txr->sc->recovery_mode)) + return (EPERM); + val = IXGBE_READ_REG(&txr->sc->hw, IXGBE_TDH(txr->me)); error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr) @@ -1822,6 +1838,9 @@ ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS) if (!txr) return (0); + if (atomic_load_acq_int(&txr->sc->recovery_mode)) + return (EPERM); + val = IXGBE_READ_REG(&txr->sc->hw, IXGBE_TDT(txr->me)); error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr) @@ -1845,6 +1864,9 @@ ixgbe_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS) if (!rxr) return (0); + if (atomic_load_acq_int(&rxr->sc->recovery_mode)) + return (EPERM); + val = IXGBE_READ_REG(&rxr->sc->hw, IXGBE_RDH(rxr->me)); error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr) @@ -1868,6 +1890,9 @@ ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS) if (!rxr) return (0); + if (atomic_load_acq_int(&rxr->sc->recovery_mode)) + return (EPERM); + val = IXGBE_READ_REG(&rxr->sc->hw, IXGBE_RDT(rxr->me)); error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr) @@ -2158,6 +2183,7 @@ ixgbe_perform_aim(struct ixgbe_softc *sc, struct ix_rx_queue *que) { uint32_t newitr = 0; struct rx_ring *rxr = &que->rxr; + /* FIXME struct tx_ring *txr = ... ->txr; */ /* * Do Adaptive Interrupt Moderation: @@ -2173,12 +2199,18 @@ ixgbe_perform_aim(struct ixgbe_softc *sc, struct ix_rx_queue *que) que->eitr_setting = 0; /* Idle, do nothing */ if (rxr->bytes == 0) { + /* FIXME && txr->bytes == 0 */ return; } - if ((rxr->bytes) && (rxr->packets)) { - newitr = (rxr->bytes / rxr->packets); - } + if ((rxr->bytes) && (rxr->packets)) + newitr = rxr->bytes / rxr->packets; + /* FIXME for transmit accounting + * if ((txr->bytes) && (txr->packets)) + * newitr = txr->bytes/txr->packets; + * if ((rxr->bytes) && (rxr->packets)) + * newitr = max(newitr, (rxr->bytes / rxr->packets)); + */ newitr += 24; /* account for hardware frame, crc */ /* set an upper boundary */ @@ -2201,6 +2233,8 @@ ixgbe_perform_aim(struct ixgbe_softc *sc, struct ix_rx_queue *que) que->eitr_setting = newitr; /* Reset state */ + /* FIXME txr->bytes = 0; */ + /* FIXME txr->packets = 0; */ rxr->bytes = 0; rxr->packets = 0; @@ -2658,6 +2692,9 @@ ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS) int error; unsigned int reg, usec, rate; + if (atomic_load_acq_int(&que->sc->recovery_mode)) + return (EPERM); + reg = IXGBE_READ_REG(&que->sc->hw, IXGBE_EITR(que->msix)); usec = ((reg & 0x0FF8) >> 3); if (usec > 0) @@ -2697,12 +2734,12 @@ ixgbe_add_device_sysctls(if_ctx_t ctx) /* Sysctls for all devices */ SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "fc", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "advertise_speed", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); @@ -2711,35 +2748,35 @@ ixgbe_add_device_sysctls(if_ctx_t ctx) &sc->enable_aim, 0, "Interrupt Moderation"); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "fw_version", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, ixgbe_sysctl_print_fw_version, "A", "Prints FW/NVM Versions"); #ifdef IXGBE_DEBUG /* testing sysctls (for all devices) */ SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "power_state", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_power_state, "I", "PCI Power State"); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "print_rss_config", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, ixgbe_sysctl_print_rss_config, "A", "Prints RSS Configuration"); #endif /* for X550 series devices */ if (hw->mac.type >= ixgbe_mac_X550) SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "dmac", - CTLTYPE_U16 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + CTLTYPE_U16 | CTLFLAG_RW, sc, 0, ixgbe_sysctl_dmac, "I", "DMA Coalesce"); /* for WoL-capable devices */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) { SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "wol_enable", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_wol_enable, "I", "Enable/Disable Wake on LAN"); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "wufc", - CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + CTLTYPE_U32 | CTLFLAG_RW, sc, 0, ixgbe_sysctl_wufc, "I", "Enable/Disable Wake Up Filters"); } @@ -2754,20 +2791,20 @@ ixgbe_add_device_sysctls(if_ctx_t ctx) phy_list = SYSCTL_CHILDREN(phy_node); SYSCTL_ADD_PROC(ctx_list, phy_list, OID_AUTO, "temp", - CTLTYPE_U16 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + CTLTYPE_U16 | CTLFLAG_RD, sc, 0, ixgbe_sysctl_phy_temp, "I", "Current External PHY Temperature (Celsius)"); SYSCTL_ADD_PROC(ctx_list, phy_list, OID_AUTO, "overtemp_occurred", - CTLTYPE_U16 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_U16 | CTLFLAG_RD, sc, 0, ixgbe_sysctl_phy_overtemp_occurred, "I", "External PHY High Temperature Event Occurred"); } if (sc->feat_cap & IXGBE_FEATURE_EEE) { SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "eee_state", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, ixgbe_sysctl_eee_state, "I", "EEE Power Save State"); } } /* ixgbe_add_device_sysctls */ @@ -2831,6 +2868,8 @@ ixgbe_if_detach(if_ctx_t ctx) ctrl_ext &= ~IXGBE_CTRL_EXT_DRV_LOAD; IXGBE_WRITE_REG(&sc->hw, IXGBE_CTRL_EXT, ctrl_ext); + callout_drain(&sc->fw_mode_timer); + ixgbe_free_pci_resources(ctx); free(sc->mta, M_IXGBE); @@ -3497,6 +3536,34 @@ ixgbe_if_timer(if_ctx_t ctx, uint16_t qid) } /* ixgbe_if_timer */ +/************************************************************************ + * ixgbe_fw_mode_timer - FW mode timer routine + ************************************************************************/ +static void +ixgbe_fw_mode_timer(void *arg) +{ + struct ixgbe_softc *sc = arg; + struct ixgbe_hw *hw = &sc->hw; + + if (ixgbe_fw_recovery_mode(hw)) { + if (atomic_cmpset_acq_int(&sc->recovery_mode, 0, 1)) { + /* Firmware error detected, entering recovery mode */ + device_printf(sc->dev, "Firmware recovery mode detected. Limiting" + " functionality. Refer to the Intel(R) Ethernet Adapters" + " and Devices User Guide for details on firmware recovery" + " mode.\n"); + + if (hw->adapter_stopped == FALSE) + ixgbe_if_stop(sc->ctx); + } + } else + atomic_cmpset_acq_int(&sc->recovery_mode, 1, 0); + + + callout_reset(&sc->fw_mode_timer, hz, + ixgbe_fw_mode_timer, sc); +} /* ixgbe_fw_mode_timer */ + /************************************************************************ * ixgbe_sfp_probe * @@ -3948,7 +4015,7 @@ ixgbe_intr(void *arg) } /* Check for fan failure */ - if ((hw->device_id == IXGBE_DEV_ID_82598AT) && + if ((sc->feat_en & IXGBE_FEATURE_FAN_FAIL) && (eicr & IXGBE_EICR_GPI_SDP1)) { device_printf(sc->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n"); @@ -4142,6 +4209,9 @@ ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS) int error, advertise; sc = (struct ixgbe_softc *)arg1; + if (atomic_load_acq_int(&sc->recovery_mode)) + return (EPERM); + advertise = sc->advertise; error = sysctl_handle_int(oidp, &advertise, 0, req); @@ -4493,6 +4563,9 @@ ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS) int error = 0, reta_size; u32 reg; + if (atomic_load_acq_int(&sc->recovery_mode)) + return (EPERM); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for output.\n"); @@ -4548,6 +4621,9 @@ ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS) struct ixgbe_hw *hw = &sc->hw; u16 reg; + if (atomic_load_acq_int(&sc->recovery_mode)) + return (EPERM); + if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) { device_printf(iflib_get_dev(sc->ctx), "Device has no supported external thermal sensor.\n"); @@ -4580,6 +4656,9 @@ ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS) struct ixgbe_hw *hw = &sc->hw; u16 reg; + if (atomic_load_acq_int(&sc->recovery_mode)) + return (EPERM); + if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) { device_printf(iflib_get_dev(sc->ctx), "Device has no supported external thermal sensor.\n"); @@ -4617,6 +4696,9 @@ ixgbe_sysctl_eee_state(SYSCTL_HANDLER_ARGS) int curr_eee, new_eee, error = 0; s32 retval; + if (atomic_load_acq_int(&sc->recovery_mode)) + return (EPERM); + curr_eee = new_eee = !!(sc->feat_en & IXGBE_FEATURE_EEE); error = sysctl_handle_int(oidp, &new_eee, 0, req); @@ -4681,15 +4763,20 @@ ixgbe_init_device_features(struct ixgbe_softc *sc) sc->feat_cap |= IXGBE_FEATURE_BYPASS; break; case ixgbe_mac_X550: + sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; sc->feat_cap |= IXGBE_FEATURE_TEMP_SENSOR; sc->feat_cap |= IXGBE_FEATURE_SRIOV; sc->feat_cap |= IXGBE_FEATURE_FDIR; break; case ixgbe_mac_X550EM_x: + sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; sc->feat_cap |= IXGBE_FEATURE_SRIOV; sc->feat_cap |= IXGBE_FEATURE_FDIR; + if (sc->hw.device_id == IXGBE_DEV_ID_X550EM_X_KR) + sc->feat_cap |= IXGBE_FEATURE_EEE; break; case ixgbe_mac_X550EM_a: + sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; sc->feat_cap |= IXGBE_FEATURE_SRIOV; sc->feat_cap |= IXGBE_FEATURE_FDIR; sc->feat_cap &= ~IXGBE_FEATURE_LEGACY_IRQ; @@ -4725,6 +4812,9 @@ ixgbe_init_device_features(struct ixgbe_softc *sc) /* Thermal Sensor */ if (sc->feat_cap & IXGBE_FEATURE_TEMP_SENSOR) sc->feat_en |= IXGBE_FEATURE_TEMP_SENSOR; + /* Recovery mode */ + if (sc->feat_cap & IXGBE_FEATURE_RECOVERY_MODE) + sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE; /* Enabled via global sysctl... */ /* Flow Director */ @@ -4776,14 +4866,42 @@ static void ixgbe_sbuf_fw_version(struct ixgbe_hw *hw, struct sbuf *buf) { struct ixgbe_nvm_version nvm_ver = {0}; - uint16_t phyfw = 0; - int status; const char *space = ""; + ixgbe_get_nvm_version(hw, &nvm_ver); /* NVM version */ ixgbe_get_oem_prod_version(hw, &nvm_ver); /* OEM's NVM version */ - ixgbe_get_orom_version(hw, &nvm_ver); /* Option ROM */ ixgbe_get_etk_id(hw, &nvm_ver); /* eTrack identifies a build in Intel's SCM */ - status = ixgbe_get_phy_firmware_version(hw, &phyfw); + ixgbe_get_orom_version(hw, &nvm_ver); /* Option ROM */ + + /* FW version */ + if ((nvm_ver.phy_fw_maj == 0x0 && + nvm_ver.phy_fw_min == 0x0 && + nvm_ver.phy_fw_id == 0x0) || + (nvm_ver.phy_fw_maj == 0xF && + nvm_ver.phy_fw_min == 0xFF && + nvm_ver.phy_fw_id == 0xF)) { + /* If major, minor and id numbers are set to 0, + * reading FW version is unsupported. If major number + * is set to 0xF, minor is set to 0xFF and id is set + * to 0xF, this means that number read is invalid. */ + } else + sbuf_printf(buf, "fw %d.%d.%d ", + nvm_ver.phy_fw_maj, nvm_ver.phy_fw_min, nvm_ver.phy_fw_id); + + /* NVM version */ + if ((nvm_ver.nvm_major == 0x0 && + nvm_ver.nvm_minor == 0x0 && + nvm_ver.nvm_id == 0x0) || + (nvm_ver.nvm_major == 0xF && + nvm_ver.nvm_minor == 0xFF && + nvm_ver.nvm_id == 0xF)) { + /* If major, minor and id numbers are set to 0, + * reading NVM version is unsupported. If major number + * is set to 0xF, minor is set to 0xFF and id is set + * to 0xF, this means that number read is invalid. */ + } else + sbuf_printf(buf, "nvm %x.%02x.%x ", + nvm_ver.nvm_major, nvm_ver.nvm_minor, nvm_ver.nvm_id); if (nvm_ver.oem_valid) { sbuf_printf(buf, "NVM OEM V%d.%d R%d", nvm_ver.oem_major, @@ -4798,13 +4916,9 @@ ixgbe_sbuf_fw_version(struct ixgbe_hw *hw, struct sbuf *buf) } if (nvm_ver.etk_id != ((NVM_VER_INVALID << NVM_ETK_SHIFT) | - NVM_VER_INVALID)) { + NVM_VER_INVALID | 0xFFFFFFFF)) { sbuf_printf(buf, "%seTrack 0x%08x", space, nvm_ver.etk_id); - space = " "; } - - if (phyfw != 0 && status == IXGBE_SUCCESS) - sbuf_printf(buf, "%sPHY FW V%d", space, phyfw); } /* ixgbe_sbuf_fw_version */ /************************************************************************ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 3dae3aeebaa1..ae202b72390b 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -434,6 +434,10 @@ struct ixgbe_softc { /* Bypass */ struct ixgbe_bp_data bypass; + /* Firmware error check */ + int recovery_mode; + struct callout fw_mode_timer; + /* Misc stats maintained by the driver */ unsigned long dropped_pkts; unsigned long mbuf_header_failed; diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index 7767e9a5571c..4c50f10ed92e 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1133,6 +1133,19 @@ s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, IXGBE_NOT_IMPLEMENTED); } +/** + * ixgbe_toggle_txdctl - Toggle VF's queues + * @hw: pointer to hardware structure + * @vind: VMDq pool index + * + * Enable and disable each queue in VF. + */ +s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind) +{ + return ixgbe_call_func(hw, hw->mac.ops.toggle_txdctl, (hw, + vind), IXGBE_NOT_IMPLEMENTED); +} + /** * ixgbe_fc_enable - Enable flow control * @hw: pointer to hardware structure @@ -1417,15 +1430,15 @@ s32 ixgbe_bypass_rw(struct ixgbe_hw *hw, u32 cmd, u32 *status) /** * ixgbe_bypass_valid_rd - Verify valid return from bit-bang. + * @hw: pointer to hardware structure + * @in_reg: The register cmd for the bit-bang read. + * @out_reg: The register returned from a bit-bang read. * * If we send a write we can't be sure it took until we can read back * that same register. It can be a problem as some of the fields may * for valid reasons change inbetween the time wrote the register and * we read it again to verify. So this function check everything we * can check and then assumes it worked. - * - * @u32 in_reg - The register cmd for the bit-bang read. - * @u32 out_reg - The register returned from a bit-bang read. **/ bool ixgbe_bypass_valid_rd(struct ixgbe_hw *hw, u32 in_reg, u32 out_reg) { diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index 33c1cd1baeaf..b81510dacb95 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -131,6 +131,7 @@ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, u32 *vfta_delta, u32 vfta, bool vlvf_bypass); +s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind); s32 ixgbe_fc_enable(struct ixgbe_hw *hw); s32 ixgbe_setup_fc(struct ixgbe_hw *hw); s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 7643d4028529..df7ab90e72ab 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -133,6 +133,7 @@ s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw) mac->ops.init_uta_tables = NULL; mac->ops.enable_rx = ixgbe_enable_rx_generic; mac->ops.disable_rx = ixgbe_disable_rx_generic; + mac->ops.toggle_txdctl = ixgbe_toggle_txdctl_generic; /* Flow Control */ mac->ops.fc_enable = ixgbe_fc_enable_generic; @@ -4138,6 +4139,62 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw) return IXGBE_SUCCESS; } + +/** + * ixgbe_toggle_txdctl_generic - Toggle VF's queues + * @hw: pointer to hardware structure + * @vf_number: VF index + * + * Enable and disable each queue in VF. + */ +s32 ixgbe_toggle_txdctl_generic(struct ixgbe_hw *hw, u32 vf_number) +{ + u8 queue_count, i; + u32 offset, reg; + + if (vf_number > 63) + return IXGBE_ERR_PARAM; + + /* + * Determine number of queues by checking + * number of virtual functions + */ + reg = IXGBE_READ_REG(hw, IXGBE_GCR_EXT); + switch (reg & IXGBE_GCR_EXT_VT_MODE_MASK) { + case IXGBE_GCR_EXT_VT_MODE_64: + queue_count = 2; + break; + case IXGBE_GCR_EXT_VT_MODE_32: + queue_count = 4; + break; + case IXGBE_GCR_EXT_VT_MODE_16: + queue_count = 8; + break; + default: + return IXGBE_ERR_CONFIG; + } + + /* Toggle queues */ + for (i = 0; i < queue_count; ++i) { + /* Calculate offset of current queue */ + offset = queue_count * vf_number + i; + + /* Enable queue */ + reg = IXGBE_READ_REG(hw, IXGBE_PVFTXDCTL(offset)); + reg |= IXGBE_TXDCTL_ENABLE; + IXGBE_WRITE_REG(hw, IXGBE_PVFTXDCTL(offset), reg); + IXGBE_WRITE_FLUSH(hw); + + /* Disable queue */ + reg = IXGBE_READ_REG(hw, IXGBE_PVFTXDCTL(offset)); + reg &= ~IXGBE_TXDCTL_ENABLE; + IXGBE_WRITE_REG(hw, IXGBE_PVFTXDCTL(offset), reg); + IXGBE_WRITE_FLUSH(hw); + } + + return IXGBE_SUCCESS; +} + /** * ixgbe_need_crosstalk_fix - Determine if we need to do cross talk fix * @hw: pointer to hardware structure @@ -5151,15 +5208,14 @@ s32 ixgbe_bypass_rw_generic(struct ixgbe_hw *hw, u32 cmd, u32 *status) /** * ixgbe_bypass_valid_rd_generic - Verify valid return from bit-bang. + * @in_reg: The register cmd for the bit-bang read. + * @out_reg: The register returned from a bit-bang read. * * If we send a write we can't be sure it took until we can read back * that same register. It can be a problem as some of the fields may * for valid reasons change inbetween the time wrote the register and * we read it again to verify. So this function check everything we * can check and then assumes it worked. - * - * @u32 in_reg - The register cmd for the bit-bang read. - * @u32 out_reg - The register returned from a bit-bang read. **/ bool ixgbe_bypass_valid_rd_generic(u32 in_reg, u32 out_reg) { @@ -5210,7 +5266,7 @@ bool ixgbe_bypass_valid_rd_generic(u32 in_reg, u32 out_reg) * ixgbe_bypass_set_generic - Set a bypass field in the FW CTRL Regiter. * * @hw: pointer to hardware structure - * @cmd: The control word we are setting. + * @ctrl: The control word we are setting. * @event: The event we are setting in the FW. This also happens to * be the mask for the event we are setting (handy) * @action: The action we set the event to in the FW. This is in a @@ -5395,6 +5451,103 @@ void ixgbe_get_etk_id(struct ixgbe_hw *hw, struct ixgbe_nvm_version *nvm_ver) } } +/** + * ixgbe_get_nvm_version - Return version of NVM and its components + * + * @hw: pointer to hardware structure + * @nvm_ver: pointer to output structure + * + * irrelevant component fields will return 0, read errors will return 0xff + **/ +void ixgbe_get_nvm_version(struct ixgbe_hw *hw, + struct ixgbe_nvm_version *nvm_ver) +{ + u16 word, phy_ver; + + DEBUGFUNC("ixgbe_get_nvm_version"); + + memset(nvm_ver, 0, sizeof(struct ixgbe_nvm_version)); + + /* eeprom version is mac-type specific */ + switch (hw->mac.type) { + case ixgbe_mac_82598EB: + /* version of eeprom section */ + if (ixgbe_read_eeprom(hw, NVM_EEP_OFFSET_82598, &word)) + word = NVM_VER_INVALID; + nvm_ver->nvm_major = ((word & NVM_EEP_MAJOR_MASK) + >> NVM_EEP_MAJ_SHIFT); + nvm_ver->nvm_minor = ((word & NVM_EEP_MINOR_MASK) + >> NVM_EEP_MIN_SHIFT); + nvm_ver->nvm_id = (word & NVM_EEP_ID_MASK); + break; + case ixgbe_mac_X540: + /* version of eeprom section */ + if (ixgbe_read_eeprom(hw, NVM_EEP_OFFSET_X540, &word)) + word = NVM_VER_INVALID; + nvm_ver->nvm_major = ((word & NVM_EEP_MAJOR_MASK) + >> NVM_EEP_MAJ_SHIFT); + nvm_ver->nvm_minor = ((word & NVM_EEP_MINOR_MASK) + >> NVM_EEP_MIN_SHIFT); + nvm_ver->nvm_id = (word & NVM_EEP_ID_MASK); + break; + + case ixgbe_mac_X550: + case ixgbe_mac_X550EM_x: + case ixgbe_mac_X550EM_a: + /* version of eeprom section */ + if (ixgbe_read_eeprom(hw, NVM_EEP_OFFSET_X540, &word)) + word = NVM_VER_INVALID; + nvm_ver->nvm_major = ((word & NVM_EEP_MAJOR_MASK) + >> NVM_EEP_MAJ_SHIFT); + nvm_ver->nvm_minor = (word & NVM_EEP_X550_MINOR_MASK); + + break; + default: + break; + } + + /* phy version is mac-type specific */ + switch (hw->mac.type) { + case ixgbe_mac_X540: + case ixgbe_mac_X550: + case ixgbe_mac_X550EM_x: + case ixgbe_mac_X550EM_a: + /* intel phy firmware version */ + if (ixgbe_read_eeprom(hw, NVM_EEP_PHY_OFF_X540, &word)) + word = NVM_VER_INVALID; + nvm_ver->phy_fw_maj = ((word & NVM_PHY_MAJOR_MASK) + >> NVM_PHY_MAJ_SHIFT); + nvm_ver->phy_fw_min = ((word & NVM_PHY_MINOR_MASK) + >> NVM_PHY_MIN_SHIFT); + nvm_ver->phy_fw_id = (word & NVM_PHY_ID_MASK); + break; + default: + break; + } + + ixgbe_get_etk_id(hw, nvm_ver); + + /* devstarter image */ + if (ixgbe_read_eeprom(hw, NVM_DS_OFFSET, &word)) + word = NVM_VER_INVALID; + nvm_ver->devstart_major = ((word & NVM_DS_MAJOR_MASK) >> NVM_DS_SHIFT); + nvm_ver->devstart_minor = (word & NVM_DS_MINOR_MASK); + + /* OEM customization word */ + if (ixgbe_read_eeprom(hw, NVM_OEM_OFFSET, &nvm_ver->oem_specific)) + nvm_ver->oem_specific = NVM_VER_INVALID; + + /* vendor (not intel) phy firmware version */ + if (ixgbe_get_phy_firmware_version(hw, &phy_ver)) + phy_ver = NVM_VER_INVALID; + nvm_ver->phy_vend_maj = ((phy_ver & NVM_PHYVEND_MAJOR_MASK) + >> NVM_PHYVEND_SHIFT); + nvm_ver->phy_vend_min = (phy_ver & NVM_PHYVEND_MINOR_MASK); + + /* Option Rom may or may not be present. Start with pointer */ + ixgbe_get_orom_version(hw, nvm_ver); + return; +} /** * ixgbe_dcb_get_rtrup2tc_generic - read rtrup2tc reg diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index 0ff5c60d40af..a2da9c834f8f 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -141,6 +141,7 @@ s32 ixgbe_set_vlvf_generic(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlvf_bypass); s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw); s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass); +s32 ixgbe_toggle_txdctl_generic(struct ixgbe_hw *hw, u32 vind); s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -195,6 +196,8 @@ void ixgbe_get_oem_prod_version(struct ixgbe_hw *hw, struct ixgbe_nvm_version *nvm_ver); void ixgbe_get_orom_version(struct ixgbe_hw *hw, struct ixgbe_nvm_version *nvm_ver); +void ixgbe_get_nvm_version(struct ixgbe_hw *hw, + struct ixgbe_nvm_version *nvm_ver); void ixgbe_disable_rx_generic(struct ixgbe_hw *hw); void ixgbe_enable_rx_generic(struct ixgbe_hw *hw); s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, diff --git a/sys/dev/ixgbe/ixgbe_features.h b/sys/dev/ixgbe/ixgbe_features.h index ed35a6ed458c..0cef334a185f 100644 --- a/sys/dev/ixgbe/ixgbe_features.h +++ b/sys/dev/ixgbe/ixgbe_features.h @@ -56,6 +56,7 @@ #define IXGBE_FEATURE_EEE (u32)(1 << 11) #define IXGBE_FEATURE_LEGACY_IRQ (u32)(1 << 12) #define IXGBE_FEATURE_NEEDS_CTXD (u32)(1 << 13) +#define IXGBE_FEATURE_RECOVERY_MODE (u32)(1 << 15) /* Check for OS support. Undefine features if not included in the OS */ #ifndef PCI_IOV diff --git a/sys/dev/ixgbe/ixgbe_rss.h b/sys/dev/ixgbe/ixgbe_rss.h index c00273587aaa..84c802671195 100644 --- a/sys/dev/ixgbe/ixgbe_rss.h +++ b/sys/dev/ixgbe/ixgbe_rss.h @@ -48,6 +48,7 @@ #define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) #define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) #define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) +#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) #define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) #define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index dbcc6544133e..a414e27142ec 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -202,6 +202,10 @@ #define IXGBE_FLA_X550EM_x IXGBE_FLA #define IXGBE_FLA_X550EM_a 0x15F68 #define IXGBE_FLA_BY_MAC(_hw) IXGBE_BY_MAC((_hw), FLA) +#define IXGBE_FLA_FL_SIZE_SHIFT_X540 17 +#define IXGBE_FLA_FL_SIZE_SHIFT_X550 12 +#define IXGBE_FLA_FL_SIZE_MASK_X540 (0x7 << IXGBE_FLA_FL_SIZE_SHIFT_X540) +#define IXGBE_FLA_FL_SIZE_MASK_X550 (0x7 << IXGBE_FLA_FL_SIZE_SHIFT_X550) #define IXGBE_EEMNGCTL 0x10110 #define IXGBE_EEMNGDATA 0x10114 @@ -284,6 +288,41 @@ #define IXGBE_I2C_CLK_OE_N_EN_BY_MAC(_hw) IXGBE_BY_MAC((_hw), I2C_CLK_OE_N_EN) #define IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT 500 +/* NVM component version fields */ +#define NVM_VERSZ_LONG 64 +#define NVM_VERSZ_SHORT 32 +#define NVM_VER_LONG \ + "DS_%x.%x NVM_%x.%02x.%x PHY_%x.%02x.%x OEM_%04x EtkId_%x OR_%x.%x.%x\n" +#define NVM_VER_SHORT1 "%02x.%02x %x %x.%x.%x\n" +#define NVM_VER_SHORT2 "%02x.%02x.%x %x.%02x.%x %x %x.%x.%x\n" + +#define NVM_EEP_MAJOR_MASK 0xF000 +#define NVM_EEP_MINOR_MASK 0xFF0 +#define NVM_EEP_ID_MASK 0xF +#define NVM_EEP_MAJ_SHIFT 12 +#define NVM_EEP_MIN_SHIFT 4 + +#define NVM_EEP_OFFSET_82598 0x2A +#define NVM_EEP_OFFSET_X540 0x18 +#define NVM_EEP_X550_MINOR_MASK 0xFF +#define NVM_EEP_PHY_OFF_X540 0x19 +#define NVM_PHY_MAJOR_MASK 0xF000 +#define NVM_PHY_MINOR_MASK 0xFF0 +#define NVM_PHY_ID_MASK 0xF +#define NVM_PHY_MAJ_SHIFT 12 +#define NVM_PHY_MIN_SHIFT 4 + +#define NVM_DS_OFFSET 0x29 +#define NVM_DS_MAJOR_MASK 0xF000 +#define NVM_DS_MINOR_MASK 0xF +#define NVM_DS_SHIFT 12 + +#define NVM_OEM_OFFSET 0x2A + +#define NVM_PHYVEND_MAJOR_MASK 0xFF00 +#define NVM_PHYVEND_MINOR_MASK 0xFF +#define NVM_PHYVEND_SHIFT 8 + #define IXGBE_I2C_THERMAL_SENSOR_ADDR 0xF8 #define IXGBE_EMC_INTERNAL_DATA 0x00 #define IXGBE_EMC_INTERNAL_THERM_LIMIT 0x20 @@ -344,6 +383,16 @@ struct ixgbe_nvm_version { u16 or_build; u8 or_patch; + u8 phy_fw_maj; + u16 phy_fw_min; + u8 phy_fw_id; + + u8 devstart_major; + u8 devstart_minor; + u16 oem_specific; + + u8 phy_vend_maj; + u8 phy_vend_min; }; /* Interrupt Registers */ @@ -1443,6 +1492,7 @@ struct ixgbe_dmac_config { #define IXGBE_BARCTRL_FLSIZE 0x0700 #define IXGBE_BARCTRL_FLSIZE_SHIFT 8 #define IXGBE_BARCTRL_CSRSIZE 0x2000 +#define IXGBE_BARCTRL_CSRSIZE_SHIFT 13 /* RSCCTL Bit Masks */ #define IXGBE_RSCCTL_RSCEN 0x01 @@ -3414,6 +3464,7 @@ struct ixgbe_adv_tx_context_desc { #define IXGBE_ADVTXD_POPTS_RSV 0x00002000 /* POPTS Reserved */ #define IXGBE_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */ #define IXGBE_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ +#define IXGBE_ADVTXD_MACLEN_MASK (0x7F << IXGBE_ADVTXD_MACLEN_SHIFT) /* Adv ctxt desc mac len mask */ #define IXGBE_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */ #define IXGBE_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */ #define IXGBE_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */ @@ -4030,6 +4081,7 @@ struct ixgbe_mac_operations { s32 (*init_uta_tables)(struct ixgbe_hw *); void (*set_mac_anti_spoofing)(struct ixgbe_hw *, bool, int); void (*set_vlan_anti_spoofing)(struct ixgbe_hw *, bool, int); + s32 (*toggle_txdctl)(struct ixgbe_hw *hw, u32 vf_index); s32 (*update_xcast_mode)(struct ixgbe_hw *, int); s32 (*set_rlpml)(struct ixgbe_hw *, u16); From nobody Sat Sep 21 10:00:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9l9j5bK6z5Xn1p; Sat, 21 Sep 2024 10:00: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 4X9l9j4pVyz4b1w; Sat, 21 Sep 2024 10:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726912809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kFjw4I7rC7oKBrtuVS9VyUpWfqdyXLMzZjXilSeOQo=; b=P48f01i8w2AOWlwNClBt7MFYhSvBJBd7zATMEYN7QIH8536xzgMY2/Zsh2/KUjxiS9nbXY 6VnPdQy3IH3nD4msQ6LIj640aixFj4Fi3B3HV8Z0g1HemonhHjNp4Wj/pG0HtVH9t8kUiP hQUYe4sY27hNbh1ZyRrLFhL34Elto0TqbZpyPGQtrVIfTAh08MDyAJYRZjwk8o+zG+GfMv pWN+FjZG3YjHM3S7CUdALWsxq9AVQyDcaOz+t5WVS50/0SW+XzCZv5PZBXFqbBPjTflWwO ZoeyUbVlWZ90Jl7kLN2tJK8+9P3iv7tsYsCVb7+M+bvqkTwG4kXuJKu1ijsbvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726912809; a=rsa-sha256; cv=none; b=m1K/j6hnNVKvgM9fovvINyFIP8xzZXgDcFFJS9JUR26rqrWPqbl/CUu6/OolEHWcX2WD8a CLfBg3rAvof0guKvBVGzXQc5zoaWMXeTydVo3wXBxW02UL8TsUqYx1E4eM0ZYw/C8KqlUs tL1YpR3v6M59HmzFWTmnrIwVinu+Et9rGw3EeyMGV8xUm1SV+6qeFCDNX1dIUlSac0PvEZ pUi60wK+K+JOTKgfEHojMjRWCkzJM43ngANoiYMydUDl/gnoCAqWNhAcgIfPCVcKAKHXHQ 4iLQQGXYp3NA+efgwzeZLsz364d8w3rauDkgyf6jay50AB723lyyCqtNvudYEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726912809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kFjw4I7rC7oKBrtuVS9VyUpWfqdyXLMzZjXilSeOQo=; b=xM5/fEQeOz+V9Ro/3jU1mP/CAKf/KD/zMNsX2IZcmCPPhaY4TKPMcdPHt7EP/iBtibqTtQ IaCcoHLVG6yWfhnOBSocFqJgi66cLK8a9ynZLMFnthHZSKzIx7MLHTxsjB0gAEDD2eHSCG bjJJEwfOH02CXVS1+WoBDYXgmgz9QWYOB9Jh/XHKG9tCnfZRfOoXbz+AdQpm+4TLU5ozYc Fabrtroaea0ojzYHTyP9LWBHl87opfPeNIN4ETmwOIY9lvo8T7eCujwcB6fcXI9ZwzHF34 h2kr2zz0U36Rl67qOoPEH794TiSUIFyRKkUm6NS8nX8vXhwYe0mTtACo50z16g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9l9j4G0NzT5C; Sat, 21 Sep 2024 10:00: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 48LA09F7091642; Sat, 21 Sep 2024 10:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LA09LG091631; Sat, 21 Sep 2024 10:00:09 GMT (envelope-from git) Date: Sat, 21 Sep 2024 10:00:09 GMT Message-Id: <202409211000.48LA09LG091631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b6cd053e6da9 - main - ixgbe: update if_sriov with ix-3.3.38 changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6cd053e6da9bb8f77d2c6069260e52bbd53fa4a Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b6cd053e6da9bb8f77d2c6069260e52bbd53fa4a commit b6cd053e6da9bb8f77d2c6069260e52bbd53fa4a Author: Kevin Bowling AuthorDate: 2024-09-21 09:56:19 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 09:59:33 +0000 ixgbe: update if_sriov with ix-3.3.38 changes There are some critical fixes here. The PF must communicate with each VF slot (vf->pool), only VFs shall use 0 for everything. IXGBE_FEATURE_SRIOV needs to be set before calling ixgbe_if_init(). With these changes, ixv(4) now attaches to VFs, but after bringing up VFs, the PF and VF still are not correctly passing traffic. MFC after: 1 week --- sys/dev/ixgbe/if_sriov.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index eab5ff8f5da0..6a2dad4bca42 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -95,26 +95,26 @@ ixgbe_align_all_queue_indices(struct ixgbe_softc *sc) /* Support functions for SR-IOV/VF management */ static inline void -ixgbe_send_vf_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) +ixgbe_send_vf_msg(struct ixgbe_hw *hw, struct ixgbe_vf *vf, u32 msg) { if (vf->flags & IXGBE_VF_CTS) msg |= IXGBE_VT_MSGTYPE_CTS; - ixgbe_write_mbx(&sc->hw, &msg, 1, vf->pool); + hw->mbx.ops[vf->pool].write(hw, &msg, 1, vf->pool); } static inline void ixgbe_send_vf_success(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_SUCCESS); + ixgbe_send_vf_msg(&sc->hw, vf, msg | IXGBE_VT_MSGTYPE_SUCCESS); } static inline void ixgbe_send_vf_failure(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_FAILURE); + ixgbe_send_vf_msg(&sc->hw, vf, msg | IXGBE_VT_MSGTYPE_FAILURE); } static inline void @@ -210,7 +210,7 @@ ixgbe_ping_all_vfs(struct ixgbe_softc *sc) for (int i = 0; i < sc->num_vfs; i++) { vf = &sc->vfs[i]; if (vf->flags & IXGBE_VF_ACTIVE) - ixgbe_send_vf_msg(sc, vf, IXGBE_PF_CONTROL_MSG); + ixgbe_send_vf_msg(&sc->hw, vf, IXGBE_PF_CONTROL_MSG); } } /* ixgbe_ping_all_vfs */ @@ -254,6 +254,17 @@ ixgbe_vf_set_default_vlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf, IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf->pool), vmvir); } /* ixgbe_vf_set_default_vlan */ +static void +ixgbe_clear_vfmbmem(struct ixgbe_softc *sc, struct ixgbe_vf *vf) +{ + struct ixgbe_hw *hw = &sc->hw; + uint32_t vf_index = IXGBE_VF_INDEX(vf->pool); + uint16_t mbx_size = hw->mbx.size; + uint16_t i; + + for (i = 0; i < mbx_size; ++i) + IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_index), i, 0x0); +} /* ixgbe_clear_vfmbmem */ static boolean_t ixgbe_vf_frame_size_compatible(struct ixgbe_softc *sc, struct ixgbe_vf *vf) @@ -310,6 +321,8 @@ ixgbe_process_vf_reset(struct ixgbe_softc *sc, struct ixgbe_vf *vf) // XXX clear multicast addresses ixgbe_clear_rar(&sc->hw, vf->rar_index); + ixgbe_clear_vfmbmem(sc, vf); + ixgbe_toggle_txdctl(&sc->hw, IXGBE_VF_INDEX(vf->pool)); vf->api_ver = IXGBE_API_VER_UNKNOWN; } /* ixgbe_process_vf_reset */ @@ -371,7 +384,7 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) vf->flags |= IXGBE_VF_CTS; - resp[0] = IXGBE_VF_RESET | ack | IXGBE_VT_MSGTYPE_CTS; + resp[0] = IXGBE_VF_RESET | ack; bcopy(vf->ether_addr, &resp[1], ETHER_ADDR_LEN); resp[3] = hw->mac.mc_filter_type; ixgbe_write_mbx(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); @@ -582,7 +595,8 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) hw = &sc->hw; - error = ixgbe_read_mbx(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); + error = hw->mbx.ops[vf->pool].read(hw, msg, IXGBE_VFMAILBOX_SIZE, + vf->pool); if (error != 0) return; @@ -643,13 +657,13 @@ ixgbe_handle_mbx(void *context) vf = &sc->vfs[i]; if (vf->flags & IXGBE_VF_ACTIVE) { - if (hw->mbx.ops[0].check_for_rst(hw, vf->pool) == 0) + if (hw->mbx.ops[vf->pool].check_for_rst(hw, vf->pool) == 0) ixgbe_process_vf_reset(sc, vf); - if (hw->mbx.ops[0].check_for_msg(hw, vf->pool) == 0) + if (hw->mbx.ops[vf->pool].check_for_msg(hw, vf->pool) == 0) ixgbe_process_vf_msg(ctx, vf); - if (hw->mbx.ops[0].check_for_ack(hw, vf->pool) == 0) + if (hw->mbx.ops[vf->pool].check_for_ack(hw, vf->pool) == 0) ixgbe_process_vf_ack(sc, vf); } } @@ -698,8 +712,10 @@ ixgbe_if_iov_init(if_ctx_t ctx, u16 num_vfs, const nvlist_t *config) } sc->num_vfs = num_vfs; - ixgbe_if_init(sc->ctx); + ixgbe_init_mbx_params_pf(&sc->hw); + sc->feat_en |= IXGBE_FEATURE_SRIOV; + ixgbe_if_init(sc->ctx); return (retval); @@ -769,7 +785,7 @@ ixgbe_init_vf(struct ixgbe_softc *sc, struct ixgbe_vf *vf) ixgbe_vf_enable_transmit(sc, vf); ixgbe_vf_enable_receive(sc, vf); - ixgbe_send_vf_msg(sc, vf, IXGBE_PF_CONTROL_MSG); + ixgbe_send_vf_msg(&sc->hw, vf, IXGBE_PF_CONTROL_MSG); } /* ixgbe_init_vf */ void From nobody Sat Sep 21 11:10:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9mkz0zqzz5Vp6L; Sat, 21 Sep 2024 11:10: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 4X9mky6ChBz4kgY; Sat, 21 Sep 2024 11:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ygvJM+i23AwXVNkU3S/d5mOUcplVhSCCw14dsxHSxaA=; b=CqpAc+HRtnwRSsjK+/EyTyTvfUhUuZufCmd2yG2DYG6rqd5hZHibEWT6XGKrRYWobY9ESI YVDIzl7beHBoHSdDiM+qNLoViVeFdVovJUw7Bkoe9L38TFrCvr5cMnoX3r/Zb/Q+6AWBvj bVKjURWBLT5ud3gx5bsPqFBNYvuY3FarUGpvOZBaNf84SGwcjMgCQyjYLqqWpxlGtHP9RI Zf4o/4bEPtyOCBghK+SZa+1a/RAFgIY4AOTTpzuHclUDRlG4m5guOMDXnx2Rzqt2yflPU2 8ioODEtXEosObE0LvIEvjfhYG3Zo8AMiuBPVOMMUQVPV/s5TzL5TLGmjEIWuVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917034; a=rsa-sha256; cv=none; b=opw2IjDt+XYdpttJbgwnQQXQzBnkhmTSd8Ql+I1oB6iTTTThYr6Kb0C32fskArI852GK5+ THlhrqjHKiWAXiDciuQ6gVd5LbkZ8Jex57PsXDxv+azjJK6+j4akxcVrLZCmSTOOLjdARt urlQdeMhGpu8KRgqtdMRPWEuMWkraPs72uwyzzFLA+h+MxWQK32+jQp4TdrS5oKj2vs6aa 3pfJblo/cp+eL+gs43gLSIEuf5v49Lv5++6jJu41N4KgQZI9FTsTy99Xx3ZX1eXau7LIen 5FB7x/kb3FNhAgeYUu9gW5rKWznK68D60GRTz+Edk/bSR0gwRXW7i2b9Kpr+nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ygvJM+i23AwXVNkU3S/d5mOUcplVhSCCw14dsxHSxaA=; b=mboOt1WTtzWTV66/zt0wpxHDDVbISqKdhLvD61WO+Wcfkv8UEJBMDLrfLLiqGUfszc666X zgP/FetuxjOjDWKUywlsjNmflxpSIQJHqzbw52qdtR8+U5GkLwnAgdKhtrY8vfrKBtH6yW /7Di52Ki2Mx3JyCfxZS3H59TmDvL9EYogAq5cU8RKtZHTX0cb5DBsUWhQyQj5ztsdfOKCP zNeWZtdEzLNn1dbZLwrnHxqbGwgLU1cE7t0OSAZORVXv5XbLp5kSCdCJE6zoEgknbgqhFN lHOaxZOe7GPZLGy4Dk0NTue1uThmCXw0oMuT0mgBiYKy/P6e9CprwEe+iqWtvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9mky5kwmzX5p; Sat, 21 Sep 2024 11:10: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 48LBAYZL015313; Sat, 21 Sep 2024 11:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBAYx0015310; Sat, 21 Sep 2024 11:10:34 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:10:34 GMT Message-Id: <202409211110.48LBAYx0015310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 06a6d0259fe5 - stable/14 - Revert "tzsetup: symlink /etc/localtime instead of copying" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 06a6d0259fe5721bfb3b745b231ecf7cf3a5e28e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=06a6d0259fe5721bfb3b745b231ecf7cf3a5e28e commit 06a6d0259fe5721bfb3b745b231ecf7cf3a5e28e Author: Ed Maste AuthorDate: 2024-09-21 11:06:02 +0000 Commit: Ed Maste CommitDate: 2024-09-21 11:06:39 +0000 Revert "tzsetup: symlink /etc/localtime instead of copying" This failed when used with tzsetup's -C option (for example, when using etcupdate -D to update a jail from the host). Revert the stable/14 MFC for now; will be reapplied after being fixed in main.. This reverts commit fc43a1b6842afa806dfd7ba48de5bece63d04456. This reverts commit 87f7f0389f8b7bf30ef12df5c0d337cb2789883e. --- usr.sbin/etcupdate/tests/tzsetup_test.sh | 5 +- usr.sbin/tzsetup/tzsetup.8 | 2 +- usr.sbin/tzsetup/tzsetup.c | 119 ++++++++++++++++++++++++------- 3 files changed, 96 insertions(+), 30 deletions(-) diff --git a/usr.sbin/etcupdate/tests/tzsetup_test.sh b/usr.sbin/etcupdate/tests/tzsetup_test.sh index 155830bddae7..dd76884e13eb 100644 --- a/usr.sbin/etcupdate/tests/tzsetup_test.sh +++ b/usr.sbin/etcupdate/tests/tzsetup_test.sh @@ -232,8 +232,7 @@ echo "Differences for real update:" diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ || FAILED=yes -# XXX tzsetup installs a symlink as of 5e16809c953f -#file /etc/localtime "foo" -#file /var/db/zoneinfo "foo" +file /etc/localtime "foo" +file /var/db/zoneinfo "foo" [ "${FAILED}" = no ] diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8 index 499d25765541..bfa625a1af3a 100644 --- a/usr.sbin/tzsetup/tzsetup.8 +++ b/usr.sbin/tzsetup/tzsetup.8 @@ -52,7 +52,7 @@ The following options are available: Open all files and directories relative to .Ar chroot_directory . .It Fl n -Do not create or symlink files. +Do not create or copy files. .It Fl r Reinstall the zoneinfo file installed last time. The name is obtained from diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 617de4efb765..6cd2e16b607c 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -744,42 +744,109 @@ static void message_zoneinfo_file(const char *title, char *prompt) static int install_zoneinfo_file(const char *zoneinfo_file) { + char buf[1024]; char prompt[SILLY_BUFFER_SIZE]; + struct stat sb; + ssize_t len; + int fd1, fd2, copymode; + + if (lstat(path_localtime, &sb) < 0) { + /* Nothing there yet... */ + copymode = 1; + } else if (S_ISLNK(sb.st_mode)) + copymode = 0; + else + copymode = 1; #ifdef VERBOSE - snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", - path_localtime, zoneinfo_file); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copying %s to %s", zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Creating symbolic link %s to %s", + path_localtime, zoneinfo_file); message_zoneinfo_file("Info", prompt); #endif if (reallydoit) { - if (access(zoneinfo_file, R_OK) != 0) { - snprintf(prompt, sizeof(prompt), - "Cannot access %s: %s", zoneinfo_file, - strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - if (unlink(path_localtime) < 0 && errno != ENOENT) { - snprintf(prompt, sizeof(prompt), - "Could not delete %s: %s", - path_localtime, strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - if (symlink(zoneinfo_file, path_localtime) < 0) { - snprintf(prompt, sizeof(prompt), - "Cannot create symbolic link %s to %s: %s", - path_localtime, zoneinfo_file, - strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); + if (copymode) { + fd1 = open(zoneinfo_file, O_RDONLY, 0); + if (fd1 < 0) { + snprintf(prompt, sizeof(prompt), + "Could not open %s: %s", zoneinfo_file, + strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + + if (unlink(path_localtime) < 0 && errno != ENOENT) { + snprintf(prompt, sizeof(prompt), + "Could not delete %s: %s", + path_localtime, strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + + fd2 = open(path_localtime, O_CREAT | O_EXCL | O_WRONLY, + S_IRUSR | S_IRGRP | S_IROTH); + if (fd2 < 0) { + snprintf(prompt, sizeof(prompt), + "Could not open %s: %s", + path_localtime, strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + + while ((len = read(fd1, buf, sizeof(buf))) > 0) + if ((len = write(fd2, buf, len)) < 0) + break; + + if (len == -1) { + snprintf(prompt, sizeof(prompt), + "Error copying %s to %s %s", zoneinfo_file, + path_localtime, strerror(errno)); + message_zoneinfo_file("Error", prompt); + /* Better to leave none than a corrupt one. */ + unlink(path_localtime); + return (DITEM_FAILURE | DITEM_RECREATE); + } + close(fd1); + close(fd2); + } else { + if (access(zoneinfo_file, R_OK) != 0) { + snprintf(prompt, sizeof(prompt), + "Cannot access %s: %s", zoneinfo_file, + strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + if (unlink(path_localtime) < 0 && errno != ENOENT) { + snprintf(prompt, sizeof(prompt), + "Could not delete %s: %s", + path_localtime, strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + if (symlink(zoneinfo_file, path_localtime) < 0) { + snprintf(prompt, sizeof(prompt), + "Cannot create symbolic link %s to %s: %s", + path_localtime, zoneinfo_file, + strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } } #ifdef VERBOSE - snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", zoneinfo_file, - path_localtime); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copied timezone file from %s to %s", + zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", + zoneinfo_file, path_localtime); message_zoneinfo_file("Done", prompt); #endif } /* reallydoit */ From nobody Sat Sep 21 11:11:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9mm86ypKz5Vp8w; Sat, 21 Sep 2024 11:11: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 4X9mm86T01z4lFZ; Sat, 21 Sep 2024 11:11:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=45v/Cin7Etu6c6SSCdGAmK25FHqC+kC9yVNsIL1qBqM=; b=qGsZOr3AUk3/9VydbZZ5dv6oyUDn5+xu9tVOaQhRQbTsu/pd6/xxmf2Briv5hYD9OuE9oC KKUaFjYFr3298t34zlolsjzTxp1KDPBRAzG53ZVtHrlJg6zDrg4i8iush0VTx6cfFnPPUa yQ6/GUEIgFwSdFYO2pRokcY6HFfSI2xjUfjYZLn4P/+L0FdasPKDc/OofRHCcbfTP3T57X iPXnkOgkUps+RFQIw8Ajki/h7AD73ZNn2SVvmg/P0sJRhDPo5m8l6LEqODf5dF1k702rVo X0N0c2T/8h1kPhsBgG2AOoXXBYFGRclJpWsPUUo2UAXLd2Sc2nxjqtF7RQ1hdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917096; a=rsa-sha256; cv=none; b=FweUkyq4sfJ10LgQ5o3KN63MW7UhGp+rI5kzM4ALE4DzeqzRDhwwrlHNxmyQBepWidQ/SH GFkMqyATDXbU9mjefPaIczH0fGT/L8zpXZxi5WMy4z7P16Tyr4gRWQCPsP/ETavylw+gZ+ kIedbuQ2ejVlwQG/ybWWvini67a9xlz6IibKQFaJvw2sibCb2Kg04kWL3lMuuFZI3DFPHX x9cfpoCmu1RyYx3aOmooBKSGVY6c19xNgx2bvStWQky8fMI+F0b28i1KU8we2/7PFzWdWz 1E13LfusTAlq+4G3JwQC2lo3DEP0tybLEZ6yrz3EV5dKsGmsNpIE1uHi8BSSIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=45v/Cin7Etu6c6SSCdGAmK25FHqC+kC9yVNsIL1qBqM=; b=PcZt0+JYS8t/Ij8VAC156OpWltbS8azuuYYsyQw0WxIo4AAV/x2do4kuxwwW9C4PrMt796 zs1ej7YZRjs/1WGv2SCrzfykeAxfvv18nfJz/zO3p9HGFEYb3PyLLJdxwFRCL7ARPEj3mF tv3dQJP5OZKKWNVHeKcr90/wEIhvOLGfbKjzkd565eq5x3X8vQfZPvhP5+r+rVD/EKTAiw E+YddHZAnOi+tPPXkzsXxI31m8eEgNBsfWHpZXbmn5xekyESi4/h40Ns1j+Mhmz283HYGT NkiF20eF+nlq2dCXmMA7Rdgerxy9eMZwZh4P244s1qm19P/Z72siS6jbjFsiVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9mm85wfFzXKv; Sat, 21 Sep 2024 11:11: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 48LBBa48020029; Sat, 21 Sep 2024 11:11:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBBaL0020026; Sat, 21 Sep 2024 11:11:36 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:11:36 GMT Message-Id: <202409211111.48LBBaL0020026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a924b5ee6a1b - main - ixgbe: fix fw_recovery_mode callout List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a924b5ee6a1b4456b5bde979bb9e15d18726de4f Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a924b5ee6a1b4456b5bde979bb9e15d18726de4f commit a924b5ee6a1b4456b5bde979bb9e15d18726de4f Author: Kevin Bowling AuthorDate: 2024-09-21 11:10:11 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 11:11:17 +0000 ixgbe: fix fw_recovery_mode callout Need to pass the softc in with the callout arg MFC after: 1 week --- sys/dev/ixgbe/if_ix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 74bde3497279..80f288a4ccf0 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1150,7 +1150,7 @@ ixgbe_if_attach_post(if_ctx_t ctx) callout_init(&sc->fw_mode_timer, true); /* Start the task */ - callout_reset(&sc->fw_mode_timer, hz, ixgbe_fw_mode_timer, 0); + callout_reset(&sc->fw_mode_timer, hz, ixgbe_fw_mode_timer, sc); } return (0); From nobody Sat Sep 21 11:13:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9mpk5qDlz5Vpmh; Sat, 21 Sep 2024 11:13:50 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9mpk5JzQz4lSh; Sat, 21 Sep 2024 11:13:50 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uHlSJV/ZT2zJpE+Wbdptyw9ULF9AUheBUFMrE+bd7WI=; b=eRwaxnrdthKLc88HVqLEp8J+WwYz+eO/BVq3SrzJxuRVyG9pcrO/x8Z5omGkad7SKG9fCA Ke7AU+3RBZGqrLpvbZ7ojsuTstPeWqT+wHsdYkznxDEE1ez9k2YbcpiJ4jiOmO7juhUJ4d oI/ruuI34/JelDhUUqSn9ON7prOGx+P7D5PVy+8Tb09fo1xkYLFbKQ2+zwo6RFF4WmXg4u eJS7dlarLa38d9rQrw+UVwMVeZWg8A2kiOTlkF2jvkXwgwEd8ZIbUCmKhxsPQ5N8W95Oax aZvAi/gXLeUvPrxUpPEtfRCU2kAj57W/YU9sF1sXYPvV48gyVN2NJO3KJL2qlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917230; a=rsa-sha256; cv=none; b=StQsnXSu48kA02utvk6D4vAZNiftsynpUb012nhiucCfTEZqx1Wot/pmKhs9VLkdJjBGqh aXpcLoUxMMtGBisoEbNEG0pNIoCb1RYzQkoCW9uAhzPJef1O2ubUK2uIywrXqQfeAoepFe R0ikZ+yuxdtYjC9SZePsMfN7z93ArOeqFmwHF5imDDirNw0liL37VgLdoYstJ7vePdEJae P+bve9qLm4a48MVuAN9H2IRrOZ+1LVApP3VpBHysZZChO/VwtwlK83M/zik669Kn+AQ2fc j+iEp1M72Sd+dAMlAbIfnwj1tTcTeR9JjdHl+yT/PhJ01+2r/6kbG2hZa5mwcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uHlSJV/ZT2zJpE+Wbdptyw9ULF9AUheBUFMrE+bd7WI=; b=fhRaSgPqyv6drQnY+sDyg3UGIhZn5v6fIbmPQ7v+qg1Q7W8/jBBhAnYfYth+CaQIA1itPK 4GkuQxgn8bO80usRT5GbtI16u3I6CfXuDuSMy44cyNwBylpbtC29Kcp2Pn9vhkkZV/iJOF tYFiGZpo/ENF1AMJdjcMdYoUlDt/K0JROfoBg32Ge9WvVc4zymDjgQhpetfvzOe2QpokBn mA1fyi3ZRNtF8Zp8ak1uhgEI09+z6y3yxg7yY7xpZEPNUrvEmyNnZKyLe/meFzhQKSly3/ z3AVRBPfRBaL+Nk8yxX875HbCaEQqCSQYzUETXakj7tgqJLa+xX/EMen3WwB7Q== Received: from ltc.des.dev (unknown [91.174.26.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X9mpk4JrbzjZK; Sat, 21 Sep 2024 11:13:50 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id D6B4DBF3AB; Sat, 21 Sep 2024 13:13:48 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Konstantin Belousov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a52b30ff98cd - main - sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf In-Reply-To: <202409202109.48KL9RZ1078677@gitrepo.freebsd.org> (Konstantin Belousov's message of "Fri, 20 Sep 2024 21:09:27 GMT") References: <202409202109.48KL9RZ1078677@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 21 Sep 2024 13:13:48 +0200 Message-ID: <867cb5z2c3.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Konstantin Belousov writes: > commit a52b30ff98cdab82af140285fa7fcdf1036fef27 > Author: Konstantin Belousov > AuthorDate: 2024-09-20 18:48:19 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-09-20 21:08:51 +0000 > > sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf >=20=20=20=20=20 > Tested by: yasu > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > --- > sys/kern/sys_pipe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > index 2b81d08f7077..6a5d150423bc 100644 > --- a/sys/kern/sys_pipe.c > +++ b/sys/kern/sys_pipe.c > @@ -1677,7 +1677,7 @@ pipe_free_kmem(struct pipe *cpipe) >=20=20 > if (cpipe->pipe_buffer.buffer !=3D NULL) { > atomic_subtract_long(&amountpipekva, cpipe->pipe_buffer.size); > - chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, > + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, > -cpipe->pipe_buffer.size, 0); > vm_map_remove(pipe_map, > (vm_offset_t)cpipe->pipe_buffer.buffer, This appears to be the opposite of the patch which you posted on -current and which yasu@ tested (minus the bit that you committed as af96ccc6a508). That patch replaced cr_ruidinfo with cr_uidinfo in three places; this patch replaces cr_uidinfo with cr_ruidinfo somewhere else. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sat Sep 21 11:18:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9mvz4snxz5VpgG; Sat, 21 Sep 2024 11:18: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 4X9mvz4N1fz4mDf; Sat, 21 Sep 2024 11:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I68tFt8TNYoOsgE4HE5QHtfNjWaSuj4tol3gRBr6310=; b=MzJ9nyCSnsuoN5iFSbVAQ6+3Box/FPTSxSpT5OvzqJWneVqE2Q8TR0hF2/A5Up7F28SlWn Fr2hHSDoEnwYGXSj6jpFwJlgh3ts6oxPL2qMWrOaDdixBqZPUqq5iTqk8/0rYH8I3igP5K pJI/BZZ01SPktMKSYiQF/UyowU5czxlG4ybaZlhh3+Pd7R7MbzV1CNdfDbV8/pqKqSvM44 dRDCQS31MmJG1f2GS8DIIGthgSIh0NcLmr0wSpDUPdJ4n4CHQcOPjnV1M7k9bVWm6qOCOV 3+2F5StpvFKyfhdgfpNQBP+8bEUpoNp2ajRUipz9uI7l/yePQrP2qYzIhfpj6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917503; a=rsa-sha256; cv=none; b=io9dK1/z/GB9E2qMt7u5EwEEwQlcTFkEtgG89KDs1tymmSDzFMG8oicySN6Q9VVzwBxEDC vy0oAcgp5DUulPji49Tos+0lzGkKaYeDzrnEmNwKhY0qqrKhj1iFN61gdz7QuiUkBDFzRf zKmdvUIw/UezEv70zk19mks6iX2lewDSAqOtXE4t3wUR2FZGgEtKC7RhE30E11HrqP2a07 I9OSf9UEbXi6JFdLzZFsaWArUOEa8wNPIPHnzEYC9VgFJPKJoqOspy/K0TlVDbaeyP8dWg P81Dzwfwd+qLVGwkDQCoy1rCue51EcssNPRxlwDko7pCZufmIgs4H5A5lHxf7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I68tFt8TNYoOsgE4HE5QHtfNjWaSuj4tol3gRBr6310=; b=isUEPwCUVo7PyRzwjAYeH4dcaBP1FpkmqWcHQCcd85j1NKBMLXzpRwR45v+HAvKmg85wsz AUIV+zvXM8fGMHk7ifOo2kAqgQjdI+LhKX1rR2RG3BKv/U2SUJS5wAMXAr9Yoh6051Y6KL zYYGkT9ro5RfS6748CjxnJn4P4/u1D+TpVfJ++Ymvu6pGCPffZLt2Eti7Qd/tYC+v9c6pc dHfU13OO4nHGf/cCCfz5u7qE49XkcNt0J0fq6vBBOBI8E3tYVr7DTUGltbicIO4ybM3YoL qkgxhlWx6rJYDtg9xWRbAKloW2BpMVGntbzlg2u+BIUMD8W7n+9demCVcICDeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9mvz3rYXzXNn; Sat, 21 Sep 2024 11:18: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 48LBINI1022965; Sat, 21 Sep 2024 11:18:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBINge022962; Sat, 21 Sep 2024 11:18:23 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:18:23 GMT Message-Id: <202409211118.48LBINge022962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 74d66dc43d05 - stable/14 - e1000: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 74d66dc43d0544d0d4807e6cc19a82421b97a6eb Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=74d66dc43d0544d0d4807e6cc19a82421b97a6eb commit 74d66dc43d0544d0d4807e6cc19a82421b97a6eb Author: Gordon Bergling AuthorDate: 2024-09-18 02:32:41 +0000 Commit: Gordon Bergling CommitDate: 2024-09-21 11:18:12 +0000 e1000: Fix a typo in a source code comment - s/chekcsums/checksums/ (cherry picked from commit 3e614fb600f233097ee5e007cbffdb3001aa110b) --- sys/dev/e1000/e1000_82575.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index fded5dc2b04e..a33aa9eb2903 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -2425,7 +2425,7 @@ static s32 e1000_validate_nvm_checksum_82580(struct e1000_hw *hw) } if (nvm_data & NVM_COMPATIBILITY_BIT_MASK) { - /* if chekcsums compatibility bit is set validate checksums + /* if checksums compatibility bit is set validate checksums * for all 4 ports. */ eeprom_regions_count = 4; } From nobody Sat Sep 21 11:18:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9mwL5Whxz5Vq06; Sat, 21 Sep 2024 11:18: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 4X9mwL4Yx7z4mLV; Sat, 21 Sep 2024 11:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RBHmxq9R1A8a9xQIRijudTmRyZDUVOib9Npx0MGG8B4=; b=kaO2eDKwdWx4wLXJRq6S00I6tKnFYiI0axlAByIEZ2haQPeL4DerVr2tpJv+KpDtwj1hiU a955w5YmaCkGvZlG1LemnbjN0Fltz/2AHp+ZNCfx9bSanGuaNGTIXoDAQ+GY6NkTqDHQNo TX3dS6HOL+xue+YGhhSY/nq3Tj6uHPY6vgaDJG0il+os50MZ3HejdeI0h+rg2OaM0UBv5C cgETZ2P/O1YqfApQAnFWp2Wpd3Y34NsvtOXScCFlNtFV1j5GWouSjL9cL2ggvYH0uFz7TD 81TxREBoetNdZlF812vsNKUyAs5IKrSMK38vI8KAPEspyN8Q5WUpso1wtaC2tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917522; a=rsa-sha256; cv=none; b=M6+KcXpjk8/q4uRmtyrLizciFzXMDr+8h6AyJmBbL3zOuenRtaQ3mzn1H+CYZHmhBfhJoL /ct+LiO2Xhfz1a6SlsNNlBTyxWdPhrbQr2EaibzvUr1XD6eLfk3FIacPBdBQNNOLgpJY+q 9CNDtmJGY+jqjlRyszQODGIy2yagkaB5VFwh3rICCuxu6DLEm99x5+3EQLDMTS30n50+6L 98sQojdOHs1i83tT1WrkFq+0JPncVYfwBj+3RZR2oaW69TJ/Vyg86+GJ8vtcb8MmndtfpO uKGBNLcJA4atq0lNYFdmJpkIjrquz+QTPU5CzTsleAqgc0SZY8rPSl7Sh6iDIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RBHmxq9R1A8a9xQIRijudTmRyZDUVOib9Npx0MGG8B4=; b=pXHwuUVIn61WdtUSigFxC7rLoQOgQB373+UvAhZHTqGO+/lemgsclXHY3LbHu7F4ZwUXiK AZmMcIN6n5QUqIvEDBpFbnaxHTZ3q28tdIwaRrQjH+zS79MI9Bf7hCdaS0wcBGsvMw9X9g NyRINscRoMz00qYTcDJlsueY3JjPRjGobvQumbbQLqP7w9YodKZz3aE2LKpfuhLNj++HFj TC1I8quqRocQyCuGNjWnI61cP4Z0N53etptoJnj+EHOOqwDrJ9MPilfJ/k7R6A9Dogg82/ iS6MAS+OH40rVd8WO4DH0aCR+TcMI8cUpLVqg36g9pL2Ef+75L3jfWdr5d3MVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9mwL40DVzX3h; Sat, 21 Sep 2024 11:18: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 48LBIg5k023134; Sat, 21 Sep 2024 11:18:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBIg9B023131; Sat, 21 Sep 2024 11:18:42 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:18:42 GMT Message-Id: <202409211118.48LBIg9B023131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 696860052a2c - stable/13 - e1000: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 696860052a2c897544d1a979a663a1dda5cb7652 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=696860052a2c897544d1a979a663a1dda5cb7652 commit 696860052a2c897544d1a979a663a1dda5cb7652 Author: Gordon Bergling AuthorDate: 2024-09-18 02:32:41 +0000 Commit: Gordon Bergling CommitDate: 2024-09-21 11:18:33 +0000 e1000: Fix a typo in a source code comment - s/chekcsums/checksums/ (cherry picked from commit 3e614fb600f233097ee5e007cbffdb3001aa110b) --- sys/dev/e1000/e1000_82575.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index fded5dc2b04e..a33aa9eb2903 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -2425,7 +2425,7 @@ static s32 e1000_validate_nvm_checksum_82580(struct e1000_hw *hw) } if (nvm_data & NVM_COMPATIBILITY_BIT_MASK) { - /* if chekcsums compatibility bit is set validate checksums + /* if checksums compatibility bit is set validate checksums * for all 4 ports. */ eeprom_regions_count = 4; } From nobody Sat Sep 21 11:26:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n560lKWz5VqRW; Sat, 21 Sep 2024 11:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n5604zRz4ndJ; Sat, 21 Sep 2024 11:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tsdi6VMO+MEp/kE5mVSz08pvXf7HVC5uugXh1tw4DVc=; b=Vr1ZMGcg0m7RFtskHHjnHlmM7DmXNmiBGtfc01lhCXh5nM05F9o69B6dL2iqQCqj+8ZLDi SbcTDgtZmLlT0p4tOBcQu8qL1qotLWDyRWb4AUhe3+dA8/hK3BNytm7tZf85eK8Cbi5t14 5JJOKT0l0onfH0wnFM46bXQXUIuFHCJScGeKKM54YM8v02nM1f3L/t8Y75C8LSmB/8C6iB QVK3cJvDYs6EVMzLcWKGcyllavAj/Q58tn566vCz1Vx1912s1vW+9KYpavWFbVT+UOYvk1 eCRSuqfFAg65mN3hsCIO8QLwNG5ePZPnFrgME1pf8ZOvctOMFNb9U3R3ODNy2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917978; a=rsa-sha256; cv=none; b=xRFtlLJ4qc0OVOQLnTzgRqC7/CD8V0DwvKsxpaVTpbDJjvjSNiKkvKHaJCny7IzaiEglGd seZD//vJWNd0W/MtVzUnI29mDG08mUiswYKU+jGhM2udJwS8xGpYiZaJblRCMlWBYPTXNF 9NEyt/gBskf6qA8886ILMe4YLd+y8mBlskgvtIdnlqKggRkfxIU2gL6Y2CU9LEqjUGZEK+ LTZqsm4+yRDAV6RNa+5UZNjC31qEVhEdH6QODbyJb2+yEaiWdXylQ5G3FCClH6XHtQo2zQ u/IgtAF6fov2GDh92eJ2Ebb17+WOYynE+gPALvgasKb5x0iQYEMlwM4x3osx4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tsdi6VMO+MEp/kE5mVSz08pvXf7HVC5uugXh1tw4DVc=; b=ORUQcKpjfZRzd0FMv2/t8zCWMlC7O/ObptSeTZ6KvbdaAdd7CfAZtjdKtNdX2QuAjXSO+v t8OTg6YleHx2j1whDMlMbsI58F6VyUKOTNb8f3qx+bFx4EdJUN1E1sqCgqQUFdhhV2I56U pT5/bADmGAcABXQuRjEGwbdEQtnDpkLN9yJ37NUt+W5/wOQjMmo12mJFHQ/FzzqoRxcS9I hmk005DmX4O8ISk4AhJylHL4BRNbN8L/wglLkQGq6UdXcneqxe/qxhTExlQhdv0KFPk4eo Vios4UpDTzyHo57sqvFgeSuHNmp3t2n1dNeX9mYKKuRKWFhtrBmOmJvEn3DvBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n556HrtzX8r; Sat, 21 Sep 2024 11:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQHRq040061; Sat, 21 Sep 2024 11:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQH7t040058; Sat, 21 Sep 2024 11:26:17 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:17 GMT Message-Id: <202409211126.48LBQH7t040058@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: 1693e3be3bfb - main - u3g: reorder Quectel devices by product ID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1693e3be3bfb9911bb9c31d2ce35ffb20674df2b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1693e3be3bfb9911bb9c31d2ce35ffb20674df2b commit 1693e3be3bfb9911bb9c31d2ce35ffb20674df2b Author: Franco Fichtner AuthorDate: 2024-09-07 09:33:44 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 u3g: reorder Quectel devices by product ID Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1410 --- sys/dev/usb/serial/u3g.c | 10 +++++----- sys/dev/usb/usbdevs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 28a403a846bd..a549f93b2af1 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -512,21 +512,21 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(QUANTA, GLX, 0), U3G_DEV(QUANTA, Q101, 0), U3G_DEV(QUANTA, Q111, 0), + U3G_DEV(QUECTEL, EC21, 0), U3G_DEV(QUECTEL, EC25, 0), U3G_DEV(QUECTEL, EM05, 0), - U3G_DEV(QUECTEL, EC21, 0), U3G_DEV(QUECTEL, EG91, 0), U3G_DEV(QUECTEL, EG95, 0), + U3G_DEV(QUECTEL, BG96, 0), U3G_DEV(QUECTEL, EP06, 0), U3G_DEV(QUECTEL, EG065K, 0), - U3G_DEV(QUECTEL, EM12, 0), - U3G_DEV(QUECTEL, BG96, 0), - U3G_DEV(QUECTEL, BG95, 0), - U3G_DEV(QUECTEL, AG35, 0), U3G_DEV(QUECTEL, AG15, 0), + U3G_DEV(QUECTEL, AG35, 0), U3G_DEV(QUECTEL, AG520, 0), U3G_DEV(QUECTEL, AG550, 0), + U3G_DEV(QUECTEL, EM12, 0), U3G_DEV(QUECTEL, EM160R, 0), + U3G_DEV(QUECTEL, BG95, 0), U3G_DEV(QUECTEL, RG500, 0), U3G_DEV(QUECTEL, RG520, 0), U3G_DEV(QUECTEL, EC200, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 861e5ad73a2e..61c7686da957 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -3988,21 +3988,21 @@ product QUANTA GLE 0xea06 HSDPA modem product QUANTA RW6815R 0xf003 HP iPAQ rw6815 RNDIS /* Quectel products */ +product QUECTEL EC21 0x0121 Quectel EC21 product QUECTEL EC25 0x0125 Quectel EC20(MDM9x07)/EC25/EG25 product QUECTEL EM05 0x0127 Quectel EM05 -product QUECTEL EC21 0x0121 Quectel EC21 product QUECTEL EG91 0x0191 Quectel EG91 product QUECTEL EG95 0x0195 Quectel EG95 +product QUECTEL BG96 0x0296 Quectel BG96 product QUECTEL EP06 0x0306 Quectel EG06/EP06/EM06 product QUECTEL EG065K 0x030B Quectel EG065K/EG060K -product QUECTEL EM12 0x0512 Quectel EG12/EP12/EM12/EG16/EG18 -product QUECTEL BG96 0x0296 Quectel BG96 -product QUECTEL BG95 0x0700 Quectel BG95/BG77/BG600L-M3/BC69 -product QUECTEL AG35 0x0435 Quectel AG35 product QUECTEL AG15 0x0415 Quectel AG15 +product QUECTEL AG35 0x0435 Quectel AG35 product QUECTEL AG520 0x0452 Quectel AG520 product QUECTEL AG550 0x0455 Quectel AG550 +product QUECTEL EM12 0x0512 Quectel EG12/EP12/EM12/EG16/EG18 product QUECTEL EM160R 0x0620 Quectel EM160R/EG20 +product QUECTEL BG95 0x0700 Quectel BG95/BG77/BG600L-M3/BC69 product QUECTEL RG500 0x0800 Quectel RG500/RM500/RG510/RM510 product QUECTEL RG520 0x0801 Quectel RG520/RM520/SG520 product QUECTEL EC200 0x6000 Quectel EC200/UC200 From nobody Sat Sep 21 11:26:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n572RmVz5W59N; Sat, 21 Sep 2024 11:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n570PxTz4npH; Sat, 21 Sep 2024 11:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12GM4USgPH8VLapOiGKpJDUMNw2i6wf6I6Deez+o9b8=; b=cr0DiMvp+GJV+xXDowXh3b92FcEZTieqaHK7hrDG/g3fw6ELvXz34CroHFIKeq5cgSKBGh 6hKq3lKJAGAkGNesgPXQSIcgUZu1fKB6prhJe0kf/IVHP7hImB8HB0FImreQVmL2gQRUyx rpTYwfsWJDwv3AKKgRst+pOSIZpSHx1M1/rAc9bEgSsbaq+YPrMYDVtj7d/XJdepx0Ol3L kA18KpGh6ztoMGoDJ1ZC7wNJXNLYW0xRGvymhfCvl1RhoqGoqILDxdLgINEPpYmIkU/KLh HZF+8PcLT9eS8OLDQeltTZ7ABa+yHmzaVtV51Cl40rqeuCnjBQ70zI6P5C8Jcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917979; a=rsa-sha256; cv=none; b=ptm6nLZRhP6aa28P+0gWG9GjHF/9Jz5/qb2IJL7UY3UwLqMLc0tJczi6NqSQ8ulD4wjXps e0FDIdSYUSyq1yeFwNoXZQ+l1CO1AGBjbb8zSI5gbTILizIRn8rkyFlYvC/KdEAOU4ZsMH cBZ6fLe/jHGBwJISlJF9phKg83A1hX7y4KsjBo4j1AsOGjmp4YprJyY2UWY0ALfs6sMWzH W0N5/ttORHAjbLWg5NBDfa03ITsddtfZ7nPss3PFWJhnaymoaEN+UWyfLcXg82R4xttsXo rDnDJVfypmK2ed6hmTIVuCcGkQaqQfN31R6xWeKZyhrqD3UBhOBkvxn1A5Q8rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12GM4USgPH8VLapOiGKpJDUMNw2i6wf6I6Deez+o9b8=; b=ElTBHx1LfyoUIgxRR7cKJ/JKr47dxvBcvsefszCzJ7mc4e7G5DQu0Th/YonpWBn/dVMAKw Qb9qDf75nDf3yRcorg/G7aIaTq7eRSGLo2EY8zc01Luc8YlPaTprViIcRlegyISgDrzev0 RSPQsDsZB/lkNpm1/5EW8x9TJjV1zjU8dvVJO4EGlVpanyMliZyBjR4FKmm3RtN3O2SKjx 7tx9nm/OuRGH/AS28u9/qqisnh1rMpHMjb8XwbvpcBTG2aZXpyLOMMk7TZg5hbXhAKmeWC j07Z0QEDH82Bh2WqBVqtKEa/O6NUPDxd6d0KtaTYPMgOmd8JAap1rLWoNjUTqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n566trwzX79; Sat, 21 Sep 2024 11:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQIHL040100; Sat, 21 Sep 2024 11:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQI06040097; Sat, 21 Sep 2024 11:26:18 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:18 GMT Message-Id: <202409211126.48LBQI06040097@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: 45001ab45ed0 - main - loader.efi.8: BOOOTX64.EFI: fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45001ab45ed0ff4706300592715563fb87d26c9a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=45001ab45ed0ff4706300592715563fb87d26c9a commit 45001ab45ed0ff4706300592715563fb87d26c9a Author: Graham Perrin AuthorDate: 2024-09-08 22:02:04 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 loader.efi.8: BOOOTX64.EFI: fix typo Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1412 --- stand/man/loader.efi.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 3527d8b66a99..84ba5c4fdb30 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -434,7 +434,7 @@ to the default name if there wasn't one there before. Check to see if they are copies before updating (with X64 substituted using the above table): .Bd -literal -offset indent -# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOTX64.EFI .Ed Copy the loader: .Bd -literal -offset indent From nobody Sat Sep 21 11:26:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n585fVKz5Vq8j; Sat, 21 Sep 2024 11:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n582Klvz4npR; Sat, 21 Sep 2024 11:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ylISYavsu/450PswiD3rDCvx5yhcxh583CKRxhO8rk=; b=uJvNZUR97onMJDJhf2oUMmht8XVTInNNB3kW/lR1Q5F5SF1hTBYCO2mR0sz7k3yX920Mpn 76Mxma6UAEuPAIgNWMS/YUzG1EoQen5D9tPSDgr077rPoNw0DI2qycIslrNcnmffLPUmas NaSJkI7Lb2LOrXICc8B6Wyb2G5/ZauNKSCcZFtx81cS+GbLcCbtwKTyl7x6CWb1FSFEBJs y2qAaUsMX/OLlYd7SAlgeQw+HJ0X3RhH3qskW/6Wrq89i5o2eTWKDXnjOvjnnMSAcU5XcL rXZ2PoYPqUl5ozmsXz9ou1pQ1gcDSQNqmAFuiPcHTMAbKox474feTNgqhjIUuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917980; a=rsa-sha256; cv=none; b=guo+V8rirNQQMiDTv5EqhefEWN9oAv8VtFIZKn3Jq2o1m2D8J1Kk5XlC1c9gr0bFvoTVWi IF9uAPHn+HqxSKmpV7sz1lb+dfIYPW7PGOqHvLmHeY9EpBHl5G8gff92/7+QmJo2vEVLqK WC7eynfRKC8OCqRdjOYK3Ul8vG1PnSUSx+CKLORRlcFAMSQOiPVqBlVcR+jDqpO1wIpcMi USFenfHRQs+EgVXZAFotED5j5Kebcw1ULBqWWy/wHpWWCfx7uK9/qL73HTHu4G5NFYAOI+ mV7ZZTDvgnahZWGb1bJE65sEhXMLoTITsghanUJspS8JDh6IY2BuuOdUWH28qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ylISYavsu/450PswiD3rDCvx5yhcxh583CKRxhO8rk=; b=dA2Ny6uVMesFVenL6VWNpYC2wr3Z+be/fL9UihN9nhZsN+wnusRDfoG/0o9RVkyH7NDk/8 oEo160fL75OZjbjFAf31JoB8+nbEmL655Hz0cS+PH+CsTh1SnIgABEO20S29bxu0ULm4jn axYF5ehErAmnwOUWAIwLvXGGEjdcYlj4wlaT7kBX/u65XbngPjziUvs/n5t5OzEIB+VQQg VIIMegmwQC+of3CSALFxErGK5sz5yySjXwgSJIMV44TcRN/QSLLtSRBLwVu2WZkgAv/9C0 2zqoBBtd4uh3zJuRFcokymAu20S0pjawEHQLtzzPezER6sh0pYZUEiznx7PFNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n581nLFzXfF; Sat, 21 Sep 2024 11:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQJSZ040139; Sat, 21 Sep 2024 11:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQJ1G040136; Sat, 21 Sep 2024 11:26:19 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:19 GMT Message-Id: <202409211126.48LBQJ1G040136@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: 2878d99dfcfb - main - manuals: Misc macro typos List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581 commit 2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581 Author: Graham Percival AuthorDate: 2024-09-12 16:36:42 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 manuals: Misc macro typos These were reported by `mandoc -T lint` as ERROR: skipping unknown macro When these pages were rendered with `man`, the "unknown macro" meant that the entire line was omitted from the output. Obvious typos in: lib/libsys/swapon.2 lib/libsys/procctl.2 share/man/man9/firmware.9 lib/libcasper/services/cap_net/cap_net.3: 'mode' describes a function argument. lib/libsys/statfs.2: there's no .Tm command ("trademark?"), and .Tn ("tradename") is deprecated, so remove the macro entirely. usr.sbin/mfiutil/mfiutil.8: man was interpreting '/dev/' as a macro (which it didn't recognize). share/man/man4/qat.4: same issue as above, but with '0'. In this case, given the context of the previous line, rewriting as "Value '0'" seemed more appropriate. usr.sbin/mlx5tool/mlx5tool.8: typo in .Xr Signed-off-by: Graham Percival Sponsored by: Tarsnap Backup Inc. Reviewed by: concussious, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1417 --- lib/libcasper/services/cap_net/cap_net.3 | 2 +- lib/libsys/procctl.2 | 2 +- lib/libsys/statfs.2 | 4 +--- lib/libsys/swapon.2 | 2 +- share/man/man4/qat.4 | 2 +- share/man/man9/firmware.9 | 2 +- usr.sbin/mfiutil/mfiutil.8 | 3 ++- usr.sbin/mlx5tool/mlx5tool.8 | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/libcasper/services/cap_net/cap_net.3 b/lib/libcasper/services/cap_net/cap_net.3 index 6e525508d3c4..e322222e866f 100644 --- a/lib/libcasper/services/cap_net/cap_net.3 +++ b/lib/libcasper/services/cap_net/cap_net.3 @@ -121,7 +121,7 @@ The .Fn cap_net_limit_init returns an opaque limit handle used to store a list of capabilities. The -.Fv mode +.Fa mode restricts the functionality of the service. Modes are encoded using the following flags: .Pp diff --git a/lib/libsys/procctl.2 b/lib/libsys/procctl.2 index cdb379696401..df8119799c6d 100644 --- a/lib/libsys/procctl.2 +++ b/lib/libsys/procctl.2 @@ -75,7 +75,7 @@ All status changing requests .Dv *_CTL require the caller to have the right to debug the target. All status query requests -.DV *_STATUS +.Dv *_STATUS require the caller to have the right to observe the target. .Pp The following commands are supported: diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index 50809869a022..a2abd9e7d7cd 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -231,9 +231,7 @@ Corrupted data was detected while reading from the file system. The fields in the .Vt statfs structure have been defined to provide the parameters relevant for -traditional -.Tm UNIX -file systems. +traditional UNIX file systems. For some other file systems, values that have similar, but not identical, semantics to those described above may be returned. An example is msdosfs, which in case of FAT12 or FAT16 file systems diff --git a/lib/libsys/swapon.2 b/lib/libsys/swapon.2 index d7694ed48c8e..23ed0bc2aa83 100644 --- a/lib/libsys/swapon.2 +++ b/lib/libsys/swapon.2 @@ -67,7 +67,7 @@ is made available for other purposes. The .Fa special argument points to the name of the device or file used for swapping. -.The +The .Va flags argument takes the following flags: .Bl -tag -width SWAPOFF_FORCE diff --git a/share/man/man4/qat.4 b/share/man/man4/qat.4 index b0fa0b0cbc92..02be0837ce54 100644 --- a/share/man/man4/qat.4 +++ b/share/man/man4/qat.4 @@ -148,7 +148,7 @@ QAT firmware revision number. Summary of device specific configuration. .It Va heartbeat QAT device heartbeat status. Value '1' indicates that the device is operational. -'0' value means that the device is not responsive. Device requires restart. +Value '0' means that the device is not responsive. Device requires restart. .It Va heartbeat_failed Number of QAT heartbeat failures received. .It Va heartbeat_sent diff --git a/share/man/man9/firmware.9 b/share/man/man9/firmware.9 index 883f0a2634d4..f324861248d2 100644 --- a/share/man/man9/firmware.9 +++ b/share/man/man9/firmware.9 @@ -341,7 +341,7 @@ uses the following algorithm to find firmware images: .It If an existing firmware image is registered for .Fa imagename, -.that image is returned. +that image is returned. .It If .Fa imagename diff --git a/usr.sbin/mfiutil/mfiutil.8 b/usr.sbin/mfiutil/mfiutil.8 index 86dc6b6ee122..9f8cacf7f16d 100644 --- a/usr.sbin/mfiutil/mfiutil.8 +++ b/usr.sbin/mfiutil/mfiutil.8 @@ -271,7 +271,8 @@ Currently three global options are supported: .It Fl D Ar device .Ar device specifies the device node of the controller to use. -'/dev/' will be added to the device node if needed. +.Pa /dev/ +will be added to the device node if needed. If no device node is specified, then device will be made of the type and device. .It Fl t Ar type diff --git a/usr.sbin/mlx5tool/mlx5tool.8 b/usr.sbin/mlx5tool/mlx5tool.8 index 13c19d2d032b..cca1adeedbeb 100644 --- a/usr.sbin/mlx5tool/mlx5tool.8 +++ b/usr.sbin/mlx5tool/mlx5tool.8 @@ -60,7 +60,7 @@ The utility executes commands on specific adapter, which is addressed using .Em device:bus:slot:function conventions of the PCIe buses. You can match adapters ethernet name and addresses using the -.X pciconf 8 +.Xr pciconf 8 utility. The address is passed as an argument of the .Fl d From nobody Sat Sep 21 11:26:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n593WVkz5W5Ct; Sat, 21 Sep 2024 11:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n591lnCz4ntp; Sat, 21 Sep 2024 11:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWl6wk+azK8zDlPdAa43a/GYPDC4x/qxinz7aaXew8s=; b=BwswWaJoLFc2ubR5i8seHd0ChFRHx9r7+Bz6phlHz6DDKgJ1MAmUv/Nh1boR05/j/kumTS pUq+EOEuWJREpurQI3vWm5Tjw+7CO5Zv5SagDrXV9Uaew2GuCzTH75iyJcHPqXbOPNQXza e7P+w19RsPiLdgnoHSeKaXlGBEXTNYzEIDClYJJd3ZAjCV32oNsDdKJv2QXvoldOe8JwzZ sBrTTLRS7NCaN7+B/Ghkl8uFhIC0EGv+t83KUqWjDKKtuA+tB4+r3ULd1u3Zk2TypkLhvc M1Cb4WYxN3k+FN7eMh/jImtst2F4BKdopb5MXY4s84Wv16UYD079Y96TpeClyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917981; a=rsa-sha256; cv=none; b=B0wvDULSq/LiEvAPNEhPWjpY7AGUqoIaTZW7f6aXIBOGMTJ+owjWs41ww3Fv7wqW3Lqtrz KM6f73XaAB/ktBdABz0h1MDh+pIsRH5qYYSwZMRjOAGbYXbu6QkN9ThEnKJA9+eryYauu3 5TuRiqgN1CxsRP1jEvF8g4OO1Wyc3FlubOS9gSMDqr/Hn1nd8ZhWDnij8FW0oIbW4dUJst jhwdH+TChFbBnX+/kLoobG07zHPxzPpUIfHnvPJVDlkyHWW4QWpwIJvJm5NiISTLCH4key 0LHHEWujr6LGRQAS7y7p4tzyrqo+ZXd4/u/UPw8njCv/38h/OtN7hGG4B6WpeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWl6wk+azK8zDlPdAa43a/GYPDC4x/qxinz7aaXew8s=; b=sAhg9zCihGdCA781tmv/S0XFP3D418FvHNKqKsv4mQF6JBQ0M4LQnQdAT8XZX3k2ZhGikn dN9kh+tQyRjjpEv7hDRfgiraCwlwUIz0wcIVmxWtRfSWZPz9IglV3UKUPR/pLcZ6rTCKdX kvtScyTnugxIA/U/VQQJTbLmgsjf/m9/kBqQlt0Cz1sYEe/ohNjAUJQzSVug8IAOFwPvhY zGxy+OpEnaSkZdF9w09m+cS0PadzadD61GpAAVl9pv8L7Ams92Bb5hNvzRqAoQvbLdPs1n o0C34pSMgznTEIfLLTiln/1E2MO11t2/UnAgDNIDQoWNCP0w+ha0TMpXox8mLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n591BYnzXTN; Sat, 21 Sep 2024 11:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQLdZ040181; Sat, 21 Sep 2024 11:26:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQLuF040178; Sat, 21 Sep 2024 11:26:21 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:21 GMT Message-Id: <202409211126.48LBQLuF040178@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: a55640536ace - main - Install xo_emit_f.3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a55640536ace15909e57c57c57cdd1270ba82da2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a55640536ace15909e57c57c57cdd1270ba82da2 commit a55640536ace15909e57c57c57cdd1270ba82da2 Author: John F. Carr AuthorDate: 2024-09-03 17:41:43 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 Install xo_emit_f.3 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1406 --- lib/libxo/libxo/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libxo/libxo/Makefile b/lib/libxo/libxo/Makefile index 5b40d1e26880..38e6ff031c7f 100644 --- a/lib/libxo/libxo/Makefile +++ b/lib/libxo/libxo/Makefile @@ -28,6 +28,7 @@ MAN+= xo_attr.3 \ xo_create.3 \ xo_emit.3 \ xo_emit_err.3 \ + xo_emit_f.3 \ xo_err.3 \ xo_error.3 \ xo_finish.3 \ From nobody Sat Sep 21 11:26:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5B6fhxz5Vq66; Sat, 21 Sep 2024 11:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n5B3JtZz4ns3; Sat, 21 Sep 2024 11:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mv0d3Eeg+xytzK3AiigajSK+PeegBMjLE2782CNekHM=; b=dh2PXzxF54plITAKXonJ7SE+HblzELgFzIRan3r8m2X7vGomvnSKpO/AJWe4gQb0ASRI7H nejqE8PXAsYtq7n6WKDkD3iQhg99J+YjbOiaO8clegAwQn7LjmuerZnu3wsxBMgDAxs6u1 R6GuaFEO5FpWyT+9Ubl2mbXSjL/V/xlGAT4YBUCHmsm7hmvv0CmJYqAFWnz8OUcMzo4CMJ JFGEVeiMjqEtluuTKM1ekEZiZVMtKr6+054uYzPXn9xHvahrZsJby5Ct3ibt04305obuek nkH9KSaLDAWidS+QaOeFVjHUr8z8BMM/p8Y768unlxmmfHU+91IeYYjKxVhRCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917982; a=rsa-sha256; cv=none; b=R6+cX7krHgvnN4Q6UVBfRX9gHlO2/9UV0PnS9HJyyYAN9++NQJmpx4OngnwCTruzY6OfeG E1z5rY35ai/x5XVyXi4HCyWg3rZnJd+1ZSw1fTW+AKar0IxdZHJmMT73XwIIRvpAgXPFnH Vwg0C5wKZei/pvj61B2tSTJ8PsnjIYDgcco4NEmUoJd9hYgIvULLo02EZJQ6Fh64OvQrTY B6UX0WdLIWcMadz5ESnybEZTTonSc9wiTO8i44VbIM82iUC3wslnIum+5KJCyDSuudT//x Hq+vCtpr0ve0p/suYUSyhA6XT+Af86PHGxov8yA1Gvi0TNQaFvnAVL2AiyXVCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mv0d3Eeg+xytzK3AiigajSK+PeegBMjLE2782CNekHM=; b=X6k/abP3zE87YJZ6cujdZiR9dXsIMVFzE8fGJhORBY/3HkCVMOTr6XRnQGlEYVcDKpuK9D 2nJmGkOqICgXXt/FFEaKTy8SDjHF24Q7MWH0ve5/pe2IH2/qiaqzlno0gtVnLqjfFOJawF 1UewMsldcA9jGr+WXsd6n9H1Wc3jrnDZeA2GwsGjaIwTLgrFdQJECosiXX70OFX2iraDDe n+L7YZK3hZFNMaCGyRdNu4M2oFKm6oL1EnDuDPleIDLxzVTWerIROCR7lWb1tF6jAz8E3n xdauq/yRbd/5+xocqMpUqeLHjRNVADK/1+fyxUT2evnNoc/6Fc8OzioSqCWCYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5B2Ns2zXLW; Sat, 21 Sep 2024 11:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQMDC040235; Sat, 21 Sep 2024 11:26:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQMlZ040232; Sat, 21 Sep 2024 11:26:22 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:22 GMT Message-Id: <202409211126.48LBQMlZ040232@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: c3c06f94f048 - main - Remove unused includes, migrate to stdint.h for uintXX_t types. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3c06f94f04847dceca2a5df80f7ef1ec00709ec Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3c06f94f04847dceca2a5df80f7ef1ec00709ec commit c3c06f94f04847dceca2a5df80f7ef1ec00709ec Author: Faraz Vahedi AuthorDate: 2024-08-21 13:08:03 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 Remove unused includes, migrate to stdint.h for uintXX_t types. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1392 --- lib/libfigpar/figpar.c | 1 - lib/libfigpar/string_m.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libfigpar/figpar.c b/lib/libfigpar/figpar.c index 803ebadc3f49..19fb91f08900 100644 --- a/lib/libfigpar/figpar.c +++ b/lib/libfigpar/figpar.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include diff --git a/lib/libfigpar/string_m.c b/lib/libfigpar/string_m.c index 2e4adcdf791c..df3def788971 100644 --- a/lib/libfigpar/string_m.c +++ b/lib/libfigpar/string_m.c @@ -24,11 +24,9 @@ * SUCH DAMAGE. */ -#include - #include #include -#include +#include #include #include From nobody Sat Sep 21 11:26:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5C5nJ5z5Vq6C; Sat, 21 Sep 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n5C3l9Yz4nhN; Sat, 21 Sep 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5s4SbOMjs/wb20l9sGlS+lwzih8UiJ4eP4p9wQBR/ro=; b=HJ6CXvzbQTAckMExnx2wzp4992taKUEZgz0hwDtop8KIsGz+Eq8jwp4MLmh6bW2vswAH96 TaC7XF8BQO7jS+/sDltgMUkMgbnKXeyG9t2V7iIYnjtbg/bEfJFI6bl2avkfQ4RUqIwlM5 5KY7QSMe4bkMhEGxhKeVxxzm2iNDOmwq0SnZrNHNnknD7cotnVFPaQZgTQCLlkXTxNF5CX OMuWgxTpmcdz58EpoPlhXz1MYEqQLhAM9ri36XguRxgVXzbs31xvFd5rhbkJp2vwJFY/4Z QwNehEZac3TvYyIdemkHPLT3mOMTztlKEEsKn6rL8ySNLEmtuGycEd6yDbQk6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917983; a=rsa-sha256; cv=none; b=JNW/kGKDivYcFQJLXfk9IZWWNsbTwFbcKCEjwqMc6kamx3NJ8UtD4P2AXnlhxQOLo/NMQq 9BhKbMbf5hJLD87lpSdQ4xqSNkXmBCqmJRo2FZr7qLaSbuM3T7VEmjkWFpDz65K83sF336 Bla9XJBBEvIRS4bFhhFCKfEGhA36efrZz/NgHRIFAWdziT0QTmvnrKR/MI1yZIDW9gd2em UwKZnMraLS+Vgc7OnO+fu9FkXHqjz6mrfi2ynxjfDdKAr0khkORGsYn3EKgPK1cHXQnDwn UyZENv2IS6OQ7l+gBH+gSxrmsxkjgbaT1CGRSmo453M9zJBS0SUjkPdiHF8PHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5s4SbOMjs/wb20l9sGlS+lwzih8UiJ4eP4p9wQBR/ro=; b=sFq4HPWeIKoXWSKUqkRyBFCC2voQQdmjG39crEBB94XLRDtUre0n+GaBh956m9s0ZTTMMW bjWwQcUBDuU97diSvVqHHe+6h3+etdwGXy3wAF/QaxUy4zGY561TidRGeJTDlD4/bSRMHE 280k9PrXXhEWb6rL63tz5R8f+KGPWsPEfFSuVOIxMj08Dd9A9RvFY674kv7Doz6Jq8818X 0ToZ0J8CpKVJY+PwdGJmCby8Lwt9C9FPHig2byzcfgR4m2Z+ArY0e4IlpTfgY+qW4UAfBD 0dRlqYbsvEnPJgcT95f3Vf+Z3A9YhGTXPFe17TDv1BzveZrWZBwjnKf9WI8E0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5C2pJ8zX7B; Sat, 21 Sep 2024 11:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQNQ0040283; Sat, 21 Sep 2024 11:26:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQNmk040280; Sat, 21 Sep 2024 11:26:23 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:23 GMT Message-Id: <202409211126.48LBQNmk040280@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: f144058b4066 - main - Refactor error handling in lseek operations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f144058b406656fa4678f8ff2f04c2da46176c79 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f144058b406656fa4678f8ff2f04c2da46176c79 commit f144058b406656fa4678f8ff2f04c2da46176c79 Author: Faraz Vahedi AuthorDate: 2024-08-21 13:19:38 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 Refactor error handling in lseek operations 1. Subtraction was performed on the current position regardless of the success of the lseek operation. In the event of an error, this resulted in the current position being erroneously set to -2, which bypassed the intended error handling mechanism. The proposed change performs error checking immediately following the lseek operation, prior to any modification of the current position. This ensures that a failed lseek operation will correctly trigger the appropriate error handling. 2. The error checking logic was based on the assumption that lseek would return `offset - 1` upon failure. However, this is not consistent with the behaviour of lseek as specified in the POSIX standard, which stipulates that lseek shall return -1 in case of an error. The code has been updated to reflect this standard, improving reliability and compliance. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1392 --- lib/libfigpar/figpar.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/lib/libfigpar/figpar.c b/lib/libfigpar/figpar.c index 19fb91f08900..fbc6aaaba606 100644 --- a/lib/libfigpar/figpar.c +++ b/lib/libfigpar/figpar.c @@ -160,11 +160,11 @@ parse_config(struct figpar_config options[], const char *path, } /* Get the current offset */ - curpos = lseek(fd, 0, SEEK_CUR) - 1; - if (curpos == -1) { + if ((curpos = lseek(fd, 0, SEEK_CUR)) == -1) { close(fd); return (-1); } + curpos--; /* Find the length of the directive */ for (n = 0; r != 0; n++) { @@ -186,8 +186,7 @@ parse_config(struct figpar_config options[], const char *path, } /* Go back to the beginning of the directive */ - error = (int)lseek(fd, curpos, SEEK_SET); - if (error == (curpos - 1)) { + if (lseek(fd, curpos, SEEK_SET) == -1) { close(fd); return (-1); } @@ -245,11 +244,11 @@ parse_config(struct figpar_config options[], const char *path, } /* Get the current offset */ - curpos = lseek(fd, 0, SEEK_CUR) - 1; - if (curpos == -1) { + if ((curpos = lseek(fd, 0, SEEK_CUR)) == -1) { close(fd); return (-1); } + curpos--; /* Find the end of the value */ quote = 0; @@ -267,19 +266,18 @@ parse_config(struct figpar_config options[], const char *path, */ /* Get the current offset */ - charpos = lseek(fd, 0, SEEK_CUR) - 1; - if (charpos == -1) { + if ((charpos = lseek(fd, 0, SEEK_CUR)) == -1) { close(fd); return (-1); } + charpos--; /* * Go back so we can read the character before the key * to check if the character is escaped (which means we * should continue). */ - error = (int)lseek(fd, -2, SEEK_CUR); - if (error == -3) { + if (lseek(fd, -2, SEEK_CUR) == -1) { close(fd); return (-1); } @@ -291,8 +289,7 @@ parse_config(struct figpar_config options[], const char *path, */ for (n = 1; *p == '\\'; n++) { /* Move back another offset to read */ - error = (int)lseek(fd, -2, SEEK_CUR); - if (error == -3) { + if (lseek(fd, -2, SEEK_CUR) == -1) { close(fd); return (-1); } @@ -300,8 +297,7 @@ parse_config(struct figpar_config options[], const char *path, } /* Move offset back to the key and read it */ - error = (int)lseek(fd, charpos, SEEK_SET); - if (error == (charpos - 1)) { + if (lseek(fd, charpos, SEEK_SET) == -1) { close(fd); return (-1); } @@ -352,8 +348,7 @@ parse_config(struct figpar_config options[], const char *path, } /* Get the current offset */ - charpos = lseek(fd, 0, SEEK_CUR) - 1; - if (charpos == -1) { + if ((charpos = lseek(fd, 0, SEEK_CUR)) == -1) { close(fd); return (-1); } @@ -364,8 +359,7 @@ parse_config(struct figpar_config options[], const char *path, n--; /* Move offset back to the beginning of the value */ - error = (int)lseek(fd, curpos, SEEK_SET); - if (error == (curpos - 1)) { + if (lseek(fd, curpos, SEEK_SET) == -1) { close(fd); return (-1); } From nobody Sat Sep 21 11:26:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5D5zyDz5VqV3; Sat, 21 Sep 2024 11:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n5D4yGZz4nsV; Sat, 21 Sep 2024 11:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqFd2tfMzb+D4sCneG2+zST6qUGCb3LlSPmclK4NgEc=; b=oXBY0a4YuOKYbML51CVn0mLIND1qgwz5K/L//vUSZPhOVVeuwsb+rDrkwyD/YPUQZK/ISi 9zFGPK++NZJH0yhMyNIPvnQ1PW/zkji45831V4x0Vvbi2PWXV9Ud7IP8R0YrqStn/O/d4v cVKj8fGlpIkfhkyyGWage+v9q1DCzeJpLCeBbL929Zdn1iwMUyjIdq3ViPnw9NTqF0pFX7 +mPN8DkdDULEq0qrzITNkbzTcDOpYFQQ3puYFTrqGrjN7SVEA3o14ulZ/1MN04unsoDnL3 HB9K58uAUbxfbrg88jwCDCLrnNC2IcIOAEXl3A/Eo++sK02N2owR5cjwiDAbHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917984; a=rsa-sha256; cv=none; b=RG2tB310XXB2Chr2zN8v9GZG9oJjDb2ZgaWHBS6hIaL2pUZ1Mf5inm6G6Ad0lfBilxeZ/T f6Ie32vm0rUCnSnQysX1lB+m3McqdYVSnNezdrQ+XXaZc9eQJGoJ1Ot8R6PX138fJ9zC/M HCj3xkoatY0mm+MTEFYfzjupzMrt5cp25WnkJibCDojx0vdSFy63taEu9rJOTh0uJtYuuq rVJbUoGUkHqORi9rBUYW4bITmBzSiVx5nUu5rC/ZBmTTwWoy0/ykWYpHpn1DJ549z6owKT LvxKPzm7QTgSFCWvDD9f1yCIbrBlduBVP18VZRfB1x+ghUKEJ1nuQYss9R7GEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqFd2tfMzb+D4sCneG2+zST6qUGCb3LlSPmclK4NgEc=; b=Ax8di5FuJkK9/8+pc7fQ+mtAka9NYxzcvcDY8oNd+CMdSsX7zPcCFHkiG3ZmdlNpjmskei VGNf00HMMQxvNXbWjWWKQi06U+gv7uuaD2h/axofff08NzOxDGw7lqSjY791/6blasj+dg vu/qhdEU+5D3xm4gSMQlInaQFXSSgn6J+72h+bxgBLAcvpwYCG9KjWj0rp3dzJMmtdblEC NMJ+YYY2QFWThzZ5aZ6hmOiEsADnYUKtwtfM7B7HxuZaCDfyXAuReewB5TUrUR1GbcSLL0 zV0tN/sOBNfxKtHiaAVVlazVcyrFMQZYM70ADrgX9enR1tMZoVQ/+JlY0j4Qyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5D464bzX7C; Sat, 21 Sep 2024 11:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQO4A040331; Sat, 21 Sep 2024 11:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQOwm040328; Sat, 21 Sep 2024 11:26:24 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:24 GMT Message-Id: <202409211126.48LBQOwm040328@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: c10511375252 - main - loader: actually change the staging slop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c10511375252e53d6c9fe47f97e254f1380a89c5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c10511375252e53d6c9fe47f97e254f1380a89c5 commit c10511375252e53d6c9fe47f97e254f1380a89c5 Author: Ahmad Khalifa AuthorDate: 2024-08-12 09:57:38 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:15 +0000 loader: actually change the staging slop Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1381 --- stand/efi/loader/copy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index d34acea4e876..e5c950d75f37 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -268,7 +268,9 @@ command_staging_slop(int argc, char *argv[]) res = CMD_ERROR; } if (res == CMD_OK && staging_slop != new) { + staging_slop = new; printf("changed slop, unloading kernel\n"); + unload(); efi_copy_free(); efi_copy_init(); From nobody Sat Sep 21 11:26:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5G0dX2z5VqV5; Sat, 21 Sep 2024 11:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9n5F5gpbz4p84; Sat, 21 Sep 2024 11:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIy+IjnwA7IKFAwC+zE6ksjtGQAcjGZkChklv1H7AXM=; b=JyQKzeGgP8s2vvMHbwj0eDyO2u/uu5M7ouVsnokVuXUZ8m+WAmjA4MX8kNcu7qhNCl0tft 3nFFm4HkbjNCD2nIwh6we1wBcczw83SiwZql/K2sqp1OxpVI7iXeg7dLq9QlgN0ynyGb0w AmBMIw6Pn8pMfdXXeSE2vdE5U6ZYp4cKFxAZqiNgSHbvKDt6rY+Xp6tCmH4r84o+RkWMTc GcvAZm2RVKJF02hJ+cMv7Bbjz79z7GxjS5BedmHgY/eew5PFktqf0z54hqqxBVKjqbjtgg RhC7K1yTrZgI25ZAjfq26XLYgoy6ITltqXf5Gh1y/Bcw9/dbvkwK54Emf6eNkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917985; a=rsa-sha256; cv=none; b=yNeN2CylChfBaqX57sIGzwTiRz/PlYzkMq9vfdS3civ85o2lAia01HIjrrmlE9uviSAG6q FyUIOjaWrP6Winw/ixZ3zAFE4LhD2SliP7xlEy8vo3RLs+LY2hv9YannQOBDKp/OXcL1fG YW1uTcj7VJtPT6VKln+tmWD6vXldI8mKVTtpeZMlsCVKXlWUOWr7eOU+mUYe22iRkIJb3E hwMWWCRyGIotp6U16xi+AAM3aHM+z138vCX7gmkuKIcYyLgxNvnGaIIn+u+Pnkeu4zKHSa wzfY3NjqLP7tl9wp1tC5nk5gpDvnXzwAp6VEdmAWHCwB+Jdu5EWaPc7p4vz99g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIy+IjnwA7IKFAwC+zE6ksjtGQAcjGZkChklv1H7AXM=; b=klBgIg4ev74jM2WyoD53FSNR28EkFGSQ6k3QAJgmR3c9Xc8F72NJckPVO7hz3PggTESJYW Kj4+/ebgpVaNMmG5Q2cSkUOIS+MT+SmMV5vg2zxrfFkIz17WZp4DiR/99Z6UjZjF8CfCKA 2Bv/spdQwqWQ3L1JegdzjeQLpu6jLAeFnbz1j7zYeJCfg0ucMTARKfAtGct3KmkXFtwKDy wBbNskRlf4o9+kCZBCgbJ/kWj4Yk1YMHC59y8Uv9CurkRW8PActAAF89/ll7vmFwcCf9/U RGu9obp9XqK+5Ufe0DRi88WD8VD81fjPOJOc1uk5lNejltpdb5odizDR779QAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5F54p9zX29; Sat, 21 Sep 2024 11:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQPkk040370; Sat, 21 Sep 2024 11:26:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQP4m040367; Sat, 21 Sep 2024 11:26:25 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:25 GMT Message-Id: <202409211126.48LBQP4m040367@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: a698c15a41af - main - loader: remove unneeded variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a698c15a41afca19f87e11d4f8ce5664f992673b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a698c15a41afca19f87e11d4f8ce5664f992673b commit a698c15a41afca19f87e11d4f8ce5664f992673b Author: Ahmad Khalifa AuthorDate: 2024-08-12 10:01:07 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:16 +0000 loader: remove unneeded variable Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1381 --- stand/efi/loader/copy.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index e5c950d75f37..3e466e875af8 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -220,11 +220,10 @@ command_copy_staging(int argc, char *argv[]) [COPY_STAGING_DISABLE] = "disable", [COPY_STAGING_AUTO] = "auto", }; - int prev, res; + int prev; - res = CMD_OK; if (argc > 2) { - res = CMD_ERROR; + return (CMD_ERROR); } else if (argc == 2) { prev = copy_staging; if (strcmp(argv[1], "enable") == 0) @@ -235,9 +234,9 @@ command_copy_staging(int argc, char *argv[]) copy_staging = COPY_STAGING_AUTO; else { printf("usage: copy_staging enable|disable|auto\n"); - res = CMD_ERROR; + return (CMD_ERROR); } - if (res == CMD_OK && prev != copy_staging) { + if (prev != copy_staging) { printf("changed copy_staging, unloading kernel\n"); unload(); efi_copy_free(); @@ -246,7 +245,7 @@ command_copy_staging(int argc, char *argv[]) } else { printf("copy staging: %s\n", mode[copy_staging]); } - return (res); + return (CMD_OK); } COMMAND_SET(copy_staging, "copy_staging", "copy staging", command_copy_staging); #endif @@ -256,18 +255,16 @@ command_staging_slop(int argc, char *argv[]) { char *endp; u_long new, prev; - int res; - res = CMD_OK; if (argc > 2) { - res = CMD_ERROR; + return (CMD_ERROR); } else if (argc == 2) { new = strtoul(argv[1], &endp, 0); if (*endp != '\0') { printf("invalid slop value\n"); - res = CMD_ERROR; + return (CMD_ERROR); } - if (res == CMD_OK && staging_slop != new) { + if (staging_slop != new) { staging_slop = new; printf("changed slop, unloading kernel\n"); @@ -278,7 +275,7 @@ command_staging_slop(int argc, char *argv[]) } else { printf("staging slop %#lx\n", staging_slop); } - return (res); + return (CMD_OK); } COMMAND_SET(staging_slop, "staging_slop", "set staging slop", command_staging_slop); From nobody Sat Sep 21 11:26:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5H1B0hz5VqRh; Sat, 21 Sep 2024 11:26: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 4X9n5G6tTmz4p5p; Sat, 21 Sep 2024 11:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvAnHIu15O9F6sw8+KAlXY1vJttEgLKvkJw+7W4V54s=; b=Twg/mOrTOIpvcFJs02d+azgzzzKUSuvj54zWuUVToJiuhun89qX9mEaYh3mP3nBhGU/wjf 3kvGu7a9yts8rNvXzoaDiQwg0Fwxid8Kv/dhBYe1swwlM01wYEX/N/V+LmqtwgiI3CPlda itVjFVVvg0wDasu9GwmXJIxjLfT765psUdt/VBzvPhsU+ruf6zYxd/bmUOB9gyhCTqGLw9 ZWqxbIwF/LPUT5kxIMz6jJD+uOpDAIxvS61bw+NaZZ2Z1f1YMsQzNuVJYooKyJzXOxx6Rb ORSXS5ElH9lGXmTjStJai8lo29CORUAfj/wGhXn8z+sI8eU1FMaqKVsZMWpziw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917987; a=rsa-sha256; cv=none; b=sCsZL6kYtgHdl+q/D6wRowBg6/uerdQ3uBD2u6D7NtIerBID4LemdeT9kO6ri7ifyuoQ9y fcoaAf7AD8Y3Lera9tPU5Np6+TJAv80pnG5zikSzMkt9g556wC+qr75BCsbO3M0yxnHSaz dQ3vEkUxCxnlXbNenQbL9peXyqcQCBgslAFyGCFKyvLlic8gevHKI0YC2Pmpjo1GD54XwK 2xGUWlvvALeHroqdB8n0GWf7/OZYtN0XlcLk8BJrhyDPRj5F1JAGesExUh+MVmFglhaIs7 yR0vgSrl2JM/r5xhbXWiVOF9521lUZyq6Xh+UgL15RrCA4yTn2b/l+jxIxSQVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvAnHIu15O9F6sw8+KAlXY1vJttEgLKvkJw+7W4V54s=; b=XWjv6T9H30hzrf/mQnpvQ+8WnkrvhvZlOLpq+wgbvM6Rwqcd/SoPIdMFSWe7J2ri4T+wvO wkJdmWWSF9TPJPCx8dgye6OkxVQn79sWJ6XnGRumdFpcMTi1pXTmTZBH/JOca2P+lgVmz5 TD+86aKyX0CzKoF80fobGj56PntZmBSOFLeuNCNRPp1E/mJrq0+y//8Th0e8VZ0oN2C4z1 rfGI/B+xFJ/NgoXA2HCtiEyPnWU6Crwz/kUhTLnXjwSR73hmtzWPKFzEgaHWtPDag4moSf 69k35p1F0P0h63xP8ly0KcvEstV/DKlH7MJ4sdgkkEo7PGxReKXQiwR+QR/28Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5G65wxzXfG; Sat, 21 Sep 2024 11:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LBQQQx040430; Sat, 21 Sep 2024 11:26:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQQ4K040427; Sat, 21 Sep 2024 11:26:26 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:26 GMT Message-Id: <202409211126.48LBQQ4K040427@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: 6fdb07d5b7e9 - main - loader: provide error message in command_errmsg instead of printing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fdb07d5b7e9293a6851a23b7ecb26636cf1ec1e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6fdb07d5b7e9293a6851a23b7ecb26636cf1ec1e commit 6fdb07d5b7e9293a6851a23b7ecb26636cf1ec1e Author: Ahmad Khalifa AuthorDate: 2024-08-12 12:11:06 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:16 +0000 loader: provide error message in command_errmsg instead of printing Also provide an error message when argc is too long instead of printing "no error message". Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1381 --- stand/efi/loader/copy.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index 3e466e875af8..90a55089ffc4 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -223,7 +223,7 @@ command_copy_staging(int argc, char *argv[]) int prev; if (argc > 2) { - return (CMD_ERROR); + goto usage; } else if (argc == 2) { prev = copy_staging; if (strcmp(argv[1], "enable") == 0) @@ -232,10 +232,8 @@ command_copy_staging(int argc, char *argv[]) copy_staging = COPY_STAGING_DISABLE; else if (strcmp(argv[1], "auto") == 0) copy_staging = COPY_STAGING_AUTO; - else { - printf("usage: copy_staging enable|disable|auto\n"); - return (CMD_ERROR); - } + else + goto usage; if (prev != copy_staging) { printf("changed copy_staging, unloading kernel\n"); unload(); @@ -246,6 +244,10 @@ command_copy_staging(int argc, char *argv[]) printf("copy staging: %s\n", mode[copy_staging]); } return (CMD_OK); + +usage: + command_errmsg = "usage: copy_staging enable|disable|auto"; + return (CMD_ERROR); } COMMAND_SET(copy_staging, "copy_staging", "copy staging", command_copy_staging); #endif @@ -257,13 +259,11 @@ command_staging_slop(int argc, char *argv[]) u_long new, prev; if (argc > 2) { - return (CMD_ERROR); + goto err; } else if (argc == 2) { new = strtoul(argv[1], &endp, 0); - if (*endp != '\0') { - printf("invalid slop value\n"); - return (CMD_ERROR); - } + if (*endp != '\0') + goto err; if (staging_slop != new) { staging_slop = new; printf("changed slop, unloading kernel\n"); @@ -276,6 +276,10 @@ command_staging_slop(int argc, char *argv[]) printf("staging slop %#lx\n", staging_slop); } return (CMD_OK); + +err: + command_errmsg = "invalid slop value"; + return (CMD_ERROR); } COMMAND_SET(staging_slop, "staging_slop", "set staging slop", command_staging_slop); From nobody Sat Sep 21 11:26:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5J2SQbz5VqRj; Sat, 21 Sep 2024 11:26: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 4X9n5J0WfWz4p8f; Sat, 21 Sep 2024 11:26:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVMcjRKr767CLq3+VJgen0bVrR9uE+E4p2oUaKglMzk=; b=gy1qIVU1MrWgjFcoCGJO4AXtGOJ+GdyRwZ/UKbA+xx2YER+oFZZ6NqnwwZ8o3RMKtnkwaR Um1ObMTrg9C2g16XGuPEqdPjvkvgXKBX9T6PkWN9ZgfMHigF9h1Zm0TfooXARVJr5UmKZ9 rYavmTNuEJqlyd1B6QTn+RN6wdfOhHVffgtYs6iIaD0nK38GpZg6QKHDFXmaQMhyjYR4F3 S8UEQpx+MUOAzizkS2e6l7cWb/hyc6MeSjOUo3UQ/5UhL5PMZ+PqEoyfgsW7Fpi/LkHe2y FiED4dpcui9pT+ql6KZuzGW1MqjYnSSNHAz7uoj8jD+I7FSwVkA084EdTZS/dQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917988; a=rsa-sha256; cv=none; b=XzgOBhUq83rpIfL4YZbsWRdcwunBHLFxEW8t6lZGsvLbZugK6/kx/Jn0yQkD/nv7IyjfwV dNgsvTJ03M2Ig2bLvpBhrjodcSRZWs105R/ckAuC9JVo/wA0nkbEkwosxq8+svX2X+6TYp kmDG44m5I4pjP1IYOdqgPzCylckoWITVV1lWEws3vxM/qxmCw0bSCJWfyBCInWqK9aJbKZ ltnJJDVkEZtb6c7pnj3JOBgiLkL/IYqhPz/1QSMyJIK+ip6CrtEcXaqj8AT2f8Km6u/cNJ xYHdn9Up3cilkEDrqJJr85ehSNNtF0hhv8ThP5yNa6F4X10g/WrAozL++/yMBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVMcjRKr767CLq3+VJgen0bVrR9uE+E4p2oUaKglMzk=; b=PdSN4+ZQtB/bjlapiRfEK+JpOAp9jVPZQyj9ABPGjU20PwsvDmHnBIcEKBUAHaMH1ioGjF srNHT4PKKZVYC6k6fidioNcg+OVkV9noIy/m3HduPMbhOUxWsPy9tQuReOamBD/asYRS1d mJGFEiHGDPodkpeNXPczgU5wBBTSTH+8XOkXlAWbHZCZlRXH1q9UUkMN6yO8ERa/FzJ/y/ HdCS2s9gWgvQgcVLhe2VXWSaE+CcHr/9p4bOEQgDoCJy5Z/w84hW+xtgHpZLL/xfiYHJn/ 2FnWh3QaQ3iExWBMapFIl0G+splC32zDywAaj+NAfmYRhBP7ZmCYN9lbcQUG6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5J00BszXfH; Sat, 21 Sep 2024 11:26: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 48LBQRmJ040480; Sat, 21 Sep 2024 11:26:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQRRo040477; Sat, 21 Sep 2024 11:26:27 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:27 GMT Message-Id: <202409211126.48LBQRRo040477@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: 83e93d53f674 - main - hv_netvsc.4: mlink to hn(4)/if_hn(4) + tag spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83e93d53f67448a7546c32cd44cb145eceb6c8fb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=83e93d53f67448a7546c32cd44cb145eceb6c8fb commit 83e93d53f67448a7546c32cd44cb145eceb6c8fb Author: Alexander Ziaee AuthorDate: 2024-08-11 06:01:40 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:16 +0000 hv_netvsc.4: mlink to hn(4)/if_hn(4) + tag spdx dmesg for this device says: > hn0: on vmbus0 Add links so that `man hn` and `man if_hn` work. MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1377 --- share/man/man4/Makefile | 2 ++ share/man/man4/hv_netvsc.4 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index ad4bc47acfea..d8d90f092083 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -713,6 +713,8 @@ MLINKS+=gpioths.4 dht11.4 MLINKS+=gpioths.4 dht22.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hpet.4 acpi_hpet.4 +MLINKS+=hv_netvsc.4 hn.4 \ + hv_netvsc.4 if_hn.4 MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=${_attimer.4} ${_i8254.4} MLINKS+=ip.4 rawip.4 diff --git a/share/man/man4/hv_netvsc.4 b/share/man/man4/hv_netvsc.4 index 226fa016f695..e5c7004713c5 100644 --- a/share/man/man4/hv_netvsc.4 +++ b/share/man/man4/hv_netvsc.4 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2012 Microsoft Corp. .\" All rights reserved. From nobody Sat Sep 21 11:26:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9n5K3Dm2z5VqPP; Sat, 21 Sep 2024 11:26: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 4X9n5K1cg6z4nqw; Sat, 21 Sep 2024 11:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3V9oreIChUE07ZQQvmFHGbBLX7jAzqhzqloJqmOhOz4=; b=v5I96dAicKePiCECm0b4OKtf6Thea/niahV++Po4MH5L8xU/a2Bmh62Gq9QFXHHhd5ztdR yv9g5rHJ5uCKCfRMLXcR3C/7LQtIPhiIvPjTKkhdHwFCTl9zyeNiYUv/MF3wVUXXwlCKgH NY9pjUkzc9lt6VgaXlhmDRoQi5wpBBvESbzlddyHv+VVpl6ykImkUQWkPsPB5DhXcRV04F n1b55Paos96vQt3yXYEgEkbbo/7AODN62zDY7O2vC8R9OmRPpcIei5/G8Xos6buZyVxnoy ec08P3zwwlxE4+dC6h2LpGsxagbGQdlacKr5RuZYpUEmddU7FHG2h2ip8M3mlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726917989; a=rsa-sha256; cv=none; b=rohQ5+tPXPuh/E0lwye6GZ1LbMrzUEL0WROWBFsOOwVo6c2DNTI6i1Kx/W6eEttb6iDKhg P4b92+3W1bPLbg+AvXTlUDEwGwwicRl69xtrXp9spGxKEyXCUgLu/0FBuRR9YYMwlC9kdS yky5F2bCB3zMydKqG7llxGTfcaVF3nMM1tbLIXfnPGXNIOtr7QnDp5kQkf/FmsQE967vfe 7IX2FR3unOwB8OpQXzcBD9pcuBKwWX2Ryo05qbLSkJmRVNT/oHIATG7qQBimV4FxoCnDcx IXb4gJtzuqokO0280UTAH7Kb9via6ztJGmVzu90yqUNwFd7qkpg4IcLrqypZCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726917989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3V9oreIChUE07ZQQvmFHGbBLX7jAzqhzqloJqmOhOz4=; b=kXu+3fydApuJHKhoEczKPApusvzx+M1nuU7rQXQJfzGylxOyEKehI26wmOUfUdwLmqThej fiNEY3vgXq28cx8tlCmb7p6u2ETbdRq9wSSAxYmF+q6+WLBqL8TgLx268DR7MK67dnVZFK goU9McNU4Ef7Fzrq4Ol1ZZMkQ6E3FUj7KHgTbvMHbKtWEz4s+sW9TR+zPMJ9KkWpAOew2i hqYqKpJk8B9TCgs/fNMWzyeLxv1ozr0mV5H+bpjn8I+gO67sapShwBQ6+MmVs8mC3WrHeS CWzfR8Dee2a1DxbvPhOZv60rhP5Blct72Jhgba+LKJIv04ZfU7J/Gk8PPZgMWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9n5K100JzXLX; Sat, 21 Sep 2024 11:26: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 48LBQTJd040528; Sat, 21 Sep 2024 11:26:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LBQTFt040525; Sat, 21 Sep 2024 11:26:29 GMT (envelope-from git) Date: Sat, 21 Sep 2024 11:26:29 GMT Message-Id: <202409211126.48LBQTFt040525@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: 2a680c5c37ea - main - sysctl.8: mark sysctls as vars per style.mdoc(7) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a680c5c37ea020467fce545734afea019d3a3ea Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2a680c5c37ea020467fce545734afea019d3a3ea commit 2a680c5c37ea020467fce545734afea019d3a3ea Author: Alexander Ziaee AuthorDate: 2024-09-14 18:33:21 +0000 Commit: Warner Losh CommitDate: 2024-09-21 11:25:16 +0000 sysctl.8: mark sysctls as vars per style.mdoc(7) + while here, fix alignment and tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1421 --- sbin/sysctl/sysctl.8 | 154 ++++++++++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 76 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 528efe6697b5..d350b62e67a3 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -50,11 +53,10 @@ privilege to set kernel state. The state to be retrieved or set is described using a .Dq Management Information Base .Pq Dq MIB -style name, described as a dotted set of -components. +style name, described as a dotted set of components. .Pp The following options are available: -.Bl -tag -width indent +.Bl -tag -width "-f filename" .It Fl A Equivalent to .Fl o a @@ -202,77 +204,77 @@ String and integer values can be set using .Nm . .Bl -column security.bsd.unprivileged_read_msgbuf integerxxx .It Sy "Name Type Changeable" -.It "kern.ostype string no" -.It "kern.osrelease string no" -.It "kern.osrevision integer no" -.It "kern.version string no" -.It "kern.maxvnodes integer yes" -.It "kern.maxproc integer no" -.It "kern.maxprocperuid integer yes" -.It "kern.maxfiles integer yes" -.It "kern.maxfilesperproc integer yes" -.It "kern.argmax integer no" -.It "kern.securelevel integer raise only" -.It "kern.hostname string yes" -.It "kern.hostid integer yes" -.It "kern.clockrate struct no" -.It "kern.posix1version integer no" -.It "kern.ngroups integer no" -.It "kern.job_control integer no" -.It "kern.saved_ids integer no" -.It "kern.boottime struct no" -.It "kern.domainname string yes" -.It "kern.filedelay integer yes" -.It "kern.dirdelay integer yes" -.It "kern.metadelay integer yes" -.It "kern.osreldate integer no" -.It "kern.bootfile string yes" -.It "kern.corefile string yes" -.It "kern.logsigexit integer yes" -.It "security.bsd.suser_enabled integer yes" -.It "security.bsd.see_other_uids integer yes" -.It "security.bsd.see_other_gids integer yes" -.It "security.bsd.see_jail_proc integer yes" -.It "security.bsd.unprivileged_proc_debug integer yes" -.It "security.bsd.unprivileged_read_msgbuf integer yes" -.It "vm.loadavg struct no" -.It "hw.machine string no" -.It "hw.model string no" -.It "hw.ncpu integer no" -.It "hw.byteorder integer no" -.It "hw.physmem integer no" -.It "hw.usermem integer no" -.It "hw.pagesize integer no" -.It "hw.floatingpoint integer no" -.It "hw.machine_arch string no" -.It "hw.realmem integer no" -.It "machdep.adjkerntz integer yes" -.It "machdep.disable_rtc_set integer yes" -.It "machdep.guessed_bootdev string no" -.It "user.cs_path string no" -.It "user.bc_base_max integer no" -.It "user.bc_dim_max integer no" -.It "user.bc_scale_max integer no" -.It "user.bc_string_max integer no" -.It "user.coll_weights_max integer no" -.It "user.expr_nest_max integer no" -.It "user.line_max integer no" -.It "user.re_dup_max integer no" -.It "user.posix2_version integer no" -.It "user.posix2_c_bind integer no" -.It "user.posix2_c_dev integer no" -.It "user.posix2_char_term integer no" -.It "user.posix2_fort_dev integer no" -.It "user.posix2_fort_run integer no" -.It "user.posix2_localedef integer no" -.It "user.posix2_sw_dev integer no" -.It "user.posix2_upe integer no" -.It "user.stream_max integer no" -.It "user.tzname_max integer no" -.It "user.localbase string no" +.It Va "kern.ostype string no" +.It Va "kern.osrelease string no" +.It Va "kern.osrevision integer no" +.It Va "kern.version string no" +.It Va "kern.maxvnodes integer yes" +.It Va "kern.maxproc integer no" +.It Va "kern.maxprocperuid integer yes" +.It Va "kern.maxfiles integer yes" +.It Va "kern.maxfilesperproc integer yes" +.It Va "kern.argmax integer no" +.It Va "kern.securelevel integer raise only" +.It Va "kern.hostname string yes" +.It Va "kern.hostid integer yes" +.It Va "kern.clockrate struct no" +.It Va "kern.posix1version integer no" +.It Va "kern.ngroups integer no" +.It Va "kern.job_control integer no" +.It Va "kern.saved_ids integer no" +.It Va "kern.boottime struct no" +.It Va "kern.domainname string yes" +.It Va "kern.filedelay integer yes" +.It Va "kern.dirdelay integer yes" +.It Va "kern.metadelay integer yes" +.It Va "kern.osreldate integer no" +.It Va "kern.bootfile string yes" +.It Va "kern.corefile string yes" +.It Va "kern.logsigexit integer yes" +.It Va "security.bsd.suser_enabled integer yes" +.It Va "security.bsd.see_other_uids integer yes" +.It Va "security.bsd.see_other_gids integer yes" +.It Va "security.bsd.see_jail_proc integer yes" +.It Va "security.bsd.unprivileged_proc_debug integer yes" +.It Va "security.bsd.unprivileged_read_msgbuf integer yes" +.It Va "vm.loadavg struct no" +.It Va "hw.machine string no" +.It Va "hw.model string no" +.It Va "hw.ncpu integer no" +.It Va "hw.byteorder integer no" +.It Va "hw.physmem integer no" +.It Va "hw.usermem integer no" +.It Va "hw.pagesize integer no" +.It Va "hw.floatingpoint integer no" +.It Va "hw.machine_arch string no" +.It Va "hw.realmem integer no" +.It Va "machdep.adjkerntz integer yes" +.It Va "machdep.disable_rtc_set integer yes" +.It Va "machdep.guessed_bootdev string no" +.It Va "user.cs_path string no" +.It Va "user.bc_base_max integer no" +.It Va "user.bc_dim_max integer no" +.It Va "user.bc_scale_max integer no" +.It Va "user.bc_string_max integer no" +.It Va "user.coll_weights_max integer no" +.It Va "user.expr_nest_max integer no" +.It Va "user.line_max integer no" +.It Va "user.re_dup_max integer no" +.It Va "user.posix2_version integer no" +.It Va "user.posix2_c_bind integer no" +.It Va "user.posix2_c_dev integer no" +.It Va "user.posix2_char_term integer no" +.It Va "user.posix2_fort_dev integer no" +.It Va "user.posix2_fort_run integer no" +.It Va "user.posix2_localedef integer no" +.It Va "user.posix2_sw_dev integer no" +.It Va "user.posix2_upe integer no" +.It Va "user.stream_max integer no" +.It Va "user.tzname_max integer no" +.It Va "user.localbase string no" .El .Sh FILES -.Bl -tag -width ".In netinet/icmp_var.h" -compact +.Bl -tag -width "" -compact .It In sys/sysctl.h definitions for top level identifiers, second level kernel and hardware identifiers, and user level identifiers @@ -296,20 +298,20 @@ definitions for fourth level UDP identifiers For example, to retrieve the maximum number of processes allowed in the system, one would use the following request: .Pp -.Dl "sysctl kern.maxproc" +.Dl Va "sysctl kern.maxproc" .Pp To set the maximum number of processes allowed per uid to 1000, one would use the following request: .Pp -.Dl "sysctl kern.maxprocperuid=1000" +.Dl Va "sysctl kern.maxprocperuid=1000" .Pp Information about the system clock rate may be obtained with: .Pp -.Dl "sysctl kern.clockrate" +.Dl Va "sysctl kern.clockrate" .Pp Information about the load average history may be obtained with: .Pp -.Dl "sysctl vm.loadavg" +.Dl Va "sysctl vm.loadavg" .Pp More variables than these exist, and the best and likely only place to search for their deeper meaning is undoubtedly the source where From nobody Sat Sep 21 12:49:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9pxq124Tz5WJ9w; Sat, 21 Sep 2024 12:50:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9pxp4Tlxz421w; Sat, 21 Sep 2024 12:50:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 48LCnrrq085229; Sat, 21 Sep 2024 15:49:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 48LCnrrq085229 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 48LCnrLC085228; Sat, 21 Sep 2024 15:49:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Sep 2024 15:49:53 +0300 From: Konstantin Belousov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a52b30ff98cd - main - sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf Message-ID: References: <202409202109.48KL9RZ1078677@gitrepo.freebsd.org> <867cb5z2c3.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <867cb5z2c3.fsf@ltc.des.dev> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4X9pxp4Tlxz421w X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, Sep 21, 2024 at 01:13:48PM +0200, Dag-Erling Smørgrav wrote: > Konstantin Belousov writes: > > commit a52b30ff98cdab82af140285fa7fcdf1036fef27 > > Author: Konstantin Belousov > > AuthorDate: 2024-09-20 18:48:19 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-09-20 21:08:51 +0000 > > > > sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf > > > > Tested by: yasu > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > --- > > sys/kern/sys_pipe.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > index 2b81d08f7077..6a5d150423bc 100644 > > --- a/sys/kern/sys_pipe.c > > +++ b/sys/kern/sys_pipe.c > > @@ -1677,7 +1677,7 @@ pipe_free_kmem(struct pipe *cpipe) > > > > if (cpipe->pipe_buffer.buffer != NULL) { > > atomic_subtract_long(&amountpipekva, cpipe->pipe_buffer.size); > > - chgpipecnt(cpipe->pipe_pair->pp_owner->cr_uidinfo, > > + chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, > > -cpipe->pipe_buffer.size, 0); > > vm_map_remove(pipe_map, > > (vm_offset_t)cpipe->pipe_buffer.buffer, > > This appears to be the opposite of the patch which you posted on > -current and which yasu@ tested (minus the bit that you committed as > af96ccc6a508). That patch replaced cr_ruidinfo with cr_uidinfo in three > places; this patch replaces cr_uidinfo with cr_ruidinfo somewhere else. After I realized the cause, I did the initial version of the patch ASAP, to be able to get the feedback immediately. Before committing anything, I did a self-review and remembered that I have did a lot of considerations when implementing swap accounting and decided that ruid is the right target for charge. Besides stating the obvious fact above, what do you expect me to answer/ react to your mail? From nobody Sat Sep 21 13:00:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9q9L4rlVz5WM5w; Sat, 21 Sep 2024 13:00: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 4X9q9L4BRDz43X5; Sat, 21 Sep 2024 13:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LkAEO51I5uVw/cKJsfPDXOb91TLVbyzps5Ku5VxTRqA=; b=ChoEhUmwn3LghF1EH6YgILGQQVWoxtEeV2UN5osnL9UC21ytfZYQ68ZOrepR9LRsWmckOQ HQff7I5V5fTnhQ9TaGuBAWo74DpxHe9HMghh1YI2BaLhdaHJF1XVdOoz05eBqGNMfXk3Aa fgwz648wZ9PzMl+iiVqvUVDr9zPBbq/YoFX+jTbBAXEJRJyf41XWxFDjC81Cy8NKrg5fie A6e4KtpPOzG28ZjJWmhyqhjNY+FAY84dfa/FooRQ+TWryyyYsC8npIgM+oFo0l733g8aRD v8vdpUOOaVoa/StgUDvINniUvI0n/keJ6U6qVBsPBBfIn//TBsE/E4qaCc4KIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726923606; a=rsa-sha256; cv=none; b=euHMQKsBHE6Fpfoz3I0vLAn0Bl2IHEU1+0OvogNMYogipdRQXvg2WcrSPpV4a9g6TWBh5I SBebh4c0r1JG9QtMD6jO56ZYD9+JngLrJcROwX7T5sdJwE6bA2g9WLjFm0c8EGapebxJ4W +Uv4dBkVehYqku86KMIBYZc0WSV4b1U2+vyub1BCUhcqUknFoaUXHgtK//Ch72uYm+2S/b UZINm/at7jSX2MhqhgZn2u3mKGld3fNt1CCRvnlFXZWmjdl3cin8aquWolzEjLAXAvI7kj +1k0nNIe0iV599/cwr6L5Hq2YITn+J8n2mdSo3AzWdaDVbo+A/GJBsdIbWGBwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LkAEO51I5uVw/cKJsfPDXOb91TLVbyzps5Ku5VxTRqA=; b=fnVsfuEFgE8NW/3ufNJl7ZTkE8rE8Kpv9ZjCoYQuZhBgTRgatzc4FBB9MBh8eb6m+VwTdW 7qfOOhe513EPU07ltAcbFq0a936YJx1s1dQCrUAA1Now9QSMt1IicNVthjefDIRzZxiyIT tiMkSdsqqDB8CWfnoIQ+Jn7xkd/NwY112+wUlOyKf5mENCT+YtePv+WKJ879ODd4H4uimF Px/l/uBf6cvTtGe1imKbhenehsTwQcKS2n+2tT2T+veWi2JL2cXEbb5byvb5PD9usmWiYV F6pe4J0/LehqARk8Z4jma4tZBcDypacKsQRTlEl757EtEKI3aBafxshYKsYuBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9q9L3nyHzYx2; Sat, 21 Sep 2024 13:00: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 48LD06Pu097042; Sat, 21 Sep 2024 13:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LD06ch097038; Sat, 21 Sep 2024 13:00:06 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:00:06 GMT Message-Id: <202409211300.48LD06ch097038@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: 944c74b7d93c - main - jail.conf.5: minor cleanup (spdx, macros, xrefs) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 944c74b7d93c60709b966a5a522110e4fe1038b2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=944c74b7d93c60709b966a5a522110e4fe1038b2 commit 944c74b7d93c60709b966a5a522110e4fe1038b2 Author: Alexander Ziaee AuthorDate: 2024-08-07 19:14:38 +0000 Commit: Warner Losh CommitDate: 2024-09-21 12:41:50 +0000 jail.conf.5: minor cleanup (spdx, macros, xrefs) + expand see also section with other relevant pages and the handbook + tag paths with the path macro so they can be searched with apropos + tag spdx, one sentance per line MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1371 --- usr.sbin/jail/jail.conf.5 | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/usr.sbin/jail/jail.conf.5 b/usr.sbin/jail/jail.conf.5 index 0b82a972020c..dda2c0366dd1 100644 --- a/usr.sbin/jail/jail.conf.5 +++ b/usr.sbin/jail/jail.conf.5 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2012 James Gritton .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2023 +.Dd September 21, 2024 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -169,17 +172,17 @@ A line of the form .Pp will include another file (or files) in the configuration. The filename should be either absolute, or relative to the -configuration file's directory. It cannot contain variable -expansions, but may contain +configuration file's directory. +It cannot contain variable expansions, but may contain .Xr glob 3 patterns. .Pp The included file must exist, though a filename glob may match zero or -more files. This allows inclusion of any/all files in a directory, -such as -.Dq /etc/jail.conf.d/*.conf , +more files. +This allows inclusion of any/all files in a directory, such as +.Dq Pa /etc/jail.conf.d/*.conf , or conditional inclusion of a single file, such as -.Dq jail.foo[.]conf . +.Dq Pa jail.foo[.]conf . .Ss Comments The configuration file may contain comments in the common C, C++, and shell formats: @@ -238,10 +241,19 @@ bar { \[char46]include "/usr/local/etc/jail.*.conf"; .Ed .Sh SEE ALSO -.Xr jail_set 2 , +.Xr jail 2 , +.Xr jail 3 , +.Xr jail 3lua , .Xr rc.conf 5 , .Xr jail 8 , -.Xr jls 8 +.Xr jexec 8 , +.Xr jls 8 , +.Xr zfs-jail 8 +.Pp +The +.Dq Jails and Containers +chapter of the +.%B FreeBSD Handbook . .Sh HISTORY The .Xr jail 8 From nobody Sat Sep 21 13:00:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9q9N1Bf4z5WMC4; Sat, 21 Sep 2024 13:00: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 4X9q9M6BhKz43TW; Sat, 21 Sep 2024 13:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7/1oopj4576QbsYU3OwOkjn2wH9DW0cmuzU+y3kFBo=; b=cwM8HBfyer16ZEyg6cDPcKSF4JJlw/At5sT9nc/s3ETdzTHz04b0ENI1EeakLXsCxLRaBO hmTtChXyAe+VNPnR+Noc7wO31HFQz6WfD+ldHbtad7256rw5vCej513puBODD1ZJStD6ym j4/wbDrEzO/ZDMVHZluhhqFlsCdy5CWrV5X/nIj1JBveRnug2Kj3+AimcMumTq0loaxuk3 9jJr6sGfn971ZOOei2ob3ysuH1jutmViEF39rfdAvbXpXdSNtC5ZZS8VjnVTTHBH1etn/R kKwftHGmK9F62f1hWtib2IOjY78yJNRu4JsUkKA3cwC25/7V9264U2LdrzXXIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726923607; a=rsa-sha256; cv=none; b=RfQ6cykRy30QGrrTaSWBfOZERa+HvMhuDeFcUsCUXc+tcl/7U43+2/RBtEyxpqloxsTFVe OyNAI+ipr+M26yp2iMntGNRG9i1EoRlhnj+wTFwq9Hp66tvLHGmsPLAj16dvxppZ3ST1DJ cTKoMwFkxxwSOfowQud3+137up0RupEEcGj5d6cT1CRSuDYJJ11GYBhCIYcN4K+6phGrZb RF8UPvLwGK/hOgStNeapBk1RLvGtoe04ryLizBieW+w3WZ5TqUFZ9FBMttMcrx3TQREjUl f315MwgpACcucM2gfzC7hLtvkKvABsZOh4QUVcd5KIvJpxWT66JOiDZEZOtG9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7/1oopj4576QbsYU3OwOkjn2wH9DW0cmuzU+y3kFBo=; b=OKzmN2MU5Ik0WEw4GwQXaaw6AAQ0rnt71Yzg8VvEJruHIB0RmmXNClILu9vWtgXCQ6p0Di p33NNH/jBZFpb8osUbGA1lMaWvmAC7P5TIKxGO+8xJBlwFWe+kX+pLkT7OnzXcLTcoQ0Vo eDO7YpRlikSZQsoTtYnQqtbA9gtdGoIGHpmbLFt0aX3NgwwvagJZYhYW9aMjbF0DVSk3Ko XF88iJdJ20pttkFvnKkyQ9rH8hq9P7GB85q0WNzreWxYq5Y6Zrc9cnU+soJrpT2q4F63qC OnChVJTRojFLXiB0Q5UlpokOJWBcvSu8tVQmY/Dj2UkX6xKpvihhq2A920pLMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9q9M4JYLzZSY; Sat, 21 Sep 2024 13:00: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 48LD07i3097316; Sat, 21 Sep 2024 13:00:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LD07BG097311; Sat, 21 Sep 2024 13:00:07 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:00:07 GMT Message-Id: <202409211300.48LD07BG097311@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: dca2b27e4247 - main - jail.conf.5: Minor igor issues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dca2b27e4247c4dad18a8e82d237e05c8ace7271 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dca2b27e4247c4dad18a8e82d237e05c8ace7271 commit dca2b27e4247c4dad18a8e82d237e05c8ace7271 Author: Warner Losh AuthorDate: 2024-09-21 12:43:34 +0000 Commit: Warner Losh CommitDate: 2024-09-21 12:43:34 +0000 jail.conf.5: Minor igor issues Sponsored by: Netflix --- usr.sbin/jail/jail.conf.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/jail/jail.conf.5 b/usr.sbin/jail/jail.conf.5 index dda2c0366dd1..f2c1861cc304 100644 --- a/usr.sbin/jail/jail.conf.5 +++ b/usr.sbin/jail/jail.conf.5 @@ -98,7 +98,7 @@ parameter is implicitly set to the name in the jail definition. .Ss String format Parameter values, including jail names, can be single tokens or quoted strings. -A token is any sequence of characters that aren't considered special in +A token is any sequence of characters that are not considered special in the syntax of the configuration file (such as a semicolon or whitespace). If a value contains anything more than letters, numbers, dots, dashes @@ -146,7 +146,7 @@ definition. .Pp Variable substitution is done on a per-jail basis, even when that substitution is for a parameter defined in a wildcard section. -This is useful for wildcard parameters based on e.g. a jail's name. +This is useful for wildcard parameters based on e.g., a jail's name. .Pp Later definitions in the configuration file supersede earlier ones, so a wildcard section placed before (above) a jail definition defines @@ -196,7 +196,7 @@ shell formats: # This is a shell style comment. .Ed .Pp -Comments are legal wherever whitespace is allowed, i.e. anywhere except +Comments are legal wherever whitespace is allowed, i.e., anywhere except in the middle of a string or a token. .Sh FILES .Bl -tag -width "indent" -compact From nobody Sat Sep 21 13:00:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9q9N75Vxz5WLwS; Sat, 21 Sep 2024 13:00: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 4X9q9N5F0Hz43j2; Sat, 21 Sep 2024 13:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vA4ZkKs776J75Gtqk14a6jcV7esyGRPSepoUkZrA2M0=; b=bEwFNJ4nZJloDICfypg2U+4JSgCp7jall63ZcR6QCY1jAPCLCQXPM888/hPUwbK9HQbQxS +xnzg/LcZ1NNgDvujB6kaNAkqn55zakPlpc26LxzXmAYgr2DogQSuJsziJ7Fwqy+jdJ7wo lhDPlyj2iB60PW81vmllstIJGhwIb9CWUBQh1OYxdEzecFnp9YuSVRfGB0R/t7yCxA53lC uXpVBR+p//8xsfrbY2A8PNgPyZZDm9VpD2E8H1LV5OhYd2q6BCPL5wFNRIQjK16OGKb47W 71TLj40m/gM+BwRNodKA21unsJRBFhTVJ4wsWHH+g3wngqml5RlNVWcwM5LWNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726923608; a=rsa-sha256; cv=none; b=V19T989dn7hqU0Qyat9cILf7SMIATnBkvsBGtlhVT9PA1Vb6q/iYEGYROsfITwyvNHakme Qij2WWhpwvFtd0dsqv89YPIohxkVpLlxzG1se3XvOIQsaeGMzZHiVBS1KKMCB2oSA9DgLo w6zJYTVZ0OPXllx4UMr4kJK+rwhzyemTyCj1h/t/xZt5DnBSUmLdX6tyEMhcYSgxZ/7V6v uCTlssjprQaFC8N3HSJJVDMtZIuYVamC9rKGtLwc21sxTYT/rWuCo+St6LmDR1YAPMcnsx hLmaZdGwU4/Lp/HXJdfuyPnf1t3LwEBDBoADSvURniGFzAQNLx+zXJpFYFqdZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vA4ZkKs776J75Gtqk14a6jcV7esyGRPSepoUkZrA2M0=; b=SkhqY4k2DLFYSh7FL1v/8Oyb3l/If/HMIroK/D/BPev9RBfgyDkJ24kbdntJhqnqKQ+VDN ibQogsYQUVyYOwX40vcdFl08BCdB25YvPCTw0UgUWED2xCI+yxXBYBmXKT5OfEHtAYquLw 8vRp9wGp/D/9LuQ+6XaaYUVMWyZtBZgxSFPte2nEd1vvqV4Z8KTgPCXlQ+Hy5/e+9MatxZ WdWathpHn2MlIutgeDdvx9V/Z09rL81RnwdzRRKspelF7l9h8p91WAfJcnS9vcI5SnzBOI 35iLhjwPfgDFr4FqLDMlWZ4K5qJlvqM5jei/weMVkfwHAQ9VKvnSwEHuzE+Umg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9q9N4sF7zZqy; Sat, 21 Sep 2024 13:00: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 48LD08Uu097598; Sat, 21 Sep 2024 13:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LD08pV097595; Sat, 21 Sep 2024 13:00:08 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:00:08 GMT Message-Id: <202409211300.48LD08pV097595@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: b15aff050530 - main - mitigations.7: explain installing firmware + spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b15aff050530a791262e166ee0c8fed3a118e7d6 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b15aff050530a791262e166ee0c8fed3a118e7d6 commit b15aff050530a791262e166ee0c8fed3a118e7d6 Author: Alexander Ziaee AuthorDate: 2024-09-15 01:23:52 +0000 Commit: Warner Losh CommitDate: 2024-09-21 12:56:03 +0000 mitigations.7: explain installing firmware + spdx MFC after: 3 days Reported by: imp (ucode is for security) Reported by: emaste (ucode is not minix) Reported by: delphij (please ucode asap) Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1411 --- share/man/man7/mitigations.7 | 48 +++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index 75decbe2d026..fceaa21a67ea 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifer: BSD-2-Clause +.\" .\" Copyright © 2023 The FreeBSD Foundation .\" .\" This documentation was written by Ed Maste , and @@ -41,6 +44,7 @@ or per-process basis, some are optionally enabled or disabled at compile time, and some are inherent to the implementation and have no controls. .Pp The following vulnerability mitigations are covered in this document: +.Pp .Bl -bullet -compact .It Address Space Layout Randomization (ASLR) @@ -59,9 +63,11 @@ Stack Overflow Protection .It Supervisor Mode Memory Protection .It -Hardware Vulnerability Mitigation Controls -.It Capsicum +.It +Firmware and Microcode +.It +Architectural Vulnerability Mitigations .El .Pp Please note that the effectiveness and availability of these mitigations may @@ -332,18 +338,14 @@ kernel. .Pp These features are automatically used by the kernel. There is no user-facing configuration. -.Ss Hardware vulnerability controls -See -.Xr security 7 -for more information. .\" .Ss Capsicum Capsicum is a lightweight OS capability and sandbox framework. See .Xr capsicum 4 for more information. -.Pp .Sh HARDWARE VULNERABILITY MITIGATIONS +.Ss Firmware and Microcode Recent years have seen an unending stream of new hardware vulnerabilities, notably CPU ones generally caused by detectable microarchitectural side-effects of speculative execution which leak private data from some other thread or @@ -351,18 +353,36 @@ process or sometimes even internal CPU state that is normally inaccessible. Hardware vendors usually address these vulnerabilities as they are discovered by releasing microcode updates, which may then be bundled into platform firmware updates -.Pq historically called BIOS updates for PCs . +.Pq historically called BIOS updates for PCs +or packages to be updated by the operating system at boot time. +.Pp +Platform firmware updates, if available from the manufacturer, +are the best defense as they provide coverage during early boot. +Install them with +.Pa sysutils/flashrom +from the +.Fx +Ports Collection. +.Pp +If platform firmware updates are no longer available, +packaged microcode is available for installation at +.Pa sysutils/cpu-microcode +and can be loaded at runtime using +.Xr loader.conf 5 , +see the package message for more details. .Pp The best defense overall against hardware vulnerabilities is to timely apply -these updates when available and to disable the affected hardware's problematic -functionalities when possible (e.g., CPU Simultaneous Multi-Threading). +these updates when available, as early as possible in the boot process, +and to disable the affected hardware's problematic functionalities when possible +(e.g., CPU Simultaneous Multi-Threading). Software mitigations are only partial substitutes for these, but they can be helpful on out-of-support hardware or as complements for just-discovered vulnerabilities not yet addressed by vendors. Some software mitigations depend on hardware capabilities provided by a microcode update. -.Pp -FreeBSD's usual policy is to apply by default all OS-level mitigations that do +.Ss Architectural Vulnerability Mitigations +.Fx Ap s +usual policy is to apply by default all OS-level mitigations that do not require recompilation, except those the particular hardware it is running on is known not to be vulnerable to .Pq which sometimes requires firmware updates , @@ -451,6 +471,10 @@ should be considered when configuring and deploying them in a .Fx system. .Pp +Additional mitigation knobs are listed in the +.Sx KNOBS AND TWEAKS +section of +.Xr security 7 . .Sh SEE ALSO .Xr elfctl 1 , .Xr proccontrol 1 , From nobody Sat Sep 21 13:04:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9qG61RJJz5WMY4; Sat, 21 Sep 2024 13:04: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 4X9qG60v5cz44mr; Sat, 21 Sep 2024 13:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbzZUiJGjNqBNd4DG6fg/DyKx3qIGh02Xgl86lNagCI=; b=ZtpE/wiCO0JRCM9tX3uqFrI/fw8atIMZOkJ67jdEpQw6+o1hwk/jiZvDTr2fxi/hWgl/7U dCqLa8d5mbXFZbeIlWuM0RSOgzLiBWboTAVIpiDbUC1lljF0rx3g2CeZ4n/L9hX7rTgDN6 AToenigX3796ZlChNTF3GoFYEiFr+9vMC6+H9RweDBYNwlOTSo+1pxTdV9l/o+9exPoCrh 905M8QZhcA6uC5dVGrkKrkP5vn7O2Yqk539SA9+y9rKs8Dv/p6hbBvvDUuAcEqxLfDaK6V s5q/ftTSus8VLhBcUbuvj645Rm4fbNeeBmGLJnib/sUx7jQLsg+q3c5z53EnSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726923854; a=rsa-sha256; cv=none; b=tYRLX1PnUfpc5+oSkkyZcFVUM0p4E3aaDQgkaGuQBJAjfPjhB917VeCGxK1lVbZLEgUtEf jvOsKoKvekNN/WO38r8ryPk5y6+dLa+jKmPYH6keajQFzzwKxETyX2B2c/fzr0vOXtBEVl 8JHwHNmsFzA1SAB5OwaCKdR8rasPGjDJOmjc+Z2Wgpk5piFS8LCp4ApX/IpxKGS0EToW9g JLCD5RwbaD2L378IDMRLnvTd5PWjDI+0iCwTrdWPSHQ+uxML1e09O5tqW0oi6NCp4Eyotr H6sh47WRngzbk6TScYQFEG+go1OTg6HEQ4mzzvL97f5Dxbe/gQezRdw1eDj0BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbzZUiJGjNqBNd4DG6fg/DyKx3qIGh02Xgl86lNagCI=; b=eLduUxBigZcsRXcuQBNzwahlDir9JRRqSj0cJONlMFeri4orjn4pzahsnyqHXtF2A1dMbQ 5/SZnvOe0++EHxn70swY5sqp2aVbYJPSgQEzEJFKT+Sxcs5ZcHQHoe+547rGMS6UoBtZIo nXRqfNfiB4oKWQ5feLxYA5X9MBSm2kWakOZWhMLaO/29IrroKH73i4A3/suW3GjB9Tl6cd rhyY9mgEyBtDk4srwDR6bhybUGHWPkmEvrzi9jbEdqFdco34Jh6ZRKxeQvYPWNm4RU6e08 z/lnxe09NNKjFZtg9fUjVc2kRtjVQ+/bBAJmryicbz1O9KHHVIiLZrXOX5ml2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9qG60Mq5zZmv; Sat, 21 Sep 2024 13:04: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 48LD4D25010248; Sat, 21 Sep 2024 13:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LD4Dht010245; Sat, 21 Sep 2024 13:04:13 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:04:13 GMT Message-Id: <202409211304.48LD4Dht010245@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: e36af20691d8 - main - jail.conf.5: cleanup introduction List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e36af20691d8922ecf416170a56d06aca62a0ccd Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e36af20691d8922ecf416170a56d06aca62a0ccd commit e36af20691d8922ecf416170a56d06aca62a0ccd Author: Ingo Schwarze AuthorDate: 2024-09-14 01:12:18 +0000 Commit: Warner Losh CommitDate: 2024-09-21 13:03:21 +0000 jail.conf.5: cleanup introduction Suggested by ingo on mandoc-tech@ MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1422 --- usr.sbin/jail/jail.conf.5 | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/usr.sbin/jail/jail.conf.5 b/usr.sbin/jail/jail.conf.5 index f2c1861cc304..627c38b0f8b6 100644 --- a/usr.sbin/jail/jail.conf.5 +++ b/usr.sbin/jail/jail.conf.5 @@ -30,29 +30,29 @@ .Os .Sh NAME .Nm jail.conf -.Nd configuration file for -.Xr jail 8 +.Nd configuration file for system jails .Sh DESCRIPTION -A +The +.Nm +file consists of one or more jail definitions statements for use by the .Xr jail 8 -configuration file consists of one or more jail definitions statements, -and parameter or variable statements within those jail definitions. -A jail definition statement looks something like a C compound statement. -A parameter statement looks like a C assignment, -including a terminating semicolon. +management program. +A jail definition statement consists of a single word, the name of the jail, +an opening curly brace, a list of at least two parameter assignments, +and a closing curly brace. +A parameter assignment consists of a single word, the parameter name, +an equals sign, a value enclosed in double quotes, and a terminating semicolon. .Pp -The general syntax of a jail definition is: -.Bd -literal -offset indent -jailname { - parameter = "value"; - parameter = "value"; - ... -} +The syntax of a jail definition is as follows: +.Bd -unfilled +. Ar jailname Cm \&{ +.Bd -unfilled -offset indent -compact +.Ar parameter Cm = Qq Ar value ; +\&... +.Ed +.Cm \&} .Ed .Pp -Each jail is required to have a -.Va name -at the front of its definition. This is used by .Xr jail 8 to specify a jail on the command line and report the jail status, From nobody Sat Sep 21 13:05:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9qJ048gjz5WNQX; Sat, 21 Sep 2024 13:05: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 4X9qJ03nCJz45Zf; Sat, 21 Sep 2024 13:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n4afZ0OF+/+GWDEd9roJBtXZs03XNWfVZRMigyaY41Y=; b=yyvwSbbCpTAZri9bD/gh9dHn8UJyFP8KqjNXu590f7KMJVliOS7TNe9orAbXe5YFlKJzOH UUUOfBD1tnPhjuYJ1zlSKooAj1YN626fe7tF76F0enNybjjK2TYcwPJBvPc8nE2pGKbty2 OvKQa7+IdaocK0j2S2Frq0jK5MbaBMyCt1gvfbOF+J7jIqvL3J5+hegQ3GYc0XV76Ob5SH 7kUHYvOhm/m7Jitcn7c/laBShdmy6SARUsZPF5lh0KW+ZMfk/zxY/0jCp57/jZn6sA4PIp 1o28Bvm/Hh8AaSfGcLGBa5VkWYKv1IGm4XJzLv5L/88vlw1h9pX2PuqWJat0kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726923952; a=rsa-sha256; cv=none; b=UBeOUkdnA/RXPPrw47kYxfoJueXtJYXD4lkv1eu8ngcmAA6N1FNtjZOB+7/NAV44+M3YGK E1BczdGgnUuM3K7Ps4eH0Xri8OtLFUDdw7F3aifR+eo1UoyCKsrwwx/Sz6EJxqwQ9tkxnP waORWPnXFJKAq4eCMY6msP/BXi+rELs1XWHPQwjgaooA+viv9d0+/C5J8SVhW0gJ0TiWZl pCjKvf53Iw7dlRAgYTZKPsz37424DOFnc6z1jjuyoKLvao7sG1c8kogQKAAIylvvKu6UNw rT+xzGuXGH1dQhepcHQr11u21tjfgahDPaZ+JvXNJ6sinzyYXf6sdB9tSXLKHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726923952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n4afZ0OF+/+GWDEd9roJBtXZs03XNWfVZRMigyaY41Y=; b=qkyDhfJz05W6wmoBQIpiS+dI/sGca0Or+UDz4GmJwecfRQk8Oe7XY6yYfUroQ6BIHm8TGN kMZqmEGkLSv8sjy2hRTE9L1AuBjxEw9bVjmvNEdwc47LApH/St3Pvj/28WwaIdIEun5GFt sWEsQcj1nmJcfc61iR9wf2iYVeQ5v8PBCi4gUzluTrFrGfX/9aE+SBP3KEiqIQCioggctN EBRt1roqK43V7AXzC2D4WOaWDZ5Xvfnfi2gnQ7/OsX9pT5l7y0cuWNXyJ8EUs0BRzX7/hi kRc4m3JItqlyHIs4tQL1LeWHHQUiXmsSWLdbnNA9EmbfxS/1mI3rHRwJzMAypg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9qJ03NGFzZs0; Sat, 21 Sep 2024 13:05: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 48LD5qMZ010644; Sat, 21 Sep 2024 13:05:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LD5qS1010641; Sat, 21 Sep 2024 13:05:52 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:05:52 GMT Message-Id: <202409211305.48LD5qS1010641@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: 1b1e392aed49 - main - ggate: Add support for O_DIRECT access List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b1e392aed4957a38c49599512b4f65b844a0772 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1b1e392aed4957a38c49599512b4f65b844a0772 commit 1b1e392aed4957a38c49599512b4f65b844a0772 Author: David E. Cross AuthorDate: 2024-09-21 07:22:57 +0000 Commit: Mark Johnston CommitDate: 2024-09-21 13:05:22 +0000 ggate: Add support for O_DIRECT access Adds support for controlling O_DIRECT access to ggated, ggatec, and ggatel. Reviewed by: markj Relnotes: yes MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D45056 --- sbin/ggate/ggatec/ggatec.8 | 25 ++++++++--- sbin/ggate/ggatec/ggatec.c | 12 ++++-- sbin/ggate/ggated/ggated.8 | 54 ++++++++++++++++++++++-- sbin/ggate/ggated/ggated.c | 102 +++++++++++++++++++++++++++++++++++---------- sbin/ggate/ggatel/ggatel.8 | 24 +++++++---- sbin/ggate/ggatel/ggatel.c | 20 ++++++--- sbin/ggate/shared/ggate.h | 7 +++- 7 files changed, 192 insertions(+), 52 deletions(-) diff --git a/sbin/ggate/ggatec/ggatec.8 b/sbin/ggate/ggatec/ggatec.8 index 1b780632f154..99f9bcab5964 100644 --- a/sbin/ggate/ggatec/ggatec.8 +++ b/sbin/ggate/ggatec/ggatec.8 @@ -34,6 +34,7 @@ .Op Fl n .Op Fl v .Op Fl o Cm ro | wo | rw +.Op Fl o Cm direct .Op Fl p Ar port .Op Fl q Ar queue_size .Op Fl R Ar rcvbuf @@ -48,6 +49,7 @@ .Op Fl n .Op Fl v .Op Fl o Cm ro | wo | rw +.Op Fl o Cm direct .Op Fl p Ar port .Op Fl R Ar rcvbuf .Op Fl S Ar sndbuf @@ -108,13 +110,21 @@ provider (cancels all pending requests). Do not use .Dv TCP_NODELAY option on TCP sockets. -.It Fl o Cm ro | wo | rw -Specify permissions to use when opening the file or device: read-only -.Pq Cm ro , +.It Fl o Ar option +Specify permissions and options to use when opening the file or device. +.Bl -tag -width indent +.It Cm ro +read-only +.It Cm wo write-only -.Pq Cm wo , -or read-write -.Pq Cm rw . +.It Cm rw +read-write +.It Cm direct +open with +.Dv O_DIRECT +option on the file +.El +.Pp Default is .Cm rw . .It Fl p Ar port @@ -160,11 +170,14 @@ Use a CD-ROM device on a remote host. .Bd -literal -offset indent server# cat /etc/gg.exports client RO /dev/cd0 +client RW /tmp/image server# ggated client# ggatec create -o ro server /dev/cd0 ggate0 client# mount_cd9660 /dev/ggate0 /cdrom +client# ggatec create -o rw -o direct server /tmp/image +ggate1 .Ed .Sh SEE ALSO .Xr geom 4 , diff --git a/sbin/ggate/ggatec/ggatec.c b/sbin/ggate/ggatec/ggatec.c index 5ce605596fb9..b6f248c05290 100644 --- a/sbin/ggate/ggatec/ggatec.c +++ b/sbin/ggate/ggatec/ggatec.c @@ -52,7 +52,6 @@ #include #include -#include #include "ggate.h" @@ -62,6 +61,7 @@ static const char *path = NULL; static const char *host = NULL; static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; +static int direct_flag = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; static unsigned port = G_GATE_PORT; @@ -78,10 +78,12 @@ static void usage(void) { - fprintf(stderr, "usage: %s create [-nv] [-o ] [-p port] " + fprintf(stderr, "usage: %s create [-nv] [-o ] " + "[-o ] [-p port] " "[-q queue_size] [-R rcvbuf] [-S sndbuf] [-s sectorsize] " "[-t timeout] [-u unit] \n", getprogname()); - fprintf(stderr, " %s rescue [-nv] [-o ] [-p port] " + fprintf(stderr, " %s rescue [-nv] [-o ] " + "[-o ] [-p port] " "[-R rcvbuf] [-S sndbuf] <-u unit> \n", getprogname()); fprintf(stderr, " %s destroy [-f] <-u unit>\n", getprogname()); fprintf(stderr, " %s list [-v] [-u unit]\n", getprogname()); @@ -361,7 +363,7 @@ handshake(int dir) close(sfd); return (-1); } - cinit.gc_flags = flags | dir; + cinit.gc_flags = flags | direct_flag | dir; cinit.gc_token = token; cinit.gc_nconn = 2; g_gate_swap2n_cinit(&cinit); @@ -585,6 +587,8 @@ main(int argc, char *argv[]) flags = G_GATE_FLAG_WRITEONLY; else if (strcasecmp("rw", optarg) == 0) flags = 0; + else if (strcasecmp("direct", optarg) == 0) + direct_flag = GGATE_FLAG_DIRECT; else { errx(EXIT_FAILURE, "Invalid argument for '-o' option."); diff --git a/sbin/ggate/ggated/ggated.8 b/sbin/ggate/ggated/ggated.8 index 7016dd58f87a..8e3ad68d1db0 100644 --- a/sbin/ggate/ggated/ggated.8 +++ b/sbin/ggate/ggated/ggated.8 @@ -85,10 +85,51 @@ An alternate location for the exports file. .Pp The format of an exports file is as follows: .Bd -literal -offset indent -1.2.3.4 RO /dev/cd0 -1.2.3.0/24 RW /tmp/test.img -hostname WO /tmp/image +1.2.3.4 RO /dev/cd0 +1.2.3.0/24 RW /tmp/test.img +hostname WO /tmp/image +hostname RW,DIRECT /tmp/direct-image +hostname RW,NODIRECT /tmp/nodirect-image .Ed +.Pp +The first colunm specifies the ip, network with netmask, or the hostname +that the export applies to. +.Pp +The next column is the access flags that apply to the export +.Bl -tag -width ".Cm NODIRECT" +.It Cm RO +Read-Only the path specified will be exported to the client read only. +.It Cm WO +Write-Only the path specified will be exported to the client write only. +.It Cm RW +Read-Write the path specified will be exported to the client read-write. +.It Cm DIRECT +The path specified will always be opened with O_DIRECT for clients. +.It Cm NODIRECT +The path specified will never be opened with O_DIRECT for clients. +.El +.Pp +The final column specifies the path to export. +.Pp +Files are opened with the least common flags between the client and the +server. A client may request read or write only to a read-write export +and the server will honor the client request and open the file in the +requested mode. A client requesting greater access than permissions listed +in the file will be rejected. +.Pp +DIRECT and NODIRECT are used to coerce the use of the O_DIRECT flag to +.Xr open 2 when the specified path is opened. If DIRECT is specified the +path is always opened with O_DIRECT. If NODIRECT is specified the path is +never opened with O_DIRECT. DIRECT access limits the cache effects of +IO operaions on the file. This has the effect of having clients accessing +exports to not impact the cache of the local machine, however it +will cause greater IO utilization to the devices on which the files reside. +.Pp +If neither is specified the server will use +the preference specified by the client, with the default to not use O_DIRECT. +If the client specifies a preference against the server's configuration the +client preference will be silently ignored. +.Pp .Sh FILES .Bl -tag -width ".Pa /var/run/ggated.pid" -compact .It Pa /var/run/ggated.pid @@ -104,13 +145,18 @@ should be called with the .Fl v option. .Sh EXAMPLES -Export CD-ROM device and a file: +Export CD-ROM device, a file, and a file with +.Dv O_DIRECT +option: .Bd -literal -offset indent # echo "1.2.3.0/24 RO /dev/cd0" > /etc/gg.exports # echo "client RW /image" >> /etc/gg.exports +# echo "client RW,DIRECT /image2" >> /etc/gg.exports +# echo "client RW,NODIRECT /image3" >> /etc/gg.exports # ggated .Ed .Sh SEE ALSO +.Xr open 2 , .Xr geom 4 , .Xr ggatec 8 , .Xr ggatel 8 diff --git a/sbin/ggate/ggated/ggated.c b/sbin/ggate/ggated/ggated.c index c579da1c1267..ef7b61cb13c4 100644 --- a/sbin/ggate/ggated/ggated.c +++ b/sbin/ggate/ggated/ggated.c @@ -64,7 +64,7 @@ struct ggd_connection { off_t c_mediasize; unsigned c_sectorsize; - unsigned c_flags; /* flags (RO/RW) */ + int c_flags; /* flags (RO/RW) */ int c_diskfd; int c_sendfd; int c_recvfd; @@ -85,11 +85,18 @@ struct ggd_request { #define r_length r_hdr.gh_length #define r_error r_hdr.gh_error +#define EFLAGS_RDONLY 0x0000 +#define EFLAGS_WRONLY 0x0001 +#define EFLAGS_RDWR 0x0002 +#define EFLAGS_ACCMODE 0x0003 +#define EFLAGS_DIRECT 0x0004 +#define EFLAGS_NODIRECT 0x0008 + struct ggd_export { char *e_path; /* path to device/file */ in_addr_t e_ip; /* remote IP address */ in_addr_t e_mask; /* IP mask */ - unsigned e_flags; /* flags (RO/RW) */ + int e_flags; /* flags (WO/RO/RW/DIRECT/NODIRECT) */ SLIST_ENTRY(ggd_export) e_next; }; @@ -146,20 +153,61 @@ countmask(unsigned m) return (mask); } +static int +parse_flags(const char *flagsstr, int lineno) +{ + char *flagscpy; + char *word, *brkf; + int access_flags = -1; + int direct_flags = 0; + + flagscpy = strdup(flagsstr); + if (flagscpy == NULL) { + g_gate_xlog("Not enough memory."); + } + + for (word = strtok_r(flagscpy, ",", &brkf); + word != NULL; + word = strtok_r(NULL, ",", &brkf)) { + if (strcasecmp("ro", word) == 0 || + strcasecmp("rd", word) == 0) { + access_flags = EFLAGS_RDONLY; + } else if (strcasecmp("wo", word) == 0) { + access_flags = EFLAGS_WRONLY; + } else if (strcasecmp("rw", word) == 0) { + access_flags = EFLAGS_RDWR; + } else if (strcasecmp("direct", word) == 0) { + direct_flags = EFLAGS_DIRECT; + } else if (strcasecmp("nodirect", word) == 0) { + direct_flags = EFLAGS_NODIRECT; + } else { + g_gate_xlog("Invalid value (%s) in flags field at " + "line %u.", word, lineno); + } + } + free(flagscpy); + if (access_flags == -1) { + g_gate_xlog("Invalid value (%s) in flags field at " + "line %u.", flagsstr, lineno); + } + return (direct_flags | access_flags); +} + static void line_parse(char *line, unsigned lineno) { struct ggd_export *ex; - char *word, *path, *sflags; - unsigned flags, i, vmask; + char *word, *path, *sflags, *brkl; + unsigned i, vmask; + int flags; in_addr_t ip, mask; ip = mask = flags = vmask = 0; path = NULL; sflags = NULL; - for (i = 0, word = strtok(line, " \t"); word != NULL; - i++, word = strtok(NULL, " \t")) { + for (i = 0, word = strtok_r(line, " \t", &brkl); word != NULL; + i++, word = strtok_r(NULL, " \t", &brkl)) { switch (i) { case 0: /* IP address or host name */ ip = g_gate_str2ip(strsep(&word, "/")); @@ -185,17 +233,7 @@ line_parse(char *line, unsigned lineno) mask = countmask(vmask); break; case 1: /* flags */ - if (strcasecmp("rd", word) == 0 || - strcasecmp("ro", word) == 0) { - flags = O_RDONLY; - } else if (strcasecmp("wo", word) == 0) { - flags = O_WRONLY; - } else if (strcasecmp("rw", word) == 0) { - flags = O_RDWR; - } else { - g_gate_xlog("Invalid value in flags field at " - "line %u.", lineno); - } + flags = parse_flags(word, lineno); sflags = word; break; case 2: /* path */ @@ -306,13 +344,16 @@ exports_check(struct ggd_export *ex, struct g_gate_cinit *cinit, struct ggd_connection *conn) { char ipmask[32]; /* 32 == strlen("xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx")+1 */ - int error = 0, flags; + int error = 0, flags, access_flags, direct_flags = 0; strlcpy(ipmask, ip2str(ex->e_ip), sizeof(ipmask)); strlcat(ipmask, "/", sizeof(ipmask)); strlcat(ipmask, ip2str(ex->e_mask), sizeof(ipmask)); + + access_flags = ex->e_flags & EFLAGS_ACCMODE; + if ((cinit->gc_flags & GGATE_FLAG_RDONLY) != 0) { - if (ex->e_flags == O_WRONLY) { + if (access_flags == EFLAGS_WRONLY) { g_gate_log(LOG_WARNING, "Read-only access requested, " "but %s (%s) is exported write-only.", ex->e_path, ipmask); @@ -321,7 +362,7 @@ exports_check(struct ggd_export *ex, struct g_gate_cinit *cinit, conn->c_flags |= GGATE_FLAG_RDONLY; } } else if ((cinit->gc_flags & GGATE_FLAG_WRONLY) != 0) { - if (ex->e_flags == O_RDONLY) { + if (access_flags == EFLAGS_RDONLY) { g_gate_log(LOG_WARNING, "Write-only access requested, " "but %s (%s) is exported read-only.", ex->e_path, ipmask); @@ -330,24 +371,41 @@ exports_check(struct ggd_export *ex, struct g_gate_cinit *cinit, conn->c_flags |= GGATE_FLAG_WRONLY; } } else { - if (ex->e_flags == O_RDONLY) { + if (access_flags == EFLAGS_RDONLY) { g_gate_log(LOG_WARNING, "Read-write access requested, " "but %s (%s) is exported read-only.", ex->e_path, ipmask); return (EPERM); - } else if (ex->e_flags == O_WRONLY) { + } else if (access_flags == EFLAGS_WRONLY) { g_gate_log(LOG_WARNING, "Read-write access requested, " "but %s (%s) is exported write-only.", ex->e_path, ipmask); return (EPERM); } } + + if ((cinit->gc_flags & GGATE_FLAG_DIRECT) != 0) { + if (ex->e_flags & EFLAGS_NODIRECT) { + g_gate_log(LOG_WARNING, "Direct IO requested, " + "but %s (%s) is exported NODIRECT.", ex->e_path, + ipmask); + } else { + conn->c_flags |= GGATE_FLAG_DIRECT; + direct_flags = O_DIRECT; + } + } + + if (ex->e_flags & EFLAGS_DIRECT) { + direct_flags = O_DIRECT; + } + if ((conn->c_flags & GGATE_FLAG_RDONLY) != 0) flags = O_RDONLY; else if ((conn->c_flags & GGATE_FLAG_WRONLY) != 0) flags = O_WRONLY; else flags = O_RDWR; + flags |= direct_flags; if (conn->c_diskfd != -1) { if (strcmp(conn->c_path, ex->e_path) != 0) { g_gate_log(LOG_ERR, "old %s and new %s: " diff --git a/sbin/ggate/ggatel/ggatel.8 b/sbin/ggate/ggatel/ggatel.8 index 816a5b9a6e0e..0dd4f30041c5 100644 --- a/sbin/ggate/ggatel/ggatel.8 +++ b/sbin/ggate/ggatel/ggatel.8 @@ -32,7 +32,7 @@ .Nm .Cm create .Op Fl v -.Op Fl o Cm ro | wo | rw +.Oo Fl o option Oc ... .Op Fl s Ar sectorsize .Op Fl t Ar timeout .Op Fl u Ar unit @@ -48,7 +48,7 @@ .Nm .Cm rescue .Op Fl v -.Op Fl o Cm ro | wo | rw +.Oo Fl o option Oc ... .Fl u Ar unit .Ar path .Sh DESCRIPTION @@ -92,13 +92,21 @@ Available options: Forcibly destroy .Nm ggate provider (cancels all pending requests). -.It Fl o Cm ro | wo | rw -Specify permissions to use when opening the file or device: read-only -.Pq Cm ro , +.It Fl o Ar option +Specify permissions and options to use when opening the file or device. +.Bl -tag -width indent +.It Cm ro +read-only +.It Cm wo write-only -.Pq Cm wo , -or read-write -.Pq Cm rw . +.It Cm rw +read-write +.It Cm direct +open with +.Dv O_DIRECT +option on the file +.El +.Pp Default is .Cm rw . .It Fl s Ar sectorsize diff --git a/sbin/ggate/ggatel/ggatel.c b/sbin/ggate/ggatel/ggatel.c index 246a419ecaaf..1cbb6af28b7e 100644 --- a/sbin/ggate/ggatel/ggatel.c +++ b/sbin/ggate/ggatel/ggatel.c @@ -43,7 +43,6 @@ #include #include -#include #include "ggate.h" @@ -52,6 +51,7 @@ static enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; +static int direct_flag = 0; static int force = 0; static unsigned sectorsize = 0; static unsigned timeout = G_GATE_TIMEOUT; @@ -60,24 +60,30 @@ static void usage(void) { - fprintf(stderr, "usage: %s create [-v] [-o ] " + fprintf(stderr, "usage: %s create [-v] [-o option] ... " "[-s sectorsize] [-t timeout] [-u unit] \n", getprogname()); - fprintf(stderr, " %s rescue [-v] [-o ] <-u unit> " + fprintf(stderr, " %s rescue [-v] [-o option] ... <-u unit> " "\n", getprogname()); fprintf(stderr, " %s destroy [-f] <-u unit>\n", getprogname()); fprintf(stderr, " %s list [-v] [-u unit]\n", getprogname()); + fprintf(stderr, " option = {ro, wo, rw, direct}\n"); exit(EXIT_FAILURE); } static int g_gate_openflags(unsigned ggflags) { + int openflags = O_RDWR; if ((ggflags & G_GATE_FLAG_READONLY) != 0) - return (O_RDONLY); + openflags = O_RDONLY; else if ((ggflags & G_GATE_FLAG_WRITEONLY) != 0) - return (O_WRONLY); - return (O_RDWR); + openflags = O_WRONLY; + + if (direct_flag) + openflags |= O_DIRECT; + + return (openflags); } static void @@ -248,6 +254,8 @@ main(int argc, char *argv[]) flags = G_GATE_FLAG_WRITEONLY; else if (strcasecmp("rw", optarg) == 0) flags = 0; + else if (strcasecmp("direct", optarg) == 0) + direct_flag = 1; else { errx(EXIT_FAILURE, "Invalid argument for '-o' option."); diff --git a/sbin/ggate/shared/ggate.h b/sbin/ggate/shared/ggate.h index 0170df2dd1b6..78488a24c3fa 100644 --- a/sbin/ggate/shared/ggate.h +++ b/sbin/ggate/shared/ggate.h @@ -29,6 +29,7 @@ #ifndef _GGATE_H_ #define _GGATE_H_ +#include #include #include @@ -42,8 +43,8 @@ #define GGATE_MAGIC "GEOM_GATE " #define GGATE_VERSION 0 -#define GGATE_FLAG_RDONLY 0x0001 -#define GGATE_FLAG_WRONLY 0x0002 +#define GGATE_FLAG_RDONLY G_GATE_FLAG_READONLY +#define GGATE_FLAG_WRONLY G_GATE_FLAG_WRITEONLY /* * If neither the GGATE_FLAG_SEND nor the GGATE_FLAG_RECV flag is * set - this is initial connection. @@ -53,6 +54,8 @@ #define GGATE_FLAG_SEND 0x0004 #define GGATE_FLAG_RECV 0x0008 +#define GGATE_FLAG_DIRECT 0x0010 + #define GGATE_CMD_READ 0 #define GGATE_CMD_WRITE 1 #define GGATE_CMD_FLUSH 3 From nobody Sat Sep 21 13:07:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9qLB0q4pz5WNjZ; Sat, 21 Sep 2024 13:07: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 4X9qL95fXMz4620; Sat, 21 Sep 2024 13:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726924065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0kC38bckG9K3eDCbNvTScsDlBBh6XfyFR3pMtKk4Eg=; b=m0gzCJ7ASZTi/uWYrVq7PrQwDfAFClMFrlceoubBrSPoZc5AB4uW5izV0jel6A2nvboMFe KB3UAupvqL7lxnm5C1BcLaPLDG6WGsgF4ig7WMzj1Q92iVY+p5XQwoIeafrahpfJJKaECA eEVp1CGGA2FhwqFhI3FvA1mMYdcw8jfS5oPD4lnVT4QWdrbOXuqS3rQBviO/CsZc1OHpzU g1aYzgeMLg7hqFeE9PzD1Od1pdEN6NAlVhUOAvVaWm79slhgUpUNlYnGLmA3Lv7P6Nj4rC eeJQtYio+ysrLZLzzxDgfSAroptNq8nELcSCLMQJJlqZW1mcdLvaI3gNQcqs0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726924065; a=rsa-sha256; cv=none; b=dXeNaZRY/UYxzGC5KS7kZu97xTKsLOYNDXMX8jwmmWDWbHh7F+YMeQ90OOIimUOYocy8Ke 9Be+NHrjy8ULw23LGsDYIaZavJEt6ws7Hf5rf4jbjxIEGJs58Nr4y4VKjAt8s3Y1KcyL+4 E5XUkpYh8E9P13QBOJWlJwEFtHBl8vy2iuU/j+ZJOw2aFB3R2a3KG6DDGixogBlIIyR0cl 0DL7bWgkgFGnl+zHJAjGkIaaii3qbR3t0MPBSO4Vh+U60wXewseC0ZQSUcRsVmFEiifgpe Z3dlfJiUGb0VGZSjlN158p1xffZkdAbdJYSZk7fgq6mj4/bb3yZF5uG1l0zbjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726924065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0kC38bckG9K3eDCbNvTScsDlBBh6XfyFR3pMtKk4Eg=; b=YJHXM7nkSrTiEatdzUSDaMirrr12cTjsCoI16hk/1U02G6KDPUOwoaJ6toC7ZlF0Y6bCUL 6/DhJTxqNx3HiONUZI0onrO81NjOGSnwuSff8mirCJZmBdEV7vj/bvm/9FUmJtlecfKVa2 weBwYK5Dv/m5wJDicA9RSN99YHKrAHNYN2AfvmaQNwVYzniA0IPtAjiON4SiY0i8wJYS6g DH5coD8nyOc1P8cnNjhX99UCfCW2sMyAhC2F7kPPJAILae71jE25Js0iGmM69E+Px5GFdv Xr2y/Kbn7G3TeRlnkkhrRmXVgRjjxQjeOide2oxtDCpRanGquvFpS4PVEPa/Gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9qL95BtFzZKZ; Sat, 21 Sep 2024 13:07: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 48LD7jGn011062; Sat, 21 Sep 2024 13:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LD7jPF011059; Sat, 21 Sep 2024 13:07:45 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:07:45 GMT Message-Id: <202409211307.48LD7jPF011059@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: f3754afd5901 - main - Remove stray whitespaces from sys/amd64/ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3754afd5901857787271e73f9c34d3b9069a03f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f3754afd5901857787271e73f9c34d3b9069a03f commit f3754afd5901857787271e73f9c34d3b9069a03f Author: Joshua Rogers AuthorDate: 2024-09-12 16:35:12 +0000 Commit: Warner Losh CommitDate: 2024-09-21 13:05:46 +0000 Remove stray whitespaces from sys/amd64/ Signed-off-by: Joshua Rogers Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1418 --- sys/amd64/amd64/bios.c | 4 ++-- sys/amd64/amd64/cpu_switch.S | 2 +- sys/amd64/amd64/db_disasm.c | 2 +- sys/amd64/amd64/exception.S | 2 +- sys/amd64/amd64/fpu.c | 2 +- sys/amd64/amd64/initcpu.c | 8 ++++---- sys/amd64/amd64/machdep.c | 2 +- sys/amd64/amd64/mem.c | 6 +++--- sys/amd64/amd64/mpboot.S | 6 +++--- sys/amd64/amd64/pmap.c | 32 ++++++++++++++++---------------- sys/amd64/amd64/sigtramp.S | 2 +- sys/amd64/amd64/sys_machdep.c | 2 +- sys/amd64/amd64/trap.c | 2 +- sys/amd64/amd64/vm_machdep.c | 2 +- sys/amd64/include/asm.h | 2 +- sys/amd64/include/bus_dma.h | 2 +- sys/amd64/include/param.h | 4 ++-- sys/amd64/include/pmap.h | 2 +- sys/amd64/include/resource.h | 2 +- sys/amd64/include/sf_buf.h | 2 +- sys/amd64/include/vmm.h | 4 ++-- sys/amd64/include/vmm_dev.h | 2 +- sys/amd64/include/vmm_instruction_emul.h | 2 +- sys/amd64/include/vmparam.h | 2 +- sys/amd64/pci/pci_cfgreg.c | 10 +++++----- sys/amd64/sgx/sgx.c | 2 +- sys/amd64/vmm/amd/amdvi_hw.c | 4 ++-- sys/amd64/vmm/amd/amdvi_priv.h | 8 ++++---- sys/amd64/vmm/amd/ivrs_drv.c | 18 +++++++++--------- sys/amd64/vmm/amd/npt.c | 2 +- sys/amd64/vmm/amd/svm.c | 30 +++++++++++++++--------------- sys/amd64/vmm/amd/svm_msr.c | 2 +- sys/amd64/vmm/intel/ept.c | 2 +- sys/amd64/vmm/intel/vmx.c | 2 +- sys/amd64/vmm/io/ppt.c | 22 +++++++++++----------- sys/amd64/vmm/io/vhpet.c | 6 +++--- sys/amd64/vmm/io/vlapic.c | 16 ++++++++-------- sys/amd64/vmm/io/vrtc.c | 2 +- sys/amd64/vmm/vmm.c | 8 ++++---- sys/amd64/vmm/vmm_instruction_emul.c | 8 ++++---- sys/amd64/vmm/vmm_mem.c | 2 +- 41 files changed, 121 insertions(+), 121 deletions(-) diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index 4dbca4424aa4..3f53b80d6920 100644 --- a/sys/amd64/amd64/bios.c +++ b/sys/amd64/amd64/bios.c @@ -50,7 +50,7 @@ * * Search some or all of the BIOS region for a signature string. * - * (start) Optional offset returned from this function + * (start) Optional offset returned from this function * (for searching for multiple matches), or NULL * to start the search from the base of the BIOS. * Note that this will be a _physical_ address in @@ -68,7 +68,7 @@ u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen, int paralen, int sigofs) { u_char *sp, *end; - + /* compute the starting address */ if ((start >= BIOS_START) && (start <= (BIOS_START + BIOS_SIZE))) { sp = (char *)BIOS_PADDRTOVADDR(start); diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index 2a3eced01ab3..32d1b91d50b4 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -386,7 +386,7 @@ END(savectx) /* * resumectx(pcb) * Resuming processor state from pcb. - */ + */ ENTRY(resumectx) /* Switch to KPML5/4phys. */ movq KPML4phys,%rax diff --git a/sys/amd64/amd64/db_disasm.c b/sys/amd64/amd64/db_disasm.c index bca12894efdf..5f658fb3b0d0 100644 --- a/sys/amd64/amd64/db_disasm.c +++ b/sys/amd64/amd64/db_disasm.c @@ -1391,7 +1391,7 @@ db_disasm(db_addr_t loc, bool altfmt) case 0xc8: i_name = "monitor"; i_size = NONE; - i_mode = 0; + i_mode = 0; break; case 0xc9: i_name = "mwait"; diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 7b6cde824203..c3d5819378d1 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -114,7 +114,7 @@ dtrace_invop_calltrap_addr: movq $0,TF_ADDR(%rsp) movq $0,TF_ERR(%rsp) jmp alltraps_noen_u - + .globl X\l .type X\l,@function X\l: diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index ebc8b869b368..1c38949f7375 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -538,7 +538,7 @@ fpuformat(void) * (FP_X_INV, FP_X_DZ) * 4 Denormal operand (FP_X_DNML) * 5 Numeric over/underflow (FP_X_OFL, FP_X_UFL) - * 6 Inexact result (FP_X_IMP) + * 6 Inexact result (FP_X_IMP) */ static char fpetable[128] = { 0, diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index c5266ffcc235..05e482f7783b 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -2,21 +2,21 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) KATO Takenori, 1997, 1998. - * + * * All rights reserved. Unpublished rights reserved under the copyright * laws of Japan. - * + * * 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 as * the first lines of this file unmodified. * 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 ``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. diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 5dbc41553452..e2ae3843a119 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -229,7 +229,7 @@ cpu_startup(void *dummy) * namely: incorrect CPU frequency detection and failure to * start the APs. * We do this by disabling a bit in the SMI_EN (SMI Control and - * Enable register) of the Intel ICH LPC Interface Bridge. + * Enable register) of the Intel ICH LPC Interface Bridge. */ sysenv = kern_getenv("smbios.system.product"); if (sysenv != NULL) { diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index 25d22805ed3e..413b7c74890e 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -191,7 +191,7 @@ memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, * This is basically just an ioctl shim for mem_range_attr_get * and mem_range_attr_set. */ -int +int memioctl_md(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, struct thread *td) { @@ -221,7 +221,7 @@ memioctl_md(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, M_MEMDESC, M_WAITOK); error = mem_range_attr_get(md, &nd); if (!error) - error = copyout(md, mo->mo_desc, + error = copyout(md, mo->mo_desc, nd * sizeof(struct mem_range_desc)); free(md, M_MEMDESC); } @@ -229,7 +229,7 @@ memioctl_md(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, nd = mem_range_softc.mr_ndesc; mo->mo_arg[0] = nd; break; - + case MEMRANGE_SET: md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); diff --git a/sys/amd64/amd64/mpboot.S b/sys/amd64/amd64/mpboot.S index db1f3de209c7..e3d940088f14 100644 --- a/sys/amd64/amd64/mpboot.S +++ b/sys/amd64/amd64/mpboot.S @@ -62,7 +62,7 @@ mptramp_start: /* Enable protected mode */ movl $CR0_PE, %eax - mov %eax, %cr0 + mov %eax, %cr0 /* * Now execute a far jump to turn on protected mode. This @@ -207,7 +207,7 @@ bootcode: * are interpreted slightly differently. * %ds: +A, +W, -E, DPL=0, +P, +D, +G * %ss: +A, +W, -E, DPL=0, +P, +B, +G - * Accessed, Writeable, Expand up, Present, 32 bit, 4GB + * Accessed, Writeable, Expand up, Present, 32 bit, 4GB * For %ds, +D means 'default operand size is 32 bit'. * For %ss, +B means the stack register is %esp rather than %sp. */ @@ -237,7 +237,7 @@ mptramp_nx: /* * The pseudo descriptor for lgdt to use. */ -lgdt_desc: +lgdt_desc: .word gdtend-gdt /* Length */ .long gdt-mptramp_start /* Offset plus %ds << 4 */ diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 4cb833757489..3b7220369b61 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1824,7 +1824,7 @@ create_pagetables(vm_paddr_t *firstaddr) * then the residual physical memory is mapped with 2MB pages. Later, * if pmap_mapdev{_attr}() uses the direct map for non-write-back * memory, pmap_change_attr() will demote any 2MB or 1GB page mappings - * that are partially used. + * that are partially used. */ pd_p = (pd_entry_t *)DMPDphys; for (i = NPDEPG * ndm1g, j = 0; i < NPDEPG * ndmpdp; i++, j++) { @@ -2279,7 +2279,7 @@ pmap_bootstrap_la57(void *arg __unused) vm_page_free(m_pd); vm_page_free(m_pt); - /* + /* * Recursively map PML5 to itself in order to get PTmap and * PDmap. */ @@ -2510,7 +2510,7 @@ pmap_init(void) /* * Initialize the vm page array entries for the kernel pmap's * page table pages. - */ + */ PMAP_LOCK(kernel_pmap); for (i = 0; i < nkpt; i++) { mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); @@ -3461,12 +3461,12 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) cpuid = PCPU_GET(cpuid); other_cpus = all_cpus; CPU_CLR(cpuid, &other_cpus); - if (pmap == kernel_pmap || pmap_type_guest(pmap)) + if (pmap == kernel_pmap || pmap_type_guest(pmap)) active = all_cpus; else { active = pmap->pm_active; } - if (CPU_OVERLAP(&active, &other_cpus)) { + if (CPU_OVERLAP(&active, &other_cpus)) { act.store = cpuid; act.invalidate = active; act.va = va; @@ -4226,7 +4226,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) pmap_pt_page_count_adj(pmap, -1); - /* + /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done */ @@ -4377,7 +4377,7 @@ pmap_pinit_pml5(vm_page_t pml5pg) pm_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; - /* + /* * Install self-referential address mapping entry. */ pm_pml5[PML5PML5I] = VM_PAGE_TO_PHYS(pml5pg) | @@ -5179,7 +5179,7 @@ pmap_growkernel(vm_offset_t addr) end = (end + NBPDR) & ~PDRMASK; if (end - 1 >= vm_map_max(kernel_map)) { end = vm_map_max(kernel_map); - break; + break; } continue; } @@ -5196,7 +5196,7 @@ pmap_growkernel(vm_offset_t addr) end = (end + NBPDR) & ~PDRMASK; if (end - 1 >= vm_map_max(kernel_map)) { end = vm_map_max(kernel_map); - break; + break; } } @@ -6146,7 +6146,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * PG_A set. If the old PDE has PG_RW set, it also has PG_M * set. Thus, there is no danger of a race with another * processor changing the setting of PG_A and/or PG_M between - * the read above and the store below. + * the read above and the store below. */ if (workaround_erratum383) pmap_update_pde(pmap, va, pde, newpde); @@ -6276,7 +6276,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, * pmap_remove_pte: do the things to unmap a page in a process */ static int -pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va, +pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va, pd_entry_t ptepde, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; @@ -6889,7 +6889,7 @@ pmap_pde_ept_executable(pmap_t pmap, pd_entry_t pde) * single page table page (PTP) to a single 2MB page mapping. For promotion * to occur, two conditions must be met: (1) the 4KB page mappings must map * aligned, contiguous physical memory and (2) the 4KB page mappings must have - * identical characteristics. + * identical characteristics. */ static bool pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, vm_page_t mpte, @@ -7237,7 +7237,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, goto out; } if (psind == 1) { - /* Assert the required virtual and physical alignment. */ + /* Assert the required virtual and physical alignment. */ KASSERT((va & PDRMASK) == 0, ("pmap_enter: va unaligned")); KASSERT(m->psind > 0, ("pmap_enter: m->psind < psind")); rv = pmap_enter_pde(pmap, va, newpte | PG_PS, flags, m, &lock); @@ -7933,7 +7933,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, * Map using 2MB pages. Since "ptepa" is 2M aligned and * "size" is a multiple of 2M, adding the PAT setting to "pa" * will not affect the termination of this loop. - */ + */ PMAP_LOCK(pmap); for (pa = ptepa | pmap_cache_bits(pmap, pat_mode, true); pa < ptepa + size; pa += NBPDR) { @@ -8168,7 +8168,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, srcptepaddr = *pde; if (srcptepaddr == 0) continue; - + if (srcptepaddr & PG_PS) { /* * We can only virtual copy whole superpages. @@ -8246,7 +8246,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, pmap_abort_ptp(dst_pmap, addr, dstmpte); goto out; } - /* Have we copied all of the valid mappings? */ + /* Have we copied all of the valid mappings? */ if (dstmpte->ref_count >= srcmpte->ref_count) break; } diff --git a/sys/amd64/amd64/sigtramp.S b/sys/amd64/amd64/sigtramp.S index 4676d5f67650..9aed66a199a1 100644 --- a/sys/amd64/amd64/sigtramp.S +++ b/sys/amd64/amd64/sigtramp.S @@ -68,7 +68,7 @@ ENTRY(__vdso_sigcode) * * LLVM libunwind from stable/13 cannot parse register numbers higher * than 32. Disable %rflags, %fs.base, and %gs.base annotations. - */ + */ .cfi_offset %fs, SIGF_UC + UC_FS .cfi_offset %gs, SIGF_UC + UC_GS .cfi_offset %es, SIGF_UC + UC_ES diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index c8bddb0acb19..70a369ec64a3 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -311,7 +311,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = copyout(&pcb->pcb_fsbase, uap->parms, sizeof(pcb->pcb_fsbase)); break; - + case AMD64_SET_FSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (error == 0) { diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 67146240ba58..a6d6c792ee92 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -723,7 +723,7 @@ trap_pfault(struct trapframe *frame, bool usermode, int *signo, int *ucode) * Due to both processor errata and lazy TLB invalidation when * access restrictions are removed from virtual pages, memory * accesses that are allowed by the physical mapping layer may - * nonetheless cause one spurious page fault per virtual page. + * nonetheless cause one spurious page fault per virtual page. * When the thread is executing a "no faulting" section that * is bracketed by vm_fault_{disable,enable}_pagefaults(), * every page fault is treated as a spurious page fault, diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index f6d52fa4c02b..f74091438648 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -606,7 +606,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { - /* + /* * Do any extra cleaning that needs to be done. * The thread may have optional components * that are not present in a fresh thread. diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h index 6a2e326d42aa..6535e44d5cef 100644 --- a/sys/amd64/include/asm.h +++ b/sys/amd64/include/asm.h @@ -92,7 +92,7 @@ #define END(x) .size x, . - x; .cfi_endproc /* - * WEAK_REFERENCE(): create a weak reference alias from sym. + * WEAK_REFERENCE(): create a weak reference alias from sym. * The macro is not a general asm macro that takes arbitrary names, * but one that takes only C names. It does the non-null name * translation inside the macro. diff --git a/sys/amd64/include/bus_dma.h b/sys/amd64/include/bus_dma.h index 82765dacc30a..30d819cc3425 100644 --- a/sys/amd64/include/bus_dma.h +++ b/sys/amd64/include/bus_dma.h @@ -29,6 +29,6 @@ #ifndef _AMD64_BUS_DMA_H_ #define _AMD64_BUS_DMA_H_ -#include +#include #endif /* _AMD64_BUS_DMA_H_ */ diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 660f69593709..8ad1c0e93c6a 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -78,7 +78,7 @@ * ALIGNED_POINTER is a boolean macro that checks whether an address * is valid to fetch data elements of type t from on this architecture. * This does not reflect the optimal alignment, just the possibility - * (within reasonable limits). + * (within reasonable limits). */ #define ALIGNED_POINTER(p, t) 1 @@ -154,7 +154,7 @@ #define amd64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define amd64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) -#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) +#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) #define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 0819b3bc2945..adeb89d08bb5 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -140,7 +140,7 @@ #define PGEX_PK 0x20 /* protection key violation */ #define PGEX_SGX 0x8000 /* SGX-related */ -/* +/* * undef the PG_xx macros that define bits in the regular x86 PTEs that * have a different position in nested PTEs. This is done when compiling * code that needs to be aware of the differences between regular x86 and diff --git a/sys/amd64/include/resource.h b/sys/amd64/include/resource.h index 9477572176e0..d44fd653cc84 100644 --- a/sys/amd64/include/resource.h +++ b/sys/amd64/include/resource.h @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF diff --git a/sys/amd64/include/sf_buf.h b/sys/amd64/include/sf_buf.h index 71e6b72acd1c..4a64928ae141 100644 --- a/sys/amd64/include/sf_buf.h +++ b/sys/amd64/include/sf_buf.h @@ -34,7 +34,7 @@ * On this machine, the only purpose for which sf_buf is used is to implement * an opaque pointer required by the machine-independent parts of the kernel. * That pointer references the vm_page that is "mapped" by the sf_buf. The - * actual mapping is provided by the direct virtual-to-physical mapping. + * actual mapping is provided by the direct virtual-to-physical mapping. */ static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 37972d54bd99..be88fc867e98 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -124,7 +124,7 @@ enum x2apic_state { /* * The VM name has to fit into the pathname length constraints of devfs, * governed primarily by SPECNAMELEN. The length is the total number of - * characters in the full path, relative to the mount point and not + * characters in the full path, relative to the mount point and not * including any leading '/' characters. * A prefix and a suffix are added to the name specified by the user. * The prefix is usually "vmm/" or "vmm.io/", but can be a few characters @@ -465,7 +465,7 @@ struct vm_copyinfo { /* * Set up 'copyinfo[]' to copy to/from guest linear address space starting * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for - * a copyin or PROT_WRITE for a copyout. + * a copyin or PROT_WRITE for a copyout. * * retval is_fault Interpretation * 0 0 Success diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h index b77b0ef5d996..1f86538ce5f3 100644 --- a/sys/amd64/include/vmm_dev.h +++ b/sys/amd64/include/vmm_dev.h @@ -301,7 +301,7 @@ enum { IOCNUM_UNMAP_PPTDEV_MMIO = 46, /* statistics */ - IOCNUM_VM_STATS = 50, + IOCNUM_VM_STATS = 50, IOCNUM_VM_STAT_DESC = 51, /* kernel device state */ diff --git a/sys/amd64/include/vmm_instruction_emul.h b/sys/amd64/include/vmm_instruction_emul.h index a21754ac777f..d5f0363cfb41 100644 --- a/sys/amd64/include/vmm_instruction_emul.h +++ b/sys/amd64/include/vmm_instruction_emul.h @@ -112,7 +112,7 @@ void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); * 'gla' is the guest linear address provided by the hardware assist * that caused the nested page table fault. It is used to verify that * the software instruction decoding is in agreement with the hardware. - * + * * Some hardware assists do not provide the 'gla' to the hypervisor. * To skip the 'gla' verification for this or any other reason pass * in VIE_INVALID_GLA instead. diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index ad6bf28f1c3b..026da4b460e2 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -89,7 +89,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 63 diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index 90e15b15553d..df3ea5659dd1 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -118,7 +118,7 @@ pci_docfgregread(int domain, int bus, int slot, int func, int reg, int bytes) return (-1); } -/* +/* * Read configuration space register */ u_int32_t @@ -144,8 +144,8 @@ pci_cfgregread(int domain, int bus, int slot, int func, int reg, int bytes) return (pci_docfgregread(domain, bus, slot, func, reg, bytes)); } -/* - * Write configuration space register +/* + * Write configuration space register */ void pci_cfgregwrite(int domain, int bus, int slot, int func, int reg, uint32_t data, @@ -171,7 +171,7 @@ pci_cfgregwrite(int domain, int bus, int slot, int func, int reg, uint32_t data, pcireg_cfgwrite(bus, slot, func, reg, data, bytes); } -/* +/* * Configuration space access using direct register operations */ @@ -184,7 +184,7 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes) if (bus <= PCI_BUSMAX && slot <= PCI_SLOTMAX && func <= PCI_FUNCMAX && (unsigned)reg <= PCI_REGMAX && bytes != 3 && (unsigned)bytes <= 4 && (reg & (bytes - 1)) == 0) { - outl(CONF1_ADDR_PORT, (1U << 31) | (bus << 16) | (slot << 11) + outl(CONF1_ADDR_PORT, (1U << 31) | (bus << 16) | (slot << 11) | (func << 8) | (reg & ~0x03)); dataport = CONF1_DATA_PORT + (reg & 0x03); } diff --git a/sys/amd64/sgx/sgx.c b/sys/amd64/sgx/sgx.c index b25862fd2a59..1ada2a189f3c 100644 --- a/sys/amd64/sgx/sgx.c +++ b/sys/amd64/sgx/sgx.c @@ -71,7 +71,7 @@ * User .-- EENTER -- Go to entry point of enclave * space | EEXIT -- Exit back to main application * ENCLU '-- ERESUME -- Resume enclave execution (e.g. after exception) - * + * * Enclave lifecycle from driver point of view: * 1) User calls mmap() on /dev/sgx: we allocate a VM object * 2) User calls ioctl SGX_IOC_ENCLAVE_CREATE: we look for the VM object diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index e87d173023f8..881bfa2ef946 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -928,8 +928,8 @@ amdvi_teardown_hw(struct amdvi_softc *softc) dev = softc->dev; - /* - * Called after disable, h/w is stopped by now, free all the resources. + /* + * Called after disable, h/w is stopped by now, free all the resources. */ amdvi_free_evt_intr_res(dev); diff --git a/sys/amd64/vmm/amd/amdvi_priv.h b/sys/amd64/vmm/amd/amdvi_priv.h index a48390f1c067..2a2646b6907e 100644 --- a/sys/amd64/vmm/amd/amdvi_priv.h +++ b/sys/amd64/vmm/amd/amdvi_priv.h @@ -211,8 +211,8 @@ struct amdvi_ctrl { uint64_t limit:40; uint16_t :12; } excl; - /* - * Revision 2 only. + /* + * Revision 2 only. */ uint64_t ex_feature; struct { @@ -253,8 +253,8 @@ CTASSERT(offsetof(struct amdvi_ctrl, pad2)== 0x2028); CTASSERT(offsetof(struct amdvi_ctrl, pad3)== 0x2040); #define AMDVI_MMIO_V1_SIZE (4 * PAGE_SIZE) /* v1 size */ -/* - * AMF IOMMU v2 size including event counters +/* + * AMF IOMMU v2 size including event counters */ #define AMDVI_MMIO_V2_SIZE (8 * PAGE_SIZE) diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c index 34aebc62fed4..c75e0fcc2d68 100644 --- a/sys/amd64/vmm/amd/ivrs_drv.c +++ b/sys/amd64/vmm/amd/ivrs_drv.c @@ -51,7 +51,7 @@ device_t *ivhd_devs; /* IVHD or AMD-Vi device list. */ int ivhd_count; /* Number of IVHD header. */ -/* +/* * Cached IVHD header list. * Single entry for each IVHD, filtered the legacy one. */ @@ -225,7 +225,7 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) break; default: - device_printf(softc->dev, + device_printf(softc->dev, "unknown type: 0x%x\n", ivhd->Header.Type); return (-1); } @@ -366,7 +366,7 @@ ivhd_identify(driver_t *driver, device_t parent) ivrs_ivinfo = ivrs->Info; printf("AMD-Vi: IVRS Info VAsize = %d PAsize = %d GVAsize = %d" " flags:%b\n", - REG_BITS(ivrs_ivinfo, 21, 15), REG_BITS(ivrs_ivinfo, 14, 8), + REG_BITS(ivrs_ivinfo, 21, 15), REG_BITS(ivrs_ivinfo, 14, 8), REG_BITS(ivrs_ivinfo, 7, 5), REG_BITS(ivrs_ivinfo, 22, 22), "\020\001EFRSup"); @@ -439,7 +439,7 @@ ivhd_probe(device_t dev) return (ENXIO); unit = device_get_unit(dev); - KASSERT((unit < ivhd_count), + KASSERT((unit < ivhd_count), ("ivhd unit %d > count %d", unit, ivhd_count)); ivhd = ivhd_hdrs[unit]; KASSERT(ivhd, ("ivhd is NULL")); @@ -506,7 +506,7 @@ ivhd_print_flag(device_t dev, enum IvrsType ivhd_type, uint8_t flag) * Feature in legacy IVHD type(0x10) and attribute in newer type(0x11 and 0x40). */ static void -ivhd_print_feature(device_t dev, enum IvrsType ivhd_type, uint32_t feature) +ivhd_print_feature(device_t dev, enum IvrsType ivhd_type, uint32_t feature) { switch (ivhd_type) { case IVRS_TYPE_HARDWARE_LEGACY: @@ -639,7 +639,7 @@ ivhd_attach(device_t dev) int status, unit; unit = device_get_unit(dev); - KASSERT((unit < ivhd_count), + KASSERT((unit < ivhd_count), ("ivhd unit %d > count %d", unit, ivhd_count)); /* Make sure its same device for which attach is called. */ KASSERT((ivhd_devs[unit] == dev), @@ -658,12 +658,12 @@ ivhd_attach(device_t dev) softc->pci_seg = ivhd->PciSegmentGroup; softc->pci_rid = ivhd->Header.DeviceId; softc->ivhd_flag = ivhd->Header.Flags; - /* + /* * On lgeacy IVHD type(0x10), it is documented as feature * but in newer type it is attribute. */ softc->ivhd_feature = ivhd->FeatureReporting; - /* + /* * PCI capability has more capabilities that are not part of IVRS. */ softc->cap_off = ivhd->CapabilityOffset; @@ -694,7 +694,7 @@ ivhd_attach(device_t dev) status = amdvi_setup_hw(softc); if (status != 0) { - device_printf(dev, "couldn't be initialised, error=%d\n", + device_printf(dev, "couldn't be initialised, error=%d\n", status); goto fail; } diff --git a/sys/amd64/vmm/amd/npt.c b/sys/amd64/vmm/amd/npt.c index edd61d6b62ea..6fd6628053f2 100644 --- a/sys/amd64/vmm/amd/npt.c +++ b/sys/amd64/vmm/amd/npt.c @@ -58,7 +58,7 @@ svm_npt_init(int ipinum) npt_flags = ipinum & NPT_IPIMASK; TUNABLE_INT_FETCH("hw.vmm.npt.enable_superpage", &enable_superpage); if (enable_superpage) - npt_flags |= PMAP_PDE_SUPERPAGE; + npt_flags |= PMAP_PDE_SUPERPAGE; return (0); } diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index 1015b04ee161..cc0b1c0c8725 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -282,7 +282,7 @@ svm_modresume(void) { svm_enable(NULL); -} +} #ifdef BHYVE_SNAPSHOT void @@ -301,14 +301,14 @@ svm_set_tsc_offset(struct svm_vcpu *vcpu, uint64_t offset) #endif /* Pentium compatible MSRs */ -#define MSR_PENTIUM_START 0 +#define MSR_PENTIUM_START 0 #define MSR_PENTIUM_END 0x1FFF /* AMD 6th generation and Intel compatible MSRs */ -#define MSR_AMD6TH_START 0xC0000000UL -#define MSR_AMD6TH_END 0xC0001FFFUL +#define MSR_AMD6TH_START 0xC0000000UL +#define MSR_AMD6TH_END 0xC0001FFFUL /* AMD 7th and 8th generation compatible MSRs */ -#define MSR_AMD7TH_START 0xC0010000UL -#define MSR_AMD7TH_END 0xC0011FFFUL +#define MSR_AMD7TH_START 0xC0010000UL +#define MSR_AMD7TH_END 0xC0011FFFUL /* * Get the index and bit position for a MSR in permission bitmap. @@ -328,12 +328,12 @@ svm_msr_index(uint64_t msr, int *index, int *bit) return (0); } - base += (MSR_PENTIUM_END - MSR_PENTIUM_START + 1); + base += (MSR_PENTIUM_END - MSR_PENTIUM_START + 1); if (msr >= MSR_AMD6TH_START && msr <= MSR_AMD6TH_END) { - off = (msr - MSR_AMD6TH_START); + off = (msr - MSR_AMD6TH_START); *index = (off + base) / 4; return (0); - } + } base += (MSR_AMD6TH_END - MSR_AMD6TH_START + 1); if (msr >= MSR_AMD7TH_START && msr <= MSR_AMD7TH_END) { @@ -852,7 +852,7 @@ svm_npf_emul_fault(uint64_t exitinfo1) return (false); } - return (true); + return (true); } static void @@ -893,7 +893,7 @@ svm_handle_inst_emul(struct vmcb *vmcb, uint64_t gpa, struct vm_exit *vmexit) default: vmexit->u.inst_emul.cs_base = 0; vmexit->u.inst_emul.cs_d = 0; - break; + break; } /* @@ -994,7 +994,7 @@ svm_save_intinfo(struct svm_softc *svm_sc, struct svm_vcpu *vcpu) uint64_t intinfo; ctrl = svm_get_vmcb_ctrl(vcpu); - intinfo = ctrl->exitintinfo; + intinfo = ctrl->exitintinfo; if (!VMCB_EXITINTINFO_VALID(intinfo)) return; @@ -1533,7 +1533,7 @@ svm_vmexit(struct svm_softc *svm_sc, struct svm_vcpu *vcpu, eax = state->rax; ecx = ctx->sctx_rcx; edx = ctx->sctx_rdx; - retu = false; + retu = false; if (info1) { vmm_stat_incr(vcpu->vcpu, VMEXIT_WRMSR, 1); @@ -1667,7 +1667,7 @@ svm_vmexit(struct svm_softc *svm_sc, struct svm_vcpu *vcpu, default: vmm_stat_incr(vcpu->vcpu, VMEXIT_UNKNOWN, 1); break; - } + } SVM_CTR4(vcpu, "%s %s vmexit at %#lx/%d", handled ? "handled" : "unhandled", exit_reason_to_str(code), @@ -2231,7 +2231,7 @@ svm_run(void *vcpui, register_t rip, pmap_t pmap, struct vm_eventinfo *evinfo) /* Restore host LDTR. */ lldt(ldt_sel); - /* #VMEXIT disables interrupts so re-enable them here. */ + /* #VMEXIT disables interrupts so re-enable them here. */ enable_gintr(); /* Update 'nextrip' */ diff --git a/sys/amd64/vmm/amd/svm_msr.c b/sys/amd64/vmm/amd/svm_msr.c index 629dd0bd3b46..1f7be6029e64 100644 --- a/sys/amd64/vmm/amd/svm_msr.c +++ b/sys/amd64/vmm/amd/svm_msr.c @@ -59,7 +59,7 @@ static uint64_t host_msrs[HOST_MSR_NUM]; void svm_msr_init(void) { - /* + /* * It is safe to cache the values of the following MSRs because they * don't change based on curcpu, curproc or curthread. */ diff --git a/sys/amd64/vmm/intel/ept.c b/sys/amd64/vmm/intel/ept.c index ed41f99fb4e6..5432c7da5df7 100644 --- a/sys/amd64/vmm/intel/ept.c +++ b/sys/amd64/vmm/intel/ept.c @@ -137,7 +137,7 @@ ept_dump(uint64_t *ptp, int nlevels) if (ptpval == 0) continue; - + for (t = 0; t < tabs; t++) printf("\t"); printf("%3d 0x%016lx\n", i, ptpval); diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index 63b0cf3d2ff9..34b5fecc149c 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -3665,7 +3665,7 @@ vmx_setcap(void *vcpui, int type, int val) vlapic = vm_lapic(vcpu->vcpu); vlapic->ipi_exit = val; break; - case VM_CAP_MASK_HWINTR: + case VM_CAP_MASK_HWINTR: retval = 0; break; default: diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c index 109707dbcbd5..3b043c64fbde 100644 --- a/sys/amd64/vmm/io/ppt.c +++ b/sys/amd64/vmm/io/ppt.c @@ -257,7 +257,7 @@ ppt_teardown_msi(struct pptdev *ppt) if (res != NULL) bus_release_resource(ppt->dev, SYS_RES_IRQ, rid, res); - + ppt->msi.res[i] = NULL; ppt->msi.cookie[i] = NULL; } @@ -268,7 +268,7 @@ ppt_teardown_msi(struct pptdev *ppt) ppt->msi.num_msgs = 0; } -static void +static void ppt_teardown_msix_intr(struct pptdev *ppt, int idx) { int rid; @@ -279,25 +279,25 @@ ppt_teardown_msix_intr(struct pptdev *ppt, int idx) res = ppt->msix.res[idx]; cookie = ppt->msix.cookie[idx]; - if (cookie != NULL) + if (cookie != NULL) bus_teardown_intr(ppt->dev, res, cookie); - if (res != NULL) + if (res != NULL) bus_release_resource(ppt->dev, SYS_RES_IRQ, rid, res); ppt->msix.res[idx] = NULL; ppt->msix.cookie[idx] = NULL; } -static void +static void ppt_teardown_msix(struct pptdev *ppt) { int i; - if (ppt->msix.num_msgs == 0) + if (ppt->msix.num_msgs == 0) return; - for (i = 0; i < ppt->msix.num_msgs; i++) + for (i = 0; i < ppt->msix.num_msgs; i++) ppt_teardown_msix_intr(ppt, i); free(ppt->msix.res, M_PPTMSIX); @@ -307,14 +307,14 @@ ppt_teardown_msix(struct pptdev *ppt) pci_release_msi(ppt->dev); if (ppt->msix.msix_table_res) { - bus_release_resource(ppt->dev, SYS_RES_MEMORY, + bus_release_resource(ppt->dev, SYS_RES_MEMORY, ppt->msix.msix_table_rid, ppt->msix.msix_table_res); ppt->msix.msix_table_res = NULL; ppt->msix.msix_table_rid = 0; } if (ppt->msix.msix_pba_res) { - bus_release_resource(ppt->dev, SYS_RES_MEMORY, + bus_release_resource(ppt->dev, SYS_RES_MEMORY, ppt->msix.msix_pba_rid, ppt->msix.msix_pba_res); ppt->msix.msix_pba_res = NULL; @@ -678,10 +678,10 @@ ppt_setup_msix(struct vm *vm, int bus, int slot, int func, *** 219 LINES SKIPPED *** From nobody Sat Sep 21 13:12:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9qS824p4z5WQ1J; Sat, 21 Sep 2024 13:12: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 4X9qS810zTz46t1; Sat, 21 Sep 2024 13:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726924376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1BQWG7z811xm8j/lDbNV7d7k5+h9WK1D/oraLNQ+XAY=; b=VJ+/xpR35ENFTfgdqXQRCIhMVhWZZ5DXenrUsGrk/jAt+++MtHE1au9475xH12ZlNuSYso trPmT1kYZaPTt0UOu+Lbiikb/HX9pPCFK55D6KhHF3woTlTAMhP8Hnw9NymjAxoVrN8Onh OB2cm2JzZE7EeI9O6AAiD8vDpgSEbJhY18wXxTMM16YIm+ghk7chJLleODIopq6h4wg1nE I6aMFXs/B8zrs1lltDHpUUOTNNY3CZKtxZ86JcJsR11jzyXieg3iZ6IoJpxJ7BNXgzaB/9 4hC6E/htGu2x7yKT7dpQ0uzhbFpOrika4Y40padrHFCap+U/JYD2rzKOqmvTVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726924376; a=rsa-sha256; cv=none; b=yWKs5Qv9NIAdMrnYhJpiV9r9tNE1lWmpgD167+UE+fKR9/zaFJFxTaOuCsogUPCrFjAvlJ OqNU3/mbXm367uTGZON8jn2jw7SazACW/8KHjaa0AjIn5eHj/+bnEVxAS12rDTzpDfEhBW JTqqCecTyMeYW807n/Kxi6OyCRb4AudKrGb5Z9RTZjSMM0u9kMa26Np71yEMC4hWNEO48F oMVQYTia2Uk3n7iRuu+S7uAfw69sZEevArmhItghPN3WndAtFLBZTNFX4pxFp4STQTycyt 7VYFw32mIcBojQ5tU4I4OUxwwbg9CwxR1w+4rXl2WSGDbxxQNhhATamc94kEHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726924376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1BQWG7z811xm8j/lDbNV7d7k5+h9WK1D/oraLNQ+XAY=; b=lxByGsNmbXFqFyO1J0DA2zKoX9DoyHVyq1PtX4sRdHmbGoMK74NXGjuFstWKcVrnNoCuhj dgx7RumjtvHMChKvvWMPrIBK2LkIP69evs8h/7fU3AdwlBdp9Q++GPXhd6XhWkHRSpsZYn BTWdUxJsSZa3o4vcTVfmKwEs0gFXEZZpPm+ZTh66d80kKmuFUMhTfd9Ny4sZUA3c0+sBXQ USIGsI6N+dEz9CUC7d9WMde4kW760P2kGDiZ+sT/lo1rFxijSzHcJN5a9HiOFGKyqzGQ56 4c+f2VbzwCWrdaiUDAsiHSmCAu9Cbzsd9T4JLxldGqIKtGHlawihEQ7qScf42A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9qS80cFYzZL9; Sat, 21 Sep 2024 13:12: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 48LDCtoR027536; Sat, 21 Sep 2024 13:12:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LDCtPe027533; Sat, 21 Sep 2024 13:12:55 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:12:55 GMT Message-Id: <202409211312.48LDCtPe027533@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: 03ff6260b4be - main - src.conf.5: regen after LOADER_IA32 knob addition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03ff6260b4bea111f5f464d1ecaa3d12b8d81379 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=03ff6260b4bea111f5f464d1ecaa3d12b8d81379 commit 03ff6260b4bea111f5f464d1ecaa3d12b8d81379 Author: Ed Maste AuthorDate: 2024-09-21 13:10:25 +0000 Commit: Ed Maste CommitDate: 2024-09-21 13:12:36 +0000 src.conf.5: regen after LOADER_IA32 knob addition Fixes: fe3f792f9a29 ("Add build option for the ia32 loader") Sponsored by: The FreeBSD Foundation --- share/man/man5/src.conf.5 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 267351309f93..303697c6efb5 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 September 7, 2024 +.Dd September 21, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1034,6 +1034,16 @@ Build GELI bootloader support. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +.It Va WITHOUT_LOADER_IA32 +Do not build the 32-bit UEFI loader. +.Pp +This is a default setting on +arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +.It Va WITH_LOADER_IA32 +Build the 32-bit UEFI loader. +.Pp +This is a default setting on +amd64/amd64. .It Va WITHOUT_LOADER_KBOOT Do not build kboot, a linuxboot environment loader .Pp From nobody Sat Sep 21 13:13:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9qT83bZ6z5WQBx; Sat, 21 Sep 2024 13:13:48 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 4X9qT75nVZz47Bc; Sat, 21 Sep 2024 13:13:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=B3vORMf6; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::12f as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3a0c870ff25so10014805ab.2; Sat, 21 Sep 2024 06:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726924426; x=1727529226; 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=S3T7gbL3AVm6jma+KRI33LbPBGRq/Tve5339DtHt8Hc=; b=B3vORMf64f5qhB/L5yYc9zgh5pc3Z7//wTn60k1RJC1Cnd/EYiPSKpWvvm/8YWSLJK O9eaLrDWCuPoUtEDrVx5/3n0KgOf7qR7IiYgoqiFf0j/DE1rM6KiaQAuQuysrPAKoFlB 0kUVJVhxHSRElZUn/l5S+3uRlc9dyz5JT8frim5itFKKL9g5tTv4ro5pkwfJxSU1pyqe i34rfeItf+NIVNNg4HKzmlostWxe7pBSJ7s5OyTd67FVfuvQ0259XFIZijIxRXvtZ/jF j84nGVhRntzY2Di7ajfWdM39Tnig3eiPD0jfpNMBjlI+tz27A8j6eaLqhcp62vwjbxwt BkGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726924426; x=1727529226; 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=S3T7gbL3AVm6jma+KRI33LbPBGRq/Tve5339DtHt8Hc=; b=pG4vGy6BUjj1QQJTSw2G9wyTlp8VdIftQIck0TdD0JGjmo2nn7bQQ+eftFjYLkUyOY Tf5Xv5kxtP27ZxJCQ1i/GC/WHoZKo0Z/L92JOZtBdwrVmQkhmAbgXVVp7gKUoQe/qTGs C3EWdfqiREeDL9DQeKrb2FrZjTiE/rEjzCnx2021FaSMOxqDW5YxcJN2lEO2t7jgi49B q3HVwpX1Dt+4cYynSuCvcW+dRCRuxrxR0aGuZxiYJYUpyOu+dm4j6QqmRCnYaJibT+a5 nVJWb+OqXS2B+knZJtgYnBwx+ZcFRJbbIK9534p+7FjJQA6sHpcbezEt//2CsS6tem8H ZRLw== X-Forwarded-Encrypted: i=1; AJvYcCV6QKI8eXKqYlloqoaFryFmBqu62EGFCxpX/yr+zsSHnzXgim6pmoJLm4/vNrPPZO284O5eZLN3rV7jNIzkwIn/E1+B@freebsd.org, AJvYcCXFpggQN1AqnMcBgal0Ezzl+XDp1mjtEFgim2bhhWkf9GWKnFv9MQ5gt59h6t4Lu4jB1LxJOLv6sP3a/a1GD6fk+fjXiRc=@freebsd.org X-Gm-Message-State: AOJu0YzGQ0u343UuLRrgHzbuoXU32gLf0ZKD9TY48C4ZteuBpH8f0Uw4 1q/JC2QSVNTvHivorb1xtE0nnAEaR4K1wowjumI0EaI1qGB9GxTPgZjpOQOZ X-Google-Smtp-Source: AGHT+IEM2CE8jT/tU9lPkhRQtMJiXCAH+d4Jd5Mu1NWx/QuUmsirtTEQcvqAA5ekc8hUrZIKIKyZeQ== X-Received: by 2002:a05:6e02:1e03:b0:39f:6f8c:45f3 with SMTP id e9e14a558f8ab-3a0c8d25d74mr50479615ab.16.1726924426080; Sat, 21 Sep 2024 06:13:46 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d37ec21a80sm4114629173.65.2024.09.21.06.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 06:13:44 -0700 (PDT) Date: Sat, 21 Sep 2024 09:13:41 -0400 From: Mark Johnston To: "Simon J. Gerraty" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4a5fa1086184 - main - procfs require PRIV_PROC_MEM_WRITE to write mem Message-ID: References: <202409192011.48JKBCr5030825@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409192011.48JKBCr5030825@gitrepo.freebsd.org> X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::12f:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4X9qT75nVZz47Bc X-Spamd-Bar: -- On Thu, Sep 19, 2024 at 08:11:12PM +0000, Simon J. Gerraty wrote: > The branch main has been updated by sjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4a5fa1086184f7450f63d4a8e403b16f40a78fce > > commit 4a5fa1086184f7450f63d4a8e403b16f40a78fce > Author: Simon J. Gerraty > AuthorDate: 2024-09-19 20:10:27 +0000 > Commit: Simon J. Gerraty > CommitDate: 2024-09-19 20:10:27 +0000 > > procfs require PRIV_PROC_MEM_WRITE to write mem > > Add a priv_check for PRIV_PROC_MEM_WRITE which will be blocked > by mac_veriexec if being enforced, unless the process has a maclabel > to grant priv. > > Reviewed by: stevek > Sponsored by: Juniper Networks, Inc. > Differential Revision: https://reviews.freebsd.org/D46692 > --- > sys/fs/procfs/procfs_mem.c | 3 +++ > sys/kern/kern_priv.c | 4 +++- > sys/security/mac_grantbylabel/mac_grantbylabel.c | 2 ++ > sys/security/mac_veriexec/mac_veriexec.c | 1 + > sys/sys/priv.h | 1 + > 5 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c > index 6ef725ee0ee7..159b40785172 100644 > --- a/sys/fs/procfs/procfs_mem.c > +++ b/sys/fs/procfs/procfs_mem.c > @@ -41,6 +41,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -61,6 +62,8 @@ procfs_doprocmem(PFS_FILL_ARGS) > > PROC_LOCK(p); > error = p_candebug(td, p); > + if (error == 0 && uio->uio_rw == UIO_WRITE) > + error = priv_check(td, PRIV_PROC_MEM_WRITE); Why is this check here and not in proc_rwmem()? procfs isn't the only interface to this kind of functionality, and it isn't even the main one. > PROC_UNLOCK(p); > if (error == 0) > error = proc_rwmem(p, uio); > diff --git a/sys/kern/kern_priv.c b/sys/kern/kern_priv.c > index c146f9e6f8d5..83fd246eef9b 100644 > --- a/sys/kern/kern_priv.c > +++ b/sys/kern/kern_priv.c > @@ -242,7 +242,9 @@ priv_check_cred(struct ucred *cred, int priv) > * but non-root users are expected to be able to read it (provided they > * have permission to access /dev/[k]mem). > */ > - if (priv == PRIV_KMEM_READ) { > + switch (priv) { > + case PRIV_KMEM_READ: > + case PRIV_PROC_MEM_WRITE: /* we already checked candebug */ > error = 0; > goto out; > } > diff --git a/sys/security/mac_grantbylabel/mac_grantbylabel.c b/sys/security/mac_grantbylabel/mac_grantbylabel.c > index 848131e54590..4d14577820eb 100644 > --- a/sys/security/mac_grantbylabel/mac_grantbylabel.c > +++ b/sys/security/mac_grantbylabel/mac_grantbylabel.c > @@ -218,6 +218,7 @@ mac_grantbylabel_priv_grant(struct ucred *cred, int priv) > return rc; /* not interested */ > > switch (priv) { > + case PRIV_PROC_MEM_WRITE: > case PRIV_KMEM_READ: > case PRIV_KMEM_WRITE: > break; > @@ -244,6 +245,7 @@ mac_grantbylabel_priv_grant(struct ucred *cred, int priv) > if (label & GBL_IPC) > rc = 0; > break; > + case PRIV_PROC_MEM_WRITE: > case PRIV_KMEM_READ: > case PRIV_KMEM_WRITE: > if (label & GBL_KMEM) > diff --git a/sys/security/mac_veriexec/mac_veriexec.c b/sys/security/mac_veriexec/mac_veriexec.c > index 7ac09e2acf0f..490601863197 100644 > --- a/sys/security/mac_veriexec/mac_veriexec.c > +++ b/sys/security/mac_veriexec/mac_veriexec.c > @@ -435,6 +435,7 @@ mac_veriexec_priv_check(struct ucred *cred, int priv) > error = 0; > switch (priv) { > case PRIV_KMEM_WRITE: > + case PRIV_PROC_MEM_WRITE: > case PRIV_VERIEXEC_CONTROL: > /* > * Do not allow writing to memory or manipulating veriexec, > diff --git a/sys/sys/priv.h b/sys/sys/priv.h > index a61de8d32fe0..7a5773da220f 100644 > --- a/sys/sys/priv.h > +++ b/sys/sys/priv.h > @@ -513,6 +513,7 @@ > */ > #define PRIV_KMEM_READ 680 /* Open mem/kmem for reading. */ > #define PRIV_KMEM_WRITE 681 /* Open mem/kmem for writing. */ > +#define PRIV_PROC_MEM_WRITE 682 /* Open /proc//mem for writing. */ > > /* > * Kernel debugger privileges. From nobody Sat Sep 21 13:41:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9r5M6Fh3z5WZNX; Sat, 21 Sep 2024 13:41: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 4X9r5M2dTtz4DwL; Sat, 21 Sep 2024 13:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726926103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JM51pk32zZzGhQwdNP8hfBjnaV3V7Ex7jPfjW4S8JWc=; b=u5UwDL8/ZvjiDpgyRxv4edSL/eU3cX8ybq6robomsRQfAo0hFAbo940ASQe22IMQeTg5CW l5xNJ1zBd5fqd3HPpmca0pjEodpzrBwNP5WMc46waZgs3fG+SuIBcTftw/geNrvt1Bp8Q2 +K4/ensLGEtcVUFjUM6MgJVKwC4Pvv625fhw2get+73U8KJyU2rXSm3WE0aiuPwz1+W+WS pQHc1EqrICWuby+ntVN7CSoB9506QUC9t0TgvX1A/2yIhchUeDsUWKDSSVaB1gM18QFTKG huv0hqg0q8QsYBLTTGElEJTuJS8pQziZUQHszpMRDhw6szGHzMqToqvYSp24oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726926103; a=rsa-sha256; cv=none; b=klpVchU5tpSdtxMud0JWip6HZ0De8iMtJ+3I5NAC2M1XwKX9RSQluCt6sbnwDHCdjDcUxV PE9vmkdONR3gr65ux8hwWcuAEfNrBfAWS4oqy6K1jo0hMohjqi0yrBEFqEzuFTBrd9HJBi /lspd/IOXYcPioXGH5g8cYC4TB/ARl7jLwefuUcQN+OXYHqS31qljXUtquKUUaFpu761jh gZiI8LZrkbhjp3qzNFrKv6rB7asMZzkQ4vePFaJAwaISBrCv8Qu9fYnk4uY8Q2BgaSNBAX E40sv2xaiB2qM9vw/zyCdkHG9sF7LqMP6aeWCkUS54T0xIwOS90OsEmq1V0uPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726926103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JM51pk32zZzGhQwdNP8hfBjnaV3V7Ex7jPfjW4S8JWc=; b=eHjRFrpMBnOzdg6jpb48ffARvBunMEVF1J1xGchQaEdZnjMoUDtpcNQc+AKPVZs+cUT2jO cFJDh852yXDATUEbSe2wmV3Qoigbh7Zqq6XRkiDAbIhb3j3DPUbxaNTUZdYJxLhV/7jnig +2ycIyMlCyc6VIuI0sMyddAXfXHp090V6IgKqX6BvAlKf/l03XRIy3mq/QD9jhar1Dd1lR rlemDXg6NApOaAsHNdyaEtzWKFW12Fv+PjXq7q1FLaP02LJuksjIN/WJdPPh4kDTUtL+17 wifxRMr9l+SXuXgnHRibeig0BHStY92VqBfiyzrzt/rELpe2JqQZjc0CMO82cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9r5M2DxGzc4q; Sat, 21 Sep 2024 13:41: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 48LDfh5q072848; Sat, 21 Sep 2024 13:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LDfh9m072845; Sat, 21 Sep 2024 13:41:43 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:41:43 GMT Message-Id: <202409211341.48LDfh9m072845@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: 1a58fd5bf686 - main - Makefile.inc1: make pkg-create(8) compression level overridable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a58fd5bf686b30f6f6374f5923c4f935a7f4308 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a58fd5bf686b30f6f6374f5923c4f935a7f4308 commit 1a58fd5bf686b30f6f6374f5923c4f935a7f4308 Author: Evgenii Khramtsov <2khramtsov@gmail.com> AuthorDate: 2024-09-15 14:48:55 +0000 Commit: Warner Losh CommitDate: 2024-09-21 13:40:11 +0000 Makefile.inc1: make pkg-create(8) compression level overridable pkg(8) after 8991ebd7afb0 ("Fix #1566: Add pkg-create(8) -l,--level to set compression level") accepts compression level when creating packages with a compression format (e.g. txz, tzst). When compression is used (PKG_FORMAT is not "tar"), use compression level from PKG_LEVEL for pkg-create(8) to make use of 8991ebd7afb0. PKG_LEVEL default is set to pkg default to keep current behavior, see pkg(8) 31000cb40b30 ("tzst: by default compression at the 19 level). Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1420 --- Makefile.inc1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 991e9973fb04..557bbc825625 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2008,6 +2008,8 @@ KSTAGEDIR?= ${OBJTOP}/kernelstage SSTAGEDIR?= ${OBJTOP}/sourcestage REPODIR?= ${OBJROOT}repo PKG_FORMAT?= tzst +PKG_LEVEL?= -1 +PKG_CLEVEL?= ${"${PKG_FORMAT:Mtar}" != "":?:-l ${PKG_LEVEL}} PKG_REPO_SIGNING_KEY?= # empty PKG_OUTPUT_DIR?= ${PKG_VERSION} PKG_ABI_FILE?= ${WSTAGEDIR}/usr/bin/uname @@ -2155,7 +2157,7 @@ create-source-src-package: _pkgbootstrap .PHONY ${SSTAGEDIR}/src.ucl ${PKG_CMD} -o ABI=${PKG_ABI} \ -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} \ -M ${SSTAGEDIR}/src.ucl \ -p ${SSTAGEDIR}/src.plist \ -r ${SRCDIR} \ @@ -2182,7 +2184,7 @@ create-source-src-sys-package: _pkgbootstrap .PHONY ${SSTAGEDIR}/src-sys.ucl ${PKG_CMD} -o ABI=${PKG_ABI} \ -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} \ -M ${SSTAGEDIR}/src-sys.ucl \ -p ${SSTAGEDIR}/src-sys.plist \ -r ${SRCDIR} \ @@ -2225,7 +2227,8 @@ create-world-package-${pkgname}: .PHONY fi ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} \ + -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ -r ${WSTAGEDIR} \ -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} @@ -2255,7 +2258,7 @@ create-dtb-package: ${KSTAGEDIR}/${DISTDIR}/dtb.ucl ; \ ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} \ -M ${KSTAGEDIR}/${DISTDIR}/dtb.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/dtb.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ @@ -2287,7 +2290,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} \ -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ @@ -2327,7 +2330,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} \ -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ From nobody Sat Sep 21 13:42:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9r6L21gDz5WZfl; Sat, 21 Sep 2024 13:42: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 4X9r6L0Tvcz4FS5; Sat, 21 Sep 2024 13:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726926154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=auO+nt3NNBeXIpgW//RoGmqRmFn9PhYgNtY0Izo3wPI=; b=pXRBNss+ez8iX6lj37lXw3KieRnfp2A+nJ8eTCt3O0gUDzjUyBWDQalpNS2mHpWYsBNhrO 23rM3aaz5pnp9kivKhuy+ppq2OJufYX3X+LJFvBY1OMirHhEX2ctbmj466O+vP6cllIWNj xZn4DCeR4HiBed8mXVI+oJ5kJrUS0dB0DcGtYWoEyeB/4Gbnccdl63Bt6ideTm1RBi78/E M1dG+krbSeUVsdtlIECOHR0l09aoFFkwAlcX8qzluVF+RxgJmcdDl/n05bAfI9AKzytRVk XNTLRXapvDMv0Z+uq/cOAlRQsMeJYJuYRP5QMrEXJjwRFvACnfEJv9m4e3v37A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726926154; a=rsa-sha256; cv=none; b=ySBwTdINufVmrAeVHYsyEa6nK2L5XcrGwY6HJb5oYdasWXvZUYhQibV38DArAKNPqK36Sy MujBCzCSoUp8Rtn3upnfFcxEV2CUhUX7GY5wW8jnx0L4JaG5F+uWhB96oeipMFAymqs8jE Z7DsCJDXjNAcN1mOU2vC37MxyBdd+wMn7deeA5AJp8422n27SMLZvW7F0Poi+hFBI+sEcT 7rkExyyiOhwqENLWygRqgLK3Wm5rTgLrx35tg+rWYK8fXRh4C3Lc+qlZlsOusUa8cOHuFN O2LTOPVORbpIfR0Pcxi73fZOgx9Ars+uPUpaKViqG9brZIOmXvQZfHAyxtzHAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726926154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=auO+nt3NNBeXIpgW//RoGmqRmFn9PhYgNtY0Izo3wPI=; b=lyaJfFn7UyAJXot05H8/IJeH8AZEsX1MW9hnKnWhKFTw1VWaj8D3OCmPdCL1kKsG8fjsr6 MOxuZ3ExH2AK2EQGfmgqJXJTrFGmvGEFy9r1tM9yu7PA/W1sqYONMDZ0/GooDMyeeZvIDz vvWCpFq9lI8rGDNQqjE7JBGV/5i4PRGrxDPQZraUEfKQlFzmos3T/oyCw/0baD557AAsT6 Gh43fpsNou1ggdyL8XES5tbHcZsHumyZ56JQRt/Gqox/d2ODKdddxr5S0ly7+0zCNkgqud wQLXXoscsR4/8bt8eDyucat+0lbnfMDz93baM6q0th2M2llr/aEeAjdGi4FJSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9r6K6xfFzc6v; Sat, 21 Sep 2024 13:42: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 48LDgXsF078473; Sat, 21 Sep 2024 13:42:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LDgXQC078470; Sat, 21 Sep 2024 13:42:33 GMT (envelope-from git) Date: Sat, 21 Sep 2024 13:42:33 GMT Message-Id: <202409211342.48LDgXQC078470@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: 7cfdb02a73df - main - bhyve: Fix an inverted check when enabling PCI busmastering List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cfdb02a73df33d33952119c87f3e12f12778360 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7cfdb02a73df33d33952119c87f3e12f12778360 commit 7cfdb02a73df33d33952119c87f3e12f12778360 Author: Mark Johnston AuthorDate: 2024-09-21 13:15:26 +0000 Commit: Mark Johnston CommitDate: 2024-09-21 13:42:15 +0000 bhyve: Fix an inverted check when enabling PCI busmastering Reported by: Andy Fiddaman Fixes: e962b37bf0ff ("bhyve: Do not enable PCI BAR decoding if a boot ROM is present") --- usr.sbin/bhyve/pci_emul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index e066d6766f3c..b61f29aa6830 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -1160,7 +1160,7 @@ 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); - if (!get_config_bool_default("pci.enable_bars", !bootrom_boot())) + 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); From nobody Sat Sep 21 14:54:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9sjm3cZLz5XFpk; Sat, 21 Sep 2024 14:54: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 4X9sjm1x2Fz4RlM; Sat, 21 Sep 2024 14:54:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726930492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oih0vu1ypP+UAo6KseUpnfrTRrRgzfXiMfoiKKuiB6w=; b=CgqSN91nhfoSJJC9wYu1nizjAjLECT420oLmBNqn9hjilWTCEgDzpzFU9y55iKr+RS6cET S5jmCuflX9NgCWL08VjI6eAU6SybiuvdrL6J9X0o4IfZTcr1louKCJguvJ3LKnax4siOGH hzDT8GtIdaGECfGGDwz/UctlJnYUdTlhef+SS9trwQS1HKlmSF0NZZIWS9i5iEy+wmYz4P XyNa4QAyop+N0gVgqDA5nVS0xorLoiihQNE8PGNQ4Zs+4iVqFumMQjwxkpJrtB2uOZZrhA jAHney/WJxb9+VMKB+cWYGdZo+t3wMrMNxlnXT/J7hjUhKhhWVkr4Yo/3PAN0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726930492; a=rsa-sha256; cv=none; b=OF+VOWBHYuGyGofNK/DezHtWCimew1Jd3BMYqovD5d7+JDvRHHZgBPq67DC+XFQAIaNrx2 2s2xalT1cgKqRF7KIgSGl24IgYba3NMN7LRB4Rj870wdoarqETKd+uhN9vXiUA5ZltuAbk hrKQ78Hv+6SIeOhNrSRfKfItN+Vqhz7SI0aGCrJj2PrF/+dF8D05LD335z1UUV0LeMasrH tZ3nI5X5fklaIG14mEQzXdzUhcNEY+y3P9E4rULyCT/8KIatu1tE7ZiD3BzyXwPbC4MqTQ 6BlBGroKST7rmbVr6WD6RpB6stYkKPw08KYZQQWM9DThKvV3FwGp3pwG4l/YKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726930492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oih0vu1ypP+UAo6KseUpnfrTRrRgzfXiMfoiKKuiB6w=; b=hFNOUcfQktHI5qBKGilNf9hPouPisxhV0oiAIp0Eu1gUgnhExfUKNkD/o7zx89441YEy7l OzNAmUALfRd41n187gLzR0oKEJxH+AOW4SfKLC9dIzff52QYxyxN9WRZO2Px9hdyZX5zHW TbAREkzz6UhGynsJxSx75ELt8+KljbEQrdibK+V8KQdg0mpVs5qcEgjoOvUDFK3AGkua+/ uH98ysQ/P28Zg8f+hasyFLRDiQ2c5Di4QBWo5Fmq/T9wb9c4tpNZg6EYaw4lUZiGiaRSG6 SoBDGDWkjZTKT5ghu0mRXqac5V21dhsEYbWwMT2dqCIZYeY5+bTRia4WhTk35Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9sjl74przdlv; Sat, 21 Sep 2024 14:54: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 48LEspbf096760; Sat, 21 Sep 2024 14:54:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LEspIJ096757; Sat, 21 Sep 2024 14:54:51 GMT (envelope-from git) Date: Sat, 21 Sep 2024 14:54:51 GMT Message-Id: <202409211454.48LEspIJ096757@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: e47939b3b110 - main - hn: fix build on !x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e47939b3b110689b63bb14d0cf9f55ace4c7a8a2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e47939b3b110689b63bb14d0cf9f55ace4c7a8a2 commit e47939b3b110689b63bb14d0cf9f55ace4c7a8a2 Author: Warner Losh AuthorDate: 2024-09-21 13:54:32 +0000 Commit: Warner Losh CommitDate: 2024-09-21 14:53:47 +0000 hn: fix build on !x86 hv_netvm aren't installed on !x64. Do the canonical thing with the links. Fixes: 83e93d53f674 Sponsored by: Netflix --- share/man/man4/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index d8d90f092083..e2448660a112 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -713,8 +713,8 @@ MLINKS+=gpioths.4 dht11.4 MLINKS+=gpioths.4 dht22.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hpet.4 acpi_hpet.4 -MLINKS+=hv_netvsc.4 hn.4 \ - hv_netvsc.4 if_hn.4 +MLINKS+=${_hv_netvsc.4} ${_hn.4} \ + ${_hv_netvsc.4} ${_if_hn.4} MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=${_attimer.4} ${_i8254.4} MLINKS+=ip.4 rawip.4 @@ -838,6 +838,7 @@ _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 _ftgpio.4= ftgpio.4 _ftwd.4= ftwd.4 +_hn.4= _hn.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 @@ -853,6 +854,7 @@ _hwpstate_intel.4= hwpstate_intel.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 _if_bxe.4= if_bxe.4 +_if_hn.4= if_hn.4 _if_nfe.4= if_nfe.4 _if_urtw.4= if_urtw.4 _if_vmx.4= if_vmx.4 From nobody Sat Sep 21 15:26:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9tQY0dJfz5Whcx; Sat, 21 Sep 2024 15:26:45 +0000 (UTC) (envelope-from scf@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 4X9tQX4v6lz4XkJ; Sat, 21 Sep 2024 15:26:44 +0000 (UTC) (envelope-from scf@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726932404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h3MZgPaxwALvw2LuktFSWj10f5KAdmN4mUKX3z2L0U8=; b=HkGiMrOvx2CqK4nFU9IGa8XeA/Rw+9Pt+2xwhI3hdRGFiqWOgChmmaQMkYZP9BhgvIgg1Z 6fuNIwlJprU6b+U1PqJc3uXp9EM/0jjWyLjnxjT4qFUStz65/4Bb/ICDKiys9DJRPgtB6J llZvtIYzuNjwLAq8EUrp6W1cyiIFNKKzZ7fMw2rYk7Q4wuBdq9yHmXkOHusV8AR3bJMpgu zjsZ8X8CZydkfNbNpU9+I+WXtkrww6xdKO6mBnoEFLZy515+R7Gw6rEFtPIt6Q5jth9gty CL9kujZiHplF/q879fmNzhzkl8yFVqwgCHvSovFjmH+IbNYJxEdPBhlsZuEjGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726932404; a=rsa-sha256; cv=none; b=eLenwPXUYEwEzefuwjy1Do1KD59gab0VLC0zFZ9TZQo5s0mnL5NLeiJdDj3i7okINSmlvQ OLNR2/U5ilwVZVKMN+7243Uj8tCDMGLxkp8LRkmc6KXZ1qy7Nwc6JJS7jnLKnUlX3kKdPA uoldk4BM4BSENqfpMuTDgKsJ/gL4BZna13jg6CgOLtDmfW4cr0AOfNPRwYruFvGLa3Rig0 Ed8wMicunwCoKWbByslKb5hTgGcu9vjLqxzGQhqLjvRaY2rcPlrf00HCSxiXKz7AIBboMg K7iAS44s1EMH1NV6ZxZyN3PpUdD9W/bwWrIy2ILtmGIsAjkl/d36y7WY9XsdMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726932404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h3MZgPaxwALvw2LuktFSWj10f5KAdmN4mUKX3z2L0U8=; b=exPNPtQEjHdfZl6yGeRCPFSkqqbZe8aQNfVMhdwWiIfMre84Rgbs550xWKjgq4wb9yX3+K MkY1u7aCvLTCP95VApP0hdKyAAKuusfSKb2MxyHimZpAdxJBWsl+DiuIqFeu3VcOX8axRN 1atctBkwjrTdgcydilNQWlO+8EbF2d9Mn2C7mY4uBNKAsx0/K6aGjM5ctwbO+TlfXXbJaH RKjdvApJ3GyjuLOMJ9lPdZp05TCSk5CkIe2HSCzNe3EOm6QvUidIoWn+RqLPxuWru78DWc yBUEiKd/WdpVAcrQLgQjoHdDhCvk02+p09T1gYgU1HmH3EF0+bREMe737zDDUw== Received: from thor.farley.org (1609341-v107.1360-static.crmlinaa.metronetinc.net [104.254.222.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: scf/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X9tQX2Zb6z132F; Sat, 21 Sep 2024 15:26:44 +0000 (UTC) (envelope-from scf@FreeBSD.org) Date: Sat, 21 Sep 2024 11:26:26 -0400 (EDT) From: "Sean C. Farley" To: Ed Maste cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 06a6d0259fe5 - stable/14 - Revert "tzsetup: symlink /etc/localtime instead of copying" In-Reply-To: <202409211110.48LBAYx0015310@gitrepo.freebsd.org> Message-ID: References: <202409211110.48LBAYx0015310@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Sat, 21 Sep 2024, Ed Maste wrote: > The branch stable/14 has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=06a6d0259fe5721bfb3b745b231ecf7cf3a5e28e > > commit 06a6d0259fe5721bfb3b745b231ecf7cf3a5e28e > Author: Ed Maste > AuthorDate: 2024-09-21 11:06:02 +0000 > Commit: Ed Maste > CommitDate: 2024-09-21 11:06:39 +0000 > > Revert "tzsetup: symlink /etc/localtime instead of copying" > > This failed when used with tzsetup's -C option (for example, when using > etcupdate -D to update a jail from the host). Revert the stable/14 MFC > for now; will be reapplied after being fixed in main.. > > This reverts commit fc43a1b6842afa806dfd7ba48de5bece63d04456. > This reverts commit 87f7f0389f8b7bf30ef12df5c0d337cb2789883e. Thank you! Sean -- scf@FreeBSD.org From nobody Sat Sep 21 17:03:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9wZ10qRCz5XVLZ; Sat, 21 Sep 2024 17:03:21 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9wZ05pb8z4pnx; Sat, 21 Sep 2024 17:03:20 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726938200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kiN2FyIFJYGKfqNz53IYBuvh+la2OtmN+CvYY6TRn58=; b=tIjWxOi0UOug4TyWB2+mISKHVt5lUEmwXq7LR9UhK+ZeKYFU2XQEGe0N1hrk8I5mJ4oxM/ FcVgJAuE9+dO8wHyY4BObwG/IidtvpABl94PpYP1LjEAcYKXtg2yiv7/AKz2Uzz89bjLd0 Fax8HhY46usWA50p/eMvYBT2a1IXc/WNPXaaVOpXCeiY4pbWlbP+XbyDqywAofgxdV/1xa gCj2Bhc4oM+gb68soTWF5s2oUPlmirf9/wKd+DxK6gSolKvN/Ut6u1th2wUNuQf7aFo97I +dTyHkiKy2kg7wx7RHxt9WEQK1XUXa1x63dgNmGCy0gom8Dkv0q6ghcNMWyX+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726938200; a=rsa-sha256; cv=none; b=AXSIE+MFeIY/KdQjNcnAC4A+FiUP3wcJIECXgCxC720wU0K9S4R6CuOtE1tt24kH8EwcfJ 4FvwQR78WaRE+/BMLnwaOvgjY1brFDzs6wPXtVqtjUN3QCUZkJqkUxlub4DAGVeaft+zJJ TFCEBsFaiKk1THWBqVAgxD0Cq42Ao5cp+NIxn2tN9biS650SUN5dgJaqgNaYiI/OQFBkec lLyfU8zXR3kc368jfT5zX/+UvXGcpDyJ+xUin+OO1RaPTxIoOjF3P3mxt5xeTzoVSouxH4 0pEl59Wf8kp2Ao0OsDuYFa7rFajt4nB40VPKlWJJpEVJTu6sB1fxjEEog7jimg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726938200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kiN2FyIFJYGKfqNz53IYBuvh+la2OtmN+CvYY6TRn58=; b=nOlrM8E2/ZUEnAwiWL/23Y7P0//joo0RKD85oA/N0g1KdK8s56lOln8yDF3jLKM5M1mSrl lcxBc1g7/getewrUVLTsos4LGepEt0GkBrkpwY0kaJhsBRehkOiQSmtG8mP/FprbpS3n1l t82Sc3q1dAqo36ZTSitqI4A9EepGf8nFW6B3NpzMtT/88abYR8X+YlV+Put8VpKQpqXqRx pBWrjpcoHmLiNjswYaVUudyA7RsFwNzDfgO1kL0a8qQJF641GlO6IN9UJVnUzGZU4tc27u mEVtAXdUpLPH1AvtgrPK7w8+5J0WS1mlZRnjJKDESgFfLBR8rdrLbjnwzOQ0Bw== Received: from ltc.des.dev (unknown [91.174.26.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X9wZ04XcCz15gZ; Sat, 21 Sep 2024 17:03:20 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id A6629BF117; Sat, 21 Sep 2024 19:03:18 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a52b30ff98cd - main - sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf In-Reply-To: (Konstantin Belousov's message of "Sat, 21 Sep 2024 15:49:53 +0300") References: <202409202109.48KL9RZ1078677@gitrepo.freebsd.org> <867cb5z2c3.fsf@ltc.des.dev> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 21 Sep 2024 19:03:18 +0200 Message-ID: <86y13lx7l5.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Konstantin Belousov writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Konstantin Belousov writes: > > > commit a52b30ff98cdab82af140285fa7fcdf1036fef27 > > > > > > sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf > > >=20=20=20=20=20 > > > Tested by: yasu > > > Sponsored by: The FreeBSD Foundation >> > MFC after: 1 week > > This appears to be the opposite of the patch which you posted on > > -current and which yasu@ tested [...] > Before committing anything, I did a self-review and remembered that I > have did a lot of considerations when implementing swap accounting and > decided that ruid is the right target for charge. > > Besides stating the obvious fact above, what do you expect me to answer/ > react to your mail? My point is that the commit message claims the patch was tested by yasu@ when in fact it wasn't. If you're convinced that this is the correct solution then that's fine, and it does appear to work, but don't claim that it's been tested by others when it hasn't. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sat Sep 21 17:37:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9xKb3qDhz5XhJ5; Sat, 21 Sep 2024 17: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 4X9xKb0y13z3xY2; Sat, 21 Sep 2024 17: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=1726940259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXroMXPE7qO/pNkxV9oZOU79OBO3S6pOi7DdBd46Vb0=; b=hqbzPZXZj954Y3XUnKK6lCew6JHdO3Fou52IPezXTHUCQ1ump7JLCmAvKAX2h/Eq/ka9i1 JRRVTafGrjPPN2R3tXDs1QEHIcWbXN9F39+GxpW7tzvDZjSCs5Og9Q7xUsZMhSuELQBDCk rpumWewg02Wa4vINnhl59bVcJAjtuTLEgQ7/1xTYlgNtPGyvuuxFyR0acj9GUU7m0TNfir nfHolxXQWeoDo+dIx8zshZ9bbjs89leocA9h2yvOsLucA3mieAW5pBCUYRYaHJ2pSG5tEd R/o3e3w/mGbCdDbpHBB86MEa+xIWRQx74vWx0iQHoIdplKf897RfbWdiUZn1XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726940259; a=rsa-sha256; cv=none; b=i9xp0veUQ76dOBIQHGJ+JZ5s02vqYpACnsDtARNXHWE01xYGDhfr2Zw9oV42O7vZao5Aky 9VzCcbYQKP2YD0Esbu5bh2/cmpC/jsmDF0dxEUN41RQEf345/AjmQpg8ReGalTElafhMTv BbXBD/EhG0glaIjEsE998qpXsdrWyqmuvIEHZnp0ZkjDDegC/ruSxb/57B3E9upTGWq0mF EcHx4RVc8dw1pVyaPwUX2UIddbCeFpElGa8LZ16fTysmXnv5HQ+Nywa6uN86hav/oL+3Yf 0BJfqYaGi9ZUlajkw/FUcb3u3pudD6CwoysHf8CD8GXykt7DKVs3jJWQSKfQbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726940259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXroMXPE7qO/pNkxV9oZOU79OBO3S6pOi7DdBd46Vb0=; b=j2e4rvlrBrCQj9o5WTUc1xywI4jTaM3lLozj4MlqFOvk3KVsIYUY6FsvLqmh4NjN0r+I9O lxCqHR+x0k8vk71nUPVMgBONIWZHcG1xVf8QZUJln23xiJ8yZ0a/B0vku2AIysBB4d5Cmh zQRlMaWE4Xr4PrMSffXkZKAUQi0J0aMshg0k92UftGod9FS7+6cds1dLaODX7umast43/c 9LhQv429KKZhYXFF7MU1Hp4CD+1iWD/u5ZZU3nPCpy7dMc58ka3JZnHoZTfoBBQAv4ILbn /D6uhqyq8TGXLlwDsEXLS2wfepqTpCjmfgEFH5U7dxCj3wIYoSv1lqC50PI+mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9xKb0D1Pzj5B; Sat, 21 Sep 2024 17:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LHbcjI070430; Sat, 21 Sep 2024 17: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 48LHbcks070427; Sat, 21 Sep 2024 17:37:38 GMT (envelope-from git) Date: Sat, 21 Sep 2024 17:37:38 GMT Message-Id: <202409211737.48LHbcks070427@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: f505f9a842eb - main - bhyve: simplify slot validation in xHCI emulation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f505f9a842eb3e75e16e6c7c6f67d5b592b1bc65 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f505f9a842eb3e75e16e6c7c6f67d5b592b1bc65 commit f505f9a842eb3e75e16e6c7c6f67d5b592b1bc65 Author: Pierre Pronchery AuthorDate: 2024-09-18 18:52:04 +0000 Commit: Ed Maste CommitDate: 2024-09-21 17:36:10 +0000 bhyve: simplify slot validation in xHCI emulation This is a follow-up to commit e72d86ad9c62 ("bhyve: improve input validation in pci_xhci") -- introducing a helper for slot validation. Co-authored-by: John Baldwin Reviewed by: markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46696 --- usr.sbin/bhyve/pci_xhci.c | 90 +++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 58 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 2399cb4fc9b8..5b21361f2823 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -348,6 +348,7 @@ static void pci_xhci_update_ep_ring(struct pci_xhci_softc *sc, struct pci_xhci_dev_emu *dev, struct pci_xhci_dev_ep *devep, struct xhci_endp_ctx *ep_ctx, uint32_t streamid, uint64_t ringaddr, int ccs); +static int pci_xhci_validate_slot(uint32_t slot); static void pci_xhci_set_evtrb(struct xhci_trb *evtrb, uint64_t port, uint32_t errcode, @@ -849,17 +850,14 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) DPRINTF(("pci_xhci disable slot %u", slot)); - cmderr = XHCI_TRB_ERROR_NO_SLOTS; - if (sc->portregs == NULL) + if (sc->portregs == NULL) { + cmderr = XHCI_TRB_ERROR_NO_SLOTS; goto done; + } - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; - goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } dev = XHCI_SLOTDEV_PTR(sc, slot); if (dev) { @@ -867,7 +865,6 @@ pci_xhci_cmd_disable_slot(struct pci_xhci_softc *sc, uint32_t slot) cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; } else { dev->dev_slotstate = XHCI_ST_DISABLED; - cmderr = XHCI_TRB_ERROR_SUCCESS; /* TODO: reset events and endpoints */ } } else @@ -886,19 +883,16 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) uint32_t cmderr; int i; - cmderr = XHCI_TRB_ERROR_NO_SLOTS; - if (sc->portregs == NULL) + if (sc->portregs == NULL) { + cmderr = XHCI_TRB_ERROR_NO_SLOTS; goto done; + } DPRINTF(("pci_xhci reset device slot %u", slot)); - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; - goto done; - } dev = XHCI_SLOTDEV_PTR(sc, slot); if (!dev || dev->dev_slotstate == XHCI_ST_DISABLED) @@ -928,8 +922,6 @@ pci_xhci_cmd_reset_device(struct pci_xhci_softc *sc, uint32_t slot) ep_ctx->dwEpCtx0 = FIELD_REPLACE( ep_ctx->dwEpCtx0, XHCI_ST_EPCTX_DISABLED, 0x7, 0); } - - cmderr = XHCI_TRB_ERROR_SUCCESS; } pci_xhci_reset_slot(sc, slot); @@ -953,8 +945,6 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, islot_ctx = &input_ctx->ctx_slot; ep0_ctx = &input_ctx->ctx_ep[1]; - cmderr = XHCI_TRB_ERROR_SUCCESS; - DPRINTF(("pci_xhci: address device, input ctl: D 0x%08x A 0x%08x,", input_ctx->ctx_input.dwInCtx0, input_ctx->ctx_input.dwInCtx1)); DPRINTF((" slot %08x %08x %08x %08x", @@ -972,13 +962,9 @@ pci_xhci_cmd_address_device(struct pci_xhci_softc *sc, uint32_t slot, goto done; } - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; - goto done; - } /* assign address to slot */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1042,17 +1028,11 @@ pci_xhci_cmd_config_ep(struct pci_xhci_softc *sc, uint32_t slot, uint32_t cmderr; int i; - cmderr = XHCI_TRB_ERROR_SUCCESS; - DPRINTF(("pci_xhci config_ep slot %u", slot)); - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; - goto done; - } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1175,15 +1155,9 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_softc *sc, uint32_t slot, DPRINTF(("pci_xhci: reset ep %u: slot %u", epid, slot)); - cmderr = XHCI_TRB_ERROR_SUCCESS; - - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; - goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1272,15 +1246,9 @@ pci_xhci_cmd_set_tr(struct pci_xhci_softc *sc, uint32_t slot, uint32_t cmderr, epid; uint32_t streamid; - cmderr = XHCI_TRB_ERROR_SUCCESS; - - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; - goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } dev = XHCI_SLOTDEV_PTR(sc, slot); assert(dev != NULL); @@ -1362,7 +1330,6 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, islot_ctx = &input_ctx->ctx_slot; ep0_ctx = &input_ctx->ctx_ep[1]; - cmderr = XHCI_TRB_ERROR_SUCCESS; DPRINTF(("pci_xhci: eval ctx, input ctl: D 0x%08x A 0x%08x,", input_ctx->ctx_input.dwInCtx0, input_ctx->ctx_input.dwInCtx1)); DPRINTF((" slot %08x %08x %08x %08x", @@ -1380,13 +1347,9 @@ pci_xhci_cmd_eval_ctx(struct pci_xhci_softc *sc, uint32_t slot, goto done; } - if (slot == 0) { - cmderr = XHCI_TRB_ERROR_TRB; - goto done; - } else if (slot > XHCI_MAX_SLOTS) { - cmderr = XHCI_TRB_ERROR_SLOT_NOT_ON; + cmderr = pci_xhci_validate_slot(slot); + if (cmderr != XHCI_TRB_ERROR_SUCCESS) goto done; - } /* assign address to slot; in this emulation, slot_id = address */ dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1723,6 +1686,17 @@ pci_xhci_update_ep_ring(struct pci_xhci_softc *sc, } } +static int +pci_xhci_validate_slot(uint32_t slot) +{ + if (slot == 0) + return (XHCI_TRB_ERROR_TRB); + else if (slot > XHCI_MAX_SLOTS) + return (XHCI_TRB_ERROR_SLOT_NOT_ON); + else + return (XHCI_TRB_ERROR_SUCCESS); +} + /* * Outstanding transfer still in progress (device NAK'd earlier) so retry * the transfer again to see if it succeeds. From nobody Sat Sep 21 20:51:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB1dC3YNYz5VbH8; Sat, 21 Sep 2024 20:51:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XB1dB5rxDz4bkB; Sat, 21 Sep 2024 20:51:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 48LKpIA0000071; Sat, 21 Sep 2024 23:51:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 48LKpIA0000071 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 48LKpHUv000070; Sat, 21 Sep 2024 23:51:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Sep 2024 23:51:17 +0300 From: Konstantin Belousov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a52b30ff98cd - main - sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf Message-ID: References: <202409202109.48KL9RZ1078677@gitrepo.freebsd.org> <867cb5z2c3.fsf@ltc.des.dev> <86y13lx7l5.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86y13lx7l5.fsf@ltc.des.dev> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4XB1dB5rxDz4bkB X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, Sep 21, 2024 at 07:03:18PM +0200, Dag-Erling Smørgrav wrote: > Konstantin Belousov writes: > > Dag-Erling Smørgrav writes: > > > Konstantin Belousov writes: > > > > commit a52b30ff98cdab82af140285fa7fcdf1036fef27 > > > > > > > > sys_pipe: consistently use cr_ruidinfo for accounting of pipebuf > > > > > > > > Tested by: yasu > > > > Sponsored by: The FreeBSD Foundation > >> > MFC after: 1 week > > > This appears to be the opposite of the patch which you posted on > > > -current and which yasu@ tested [...] > > Before committing anything, I did a self-review and remembered that I > > have did a lot of considerations when implementing swap accounting and > > decided that ruid is the right target for charge. > > > > Besides stating the obvious fact above, what do you expect me to answer/ > > react to your mail? > > My point is that the commit message claims the patch was tested by yasu@ > when in fact it wasn't. If you're convinced that this is the correct > solution then that's fine, and it does appear to work, but don't claim > that it's been tested by others when it hasn't. The main part of the patch was to ensure consistency in updates: it must be either always uidinfo, or always ruidinfo. Which one specifically would affect the limit's semantic, but not the buggy behavior you reported. From nobody Sat Sep 21 21:17:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB2C95gdhz5VmD1; Sat, 21 Sep 2024 21:17: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 4XB2C94s1Pz4gsW; Sat, 21 Sep 2024 21:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726953445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16RnEqNykkX5kJpwEY8LUONSQsQqfFPp9XzxEKv+I1o=; b=aGmIlGpZAz8EdJD02OJsrh9FNcVE/95IhDw6lGHyYAjn/okEqu+EbrzkKT0LWek97h5yJG s/S2k9561AzvkNJn3kmHA677g8eDuVpWAI99AAi5+KHHnz8REQVkRphC3mnidpXkcCXA7J qNM7C0OSsZ9vGI+jsnBoOeNe0y+kxHK6MDBEWClhk4bg2av6Cv6bAEHkHh9XnRcUGk8Nv7 YH7En02pQCEJJJDWsam7YR/PjGA83c/3OZ2Uxaqj5c4cIV9dMGtlFL2EV0Z0xPQOqEC3hs 9Kp71fhYkTWAHF+B5p1ZWxY/ehrNBz8S/XaqfU8ZG4uenI7EGvfz4NnnaMEzlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726953445; a=rsa-sha256; cv=none; b=iLjfpOqoqy9wIAMYDMgi7IA7w6CxASeHjdyo0aDVZ1fcgMpfb4wRsS5F4LURhpscUTyPIf lsnlCbcwyh5oPMfOxQmoPfGlR3lWpb+cy0eIM6py7iC0lMlaAM0e3imJ3jZU3vAbcPGC3X P9QiY3B5+6je9tNO/xm2Yt3MCJwUjIdlu1h5+KJiYz637osCrqaZ4roIVFeXcW8lA9pspa HXLpY1SPuGFmEEyoYCvcopZ9N4xeQpLNU2d6J3M96K48VnwgbEBsxsXwO2KHDeceL53vob ismDNLQmHQNM3kh3vu//JkSiS4NLS79HhsMN19JbAqm4FLOZ0CkglsTzULKrmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726953445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16RnEqNykkX5kJpwEY8LUONSQsQqfFPp9XzxEKv+I1o=; b=YU1eszILNRTWg7KmHDkoyLrN6wLjQ2PBKP0oQ1ma5FqMF6PnOPkVSo1ZLhC4Rsv//7VQL2 5FAy+xDVSR1WCXESG9r+1/Wr6PIRCQcZOncXMXLbfv2TCAm9EOMbNj+mlEVuQsbTzVYhhs rqPYyDD1m1VvqmM5r9h0aFAhXcwoE1NF6EkAic0aA4I9C/+4E12I9jhFDU2IFHVrVPUk3V R2IeBcbRUil/NPwIK/1X155x31iTQaDEWXnCAsSRsubD8xkVjQy46smmH5NPAS5ZZF6dT/ 0r8wGmwET0yjUM2cWJfc6vlFtvXGJihcxvRR+ZmalcCfQR7py2C/4/GTAJ8duw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB2C945xPzqBJ; Sat, 21 Sep 2024 21:17: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 48LLHP7S043510; Sat, 21 Sep 2024 21:17:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LLHPQr043507; Sat, 21 Sep 2024 21:17:25 GMT (envelope-from git) Date: Sat, 21 Sep 2024 21:17:25 GMT Message-Id: <202409212117.48LLHPQr043507@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: 32b0830aa030 - main - conf: make ZFS depend on XDR sources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32b0830aa03035fd06efa9da917ec6b7c3c65310 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=32b0830aa03035fd06efa9da917ec6b7c3c65310 commit 32b0830aa03035fd06efa9da917ec6b7c3c65310 Author: Siva Mahadevan AuthorDate: 2024-09-21 19:43:02 +0000 Commit: Warner Losh CommitDate: 2024-09-21 21:15:33 +0000 conf: make ZFS depend on XDR sources ZFS nvpair.c source file depends on XDR unconditionally. This fixes the ZFS build with NFSD kernel options disabled. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1429 --- sys/conf/files | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 9cb22af79ade..cb288bc8a5bc 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -5296,9 +5296,9 @@ xen/xenbus/xenbusb.c optional xenhvm xen/xenbus/xenbusb_front.c optional xenhvm xen/xenbus/xenbusb_back.c optional xenhvm xen/xenmem/xenmem_if.m optional xenhvm -xdr/xdr.c optional xdr | krpc | nfslockd | nfscl | nfsd -xdr/xdr_array.c optional xdr | krpc | nfslockd | nfscl | nfsd -xdr/xdr_mbuf.c optional xdr | krpc | nfslockd | nfscl | nfsd -xdr/xdr_mem.c optional xdr | krpc | nfslockd | nfscl | nfsd -xdr/xdr_reference.c optional xdr | krpc | nfslockd | nfscl | nfsd -xdr/xdr_sizeof.c optional xdr | krpc | nfslockd | nfscl | nfsd +xdr/xdr.c optional xdr | krpc | nfslockd | nfscl | nfsd | zfs +xdr/xdr_array.c optional xdr | krpc | nfslockd | nfscl | nfsd | zfs +xdr/xdr_mbuf.c optional xdr | krpc | nfslockd | nfscl | nfsd | zfs +xdr/xdr_mem.c optional xdr | krpc | nfslockd | nfscl | nfsd | zfs +xdr/xdr_reference.c optional xdr | krpc | nfslockd | nfscl | nfsd | zfs +xdr/xdr_sizeof.c optional xdr | krpc | nfslockd | nfscl | nfsd | zfs From nobody Sat Sep 21 21:19:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB2FJ433Cz5Vnfg; Sat, 21 Sep 2024 21:19: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 4XB2FJ2nr0z4hXv; Sat, 21 Sep 2024 21:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726953556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZRW+Lj+nDIyZgAT1cUhg3o5DXEFdKOmir5yveFA5QQs=; b=Zd/FvWjt5sEPevIUx0OPiZlcz+bjGcr8BLCiFWx/jZV5n9JzYV+1TeQ9FQaExYE8rcdndY 6GC2cg+sxMNMAw1+Fsj5K04lx1Y8/T4Klwy4rbILJAVxViapvwAWCJN2YtHazQMJzGObPL OqYm2OHMjahujS2gp6d0cONt+KDlYSXFHZYvQW7vwYyVSpWsk3k1KJFVXU7P+rU+A46css 3x9F8bW3EARx2nsfpuVLKxUwp9icQSpPAg0dSm3/Jhs0uzhAjzR37O/qE5cH2KEwMYgVGF LfVxNWBJnF7Q0f/AQmrV7dKpFmrTDoq15j+oeUQ7W40/AvkFBkfEPgrReNQklg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726953556; a=rsa-sha256; cv=none; b=J1NjZAQcZFLLkfzcbcvZ4De/42x4A8AmQIO23IQUlkHkWG7mn/fARMO6luqJLq3HQUTZDF E+2rGHIqer7XpwAJBuonYtrv6dFf5fY72Q3KvEUhyt0E+sXRd1tKhqabbUgKmZElblegcv BAudhobDB4PbUyzQzag0wuPaGyhzTwNfQjIR6Ajw3OUGDvHNPp6TC2zmEvKLkRJv95xYRT WLo7Ebnj8C66ZumMby7TI42XSJWWloBmuXpu71UOzpddrKq3LweMxa4JjP8PZyhDd/zPTL VhRlYM8gMELmMpXKaeA+7dmeFUdEVp94fUAIffPgVGyninR29n4YeoQWZj+TNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726953556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZRW+Lj+nDIyZgAT1cUhg3o5DXEFdKOmir5yveFA5QQs=; b=jZK2RSxC6hltyVqfK9naPTHeAaU67iDavYKZDRSLYUe4jw+7BqKLh6rOu5ZIlnlFHN1EWp sqsZe2MmpYHh0XoKWiSuvzZAZmDFWe+iofTFd0a3ehUTZuhbryeNycFryqQPwMfmpLK+4i oWMw0Zj9QiXSwwmecX7XO2Djcldp4o/UmZAOqxXj2Xi9iC/aDT+uyt/I1QGF98e1zR0Tih ZEtROsghm+uEJuccpQbpPwoHHQKkBgafxjlVf+J1hTTeizyMUYK5gHUd/QtbVouMo1qHJ/ hkQiypd2foFzDgoknGB5DmixLoaQ+vAIhaIUEPDka3aPyCeCmmSrIZ5LLsSM4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB2FJ2P9NzpbH; Sat, 21 Sep 2024 21:19: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 48LLJGjn043923; Sat, 21 Sep 2024 21:19:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LLJGiT043920; Sat, 21 Sep 2024 21:19:16 GMT (envelope-from git) Date: Sat, 21 Sep 2024 21:19:16 GMT Message-Id: <202409212119.48LLJGiT043920@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: 66fcbd9556b0 - main - VOP_ATTRIB.9: switch to Fa/Fc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66fcbd9556b0053253a945638ae360ffc9040c82 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66fcbd9556b0053253a945638ae360ffc9040c82 commit 66fcbd9556b0053253a945638ae360ffc9040c82 Author: Konstantin Belousov AuthorDate: 2024-09-20 07:24:26 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-21 21:18:55 +0000 VOP_ATTRIB.9: switch to Fa/Fc Sponsored by: The FreeBSD Foundation MFC after: 3 days --- share/man/man9/VOP_ATTRIB.9 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/share/man/man9/VOP_ATTRIB.9 b/share/man/man9/VOP_ATTRIB.9 index a3bf2c0f8898..d7c55bd683d8 100644 --- a/share/man/man9/VOP_ATTRIB.9 +++ b/share/man/man9/VOP_ATTRIB.9 @@ -37,12 +37,26 @@ .In sys/param.h .In sys/vnode.h .Ft int -.Fn VOP_GETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred" +.Fo VOP_GETATTR +.Fa struct vnode *vp +.Fa flags +.Fa struct vattr *vap +.Fa struct ucred *cred +.Fc .Ft int -.Fn VOP_SETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred" +.Fo VOP_SETATTR +.Fa struct vnode *vp +.Fa struct vattr *vap +.Fa struct ucred *cred +.Fc .Ft int -.Fn VOP_STAT "struct vnode *vp" "struct stat *sb" "struct ucred *active_cred" \ -"struct ucred *file_cred" +.Fo VOP_STAT +.Fa struct vnode *vp +.Fa struct stat *sb +.Fa flags +.Fa struct ucred *active_cred +.Fa struct ucred *file_cred +.Fc .Sh DESCRIPTION These entry points manipulate various attributes of a file or directory, including file permissions, owner, group, size, From nobody Sat Sep 21 22:56:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB4PB68Yxz5XS75; Sat, 21 Sep 2024 22:56: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 4XB4PB2N5jz539k; Sat, 21 Sep 2024 22:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726959374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4euioem/t++rkWqtUlX6FvCNwh/boaJclsWQ9vDu1Q=; b=IfGYgF1kaRpMJmDVD+cwQscl5DqY7RSQ+GvogOpyjE1PcbXhidwB5fpkk+giCjN3AK67+f Ymmq2WhR+usDRB6mKm9HqUzYsicrN+oJh+DCmhnld39OdqN56K7EUJQXxyeJhngNH6czYy OLqFpErkDUFVpGCeBvejjgvdCqQ29GzXTcM9RpVwu1pJ92Ap4S+iK5WYyXhjLzrUj9ywPd 5MlOBcTA5mAUJO8yB7ccTIXwfXIAduxRKaRfdENWP87bYdFMXtRQgForDhWf4ej7NloRlr mWQypJeU13RcoSprt6qW3UOnBVBlnKCjRn/GR3O9nCtCK5oO41wQpEFVW7lcfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726959374; a=rsa-sha256; cv=none; b=BFFneJuxaf3P8lUnvYICvcyfnQX+B2HYYikv06Il6DEVzEcs+P+lw7FE0rlxEszlgt+Igi Ka/h+jrF+58c3UF5qVQMzLCAGZdlqXyuw9aHiLSJ4bSSTICBUJc2Gwk8mPS85CjWdrwQGz Q5v3zZ0UfwYv3jzOOw9oWx0Y7ngiDtnpZiymLwp25g2JlfENJ+u/8aROS90LQaRYgz6/7R 9CiHyD43lfjY/SOy+2I5PY6kZh5q08SqOzgeyFhIb2tshHh+9BOjFSmM+6wYVw5atSiQU2 ekFekfzoqIK+XrJH4ZEVk4+XuT00tEVWfQ7qW4dArZD7j9rs3FhOezaRB3Hm2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726959374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4euioem/t++rkWqtUlX6FvCNwh/boaJclsWQ9vDu1Q=; b=K5UWalrgLzDb18oMluuo6NKjYSmRrZvkeQ8KtZvN/R2ybysCeOeF+YxL0zcUFGNd17pzxJ 4JAtffIWUewdBqm4KcN/Wf61nOIkXyuXKSyfTTS91j8oRks4ad/WbertHQyWu3MvCmVs6K Q+8FpWobLdZ1mrRQoky5QfaJD6tKKcVLYrJEZSaRTYtdHd8qBPumkOiu+Y+2+vaeLaei9t 2O4vWvRUWPPo20gBKVtE36OhvyT1neslFn/2x6psbcfcOknX1PRXpXRg+kZDtK+Qk5chy2 FSAbOHxcK8t6KLHwkem76OC5MmT+gF6ximozkyJD343c3kIMFZ4XOn9tNIpeKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB4PB1yP1zsNb; Sat, 21 Sep 2024 22:56: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 48LMuE07012201; Sat, 21 Sep 2024 22:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LMuE1d012198; Sat, 21 Sep 2024 22:56:14 GMT (envelope-from git) Date: Sat, 21 Sep 2024 22:56:14 GMT Message-Id: <202409212256.48LMuE1d012198@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: 93e96359c980 - main - libpfctl: ensure we return useful error codes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93e96359c980ccf318fe089b30b863f7c910b622 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=93e96359c980ccf318fe089b30b863f7c910b622 commit 93e96359c980ccf318fe089b30b863f7c910b622 Author: Kristof Provost AuthorDate: 2024-09-20 09:36:22 +0000 Commit: Kristof Provost CommitDate: 2024-09-21 22:55:46 +0000 libpfctl: ensure we return useful error codes Return errno rather than -1 on error. This allows pfctl to report much more useful errors. Reported by: Alexander Leidinger MFC after: 1 week --- lib/libpfctl/libpfctl.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 11984a301336..c8eeb913e912 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -2164,8 +2164,12 @@ pfctl_clear_rules(int dev, const char *anchorname) ret = ioctl(dev, DIOCXBEGIN, &trans); if (ret != 0) - return (ret); - return ioctl(dev, DIOCXCOMMIT, &trans); + return (errno); + ret = ioctl(dev, DIOCXCOMMIT, &trans); + if (ret != 0) + return (errno); + + return (0); } int @@ -2199,9 +2203,14 @@ pfctl_clear_nat(int dev, const char *anchorname) ret = ioctl(dev, DIOCXBEGIN, &trans); if (ret != 0) - return (ret); - return ioctl(dev, DIOCXCOMMIT, &trans); + return (errno); + ret = ioctl(dev, DIOCXCOMMIT, &trans); + if (ret != 0) + return (errno); + + return (0); } + int pfctl_clear_eth_rules(int dev, const char *anchorname) { @@ -2223,8 +2232,12 @@ pfctl_clear_eth_rules(int dev, const char *anchorname) ret = ioctl(dev, DIOCXBEGIN, &trans); if (ret != 0) - return (ret); - return ioctl(dev, DIOCXCOMMIT, &trans); + return (errno); + ret = ioctl(dev, DIOCXCOMMIT, &trans); + if (ret != 0) + return (errno); + + return (0); } static int @@ -2278,7 +2291,10 @@ pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s) ret = ioctl(dev, DIOCSETSYNCOOKIES, &nv); free(nv.data); - return (ret); + if (ret != 0) + return (errno); + + return (0); } int @@ -2386,7 +2402,7 @@ pfctl_table_set_addrs(int dev, struct pfr_table *tbl, struct pfr_addr io.pfrio_size = size; io.pfrio_size2 = (size2 != NULL) ? *size2 : 0; if (ioctl(dev, DIOCRSETADDRS, &io)) - return (-1); + return (errno); if (nadd != NULL) *nadd = io.pfrio_nadd; if (ndel != NULL) @@ -2414,7 +2430,7 @@ int pfctl_table_get_addrs(int dev, struct pfr_table *tbl, struct pfr_addr *addr, io.pfrio_esize = sizeof(*addr); io.pfrio_size = *size; if (ioctl(dev, DIOCRGETADDRS, &io)) - return (-1); + return (errno); *size = io.pfrio_size; return (0); } From nobody Sat Sep 21 22:56:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB4Px6Crsz5XSNl; Sat, 21 Sep 2024 22:56: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 4XB4Px4GFgz53Ym; Sat, 21 Sep 2024 22:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726959413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8sfo4XdEFRP0979+UAgGoAnWqzLkdTMeEy9g6wfJahA=; b=ytO0g8mhgTsY7BRssEwNwsxSKuAjbr30byu3C/pgU5WeaiQNBc1lOmUzQyBPg5XyTCZNv9 vTnJvGGqfmwsEY5x6WPHP70n30B/lRzyhd/QNFAIzPzcd2F1UX+JFq1UBBbdi3U0DzDcLL RHe9zFpbBqgcbv3V+f6TJ82K9II83POeP6XYdk/qmYVji9l3tf/9Cz+oHmAgno8WgCFS76 QftSykEf9XAIsJGQ9XZ6uNufhIju2BhfLmbz+DYfphljWNB5qUEsvuy7xHdX0RcLJHLYZ1 Ja2qDuhDgFZfzMjjXExrK30JafAnookn1etB2e1jlwcGKc0dylJQZ6wPjqKSFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726959413; a=rsa-sha256; cv=none; b=nV0e5k2hA/8C8PwnT093UA1pjbR8B7NpSfirZhuZS/34KbkxYtAm3c3Bk2Jd20lR8U9qb9 LTvkFba2+xYpnmrwtCmwCBKfR1H03yYUpbRyv5EdF0zozxIIkyAwXSYbnzhjx8ra2+4KwZ LYFJtw0vQSGz3pD3D2fJhuVkJoLUZCt7YSJN5/OKVnBpSsq8I7dUs1BNv65qJWung1BoqY hn6FOxj+xa0daDNnQ98JBTKN4xj6yMy7byKi83TcXQKMNJQB/9eLSuQ79eC+YH4Ychamou MvI1+drYsKk+MFxMQ1J11zZuzw9mF4ENFsg5EdAPZUwh/frladuI7sJ343PNGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726959413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8sfo4XdEFRP0979+UAgGoAnWqzLkdTMeEy9g6wfJahA=; b=K+Az2l58sIdmrNfXgArBNW96QDUzPPH9lgbbz3zqGlWAPCFWZsYGFAUequi08nTNNOIWQ/ hDWgKtISaEQWgSahkvsqlcNeUSBjV/2FJHxJS2LQDBx7m/VErmdtNitS8r7oNiPm+PTPRK /aVbya44Hp5AsHUjJZWGDZ/JLb7iK41+JJafZtywWeVgLoEjUWpuCTqGpdevJvK6Oft9G7 HhOv54nCNG1zXk2UgnOBxztEEcVNA61q+GK1xz0oTZwBQ2kIT33138kjAZ60Ti+AUX+VV5 eMkqJBR78qAKoJmjOM+f24XC4VLAjSnmSRVeGvrGMcLuf+FsSTOYFuO5MwgOYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB4Px3svczrfp; Sat, 21 Sep 2024 22:56: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 48LMurso012400; Sat, 21 Sep 2024 22:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LMurAC012397; Sat, 21 Sep 2024 22:56:53 GMT (envelope-from git) Date: Sat, 21 Sep 2024 22:56:53 GMT Message-Id: <202409212256.48LMurAC012397@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: f8d14a44deb0 - main - if_usie: fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8d14a44deb0bb0a3bde623bd9204212af12f938 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8d14a44deb0bb0a3bde623bd9204212af12f938 commit f8d14a44deb0bb0a3bde623bd9204212af12f938 Author: Kristof Provost AuthorDate: 2024-09-21 15:56:06 +0000 Commit: Kristof Provost CommitDate: 2024-09-21 22:56:37 +0000 if_usie: fix typo Fix a 'case AF_INET;' typo, and ensure we include 'opt_inet6.h' so #ifdef INET6 actually works. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/usb/net/if_usie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/net/if_usie.c b/sys/dev/usb/net/if_usie.c index 193ed956595a..bcbf056f3844 100644 --- a/sys/dev/usb/net/if_usie.c +++ b/sys/dev/usb/net/if_usie.c @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_inet6.h" + #include #include #include @@ -1190,7 +1192,7 @@ usie_if_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, switch (dst->sa_family) { #ifdef INET6 - case AF_INET6; + case AF_INET6: /* fall though */ #endif case AF_INET: From nobody Sun Sep 22 01:28:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB7n464T7z5Wpgl; Sun, 22 Sep 2024 01:28: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 4XB7n433dMz4KXl; Sun, 22 Sep 2024 01:28:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726968520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41feftz1Aq2wdTqgOlrHPFJfYcsKPKFMECYPEJbaOSE=; b=d4ciPTF3qjwBlHy6bCz0aPnwgvTSrWrlM6hffWM788kNVvHhwKZpclLpdIJawtzMdLXdJU ZIaxNIEBmiY71MefPZDxYwV2t4gSRHeRj3qdZDIqmNa7UwiM7GxI6hfFqGh2A9YRLP01Qp lvniiEBurPDnsK09vyTGo2GD1lCyApFslfDkvU3Il+/IS4CerlHEJ73skxeLG9fOf7OurV doEgm/vdAK90RnDC3UlSozV3id6YbZGtlLMisdK/+qyoou4OUtOTmjt8TTjLzDlUi8+zdD hANzTpU9EXSyjJmiIVmI4VfxuFTEPGUrO8mrS/mLBjN63slEiu3FI9URsTK6Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726968520; a=rsa-sha256; cv=none; b=nLevf3qq7CaZlO9B8KiyggQUCz+VSf4Vw8XobQAF/3WGSQdRHBdsmD20hhhV6BGtFf3i5o uChp/cCLdOxDS9abMyM+GBuaUbAcl3RSZg3Go4G3hJIBxJpATXhL8hPQRcHNcP5jFPO+/W 2bFDIMfAqyckXwQZdkoFQoG5HgfZfFawIqYoNnuXVQC+yUPx/XdxngFdjbKUpo94TRbdJv EiXhcsSU7uIrQ6rQzuQ7/BEF7JZnPXjyHV2WU77SmFTCAlKHG0Xgn1UQG31sqgWtHroBRn NnLxRJ5eDe20exHMN6ts2TQYBbcryRcabbTEmAac3/TQxcVjNeU29PfFW4wv3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726968520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41feftz1Aq2wdTqgOlrHPFJfYcsKPKFMECYPEJbaOSE=; b=TjTmgBOvsNzg7fjiFDJuhWPJA2hicutXnGwPn0dG1hPpPRtwqYQ8zqM1e+P8EB15aJ1ave eJU+fSrQ87zPe2Por4RAh/v1TWp1TFn1kyaBNdI5rNQuHewupZUP4ijKlFczborimOGYKI UGLjiFX2Q/nIxrUNY+qM/3zj2efSJRuYa3Fu4S0sUq32IVybHegiXLJmUg1GlORI+t3XIR PgKVoD1vxL+wwYPpGEGaCqSZPt07f+p7N+v3rPUNTvSyUDwHAwS/Wfjh5QyUMczrolnIv2 5qY6SHPDMFPSdenLH2yFTYy+LVMQPsynaAc195HTBt1DjoTEwEpIX3M0GtKLhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB7n42fVdzwTx; Sun, 22 Sep 2024 01:28: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 48M1SeXF067947; Sun, 22 Sep 2024 01:28:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M1SeBj067944; Sun, 22 Sep 2024 01:28:40 GMT (envelope-from git) Date: Sun, 22 Sep 2024 01:28:40 GMT Message-Id: <202409220128.48M1SeBj067944@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: 55ea43ce4b1b - main - git-blame-ignore-revs: Ignore f3754afd5901 in blame List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55ea43ce4b1bb20f76702581eb10ba2a56d2ab75 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=55ea43ce4b1bb20f76702581eb10ba2a56d2ab75 commit 55ea43ce4b1bb20f76702581eb10ba2a56d2ab75 Author: Zhenlei Huang AuthorDate: 2024-09-22 01:18:56 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 01:18:56 +0000 git-blame-ignore-revs: Ignore f3754afd5901 in blame --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 9ab3027bffda..d2cc2c9ff41f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,6 +8,8 @@ # # This file is sorted in git log order (newest commits first). +# remove stray whitespaces from sys/amd64/ +f3754afd5901857787271e73f9c34d3b9069a03f # style and whitespace fixes for bpf 1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c # whitespace fixes in sys/mman.h From nobody Sun Sep 22 02:10:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB8jH6rlbz5XM10; Sun, 22 Sep 2024 02:10: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 4XB8jH4zYnz4Rl9; Sun, 22 Sep 2024 02:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726971027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ul5fVUCWOpFVIO3aCAiUSdKZs+hXaLjHYCfNchQffw=; b=lx8BbC1ebECRXBRrXJAFJRl2Lf7XnZKc2wI5hoK8K+YVggipyQ/ZaVCCsHv6r+kUN7viSw Q7v81LD/v7JjAiSeh6wxfVXLpHpghwYAuyvvSstCQMc6fBxIllF8EgbVtGv5Jol2A3zh8i dXOfXD5IMuR2QqqoOBFlqH7PqUnLgZS6SdJuTkyJNSjgPBUmlMc31oOTeyY8eHUZ/+7Pu4 sFGJzHlTXO3Q8Ur99vGSH26OSEsEyKqjkuHrj57NjNPGeSjm4kKItRY2rpx7ley6LMcbOe tKeDloeNTEdsnJSuwafPcQEPBMIxqi5t72EhKCICwKelcBTPpQYWfo/SrhtEjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726971027; a=rsa-sha256; cv=none; b=hVbk9wDP19J1gNaikOarGLQWXq5QxqmHUHWEppwPmFXvvtLxlqkJJMF0CBdkBlQC2FF9Hp TMY9fMu0qIpGBCwRbRsq0t4DlGcUuZK9FBKXSo1JukqmAniOs5KHuGvMWorYW04keDV19z zod3CTfv/vnJeqA+LeUNH0Deyo6B3L2yxC/EX6KNg0WgwZGjuuemMHJLh6RHG5QOIKzqlu 2kb9EH1KbrLSM7vFzCIsFhs8psnmaL7Pf0jYzNS5+E2a0Of/pxNtoXg/m++l7VPzo2q5Iq 0oGENexNTl7X0hS5n0hj2m6deKlX9roNStgHh1JKqeCQ6HbPtDbKYowm3J2AaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726971027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ul5fVUCWOpFVIO3aCAiUSdKZs+hXaLjHYCfNchQffw=; b=bD/ENhHXZ0XN5iZR46T9qXl530H12InyWFrHaxLdhjr4xbl2JRnrC3cjIsici+lXv8M0gG ts81b1T9hdW6Tm7SHSJ7BjQ6PqW9oYMtTG5l664puqiYBEoJeLi6Tmm6xccgWH0m8Qmlrh vyCfeiJY+iopKChABfm7wdmMIG36d3VwL/rnl5HE1shNx97xmSqV27aWqnvQmXUaJdOG2Y 4sLBaKXlkCosZKy6O1tBiVh9tt5ByJSvHsodwHOZzyqq6RVBhYkDK11klgOzvZjpKBKGC3 uO5KL8rbX2iY6uzBKoL4h2xkHVJIrSkADZ40hfaSndLClMIvDElmOLc7o7eLvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB8jH4V6Nzy8n; Sun, 22 Sep 2024 02:10: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 48M2AR4L044580; Sun, 22 Sep 2024 02:10:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M2ARBB044577; Sun, 22 Sep 2024 02:10:27 GMT (envelope-from git) Date: Sun, 22 Sep 2024 02:10:27 GMT Message-Id: <202409220210.48M2ARBB044577@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: b90ba458dcae - main - iflib: Prefer C99's __func__ over GCC's __FUNCTION__ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b90ba458dcaecc4041e008b99fde003bc9867a0d Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b90ba458dcaecc4041e008b99fde003bc9867a0d commit b90ba458dcaecc4041e008b99fde003bc9867a0d Author: Zhenlei Huang AuthorDate: 2024-09-22 02:07:38 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 02:07:38 +0000 iflib: Prefer C99's __func__ over GCC's __FUNCTION__ MFC after: 3 days --- sys/net/iflib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index a595a5f2dd0f..ca9610ae3809 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3874,7 +3874,7 @@ iflib_completed_tx_reclaim(iflib_txq_t txq, int thresh) if (reclaim <= thresh /* + MAX_TX_DESC(txq->ift_ctx) */) { #ifdef INVARIANTS if (iflib_verbose_debug) { - printf("%s processed=%ju cleaned=%ju tx_nsegments=%d reclaim=%d thresh=%d\n", __FUNCTION__, + printf("%s processed=%ju cleaned=%ju tx_nsegments=%d reclaim=%d thresh=%d\n", __func__, txq->ift_processed, txq->ift_cleaned, txq->ift_ctx->ifc_softc_ctx.isc_tx_nsegments, reclaim, thresh); } @@ -3980,7 +3980,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) count = MIN(avail, TX_BATCH_SIZE); #ifdef INVARIANTS if (iflib_verbose_debug) - printf("%s avail=%d ifc_flags=%x txq_avail=%d ", __FUNCTION__, + printf("%s avail=%d ifc_flags=%x txq_avail=%d ", __func__, avail, ctx->ifc_flags, TXQ_AVAIL(txq)); #endif do_prefetch = (ctx->ifc_flags & IFC_PREFETCH); From nobody Sun Sep 22 02:10:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB8jJ6Pwbz5XLsH; Sun, 22 Sep 2024 02:10: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 4XB8jJ5GPPz4Rcr; Sun, 22 Sep 2024 02:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726971028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNRk5MjstTZlZjZuSNoj90v/5MIeJlQ4HnocAGJkCuY=; b=f5kOJda9mcIcx7Ff3j4bi4i2OP/CnhjSDY0bJ4+elIIqprVpJyknvBhAXWAGORTG6ScS93 sJSbs2w76Ui9lcN6dggJiYUxoUqs/xIketsE/61LJ5/mOtzatAWgTnTFAMamcEOfYXStba Jwcwfxp3Fq7X4AneeWMFIIxGWAGTEBTPs5+z4iSmAROcXPwmvF+/dyjbSn/EekYhPUCKiU VTfjVgMv2/lqf+J8+l5LsK9v+X0qkAFuxBvt6wGsRlzuUktTTToFVvnSlkmT/Kp4jtBGmU Mep/fp42W8KhKc6Y9zVOrKOse98eQx60c6FZKVlx9VcGZSoRaU8hi0741PYH6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726971028; a=rsa-sha256; cv=none; b=yoKk2BOwTNskLRhEomhOcyszaaBjMdjPg8n2Fd1qLSd7gpw/KNmED0BpSPFugIWDry8QiB 5atU3E8NGyfBmLOAqTOkduvksCW1wIOGy8PZ4UkZh2BDf39u/Y6Vu6vErJP7pkdGI6R2bS F9+RJWSjN5iJUwxyFUi66Y4M512PMZwH/2nhd6X4g78Wmcel9WgYGBOE5KhPtROMbbYMkw Y3BY67nz2bOrJyzPTAbsVZ+yjzcqC1TqZ701ZdY8gXhJkOaPEycX4GYRbr3AP+EyQiqYvi ph1dGSGalxy569ca/RTyMB2THNCkQJdFIbcrMfTVmqbhdFc0uwcOJDQp2bIpmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726971028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNRk5MjstTZlZjZuSNoj90v/5MIeJlQ4HnocAGJkCuY=; b=CHAbk3S+Xc5yyJBmt9Bj+BOKQGEvhDQ/7SqMdcnR48T0QubRi6JkGE/HONxCoOHJrXvCpR ZvJeWr1ps/q20/KP0uLk0fyuqC3x5J1t0OtG7pyC5MeDPjqsPxi2NwUicUW8Yl3xEJdL+7 gwvHltj7p9ylfAXOAIzD9LqOHDcr3XYFWfZbZt7W5ThfaPx6sEzq2HNDejgn/uTVxeRt2R OmqAalaxBdL1xAxYPD58XMlmdP5sbfSMI+SPpC2LJjrpblsJh+vqClqrd+CmHqe7am/+qw YzGa2rhv5bkkC/F67A5lpixoLZvIH5tc6FuejizIVDFXLs9Sd3zXLZH5ebwVRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB8jJ4sjpzyB0; Sun, 22 Sep 2024 02:10: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 48M2ASvs044625; Sun, 22 Sep 2024 02:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M2AScx044622; Sun, 22 Sep 2024 02:10:28 GMT (envelope-from git) Date: Sun, 22 Sep 2024 02:10:28 GMT Message-Id: <202409220210.48M2AScx044622@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: fa7045f99cdb - main - iflib: Many style fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa7045f99cdb2b699205653f42f3fe78597880a7 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fa7045f99cdb2b699205653f42f3fe78597880a7 commit fa7045f99cdb2b699205653f42f3fe78597880a7 Author: Zhenlei Huang AuthorDate: 2024-09-22 02:07:39 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 02:07:39 +0000 iflib: Many style fixes MFC after: 3 days --- sys/net/iflib.c | 296 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index ca9610ae3809..9df01edc14d6 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -126,8 +126,8 @@ */ static MALLOC_DEFINE(M_IFLIB, "iflib", "ifnet library"); -#define IFLIB_RXEOF_MORE (1U << 0) -#define IFLIB_RXEOF_EMPTY (2U << 0) +#define IFLIB_RXEOF_MORE (1U << 0) +#define IFLIB_RXEOF_EMPTY (2U << 0) struct iflib_txq; typedef struct iflib_txq *iflib_txq_t; @@ -200,16 +200,16 @@ struct iflib_ctx { qidx_t ifc_sysctl_ntxds[8]; qidx_t ifc_sysctl_nrxds[8]; struct if_txrx ifc_txrx; -#define isc_txd_encap ifc_txrx.ift_txd_encap -#define isc_txd_flush ifc_txrx.ift_txd_flush -#define isc_txd_credits_update ifc_txrx.ift_txd_credits_update -#define isc_rxd_available ifc_txrx.ift_rxd_available -#define isc_rxd_pkt_get ifc_txrx.ift_rxd_pkt_get -#define isc_rxd_refill ifc_txrx.ift_rxd_refill -#define isc_rxd_flush ifc_txrx.ift_rxd_flush -#define isc_legacy_intr ifc_txrx.ift_legacy_intr -#define isc_txq_select ifc_txrx.ift_txq_select -#define isc_txq_select_v2 ifc_txrx.ift_txq_select_v2 +#define isc_txd_encap ifc_txrx.ift_txd_encap +#define isc_txd_flush ifc_txrx.ift_txd_flush +#define isc_txd_credits_update ifc_txrx.ift_txd_credits_update +#define isc_rxd_available ifc_txrx.ift_rxd_available +#define isc_rxd_pkt_get ifc_txrx.ift_rxd_pkt_get +#define isc_rxd_refill ifc_txrx.ift_rxd_refill +#define isc_rxd_flush ifc_txrx.ift_rxd_flush +#define isc_legacy_intr ifc_txrx.ift_legacy_intr +#define isc_txq_select ifc_txrx.ift_txq_select +#define isc_txq_select_v2 ifc_txrx.ift_txq_select_v2 eventhandler_tag ifc_vlan_attach_event; eventhandler_tag ifc_vlan_detach_event; @@ -272,12 +272,12 @@ iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx) return (ctx->ifc_sysctl_extra_msix_vectors); } -#define IP_ALIGNED(m) ((((uintptr_t)(m)->m_data) & 0x3) == 0x2) -#define CACHE_PTR_INCREMENT (CACHE_LINE_SIZE/sizeof(void*)) -#define CACHE_PTR_NEXT(ptr) ((void *)(((uintptr_t)(ptr)+CACHE_LINE_SIZE-1) & (CACHE_LINE_SIZE-1))) +#define IP_ALIGNED(m) ((((uintptr_t)(m)->m_data) & 0x3) == 0x2) +#define CACHE_PTR_INCREMENT (CACHE_LINE_SIZE / sizeof(void *)) +#define CACHE_PTR_NEXT(ptr) ((void *)(((uintptr_t)(ptr) + CACHE_LINE_SIZE - 1) & (CACHE_LINE_SIZE - 1))) -#define LINK_ACTIVE(ctx) ((ctx)->ifc_link_state == LINK_STATE_UP) -#define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF) +#define LINK_ACTIVE(ctx) ((ctx)->ifc_link_state == LINK_STATE_UP) +#define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF) typedef struct iflib_sw_rx_desc_array { bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ @@ -325,9 +325,9 @@ typedef struct iflib_sw_tx_desc_array { #define IFC_NETMAP_TX_IRQ 0x80000000 -#define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ - CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ - CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) +#define CSUM_OFFLOAD (CSUM_IP_TSO | CSUM_IP6_TSO | CSUM_IP | \ + CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP_SCTP | \ + CSUM_IP6_UDP | CSUM_IP6_TCP | CSUM_IP6_SCTP) struct iflib_txq { qidx_t ift_in_use; @@ -455,11 +455,11 @@ struct iflib_rxq { uint8_t ifr_ntxqirq; uint8_t ifr_txqid[IFLIB_MAX_TX_SHARED_INTR]; uint8_t ifr_fl_offset; - struct lro_ctrl ifr_lc; + struct lro_ctrl ifr_lc; struct grouptask ifr_task; struct callout ifr_watchdog; struct iflib_filter_info ifr_filter_info; - iflib_dma_info_t ifr_ifdi; + iflib_dma_info_t ifr_ifdi; /* dynamically allocate if any drivers need a value substantially larger than this */ struct if_rxd_frag ifr_frags[IFLIB_MAX_RX_SEGS] __aligned(CACHE_LINE_SIZE); @@ -483,8 +483,8 @@ typedef struct if_rxsd { #define RXD_INFO_SIZE 8 #define PKT_TYPE uint32_t #endif -#define PKT_LOOP_BOUND ((PKT_INFO_SIZE/3)*3) -#define RXD_LOOP_BOUND ((RXD_INFO_SIZE/4)*4) +#define PKT_LOOP_BOUND ((PKT_INFO_SIZE / 3) * 3) +#define RXD_LOOP_BOUND ((RXD_INFO_SIZE / 4) * 4) typedef struct if_pkt_info_pad { PKT_TYPE pkt_val[PKT_INFO_SIZE]; @@ -507,7 +507,7 @@ pkt_info_zero(if_pkt_info_t pi) #ifndef __LP64__ pi_pad->pkt_val[6] = 0; pi_pad->pkt_val[7] = 0; pi_pad->pkt_val[8] = 0; pi_pad->pkt_val[9] = 0; pi_pad->pkt_val[10] = 0; -#endif +#endif } static inline void @@ -519,12 +519,12 @@ rxd_info_zero(if_rxd_info_t ri) ri_pad = (if_rxd_info_pad_t)ri; for (i = 0; i < RXD_LOOP_BOUND; i += 4) { ri_pad->rxd_val[i] = 0; - ri_pad->rxd_val[i+1] = 0; - ri_pad->rxd_val[i+2] = 0; - ri_pad->rxd_val[i+3] = 0; + ri_pad->rxd_val[i + 1] = 0; + ri_pad->rxd_val[i + 2] = 0; + ri_pad->rxd_val[i + 3] = 0; } #ifdef __LP64__ - ri_pad->rxd_val[RXD_INFO_SIZE-1] = 0; + ri_pad->rxd_val[RXD_INFO_SIZE - 1] = 0; #endif } @@ -532,19 +532,19 @@ rxd_info_zero(if_rxd_info_t ri) * Only allow a single packet to take up most 1/nth of the tx ring */ #define MAX_SINGLE_PACKET_FRACTION 12 -#define IF_BAD_DMA (bus_addr_t)-1 +#define IF_BAD_DMA ((bus_addr_t)-1) -#define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) +#define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) -#define CTX_LOCK_INIT(_sc) sx_init(&(_sc)->ifc_ctx_sx, "iflib ctx lock") -#define CTX_LOCK(ctx) sx_xlock(&(ctx)->ifc_ctx_sx) -#define CTX_UNLOCK(ctx) sx_xunlock(&(ctx)->ifc_ctx_sx) -#define CTX_LOCK_DESTROY(ctx) sx_destroy(&(ctx)->ifc_ctx_sx) +#define CTX_LOCK_INIT(_sc) sx_init(&(_sc)->ifc_ctx_sx, "iflib ctx lock") +#define CTX_LOCK(ctx) sx_xlock(&(ctx)->ifc_ctx_sx) +#define CTX_UNLOCK(ctx) sx_xunlock(&(ctx)->ifc_ctx_sx) +#define CTX_LOCK_DESTROY(ctx) sx_destroy(&(ctx)->ifc_ctx_sx) -#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) -#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) -#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) -#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) +#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) +#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) +#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) +#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) @@ -579,7 +579,7 @@ static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "iflib driver parameters"); /* - * XXX need to ensure that this can't accidentally cause the head to be moved backwards + * XXX need to ensure that this can't accidentally cause the head to be moved backwards */ static int iflib_min_tx_latency = 0; SYSCTL_INT(_net_iflib, OID_AUTO, min_tx_latency, CTLFLAG_RW, @@ -721,7 +721,7 @@ static void iflib_stop(if_ctx_t ctx); static void iflib_if_init_locked(if_ctx_t ctx); static void iflib_free_intr_mem(if_ctx_t ctx); #ifndef __NO_STRICT_ALIGNMENT -static struct mbuf * iflib_fixup_rx(struct mbuf *m); +static struct mbuf *iflib_fixup_rx(struct mbuf *m); #endif static SLIST_HEAD(cpu_offset_list, cpu_offset) cpu_offsets = @@ -745,7 +745,7 @@ iflib_num_rx_descs(if_ctx_t ctx) if_shared_ctx_t sctx = ctx->ifc_sctx; uint16_t first_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; - return scctx->isc_nrxd[first_rxq]; + return (scctx->isc_nrxd[first_rxq]); } static int @@ -755,7 +755,7 @@ iflib_num_tx_descs(if_ctx_t ctx) if_shared_ctx_t sctx = ctx->ifc_sctx; uint16_t first_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; - return scctx->isc_ntxd[first_txq]; + return (scctx->isc_ntxd[first_txq]); } #ifdef DEV_NETMAP @@ -851,7 +851,7 @@ iflib_netmap_config(struct netmap_adapter *na, struct nm_config_info *info) info->num_tx_rings, info->num_rx_rings, info->num_tx_descs, info->num_rx_descs, info->rx_buf_maxsize); - return 0; + return (0); } static int @@ -925,7 +925,7 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) MPASS(i < IFLIB_MAX_RX_REFRESH); if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ - return netmap_ring_reinit(kring); + return (netmap_ring_reinit(kring)); fl->ifl_bus_addrs[i] = paddr + nm_get_offset(kring, slot); @@ -1268,7 +1268,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) if (n) { /* update the state variables */ if (netmap_no_pendintr && !force_update) { /* diagnostics */ - iflib_rx_miss ++; + iflib_rx_miss++; iflib_rx_miss_bufs += n; } kring->nr_hwtail = nm_i; @@ -1406,7 +1406,7 @@ prefetch2cachelines(void *x) { __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); #if (CACHE_LINE_SIZE < 128) - __asm volatile("prefetcht0 %0" :: "m" (*(((unsigned long *)x)+CACHE_LINE_SIZE/(sizeof(unsigned long))))); + __asm volatile("prefetcht0 %0" :: "m" (*(((unsigned long *)x) + CACHE_LINE_SIZE / (sizeof(unsigned long))))); #endif } #else @@ -1474,7 +1474,7 @@ iflib_dma_alloc_align(if_ctx_t ctx, int size, int align, iflib_dma_info_t dma, i goto fail_0; } - err = bus_dmamem_alloc(dma->idi_tag, (void**) &dma->idi_vaddr, + err = bus_dmamem_alloc(dma->idi_tag, (void **)&dma->idi_vaddr, BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_ZERO, &dma->idi_map); if (err) { device_printf(dev, @@ -1743,8 +1743,8 @@ iflib_txsd_alloc(iflib_txq_t txq) NULL, /* lockfunc */ NULL, /* lockfuncarg */ &txq->ift_buf_tag))) { - device_printf(dev,"Unable to allocate TX DMA tag: %d\n", err); - device_printf(dev,"maxsize: %ju nsegments: %d maxsegsize: %ju\n", + device_printf(dev, "Unable to allocate TX DMA tag: %d\n", err); + device_printf(dev, "maxsize: %ju nsegments: %d maxsegsize: %ju\n", (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); goto fail; } @@ -1954,7 +1954,7 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) device_t dev = ctx->ifc_dev; iflib_fl_t fl; bus_addr_t lowaddr; - int err; + int err; MPASS(scctx->isc_nrxd[0] > 0); MPASS(scctx->isc_nrxd[rxq->ifr_fl_offset] > 0); @@ -2304,8 +2304,8 @@ iflib_fl_setup(iflib_fl_t fl) bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size - 1); /* - ** Free current RX buffer structs and their mbufs - */ + * Free current RX buffer structs and their mbufs + */ iflib_fl_bufs_free(fl); /* Now replenish the mbufs */ MPASS(fl->ifl_credits == 0); @@ -2435,7 +2435,7 @@ iflib_timer(void *arg) GROUPTASK_ENQUEUE(&txq->ift_task); sctx->isc_pause_frames = 0; - if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) + if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq, txq->ift_timer.c_cpu); return; @@ -2446,7 +2446,7 @@ iflib_timer(void *arg) txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); STATE_LOCK(ctx); if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); - ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); + ctx->ifc_flags |= (IFC_DO_WATCHDOG | IFC_DO_RESET); iflib_admin_intr_deferred(ctx); STATE_UNLOCK(ctx); } @@ -2670,8 +2670,8 @@ calc_next_rxd(iflib_fl_t fl, int cidx) if (__predict_false(size == 0)) return (start); - cur = start + size*cidx; - end = start + size*nrxd; + cur = start + size * cidx; + end = start + size * nrxd; next = CACHE_PTR_NEXT(cur); return (next < end ? next : start); } @@ -2683,19 +2683,19 @@ prefetch_pkts(iflib_fl_t fl, int cidx) int nrxd = fl->ifl_size; caddr_t next_rxd; - nextptr = (cidx + CACHE_PTR_INCREMENT) & (nrxd-1); + nextptr = (cidx + CACHE_PTR_INCREMENT) & (nrxd - 1); prefetch(&fl->ifl_sds.ifsd_m[nextptr]); prefetch(&fl->ifl_sds.ifsd_cl[nextptr]); next_rxd = calc_next_rxd(fl, cidx); prefetch(next_rxd); - prefetch(fl->ifl_sds.ifsd_m[(cidx + 1) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_m[(cidx + 2) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_m[(cidx + 3) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_m[(cidx + 4) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_cl[(cidx + 1) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_cl[(cidx + 2) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_cl[(cidx + 3) & (nrxd-1)]); - prefetch(fl->ifl_sds.ifsd_cl[(cidx + 4) & (nrxd-1)]); + prefetch(fl->ifl_sds.ifsd_m[(cidx + 1) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_m[(cidx + 2) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_m[(cidx + 3) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_m[(cidx + 4) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_cl[(cidx + 1) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_cl[(cidx + 2) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_cl[(cidx + 3) & (nrxd - 1)]); + prefetch(fl->ifl_sds.ifsd_cl[(cidx + 4) & (nrxd - 1)]); } static struct mbuf * @@ -2720,7 +2720,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, bool unload, if_rxsd_t sd, #endif if (rxq->ifr_ctx->ifc_flags & IFC_PREFETCH) prefetch_pkts(fl, cidx); - next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); + next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size - 1); prefetch(&fl->ifl_sds.ifsd_map[next]); map = fl->ifl_sds.ifsd_map[cidx]; @@ -2768,7 +2768,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, bool unload, if_rxsd_t sd, if (unload && irf->irf_len != 0) bus_dmamap_unload(fl->ifl_buf_tag, map); - fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); + fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size - 1); if (__predict_false(fl->ifl_cidx == 0)) fl->ifl_gen = 0; bit_clear(fl->ifl_rx_bitmap, cidx); @@ -2812,7 +2812,7 @@ assemble_segments(iflib_rxq_t rxq, if_rxd_info_t ri, if_rxsd_t sd, int *pf_rv) continue; } if (mh == NULL) { - flags = M_PKTHDR|M_EXT; + flags = M_PKTHDR | M_EXT; mh = mt = m; padlen = ri->iri_pad; } else { @@ -2913,16 +2913,16 @@ iflib_check_lro_possible(struct mbuf *m, bool v4_forwarding, bool v6_forwarding) eh = mtod(m, struct ether_header *); switch (eh->ether_type) { #if defined(INET6) - case htons(ETHERTYPE_IPV6): - return (!v6_forwarding); + case htons(ETHERTYPE_IPV6): + return (!v6_forwarding); #endif -#if defined (INET) - case htons(ETHERTYPE_IP): - return (!v4_forwarding); +#if defined(INET) + case htons(ETHERTYPE_IP): + return (!v4_forwarding); #endif } - return false; + return (false); } #else static void @@ -3058,8 +3058,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) mt = mf = NULL; } } - if ((m->m_pkthdr.csum_flags & (CSUM_L4_CALC|CSUM_L4_VALID)) == - (CSUM_L4_CALC|CSUM_L4_VALID)) { + if ((m->m_pkthdr.csum_flags & (CSUM_L4_CALC | CSUM_L4_VALID)) == + (CSUM_L4_CALC | CSUM_L4_VALID)) { if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) continue; } @@ -3102,15 +3102,15 @@ err: return (0); } -#define TXD_NOTIFY_COUNT(txq) (((txq)->ift_size / (txq)->ift_update_freq)-1) +#define TXD_NOTIFY_COUNT(txq) (((txq)->ift_size / (txq)->ift_update_freq) - 1) static inline qidx_t txq_max_db_deferred(iflib_txq_t txq, qidx_t in_use) { qidx_t notify_count = TXD_NOTIFY_COUNT(txq); qidx_t minthresh = txq->ift_size / 8; - if (in_use > 4*minthresh) + if (in_use > 4 * minthresh) return (notify_count); - if (in_use > 2*minthresh) + if (in_use > 2 * minthresh) return (notify_count >> 1); if (in_use > minthresh) return (notify_count >> 3); @@ -3122,21 +3122,21 @@ txq_max_rs_deferred(iflib_txq_t txq) { qidx_t notify_count = TXD_NOTIFY_COUNT(txq); qidx_t minthresh = txq->ift_size / 8; - if (txq->ift_in_use > 4*minthresh) + if (txq->ift_in_use > 4 * minthresh) return (notify_count); - if (txq->ift_in_use > 2*minthresh) + if (txq->ift_in_use > 2 * minthresh) return (notify_count >> 1); if (txq->ift_in_use > minthresh) return (notify_count >> 2); return (2); } -#define M_CSUM_FLAGS(m) ((m)->m_pkthdr.csum_flags) -#define M_HAS_VLANTAG(m) (m->m_flags & M_VLANTAG) +#define M_CSUM_FLAGS(m) ((m)->m_pkthdr.csum_flags) +#define M_HAS_VLANTAG(m) (m->m_flags & M_VLANTAG) -#define TXQ_MAX_DB_DEFERRED(txq, in_use) txq_max_db_deferred((txq), (in_use)) -#define TXQ_MAX_RS_DEFERRED(txq) txq_max_rs_deferred(txq) -#define TXQ_MAX_DB_CONSUMED(size) (size >> 4) +#define TXQ_MAX_DB_DEFERRED(txq, in_use) txq_max_db_deferred((txq), (in_use)) +#define TXQ_MAX_RS_DEFERRED(txq) txq_max_rs_deferred(txq) +#define TXQ_MAX_DB_CONSUMED(size) (size >> 4) /* forward compatibility for cxgb */ #define FIRST_QSET(ctx) 0 @@ -3441,7 +3441,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp) } } if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; + ip->ip_sum = 0; break; } @@ -3541,8 +3541,8 @@ calc_next_txd(iflib_txq_t txq, int cidx, uint8_t qid) if (__predict_false(size == 0)) return (start); - cur = start + size*cidx; - end = start + size*ntxd; + cur = start + size * cidx; + end = start + size * ntxd; next = CACHE_PTR_NEXT(cur); return (next < end ? next : start); } @@ -3569,7 +3569,7 @@ iflib_ether_pad(device_t dev, struct mbuf **m_head, uint16_t min_frame_size) device_printf(dev, "cannot pad short frame, m_dup() failed"); DBG_COUNTER_INC(encap_pad_mbuf_fail); DBG_COUNTER_INC(tx_frees); - return ENOMEM; + return (ENOMEM); } m_freem(*m_head); *m_head = new_head; @@ -3588,7 +3588,7 @@ iflib_ether_pad(device_t dev, struct mbuf **m_head, uint16_t min_frame_size) return (ENOBUFS); } - return 0; + return (0); } static int @@ -3620,7 +3620,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) cidx = txq->ift_cidx; pidx = txq->ift_pidx; if (ctx->ifc_flags & IFC_PREFETCH) { - next = (cidx + CACHE_PTR_INCREMENT) & (ntxd-1); + next = (cidx + CACHE_PTR_INCREMENT) & (ntxd - 1); if (!(ctx->ifc_flags & IFLIB_HAS_TXCQ)) { next_txd = calc_next_txd(txq, cidx, 0); prefetch(next_txd); @@ -3629,7 +3629,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) /* prefetch the next cache line of mbuf pointers and flags */ prefetch(&txq->ift_sds.ifsd_m[next]); prefetch(&txq->ift_sds.ifsd_map[next]); - next = (cidx + CACHE_LINE_SIZE) & (ntxd-1); + next = (cidx + CACHE_LINE_SIZE) & (ntxd - 1); } map = txq->ift_sds.ifsd_map[pidx]; ifsd_m = txq->ift_sds.ifsd_m; @@ -3650,13 +3650,13 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) err = iflib_ether_pad(ctx->ifc_dev, m_headp, scctx->isc_min_frame_size); if (err) { DBG_COUNTER_INC(encap_txd_encap_fail); - return err; + return (err); } } m_head = *m_headp; pkt_info_zero(&pi); - pi.ipi_mflags = (m_head->m_flags & (M_VLANTAG|M_BCAST|M_MCAST)); + pi.ipi_mflags = (m_head->m_flags & (M_VLANTAG | M_BCAST | M_MCAST)); pi.ipi_pidx = pidx; pi.ipi_qsidx = txq->ift_id; pi.ipi_len = m_head->m_pkthdr.len; @@ -3762,7 +3762,7 @@ defrag: txq->ift_gen = 1; } /* - * drivers can need as many as + * drivers can need as many as * two sentinels */ MPASS(ndesc <= pi.ipi_nsegs + 2); @@ -3814,7 +3814,7 @@ iflib_tx_desc_free(iflib_txq_t txq, int n) cidx = txq->ift_cidx; gen = txq->ift_gen; qsize = txq->ift_size; - mask = qsize-1; + mask = qsize - 1; ifsd_m = txq->ift_sds.ifsd_m; do_prefetch = (txq->ift_ctx->ifc_flags & IFC_PREFETCH); @@ -3895,17 +3895,17 @@ _ring_peek_one(struct ifmp_ring *r, int cidx, int offset, int remaining) struct mbuf **items; size = r->size; - next = (cidx + CACHE_PTR_INCREMENT) & (size-1); + next = (cidx + CACHE_PTR_INCREMENT) & (size - 1); items = __DEVOLATILE(struct mbuf **, &r->items[0]); - prefetch(items[(cidx + offset) & (size-1)]); + prefetch(items[(cidx + offset) & (size - 1)]); if (remaining > 1) { prefetch2cachelines(&items[next]); - prefetch2cachelines(items[(cidx + offset + 1) & (size-1)]); - prefetch2cachelines(items[(cidx + offset + 2) & (size-1)]); - prefetch2cachelines(items[(cidx + offset + 3) & (size-1)]); + prefetch2cachelines(items[(cidx + offset + 1) & (size - 1)]); + prefetch2cachelines(items[(cidx + offset + 2) & (size - 1)]); + prefetch2cachelines(items[(cidx + offset + 3) & (size - 1)]); } - return (__DEVOLATILE(struct mbuf **, &r->items[(cidx + offset) & (size-1)])); + return (__DEVOLATILE(struct mbuf **, &r->items[(cidx + offset) & (size - 1)])); } static void @@ -3955,9 +3955,9 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) */ DBG_COUNTER_INC(txq_drain_flushing); for (i = 0; i < avail; i++) { - if (__predict_true(r->items[(cidx + i) & (r->size-1)] != (void *)txq)) - m_freem(r->items[(cidx + i) & (r->size-1)]); - r->items[(cidx + i) & (r->size-1)] = NULL; + if (__predict_true(r->items[(cidx + i) & (r->size - 1)] != (void *)txq)) + m_freem(r->items[(cidx + i) & (r->size - 1)]); + r->items[(cidx + i) & (r->size - 1)] = NULL; } return (avail); } @@ -4187,7 +4187,7 @@ _task_fn_admin(void *context) do_reset = (ctx->ifc_flags & IFC_DO_RESET); do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); in_detach = (ctx->ifc_flags & IFC_IN_DETACH); - ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); + ctx->ifc_flags &= ~(IFC_DO_RESET | IFC_DO_WATCHDOG); STATE_UNLOCK(ctx); if ((!running && !oactive) && !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) @@ -4343,7 +4343,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) } while (next != NULL); if (count > nitems(marr)) - if ((mp = malloc(count*sizeof(struct mbuf *), M_IFLIB, M_NOWAIT)) == NULL) { + if ((mp = malloc(count * sizeof(struct mbuf *), M_IFLIB, M_NOWAIT)) == NULL) { /* XXX check nextpkt */ m_freem(m); /* XXX simplify for now */ @@ -4482,11 +4482,11 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) avoid_reset = true; #endif /* - ** Calling init results in link renegotiation, - ** so we avoid doing it when possible. - */ + * Calling init results in link renegotiation, + * so we avoid doing it when possible. + */ if (avoid_reset) { - if_setflagbits(ifp, IFF_UP,0); + if_setflagbits(ifp, IFF_UP, 0); if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) reinit = 1; #ifdef INET @@ -4588,7 +4588,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_MEXTPG; setmask = 0; #ifdef TCP_OFFLOAD - setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6); + setmask |= mask & (IFCAP_TOE4 | IFCAP_TOE6); #endif setmask |= (mask & IFCAP_FLAGS); setmask |= (mask & IFCAP_WOL); @@ -4913,15 +4913,15 @@ find_child_with_core(int cpu, struct cpu_group *grp) int i; if (grp->cg_children == 0) - return -1; + return (-1); MPASS(grp->cg_child); for (i = 0; i < grp->cg_children; i++) { if (CPU_ISSET(cpu, &grp->cg_child[i].cg_mask)) - return i; + return (i); } - return -1; + return (-1); } @@ -4938,7 +4938,7 @@ find_l2_neighbor(int cpu) grp = cpu_top; if (grp == NULL) - return -1; + return (-1); /* * Find the smallest CPU group that contains the given core. @@ -4957,7 +4957,7 @@ find_l2_neighbor(int cpu) /* Must share L2. */ if (grp->cg_level > CG_SHARE_L2 || grp->cg_level == CG_SHARE_NONE) - return -1; + return (-1); /* * Select the first member of the set that isn't the reference @@ -5198,10 +5198,10 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct int err, msix, rid; int num_txd, num_rxd; - ctx = malloc(sizeof(* ctx), M_IFLIB, M_WAITOK|M_ZERO); + ctx = malloc(sizeof(*ctx), M_IFLIB, M_WAITOK | M_ZERO); if (sc == NULL) { - sc = malloc(sctx->isc_driver->size, M_IFLIB, M_WAITOK|M_ZERO); + sc = malloc(sctx->isc_driver->size, M_IFLIB, M_WAITOK | M_ZERO); device_set_softc(dev, ctx); ctx->ifc_flags |= IFC_SC_ALLOCATED; } @@ -5285,7 +5285,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct } if (scctx->isc_rss_table_size == 0) scctx->isc_rss_table_size = 64; - scctx->isc_rss_table_mask = scctx->isc_rss_table_size-1; + scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1; GROUPTASK_INIT(&ctx->ifc_admin_task, 0, _task_fn_admin, ctx); /* XXX format name */ @@ -5302,16 +5302,16 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct MPASS(CPU_COUNT(&ctx->ifc_cpus) > 0); /* - ** Now set up MSI or MSI-X, should return us the number of supported - ** vectors (will be 1 for a legacy interrupt and MSI). - */ + * Now set up MSI or MSI-X, should return us the number of supported + * vectors (will be 1 for a legacy interrupt and MSI). + */ if (sctx->isc_flags & IFLIB_SKIP_MSIX) { msix = scctx->isc_vectors; } else if (scctx->isc_msix_bar != 0) - /* - * The simple fact that isc_msix_bar is not 0 does not mean we - * we have a good value there that is known to work. - */ + /* + * The simple fact that isc_msix_bar is not 0 does not mean we + * we have a good value there that is known to work. + */ msix = iflib_msix_init(ctx); else { scctx->isc_vectors = 1; @@ -5583,7 +5583,7 @@ iflib_device_suspend(device_t dev) IFDI_SUSPEND(ctx); CTX_UNLOCK(ctx); - return bus_generic_suspend(dev); + return (bus_generic_suspend(dev)); } int iflib_device_shutdown(device_t dev) @@ -5594,7 +5594,7 @@ iflib_device_shutdown(device_t dev) IFDI_SHUTDOWN(ctx); CTX_UNLOCK(ctx); - return bus_generic_suspend(dev); + return (bus_generic_suspend(dev)); } int @@ -5981,20 +5981,20 @@ iflib_queues_alloc(if_ctx_t ctx) goto err_rx_desc; } - for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) + for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, M_WAITOK); } /* TXQs */ - vaddrs = malloc(sizeof(caddr_t)*ntxqsets*ntxqs, M_IFLIB, M_WAITOK); - paddrs = malloc(sizeof(uint64_t)*ntxqsets*ntxqs, M_IFLIB, M_WAITOK); + vaddrs = malloc(sizeof(caddr_t) * ntxqsets * ntxqs, M_IFLIB, M_WAITOK); + paddrs = malloc(sizeof(uint64_t) * ntxqsets * ntxqs, M_IFLIB, M_WAITOK); for (i = 0; i < ntxqsets; i++) { iflib_dma_info_t di = ctx->ifc_txqs[i].ift_ifdi; for (j = 0; j < ntxqs; j++, di++) { - vaddrs[i*ntxqs + j] = di->idi_vaddr; - paddrs[i*ntxqs + j] = di->idi_paddr; + vaddrs[i * ntxqs + j] = di->idi_vaddr; + paddrs[i * ntxqs + j] = di->idi_paddr; } } if ((err = IFDI_TX_QUEUES_ALLOC(ctx, vaddrs, paddrs, ntxqs, ntxqsets)) != 0) { @@ -6009,14 +6009,14 @@ iflib_queues_alloc(if_ctx_t ctx) free(paddrs, M_IFLIB); /* RXQs */ - vaddrs = malloc(sizeof(caddr_t)*nrxqsets*nrxqs, M_IFLIB, M_WAITOK); - paddrs = malloc(sizeof(uint64_t)*nrxqsets*nrxqs, M_IFLIB, M_WAITOK); + vaddrs = malloc(sizeof(caddr_t) * nrxqsets * nrxqs, M_IFLIB, M_WAITOK); + paddrs = malloc(sizeof(uint64_t) * nrxqsets * nrxqs, M_IFLIB, M_WAITOK); for (i = 0; i < nrxqsets; i++) { iflib_dma_info_t di = ctx->ifc_rxqs[i].ifr_ifdi; for (j = 0; j < nrxqs; j++, di++) { - vaddrs[i*nrxqs + j] = di->idi_vaddr; - paddrs[i*nrxqs + j] = di->idi_paddr; + vaddrs[i * nrxqs + j] = di->idi_vaddr; + paddrs[i * nrxqs + j] = di->idi_paddr; } } if ((err = IFDI_RX_QUEUES_ALLOC(ctx, vaddrs, paddrs, nrxqs, nrxqsets)) != 0) { @@ -6517,7 +6517,7 @@ void iflib_config_gtask_deinit(struct grouptask *gtask) { - taskqgroup_detach(qgroup_if_config_tqg, gtask); + taskqgroup_detach(qgroup_if_config_tqg, gtask); } void @@ -6742,11 +6742,11 @@ msi: scctx->isc_ntxqsets = 1; scctx->isc_vectors = vectors; if (vectors == 1 && pci_alloc_msi(dev, &vectors) == 0) { - device_printf(dev,"Using an MSI interrupt\n"); + device_printf(dev, "Using an MSI interrupt\n"); scctx->isc_intr = IFLIB_INTR_MSI; } else { scctx->isc_vectors = 1; - device_printf(dev,"Using a Legacy interrupt\n"); + device_printf(dev, "Using a Legacy interrupt\n"); scctx->isc_intr = IFLIB_INTR_LEGACY; } @@ -6779,7 +6779,7 @@ mp_ring_state_handler(SYSCTL_HANDLER_ARGS) state[0], state[1], state[2], ring_state); rc = sbuf_finish(sb); sbuf_delete(sb); - return(rc); + return (rc); } enum iflib_ndesc_handler { @@ -6798,7 +6798,7 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) int nqs, rc, i; nqs = 8; - switch(type) { + switch (type) { case IFLIB_NTXD_HANDLER: ndesc = ctx->ifc_sysctl_ntxds; if (ctx->ifc_sctx) @@ -6816,7 +6816,7 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) if (nqs == 0) nqs = 8; - for (i=0; i<8; i++) { + for (i = 0; i < 8; i++) { if (i >= nqs) break; if (i) @@ -6826,14 +6826,14 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) rc = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (rc || req->newptr == NULL) - return rc; + return (rc); for (i = 0, next = buf, p = strsep(&next, " ,"); i < 8 && p; i++, p = strsep(&next, " ,")) { ndesc[i] = strtoul(p, NULL, 10); } - return(rc); + return (rc); } #define NAME_BUFLEN 32 From nobody Sun Sep 22 02:10:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB8jL05Sqz5XLv5; Sun, 22 Sep 2024 02:10: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 4XB8jK6DYFz4RgN; Sun, 22 Sep 2024 02:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726971029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJBBVjjUW+TgFjVC/Kr/19/nWKnNXHG4QWYWCvMpGjo=; b=SnnmI1pBDAVlaSanBoCA5KPSxo2Wh2ZPoOZkjLpQbANm7/AFvndSMLaIUAFFxmvh2PhUzU O9sFfK0QNs7SrCkCI3Hh4LY4yX1WA3SLe6xlMLog4h6rY+UHwzD2stKjkvQjc8sjEmUeFQ dvs9RFAD+dIs8j1jQcFNwnzgvqZCNFh4gD/v/v7cx8Ydxv39E/zQdDYiz+m7dsAB1yt2pS /NRobkXeku40gpZcHzpu4EUynQ3EjBjyqwaPDufgaVwrWuMkwQcz5bWDSeeCqtW0NLg+0d y7HuCFowgeSkIAEIc1sWuBOMr/PGVNX5+Wklrr3aKBsiVuX6ORA0cqvkz5iVNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726971029; a=rsa-sha256; cv=none; b=AVYhNAIPQDAzSeizdyHS85zYafByYFb6uiDwuazCdtfjk5SmzBIs0C3m04iEKzdGTP0jJi xMH2P1gxTg2q1qvHHTI7x4aPnCibxt7KZUYu1twlxaLoz68pR5nUqfQklNFW++2Sdbu72E 2baIgyvS9FERjtGDLRaiCcrsQjxOvnb47H4451QzVGMJddf+rVf4iHFJw0Rxcs+5MIPFWR piZGMyifxza89TnlpSihhZs5pZyeqkLfqHYUPNUL9iCy/fbD3HbzMqR3xb0IkVwO3O0/UI l4H67eHQ14cklDWkXzBdEDZcI5XjY2nne73jydkt7agNhzJvvhZIbGNfdE9BBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726971029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WJBBVjjUW+TgFjVC/Kr/19/nWKnNXHG4QWYWCvMpGjo=; b=duUmdoqrSAWJkoE3cUZAgTA+7aybz6n9lt3blJy5L9xt+Xy410TVNbnn60QPFNZ9l8jm+q FNg5ajDQiKurtC5lzowhpworlZc1o16Ojg18JxKc1UBiWH9Ff1syvRn/NvmCuhzWI0DTSL 5It23O+k8TTmYEuR5LfII9MXYHZ/JKXGAqZpfgVznw3Bdqwe3YssW8unPqX8Tu8IjNOHe0 5Fz/hiFo0FTn9by7w7uCSvf9P1ExC9CDPNxewFD+rOMxCGP4biHIRbEaTqCU3/3MJf9jWZ h9PvfaotvgN554yJZ4hyLImXub12azGOQ0BHeTxc4dDGX3+/G33ThWsXbdQtPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB8jK5rgPzxj4; Sun, 22 Sep 2024 02:10: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 48M2ATw0044672; Sun, 22 Sep 2024 02:10:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M2ATkj044669; Sun, 22 Sep 2024 02:10:29 GMT (envelope-from git) Date: Sun, 22 Sep 2024 02:10:29 GMT Message-Id: <202409220210.48M2ATkj044669@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: 0ca553d761e5 - main - iflib: Ignore fa7045f99cdb in blame List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ca553d761e5832ad6ff6fab0a3b896c8fe9d813 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0ca553d761e5832ad6ff6fab0a3b896c8fe9d813 commit 0ca553d761e5832ad6ff6fab0a3b896c8fe9d813 Author: Zhenlei Huang AuthorDate: 2024-09-22 02:09:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 02:09:29 +0000 iflib: Ignore fa7045f99cdb in blame --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index d2cc2c9ff41f..025af986df7c 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,6 +8,8 @@ # # This file is sorted in git log order (newest commits first). +# style fixes for iflib +fa7045f99cdb2b699205653f42f3fe78597880a7 # remove stray whitespaces from sys/amd64/ f3754afd5901857787271e73f9c34d3b9069a03f # style and whitespace fixes for bpf From nobody Sun Sep 22 03:53:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBC0K0RNfz5XBQh; Sun, 22 Sep 2024 03:53: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 4XBC0J6jDjz4k3J; Sun, 22 Sep 2024 03:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726977217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKdTf9mkHpurAoeZ0hIRfltnGky4+Bz9mrmpnYcahpg=; b=gW7gUeowBKfjtYkhRAalo+gbK9TIxSIG8Ac6837d820lpl2g96ZD7X1KeHZfObwoDlHs4Y mcHpzmFM3g4ULga9+Lbt2rbNPyuFPnLg1KdNOi2vqmVtYarB3jv0Vne5fSxYzXB/f/VNsV bTwQZmChORGazTKTLDl8T9zlWLqLvcSImcSF+eo9UJ53il8AFF0vFvuxH+nzx/KFJiuoN1 6zUno1D1+0u1R/YQKvvbFS5No7NUyJ+l74lDP1L9kt85o8Dwwm90lGWXzzPr2K2MaRHB2b ne0w3/gth94BHciqwpe8Yvc9b0mAZja7vfbxNZt8TxVUfSs5hZeUsFnniEq31A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726977217; a=rsa-sha256; cv=none; b=povr/Xgpc/Y6y5SpokKQTteZv0yHP/CY291u+fOUaM8GEQwMBBHflZqoVXsgt+xeGWmfZY m6w+V639pAzxDw4xfZ4XAyKiUlP8mw34elBnfDVoL2Y1PJ67U1fyzDrAEY2GlQrUcuxVc8 MzZK8fkpFeoE3CMQVJX78muTYxFvHShg5sgwkb/sHgFHNBzP9eXHPoN9UKqaDVVPaWjozG +LAs0U1ODOCyRj0cBkfjY5CM4pcaQKQTvzku7HQmWHExbarKenATtfYqCdZnOGoEepX+oV ObkGePbhMQZUmScynOoXC8nAa4tuXqXdYOkoZsIxA9RrBywArbeakxDbKZaD2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726977216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKdTf9mkHpurAoeZ0hIRfltnGky4+Bz9mrmpnYcahpg=; b=KURWwm7n0CADiAQBcyEHQnMmoC/qB6uVk/sRz5OFuHicqPowa4eDDg2cZHyMENfTfnmqoH DOcHtcLKg9/gCTkDFl2+dugSoEbbZQwcm77FQUi8UY0c3wt0Ke7KFuV+53efj2ReogSPzf Gr5+Fl3t40+zm4LT0ItuIaAVnOjEVFzrXtaVYaQPNIO3LeM08H/Y97Kjrac7YymnqvKtnN WNu4RxympQLo+J2kVYH78sElcH5qguC50TU97NrL/sMe+awRVh8Nes860lqHVMh6TR8tvt jdsygDVuqKeUjgTXWos+2CoEXr2xMMwLHpkYcYDyQES80DJRoygJ0caa6yqiAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBC0J6CbVz11Qc; Sun, 22 Sep 2024 03:53: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 48M3raPT022493; Sun, 22 Sep 2024 03:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M3ra8D022490; Sun, 22 Sep 2024 03:53:36 GMT (envelope-from git) Date: Sun, 22 Sep 2024 03:53:36 GMT Message-Id: <202409220353.48M3ra8D022490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f6e1b5679211 - main - e1000: remove NEEDGIANT from a couple sysctls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6e1b567921187b9331bd71c86e94cf232dd7761 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f6e1b567921187b9331bd71c86e94cf232dd7761 commit f6e1b567921187b9331bd71c86e94cf232dd7761 Author: Kevin Bowling AuthorDate: 2024-09-22 03:52:48 +0000 Commit: Kevin Bowling CommitDate: 2024-09-22 03:52:48 +0000 e1000: remove NEEDGIANT from a couple sysctls These are internally locked already MFC after: 1 week --- sys/dev/e1000/if_em.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 3d815348f5ec..768522a821bd 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -831,11 +831,11 @@ em_if_attach_pre(if_ctx_t ctx) child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "nvm", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, em_sysctl_nvm_info, "I", "NVM Information"); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "fw_version", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, em_sysctl_print_fw_version, "A", "Prints FW/NVM Versions"); From nobody Sun Sep 22 03:58:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBC6B2LTPz5XBvS; Sun, 22 Sep 2024 03:58: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 4XBC6B1g3Jz4kk0; Sun, 22 Sep 2024 03: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=1726977522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u2Vn0+4hhnR8rxVA0xjNAHvrtlIHYzlkyo5cTOWkWR0=; b=PKuS6o9v1kkLObUHxHa9O27K1sFLvReq/RaGIQLCKZOCUnSYjNBrwV8Ve6Xp8JOtapntBd vft1TolY/eZ5ckI1kGerQ9XQxnSBuLD1eE+mrVC+WEo8ZbbYTPRml5D5eRURjXV60ARS8o xFgGDKzDvzdJllMvCP0GEBt8RZlP2PpkZEDIfNWhbeYx7YScKgTAsVnj7sa2r73I/euLiY TsXmhpoDyk54MhvWpzyoMV0OtByzpiHmPg0W3NWh0P7wuEC5vls6IkLTmX9L658BnoRYpa RJiUliw9+cGHgEUrz82K3Ymgb7ytisfBjy3ADxLPTdnS3pqfJ2OibSk4/bjGrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726977522; a=rsa-sha256; cv=none; b=E5ZL7jcrYF7ThTI80HS7KDom/1SCgHCAhliwEo/J1KpXegc3eREgXQoX14qH3Qyd9gP7nA 85J6borPhp31A6u84jKSFRVx9afMJRxy1hLNUFWOIj4Wfhk6RSwpBpQ412jSrcptqgZjCr RxWaoaQGYVbdyRHPF9yw8V4sEuTZd7oNK0oLSP1hBqboQWKAF0ETr/xhqOUR10lp5zWtkb 7gUWhesRfOOANPLJ6DmYxCQpS6jMtphiVUdwK+LMGciAHBzVHKhDTztuRubb6M4ZqqW3PK KSXw1++lieV4PPKvYh9x4Q4hN7Dep/aZMcJt3oqtqpwi8yImNDJq6IQp1MvrSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726977522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u2Vn0+4hhnR8rxVA0xjNAHvrtlIHYzlkyo5cTOWkWR0=; b=AcknaJ8em3BDtn2lB7KY73np2aIwVzLMwosPeeBbUKW5r3arcfVwZLVDtnE8sQLNdRg88E vwPuosDVzZYYMtIZmmk8ZwO1bzDlWJwn1yN+26bbSNj8IZZGACv6M8nV5kPLR76hyiYgjS VG37bivqZ/GghBuujiMqlylrUFVAbbAi33Wh4Xj4rt/DIcD8IZrgT4SNToz5LsSZwIv9uL 4NLqnmu6urU//GjkDY/IoIrYBOqxs/W8Jbn1TMC0wKLp0JRvKwPddyFnugNrlUe5GZQ/qJ I8UiFP/0y5JGfY2IbWQNHjaeRQLXyuuXM9X0JvKv0ZOzz7gnUp33G1cKWGWoNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBC6B1GdPz11hb; Sun, 22 Sep 2024 03: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 48M3wg8i023363; Sun, 22 Sep 2024 03: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 48M3wgiV023360; Sun, 22 Sep 2024 03:58:42 GMT (envelope-from git) Date: Sun, 22 Sep 2024 03:58:42 GMT Message-Id: <202409220358.48M3wgiV023360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e3a6e916dbba - main - ixgbe: fix misleading indentation in ixgbe_phy List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3a6e916dbbade2d4047e127c371ee0d0a25a294 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e3a6e916dbbade2d4047e127c371ee0d0a25a294 commit e3a6e916dbbade2d4047e127c371ee0d0a25a294 Author: Kevin Bowling AuthorDate: 2024-09-22 03:57:48 +0000 Commit: Kevin Bowling CommitDate: 2024-09-22 03:57:48 +0000 ixgbe: fix misleading indentation in ixgbe_phy MFC after: 1 week --- sys/dev/ixgbe/ixgbe_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index e3f311473c38..da7d16a514d0 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -1492,7 +1492,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) hw->phy.type = ixgbe_phy_sfp_active_unknown; else - hw->phy.type = ixgbe_phy_sfp_unknown; + hw->phy.type = ixgbe_phy_sfp_unknown; break; } } From nobody Sun Sep 22 04:06:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBCGm1ZVDz5XCg0; Sun, 22 Sep 2024 04:06: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 4XBCGm0zZLz4m8l; Sun, 22 Sep 2024 04:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726977968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fb7o0ytNuogvGIh4/bbI8c6gNf/n5BEAApHrt3jdBdE=; b=gpVC+i7Kwjib8EdTt7h9VTNUaPNOsD2MBe9L40ySUv+z5Y2cwgDQGVxeFJQP/qHn03bU0U WtaUEoTa8wn/Lx4NChKeG26eDCDwTrLCzQBw5Bs5MwezODpzjuDbRVf0O7eLNWXH/Pa+sm +CpnZJPsprbmyI2rYR81X88Ca4cmsdnXx/LM6mwhoW5N1mtQY0PTqUp8kzgvKHAzkoEPs0 Pmac1mtcprg2Jw3DeLHDVbeNKiI4263fixZu9cbHHyDZObG2+xvh3H5I9RxBQ8cZP5EUbm 9/6LDjERJ+mZ6elrzcBNb5IHQ1GvtQg8KxOG4AMTYGGbBqG7EkcBITP5opXcZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726977968; a=rsa-sha256; cv=none; b=hX5YjqPNXE8S4aj7mfvOqwW7r2TPOXqfnYebshnPy1Rmc+MRhf3kAgHCLOACAFFCo66vzw 0FGe7Uk5ucJjRijjGq7KPYpBgX8mdMyYa+XArViMXHgB1zm5QL37Fcsf8avFUTds4BfVp8 nsBHN/treRvwfh3TJtSsndXhqv8pJ2xp+RWRDFc6uRGpBZ98yxxTwA2n1Cz7dBUE8UuzlM ouPBiLELYszC475MBuhPKPpowc1A/qijsZYRK9kI5Mmy89UbauAN0BfH8+pYJQ7XFy49Fh jH1t1xOwXDz2EzZNKuMFZ6bIFE2z+hxymhhKzP5EKUa2ENbZonwXpTSG1H5x1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726977968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fb7o0ytNuogvGIh4/bbI8c6gNf/n5BEAApHrt3jdBdE=; b=j3atOoQa4BDqAirxsuSXi/KLxdtcLQ3DzZvbafAJeik3muWtZsVUxAJsdVQ4VOxmMU7kBh iCm86tm/cyTsvyrnKnagv0Q74wu+7w6QJ8XxejftQRqOKqzhKtf/CfU44g4UIwZoS02VMA nWnv0WMoc+KR+V1rh/AmbexvCwM/0ee3Nrpz98q8penuZSRy54NzczpndyndA1Vs2dRolJ h4o5DgFd0+WG1aqA+QP2ENEvpBL+NeaSSXi/hE/3jA3TuVhj6qZtclpBlWsiCQ181QrFt6 KTYRMvHP1tKtgxbBund6VGPYxIC1fruyjkkwpUeRmDZLbPDW5nop7cfdnZXl+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBCGm0Zr9z11sj; Sun, 22 Sep 2024 04:06: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 48M467MI040580; Sun, 22 Sep 2024 04:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M4674I040577; Sun, 22 Sep 2024 04:06:07 GMT (envelope-from git) Date: Sun, 22 Sep 2024 04:06:07 GMT Message-Id: <202409220406.48M4674I040577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c11a0649b972 - main - e1000: drop NEEDGIANT on em_sysctl_reg_handler uses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c11a0649b97281699e39d0fc82818f235c1dfb87 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c11a0649b97281699e39d0fc82818f235c1dfb87 commit c11a0649b97281699e39d0fc82818f235c1dfb87 Author: Kevin Bowling AuthorDate: 2024-09-22 04:04:38 +0000 Commit: Kevin Bowling CommitDate: 2024-09-22 04:04:38 +0000 e1000: drop NEEDGIANT on em_sysctl_reg_handler uses These are simple singular diagnostic register reads MFC after: 1 week --- sys/dev/e1000/if_em.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 768522a821bd..8d140979fbcd 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4433,11 +4433,11 @@ em_add_hw_stats(struct e1000_softc *sc) CTLFLAG_RD, &sc->watchdog_events, "Watchdog timeouts"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_CTRL, em_sysctl_reg_handler, "IU", "Device Control Register"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_RCTL, em_sysctl_reg_handler, "IU", "Receiver Control Register"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", @@ -4455,11 +4455,11 @@ em_add_hw_stats(struct e1000_softc *sc) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_TDH(txr->me), em_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_TDT(txr->me), em_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq", @@ -4475,11 +4475,11 @@ em_add_hw_stats(struct e1000_softc *sc) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_RDH(rxr->me), em_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD, sc, E1000_RDT(rxr->me), em_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq", From nobody Sun Sep 22 04:18:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBCXs3JD0z5XDY7; Sun, 22 Sep 2024 04:18: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 4XBCXs2bsFz4n4s; Sun, 22 Sep 2024 04:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726978701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6e6+agIrmUru8vhjSV65jk884vnh8dQ1CeoLYy4NXXU=; b=gz2xdADzZ96bTfRNflCOlc4olfJd6F+dhh2wCU1KV7zqxwSK70PHxrmM93rqO5xHUfsthi guwVoz0B4vizuPRyQWpCiUPEs8/V0li7bZ2VK2hcMf7ZArrg2zYDm73H4RtIL02ROXEvmh WOV9q8n/Rou7uvDgbaiTVaEP27eevOdgD4RtS/ZcX6EcnAZZi8pet/KaWvTKGKYPRDScYd gqCmDTQQkGX4LNDh6ii2oD01eFPdBOY/ZwxEZwiaTbJ9OBNTwmn1XS/KbakHv9B7nIx4w2 EQ2d5HpjrdE66q72RyjTOOURqSI7u3TIP8TXaUXcPh0io+USZdrUJ01o/4eYqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726978701; a=rsa-sha256; cv=none; b=xmCUMybnZu/55JIkDWI9aKCJ9b5xJhFNsE+Uw23JedlEsbnKjTIF45UzsydWerkPM6TOeM YcSP8Tm/GOOgUl1OUav02ATKHqqfYDDlWEQfJs95L3dfdqP6IiFc8oMyXCbuyOud1DOal6 BLhSSzvDUPpDCdhrX82hKXgZPAJFS5Di+7MH/vvyS6Nd77LX5PD2jqk6N9lKU/mECRSWon PyvqNBrn2wiCSaI59dxW5s3WghFWWqDo19vO46XAKi8SztYXQRaK2COHSjQF8PyifKPnc5 pHxAtsTbw+fmfLw3o4RABLFBaCpep4LK1AgIMHQ7m+jT2ZkPgUZh4NAF7rmrjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726978701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6e6+agIrmUru8vhjSV65jk884vnh8dQ1CeoLYy4NXXU=; b=YVgEvYVM+XaWy9I5iwl5E8w0oKIWerJz3swEsXv+bL05SUPiyQopEJbfOxcZXAVh56rkTu gFTsaWrm4MF6x6i8YvnB4w7MHxn3+JUa3wRWakbAqW5YsdNlDWHIMgCB9lqe56UHCBraJx ElX5YNP+4pHBZ2EHsVCQYavD4ie8/3Atqhl43bk8rpKvbpN+wQBa6NkYu8IxdFroRzMF9f VQ3CpHb7Qd0AXpritCorL9QlIiZckqwRWihEwXBteeDygj5Br1YRPvTuIxDnZK0oODsbCu m10fDFoug8jLWZTU7yJji651UwG7ye9CVQq2NRyAMtlQ/QctxivPQ52YM1aqGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBCXs24Xwz12HX; Sun, 22 Sep 2024 04:18: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 48M4ILNP057403; Sun, 22 Sep 2024 04:18:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M4ILjh057400; Sun, 22 Sep 2024 04:18:21 GMT (envelope-from git) Date: Sun, 22 Sep 2024 04:18:21 GMT Message-Id: <202409220418.48M4ILjh057400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5f6964d9fbf6 - main - e1000: drop NEEDGIANT from em_sysctl_debug_info use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f6964d9fbf663f85ee60dae7dfff153b82759d8 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5f6964d9fbf663f85ee60dae7dfff153b82759d8 commit 5f6964d9fbf663f85ee60dae7dfff153b82759d8 Author: Kevin Bowling AuthorDate: 2024-09-22 04:17:30 +0000 Commit: Kevin Bowling CommitDate: 2024-09-22 04:17:30 +0000 e1000: drop NEEDGIANT from em_sysctl_debug_info use The write is only used to toggle the debug print function and this is otherwise stateless. MFC after: 1 week --- sys/dev/e1000/if_em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 8d140979fbcd..e2d8535143ef 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -840,7 +840,7 @@ em_if_attach_pre(if_ctx_t ctx) "Prints FW/NVM Versions"); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "debug", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW, sc, 0, em_sysctl_debug_info, "I", "Debug Information"); SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "fc", From nobody Sun Sep 22 07:36:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxg4q8Jz5XYPl; Sun, 22 Sep 2024 07:36: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 4XBHxg3sftz44h4; Sun, 22 Sep 2024 07:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6LHW/8OIXSd/ckrdqmnuNirduzZNXZj+5Ad4hS0JJNY=; b=grFQsuKwEioENgjWdS76vr7Jir5WVTQDEwhYCkvGxcGbk4zHtcRviUArv4Rz+cs4i1ZzMw FFlfysXf8Agenh4CvEIAVT5zLY5ciVBqB5J9+EEFKPqlpyTnFrAgGaSqlFhUJMdOQBZI9V Mpkk96L6+7mR78PUk80bM6e0NHSxnN/LM4GfRmnqT7ejeZuK23JYD8gSiex8HZbd67DMMd GfMOqfeZfkZrMXx/nYicN4EpOo0qW4eltPdl9W8JqhCLbK12xnyTyW7xOTfBOQeBeTsubK EDA3fljDM60cfwZpvuDGDEl+V2UGgrJtm6WE7DcJjfetITGtP6PERk1P0vaJJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990599; a=rsa-sha256; cv=none; b=ZkNAauOjs7olyBnoobU1OQfvn4ZqUP0zZNYOve7nvU+Jj2pXSnGguOhPyS66UKdYhKAj+Q +/n63gmAXe8yXyKCRQijDtalrjy4dpMXMw3zTkXaqgb4zbEKyll/grW0QMH14rKTGChuNa VFJ+2OfxQr3FfqIMPcbcF7sSZ+0LIj9xa2eDwZjtnzkMI6EJHvWk7QR1SaehvkMpXgsdOo h8QigsdaMHDPxYutAYU1dDCDKKqsV/J/SzliNhpnt6ypIsF4o3mgzZkg/zWqv71tA8pJQ7 U3XE7AmoKeTui2rke308hbe/6TNwFi1zI5fTr6XOZ3JsuJaoGBxKom9+0uSKOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6LHW/8OIXSd/ckrdqmnuNirduzZNXZj+5Ad4hS0JJNY=; b=SG8ps0HkaiXwIqM532HZJJDjIObvuVPPGfTu5KVU5y9YZ2HBVtPcXWlTi4Djrj48DOgrDu 4Yk+ECDQGBEFKEGVNsFckaXCsUNahnOmipabAfjHuWcCn9YZoDX6zC/Mqf4X/aFgue4mzk QMAFzaowc0/7sON2YkaQHNa1KiQlC1yYIT2GDlXwvA6D65sGdZj2sN9Q+Cb+AVxVKt8qp9 tCq8Ekah5nBUfjLUVPH+bOYTO3qm89kJqldRSFTN33CXckHFTRh0wk6WjsvqU0cmK404Zr DzepQOhUvOLFd7U0GidfxAxJDmscoc+rM6Ce+RemCvfYrj0Bbf50/O/XGjU0yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxg38hjz16fQ; Sun, 22 Sep 2024 07:36: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 48M7adIl096990; Sun, 22 Sep 2024 07:36:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7ad03096987; Sun, 22 Sep 2024 07:36:39 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:39 GMT Message-Id: <202409220736.48M7ad03096987@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: 32fce09268dd - main - random: Avoid magic numbers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32fce09268ddd97efb4412529ba57293554c5985 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=32fce09268ddd97efb4412529ba57293554c5985 commit 32fce09268ddd97efb4412529ba57293554c5985 Author: Colin Percival AuthorDate: 2024-09-18 05:12:04 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:47 +0000 random: Avoid magic numbers Move RANDOM_FORTUNA_{NPOOLS,DEFPOOLSIZE} from fortuna.c to fortuna.h and use RANDOM_FORTUNA_DEFPOOLSIZE in random_harvestq.c rather than having a magic (albeit explained in a comment) number. The NPOOLS value will be used in a later commit. Reviewed by: cem MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46693 --- sys/dev/random/fortuna.c | 2 -- sys/dev/random/fortuna.h | 4 ++++ sys/dev/random/random_harvestq.c | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/dev/random/fortuna.c b/sys/dev/random/fortuna.c index 53b629ac378c..c4282c723a44 100644 --- a/sys/dev/random/fortuna.c +++ b/sys/dev/random/fortuna.c @@ -71,8 +71,6 @@ #include /* Defined in FS&K */ -#define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */ -#define RANDOM_FORTUNA_DEFPOOLSIZE 64 /* The default pool size/length for a (re)seed */ #define RANDOM_FORTUNA_MAX_READ (1 << 20) /* Max bytes from AES before rekeying */ #define RANDOM_FORTUNA_BLOCKS_PER_KEY (1 << 16) /* Max blocks from AES before rekeying */ CTASSERT(RANDOM_FORTUNA_BLOCKS_PER_KEY * RANDOM_BLOCKSIZE == diff --git a/sys/dev/random/fortuna.h b/sys/dev/random/fortuna.h index cb4683514989..7378edb9238c 100644 --- a/sys/dev/random/fortuna.h +++ b/sys/dev/random/fortuna.h @@ -27,6 +27,10 @@ #ifndef SYS_DEV_RANDOM_FORTUNA_H_INCLUDED #define SYS_DEV_RANDOM_FORTUNA_H_INCLUDED +/* Defined in FS&K */ +#define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */ +#define RANDOM_FORTUNA_DEFPOOLSIZE 64 /* The default pool size/length for a (re)seed */ + #ifdef _KERNEL typedef struct mtx mtx_t; #define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&fortuna_state.fs_mtx, "reseed mutex", NULL, MTX_DEF) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 4605d811a239..a8ccabd1a902 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -54,6 +54,7 @@ #include #include +#include #include #include #include @@ -259,8 +260,8 @@ random_sources_feed(void) * stuck for a few seconds with random_kthread gradually collecting a * small chunk of entropy every 1 / RANDOM_KTHREAD_HZ seconds. * - * The value 64 below is RANDOM_FORTUNA_DEFPOOLSIZE, i.e. chosen to - * fill Fortuna's pools in the default configuration. With another + * We collect RANDOM_FORTUNA_DEFPOOLSIZE bytes per pool, i.e. enough + * to fill Fortuna's pools in the default configuration. With another * PRNG or smaller pools for Fortuna, we might collect more entropy * than needed to fill the pools, but this is harmless; alternatively, * a different PRNG, larger pools, or fast entropy sources which are @@ -270,8 +271,8 @@ random_sources_feed(void) * try again for a large amount of entropy. */ if (!p_random_alg_context->ra_seeded()) - npools = howmany(p_random_alg_context->ra_poolcount * 64, - sizeof(entropy)); + npools = howmany(p_random_alg_context->ra_poolcount * + RANDOM_FORTUNA_DEFPOOLSIZE, sizeof(entropy)); /* * Step over all of live entropy sources, and feed their output From nobody Sun Sep 22 07:36:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxh5Zt4z5XYGn; Sun, 22 Sep 2024 07:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBHxh4WwVz44bh; Sun, 22 Sep 2024 07:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UHGytk8MN5kD5w1VvoS9vIc/ZJpmUNhf2USuqtqeFXw=; b=pWvMU6Nok+uB1M6CejFpyiRantBMNBTgzk7ZE8QFbHP6Ix7o8oGu78uZiMfVV1wOD+Ao2+ ZExAKzikZwyr9byTuENbog8N404vOCyNQjvptlm+Bc3ttcIwVrxgiDoGT+ptDrqeQkh8Yk pMKPCxbu9sD+7jcbEopAOrNq9TZ3sFU+zrdcDdeAYLqxu8oJXYtsJGaVOhoRvqemlA8Sf9 q+s1GBQTdg0A3gIKWaAgmdQfgQN0oPNeupnGVoLCyW98QlvFArrVORj6ex+QhTrIfNNDV5 JuPOHZLgZ4azMkqml86S9J6+Xk2svbuPO+NoTH2QclZxqUTFvt/0tyVTnAybfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990600; a=rsa-sha256; cv=none; b=hj38zctiPxhBKIM7FHOH71/N5V4N94oEhYjrKfomVWqjc+yHsdxwjzN+RFFDOkZGb/Jknk lUYI0iGiqhrCgo2Bw036b9gYIJgA1v/FjCXt0sgwlkVvUFEBBfEBTNhU95KFtPE3VGGXRj D4+ELKmSVkzxf3TKBWRopfgJoyvtNPAm/6o2kY05UJCweMqKHZqdR4XiL3SOyQn1CgZu0G xOGIK5AYrUMFiGZwzAIH1Hs49Iw5MNAULguICrMGGkUWuO9kRs7asitgISOnBfcYXQWHRz X71GXxp4D69keBxztH+tJIwCVwBx9YcpbhNiHznRqZShygqOf3KEMqeV7boP6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UHGytk8MN5kD5w1VvoS9vIc/ZJpmUNhf2USuqtqeFXw=; b=dsuRO4XmbitRmW+TvIc0yBuwzdWBHxTjjgPRXHlanum+En3JrLfctZz8gXfMw/q8rSqhaA 6hYmS/XcrYajjGi74DPtyBLR7kIMZq3OMdrb0YlLuwJuHLdHzz4qEDVMxBmYnlIZwQlaZe +hhbNIG7+OOmavKVQhRpAIEsumFoEQBOOmGx/AYJ15kAY3P7zGM9GeuU5f4wzWGmVgWUoR kfFE74/6eRSaHuEOVhpdsdYXBEKW4rnkC4/iAr99Tl4NrLIz7VHl2SVXtKsgThuPmIjCNt JzrMDRDuiu8TCavFLmbsPSpuvftAghM+rpEKrAjdb9r7BRfdmtYgvDaAHK6Xcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxh47Tfz16sv; Sun, 22 Sep 2024 07:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48M7aeRd097037; Sun, 22 Sep 2024 07:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7aeZK097034; Sun, 22 Sep 2024 07:36:40 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:40 GMT Message-Id: <202409220736.48M7aeZK097034@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: 58ec2d0d4a3c - main - loader: Add TSLOG to interpreter built-ins List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58ec2d0d4a3c3bcf741d9694dc7696c7b4e753b9 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=58ec2d0d4a3c3bcf741d9694dc7696c7b4e753b9 commit 58ec2d0d4a3c3bcf741d9694dc7696c7b4e753b9 Author: Colin Percival AuthorDate: 2024-09-18 11:01:41 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:47 +0000 loader: Add TSLOG to interpreter built-ins Wrap each call to a built-in command with TSENTER/TSEXIT to make it easier to see where time is going in the loader. MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46630 --- stand/common/interp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/common/interp.c b/stand/common/interp.c index 5d20822e037d..e1fa4f9582ac 100644 --- a/stand/common/interp.c +++ b/stand/common/interp.c @@ -190,7 +190,9 @@ interp_builtin_cmd(int argc, char *argv[]) cmd = interp_lookup_cmd(argv[0]); if (cmd != NULL && cmd->c_fn) { + TSENTER2(argv[0]); result = cmd->c_fn(argc, argv); + TSEXIT(); } else { command_errmsg = "unknown command"; } From nobody Sun Sep 22 07:36:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxk0sLWz5XYDw; Sun, 22 Sep 2024 07:36: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 4XBHxj5Qxzz44h8; Sun, 22 Sep 2024 07:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4DBXTG/Si0XbAkVbLo81Mdu+Tjnx0H/8Oa0DSmecX3o=; b=k0t4MLmd1Ua09bqlrpRCf+9A5CTaCn62yNXYxnaVJ/QSr81bw0XPAQLOW2o0CsLXDitjEd C5u+IXiY3tNX/3IGOAI80dsL15O7LsQp10cwQ2XmNLDErhkOLpsHnsUMXHde+MIBQZRVAM qVIlPaI9ixZg6bE7M+m56GKNF/XLlFSjGeNMOphwEBUBjCaSUlwvZXIQ4azqmjacCgoc6H uxuiZOqepn5285LNMX84nNGe7U2mCpPn77KYfYqueu2rgS3W/SiATDbxJwxoTgvnPK7Ds0 +a9iLwHuFW+lnnGj+SMguZ26C4PvY6sA8W0psDfzqTf0M4P/+sPS50xGcxfQWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990601; a=rsa-sha256; cv=none; b=V5JBiKwQVHR/ybES3stNvPZHGOJpYSF12p9QDkKkxspUXk8iioBtJBXvMOZiGsd7bm3PQ9 hKOriPfEmYayK3uo3T/A5ZYszRqQjYSpktxCtTzD8w+hAYQE14qh8UwHeDazmdQq4JsOBt 5fWc5u1R8hPbXnmRfsUbSNS6KFMNyQPjrLbw4SOEhAsue+NcIm3Mepcmou2mh1gX0yvW0F Rq6W0LwYaBCYsFXTrrlss8QJJpgYtUVbgI2/mhpo+3VVEM3RynFjnAuTt2bXnwuIhS5V03 x2AM+miap5vZlvDdQG/DpfdD1x9cGSgXw1e4HMgGACxNM8rLfJRgi2WqRCU+2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4DBXTG/Si0XbAkVbLo81Mdu+Tjnx0H/8Oa0DSmecX3o=; b=Gv1B8v4EN1B3bX46SCI0+c6WObDaoCdTxiOLnKAsSVDKdckwSH84OmZHnV1lXVVZ02vDbq 9LdtTmVo5fVgCR13jv6w2mUGrbw9bRcTV48bmSLhwnlDZkfQIIzmwf290fqa1UBWiTBnfr MQhtIHEKOEfPfD3I23yoSgzcocPtUMMXfvK9TJ9c2t/snhQJ5LLButZRz07odf/EQo4T42 nDtvejBqUtDqxhQYNwbv7hIzh7HKh0PYb2rK1lXtL9XagaEk6pOnNqBKHth7T3GffFtpSa klKTZXVxHMP8GKb8QVs0CreTdfzO2rdrYkcLu5Hw69OThNYHM3ZRfkR7YMDfww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxj4q4Kz17Lh; Sun, 22 Sep 2024 07:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48M7affG097090; Sun, 22 Sep 2024 07:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7af2e097087; Sun, 22 Sep 2024 07:36:41 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:41 GMT Message-Id: <202409220736.48M7af2e097087@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: b58fe4eb29fb - main - loader: Instrument EFI GetRNG with TSLOG List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b58fe4eb29fbd3236df0f7fdfad4393d2536dbb5 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b58fe4eb29fbd3236df0f7fdfad4393d2536dbb5 commit b58fe4eb29fbd3236df0f7fdfad4393d2536dbb5 Author: Colin Percival AuthorDate: 2024-09-18 11:01:55 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:47 +0000 loader: Instrument EFI GetRNG with TSLOG On some systems, the EFI GetRNG is slow. Make it show up in flamecharts. MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46631 --- stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 790d5c0ce1ad..17676cd9deb8 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -1268,7 +1268,9 @@ command_seed_entropy(int argc, char *argv[]) return (CMD_ERROR); } + TSENTER2("rng->GetRNG"); status = rng->GetRNG(rng, NULL, size, (UINT8 *)buf); + TSEXIT(); if (status != EFI_SUCCESS) { free(buf); command_errmsg = "GetRNG failed"; From nobody Sun Sep 22 07:36:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxl0Zzcz5XYSH; Sun, 22 Sep 2024 07:36: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 4XBHxk6YbTz44Ym; Sun, 22 Sep 2024 07:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pn1+nGaQZgG7wgknu8eKXYdVLZgbKfI/3/ndvw5Vf30=; b=YJ7XVAw/OPof6KsLmsnNLfSfB+9jBwxJ+GV5ZII4ag9b4ziOXmxelWqLy5fA0VuzaCi96p 7Sc8xYSnaFPaGQ/B6UcvHDc0HSiRInOs+6wONsKW78GsOhkxSOPrAlijHezMdUEw5tX8bg kAtprXKmU3K9Lef7D/9ZY3rud9SeiS/zsbiUMU9idjMnXWljSbAj9lWPX2GNiazGiRKVzt +g2uS/d/iVS/D7c8r4xI+9KQ8tvx1ED1BLfc9sioK55/v8EKebuHnbcodbCmGcPlsyFywF No6hQwR82Vjr3/fh5S30o/GkhBSCpJ1maeDG2uYOWapJHLxxx+c3ZhFjDfaKkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990602; a=rsa-sha256; cv=none; b=Wlr6XgJ2GiuRJ+vgHh2xrHyDEKFQDaYEX0yQ2kMvR6BpCDOH0ahLFlMiwLlYnwLbSZLkAZ 1TWdfwhQUH2FnQixTXbTafo81IRGT6qOEht/BWITOhectQmDg5QUJMrJuB1BJndeCcbOCL dv4mLFIm/kogCBwThcS6nrCsfDkTILsivIV4ycZv9ylwfNEgtsmT4edRKn6doUXFoIQ5Sp 4E+GOnD2HKmVT8blkepxmN1HOcUe+ehzy1vAjBg/oWYBxgIbaHWAi54E2hZSwhoy9hLnNG yMI+W/pmWNxwyzXw41HxiLUaNtQDhwLxu/aDNL1FjNNDbrKy752+C3+QAXKxoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pn1+nGaQZgG7wgknu8eKXYdVLZgbKfI/3/ndvw5Vf30=; b=DglwOn+VB+Ol6kgpChAy8GHExwNuIoz3GfXOvczJgHQ5itRpwn9wLooAEcVeOj0S7XtjLn /5uKCq/twZnY+ooNaWDlPWXA4ijBul/2gRXcUrVi35ukncKre2gPwZj7psdDC5SSp0wcvn gRplZd0Sw9VoUdc8oaz/p2LC69qOnOVOyYx8q51/gltaHBxQri+M1+sOOwvi3VuFbKpvCv K8DsNqzxTD8xE8tgU0Nn+QpIb6jc7FkkMYARAUTaWzdIAWhy4y9IQ5QTpjAqs/2n1UF/8R smKLlDw0zLV9Wkd+ftTwTA7v9elZoTgded19M09AyNpHw/sHOZKKoKvuWJsQPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxk67BRz17Lj; Sun, 22 Sep 2024 07:36: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 48M7agcd097140; Sun, 22 Sep 2024 07:36:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7agEx097137; Sun, 22 Sep 2024 07:36:42 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:42 GMT Message-Id: <202409220736.48M7agEx097137@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: f4a69a933cd6 - main - loader: Make EFI entropy size configurable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4a69a933cd645e384b337db5ef2ccf41a1ddd5b Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=f4a69a933cd645e384b337db5ef2ccf41a1ddd5b commit f4a69a933cd645e384b337db5ef2ccf41a1ddd5b Author: Colin Percival AuthorDate: 2024-09-18 11:02:01 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:47 +0000 loader: Make EFI entropy size configurable Add a new loader variable entropy_efi_seed_size which defaults to 2048; if not defined (e.g. if the /boot/lua/ is updated but /boot/defaults/ isn't) the same 2048 default will be used. Reviewed by: Val Packett MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46632 --- stand/defaults/loader.conf | 8 ++++++-- stand/lua/core.lua | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index a5d27b96b6ba..c3de7cdfb74b 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -48,8 +48,12 @@ entropy_cache_type="boot_entropy_cache" # Required for the kernel to find # the boot-time entropy cache. This # must not change value even if the # _name above does change! -entropy_efi_seed="YES" # Set this to NO to disable loading - # entropy from the UEFI hardware random number generator API +entropy_efi_seed="YES" # Set this to NO to disable loading + # entropy from the UEFI hardware + # random number generator API +entropy_efi_seed_size="2048" # Set this to a different value to + # change the amount of entropy + # requested from EFI ### RAM Blacklist configuration ############################ ram_blacklist_load="NO" # Set this to YES to load a file diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 7b7560ddc820..72b19462ae5c 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -369,7 +369,8 @@ end function core.loadEntropy() if core.isUEFIBoot() then if (loader.getenv("entropy_efi_seed") or "no"):lower() == "yes" then - loader.perform("efi-seed-entropy") + local seedsize = loader.getenv("entropy_efi_seed_size") or "2048" + loader.perform("efi-seed-entropy " .. seedsize) end end end From nobody Sun Sep 22 07:36:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxm31SLz5XYBv; Sun, 22 Sep 2024 07:36: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 4XBHxl70w8z44Qq; Sun, 22 Sep 2024 07:36:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlY42FYZ9Pe7ASvcs/5r6vlgtUrPnKb8j7HnA5kHyWE=; b=n2D4XMqYHMB/o4UT6bYwn8Ys1WiNIgWNtXveQJolSbCnX+0mj92qz02zeXgW24SfwaJdqu calUHBL9xhdAZZCJJyCFfkvacT1JHU7gSv7sXveJe5noH75Cz/rOZB/aTSQ3//dpAyRPtQ AuOLejDii71fgwAoJfOJomPdBZjB+sd1uMQmTtXLporvvn8eU+9IANvB64audQZ4iv7rVM yw79CarkDxDH0zErUsb/AGc4F9D+URXKIQZRaTiCZEN8XfZefijxhzhTcqo8F2eWN4MThc B4fF0qWA1VcFGwyTzk5WaHNwiOJJQnQmQAj2mFG58tE8vdMsj/87oLsdOJnT4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990604; a=rsa-sha256; cv=none; b=C3h591JDu7YaJNNrX5ZwyhD/HVqYxaFDE0OjCnn+v5iYMPKrFtQt4YmfsZjyaV5art5NlC Krrszf11IzEte02QjD9apkbsfFou2YUb2P8SIV/6dfgXWpz1Dq3Ap3yJwQs8BSHeHtYTX6 vNK4AC2ORMmNLHLbbm46mHLxVTTxfQ7TgV55BVR7mDz2cUVmxmvrK6mK74NevWp0gr40Co aV+6DPwMiwpYz/CmFgOBUsG26FDXLdc0FE3TpfRbMTTc+GsN9WF4VPwFkWESJ1+jieWK0q vHBPoUhX5dhb5NtY6bV6liXHrwrraah1v26ylFkNCH8XP9oQc+XY2zSevKprmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlY42FYZ9Pe7ASvcs/5r6vlgtUrPnKb8j7HnA5kHyWE=; b=i8lX8BZ6dpibCSxOXYxMe3ij3+Jcnb/qqm0yUlJAgdEa0utNfgYWZwzB5FZcPcvTpY6D8A HOWhqEYyI43fJedDmg1PgTVFZ3Y+x9HvkjPjBz6GQq7Hb7/dRLsSk4p5HFSGTnAeiaiA/P GoycO6bPPp0ZExcvQy7xjaZe3gZQdRyG/DvCworoR+CnQI6GS/ByMuon/L8XtHkqLunL6Z OLW59vz/X+60mXdjiiUJBy8QOEM4yHJ+vvaggMOADLwUUu2yRQhRIFAQSdeZXilSuWAUEM TTwTCjTkVFIEVDP0KoWpPotxQgM0uwhFe65FCgbn4JS/nRKUqSRt7TLgwL2+nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxl6bwdz16qY; Sun, 22 Sep 2024 07:36: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 48M7ahJ7097179; Sun, 22 Sep 2024 07:36:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7ahk2097176; Sun, 22 Sep 2024 07:36:43 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:43 GMT Message-Id: <202409220736.48M7ahk2097176@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: 8ce291a335bc - main - pkcs5v2: Add pkcs5v2_genkey_raw function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ce291a335bc751e7a89691eebfb9f9da65b82ac Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=8ce291a335bc751e7a89691eebfb9f9da65b82ac commit 8ce291a335bc751e7a89691eebfb9f9da65b82ac Author: Colin Percival AuthorDate: 2024-09-18 11:02:05 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:47 +0000 pkcs5v2: Add pkcs5v2_genkey_raw function This is like pkcs5v2_genkey but takes a "passphrase" as a buffer and length rather than a NUL-terminated string. Reviwed by: pjd MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46633 --- sys/geom/eli/pkcs5v2.c | 13 +++++++++++-- sys/geom/eli/pkcs5v2.h | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/geom/eli/pkcs5v2.c b/sys/geom/eli/pkcs5v2.c index 546f1d64af83..c4cecf4782ab 100644 --- a/sys/geom/eli/pkcs5v2.c +++ b/sys/geom/eli/pkcs5v2.c @@ -51,13 +51,22 @@ void pkcs5v2_genkey(uint8_t *key, unsigned keylen, const uint8_t *salt, size_t saltsize, const char *passphrase, u_int iterations) { + + pkcs5v2_genkey_raw(key, keylen, salt, saltsize, passphrase, + strlen(passphrase), iterations); +} + +void +pkcs5v2_genkey_raw(uint8_t *key, unsigned keylen, const uint8_t *salt, + size_t saltsize, const uint8_t *passphrase, size_t passlen, + u_int iterations) +{ uint8_t md[SHA512_MDLEN], saltcount[saltsize + sizeof(uint32_t)]; uint8_t *counter, *keyp; - u_int i, bsize, passlen; + u_int i, bsize; uint32_t count; struct hmac_ctx startpoint, ctx; - passlen = strlen(passphrase); bzero(key, keylen); bcopy(salt, saltcount, saltsize); counter = saltcount + saltsize; diff --git a/sys/geom/eli/pkcs5v2.h b/sys/geom/eli/pkcs5v2.h index f271f17a68c1..02e3fac02fe7 100644 --- a/sys/geom/eli/pkcs5v2.h +++ b/sys/geom/eli/pkcs5v2.h @@ -30,6 +30,9 @@ #define _PKCS5V2_H_ void pkcs5v2_genkey(uint8_t *key, unsigned keylen, const uint8_t *salt, size_t saltsize, const char *passphrase, u_int iterations); +void pkcs5v2_genkey_raw(uint8_t *key, unsigned keylen, const uint8_t *salt, + size_t saltsize, const uint8_t *passphrase, size_t passlen, + u_int iterations); #ifndef _KERNEL int pkcs5v2_calculate(int usecs); #endif From nobody Sun Sep 22 07:36:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxn4Xp3z5XYH0; Sun, 22 Sep 2024 07:36: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 4XBHxn1BwYz44hq; Sun, 22 Sep 2024 07:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5oxfBQLes+yrDz1Qf3hVOEWCe5Ctt+DbFQMohJRAg80=; b=qUr/jbU8D5l4eC2fwetH8p88B+AdmGSo3VFMFNQVHKO8zu1aXMUuoUDdWcCVV6YsxzVpAt Ud5sEkWbSRPjg6cMCbe0nkFfgP7jNUwaBsfPpsnGk03tr8UEWlkOvgGM9mh3bgx1UpRi+6 ljQ0ygPUABVryBpc3UGupbgoljSj/5R71ai5q0qYy2lOZBePEby50toCPiJJXuDvel3CUm 7J8HiZ+ZW4vXyVBwZ4OIMDyxAQ2r9ZcvanfyCQyOc4KCcw8r8jHO9NxixI1+utXmFEkcg6 Zh+JQGg8gVFsBkUJQnNKrY4OLrQhqQp+jOj7JiI/oRiJgDbw2DlApRj+KUlVdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990605; a=rsa-sha256; cv=none; b=dW5QOEprkZb9WUDN8lVYggZbNR0VR7+DmUlEC3Rmz9n4//yPD1OwVXrT1SxmH0MMd6fPuv 24eGVTE/qj2mWP0PkoHQbsK8nOPRgGqTtlYyfOK1fFdmrb7QKwrPUdQSOQZi66N2d4wIkl c34AEFi6QHwcsNC0y/W8KDCb04lOBXzqmbOp95cTRtFKZjEgYvkKd2d3Rq8R6fTomr7O3y duwmkglUKpVzpZNEJhHI67oZhUT5+yfsYWomQQ7zlB4sYt2dTSZ7ku437l7aIGxKWJn6Fv w9KsyCA0z22/5TV+tHPb6P3MjuaOynuJ+pFlQBKiB+zRWjTYO3fJj0qQ78S4bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5oxfBQLes+yrDz1Qf3hVOEWCe5Ctt+DbFQMohJRAg80=; b=AFwvpB/vDfEisnm9wLnSuo8+nIIgI3Yn78JGYBPPOZ5PyovVsH6/ad8B9nJR2PgQ4BzSO+ Xjx812Jl3YOTcsw0rlJP8c8FWcrObSQsoFGrN/ggFiIzcB9AmtakgBh5LpnfNm/XxDMjRc p/NYOp86yuniU3gmdaZ0kb0vmi2RcOM+FyteLpaFjLUtq78Nv2AxUmXiLf0BWXp4nf/Ela qEEW2MtZHWuMTZhXmJ9ZKJEO00M/2WEATPZ1ijQrbdpb5M5De9CUzs8n3KmaL2xw7FDT+E VVc/WCnEg07zdwAvEGq4R1N2JCr7b5GgrtJeYNVcOqQqqey+49CDIJlvhjsVtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxn0qJFz16qZ; Sun, 22 Sep 2024 07:36: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 48M7aj3m097221; Sun, 22 Sep 2024 07:36:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7ajnT097218; Sun, 22 Sep 2024 07:36:45 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:45 GMT Message-Id: <202409220736.48M7ajnT097218@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: 925f15731e34 - main - loader: Make pkcs5v2 unconditionally available List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 925f15731e3480fe80f580a2f7463cb5210a95c8 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=925f15731e3480fe80f580a2f7463cb5210a95c8 commit 925f15731e3480fe80f580a2f7463cb5210a95c8 Author: Colin Percival AuthorDate: 2024-09-18 11:02:08 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:47 +0000 loader: Make pkcs5v2 unconditionally available This was previously only available if GELI support was included, but I want to use it for processing entropy from EFI Reviewed by: imp MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46634 --- stand/libsa/Makefile | 4 ++++ stand/libsa/geli/Makefile.inc | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index c5de2c9b8e13..dda3bfcea88f 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -164,6 +164,10 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c crc32_libkern.c +# Bits from GELI which are reused elsewhere +.PATH: ${SYSDIR}/geom/eli +SRCS+= g_eli_hmac.c pkcs5v2.c + # Maybe GELI .if ${MK_LOADER_GELI} == "yes" .include "${SASRC}/geli/Makefile.inc" diff --git a/stand/libsa/geli/Makefile.inc b/stand/libsa/geli/Makefile.inc index 07600d5287bd..8300359a465a 100644 --- a/stand/libsa/geli/Makefile.inc +++ b/stand/libsa/geli/Makefile.inc @@ -21,10 +21,8 @@ SRCS+= ${i} .endfor SRCS+= geliboot.c \ geliboot_crypto.c \ - g_eli_hmac.c \ g_eli_key.c \ g_eli_key_cache.c \ - pkcs5v2.c \ # aes .PATH: ${SYSDIR}/opencrypto From nobody Sun Sep 22 07:36:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxp6pQ2z5XYSJ; Sun, 22 Sep 2024 07:36: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 4XBHxp2JD2z44RC; Sun, 22 Sep 2024 07:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=17NhGn9Y+1OSXbmSPy4e6pmU6j6TrSlXehwQLp+Eq/A=; b=JgENnH0zWtPfILtQpHuIdpI1oqPIYWi477UX0fIOtcYkkRDoBHA9tP3uigcj5YdxdtQl7Q xZIVdpIlceQBb1B6+4BbGqmQdncex6RvgDYaRb7A4g1Zh8i31OLiwUZ+AAhQYu4JCUudXz /+1SiZKrqxni9J6kkQV1gtpqv49noB42aic5CyCwDp9G19AswRH7OlCj/+pxE65qKQUoQw T/or4AkNOxw3XVD+mJE/X3cDRBXzlafrry1c7yLrEKG+nnN5aqqMESQEk61TVxxDgEqCXf 7qo8kEzYn2+M/94tudHCEQDpaxq//eYvb9SURDwChiOZKRRZ+RZ3SKtJ2MjLDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990606; a=rsa-sha256; cv=none; b=fkpzL4Z0j0Weqv4GQrKPxkd9cucHNoxJyztfUNS3oSwghHaoUimdEa5GXz0BhI7SW9qoAY JKuNQaFRtTltn5MxWcUSR+FtdvaK31amHBJmu6yCXQ3YbMgQHJx3P2KJJzdOmnxTKc9KOG 4IoaKJR6SE+Jrq+E+LyKrwhSBMKzyKQlLmTq398yO+ntADSZ6qvTC5RNLgCBqrmqp+TXl5 d49QUa3qGDNuVPzG6rvU1SSfBnPqt7/ooB82gFh3L1vig5FTvRaHhYL4MuEgc/ZGmw1i5N HDbML4gwOwR0UoF+6k+yZE/VSi2xFkzM32mqwPFl3iPPBXasA8vSOQ4tmlw3nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=17NhGn9Y+1OSXbmSPy4e6pmU6j6TrSlXehwQLp+Eq/A=; b=mqZXZoQ81ktYat/RXFLw75B3AvQs3oA2IZn3F66c7f4efK4RmHN6xHtmaoNMAZmYOGh2kG eLueeAeB9IKMBfEXlMTzQv/iU/fCSs1rtuly2tYj1PbjY+9GxWISuWgmrrYBf6gB/ywY6t ypjonVcYA2M9QO0Z+5tK78jSCKjb4hb1uU33O5a0baMCr8+t+dUtgdd7IpCfRg6YPFbJ32 qGAzdcXz6HT77YHAacDMjggtNWhUfBlJtxvqosJLB4xvdQctXzPT9ZuthRiqmffuF425Lz cUI6TjedsvmtPKYdveQ3qjtAaLCx8AP+xxeZwS/JUM4gZ2ppfFN0sElVGuNNMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxp1m6jz16hd; Sun, 22 Sep 2024 07:36: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 48M7ak0d097272; Sun, 22 Sep 2024 07:36:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7akhq097269; Sun, 22 Sep 2024 07:36:46 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:46 GMT Message-Id: <202409220736.48M7akhq097269@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: c8ebbd28aa91 - main - loader: Expand EFI entropy if < 2048 bytes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8ebbd28aa91705aea3a67b06018ea6aef5aa6e4 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c8ebbd28aa91705aea3a67b06018ea6aef5aa6e4 commit c8ebbd28aa91705aea3a67b06018ea6aef5aa6e4 Author: Colin Percival AuthorDate: 2024-09-18 11:02:12 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:48 +0000 loader: Expand EFI entropy if < 2048 bytes The EFI RNG on some platforms takes a long time if we request 2048 bytes of entropy, so we would like to request less; but our kernel Fortuna RNG needs to be fed 2048 bytes in order to consider itself "fully seeded". If we have between 64 bytes (the size of a single Fortuna pool and enough to guarantee cryptographic security) and 2048 bytes (what Fortuna wants) then the boot process will hang waiting for more entropy despite in fact having enough to operate securely. Since 64 bytes of entropy is plenty to be cryptographically secure (an attack of cost ~ 2^128 is infeasible, which implies a mere 16 bytes of entropy), use PBKDF2 (aka pkcs5v2_genkey_raw) to spread the entropy across 2048 bytes. This is secure since PBKDF2 has the property that every subset of output bytes has within O(1) of the maximum possible amount of entropy. Reviewed by: pjd MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46635 --- stand/efi/loader/main.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 17676cd9deb8..508e7ad2db36 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -57,6 +57,9 @@ #include #include +#include +#include + #include "efizfs.h" #include "framebuffer.h" @@ -1250,11 +1253,27 @@ command_seed_entropy(int argc, char *argv[]) { EFI_STATUS status; EFI_RNG_PROTOCOL *rng; - unsigned int size = 2048; + unsigned int size_efi = RANDOM_FORTUNA_DEFPOOLSIZE * RANDOM_FORTUNA_NPOOLS; + unsigned int size = RANDOM_FORTUNA_DEFPOOLSIZE * RANDOM_FORTUNA_NPOOLS; + void *buf_efi; void *buf; if (argc > 1) { - size = strtol(argv[1], NULL, 0); + size_efi = strtol(argv[1], NULL, 0); + + /* Don't *compress* the entropy we get from EFI. */ + if (size_efi > size) + size = size_efi; + + /* + * If the amount of entropy we get from EFI is less than the + * size of a single Fortuna pool -- i.e. not enough to ensure + * that Fortuna is safely seeded -- don't expand it since we + * don't want to trick Fortuna into thinking that it has been + * safely seeded when it has not. + */ + if (size_efi < RANDOM_FORTUNA_DEFPOOLSIZE) + size = size_efi; } status = BS->LocateProtocol(&rng_guid, NULL, (VOID **)&rng); @@ -1268,20 +1287,34 @@ command_seed_entropy(int argc, char *argv[]) return (CMD_ERROR); } + if ((buf_efi = malloc(size_efi)) == NULL) { + free(buf); + command_errmsg = "out of memory"; + return (CMD_ERROR); + } + TSENTER2("rng->GetRNG"); - status = rng->GetRNG(rng, NULL, size, (UINT8 *)buf); + status = rng->GetRNG(rng, NULL, size_efi, (UINT8 *)buf_efi); TSEXIT(); if (status != EFI_SUCCESS) { + free(buf_efi); free(buf); command_errmsg = "GetRNG failed"; return (CMD_ERROR); } + if (size_efi < size) + pkcs5v2_genkey_raw(buf, size, "", 0, buf_efi, size_efi, 1); + else + memcpy(buf, buf_efi, size); if (file_addbuf("efi_rng_seed", "boot_entropy_platform", size, buf) != 0) { + free(buf_efi); free(buf); return (CMD_ERROR); } + explicit_bzero(buf_efi, size_efi); + free(buf_efi); free(buf); return (CMD_OK); } From nobody Sun Sep 22 07:36:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxq4GJyz5XYF3; Sun, 22 Sep 2024 07:36: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 4XBHxq39R6z44nN; Sun, 22 Sep 2024 07:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LdKPoud8bRLU/Cz8wEIVlqdTdVLntCGCEgLrpqGaZDE=; b=w06WJ+DsJk2GaC0P31pwV3NDvwSuJ89SM8IhLyqYuchn7TksyPfWkfaEfxnvZLs8dYPl4R a0gdZdvbITD1JfFyHW/2hcQCwsV6g+HkfH6+VyxJepkSinYR2zvv5ARV/o48xLjklW5k/8 7y6YY4bYI/ikoy19spka2LA9NiJ8keJGiCrg/9SUZzafZgaLn70WmuHvTUgROFh0DCdKWh borkIUBA5P8nigcXB8jjSqmUvU0h++PGfl3+0+sjbchC4i2pYPCJRWx285SR8gWkTaWhhy F1/6g1dXEoDXvTjmOVUg7hsXKWKDAaTlTzV/JOQxVpI2dK7OWbFNXW5K0rZiJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990607; a=rsa-sha256; cv=none; b=vj4oNyy3UanFKD9MbdU3Kbh3COjkA9nr+A86K1p3CTNJmELZWJrJMTwx3LNlpuSXx/GIL6 Z7BpIqoTdrv3m61MDr5415PtRBFfLoTLZMPvxbf1IbNRcAJy73cUZnNm2hmTzwidquy2HH n2ayJC5QUP14BSqw7zX0eh6PpKYyOMhMNDByDUGGMdMgbasuvOgpnyrMlouu3dUGWoUlVe hPbnvd8Z0zDeDzy6qeOdNK1GF+vYgI3weoCyPo50JDCORn1aTefG/eU8GN369P6qu4pb7M R2sRgz+FMeK5yKpzg4C+GvQC44ONgAhKnV7WUvh7Wx/ODGhrovB8sDuZ+T8gwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LdKPoud8bRLU/Cz8wEIVlqdTdVLntCGCEgLrpqGaZDE=; b=j07MbdGwh5nRtUh2BPQPntSc89uya64XsYHDsyu5HeIt4FBUtun2aHQS0C3PMQbn8fYvwh PyYVRt2+VSW5xhcC+JJI/e8xogcuYoyi5sQEJMJTRi3mhdfK4/OVzqYkyUV16q5aQ7StV0 nqlxXLXusTza6kkuezjmV7sUPweGdZfEi6ksKoI0sg7n/ZZ8wmq70n1EtFpPuv2FYYDrsN Jo/jOYjGCSF5ARl3yMixe8v3g/Tv4iwI+k1+rEdR1qXwIoJFJOcBBOhL4O5Y3cEHo0c2c6 CnJHrqPDCVJdRHrJWig24AEOKrJYpCEPoVmjz0nIJXCVRi1s78bKNc+dmYnJQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxq2lCRz16hf; Sun, 22 Sep 2024 07:36: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 48M7alB1097320; Sun, 22 Sep 2024 07:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7alQ5097317; Sun, 22 Sep 2024 07:36:47 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:47 GMT Message-Id: <202409220736.48M7alQ5097317@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: 714a6d436819 - main - EC2: Set entropy_efi_seed_size to 64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 714a6d436819d446e01d1e4741fbe1089a23fe57 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=714a6d436819d446e01d1e4741fbe1089a23fe57 commit 714a6d436819d446e01d1e4741fbe1089a23fe57 Author: Colin Percival AuthorDate: 2024-09-18 11:02:15 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:48 +0000 EC2: Set entropy_efi_seed_size to 64 This dramatically improves boot speeds on Graviton 2 instances. MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46636 --- release/tools/ec2.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 34434f86a0b1..9e9471b55149 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -38,6 +38,10 @@ ec2_common() { echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf + # The EFI RNG on Graviton 2 is particularly slow if we ask for the + # default 2048 bytes of entropy; ask for 64 bytes instead. + echo 'entropy_efi_seed_size="64"' >> ${DESTDIR}/boot/loader.conf + # Tell gptboot not to wait 3 seconds for a keypress which will # never arrive. printf -- "-n\n" > ${DESTDIR}/boot.config From nobody Sun Sep 22 07:36:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBHxr6cPSz5XYMN; Sun, 22 Sep 2024 07:36: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 4XBHxr48DZz44ng; Sun, 22 Sep 2024 07:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6/N95iaNjiJq/aFGsl+WGRIVlap7ViUOHzuiYNFZxo=; b=YeyokEe+rZuiAP06s9bO3amk4QjbPvuEyUNaUZpOF3a7SonlD2jTVJSSscLNmHJNT/Qsd4 TmeNHaSq/L/ofjjdoC04QQsyKbJVByYOyGYfT/P3Uo0Uh/bX8w/eO6yhbPZzMEsC8vpkYk q/av4J1M6zv3+sFOKi2ijhKAwXgpQ/ZzJKogISs68GqcpNmZ00+rmI6RAWvSp7l3ITolnS gXLBQ0sFg8lGeUcUO0eOz4LXnEJZei91bANVPL5ZCuOFInytwYBXQoJLOcdbAGqn1txLkt l8bq2a0VRuDyl1pqwgRNoeKs092IvO0V8e//Q2AKLmEiF2bGc/6USJDhm3E/HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726990608; a=rsa-sha256; cv=none; b=NJxQy+aaNYXen/sfmtUpj3GU2MSK+x6Hr6ZqTbYfD3pzSHs4y8QZMKlOqg7NRzE7vTazgX tA8IzqOM7bqqRJCU4ZHFCXOkRkQZaQ7CVj0DmPtA65+oxiRMurWD0HigROLpLL1pze76bk 6/4dcqnt5rEAlgKXRHtta/TubLgkJBCwOAeGl4dgZusPol4dfmkArehvt1MzlXfYfP8ARv EceofBfDPhzzVg3hahFF5I97INv0YuH8WLkunjMm2crN/g8x2iTq9P/4Mi2n0CBiuQFzvb 5AMGVEiBO/ivHpPSsNKCmlzbHGbzYu3sLsJ9G5K04mD7E/eDY7DKRnGp+4PNKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726990608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6/N95iaNjiJq/aFGsl+WGRIVlap7ViUOHzuiYNFZxo=; b=mvfLnyAY5hPiFO5JshnxBjPpAtL60WwEsI3ZDb85yFJBXIEbO303e6KVLZ3PbYorl1V9Fg RevOp8Zzl4PDAFW0k6HnoBUBl4vsUxr8qfs4rwfzhYHRqCyT2LDMBn1nZhCJiM/FCXGJEY ZncOwJJq6aM5aMMIEqJIG8iwC+d2Y5dyIIj19pC0a6JHvPKtSqrGSA7i9aOqzs1r+TjTD+ b+TMvthDfmvdyfgoQHk8HRJrqZXpFm0srcpFBDd1rH/nw9PNhEqWRZm6yzPdXhS+vtzc97 xl0WimRqD6ZVClUSZMbAinVJFjJWIijJJ7OItQaxre/lljajGOPvt8+Ygy1NBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBHxr3lMYz16hg; Sun, 22 Sep 2024 07:36: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 48M7amEx097368; Sun, 22 Sep 2024 07:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M7am2v097365; Sun, 22 Sep 2024 07:36:48 GMT (envelope-from git) Date: Sun, 22 Sep 2024 07:36:48 GMT Message-Id: <202409220736.48M7am2v097365@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: 74a28cf6e7f6 - main - loader: Load platform entropy even without menu List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74a28cf6e7f66c7c12fd25ee8231eeedf756bf08 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=74a28cf6e7f66c7c12fd25ee8231eeedf756bf08 commit 74a28cf6e7f66c7c12fd25ee8231eeedf756bf08 Author: Colin Percival AuthorDate: 2024-09-18 11:02:20 +0000 Commit: Colin Percival CommitDate: 2024-09-22 07:35:48 +0000 loader: Load platform entropy even without menu In 5c73b3e0a3db calls to core.loadEntropy were added to core.boot and core.autoboot; but neither of those is invoked if we disable the "beastie" menu. Add a core.loadEntropy call to the no-menu path. Reviewed by: imp MFC after: 1 week Sponsored by: Amazon Fixes: 5c73b3e0a3db ("Add support for getting early entropy from UEFI") Differential Revision: https://reviews.freebsd.org/D46637 --- stand/lua/loader.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/lua/loader.lua b/stand/lua/loader.lua index 454cd7e6332f..0874239db587 100644 --- a/stand/lua/loader.lua +++ b/stand/lua/loader.lua @@ -54,4 +54,6 @@ if not core.isMenuSkipped() then else -- Load kernel/modules before we go config.loadelf() + -- Load platform entropy if possible + core.loadEntropy() end From nobody Sun Sep 22 09:36:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLcL00Jjz5Wdyd; Sun, 22 Sep 2024 09:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBLcK4j0cz4T7p; Sun, 22 Sep 2024 09:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dsfAOK32MEp4dgXfSKbXY0/9RPMUO2thaAbzdKRW3H8=; b=ohUGN8VvwdO0vkQ48Bw85hWQgwYkv/EWW0x0R2vNhf/rwakc4fhRZntSVZUCm86IR86lON uvBdog5UXP6rbyOIvqeB24QaEJjSF9qn6sHr1TT1GImzfbB8jBvW/GrRKcC210OMofaZRu oLuNV1BXKeLSeylA6FpOnR4ZauZmSZQcDwioeQ5d3PNUdixHEQH8PL4fBIyFN64JZkgWAJ STN/KZauDe1DDZKrawqeXcKqJmry8fnXohaCS1FQWaxC7BLNh06QlgpLls6ecKCyf1Fasq ykmfVg2+FjeLxdpbuXKlpq2a2eNmff+lzFep5TNmg+BMuMRQoMhfWPnpSX0RHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997809; a=rsa-sha256; cv=none; b=AABOISGQJEeQJ2C01COwYCViVJ4V3rkoQmCE9IKnXdyeVLfBWgd5sm5NyIv2oTRFarfN60 SNqx5yjlt2DO2CPAinbsqzH+IQA5eVchIOX63JEj41YCIGK8CP1FB0sxXooyCN27dz9BYa WGLmSyAtTyqOnVXQvR8IHG4+Q9oHBQ8BgR67HHJv/oJK24oozbaX7AUgayUyrpNcVfTo7N 8q6nYu+qlH2DCfYViX2w6ogrRqKmB+rhC9NMh2+2EFG0F7e3+Dz6Qq81BwBILOYgVMZ0Sb OGYd4rYsHRdXHEDCcDlENbgrnHuFDhYT4MvzCZrcswYkPBJLQLqwRj8bF+llSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dsfAOK32MEp4dgXfSKbXY0/9RPMUO2thaAbzdKRW3H8=; b=XQOmTibYdBNJL8bAokjKOA7im5yCC8VhU8CUR918N+ETy7hPv6WC7j90kjPtGntkeBAypl prhTH0LuaWZtIewcZfb6v3Apc+PfsaHRIFbJyV0eUGNXhsCyUOO1iGRe1WoPztO1KaEHSZ /rE+eG5pnsmD2/nWIBKiWkwjzjdh46knddfZc0FSvmX0KW3iKVj6UAvu801BkVktggVR1C JMSKN6negv8fnwQQDt0Y/YkNDBPK+UrJXT4zAfLsZNL2pnPyPcxVbz4mX9+TG4TVmSyRWd JAe7O2z+YMv//ErV2R21vzyCdE4hDJF6gVYIOLlyQYgqh+ZDdnv8ugNdnl+I9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLcK4J29z1B4J; Sun, 22 Sep 2024 09:36: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 48M9anRN000735; Sun, 22 Sep 2024 09:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9annM000732; Sun, 22 Sep 2024 09:36:49 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:36:49 GMT Message-Id: <202409220936.48M9annM000732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ba08efe3f2ff - stable/14 - getrlimit(2): document RLIMIT_UMTXP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ba08efe3f2ffd0e1ac6fdd417e04f6495a0560c5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ba08efe3f2ffd0e1ac6fdd417e04f6495a0560c5 commit ba08efe3f2ffd0e1ac6fdd417e04f6495a0560c5 Author: Konstantin Belousov AuthorDate: 2024-09-10 04:06:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-21 21:19:49 +0000 getrlimit(2): document RLIMIT_UMTXP (cherry picked from commit 3a2a5d606082dd782594b393c3920b9478698f07) --- lib/libc/sys/getrlimit.2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/sys/getrlimit.2 b/lib/libc/sys/getrlimit.2 index b28a82ca9534..2e79b3000c69 100644 --- a/lib/libc/sys/getrlimit.2 +++ b/lib/libc/sys/getrlimit.2 @@ -120,6 +120,9 @@ sysctl is set. Please see .Xr tuning 7 for a complete description of this sysctl. +.It Dv RLIMIT_UMTXP +The limit of the number of process-shared posix thread library objects +allocated by user id. .It Dv RLIMIT_VMEM An alias for .Dv RLIMIT_AS . From nobody Sun Sep 22 09:36:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLcM1C5yz5Wdyl; Sun, 22 Sep 2024 09:36: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 4XBLcL5yyhz4T7q; Sun, 22 Sep 2024 09:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0VHOFZyGn5gCjaMgpCCwYk5Df+EZh5PET1TM49voFOQ=; b=VBTBtJ0Ngh6ShgF8Qg/92rT02ITAQ9rRHdpgJG8XjyCtZzKv/fIkVTKdEUWLdzfrEH+cSJ lfUT3Ec6VgAwxViRnwrxnCUA4GfRZs+iSpDU5aEG0Z8UCq9G2GCUuu5KbOKLUdPeNlZ3/U QSAjv37Vu9FdU8f/Q16ylDqECYzCY7KljrvRAlDJCcfOjskz2whFET+qQIFUcsL2b/XBJO yOgvqndcvT25+bU6ojvYOs3ibDUBZ1rY/Y26G8+rO1Jq4dK1h3RSJ+5EPH6EFpu0kwJlNX az0Uaq94h+6LvqvvgFfUbunIN3WuOVLRy+AC9atmsRR1q4xUwGi665mw/XuIqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997810; a=rsa-sha256; cv=none; b=tHsFr8UlLyRCmU4EPs3Cz57xajSXl+fdGlk+gavfRsWL2vl51CUVwY0bdhrJH0drO9rOQa L5dREj5dVhyGlVBGUNn2xGf/OJzyC1Qz1+S7YsUi65HAA/2+7k5U6nZXqIXHsThhbubkSB /Cuywg98S172GTeKd/WqMeg4uiARRlAWbWLtnSRbFQ2l2ZyozjcicoZneJeAwLbnyS8mSi dN5qvTc8W2TpZ85G1lRorNlnSw7UdZCaLDzX1go5PGQt5FM7IMTXrdE5JE7/DzWsGLHCor 6NsBMMpSkV2VTHkUoCkLdiBABLHJh6vJxXpr8z6rRVd6KOpejNUMLQ41m0Xi6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0VHOFZyGn5gCjaMgpCCwYk5Df+EZh5PET1TM49voFOQ=; b=fkAC8lSsAe2uJcilToQb8s+DoueOJkJBJ3eBIyUDj/FDAEpFMCccpKr0bmDDRZiekKQHEh sDml6Qp6Q7ellKTXfnks5ZdPLEuEiI5Ns23TVrqmPa9E7qpY617Xg5lQIZl1u1WAN7hznx zOHlagkzMnwDxOZtRAXQnhRREjYba84fbwQAGvepP0KgZEsALMzpr6VW2/rcXK//+APCW/ xmiWpx1SaYr97QILJQ4arijeuDTXAGSfSxbc6S9RHSeXaSzO5pcJQHBKqaADCKnjk838Xt XSRA6HvTteX8E3KfXm/+N1UGPOsTaDd3YKNAqUoKrDrUGsmUXcFj2TFZUwBvxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLcL5ZzJz1BM3; Sun, 22 Sep 2024 09:36: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 48M9aoGc000783; Sun, 22 Sep 2024 09:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9aoU7000780; Sun, 22 Sep 2024 09:36:50 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:36:50 GMT Message-Id: <202409220936.48M9aoU7000780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 50c03711f28a - stable/14 - procstat(1): make rlimit_param[] size assertion automatic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 50c03711f28a69e6e1811414abd8e4d191d3445d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=50c03711f28a69e6e1811414abd8e4d191d3445d commit 50c03711f28a69e6e1811414abd8e4d191d3445d Author: Konstantin Belousov AuthorDate: 2024-09-14 13:15:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-21 21:19:49 +0000 procstat(1): make rlimit_param[] size assertion automatic (cherry picked from commit e3b777534baeb69a1ee88d0b18c76a68eacdb34e) --- usr.bin/procstat/procstat_rlimit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.bin/procstat/procstat_rlimit.c b/usr.bin/procstat/procstat_rlimit.c index f2dcfcd47327..f930d5b0aee0 100644 --- a/usr.bin/procstat/procstat_rlimit.c +++ b/usr.bin/procstat/procstat_rlimit.c @@ -48,7 +48,7 @@ static struct { const char *name; const char *suffix; -} rlimit_param[15] = { +} rlimit_param[] = { {"cputime", "sec"}, {"filesize", "B "}, {"datasize", "B "}, @@ -66,9 +66,8 @@ static struct { {"umtxp", " "}, }; -#if RLIM_NLIMITS > 15 -#error "Resource limits have grown. Add new entries to rlimit_param[]." -#endif +_Static_assert(nitems(rlimit_param) == RLIM_NLIMITS, + "Resource limits have grown. Add new entries to rlimit_param[]."); static const char * humanize_rlimit(int indx, rlim_t limit) From nobody Sun Sep 22 09:36:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLcN2ZHlz5WfCk; Sun, 22 Sep 2024 09:36: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 4XBLcN04f5z4TKN; Sun, 22 Sep 2024 09:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QdzmO5oS0noY3SaXOjXUQW21eeSF5kvG1k6rzBK9HbY=; b=rRX46DO+MzdyHU0S040s9qe/eu0pbaUoTutn2lBv2A6cQqcunRn1uOJObKgYVTGNcM/CKo sj81/8FUZglrwUM284ciYb+UCPcN6CZV71bSs/YpuOMJTAeZd2DqQQT5AKXEiCMVRDW00w 0R4Urq2zEQUZ7mmiY/NbHOwrHFUnrQxMxsHTz3spWKR4W039it2hdjb87g2nQTj8EZ5eud ft0lzdxB35XWFnY91SGm7wmXjNhb1IPTOyTPWC/b8qgQ878dn8GsXwPOB56vvOZSs1AlG0 xMW8gf9X1/rUUwa6W1TJyYjhLrKEkyBFHPUu+dg1En21PRzJ1QmAoGusvhtdjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997812; a=rsa-sha256; cv=none; b=R2iA78nihWG7pD7nI9XiyoPserJ88eHaG5qfApZWs1ne8Tw2B4dwkT0MLKmMl5MQ5TRqM1 uF3TeQAIciaXGNb/bVYpInpr8sGNqtXyrmrMrE7v19AI9IPdxqABxU4LfmZnvpfydzAjke sSHHmskhPuy3heV2eoFfp2kbttCKTGwk/p7Bwfl+9Vkzk5sRiC1GDR6SB8C0/7eGZv5IBj 2V2VbGxieo14gumyEFDm9ZEpG1Ts9jIxhjxLS12Fb3fA/PKO2A2XZd5ahrUgth8pXkNUrS 8fVqtVJ0SQ90iEA3OymndjOv+NnhH5Sw7zWu8PBA8Ay7VOZlH9Lrm6134fDfWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QdzmO5oS0noY3SaXOjXUQW21eeSF5kvG1k6rzBK9HbY=; b=aVklRQ/3e9bWSDb3q/HwI6VRM4Q32FwU8DvYJ7duZOow8UN55cflqCMoE1RwRWbJ2Dz6Qs PvYhT658KGo1vQY2lsxc7saWsfRYjpTiL7R3j7P2BMlGR+ZoIl2+pHyoYLsbTgiCK2U54/ UBYqAkCkwOBGldC19q9T6nwNFdk2ijSZ1yLeSh2qz0C3tkJ3sp52QznCubU5giwi8eYvlO U2FSD9p1zla2iIwapOtmIzlAxsFEqIY4lWE4E8XvPGHT0nYeJ2WKgDcN5DjC52i8RIQVIy jDR35p/4kjYkF90exaRJCMt/WMl/hCFLRXuOaa3M4vUwc1zxGCRjUmL20Rf23w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLcM6c3Tz1B4K; Sun, 22 Sep 2024 09:36: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 48M9apxs000840; Sun, 22 Sep 2024 09:36:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9ap8P000837; Sun, 22 Sep 2024 09:36:51 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:36:51 GMT Message-Id: <202409220936.48M9ap8P000837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8de0b8412310 - stable/14 - softdep_mount: on journal start failure, report the mount point path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8de0b84123109b8a15488267a0167ab2457de0b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8de0b84123109b8a15488267a0167ab2457de0b9 commit 8de0b84123109b8a15488267a0167ab2457de0b9 Author: Konstantin Belousov AuthorDate: 2024-09-15 08:05:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-21 21:19:50 +0000 softdep_mount: on journal start failure, report the mount point path (cherry picked from commit 8276c6ea9cf7cc3c7a0bd5a50fd1db298656f514) --- sys/ufs/ffs/ffs_softdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 961cb4493621..90f37c2c1ac3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2635,7 +2635,8 @@ softdep_mount(struct vnode *devvp, if ((fs->fs_flags & FS_SUJ) && (error = journal_mount(mp, fs, cred)) != 0) { - printf("Failed to start journal: %d\n", error); + printf("%s: failed to start journal: %d\n", + mp->mnt_stat.f_mntonname, error); softdep_unmount(mp); return (error); } From nobody Sun Sep 22 09:36:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLcP2nwXz5WdwP; Sun, 22 Sep 2024 09:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBLcP0fpDz4TKf; Sun, 22 Sep 2024 09:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=31vzbtrRlY06D4u9n+yzIBafFG/2BgiG1Emxb//9esY=; b=Ids3Oly0UtDF0JK49Qk42CpUTxkX0alVk/cwDQPp5/uY2NMpJU4QleCi8GGhl2qUsySfvm h0s9V6TbaXit3Kd6NPu7W25QZI7IT0xyXdjWeirKiQa0LPLo1llLx938pjZzFyEWyRbuNI xSpQHV0fcXf/Z/tIy3ng3JqFpdiWLSzd/1zasl0qatdNFKvLBH1rYWgBD9sboK0rXnIRIs Pa6F+vkMQ4eNBye1Fo4F+dar5Qy3Ow3ZoziB8vzQXK7wlT48vWCMNz0wF60ClbnwLkv/+p JQWCAKTzmKM78qDf5A6lvyknemRyu1h2R7hw1bLK5/f+cSsTaWUxQjIThKIAoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997813; a=rsa-sha256; cv=none; b=eGZT9Qpngyrvu4xqp9X9Mv5drstbGiQvPJ4ZTRsPTHe8Ghzj1yrHfA8BLO6FE0ZazCOV3G HcLLgf6zEK0aXTS73Hj4MMFHs2ZdN3xnmXEQCsmJCSjArcC1Zw4IRLRvPn7BIGCuLnBS8J DVhdQ4eQI2gsY9mrNCWs2WQ9YaDL2Z9v7WzDoMRZEgMbR8UqxLCfe+7uCuQ5wmTeoexivy gskRaJoGHfP5Az86Bf+KLNspnGg5o0m0ICDopIAkMNmXPnakVp6dXM3G0xPrdtOrIL7esf 99coCOsRA4A9Fd0TkB6q+01PjIiPJEadeLhHdblxlrBrGcPszTWXP6DRnwMmqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=31vzbtrRlY06D4u9n+yzIBafFG/2BgiG1Emxb//9esY=; b=rHU/hyP/Yci1VRe/KwWoD8vV9qxY0JEjbDamx7MjJ9zeHhL5ZX0IiyA5+x+PXjSwSOrPhw MdcyZCAx/W3VUTPGEELl44hqniXHg8NQ0LyrWAFnBZrTZzK9n8R9Z6FBmuRShaurae/IkI 3JGpEGrjpM1Z0NBBrUFci4J8D0Tp96qYg+bdMj48vg+6ihPa9XTr4Y4g29TbO3jQnirMiA rcW0feP2VSRpZftbdbROLOdixCdn4DdR2kDH2/JybLPZSdKH5T0+NHgRQrXjf8VhMEba7D 9EBL+IVALInuNnHQtWAkWoor7xIHk/j+Q9IZXqWuHTg+5HlF7vjM3ptzNHoUQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLcP0GkKz19xM; Sun, 22 Sep 2024 09:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48M9aqt2000891; Sun, 22 Sep 2024 09:36:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9aqCK000888; Sun, 22 Sep 2024 09:36:52 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:36:52 GMT Message-Id: <202409220936.48M9aqCK000888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d9259de0a623 - stable/14 - softdep_mount: report failure of the softdepflush thread creation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d9259de0a6232b1a28787add531cc6627718768d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d9259de0a6232b1a28787add531cc6627718768d commit d9259de0a6232b1a28787add531cc6627718768d Author: Konstantin Belousov AuthorDate: 2024-09-15 08:06:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-21 21:19:50 +0000 softdep_mount: report failure of the softdepflush thread creation PR: 281511 (cherry picked from commit 4b273a7fb9e6d9a006c5ac7cbd27f5d006569edb) --- sys/ufs/ffs/ffs_softdep.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 90f37c2c1ac3..3729d67d1eb2 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2646,10 +2646,18 @@ softdep_mount(struct vnode *devvp, ACQUIRE_LOCK(ump); ump->softdep_flags |= FLUSH_STARTING; FREE_LOCK(ump); - kproc_kthread_add(&softdep_flush, mp, &bufdaemonproc, + error = kproc_kthread_add(&softdep_flush, mp, &bufdaemonproc, &ump->softdep_flushtd, 0, 0, "softdepflush", "%s worker", mp->mnt_stat.f_mntonname); ACQUIRE_LOCK(ump); + if (error != 0) { + printf("%s: failed to start softdepflush thread: %d\n", + mp->mnt_stat.f_mntonname, error); + ump->softdep_flags &= ~FLUSH_STARTING; + FREE_LOCK(ump); + softdep_unmount(mp); + return (error); + } while ((ump->softdep_flags & FLUSH_STARTING) != 0) { msleep(&ump->softdep_flushtd, LOCK_PTR(ump), PVM, "sdstart", hz / 2); From nobody Sun Sep 22 09:36:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLcQ2cRMz5Wf9y; Sun, 22 Sep 2024 09:36: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 4XBLcQ1mVwz4TBL; Sun, 22 Sep 2024 09:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mT7EEjtaRcApYjciaGcS1glhWcSBqCq6aAErNRv+rLY=; b=slyupDvR3qxKpoXePRZprqwu1bEaINS/wmkioFqk53qWGapJPv3zDniScVtu2i/MYsGyeb /mk5BgLoDYp/dhkN9BYBPUhDctfeoe8BuJdF18vPMf7PMA6//aUG8rfONkdfxBv1jz+cmb KrvF822U7UEQBccBd36RuDS1sLMB63TmPPgXCzEkDVW9r+Z8vRxlnMSXawcfT2DAd6umqh Wn9rsiLDszYBjILI+TX9tYc9iC0X9XK1Sb5v83zo/iqk8+YbEFHmdg4UTRwsQKGJ7/BP9Z ZhnZwv6CmDX+jNyIjzdJkkev8dEP4eXQMu9bhpe505kaW8rqgSIHaQSDS9LPYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997814; a=rsa-sha256; cv=none; b=RB6x2zdu0lKsPPtam7bLM05DPejbdm8VCEy+cjox7Mn3iFOn53f9UtylZj5KTYTV9hGYrx 2gMBPMLj5Pgro9V8QL4ysu3thYTQYGVPv58jxklTCi6dzPR8vWPgztNJvYo/mL9ejuFBWY jNUSp5YUJX5I4fSVbLDNvmJO3qq5T3mveU6KJoLLn8WCc4xvvx/z4Sbx/ZV3KwY+QhVaC9 MfuhtiuSVyJQrs+yfJMgMIt93dgqXCARfr7JtzkCmjuwwhGV2z6XpILNCqVVorjH3KTEYb lJ6OtMyABHfUd6kQ66pY1jBW9P4ZxS6dWjNwvZqjXo/hBmQKsJmWrX8YE5EU3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mT7EEjtaRcApYjciaGcS1glhWcSBqCq6aAErNRv+rLY=; b=qtrjya/zHuwYFa8/JZkoa3RmIn1NRG3mt2wsBMJauzIjPgFP0OelwqCPXMZ1mDd+elVJ+x l0iJzjLS/PSGZAyPaJthz1QD/E5rqHXzH0UHcLhYJJGPfkdLICRWYIRhAXGbtlG6UVE9IN udqNlh/kWTK43rAnQ8OCimEaxU/EjsYgcI4keBoD5snzXicZKtKD3OnR6Ttr2oXTYZ26+L qWPDeZh4WIHwrgGeZenfxHZ5zEYsaq0r+qJn+Mb4HhHKvWINYadFfupDywcwsGpx1Qe9X1 VxC0s8DR00nnetq/gLueHJKAfkUdIW1gdjGaA6d9VoQNIadY7ORp6sNBm8ssRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLcQ1P6Xz19xN; Sun, 22 Sep 2024 09:36: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 48M9ashk000930; Sun, 22 Sep 2024 09:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9as5D000927; Sun, 22 Sep 2024 09:36:54 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:36:54 GMT Message-Id: <202409220936.48M9as5D000927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 81f829b3010d - stable/14 - amd64 sysarch(2): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 81f829b3010d6b294b229eee5148cd942dd78914 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81f829b3010d6b294b229eee5148cd942dd78914 commit 81f829b3010d6b294b229eee5148cd942dd78914 Author: Konstantin Belousov AuthorDate: 2024-09-16 19:54:03 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-22 09:25:15 +0000 amd64 sysarch(2): style (cherry picked from commit 29a0a720c33fc70601ea85f813d982a99c3e7896) --- sys/amd64/amd64/sys_machdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 6c8b038bdb09..aae3743f0e91 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -286,7 +286,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case I386_SET_FSBASE: error = copyin(uap->parms, &i386base, sizeof(i386base)); - if (!error) { + if (error == 0) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = i386base; td->td_frame->tf_fs = _ufssel; @@ -300,7 +300,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case I386_SET_GSBASE: error = copyin(uap->parms, &i386base, sizeof(i386base)); - if (!error) { + if (error == 0) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = i386base; td->td_frame->tf_gs = _ugssel; @@ -315,7 +315,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_FSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); - if (!error) { + if (error == 0) { if (a64base < VM_MAXUSER_ADDRESS) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = a64base; @@ -333,7 +333,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case AMD64_SET_GSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); - if (!error) { + if (error == 0) { if (a64base < VM_MAXUSER_ADDRESS) { set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = a64base; From nobody Sun Sep 22 09:37:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLdY25fhz5WfN2 for ; Sun, 22 Sep 2024 09:37: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 4XBLdX6rSkz4VNM; Sun, 22 Sep 2024 09:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mRYxFJmIdW38MIMy9mJjPzvJWJNsySQKftV1liUzuMA=; b=H7ipKXDDSE3Uvzkx4cPIh+djRX6j7NuEFv9t35YlhiDyh/uadwC3p7do4oWWcstJe85IH1 ag2Vxheql/4pStWcTOpnLDP2zatdG9DYezXoqK9IeZn7ChSgRBFXlMULtv8IheBb9QBrjz UPzPqk+77B1ZAtS8czVQbBy1RQt1gA+zXY3El1lS1xmetYaczxtaUa5Atf8kh4HadFD8fc TJr+w1CLiTsux1vENVXCL5Z/U2bXP+r7KGZWUx/peHpOHtouCJjgPibgC7/qtDbfydkSc6 TS71gXsz7r+R6g7+ldTJdbJibbTHb/e/nJmHpX8u2zqFGj2x9q3DtbqM5DQJ1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997873; a=rsa-sha256; cv=none; b=IrCkF+dvuRMEJYgL9Z4YFS8CGyjbxt5qMVT8Xh08G0qtVE+m6me1bSjA5syOhbI+dELVDk JiD2SnREUx9bS+Se06Af/oNXdU70PgRKjlaJ13IO3zTteSqiwncyqHvqzEendvFy5ao0nd GaTSCIZwSpcdf19+3Fc6je1hDxya9irJyQKnOcHngg3xqY9v4ny8sFrq2uNOf00Dk30OAr 097yetwUmF2ONclHJIRUm197Fjrc8kmSfz+ZhjUSIMqq+kb7M5GF53MVJM+gjh8h2kHbLJ XOIFI01l7Z0XJCrppVEXE8P+4YNro2cJlNRKqTiOOTDT80Z7Eq4omVrMYl6a1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mRYxFJmIdW38MIMy9mJjPzvJWJNsySQKftV1liUzuMA=; b=M/DjkUBTLna1by1ybXc7i9rjMhYgHXl3B84tUKyHmrwULKJbZsvaUEO8giFRHFlJcdJjLU nHxSWM/ip3wOj9rn4uXUG65mHK4Nn3V6aHiCNlmWYJ6aArUYUlsJDUcr1hN6DzkC8z5T06 tk0l50oqpv7kg67BwjKaPQFHV5hgvk3npexGxEn/Frro5nUJ4Bnzhvu+G4MoBL4cf5Up8+ qQFArTeflmViptfYVb6xWd9jurZwrS9Fdgn+vS/DoneT6LIQp31HEfXAlOJQ0C4WgHDB+b JG5fgOjUZyzJNlcG3N0DcioIdJgrP0VHIz4wbv2hMGSgz0eP10yAhLmeqX5w9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLdX68z6z1B6l; Sun, 22 Sep 2024 09:37: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 48M9bqE9001235; Sun, 22 Sep 2024 09:37:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9bqEb001234; Sun, 22 Sep 2024 09:37:52 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:37:52 GMT Message-Id: <202409220937.48M9bqEb001234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 7432c96084d7..1de139fdd502 - vendor/llvm-project/release-19.x - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-19.x X-Git-Reftype: branch X-Git-Commit: 1de139fdd502e836552eba1049a42b45514d8f7b X-Git-Oldrev: 7432c96084d72c631f1e5ddf1cc2e24fd9c92482 X-Git-Newrev: 1de139fdd502e836552eba1049a42b45514d8f7b Auto-Submitted: auto-generated The branch vendor/llvm-project/release-19.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=7432c96084d7..1de139fdd502 1de139fdd502 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1, a.k.a. 19.1.0 release. From nobody Sun Sep 22 09:37:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLdY24z5z5WfbK for ; Sun, 22 Sep 2024 09:37: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 4XBLdX70lzz4VSQ; Sun, 22 Sep 2024 09:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CUsMd1xQ9ITWbLdo2iQP2r4gOy5Z0mOKWxYDX91z324=; b=dmSY1+MEhgTTezn2RsYD8h1ETiNJuHfrjh+a7YIPqO+r8PFFfdgU7o7WpkDBbFPrwCUYPL MTEWiB9an9M3WfOtW3Dme8DCDsWrc2WCxp+0hhn+0TRFFWOynReo5wJSVc8ASaCYfm1Lgm Hu/VSTMA4EH26qHjzPcZnIGWo5obGm0GJ2z4qwzWsNU1IQujMWzNedvxKOHMgDBpTwJPT2 Ca1VAQo7Uf1SZtULsEirTDaYK6TBMjVfvKP0dnfs6hVu8/ZuG2xpp8sDbDjxkprwimuKEO kLzSN7Adm0kmpOLkMB5+NZoT6OfvE7l6hlX4AMLAKMWGY2Xmk+vaKHEm+5fRmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997873; a=rsa-sha256; cv=none; b=GF2NEuuFBT6j2CuCGlTRcVZ3+W3zKD8QAlDrFefiY69RN/AQPME1b9J6cL50089iakVfj0 /cDM0z9cjWfNqlHSdGPf6ngteYgyyKAZUxeXBBHRg5L+G527eRa1Fvlc4VelLrzmz97eIq J5wocguTXKcr1lG1d+oHp1Bsjm3RCuA3fzmEOSI+ojvdIAAXfKafV3GomdiWqyceUGDg6B i7WK1AEHIY2qF+BcHnpJLbNB3uvNMikxKYJOFuTrRmbG00dq/A703qzAC1RXaQD530uWgU KUDz219PuhnEEwrVP3/8c/v4/BYgh5LY3tJ6s7V4gs7a2FGpDA0Npq4DbDDNfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CUsMd1xQ9ITWbLdo2iQP2r4gOy5Z0mOKWxYDX91z324=; b=GjpXqqLhcviLL2nmjMTOAeqB+iG3X5b6UYxxcaBz4n+f21jgpaQLyXU9yT3LDahBSx/tUU P47+dhwpQwgXCtQOVJpro7pgTLFX3F4VwzJJzNmK206LkTjsaJwVKCCOxoxsGOXb1ke1QP V1gvB0s45HEDdr1HaIf0OwyBnBzWLHZPgXPSNpoZEKqIJ2CVC/DsDgGAAXZu9UeUbyVcS9 zQtycwVnloGRsltXBeG8QUU2kVnAx7oGBFWN2NBTf+ndVaWUVJv+23bewPUstBBXzFwkAt RozyOUCkFWU6/tUxF6cSv+SAzEMfd27tsWLgLyLUQbnWT72mMtiVdmXryaVYSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLdX6csjz19nF; Sun, 22 Sep 2024 09:37: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 48M9bqXR001254; Sun, 22 Sep 2024 09:37:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9bqnQ001253; Sun, 22 Sep 2024 09:37:52 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:37:52 GMT Message-Id: <202409220937.48M9bqnQ001253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 20efa1420655 - Create tag vendor/llvm-project/llvmorg-19.1.0-0-ga4bf6cd7cfb1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-19.1.0-0-ga4bf6cd7cfb1 X-Git-Reftype: annotated tag X-Git-Commit: 20efa1420655c78a8f6e807cc9f0e8eba034e943 Auto-Submitted: auto-generated The annotated tag vendor/llvm-project/llvmorg-19.1.0-0-ga4bf6cd7cfb1 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-19.1.0-0-ga4bf6cd7cfb1 tag vendor/llvm-project/llvmorg-19.1.0-0-ga4bf6cd7cfb1 Tagger: Dimitry Andric TaggerDate: 2024-09-22 09:37:24 +0000 Tag llvm-project branch release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1, a.k.a. 19.1.0 release. commit 1de139fdd502e836552eba1049a42b45514d8f7b Author: Dimitry Andric AuthorDate: 2024-09-22 09:37:02 +0000 Commit: Dimitry Andric CommitDate: 2024-09-22 09:37:02 +0000 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1, a.k.a. 19.1.0 release. From nobody Sun Sep 22 10:29:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBMnR1LNBz5XGvK; Sun, 22 Sep 2024 10:29:47 +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 4XBMnQ2mTDz4gsn; Sun, 22 Sep 2024 10:29:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=fQjuv1MN; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f31 as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6c524b4f8b9so32954746d6.3; Sun, 22 Sep 2024 03:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727000984; x=1727605784; 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=uSUvOlsv1UDTS4o5p6zNtLqm3NRrLhTKsSbswin4b/0=; b=fQjuv1MNLR4tRnR8WntVQjIZkU0EorGUCf/AjVPW7cS4gnlqsJGoq6TjfoM2pyBmFl d+90JXWhYBoR1ZZKDC/HzUKC40LFtgerlDmknT+V/456gie7Ux/zKjghexhrs8gYG/Iu 78bZ/OFeVuaSwtmdVUkLdXHu+rHTMGUkm/CGz1NyhMaZYpTd1I2A4IzXNuVByVGjq7xh Je844jYDhGZmkP0ZPSXEa6NcO8XKta2Yo+sx0FbrtZStCLQIt/mll1udFjPhYLATwp20 2IxkhX9AB7wOaQoCvPA2Qc/98KUJLMm44+SsgzEDMY+YHANyixWFFhvPtxnPiTeHd1dj jN2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727000984; x=1727605784; 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=uSUvOlsv1UDTS4o5p6zNtLqm3NRrLhTKsSbswin4b/0=; b=rKY26xxlHNJFbdYJbtrhGtmt7kS5F4aWqrYrqyBYKx9Rs3ite+U2TWZocNWeDqV/xv NrxCOnqKkDrRb7lDwtt3M9HOZt7nH/cZf/JZyyTkrIH5M/ogXRI7yYh42eccrVYmSrrn e4gE115+BMzFyRXrSAAFijqCF7x2t/UWE4BWZzQduqsSIHY3CajJGjEjIFXnf5TtWYyH 5HF/MjRNxZB9Jun8b0YHLaYRMmYGeinzkjq8dSzEXyRmIExBtVFya1rAgJTVhwsu2YLN 73Wd+LsXDXifWAFrTSybE+KFscPukJjS5+Xzro4O9aa4m93gdE2GfnHs2HymtbmmiTUl L0pA== X-Forwarded-Encrypted: i=1; AJvYcCW0xGeANjwowF8uxPAMHZxbNFhzFxk85luLIZmUsXGhKQ9MgAiQM5mGOOdpLbKQI8qSgV4r2zqLy6+YHOlss0WTtmVw@freebsd.org, AJvYcCWFaKKD1Rz1yNjdx/daKyL+/BxFPEuaCjqYwanr4QdF1bNZ996Hbiu3ptFnahdDwiLEUWANq5ywYpRuDivxMqkVHI8mV4I=@freebsd.org X-Gm-Message-State: AOJu0YzZtLHSGAmJ+ECzmVsRRQCoBW+BlhrCBlhZoSh11IfqHa5DqP8S Nbjomjd64FSKKIQmaftEu2aGq38dFMld8bv9oEx8pnxfR1O/dRpSCG3qLQEL X-Google-Smtp-Source: AGHT+IEOCFuCj2zdBBBAzb47mMjybFEuhkb6TaBDvqLkr4qTqBPhOFjJvp/DizlZoLOlAfyzjxZYSQ== X-Received: by 2002:a05:6214:540f:b0:6c7:c7e3:a799 with SMTP id 6a1803df08f44-6c7c7e3a7eemr98460076d6.13.1727000984409; Sun, 22 Sep 2024 03:29:44 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c75e494a28sm36056696d6.68.2024.09.22.03.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 03:29:42 -0700 (PDT) Date: Sun, 22 Sep 2024 06:29:39 -0400 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output Message-ID: References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f31:from]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4XBMnQ2mTDz4gsn X-Spamd-Bar: -- On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=94567c8641e235763b5b2926416d89d36654cde1 > > commit 94567c8641e235763b5b2926416d89d36654cde1 > Author: Bram > AuthorDate: 2024-07-23 08:57:42 +0000 > Commit: Warner Losh > CommitDate: 2024-09-20 15:06:26 +0000 > > netstat: Resolve duplicate "dropped-packets" key from libxo output > > The current libxo output uses the "dropped-packets" key for both incoming and > outgoing packets. This commit distinguishes between the two by adding an "in" > and "out" suffix. The original "dropped-packets" key is kept for backwards > compatibility for now. > > PR: 244589 > Reviewed by: imp, zlei > Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 > --- > usr.bin/netstat/if.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c > index 172ea5324ccb..f0af785bce04 100644 > --- a/usr.bin/netstat/if.c > +++ b/usr.bin/netstat/if.c > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) > IFA_STAT(ipackets), link|network, 1); > show_stat("lu", nerr_len, "received-errors", IFA_STAT(ierrors), > link, 1); > + /* Below is kept for backwards compatibility. Will be removed in the future. */ > show_stat("lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops), > link, 1); > + show_stat("lu", nerr_len, "dropped-packets-in", IFA_STAT(iqdrops), > + link, 1); This breaks plain netstat output, causing a bunch of network tests to fail. For instance, "netstat -Wf link -I re0" now prints an extra column. I think we should not bother with backwards compat unless libxo is emitting structured output. This can be implemented using the "e" format modifier described in the xo_format modified, but I'm not sure how to plumb it through show_stat(). Let's revert until this is fixed? > if (bflag) > show_stat("lu", nbyte_len, "received-bytes", > IFA_STAT(ibytes), link|network, 0); > @@ -516,7 +519,7 @@ intpr(void (*pfunc)(char *), int af) > show_stat("NRSlu", nerr_len, "collisions", IFA_STAT(collisions), > link, 1); > if (dflag) > - show_stat("LSlu", nerr_len, "dropped-packets", > + show_stat("LSlu", nerr_len, "dropped-packets-out", > IFA_STAT(oqdrops), link, 1); > xo_emit("\n"); > > @@ -705,8 +708,11 @@ loop: > new->ift_ip - old->ift_ip, 1, 1); > show_stat("lu", 5, "received-errors", > new->ift_ie - old->ift_ie, 1, 1); > + /* Below is kept for backwards compatibility. Will be removed in the future. */ > show_stat("lu", 5, "dropped-packets", > new->ift_id - old->ift_id, 1, 1); > + show_stat("lu", 5, "dropped-packets-in", > + new->ift_id - old->ift_id, 1, 1); > show_stat("lu", 10, "received-bytes", > new->ift_ib - old->ift_ib, 1, 0); > show_stat("lu", 10, "sent-packets", > @@ -718,7 +724,7 @@ loop: > show_stat("NRSlu", 5, "collisions", > new->ift_co - old->ift_co, 1, 1); > if (dflag) > - show_stat("LSlu", 5, "dropped-packets", > + show_stat("LSlu", 5, "dropped-packets-out", > new->ift_od - old->ift_od, 1, 1); > xo_close_instance("stats"); > xo_emit("\n"); From nobody Sun Sep 22 10:44:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBN6D49rGz5XLLl; Sun, 22 Sep 2024 10:44: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 4XBN6D2DQvz4lML; Sun, 22 Sep 2024 10:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727001860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xAlrz52NCuDw7f+CpUVm2w7GUp4sPUkzL5aEh7y0tI=; b=Hn/gdtw80BDTaALEW/k5WpvT6825589mXnBhLyqUlM1RM0NQ1eBh534EWB/UhRtXk9GSlu 6rBzsFRZrDMa+TuITtMnH0ils7NPrSAA0TkGeCl722PTgIcSK0ruVm+N8B1vooBI1fCsOv efapki8QoOQhb/ZgdOR2oQ91ZxxQ1wMEr0IGUk+L+W43g2THV+2dTBxZq+dqHye+HeXTQZ r76KZta/hFAt59K3J+YpvEYkGMpsoyzxebAPSlG3dOzWfjHbLUVhuR2TojeirWJlp/NF/p E9OIAFl/r1oOF28DBXLPJ3nyktleNsAYm0RKrAE1y36APkcF+5Lxp0upHlNRVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727001860; a=rsa-sha256; cv=none; b=G9VGqkTS0DujPFC8TGGvqu3irsfqCAyxwyLRLVpHYteKTHB1ZJgZSX7ekzLB+7tG1ZIiOG VIYo+H0Ot5Y+BQ7Tr8VTy5ijm6tglHmbD3U9V7H0wpeJbV21wUm8LU1lbQOkFzWTCgkKfK LD7msbZl89YH1JQ3N7oJCkOK9YyjfhccMlaJwWS3aVVlF6hmZ9dX6Vat+PFVlGsLruT+lb WJu6EA89ts5J5am0BGtdx3BGd0abq9aXDCfUcQBvUknY3ZaxoSv9phT9jb4xEjzxH8AmY7 AA0wrWUkR2VrkmF8FhE9ubKz6J2J2NzIwwV4WH/6kDOP57QZmFGbVNHwKAoGpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727001860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xAlrz52NCuDw7f+CpUVm2w7GUp4sPUkzL5aEh7y0tI=; b=K6aQxY+jTG8K12v4Bn4fDLPA14DaghcdLEVBAPL8VA9KvBwS4KcZttqsxhHW3eX7pWmykU EjJuF6mnf/kcGezcnQpLFZIvCvZDyWLFjk8ESum6GMGDUtZ9c709WEZjExBHLHB22GDBFZ 2NVtvlZLUUsxPEAYHUNxD/6A0J6o4/Be5oKMrVJQSSg0waMkP7V9ckbwZX9ysRaaDqO+TF uqcWZlU4KWgMPvlFiCwFnTDVNX9FcJe7gB1JMvp3KdMFkMs08b59UwBXaviTyZa4loHmPP COTJB9OfEU2mG02Ajd7LJgtont4dA2EBXJe/P6oKALdjHXG3aw9/QNWsW9TMbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBN6D1pDZz1CPc; Sun, 22 Sep 2024 10:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48MAiKYX021698; Sun, 22 Sep 2024 10:44:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MAiKjE021695; Sun, 22 Sep 2024 10:44:20 GMT (envelope-from git) Date: Sun, 22 Sep 2024 10:44:20 GMT Message-Id: <202409221044.48MAiKjE021695@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: 4004e1752ec7 - main - hda: remove duplicate codec defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4004e1752ec7992eeace7f0318d2ca3fc7ba9e03 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4004e1752ec7992eeace7f0318d2ca3fc7ba9e03 commit 4004e1752ec7992eeace7f0318d2ca3fc7ba9e03 Author: Pavel Timofeev AuthorDate: 2024-09-22 10:40:36 +0000 Commit: Ed Maste CommitDate: 2024-09-22 10:43:49 +0000 hda: remove duplicate codec defines Reviewed by: emaste Fixes: 35e492f3bd41 ("Update list of Conexant and Realtek codecs.") Differential Revision: https://reviews.freebsd.org/D45965 --- sys/dev/sound/pci/hda/hdac.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 4b4bd70f800f..5e66e8eaed59 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -586,8 +586,6 @@ #define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) #define HDA_CODEC_ALC298 HDA_CODEC_CONSTRUCT(REALTEK, 0x0298) #define HDA_CODEC_ALC299 HDA_CODEC_CONSTRUCT(REALTEK, 0x0299) -#define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) -#define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) #define HDA_CODEC_ALC300 HDA_CODEC_CONSTRUCT(REALTEK, 0x0300) #define HDA_CODEC_ALC623 HDA_CODEC_CONSTRUCT(REALTEK, 0x0623) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) From nobody Sun Sep 22 11:26:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBP3L2rnNz5XbZb; Sun, 22 Sep 2024 11:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBP3L1jhtz4spM; Sun, 22 Sep 2024 11:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727004414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GpWPvAsZuBLHPcyux4AIlWf55n8qZn4ZFQCe52o36lE=; b=ViSqufhvyNZJs4QbiWLpxv+HaK1rXM/zLmA1BRZjZXO9E+7vXnUEJH68n5QyCJWyqwvKJv 8aFLShCQJHWJ9B7rEv8ZGdqWBrqVlWgPQK0yvfB9+XXp0RzTYnqXr6u5fBiLhKWnd1asf5 gHztvzdQNkMtqeZuRr6OeRTSzBbiq68SVxWAZD7CbbktgJWR08ww1Q4RTMRghsr2AAmbyt QCwhQgHjM80RTfuh8J7B+Yp9EyT0iOBdmJTGQsh74z0oloDHzxuMQ9LskXAtaqF63A6bzQ uUYXS5D8atWo+0SezVTfTindyjgjeIGw3us5zrXm2cRAnTP8JGh4cJd6fAEPig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727004414; a=rsa-sha256; cv=none; b=s+9tuhK0sEdHayOwwqTgUctP/FJ5O9q706PYk93uxQfD1sHtZNd0rAK6xRmrASO+keU9BY i7FCFEgo4TI23EYSHLHYgD9TEWXfm9BT1fZyv1oa7g2BGXTV1TuiiMuM0j8SJ6CEJbH2Au LcBthOyCttAbA9GdgPIdidzcCp/y3ntf5WvoxcqTiTOZ0slJAHco2SCy4hvcYdHL3HUWYp tZ7UFThui1l41qn9bV0g7gY7KKERk8182qakhLw3/pWiz8w3/R93RK2bVSO0pdyJ/wMwbf 4VE1YWFn6tRGW3zf9dzyE377QEP0y3/PJXcvUj+Um7R4rrg7PBeBPTBdiF04WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727004414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GpWPvAsZuBLHPcyux4AIlWf55n8qZn4ZFQCe52o36lE=; b=hVRSi55HB95Bo+wQ7oRn2Z3aKEVEDlwxhWAliBfnUnuVhw/dhwgGeUvvH1qjVhIEG1NiA3 SvaPSSzLnivnvdBUWZSVgneb57948dhexUI/EdxDOIzWslFcaIeIkBnnjnNoSktnTZmUNb 79tW2E+4SEXCXjVNUrEYdNDJbnH4//JKggPRcwvLVSoEgbMY+zuudGVq67FNw1D65Gc1t4 gSFTM2ZYw13fG8/BK8hIegXA05eLlN93+s+TSfrDogRCBRU/x/rUyRgHbqivImUCbLQDzf YVwqqPrCdFEyVZd54jTARGu2TT1oPuyd7dMLoSDwBMZnzkUc8NfW5OA18sgP7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBP3L1Brzz1F6G; Sun, 22 Sep 2024 11:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48MBQsTw090157; Sun, 22 Sep 2024 11:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MBQsjM090154; Sun, 22 Sep 2024 11:26:54 GMT (envelope-from git) Date: Sun, 22 Sep 2024 11:26:54 GMT Message-Id: <202409221126.48MBQsjM090154@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: a305f44d1404 - main - bhyve: validate corb->wp to avoid infinite loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a305f44d1404fbf386bb2b50ab7233ce9eabe0bb Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a305f44d1404fbf386bb2b50ab7233ce9eabe0bb commit a305f44d1404fbf386bb2b50ab7233ce9eabe0bb Author: Ed Maste AuthorDate: 2024-09-19 18:57:42 +0000 Commit: Ed Maste CommitDate: 2024-09-22 11:25:02 +0000 bhyve: validate corb->wp to avoid infinite loop Guests must set HDAC_CORBWP less than corb->size. Treat invalid values as an error rather than entering an infinite loop. Reported by: Synacktiv Reviewed by: markj Security: HYP-12 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46134 --- usr.sbin/bhyve/pci_hda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index 8bd84a5113eb..97d6264413e0 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -788,6 +788,11 @@ hda_corb_run(struct hda_softc *sc) int err; corb->wp = hda_get_reg_by_offset(sc, HDAC_CORBWP); + if (corb->wp >= corb->size) { + DPRINTF("Invalid HDAC_CORBWP %u >= size %u", corb->wp, + corb->size); + return (-1); + } while (corb->rp != corb->wp && corb->run) { corb->rp++; From nobody Sun Sep 22 13:19:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRY61b9Gz5X9cK; Sun, 22 Sep 2024 13:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBRY56snmz4Hhm; Sun, 22 Sep 2024 13:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILhiTHaPK2fyIWlJz6GF0PnaW2xZpz78D7vwQ/IEQg0=; b=xabia0kiG/B6Wm1xtOK21dilfwgyfNKwpI7sUZAwGiYHddYgXpxBliYsQgN06MLsxjT80d Vx2KB2mAqBxlGm/wX2izeq3r9vRLDwJPkF4ZJXqJMRWdoxBzq8Bftv3GaVQQ4A9AUzKZwi 0/YBttndwZytyBzLn2NaZluiijHusvNTI8ICSKQUwXs9sa/MatLsQKf2lHLYexsRDUKfH5 ruZi3GRgwV01/Tb3/4+d5ZSck/aWqPIGlYURBGW9GZ6spH1tLINFm/PFcumfAezSJ42cvp oa/RYzKdtug1vNsJRn7SBo5Rkh6mha219TNZROLp4MzI1v6btFlhe833PjzWsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727011161; a=rsa-sha256; cv=none; b=sTopRHl/wdVlRO6MQM26MQlzMbuj5r3l5G3K6jvmuZ9QU/0nm3ZpHHjCwHkWTsGk61ACc1 bBbWvkq8wQCZKnQ4VkW4ym8yddRNOZB3rGX6VMIJngOvQnqjE7zqY1rj97m17ENkSAY4Tt 2VAaFAGwdv/iOXH9FH1d3VIj1f9C/YpQlGZnCh0NscL0A4d1kN+cVcAFF0KWaW45C58GDv oKYbjJJEU3JxiEhouPV1DGzAZCi7bZb6VVFxl7XLQMQzfWGU/DWPXjakME9OSmJugzF1cI bs+Vk/D3kAuETp1JhH3b8HVV51MFQ9Yl8gRYDgGgxC5b6ktoyC1e+pd8mWBRpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILhiTHaPK2fyIWlJz6GF0PnaW2xZpz78D7vwQ/IEQg0=; b=eQz6rfpekbZ/rxjRZ6IP/awK3I6Z+83Y3lIlUUvheDMFlMiBg1v+wVqRPy06kSUm5D3PYO Hnr+Y6mWoWAaYjjVYm/C0Mrmey60cO1fm+WsEKREcxzbek1mIVK3KMsURcj5Rnc6a4DQbV V72NVRrkHEIz0DuiDo+LHXbIdMr5xy6F8bwa8+bSuQRpWCb3ebZkwVVG69+uOPYWnfiVUI hFZS39oV915HsbnjlFbH+5TDrrsJrUgemEaiUOLwcQIKWiF2ZzVnncPbHNM4V5asQslp5u MmV9t1MsQFSpjL1IbWiN1MbTSFSUzNpXyPtQoQyJrg79Q9orT+snezQ58v6Ztw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBRY56TFMz1HpS; Sun, 22 Sep 2024 13:19: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 48MDJLGD076638; Sun, 22 Sep 2024 13:19:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDJL5M076635; Sun, 22 Sep 2024 13:19:21 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:19:21 GMT Message-Id: <202409221319.48MDJL5M076635@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: 85918beb387f - main - intrng: Add support for multiple interrupt roots List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85918beb387f179abc93a6c613801fb9761ff1e2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=85918beb387f179abc93a6c613801fb9761ff1e2 commit 85918beb387f179abc93a6c613801fb9761ff1e2 Author: Ayrton Munoz AuthorDate: 2024-07-21 18:10:20 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:18:34 +0000 intrng: Add support for multiple interrupt roots Different types of interrupts may require using different exception vectors so this commit adds support multiple interrupt roots to handle these cases. Archs may opt-in to multiple interrupt roots by defining INTR_ROOT_NUM as the number of roots in their intr.h. Based off https://reviews.freebsd.org/D40161. Signed-off-by: Ayrton Munoz Co-authored-by: Kyle Evans Co-authored-by: Andrew Turner Reviewed-by: imp,mmel,mhorne Pull-Request: https://github.com/freebsd/freebsd-src/pull/1363 --- sys/arm/allwinner/a10/a10_intc.c | 2 +- sys/arm/arm/exception.S | 5 ++- sys/arm/arm/gic.c | 2 +- sys/arm/arm/gic_acpi.c | 2 +- sys/arm/arm/gic_fdt.c | 3 +- sys/arm/broadcom/bcm2835/bcm2835_intr.c | 3 +- sys/arm/broadcom/bcm2835/bcm2836.c | 5 ++- sys/arm/ti/aintc.c | 3 +- sys/arm64/arm64/exception.S | 3 ++ sys/arm64/arm64/gic_v3.c | 4 +- sys/arm64/arm64/gic_v3_acpi.c | 5 ++- sys/arm64/arm64/gic_v3_fdt.c | 3 +- sys/arm64/arm64/gicv3_its.c | 2 +- sys/kern/pic_if.m | 3 +- sys/kern/subr_intr.c | 68 ++++++++++++++++++++++++--------- sys/riscv/riscv/aplic.c | 4 +- sys/riscv/riscv/intc.c | 4 +- sys/riscv/riscv/sbi_ipi.c | 4 +- sys/riscv/riscv/timer.c | 4 +- sys/riscv/riscv/trap.c | 6 +-- sys/sys/intr.h | 14 ++++++- 21 files changed, 104 insertions(+), 45 deletions(-) diff --git a/sys/arm/allwinner/a10/a10_intc.c b/sys/arm/allwinner/a10/a10_intc.c index 410fba4b4728..0bac9edbfd08 100644 --- a/sys/arm/allwinner/a10/a10_intc.c +++ b/sys/arm/allwinner/a10/a10_intc.c @@ -236,7 +236,7 @@ a10_intr_pic_attach(struct a10_aintc_softc *sc) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc)); + return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, INTR_ROOT_IRQ)); } static void diff --git a/sys/arm/arm/exception.S b/sys/arm/arm/exception.S index 7230830f78cb..a17898a53d49 100644 --- a/sys/arm/arm/exception.S +++ b/sys/arm/arm/exception.S @@ -48,6 +48,8 @@ #include "assym.inc" +#include + #include #include #include @@ -308,7 +310,8 @@ ASENTRY_NP(irq_entry) PUSHFRAMEINSVC /* mode stack, build trapframe there. */ adr lr, exception_exit /* Return from handler via standard */ mov r0, sp /* exception exit routine. Pass the */ - b _C_LABEL(intr_irq_handler)/* trapframe to the handler. */ + mov r1, #INTR_ROOT_IRQ /* trapframe and PIC root to the handler. */ + b _C_LABEL(intr_irq_handler) END(irq_entry) /* diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index 7fbf7e7fd827..b1b7aacd63ab 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -200,7 +200,7 @@ gic_cpu_mask(struct arm_gic_softc *sc) #ifdef SMP static void -arm_gic_init_secondary(device_t dev) +arm_gic_init_secondary(device_t dev, uint32_t rootnum) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq, cpu; diff --git a/sys/arm/arm/gic_acpi.c b/sys/arm/arm/gic_acpi.c index fa823320dcc9..6fd6f5271375 100644 --- a/sys/arm/arm/gic_acpi.c +++ b/sys/arm/arm/gic_acpi.c @@ -227,7 +227,7 @@ gic_acpi_attach(device_t dev) /* * Controller is root: */ - if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc) != 0) { + if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc, INTR_ROOT_IRQ) != 0) { device_printf(dev, "could not set PIC as a root\n"); intr_pic_deregister(dev, xref); goto cleanup; diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c index 7ebc4faaa862..06a869eaae42 100644 --- a/sys/arm/arm/gic_fdt.c +++ b/sys/arm/arm/gic_fdt.c @@ -153,7 +153,8 @@ gic_fdt_attach(device_t dev) */ pxref = ofw_bus_find_iparent(ofw_bus_get_node(dev)); if (pxref == 0 || xref == pxref) { - if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc) != 0) { + if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc, INTR_ROOT_IRQ) + != 0) { device_printf(dev, "could not set PIC as a root\n"); intr_pic_deregister(dev, xref); goto cleanup; diff --git a/sys/arm/broadcom/bcm2835/bcm2835_intr.c b/sys/arm/broadcom/bcm2835/bcm2835_intr.c index 5a8457bc4b67..65ada57c0b60 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_intr.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_intr.c @@ -405,7 +405,8 @@ bcm_intc_attach(device_t dev) sc->intc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intc_irq_res == NULL) { - if (intr_pic_claim_root(dev, xref, bcm2835_intc_intr, sc) != 0) { + if (intr_pic_claim_root(dev, xref, bcm2835_intc_intr, sc, INTR_ROOT_IRQ) + != 0) { /* XXX clean up */ device_printf(dev, "could not set PIC as a root\n"); return (ENXIO); diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c index 8ff824d34521..7ed9dedaa77e 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -538,7 +538,7 @@ bcm_lintc_init_pmu_on_ap(struct bcm_lintc_softc *sc, u_int cpu) } static void -bcm_lintc_init_secondary(device_t dev) +bcm_lintc_init_secondary(device_t dev, uint32_t rootnum) { u_int cpu; struct bcm_lintc_softc *sc; @@ -646,7 +646,8 @@ bcm_lintc_pic_attach(struct bcm_lintc_softc *sc) if (pic == NULL) return (ENXIO); - error = intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc); + error = intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc, + INTR_ROOT_IRQ); if (error != 0) return (error); diff --git a/sys/arm/ti/aintc.c b/sys/arm/ti/aintc.c index 776d231c3c48..b822a2038211 100644 --- a/sys/arm/ti/aintc.c +++ b/sys/arm/ti/aintc.c @@ -230,7 +230,8 @@ ti_aintc_pic_attach(struct ti_aintc_softc *sc) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc)); + return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, + INTR_ROOT_IRQ)); } static int diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 3dff834e27a2..9e33fd998502 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -26,6 +26,7 @@ */ #include +#include #include #include @@ -232,6 +233,7 @@ ENTRY(handle_el1h_irq) save_registers 1 KMSAN_ENTER mov x0, sp + mov x1, #INTR_ROOT_IRQ bl intr_irq_handler KMSAN_LEAVE restore_registers 1 @@ -266,6 +268,7 @@ ENTRY(handle_el0_irq) save_registers 0 KMSAN_ENTER mov x0, sp + mov x1, #INTR_ROOT_IRQ bl intr_irq_handler do_ast KMSAN_LEAVE diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index 0b25650b3fbf..964a129111e2 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -1093,7 +1093,7 @@ gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) #ifdef SMP static void -gic_v3_init_secondary(device_t dev) +gic_v3_init_secondary(device_t dev, uint32_t rootnum) { struct gic_v3_setup_periph_args pargs; device_t child; @@ -1140,7 +1140,7 @@ gic_v3_init_secondary(device_t dev) for (i = 0; i < sc->gic_nchildren; i++) { child = sc->gic_children[i]; - PIC_INIT_SECONDARY(child); + PIC_INIT_SECONDARY(child, rootnum); } } diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index 180066b88930..86ddb316da1d 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -345,8 +345,9 @@ gic_v3_acpi_attach(device_t dev) } } - if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc) - != 0) { + err = intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc, + INTR_ROOT_IRQ); + if (err != 0) { err = ENXIO; goto error; } diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index 5637f6933956..f913d3bfaee6 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -161,7 +161,8 @@ gic_v3_fdt_attach(device_t dev) /* Register xref */ OF_device_register_xref(xref, dev); - if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc) != 0) { + err = intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc, INTR_ROOT_IRQ); + if (err != 0) { err = ENXIO; goto error; } diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index d69f86023da6..a79706526c80 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1284,7 +1284,7 @@ gicv3_its_setup_intr(device_t dev, struct intr_irqsrc *isrc, #ifdef SMP static void -gicv3_its_init_secondary(device_t dev) +gicv3_its_init_secondary(device_t dev, uint32_t rootnum) { struct gicv3_its_softc *sc; diff --git a/sys/kern/pic_if.m b/sys/kern/pic_if.m index 53117e4b15f7..f78e787594c5 100644 --- a/sys/kern/pic_if.m +++ b/sys/kern/pic_if.m @@ -74,7 +74,7 @@ CODE { } static void - null_pic_init_secondary(device_t dev) + null_pic_init_secondary(device_t dev, uint32_t rootnum) { } @@ -157,6 +157,7 @@ METHOD void pre_ithread { METHOD void init_secondary { device_t dev; + uint32_t rootnum; } DEFAULT null_pic_init_secondary; METHOD void ipi_send { diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 210989868415..a6052f28b04c 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -89,6 +89,15 @@ #define INTRNAME_LEN (2*MAXCOMLEN + 1) +/* + * Archs may define multiple roots with INTR_ROOT_NUM to support different kinds + * of interrupts (e.g. arm64 FIQs which use a different exception vector than + * IRQs). + */ +#if !defined(INTR_ROOT_NUM) +#define INTR_ROOT_NUM 1 +#endif + #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -99,13 +108,14 @@ MALLOC_DECLARE(M_INTRNG); MALLOC_DEFINE(M_INTRNG, "intr", "intr interrupt handling"); -/* Main interrupt handler called from assembler -> 'hidden' for C code. */ -void intr_irq_handler(struct trapframe *tf); - /* Root interrupt controller stuff. */ -device_t intr_irq_root_dev; -static intr_irq_filter_t *irq_root_filter; -static void *irq_root_arg; +struct intr_irq_root { + device_t dev; + intr_irq_filter_t *filter; + void *arg; +}; + +static struct intr_irq_root intr_irq_roots[INTR_ROOT_NUM]; struct intr_pic_child { SLIST_ENTRY(intr_pic_child) pc_next; @@ -327,12 +337,17 @@ isrc_release_counters(struct intr_irqsrc *isrc) * from the assembler, where CPU interrupt is served. */ void -intr_irq_handler(struct trapframe *tf) +intr_irq_handler(struct trapframe *tf, uint32_t rootnum) { struct trapframe * oldframe; struct thread * td; + struct intr_irq_root *root; + + KASSERT(rootnum < INTR_ROOT_NUM, + ("%s: invalid interrupt root %d", __func__, rootnum)); - KASSERT(irq_root_filter != NULL, ("%s: no filter", __func__)); + root = &intr_irq_roots[rootnum]; + KASSERT(root->filter != NULL, ("%s: no filter", __func__)); kasan_mark(tf, sizeof(*tf), sizeof(*tf), 0); kmsan_mark(tf, sizeof(*tf), KMSAN_STATE_INITED); @@ -342,7 +357,7 @@ intr_irq_handler(struct trapframe *tf) td = curthread; oldframe = td->td_intr_frame; td->td_intr_frame = tf; - irq_root_filter(irq_root_arg); + (root->filter)(root->arg); td->td_intr_frame = oldframe; critical_exit(); #ifdef HWPMC_HOOKS @@ -479,6 +494,14 @@ isrc_free_irq(struct intr_irqsrc *isrc) return (0); } +device_t +intr_irq_root_device(uint32_t rootnum) +{ + KASSERT(rootnum < INTR_ROOT_NUM, + ("%s: invalid interrupt root %d", __func__, rootnum)); + return (intr_irq_roots[rootnum].dev); +} + /* * Initialize interrupt source and register it into global interrupt table. */ @@ -877,9 +900,10 @@ intr_pic_deregister(device_t dev, intptr_t xref) */ int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, - void *arg) + void *arg, uint32_t rootnum) { struct intr_pic *pic; + struct intr_irq_root *root; pic = pic_lookup(dev, xref, FLAG_PIC); if (pic == NULL) { @@ -901,14 +925,17 @@ intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, * Note that we further suppose that there is not threaded interrupt * routine (handler) on the root. See intr_irq_handler(). */ - if (intr_irq_root_dev != NULL) { + KASSERT(rootnum < INTR_ROOT_NUM, + ("%s: invalid interrupt root %d", __func__, rootnum)); + root = &intr_irq_roots[rootnum]; + if (root->dev != NULL) { device_printf(dev, "another root already set\n"); return (EBUSY); } - intr_irq_root_dev = dev; - irq_root_filter = filter; - irq_root_arg = arg; + root->dev = dev; + root->filter = filter; + root->arg = arg; debugf("irq root set to %s\n", device_get_nameunit(dev)); return (0); @@ -1552,14 +1579,19 @@ dosoftints(void) void intr_pic_init_secondary(void) { + device_t dev; + uint32_t rootnum; /* - * QQQ: Only root PIC is aware of other CPUs ??? + * QQQ: Only root PICs are aware of other CPUs ??? */ - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - //mtx_lock(&isrc_table_lock); - PIC_INIT_SECONDARY(intr_irq_root_dev); + for (rootnum = 0; rootnum < INTR_ROOT_NUM; rootnum++) { + dev = intr_irq_roots[rootnum].dev; + if (dev != NULL) { + PIC_INIT_SECONDARY(dev, rootnum); + } + } //mtx_unlock(&isrc_table_lock); } #endif diff --git a/sys/riscv/riscv/aplic.c b/sys/riscv/riscv/aplic.c index 19b80409c0f2..af58bb014745 100644 --- a/sys/riscv/riscv/aplic.c +++ b/sys/riscv/riscv/aplic.c @@ -321,6 +321,7 @@ aplic_setup_direct_mode(device_t dev) int error = ENXIO; u_int irq; int cpu, hartid, rid, i, nintr, idc; + device_t rootdev; sc = device_get_softc(dev); node = ofw_bus_get_node(dev); @@ -407,7 +408,8 @@ aplic_setup_direct_mode(device_t dev) APLIC_IDC_ITHRESHOLD_DISABLE); } - iparent = OF_xref_from_node(ofw_bus_get_node(intr_irq_root_dev)); + rootdev = intr_irq_root_device(INTR_ROOT_IRQ); + iparent = OF_xref_from_node(ofw_bus_get_node(rootdev)); cell = IRQ_EXTERNAL_SUPERVISOR; irq = ofw_bus_map_intr(dev, iparent, 1, &cell); error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); diff --git a/sys/riscv/riscv/intc.c b/sys/riscv/riscv/intc.c index 399bb05bbcfe..248175e8bea3 100644 --- a/sys/riscv/riscv/intc.c +++ b/sys/riscv/riscv/intc.c @@ -181,7 +181,7 @@ intc_attach(device_t dev) if (pic == NULL) return (ENXIO); - return (intr_pic_claim_root(sc->dev, xref, intc_intr, sc)); + return (intr_pic_claim_root(sc->dev, xref, intc_intr, sc, INTR_ROOT_IRQ)); } static void @@ -241,7 +241,7 @@ intc_setup_intr(device_t dev, struct intr_irqsrc *isrc, #ifdef SMP static void -intc_init_secondary(device_t dev) +intc_init_secondary(device_t dev, uint32_t rootnum) { struct intc_softc *sc; struct intr_irqsrc *isrc; diff --git a/sys/riscv/riscv/sbi_ipi.c b/sys/riscv/riscv/sbi_ipi.c index d694b476f5f9..fac5c0c39b99 100644 --- a/sys/riscv/riscv/sbi_ipi.c +++ b/sys/riscv/riscv/sbi_ipi.c @@ -141,6 +141,7 @@ sbi_ipi_attach(device_t dev) int irq, rid, error; phandle_t iparent; pcell_t cell; + device_t rootdev; sc = device_get_softc(dev); sc->dev = dev; @@ -155,7 +156,8 @@ sbi_ipi_attach(device_t dev) return (ENXIO); } - iparent = OF_xref_from_node(ofw_bus_get_node(intr_irq_root_dev)); + rootdev = intr_irq_root_device(INTR_ROOT_IRQ); + iparent = OF_xref_from_node(ofw_bus_get_node(rootdev)); cell = IRQ_SOFTWARE_SUPERVISOR; irq = ofw_bus_map_intr(dev, iparent, 1, &cell); error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); diff --git a/sys/riscv/riscv/timer.c b/sys/riscv/riscv/timer.c index 456dd463ab2a..7ff8a84f3769 100644 --- a/sys/riscv/riscv/timer.c +++ b/sys/riscv/riscv/timer.c @@ -196,6 +196,7 @@ riscv_timer_attach(device_t dev) int irq, rid, error; phandle_t iparent; pcell_t cell; + device_t rootdev; sc = device_get_softc(dev); if (riscv_timer_sc != NULL) @@ -211,7 +212,8 @@ riscv_timer_attach(device_t dev) riscv_timer_sc = sc; - iparent = OF_xref_from_node(ofw_bus_get_node(intr_irq_root_dev)); + rootdev = intr_irq_root_device(INTR_ROOT_IRQ); + iparent = OF_xref_from_node(ofw_bus_get_node(rootdev)); cell = IRQ_TIMER_SUPERVISOR; irq = ofw_bus_map_intr(dev, iparent, 1, &cell); error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c index 3a7b3fba26b9..89eb6a1a378b 100644 --- a/sys/riscv/riscv/trap.c +++ b/sys/riscv/riscv/trap.c @@ -74,8 +74,6 @@ #include #endif -void intr_irq_handler(struct trapframe *tf); - int (*dtrace_invop_jump_addr)(struct trapframe *); /* Called from exception.S */ @@ -319,7 +317,7 @@ do_trap_supervisor(struct trapframe *frame) exception = frame->tf_scause & SCAUSE_CODE; if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ - intr_irq_handler(frame); + intr_irq_handler(frame, INTR_ROOT_IRQ); return; } @@ -400,7 +398,7 @@ do_trap_user(struct trapframe *frame) exception = frame->tf_scause & SCAUSE_CODE; if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ - intr_irq_handler(frame); + intr_irq_handler(frame, INTR_ROOT_IRQ); return; } intr_enable(); diff --git a/sys/sys/intr.h b/sys/sys/intr.h index f6957864c639..54e838e5015a 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -33,10 +33,15 @@ #error Need INTRNG for this file #endif +#ifndef LOCORE #include +#endif #define INTR_IRQ_INVALID 0xFFFFFFFF +#define INTR_ROOT_IRQ 0 + +#ifndef LOCORE enum intr_map_data_type { INTR_MAP_DATA_ACPI = 0, INTR_MAP_DATA_FDT, @@ -110,12 +115,13 @@ u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); struct intr_pic *intr_pic_register(device_t, intptr_t); int intr_pic_deregister(device_t, intptr_t); -int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *); +int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, + uint32_t); int intr_pic_add_handler(device_t, struct intr_pic *, intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); bool intr_is_per_cpu(struct resource *); -extern device_t intr_irq_root_dev; +device_t intr_irq_root_device(uint32_t); /* Intr interface for BUS. */ @@ -163,4 +169,8 @@ void intr_ipi_send(cpuset_t cpus, u_int ipi); void intr_ipi_dispatch(u_int ipi); #endif +/* Main interrupt handler called from asm on most archs except riscv. */ +void intr_irq_handler(struct trapframe *tf, uint32_t rootnum); + +#endif /* !LOCORE */ #endif /* _SYS_INTR_H */ From nobody Sun Sep 22 13:19:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRY720pgz5X9WM; Sun, 22 Sep 2024 13:19: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 4XBRY70XPcz4Hnw; Sun, 22 Sep 2024 13:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVugKQ3eWgtSCghry1k3UwQL6sgSC4cdQV6Nm2/citI=; b=MSEPQUFTWQhpUAggFzACt3ZwU1qKhoOgRWAffNUNX3XDBJc3TLjsQ0PcsRRRqnf9azNdw7 WuTzeLS+XpNxZtyA065Z3G++VQD71/7z+Haunm7j2iqS2x8hbYYsaWZrxDsC415Uvmo2Kf lV0v5p8Emw3CtoH0YKHCQ3f+OWlHfilsW05K9qFnjTgUmtzhaKx132atrmmw/dB1adTFZO MUhyKO/RLSfKBAU9wGH/P5FtIbWk+fy+lKPxqyxFrZ7uhjmOM+TfI8u84xJXhOOuQa9VCS Jz3Dvth0K1PhIM1TRDokXXIxZCb+65lY7i8KrLWhnM4lWImHb0dGgr/R8zvCnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727011163; a=rsa-sha256; cv=none; b=ZhMC04zJqaJ6qw+12dvIBAkchMrr/PKI5sIsiPju9/GqootTy+9h3PIJO6QOoGcoc2NGZ1 r7NBIjL2afNjnOX87Ymbfuw8fTNyem3zh4larFsZJ7ZUkfB27ecqRdXGpkC8oyaWA++Dez DJPrEPLxD9pZI0XQIYDTrz5wh1Vxu5X83bt7yUJduurDpQLMLTRPt20eNICniz1MIbYbUU t2GuZrotHgLD9WF2EAXn7L7LgBlAE0Dqlbx3SAZQIX15dgfOoCNl/enI5tN0qeeDuI0IX5 pF4OM2Txn3GtDCdyaCBMPv/3ByGdDxbQcTxn8MverJE++zWFynIvHV3vmxgB7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVugKQ3eWgtSCghry1k3UwQL6sgSC4cdQV6Nm2/citI=; b=Mk1TaaXheYDkqmz8HRGfPT3kAbfdikljKxmYTSpL8IsIRktz1mzLoPG1cDZZXShadP8UXY 2+n6P/YbqamgSVzAsow1dok2LSxpf8quX/nRJwLZM1JUc9aFwyKAnd9hHWHOtMKy17/LyE oWZ9p/Frg2jPZi3Nt2eG6pcpkKo+5VOoy8RORnz2GWnKbdD03DaWuMynnyy0NzM+DGlUnC RCyQrmDs7MMrfumUf+/jB3Ksu1hkNcxbvPOQTchdl6OhrwdJ4aHhRmJGSrV5s4LKMvrJB2 rUGJGLiMA92QYVWPh1cGchGGAA2ILc+iosCHCzZ2MWKLiqbTElNlJfwNhTiGfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBRY66xgCz1HLt; Sun, 22 Sep 2024 13:19: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 48MDJMfC076681; Sun, 22 Sep 2024 13:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDJMdi076678; Sun, 22 Sep 2024 13:19:22 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:19:22 GMT Message-Id: <202409221319.48MDJMdi076678@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: 1f0174c92786 - main - arm64: Add support for FIQs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f0174c92786938ee260d973f5c5172b1a4f6435 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1f0174c92786938ee260d973f5c5172b1a4f6435 commit 1f0174c92786938ee260d973f5c5172b1a4f6435 Author: Ayrton Munoz AuthorDate: 2024-08-10 15:38:26 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:18:34 +0000 arm64: Add support for FIQs arm64 supports FIQs, fast interrupt requests, which are required by Apple silicon which hardwires the ARM timers to FIQs. This is needed by the upcoming Apple Interrupt Controller. Based on work by andrew@ and kevans@ in https://reviews.freebsd.org/D40161. Signed-off-by: Ayrton Munoz Co-authored-by: Kyle Evans Co-authored-by: Andrew Turner Reviewed-by: imp,mmel,mhorne Pull-Request: https://github.com/freebsd/freebsd-src/pull/1363 --- sys/arm64/arm64/exception.S | 32 ++++++++++++++++++++++++++++---- sys/arm64/include/armreg.h | 4 ++-- sys/arm64/include/intr.h | 6 ++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 9e33fd998502..b3f2a3931e08 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -30,6 +30,7 @@ #include #include +#include #include "assym.inc" .text @@ -170,7 +171,7 @@ .macro do_ast mrs x19, daif /* Make sure the IRQs are enabled before calling ast() */ - bic x19, x19, #PSR_I + bic x19, x19, #(PSR_I | PSR_F) 1: /* * Mask interrupts while checking the ast pending flag @@ -240,6 +241,17 @@ ENTRY(handle_el1h_irq) ERET END(handle_el1h_irq) +ENTRY(handle_el1h_fiq) + save_registers 1 + KMSAN_ENTER + mov x0, sp + mov x1, #INTR_ROOT_FIQ + bl intr_irq_handler + KMSAN_LEAVE + restore_registers 1 + ERET +END(handle_el1h_fiq) + ENTRY(handle_el1h_serror) save_registers 1 KMSAN_ENTER @@ -276,6 +288,18 @@ ENTRY(handle_el0_irq) ERET END(handle_el0_irq) +ENTRY(handle_el0_fiq) + save_registers 0 + KMSAN_ENTER + mov x0, sp + mov x1, #INTR_ROOT_FIQ + bl intr_irq_handler + do_ast + KMSAN_LEAVE + restore_registers 0 + ERET +END(handle_el0_fiq) + ENTRY(handle_el0_serror) save_registers 0 KMSAN_ENTER @@ -318,17 +342,17 @@ exception_vectors: vector el1h_sync 1 /* Synchronous EL1h */ vector el1h_irq 1 /* IRQ EL1h */ - vempty 1 /* FIQ EL1h */ + vector el1h_fiq 1 /* FIQ EL1h */ vector el1h_serror 1 /* Error EL1h */ vector el0_sync 0 /* Synchronous 64-bit EL0 */ vector el0_irq 0 /* IRQ 64-bit EL0 */ - vempty 0 /* FIQ 64-bit EL0 */ + vector el0_fiq 0 /* FIQ 64-bit EL0 */ vector el0_serror 0 /* Error 64-bit EL0 */ vector el0_sync 0 /* Synchronous 32-bit EL0 */ vector el0_irq 0 /* IRQ 32-bit EL0 */ - vempty 0 /* FIQ 32-bit EL0 */ + vector el0_fiq 0 /* FIQ 32-bit EL0 */ vector el0_serror 0 /* Error 32-bit EL0 */ GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 54600d63891e..2c4707679432 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -411,7 +411,7 @@ #define DAIF_I (1 << 1) #define DAIF_F (1 << 0) #define DAIF_ALL (DAIF_D | DAIF_A | DAIF_I | DAIF_F) -#define DAIF_INTR (DAIF_I) /* All exceptions that pass */ +#define DAIF_INTR (DAIF_I | DAIF_F) /* All exceptions that pass */ /* through the intr framework */ /* DBGBCR_EL1 - Debug Breakpoint Control Registers */ @@ -2401,7 +2401,7 @@ #define PSR_D 0x00000200UL #define PSR_DAIF (PSR_D | PSR_A | PSR_I | PSR_F) /* The default DAIF mask. These bits are valid in spsr_el1 and daif */ -#define PSR_DAIF_DEFAULT (PSR_F) +#define PSR_DAIF_DEFAULT (0) #define PSR_BTYPE 0x00000c00UL #define PSR_SSBS 0x00001000UL #define PSR_ALLINT 0x00002000UL diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h index 3cdbc83ff109..f7aa2de0ee00 100644 --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -27,6 +27,7 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +#ifndef LOCORE #ifdef FDT #include #endif @@ -48,4 +49,9 @@ arm_irq_memory_barrier(uintptr_t irq) #define ACPI_GPIO_XREF 3 #endif +#endif /* !LOCORE */ + +#define INTR_ROOT_FIQ 1 +#define INTR_ROOT_NUM 2 + #endif /* _MACHINE_INTR_H */ From nobody Sun Sep 22 13:19:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRZ04Xfdz5X9rc for ; Sun, 22 Sep 2024 13:20:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 4XBRZ00nDrz4JTR for ; Sun, 22 Sep 2024 13:20:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7d4f85766f0so2895849a12.2 for ; Sun, 22 Sep 2024 06:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727011206; x=1727616006; 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=qi3opoN4FC5MXNtkIWBPG3XxsqOaivMcwrPmcV5M4qg=; b=Bq1Y3QEUYIsfB0t83J65ZBdJoQgXi70hMZbBFFkNhXvXrW3P+lVeS94DHxKR0mDw1B LlhtTbj2rPeCEZQ0Dle1woK2b/D5uw3QxEvwtwkBKDsfXXdZNoKBTHN70exuhXDTyUXx 6okzlZsucDWwIwPFdU/SbgvR/utC2n4y5FjcJ2vlM4SKwl5mgFEy8oi4mAZGfOuF0Bv9 uZXr2DjCPGRvvYLEWjXXX+CnKPOckCvmtviv8wNPn9HaSy1yXY+7jQPu0LnNILp/eICy fsOBdbmdRWya9CB8sF34LY09XFgkdxvyOKj7BfZ8zBHgh6Q2lEiuNcnhNfSgCCSGk1bn 0Pkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727011206; x=1727616006; 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=qi3opoN4FC5MXNtkIWBPG3XxsqOaivMcwrPmcV5M4qg=; b=sPdQyQb+D9RN9YTK/WsxyryfeZDrc2B4IUmrrNEbCss2OInOFmtuwXzuS6sB6nMQVK o62CP/OK5v97HZBb+9A4Fhh8xL62KTgtPXrBl3LO6peU8vmQ7okNMJ+H4SNJ6lWw3tyL YHp7f0bcmbsb4WJQO9g5aijguabzCH+5mQ9ZdzckwNuT8SZIL0t+FGFau//C3Yj538Z8 XkYALe2TKebSZP2WAURdWeuf9BNVkrpqD2yeKNwEfJBwCrN9oPXRAa91M5c3V89VKHnn KeiCZ6TCNHJA+JcHgoZ8Hil9ppv3nMo2+llRLgcy+Z+owcBIusfQQF+/GYP1qWrt1Yfv FcKA== X-Forwarded-Encrypted: i=1; AJvYcCXEI5bbmKiuXfxsAOn8QyhuffL/dj/myqUBOUIyhqEz8RRraDxkTgmo5wmBmBbXvGPuveg+HReXx8lUwuLwRSSugKBN@freebsd.org X-Gm-Message-State: AOJu0YyTDvlah3Ej0uedEgHPfXagJ5UceOiQrccLlq/L1El/o7fljPhR S4DkAwYuhUaznZ8m62tVAb4A1azUjmJe/umxmh77KtA0yne7HgptSIsv2H39BciVFEv5A2L/wT6 UD5Pyu1KZWmyQ9lELF3sBIZajxMwoTeNdkisaOw== X-Google-Smtp-Source: AGHT+IH4/b3p2/ykNzMM00o6WRDDIrUz2hG8AaOAeFN+o1YC+9y23npy8bZSHVVoomTm9ff11ayYIg9dKzPg2H477P0= X-Received: by 2002:a17:90b:4b8e:b0:2da:8974:b3e3 with SMTP id 98e67ed59e1d1-2dd7f71a9c1mr11544309a91.27.1727011206091; Sun, 22 Sep 2024 06:20:06 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 22 Sep 2024 14:19:54 +0100 Message-ID: Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output To: Mark Johnston Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Content-Type: multipart/alternative; boundary="00000000000076754d0622b521c7" 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: 4XBRZ00nDrz4JTR X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --00000000000076754d0622b521c7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Sep 22, 2024 at 11:29=E2=80=AFAM Mark Johnston = wrote: > On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d= 36654cde1 > > > > commit 94567c8641e235763b5b2926416d89d36654cde1 > > Author: Bram > > AuthorDate: 2024-07-23 08:57:42 +0000 > > Commit: Warner Losh > > CommitDate: 2024-09-20 15:06:26 +0000 > > > > netstat: Resolve duplicate "dropped-packets" key from libxo output > > > > The current libxo output uses the "dropped-packets" key for both > incoming and > > outgoing packets. This commit distinguishes between the two by > adding an "in" > > and "out" suffix. The original "dropped-packets" key is kept for > backwards > > compatibility for now. > > > > PR: 244589 > > Reviewed by: imp, zlei > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 > > --- > > usr.bin/netstat/if.c | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c > > index 172ea5324ccb..f0af785bce04 100644 > > --- a/usr.bin/netstat/if.c > > +++ b/usr.bin/netstat/if.c > > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) > > IFA_STAT(ipackets), link|network, 1); > > show_stat("lu", nerr_len, "received-errors", > IFA_STAT(ierrors), > > link, 1); > > + /* Below is kept for backwards compatibility. Will be > removed in the future. */ > > show_stat("lu", nerr_len, "dropped-packets", > IFA_STAT(iqdrops), > > link, 1); > > + show_stat("lu", nerr_len, "dropped-packets-in", > IFA_STAT(iqdrops), > > + link, 1); > > This breaks plain netstat output, causing a bunch of network tests to > fail. For instance, "netstat -Wf link -I re0" now prints an extra > column. > > I think we should not bother with backwards compat unless libxo is > emitting structured output. This can be implemented using the "e" > format modifier described in the xo_format modified, but I'm not sure > how to plumb it through show_stat(). > > Let's revert until this is fixed? > Works for me. I hadn't noticed before the push. Thanks for bringing it up. Warner > > if (bflag) > > show_stat("lu", nbyte_len, "received-bytes", > > IFA_STAT(ibytes), link|network, 0); > > @@ -516,7 +519,7 @@ intpr(void (*pfunc)(char *), int af) > > show_stat("NRSlu", nerr_len, "collisions", > IFA_STAT(collisions), > > link, 1); > > if (dflag) > > - show_stat("LSlu", nerr_len, "dropped-packets", > > + show_stat("LSlu", nerr_len, "dropped-packets-out"= , > > IFA_STAT(oqdrops), link, 1); > > xo_emit("\n"); > > > > @@ -705,8 +708,11 @@ loop: > > new->ift_ip - old->ift_ip, 1, 1); > > show_stat("lu", 5, "received-errors", > > new->ift_ie - old->ift_ie, 1, 1); > > + /* Below is kept for backwards compatibility. Will be removed in > the future. */ > > show_stat("lu", 5, "dropped-packets", > > new->ift_id - old->ift_id, 1, 1); > > + show_stat("lu", 5, "dropped-packets-in", > > + new->ift_id - old->ift_id, 1, 1); > > show_stat("lu", 10, "received-bytes", > > new->ift_ib - old->ift_ib, 1, 0); > > show_stat("lu", 10, "sent-packets", > > @@ -718,7 +724,7 @@ loop: > > show_stat("NRSlu", 5, "collisions", > > new->ift_co - old->ift_co, 1, 1); > > if (dflag) > > - show_stat("LSlu", 5, "dropped-packets", > > + show_stat("LSlu", 5, "dropped-packets-out", > > new->ift_od - old->ift_od, 1, 1); > > xo_close_instance("stats"); > > xo_emit("\n"); > --00000000000076754d0622b521c7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Sep 22, 2024 at 11:29=E2=80= =AFAM Mark Johnston <markj@freebsd.= org> wrote:
On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d36654cde1<= /a>
>
> commit 94567c8641e235763b5b2926416d89d36654cde1
> Author:=C2=A0 =C2=A0 =C2=A0Bram <
bram@cbbg.nl>
> AuthorDate: 2024-07-23 08:57:42 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-09-20 15:06:26 +0000
>
>=C2=A0 =C2=A0 =C2=A0netstat: Resolve duplicate "dropped-packets&qu= ot; key from libxo output
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0The current libxo output uses the "dropped-pac= kets" key for both incoming and
>=C2=A0 =C2=A0 =C2=A0outgoing packets. This commit distinguishes between= the two by adding an "in"
>=C2=A0 =C2=A0 =C2=A0and "out" suffix. The original "drop= ped-packets" key is kept for backwards
>=C2=A0 =C2=A0 =C2=A0compatibility for now.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0PR: 244589
>=C2=A0 =C2=A0 =C2=A0Reviewed by: imp, zlei
>=C2=A0 =C2=A0 =C2=A0Pull Request: https://github= .com/freebsd/freebsd-src/pull/1331
> ---
>=C2=A0 usr.bin/netstat/if.c | 10 ++++++++--
>=C2=A0 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
> index 172ea5324ccb..f0af785bce04 100644
> --- a/usr.bin/netstat/if.c
> +++ b/usr.bin/netstat/if.c
> @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0IF= A_STAT(ipackets), link|network, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("= lu", nerr_len, "received-errors", IFA_STAT(ierrors),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0li= nk, 1);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Below is kept for = backwards compatibility. Will be removed in the future. */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("= lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0li= nk, 1);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu&qu= ot;, nerr_len, "dropped-packets-in", IFA_STAT(iqdrops),
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0link, 1= );

This breaks plain netstat output, causing a bunch of network tests to
fail.=C2=A0 For instance, "netstat -Wf link -I re0" now prints an= extra
column.

I think we should not bother with backwards compat unless libxo is
emitting structured output.=C2=A0 This can be implemented using the "e= "
format modifier described in the xo_format modified, but I'm not sure how to plumb it through show_stat().

Let's revert until this is fixed?

W= orks for me. I hadn't noticed before the push. Thanks for bringing it u= p.

Warner
=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (bflag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0show_stat("lu", nbyte_len, "received-bytes"= ;,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0IFA_STAT(ibytes), link|network, 0);
> @@ -516,7 +519,7 @@ intpr(void (*pfunc)(char *), int af)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("= NRSlu", nerr_len, "collisions", IFA_STAT(collisions),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0li= nk, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (dflag)
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0show_stat("LSlu", nerr_len, "dropped-packets", > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0show_stat("LSlu", nerr_len, "dropped-packets-out"= ;,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0IFA_STAT(oqdrops), link, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xo_emit("\n= ");
>=C2=A0
> @@ -705,8 +708,11 @@ loop:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_ip - old->ift_i= p, 1, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 5, "received-= errors",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_ie - old->ift_i= e, 1, 1);
> +=C2=A0 =C2=A0 =C2=A0/* Below is kept for backwards compatibility. Wil= l be removed in the future. */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 5, "dropped-p= ackets",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_id - old->ift_i= d, 1, 1);
> +=C2=A0 =C2=A0 =C2=A0show_stat("lu", 5, "dropped-packet= s-in",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_id - old->ift_id, 1,= 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 10, "received= -bytes",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_ib - old->ift_i= b, 1, 0);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("lu", 10, "sent-pac= kets",
> @@ -718,7 +724,7 @@ loop:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("NRSlu", 5, "collis= ions",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new->ift_co - old->ift_c= o, 1, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (dflag)
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("LSlu&= quot;, 5, "dropped-packets",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat("LSlu&= quot;, 5, "dropped-packets-out",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ne= w->ift_od - old->ift_od, 1, 1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0xo_close_instance("stats");
>=C2=A0 =C2=A0 =C2=A0 =C2=A0xo_emit("\n");
--00000000000076754d0622b521c7-- From nobody Sun Sep 22 13:24:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRgK3BKWz5XCXv; Sun, 22 Sep 2024 13:24: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 4XBRgK1Trzz4KZ0; Sun, 22 Sep 2024 13:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/LWEA7wkVklCtI5cQfHrcCXnwVh6P/Ju1VHBvuB+fdc=; b=TYgKT+WOeOextSLIoClGdeWY5YXfGKM7C6Pxs9oCgj0TMUZcycA1WCtX1YkzbJRspRgiuh jjOeNmlzjJ6yzu+ca3kEynV8A7n7mej/84rFMhw0MnoprftH7qACTy4LvqE1ryejQ2KuW3 QRX7h9s/SN4B/s2RpkJSpMaNgirtc0OXsvug2rekao4xBDkrPTxJ1C0Pez1woZJEbR9WEa UVvcMOPQFwLNi7Xn43UL/odaGsbeQhd20PqLtv/z9jwC8JRJKsjGr9FN0/AYjYwz9MZnCh jwo0W5QGcoHbo93/lGKYU3HU9LqPgoWCjDEFovbRGYUaCdVvaGVuLXw8KoUoYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727011485; a=rsa-sha256; cv=none; b=eE0rfrWmfaIdlp/jvCjIpUXRIiO110qwiW4bC6xwlnbR2hpukYv3XOaTqB3ApVbvZlTlCM RPb2sEURG55uhiNiaGmiORJiCTH5uRHyWck3hlPM0pF7ByVA31jkgvOVE7sAvS+OM1Ea71 jHGA6EpEogR4cVgTdFajxJ/RjJxNv5ZqQIAML5tCMFl/IdR739Z07Ik5ABzis1VjnNTfvf t4VTVE7lNSOuvNUDPLXBjNKql4x3Rq+3k7In4zjipf3VZPm7FQWIyRndK6W06PQSWLf6ds uliZ7OKB8XA3u7NVRcV4pQYPxFsqlbbNcjr1mPuyCwiEKXkcNpvnTVO7MRALWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/LWEA7wkVklCtI5cQfHrcCXnwVh6P/Ju1VHBvuB+fdc=; b=N5m+rOcyyuDygM0G6cuIVZhzkP8HXIY/zXaCGHQ8Twy213i27axztwR0dYwMxbLn89YtgF Gx84cNaGUh6NYSnu53pQ+qNeWL1cJuM8vyzGWQ3u01cZHVKRx46MuSOVWCNwlEX+GaEU0j x2tnr13k8Ero1IpLpIVhZTrV3fvC7Emo/OcZoASWVmk0rUKBRGeoFvd02NFXzuZBuMBWHl YRgPOjl2AAhL8SsdERhhsd1XAxBlN8zQD4r788mNOG4ey3UamOosVctnbhkFKaRqaMha66 QJ6RxCix41qEEp0uTjcDwtcb+ag3YMWaFXrIdrlw3bofKIhK74fwiKARHMoVVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBRgK16C4z1HJw; Sun, 22 Sep 2024 13:24: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 48MDOjti093190; Sun, 22 Sep 2024 13:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDOjiH093187; Sun, 22 Sep 2024 13:24:45 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:24:45 GMT Message-Id: <202409221324.48MDOjiH093187@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: d00827a9ca0b - main - Revert "netstat: Resolve duplicate "dropped-packets" key from libxo output" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d00827a9ca0b4f1838b8671859c52c852c6a2727 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d00827a9ca0b4f1838b8671859c52c852c6a2727 commit d00827a9ca0b4f1838b8671859c52c852c6a2727 Author: Warner Losh AuthorDate: 2024-09-22 13:21:07 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:23:10 +0000 Revert "netstat: Resolve duplicate "dropped-packets" key from libxo output" This reverts commit 94567c8641e235763b5b2926416d89d36654cde1. This breaks normal netstat output. It's kinda tricky to do a quick fix on, so revert this until that can be fixed. If via github, please open a new pull request... Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 --- usr.bin/netstat/if.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 877c7aa8dd5e..172ea5324ccb 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -501,11 +501,8 @@ intpr(void (*pfunc)(char *), int af) IFA_STAT(ipackets), link|network, 1); show_stat("lu", nerr_len, "received-errors", IFA_STAT(ierrors), link, 1); - /* Below is kept for backwards compatibility. Will be removed before FreeBSD 16. */ show_stat("lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops), link, 1); - show_stat("lu", nerr_len, "dropped-packets-in", IFA_STAT(iqdrops), - link, 1); if (bflag) show_stat("lu", nbyte_len, "received-bytes", IFA_STAT(ibytes), link|network, 0); @@ -519,7 +516,7 @@ intpr(void (*pfunc)(char *), int af) show_stat("NRSlu", nerr_len, "collisions", IFA_STAT(collisions), link, 1); if (dflag) - show_stat("LSlu", nerr_len, "dropped-packets-out", + show_stat("LSlu", nerr_len, "dropped-packets", IFA_STAT(oqdrops), link, 1); xo_emit("\n"); @@ -708,11 +705,8 @@ loop: new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", new->ift_ie - old->ift_ie, 1, 1); - /* Below is kept for backwards compatibility. Will be removed before FreeBSD 16. */ show_stat("lu", 5, "dropped-packets", new->ift_id - old->ift_id, 1, 1); - show_stat("lu", 5, "dropped-packets-in", - new->ift_id - old->ift_id, 1, 1); show_stat("lu", 10, "received-bytes", new->ift_ib - old->ift_ib, 1, 0); show_stat("lu", 10, "sent-packets", @@ -724,7 +718,7 @@ loop: show_stat("NRSlu", 5, "collisions", new->ift_co - old->ift_co, 1, 1); if (dflag) - show_stat("LSlu", 5, "dropped-packets-out", + show_stat("LSlu", 5, "dropped-packets", new->ift_od - old->ift_od, 1, 1); xo_close_instance("stats"); xo_emit("\n"); From nobody Sun Sep 22 13:28:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRlQ6lZLz5XDj0; Sun, 22 Sep 2024 13:28: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 4XBRlQ5ZGvz4LJ4; Sun, 22 Sep 2024 13:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2dqvYYpnteDE1/KaW+G8AVnlJrIn7F/3oLUBy0/nf/4=; b=O1l4/TJJvp9UzrUNhoVlyRYWqO3TWtFWDHLxEfK30AHi5Ym99FSBeC8Jq+U05RMxwENr58 wdKSwEQDaxYjiNnBuxWcruli4b6rsdwN8gaPZBqBYS5hScCQ0Avo/DP2qf9TcViIb85ZVA SLCkQzKH4hhEOtj02vzicmcZV6g2v5OU81iWr0vIB9FMbdQfSm2G4YdrMoMLoWAWKaAGm0 zfbB7DpTmlj5sA9y9Ela2SaI7NEQd3Bz1+FIqm546yFIL07jLbcEXravVBI/LqyLWUtje9 rXdW6MOe4n1NVr1Leon59bpRtGcX5FNWX1nNsBEUc84IJLEiYgpXhuiX3uFaEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727011698; a=rsa-sha256; cv=none; b=D+0ksCgsUOSJit/ohTcKmHB6t/vBejENc0pIIfLtPcOTAk8P7yb/G5Z1bi786MODwdWAqJ wtUQDLr89YRXjE/ORUePF3yvAfmsTbR59otpgnIRkV9u4gxWRDHbnuY/p96x8XS0ta46gu H0een/eWa/dS5yXsVQ97eMjJ6NIsnodSAE+6VmJPuGh+zIs7tUZ5ydlCJf7Jn7s0G+Gug4 HcSGiaCmPI6HVdk3GprdQokCGK2xUaoSnyWGiavZEXZAtTs4NuPtib89GujN/qib5Q/NUi dUgcE41kZ3/UZ5ca/5+LcOoMOnGGcKyLoXLJpm2IvLhPVMivrTqzLDUI3BRmHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727011698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2dqvYYpnteDE1/KaW+G8AVnlJrIn7F/3oLUBy0/nf/4=; b=fUbjrbHqvig5Yy7J7erSvnbfzT5iG5toGVbxxLFgKGi2I1hmiu2U7h4mX8Gd3tpvM6SuDK HiqT8EJwbK6KvvIovi/9BZB9Mdmv0HpL8zOO2f44NG9KjqEe+NBXzp8JehJ67Q7wFBA12x tN3V8mQJV0aYsvUm9IWvdqxs6FcZmzRvzAqxfjGomewtFOh4At/WPnK8uZrF1Aly1eUps2 Ppha7et6FmRklJguwa8KF4XggSNmRMILPa9O9QvYp/ilF1eH3CQKyhJ90wgI1oFkPxQZ8g L66gNty8g+WwHPb5JUsvcTZWWuK+3H4KQl3Wa2CBcgUFlgDPnHMGAHmBD6NNeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBRlQ59kVz1HnJ; Sun, 22 Sep 2024 13:28: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 48MDSIgu093786; Sun, 22 Sep 2024 13:28:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDSITV093783; Sun, 22 Sep 2024 13:28:18 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:28:18 GMT Message-Id: <202409221328.48MDSITV093783@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: 00b0498051de - main - Fix xo_emit format string for percentages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00b0498051de59c9014fe2cf239b28c3e4bd469c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=00b0498051de59c9014fe2cf239b28c3e4bd469c commit 00b0498051de59c9014fe2cf239b28c3e4bd469c Author: John F. Carr AuthorDate: 2024-04-22 19:13:44 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:26:46 +0000 Fix xo_emit format string for percentages The "%lld" format string was used with a value of type long. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278532. Reviewed by: imp, mmel Pull Request: https://github.com/freebsd/freebsd-src/pull/1344 --- usr.bin/vmstat/vmstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index e7790ad6e2f6..1d0eb4c9283f 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1105,7 +1105,7 @@ percent(const char *name, long pctv, int *over) { char fmt[64]; - snprintf(fmt, sizeof(fmt), " {:%s/%%%ulld/%%lld}", name, + snprintf(fmt, sizeof(fmt), " {:%s/%%%uld/%%ld}", name, (*over && pctv <= 9) ? 1 : 2); xo_emit(fmt, pctv); if (*over && pctv <= 9) From nobody Sun Sep 22 13:33:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBRsK49Ntz5XGjv; Sun, 22 Sep 2024 13:33: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 4XBRsK2b5Yz4MlF; Sun, 22 Sep 2024 13:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727012005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5MXN4OYCfrU2MAvar/8WG58FQa7ZorNrVbzdInlaO9Q=; b=tSzWMI106slJ8bUtc1B1hXM/YcrBA3L3nw4LpuRBEi0DzHX7qsAn+IhS9VpNZRsVbIQQG3 dRlYz6ymbxhqmLp84bKh2Xj84PI4I3DWS2igX6WFs1xzhlRiptKBD/nHHvJ5Pff1qcuInP DAU5xR2GqOaeZM+Tv/GErzreWgpg5UAz8o5sYBNAk7+uPDfR7UkvmSiCNzg1MLZqwM0WWW nYgoypsqsR1erxxSZl95fFfQc6amqwxBaJbdUNd5hKmyL5dLOACpho4BFkmYZ71YK02wcY 2ORDr+v2pyUp/FK9NZ/hLPcHqdy6HO5vrGKS40UNQqpsdjxxYI3/Jw3fZ58MYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727012005; a=rsa-sha256; cv=none; b=j1zEiaB9Ao419G+OynG59YXEAwWkzKKsQhMDC6RX8PVIynp01i8KPR8pOFPdxm6/bWht9O I7MJwC3IqIDGBhIB06sKgp3QkQYuvwrGkJr1h/lQAhwYtgNEi8RdlCgOJJ7GUzbpU5A+DE Y+lvvg8MpX5GGzoV6SCQCijkKr0/dsAwwRB6G6kNp/NuLRwmk+KR+eLEgbtr5Mf7fqFfYW /u4YCmU4qZnASwmzNF+d4tfeMRtG3sqH5zwhmZcqyGNjV+2Z4RJiqEblWQiJgz9C3w8lqY hWJOdbZzix6AbIwl1qNydMEFfZYjQWKuPOCNGi6Ih1l6PcKyqXJFuwwGTmpHqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727012005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5MXN4OYCfrU2MAvar/8WG58FQa7ZorNrVbzdInlaO9Q=; b=TLYd7yyyOBPQZAxSMwYcdR1vd+HRDl8Fk2GGjDj5lgzf1Yj3wIvsEfz+Z/Yj8FwHoDhJHD EA51VYJgsTtO+D9fqstTWhMSK1j8y/PDy6izPrab75SzJMRT/kcYkSb/a52B+0AzX6eW7s lbQsq9zAH03AS1QFllxM4FiV9lxi6ArdZhDLUgelAgydKGKz6Iv8TTxfdwdhWnqxqgKZR9 gIpXEo/lxly+LymkhNZnVmQoY4vAu4NZLdLCOqtunqbPsxoV0XSyHPxDIs7uIRlpWdYXQb m1D+CowNsiqW7fKWj4yoksmbOeyhAR/pA6y6ZJUKIiCqLerf55zvqHEtsoa0qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBRsK2Cc2z1J6x; Sun, 22 Sep 2024 13:33: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 48MDXPG9009775; Sun, 22 Sep 2024 13:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDXPeA009772; Sun, 22 Sep 2024 13:33:25 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:33:25 GMT Message-Id: <202409221333.48MDXPeA009772@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: 17cccb6f9092 - main - libsa: Fix a comment to be less vague List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17cccb6f909203e29e7d013d54e3e3620b34769a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=17cccb6f909203e29e7d013d54e3e3620b34769a commit 17cccb6f909203e29e7d013d54e3e3620b34769a Author: Warner Losh AuthorDate: 2024-09-22 13:32:00 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:32:00 +0000 libsa: Fix a comment to be less vague Be more specific about where this is used. Sponsored by: Netflix --- stand/libsa/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index dda3bfcea88f..6064a6780921 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -164,7 +164,7 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c crc32_libkern.c -# Bits from GELI which are reused elsewhere +# Bits from GELI reused for some random seeding cases .PATH: ${SYSDIR}/geom/eli SRCS+= g_eli_hmac.c pkcs5v2.c From nobody Sun Sep 22 13:53:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSJs5lGLz5XQLj; Sun, 22 Sep 2024 13:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBSJs3GMKz4R0L; Sun, 22 Sep 2024 13:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OnXfkF0Z9AAUFkmJ8LebsvRsbtD2dimTxIylxAF+ESg=; b=oMb+Vp9KPg7jDJHN01TzNRDMfd0+MfETA2ZP5xU5EGDcdey4o8bi9WA1TzBKRqeyn4gllv pY4ZFq9dsg6K0VSM6VWKK+WhUPkDXyCF7t+4DXVCdVopexR1IMG5uiDeoZtbbv6L4IqhMW J8Z9o2SbvjvZZ9maBPfLRViWSmhjtmsGRm1YvUelmO59go6K1AsADV7egpZlaxqgAW0FUd a/56QsnEYolYd98eMm7cyNr/yDcIgz6tfTVLWj0gpxxH5z/4FS6j7NiyjKSO8slU/eAAqJ zbrMfidezst19orIOSgVM/bnR0qk7n3LJTGp6Sd6WOGuXoZfywCp4DL65FaRUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013229; a=rsa-sha256; cv=none; b=HHva77357Gc4KU0RKbCGZutHjuPIekkTPu08gEEMscnT8sF9h/zCtcWbLhuzlnBKUHzIMp HlKW1JbgsCFJBgDYwptCxKl1hE6O6sBdAuMkt1EXnzxH3jQpbExdJfrIC9Yb38yFJEwbL1 nS/pEupH05YTd4pFClrRFoaubxILA4+AnNpQXH3mfxqeXpzaO0tffU+ddVFWCJA19yfdzf iiwg/hj6MVJCBxNnyBm30NgcKnLpPw8AmvZritKvbdvBZam34OvMZIJ0ZdOoWHIESovqTG Z0AFNPCLWo0EhByILHO0g/GT3iFxZ3JqJAnyP9XXacySZgKHuT7uiZAuktc5Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OnXfkF0Z9AAUFkmJ8LebsvRsbtD2dimTxIylxAF+ESg=; b=BZ63Rj/OgY542HI/HYOxSFTGji8m1cqkv9WeOYG6HyjQw3Yj90XFl+zxZHSLEaXBm08A9U nYe0NgZJYN0zGmUcgQ+lQ3BvyzI7nW6TtxzcYfZB0ZVHkuX00xueLzu4I8lnV4mrmTx6Gm CBPIAC7xFFDIpNaoQlRHLV8S0JItNp7ldxqazarRWbNYIjLsrB7rEyxMydNKAfszTEpXxb Ym7o/nfRDrp/S09yGZku94RLsOMPmimwG32fkb8/X8InLuX0g3EPZf00lFQIuwZasajU1A J/t/We9t+VR9vgUD7uqZF444cCTw4yfOWvWXTyqQ7G2F3zEiMVciWnWGHfkjmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSJs2t2qz1JNS; Sun, 22 Sep 2024 13:53: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 48MDrnXH044126; Sun, 22 Sep 2024 13:53:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrnC9044123; Sun, 22 Sep 2024 13:53:49 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:49 GMT Message-Id: <202409221353.48MDrnC9044123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 75f6087bf6bb - stable/14 - growfs.8: align and alphabetize options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75f6087bf6bbbfdb270664c81e942b341a3e543f Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=75f6087bf6bbbfdb270664c81e942b341a3e543f commit 75f6087bf6bbbfdb270664c81e942b341a3e543f Author: Alexander Ziaee AuthorDate: 2024-08-12 09:39:03 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:45:53 +0000 growfs.8: align and alphabetize options MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1379 (cherry picked from commit 0d8effbd6e45643154c90942f210b7f7a6ecc61d) --- sbin/growfs/growfs.8 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8 index 9a6076017c74..9b619613f30e 100644 --- a/sbin/growfs/growfs.8 +++ b/sbin/growfs/growfs.8 @@ -61,16 +61,11 @@ The .Nm utility extends the size of the file system on the specified special file. The following options are available: -.Bl -tag -width indent +.Bl -tag -width "-s size" .It Fl N .Dq Test mode . Causes the new file system parameters to be printed out without actually enlarging the file system. -.It Fl y -Causes -.Nm -to assume yes -as the answer to all operator questions. .It Fl s Ar size Determines the .Ar size @@ -87,6 +82,11 @@ This value defaults to the size of the raw partition specified in (in other words, .Nm will enlarge the file system to the size of the entire partition). +.It Fl y +Causes +.Nm +to assume yes +as the answer to all operator questions. .El .Sh EXIT STATUS Exit status is 0 on success, and >= 1 on errors. From nobody Sun Sep 22 13:53:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSJv0N8Jz5XQjZ; Sun, 22 Sep 2024 13:53: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 4XBSJt4JJsz4RBm; Sun, 22 Sep 2024 13:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n3I/YGATOVwmI3YUpYvY5PT8h8aiBZcpS6kDQ1XXA2A=; b=gumncJIWVES8Qb97BecqS4dLsGSrVzEzzFrYUT2BEcdJ/ohk6s1mRp3W3H6Tf4i3Hq8zQ/ kcIQfUPVSRQKFPwfxAurgc6f+CTJf1BEcu7n2PDWhKQw//OWV9TBrrc77aKYzcSa00F9WZ cQ3Q90m9zHXojk1KwE/f5H2M5AN3TLi7PCoVt+xBhHKE/N/npUFjmVClNNMJ7CcoMlX4Km v18B0uwOaPqGA3SL9wB9pttA0lHc0FLVbFePIdaSsgt+GUQB4DkldgW4MCfpSWIPkL0f2Z juRllZmt2AHGAPH3JmC+m+fWDU0l2yRxNEXNk5sQEYp0ikV09pWpCfHVXYupFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013230; a=rsa-sha256; cv=none; b=xzdIPcrHoUb9YVPl4EQLUnhIr7zVcySzBOzeoiNwLPJlWlyTqvFPU4y0a/cjd+pBFjeria jW94P8EQjqTE/IxQMXe01nrkX0QAYpnwii6yKfFBldh1NFEtXeHWrstDP0L5FV8S8ffumD dt0bMpTkmtTxDa0X9HUBJnyMTDHvJsYIyCIYBmmNygMNAwVHjHYBYqyjkaW/Yl5uysc2g1 cn36k6qbkmR7jr49qtQ0re7w3/LxtQYyb6zBkwEG1daRq24ew5rlRuTmG9vrMeHWmFI4Hl Ip3D/ZTp0AhWuXamx46qSsUSRtsK/m0wL01dxxkHTKd0zWTF8D3ivYOgcm6MqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n3I/YGATOVwmI3YUpYvY5PT8h8aiBZcpS6kDQ1XXA2A=; b=bJdnBhHuMBQZOuvwMlEmEDr8xzo9A0tN8Z0ABdzfbO9q9I5oGw+tlaHHZTUY5fiwKTizLF 6doTSXcFgmExBN2KYLnZJlucy5SO/dvGMF52dwFDOM/mTF7am1djcfM/V7tRvUJhVnQD5x C0e/FFjLtfg2pqLbUJ9tSoAVykofk6bcA0nWDfRNFwTi0pvqdo4kP0/MogO/CyefQnbE40 s9l7ErlXzcR0VLYmbZcshDQ4ddFewkwlDGJ98L/d+RhI3JITtoRiJbmnp0g/lpALbJM8Lj wVKKovxnt8e4s1f99LADZZd//RiDafXgwb8IpUmZsLhQrEWA5ucvgDlvLDeqig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSJt3rTdz1J5l; Sun, 22 Sep 2024 13:53: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 48MDroqG044177; Sun, 22 Sep 2024 13:53:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDroNI044174; Sun, 22 Sep 2024 13:53:50 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:50 GMT Message-Id: <202409221353.48MDroNI044174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c3a0e8fe09c5 - stable/14 - diskless.8: show in `apropos pxe` + tag SPDX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3a0e8fe09c5bbe42577b9567015f5f542b1f9bc Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3a0e8fe09c5bbe42577b9567015f5f542b1f9bc commit c3a0e8fe09c5bbe42577b9567015f5f542b1f9bc Author: Alexander Ziaee AuthorDate: 2024-08-12 03:07:42 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:45:53 +0000 diskless.8: show in `apropos pxe` + tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1378 (cherry picked from commit 7e3b6b249f54f5b22eae14dfa48ef7891bc4eac1) --- share/man/man8/diskless.8 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man8/diskless.8 b/share/man/man8/diskless.8 index 8839e27e11ba..cc49854ae850 100644 --- a/share/man/man8/diskless.8 +++ b/share/man/man8/diskless.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt .\" Updated by Luigi Rizzo, Robert Watson .\" All rights reserved. @@ -24,12 +27,12 @@ .\" (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 May 3, 2020 +.Dd August 11, 2024 .Dt DISKLESS 8 .Os .Sh NAME .Nm diskless -.Nd booting a system over the network +.Nd booting a system over the network with PXE .Sh DESCRIPTION The ability to boot a machine over the network is useful for .Em diskless From nobody Sun Sep 22 13:53:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSJv5zD0z5XQgg; Sun, 22 Sep 2024 13:53: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 4XBSJv4YjZz4R0N; Sun, 22 Sep 2024 13:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=giidF+HrvOt2Up8yKGj5K4evLuOQaqC0oEp9+9Skas8=; b=TlW40PjfW+mrW5ggRTGXqIj1QOw7e7nbBvlDyDA26pYIWKWCNb1EXKffvRcPO7o2HBELPi 7F0uUKcYKKG8p63lqgM02/GnTxa3s/JZ7uM5k06v67CJoCnK+AXTbh+iUxxJsa+xOX/bKO fPqkiFCi0iJzEaQruCOu7mpZU5neeBPiSZixGYhcpsZOHfAUyMl8H1wvyvT7vik8TyrxAE A8kdvzLVaMqhHKipCPzx7ql6UdbfvqYN6Q0apbCrOWtgtFPHKEci26AC5bZExWbYb3xnZL blGIMNjmecLHVIyukUsPo4KdVlcjAgEX+5OHZ3if89qDtnx0a9cHyGQRyKu7uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013231; a=rsa-sha256; cv=none; b=Yfn3NzE1m1WINzQsmP/t0naPYWRFDFTt6Pz0sym12slAw1yJivrFAzeyY8G1uFGzwzGgUM AF30WqHqxN6/RhhFVSVeuGJ9XKCFk2v4ty6K7ATXvE4kLwAoKDSpdlaFVfB0408Wi5Z1Pa 9Pl0EBtv3gnbvXin5bG6EXXRRrFF6CvCyamojUmMm7HhuctkKvUpVWQ+Q0Lknhgj5HH5vO ajLybdKUuzCvDyQFD8PR8uWRaXqjXgd7kohx7EFis6GzEdWgeO/EArvZe1CZYZH5uH2nJm dyV5yhAde+Jgluc464EHA5XxL2InXDOBEZSAcn3APOFabUEBt4mB/ALg1v0Ifw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=giidF+HrvOt2Up8yKGj5K4evLuOQaqC0oEp9+9Skas8=; b=lAkMAIknKTLR4U1PTQ8+df08cQTxqnjnplVxfKagwpJWqg6OuSyQsUTpLjoxEu0lJmaMK3 UYcNQX67sPeuTimV2A+c0I3oByj00wTeaUQPmQl56/oj4eW4w/ACcLlFePMibMeiwEhpqu eYDmWB+l5FryanpaJ3TJMHrpINWwCWywZjOIiU9tFPesmT/NGTXChO0iBbT91uogh8ugMg Vy7+fB85yIeS7TUbvWP+Kmk07ft8ekw9Y6E0UpVNInqJ68oJMa9nr1fyKKoLNHJhS/vJdM l6qxbu5L00fDVkfQCKYMgQ+LOJdLXVdUHyg8kk2HUyT7aTZxwTVrclYE0xPQmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSJv4BLHz1JQN; Sun, 22 Sep 2024 13:53: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 48MDrpMD044222; Sun, 22 Sep 2024 13:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrprc044219; Sun, 22 Sep 2024 13:53:51 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:51 GMT Message-Id: <202409221353.48MDrprc044219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2af7c211b0bb - stable/14 - ure.4: description consistencies + tag spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2af7c211b0bb44fb489ca8394ca3170707214be7 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2af7c211b0bb44fb489ca8394ca3170707214be7 commit 2af7c211b0bb44fb489ca8394ca3170707214be7 Author: Alexander Ziaee AuthorDate: 2024-08-14 06:50:18 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:32 +0000 ure.4: description consistencies + tag spdx + consistent document description languague with other USB-BaseT drivers + mention newly added adapters from 6ea4d9 + attempt to mention rgephy(4) phys feed into ure interfaces Fixes: 6ea4d9 (Move RTL8156 from cdce(4) to ure(4)) MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1384 (cherry picked from commit 4c72525953fdf618a3fc0a45f3ef3f071dcc0c52) --- share/man/man4/ure.4 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/share/man/man4/ure.4 b/share/man/man4/ure.4 index 18b68ec9bc8a..773fa7a2426b 100644 --- a/share/man/man4/ure.4 +++ b/share/man/man4/ure.4 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2015-2016 Kevin Lo .\" All rights reserved. @@ -23,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 31, 2016 +.Dd September 3, 2024 .Dt URE 4 .Os .Sh NAME .Nm ure -.Nd "RealTek RTL8152/RTL8153 USB to Ethernet controller driver" +.Nd "RealTek RTL8152/RTL8153/RTL8153B/RTL8156/RTL8156B USB to Ethernet controller driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,15 +54,20 @@ if_ure_load="YES" The .Nm driver provides support for USB Ethernet adapters based on the RealTek -RealTek RTL8152 and RTL8153 USB Ethernet controllers. +RTL8152, RTL8153/RTL8153B, and RTL8156/RTL8156B USB Ethernet controllers, +as well as USB Ethernet PHYs provided by +.Xr rgephy 4 . .Pp -NICs based on the RTL8152 are capable of 10 and 100Mbps speeds. -NICs based on the RTL8153 are capable of 10, 100 and 1000Mbps operation. +NICs based on the RTL8152 are capable of 10 and 100Mbps. +NICs based on the RTL8153 or provided by +.Xr rgephy 4 +are capable of 10, 100, and 1000Mbps. +NICs based on the RTL8156 are capable of 10, 100, 1000, and 2500Mbps operation. .Pp The .Nm driver supports the following media types: -.Bl -tag -width ".Cm 10baseT/UTP" +.Bl -tag -width "10baseT/UTP" .It Cm autoselect Enable auto selection of the media type and options. The user can manually override @@ -86,7 +93,7 @@ or .Cm half-duplex modes. .It Cm 1000baseTX -Set 1000baseTX operation over twisted pair. +Set 1000baseTX (Gigabit Ethernet) operation over twisted pair. The RealTek gigE chips support 1000Mbps in .Cm full-duplex mode only. @@ -94,12 +101,12 @@ mode only. .Pp The .Nm -driver supports the following media options: -.Bl -tag -width ".Cm full-duplex" +driver supports the following media options for 10/100 operation: +.Bl -tag -width "full-duplex" .It Cm full-duplex -Force full duplex operation. +Force full-duplex operation. .It Cm half-duplex -Force half duplex operation. +Force half-duplex operation. .El .Pp For more information on configuring this device, see From nobody Sun Sep 22 13:53:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSJx1hz8z5XQjc; Sun, 22 Sep 2024 13:53: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 4XBSJw68Trz4R5S; Sun, 22 Sep 2024 13:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mGGF+mBO7S2fD8fJ72CcvcPWNxIJUicmykCePcLopBM=; b=hULeuhfLaFcSTg8acQlLHIaTPftwrw31LhYa3Tq+tQ2h7cZcgf2ztYkmqY7YZZaogz6CR0 ZBeQAjV9C0++b2IrKUtR7aFaSa3MmJUERyvL8e3R286cLSolaHIo2RCmwBoP48ZFU6Zctm gB1wPqQxRFb+hYreyV8fKGZjpdkAL/q+Wifysa17moK+uUjW5p78ePDKXaEWYMjXKXCOUN KQ6FbZTrqmFm7Q0Nv8NdWubIJd+puRFu7P24SWnHUMIK2h6/lf+rHXuTp0lCcf0v4BOEe0 FUEig2a1W0/Mhu5Nr+NrnJiW4y8hWIkOzxUCszo8Q3PlJCaPhD0xPZTc54rx6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013232; a=rsa-sha256; cv=none; b=dkhQhwa2boE9SfVdXhXlqQlTi7luxw7PTmZgiPJVYAhlhcNgH/ZI+iIGQz6imJPMv7MTuZ 5OMvXtQFbLZp/cZAC9B/efc0ZI5NbxxPg2+vjLjbCzQtaEsmZ/OEpioCx0OaB1HgOqSFSw aMfJvKYLDQUw4wFyRa1rg/2Np3Zoue08ImEMRO2L4ZO7d60x1c0wLE4cjZYrqF7gypjLD+ fgubnhWIn+J18T6jiojxq2oVZLz2SSjCWSzRz341Hb10Vg4gsajmectWNF+/h1BQ8ES69/ 9zFaAOX9mpIM7R4Gizr6bQ+rBvpJzXst67GYvVD/+zbEwXKxy16BnE1OBCJMFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mGGF+mBO7S2fD8fJ72CcvcPWNxIJUicmykCePcLopBM=; b=oSvlgmiC3lkqRgMrsN+vhNPX80fvFsrHhKey2LTwRJj2/tsN1IALoxszP/uc/EIpxlxW/3 4iknyW9jJBCZjB9L2+C3muEiLAS/lOHZR5yax+/f3n7O3Qw86Am/Smpv9BhHOb4aWqOH4A YH0YK3v45slTioEkzl4NmQLsVHnJH+Lfwp2LXUXtonYLXAt0N4o/Gcw6t62VVCmHTZmCT/ bAUMiXCWnOX6T6TDN5Pf9hMF6Ci54g7buraP4zh+juj7ieTGBHRjxUEBkIMhbDPdZGEoqf UDJ3L6CRtXAByAt8/l0MrzOss0cjiqilDyPgouXn/GfzsLJlUiqqaq2viJ7EGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSJw5Tnnz1JLk; Sun, 22 Sep 2024 13:53: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 48MDrqQX044264; Sun, 22 Sep 2024 13:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrqHG044261; Sun, 22 Sep 2024 13:53:52 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:52 GMT Message-Id: <202409221353.48MDrqHG044261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ef4ee388ff6e - stable/14 - UPDATING: increase visibility of footnotes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ef4ee388ff6e6411d33452968b23b44d83aa7e87 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4ee388ff6e6411d33452968b23b44d83aa7e87 commit ef4ee388ff6e6411d33452968b23b44d83aa7e87 Author: Alexander Ziaee AuthorDate: 2024-08-14 01:33:07 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:36 +0000 UPDATING: increase visibility of footnotes MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1382 (cherry picked from commit fe830c3bdbb80545711d49b5bd6fd4ec28ed9f8e) --- UPDATING | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/UPDATING b/UPDATING index d9804dce33e1..e8ce65692e6b 100644 --- a/UPDATING +++ b/UPDATING @@ -1935,6 +1935,8 @@ COMMON ITEMS: make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE + If you are running kernel modules from ports, see FOOTNOTE [1]. + To test a kernel once --------------------- If you just want to boot a kernel once (because you are not sure @@ -1951,8 +1953,7 @@ COMMON ITEMS: make buildworld make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installkernel KERNCONF=YOUR_KERNEL_HERE - [1] + make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] etcupdate -p [5] make installworld @@ -1970,7 +1971,7 @@ COMMON ITEMS: make buildworld - make buildkernel KERNCONF=YOUR_KERNEL_HERE + make buildkernel KERNCONF=YOUR_KERNEL_HERE [1] make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC @@ -1989,8 +1990,7 @@ COMMON ITEMS: make buildworld [9] make buildkernel KERNCONF=YOUR_KERNEL_HERE [8] - make installkernel KERNCONF=YOUR_KERNEL_HERE - [1] + make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] etcupdate -p [5] make installworld @@ -2010,8 +2010,10 @@ COMMON ITEMS: messages there. If in doubt, please track -stable which has much fewer pitfalls. - [1] If you have third party modules, such as vmware, you should disable - them at this point so they don't crash your system on +FOOTNOTES: + + [1] If you have third party modules, such as drm-kmod or vmware, you + should disable them at this point so they don't crash your system on reboot. Alternatively, you should rebuild all the modules you have in your system and install them as well. If you are running -current, you should seriously consider placing all sources to all the modules for From nobody Sun Sep 22 13:53:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSJy5PQBz5XQbD; Sun, 22 Sep 2024 13:53: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 4XBSJx6rKXz4RFH; Sun, 22 Sep 2024 13:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HugKmll02wwLRmunAfLQNYDWQzC8qo+ArHQ78R351DE=; b=mpJnYu3L+YR4YNEbD5oC5q9kc523Y5AMMoKxgJHvIe+3x8Pb1jebiUWuUJj3o7iv2Vsdh4 3m+jcr/8ZHXmMagmw9sN/5G8ltm6riyheT0tOTxurcU+MOl8F4eTDDQh1C5WJmt625Tu3+ abDrGp6J1JylF/55GEf7bE6YODr+lFeM8ZEp57l9A40aGoM3Or3NjqySE7XStd9pZJGiPD S3tolNSh6zZY2wVM2zQri2NRcTSJsNj89QZnYME2agb90OteJjIjzd17tQwtD0LwEOO2cC NcKUj+u5QmS5hQByUAusp5xiBF+YTi+P9wQnUn7nMFiXxzS6PQcAQWCPnGUt8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013234; a=rsa-sha256; cv=none; b=An1pvhRmb08BO3CSC/13luAC7+fOaspmuVJwkIhkcJWkQIyHh5+3qdaNANTFdDIrZaTXsu Et37nMXtLDunJOlsxFTpZSFMy/Qiqtmvmh6bMuU3BZ5ZuYPxh+rHcaB/t6QMUY+jW3nKd1 9doINK0+ueyGVA0QxzTpIY30yy0NoV3aD9a9mhJJ9swadCR7+IZPSp4iqgRb6kTYWd4Dva VtyeXorVK2S8G2uKZbb7ZW0rI1NIHcN//tykAi5OohYZQploeb05bmGj+VYcnLTVCmvnpO JXjhSSfoe7nrK98/u7jrgxLHDhP/zcVOYT7tnQ/GJ+HwCCWzfjq9Zw+TlviUWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HugKmll02wwLRmunAfLQNYDWQzC8qo+ArHQ78R351DE=; b=pb3z+HPsq3mMegFcOALyMRSZ1prQdrfm7rVbYMZ/zhhM7H1X3z9lK0XlN643F3CPSgBHi9 GZxO0BIoCQufaip45eUfvsxs8TVHiEl5x/S2nsXmNRApa8qcFaLyc1mdoIgS29wmzS2/Qt jybjak7coQIDOXJKg3v8j6zWtA4PlTY86zNhRr/eN7mJacLIoy1GDWnaKRDvFEgnvFbU11 N6cSMtvhwgsWXwei+d2h5ZanYj5Z8XFxLKFNnWCnPhhA4k7+bgZoln2KCFBKbn+csiNE1N NiAr8HKg0XrohMi/jGD0D954Zlfp+6doqrRojDchuAhsykXT0xi2eyiYBx8e2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSJx6Rthz1JLl; Sun, 22 Sep 2024 13:53: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 48MDrr86044318; Sun, 22 Sep 2024 13:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrrrj044315; Sun, 22 Sep 2024 13:53:53 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:53 GMT Message-Id: <202409221353.48MDrrrj044315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0e1363eda10b - stable/14 - ip6addrctl: Update the sample configuration file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e1363eda10be305cf29165bfebec0a1b9c3964e Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0e1363eda10be305cf29165bfebec0a1b9c3964e commit 0e1363eda10be305cf29165bfebec0a1b9c3964e Author: Jose Luis Duran AuthorDate: 2024-08-11 03:06:12 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:36 +0000 ip6addrctl: Update the sample configuration file Update the sample ip6addrctl.conf.sample file to match the default policy, currently based on RFC 6724. MFC after: 3 days Signed-off-by: Jose Luis Duran Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 (cherry picked from commit 6bfbfc8f4fdc6ccd200541ef738a90d1be3c1ab7) --- usr.sbin/ip6addrctl/ip6addrctl.conf.sample | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.conf.sample b/usr.sbin/ip6addrctl/ip6addrctl.conf.sample index edcf77553f14..59c1f3db47e0 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.conf.sample +++ b/usr.sbin/ip6addrctl/ip6addrctl.conf.sample @@ -1,11 +1,15 @@ -# default policy table based on RFC 3484. +# default policy table based on RFC 6724. # usage: ip6addrctl install path_to_this_file # # #Format: #Prefix Precedence Label -::1/128 50 0 -::/0 40 1 -2002::/16 30 2 -::/96 20 3 -::ffff:0:0/96 10 4 +::1/128 50 0 +::/0 40 1 +::ffff:0:0/96 35 4 +2002::/16 30 2 +2001::/32 5 5 +fc00::/7 3 13 +::/96 1 3 +fec0::/10 1 11 +3ffe::/16 1 12 From nobody Sun Sep 22 13:53:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSK04jFJz5XQY9; Sun, 22 Sep 2024 13:53: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 4XBSK02WYtz4RFT; Sun, 22 Sep 2024 13:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AeIjSCxoEOlrQ+g1jYbhM4GT1V/umfT+H6gQsgzdPMY=; b=AS6QlO/QF+3ZsqMHz8JZ7QqW7+iUblJDOOGWGjVVeKdIjN3UkxV5W1TuCO436mJ33G4HOr Gg7rJ8tKOHXAKih1nMYEDvD1L2+3Z9Vi1eImrLID0GRHRmymjt1SaUToiP6KSC72orGXGl gromSJ2EGcos5mukKZlwwMwBpeLzjMJhjBtf10nGn8SPAy6hC1FL+PN27MQUzyb3KJai60 Z6v3fWKfZyR2kQiew9Hj2A/z9zjfP4SP9+9CAGEXbAJZa1nKs67IkahijR4ebYemTpF1HR E6JyrIJiv5HJO3pF/w/GO+PFI+SDKy40AVcZCOJgRE87ca967Unct6TL7w5bGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013236; a=rsa-sha256; cv=none; b=eHv8ZQbxv3/NunYY8M4jYVcSLEpNMcWAj3YkWxgCAZh/SJesgt+sPu8Rf6iwELd+qs7zcV rElHn4xZehLEmuceLMbZUDAaQ7Z1CZXmrPNZBJmMEiS2jGp3wX5D1RYYOCEh4DVIbRiQc8 Xn85GxcqDzLtIJdSfOcgiKOIZw0B+bKOrpT+VQn5bJpwVz5iN1W7bLrDP6gyVB7ZvuT6Ag mTiflKbxFJeeRXplghmY0ufoVxoqfi+CleKWWyOMAszacP4xxyWaQByalmBAkzfhlDybMM aio2/5e/Bw1zFaZB5DDEzgpXAzL5KlA0d3elqktRPkzLmLZ5y+e28DiLQxygtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AeIjSCxoEOlrQ+g1jYbhM4GT1V/umfT+H6gQsgzdPMY=; b=EIP+1JN7kncDSBAOlNssdhqgkTyZxFNzXm2RVyvphnJ+WASIoYFJRY4J+bSwQ1YFS1BOUp oOhAxk0GLLdIVDVWpMRns7lLV1kLdJBLf+mpyCDcCpA6LAJaurhQXGGR3vkwSGOwFcuVW9 rQKERhueDij9LgfucnJlpbIffX5THZKPK1O2s+QBxrEHUpI0MRB/xWDXGhqD0e9nmQHAUM 29kZhL4jaCmM1zIoXDf8xYrg+Hs3x6Q5/c+BEOg/ORq3TuT7gnZZQYejlJNMaOx7awDjAp 7RLodJxQGqgxtlElmL3jdmZXUxE8xEIYL+Jiz1FVR2eNdWeYm+YNMF85Wp3rHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSK01Kpnz1JBl; Sun, 22 Sep 2024 13:53: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 48MDruXi044416; Sun, 22 Sep 2024 13:53:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDru26044409; Sun, 22 Sep 2024 13:53:56 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:56 GMT Message-Id: <202409221353.48MDru26044409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: b6356ec88d03 - stable/14 - adduser.8: update log location + spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b6356ec88d03d28eb33ef155f73ff1ae29319a78 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b6356ec88d03d28eb33ef155f73ff1ae29319a78 commit b6356ec88d03d28eb33ef155f73ff1ae29319a78 Author: Alexander Ziaee AuthorDate: 2024-08-01 12:33:22 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:36 +0000 adduser.8: update log location + spdx Closes: 280538 Fixes: cf8a18 (back out logging to /var/log/adduser) MFC after: 3 days Reported by: Herbert Baerschneider Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1354 (cherry picked from commit 1f882a5834836b43d4689efeefbc3109fc169363) --- usr.sbin/adduser/adduser.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/adduser/adduser.8 b/usr.sbin/adduser/adduser.8 index ed67e21f9430..8ba623fedd9d 100644 --- a/usr.sbin/adduser/adduser.8 +++ b/usr.sbin/adduser/adduser.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1995-1996 Wolfram Schneider . Berlin. .\" All rights reserved. .\" Copyright (c) 2002-2004 Michael Telahun Makonnen @@ -427,7 +430,7 @@ message file for .Nm .It Pa /usr/share/skel skeletal login directory -.It Pa /var/log/adduser +.It Pa /var/log/userlog logfile for .Nm .El From nobody Sun Sep 22 13:53:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSJz4gCwz5XQLt; Sun, 22 Sep 2024 13:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBSJz0hQ3z4R5X; Sun, 22 Sep 2024 13:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWnB3G7KTqcML/5s4XdnUwxyrF8rfXt3kZO1lsF3kEY=; b=hTcDN2RZd0JfjvgwLgq0+DGtmU7DDHX/hQu54Rxg9zPbKm2B3mrgLVoTfPYRZl0DD2RRvx yjZBFQkwOLJOVKidsKBG2rQmRxN071biQw1bgsdIkuhYLkgQh541Uw9vAjYfSVzl0TRg73 TwjjT4UXKE/L9LJFADaYQesOYPIUCmk9Se2QY9RNG0bLCtVK1nPZiZ6EjR6MmIqvGZRJz2 VLrym8xZkzs8No5kuV8MKaTnRuKI7gZxefqaMD2uCBAjubquEfVZSIpdc4Mzpn8omdxTdv mF+qSgl+zT5AM+pyjoXjE38+VJhUoLj3BSE+nHHk3jePqLne9jOlJIHRlfQk2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013235; a=rsa-sha256; cv=none; b=LVAKmDPFjP8qJ+vRsPnxWn+mf5GZPmdYoE89hNL6a9P+o8Aj/z7RtDluuBUcdiZWXmJfcp 0WMUcJRYKms+hc38TWaCqpD+Lrkiv+sWHKEeKBhMA+0oeImiGUHJTN8mePEoLY7EHq0lY9 VyhVgAITpooWJp9K0vrTo5BSpZ3pSi2XyihTt3zP+vfgc3jFsu9UJtr3rTbtKbAYZHRGMJ iqGxiCsCJMFkh0TzG+wrELunu1dWvtul6Rign+xo1ZbuX8JwsvOxkp7DlakcjoBZzbNqfY bPI70ar5/ox+5yDiY2t3YLisbIsWqxlDtDc6mERYJawDxsKQDnbNhP/Co52CfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWnB3G7KTqcML/5s4XdnUwxyrF8rfXt3kZO1lsF3kEY=; b=E6LbP+tSY8LRk8q3dG+JcSW/vemQQVRbXPdfTo4b+Z257nphw7mVQy+pV45RKxwqJMAkAz wiLWNgqmTa62HWnh9ilO1XV7oMUrh9nDjcWqmn5jIPa5cqrO1KEPJ7fnhwPRMFKpOYWLoC RrguX1n+PFBlyu7sFQ16FOJ3l1eTfSoNF+qV2MfbhU8Yti0dop8QP7Vt9l6kGhNe3ESY3N NT6fJzmDu0dKv6XeHGWvtDKyAx5n3PtBAXNhxe0PO+2SPBlzHaRgP2aUNyO76JurrTp0bF mniArMucBx10+c8fCBgeOui2RWFqbeJC9Ty10RNN7qpOrC7obeTfot4eztG8dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSJz0JdHz1JNT; Sun, 22 Sep 2024 13:53: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 48MDrskI044367; Sun, 22 Sep 2024 13:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrsvj044364; Sun, 22 Sep 2024 13:53:54 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:54 GMT Message-Id: <202409221353.48MDrsvj044364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 88dc78cae971 - stable/14 - geom.8: minor cleanup (markup, spdx, gsched) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88dc78cae9714c2352675bf72dade178b883f9ad Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=88dc78cae9714c2352675bf72dade178b883f9ad commit 88dc78cae9714c2352675bf72dade178b883f9ad Author: Alexander Ziaee AuthorDate: 2024-08-12 09:59:21 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:36 +0000 geom.8: minor cleanup (markup, spdx, gsched) Fixes: 86c06f (Remove GEOM_SCHED class and gsched) MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1380 (cherry picked from commit a5770eb54f7d13717098b5c34cc2dd51d2772021) --- sbin/geom/core/geom.8 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sbin/geom/core/geom.8 b/sbin/geom/core/geom.8 index 124ea0f2be11..7f0f0b2911b3 100644 --- a/sbin/geom/core/geom.8 +++ b/sbin/geom/core/geom.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" @@ -27,7 +30,7 @@ .Os .Sh NAME .Nm geom -.Nd "universal control utility for GEOM classes" +.Nd universal control utility for GEOM classes .Sh SYNOPSIS .Nm .Ar class @@ -66,7 +69,7 @@ which can be used for existing .Nm unaware classes. Here is the list of standard commands: -.Bl -tag -width ".Cm status" +.Bl -tag -width indent .It Cm help List all available commands for the given class. .It Cm list @@ -74,7 +77,7 @@ Print detailed information (within the given class) about all geoms (if no additional arguments were specified) or the given geoms. This command is only available if the given class exists in the kernel. Additional options include: -.Bl -tag -width ".Fl a" +.Bl -tag -width "-a" .It Fl a Print information for geoms without providers. .El @@ -84,9 +87,11 @@ Print general information (within the given class) about all geoms This command is only available if the given class exists in the kernel. .Pp Additional options include: -.Bl -tag -width ".Fl s" +.Bl -tag -width "-s" .It Fl a -When used with -g, print status for geoms without providers. +When used with +.Fl g , +print status for geoms without providers. .It Fl g Report statuses for geoms instead of providers. .It Fl s @@ -107,7 +112,7 @@ kernel module. .El .Pp Additional options include: -.Bl -tag -width ".Cm status" +.Bl -tag -width indent .It Fl p Ar provider-name Print detailed information about the geom which provides .Ar provider-name . @@ -170,7 +175,7 @@ VIRSTOR .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev GEOM_LIBRARY_PATH" +.Bl -tag -width "GEOM_LIBRARY_PATH" .It Ev GEOM_LIBRARY_PATH Specifies the path where shared libraries are stored instead of .Pa /lib/geom/ . @@ -213,7 +218,6 @@ geom md unload .Xr gnop 8 , .Xr gpart 8 , .Xr graid3 8 , -.Xr gsched 8 , .Xr gshsec 8 , .Xr gstripe 8 , .Xr gunion 8 , From nobody Sun Sep 22 13:53:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSK24sPwz5XQYK; Sun, 22 Sep 2024 13:53: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 4XBSK23FFmz4RP5; Sun, 22 Sep 2024 13:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5KgpjuzmMpm+3wZDkQ6R3HuCsTwswYnDbqBNqabNXAE=; b=O5ug8g6Tnt/EGbIyvu13YdArRff8Zq9kOIUcV2dOY/7W5C49P7HoM9h89SakdN5CwaxnfH 2SEcsKNUNM5fwtaEHXs5q3CjxngvTQ1XaQ7Y77RxW/mDBSn2P5/48RYJAiGx9recVtuIr5 knTcKyHXNcgzja3QCZ1fWFHJHtcz1AVYhA0zIhFfi/gWsHIy6uBhkOhwyXdolXtUk67Wz1 9vX29riZdfMIVX+LDBrRe4I0LI81Aj/to5AOLcuDb0yhREYIaOWV7A4QAxGVeoxIZLO+m6 7drrGVOaPDIYAdBWnPnZvOb9myRIDruzSfWJLcz8pFqIx2K3250uenpD2fmIyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013238; a=rsa-sha256; cv=none; b=At5yC/WDcA1Q+MeidwpG2Rs0w3zVz1M3d7hhdzdll7+o0sQzGKuMvSBzxzPsxuklnagmE1 OpPi4XOglA970C97IB/xOUvwcML5ZbHW3N3J5hBuWlRNLkk84W27ggJ/FkUbbR4XJfmP7w bUgkkVRMmfNaRtp9D8F0qD4Cp5R/Vo7+4GjMG3TaibVgmPRBJxSCTo3y+c0UTWUnOFUvfy CBluuSJCNvnyPtadkCBL6YSkiP6AuXj2ZbZ1bQtfzRsr30vQBISlBFsI/iODHLoUBnbY2R NUPew7bisIRSq7qBmVrfu/z8DPhzH1gqvvxLKI1Pi0HCPh/I7+OYgaOkrP5vIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5KgpjuzmMpm+3wZDkQ6R3HuCsTwswYnDbqBNqabNXAE=; b=JRU69DZ8nU38q3E0OD7x3Rnc142ijPalmUopV7kZXulU0PRDgZgPtL7Sxeh6CnMY+wkTUp syStpYSJyHyCqAcVOLhlVlBz5otdRF2h9DvkmvPk2rcVldH2POsuDGzEPXdbjlMOw63mFt Q8TSQNHdMFHo4zZesNnN0b3WxDjFrqkSgSjNqJhMPBT5+sFk09h14he48swU+bDTrQ2+sU JE2GLwVd5yK2HrOWzV/aBC5j4avefiw+Cayj7QAkDuOOInJv3RpbpSHCRIIfqArrR11Uz6 HnK6vHEarpgTo5RNnpb04jlYA9LsFLH0n0XzQk1ZF1GwvsrJGV7FOzEKXY4qbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSK22sNWz1JBm; Sun, 22 Sep 2024 13:53: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 48MDrw4F044502; Sun, 22 Sep 2024 13:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrwlJ044499; Sun, 22 Sep 2024 13:53:58 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:58 GMT Message-Id: <202409221353.48MDrwlJ044499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 08a7825f05a8 - stable/14 - dummynet: fix pie List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 08a7825f05a82b2c7b1e68557e288d360e59b813 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=08a7825f05a82b2c7b1e68557e288d360e59b813 commit 08a7825f05a82b2c7b1e68557e288d360e59b813 Author: Franco Fichtner AuthorDate: 2024-07-29 14:38:00 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:37 +0000 dummynet: fix pie Since 26b9e1f07fa codel was fixed but traffic was not flowing for pie too. Apply the same fix. MFC after: 1 week Sponsored by: OPNsense Differential Revision: https://reviews.freebsd.org/D46182 Also see: https://redmine.pfsense.org/issues/13996 Also see: https://forum.opnsense.org/index.php?topic=41827.0 Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1390 (cherry picked from commit 2b7f2890a812eb09dccaa8069483566a3b292338) --- sys/netpfil/ipfw/dn_sched_fq_pie.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c index 632bfd4b7152..06700b0f93af 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_pie.c +++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -744,6 +744,9 @@ pie_enqueue(struct fq_pie_flow *q, struct mbuf* m, struct fq_pie_si *si) } if (t != DROP) { + if (m->m_pkthdr.rcvif != NULL) + m_rcvif_serialize(m); + mq_append(&q->mq, m); fq_update_stats(q, si, len, 0); return 0; From nobody Sun Sep 22 13:53:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSK22R6Wz5XQYD; Sun, 22 Sep 2024 13:53: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 4XBSK12c7Yz4R2t; Sun, 22 Sep 2024 13:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uOwWH++afVu3sz3+oeT9A13ZOSoKnpEFH3Jw4saA08s=; b=giCVFi8S4xpVJlRfdvAj/pdqmtFyCUAz97bxJ1hBBSTUxNMefCZe0QT0dAVoEX2Ky2esRY 69FvSO3sd1IBfJzK2dYhrcuosljQ0dYu0xVe/7mHWxga9HjRyEGwO/lFOPVS1kJZpzudwQ 74Bw59Ag9VwZPT7lVC78OGexNNVKl98eDs/w36St1lWVUwNHSUcQl17xoUaOk/m4DAVfWQ ybxyUBzUibETgfuX7bf308LbUNvQfH2aLJrvy/Bz4mjbED++PHDKZyXm5U4py94WdfvGdt MzQTlsGqr+J3s1SeyfkzghWOvm+zJ1GC6C/DDtfeqWwlPX0poDXt3uKHC3UaFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013237; a=rsa-sha256; cv=none; b=JIiQO8Q8kbWxDaJgVQm479YI88hLvaMmv32tK6MV8icb1kFgUWLAUXs3igrkh4kg16JRzR 3YbUdzs9qyEWR/ad1OaY6R1W3fePSLe7CphU4AFR0yPNMIJwiiN8RyekrIeqhTJzSP+7cc KQelXOmQPwaaQ5dTtCtMT3azEHKUSN9z6Jvan4eCtVd4E8LJpugyQnM6xeYYdbYAION3ER A/DGAE78863r05KAb132LwtJs4mGHsXwgFi2NN4348aOdW8c+aAiZUyl3rs0HcPYjUwhw1 EJnjEkvHwT3bYrqF8uOzBXaMeaUNdUy7P55bN/e77nLdZLYBSqKwb029/tlbWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uOwWH++afVu3sz3+oeT9A13ZOSoKnpEFH3Jw4saA08s=; b=FoiS3UmI8V5DvEukDTBCZExJNQPKAnJHjBHZltsyXpHRRs84lT9VAQ1vZWDybPkkge8CeO B0GQQMf5T9AdEXJ8ntaYbf/mvZ490kS5jkyxe/9ZyuEXkFSJwCNSOtn9/DYtxVGqEVn4tp dBnkrJt8Uv8//29NBi9gRGdHk+31s/8ZgaUvhbd/JVW8DBpRbNuZi13h8QUl4bR8Y/tdTS /N91jLbHsK9u1EZTeeX6bAclROsaOwazal5vCJr6Gk6NWA5B6r0NMLFUmKsNRYz2G2QoBY KQ/zGaHvfPOec+39OsDlCOLT9K364ydypTQs1iXAypQF3NdvTkLkH0bTR/wUNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSK12DCbz1Hv6; Sun, 22 Sep 2024 13:53: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 48MDrvQI044466; Sun, 22 Sep 2024 13:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MDrvi9044463; Sun, 22 Sep 2024 13:53:57 GMT (envelope-from git) Date: Sun, 22 Sep 2024 13:53:57 GMT Message-Id: <202409221353.48MDrvi9044463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 691398348632 - stable/14 - ip6addrctl.8: Reference RFC 6724 instead List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 691398348632d1bbad1b35e40e5319075115ea6c Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=691398348632d1bbad1b35e40e5319075115ea6c commit 691398348632d1bbad1b35e40e5319075115ea6c Author: Jose Luis Duran AuthorDate: 2024-08-10 17:46:23 +0000 Commit: Warner Losh CommitDate: 2024-09-22 13:46:37 +0000 ip6addrctl.8: Reference RFC 6724 instead Commit e695500d3cb945e62b4591cb68792601ed5c4b46 updated the policy table to match RFC 6724, which obsoletes RFC 3484. Add a reference to RFC 6724, and mark it up as a technical report (%R). MFC after: 3 days Signed-off-by: Jose Luis Duran Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 (cherry picked from commit 3272054073720172ebae9c2c5c75e656f72a6df1) --- usr.sbin/ip6addrctl/ip6addrctl.8 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.8 b/usr.sbin/ip6addrctl/ip6addrctl.8 index f50da59aa2bb..cf8f1db4a8bd 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.8 +++ b/usr.sbin/ip6addrctl/ip6addrctl.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 25, 2001 +.Dd August 10, 2024 .Dt IP6ADDRCTL 8 .Os .\" @@ -107,9 +107,12 @@ comments and are ignored. .\" .Sh SEE ALSO .Rs +.%A "Dave Thaler" .%A "Richard Draves" -.%T "Default Address Selection for IPv6" -.%N RFC 3484 +.%A "Arifumi Matsumoto" +.%A "Tim Chown" +.%T "Default Address Selection for Internet Protocol Version 6 (IPv6)" +.%R RFC 6724 .Re .\" .Sh HISTORY From nobody Sun Sep 22 14:03:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBSWz4JLHz5XVFy; Sun, 22 Sep 2024 14: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 4XBSWz171lz4Vlg; Sun, 22 Sep 2024 14:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGuDkawolO+Cj4aIul4HMAWPxPsoyw7KN4WjS8tPO8E=; b=JZ0RCI4Ze88iwRwppj7QMECFoJydC8Veg9yGuhDH6dgs2hvnnXTd1/4CIr6DyzvpU2Ns07 7AAj3z7wxzgMW66nNVS9lNyJmFlntmYwABNcymDDMkCReSfUPFBdVvNMaZeD2/NNrz720e irlzjspp77joxOHRDvuPRUknVl8bqHzT+PL6mxDpkTthGIoxpGPrF7enajpJp5zEjtsNsz CbKJ4DjoE1E1r0NmTC1hAfW/pK1q6wIG0zb5w5Rhb5gobmXDQ2ERSbVRiw4dpeNRFS4Aev ksF7viFDWJPWfupiavWtA7bw0D3//MjiewHF7SLk0doQzLvP8MThTND5n1DUSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727013807; a=rsa-sha256; cv=none; b=u7yF9kBOCE1xKH+ZSD4n10URnn+Q/kXGFr+t2xCSgEktton5KnCNuGxE4VkmRVrm9USUVr Md9p+UQg+DWHSYzfRygKCEVfAjiWcUAkyOVxPR2++REutVcrmqH/KM2auGhxmCGNQlF0Nr P+nnE6vIrmjCak24Qkcb5TkACa1KInOcmzw2TeG3e3aYnazMGnTHkG31GolIpO5m1FkH6T +i/8fkD4o66nu2gonICYwkqBahs6QI1CW3zjUZTRwCkLQiTaI1ZTnr0FHS+LK6KyKrujUv MySB6MiNATLrP5qBtVP+eABYcRwg1yqcgtTsBfChaIwujXnrNi+nPFHHRkMSMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727013807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGuDkawolO+Cj4aIul4HMAWPxPsoyw7KN4WjS8tPO8E=; b=oRyXGthF4VUGRQPNBWF1hwiap29BOLUF73gSY6kFSKCjafMasVtcwirjZZa82eZR0k5AEu SLD3BGH9PlMFyeVOcoWuBCa/EzAj1YRkbaZP3drGLEezN91wQlyU349cb0Y1K3AHUaumNC IgCNa9FFNtsx9XHhr9/GraV5QooKVSLaI5bv6/FpQqLTEjKktBYzpGLttFxlpHCNIHg8pm FxfnM0MCEI4PGSK9x+CmxdchWidZiWQHVY6Q+T49cC0L29YucaMih6cHcECasmNeXFG5IH +gEz0Ijsg/c/GXtirricYG0FMjbeDPP1GBsqyedMNFrg26+vqXWgGAw951xtcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBSWz0kywz1K36; Sun, 22 Sep 2024 14:03: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 48ME3RkE061955; Sun, 22 Sep 2024 14: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 48ME3QIh061952; Sun, 22 Sep 2024 14:03:26 GMT (envelope-from git) Date: Sun, 22 Sep 2024 14:03:26 GMT Message-Id: <202409221403.48ME3QIh061952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 29a6f8fd93c2 - main - vm: Use VM_ALLOC_NOFREE when allocating bogus_page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29a6f8fd93c278f0c7d7b2248068bb0353027e4a Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=29a6f8fd93c278f0c7d7b2248068bb0353027e4a commit 29a6f8fd93c278f0c7d7b2248068bb0353027e4a Author: Bojan Novković AuthorDate: 2024-09-22 13:31:45 +0000 Commit: Bojan Novković CommitDate: 2024-09-22 14:02:53 +0000 vm: Use VM_ALLOC_NOFREE when allocating bogus_page Allocate the 'bogus_page' page using VM_ALLOC_NOFREE since it never gets released. Differential Revision: https://reviews.freebsd.org/D46699 Reviewed by: alc, markj, kib --- sys/vm/vm_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ba32a9eb9e63..40108e8a9b0a 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -194,7 +194,7 @@ vm_page_init(void *dummy) fakepg_zone = uma_zcreate("fakepg", sizeof(struct vm_page), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - bogus_page = vm_page_alloc_noobj(VM_ALLOC_WIRED); + bogus_page = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_NOFREE); } static int pgcache_zone_max_pcpu; From nobody Sun Sep 22 14:49:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBTXg3kwGz5XpGb; Sun, 22 Sep 2024 14:49: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 4XBTXg1s33z4gcj; Sun, 22 Sep 2024 14:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727016547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KJZrO48LAUMZ4l3OiVkj9RBHlb8GIqI9Q17Sq1H7Txc=; b=Y+kNk8kMwyvjKb1CWyOFPrZ5PwgbG2HYWyORe+z/Lw2ar8sRW9r+ic7ntql1xn9XZE0lyt P4SJKbr3ebEvMeEcpjiSwLrsKpOgwLLTb4hNUTNwEIVQc+TYU+4bTU+jdho0mGkgwT44pO qY/bvIcZ+DwjDFZEzHyCFO1A3lW9WAVm+U+MC/epGUWVWybN/bALlxM24gZmEK3wPzeNBp mKyveTrLSvzPsslnKlOyS69rlexK7ZnG6FAv60+MqqKnxq8mk0CE6vn9OjpYROQnLDqxcn sl2azwhDBZJf7DzxKZ6xVWI1Ux4YOyea1GZvZzokmk5sQkIH9BXUu8XKVYHXbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727016547; a=rsa-sha256; cv=none; b=OJra46r/0qS1Purdos/VAjvQWmbQijzCzNse4FxHjyQZmfSHML5KJFhGKHX/rwJ9jelUuZ r8Gd9uCdMTjJxfkzGo3y3H/VDfXE3Bs4eGOt04gMiECxNKs54Fj4MKk4dMHBELnA+tBztF r9bqk6RXii3T4Wg88RXGI0P5wKUn34JS8EavUqftTeIx67+RePmuY8QRDXq1nZ/MaK3wqq CYZYbta/EBDrXPNMjD5Uj8FgYjN7kDrx2eZdQzo3Z6QcbC2SsqUT3FK7nE0TZxJttbzUOp JLZFveA6LLS3A5hEK8bavBIGlSKFcqXSKYh/xX/qjFhtvv44baGG1rWQEokbAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727016547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KJZrO48LAUMZ4l3OiVkj9RBHlb8GIqI9Q17Sq1H7Txc=; b=Ip54iutWDQTQa5Y5VvF+Qof5VdGubi6kjRsrDm4FVm01cL60Jojs6c+YtngFxrMdFHxU/b RVJtchhJkMTkAoJP9+ZkYGCAq/ns+ZrK5DeA9/oIABiq3ZY/i9H2jxwy5r+m41VsAtFIBk HYojagPxBtvSxUNHpitEj2cxOipiJeRllMnueJkV6mC0xGYnEYDlMJ8XGngOIw1l0e1krQ MUPBpO4bSHXrXthXRsZnHGQ+3jlbuEGrmT3OptbRSFC5gUxec4w6evCx8EVkwimWSblwrt AVop/xk+TBWXfShINeXiNIu0ir2jc2gUOtErcoRFtLT4+k2rG0sAvJW/drIZ2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBTXg1Shbz1L2K; Sun, 22 Sep 2024 14:49: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 48MEn7Qp029824; Sun, 22 Sep 2024 14:49:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MEn7Us029821; Sun, 22 Sep 2024 14:49:07 GMT (envelope-from git) Date: Sun, 22 Sep 2024 14:49:07 GMT Message-Id: <202409221449.48MEn7Us029821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1d94490aee5c - stable/14 - kernel: Fix defining of .init_array and .fini_array sections List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d94490aee5c8353ed08909bbd00af7cfb48a8dc Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d94490aee5c8353ed08909bbd00af7cfb48a8dc commit 1d94490aee5c8353ed08909bbd00af7cfb48a8dc Author: Zhenlei Huang AuthorDate: 2024-09-02 04:26:47 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 14:45:36 +0000 kernel: Fix defining of .init_array and .fini_array sections These input sections can have decimal numbers as the priority suffix. Clang emits the '%u' form, while SORT is an alias for SORT_BY_NAME, hence will result in wrong order of constructors / destructors in output sections. Fix by using the correct sorting command SORT_BY_INIT_PRIORITY instead [1]. The functions referenced by section .fini_array is in the normal order, but been executed in the reverse order. The order is same with .init_array section. Currently these sections are not used, there should be no functional change. Note: As for the .ctors and .dtors sections, both Clang and GCC emit the priority suffix in the form of '%05u', so there is no semantic difference between SORT_BY_NAME and SORT_BY_INIT_PRIORITY for those sections [2]. This fix is extracted from a bigger patch [3] of hselasky, with additional fix for .fini_array section. 1. https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html 2. https://reviews.llvm.org/D91187 3. https://reviews.freebsd.org/D40467 Reviewed by: imp (previous version) Obtained from: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45194 (cherry picked from commit e15b5ba77d693609c9a452d1b0a1cdd5eb29350d) --- sys/conf/ldscript.amd64 | 4 ++-- sys/conf/ldscript.i386 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/conf/ldscript.amd64 b/sys/conf/ldscript.amd64 index 9c6e603a5753..72dc573f113e 100644 --- a/sys/conf/ldscript.amd64 +++ b/sys/conf/ldscript.amd64 @@ -93,15 +93,15 @@ SECTIONS .init_array : { PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) KEEP (*(.init_array)) PROVIDE_HIDDEN (__init_array_end = .); } .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) PROVIDE_HIDDEN (__fini_array_end = .); } _start_ctors = .; diff --git a/sys/conf/ldscript.i386 b/sys/conf/ldscript.i386 index 6563ed2cd623..c46a9910eb3b 100644 --- a/sys/conf/ldscript.i386 +++ b/sys/conf/ldscript.i386 @@ -87,15 +87,15 @@ SECTIONS .init_array : { PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) KEEP (*(.init_array)) PROVIDE_HIDDEN (__init_array_end = .); } .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) KEEP (*(.fini_array)) - KEEP (*(SORT(.fini_array.*))) PROVIDE_HIDDEN (__fini_array_end = .); } _start_ctors = .; From nobody Sun Sep 22 14:49:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBTXh6Czbz5Xp3g; Sun, 22 Sep 2024 14:49: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 4XBTXh31Qdz4gck; Sun, 22 Sep 2024 14:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727016548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MuyhF6uT8uXQx7wj9OPD+o8hVsbLopJejxRWKrW01fw=; b=h9GOhEpW8AQzDjkRoUqqw6HYg0rVDPDAyIDQqYX6onoh++1hfwa6twZGg5nPh7pkLDnF/i HErDtd7Z/K2En84NRIe4q+y3dG82J0LjVt+5j0Ha9BDUkYsbqTPyjFQyHzA6JmRyZat6sN Pnvkc4g1w4f8kUfgoImwjn+HBOL8mGskA0lC2e7lFdqiV+loMG6gCAIWD0KM+5cEmmSjew lkKsakiVf5unlLeKhGAIsZEuGdtWzG2hiEqf0V4xpKqXD2hEG01QwBDRRFoaLIyQ+pBIlG kafhPEtpXL/c6OcopL73IQUJtlpYzw6n1QaKeMPt7Pes4+TeaC2Ot7vnrctRhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727016548; a=rsa-sha256; cv=none; b=wJ9ex4KWaTt8EetQFlMNSjDa6zlbiGI+oCqYhIlHyWy3IBmwb1WQRmzTMw2Tf1e2RyAiYW vUz4m9cLUjGivJX3GB92+aO70FCzxpgQjKj5Z0GHeX2wdCxfXLchoyiIXZ8xitRFMnrAxy 1Z0IgfaYgUD4XKU7CW7vk6YCKo7UiRmi4ClS/bFxRFy/OKr5zVtxB4IQhnVs0Iqo9k+ug4 FfdaR8TpATIHAPMWDn46TlWbZj7VeOiyiuxRdIkdEs2uGmKPKsv5tHW5ExYXd4XBEYYTsR Hs395p/hvAj1UriFsTG0iOiPAJYp28jH7OqLyT7MKOG4BEySPlG3tAKoYM0dhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727016548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MuyhF6uT8uXQx7wj9OPD+o8hVsbLopJejxRWKrW01fw=; b=ZS0GKERzmVy+ATMuPsty30yTF2EmCxl+sY6P+9R0cUbLN/RglEgEILEgCdorCOJAidoL3s AX2yKRw6VyH/ra/ZZIRIkImKyaPTUEB5I3n2OZtqDT2r3xzZRYXSnEQ0YhVXJXIz/KWVg0 hTtdcdTfveCcybZnB6IY2mo6UBvWHmwEgqwWIwfa5zAgfaVhc4LREF79YHvayNSM3hnVhp rvgjJLig7cHKxRdOTgPc45oAN7AF8EfEXgXzo4phcYWJY+xUW9AzSXY2t7Xb2D5k3gpzGv Slbvxj6tQ+z0zZIwwCbMb6PUkLKJgQZX1DOgKJIOzcwcjpJ3vuoVPinAF083Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBTXh2XCZz1L2L; Sun, 22 Sep 2024 14:49: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 48MEn87J029885; Sun, 22 Sep 2024 14:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MEn88v029882; Sun, 22 Sep 2024 14:49:08 GMT (envelope-from git) Date: Sun, 22 Sep 2024 14:49:08 GMT Message-Id: <202409221449.48MEn88v029882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: bb5f70161454 - stable/14 - kernel: Add defination of .init_array and .fini_array for all other platforms List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb5f701614546c2e2cc682e23f49f7606cea3138 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bb5f701614546c2e2cc682e23f49f7606cea3138 commit bb5f701614546c2e2cc682e23f49f7606cea3138 Author: Zhenlei Huang AuthorDate: 2024-09-02 04:26:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 14:45:36 +0000 kernel: Add defination of .init_array and .fini_array for all other platforms Currently these sections are not used but defined only for amd64 and i386. Added them for all other platforms to keep all platforms in sync. There should be no functional change. This change is extracted from a bigger patch [1] of hselasky, with additional fix for the order of .fini_array section. 1. https://reviews.freebsd.org/D40467 Obtained from: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45214 (cherry picked from commit 3e76d05231b0aa77d922bdbc9abf62d9747a91ab) --- sys/conf/ldscript.arm | 14 ++++++++++++++ sys/conf/ldscript.arm64 | 14 ++++++++++++++ sys/conf/ldscript.powerpc | 16 ++++++++++++++-- sys/conf/ldscript.powerpc64 | 15 ++++++++++++++- sys/conf/ldscript.powerpc64le | 15 ++++++++++++++- sys/conf/ldscript.powerpcspe | 16 ++++++++++++++-- sys/conf/ldscript.riscv | 14 ++++++++++++++ 7 files changed, 98 insertions(+), 6 deletions(-) diff --git a/sys/conf/ldscript.arm b/sys/conf/ldscript.arm index a9c39977a6fc..f42af5bc4a4c 100644 --- a/sys/conf/ldscript.arm +++ b/sys/conf/ldscript.arm @@ -83,6 +83,20 @@ SECTIONS } .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index 21c7dc35d9b7..8a4aeebb6622 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -98,6 +98,20 @@ SECTIONS . = ALIGN(128); .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : diff --git a/sys/conf/ldscript.powerpc b/sys/conf/ldscript.powerpc index 2bfc02768a22..bb72d25e6af7 100644 --- a/sys/conf/ldscript.powerpc +++ b/sys/conf/ldscript.powerpc @@ -79,8 +79,20 @@ SECTIONS . = ALIGN(4096); .got : { *(.got) } .got.plt : { *(.got.plt) } - - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64 index f436a3bc0f64..d4daa4d07c14 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -105,7 +105,20 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.powerpc64le b/sys/conf/ldscript.powerpc64le index bd883853711a..a87ae9f139fd 100644 --- a/sys/conf/ldscript.powerpc64le +++ b/sys/conf/ldscript.powerpc64le @@ -104,7 +104,20 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :text :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.powerpcspe b/sys/conf/ldscript.powerpcspe index 38209f6516c8..82ac2ad1b811 100644 --- a/sys/conf/ldscript.powerpcspe +++ b/sys/conf/ldscript.powerpcspe @@ -80,8 +80,20 @@ SECTIONS . = ALIGN(4096); .got : { *(.got) } .got.plt : { *(.got.plt) } - - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. diff --git a/sys/conf/ldscript.riscv b/sys/conf/ldscript.riscv index 9a2764a23789..ad6f2676c504 100644 --- a/sys/conf/ldscript.riscv +++ b/sys/conf/ldscript.riscv @@ -71,6 +71,20 @@ SECTIONS } .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : From nobody Sun Sep 22 15:17:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBV9X51DMz5WXBM; Sun, 22 Sep 2024 15:17:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 4XBV9X2bs3z4nq4; Sun, 22 Sep 2024 15:17:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-7a99fdf2e1aso463719885a.2; Sun, 22 Sep 2024 08:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727018255; x=1727623055; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=0JPZqxu4KYXq1lt0fsuOq7ZgD3cifygesoOnL/RxVhk=; b=Oe9PfKcEBpVwRq8PvivWBVpI+moYZnzo6SFERuTFOE6tRudiWuKVQ+r79NwVATNo2A tu/uMUL9uZmtaPEK2waCA/QGYvJczRgKW7+n/YNFM8SD7bbUHJf+HH3oypfjTUn6n3TP w4f9+ssz6UZjWx34TJOzsh3Mmg86A27sRx5L/Rh/3CW8fxdgVz95CoPF+PXhvO8rsRzZ 1/jBHkgXteqA5WMqBEDXVM82G2amnJFfEFkJ8bYpA0In41JWkI/RNDryYdAXJ+9KCmlJ 4vDB+01TM/qk2SIHrwmc6xjbKDTfGDWCad+ZxE8oCEX/XVzfBuzod2RNhAk/Nf+N89jQ uY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727018255; x=1727623055; h=in-reply-to:content-transfer-encoding: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=0JPZqxu4KYXq1lt0fsuOq7ZgD3cifygesoOnL/RxVhk=; b=QIMl4tL/rkSsn8ui6MxAoMojo8JNhyCUEl/fHWO/ijVOGiBbT4kAZCcMkxXyChKnbN czXwm2E7dOIyT8MkYmYYMjS0t2mzq7fS4ajl+Xi0Vw4DVIP5695YIdBHfuNjXwpvMXze KjjBiPerlFtBIgqKG3dgdpub9ykg+JTKuLjFJmPhvGv2Gg68Wqj+wJYnyeP2PN4BF/wQ Q2wWZL8gi/vpImTnRja0rl8V95eyY808ZJq8ONXhKBan6NSUhCR1ivU8l99ihibCvYzo rUJBEUFF1td3RWb51DC53xqKVWdZEzk8RtRw1mwDlL/OFR1ds8FmHWNCLko/1JJxENnC sDBA== X-Forwarded-Encrypted: i=1; AJvYcCU1QtIDyWaV3xAk8GU8VVnzhM4daJXNTeAltBERTVGQgnje+4kRMR/txOA/GFZXHiGT7Vtg/FoQuICIJEK46p4=@freebsd.org, AJvYcCXlEyPESI1M0Q3MdrLE29+u9/0wbQFuI65laFdlDkdyj8g0MMKs0A27y2m75Hs/AEnLuyctOVstwFkzdZYrqgHco5H03fk=@freebsd.org, AJvYcCXpCgOdZ/QSL7DrCGKNAplewSoP6rJxfk8kgQL/ZbpC9Bf9WSJ9r+FviyfV0nQqD1IkScCOqYbY0LWSX0KwQCK3x21j@freebsd.org X-Gm-Message-State: AOJu0YxTBL+lN3Enw0HneO1W3x2Se3E+sTXBE/W/8wkN39zb8dyqUZJf cZkp8wfkvBHi+s+fErRAcUMc/6Ac7XCYft2kC3twqkFTi95K1zvRZzOHBqeg X-Google-Smtp-Source: AGHT+IFgmMwQG5uXrHE5t0g7NVNRUZXNGlv/OLJLx249e38lw6cF5MRJ6B9LXt5AxXTB6zG4nXmrJw== X-Received: by 2002:a05:620a:2443:b0:7ac:b2d6:9ccf with SMTP id af79cd13be357-7acb82159bfmr1616514685a.61.1727018255351; Sun, 22 Sep 2024 08:17:35 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7acb080729fsm388300485a.42.2024.09.22.08.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 08:17:34 -0700 (PDT) Date: Sun, 22 Sep 2024 11:17:30 -0400 From: Mark Johnston To: Warner Losh Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output Message-ID: References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: 4XBV9X2bs3z4nq4 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sun, Sep 22, 2024 at 02:19:54PM +0100, Warner Losh wrote: > On Sun, Sep 22, 2024 at 11:29 AM Mark Johnston wrote: > > > On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote: > > > The branch main has been updated by imp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=94567c8641e235763b5b2926416d89d36654cde1 > > > > > > commit 94567c8641e235763b5b2926416d89d36654cde1 > > > Author: Bram > > > AuthorDate: 2024-07-23 08:57:42 +0000 > > > Commit: Warner Losh > > > CommitDate: 2024-09-20 15:06:26 +0000 > > > > > > netstat: Resolve duplicate "dropped-packets" key from libxo output > > > > > > The current libxo output uses the "dropped-packets" key for both > > incoming and > > > outgoing packets. This commit distinguishes between the two by > > adding an "in" > > > and "out" suffix. The original "dropped-packets" key is kept for > > backwards > > > compatibility for now. > > > > > > PR: 244589 > > > Reviewed by: imp, zlei > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 > > > --- > > > usr.bin/netstat/if.c | 10 ++++++++-- > > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c > > > index 172ea5324ccb..f0af785bce04 100644 > > > --- a/usr.bin/netstat/if.c > > > +++ b/usr.bin/netstat/if.c > > > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) > > > IFA_STAT(ipackets), link|network, 1); > > > show_stat("lu", nerr_len, "received-errors", > > IFA_STAT(ierrors), > > > link, 1); > > > + /* Below is kept for backwards compatibility. Will be > > removed in the future. */ > > > show_stat("lu", nerr_len, "dropped-packets", > > IFA_STAT(iqdrops), > > > link, 1); > > > + show_stat("lu", nerr_len, "dropped-packets-in", > > IFA_STAT(iqdrops), > > > + link, 1); > > > > This breaks plain netstat output, causing a bunch of network tests to > > fail. For instance, "netstat -Wf link -I re0" now prints an extra > > column. > > > > I think we should not bother with backwards compat unless libxo is > > emitting structured output. This can be implemented using the "e" > > format modifier described in the xo_format modified, but I'm not sure > > how to plumb it through show_stat(). > > > > Let's revert until this is fixed? > > > > Works for me. I hadn't noticed before the push. Thanks for bringing it up. Thanks, the tests seem to be fixed now. From nobody Sun Sep 22 15:24:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBVKN0CDdz5WbDV; Sun, 22 Sep 2024 15:24: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 4XBVKM5rcXz4qMT; Sun, 22 Sep 2024 15:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727018663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbO9+hf0urBri8qArdsfL1xw7i6VIY27A8jWlBizmys=; b=XIcdCWQd9fmdzvMFdLTMhwTxUb6xM0FcC0OfdE6S1cCA+CMBITWhTvZcLUMVjYig5Ruys7 UVpWxqFOcr8B6vI5MPM3+AbjSBY021s7E3CoA5yehyZuyyy7NmjZoTSjIHAR3Yy3KmrUJl yecUbF66CaiXrBnfYYrPiDRsoh/jdCHApb5VPlw9TioditPnuaKWBwLdI/+y/ruw2Hvwym rYa9wqIV+IM1si4jD4s7OvkqP9O7WsMJNg7WGK6HeDyz0NIgEX5vlbBz/zI3pVwF9rTYLe vCG1h/raERz6lqktnbVkUNWaYzWUyzmpJRKgaDg2Yqmjj1uUFBP+D+DJsM4NZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727018663; a=rsa-sha256; cv=none; b=XmY69LOOFvSyKGgP2AwjNQkcW/bBPO6DgVtHhLK7dcybAopDa2Y8iQyhxkmUe8hCJ5kmRN 6aBQRqoG4r8gTbit0T533iQGUFKMnMo99BTDaminjRGP0jIUoRifgLFaMlhcOh584mxIdI m5e5xFJCAnfWWzZUYivpcShYngoPVQfCurRz+fzUfkSoH6BJIVr1pn3P46kEjhEI0ZAqCt +FqnLHkKTPKNuvsNOMBDT4Wl6XebKzoRUZbY0mG8cT1BNRxxA5A+RbIiiXOTxWDEvWQmhL ASeuiMxkejFBbwWwgtDnAWfIzyMhgi/Vay0yApNXiLzD3+sYr3FR0qArJA62ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727018663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbO9+hf0urBri8qArdsfL1xw7i6VIY27A8jWlBizmys=; b=KVZkBFWO0bYU7YazcloOtguEXCRSYsOTRoKnGMcZq/3vlwQU+fTb3I/JD1OaMWnqNjsj/p WPVudHdI1bKOAuk6H8zDe/+L3BIHNL8+2U8eANusvkMVLkVXdKJvCYzhRk1uJYRCt2MVtA wnLqTPu+IIRPnT32yKhYooy/AtSc2b11hvqpim9UJlaTUJa7rhNsySe/UKP0hDPXwVVrdZ nuRJxGGW+xfVHklE/035H+Ro0VeLjIK3TO23YBfCILn+VLlmKloQ/10r1K1OBkiru6RQ4Y B6G6e8Cc066dqtDyR1JxhoqqlKdAkOSMnhhjFzy6hAaQSodTRBTcGRIsZN0G8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBVKM5SL4z1Ln2; Sun, 22 Sep 2024 15:24: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 48MFONVd097553; Sun, 22 Sep 2024 15:24:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MFON21097550; Sun, 22 Sep 2024 15:24:23 GMT (envelope-from git) Date: Sun, 22 Sep 2024 15:24:23 GMT Message-Id: <202409221524.48MFON21097550@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: f8afe99cc8b2 - main - efibootmgr: minor cleanup (spdx, typos, see also) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8afe99cc8b2f635f87319e6cedad14f64f5ed1f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8afe99cc8b2f635f87319e6cedad14f64f5ed1f commit f8afe99cc8b2f635f87319e6cedad14f64f5ed1f Author: Alexander Ziaee AuthorDate: 2024-09-22 05:49:01 +0000 Commit: Warner Losh CommitDate: 2024-09-22 15:21:39 +0000 efibootmgr: minor cleanup (spdx, typos, see also) This page was getting pulled into `apropos unix` results due to arguments being on the same line as a name macro in synopsis. While here, tag spdx, fold a line slightly better, add loader.efi(8) to see also and fix it's order. MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1430 --- usr.sbin/efibootmgr/efibootmgr.8 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.8 b/usr.sbin/efibootmgr/efibootmgr.8 index f74ee8a2e634..60e2447931f1 100644 --- a/usr.sbin/efibootmgr/efibootmgr.8 +++ b/usr.sbin/efibootmgr/efibootmgr.8 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2017-2018 Netflix, Inc. .\" @@ -22,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 17, 2023 +.Dd September 22, 2024 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -67,7 +69,8 @@ .Fl t Ar timeout .Nm .Fl T -.Nm Fl u Ar unix-path +.Nm +.Fl u Ar unix-path .Sh "DESCRIPTION" The .Nm @@ -80,8 +83,8 @@ boot method to be tried once upon the next boot. .Pp The UEFI standard defines how hosts may control what is used to bootstrap the system. -Each method is encapsulated within a persistent UEFI variable, stored -by the UEFI BIOS of the form +Each method is encapsulated within a persistent UEFI variable, +stored by the UEFI BIOS of the form .Cm Boot Ns Em XXXX (where XXXX are uppercase hexadecimal digits). These variables are numbered, each describing where to load the bootstrap @@ -275,10 +278,11 @@ for the next reboot use: .Pp .Dl efibootmgr -o 0009,0003,... .Sh SEE ALSO -.Xr efirt 9 , .Xr efivar 8 , .Xr gpart 8 , -.Xr uefi 8 +.Xr loader.efi 8 , +.Xr uefi 8 , +.Xr efirt 9 , .Sh STANDARDS The Unified Extensible Firmware Interface Specification is available from From nobody Sun Sep 22 15:31:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBVV575H5z5Wf5p; Sun, 22 Sep 2024 15:31: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 4XBVV55W7Qz4ryT; Sun, 22 Sep 2024 15:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727019117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xV4Zrx1Bp1pHnOkg6bVBeXLmXF+5SDPZnBaoDmzLZ34=; b=X7KOwoEmaWzojgoLRKlO0rs7jpD8kOWWpSNXch+zlADX9tTmwW6vRnkTiZ04c2HdH66CpJ pTKiE4WGqoMqUz0D1z+gcctprRM9h4J5emaDk4FbnkVt+yvts+Z0Ry3FvvBcZlNw/Hf/dG sAw5BB1GQpWHadzEW0qlHqeIGA0ZQP69s4WTPZRvF/vxrLAEI30hd8DU/FBKCU6YZSORZU LW1WQLgypDFQF3PwFNPAR7F3S26GhpZlw97PbmPv7AzhP6Zmnxh+T8Fg9hHQjWp/2YUnJ1 YHeUkK8lksJq6igKEA9hURWUiKj5SDcZCaTTZ9PEgaLh809OkAC2VBrETMq6jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727019117; a=rsa-sha256; cv=none; b=RM3XGjjzWpMI2nYQ+09TVai8O8cWsYTUrY0/N1TvtMRIcedPcn9urxmkXZOAKLkyswttAZ qfn0F11CSayP+bSTKTsq0fS28LgBUteG9PMymjp+SHSo9pnCIILUnwtFp7uguQxFad1UO0 Xul8i+Tzy9FCyCaDefF85YE6V+yUxU/93qNTTXkkU+EtDDrBQdAZTWo6imOwy2k4lYjvwU BOLPD3GNHq5Fw5Bh7orlbUMLTfoRgdlOqFjFbM05MhsuelxNm4CY0dDBN4C8JLM1vV8/GD uaCXWXSNlb5y+rbzpW7d4curI4gTbyd0WXZ/XFNjZ+RQkbw5MbiAEadYVVQH8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727019117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xV4Zrx1Bp1pHnOkg6bVBeXLmXF+5SDPZnBaoDmzLZ34=; b=OWPKGBHRRgL8x7J2tJ8YSIV5jvBra3Jo/y9F8g13qM0ER5pIgmHtAUwMxdXNWfIV+SuX5v XEas1xhi7ncFwL8+VM0Ju/EMMEi+rG3C3MgR1fcy1kG5Oahpoa2f0nm1QNcFja0QcV9PPT IC+nfYcIX96cIB4FvGh6brRNWzCnOgCqQpj1tLkI/itL1f0njaUfiY3f5MUJ0FsRlo4ggF uCbm0zEAMHeYEY832xyp58ORKuM+kfBoipMynPbFtOXbqAfJIKCWiZb7h7el4eOf/ghAyX e6hQoAAhBa10GttcLKnV27vmfvxh9uQZ2IQlpor4CfD7OFUc6NLt6qLzavxuvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBVV556ZMz1M71; Sun, 22 Sep 2024 15:31: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 48MFVvnB013816; Sun, 22 Sep 2024 15:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MFVvpJ013813; Sun, 22 Sep 2024 15:31:57 GMT (envelope-from git) Date: Sun, 22 Sep 2024 15:31:57 GMT Message-Id: <202409221531.48MFVvpJ013813@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: bbf71b315967 - main - sound: Fix SEQ_SYSEX() macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbf71b31596719c61d540513da3d8a3db20dad66 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bbf71b31596719c61d540513da3d8a3db20dad66 commit bbf71b31596719c61d540513da3d8a3db20dad66 Author: Rozhuk Ivan AuthorDate: 2024-08-09 18:52:17 +0000 Commit: Warner Losh CommitDate: 2024-09-22 15:27:29 +0000 sound: Fix SEQ_SYSEX() macro Correct implementation also found in Linux's soundcard.h: https://github.com/torvalds/linux/blob/master/include/uapi/linux/soundcard.h#L1178 seq_processevent() interprets event[1] as device number and does not work properly with current SEQ_SYSEX() implementation. Note: soundcard.h has its own funky style, which this commit follows Reviewed by: imp, christos Pull Request: https://github.com/freebsd/freebsd-src/pull/1374 --- sys/sys/soundcard.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index b5434b930215..304ae38c08d4 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -1400,8 +1400,9 @@ void seqbuf_dump(void); /* This function must be provided by programs */ int i, l=(len); if (l>6)l=6;\ _SEQ_NEEDBUF(8);\ _seqbuf[_seqbufptr] = EV_SYSEX;\ - for(i=0;i To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3503aa0cdcb0 - main - mlx5en: Handle install SA for ipv6 encapsulated case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3503aa0cdcb01f141fbc1b60746e840e06ac4987 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3503aa0cdcb01f141fbc1b60746e840e06ac4987 commit 3503aa0cdcb01f141fbc1b60746e840e06ac4987 Author: Ariel Ehrenberg AuthorDate: 2024-09-10 12:26:15 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-22 16:06:02 +0000 mlx5en: Handle install SA for ipv6 encapsulated case Pass the right encap flag to network card Sponsored by: NVidia networking MFC after: 1 week --- sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c index e348ab1992a5..9523dc8d5e95 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c @@ -388,14 +388,19 @@ setup_pkt_transport_reformat(struct mlx5_accel_esp_xfrm_attrs *attrs, __be32 spi; void *hdr; - if (attrs->family == AF_INET) + if (attrs->family == AF_INET) { if (attrs->encap) reformat_params->type = MLX5_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_UDPV4; else reformat_params->type = MLX5_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV4; - else - reformat_params->type = - MLX5_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV6; + } else { + if (attrs->encap) + reformat_params->type = + MLX5_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_UDPV6; + else + reformat_params->type = + MLX5_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV6; + } if (attrs->encap) bfflen += sizeof(*udphdr); From nobody Sun Sep 22 16:25:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBWgV4JKqz5XGwB; Sun, 22 Sep 2024 16:25: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 4XBWgV13Tkz44lP; Sun, 22 Sep 2024 16:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727022310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mA2KbHV/cecEfsXWEQj0zNGcvS6ME9TBTzmHXdJWWRQ=; b=wgi7100hEO0wOX7uUmrijoJoNovgXwhgWOb/5BJyRJm+fDv0VUJ06itwYOZZu6Jn8SpV7m u8DL0NtLWtaEyDrZm7iUBxat8/J1zgUwwILppDBVsFYbNusBFD06zFvykYrAmNFM9w486R oHqf1NAFeMhAtdnkva6QcyVXNI3SiFEsvWPlj3mxl9OG66V4zuiNfaoZfmEC/KFpnjzdE0 gtdP515FmrsOjGLMNHffTImlr12PiqtPXUYjR46PihU5cAIDx56dwm9RTQM0v9orr7SKo6 6w7kARoT9UfTv19RTmTtpmTHbXGsZwrBXfwn0Oc8bx3Lo7etLR8/ASll91ysmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727022310; a=rsa-sha256; cv=none; b=QDgjTFaYsfeDiV3iXAZKQcmAhlOxzDpvqY0wBxm+C9p4z7BmltsY+7jQL+i/0qwV2vyFiD K9cjjtss2sPMRTQax2xXQa0VbGsLYnC1xPQpgVMbI3C1Dyxdpjts/XQHd5ucVzC8P+Pvd8 XGx2qahjAq2yOsOZJpqtbOJMgTK+POzb9wNgtcGhQDV/KSYXGApgPwgyS/MXJdIThTJtSq +/GQPVqIDwLLg+NK5Hd45B2k6LM1aQ97OImrwDpqcZ+aDM7rx9DtPHhdaNx2volpksNX9N WiBUC4Q2pnzBu3boCdeOufZCZ6cM+LzCw5crofPXBnzoK5mfuWRmTwL/fa0JeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727022310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mA2KbHV/cecEfsXWEQj0zNGcvS6ME9TBTzmHXdJWWRQ=; b=KyQ7EKyXpG+J1EDpQ9JctzMNtDAZA1XL57SI9OReGNKjMdzMoZV+daLyT3/WPSULMvO8mF g4P6uRYSgW/YSl004VNCDoE1rMqf1jTakezHzVEffHNmL6JKwXj7Nh3hTizIdHKXgEvrD6 9B2GPe5s5ycUa2gGgM2Vxqvpd0EAJfkPlDzNKvlJdaNfLHXP5aT9MEu9tHEapSAfcL5WS7 MHPVKhpZ+R4iKKoqDo/r1SWf+z8e42s/yIjoYwhr7KjQOJo8gNkHQ64h42EQuA0cNySB24 bf5DBNvnLUuW9aEia2VPzuxmHfb8qwlaNSB9/gkOgsXlOTEsEf3Q5Tc1OhgWlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBWgV0Ywvz1NPM; Sun, 22 Sep 2024 16:25: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 48MGP9Xg000264; Sun, 22 Sep 2024 16:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MGP9eY000261; Sun, 22 Sep 2024 16:25:09 GMT (envelope-from git) Date: Sun, 22 Sep 2024 16:25:09 GMT Message-Id: <202409221625.48MGP9eY000261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 8fee873d78eb - stable/14 - tcp: keep syncache flags when updating ECN info List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8fee873d78eb8d04ffbc079d0ee01549f5c0d556 Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=8fee873d78eb8d04ffbc079d0ee01549f5c0d556 commit 8fee873d78eb8d04ffbc079d0ee01549f5c0d556 Author: Richard Scheffenegger AuthorDate: 2024-09-18 09:18:00 +0000 Commit: Richard Scheffenegger CommitDate: 2024-09-22 16:24:36 +0000 tcp: keep syncache flags when updating ECN info While processing the ECN flags of an incoming packet, incorrectly cleared all other syncache flags. Reported by: tuexen Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46694 (cherry picked from commit 0a05ea1f56e65ec0477d56daf5ed623087464082) --- 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 e24249048fd6..6e71d14196f5 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1536,7 +1536,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ if (sc->sc_flags & SCF_ECN_MASK) { sc->sc_flags &= ~SCF_ECN_MASK; - sc->sc_flags = tcp_ecn_syncache_add(tcp_get_flags(th), iptos); + sc->sc_flags |= tcp_ecn_syncache_add(tcp_get_flags(th), iptos); } #ifdef MAC /* From nobody Sun Sep 22 16:29:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBWmT3jv3z5XJZ0 for ; Sun, 22 Sep 2024 16:29:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 4XBWmS6xjPz45Sl for ; Sun, 22 Sep 2024 16:29:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-7d4f8a1626cso3086220a12.3 for ; Sun, 22 Sep 2024 09:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727022567; x=1727627367; 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=IHjE1vrIYYv0O8TOk3GvaGKogWE2AxGbgfQ1A3zTros=; b=p0GAkxEnWEI2FJlgxiVnR4I4Aon+G24aMqnG5RHHZfQI09VVZv7nPh1UhBO5IPAsKF w5n7IJTX606bF62JbW0dWX7q/xBGtDpWXWGE+5O2uyw1bK/kCzq9BBUd9F5xuRN+ycNP mflTPSl+fFaL9wXWXIJ6mcW3qQFJNLAvyRO+JeBb9+SR12UTrdksSChPnx8qN+vs04ui 9ZeWFM3j98yUjGhKUvQNMRrvzi3ETdbC1qdjojPQQFE0ajk5jutqGYE52a0LJnp2+b6w Zb2WRR/PpzFnZQZBXMdsGPb9aJErgWLpW1YBfy50ZssJNVlaiPtzBzgW0nZ0jyAHKgFT UXSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727022567; x=1727627367; 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=IHjE1vrIYYv0O8TOk3GvaGKogWE2AxGbgfQ1A3zTros=; b=m2sT8k726R+lcs24oF7puGPBSmQnJaXNInxy7T2QzQZIW7kj/cRzu/yrkLl2JMaDTl ppsEKE/QWa6kDcn/AS5NC/YcW3fax/Mlraw4R8iXvww/dkfFN3XrTlNadMGV1BhpRoMV 1S79LKMbpSYOAW+93uUfysKv31eWb2OKi1OCgCBW3BiZPqjzXrm90njS4lwTuQ1KP4BZ 80qvzxBzBrG7zZ201uUscni3IWAhSZtbcz3hXiiHmlRrUj94G3m764DGCzNuycu6TQ32 BR1vUG/+nZR5a0L+0y7Q40iZ+j3w8/DEGg7uMl4LeptDQyenmDU4/f+OlwVuSgBfPSj0 Nyhg== X-Forwarded-Encrypted: i=1; AJvYcCXcR4/+kA94PSLaA7xPK1PXJX7nN1aYqHnYITQrZUoy79URLShUEKUeIW9S3ZUfsgXs6LZFoxR9Id+MFRrafrfCQ11m@freebsd.org X-Gm-Message-State: AOJu0Yx+XzS6dGNmu+uysW+hugkcI43lg4YGlgj+HMkaOtCch5PRELGB vpv0Aa5PXbVPf7ZaklVgMsbXk1NmybZB7aYe+wBDJfIgXs+EZaKC3raIcS2EgWO4uikKMIiRrwD eYQtM60tiAWtjv3C/6wqwu4GhWSlLXEMFXQFaCg== X-Google-Smtp-Source: AGHT+IHcGosM0Xaoc+hTWg4442FZ2PgrWNmDyf3ZnYbA1l0TP4oky/dX53l68GN5rP1PwoCLJpn3CRBXCblq9JdbKYU= X-Received: by 2002:a17:90b:4d07:b0:2d3:c8e5:e548 with SMTP id 98e67ed59e1d1-2dd7f40ad4cmr12556382a91.13.1727022567214; Sun, 22 Sep 2024 09:29:27 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 22 Sep 2024 17:29:15 +0100 Message-ID: Subject: Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output To: Mark Johnston Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Bram Content-Type: multipart/alternative; boundary="000000000000a36e150622b7c631" 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: 4XBWmS6xjPz45Sl X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --000000000000a36e150622b7c631 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Sep 22, 2024 at 4:17=E2=80=AFPM Mark Johnston w= rote: > On Sun, Sep 22, 2024 at 02:19:54PM +0100, Warner Losh wrote: > > On Sun, Sep 22, 2024 at 11:29=E2=80=AFAM Mark Johnston > wrote: > > > > > On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d= 36654cde1 > > > > > > > > commit 94567c8641e235763b5b2926416d89d36654cde1 > > > > Author: Bram > > > > AuthorDate: 2024-07-23 08:57:42 +0000 > > > > Commit: Warner Losh > > > > CommitDate: 2024-09-20 15:06:26 +0000 > > > > > > > > netstat: Resolve duplicate "dropped-packets" key from libxo > output > > > > > > > > The current libxo output uses the "dropped-packets" key for bot= h > > > incoming and > > > > outgoing packets. This commit distinguishes between the two by > > > adding an "in" > > > > and "out" suffix. The original "dropped-packets" key is kept fo= r > > > backwards > > > > compatibility for now. > > > > > > > > PR: 244589 > > > > Reviewed by: imp, zlei > > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 > > > > --- > > > > usr.bin/netstat/if.c | 10 ++++++++-- > > > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c > > > > index 172ea5324ccb..f0af785bce04 100644 > > > > --- a/usr.bin/netstat/if.c > > > > +++ b/usr.bin/netstat/if.c > > > > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) > > > > IFA_STAT(ipackets), link|network, 1); > > > > show_stat("lu", nerr_len, "received-errors", > > > IFA_STAT(ierrors), > > > > link, 1); > > > > + /* Below is kept for backwards compatibility. Will be > > > removed in the future. */ > > > > show_stat("lu", nerr_len, "dropped-packets", > > > IFA_STAT(iqdrops), > > > > link, 1); > > > > + show_stat("lu", nerr_len, "dropped-packets-in", > > > IFA_STAT(iqdrops), > > > > + link, 1); > > > > > > This breaks plain netstat output, causing a bunch of network tests to > > > fail. For instance, "netstat -Wf link -I re0" now prints an extra > > > column. > > > > > > I think we should not bother with backwards compat unless libxo is > > > emitting structured output. This can be implemented using the "e" > > > format modifier described in the xo_format modified, but I'm not sure > > > how to plumb it through show_stat(). > > > > > > Let's revert until this is fixed? > > > > > > > Works for me. I hadn't noticed before the push. Thanks for bringing it > up. > > Thanks, the tests seem to be fixed now. > Thanks for the quick shout out it was a problem... --000000000000a36e150622b7c631 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Sep 22, 2024 at 4:17=E2=80=AF= PM Mark Johnston <markj@freebsd.org= > wrote:
= On Sun, Sep 22, 2024 at 02:19:54PM +0100, Warner Losh wrote:
> On Sun, Sep 22, 2024 at 11:29=E2=80=AFAM Mark Johnston <markj@freebsd.org> wrote= :
>
> > On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote:
> > > The branch main has been updated by imp:
> > >
> > > URL:
> > https://= cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d36654cde1<= /a>
> > >
> > > commit 94567c8641e235763b5b2926416d89d36654cde1
> > > Author:=C2=A0 =C2=A0 =C2=A0Bram <
bram@cbbg.nl>
> > > AuthorDate: 2024-07-23 08:57:42 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > CommitDate: 2024-09-20 15:06:26 +0000
> > >
> > >=C2=A0 =C2=A0 =C2=A0netstat: Resolve duplicate "dropped-= packets" key from libxo output
> > >
> > >=C2=A0 =C2=A0 =C2=A0The current libxo output uses the "d= ropped-packets" key for both
> > incoming and
> > >=C2=A0 =C2=A0 =C2=A0outgoing packets. This commit distinguish= es between the two by
> > adding an "in"
> > >=C2=A0 =C2=A0 =C2=A0and "out" suffix. The original = "dropped-packets" key is kept for
> > backwards
> > >=C2=A0 =C2=A0 =C2=A0compatibility for now.
> > >
> > >=C2=A0 =C2=A0 =C2=A0PR: 244589
> > >=C2=A0 =C2=A0 =C2=A0Reviewed by: imp, zlei
> > >=C2=A0 =C2=A0 =C2=A0Pull Request: http= s://github.com/freebsd/freebsd-src/pull/1331
> > > ---
> > >=C2=A0 usr.bin/netstat/if.c | 10 ++++++++--
> > >=C2=A0 1 file changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
> > > index 172ea5324ccb..f0af785bce04 100644
> > > --- a/usr.bin/netstat/if.c
> > > +++ b/usr.bin/netstat/if.c
> > > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) > > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0IFA_STAT(ipackets), link|network, 1);
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_s= tat("lu", nerr_len, "received-errors",
> > IFA_STAT(ierrors),
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0link, 1);
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Below is= kept for backwards compatibility. Will be
> > removed in the future. */
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_s= tat("lu", nerr_len, "dropped-packets",
> > IFA_STAT(iqdrops),
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0link, 1);
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat(&= quot;lu", nerr_len, "dropped-packets-in",
> > IFA_STAT(iqdrops),
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0link, 1);
> >
> > This breaks plain netstat output, causing a bunch of network test= s to
> > fail.=C2=A0 For instance, "netstat -Wf link -I re0" now= prints an extra
> > column.
> >
> > I think we should not bother with backwards compat unless libxo i= s
> > emitting structured output.=C2=A0 This can be implemented using t= he "e"
> > format modifier described in the xo_format modified, but I'm = not sure
> > how to plumb it through show_stat().
> >
> > Let's revert until this is fixed?
> >
>
> Works for me. I hadn't noticed before the push. Thanks for bringin= g it up.

Thanks, the tests seem to be fixed now.

Thanks for the quick shout out it was a problem...=C2=A0
--000000000000a36e150622b7c631-- From nobody Sun Sep 22 16:36:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBWwH3vVvz5XMBN; Sun, 22 Sep 2024 16:36: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 4XBWwH3FfBz47dq; Sun, 22 Sep 2024 16:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727022975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UACxf8rAcYhLb0AD703YCMwPUhIDIqb1SdG2inMgDAM=; b=SPya/rpUNXD3Rka6HASrYMNN+AWz7IAwMTGTCe1YxJlAd/AFAbh+C0NnMV0d/6RRzGK5bF oWs31yriLAlX9cLJSlOE8UoOqZCuEIYP6uG5mt6UPDuOhzZklGJpH/2R67dOSiDFeJORRv TALvdlGDUygby+663WXBpDsVfc+jcsoq0UZRPj+TScr14xKm+LfpvakO1XtCUluCZct8Ju KuIcx1aUHC+p14to+/HKpjJ7EKqeBmdLh5Kc2KgkUy0YkZqsbPsmrQxEk+ruik+HSY71UE 84xVX1rnx1xnek6ZMDwsQuuEW92heowzK0DgldOdQLZIs7gWZDrDRopr/iZsNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727022975; a=rsa-sha256; cv=none; b=NeCu6NtH56xyRSYBlLI9oEUO4v2011xtqjgNkdZ2enGxvvaoc3fK6ga3UUUZHEOjEtPgML Y+rgd0gw/rsONYHoaeIJrDDpNBoAisO5UyDKQet2eOCQXBmO5mPobT+33Y1mC33pg1NUOO m5dK4Y9Oz8OKrNvZwnimb5mrMxBeDGTHbhJfH7pTBJk1nIC73/LTCcKwSW2B1mnGG4N0I7 Tu4ewDdx1YI6k2K3o73L3bRk6h0Z5wfCNQa7eJo5u0vGI4pnArIrDtyuGBD8/HBtzylXYU JLbOUf1NC6jZbiyw1cFprfVzbS2JV84vdDRKkXBU6bzrsuWZ9zZpqPHqFBsy4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727022975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UACxf8rAcYhLb0AD703YCMwPUhIDIqb1SdG2inMgDAM=; b=IF8LD5eW6PXknNk+TreFeRgf5UV2NwR/eUJ/uBjCRYYbGNO7RBrGig7GVfpNBzwC2KmvMR STK6Czm10aNrj34EIH1pDf1SqlPJtUg8IggGexbLDW5QlVXgAtOEwB/yniD9Vc0qHlA/kM kk+3hncglaOKvdZqWMsuLtrgYIN6nX+44ZL/OZN4W/y6y5CMeYBlCzvt1im4XBeCwfDh+b mJk2WToNVER9WZHpyMAy9ONBaeMWRjrZR5N8XxfB57zVtHH2u5Pl0F0PM1NiQeJkVTzagt qhyqYFkctPL/lEaVfmm89SAFQxHQyzHtNOa08h4Pg69AM+2fF8SjVMHzdx/0fA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBWwH2lY1z1NgT; Sun, 22 Sep 2024 16:36: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 48MGaFwa016899; Sun, 22 Sep 2024 16:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MGaFDf016896; Sun, 22 Sep 2024 16:36:15 GMT (envelope-from git) Date: Sun, 22 Sep 2024 16:36:15 GMT Message-Id: <202409221636.48MGaFDf016896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 9503fb867a43 - stable/14 - ncal: add -M to start week on Monday in cal mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9503fb867a4395378efcf132cbb838f8372e8e70 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9503fb867a4395378efcf132cbb838f8372e8e70 commit 9503fb867a4395378efcf132cbb838f8372e8e70 Author: Valentine Astakhov AuthorDate: 2024-06-17 17:58:02 +0000 Commit: Warner Losh CommitDate: 2024-09-22 16:35:10 +0000 ncal: add -M to start week on Monday in cal mode MFC after: 2 weeks Reviewed by: imp, Alexander Ziaee, Pull Request: https://github.com/freebsd/freebsd-src/pull/1294 (cherry picked from commit 8c108b341cd82d0ed9fcd573764bc94682e84125) --- usr.bin/ncal/ncal.1 | 16 ++++++++++------ usr.bin/ncal/ncal.c | 34 +++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/usr.bin/ncal/ncal.1 b/usr.bin/ncal/ncal.1 index a0b6889dca31..8ece31b79cc1 100644 --- a/usr.bin/ncal/ncal.1 +++ b/usr.bin/ncal/ncal.1 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Wolfgang Helbig .\" All rights reserved. .\" @@ -31,7 +34,7 @@ .Nd displays a calendar and the date of Easter .Sh SYNOPSIS .Nm -.Op Fl 3hjy +.Op Fl 3hjMy .Op Fl A Ar number .Op Fl B Ar number .Oo @@ -39,7 +42,7 @@ .Ar year .Oc .Nm -.Op Fl 3hj +.Op Fl 3hjM .Op Fl A Ar number .Op Fl B Ar number .Fl m Ar month @@ -85,6 +88,10 @@ option, display date of Easter according to the Julian Calendar. Display date of Easter (for western churches). .It Fl j Display Julian days (days one-based, numbered from January 1). +.It Fl M +Display Monday as the first day of the week in +.Nm cal +mode. .It Fl m Ar month Display the specified .Ar month . @@ -186,7 +193,7 @@ X/Open System Interfaces option of the specification. .Pp The flags -.Op Fl 3hyJeopw , +.Op Fl 3ehJMopwy , as well as the ability to specify a month name as a single argument, are extensions to that specification. .Pp @@ -215,6 +222,3 @@ codes is historically naive for many countries. .Pp Not all options are compatible and using them in different orders will give varying results. -.Pp -It is not possible to display Monday as the first day of the week with -.Nm cal . diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index 20d14b3a4bde..cda7580162c1 100644 --- a/usr.bin/ncal/ncal.c +++ b/usr.bin/ncal/ncal.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,7 @@ static int flag_weeks; /* user wants number of week */ static int nswitch; /* user defined switch date */ static int nswitchb; /* switch date for backward compatibility */ static int highlightdate; +static bool flag_monday; /* user wants week starts on Monday */ static char *center(char *s, char *t, int w); static wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); @@ -216,6 +218,7 @@ main(int argc, char *argv[]) flag_nohighlight = 0; flag_weeks = 0; + flag_monday = false; /* * Use locale to determine the country code, @@ -256,7 +259,7 @@ main(int argc, char *argv[]) before = after = -1; - while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wy")) != -1) + while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wyM")) != -1) switch (ch) { case '3': flag_3months = 1; @@ -306,6 +309,9 @@ main(int argc, char *argv[]) case 'j': flag_julian_day = 1; break; + case 'M': + flag_monday = true; + break; case 'm': if (flag_specifiedmonth) errx(EX_USAGE, "Double -m specified"); @@ -509,7 +515,7 @@ usage(void) " cal [general options] [-hj] [-m month] [year]\n" " ncal [general options] [-hJjpwy] [-s country_code] [[month] year]\n" " ncal [general options] [-hJeo] [year]\n" -"General options: [-NC3] [-A months] [-B months]\n" +"General options: [-NCM3] [-A months] [-B months]\n" "For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]\n", stderr); exit(EX_USAGE); @@ -652,10 +658,13 @@ monthrangeb(int y, int m, int jd_flag, int before, int after) /* Day of the week names. */ for (i = 0; i < count; i++) { wprintf(L"%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls ", - wdss, wds.names[6], wdss, wds.names[0], - wdss, wds.names[1], wdss, wds.names[2], - wdss, wds.names[3], wdss, wds.names[4], - wdss, wds.names[5]); + wdss, wds.names[flag_monday ? 0 : 6], + wdss, wds.names[flag_monday ? 1 : 0], + wdss, wds.names[flag_monday ? 2 : 1], + wdss, wds.names[flag_monday ? 3 : 2], + wdss, wds.names[flag_monday ? 4 : 3], + wdss, wds.names[flag_monday ? 5 : 4], + wdss, wds.names[flag_monday ? 6 : 5]); } printf("\n"); @@ -860,7 +869,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) date dt; /* handy date */ int dw; /* width of numbers */ int first; /* first day of month */ - int firsts; /* sunday of first week of month */ + int firstsm; /* sunday or monday of first week of month */ int i, j, k, l; /* just indices */ int jan1 = 0; /* the first day of this year */ int last; /* the first day of next month */ @@ -911,10 +920,13 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) } /* - * Set firsts to the day number of sunday of the first week of - * this month. (This might be in the last month) + * Set firstsm to the day number of sunday or monday of the first week + * of this month. (This might be in the last month) */ - firsts = first - (weekday(first)+1) % 7; + if (flag_monday) + firstsm = first - weekday(first); + else + firstsm = first - (weekday(first) + 1) % 7; /* * Fill the lines with day of month or day of year (Julian day) @@ -923,7 +935,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) */ for (i = 0; i != 6; i++) { l = 0; - for (j = firsts + 7 * i, k = 0; j < last && k != dw * 7; + for (j = firstsm + 7 * i, k = 0; j < last && k != dw * 7; j++, k += dw) { if (j >= first) { if (jd_flag) From nobody Sun Sep 22 16:52:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBXHX6bQzz5XSxd for ; Sun, 22 Sep 2024 16:52:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 4XBXHX2PQvz4Cyx for ; Sun, 22 Sep 2024 16:52:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=kDNTXSQ9; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::531) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-7c6b4222fe3so2287861a12.3 for ; Sun, 22 Sep 2024 09:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727023975; x=1727628775; 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=hcsqh2nFNoOda0cJVXECDIsJRR5CYY0LKBVNEsndQVw=; b=kDNTXSQ9iWEYvQugv7LMakHLRTID1qLKb3AkHiZZOMB9eCJsH6ySu9YcQv30M2LPun r3RQwKT7IUXiSzqKqAFGOQ5WNHoHlalaXpVc9h+Z4mjWSOvtinUGE/B+lGVcugpmlQKL jeBrQdSX6sxd/fBG/7JGUQrou4xzAV9SQQPIqAldggTyvH7VyN1Dzabs9kyDcX4YhZ2N 6axRdU+WPlB3c+9Ut6FjqTsQecS8EuAJ5MU9OdZaHJbSRcuicWzlNsniN+TebgoMmruA C0+qQG8InJAt79sZKNdpOSkUu3A4OeHw2+hIEV/JttRBEt7zy+MG/tAjm6ujn9foVQcD jgnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727023975; x=1727628775; 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=hcsqh2nFNoOda0cJVXECDIsJRR5CYY0LKBVNEsndQVw=; b=fS5twzi4Mdh4SqWL3CGYz6GpNzAs4ABZGrk3n2ayy8eJgw8IBlTRRYI65q9WHpe5w0 FCsYC+i9jXbcn8vKAM7vHYT1lxcFV4vDPbO0Mtvl3depE452CE+lXuV9jHd+dsAfM/zI 8bVdndY1tVuRgJpAUQwXKnA8SOtYRU5ELZRQTd09HYkWDdOvkj2Hy6ida74wiF4sReav kJTfUiFnaV5oRnvBM7Uc76R1pBzeI+RGfKrj3K9jH3J9q9taPrAXvjYdfWTZnRiPpANj GcggGSHJv8BlShh3Lb/VtCxs5BPsFrBt1eE40D0DJTrnbcj6JyF2GP46iYvxDIjovr0J XChA== X-Forwarded-Encrypted: i=1; AJvYcCXr69nLCr84rezP41PdA2cIKaFQtrU/uI594LwVTjDTy6doYMRJWToS6VBOUO1VsGBJiVxsPcBU3SDJa3iqlHTCBmso@freebsd.org X-Gm-Message-State: AOJu0YyUWKAHjAJmM4Lt9ftlfo6EvFFKSBBcBZ2Zoe4hI8Evs2d1nOTR cg2YO9WRoK0B4o/baenwaQRzZhRwLgqJhKnoU3hzLI7GyADItVLvO33FmXgREdFRDuoxSJQdsZS JikNPq6unJPvLtI+ZpWuqRm5oQzOFHMpND2E3B3ophSdWumxtDYI= X-Google-Smtp-Source: AGHT+IGHhW9rO9xISbhOqPtrN9cC85mJDWa+5HJrjut/bontnE5MXn11jgCAGZa2MvbWPe0CN0U4DM1H1aCgHxBo1T8= X-Received: by 2002:a17:90b:1286:b0:2d3:c892:9607 with SMTP id 98e67ed59e1d1-2dd80c175c9mr10642007a91.12.1727023974633; Sun, 22 Sep 2024 09:52:54 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202409061835.486IZ9Fd010541@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 22 Sep 2024 17:52:43 +0100 Message-ID: Subject: Re: git: 07d90ee0a621 - main - kvprintf(): Fix '+' conversion handling To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000086f8c80622b81a5b" X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::531:from]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4XBXHX2PQvz4Cyx X-Spamd-Bar: -- --00000000000086f8c80622b81a5b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 6, 2024 at 10:47=E2=80=AFPM Konstantin Belousov wrote: > On Fri, Sep 06, 2024 at 03:14:49PM -0600, Warner Losh wrote: > > On Fri, Sep 6, 2024 at 2:53=E2=80=AFPM Konstantin Belousov > > wrote: > > > > > On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=3D07d90ee0a62110e5161bb0b8a3a0b1b= 9d2beabad > > > > > > > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad > > > > Author: Sebastian Huber > > > > AuthorDate: 2024-06-14 07:30:28 +0000 > > > > Commit: Warner Losh > > > > CommitDate: 2024-09-06 18:34:30 +0000 > > > > > > > > kvprintf(): Fix '+' conversion handling > > > > > > > > For example, printf("%+i", 1) prints "+1". However, kvprintf() > did > > > > print just "1" for this example. According to PRINTF(3): > > > > > > > > A sign must always be placed before a number produced by a > signed > > > > conversion. > > > > > > > > For "%+r" radix conversions, keep the "+" handling as it is, > since > > > this > > > > is a non-standard conversion. For "%+p" pointer conversions, > > > continue > > > > to ignore the sign modifier to be in line with libc. > > > > > > > > This change allows to support the ' conversion modifier in the > > > future. > > > > > > > > Reviewed by: imp > > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1310 > > > > --- > > > > sys/kern/subr_prf.c | 27 +++++++++++++-------------- > > > > 1 file changed, 13 insertions(+), 14 deletions(-) > > > Again, isn't rtld_printf needs the same change? > > > > > > > This time I don't think so. I'll double check though. I'd checked when > this > > came in. Thanks for the reminder. > It would be weird if not needed, rtld_printf.c was a copy of subr_prf.c. > Yes. It's required. I've updated and committed. Thanks again for the reminder. I must have been confused when I thought it wasn't needed, since it isn't even a close call looking at it just now. Warner --00000000000086f8c80622b81a5b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Sep 6, 2024 at 10:47=E2=80=AF= PM Konstantin Belousov <kostikbel= @gmail.com> wrote:
On Fri, Sep 06, 2024 at 03:14:49PM -0600, Warner Losh wrote:
> On Fri, Sep 6, 2024 at 2:53=E2=80=AFPM Konstantin Belousov <kostikbel@gmail.com&g= t;
> wrote:
>
> > On Fri, Sep 06, 2024 at 06:35:09PM +0000, Warner Losh wrote:
> > > The branch main has been updated by imp:
> > >
> > > URL:
> > https://= cgit.FreeBSD.org/src/commit/?id=3D07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad<= /a>
> > >
> > > commit 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad
> > > Author:=C2=A0 =C2=A0 =C2=A0Sebastian Huber <
sebastian.huber@= embedded-brains.de>
> > > AuthorDate: 2024-06-14 07:30:28 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > CommitDate: 2024-09-06 18:34:30 +0000
> > >
> > >=C2=A0 =C2=A0 =C2=A0kvprintf(): Fix '+' conversion ha= ndling
> > >
> > >=C2=A0 =C2=A0 =C2=A0For example, printf("%+i", 1) p= rints "+1".=C2=A0 However, kvprintf() did
> > >=C2=A0 =C2=A0 =C2=A0print just "1" for this example= .=C2=A0 According to PRINTF(3):
> > >
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0A sign must always be placed befor= e a number produced by a signed
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0conversion.
> > >
> > >=C2=A0 =C2=A0 =C2=A0For "%+r" radix conversions, ke= ep the "+" handling as it is, since
> > this
> > >=C2=A0 =C2=A0 =C2=A0is a non-standard conversion.=C2=A0 For &= quot;%+p" pointer conversions,
> > continue
> > >=C2=A0 =C2=A0 =C2=A0to ignore the sign modifier to be in line= with libc.
> > >
> > >=C2=A0 =C2=A0 =C2=A0This change allows to support the ' c= onversion modifier in the
> > future.
> > >
> > >=C2=A0 =C2=A0 =C2=A0Reviewed by: imp
> > >=C2=A0 =C2=A0 =C2=A0Pull Request: http= s://github.com/freebsd/freebsd-src/pull/1310
> > > ---
> > >=C2=A0 sys/kern/subr_prf.c | 27 +++++++++++++-------------- > > >=C2=A0 1 file changed, 13 insertions(+), 14 deletions(-)
> > Again, isn't rtld_printf needs the same change?
> >
>
> This time I don't think so. I'll double check though. I'd = checked when this
> came in. Thanks for the reminder.
It would be weird if not needed, rtld_printf.c was a copy of subr_prf.c.

Yes. It's required. I've updated = and committed. Thanks again for the reminder.
I must have been co= nfused when I thought it wasn't needed, since it isn't even
a close call looking at it just now.

Warner=C2= =A0
--00000000000086f8c80622b81a5b-- From nobody Sun Sep 22 16:55:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBXLC44Tnz5XTw2; Sun, 22 Sep 2024 16:55: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 4XBXLC3Jx0z4DJP; Sun, 22 Sep 2024 16:55:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727024115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DY5MdB5iMKIVM02lwJ39H1k3h4InOjW/aj6wfaE9Aak=; b=qrNofJM7NoV601uIMlT++RjejXBpyxnVPd7B4rmkkohjqurqkhpp05ALYnOXrcwXM5Vhqj jr6ttKofjwyxnW33w0Hd1B61CIbIQ80hiqHY9mCjUnEfcixsFqP9zcvvTzTMCNb1MMvKTy WMVXdPQD/SViYBcYL9dSpsABAZv+N5q89LcAq2pMwBrwUj14BC/m1Souu8cZOYQCB4TdB0 tmyAUskSU+dc7+y04j9m7XCLLZRZ7MOA3I/fzNio3ND98gaYjxZe0mJa4kWsRk8aEBxHmN /LE0p9Gm2+F3Lk8VD3+mfR0YEWQW0PYnJgpEoJQDnJf0kf0z8JhiyCuJ3OugKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727024115; a=rsa-sha256; cv=none; b=WgAt2Jvxqv5RbpNu+vE6pLnnVQ0U2vc5mIHB9BoxodKaKyLZ9LeyL72tr11CPLBDMlzIvE P+RrofunoxEUL8q5IFh2Pr/EWJtmPxZRFsRWoHR4jnZehW8JLKwyYiS8AYOABQ4eP2atux vWQK3QxP94qwMEABEPhi6Ze0baNoGATvfl4QmWfX9c5J+xuTCjnTv0tyumlLW7/KG7PwAz Iub9gwFpch2k3GjOwwas1kCEFcY6JV/0bCou4g8FxFUtpjtcNf2TAnFgSmkTdgML3j3nY9 BcLo4++H/WfF1xMuRi9ntQjLWPEybFN6vzxSJhm1R125M+tER1CI3eFAhasazQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727024115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DY5MdB5iMKIVM02lwJ39H1k3h4InOjW/aj6wfaE9Aak=; b=yew7dFyckiL2gtURa4ZUCtVGS97xCL89Tn2AsZ79/SZOmRrM6JEUfaay44Pp6ADDXgwHDF PO51oFuux+bgbFCvZN1bn+XtF1dL24LhcaWvaAj+O0IktPDN72WkCF6LqfmpcTI5Cimug/ zYZfoo12OpLHSJbYGYT7lHeMACjRc70/MOMGWysSjoxq9v7WZxuQKFGSjXR3Yqfa8JiCFz wJ96pEEJedmu5fnZ907ktCZQSmeSvAObdU1t/Ea9qpBGCOCSsShLPmi97KITf7ytPvLV0j HGF9nb+UzZiEqdV5rO6GjaKOs4/xa6+i0rRNe+Nnrg9P2eWnC30kCQaiV2OrUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBXLC2w0Gz1Nlj; Sun, 22 Sep 2024 16:55: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 48MGtFTU050866; Sun, 22 Sep 2024 16:55:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MGtFuC050863; Sun, 22 Sep 2024 16:55:15 GMT (envelope-from git) Date: Sun, 22 Sep 2024 16:55:15 GMT Message-Id: <202409221655.48MGtFuC050863@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: f5a8f6f71a68 - main - rtld: Catch up to 07d90ee0a621 in subr_prf.c: Fix '+' conversion handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5a8f6f71a6845ad2eb3d8db22789ba6b1fd3fd8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a8f6f71a6845ad2eb3d8db22789ba6b1fd3fd8 commit f5a8f6f71a6845ad2eb3d8db22789ba6b1fd3fd8 Author: Warner Losh AuthorDate: 2024-09-22 16:49:45 +0000 Commit: Warner Losh CommitDate: 2024-09-22 16:52:11 +0000 rtld: Catch up to 07d90ee0a621 in subr_prf.c: Fix '+' conversion handling Sponsored by: Netflix --- libexec/rtld-elf/rtld_printf.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/libexec/rtld-elf/rtld_printf.c b/libexec/rtld-elf/rtld_printf.c index 45c0bdc00b29..69ee4e46fd1c 100644 --- a/libexec/rtld-elf/rtld_printf.c +++ b/libexec/rtld-elf/rtld_printf.c @@ -125,9 +125,9 @@ kvprintf(char const *fmt, struct snprintf_arg *arg, int radix, va_list ap) char nbuf[MAXNBUF]; const char *p, *percent, *q; u_char *up; - int ch, n; + int ch, n, sign; uintmax_t num; - int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; + int base, lflag, qflag, tmp, width, ladjust, sharpflag, dot; int cflag, hflag, jflag, tflag, zflag; int dwidth, upper; char padc; @@ -150,7 +150,7 @@ kvprintf(char const *fmt, struct snprintf_arg *arg, int radix, va_list ap) PCHAR(ch); } percent = fmt - 1; - qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; + qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; sign = 0; dot = 0; dwidth = 0; upper = 0; cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; reswitch: switch (ch = (u_char)*fmt++) { @@ -161,7 +161,7 @@ reswitch: switch (ch = (u_char)*fmt++) { sharpflag = 1; goto reswitch; case '+': - sign = 1; + sign = '+'; goto reswitch; case '-': ladjust = 1; @@ -242,7 +242,6 @@ reswitch: switch (ch = (u_char)*fmt++) { case 'd': case 'i': base = 10; - sign = 1; goto handle_sign; case 'h': if (hflag) { @@ -291,8 +290,10 @@ reswitch: switch (ch = (u_char)*fmt++) { goto reswitch; case 'r': base = radix; - if (sign) + if (sign) { + sign = 0; goto handle_sign; + } goto handle_nosign; case 's': p = va_arg(ap, char *); @@ -329,13 +330,11 @@ reswitch: switch (ch = (u_char)*fmt++) { goto handle_nosign; case 'y': base = 16; - sign = 1; goto handle_sign; case 'z': zflag = 1; goto reswitch; handle_nosign: - sign = 0; if (jflag) num = va_arg(ap, uintmax_t); else if (qflag) @@ -370,11 +369,11 @@ handle_sign: num = (signed char)va_arg(ap, int); else num = va_arg(ap, int); -number: - if (sign && (intmax_t)num < 0) { - neg = 1; + if ((intmax_t)num < 0) { + sign = '-'; num = -(intmax_t)num; } +number: p = ksprintn(nbuf, num, base, &n, upper); tmp = 0; if (sharpflag && num != 0) { @@ -383,7 +382,7 @@ number: else if (base == 16) tmp += 2; } - if (neg) + if (sign) tmp++; if (!ladjust && padc == '0') @@ -393,8 +392,8 @@ number: if (!ladjust) while (width-- > 0) PCHAR(' '); - if (neg) - PCHAR('-'); + if (sign) + PCHAR(sign); if (sharpflag && num != 0) { if (base == 8) { PCHAR('0'); From nobody Sun Sep 22 17:13:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBXl35Wtvz5WNK8; Sun, 22 Sep 2024 17:13: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 4XBXl34t3Wz4HJt; Sun, 22 Sep 2024 17:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727025199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8oy54RS+A+2KKzTJHkSQwn0X1enbi6eZXFoLupyxXtA=; b=Y6GTkthb31OxsFQLMfywFpOav0N4w1cXgHEloUjDTeU5IoHrievjF+7CEODdJH4WViOCU7 N4joqDpPMaJOog332DzU2qLbeRspRoGjL/+R3tGqeNzCy6OMf90YISI47wMdS8DQbIxJcH hnPU2n/Q3VV0yPxLvVyhquXjixX41qZVtFx5Y21NhchW3G/FGirwLeZ4t6h5t7z0tv6mPc RqJkfg8u4NYYTW7QozIX5jB11IYzpJLYwkZ6wdA1c/FyACJHGgHzX8TBRdqsNvl4w2Bqi4 0i6e1OG3G9GKnCMiHuLTq7TuuwseGwCznNuB3LtpMiYdDZWScXuu8EyuyoSdNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727025199; a=rsa-sha256; cv=none; b=mw1C818TICfSHeCo0IP14hIQqIbS62LMrtezH8mW3yyeHrQeKZ9VOwlVpRTF4L4cYD4QX8 40fg5Rk2/SejiyHnI7oTsPr5/qk3+QV/B/4tTVaHIrJgWaeAejfAyMLblXYB/kcY6Ig1RL XTDtIPp/xZ1ZuSvSbxLgk4c93ICzrfESlGlUgBpKCtbiQl6Yg5JwqTK3DJesmEMmpCUU1Q 9wRnQB01CYv+oICmOpJplg48WZpp8JapjaThZ7gWKrRawkCHJPRkLoauG50Ps92x0WBKCw GSowTxDUzEKZiX+8wODWjz+0CBjRqFQPk+D40tlCZwmvSax4N2N+a7W0PDkitg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727025199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8oy54RS+A+2KKzTJHkSQwn0X1enbi6eZXFoLupyxXtA=; b=mASjgm49r/Q1nhYG7ePASjnduLQzaUrNKmNALwU2RgYxD6p8ouBATbc25MktWYqb/3ZBwp lBQLN1TknBWBKUwZDIGU8IPsWwy7mTknIBRjK22JQX8cOH+OgT2cB8LcjXQ2mBQy7B16vZ 0csQTnhyBK4LRv7x8kPTq5IBscs0578Wu+UmhJYhOFPYiGsQZ0dS5ZkrvLyJYVqqW7jD6t L2SX3nDz6L860PiTUjPi3/O8cf+9e9XK5pAkMi3VLMXOTsOaRvHjq6ari1ZEACc6uzm11V FI0gau7i932sGpi6UQrIDc8EgsUTX2kdwNGDY4c4ZVOU+l0MPXLzSffDGAOdHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBXl34Sxtz1Ppc; Sun, 22 Sep 2024 17:13: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 48MHDJ2O084469; Sun, 22 Sep 2024 17:13:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MHDJfW084466; Sun, 22 Sep 2024 17:13:19 GMT (envelope-from git) Date: Sun, 22 Sep 2024 17:13:19 GMT Message-Id: <202409221713.48MHDJfW084466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 54521a2ff93a - main - Merge commit b84d773fd004 from llvm git (by Fangrui Song): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54521a2ff93ae06c95c31f79f89dc23c9b51c20b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=54521a2ff93ae06c95c31f79f89dc23c9b51c20b commit 54521a2ff93ae06c95c31f79f89dc23c9b51c20b Author: Dimitry Andric AuthorDate: 2024-09-22 17:08:47 +0000 Commit: Dimitry Andric CommitDate: 2024-09-22 17:12:17 +0000 Merge commit b84d773fd004 from llvm git (by Fangrui Song): [Parallel] Revert sequential task changes https://reviews.llvm.org/D148728 introduced `bool Sequential` to unify `execute` and the old `spawn` without argument. However, sequential tasks might be executed by any worker thread (non-deterministic), leading to non-determinism output for ld.lld -z nocombreloc (see https://reviews.llvm.org/D133003). In addition, the extra member variables have overhead. This sequential task has only been used for lld parallel relocation scanning. This patch restores the behavior before https://reviews.llvm.org/D148728 . Fix #105958 Pull Request: https://github.com/llvm/llvm-project/pull/109084 This fixes the non-reproducibility we had noticed when linking our EFI loaders, and for which we committed a workaround in f5ce3f4ef562. MFC after: 3 days --- contrib/llvm-project/lld/ELF/Relocations.cpp | 56 ++++++++++++++-------- .../llvm/include/llvm/Support/Parallel.h | 4 +- contrib/llvm-project/llvm/lib/Support/Parallel.cpp | 49 +++++-------------- 3 files changed, 48 insertions(+), 61 deletions(-) diff --git a/contrib/llvm-project/lld/ELF/Relocations.cpp b/contrib/llvm-project/lld/ELF/Relocations.cpp index 92a1b9baaca3..8cb01b63d2cc 100644 --- a/contrib/llvm-project/lld/ELF/Relocations.cpp +++ b/contrib/llvm-project/lld/ELF/Relocations.cpp @@ -1584,30 +1584,44 @@ template void elf::scanRelocations() { bool serial = !config->zCombreloc || config->emachine == EM_MIPS || config->emachine == EM_PPC64; parallel::TaskGroup tg; - for (ELFFileBase *f : ctx.objectFiles) { - auto fn = [f]() { + auto outerFn = [&]() { + for (ELFFileBase *f : ctx.objectFiles) { + auto fn = [f]() { + RelocationScanner scanner; + for (InputSectionBase *s : f->getSections()) { + if (s && s->kind() == SectionBase::Regular && s->isLive() && + (s->flags & SHF_ALLOC) && + !(s->type == SHT_ARM_EXIDX && config->emachine == EM_ARM)) + scanner.template scanSection(*s); + } + }; + if (serial) + fn(); + else + tg.spawn(fn); + } + auto scanEH = [] { RelocationScanner scanner; - for (InputSectionBase *s : f->getSections()) { - if (s && s->kind() == SectionBase::Regular && s->isLive() && - (s->flags & SHF_ALLOC) && - !(s->type == SHT_ARM_EXIDX && config->emachine == EM_ARM)) - scanner.template scanSection(*s); + for (Partition &part : partitions) { + for (EhInputSection *sec : part.ehFrame->sections) + scanner.template scanSection(*sec); + if (part.armExidx && part.armExidx->isLive()) + for (InputSection *sec : part.armExidx->exidxSections) + if (sec->isLive()) + scanner.template scanSection(*sec); } }; - tg.spawn(fn, serial); - } - - tg.spawn([] { - RelocationScanner scanner; - for (Partition &part : partitions) { - for (EhInputSection *sec : part.ehFrame->sections) - scanner.template scanSection(*sec); - if (part.armExidx && part.armExidx->isLive()) - for (InputSection *sec : part.armExidx->exidxSections) - if (sec->isLive()) - scanner.template scanSection(*sec); - } - }); + if (serial) + scanEH(); + else + tg.spawn(scanEH); + }; + // If `serial` is true, call `spawn` to ensure that `scanner` runs in a thread + // with valid getThreadIndex(). + if (serial) + tg.spawn(outerFn); + else + outerFn(); } static bool handleNonPreemptibleIfunc(Symbol &sym, uint16_t flags) { diff --git a/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h b/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h index 8170da98f15a..c34619ab7d96 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h @@ -97,9 +97,7 @@ public: // Spawn a task, but does not wait for it to finish. // Tasks marked with \p Sequential will be executed // exactly in the order which they were spawned. - // Note: Sequential tasks may be executed on different - // threads, but strictly in sequential order. - void spawn(std::function f, bool Sequential = false); + void spawn(std::function f); void sync() const { L.sync(); } diff --git a/contrib/llvm-project/llvm/lib/Support/Parallel.cpp b/contrib/llvm-project/llvm/lib/Support/Parallel.cpp index 9b14b05b5211..26da702969b7 100644 --- a/contrib/llvm-project/llvm/lib/Support/Parallel.cpp +++ b/contrib/llvm-project/llvm/lib/Support/Parallel.cpp @@ -12,7 +12,6 @@ #include "llvm/Support/Threading.h" #include -#include #include #include #include @@ -39,7 +38,7 @@ namespace { class Executor { public: virtual ~Executor() = default; - virtual void add(std::function func, bool Sequential = false) = 0; + virtual void add(std::function func) = 0; virtual size_t getThreadCount() const = 0; static Executor *getDefaultExecutor(); @@ -98,13 +97,10 @@ public: static void call(void *Ptr) { ((ThreadPoolExecutor *)Ptr)->stop(); } }; - void add(std::function F, bool Sequential = false) override { + void add(std::function F) override { { std::lock_guard Lock(Mutex); - if (Sequential) - WorkQueueSequential.emplace_front(std::move(F)); - else - WorkQueue.emplace_back(std::move(F)); + WorkStack.push_back(std::move(F)); } Cond.notify_one(); } @@ -112,42 +108,23 @@ public: size_t getThreadCount() const override { return ThreadCount; } private: - bool hasSequentialTasks() const { - return !WorkQueueSequential.empty() && !SequentialQueueIsLocked; - } - - bool hasGeneralTasks() const { return !WorkQueue.empty(); } - void work(ThreadPoolStrategy S, unsigned ThreadID) { threadIndex = ThreadID; S.apply_thread_strategy(ThreadID); while (true) { std::unique_lock Lock(Mutex); - Cond.wait(Lock, [&] { - return Stop || hasGeneralTasks() || hasSequentialTasks(); - }); + Cond.wait(Lock, [&] { return Stop || !WorkStack.empty(); }); if (Stop) break; - bool Sequential = hasSequentialTasks(); - if (Sequential) - SequentialQueueIsLocked = true; - else - assert(hasGeneralTasks()); - - auto &Queue = Sequential ? WorkQueueSequential : WorkQueue; - auto Task = std::move(Queue.back()); - Queue.pop_back(); + auto Task = std::move(WorkStack.back()); + WorkStack.pop_back(); Lock.unlock(); Task(); - if (Sequential) - SequentialQueueIsLocked = false; } } std::atomic Stop{false}; - std::atomic SequentialQueueIsLocked{false}; - std::deque> WorkQueue; - std::deque> WorkQueueSequential; + std::vector> WorkStack; std::mutex Mutex; std::condition_variable Cond; std::promise ThreadsCreated; @@ -205,16 +182,14 @@ TaskGroup::~TaskGroup() { L.sync(); } -void TaskGroup::spawn(std::function F, bool Sequential) { +void TaskGroup::spawn(std::function F) { #if LLVM_ENABLE_THREADS if (Parallel) { L.inc(); - detail::Executor::getDefaultExecutor()->add( - [&, F = std::move(F)] { - F(); - L.dec(); - }, - Sequential); + detail::Executor::getDefaultExecutor()->add([&, F = std::move(F)] { + F(); + L.dec(); + }); return; } #endif From nobody Sun Sep 22 17:13:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBXl46tFwz5WNZw; Sun, 22 Sep 2024 17:13: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 4XBXl45sPXz4Hm7; Sun, 22 Sep 2024 17:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727025200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24DFdQPMnGrEqETGNiPKPStQ50g+EGXTSsieF2z91BY=; b=tTcmQrUlqqLqbcek/fR9h4l5KJzzT5TaqfRN2s+XDbVFfpSDNEJYUIB5KxYyNwOjqqhfmt mGqmYSTaH9M33ASunkkZCux68iZ4YCejn13XsVI+SoKDIPpgfVulvcuce2HmP10JqO2kO7 80Lad/tIQN5jmyIB6MTjAQeuQuxlW6yvU7wONx1lrVjBguinaLbsgw6FHeJhFuLjljfDsm 1rEepniKw+JCUR8Aa7WOERIkv7cB/WqzcRg5AXxJW6Do5dI1/cCcFOOO3whvFGFsvxSZou i/G0TYV0q6Zpgedk/e/xDIcT6dNvqtSZsBy2l+KJD86UP7cJzyuL3kvHRyXiSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727025200; a=rsa-sha256; cv=none; b=TZwQoFQLJwxknWStH/gMGWcmeTf42u1Ei0uH7653olUCnBT+2n4Pr8pRQ6hd/3tQH400M4 DizpyZ6z5sranZ+aulYgT5IbTBepfn1OQlz1UlQQ4JeBmzt7UkC/T0hXSoVee2RtF6kn+n LuDt3pM4qwcM+36D7e+NYYreXa1RrKBUK/xoprstirKtjeA/VwyQ/UGRYQoLwXfh+qjsW4 fcpbzXnXTGyXuaL02sF+b4jYVjWdXpIZMl79eQ6oeQUONDH/Q+12zeuvp/eY312aXXzpHs US5BbBwlBBmtDdkpdyY2divQ0fpUhUVFxJmkiH7CCMSzG2HRVOoqKfEgzSrwuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727025200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24DFdQPMnGrEqETGNiPKPStQ50g+EGXTSsieF2z91BY=; b=mouBWDI/ihOdMDP6TdYW+tsbGwSUWnGFy7zKuzxxSR6wZoelU6Jjd8GrQ7GfO6JP9inMXv cNo6TzQsldpHmEeVfstUfOc8jNnQFH/tfmGacFx20l2jF/bSw1UY/0JeaouQ+vpl0127yk V/1D7Oe4EfgUMr1t3ucHax+6hkOV8BNqRk4D7ztJ9Y5Xl+v+gnJs//geRNYW3uBbI05xrr jIrFdH0TAmXsoavfGVIbHejxjQeO+ruaH3w6tQDyiU90DgnHeBBKo1C/51c5VmaZLkK1Jg KClLWA/ylEw72QD70IOX4S6MoCclzLrLguDW6NdYjaMwFCaa95OIU6lpIvCq+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBXl45Sx8z1PZl; Sun, 22 Sep 2024 17:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48MHDK3i084515; Sun, 22 Sep 2024 17:13:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MHDKTD084512; Sun, 22 Sep 2024 17:13:20 GMT (envelope-from git) Date: Sun, 22 Sep 2024 17:13:20 GMT Message-Id: <202409221713.48MHDKTD084512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: f97c7fdc59d2 - main - Bump lld LINKER_FREEBSD_VERSION for reproducibility fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f97c7fdc59d252cc8611968ffac541d4b8342b8b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f97c7fdc59d252cc8611968ffac541d4b8342b8b commit f97c7fdc59d252cc8611968ffac541d4b8342b8b Author: Dimitry Andric AuthorDate: 2024-09-22 17:12:01 +0000 Commit: Dimitry Andric CommitDate: 2024-09-22 17:12:38 +0000 Bump lld LINKER_FREEBSD_VERSION for reproducibility fix The upstream fix to make lld output for our EFI loaders reproducible again was committed in 54521a2ff93a. Bump lld's LINKER_FREEBSD_VERSION to be able to check this in the EFI loader Makefile. MFC after: 3 days --- lib/clang/include/lld/Common/Version.inc | 2 +- stand/efi/loader/Makefile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 1de090a4b4d0..86232cbccf4c 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style -#define LLD_FREEBSD_VERSION 1500000 +#define LLD_FREEBSD_VERSION 1500001 #define LLD_VERSION_STRING "18.1.6 (FreeBSD llvmorg-18.1.6-0-g1118c2e05e67-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index ae25910da2c5..e9d29e5a219e 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -111,10 +111,14 @@ LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie LDFLAGS+= -Wl,--no-dynamic-linker .endif +.include + +.if ${LINKER_TYPE} == "lld" && ${LINKER_FREEBSD_VERSION} < 1500001 # When lld is using multiple threads, which it does by default, it can # result in non-reproducible output with the custom linker script. Work # around this by disabling threading. -LDFLAGS.lld+= -Wl,--threads=1 +LDFLAGS+= -Wl,--threads=1 +.endif CLEANFILES+= ${LOADER}.efi From nobody Sun Sep 22 18:26:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBZMz3Hqrz5XB8L; Sun, 22 Sep 2024 18:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBZMz0CVQz4Ygw; Sun, 22 Sep 2024 18:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727029615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ULTiv5uoez56n7ox2FZVUlxyMVuEq5P7eYjTOpO/nkM=; b=AFoexU7Vh5oLWo+6kyPaS4nmmBc+9icBJa5ka+3sdbSjL2Skv5kyaD4Wl7RUl2mSvtxbLg IUex/8JfmkT90bDYMl6axfbCckmJ10fgOyXWpbF4wggth6jiUFHRizqIWGEYcnJBYAc320 Hh6MGK6slgx2srtmY9fmWlEWBSTEhRKF/iNrEJ3eEf11mrKwJHfmCR2Yty1XNdw7gXGOlI O8dk2T/ig/yo45Y5h6Ah2Aj20dwBEpKdHAWkieZhGQHFAQQJoM85Qc08waOijphNvSmuBr PSXRgerd+wD+5xrxVF7LTojnEapz2BIzns4TkIA/X4SlrstoGWZmMscEeD28lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727029615; a=rsa-sha256; cv=none; b=K9xofwpBTyzEs7FNFtn6BvQQ9Lw6Oq6HlLKB8KIotSuNswgUqTxrUBR2PeGNkBRIFaKBBy FYeh2n9/MpnsTT4RB+HEK8EwY9MjHgAfG0I+3tjV0ZzKBsNZpe5PoPslsAD8Tj9pMUJn3r KAaQLuUWxwRmGkDw6qgyB/JEdGCGhCaonXUI0t+mTjManT/aFn62GFus8koQvhd2ItxYfy e+/hKi7LqAPx06E5GvcGceG1tX8lCkDYn5YkU4ud5BysDo3qEj+WEjI/iOE5mZcVyqMm5t nEZV/R52yVIYcoYW39CdsN1N6totzvHUkCZW12l4NDJqlvmqiD8SfxrCy4W2fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727029615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ULTiv5uoez56n7ox2FZVUlxyMVuEq5P7eYjTOpO/nkM=; b=HPgQLJgmEYCWVcUeOiQ2EVMuIYV2wNQz03+7NmOgdXwzJeh0Sxza1UdqpxbbOEWGnHijXo Z5TsC1L1SpIsQXA8T8u5SZfcgEEakXey7wHcn5BNnNLRwBv1uUb0cgIaQSGK9BlTPRT6vn FbVsx1n5EKgCFgQZfBYKDmbKIDxqFAzdRzZFGBRDAp+Gfd6LpyQXnfUu0s3NINXn+rsmz+ HAIfdUl1nWDNQrJmlZ0eBUclhY9kO08bYyb3tCEFTle0LR4ggEDrBRcTfCVeIvUYT3jWEL n6/tYfz7Z4phY/p7UcUNbHa9j4TTqwdolGfbjezbZzABqIafoXYVkCCPpMAewQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBZMy6q3Zz1RcB; Sun, 22 Sep 2024 18:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48MIQsGh004475; Sun, 22 Sep 2024 18:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MIQsFp004472; Sun, 22 Sep 2024 18:26:54 GMT (envelope-from git) Date: Sun, 22 Sep 2024 18:26:54 GMT Message-Id: <202409221826.48MIQsFp004472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 91fac46bf7cf - main - rc.d/dnctl: Chmod +x for consistency with other rc scripts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91fac46bf7cff03c3471422c67281041c5fa0f1f Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=91fac46bf7cff03c3471422c67281041c5fa0f1f commit 91fac46bf7cff03c3471422c67281041c5fa0f1f Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-09-22 11:35:50 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-09-22 18:24:39 +0000 rc.d/dnctl: Chmod +x for consistency with other rc scripts MFC after: 1 week Approved by: bnovkov --- libexec/rc/rc.d/dnctl | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libexec/rc/rc.d/dnctl b/libexec/rc/rc.d/dnctl old mode 100644 new mode 100755 From nobody Sun Sep 22 18:26:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBZN04VPwz5XBFD; Sun, 22 Sep 2024 18:26: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 4XBZN00rgkz4Yxf; Sun, 22 Sep 2024 18:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727029616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xNj0ZvZBcyxLado834AC5ii644qKMx8PPME0+oicms=; b=VYpZ3Rtdtl1vV+7boKSP/y50aUGlAeF5+9/AyvJ7N32LpMddoCNpGOLAd+ywMdFmRCNTCD /YvBuEMkGV1F8Hto0hQUNLh1Ml5NE52emW/FGXuFDBOuq4f/8EhzQU+24sn8VaHHjl4yr1 Dit8Ac8v4VBaO8gfo6ZU/zvrmVuuqXLb9usFNCEhq6tEV6wQj3nfT7eur8pZ9kXsR7dSRk q7ct2QFSxDjIn8iEg17K7AxcWgu3dY4AibkkvfOZ4ZSWrl3z4Ry/9knT8yEZyKJCo/Lhw8 54SfrovS0OYFjG4148KYEpRk2lwP9eH8qml05DDa5WvIYYoWQB+ooFd+HDSplg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727029616; a=rsa-sha256; cv=none; b=Xkfgj6Ar1NsxHZK65J1Qo8mc0wUpbpYFt9y2Pqeia/gNgHpo21RLtNZzrXNc2AfQxMKsT1 f36M9sJ7bIEcIyK/HI44mqg2wYNKuspe0xzBNBvbFIN7bS2/nnO2wDKplU2BuCPAFl94MN QNyhYaYCxCbqqwkm8rGZXo2BFBS29fGlZCAtK9HfQ+DyOW93UnD2ygR1Of+twkhm/71qVj hE+VoZwA6ZUWhXgxE+7jt8HjZLhf5kbV8LOYRPlWP7fa45Uyz3ao//8BGompp3J2uoJXYw /CsxdsLxEEItflYBNkjD//fMd/Z8KwQwcz4fUVomutFTXKHkifq/iosVSKOVzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727029616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xNj0ZvZBcyxLado834AC5ii644qKMx8PPME0+oicms=; b=TJDA/nMtwi7vvVMgc+hzAD26ETV/zNR4IZei1/YR2MK1VapAalnrYg5RvRo9aN5nrtIOxB /DTrDbO4fg3a80MHrAuPwKFAY6GxL1PurRVR4ewgLEyhENkIJK9tpjPJjCPQGMonoHb+CL 4JCAGnh6ypSs+NRAb9a3kn7jHGBNRCD6KdqQsAh+JqwFuLo4zYwfMZTKZwMn6m39ueY48V ROZanTBpK19L9hGTyYTwhdFseB9MnyE/yEu41g4Z7iRbUMqPHca6wSpA/LDMY5zD6mLFet mWdmaNMuEpNlpNrRXuW9Hvqq7HRhVwStW64SvjEaleKOTbNdfGIl8+5vEBXR1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBZN00SqLz1R2N; Sun, 22 Sep 2024 18:26: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 48MIQtOq004530; Sun, 22 Sep 2024 18:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MIQtB1004527; Sun, 22 Sep 2024 18:26:55 GMT (envelope-from git) Date: Sun, 22 Sep 2024 18:26:55 GMT Message-Id: <202409221826.48MIQtB1004527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 859868156a16 - main - rc.subr.8: Do not use mdoc macros for Bl width List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 859868156a1658af71d57ee6c77c10fc192aa74a Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=859868156a1658af71d57ee6c77c10fc192aa74a commit 859868156a1658af71d57ee6c77c10fc192aa74a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-09-22 11:42:12 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-09-22 18:25:11 +0000 rc.subr.8: Do not use mdoc macros for Bl width Macros do not expand there. MFC after: 1 week --- share/man/man8/rc.subr.8 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8 index d2c9ce7af5d8..549a4343a72a 100644 --- a/share/man/man8/rc.subr.8 +++ b/share/man/man8/rc.subr.8 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 18, 2024 +.Dd September 22, 2024 .Dt RC.SUBR 8 .Os .Sh NAME @@ -134,7 +134,7 @@ The .Ar action argument may be one of the following: -.Bl -tag -width ".Cm remove" +.Bl -tag -width "remove" .It Cm add .Ar file is now being backed up by or possibly re-entered into this backup mechanism. @@ -487,7 +487,7 @@ scripts to be implemented in a small amount of shell code. .Ar argument is searched for in the list of supported commands, which may be one of: -.Bl -tag -width ".Cm restart" -offset indent +.Bl -tag -width "restart" -offset indent .It Cm start Start the service. This should check that the service is to be started as specified by @@ -523,7 +523,7 @@ If or .Va procname is set, also support: -.Bl -tag -width ".Cm restart" -offset indent +.Bl -tag -width "status" -offset indent .It Cm poll Wait for the command to exit. .It Cm status @@ -535,7 +535,7 @@ Other supported commands are listed in the optional variable .Pp .Ar argument may have one of the following prefixes which alters its operation: -.Bl -tag -width ".Li force" -offset indent +.Bl -tag -width "force" -offset indent .It Li fast Skip the check for an existing running process, and sets @@ -579,7 +579,7 @@ but only certain small classes of them. .Ic run_rc_command uses the following shell variables to control its behaviour. Unless otherwise stated, these are optional. -.Bl -tag -width ".Va procname" -offset indent +.Bl -tag -width "procname" -offset indent .It Va name The name of this script. This is not optional. @@ -876,7 +876,7 @@ if .Ar argument Ns Va _cmd is not defined, then a default method is provided by .Ic run_rc_command : -.Bl -tag -width ".Sy Argument" -offset indent +.Bl -tag -width "Argument" -offset indent .It Sy Argument .Sy Default method .It Cm start @@ -945,7 +945,7 @@ The following variables are available to the methods as well as after .Ic run_rc_command has completed: -.Bl -tag -width ".Va rc_service" -offset indent +.Bl -tag -width "rc_service" -offset indent .It Va rc_arg Argument provided to .Ic run_rc_command , @@ -1173,7 +1173,7 @@ and then .Ar message . .El .Sh FILES -.Bl -tag -width ".Pa /etc/rc.subr" -compact +.Bl -tag -width "/etc/rc.subr" -compact .It Pa /etc/rc.subr The .Nm From nobody Sun Sep 22 18:26:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBZN14yyCz5XB8c; Sun, 22 Sep 2024 18:26: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 4XBZN11zCdz4Z7h; Sun, 22 Sep 2024 18:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727029617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aqnKKFMk1L4IPc5e/twdv75Q7QJ3+2cuSoM6vspKwZs=; b=rL8UWKnnxBMNjq0+G+R3yiYwMTVKHKDNJPXc/V7CjRN3ncfWNYPyucEQmQGBceJqWKrnIf w9so5wIF2cJLoCWmzoqkWItMe9sTi6Y1sbhUzQV7Ez5PWlBTlWPmy7BN2X/UVBfInokIEX I5Fu0xdMN7OGJF6Pc0P6YA57HINm1BVYweOrRHUUXRUEq5Hjws1JTF5wSVICc9zoYaUbPP AWWP4s19OCyxZc1KJe6enRSME4LHEMcDZcaNyiWHB1ZCCO1+VM6f66njpdrX5QjPncmG2A ESzfSD4n8OiY3u1Y82pViilnw5CMRN4DACPJs5hfJMj8f8s8B74fVIkTqO4P9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727029617; a=rsa-sha256; cv=none; b=BPOFRH+WWRQRBxZ343ew8uqzMt1Lai/UcPmPzN8Dw/ocd+eTV5LDH6Id35rrc6KBKo4OHY kAfozbsJSMB0ULX/usp09/k7C9joatBQ37uISNu+RypJKGVZx8D5D82itWoSDIkI/m9zUe Ijz7Yts87D3OlExqY+WlxMpzPU5akOjwkHIu4iheFr976CmWWTQwqO/SWYzFe+3XDleOgi abOQF0jbdTEDGxpnOB5Fcn5Y3jYvpHlqcCxAWPQHt0MglXf5UcE78apg5kUsn0w826gLKV NfEzQGi9QnRtOFhBU/06JH9iGLNd2rhgvy3P/tg8j5Puo0L2YnmtR5w/ms/G+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=1727029617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aqnKKFMk1L4IPc5e/twdv75Q7QJ3+2cuSoM6vspKwZs=; b=gDgtFV5jq6hN3GYIDMv0be8DIiuxIJW88jRaUobQ5darqeNn8pqxJOFCx5/oXJJvnIefeK Y/Yd7ltazOtsW764UZ1Ot8KVryXVf9eeV181GLpBdGLRTPnLJn28pqVYa9JmSLwQ3nx9xJ EOU2T+G5hU1Ok0gkWeKPqIolipeR2WTQiYSEJs8UfkvfdlNlmm7gYm9MRX6vvcgtAJobKP o18n5gHdW/pevMFnlodhiSqMiZGtPWBMGk13CNYGFP16mvGlgU+9V+0TADyerUdA0Lq5nC SWFp6O22w2A85PgWO1ZsCYWTcLJMl9sC3RsU9mV87aNJ8h7wMV63lM1lVhYS+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBZN11ZPdz1R4d; Sun, 22 Sep 2024 18:26: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 48MIQvvZ004603; Sun, 22 Sep 2024 18:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MIQvID004599; Sun, 22 Sep 2024 18:26:57 GMT (envelope-from git) Date: Sun, 22 Sep 2024 18:26:57 GMT Message-Id: <202409221826.48MIQvID004599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6e414739fc95 - main - rc.subr.8: Fix the Bl macro of a list which is actually a table List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e414739fc95663836a5a10a8cf13e0211fd5efc Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=6e414739fc95663836a5a10a8cf13e0211fd5efc commit 6e414739fc95663836a5a10a8cf13e0211fd5efc Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-09-22 18:21:17 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-09-22 18:25:11 +0000 rc.subr.8: Fix the Bl macro of a list which is actually a table MFC after: 2 weeks --- share/man/man8/rc.subr.8 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8 index 549a4343a72a..b37d25e78840 100644 --- a/share/man/man8/rc.subr.8 +++ b/share/man/man8/rc.subr.8 @@ -876,17 +876,16 @@ if .Ar argument Ns Va _cmd is not defined, then a default method is provided by .Ic run_rc_command : -.Bl -tag -width "Argument" -offset indent -.It Sy Argument -.Sy Default method -.It Cm start +.Bl -column "Argument" "Default Method" -offset indent +.It Sy Argument Ta Sy Default method +.It Cm start Ta If .Va command is not running and .Ic checkyesno Va rcvar succeeds, start .Va command . -.It Cm stop +.It Cm stop Ta Determine the PIDs of .Va command with @@ -898,7 +897,7 @@ or those PIDs, and run .Ic wait_for_pids on those PIDs. -.It Cm reload +.It Cm reload Ta Similar to .Cm stop , except that it uses @@ -915,21 +914,21 @@ It can be enabled via if appropriate: .Pp .Dl "extra_commands=reload" -.It Cm restart +.It Cm restart Ta Runs the .Cm stop method, then the .Cm start method. -.It Cm status +.It Cm status Ta Show the PID of .Va command , or some other script specific status operation. -.It Cm poll +.It Cm poll Ta Wait for .Va command to exit. -.It Cm rcvar +.It Cm rcvar Ta Display which .Xr rc.conf 5 variable is used (if any).