From nobody Mon Jan 16 06:28:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwMXW2Y6tz2sry5; Mon, 16 Jan 2023 06:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwMXW24jDz3Npx; Mon, 16 Jan 2023 06:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673850491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mqx80z1SF2ih1icBtw2avMHYM9DiluxGR2uuFIesj18=; b=jsJi6M5GHX93cDe95oGOXe1ONyiFopAX0P5jkemvQDGVuD6fMJ0TJedReFP+s1LIY2ZNMG b8FDeZcKftnCCNE+4WEwvuGpduJACXE6e0fNCe99WeiFwmnTbx/aTwGQCxnPo8CWb/BCwa P73P8Z9yucVSKrRyzRdKf/+3vlfM0aFITX/9/xlKvvWcwdu0v4rc0jpTVEA0gcU6l8jvKU MlRTLmqXqlf+Vgx93xKSubbT8n7BqzVMh8bcfxqE0/6yjvjn+H1Qhvqj4UcbA/j3cvG7PX KdZ1jmf+KVZR6EVAzDddM8dqNU+2fkr9KyzSF/fJ5d2hTdeOLHHLKxejWoUF1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673850491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mqx80z1SF2ih1icBtw2avMHYM9DiluxGR2uuFIesj18=; b=nRhkwarMsSwclxG/3tgGjLrJPdah/7mvnuvs7rlqwmOXMdfthbwSkXRpUlg5mhPrNVIfgt uZi1NXTXBYDftGtZPDp5y5+ZBy2UqY0vTZxb91TCvO79r7HRAlJBF3iP1IkQALo4e0lNqb KkoIMEfIYD7zqTWLlzvrnmRgNT24arw7wg9kKaHn303H6TAq8OHLTj7F6iCIakBmfY12JU c/0h9I5NKBXdBSRShaXF++eR0NjGvcUX6goslka4eAJHuByOZLGmmgqiYkqGthKU5cA3sX XKOxQz8adMKKUiKC3XhxY9s6REgaSj5ybTj9vrsTVotKEGUlVTC4obau3Dgsfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673850491; a=rsa-sha256; cv=none; b=Zk/Ja/6xsvSL6dFDpAvQswhKN4H8Y18QwMrp4V7jyC1GnkmVEncE9E6FPKtxnYp5/FScif Jzf8rnh1NV9gg95VHqomfr9nQ/jtW5bI8GO3ynASWsbaOn0L/5JqVkwWYZndNBz+/2suK+ nQ6AnKEq1fyL9EGrd8MlMpqHeAFwWiKLyZTzEpKDml8stSJwx0XH1KCqtQedKbRG/G2JJl bsh5sJLxZwl9WCU+8Bpy4dkcMomBCEmZv//o4jdkuAWtt0biYzm8dPVMjSRUGR/Frjfvrr PHzL0nqoMrNBMQ6UyJOxWfrF7Nw12+ngWJvYUp8KPDax1HyUjgQWyr1QNE0dDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwMXW13cjzx96; Mon, 16 Jan 2023 06:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30G6SBuO047260; Mon, 16 Jan 2023 06:28:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30G6SBDY047259; Mon, 16 Jan 2023 06:28:11 GMT (envelope-from git) Date: Mon, 16 Jan 2023 06:28:11 GMT Message-Id: <202301160628.30G6SBDY047259@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: 1a27768e01ec - stable/12 - iwmbtfw(8): Fix a typo in a kernel message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 1a27768e01ecdec7f5e556c6d284564904d2e230 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1a27768e01ecdec7f5e556c6d284564904d2e230 commit 1a27768e01ecdec7f5e556c6d284564904d2e230 Author: Gordon Bergling AuthorDate: 2023-01-11 11:22:18 +0000 Commit: Gordon Bergling CommitDate: 2023-01-16 06:27:45 +0000 iwmbtfw(8): Fix a typo in a kernel message - s/succesful/successful/ (cherry picked from commit 40bb52c89b87c1417be5ded6808bd674d512900e) --- usr.sbin/bluetooth/iwmbtfw/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 202894740805..eb1d97a9bb00 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -572,7 +572,7 @@ shutdown: libusb_exit(ctx); if (retcode == 0) - iwmbt_info("Firmware download is succesful!"); + iwmbt_info("Firmware download is successful!"); else iwmbt_err("Firmware download failed!"); From nobody Mon Jan 16 10:37:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwT4J2hHwz2p1n5; Mon, 16 Jan 2023 10:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwT4J1zRxz3trV; Mon, 16 Jan 2023 10:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673865456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GkkBTmg9v4uXfN5V+pDhxM24lkgjMPoqa38eivqz9ac=; b=Y9+COVWfs5i/AUPVWLxMvTwRi6QafxcrFJ455RkcDM1naRiCmsl9v67BG2QKTdBt8sjFOl pSsTDam6ykuq4IVlSkWfNkWmwx+b/4gip0x5JmBmy9e8Bb/STgby5D53xf2LRegbSOumBG Qb8h4ciTIYZLEdcuzXsMA0R6e4xMz4AiiKTklROHWmzm1e7usNLW5u02dCdHbO4TsxH4Z0 RqmkjKkJIYkffEDQNzup4+uSaByd7R+l51S+JkAv05cbWtx+EYlA2nR9hDg8FzGEAdx3r+ 1i7rkRyhiXocIFaPp5B8fjqe5K2NFPVHo7uku5nWaC0XOaUWD15+Xu0QkAGENQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673865456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GkkBTmg9v4uXfN5V+pDhxM24lkgjMPoqa38eivqz9ac=; b=nJVS0hO8BdTHxLTfXaVeWa4AAwhZiWSRyNs2/F8uK1rssjB3HPbsFQDnGbigh5cZM4EnXO YAWLYFf+Yd71B+naAAczlMo2iBF3N7rg+adc4wfNQst6dlvUbCDHPjAog4d7ds6danU1vY fuBkquATEBfnRMFNkKm+4n8WwB5DbbitMe5dGuvKbO2vWtJ1BUMMVbI9pF9MX3KC4pnzMI tAJ+fl0nl/wreR2+xznu+Tc1n55oviGd1M06mcXhG+QETmLjc1fEaTGaYNVe7CAHdzHRuY 5KyDa7nsiLj3sg8RCMKldSaWsmQvaKfQb6VY9Ygs+RNUerWcAwvKQENC7XbNWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673865456; a=rsa-sha256; cv=none; b=hwyshvm6Fb0dJ2VQgfdun8/KYjnCypY/pQVndGeh0Ri8+0RclgZKEIhMkYOaMNmid6izsw ij59qW9ppBsgEkISZruJgxuAPge/kXF/P6XzJD0d6AEM49IFzPdGIlA6+dfTDAVZHXpanH 62OnIAhRRN3NL75WyzZSYY3gl975rF97Dbm0HJFJgr1qq33aSofMrYRxMURnpVuGeQZE9b /PMk6cpwc83Z35KihcnlUlSkLWD/JJa/+SxHE8C9K2i1q9JYVskkwqSKDI1V194mUFgGJ9 GzaW+Jq2T86f4GGdEAFUmJUrf/XWeAykEvuO9+ulZtUPwCDj8/dexZSt6hLt0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwT4J10xwz140y; Mon, 16 Jan 2023 10:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GAbaSG006054; Mon, 16 Jan 2023 10:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GAba9C006053; Mon, 16 Jan 2023 10:37:36 GMT (envelope-from git) Date: Mon, 16 Jan 2023 10:37:36 GMT Message-Id: <202301161037.30GAba9C006053@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: ddcdb534b766 - main - pf tests: properly destroy renamed interfaces List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ddcdb534b7669f186184baf164e7647d544f7bd6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ddcdb534b7669f186184baf164e7647d544f7bd6 commit ddcdb534b7669f186184baf164e7647d544f7bd6 Author: Kajetan Staszkiewicz AuthorDate: 2023-01-16 06:19:41 +0000 Commit: Kristof Provost CommitDate: 2023-01-16 06:23:07 +0000 pf tests: properly destroy renamed interfaces The pfsync:pbr tests leaves lot of interfaces when they finish, making other tests slower due to long time of loading scapy from pft_ping.py when more interfaces are present. When both sides of epair are assigned to jails, they are both removed from created_interfaces.lst and thus won't be removed during cleanup from this file. An interface assigned to jail is stored in created_jails.lst but if it is renamed, it won't be cleaned up either. Furthermore this test uses identical names for multiple interfaces across multiple jails which after destroying those jails adds to overall confusion. To address this issue a new function is provided for renaming interfaces in jails and storing their new names in created_jails.lst for deletion during cleanup. MFC after: 1 week Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D38024 --- tests/sys/common/vnet.subr | 10 ++++++ tests/sys/netpfil/pf/pfsync.sh | 77 ++++++++++++------------------------------ 2 files changed, 31 insertions(+), 56 deletions(-) diff --git a/tests/sys/common/vnet.subr b/tests/sys/common/vnet.subr index cdd3d3f69709..50abadaec81d 100644 --- a/tests/sys/common/vnet.subr +++ b/tests/sys/common/vnet.subr @@ -73,6 +73,16 @@ vnet_ifmove() sed -i "" "/^${jailname}/s/\$/ ${ifname}/" created_jails.lst } +vnet_ifrename_jail() +{ + jailname=$1 + ifname=$2 + ifnewname=$3 + + jexec ${jailname} ifconfig $ifname name $ifnewname + sed -i "" "/^${jailname}/s/${ifname}/${ifnewname}/" created_jails.lst +} + vnet_cleanup() { if [ -f created_jails.lst ]; then diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh index 83e77534a024..75b37516762f 100644 --- a/tests/sys/netpfil/pf/pfsync.sh +++ b/tests/sys/netpfil/pf/pfsync.sh @@ -417,12 +417,11 @@ pbr_common_body() alias 198.18.1.10/32 vhid 11 pass 3WjvVVw7 advskew 50 jexec gw_route_to_master sysctl net.inet.ip.forwarding=1 jexec gw_route_to_master sysctl net.inet.carp.preempt=1 - jexec gw_route_to_master ifconfig ${epair_sync_gw_route_to}a name if_pfsync - sed -i '' -e 's/'${epair_sync_gw_route_to}'a/if_pfsync/g' created_interfaces.lst - jexec gw_route_to_master ifconfig ${epair_gw_route_to_master_bridge0}a name if_br0 - sed -i '' -e 's/'${epair_gw_route_to_master_bridge0}'a/if_br0/g' created_interfaces.lst - jexec gw_route_to_master ifconfig ${epair_gw_route_to_master_bridge1}a name if_br1 - sed -i '' -e 's/'${epair_gw_route_to_master_bridge1}'a/if_br1/g' created_interfaces.lst + + vnet_ifrename_jail gw_route_to_master ${epair_sync_gw_route_to}a if_pfsync + vnet_ifrename_jail gw_route_to_master ${epair_gw_route_to_master_bridge0}a if_br0 + vnet_ifrename_jail gw_route_to_master ${epair_gw_route_to_master_bridge1}a if_br1 + jexec gw_route_to_master ifconfig pfsync0 \ syncpeer 198.19.10.2 \ syncdev if_pfsync \ @@ -451,12 +450,11 @@ pbr_common_body() alias 198.18.1.10/32 vhid 11 pass 3WjvVVw7 advskew 100 jexec gw_route_to_backup sysctl net.inet.ip.forwarding=1 jexec gw_route_to_backup sysctl net.inet.carp.preempt=1 - jexec gw_route_to_backup ifconfig ${epair_sync_gw_route_to}b name if_pfsync - sed -i '' -e 's/'${epair_sync_gw_route_to}'b/if_pfsync/g' created_interfaces.lst - jexec gw_route_to_backup ifconfig ${epair_gw_route_to_backup_bridge0}a name if_br0 - sed -i '' -e 's/'${epair_gw_route_to_backup_bridge0}'a/if_br0/g' created_interfaces.lst - jexec gw_route_to_backup ifconfig ${epair_gw_route_to_backup_bridge1}a name if_br1 - sed -i '' -e 's/'${epair_gw_route_to_backup_bridge1}'a/if_br1/g' created_interfaces.lst + + vnet_ifrename_jail gw_route_to_backup ${epair_sync_gw_route_to}b if_pfsync + vnet_ifrename_jail gw_route_to_backup ${epair_gw_route_to_backup_bridge0}a if_br0 + vnet_ifrename_jail gw_route_to_backup ${epair_gw_route_to_backup_bridge1}a if_br1 + jexec gw_route_to_backup ifconfig pfsync0 \ syncpeer 198.19.10.1 \ syncdev if_pfsync \ @@ -484,12 +482,11 @@ pbr_common_body() alias 198.18.2.20/32 vhid 22 pass 3WjvVVw7 advskew 50 jexec gw_reply_to_master sysctl net.inet.ip.forwarding=1 jexec gw_reply_to_master sysctl net.inet.carp.preempt=1 - jexec gw_reply_to_master ifconfig ${epair_sync_gw_reply_to}a name if_pfsync - sed -i '' -e 's/'${epair_sync_gw_reply_to}'a/if_pfsync/g' created_interfaces.lst - jexec gw_reply_to_master ifconfig ${epair_gw_reply_to_master_bridge1}a name if_br1 - sed -i '' -e 's/'${epair_gw_reply_to_master_bridge1}'a/if_br1/g' created_interfaces.lst - jexec gw_reply_to_master ifconfig ${epair_gw_reply_to_master_bridge2}a name if_br2 - sed -i '' -e 's/'${epair_gw_reply_to_master_bridge2}'a/if_br2/g' created_interfaces.lst + + vnet_ifrename_jail gw_reply_to_master ${epair_sync_gw_reply_to}a if_pfsync + vnet_ifrename_jail gw_reply_to_master ${epair_gw_reply_to_master_bridge1}a if_br1 + vnet_ifrename_jail gw_reply_to_master ${epair_gw_reply_to_master_bridge2}a if_br2 + jexec gw_reply_to_master ifconfig pfsync0 \ syncpeer 198.19.20.2 \ syncdev if_pfsync \ @@ -517,12 +514,11 @@ pbr_common_body() alias 198.18.2.20/32 vhid 22 pass 3WjvVVw7 advskew 100 jexec gw_reply_to_backup sysctl net.inet.ip.forwarding=1 jexec gw_reply_to_backup sysctl net.inet.carp.preempt=1 - jexec gw_reply_to_backup ifconfig ${epair_sync_gw_reply_to}b name if_pfsync - sed -i '' -e 's/'${epair_sync_gw_reply_to}'b/if_pfsync/g' created_interfaces.lst - jexec gw_reply_to_backup ifconfig ${epair_gw_reply_to_backup_bridge1}a name if_br1 - sed -i '' -e 's/'${epair_gw_reply_to_backup_bridge1}'a/if_br1/g' created_interfaces.lst - jexec gw_reply_to_backup ifconfig ${epair_gw_reply_to_backup_bridge2}a name if_br2 - sed -i '' -e 's/'${epair_gw_reply_to_backup_bridge2}'a/if_br2/g' created_interfaces.lst + + vnet_ifrename_jail gw_reply_to_backup ${epair_sync_gw_reply_to}b if_pfsync + vnet_ifrename_jail gw_reply_to_backup ${epair_gw_reply_to_backup_bridge1}a if_br1 + vnet_ifrename_jail gw_reply_to_backup ${epair_gw_reply_to_backup_bridge2}a if_br2 + jexec gw_reply_to_backup ifconfig pfsync0 \ syncpeer 198.19.20.1 \ syncdev if_pfsync \ @@ -584,43 +580,12 @@ pbr_common_body() sleep 1 done - # As cleanup is long and may lead to a timeout, - # it's run directly into the body part. - # (as cleanup timeout is not settable) - jail -r \ - client \ - gw_route_to_master \ - gw_route_to_backup \ - gw_reply_to_master \ - gw_reply_to_backup \ - server - for ifname in $(grep -E -e 'if_' -e 'epair.*a' -e 'bridge' created_interfaces.lst) - do - ifconfig $ifname >/dev/null 2>&1 && ifconfig $ifname destroy - done - atf_check -s exit:0 -e ignore -o ignore grep ', 0.0% packet loss' ping.stdout } pbr_common_cleanup() { - for jailname in client gw_route_to_master gw_route_to_backup gw_reply_to_master gw_reply_to_backup server - do - if $(jls | grep -q $jailname); then - jail -r $jailname - else - echo "$jailname already cleaned" - fi - done - for ifname in $(grep -E -e 'if_' -e 'epair.*a' -e 'bridge' created_interfaces.lst) - do - ifconfig $ifname >/dev/null 2>&1 - if [ "$?" -eq "0" ]; then - ifconfig $ifname destroy - else - echo "$ifname already destroyed" - fi - done + pft_cleanup } atf_init_test_cases() From nobody Mon Jan 16 10:38:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwT4n3gQDz2p1qb for ; Mon, 16 Jan 2023 10:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwT4n3B93z3v1j; Mon, 16 Jan 2023 10:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673865481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VUatgVAZpJQZ2/hvRj6xfS7FTdwCH5kEi/+cJK/MtCM=; b=SDXeIhQCu9KXdBIQF4oFpwYKa0TeD2n2MG73EDI/iULKwEVQaCFAAGIM70OTdP7xqkYlq0 gnUmRF5HY4ldzv5nCJY3ZmIfgQHZUKxzHqZTiKwOejHU8FHH5xS/Xi7l1EZCh4qxut6s6P Q052EdGwQddRb1DEwEImXFoQbl+RouStLWz7Gi6oappvyVX0HGLOUQYueePlpbZWzY7/8O e/9t/3gKrqiKNzYtqA3y7kX8D2d/xGwyrkIdMUNbTZJUuRCnandC9whXtYe7QKgn589Jz0 PpOvGyDwsVClRyyVs4vVCuTdf9go2yXxJGhCXgeLmCJsQwrU9SBPOFoJPwqVCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673865481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VUatgVAZpJQZ2/hvRj6xfS7FTdwCH5kEi/+cJK/MtCM=; b=I7r/w65dPi4vPruQNF5ppVSDDCPxM3lCin/4t5mUev54GcA45ZF30hzf0b8oLPwCuiHKdy 7VkPIG9wconjlpkvcldcKcWzKMvvakrZYxRW+FcbW7QdylRbY6QAIZXU6Fai4tHcuzlJwQ T+5vNAYcJ5DeTbjbLr+/HPJg6oRBbbf047Qf2ip7MQqrJRW7JclTeKH7t4h4h3h8R/0NMm 1ZyyRCwSOOMm54j9u6q1d0AxPM76DAt1Q31KzVKQlCluM0unn1fnyiAbjPgQvXuujV2JVj FkUnpAytQ48u13r+Qjon5uVQnPwsTjwa1ipBNkjiB0JcKUwtcjvDg1KowpOV3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673865481; a=rsa-sha256; cv=none; b=PvwqxmQWTQP058KYlHmhdEc3XQswM96ayQ/LgxXKCbZ9mKJv9F1Ve1Ls8M3GmcfHRfGhnV cTosh7dSF901f2mmvkYYzun5t7P8ntrhDwLe/lxtr6FarLEnXHFJjnhExTfDkf/ooZqZr2 l6MFCoMXfyJ8CPyJgCGI1dGwijh0edh2fuFKjeAg8chBo8nstX91TjOH3dKGU5a0LHp11Q M+iYqiiOuYStl0YpP4l7c5BTGlZrcRk+qLrUr5zIZ+MdrWSkc/LXOWdizRqA24Pd8RCzvE D9DEOb726E1whfAmyloOUa6xno3Q1epqkDuIIEmQsA92NhGZOM3RabklPQNchg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwT4n2DrFz13S7; Mon, 16 Jan 2023 10:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GAc1if006202; Mon, 16 Jan 2023 10:38:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GAc1gP006201; Mon, 16 Jan 2023 10:38:01 GMT (envelope-from git) Date: Mon, 16 Jan 2023 10:38:01 GMT Message-Id: <202301161038.30GAc1gP006201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Kristof Provost Subject: git: 27c146407c15 - internal/admin - Release zlei from mentorship List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/internal/admin X-Git-Reftype: branch X-Git-Commit: 27c146407c15e060887a18b8d7cd968e024e9c9e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch internal/admin has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27c146407c15e060887a18b8d7cd968e024e9c9e commit 27c146407c15e060887a18b8d7cd968e024e9c9e Author: Kristof Provost AuthorDate: 2023-01-16 10:22:37 +0000 Commit: Kristof Provost CommitDate: 2023-01-16 10:22:37 +0000 Release zlei from mentorship Approved by: core (implicit) --- mentors | 1 - 1 file changed, 1 deletion(-) diff --git a/mentors b/mentors index f78ca7dd3e4d..a12fb61b002b 100644 --- a/mentors +++ b/mentors @@ -29,4 +29,3 @@ ram ken Co-mentor: mav sam emaste theraven markj wosch cem -zlei kp Co-mentor: melifaro From nobody Mon Jan 16 10:52:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwTNy5zhqz2p3hG; Mon, 16 Jan 2023 10:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwTNy5KdQz3wQw; Mon, 16 Jan 2023 10:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673866322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AmyIM5I1Vac9o+pMFKl2aUbErINnCvn++06QOBUA9lE=; b=P75yPCGPLz4xml6uWGzyMOD/HUvGJ7+hae6WDvKEBrWdnao1JMT98crKQN2WzNTzo1gBYt x9PiibWeUmYL1HPe4GrjA9OFvNNAajIsuo1aDDPcPsPno3TSDvN0ZScvHvj7jJlLGnO3mm XbAlN/Kei2AqbSZPEOR7QbInv30tNhjM63ZJl7DjA+lmkq55a5fMaKVHstjBdTDZOgEQi4 vCqonSkrAnh2SGLodHst7upJ0gGlQwC0LuinuZy06UvGOAqJE9Wn9lFBJj+e90GxNKmUXc Ey1vKLKskZCIhr2J8CbHkzd0aKTNm94XNYDM84SvFINf27tDHe6J6R4Ab5maeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673866322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AmyIM5I1Vac9o+pMFKl2aUbErINnCvn++06QOBUA9lE=; b=gpIE0MSTWDnOwDKIMCdf6yf4xxSvh+XOsvW/nhFwIMurIR7tTzTMrOkPPCuooTAuh7DexN 2jJwGpmZ2p0UDbsu0YYQ0VU2HfUVy38GpU265LHbAuR+a1mscJe3O+7zYZib62N1nFpkJD oFQHgufjrqOh4iHAJ3lJiv5OFq5O0jZ+mbKKkGAmerO65zeHq383GkB57ZZT89/dr+4i7w xeApohrQqD4KkRK6LzGQwZp+2BbzWaRocAXs9Rz6vUGvlIZz+XPWHgXTt+ror0HxWybmxE wESqh/eEHFQSuBFckKgPena/XbFzTNciebuzQmRxHwH5SkNKtCgefpCYwN+Ohw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673866322; a=rsa-sha256; cv=none; b=jJTc1rZT8N5C8XdN3efB8N4Y1gAMwsL3zTNgWGixFQPBs3amTJHBjNHKMbGoMWaP+2gXZJ DoH3brgfuWbdB6LQPAC4j2s7mKgz+G/M0/Bz86yv1nzcox5YdhT5aPqykFN2xY7yYWMfSx SySgmSDcsYLLp5WUwwBfyu/iCSMDepu+4kMGRLxDL8qtjvDU21ifAAQN0O9D6L7IXf2t5d gmP0I1WaS1mzNBMVUg2JrHly73H5r9NV+HpH/054y1S2CNEbNr84CXG4Tj0UUlMJ84ycRv j/b2j0UqAsSiRGDXhPC/hDPfpMkj7o8wq75XVQCYtLi1PAIWhHSZFTmvr1MVow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwTNy466Xz14Jy; Mon, 16 Jan 2023 10:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GAq2Xt033884; Mon, 16 Jan 2023 10:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GAq25f033883; Mon, 16 Jan 2023 10:52:02 GMT (envelope-from git) Date: Mon, 16 Jan 2023 10:52:02 GMT Message-Id: <202301161052.30GAq25f033883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 42904794b804 - main - rtsock: fix socket closure. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42904794b80489678e8a519ba453993232b11171 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=42904794b80489678e8a519ba453993232b11171 commit 42904794b80489678e8a519ba453993232b11171 Author: Alexander V. Chernikov AuthorDate: 2023-01-15 13:40:28 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-16 10:49:45 +0000 rtsock: fix socket closure. Currently `close(2)` erroneously return `EOPNOTSUPP` for `PF_ROUTE` sockets. It happened after making rtsock socket implementation self-contained ( 36b10ac2cd18 ). Rtsock code marks socket as connected in `rts_attach()`. `soclose()` tries to disconnect such socket using `.pr_disconnect` callback. Rtsock does not implement this callback, resulting in the default method being substituted. This default method returns `ENOTSUPP`, failing `soclose()` logic. This diff restores the previous behaviour by adding custom `pr_disconnect()` returning `ENOTCONN`. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D38059 --- sys/net/rtsock.c | 8 +++++ tests/sys/net/routing/Makefile | 1 + tests/sys/net/routing/test_rtsock_ops.c | 56 +++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index a67643e724db..4ae5c9559566 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -446,6 +446,13 @@ rts_detach(struct socket *so) so->so_pcb = NULL; } +static int +rts_disconnect(struct socket *so) +{ + + return (ENOTCONN); +} + static int rts_shutdown(struct socket *so) { @@ -2702,6 +2709,7 @@ static struct protosw routesw = { .pr_detach = rts_detach, .pr_send = rts_send, .pr_shutdown = rts_shutdown, + .pr_disconnect = rts_disconnect, .pr_close = rts_close, }; diff --git a/tests/sys/net/routing/Makefile b/tests/sys/net/routing/Makefile index 45034ff211b1..7bd0b9d863f7 100644 --- a/tests/sys/net/routing/Makefile +++ b/tests/sys/net/routing/Makefile @@ -7,6 +7,7 @@ TESTSDIR= ${TESTSBASE}/sys/net/routing ATF_TESTS_C += test_rtsock_l3 ATF_TESTS_C += test_rtsock_lladdr +ATF_TESTS_C += test_rtsock_ops ATF_TESTS_PYTEST += test_routing_l3.py ATF_TESTS_PYTEST += test_rtsock_multipath.py diff --git a/tests/sys/net/routing/test_rtsock_ops.c b/tests/sys/net/routing/test_rtsock_ops.c new file mode 100644 index 000000000000..111b9edf4057 --- /dev/null +++ b/tests/sys/net/routing/test_rtsock_ops.c @@ -0,0 +1,56 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2023 Alexander V. Chernikov + * + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +ATF_TC(socket_rtsock_openclose); +ATF_TC_HEAD(socket_rtsock_openclose, tc) +{ + atf_tc_set_md_var(tc, "descr", "test successful open/close"); +} + +ATF_TC_BODY(socket_rtsock_openclose, tc) +{ + int s = socket(PF_ROUTE, SOCK_RAW, 0); + ATF_CHECK(s >= 0); + ATF_CHECK_ERRNO(0, close(s) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, socket_rtsock_openclose); + + return (atf_no_error()); +} From nobody Mon Jan 16 10:57:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwTW144h2z2p4N1; Mon, 16 Jan 2023 10:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwTW13XmTz3xjW; Mon, 16 Jan 2023 10:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673866637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzB2yqYhx1Ls0x0dClibp9n0PnFGTfuK2ebPmAQAAGs=; b=ptQd66HOZHdwky3jJbE2AA2OtqVsa26P7bStyfHdVOK6mtD6X7ZwluFhRgjbZghi3m7TuS /soku8bWE3JqI7oibLT4FqEInioJVqN83IIXBJ4kynzfS++WwdOlgysW694MaTMD+5IoTY 7KrksyPpKB7wZuwx1tzKAyRujr5X2zc0zYuaaiBe2+QegwKreESP0U3ORXD+ucH8KVkEbS tY0Ba2RW1mWq2lJ+7ttQnzPd39VcpGENKb0QParCiArZT/1yL05K4d47YfkuuPRA9fCfe+ yvv0W3Aa/+Gu3aVkzHSz4lXCVgqyfzGAHpjaGrsoni7Th4PVK/Ux7nz69HxyQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673866637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzB2yqYhx1Ls0x0dClibp9n0PnFGTfuK2ebPmAQAAGs=; b=dgWI5eMgx+ieJZw5imi3uAcvZil+6k9FVzN7VXF9hcIVpe2a+Uz9/tNEIhfFTFXm5bMoae TyjuQCIC/30J6U1cdvb76NnYFCI8AgzBuVX34uCVVuCuNvZBPbnl7Fw278nsCVBXJqx82V 9YTSwmRQo30nEl8294y8LI7/063TyoPQGLu9kgs01pmtR4jFNlAPUYXKUL/vSZguxJspna b4DYuvgxxB5tt2S1ieeP9w64IGqBqATS5fX7kJIHq2sZIWnTj/UZ/6Aqt4CycYk2BWegyG 0Y81a/3tTSc7hIQkS0FjOxouyCKH0OLBiZFjG3a2mUzArgpON6OqQc7Xd6kg9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673866637; a=rsa-sha256; cv=none; b=O1KD7/4pMRbNwB6k6n7pxrLwKS05ZoGRcV+OR07QaQafbE/VZG2pOl+cU53+o2OpVrl+hP fF2kb3IDQYGSzbgJ6qfFNC6VRrIckp2CKZR808LlEkBHEKan3kUgLJInswznJwnheJmjIB JRzgxMrQ0i9rS2ZgbeqLAm/h5kiTDA6BYdzlswdt7C9ZpAkCmqNCLM3iMZING8H6K+o5k7 RP7A7RiAhEH4LNNbbMSy0R32VK2rXDsSahjb4R69IXbKCrANwmh/n7wAL5J39i56sDTybR teDCZjnYzAmuzxpiDB7PyOQyhLrHZVLQDtu7VunfWGtp9YxT1BrweA2yTtO9SQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwTW12b13z149k; Mon, 16 Jan 2023 10:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GAvHRx034708; Mon, 16 Jan 2023 10:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GAvHR3034707; Mon, 16 Jan 2023 10:57:17 GMT (envelope-from git) Date: Mon, 16 Jan 2023 10:57:17 GMT Message-Id: <202301161057.30GAvHR3034707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a8633361ab71 - main - netlink: fix typo in netlink(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8633361ab71fda3860f6b4ed1a602f9b52b36b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a8633361ab71fda3860f6b4ed1a602f9b52b36b8 commit a8633361ab71fda3860f6b4ed1a602f9b52b36b8 Author: Alexander V. Chernikov AuthorDate: 2023-01-16 10:56:10 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-16 10:56:10 +0000 netlink: fix typo in netlink(4) Reported by: Ihor Antonov --- share/man/man4/netlink.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/netlink.4 b/share/man/man4/netlink.4 index bbfa55049e2e..2aa4903a4594 100644 --- a/share/man/man4/netlink.4 +++ b/share/man/man4/netlink.4 @@ -328,7 +328,7 @@ or . .El .Sh SEE ALSO -.Xr genetrlink 4 , +.Xr genetlink 4 , .Xr rtnetlink 4 .Rs .%A "J. Salim" From nobody Mon Jan 16 12:22:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwWNy24Vpz2sFxS; Mon, 16 Jan 2023 12:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwWNy1cQ4z457x; Mon, 16 Jan 2023 12:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673871730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DDzgTtU7tmTTkoO6ujOyWWHSY2erLZB3HBBatD+xb4=; b=nKxyfKfM5pM7tsQZNyxW4OwTKbmFkG7L+gbSVfMIrHKd9N5jp1w8NY5LoNL+KNWtvHCR70 11jj271gMwDosOYvy6BBntSEZRgmO3Db5AySsPipKq5qBEvOllENE9dUO/oG3m3BEJUuIY dD+pfabmShAVxxV41Kkie4wZk/j8vzcivLs7X1MXMG2oV6kq80IV/ZfMKwybaKlsRItmqa 6pgQ1fbBtLvJ9iI9kTuD2OlwZwd0VpTHHrkMjHcLD8+syXTSDu224FiqtAgx2hRnTpRpta 4NQ4RtYfOczAkLCrIlOu0dkxgbhrptDU5zOyU8F3w+LZWLaI4rd1mmheXvRUsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673871730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DDzgTtU7tmTTkoO6ujOyWWHSY2erLZB3HBBatD+xb4=; b=PpX5esJSpHGtn4GNyvnGF8StBnDvvV7mcdanX2zF0eLjJzvyTQ+wCCQz1rnlGM7FiMeV0r qJiLlminWB8+nyQBr2poTEfrXu3pVGXm7ansU2W2spea6Ng45nhpYFHfF5JPWK47KJEXul s+A1agnMAUlfRpsuP5qB9czIQQGmSvWqkCtOLAH45rZB2a05Cxx9LiAXmPMBr+tWu97Nqp XL8GGvWLHSvA5scXnHkxQ0PqWncbKzgfp7xdKkwlgHczhd2sihL5RYRO2wryaXF9D/O9P/ o0osh5IREXiezJbuNTJUHoeN48dbKrYxv9cTdfR8O91eLMmaSFLhEUAi5CYBnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673871730; a=rsa-sha256; cv=none; b=KcZ3UF45PGwFZ4dTL8MPG+KkUd1OLgw4h2Rgxf7WvhQnZ7x+FvTQ/OUa3gKX3A/W2BqM7M GHBszGOUE1s3a/NgG3cA7rB0bX4d497j8FeNs/97wRfZPGpFN/VfqNKOnZLNG2XN4BGrvg sBMJdQW/a3HTi2efKrDuUgiewwFSFJvn9oKDbTPhGNQCtWNSzaney2HJcqAhJhVezCKyNE BP2IZzqOOzOC2HzuSjJNMihBIXDwOaGNWOHtBDqk6M3Bl/w8UOAj/h5gMwvp/XM7mg43zi /jQPLuarAF7RN6aeD0fWi57lNUpz3ZrFJJ6d8vefIsYuKaixavzQNxVRH40k/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 4NwWNy0fkMz16C5; Mon, 16 Jan 2023 12:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GCM9Xg063275; Mon, 16 Jan 2023 12:22:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GCM9pm063274; Mon, 16 Jan 2023 12:22:09 GMT (envelope-from git) Date: Mon, 16 Jan 2023 12:22:09 GMT Message-Id: <202301161222.30GCM9pm063274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 228c632ab3f6 - main - netlink: fix compatibility with older netlink applications. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 228c632ab3f6245df4a08d8692d49c8e12aacc27 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=228c632ab3f6245df4a08d8692d49c8e12aacc27 commit 228c632ab3f6245df4a08d8692d49c8e12aacc27 Author: Alexander V. Chernikov AuthorDate: 2023-01-16 12:14:35 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-16 12:21:40 +0000 netlink: fix compatibility with older netlink applications. Some apps try to provide only the non-zero part of the required message header instead of the full one. It happens when fetching routes or interface addresses, where the first header byte is the family. This behavior is "illegal" under the "strict" Netlink socket option, however there are many applications out there doing things in the "old" way. Support this usecase by copying the provided bytes into the temporary zero-filled header and running the parser on this header instead. Reported by: Goran Mekić --- sys/netlink/netlink_message_parser.h | 16 +++++++++++++--- tests/sys/netlink/test_rtnl_ifaddr.py | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/sys/netlink/netlink_message_parser.h b/sys/netlink/netlink_message_parser.h index 96fd1c7337b7..3f64c1967f09 100644 --- a/sys/netlink/netlink_message_parser.h +++ b/sys/netlink/netlink_message_parser.h @@ -213,9 +213,19 @@ nl_parse_header(void *hdr, int len, const struct nlhdr_parser *parser, int error; if (__predict_false(len < parser->nl_hdr_off)) { - nlmsg_report_err_msg(npt, "header too short: expected %d, got %d", - parser->nl_hdr_off, len); - return (EINVAL); + if (npt->strict) { + nlmsg_report_err_msg(npt, "header too short: expected %d, got %d", + parser->nl_hdr_off, len); + return (EINVAL); + } + + /* Compat with older applications: pretend there's a full header */ + void *tmp_hdr = npt_alloc(npt, parser->nl_hdr_off); + if (tmp_hdr == NULL) + return (EINVAL); + memcpy(tmp_hdr, hdr, len); + hdr = tmp_hdr; + len = parser->nl_hdr_off; } if (npt->strict && parser->sp != NULL && !parser->sp(hdr, npt)) diff --git a/tests/sys/netlink/test_rtnl_ifaddr.py b/tests/sys/netlink/test_rtnl_ifaddr.py index bd1c55e268e7..ec349fcd6fde 100644 --- a/tests/sys/netlink/test_rtnl_ifaddr.py +++ b/tests/sys/netlink/test_rtnl_ifaddr.py @@ -8,6 +8,7 @@ from atf_python.sys.net.netlink import NetlinkTestTemplate from atf_python.sys.net.netlink import NlConst from atf_python.sys.net.netlink import NlHelper from atf_python.sys.net.netlink import NlmBaseFlags +from atf_python.sys.net.netlink import Nlmsghdr from atf_python.sys.net.netlink import NlMsgType from atf_python.sys.net.netlink import NlRtMsgType from atf_python.sys.net.netlink import Nlsock @@ -68,6 +69,25 @@ class TestRtNlIfaddr(NetlinkTestTemplate, SingleVnetTestTemplate): assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6]) == 2 assert len(ret) == 3 + def test_46_filter_family_compat(self): + """Tests that family filtering works with the stripped header""" + + hdr = Nlmsghdr( + nlmsg_len=17, + nlmsg_type=NlRtMsgType.RTM_GETADDR.value, + nlmsg_flags=NlmBaseFlags.NLM_F_ACK.value | NlmBaseFlags.NLM_F_REQUEST.value, + nlmsg_seq=self.helper.get_seq() + ) + data = bytes(hdr) + struct.pack("@B", socket.AF_INET) + self.nlsock.write_data(data) + + ret = [] + for rx_msg in self.read_msg_list(hdr.nlmsg_seq, NlRtMsgType.RTM_NEWADDR): + ifname = socket.if_indextoname(rx_msg.base_hdr.ifa_index) + family = rx_msg.base_hdr.ifa_family + ret.append((ifname, family, rx_msg)) + assert len(ret) == 2 + def filter_iface_family(self, family, num_items): """Tests that listing outputs IPv4 for the specific interface""" epair_ifname = self.vnet.iface_alias_map["if1"].name From nobody Mon Jan 16 13:05:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwXLX6MX6z2sLYT; Mon, 16 Jan 2023 13:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwXLX5stYz4CVB; Mon, 16 Jan 2023 13:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673874308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llF364LaIMdpOyl5I1nEpDmsDbzzA1foApCUxWfbEiw=; b=GLLwq0PdCFIkIDKdywt3coZzkiDVrz8QJ4AA0q3qC3PfaaosZzfl0WyhBR2g/mbbIJ6aGL hqIVz2LQk2Q3dPZ6ZtRPbbXUUxqyUsOHRlMmQ7aEdoGlg5gSKPPB4bF1xXr/0YpBdFry9D t5oQl7ZXqQNWFSXoSJerL/r2qxLG3cGOGA0LNz9JLNBJbGNhvV4OCSiQT/uMNwZq00HG5v krW0uCoebILyxLVb9mOyiF/NqyRmu9ePDKXQCJMH+K9L7oeKQgksjwGrqzuiYhi34SQLwp 97GyMFLVkYdWqNhir8CP595CnYMK8PmH9OS8vmxAViGLQNfW+asPSFNl/aExeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673874308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llF364LaIMdpOyl5I1nEpDmsDbzzA1foApCUxWfbEiw=; b=nyVGdINVzLkGpREW+a2csP2i5KVngwrQ1US8FHB2bgcaEYf9rrGAw4EuonvcnLiqzhL6wy QsynDFGeTZcJI97ghl2L2B+qCaHgEKD7ECBkwidHiv4b/sF0wqVHu/s4xtahTOdPOMeU+P Fakzy+epEiT8GTGYF+shjXRvrPGVEoPjmjO6aonqyn/8bpm7VykrJ4o/l3FunTKar5jSuJ sTPaQ+y/KH41uSsD1YxKhg+wqcAJ8Vl3CBHkwz2ewvCM27wLN6xYxyvcUoMQjPKynsW2KY N6zXWT4GwV0VuPqkNUdqm/DBbENlNZy2dUaB6sJvW4Z/Gld5fgmEzaPY510xaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673874308; a=rsa-sha256; cv=none; b=uIEkZsL5t8+gL7dDomGo65oNfqOPQM+FYdbAlw01GIPLcjCw0XmfbghUN4vUCxilJxsOIi 39fxvYv3evDgI6WYqG08Rau2FC/witq4CmISLYUUffj63967uHoAQBw0A3umi8mMuTva8q MZq9WjunI9sJRxJh4LQvzCqg05WTGby9b+cKOGNp4NG7eNPhFfPubBh8x3KsqvB90xx82W ZesD+Glq/Ln7Fclu8lIA+4W8DjeRsLPTF2zS4yvH5Z3MzIUrg0aRmDYtUduycNTixAg6qS t0LrKp1N1tK3GRYI+kGvAGbQpqfv2X4VDQHrYMwab/KYijpm6XwizA7IMKg6eA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwXLX4wS2z17T1; Mon, 16 Jan 2023 13:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GD58gc021172; Mon, 16 Jan 2023 13:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GD58iV021171; Mon, 16 Jan 2023 13:05:08 GMT (envelope-from git) Date: Mon, 16 Jan 2023 13:05:08 GMT Message-Id: <202301161305.30GD58iV021171@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: 5c2b216a1cd8 - main - mixer: Fix default_unit switching with mixers that have no devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 5c2b216a1cd8de3aabfa9e76ca8f38774acd591e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c2b216a1cd8de3aabfa9e76ca8f38774acd591e commit 5c2b216a1cd8de3aabfa9e76ca8f38774acd591e Author: Mark Johnston AuthorDate: 2023-01-16 13:02:54 +0000 Commit: Mark Johnston CommitDate: 2023-01-16 13:02:54 +0000 mixer: Fix default_unit switching with mixers that have no devices Apparently it's possible for a mixer to have no devices: $ mixer -f /dev/mixer2 pcm2:mixer: at ? kld snd_uaudio (rec) $ If this is the default sound device, an attempt to change the default unit using mixer -d fails with a segfault because mod_dunit is called with a NULL device pointer, which is dereferenced to get the parent mixer. ctl_dunit seems to be a dummy, i.e., we don't actually need it and can simply pass the mixer to mod_dunit() directly. This patch removes that structure and associated indirection to fix the crash. Reviewed by: christos, hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38060 --- usr.sbin/mixer/mixer.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index e216efe3313c..6095f7550ea8 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -42,8 +42,8 @@ static void printall(struct mixer *, int); static void printminfo(struct mixer *, int); static void printdev(struct mixer *, int); static void printrecsrc(struct mixer *, int); /* XXX: change name */ +static int set_dunit(struct mixer *, int); /* Control handlers */ -static int mod_dunit(struct mix_dev *, void *); static int mod_volume(struct mix_dev *, void *); static int mod_mute(struct mix_dev *, void *); static int mod_recsrc(struct mix_dev *, void *); @@ -51,14 +51,6 @@ static int print_volume(struct mix_dev *, void *); static int print_mute(struct mix_dev *, void *); static int print_recsrc(struct mix_dev *, void *); -static const mix_ctl_t ctl_dunit = { - .parent_dev = NULL, - .id = -1, - .name = "default_unit", - .mod = mod_dunit, - .print = NULL -}; - int main(int argc, char *argv[]) { @@ -125,7 +117,7 @@ main(int argc, char *argv[]) initctls(m); - if (dflag && ctl_dunit.mod(m->dev, &dunit) < 0) + if (dflag && set_dunit(m, dunit) < 0) goto parse; if (sflag) { printrecsrc(m, oflag); @@ -316,20 +308,19 @@ printrecsrc(struct mixer *m, int oflag) } static int -mod_dunit(struct mix_dev *d, void *p) +set_dunit(struct mixer *m, int dunit) { - int dunit = *((int *)p); int n; if ((n = mixer_get_dunit()) < 0) { warn("cannot get default unit"); return (-1); } - if (mixer_set_dunit(d->parent_mixer, dunit) < 0) { + if (mixer_set_dunit(m, dunit) < 0) { warn("cannot set default unit to: %d", dunit); return (-1); } - printf("%s: %d -> %d\n", ctl_dunit.name, n, dunit); + printf("default_unit: %d -> %d\n", n, dunit); return (0); } From nobody Mon Jan 16 13:05:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwXLZ28zmz2sLNl; Mon, 16 Jan 2023 13:05: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwXLY6xVbz4CY1; Mon, 16 Jan 2023 13:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673874310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/x6u3YlGG39TwehvXLkkUH+oS9xrPLlAseOJoWBiNy0=; b=S9lzkbKUI9Gy4uu0S2MVg8NxkL3szAw5nmjsa5k7wvzCLB8747cS7S8eaYePGD7fMtGDyJ FEO/MaCwou1hsQA4pw3p/GFSRf8t8sAWDP92RqZvb9jnFWw/I9npKem4JmFbsbUx7HR6BS pLbMFrJlZj+mybGcGNarW3M/3i3vARwn/A3JnYn/DAMNCC5Mg0nuOB51DpiHkBWpcwOU6A AV2I+qN9pHfcSaVU9d4yKOWieQqLERMVtx6zQre9VSYWFujdr0msmdHvnTTZA1232oPvdt ffwzPBBMRXZe4Sv20vEHNtOgiM7sayNXk5uSU6pFGoiukBBnNuE63cd9+yVj8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673874310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/x6u3YlGG39TwehvXLkkUH+oS9xrPLlAseOJoWBiNy0=; b=bvdsvDDRiWHaJea4nqY4mR6q+QBJ4NrOtvYPbCPZXcGCBwMDt79lrJfOaJ5jCLnqLBWLUZ rEbNKAXVrfMM4UrAaWCABvdPRcZaL4HDNijcc8q8DiEBZJ0WY5e+W9F76XDX9YKuw0PECv qSz2XsyNNKwNVm6Cscymb46PWKxU01gOyxKA0Rm436df6j7ReaA1qePrBwJ1dV2bS+qmxv Fi5dQRMRYUKwFKx9FHUAWiDqhTQ9YrK+IJspl8JyVrQkrsgjQLdCmr2rbxZUIXvRxm/Ql9 vxKcZTRxpS0s4z2rrhvzOe1cV5raDa38iyYU3b7udPtao+RF1g0fGlIMk1Hdqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673874310; a=rsa-sha256; cv=none; b=MXX3QZL1WNYi7WQqnLUR974xOHL6v9oqve5dRlXNc+vXT75ZTU7tT95UYNQ81fAqDc7TZJ I/8aKwRHYEd4228m6qIo31RsVcy+I8Uk5bYN00biFLyq/Lk+E20ajLKQNMYmlUOQu7sBWc i+f64clZbkRyVuwS7byQckI6Z+bJ7oJul+MCD+se9D7ToHTsELJd85KULfmEKskXK4sZsc L+FdtOh0DoRGnXtVIdZdfS1P4T2q+THZSAF1jgJ4Bv6691AXsy9xapmU9vLMYK1kve/twi yXuXqgl2OX2tsLaxgObftbPBoun9pjsUMrNjnoDCBO4bQKC7n252s5L4BKt5gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwXLY5qrPz175H; Mon, 16 Jan 2023 13:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GD59e9021196; Mon, 16 Jan 2023 13:05:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GD59ZZ021195; Mon, 16 Jan 2023 13:05:09 GMT (envelope-from git) Date: Mon, 16 Jan 2023 13:05:09 GMT Message-Id: <202301161305.30GD59ZZ021195@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: f7e2f98bffda - main - atomic: Remove cdefs.h includes from atomic_*.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f7e2f98bffdafff65012fb02ad838c30b7e3502f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f7e2f98bffdafff65012fb02ad838c30b7e3502f commit f7e2f98bffdafff65012fb02ad838c30b7e3502f Author: Mark Johnston AuthorDate: 2023-01-16 13:03:20 +0000 Commit: Mark Johnston CommitDate: 2023-01-16 13:03:20 +0000 atomic: Remove cdefs.h includes from atomic_*.h Avoid including cdefs.h in system headers. Both headers now include types.h, and we can assume that that pulls in cdefs.h (required for __typeof usage in some of the atomic macro expansions). No functional change intended. Reviewed by: imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38039 --- sys/sys/atomic_common.h | 1 - sys/sys/atomic_san.h | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index a7b0b50512dc..b7bfa151e8ca 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -36,7 +36,6 @@ #error do not include this header, use machine/atomic.h #endif -#include #include #define __atomic_load_bool_relaxed(p) (*(volatile _Bool *)(p)) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index 9ceea2988db2..beeea82a666b 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -43,7 +43,6 @@ #error do not include this header, use machine/atomic.h #endif -#include #include #define ATOMIC_SAN_FUNC_1(sp, op, name, type) \ From nobody Mon Jan 16 13:05:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwXLb2zGVz2sLcw; Mon, 16 Jan 2023 13:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwXLb0ZCXz4BsV; Mon, 16 Jan 2023 13:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673874311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7aY3wO5DXBi+0TNBkAqcu7FhbgeEYU9vBdn5przG7L4=; b=I46euY2lu8515MhsIGcv8r49CAb7Ju5jaENVux3K3oCLTRp/Vp4f4qufdfb72rHypeP59+ WHATWUf772J9/AWmqmQFC8k8I0kRZ9FVS3sxXUW4YA2pvQ/VPOABk/mIwkqzcLjGRiyOAh lf5/tPFU2MP03ZEU8IkmF3hUm/mRpkOSczLsXOg+ryXhJi2RbCDjXjJs6hhKuexgvf1u07 Dms4r2337wzOQp+gj1m2Pg3IG6ySpPOeOtpzaqkOs7d0ha0IyeGfY7ohDtEzv+2AHvrojo 6p7gnqXJ60nHAN07+X41AFCrWv1Wp55R8xaatxS9//woGR9Yw6KrQTl+3+TZ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673874311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7aY3wO5DXBi+0TNBkAqcu7FhbgeEYU9vBdn5przG7L4=; b=Ug4Tp1VW/30vRetGOEa7AF2/WPensNsxa/PM6AizPp2xvx9+h2oTx4lNR8OKolnCaAjDDf XE0a7BgOseoGO8BgBOEigTuSNsDyM2DSfwQ5L6AKq9IGgzoepy/HZyMncpo3e/FaxxwQwT 0PE6vKQk2kj3RnwNQTACZ/nsoGZunsMdh3+TMwbvWG9YnPPniAzZQwokT1JBZvfwrgL6j3 CF0co4Rf5m5iTwdTSuswVMip8/BDKJcwyEWW5qV2Eodi6Kz/TpTVin7Dee1U9yXZH/KLtp 8eRmsQ+rO4gTgE5/kzyREyD1R5aRvByRuGcFLSf7zkpzNvSgYH9B/sCsqN+smA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673874311; a=rsa-sha256; cv=none; b=xu5sU2s8WD+PjYPgoj93gHcWFwIqQ3c6lTEM65o1iALZ//Zi8XrWmMj/GmMD4goOnxDcbP aUymyG++kDJkzgmTYr1g3+TN61C7l+Gao30SN9+byic8Ywg22taX2xdZN87h2/F2PWHGu2 Mra4ukIeYOebaUXuJlUYmue2GIF14MuStXdoyObZRMK0zUxVzV+4Kz6btNlhliO25VkpN6 viFjjinIx1Iwd7qG2fYX20O/fcD+lP2D23oo4d8AWXZAZDyYJczGkBtStiBLuG/dH7KSQi b+0QjqUv6G0CE5zFJ7qDIfHLoICtU4qGQHWOPNfVjTy8MLpzjeVfzzmcxRhTKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwXLZ6nv1z16tV; Mon, 16 Jan 2023 13:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GD5AFi021220; Mon, 16 Jan 2023 13:05:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GD5AnC021219; Mon, 16 Jan 2023 13:05:10 GMT (envelope-from git) Date: Mon, 16 Jan 2023 13:05:10 GMT Message-Id: <202301161305.30GD5AnC021219@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: ccffe71ad4d9 - main - atomic.9: Remove the stated dependency on types.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ccffe71ad4d9ac01f6bb4efa625ffcaf9fae739f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ccffe71ad4d9ac01f6bb4efa625ffcaf9fae739f commit ccffe71ad4d9ac01f6bb4efa625ffcaf9fae739f Author: Mark Johnston AuthorDate: 2023-01-16 13:04:01 +0000 Commit: Mark Johnston CommitDate: 2023-01-16 13:04:27 +0000 atomic.9: Remove the stated dependency on types.h All machine/atomic.h necessarily include sys/atomic_common.h, which brings in types.h. Reviewed by: imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38040 --- share/man/man9/atomic.9 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 784a776546de..7513d569c2f1 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2021 +.Dd January 16, 2023 .Dt ATOMIC 9 .Os .Sh NAME @@ -40,7 +40,6 @@ .Nm atomic_thread_fence .Nd atomic operations .Sh SYNOPSIS -.In sys/types.h .In machine/atomic.h .Ft void .Fn atomic_add_[acq_|rel_] "volatile *p" " v" From nobody Mon Jan 16 15:57:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nwc9n49D2z2sjCc; Mon, 16 Jan 2023 15:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nwc9n3VSkz3DrD; Mon, 16 Jan 2023 15:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673884669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xBf1gYQJIkj3LdVjgjWFwh//Mw8jEjZQiVFukGSCE3c=; b=ycOXalHhKWVpXwoe86kt4EAxP3JkzcyH8B5XkypaUR0w2zMrNco80j8hsyFDBdMk+2iUcA 8LxXVZoR+lSfGfetPRb2MWaSnHQzV6XO7oJ3/zqLkpwUVL8W5VQWICN2mjcpQFtJUrZKox BH4lnCGfTQ+nza5LZWn/981Rd0sfHMN/QKlLmmMVyqWxW58eIgxVBct5USB+JCDV8FHgPv 6HViyjE5L/0dfLXn6t+16gfk9C25TZMqe0wxfp73FoTaknqCohuCHeG6hpcF3tpxycEmdZ 83eSMa2fIkQI7tkiRLKr0YDQMCh0HmV8X81b5BHtAj0pVjUW7EUC5qJW/XCL3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673884669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xBf1gYQJIkj3LdVjgjWFwh//Mw8jEjZQiVFukGSCE3c=; b=q0WfRgAqn0qZTyAw17ABgjDWdQAOPnXY7Ah956btDCAGr8Kq+SKD4CAkoDD5Nv0fdERs9y zB+cvmpjwpkoyMMkI/a2yGLwBHKujENLWyXZ299N1l47LDqW7n9veLFNQ2+pYgy9iKnm6u aGgcAk9/SaBmgScm4Ub/LvYqjIlK2uLFlm/hLnOCjcX9UJiwgntTD7+wLvlZyS7tv2J7/6 S1ZEdIsjhDxRarPEKDo8T4IkZUADUsBXUm98gpxnG0idbUMMKAip0HnfIdUtrJwZVLflQq 31Wrm0YuYr//l+vwmPk8cT9OXlCIgI6qFoA5Y7dcVa4fnpxHSX43jTBlVP6plg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673884669; a=rsa-sha256; cv=none; b=jAFoUnG4XyNgkvotb1Lfg0f73hyCBcs+8aaDFBvF9yfVqP7TH6r/GdMFjrvZJ3v7Iv8Y5V 6ogvU6VWWVR+cCrw4TDLT/nGU6UfApa/T4LLqT4uzKJLCUvACF9JS+V95wixd64HHCqttz aF6LgPNVcmLZrD7NkqX2JhCBW4W+sjNtCU0zOZXAB+CIzQs8Pi/cG2wdcZRXrAingOseod 5dYSXWibWI4CMzA1jLknqLp65YH99h/oAgwh5OJ3sVv67RInsLpoubeLtUOvR/BdyjwpEn c+X3dB8mtRz26RA/HMEL63mfOJsYNR5NxL4PcpecKfbA9LqXT5hmHOIQIJYEWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nwc9n2PGgz1CCx; Mon, 16 Jan 2023 15:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GFvnuw063930; Mon, 16 Jan 2023 15:57:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GFvnMK063929; Mon, 16 Jan 2023 15:57:49 GMT (envelope-from git) Date: Mon, 16 Jan 2023 15:57:49 GMT Message-Id: <202301161557.30GFvnMK063929@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: 9b7eddfeed46 - main - openssh: remove mention of now-unused svn:keywords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 9b7eddfeed465d4062dbad178261b806e97d6b62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9b7eddfeed465d4062dbad178261b806e97d6b62 commit 9b7eddfeed465d4062dbad178261b806e97d6b62 Author: Ed Maste AuthorDate: 2023-01-16 14:52:00 +0000 Commit: Ed Maste CommitDate: 2023-01-16 15:56:27 +0000 openssh: remove mention of now-unused svn:keywords Reported by: gshapiro --- crypto/openssh/FREEBSD-upgrade | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index b389f399a040..9f6f3d577e01 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -73,10 +73,7 @@ $ git diff --diff-filter=M vendor/openssh/X.YpZ HEAD:crypto/openssh - Files that have modifications relative to the vendor code, and - only those files, must have the svn:keywords property set to - FreeBSD=%H and be listed in the 'keywords' file created by the - pre-merge script. + Review the diff for any unexpected changes. 12) Run the configure script: From nobody Mon Jan 16 16:37:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nwd3L5jFHz2snfc; Mon, 16 Jan 2023 16:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nwd3L31mLz3H4t; Mon, 16 Jan 2023 16:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673887038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pEQUNR3tL+ZhFk2sTAH9lC8R6/n3t79H/usfSmUL20=; b=f7ErGNMSip8I7bDI8tTNRnVn3PkrCDfUo60CoR1ffv99HF5x1ua/6IaYUH4ay9b1GDwE4A fZ5utYnny8X4hHS04k/3LAu1bKqEE9/Q6yIQjjybpTa1spT64x9kN6iBzTT9f8vNqCAG+9 W3k3bid9hj7v+WTz5pikPyjMGxJxvv/HUaSyS0eleLN39ndk+N5MuXaDlSMJbs/9dPr84U KJT6o7CAjA/9HZ5JPV8zrjsmvJgbpBDon9QjFyuEtl8wPwKhy29E/DhOfIOmzfEFXVu34/ XAhO55ROiRuYxDxaivalN8yKTeat+r2GSmUNVda9B/teIIL9yXnwWgPzR67/6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673887038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pEQUNR3tL+ZhFk2sTAH9lC8R6/n3t79H/usfSmUL20=; b=C2/zGSpfaKJBJytj6KrjhQpBDZOe3hh2nc2d+ba3BRKYAXmrI0SwFrk+xZo3ZQ8lAwxNbl t1iw3+t7VVG8qLRxut32ka9nRqiprqVCBIeo7K4UAcfCi8RO3cNvtwCmZSYR+jeGziUOs5 PtyITsomXL2Jv4ulTUB5OlrL1cNdyZVumOUlN0rxckzrwNVouajoGT4s+JGK0Xqas0giPn KYhSk4RkT5Np/32eJg4HnihkhjL5r5IoXPBja06yvEm2+e6/XCyV6d4FqUjSIc4EcLDsJk mOggEivYgN+6+jiRJz/YN7RVEmD0FPJRCoZR4U2mlMLH1MdHoSqGKL8lNLdIhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673887038; a=rsa-sha256; cv=none; b=dblTTjCkIh/F3pr15gMK1Qdn1xG6hFSMiHDH8POsVNMKg/AklaveovlyqF0zZQ48112nZj q00qItif++ugaFriTZC2Ykj0AmeiI42jqKGMHwwrYzjNXmkyHpoOxirgpzhel8l2HdyErK eepUjmSuI3hMXjzxzpZN784akIbs+/ExmuzrLgh+DorUtt7mbYILmWr1bkwmhdf636ztYz QVmEAT4bCUP7ORgeNr48irMG+lrgAFA9+8hycBQR1kHQL9/OuUE+p6ia53GEd0fBSoqc7j 9U6UjcCGfFXU2vBDUsdectA722ZxAkk7OaDgJ1qB7ATU/qlRKYlAjy75WMbO8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nwd3L1wS3z1CSw; Mon, 16 Jan 2023 16:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GGbIP8021347; Mon, 16 Jan 2023 16:37:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GGbIXQ021345; Mon, 16 Jan 2023 16:37:18 GMT (envelope-from git) Date: Mon, 16 Jan 2023 16:37:18 GMT Message-Id: <202301161637.30GGbIXQ021345@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: 8a9495517b0a - main - ipsec: Clear pad bytes in PF_KEY messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 8a9495517b0ad54da9759a7ba2cc0b56f8e7c8f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8a9495517b0ad54da9759a7ba2cc0b56f8e7c8f9 commit 8a9495517b0ad54da9759a7ba2cc0b56f8e7c8f9 Author: Mark Johnston AuthorDate: 2023-01-16 15:46:20 +0000 Commit: Mark Johnston CommitDate: 2023-01-16 16:27:54 +0000 ipsec: Clear pad bytes in PF_KEY messages Various handlers for SADB messages will allocate a new mbuf and populate some structures in it. Some of these structures, such as struct sadb_supported, contain small reserved fields that are not initialized and are thus leaked to userspace. Fix the problem by adding a helper to allocate zeroed mbufs. This reduces code duplication and the overhead of zeroing these messages isn't harmful. Reviewed by: zlei, melifaro Reported by: KMSAN Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38068 --- sys/netipsec/key.c | 69 +++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 98bd97f465bf..345c302c2a80 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -818,6 +818,25 @@ key_havesp_any(void) return (V_spd_size != 0); } +/* + * Allocate a single mbuf with a buffer of the desired length. The buffer is + * pre-zeroed to help ensure that uninitialized pad bytes are not leaked. + */ +static struct mbuf * +key_mget(u_int len) +{ + struct mbuf *m; + + KASSERT(len <= MCLBYTES, + ("%s: invalid buffer length %u", __func__, len)); + + m = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (NULL); + memset(mtod(m, void *), 0, len); + return (m); +} + /* %%% IPsec policy management */ /* * Return current SPDB generation. @@ -2353,14 +2372,8 @@ key_spddelete2(struct socket *so, struct mbuf *m, /* create new sadb_msg to reply. */ len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); - MGETHDR(n, M_NOWAIT, MT_DATA); - if (n && len > MHLEN) { - if (!(MCLGET(n, M_NOWAIT))) { - m_freem(n); - n = NULL; - } - } - if (!n) + n = key_mget(len); + if (n == NULL) return key_senderror(so, m, ENOBUFS); n->m_len = len; @@ -3792,14 +3805,8 @@ key_setsadbmsg(u_int8_t type, u_int16_t tlen, u_int8_t satype, u_int32_t seq, len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); if (len > MCLBYTES) return NULL; - MGETHDR(m, M_NOWAIT, MT_DATA); - if (m && len > MHLEN) { - if (!(MCLGET(m, M_NOWAIT))) { - m_freem(m); - m = NULL; - } - } - if (!m) + m = key_mget(len); + if (m == NULL) return NULL; m->m_pkthdr.len = m->m_len = len; m->m_next = NULL; @@ -4979,14 +4986,8 @@ key_getspi(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) len = PFKEY_ALIGN8(sizeof(struct sadb_msg)) + PFKEY_ALIGN8(sizeof(struct sadb_sa)); - MGETHDR(n, M_NOWAIT, MT_DATA); - if (len > MHLEN) { - if (!(MCLGET(n, M_NOWAIT))) { - m_freem(n); - n = NULL; - } - } - if (!n) { + n = key_mget(len); + if (n == NULL) { error = ENOBUFS; goto fail; } @@ -7201,14 +7202,8 @@ key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) if (len > MCLBYTES) return key_senderror(so, m, ENOBUFS); - MGETHDR(n, M_NOWAIT, MT_DATA); - if (n != NULL && len > MHLEN) { - if (!(MCLGET(n, M_NOWAIT))) { - m_freem(n); - n = NULL; - } - } - if (!n) + n = key_mget(len); + if (n == NULL) return key_senderror(so, m, ENOBUFS); n->m_pkthdr.len = n->m_len = len; @@ -7839,14 +7834,8 @@ key_parse(struct mbuf *m, struct socket *so) if (m->m_next) { struct mbuf *n; - MGETHDR(n, M_NOWAIT, MT_DATA); - if (n && m->m_pkthdr.len > MHLEN) { - if (!(MCLGET(n, M_NOWAIT))) { - m_free(n); - n = NULL; - } - } - if (!n) { + n = key_mget(m->m_pkthdr.len); + if (n == NULL) { m_freem(m); return ENOBUFS; } From nobody Mon Jan 16 16:37:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nwd3M4Zjcz2snTD; Mon, 16 Jan 2023 16:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nwd3M3HWDz3HCG; Mon, 16 Jan 2023 16:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673887039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ep13nhtYQPDH17aF7XSmin19TrbCmjYVEbvpEvQKDlE=; b=a9fEgHz4tRJ+nW9A7zJ+OHxxu5zFQ8492PTCa+SAQCbpNcnSMFF47v0eUEVZj7UOhkR6lQ H6XfpAXlPZ3u0nJAwiFQQ2tpoE1b2SymdRZBaUwFZHY3y30l2Iwb21Vgy95qf4vvLivugD f/TeEEFCcplr+e8izv234sZYvtgccz/ci4GkXgU8LPKEcUM60gEqVB7GKVI+EU+wrx70Rq uAiT9CxCR3AEX2Z3eSeahMLOgQDK/rN1BDXQXI2+KUN6Va1fD7Bvc1mXbjNJh5UROWUNr0 aZpPU/5PcWei3uFCOFouy5uIILojUQoP2ylNtjlrdu8GJegm5iM2c4rBMC2gRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673887039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ep13nhtYQPDH17aF7XSmin19TrbCmjYVEbvpEvQKDlE=; b=FgFrO960WDWHmNvAYYNUGbQ0lntJcIE3RaaD3BGtT17ieB9PaBZMu2EYVY33uBZpCNnJW8 rGxNg9czcSDWqoCx4eNji1V41RfM7BToHK5/Mr7SKFZCiLezDr6zDf5tuPmgmrtJDTtTUx j8MATJs92rCliLqasVYlRLHJSovc2iQcoJP+xvCt4e9KveoEqH3cDFgHo0rnMJdOM+ALEG opA7rIXYwa0rpcSP/lnE4LsW+5efmbuVm4YONqvHqlsleGk5KWDA/nfryxmsuCanX350TP gPeCHI2VHinYF/tNXZ6ozBa8+wI4G+6KKCCMDvTNQOrZSsr86VI9DQTLMHDiWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673887039; a=rsa-sha256; cv=none; b=AN4upzpL1MEwr8ZlTycguajhh4igYSydtVRxH50a1YoXXyU3IWG+XddykMMHMOzxVO3OoE W9pX7dwudCEXwwedhy6AVKzISZRtOimGFrUf3LUGAEEggsfIn9CK1P2oiKCfR/oa9Y0mVi 2PurH5Mec3Qqw9vl5O1uSn9rB4M5B92rn+4LEAcZrrf6AY0hwCkCStz4LNprEBEmG0fXfY ifxPo3KNTE8st5Su7w1OcEiO9pJ9Ayae7y3yoFpUrryPkmB9zSjDBVflQYDHQr/C9zWXRF C/q86KUs7VGNNDmjJP2ODQ4doeliYUNcdavw+cxi7UYgubDRN8sI+osdTvMD+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 4Nwd3M2KpFz1DGp; Mon, 16 Jan 2023 16:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GGbJl3021375; Mon, 16 Jan 2023 16:37:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GGbJhs021374; Mon, 16 Jan 2023 16:37:19 GMT (envelope-from git) Date: Mon, 16 Jan 2023 16:37:19 GMT Message-Id: <202301161637.30GGbJhs021374@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: b050ee6c97e7 - main - vm_object: Fix a kernel memory disclosure via the vm_object list sysctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b050ee6c97e7f5b6f1e3adec69775fa41afc948f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b050ee6c97e7f5b6f1e3adec69775fa41afc948f commit b050ee6c97e7f5b6f1e3adec69775fa41afc948f Author: Mark Johnston AuthorDate: 2023-01-16 15:53:59 +0000 Commit: Mark Johnston CommitDate: 2023-01-16 16:27:54 +0000 vm_object: Fix a kernel memory disclosure via the vm_object list sysctl Reported by: Chris J-D MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/vm/vm_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index afe1dcb8c25a..99b28d9460a3 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2523,7 +2523,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) count * 11 / 10)); } - kvo = malloc(sizeof(*kvo), M_TEMP, M_WAITOK); + kvo = malloc(sizeof(*kvo), M_TEMP, M_WAITOK | M_ZERO); error = 0; /* From nobody Mon Jan 16 16:50:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwdLp5QMwz2spsy; Mon, 16 Jan 2023 16:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwdLp54N4z3JSl; Mon, 16 Jan 2023 16:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673887842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWyujoEa2G3lt5b1eOSQdqcbGIJwYxPwViEV2zsY5NM=; b=Nw17SSoBbm4/ngUT4MdQqfFQeE6xbOCEtOQHdVLmxVWwVn5xVLEmvCHjnNM5Hgim1H3LeE vN3Dje0/7TvAMHgP22x3uj9dA9xqEM88AhzEMCcFYeoqu44IIFWhEDMs1Uws8pftJ6leoO Xbum6IUL027QaUiHkYPKsDC2SEcvKbSPig6WvblNB1KWY7AZdyVoMQrFlujrH55RhwFSn4 GcN7Ovy6Z5iOGK3pvgrlqt8ZmtrvXIQnw7bKrCXkjHOrFk7BVSPQCcFPmFyRMY01YIEIiO x4EGgdKLdFkBFCVh9RZOcfsbigLXnSoS70ftxCdGISA+Zinz2mAUUxSzcZ3MbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673887842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWyujoEa2G3lt5b1eOSQdqcbGIJwYxPwViEV2zsY5NM=; b=qZqlfW8Si8onu4t9Iyff4naZi5v828SA7E8+GOqI709Zn3YeqsOhK3uROen4vyQ39GmWhh 19CeQeM4y33w9HNfEvqpb4e8NQDhmIcpnEVD/rN13rWnSCsSTc9axnFP5/LLODqNiTa4Zn HINPFZEmjbGYMkIGPTXxcA6mBa8Ddexkk9WW4Z3todG1ST8pIAO3oJ3AVHOylIj0lEbeZD UDOyTv4/LkNa7CZZNQ/8x5rNM0RDI2ln7AzVlyc91FOyCCWudrIpcRcdZtHZwe7b8twPXu gWtXi7v12LVgnTAnpJDiEOMcUXPRURWYbtbfhXD1UOLPTX3yvlLEjKc6D08NJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673887842; a=rsa-sha256; cv=none; b=CyT1+7ljnQni0b0qSWV78aDr5dMSbp4n2UhwjC3Pl81hDKnab/PNYXYbXM4PtQ2QTJ/LqL tA9bGXLbS+I3Il4qs42sMvQIgxOsMG5tddHroBd3LzLxb1qL9cyJuz8PRL48JhT7tHpOUQ pcT5r3Y+EbYQuOohj/qbySSdS1yOnRfGbuxtfmavRiTY7zZQQOV/Do7Z0LW/RDB/7EZ37b HQximECb/eg3Q9fVoI0/vB//aPTDR+6AFn56CnbRTZ1axGmcSa3pCdbEMtcWCyddhVdOuy d7cHx+GDGV/cJptx2pFUiEpf2dus1dJn+avRNmJpsfc5lKxl7Hn8+ByzLmtjlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwdLp478Lz1Dfh; Mon, 16 Jan 2023 16:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GGogWn044065; Mon, 16 Jan 2023 16:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GGogum044064; Mon, 16 Jan 2023 16:50:42 GMT (envelope-from git) Date: Mon, 16 Jan 2023 16:50:42 GMT Message-Id: <202301161650.30GGogum044064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Danilo G. Baio" Subject: git: 591e29117964 - main - bsdconfig, bsdinstall: Refresh mirrors list List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dbaio X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 591e29117964248d4bfea639e973a12e27f96ac9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dbaio (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=591e29117964248d4bfea639e973a12e27f96ac9 commit 591e29117964248d4bfea639e973a12e27f96ac9 Author: Danilo G. Baio AuthorDate: 2023-01-10 01:06:57 +0000 Commit: Danilo G. Baio CommitDate: 2023-01-16 16:48:06 +0000 bsdconfig, bsdinstall: Refresh mirrors list The mirrors list is in sync with the Handbook / Mirrors section [1], which was refreshed a few months ago. Mirrors removed were not responding or had duplicated addresses (aliases) with another mirror. 1 - https://docs.freebsd.org/en/books/handbook/mirrors/ Reviewed by: philip (clusteradm) Approved by: philip MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38014 --- usr.sbin/bsdconfig/include/messages.subr | 12 ++-- usr.sbin/bsdconfig/share/media/ftp.subr | 118 ++++++++----------------------- usr.sbin/bsdinstall/scripts/mirrorselect | 114 ++++++++--------------------- 3 files changed, 66 insertions(+), 178 deletions(-) diff --git a/usr.sbin/bsdconfig/include/messages.subr b/usr.sbin/bsdconfig/include/messages.subr index 9d910032616d..47ef6876854b 100644 --- a/usr.sbin/bsdconfig/include/messages.subr +++ b/usr.sbin/bsdconfig/include/messages.subr @@ -75,7 +75,6 @@ msg_cant_start_wpa_supplicant="Can't start wpa_supplicant(8). Please create a wl msg_cd_dvd="CD/DVD" msg_cdrom="CDROM" msg_checking_access_to="Checking access to\n %s" -msg_china="China" msg_chinese_desc="Ported software for the Chinese market." msg_choose_a_cd_dvd_type="Choose a CD/DVD type" msg_choose_a_dos_partition="Choose a DOS partition" @@ -200,7 +199,6 @@ msg_ipv6="IPv6" msg_ipv6_desc="IPv6-related software." msg_ipv6_ready="IPv6 ready" msg_irc_desc="Internet Relay Chat utilities." -msg_ireland="Ireland" msg_israel="Israel" msg_japan="Japan" msg_japanese_desc="Ported software for the Japanese market." @@ -222,7 +220,7 @@ msg_looking_for_keymap_files="Looking for keymap files..." msg_looking_up_host="Looking up host %s" msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" -msg_main_site="Main Site" +msg_main_site="Main Site (GeoDNS)" msg_manually_connect="Manually Connect" msg_manually_connect_help="Connect to a wireless network that may be unlisted" msg_math_desc="Mathematical computation software." @@ -310,7 +308,7 @@ msg_please_select_a_freebsd_http_distribution_site="Please select a FreeBSD HTTP msg_please_select_a_usb_drive="You have more than one USB drive. Please choose which drive\nyou would like to use." msg_please_select_dos_partition="FreeBSD can be installed directly from a DOS partition assuming,\nof course, that you have copied the relevant distributions into\nyour DOS partition before starting this installation. If this is\nnot the case then you should reboot DOS at this time and copy the\ndistributions you wish to install into a \"FREEBSD\" subdirectory\non one of your DOS partitions. Otherwise, please select the DOS\npartition containing the FreeBSD distribution files." msg_please_select_ethernet_device_to_configure="Please select the ethernet or PLIP device to configure." -msg_please_select_the_site_closest_to_you_or_other="Please select the site closest to you or \"other\" if you'd like to\nspecify a different choice. Also note that not every site listed here\ncarries more than the base distribution kits. Only Primary sites are\nguaranteed to carry the full range of possible distributions." +msg_please_select_the_site_closest_to_you_or_other="Please select the best suitable site for you or \"other\" if you want to\nspecify a different choice. The \"Main Site\" directs users to the nearest\nproject managed mirror via GeoDNS (they carry the full range of possible\ndistributions and support both IPv4 and IPv6). All other sites are known\nas \"Community Mirrors\"; not every site listed here carries more than the\nbase distribution kits. Select a site!" msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation." msg_please_specify_a_temporary_directory="Please specify a temporary directory with lots of free space:" msg_please_specify_the_name_of_the_text_editor="Please specify the name of the text editor you wish to use:" @@ -324,7 +322,6 @@ msg_ports_mgmt_desc="Utilities for managing ports and packages." msg_portuguese_desc="Ported software for the Portuguese market." msg_previous_page="Previous page" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" -msg_primary="Primary" msg_print_desc="Utilities for dealing with printing." msg_probing_devices_please_wait_this_can_take_a_while="Probing devices, please wait (this can take a while)..." msg_proceed="Proceed" @@ -362,7 +359,7 @@ msg_secure_mode_requires_root="Secure-mode requires root-access!" msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" msg_security_desc="System security software." msg_select="Select" -msg_select_a_site_thats_close="Select a site that's close!" +msg_select_a_site_thats_close="Select a site!" msg_select_the_configuration_you_would_like="Select the configuration you would like to edit:\nAddional network information displayed in help line." msg_select_wlan_interfaces_for="Select wlan interfaces for %s:" msg_selected="selected" @@ -375,7 +372,6 @@ msg_show_configured_help="Show networks configured in wpa_supplicants.conf(5)" msg_show_scan_results="Show Scan Results" msg_show_scan_results_help="Show wpa_cli(8) scan results" msg_skip="Skip" -msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" msg_sorry_package_was_not_found_in_the_index="Sorry, package %s was not found in the INDEX." @@ -386,7 +382,6 @@ msg_spanish_desc="Ported software for the Spanish market." msg_specify_some_other_ftp_site="Specify some other ftp site by URL" msg_specify_some_other_http_site="Specify some other http site by URL" msg_sweden="Sweden" -msg_switzerland="Switzerland" msg_sysutils_desc="Various system utilities." msg_taiwan="Taiwan" msg_tcl_desc="TCL and packages that depend on it." @@ -427,6 +422,7 @@ msg_user_is_using_a_slow_pc_or_ethernet_card="User is using a slow PC or Etherne msg_username_and_password_to_use="Username and password to use instead of anonymous" msg_using_interface="Using interface %s" msg_using_usb_device="Using USB device: %s" +msg_v6="- IPv6" msg_vietnamese_desc="Ported software for the Vietnamese market." msg_view_set_various_media_options="View/Set various media options" msg_warning_no_wireless_devices="WARNING! No wireless devices found." diff --git a/usr.sbin/bsdconfig/share/media/ftp.subr b/usr.sbin/bsdconfig/share/media/ftp.subr index 1f6f216eb0a9..5d6cd37ff38f 100644 --- a/usr.sbin/bsdconfig/share/media/ftp.subr +++ b/usr.sbin/bsdconfig/share/media/ftp.subr @@ -73,110 +73,54 @@ f_dialog_menu_media_ftp() f_dialog_title_restore local prompt="$msg_please_select_the_site_closest_to_you_or_other" local menu_list=" - '$msg_main_site' 'ftp.freebsd.org' - 'URL' '$msg_specify_some_other_ftp_site' - 'IPv6 $msg_main_site' 'ftp.freebsd.org' - ' IPv6 $msg_france' 'ftp4.fr.freebsd.org' - ' IPv6 $msg_france #8' 'ftp8.fr.freebsd.org' - ' IPv6 $msg_ireland' 'ftp3.ie.freebsd.org' - ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' - ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' - ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' - '$msg_primary' 'ftp1.freebsd.org' - ' $msg_primary #2' 'ftp2.freebsd.org' - ' $msg_primary #3' 'ftp3.freebsd.org' - ' $msg_primary #4' 'ftp4.freebsd.org' - ' $msg_primary #5' 'ftp5.freebsd.org' - ' $msg_primary #6' 'ftp6.freebsd.org' - ' $msg_primary #7' 'ftp7.freebsd.org' - ' $msg_primary #10' 'ftp10.freebsd.org' - ' $msg_primary #11' 'ftp11.freebsd.org' - ' $msg_primary #12' 'ftp12.freebsd.org' - ' $msg_primary #13' 'ftp13.freebsd.org' - ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_australia' 'ftp.au.freebsd.org' - ' $msg_australia #2' 'ftp2.au.freebsd.org' + '$msg_main_site' 'download.freebsd.org' + '$msg_australia $msg_v6' 'ftp.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' - '$msg_austria' 'ftp.at.freebsd.org' - '$msg_brazil' 'ftp2.br.freebsd.org' + '$msg_austria $msg_v6' 'ftp.at.freebsd.org' + '$msg_brazil #2' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' - ' $msg_brazil #4' 'ftp4.br.freebsd.org' - '$msg_bulgaria' 'ftp.bg.freebsd.org' - '$msg_china' 'ftp.cn.freebsd.org' - '$msg_czech_republic' 'ftp.cz.freebsd.org' - '$msg_denmark' 'ftp.dk.freebsd.org' + '$msg_bulgaria $msg_v6' 'ftp.bg.freebsd.org' + '$msg_czech_republic $msg_v6' 'ftp.cz.freebsd.org' + '$msg_denmark $msg_v6' 'ftp.dk.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' - '$msg_france' 'ftp.fr.freebsd.org' + '$msg_france $msg_v6' 'ftp.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' - ' $msg_france #4' 'ftp4.fr.freebsd.org' - ' $msg_france #5' 'ftp5.fr.freebsd.org' ' $msg_france #6' 'ftp6.fr.freebsd.org' - ' $msg_france #7' 'ftp7.fr.freebsd.org' - ' $msg_france #8' 'ftp8.fr.freebsd.org' - '$msg_germany' 'ftp.de.freebsd.org' - ' $msg_germany #2' 'ftp2.de.freebsd.org' - ' $msg_germany #4' 'ftp4.de.freebsd.org' - ' $msg_germany #5' 'ftp5.de.freebsd.org' - ' $msg_germany #7' 'ftp7.de.freebsd.org' - ' $msg_germany #8' 'ftp8.de.freebsd.org' - '$msg_greece' 'ftp.gr.freebsd.org' - ' $msg_greece #2' 'ftp2.gr.freebsd.org' - '$msg_ireland' 'ftp3.ie.freebsd.org' - '$msg_japan' 'ftp.jp.freebsd.org' + '$msg_germany $msg_v6' 'ftp.de.freebsd.org' + ' $msg_germany #1 $msg_v6' 'ftp1.de.freebsd.org' + ' $msg_germany #2 $msg_v6' 'ftp2.de.freebsd.org' + ' $msg_germany #5 $msg_v6' 'ftp5.de.freebsd.org' + ' $msg_germany #7 $msg_v6' 'ftp7.de.freebsd.org' + '$msg_greece $msg_v6' 'ftp.gr.freebsd.org' + ' $msg_greece #2 $msg_v6' 'ftp2.gr.freebsd.org' + '$msg_japan $msg_v6' 'ftp.jp.freebsd.org' ' $msg_japan #2' 'ftp2.jp.freebsd.org' ' $msg_japan #3' 'ftp3.jp.freebsd.org' ' $msg_japan #4' 'ftp4.jp.freebsd.org' - ' $msg_japan #5' 'ftp5.jp.freebsd.org' - ' $msg_japan #6' 'ftp6.jp.freebsd.org' - ' $msg_japan #7' 'ftp7.jp.freebsd.org' - ' $msg_japan #8' 'ftp8.jp.freebsd.org' - ' $msg_japan #9' 'ftp9.jp.freebsd.org' + ' $msg_japan #6 $msg_v6' 'ftp6.jp.freebsd.org' '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' '$msg_latvia' 'ftp.lv.freebsd.org' - '$msg_netherlands' 'ftp.nl.freebsd.org' + '$msg_netherlands $msg_v6' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' '$msg_new_zealand' 'ftp.nz.freebsd.org' - '$msg_norway' 'ftp.no.freebsd.org' - '$msg_poland' 'ftp.pl.freebsd.org' - '$msg_russia' 'ftp.ru.freebsd.org' + '$msg_norway $msg_v6' 'ftp.no.freebsd.org' + '$msg_poland $msg_v6' 'ftp.pl.freebsd.org' + '$msg_russia $msg_v6' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #5' 'ftp5.ru.freebsd.org' - ' $msg_russia #6' 'ftp6.ru.freebsd.org' - '$msg_slovak_republic' 'ftp.sk.freebsd.org' - ' $msg_slovak_republic #2' 'ftp2.sk.freebsd.org' - '$msg_slovenia' 'ftp.si.freebsd.org' - '$msg_south_africa' 'ftp.za.freebsd.org' - ' $msg_south_africa #2' 'ftp2.za.freebsd.org' - ' $msg_south_africa #4' 'ftp4.za.freebsd.org' - '$msg_sweden' 'ftp.se.freebsd.org' - ' $msg_sweden #2' 'ftp2.se.freebsd.org' - ' $msg_sweden #4' 'ftp4.se.freebsd.org' - '$msg_switzerland' 'ftp.ch.freebsd.org' - '$msg_taiwan' 'ftp.tw.freebsd.org' - ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' - ' $msg_taiwan #3' 'ftp3.tw.freebsd.org' - ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' - ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' - ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' + '$msg_slovenia $msg_v6' 'ftp.si.freebsd.org' + '$msg_south_africa $msg_v6' 'ftp.za.freebsd.org' + ' $msg_south_africa #2 $msg_v6' 'ftp2.za.freebsd.org' + ' $msg_south_africa #4' 'ftp4.za.freebsd.org' + '$msg_sweden $msg_v6' 'ftp.se.freebsd.org' + '$msg_taiwan #4' 'ftp4.tw.freebsd.org' + ' $msg_taiwan #5' 'ftp5.tw.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' - ' $msg_uk #3' 'ftp3.uk.freebsd.org' - ' $msg_uk #4' 'ftp4.uk.freebsd.org' - ' $msg_uk #5' 'ftp5.uk.freebsd.org' - '$msg_ukraine' 'ftp.ua.freebsd.org' - '$msg_usa #1' 'ftp1.us.freebsd.org' - ' $msg_usa #2' 'ftp2.us.freebsd.org' - ' $msg_usa #3' 'ftp3.us.freebsd.org' - ' $msg_usa #4' 'ftp4.us.freebsd.org' - ' $msg_usa #5' 'ftp5.us.freebsd.org' - ' $msg_usa #6' 'ftp6.us.freebsd.org' - ' $msg_usa #8' 'ftp8.us.freebsd.org' - ' $msg_usa #10' 'ftp10.us.freebsd.org' - ' $msg_usa #11' 'ftp11.us.freebsd.org' - ' $msg_usa #13' 'ftp13.us.freebsd.org' + '$msg_ukraine $msg_v6' 'ftp.ua.freebsd.org' + '$msg_usa #5 $msg_v6' 'ftp5.us.freebsd.org' + ' $msg_usa #11 $msg_v6' 'ftp11.us.freebsd.org' ' $msg_usa #14' 'ftp14.us.freebsd.org' - ' $msg_usa #15' 'ftp15.us.freebsd.org' " # END-QUOTE local hline="$msg_select_a_site_thats_close" diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect index a613a097e69a..279c5ef47cb6 100755 --- a/usr.sbin/bsdinstall/scripts/mirrorselect +++ b/usr.sbin/bsdinstall/scripts/mirrorselect @@ -39,108 +39,56 @@ BSDCFG_SHARE="/usr/share/bsdconfig" exec 3>&1 MIRROR=`bsddialog --backtitle "$OSNAME Installer" \ --title "Mirror Selection" --extra-button --extra-label "Other" \ - --menu "Please select the site closest to you or \"other\" if you'd like to specify a different choice. Also note that not every site listed here carries more than the base distribution kits. Only Primary sites are guaranteed to carry the full range of possible distributions. Select a site that's close!" \ + --menu "Please select the best suitable site for you or \"other\" if you want to specify a different choice. The \"Main Site\" directs users to the nearest project managed mirror via GeoDNS (they carry the full range of possible distributions and support both IPv4 and IPv6). All other sites are known as \"Community Mirrors\"; not every site listed here carries more than the base distribution kits. Select a site!" \ 0 0 16 \ - ftp://ftp.freebsd.org "Main Site"\ - ftp://ftp.freebsd.org "IPv6 Main Site"\ - ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ - ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ - ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ - ftp://ftp4.us.freebsd.org "IPv6 USA"\ - ftp://ftp1.freebsd.org "Primary"\ - ftp://ftp2.freebsd.org "Primary #2"\ - ftp://ftp3.freebsd.org "Primary #3"\ - ftp://ftp4.freebsd.org "Primary #4"\ - ftp://ftp5.freebsd.org "Primary #5"\ - ftp://ftp6.freebsd.org "Primary #6"\ - ftp://ftp7.freebsd.org "Primary #7"\ - ftp://ftp10.freebsd.org "Primary #10"\ - ftp://ftp11.freebsd.org "Primary #11"\ - ftp://ftp12.freebsd.org "Primary #12"\ - ftp://ftp13.freebsd.org "Primary #13"\ - ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp.au.freebsd.org "Australia"\ - ftp://ftp2.au.freebsd.org "Australia #2"\ + ftp://download.freebsd.org "Main Site (GeoDNS)"\ + http://ftp.au.freebsd.org "Australia - IPv6"\ ftp://ftp3.au.freebsd.org "Australia #3"\ - ftp://ftp.at.freebsd.org "Austria"\ + ftp://ftp.at.freebsd.org "Austria - IPv6"\ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ - ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp.bg.freebsd.org "Bulgaria"\ - ftp://ftp.cn.freebsd.org "China"\ - ftp://ftp.cz.freebsd.org "Czech Republic"\ - ftp://ftp.dk.freebsd.org "Denmark"\ + ftp://ftp.bg.freebsd.org "Bulgaria - IPv6"\ + ftp://ftp.cz.freebsd.org "Czech Republic - IPv6"\ + ftp://ftp.dk.freebsd.org "Denmark - IPv6"\ ftp://ftp.fi.freebsd.org "Finland"\ - ftp://ftp.fr.freebsd.org "France"\ + ftp://ftp.fr.freebsd.org "France - IPv6"\ ftp://ftp3.fr.freebsd.org "France #3"\ - ftp://ftp4.fr.freebsd.org "IPv6 France #4"\ - ftp://ftp5.fr.freebsd.org "France #5"\ ftp://ftp6.fr.freebsd.org "France #6"\ - ftp://ftp7.fr.freebsd.org "France #7"\ - ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ - ftp://ftp.de.freebsd.org "Germany"\ - ftp://ftp2.de.freebsd.org "Germany #2"\ - ftp://ftp4.de.freebsd.org "Germany #4"\ - ftp://ftp5.de.freebsd.org "Germany #5"\ - ftp://ftp7.de.freebsd.org "Germany #7"\ - ftp://ftp8.de.freebsd.org "Germany #8"\ - ftp://ftp.gr.freebsd.org "Greece"\ - ftp://ftp2.gr.freebsd.org "Greece #2"\ - ftp://ftp3.ie.freebsd.org "Ireland #3"\ - ftp://ftp.jp.freebsd.org "Japan"\ + ftp://ftp.de.freebsd.org "Germany - IPv6"\ + ftp://ftp1.de.freebsd.org "Germany #1 - IPv6"\ + ftp://ftp2.de.freebsd.org "Germany #2 - IPv6"\ + ftp://ftp5.de.freebsd.org "Germany #5 - IPv6"\ + ftp://ftp7.de.freebsd.org "Germany #7 - IPv6"\ + ftp://ftp.gr.freebsd.org "Greece - IPv6"\ + ftp://ftp2.gr.freebsd.org "Greece #2 - IPv6"\ + ftp://ftp.jp.freebsd.org "Japan - IPv6"\ ftp://ftp2.jp.freebsd.org "Japan #2"\ ftp://ftp3.jp.freebsd.org "Japan #3"\ ftp://ftp4.jp.freebsd.org "Japan #4"\ - ftp://ftp5.jp.freebsd.org "Japan #5"\ - ftp://ftp6.jp.freebsd.org "Japan #6"\ - ftp://ftp7.jp.freebsd.org "Japan #7"\ - ftp://ftp8.jp.freebsd.org "Japan #8"\ - ftp://ftp9.jp.freebsd.org "Japan #9"\ + ftp://ftp6.jp.freebsd.org "Japan #6 - IPv6"\ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ ftp://ftp.lv.freebsd.org "Latvia"\ - ftp://ftp.nl.freebsd.org "Netherlands"\ + ftp://ftp.nl.freebsd.org "Netherlands - IPv6"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ ftp://ftp.nz.freebsd.org "New Zealand"\ - ftp://ftp.no.freebsd.org "Norway"\ - ftp://ftp.pl.freebsd.org "Poland"\ - ftp://ftp.ru.freebsd.org "Russia"\ + ftp://ftp.no.freebsd.org "Norway - IPv6"\ + ftp://ftp.pl.freebsd.org "Poland - IPv6"\ + ftp://ftp.ru.freebsd.org "Russia - IPv6"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp5.ru.freebsd.org "Russia #5"\ - ftp://ftp6.ru.freebsd.org "Russia #6"\ - ftp://ftp.sk.freebsd.org "Slovak Republic"\ - ftp://ftp2.sk.freebsd.org "Slovak Republic #2"\ - ftp://ftp.si.freebsd.org "Slovenia"\ - ftp://ftp.za.freebsd.org "South Africa"\ - ftp://ftp2.za.freebsd.org "South Africa #2"\ + ftp://ftp.si.freebsd.org "Slovenia - IPv6"\ + ftp://ftp.za.freebsd.org "South Africa - IPv6"\ + ftp://ftp2.za.freebsd.org "South Africa #2 - IPv6"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ - ftp://ftp.se.freebsd.org "Sweden"\ - ftp://ftp4.se.freebsd.org "Sweden #4"\ - ftp://ftp.ch.freebsd.org "Switzerland"\ - ftp://ftp.tw.freebsd.org "Taiwan"\ - ftp://ftp2.tw.freebsd.org "Taiwan #2"\ - ftp://ftp3.tw.freebsd.org "Taiwan #3"\ + ftp://ftp.se.freebsd.org "Sweden - IPv6"\ ftp://ftp4.tw.freebsd.org "Taiwan #4"\ - ftp://ftp6.tw.freebsd.org "Taiwan #6"\ - ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp.uk.freebsd.org "UK"\ - ftp://ftp2.uk.freebsd.org "UK #2"\ - ftp://ftp3.uk.freebsd.org "UK #3"\ - ftp://ftp4.uk.freebsd.org "UK #4"\ - ftp://ftp5.uk.freebsd.org "UK #5"\ - ftp://ftp.ua.freebsd.org "Ukraine"\ - ftp://ftp1.us.freebsd.org "USA #1"\ - ftp://ftp2.us.freebsd.org "USA #2"\ - ftp://ftp3.us.freebsd.org "USA #3"\ - ftp://ftp4.us.freebsd.org "USA #4"\ - ftp://ftp5.us.freebsd.org "USA #5"\ - ftp://ftp6.us.freebsd.org "USA #6"\ - ftp://ftp8.us.freebsd.org "USA #8"\ - ftp://ftp10.us.freebsd.org "USA #10"\ - ftp://ftp11.us.freebsd.org "USA #11"\ - ftp://ftp13.us.freebsd.org "USA #13"\ + ftp://ftp5.tw.freebsd.org "Taiwan #5"\ + ftp://ftp.uk.freebsd.org "UK - IPv6"\ + ftp://ftp2.uk.freebsd.org "UK #2 - IPv6"\ + ftp://ftp.ua.FreeBSD.org "Ukraine - IPv6"\ + ftp://ftp5.us.freebsd.org "USA #5 - IPv6"\ + ftp://ftp11.us.freebsd.org "USA #11 - IPv6"\ ftp://ftp14.us.freebsd.org "USA #14"\ - ftp://ftp15.us.freebsd.org "USA #15"\ 2>&1 1>&3` MIRROR_BUTTON=$? exec 3>&- From nobody Mon Jan 16 18:27:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwgVf0MNSz2t2CZ; Mon, 16 Jan 2023 18:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwgVd6tpvz3hRF; Mon, 16 Jan 2023 18:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmqTaefyZmGX+/7Ta+TLCpE6m27cI6n+ejrDMmvNLMU=; b=DIt2CnftxafUag+CB7aw6WDQY+UJ0OBCbAXDAVUjDf/tTYt6wShtUYBjhFuvtxe2yb2zSn O2kx2SbOzIh6ppwYECWcxcnv8WFLKsa4bP05nmTMPfpXEcwTqeMuj8rYkxSLoSypfvSb5U p+EKi6LCWiUemXisbaDLpO6zEO2oErMR+E9L3/EfX+gAOAhcCaHu8LoUT9KYaEcDjooM1C bTnvkfu0oyRIyEnpKHJGxwi9Cgjvt6LttuJxX/B5Sf6ePGIAm+TaRLxQ4WkaGUZQ31h1BO nbGeaKhsqhYyLNHlscooXS/Dd038OKqOT3zzRozx+DgCeI862Ss0wGypm0ObGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmqTaefyZmGX+/7Ta+TLCpE6m27cI6n+ejrDMmvNLMU=; b=VpQ/ddseeWNuFgmNBc42tl+NnCqiyXaW3eJ6GJuOmj+wmK9NrJtJKzkFtgcMdoxoj5ngqW yZoy4bXiUZPPN6IvxJRPrQU7CNDFAWOhX9Ir5ArPRGnOPX5Ae+k5KA5j4JKan6+nP2s577 1PPtqzylCVJcKymEnxsKZxk8r9p0ZX7H+qfitJfZjz7Jr76gfCFQdT4fGovghMx4hLW9+J vDOYxKPAdmUSelCE9kcybDR9xqhfN8Dq1ShsbS+eFQjbV9Ss65hxbDZsxqqCHshPDLVEMe LPaGPbd4LE3TSFgd5DGdxx/2HEgJpm8MVYMAaDO4gpZ19u5bHDlGSY0VCUY3qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673893658; a=rsa-sha256; cv=none; b=wCyqfiNAQHXN8sm6eFIqTtxO06W8NtVkBDUHzCV+mSxGCwtWyM6+Pt/EWVoDNaZhZst6Wu q3CoyWVEoQmPtZWQRAmdAOMvZ9d0tmBUxUok9PawH73ysluGEIbEt2ahkVjXSffSOV3JX5 b6GsOGk5pIpTukGJTJkrBRpp3I5fHoDa8EhFugTV/B9NXGrhdnqhOWonbuFqksgqKZjN78 +piPSwgUd5XM6k7IgjqAnnp+Va2bWOs71uGoMMlcB32E+OpaRAu5hNR5xHxm/3/+dEY3wc PIXtEc+XcE6QWj7fwPKK/yRJm1dNCUK4qwMc9QlwMa5WasCX+VlwEXs4XCaj9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwgVd5w1Bz1GpK; Mon, 16 Jan 2023 18:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GIRbYS078432; Mon, 16 Jan 2023 18:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GIRbbn078431; Mon, 16 Jan 2023 18:27:37 GMT (envelope-from git) Date: Mon, 16 Jan 2023 18:27:37 GMT Message-Id: <202301161827.30GIRbbn078431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: c0c1c599c0ca - main - linuxkpi: Define `GFP_NOFS` in `linux/gfp.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0c1c599c0ca7e8a15509503991f8cd97c292bea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c0c1c599c0ca7e8a15509503991f8cd97c292bea commit c0c1c599c0ca7e8a15509503991f8cd97c292bea Author: Jean-Sébastien Pédron AuthorDate: 2022-12-30 09:49:08 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-16 18:11:52 +0000 linuxkpi: Define `GFP_NOFS` in `linux/gfp.h` Reviewed by: emaste, manu Approved by: emaste, manu Differential Revision: https://reviews.freebsd.org/D37910 --- sys/compat/linuxkpi/common/include/linux/gfp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index a2930b44b0c4..55558500dd30 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -72,6 +72,7 @@ #define GFP_HIGHUSER_MOVABLE M_WAITOK #define GFP_IOFS M_NOWAIT #define GFP_NOIO M_NOWAIT +#define GFP_NOFS M_NOWAIT #define GFP_DMA32 __GFP_DMA32 #define GFP_TEMPORARY M_NOWAIT #define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) From nobody Mon Jan 16 18:27:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwgVg1SL4z2t2QS; Mon, 16 Jan 2023 18:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwgVg1074z3hRZ; Mon, 16 Jan 2023 18:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xQFK6AyiWfvlvbowweLwqwzouwRJA+QiFO0v3gCRSsY=; b=JB0pXpNcqif+iPOYo7bN5E8Uzh1IGRsC1a7W/Rtazjt4DAhJdqZlNMb7dmFYcyqwpLtXeb MgSArvSzCWfVG9grr3Dezu2kCNwQlZkM84EP45Wk7AyKo3v8k0tXo9HrvlzeGCvqydxzNh eutp3zHdTmfITeHloi3ybA4q2yqsqkda/2SQPqi/aZrCrTOs/8i8SBa3u0J/WU+GMdvn/L EipiTGC+fs/i1gRApSFXQAUDdENkTsTdk4IkjD1g/q4Xkj9pjbO2cEWwW5NUa9xo/ClqXE oan467HLn41e+t7FNUrKlCcCuLhJmTcM/EtjMF6gNAvQihLxh922/JjHkC3WmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xQFK6AyiWfvlvbowweLwqwzouwRJA+QiFO0v3gCRSsY=; b=s3yx6GU7Txt08wjEPiXYg1H3LkF05VyI8bEfnYUVFQG8Zpj2THyORFu7RoO13hwWUW0u9+ Cq3lUJKvpotx4XT+CofYIXnybakFmkh9wAwoNNJTTCENjHaC1xha7zYUa6ojIBtn4krpEt m5PiMyAP3wFz5WFcB/cYbNIItAvEpfCI3K9qxmyjqnW+qLbxxpGMivPv7lM/0e0o7jyNft TkHC8JOzb0R4KuRjrcmelz6F29beHByaOOCC49X4BbHuOmA62I6KOyOdzi07S5ZX66CPaZ R85fCedDVV4DVpISX9u/ESv69yYmdo4JuoVskbZojkRzJNyU6U1IUZ0L+lmnCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673893659; a=rsa-sha256; cv=none; b=b9U9m3qORw6mC7gPKPzw9krDZ6k+3670nWNZZgGPEhEle4tx2EgHMl1X18D0YExfp+YNSF dBHAZDM6ruq0rlmU11FyUv2QuysGXg8qIlHFokfB050qFfqExw/4CXSYEF6OUg841dkpkC kVm58zrDsuk8+3nj1AToj/RTJR0EuRqgqbY6PoaGQjPPGUKjjhyLL1gxjFZzhtLvTOltug BKjgnR++IOwok+T40OZ+LRbv7bBNXMpG4IdVbOkf6ARnPPeVETBOpacr6hzxOsUhrENplB umynMYomYv46E/bXSUGnnCyf8zzTkCkd3Wcv3Ouu/KMFWqSepEMR2Uind3g4MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwgVf6qDxz1G9x; Mon, 16 Jan 2023 18:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GIRcYV078468; Mon, 16 Jan 2023 18:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GIRc69078467; Mon, 16 Jan 2023 18:27:38 GMT (envelope-from git) Date: Mon, 16 Jan 2023 18:27:38 GMT Message-Id: <202301161827.30GIRc69078467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 3aa335d00ac8 - main - linuxkpi: Add `gfp_mask` field to `struct shrink_control` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3aa335d00ac860565d106eb47e931206641cd653 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3aa335d00ac860565d106eb47e931206641cd653 commit 3aa335d00ac860565d106eb47e931206641cd653 Author: Jean-Sébastien Pédron AuthorDate: 2022-12-30 09:56:46 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-16 18:11:58 +0000 linuxkpi: Add `gfp_mask` field to `struct shrink_control` bz@ asked if the KBI breakage is a concern here. My answer was that this is the first time in the DRM drivers in Linux 5.13 (the version I'm working on) that this structure is initialized (as a variable local to the function in this case), so it shouldn't be a problem for the DRM drivers. However, I can't speak for other drivers maintained outside of the src tree. Reviewed by: emaste, manu Approved by: emaste, manu Differential Revision: https://reviews.freebsd.org/D37913 --- sys/compat/linuxkpi/common/include/linux/shrinker.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/shrinker.h b/sys/compat/linuxkpi/common/include/linux/shrinker.h index 05f702e62fd5..39ea35f0a862 100644 --- a/sys/compat/linuxkpi/common/include/linux/shrinker.h +++ b/sys/compat/linuxkpi/common/include/linux/shrinker.h @@ -29,8 +29,10 @@ #define _LINUXKPI_LINUX_SHRINKER_H_ #include +#include struct shrink_control { + gfp_t gfp_mask; unsigned long nr_to_scan; unsigned long nr_scanned; }; From nobody Mon Jan 16 18:27:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwgVh1k2vz2t2L2; Mon, 16 Jan 2023 18:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwgVh1F2qz3j0s; Mon, 16 Jan 2023 18:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/s7C68vQYuqWIhkqXqITxUelsY1qv8AE6073zvQwvPs=; b=DQDK4rPz8QnbBUJkL9VnetSPKFAllDKrAn7vISXr24Efyyok2pTzvD+ufgsmFogQuhV8Vw aobnsDd7G0BmG5lCXaHewIgFOVdFzgRgnxSfRuAn7g84So7qFS0+td/0VnxxNhl+Fqkz1t mkJDwtcI3pDz5kIfGfgt92SY282KKBAXFu84KbmzbaRcYzO5qm9TZTeIdBGznEswnEzTl8 hNhrKyPVnuY+oiOai9wDOzlAYMm1WQGZm9bbrOjg84XNuSAri+a9czcIKsL0issE+W+OSq GucM0Uxb13hbp0EFs5GChOSzQdzF9KOg7ZAaMF56YXa/N/7hg+6SqGUZr/a1ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/s7C68vQYuqWIhkqXqITxUelsY1qv8AE6073zvQwvPs=; b=tgYtdEoyJKnt+VAdObXe4ljxtacDHspknY1UU/9u5mr5AWZqcVGWO4fiQDMH7XPbkIHyp6 S7q5aKzAEeD5S9pRL8COe4mZGQVbaIGe5evHVWsuZz4MhvLLKecuRuFwwkNK6w1sUp5Zlf gb4LqRZbuIRE+CSBmoV+cPPRddRPZWv6Q0IbP9NRNKNyE2gbkFdrbVY6tzrBdH63sdPQQY TSMwmNM4wEL9oiB2Ze94lMoc/Rxd8qSFamRJgmKyc4EKY4VFwlayAUAeCGgxzYkulV/3oI V5iasMIAeVKTo3ZAF5zPHBZ7ELCCldot02Q30oor3DMlTe1jwYQjci5c6sAEUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673893660; a=rsa-sha256; cv=none; b=MxONxHX3iFlzhDvKYxXeLqnK9m8fnk3CtoirofzNeGyJMar9HhK8WJSZGISBHOcgi10icF paJF2sB0P5vHs6wxdwW1G8MXqxxbrjKirwEM699ZsjbE6U3jFQZtt6YBoDUYFWUKiWbBn8 sl0PmIPWDevgOQzyesYKTO6zjZWztXr2wwy1bdSx6KnQyRne3vKSj2eFnSfENLQoKloiPM 1GjVNMDA0LX7bdFDF58m9djCpF0DRAXhK06krksUwCxtbUI9yvIrS/nXUiwCWf4fRYFx5F QIwkrDCu6/E01BtOH61Y6qSUjW3LwKROYRW/bCVJofHWHIQDElhyo3Ob4VEysg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwgVh0L4Cz1Gq6; Mon, 16 Jan 2023 18:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GIRdtJ078499; Mon, 16 Jan 2023 18:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GIRduF078498; Mon, 16 Jan 2023 18:27:39 GMT (envelope-from git) Date: Mon, 16 Jan 2023 18:27:39 GMT Message-Id: <202301161827.30GIRduF078498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: ed53e350d703 - main - linuxkpi: Define `ioremap_cache()` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed53e350d703b9e3ab78d137fd59a5a9dfef8b3f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ed53e350d703b9e3ab78d137fd59a5a9dfef8b3f commit ed53e350d703b9e3ab78d137fd59a5a9dfef8b3f Author: Jean-Sébastien Pédron AuthorDate: 2022-12-30 10:36:24 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-16 18:11:58 +0000 linuxkpi: Define `ioremap_cache()` It uses the `VM_MEMATTR_WRITE_BACK` flag on FreeBSD. It replaces `ioremap_wb()` which doesn't exist in Linux. Perhaps it existed in the past and was removed. Reviewed by: emaste, manu Approved by: emaste, manu Differential Revision: https://reviews.freebsd.org/D37916 --- sys/compat/linuxkpi/common/include/linux/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 64e8b294eeff..598ff8e0376d 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -424,7 +424,7 @@ _ioremap_attr(vm_paddr_t _phys_addr, unsigned long _size, int _attr) #else #define ioremap_wc(addr, size) ioremap_nocache(addr, size) #endif -#define ioremap_wb(addr, size) \ +#define ioremap_cache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) void iounmap(void *addr); @@ -496,7 +496,7 @@ memremap(resource_size_t offset, size_t size, unsigned long flags) void *addr = NULL; if ((flags & MEMREMAP_WB) && - (addr = ioremap_wb(offset, size)) != NULL) + (addr = ioremap_cache(offset, size)) != NULL) goto done; if ((flags & MEMREMAP_WT) && (addr = ioremap_wt(offset, size)) != NULL) From nobody Mon Jan 16 18:27:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwgVj47Xmz2t2T4; Mon, 16 Jan 2023 18:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwgVj2bZyz3hpx; Mon, 16 Jan 2023 18:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R+TGsOOUaKqljBw2Rq9xE9P1nTLQov5u+kJX4H+fQOU=; b=VP3vi1g8V3/2gGwIKLdbZAmo4AsXQdRGPRoZ6ZMaW7t8tGMAEtQEezYBHtgyqDoo49kGBL oiODSaMke6B60ogJdqt+d2fjLYVGpYl2RdZ57noJY/4cmvrc23C0DvTlo+pJ+0chGz7Zmj lMpk7/7KStacf8DWw+NB5eNq6uW5uP/q3sy9azFZWbJAGH+DB8kQroCFa+AOCzEjgmnibw /F5q02LPE2D8ry4SxH1TJHtrKC79CGw51rSMkoNmGeWZwgAQ9bQj5U5h5vXDw0cJ1FvbuO 16F/DwQfjqVCIaMw7X7vZwvUQ2pTJdYWxBeThJ8h36+Bjv7fkopbaX5hlNDNZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R+TGsOOUaKqljBw2Rq9xE9P1nTLQov5u+kJX4H+fQOU=; b=tanGJQgFkL0eN0tDWzjfecIopgjaTIL7j0bepkZ8MjDnnfweJTb7VmQwhx45AltG0VedMR pWNKkmGcNCkJPMU/qBuVIqDGJtSF8n+eUaX+WVJjV9eA+Edle3XgUfr1vvM+JQqJJUwvU2 xDr4vrQy6rKtdYxSjboCRdwqJGcQ1ONxZVrn6K1eogRcHZzNrVLsw6QnEhvIuwrQepHyfS JJ8SS/dWh4Nd2y/FwlI0aly8S7uoMjfgw9Xb0E2ed20QlFVzWEnzL24HA1IRVzbffnQjZs 68oLGq7DerPmWlr13eDpopOTBYZdNLHR4TFUbUHqR9UOu0mVmXVbXFYAWQb4bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673893661; a=rsa-sha256; cv=none; b=os5FjNYlATC75V7CYMuRZlKND0nsyhFTGNnLuUb0zSv+mWfTO1wZDcuUFzZtiQMLhcus4n TStKintiB2U7ldD//wa/0ttHLGvDO2W5mIttXWhx0gGIjdpxue9tqc86kMR0Gqrgkpv1sy 7wBuHbj/BcmaQNyTaI72BhHg6ph8OZI5XAclYvd+8Arrj1+qzjdMi9XbuNiMjjBknU4gFa n6ROMuYrw9fvyBfM2AXXRRIiX6w+x0FicWxUbTP1z7sXSx2dwMlOEn4N1fQwPo4wB+QfcN LrO5l+e55Z2C294XfQo1Cf/+NMobtGdQ3xC6oL3CtkBGNYuWlQzmydSEIWrRcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwgVj1bBnz1GQP; Mon, 16 Jan 2023 18:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GIRfE1078529; Mon, 16 Jan 2023 18:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GIRfIL078528; Mon, 16 Jan 2023 18:27:41 GMT (envelope-from git) Date: Mon, 16 Jan 2023 18:27:41 GMT Message-Id: <202301161827.30GIRfIL078528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: cf8f392260bf - main - linuxkpi: Add `memalloc_noreclaim_save()` and `memalloc_noreclaim_restore()` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf8f392260bf8e9b4e088f26f81ddb96bd97e91c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cf8f392260bf8e9b4e088f26f81ddb96bd97e91c commit cf8f392260bf8e9b4e088f26f81ddb96bd97e91c Author: Jean-Sébastien Pédron AuthorDate: 2023-01-02 20:59:17 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-16 18:27:16 +0000 linuxkpi: Add `memalloc_noreclaim_save()` and `memalloc_noreclaim_restore()` They are no-ops. Reviewed by: emaste, manu Approved by: emaste, manu Differential Revision: https://reviews.freebsd.org/D37933 --- sys/compat/linuxkpi/common/include/linux/sched/mm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/sched/mm.h b/sys/compat/linuxkpi/common/include/linux/sched/mm.h index 613473e142a9..c26d99378974 100644 --- a/sys/compat/linuxkpi/common/include/linux/sched/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/sched/mm.h @@ -36,5 +36,8 @@ #define memalloc_nofs_save(x) 0 #define memalloc_nofs_restore(x) do { \ } while (0) +#define memalloc_noreclaim_save(x) 0 +#define memalloc_noreclaim_restore(x) do { \ + } while (0) #endif /* _BSD_LKPI_LINUX_SCHED_MM_H_ */ From nobody Mon Jan 16 18:27:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwgVk42ctz2t2J4; Mon, 16 Jan 2023 18:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwgVk3Pydz3j3x; Mon, 16 Jan 2023 18:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iVkIIg+KUw7ZzO2WAqE54+yD3CoA4mNvIbPQDacesWU=; b=pisYoV0zRo3qRqTNB7htozHQsu77KpiOAfIMRhMPUmKWYA6+u09BMg2n+3kSxT+sV/Q+0v qSt0QR8EP5nk7+5FadJ6dzSQweRhE3CfetTp2Es/bpKRjCPUXF/MH0tiEaiNQTfBB9iOJS n4diCV4C5DFngEBhAoXR2U16zq530PgkjPxUwiAMUi9+dEofxjjwzuRxr0JoG5S2cjoApS JbmpOQjmeyJPR0IbJAmVtLDjcylExG6mHRDEYvfZzGCXVjrULdCAjxyAdcUhEkYd4rhDWe amaRP4PyvfBi6pZFIeBvPDhAJHEle66Ax6LKPWrD1k43tkMTYvwacKTE2htykw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673893662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iVkIIg+KUw7ZzO2WAqE54+yD3CoA4mNvIbPQDacesWU=; b=ryk4R63EmvDA9uYrhxxoXQXVtm2CeVWdeM0qFus8JPdpUDYmYpYpbD749dcNV+fJL4P9h/ ZWkBU+YSugMOJjTOtha4oqn8zJrKucDqTAC/0sn9ErRqWyqJDgIXtyHItRACzOznXYIXjF P7oUcZHFj0sGHSM57ytKwyt0nRhPkpgk9oYZOwZ4Qmh9645kri3AUz9+o/06AB48T2Tdn8 /sB4gXnvIBHSRR3s6W6EQCuwNh9HibRK0BNo18yssle98E+mzOHJHfcmPMfFzD6fHExRj/ Lv6u+vWIGsqm7m0x6OorzuB1rAPvXcS+1GM0bkaNcTu+zKo/kxq/8OCKMNZvgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673893662; a=rsa-sha256; cv=none; b=HrDzT3y/+3qKnlpfAqyJmEMUu6YZJnjvR4G4xZhMANbElh7oB+cBtnNZ7P1hcepW1vHQsn fi/tWd3ktA48m2NQPyVojAq46jEjArKYFF/MDA2IrRudbXyU6s2Vx5s2/Vr7/0YVn1qFD9 /wG8Dy6+5lYKh8RbrBqm+VTHpGJm1eYgRNMpi7qU4wr4FIISudaUjm4LKCj9htU8pUs57v LvqmB/E5Io6r8XLpM80UwcLEAOkVjDMOIZXhIO5yVGpByBUNBY/7G+r89l8TRgM4oxeANO mCzRN5GN/NasT96MZKYVsP6Y9a+6aFZgTONHcyvSt90ADjoscskm8Oqyw33lSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwgVk2X6qz1GKV; Mon, 16 Jan 2023 18:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GIRgO1078560; Mon, 16 Jan 2023 18:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GIRgIZ078559; Mon, 16 Jan 2023 18:27:42 GMT (envelope-from git) Date: Mon, 16 Jan 2023 18:27:42 GMT Message-Id: <202301161827.30GIRgIZ078559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: e8ce32bea30d - main - linuxkpi: Define EBADSLT to 57 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8ce32bea30d599b481735a1d1b0a87ac06c5a66 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e8ce32bea30d599b481735a1d1b0a87ac06c5a66 commit e8ce32bea30d599b481735a1d1b0a87ac06c5a66 Author: Jean-Sébastien Pédron AuthorDate: 2023-01-02 22:48:16 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-16 18:27:21 +0000 linuxkpi: Define EBADSLT to 57 This is the same error code as Linux. As emaste@ noted in the review, FreeBSD defines the following errno values in `sys/errno.h`: * 56 is `EISCONN` * 57 is `ENOTCONN` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D37935 --- sys/compat/linuxkpi/common/include/linux/errno.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/errno.h b/sys/compat/linuxkpi/common/include/linux/errno.h index 72d8af6779a5..796203422d23 100644 --- a/sys/compat/linuxkpi/common/include/linux/errno.h +++ b/sys/compat/linuxkpi/common/include/linux/errno.h @@ -34,6 +34,7 @@ #include #define EBADRQC 56 /* Bad request code */ +#define EBADSLT 57 /* Invalid slot */ #define ECHRNG EDOM #define ETIME ETIMEDOUT From nobody Mon Jan 16 19:00:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwhDW3lB8z2t5S9; Mon, 16 Jan 2023 19:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwhDW358Bz3m7W; Mon, 16 Jan 2023 19:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673895627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+6B4UZrziaz6WFxViTa7jcYr25cc7XnrRRhE22s9QU=; b=W1SltXwjIEIxAhFWa3E5I59q0gHhYMsC8gIRvh+VfIiRRc+WEr33HSAeATems5uLW43CDN 6cxfI00orFaEVKrIId1C+HsryLteLTtCfXx8IZVC1ojBZ1jtBDphsto7dSm4Ku8R+cpimt cFdHlK1j7fRdF/Qkcr7FDywsvHI9ofHHLe/Lv/a6UFGWqyZkkuj0ZLQNIWuKlRjH00iDtY YM9gJBHCzZys6vb4DLc30fW/GW0j2UFHfbAdC+Spkss29a50QmICCoi/QfNUfsnDpThF/l fWZosa6Nhhhm1y/RKEVvvYArISkYnO1iur+qDGeYpZocipG6Flr5WvmHXvQhCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673895627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+6B4UZrziaz6WFxViTa7jcYr25cc7XnrRRhE22s9QU=; b=GykDDb5k1yUls+2uHFWB6jzlGXdXGsAPUx+yoNuoyVXLwbkIBxfkMyZOxwjo0r0+qT565x YnO3WHdfsgI5ePTJtlghufT0lxRdkJxh0LvFwFbjK2enogUXjUTuj8x1oSNzsfrs3wgOJv ehhNfPFtR7gaJTiomKnbtm/cQXZeM6SjgrU5w+JQbr5jL26vWz8AJmoBK7PMyRa5P1h9+5 ryXJd6pAWRNXfMmf8L/dPrDhzg3GgwLcL3TjZ3G1R9DMPWlNPH12Eg8iEeOesP+N0Dmpl8 /nivDUAcaJ36BsYFUg7zjoWEoPzDoM00b5Jv6eJiSWFQoEBliUYqlxNx3lxmRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673895627; a=rsa-sha256; cv=none; b=XLqfotEMkUvJTUfFkjNt4hMXLYJiceVGawMurzUTzAT6MVSuuQY9Kjxx7y7INSOGct1Bhs Kpd19RqV2Nd5ybOWz/ZalxbEa8FYiKoGwfSvDAkmsXupJ2TEAbTOUhT2Rr6v1pMhjpk8bq Bj88yLzWNlRGnFbTJ7rlWfwcHWnaP659PrkS58xXINya9TFzXpwc700BgtslNISI4bUAF+ TVviaMgDTYmxAbNrfmUD3vSCDk2K3NEsVtL+FuRTtgvE7advEKWRIMzxNj9JLZKJzTrNqj 7PW07z1II+mgOQIEzNPEobUhPpuOWz1BZuICbJtcHQ1OjX6fhfC/m7mqGsuDFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwhDW27bDz1Gvl; Mon, 16 Jan 2023 19:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GJ0Rjd031138; Mon, 16 Jan 2023 19:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GJ0RDJ031137; Mon, 16 Jan 2023 19:00:27 GMT (envelope-from git) Date: Mon, 16 Jan 2023 19:00:27 GMT Message-Id: <202301161900.30GJ0RDJ031137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ceri Davies Subject: git: 4a312c21faeb - main - lagg.4: update wireless example, document laggtype List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a312c21faebdbe68c7f99ad17130188e1e23657 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ceri (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4a312c21faebdbe68c7f99ad17130188e1e23657 commit 4a312c21faebdbe68c7f99ad17130188e1e23657 Author: Ceri Davies AuthorDate: 2023-01-16 18:53:30 +0000 Commit: Ceri Davies CommitDate: 2023-01-16 18:56:13 +0000 lagg.4: update wireless example, document laggtype The wireless example in lagg(4)'s manpage no longer works, so update. laggtype is not documented in the manpage other than in the example, so add a paragraph about it. While here, move section on rc.conf somewhere it sits more logically. Reviewed by: pauamma Differential Revision: https://reviews.freebsd.org/D31315 --- share/man/man4/lagg.4 | 51 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/share/man/man4/lagg.4 b/share/man/man4/lagg.4 index f7d8e1c5e1f5..b46566120050 100644 --- a/share/man/man4/lagg.4 +++ b/share/man/man4/lagg.4 @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2020 +.Dd January 16, 2023 .Dt LAGG 4 .Os .Sh NAME @@ -43,6 +43,18 @@ interface allows aggregation of multiple network interfaces as one virtual .Nm interface for the purpose of providing fault-tolerance and high-speed links. .Pp +Each +.Nm +interface is created at runtime using interface cloning. +This is +most easily done with the +.Xr ifconfig 8 +.Cm create +command or using the +.Va cloned_interfaces +variable in +.Xr rc.conf 5 . +.Pp A .Nm interface can be created using the @@ -79,7 +91,7 @@ the next active port is used. The first interface added is the master port; any interfaces added after that are used as failover devices. .Pp -By default, received traffic is only accepted when they are received +By default, received traffic is only accepted when it is received through the active port. This constraint can be relaxed by setting the .Va net.link.lagg.failover_rx_all @@ -123,18 +135,6 @@ disabling the interface itself. .El .Pp -Each -.Nm -interface is created at runtime using interface cloning. -This is -most easily done with the -.Xr ifconfig 8 -.Cm create -command or using the -.Va cloned_interfaces -variable in -.Xr rc.conf 5 . -.Pp The MTU of the first interface to be added is used as the lagg MTU. All additional interfaces are required to have exactly the same value. .Pp @@ -152,6 +152,17 @@ flag. The default for new interfaces is set via the .Va net.link.lagg.default_use_flowid .Xr sysctl 8 . +.Pp +When creating a +.Nm +interface, the +.Ic laggtype +can be specified as either +.Cm ethernet +or +.Cm infiniband . +If neither is specified then the default is +.Cm ethernet . .Sh EXAMPLES Create a link aggregation using LACP with two .Xr bge 4 @@ -182,16 +193,18 @@ between wired and wireless networks using two network devices. Whenever the wired master interface is unplugged, the wireless failover device will be used: .Bd -literal -offset indent -# ifconfig em0 up -# ifconfig ath0 ether 00:11:22:33:44:55 -# ifconfig create wlan0 wlandev ath0 ssid my_net up +# ifconfig em0 ether 00:11:22:33:44:55 up +# ifconfig wlan0 create wlandev ath0 ssid my_net up # ifconfig lagg0 create # ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e 192.168.1.1 netmask 255.255.255.0 .Ed .Pp -(Note the mac address of the wireless device is forced to match the wired -device as a workaround.) +(Note the MAC address of the wired device is forced to match that of the +wireless device, +.Sq 00:11:22:33:44:55 +in this example, as some common wireless devices will not allow MAC +addresses to be changed.) .Pp The following example shows how to create an infiniband failover interface. .Bd -literal -offset indent From nobody Mon Jan 16 19:00:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NwhDX47SSz2t5SF; Mon, 16 Jan 2023 19:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NwhDX3Y6mz3mGf; Mon, 16 Jan 2023 19:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673895628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41yH3aL57qmKbX8UgQGJd45Dm1Xk1Vr7rhUIUHKRIUw=; b=w1Uk0h1WOhoEQTtRSEaeens977dCTu8Q9yJNfF0rltHOITgwdRQJwYU2vyAsKu2vMEJ8Lz sqNIfLAvgJQWKVSNEkDfwiOGJikbN1ro8uGj7xn0wPNXjE/vfnNM0A2y24tQNN19x50sHe ziQTvKzKYeOlqawHWvUUxKxPO/G+ipFJZPCdKN3fB08K6eHg56ihguQaPvv4HlRvRRE1RE rn7ZzPc6ldiLtOb5MRojlhoX9XN4bBibcjnJMnXj2GPsu0eTxF0hMqRRUrdBJyQiCw8ohs befvovbC5edDdc1/R8iyB2mVNRQh8nxi+2B+NUdjA1mRnwJ5KDhrMeoe2KdMxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673895628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41yH3aL57qmKbX8UgQGJd45Dm1Xk1Vr7rhUIUHKRIUw=; b=FJL9on6AFugBd4kcnKS2Cz4p3aAIOMxft1ksmVcAd7WBe+NfoaDRni87qMsPrGHf1izI03 GqcXenhs1VnCsMpLcb8EvAQCUD+h5MCv2JjCwQamP8LbTWHgsHTfcis+4Sc2Qo2lQLqVfX n5UgexHFvODWeHfUKA540OApokXDK7cgWXJVT98r0R6xIDKElhg8dYSHqNy/2nyCecJCWF 7M8rXlx+qpsOCVfX1a00gAYBFD3SWuioBAbtdJ9yPEc2Ia3uRcAGts1kEPf+V73eUryO33 Qndzhw730S6dZU/3mrH82GA92Q3ZeZJhMdpaithqwxHr0PSs66Fo6PerReW0OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673895628; a=rsa-sha256; cv=none; b=Ngsl7hk1oUwmXxxIf2kzP+EQj1oY8PiPR4c7Edsh/xatarY0+rCPdaOQcLSYhSf+vNlbkd iEyKS0qrohYqJoL7x5Sd8kOTGaW3E/W85vDYc9WEqxOC5UweFw+yh9rUJNTZVD9F86/pu1 ImusekSbKFfm/rlZsK5Ki9d0Eo1IvJVXMhFfnT/D6TWaaOyXRTdlBiatJlgrBccqr1XS1D aP+SLgJyDV/fPh8O1x2iXGblqVpr4OKWfa/HtFJnJ0iyWUvzY7J50wK3xrBLiMEkxblvke hO9Umi8yrrDkbxqvZ8AzYZxchrYl8Vgk3q4CFR9Oyw364XapgndDFY4s2jP2sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NwhDX2fXzz1HWQ; Mon, 16 Jan 2023 19:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GJ0SRC031166; Mon, 16 Jan 2023 19:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GJ0S1N031165; Mon, 16 Jan 2023 19:00:28 GMT (envelope-from git) Date: Mon, 16 Jan 2023 19:00:28 GMT Message-Id: <202301161900.30GJ0S1N031165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ceri Davies Subject: git: d9499d3f47f2 - main - bsdconfig: correct name of the wpa_supplicant config 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9499d3f47f21d28074e5a82daf82784081a37a4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ceri (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d9499d3f47f21d28074e5a82daf82784081a37a4 commit d9499d3f47f21d28074e5a82daf82784081a37a4 Author: Ceri Davies AuthorDate: 2023-01-16 18:56:45 +0000 Commit: Ceri Davies CommitDate: 2023-01-16 18:56:45 +0000 bsdconfig: correct name of the wpa_supplicant config file Approved by: maintainer timeout (dteske) Differential Revision: https://reviews.freebsd.org/D37750 --- usr.sbin/bsdconfig/include/messages.subr | 6 +++--- usr.sbin/bsdconfig/share/media/wlan.subr | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bsdconfig/include/messages.subr b/usr.sbin/bsdconfig/include/messages.subr index 47ef6876854b..de8a374728ea 100644 --- a/usr.sbin/bsdconfig/include/messages.subr +++ b/usr.sbin/bsdconfig/include/messages.subr @@ -67,7 +67,7 @@ msg_canada="Canada" msg_cancel="Cancel" msg_cancel_exit="Cancel/Exit" msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied" -msg_cannot_edit_wireless_ssid="Cannot edit wireless configuration; no matches for\nSSID \`%s' in wpa_supplicants.conf(5)" +msg_cannot_edit_wireless_ssid="Cannot edit wireless configuration; no matches for\nSSID \`%s' in wpa_supplicant.conf(5)" msg_cannot_resolve_hostname="Cannot resolve \`%s'! Are you sure that your\nname server, gateway and network interface are correctly configured?" msg_cant_find_distribution="Warning: Can't find the \`%s' distribution on this\nFTP server. You may need to visit a different server for\nthe release you are trying to fetch or go to the Options\nmenu and set the release name to explicitly match what's\navailable on %s (or set to \"any\").\n\nWould you like to select another FTP server?" msg_cant_seem_to_write_out_resolv_conf="Can't seem to write out %s. Net cannot be used." @@ -144,7 +144,7 @@ msg_finance_desc="Monetary, financial and related applications." msg_finland="Finland" msg_floppy="Floppy" msg_forget_all="Forget All" -msg_forget_all_confirm="WARNING! Are you really sure you want to forget all known networks\nby re-initializing wpa_supplicants.conf(5)? This cannot be undone." +msg_forget_all_confirm="WARNING! Are you really sure you want to forget all known networks\nby re-initializing wpa_supplicant.conf(5)? This cannot be undone." msg_forget_all_help="Reset wpa_supplicant(8) configuration, forgetting all known networks" msg_found="found" msg_france="France" @@ -368,7 +368,7 @@ msg_shells_desc="Various shells (tcsh, bash, etc)." msg_show_all="Show All" msg_show_all_help="Show wireless networks without an SSID and all BSSIDs" msg_show_configured="Show Configured" -msg_show_configured_help="Show networks configured in wpa_supplicants.conf(5)" +msg_show_configured_help="Show networks configured in wpa_supplicant.conf(5)" msg_show_scan_results="Show Scan Results" msg_show_scan_results_help="Show wpa_cli(8) scan results" msg_skip="Skip" diff --git a/usr.sbin/bsdconfig/share/media/wlan.subr b/usr.sbin/bsdconfig/share/media/wlan.subr index f25cddff94cd..55910b77daf2 100644 --- a/usr.sbin/bsdconfig/share/media/wlan.subr +++ b/usr.sbin/bsdconfig/share/media/wlan.subr @@ -781,7 +781,7 @@ f_dialog_scan_wireless() # f_dialog_wireless_edit $ssid # # Display a menu to allow the user to either create a new entry for the -# wpa_supplicants.conf(5) file, or to edit values for an existing entry. +# wpa_supplicant.conf(5) file, or to edit values for an existing entry. # # If more than one wireless network is found to match $ssid, a sub-menu is # presented, allowing the user to select the desired network. @@ -914,7 +914,7 @@ f_dialog_wireless_edit() # # XXXDT Unfinished # This is where we display a menu that edits the entry - # And then we modify the wpa_supplicants.conf(5) config file + # And then we modify the wpa_supplicant.conf(5) config file # XXXDT Unfinished # @@ -1208,7 +1208,7 @@ f_menu_wpa_scan_results() # f_dialog_menu_wireless_edit # -# Display a list of wireless networks configured in wpa_supplicants.conf(5) and +# Display a list of wireless networks configured in wpa_supplicant.conf(5) and # (if wpa_supplicant(8) is running) also displays scan results for unconfigured # wireless networks. # @@ -1247,7 +1247,7 @@ f_dialog_menu_wireless_edit() fi if [ "$do_parse" -a "$DIALOG_MENU_WLAN_SHOW_CONFIGURED" ] then - f_dprintf "$funcname: Parsing wpa_supplicants.conf(5)" + f_dprintf "$funcname: Parsing wpa_supplicant.conf(5)" f_wpa_supplicant_parse "$conf_file" \ WIRELESS_ NWIRELESS_CONFIGS f_dprintf "%s: Parsed %i wireless configurations" \ @@ -1262,7 +1262,7 @@ f_dialog_menu_wireless_edit() # # Add both items scanned from the airwaves and networks - # parsed from wpa_supplicants.conf(5). Latter items are + # parsed from wpa_supplicant.conf(5). Latter items are # marked, sorted, and added to top of list above the # former (which are unmarked and sorted separately). # From nobody Mon Jan 16 20:25:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nwk736F0sz2p4Zx; Mon, 16 Jan 2023 20:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nwk735dY1z3vtS; Mon, 16 Jan 2023 20:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673900751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x6nLepyWpMz843m8LzUUoge0YBH0oRH53Rogn87Udi8=; b=ZxAdcYEk43M1RBZs9iITviTthmoZJj+ZvNJBQmxrIam6+UZ78XnFl2I/r6O37kP0LQ5Sn9 CP6X6+pgFS6iXjIREeqxsdtc2knk0AciL9rTrUdTj1og/gC4xRNeYBKo8F14sEPkz+PVSA 9Keg3d6EtczZ01Pvmcw6EPbc3ZBLShXzmVbeLMSiKOeZblxVAJtXMcdQcORauJQfXU4vyy k2eVey056hoXoSuXT79E7rXwCLO+0h2TUnqRQzxFPPBFFLbCgAukV8v9UvMk8SDibZzen9 01N2bck0iKZij1QchZNdtNfYrvs7HWHJycKHFhoPZK7bcIKwwZlDCy+kt2M7+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673900751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x6nLepyWpMz843m8LzUUoge0YBH0oRH53Rogn87Udi8=; b=KbOYFQeE/3t28t85unxT+RiPqsUs+mVBhG5jIFgIeOVDfqVt61FiosR3pFfqd54mx95uL5 w6d7npFzNT00Q3B6CC3GKVq1fWPa9wTHLlZj93dKtHd9LVG5H9YlOZR1nrRsQixqpHCGLl H56RdsQGt3VZ55jy7pXr9ChH5bmNyq2+a6WWCikrno1rpLzauI01gKMXWUJCke+HnOG1jV BK1ZwsvK5qeD9Nou8vICDapiipStX1k9+iB2rCIHn6hEBQY/gUwUSuOTjTmxz4AnRus/Yh 9n8Kyy+KUHJ+nW2mSLPZJcKoa8gyi5kzLMVeJumUP9GWMS1zcBj1WT/PCfbCXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673900751; a=rsa-sha256; cv=none; b=KRn7hmO/l09rsNQ5G1W2+oQe3RUNxFgHVtVwmwP8pccKvndtci30DZOaoPB4FtmZpTZndL RRWMyB0uDQ0JCFMdSzB7H9/EGElRqUMBEKpagfYjimmaxqODfBhfDWlx0sWq8/g2txAezq NIkUlZBto439k4s2C1e9Rj94AclM9SZ1DQvO91YnGe4n10XNO3XUl5cbcFoe998EkVHzZC cB1ZPWj95oPCJgSNtygStB7WQtcEM7P4oK12wK3zu+d+Z0pczgZcl3jMmLrGB5ChUnkTH3 nxBwweA973d6324LkKR0hdIte6SBBFCiq+9YfSJgXg/zXF1krxL9piF4vC18Ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nwk734gFtz1KbG; Mon, 16 Jan 2023 20:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30GKPp13051242; Mon, 16 Jan 2023 20:25:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30GKPpVC051241; Mon, 16 Jan 2023 20:25:51 GMT (envelope-from git) Date: Mon, 16 Jan 2023 20:25:51 GMT Message-Id: <202301162025.30GKPpVC051241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7f2109f240c2 - main - netlink: add snl(3) manpage to the 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f2109f240c2cdb916ca0047422ccfb2a697cee7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7f2109f240c2cdb916ca0047422ccfb2a697cee7 commit 7f2109f240c2cdb916ca0047422ccfb2a697cee7 Author: Alexander V. Chernikov AuthorDate: 2023-01-16 20:24:49 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-16 20:25:44 +0000 netlink: add snl(3) manpage to the build --- share/man/man3/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 872aec1e83ab..a72c5ac8c31f 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -27,6 +27,7 @@ MAN= arb.3 \ queue.3 \ sigevent.3 \ siginfo.3 \ + snl.3 \ stats.3 \ stdarg.3 \ sysexits.3 \ From nobody Tue Jan 17 00:33:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nwqcn1NB8z2sphq; Tue, 17 Jan 2023 00:33:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nwqcn0kFmz4Jpp; Tue, 17 Jan 2023 00:33:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673915609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1W0liMEmEU6PveZVjCVPPhRnVmaSlllJdJQOS2BvEc=; b=tHd2/XW4MWbELN3NqWRhAW4UVPAlHAM5YOjIMaHaDnGE/Y4yoQur5Bn6iELuGE8QvSxzxP 846TomKC/b34rkCEfEhwNkVK84tOqJK5LjfW2Mi4auMFAIegduXpXPEz92jAACCEzI78Vc Syi9wqztKG0kqz6q2u2c+ouvOD6kqtmQxtnBFZvRIWFSzDA8c/i/9lLzjwOSLrQc/LIIMO MouGgP5l4xHDvtuzhB401+7C2CCGGBRx4ET7+4a9VTdwqpzc6DXHwG3/NZYOAGClult0da plSP/Pt3W9p/lin347MzgACNh+YbGTSgAxphorH3rbbgo+iZZajoKpytaV/X7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673915609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1W0liMEmEU6PveZVjCVPPhRnVmaSlllJdJQOS2BvEc=; b=wJ5X/7z4vUP2QQ7lWcZVWQOapqh91xGF+7ogXtG5Ng2rQZk4AxWIA/c7Dh5tgYBqdH/yxO 1RSP4+eGZtqgekAAAJi3ppIxbLXwBapNJL6C7KjGnAVwLCmpIWnJlJLjuoaCEFM04BzidL sxr3v7KVQkoA8Wr95QR2IuMVpi/phc01+uHZpSIQxJeiPGIoRo0vmjSYuVdCf7PtGNSo5y P24mqBFxqQZUEJ47IvtMqmwzwsztutUyvCBD7kDOSmn6z284JzyVxWTfAaTjDArMGyAGLh 8IvDsd4DG1Ki1DKvRsMoY0rII6/kcp1s5ZeVOHkmjg4i1yB3UWSJTI4uM3A5xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673915609; a=rsa-sha256; cv=none; b=gIKf1zLQSmnhz2WaOPPtAY6nVY+BZK4uXVFy36P6Ng4iqbUmasOD9c0A+m6/46yZBwa1As 07jWKPHKH38hB3II4NizMl6PU6C+GpbsVlXZlomBGGk/dPP8IJ9u6LFVi0M4lgLVQDgGtz VPz8YVm5MxLQhSaU7SNdPjztSwwQccppCOmbMLuloeUPGoSAmY9MWQW0hSHJm2R3H5bXab ExCtg/UBfBw+wfxzFMOVzFKve+mRwHlmlHyRZaHYU+qDMEIAd4MMA4188wyTnG77139Gn3 fs1pK5b+sbO6pXTCQf80zYu2euRbY6ti4pXlWmUB93ie6V/7W68rE9734P0HEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nwqcm6sg4z1R2L; Tue, 17 Jan 2023 00:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30H0XSQT021370; Tue, 17 Jan 2023 00:33:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30H0XSH5021369; Tue, 17 Jan 2023 00:33:28 GMT (envelope-from git) Date: Tue, 17 Jan 2023 00:33:28 GMT Message-Id: <202301170033.30H0XSH5021369@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: de1ce17d2305 - stable/13 - dma: dma.conf.5 as MLINK to dma.8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: de1ce17d2305d34152ed50c4bb68960d41da6c69 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=de1ce17d2305d34152ed50c4bb68960d41da6c69 commit de1ce17d2305d34152ed50c4bb68960d41da6c69 Author: Ed Maste AuthorDate: 2023-01-04 18:47:26 +0000 Commit: Ed Maste CommitDate: 2023-01-17 00:32:59 +0000 dma: dma.conf.5 as MLINK to dma.8 There's no separate man page for dma.conf, but the format is documented in dma.8. Reviewed by: bapt MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37944 (cherry picked from commit 45396fda8b73146d3980797d48704184a5aa99ff) --- libexec/dma/dmagent/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/dma/dmagent/Makefile b/libexec/dma/dmagent/Makefile index f7f127cf4e7e..f56b16a0b6f0 100644 --- a/libexec/dma/dmagent/Makefile +++ b/libexec/dma/dmagent/Makefile @@ -18,6 +18,7 @@ SRCS= aliases_parse.y \ spool.c \ util.c MAN8= dma.8 +MLINKS= dma.8 dma.conf.5 CONFS= dma.conf CONFSDIR= ${CONFDIR}/dma YFLAGS+= -i From nobody Tue Jan 17 06:51:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx00m71y9z2pSQq; Tue, 17 Jan 2023 06:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx00m6c6Sz3HXg; Tue, 17 Jan 2023 06:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673938280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rMliBVkZ43aqlA4es5fQmfiVb/HyBFQc0d11z24cafA=; b=M9ayWz1UBtT+77jxQKAsImxfZG9so5xn6kxUfbHaBia/kX/HNEwUwXIpNUAhlTdSR0niCi mirKB4+MCUoU1WNynsHzJEADZ8+MktjQeWLW+Ep28R7rC25R81112Nn4lstv7vr0uVfUW/ DJUX8PGwNCfDT4cJye6ZOtNeLHPPR7qiOAVFmT+wuTQY5gaFwYRLxEGzIJJnMf1/QvkRUr uCCSSFT0ll7WVUn/Cs+bSd262/OnAnQTP+/ZNmQ+/3HqeHVPoytmKavYGY5DrB34ZNzutG rsTnRAhAyo+Z0xCB8FSG/yGx2qZOtqgCvcHe95fXqp1bPIIrbE2p0eDObXyT+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673938280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rMliBVkZ43aqlA4es5fQmfiVb/HyBFQc0d11z24cafA=; b=RgzHO3+Gr17jHHigwuvKxRTKJZaKZNCIEsXFURuXKQxS32R1xbnQCNjcgUEgwpgxTYWxjI jr0TKy1Jd8/pHMx5lahHx0kYkbXUCY9F9mJeX7Qr4rN1OWCdBiKZqWjme0WGnt0VM/MN1l CdI1a60OgqN01nUxxx1EzodqINenX+BecyX1gDgJ4kLvtNveu62HmDXEtGMMe9aaNCuFtr /+es3o+i3xjyLLlxem1I4JBNfXnB7KklASJ9i65zqDnPxXHGJbYoNhxELZMB79xklhj3Wc +2pcTlTi96RvTyftBDxS1yebUjGmgacv7M3tEHzU9nLKCMrhTmUfAMf3gli3MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673938280; a=rsa-sha256; cv=none; b=KZFVWlvVzbdLEpfS341SC8OItexPbGdr9Zaoa7lmLY+YZpcFEc2P4kDiktFw2+b8lykWGv IEkGoxsM0mmeYM2fkHr0ot92Kr32WyMKke+aAaEL7E+cCmnsajwCDncYlFobPplUcGyH0t Fap3T6R8Opkmv17J0q8+i/i54q4RbuDO+zuh2O3fFnplrfgNaQWnmNfukXn+dyntSpO3b7 sE+c5shLIh9KyVOWw7qvJmMqVq2RS48YR3QgWDNncGdTUGca9n4tioIWUOpUcD1FBrcb2d a3Lk8MMblJGfsJheE3VcfqFhNthg/fg5Ix6ObpeKmDr6B/nfZEVhIay2/wzkEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx00m5fm1zMqW; Tue, 17 Jan 2023 06:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30H6pKYA059913; Tue, 17 Jan 2023 06:51:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30H6pKGs059912; Tue, 17 Jan 2023 06:51:20 GMT (envelope-from git) Date: Tue, 17 Jan 2023 06:51:20 GMT Message-Id: <202301170651.30H6pKGs059912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gregory Neil Shapiro Subject: git: 021562c5020d - main - Sync with vendor sendmail 8.17.1 cf/cf/submit.mc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gshapiro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 021562c5020dd63d6b812369a9020b3b8147bfbd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gshapiro: URL: https://cgit.FreeBSD.org/src/commit/?id=021562c5020dd63d6b812369a9020b3b8147bfbd commit 021562c5020dd63d6b812369a9020b3b8147bfbd Author: Gregory Neil Shapiro AuthorDate: 2023-01-17 06:49:07 +0000 Commit: Gregory Neil Shapiro CommitDate: 2023-01-17 06:49:07 +0000 Sync with vendor sendmail 8.17.1 cf/cf/submit.mc --- etc/sendmail/freebsd.submit.mc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/sendmail/freebsd.submit.mc b/etc/sendmail/freebsd.submit.mc index fabc1118fa21..165c5f8eadf8 100644 --- a/etc/sendmail/freebsd.submit.mc +++ b/etc/sendmail/freebsd.submit.mc @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers. +# Copyright (c) 2001-2003, 2014 Proofpoint, Inc. and its suppliers. # All rights reserved. # # By using this file, you agree to the terms and conditions set @@ -24,3 +24,6 @@ define(`confBIND_OPTS', `WorkAroundBrokenAAAA')dnl dnl dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:0:0:0:0:0:0:0:1] FEATURE(`msp', `[127.0.0.1]')dnl +dnl enable this for SMTPUTF8 support +dnl LOCAL_CONFIG +dnl O SMTPUTF8=true From nobody Tue Jan 17 06:51:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx00p0w8Tz2pSLx; Tue, 17 Jan 2023 06:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx00p0Gq3z3Hmv; Tue, 17 Jan 2023 06:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673938282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W0xc4ytu1tHaINeVwL6e5CG/iXBgpQILxBpLvG/tO+w=; b=c6IjayPmZik1j2esgZhgcZEFSEk6KZ4K680zcTAsXZfvh+9kZDhTgI7eRPmQnatlogpDox gu0ue+E1AHXNZE8RHR6iU3GF19tJH43z8HuCyl8+x1MAktitOMDZw9GXm/zncPw4eV3Qg0 1ud/0SKWihNeaBdu07xeBwq73E7TIifhZ2iDkW+53+uJByzUh4v8B80cdexjFNSEufFXh5 omtIrMF9NPAIcIuMWs0Tmd9FHsOzhXl96jcFWarvbCa1X/7jBAN/EYcjrTtPd0JGUYqK0D WynysECXInuUXRBw/gIkpiFeHG3W2j8RkhNaFnZZWkKBIAyVj3JbAruI1SLoMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673938282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W0xc4ytu1tHaINeVwL6e5CG/iXBgpQILxBpLvG/tO+w=; b=gN5OCEgc7CfhcBv5+lgSlO+1/YOWKY9ysIR7s295shr1zG7scZX6jINFlCYIW8pOkSMQPk KyYiijMruOWJz2Wf3+TAf8wLkPWNKWl/frpiozEOiwEB/Hd+K4/N9dFqgs4w11iEQXwKpe V0i75xp3i4L1ei0ojjpv1jG2P19Z+bMkU4n8aZ6G8OFaPLhR+yrmW1oCW62583D+gYCAqj O+eYfUqiw72ZqhNvrF8JkMqrLzMUATuV+4sB8ERjkXnBbObTM8Bhg+hzKF0HnLcDeDvCzI U12lba48qHy+RkNU3bkGJ2Xb5fqHxWj3cOvJs6t5wKUQ3pNJnVsvGzNVozZDxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673938282; a=rsa-sha256; cv=none; b=M3ryk7taMy3p6WAsgVP5m7Zqe6nAhJw/ouG8MwrmwcBxw5xXBV28tmztu9DS0oW/2ya+Ju WvynKPG5DcquXNzmb6C37NKCx+a8aZ9I1QsRcqcApDiLUr7aywnSJUVcQMP4G+DDVrLmTy bbNyH7z2+vr5cPgrUlBwAgFX4uB7d9lyJTsm+a5WF9Vrftjil8FaVproMGcFRilx8F5rbU 2TQuE9Y123nMeLDRif56LtiYiD66LdFmFScUX+wjYz+6j4gDtM74Wp8BzeKUXJjqktCnZ9 jJgktl5/zBuNXfPCdTmyso85qxz9uJsbHBS11lBR7vqwmSQtyWpU7qpA0JDhkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx00n6LqvzMdf; Tue, 17 Jan 2023 06:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30H6pLke059937; Tue, 17 Jan 2023 06:51:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30H6pL7h059936; Tue, 17 Jan 2023 06:51:21 GMT (envelope-from git) Date: Tue, 17 Jan 2023 06:51:21 GMT Message-Id: <202301170651.30H6pL7h059936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gregory Neil Shapiro Subject: git: 431d2a81d421 - main - Minor changes to force commit these files so new freebsd*.cf files are built to use the new sendmail-8.17.1/cf tree. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gshapiro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 431d2a81d421d4db7a07833b4fd12015cbae5ee7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gshapiro: URL: https://cgit.FreeBSD.org/src/commit/?id=431d2a81d421d4db7a07833b4fd12015cbae5ee7 commit 431d2a81d421d4db7a07833b4fd12015cbae5ee7 Author: Gregory Neil Shapiro AuthorDate: 2023-01-17 06:49:49 +0000 Commit: Gregory Neil Shapiro CommitDate: 2023-01-17 06:49:49 +0000 Minor changes to force commit these files so new freebsd*.cf files are built to use the new sendmail-8.17.1/cf tree. --- etc/sendmail/freebsd.mc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/sendmail/freebsd.mc b/etc/sendmail/freebsd.mc index dbdfdb57ea62..97264805a67f 100644 --- a/etc/sendmail/freebsd.mc +++ b/etc/sendmail/freebsd.mc @@ -73,14 +73,14 @@ dnl NOTE: This can allow sites to use your server as a backup MX without dnl your permission. dnl FEATURE(relay_based_on_MX) -dnl DNS based black hole lists -dnl -------------------------------- -dnl DNS based black hole lists come and go on a regular basis -dnl so this file will not serve as a database of the available servers. +dnl DNS based block lists +dnl --------------------- +dnl DNS based block lists come and go on a regular basis so this +dnl file will not serve as a database of the available servers. dnl For more information, visit dnl http://en.wikipedia.org/wiki/DNSBL -dnl Uncomment to activate your chosen DNS based blacklist +dnl Uncomment to activate your chosen DNS based block list dnl FEATURE(dnsbl, `dnsbl.example.com') dnl Alternatively, you can provide your own server and rejection message: dnl FEATURE(dnsbl, `dnsbl.example.com', ``"550 Mail from " $&{client_addr} " rejected"'') From nobody Tue Jan 17 10:07:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx4Lb1fW6z2srY5; Tue, 17 Jan 2023 10:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx4Lb10dyz3mDw; Tue, 17 Jan 2023 10:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673950023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R1tZwZ7n/7Lddf1K770W3Cu/f3NjvQ9j1WeOfz2Uaag=; b=M7nIed/YqFsCr9y0VubdlxWbKExSGjfPu4gGYJbL4IMjF4MZp0zwrVlHi0vb5tH7MplQDd yH5Vs7rQl2Zv0dyW+BsXEHsYIvp2KjPVjR6hqm+9cYNrujsQuGuvrt58zskJS5YE1hPG79 /owrZfHNqZ9f5OVz0uyaIQmM4/gn8mNl7z+eK8CfCnlF4XsM4xO3gjHdmUwhOinAgsurH3 X/9e4D0hT1XGTQDhbo3D5FjxH6r3e4WDS9sVN6kgn1Uwxfsjn0VeQTNj/qdPbP1vBNPSWv znqC//8HNHSp7jswfvGzb6L5OoHQScbWBX03FzqeomV/sj655BvstU6jWbYtAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673950023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R1tZwZ7n/7Lddf1K770W3Cu/f3NjvQ9j1WeOfz2Uaag=; b=jvLr8Aq0420YzmnCBNoCHxeIjgauHhS11PIGERypwApXfvXE+VB6z6wxNQKaEuSYcgX8PF kEIr1ivWvuwFn4RNu7NZ3dRyMEFQ5IMwgpOzqNltj8Z70+QpqTA/kolyTs1GvJ6yPXAwiC 5gBRA/DaQst1Qhb8hdMPUWodvEapdQ5HHdM8XI/bOyCsHF/7DJg+KM4q0D3gkDNSKuVZ9Z BZIfauy5gpGVlvW24HSokByC8zFrwM/9L7zQr1Ck/2jUA2brMCMP9Kc0JIbHV8h5hjC755 piTGwZ/sBqlVrDCLTQpD6ey8Y1zmnMMA4JVy1ZCiJZLcsYzwExVPCXrlv3mm2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673950023; a=rsa-sha256; cv=none; b=m4oEndyYFeAXbRk/MbwicjXt7lY/9jow6fRY9/c1sDfElkp5SYE2TI3zxef42fm2zmU4cK BjVKxj1kIBY0gzeAONs6OiglYgWUj8P1ZB+V4WNbJwdJrGCuYypqGtze7bVoojEG8eu7pQ bSfHKXeMJ6Suu7M7dXY7rOtVzabFCB9W72nZmHm0z3dOjLdgY04RMOwUzCuO7BsmtDNvuT qUJUybfdfGqnP6WKMzGMy5D7Ejh5eLIBoBZApfVI87Jp3CcgY+YyvSABYZNKgpiGp9gyYE ZZPDaG9PpIm1DTWdsL2zd9KRCzfOZHrjgerxf++7ObuHOsiSj8nye9o5ejB5+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 4Nx4LZ74S0zRkW; Tue, 17 Jan 2023 10:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HA72P7034936; Tue, 17 Jan 2023 10:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HA726I034935; Tue, 17 Jan 2023 10:07:02 GMT (envelope-from git) Date: Tue, 17 Jan 2023 10:07:02 GMT Message-Id: <202301171007.30HA726I034935@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: cef7ab70ff44 - main - netcat: Allow nc to be an if_tun tunnel broker List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: cef7ab70ff44955b97e543fd03e664c89ce05bc3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=cef7ab70ff44955b97e543fd03e664c89ce05bc3 commit cef7ab70ff44955b97e543fd03e664c89ce05bc3 Author: Tom Jones AuthorDate: 2023-01-17 10:02:06 +0000 Commit: Tom Jones CommitDate: 2023-01-17 10:05:49 +0000 netcat: Allow nc to be an if_tun tunnel broker Reviewed by: kevans Relnotes: yes Sponsored by: Zenarmor Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37435 --- contrib/netcat/nc.1 | 9 ++++++++- contrib/netcat/netcat.c | 27 +++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/contrib/netcat/nc.1 b/contrib/netcat/nc.1 index 2627920cca15..9f8696135f35 100644 --- a/contrib/netcat/nc.1 +++ b/contrib/netcat/nc.1 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2020 +.Dd January 17, 2023 .Dt NC 1 .Os .Sh NAME @@ -47,6 +47,7 @@ .Op Fl p Ar source_port .Op Fl s Ar source .Op Fl T Ar toskeyword +.Op Fl -tun Ar tundev .Op Fl V Ar rtable .Op Fl w Ar timeout .Op Fl X Ar proxy_protocol @@ -240,6 +241,12 @@ to send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. This makes it possible to use .Nm to script telnet sessions. +.It Fl -tun Ar tundev +Causes +.Nm +to use the provided +.Xr tun 4 +for input and output rather than the default of stdin and stdout. .It Fl U Specifies to use .Ux Ns -domain diff --git a/contrib/netcat/netcat.c b/contrib/netcat/netcat.c index eb3c7544be76..65266b99c28e 100644 --- a/contrib/netcat/netcat.c +++ b/contrib/netcat/netcat.c @@ -112,6 +112,7 @@ int rtableid = -1; int timeout = -1; int family = AF_UNSPEC; +int tun_fd = -1; char *portlist[PORT_MAX+1]; char *unix_dg_tmp_socket; @@ -144,6 +145,10 @@ void add_ipsec_policy(int, int, char *); char *ipsec_policy[2]; #endif +enum { + FREEBSD_TUN = CHAR_MAX, /* avoid collision with return values from getopt */ +}; + int main(int argc, char *argv[]) { @@ -156,12 +161,13 @@ main(int argc, char *argv[]) socklen_t len; struct sockaddr_storage cliaddr; char *proxy; - const char *errstr, *proxyhost = "", *proxyport = NULL; + const char *errstr, *proxyhost = "", *proxyport = NULL, *tundev = NULL; struct addrinfo proxyhints; char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct option longopts[] = { { "no-tcpopt", no_argument, &FreeBSD_Oflag, 1 }, { "sctp", no_argument, &FreeBSD_sctp, 1 }, + { "tun", required_argument, NULL, FREEBSD_TUN }, { NULL, 0, NULL, 0 } }; @@ -326,6 +332,9 @@ main(int argc, char *argv[]) if (Tflag < 0 || Tflag > 255 || errstr || errno) errx(1, "illegal tos value %s", optarg); break; + case FREEBSD_TUN: + tundev = optarg; + break; case 0: /* Long option. */ break; @@ -365,6 +374,13 @@ main(int argc, char *argv[]) if (family == AF_UNIX) errx(1, "cannot use -U and --sctp"); } + if (tundev != NULL) { + if (!uflag) + errx(1, "must use --tun with -u"); + tun_fd = open(tundev, O_RDWR); + if (tun_fd == -1) + errx(1, "unable to open tun device %s", tundev); + } /* Get name of temporary socket for unix datagram client */ if ((family == AF_UNIX) && uflag && !lflag) { @@ -564,6 +580,8 @@ main(int argc, char *argv[]) if (s) close(s); + if (tun_fd != -1) + close(tun_fd); exit(ret); } @@ -840,7 +858,7 @@ readwrite(int net_fd) stdin_fd = -1; /* stdin */ - pfd[POLL_STDIN].fd = stdin_fd; + pfd[POLL_STDIN].fd = (tun_fd != -1) ? tun_fd : stdin_fd; pfd[POLL_STDIN].events = POLLIN; /* network out */ @@ -852,7 +870,7 @@ readwrite(int net_fd) pfd[POLL_NETIN].events = POLLIN; /* stdout */ - pfd[POLL_STDOUT].fd = stdout_fd; + pfd[POLL_STDOUT].fd = (tun_fd != -1) ? tun_fd : stdout_fd; pfd[POLL_STDOUT].events = 0; while (1) { @@ -1440,6 +1458,7 @@ help(void) \t-n Suppress name/port resolutions\n\ \t--no-tcpopt Disable TCP options\n\ \t--sctp\t SCTP mode\n\ + \t--tun tundev Use tun device rather than stdio\n\ \t-O length TCP send buffer length\n\ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ @@ -1500,7 +1519,7 @@ usage(int ret) #endif "\t [--no-tcpopt] [--sctp]\n" "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" - "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" + "\t [--tun tundev] [-V rtable] [-w timeout] [-X proxy_protocol]\n" "\t [-x proxy_address[:port]] [destination] [port]\n"); if (ret) exit(1); From nobody Tue Jan 17 10:07:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx4Lc2mlXz2srY8; Tue, 17 Jan 2023 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx4Lc1jJMz3mKW; Tue, 17 Jan 2023 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673950024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s5fioCjovvMIxZhycHDvIxJ4TGK7Y+DHGuI5NXEwmF8=; b=QQSZFLjdD8mOBfvxLiRRfgGQq9b0FavS59nbPkppLFKjU387Mh2H26JYQmQLCE0G+j909I w9WMZSWeNh+IkhdzCl+yBaih+szl1J2oSDcr9FuBg8IWFsS1vDEqRAo5yPcyOyW0uP3x5h qDs5rdVQ1+kFYm3mrKcFQVCFUSValdjQ0INLv5aZ9a83IvHjwZfDpNErUlAK/voDCBbU/8 SSXUV51wVVmfFsHJru7xC4AElAoy0JIfNBmwp8uFrzO8zDb9LwmelZjXFECQdHZaO35r8P eeAzeLvgaq44bJWOc2vtQ2XMK6Z+tX5j8YkdF319znTs0LTKYcORq35/8rqqzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673950024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s5fioCjovvMIxZhycHDvIxJ4TGK7Y+DHGuI5NXEwmF8=; b=VC9u9AzqeGNt4udRM/Te4IukA6czMRgWEib3KJkbVSDxkw/qetF5cfXSyR8pIWz9kJZ4Lf 1TAfm5Q84+0i4l43fM8dbebFD3C0336V4eLwq8jd2jdWdKJvsmqqAT2mRQuVpSYc0szYio zi35cTPFa27GWNUF7RoUXcjqNv83/9FwsGZTn4IQvVd0BBaPwozgfa+NrUmrXoxw0e33KJ W6uUefoGRtLrQf8QVdxm7fklkCdw6H7QlbMKeEsnbc1xYYoGP5qygZ0v5teXWjYOAnB+am GZsfEsqIQdOApi097imtzbfHCMJXCEYRm1jmAlLPQtA9FWn+bW8xJ9NU2rjXGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673950024; a=rsa-sha256; cv=none; b=EKwKJ3bxaL//RKMkreuvSNwSOjMWwmJOwHneuVTWBcWyQ6yrkA2Q59FDwp0iBYHyN6brG3 qY0UwSKb4l54g9PRZFnGEksJ2jginQTzzIunRhUjppHb4EeaBDeRE9ERrBdd0wG4nMJLIy FsJiiKTnrxTycWKcZ5hnYBiym7LvDwqPIqLqZ6giza3lJ0b+kO9zbS+JyEtPM7cOc5Wt8K 78qJQrnmrKALtEUEhf4r7xPSAumnuAplq8JjiQREme1zhmbv54iCEhnjSbmGU3YOZl6H9S XVf1QDjyttpoJgpXqcQ5nwErQ4gTw/lmb3XX/KnqeRiE6c64SSxeJWDkog9CxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx4Lc0dFKzSKy; Tue, 17 Jan 2023 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HA73se034960; Tue, 17 Jan 2023 10:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HA73nD034959; Tue, 17 Jan 2023 10:07:03 GMT (envelope-from git) Date: Tue, 17 Jan 2023 10:07:03 GMT Message-Id: <202301171007.30HA73nD034959@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: fe701c39e8aa - main - if_tun: Add basic connectivity test with nc tun support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: fe701c39e8aa270a71b5010a1eb4b488a80dcae5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=fe701c39e8aa270a71b5010a1eb4b488a80dcae5 commit fe701c39e8aa270a71b5010a1eb4b488a80dcae5 Author: Tom Jones AuthorDate: 2023-01-17 10:05:00 +0000 Commit: Tom Jones CommitDate: 2023-01-17 10:05:50 +0000 if_tun: Add basic connectivity test with nc tun support Reviewed by: kevans Sponsored by: Zenarmor Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37435 --- tests/sys/net/if_tun_test.sh | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/if_tun_test.sh b/tests/sys/net/if_tun_test.sh index 64dc004e3a06..5f05ac7c5eff 100755 --- a/tests/sys/net/if_tun_test.sh +++ b/tests/sys/net/if_tun_test.sh @@ -2,7 +2,7 @@ . $(atf_get_srcdir)/../common/vnet.subr -atf_test_case "235704" "cleanup" +atf_test_case "235704" "basic" "cleanup" 235704_head() { atf_set descr "Test PR #235704" @@ -24,7 +24,44 @@ atf_test_case "235704" "cleanup" vnet_cleanup } +basic_head() +{ + atf_set descr "Test if_tun using nc" + atf_set require.user root +} + +basic_body() +{ + vnet_init + + epair=$(vnet_mkepair) + + tun_duke=$(ifconfig tun create) + tun_bass=$(ifconfig tun create) + + vnet_mkjail duke ${epair}a ${tun_duke} + vnet_mkjail bass ${epair}b ${tun_bass} + + jexec duke ifconfig ${epair}a inet 10.0.0.1/24 up + jexec bass ifconfig ${epair}b inet 10.0.0.2/24 up + + jexec duke nc -u -l --tun /dev/${tun_duke} 10.0.0.1 2600 & + jexec bass nc -u --tun /dev/${tun_bass} 10.0.0.1 2600 & + + jexec duke ifconfig ${tun_duke} inet 10.100.0.1/24 10.100.0.2 up + jexec bass ifconfig ${tun_bass} inet 10.100.0.2/24 10.100.0.1 up + + atf_check -s exit:0 -o ignore \ + jexec bass ping -c 1 10.100.0.1 +} + +basic_clean() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "235704" + atf_add_test_case "basic" } From nobody Tue Jan 17 10:46:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx5Cy2DQ3z2sxF8; Tue, 17 Jan 2023 10:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx5Cy1ffjz3q6W; Tue, 17 Jan 2023 10:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673952382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AhwL6el7tFfHqyHeKVNe/bK6FeMJyi8MBJjo1fMgTms=; b=N0ZSxfux6eR0Tc6KMqIiOoQGa6RU3jj1oGibe6kEr4k6ngR6dyBP5YAYXRSSoVDOrrBvVb 2lOO6eYvaAEN2uJYSS2e3Ziz19uVqZ+dfrpXFl9hwO/5zkgOoyKv+YElzmXs3dyyehsz4z gw6r5kRkuqhv8L6IMH+ZM7YtBgor0fI1AQKOIrBVeuM/nLwhVS6eDa8oaPTmXywcaDGXj1 wQrsOx33hNnUfwt6Q1CKFZ/56yQb2DPEp2+QTsC7Yyg9kSS+Sdn1NCAJHKUZUtnGoou/Cw GGHM78YoApjd3qgeb2ENbRF/duuyPdfK1bq+l7iiqsKZOEe5ZdQxzs+JmcER4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673952382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AhwL6el7tFfHqyHeKVNe/bK6FeMJyi8MBJjo1fMgTms=; b=NlU0mV0yzFlHlJzwdwDKdT9ks70DH/n/V/LuGvgoZJ9hnK3WjeqI1F9dMBgZkdw87auQA9 uY3+WSukltB49+Pq9ZhCje2xYnyq0YKsiW3Wie8flQrpJrW5lXIBPOxzp5RGeLxMe7Ycwt 6w5/M+2tSl6CAywadOSuoeMEr28vBoIoEzaf5I3NqEAHfbyCYfyL4bjjnOCCVaBk6+bYph 8Jgks5aBXBK+2He+mIrn3eXOPoWq5XBD6kcOm2niT3r5w18ArhBh6fQ80zZQEh7GRMejSr VO4CHWrbh30i+R+jMMam2vcqyyCUv1UZ2mmDl8k5OpN3R4vXDkgXXrvh1oDzBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673952382; a=rsa-sha256; cv=none; b=qpQlsFcbLdyTh3HUwqImBmr8GzGkZVWhJfSXq/bBy3i3WkhqafWe9szK0RBxQZL+oUZhz8 pJUZKIH0rMeyJtUZJSVQvQHVcZ50Jb9i4nsvSrURDR88OIVWbKFugN26IOX4ODoYdqy9Mu xLayPM7FX4iNXe8craHxZKChz4oGBpFVDBZsJ3sE5fU7kj8XpOTWcCwXRsmYboeAxDzsUx Tco3qODCJsjugh5438dkNpX/3GVM9iq0IgZ/6pv2+/qIbqO6f17t/6SsZV985gpo5jgAKB hL2u1JKmiD7HzHNV6hD8qSy7tK4487WoPHVUaZ8hXdv9lC48mJVHtiedU5wQAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx5Cy0gtZzT7s; Tue, 17 Jan 2023 10:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HAkM3r091457; Tue, 17 Jan 2023 10:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HAkMuB091456; Tue, 17 Jan 2023 10:46:22 GMT (envelope-from git) Date: Tue, 17 Jan 2023 10:46:22 GMT Message-Id: <202301171046.30HAkMuB091456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 986c7be472bd - main - uhci(4): Add new USB IDs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 986c7be472bd8b29bb280e72b57e6cbf1851b26f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=986c7be472bd8b29bb280e72b57e6cbf1851b26f commit 986c7be472bd8b29bb280e72b57e6cbf1851b26f Author: Dmitry Luhtionov AuthorDate: 2023-01-17 10:43:24 +0000 Commit: Hans Petter Selasky CommitDate: 2023-01-17 10:45:35 +0000 uhci(4): Add new USB IDs. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/controller/uhci_pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/usb/controller/uhci_pci.c b/sys/dev/usb/controller/uhci_pci.c index f184713ecd8c..2b38e31208f2 100644 --- a/sys/dev/usb/controller/uhci_pci.c +++ b/sys/dev/usb/controller/uhci_pci.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #define PCI_UHCI_VENDORID_HP 0x103c #define PCI_UHCI_VENDORID_VIA 0x1106 #define PCI_UHCI_VENDORID_VMWARE 0x15ad +#define PCI_UHCI_VENDORID_ZHAOXIN 0x1d17 /* PIIX4E has no separate stepping */ @@ -240,6 +241,10 @@ uhci_pci_match(device_t self) case 0x077415ad: return ("VMware USB controller"); + + case 0x1d173038: + return ("Zhaoxin ZX-100/ZX-200/ZX-E USB controller"); + default: break; } @@ -333,6 +338,9 @@ uhci_pci_attach(device_t self) case PCI_UHCI_VENDORID_VMWARE: sprintf(sc->sc_vendor, "VMware"); break; + case PCI_UHCI_VENDORID_ZHAOXIN: + sprintf(sc->sc_vendor, "Zhaoxin"); + break; default: if (bootverbose) { device_printf(self, "(New UHCI DeviceId=0x%08x)\n", From nobody Tue Jan 17 10:46:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx5Cz31ktz2sx8v; Tue, 17 Jan 2023 10:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx5Cz2K2qz3q79; Tue, 17 Jan 2023 10:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673952383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WN8z2KVKXGho/6pM2Q1fPIowfhKYnWkiQcyvFH2bW0E=; b=EjsVmMdZU84orNWLnhcZm/RZ4cU1ajsEDOuvI8C/OKQE3by59/RcESZfGfu4KOuEQ96Ha/ fqZjKBnafxlfedh/jr9FufOn0k870eQbcM8gG7EGATy5DqE+TaF+UaCn1lyr1B1iqS4gn8 68feVqfCphD8mA8qTRei5BD/IFREM9bWQkV7/3eYRym1N9WGI/ux7690NhONu1ws2W2+7u y2B62cvm+Hqzmysfp406jQgdljRZpkiXYcA4aKGFJE7ECubF13+Nr0Z92/dZKQ15/EfGmo cE4tFgkRlm8phUViGfxe4YF0VmykJQ1TJvWykl33szobdOrywoXMZ3ssaJDSKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673952383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WN8z2KVKXGho/6pM2Q1fPIowfhKYnWkiQcyvFH2bW0E=; b=ZP9+nY4bajQhmhVFj8R+2/BcgAJI6olvxysz2LAw/PqYjIwFv49+/QR1gctQW1UidBRH5d bUE+daMQ6ZCouOVpa6sUuRfN13BK1KwpLhxIpmkz90aJdAgyRT8xeWEthvxvPJEJ4/fQTi 844+s8/sCgJiW+8zZVGclevKjj8Hw2HxO31yfx80Wd2A0qw1qlgaTmfln1W3dWb8qZJBzD Ir0hxxZevba1x4/S0Vdyz9W/bfoC7iyzEfhQiwtYE7zXOXIHa12pppXRgLL6aYPGnfNtAA 5KtLaGxQ31kdgkAse4UOKlHtTm744DOHb7KXmX8jJ0uIsfZXPJjhcKnedidUgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673952383; a=rsa-sha256; cv=none; b=sjhQouUoXZ8xqKDwDDhWDodsFsCCkMuzRLZiJo5TlZTE1yl0voDH9cGvW1kTaTNU9SqgOh Cz9XAXg630PeJPAd4MpfdLwwQBW0Zl4SZLpKqxlmGm8IUA1taZUGiUyzSTPr/vzg8bF6+1 AH7HbW2iuFB155NmsmoOObgVuhFGIR6AehbzjvTaAxFt3ALjPT0lIHb45xT7ATfIXiUWXZ x5UvhrYdUqOawXnL6vJg4u0p0OhSEDV1ugTxP3dC0buTEcntO+08fcfohwU5NSM5xr3HPG 4bWeX4wpxc27v7goAQmyBa/0YhHrQ1pRr3sretemkQmKM0i6d3NF06hk5gMokQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx5Cz1LHTzSfv; Tue, 17 Jan 2023 10:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HAkNnf091481; Tue, 17 Jan 2023 10:46:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HAkNNP091480; Tue, 17 Jan 2023 10:46:23 GMT (envelope-from git) Date: Tue, 17 Jan 2023 10:46:23 GMT Message-Id: <202301171046.30HAkNNP091480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: f9237e1937a4 - main - ehci(4): Add new USB IDs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9237e1937a4e399e08ca8e5bd88a60910e74be6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=f9237e1937a4e399e08ca8e5bd88a60910e74be6 commit f9237e1937a4e399e08ca8e5bd88a60910e74be6 Author: Dmitry Luhtionov AuthorDate: 2023-01-17 10:43:33 +0000 Commit: Hans Petter Selasky CommitDate: 2023-01-17 10:45:35 +0000 ehci(4): Add new USB IDs. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/controller/ehci_pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c index bee65e603a15..4ff15a37538c 100644 --- a/sys/dev/usb/controller/ehci_pci.c +++ b/sys/dev/usb/controller/ehci_pci.c @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #define PCI_EHCI_VENDORID_NVIDIA2 0x10DE #define PCI_EHCI_VENDORID_VIA 0x1106 #define PCI_EHCI_VENDORID_VMWARE 0x15ad +#define PCI_EHCI_VENDORID_ZHAOXIN 0x1d17 static device_probe_t ehci_pci_probe; static device_attach_t ehci_pci_attach; @@ -224,6 +225,10 @@ ehci_pci_match(device_t self) case 0x077015ad: return ("VMware USB 2.0 controller"); + + case 0x1d173104: + return ("Zhaoxin ZX-100/ZX-200/ZX-E USB 2.0 controller"); + default: break; } @@ -409,6 +414,9 @@ ehci_pci_attach(device_t self) case PCI_EHCI_VENDORID_VMWARE: sprintf(sc->sc_vendor, "VMware"); break; + case PCI_EHCI_VENDORID_ZHAOXIN: + sprintf(sc->sc_vendor, "Zhaoxin"); + break; default: if (bootverbose) device_printf(self, "(New EHCI DeviceId=0x%08x)\n", From nobody Tue Jan 17 10:46:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx5D03TDqz2sx1Y; Tue, 17 Jan 2023 10:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx5D0333hz3qL9; Tue, 17 Jan 2023 10:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673952384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDXc/XFS9CuduXuE9CRCqFuF6Wd0jlXW8JolLVEB9oA=; b=Z7hXRFp1lNLu68oDU6+qmAJkLNu3vgB9zmZA2lZVpz/KLVoVL0oGH3a/crn2SukOsuJAPA vgI6nu5Nw50zXCEsleNo/MGZfmZXs05K+ntCvEDRPyWDn3+4rRw3f2jJFm2yCYxE/WLdkr DIyTBY6RL7zBdhONmnzfFH0n6+xoJex63lSX0GTNtalzlFcuhFEiYps+SFGNeiL8Cx46EM LXW6YXqJOKWlxb2ptSY9d5Z5jxq4KiFPPnK7efAGh+ImbU0YuyqCOK5/7hq6bNptxafU7x giqaat3eyE9j/zJnZ8a8B8pP7dkSEzjmPDacYRtJVnpMHlkYvkssH4HCMALSnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673952384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDXc/XFS9CuduXuE9CRCqFuF6Wd0jlXW8JolLVEB9oA=; b=TgL/FmvfjhCW5wSe1JytxVkXWq72DgLaYQzUULbyNs+zBSLxytWfF8r+b1xoKBKtNZAII5 BTmsm8hIpwWkze2XhgrOGbdcO9bJxzRzi0PPgLTCfbwm+JKMZ+KjVF4B/7+bRi9lhFINLk IMH8NOFneeXNG8bIpHMAMUPrtRNyr6Q1/OxdOvfIskZdQ7cFrC0SKuljaKApyB2yVl5Nxt evn5ILBRvoBLkHJpqLPMt0ZWvILCceD5RkEN7K38oaDhblXLOVqbjaJVRMt0p7ovP7Ah8b VWjnEHp+F+8cr9EGC03Enidf8Nja+95fgSlYl3vAt/92T3OtqM+E4kNKSm0rGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673952384; a=rsa-sha256; cv=none; b=eWFx+1spvRJCrcOgAEZV9TIiq4Db/pGpEVleD+rQOBpUbaSJy7143wh+t0s+nazkVbcs8u grO+hNyGlhHk0MNF9cT3a/c1jWVoitav2UXyRz8cAPp2vG4HsMw+aQJphnkEkyXUwDNWla TpbJ/MOBpLOLuKTzCt7K2/l/SXVrsLk+OMxqHtXMh80r8sArhl1/FZ7qX9NRQRK6lbyDXc py1ani+cQjagag+pDCte9hwQavI7I+ZkZw4t/1GuL7tDmyRUcnGVI+9V2ojmRmhrsA+6/x yIXPQXY2aHHXdU9EmlvC+b0tayUt90AhVwVHBWnKOohGhOWEgWi6bjJnlYAv3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx5D026nXzSvk; Tue, 17 Jan 2023 10:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HAkO9R091512; Tue, 17 Jan 2023 10:46:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HAkOO4091511; Tue, 17 Jan 2023 10:46:24 GMT (envelope-from git) Date: Tue, 17 Jan 2023 10:46:24 GMT Message-Id: <202301171046.30HAkOO4091511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 0d7064d58f89 - main - xhci(4): Add new USB IDs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d7064d58f897c95c3bd319b497f70c8177e0de6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=0d7064d58f897c95c3bd319b497f70c8177e0de6 commit 0d7064d58f897c95c3bd319b497f70c8177e0de6 Author: Dmitry Luhtionov AuthorDate: 2023-01-17 10:43:40 +0000 Commit: Hans Petter Selasky CommitDate: 2023-01-17 10:45:35 +0000 xhci(4): Add new USB IDs. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/controller/xhci_pci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index 890eec4f0169..3fff1ec1db01 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #define PCI_XHCI_VENDORID_AMD 0x1022 #define PCI_XHCI_VENDORID_INTEL 0x8086 #define PCI_XHCI_VENDORID_VMWARE 0x15ad +#define PCI_XHCI_VENDORID_ZHAOXIN 0x1d17 static device_probe_t xhci_pci_probe; static device_detach_t xhci_pci_detach; @@ -205,6 +206,13 @@ xhci_pci_match(device_t self) case 0x1ada10de: return ("NVIDIA TU106 USB 3.1 controller"); + case 0x1d179202: + return ("Zhaoxin ZX-100 USB 3.0 controller"); + case 0x1d179203: + return ("Zhaoxin ZX-200 USB 3.0 controller"); + case 0x1d179204: + return ("Zhaoxin ZX-E USB 3.0 controller"); + default: break; } @@ -393,6 +401,9 @@ xhci_pci_attach(device_t self) case PCI_XHCI_VENDORID_VMWARE: strlcpy(sc->sc_vendor, "VMware", sizeof(sc->sc_vendor)); break; + case PCI_XHCI_VENDORID_ZHAOXIN: + strlcpy(sc->sc_vendor, "Zhaoxin", sizeof(sc->sc_vendor)); + break; default: if (bootverbose) device_printf(self, "(New XHCI DeviceId=0x%08x)\n", From nobody Tue Jan 17 13:10:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx8Q15RJ7z2p3MW; Tue, 17 Jan 2023 13:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx8Q14vCwz428m; Tue, 17 Jan 2023 13:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673961017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awy+Wyg3mq4Yt8FhasOlKAjJtwE6DLY+OvrXJKMJuGg=; b=Lbs0HTJ97dXGv0u00vn8knBvcsS5OSaNvTIxDj9mCVpLrLsyTbqF4TgeRocm1sm1RN2Bv5 nvN1G5p3bY2TzS9rYtU66RSnvhpmJty73mcpcYOqFcE26wHZdil+N4vFUhfsdPtz7Mbq7u q1rUqITY/HbbfLxx3WlM1zaF8dVRdhp46HQLGEfLPXASnkO2dH2jDScobZJYc3sCKltUKr 6o6jrZvLXuMMjznCc377wfOy3OtoTj0Z1k+jenHZv4ZDUNFqfDK++WKyTypKS8mE4V62b0 rma9zeXfYHq3jR1Ve7BUgnm8CdTPurOnv340DAoczpoXSRp7vM/fPYzMHXp9ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673961017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awy+Wyg3mq4Yt8FhasOlKAjJtwE6DLY+OvrXJKMJuGg=; b=SOm2gVmVumfY9oLp16NOQnWSfzUwUIlNvTjgn0DNJ+fCAt+hP1+cpQr4zMTEzijAlMMEJy wWn7ZZp3hNmdJYOfKucHhx36Oao1SBKlcwYO7G1+FFAwRlJCHWKlCZO2zP/i1j2cBSby6j CgDrwEA9CsKwCzS/W40YFaOAxfQVjUvheE3iHQM3b0ogzXd1Wr3iyStBjGOY4FEsExCyoI dsnRWXse1MSXaO1HoAma93q6RrBy667MYt12Ugiu97jAE5Sq/YsF8sMKpC4yCcWqejbDD4 vxas8hNSGA5VSl42YyV23BwcDAWprNOysp+ooYVoAL5DR95NxqbSvP5zhUxS8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673961017; a=rsa-sha256; cv=none; b=LV7jY/i8smUXmEGm+1a+vC27RhSnd5qvtVISoihEgt7sHsjj3vWjurd9M0zBjBhiyjVY5A hE0SjgHFS+DKff5bs99jOX7sdR7BBIe9CwL9J4jek2zTACHsWpy6V6/0v6KvXgtBXcPwyv YtaB2R5ZM7CQ4roBksDzUoagWIxI8f+fbicVOW17ARjGmtHNxkGwS0aBA/0ZBubqkGk9lM 0A4FNzjt7DpPp4uqTtaW/STO/kh/ycJrQrc4/7lndOYn/OLJgbGgFzwL+WVnuFERShQpFP cRZSG6AWIiwJhxK8o3Q2iqJ/nZUrH83nJl/+DUv5W4ep6Lwfer7QXFfWRR+HzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx8Q13xRczXl4; Tue, 17 Jan 2023 13:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HDAHsw000291; Tue, 17 Jan 2023 13:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HDAHaT000290; Tue, 17 Jan 2023 13:10:17 GMT (envelope-from git) Date: Tue, 17 Jan 2023 13:10:17 GMT Message-Id: <202301171310.30HDAHaT000290@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: e5f5ca7fee26 - main - mixer(3): remove redundant argument in _mixer_readvol() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e5f5ca7fee26179725ab2d66b5500d51fe8ae113 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e5f5ca7fee26179725ab2d66b5500d51fe8ae113 commit e5f5ca7fee26179725ab2d66b5500d51fe8ae113 Author: Christos Margiolis AuthorDate: 2023-01-17 13:08:59 +0000 Commit: Mark Johnston CommitDate: 2023-01-17 13:08:59 +0000 mixer(3): remove redundant argument in _mixer_readvol() There's no reason to pass the mixer as an argument since we can fetch it from mix_dev. No functional change intended. Reviewed by: markj, hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38076 --- lib/libmixer/mixer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index 1a448d222bb7..f81f2ff4a66b 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -37,17 +37,17 @@ #define BASEPATH "/dev/mixer" -static int _mixer_readvol(struct mixer *, struct mix_dev *); +static int _mixer_readvol(struct mix_dev *); /* * Fetch volume from the device. */ static int -_mixer_readvol(struct mixer *m, struct mix_dev *dev) +_mixer_readvol(struct mix_dev *dev) { int v; - if (ioctl(m->fd, MIXER_READ(dev->devno), &v) < 0) + if (ioctl(dev->parent_mixer->fd, MIXER_READ(dev->devno), &v) < 0) return (-1); dev->vol.left = MIX_VOLNORM(v & 0x00ff); dev->vol.right = MIX_VOLNORM((v >> 8) & 0x00ff); @@ -122,7 +122,7 @@ dunit: dp->parent_mixer = m; dp->devno = i; dp->nctl = 0; - if (_mixer_readvol(m, dp) < 0) + if (_mixer_readvol(dp) < 0) goto fail; (void)strlcpy(dp->name, names[i], sizeof(dp->name)); TAILQ_INIT(&dp->ctls); @@ -336,7 +336,7 @@ mixer_set_vol(struct mixer *m, mix_volume_t vol) v = MIX_VOLDENORM(vol.left) | MIX_VOLDENORM(vol.right) << 8; if (ioctl(m->fd, MIXER_WRITE(m->dev->devno), &v) < 0) return (-1); - if (_mixer_readvol(m, m->dev) < 0) + if (_mixer_readvol(m->dev) < 0) return (-1); return (0); From nobody Tue Jan 17 14:45:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxBX758B9z2sTPL; Tue, 17 Jan 2023 14:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxBX74VW5z4CXt; Tue, 17 Jan 2023 14:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673966743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKcZR8Oghv+NYK0TqOKC6fNRQkzw9wzWjAUyR1bBlMY=; b=AT4IxeBlx0/R32/sdYvMvIjzuWgp1wyoInOVGsdSdnZFp4YzctN1TyM4NyCYzqrx/xMXzF G5oICNImwotLjhxhRMO8MMdyEfidgZnhBJNfiMo1CgdqPh7NpwDjR+SGOZEvaNXfc1MFu6 U/IFGE9CuCcUG51o+ho/5YvhaYGGYDmPieLqMoMjRIGQoWBmHW1ZEytbYEye/cu2oWf3gk VyubT6VeEBZo4U1ns15h0QEPhjnpcLv3gcRyaepDFqtkOioLaWTsmlGjDC/bguP4rYi1o5 zROyXCqWOWC0G/zUURIWxCyVjbCXGMVa4EdlJQhx6iCyDBsjq6CbLsBhN5pcnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673966743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKcZR8Oghv+NYK0TqOKC6fNRQkzw9wzWjAUyR1bBlMY=; b=Onhha0ACPhQz65v5t2PseqSejFoFgYJgnzVXLs7P9wArj7OFYb5ImqHkPdUhQBg32HoL/l BTyLkkNai7iQpnXoESHa5NA/tl/CtHREnXBZ3r8lViQNxdU4fLgJKTTvhZdB9UJP3ToMs5 FvEcHS1hYm2RVZ5rknT0GWAGQ5kNIqib2s0x7W8XjzC9+7STRDzV2rkat8aP+hptvY1ihQ xrWvlxwDL5zSyTpM0FCeGae3VrKGB9J/IKjdXR6KCBebhjrwXi79TX+GV2paR6YHzcJBbf HE44iyNu5EHzMLAKquaWW8Hymm6b2C+ejtl7ahanIFM600qXmHvaI2q4feeIYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673966743; a=rsa-sha256; cv=none; b=bgwxCc5lu2KsWTqVavH/Bh4NfgA9m3PkwYSCxBFsPZqoJNQpKwYqwLc0BEj3pzGmIgJaSC A/Q7EymLotgJmL1bVPdnxX2JNYuRTaKUm3lricsJEm/PJSTkDcqrHzPGCsFkQewz2MmyFi dtwV2jRZkkWI9clt547QxZUur34Hf0ILVC4aI1rIlbdTvlFwajzgtPs3zEvDKKc9BprYfw K2MqcSAGgRxy/3ys1HxT0CjNbWbH0kqQx1ELOpuOMq6fPSEpN3aS9Qfdw7apnyBAfC9sZg B3JhtU82pNcmAVStBDr9HY2EwimuLmWl3M3RRz3yUC7Il+p5i19d+T45mmLOeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxBX73bgyzbPy; Tue, 17 Jan 2023 14:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HEjhFH033641; Tue, 17 Jan 2023 14:45:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HEjh8P033640; Tue, 17 Jan 2023 14:45:43 GMT (envelope-from git) Date: Tue, 17 Jan 2023 14:45:43 GMT Message-Id: <202301171445.30HEjh8P033640@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: d91be0f1211b - main - netlink: Zero-initialize mbuf messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d91be0f1211b0196a0087cdfa237a6a0d2a43b65 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d91be0f1211b0196a0087cdfa237a6a0d2a43b65 commit d91be0f1211b0196a0087cdfa237a6a0d2a43b65 Author: Mark Johnston AuthorDate: 2023-01-17 14:36:54 +0000 Commit: Mark Johnston CommitDate: 2023-01-17 14:36:54 +0000 netlink: Zero-initialize mbuf messages Some users of nlmsg_reserve_object() and nlmsg_reserve_data() are not careful to fully initialize pad and reserved fields, allowing uninitialized bytes to leak to userspace. For example, dump_nhgrp() doesn't set nhm->resvd = 0. Meanwhile, nlmsg_get_ns_buf() and nlmsg_get_ns_lbuf() zero-initialize the buffer, so nlmsg_get_ns_mbuf() is inconsistent. Let's just make them all behave the same here. Reported by: KMSAN Reviewed by: melifaro Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38098 --- sys/netlink/netlink_message_writer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 37414703c6f6..6573394eb881 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -215,6 +215,7 @@ nlmsg_get_ns_mbuf(struct nl_writer *nw, int size, bool waitok) nw->malloc_flag = mflag; nw->num_messages = 0; nw->enomem = false; + memset(nw->data, 0, size); NL_LOG(LOG_DEBUG2, "alloc mbuf %p req_len %d alloc_len %d data_ptr %p", m, size, nw->alloc_len, nw->data); return (true); From nobody Tue Jan 17 14:45:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxBX868wfz2sTZG; Tue, 17 Jan 2023 14:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxBX85NR1z4CVq; Tue, 17 Jan 2023 14:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673966744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30n47W6KlxnhgI19vWZr4Uu5639oGKopROhJU+sOIEQ=; b=JD0WdYbjj/6MAm/BARntI5FFVuJx8pXOGJ5gqCn2z6gK/kBMEwzyij4zeQX6Ms7As1qmwB 1e0iDEHTe9VEGAdcAgJ0qogejtLsQGZJQXhagk6wY2Hp+S/xRXLRRABkNvcABNFUqqgOLA 6dDl4XzyUqrsUhn0eF/L9yiSS4eYEJ6IVbRVtBFs9g5ma31YcrpiGKrcsSdZ0jQmFBfO+f Wrsa0DUdD5kLoX+RKpUQ2xs4iKpzeUaLP5BrbvAm3mvTVC1DFV/FSXSk8/Wvc1kTQG0iAE 7QwcfckyZA89HHA4SbmkxWCSri8byNieMpdCeaQib67FBJU+3KF9trUrhsxPNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673966744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30n47W6KlxnhgI19vWZr4Uu5639oGKopROhJU+sOIEQ=; b=BlzrmEsOKXz95UOTLDCKRlKP7eI4T3FasYsas2zkl0XWaA7f28Gt14iumgdK4KrTXmdB4t t9Y/9XSPv7aNyoGuiZA0hRQpE/4TbjtVyC5Ey0VT5AHcWu8RdAs8khRJ3mwe380kqGW4Sq JUnXxh0vlrDVIU3x1L6LAn7vCD6IOGvJLaA2EuAFoxEUigDgEnYvGbV6Dis5t1Y/0D6eMy hDzowI6tWSWAHjizVWZsW1xDlyiL7AVRufZ+1ZXXOtKxaI+mMDPgTTebvEZX31x+g0V7S8 Rs44q8U2JhROrKT9mTsC55vsNyEZdValdr2696EVxDa2utwYmYgRClH3U3Kb8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673966744; a=rsa-sha256; cv=none; b=C0ij22F/Wyh5ES9RclzZ8LDs6+bUSif3zOJ1fDRUyz0kf4Y92tbsfA4uwiSx8pO7bStTFY u55uiAvgvSw+jC13G1405tuO+XaJ5ersaP/MfZ1Nyq1Vb/dqUpZ1kfvUt9zNTKfpDGsJF4 /Kbe5JC+ki6S7XJ3QWcBDk0rtF0vnHReMeq2VOqp9N6gE4kaiHJ9J6enM2qq1gA9opbxvc 4Ktbpj8YTKYtw/hUwdoA7M9Y3lcyq67+irrieN6v5O4QE3var15+rlH+W+pxaWEjH869Kq CnHHxaEJz27lnp39pky5Pamo6p4OfOTqfQKoaIGDxiU4swJxNEcmQ1KKe5qyOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxBX84PftzbPr; Tue, 17 Jan 2023 14:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HEjibj033666; Tue, 17 Jan 2023 14:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HEji7c033665; Tue, 17 Jan 2023 14:45:44 GMT (envelope-from git) Date: Tue, 17 Jan 2023 14:45:44 GMT Message-Id: <202301171445.30HEji7c033665@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: e262610007f0 - main - netlink: Make the writers function table static and 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e262610007f01398630dc8ce7bf404dbcfd6350c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e262610007f01398630dc8ce7bf404dbcfd6350c commit e262610007f01398630dc8ce7bf404dbcfd6350c Author: Mark Johnston AuthorDate: 2023-01-17 14:37:21 +0000 Commit: Mark Johnston CommitDate: 2023-01-17 14:37:21 +0000 netlink: Make the writers function table static and const No functional change intended. Reviewed by: melifaro Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38099 --- sys/netlink/netlink_message_writer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 6573394eb881..0d27d5d0d47c 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -368,7 +368,7 @@ nlmsg_write_group_lbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) return (true); } -struct nlwriter_ops nlmsg_writers[] = { +static const struct nlwriter_ops nlmsg_writers[] = { /* NS_WRITER_TYPE_MBUF */ { .init = nlmsg_get_ns_mbuf, @@ -394,7 +394,7 @@ struct nlwriter_ops nlmsg_writers[] = { static void nlmsg_set_callback(struct nl_writer *nw) { - struct nlwriter_ops *pops = &nlmsg_writers[nw->writer_type]; + const struct nlwriter_ops *pops = &nlmsg_writers[nw->writer_type]; switch (nw->writer_target) { case NS_WRITER_TARGET_SOCKET: From nobody Tue Jan 17 14:45:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxBX96xZqz2sTgc; Tue, 17 Jan 2023 14:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxBX96LMGz4CpK; Tue, 17 Jan 2023 14:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673966745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5RGe2Gty5P/y9loAC7CUIglQopOxgz2XE259/IDom20=; b=AeYseixjEx8eclK2RIPTkoQDM2zGHNnW2p09d9sNwyFM3NEXpan8yzbUHjRasFc8cwHb+S 3jq3zGufuJfeh7O8RrqrzJ92C3EwYkR/BzmEcwYNaVqZg8KjKg210ZaWZXdl0mXYQ9y8Nv kKU33tg7KS3zcFIskN6R3GBUSuQ9NhJ+RwyUG1wTbREObLK+IGjq72YjGxsegJQ2leRTh+ kG7Disn2a1NGpMBLhldphxVvXJEIMUvbdSrHAE/suHWUuUy7LOXQggprgCud3Aa5OwbkcA W1lXGkiiRBtOylIXnHA5LmaFygE4jXC7lG7JRxwgEQSIhxC2+4SkNnNh+wA/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673966745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5RGe2Gty5P/y9loAC7CUIglQopOxgz2XE259/IDom20=; b=aWebsBIsIzD7saizmeR/SYZ4FQooSRGQG5mCGhJ7URcdhb+4RN+Lyh5gZzAyddC+3YUHOu dXjeXGzpjX8d5m00eql4EAw3mNeyv9iHlJYJcw8pudVUguzT0CT5150DQhmM3SdfbYI8l7 Qf5g7mzXKz15CqudbcNEZOrFQ5qKXqbYKGWmDOh4hJ7PgTukGqlCC8LG5YJOxmSG6m+jH4 jKa8OwdcwBz6nkO5aNKGPY7Xdcwh5caw2A7bwsZp4UaFS94w6skRv+8BA/WAakJhV5DErP s1OaVXYsfzf2gezTVosa9cc2LxMRZl/PSWvVFwJVnAz8DfLVV82j+UyGBiz33Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673966745; a=rsa-sha256; cv=none; b=rZplD9Pl548pAx7Ph6prye7ZHJZL+N/L6egAGX/13d/WxM6pFvnUyXaTRWUGmdPbEiH9pJ 9f63hZQhTx+KFM/QbFm9+ixYblWdoUUnl7pppNH6FhCYj8YQyAQK9iWULkq5d+yna5Dtzy 38Cb3gCnlJl6wAH0tEX3MWSoMfcOgiX2neCMiZMOb8W7GIVHheOApx3wnheEJNC1r1gImg 7opqmC7p1lFhrSShJalE8DiKXBQLvEEwpQdBoGJOvlP9Uyxeowz1YuTpNZ4l/GmK82HieV zKo19DKtMoQPDa4bP2DCea4WxPUU6by5WHHQGb+Fp3mgAPA++dC/zJQ0x5zxlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxBX95QJMzbPs; Tue, 17 Jan 2023 14:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HEjjlH033690; Tue, 17 Jan 2023 14:45:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HEjjj9033689; Tue, 17 Jan 2023 14:45:45 GMT (envelope-from git) Date: Tue, 17 Jan 2023 14:45:45 GMT Message-Id: <202301171445.30HEjjj9033689@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: 35472cb60ab9 - main - netlink: Fix indentation in netlink_message_writer.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 35472cb60ab95b4d99981492a87443022181eac2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=35472cb60ab95b4d99981492a87443022181eac2 commit 35472cb60ab95b4d99981492a87443022181eac2 Author: Mark Johnston AuthorDate: 2023-01-17 14:37:33 +0000 Commit: Mark Johnston CommitDate: 2023-01-17 14:37:33 +0000 netlink: Fix indentation in netlink_message_writer.c This file is indented with a mixture of tabs and spaces. No functional change intended. Reviewed by: melifaro Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38100 --- sys/netlink/netlink_message_writer.c | 135 +++++++++++++++++------------------ 1 file changed, 67 insertions(+), 68 deletions(-) diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 0d27d5d0d47c..2187c40f2786 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -130,7 +130,7 @@ nlmsg_write_socket_buf(struct nl_writer *nw, void *buf, int datalen, int cnt) free(buf, M_NETLINK); int io_flags = (nw->ignore_limit) ? NL_IOF_IGNORE_LIMIT : 0; - return (nl_send_one(m, (struct nlpcb *)(nw->arg_ptr), cnt, io_flags)); + return (nl_send_one(m, (struct nlpcb *)(nw->arg_ptr), cnt, io_flags)); } static bool @@ -153,7 +153,7 @@ nlmsg_write_group_buf(struct nl_writer *nw, void *buf, int datalen, int cnt) if (!success) return (false); - nl_send_group(m, cnt, nw->arg_uint >> 16, nw->arg_uint & 0xFFFF); + nl_send_group(m, cnt, nw->arg_uint >> 16, nw->arg_uint & 0xFFFF); return (true); } @@ -182,7 +182,7 @@ nlmsg_write_chain_buf(struct nl_writer *nw, void *buf, int datalen, int cnt) free(buf, M_NETLINK); return (false); } - return (true); + return (true); } @@ -203,12 +203,12 @@ nlmsg_get_ns_mbuf(struct nl_writer *nw, int size, bool waitok) struct mbuf *m; int mflag = waitok ? M_WAITOK : M_NOWAIT; - m = m_get2(size, mflag, MT_DATA, M_PKTHDR); - if (__predict_false(m == NULL)) - return (false); - nw->alloc_len = M_TRAILINGSPACE(m); - nw->offset = 0; - nw->hdr = NULL; + m = m_get2(size, mflag, MT_DATA, M_PKTHDR); + if (__predict_false(m == NULL)) + return (false); + nw->alloc_len = M_TRAILINGSPACE(m); + nw->offset = 0; + nw->hdr = NULL; nw->_storage = (void *)m; nw->data = mtod(m, void *); nw->writer_type = NS_WRITER_TYPE_MBUF; @@ -216,9 +216,9 @@ nlmsg_get_ns_mbuf(struct nl_writer *nw, int size, bool waitok) nw->num_messages = 0; nw->enomem = false; memset(nw->data, 0, size); - NL_LOG(LOG_DEBUG2, "alloc mbuf %p req_len %d alloc_len %d data_ptr %p", - m, size, nw->alloc_len, nw->data); - return (true); + NL_LOG(LOG_DEBUG2, "alloc mbuf %p req_len %d alloc_len %d data_ptr %p", + m, size, nw->alloc_len, nw->data); + return (true); } static bool @@ -235,7 +235,7 @@ nlmsg_write_socket_mbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) m->m_pkthdr.len = datalen; m->m_len = datalen; int io_flags = (nw->ignore_limit) ? NL_IOF_IGNORE_LIMIT : 0; - return (nl_send_one(m, (struct nlpcb *)(nw->arg_ptr), cnt, io_flags)); + return (nl_send_one(m, (struct nlpcb *)(nw->arg_ptr), cnt, io_flags)); } static bool @@ -251,7 +251,7 @@ nlmsg_write_group_mbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) m->m_pkthdr.len = datalen; m->m_len = datalen; - nl_send_group(m, cnt, nw->arg_uint >> 16, nw->arg_uint & 0xFFFF); + nl_send_group(m, cnt, nw->arg_uint >> 16, nw->arg_uint & 0xFFFF); return (true); } @@ -281,7 +281,7 @@ nlmsg_write_chain_mbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) (*m0)->m_pkthdr.len += datalen; } - return (true); + return (true); } /* @@ -317,7 +317,6 @@ nlmsg_get_ns_lbuf(struct nl_writer *nw, int size, bool waitok) return (true); } - static bool nlmsg_write_socket_lbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) { @@ -341,7 +340,7 @@ nlmsg_write_socket_lbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) } int io_flags = (nw->ignore_limit) ? NL_IOF_IGNORE_LIMIT : 0; - return (nl_send_one(m, nlp, cnt, io_flags)); + return (nl_send_one(m, nlp, cnt, io_flags)); } /* Shouldn't be called (maybe except Linux code originating message) */ @@ -364,7 +363,7 @@ nlmsg_write_group_lbuf(struct nl_writer *nw, void *buf, int datalen, int cnt) m_append(m, datalen, data); free(buf, M_NETLINK); - nl_send_group(m, cnt, nw->arg_uint >> 16, nw->arg_uint & 0xFFFF); + nl_send_group(m, cnt, nw->arg_uint >> 16, nw->arg_uint & 0xFFFF); return (true); } @@ -437,36 +436,36 @@ nlmsg_get_buf(struct nl_writer *nw, int size, bool waitok, bool is_linux) bool nlmsg_get_unicast_writer(struct nl_writer *nw, int size, struct nlpcb *nlp) { - if (!nlmsg_get_buf(nw, size, false, nlp->nl_linux)) - return (false); - nw->arg_ptr = (void *)nlp; + if (!nlmsg_get_buf(nw, size, false, nlp->nl_linux)) + return (false); + nw->arg_ptr = (void *)nlp; nw->writer_target = NS_WRITER_TARGET_SOCKET; nlmsg_set_callback(nw); - return (true); + return (true); } bool nlmsg_get_group_writer(struct nl_writer *nw, int size, int protocol, int group_id) { - if (!nlmsg_get_buf(nw, size, false, false)) - return (false); - nw->arg_uint = (uint64_t)protocol << 16 | (uint64_t)group_id; + if (!nlmsg_get_buf(nw, size, false, false)) + return (false); + nw->arg_uint = (uint64_t)protocol << 16 | (uint64_t)group_id; nw->writer_target = NS_WRITER_TARGET_GROUP; nlmsg_set_callback(nw); - return (true); + return (true); } bool nlmsg_get_chain_writer(struct nl_writer *nw, int size, struct mbuf **pm) { - if (!nlmsg_get_buf(nw, size, false, false)) - return (false); + if (!nlmsg_get_buf(nw, size, false, false)) + return (false); *pm = NULL; - nw->arg_ptr = (void *)pm; + nw->arg_ptr = (void *)pm; nw->writer_target = NS_WRITER_TARGET_CHAIN; nlmsg_set_callback(nw); NL_LOG(LOG_DEBUG3, "setup cb %p (need %p)", nw->cb, &nlmsg_write_chain_mbuf); - return (true); + return (true); } void @@ -479,23 +478,23 @@ bool nlmsg_flush(struct nl_writer *nw) { - if (__predict_false(nw->hdr != NULL)) { - /* Last message has not been completed, skip it. */ - int completed_len = (char *)nw->hdr - nw->data; + if (__predict_false(nw->hdr != NULL)) { + /* Last message has not been completed, skip it. */ + int completed_len = (char *)nw->hdr - nw->data; /* Send completed messages */ nw->offset -= nw->offset - completed_len; nw->hdr = NULL; - } + } NL_LOG(LOG_DEBUG2, "OUT"); - bool result = nw->cb(nw, nw->_storage, nw->offset, nw->num_messages); - nw->_storage = NULL; + bool result = nw->cb(nw, nw->_storage, nw->offset, nw->num_messages); + nw->_storage = NULL; - if (!result) { - NL_LOG(LOG_DEBUG, "nw %p offset %d: flush with %p() failed", nw, nw->offset, nw->cb); - } + if (!result) { + NL_LOG(LOG_DEBUG, "nw %p offset %d: flush with %p() failed", nw, nw->offset, nw->cb); + } - return (result); + return (result); } /* @@ -506,8 +505,8 @@ nlmsg_flush(struct nl_writer *nw) bool nlmsg_refill_buffer(struct nl_writer *nw, int required_len) { - struct nl_writer ns_new = {}; - int completed_len, new_len; + struct nl_writer ns_new = {}; + int completed_len, new_len; if (nw->enomem) return (false); @@ -515,7 +514,7 @@ nlmsg_refill_buffer(struct nl_writer *nw, int required_len) NL_LOG(LOG_DEBUG3, "no space at offset %d/%d (want %d), trying to reclaim", nw->offset, nw->alloc_len, required_len); - /* Calculated new buffer size and allocate it s*/ + /* Calculated new buffer size and allocate it s*/ completed_len = (nw->hdr != NULL) ? (char *)nw->hdr - nw->data : nw->offset; if (completed_len > 0 && required_len < MCLBYTES) { /* We already ran out of space, use the largest effective size */ @@ -530,10 +529,10 @@ nlmsg_refill_buffer(struct nl_writer *nw, int required_len) } bool waitok = (nw->malloc_flag == M_WAITOK); bool is_linux = (nw->writer_type == NS_WRITER_TYPE_LBUF); - if (!nlmsg_get_buf(&ns_new, new_len, waitok, is_linux)) { + if (!nlmsg_get_buf(&ns_new, new_len, waitok, is_linux)) { nw->enomem = true; NL_LOG(LOG_DEBUG, "getting new buf failed, setting ENOMEM"); - return (false); + return (false); } if (nw->ignore_limit) nlmsg_ignore_limit(&ns_new); @@ -543,22 +542,22 @@ nlmsg_refill_buffer(struct nl_writer *nw, int required_len) nlmsg_set_callback(&ns_new); ns_new.arg_uint = nw->arg_uint; - /* Copy last (unfinished) header to the new storage */ - int last_len = nw->offset - completed_len; + /* Copy last (unfinished) header to the new storage */ + int last_len = nw->offset - completed_len; if (last_len > 0) { memcpy(ns_new.data, nw->hdr, last_len); ns_new.hdr = (struct nlmsghdr *)ns_new.data; ns_new.offset = last_len; } - NL_LOG(LOG_DEBUG2, "completed: %d bytes, copied: %d bytes", completed_len, last_len); + NL_LOG(LOG_DEBUG2, "completed: %d bytes, copied: %d bytes", completed_len, last_len); - /* Flush completed headers & switch to the new nw */ + /* Flush completed headers & switch to the new nw */ nlmsg_flush(nw); memcpy(nw, &ns_new, sizeof(struct nl_writer)); - NL_LOG(LOG_DEBUG2, "switched buffer: used %d/%d bytes", nw->offset, nw->alloc_len); + NL_LOG(LOG_DEBUG2, "switched buffer: used %d/%d bytes", nw->offset, nw->alloc_len); - return (true); + return (true); } bool @@ -570,23 +569,23 @@ nlmsg_add(struct nl_writer *nw, uint32_t portid, uint32_t seq, uint16_t type, MPASS(nw->hdr == NULL); int required_len = NETLINK_ALIGN(len + sizeof(struct nlmsghdr)); - if (__predict_false(nw->offset + required_len > nw->alloc_len)) { + if (__predict_false(nw->offset + required_len > nw->alloc_len)) { if (!nlmsg_refill_buffer(nw, required_len)) return (false); - } + } - hdr = (struct nlmsghdr *)(&nw->data[nw->offset]); + hdr = (struct nlmsghdr *)(&nw->data[nw->offset]); - hdr->nlmsg_len = len; - hdr->nlmsg_type = type; - hdr->nlmsg_flags = flags; - hdr->nlmsg_seq = seq; - hdr->nlmsg_pid = portid; + hdr->nlmsg_len = len; + hdr->nlmsg_type = type; + hdr->nlmsg_flags = flags; + hdr->nlmsg_seq = seq; + hdr->nlmsg_pid = portid; - nw->hdr = hdr; - nw->offset += sizeof(struct nlmsghdr); + nw->hdr = hdr; + nw->offset += sizeof(struct nlmsghdr); - return (true); + return (true); } bool @@ -600,11 +599,11 @@ nlmsg_end(struct nl_writer *nw) return (false); } - nw->hdr->nlmsg_len = (uint32_t)(nw->data + nw->offset - (char *)nw->hdr); + nw->hdr->nlmsg_len = (uint32_t)(nw->data + nw->offset - (char *)nw->hdr); NL_LOG(LOG_DEBUG2, "wrote msg len: %u type: %d: flags: 0x%X seq: %u pid: %u", nw->hdr->nlmsg_len, nw->hdr->nlmsg_type, nw->hdr->nlmsg_flags, nw->hdr->nlmsg_seq, nw->hdr->nlmsg_pid); - nw->hdr = NULL; + nw->hdr = NULL; nw->num_messages++; return (true); } @@ -612,10 +611,10 @@ nlmsg_end(struct nl_writer *nw) void nlmsg_abort(struct nl_writer *nw) { - if (nw->hdr != NULL) { - nw->offset = (uint32_t)((char *)nw->hdr - nw->data); - nw->hdr = NULL; - } + if (nw->hdr != NULL) { + nw->offset = (uint32_t)((char *)nw->hdr - nw->data); + nw->hdr = NULL; + } } void From nobody Tue Jan 17 15:26:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxCQw4Mhzz2sZNr; Tue, 17 Jan 2023 15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxCQw3GK6z4K8W; Tue, 17 Jan 2023 15: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=1673969176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ATwCEDhjfP5mYtVWNLJz0cQlaxEGNe9vK6fctT5OSPM=; b=izbOsSVu0CGx+DlxtYNDpy9ebeiSKy0bG9TAfXT8hvC82YabaGbKf3UL2wT4yABrzv8iJL MZWoqlgGIt3amkuzY0L9TPpalN1Sh/9UJyYf4O+u7akTfej/qjsDkLq/RwLX/GYTErr3ML V5hcXuyWJTXY+2eUNMEe0v42ucvXG9xMRkRKLdNxE164pY/mWUXk6L33QdBKiOopz5UaPN /qQ5R0wFXnjWksmxwUSuf/SMdaFuB/IPM1IilS54ExBp8QtovD6tq98CY8+K8BAxplu8+y eZbymyISYxEpin3c+RIRDgJnraSy3SYu1xk3lkcTNMWpxkSe07a/m+ZrgWvtFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673969176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ATwCEDhjfP5mYtVWNLJz0cQlaxEGNe9vK6fctT5OSPM=; b=Zv2GloEdvBWNxtSPQuxY9eO/0KXosYM4DLMFHVQiR/4Kufmn7bwkflk1BxaTdxnt/oLdcA VsdGuLkqBfmEaIG7mOaANdZXIeuYRQ3xG+ozIgEmAicDDwAnVnp3AScbWuBH4uJ+nHB+Lp qJfg2sCTYSAC5Gt1REvWLL9zaCRSIz/oJPKlGypdlSOQxaSuaJD4Mv9uV0xsqR3X3sobhj ce1ThpKNTfG1u+VNPmkoITTTcuKCKByizulEcv3wrFmh7cLG3LHHMkcqdPtc02S7MV8jO9 v+pU2c26EvHpe2+UXVpU0KYGF55T/S0+D+kk65v+ekpeZzRc5BHQ7Oo8hH+K1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673969176; a=rsa-sha256; cv=none; b=ppjGCo+OUncMZY2NY4fDjeH2b7Z2qgJbFAw4YF/5VWEOiachcwB7UkzTC9X99jgs5BXrkL 5+NMTmbd9atwFA//Qkg7ZRFz7sk+rWPMjv894WiF3rboxUDFXsCz4S8RYSY6zxM0MxpTwI aLmvXmsLW9rnNnP7bz0wZDXwt4Ma2vLp7HqqjXKrqu4chDIvGhtyqaDXmsybFjRubHxrIS 5/wZYyZbAkhBsjfXjt0AMeYq+01NqA2NAh8G0fSz3o7lr+5klcN1+C/SkLOQn1qvEdio3Q PbnRBgGg09/SG32pexhz78I1cmX/eLu9WNNOyhZx52US8+L8unPdG2P24xKKBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxCQw2D3WzcGy; Tue, 17 Jan 2023 15:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HFQGpI090703; Tue, 17 Jan 2023 15:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HFQGSB090702; Tue, 17 Jan 2023 15:26:16 GMT (envelope-from git) Date: Tue, 17 Jan 2023 15:26:16 GMT Message-Id: <202301171526.30HFQGSB090702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: c96859847991 - main - df: Return non-zero status on write failure. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c968598479917f52022b86d0089a9835ddcf2799 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c968598479917f52022b86d0089a9835ddcf2799 commit c968598479917f52022b86d0089a9835ddcf2799 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-17 13:40:05 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-01-17 15:25:28 +0000 df: Return non-zero status on write failure. While here, complete the libxo conversion and switch return value to standard constants. MFC after: 1 week Sponsored by: Klara, Inc. Differential revision: https://reviews.freebsd.org/D38097 --- bin/df/df.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index 627d8b1c861d..9f7588a68d4f 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -204,7 +203,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - rv = 0; + rv = EXIT_SUCCESS; if (!*argv) { /* everything (modulo -t) */ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); @@ -226,14 +225,14 @@ main(int argc, char *argv[]) if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { xo_warn("%s", *argv); - rv = 1; + rv = EXIT_FAILURE; continue; } } else if (S_ISCHR(stbuf.st_mode)) { mntpt = getmntpt(*argv); if (mntpt == NULL) { xo_warnx("%s: not mounted", *argv); - rv = 1; + rv = EXIT_FAILURE; continue; } } else { @@ -246,7 +245,7 @@ main(int argc, char *argv[]) */ if (statfs(mntpt, &statfsbuf) < 0) { xo_warn("%s", mntpt); - rv = 1; + rv = EXIT_FAILURE; continue; } @@ -257,7 +256,7 @@ main(int argc, char *argv[]) * we've been given (-l, -t, etc.). */ if (checkvfsselected(statfsbuf.f_fstypename) != 0) { - rv = 1; + rv = EXIT_FAILURE; continue; } @@ -286,7 +285,8 @@ main(int argc, char *argv[]) prtstat(&totalbuf, &maxwidths); xo_close_container("storage-system-information"); - xo_finish(); + if (xo_finish() < 0) + rv = EXIT_FAILURE; exit(rv); } @@ -322,7 +322,7 @@ makevfslist(char *fslist, int *skip) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); return (NULL); } nextcp = fslist; From nobody Tue Jan 17 16:38:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxF284v5Rz2skbP; Tue, 17 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxF284Dpbz3Dnv; Tue, 17 Jan 2023 16: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=1673973504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dF/RawRwAVpX5NJ8OnT918Hpy9OW0s+M2aq7EOzXLiI=; b=deamlxWXaqQwa+eB1RexTeM5jLLSx6567XLcicAQY4g6SlUt9A7XyAX9eKyv6KBYvcXiLW oojdp/ZQtYUQ24DKMyDHGs/GvaRmNUJCZqJQ2s1qToAmhEBhN5pj0aXL2lVttlgPZUEtAZ BX22sWxpVFwDAH5AuLjFzoYmDOEE4+XOe1vILrxpkBNDAAE/Ci+/o+DkpoN7jz8rBaxcwZ 81Jf4G1Y4BQv/Q+b8GnlNhcXW2GX96YL28aFnj1cbR5lLouCX0ve6M7sQjbu2gCF9170Hk 6v+sB5W9hqI3qAEdt8yB4DA60/k3FvXB3D9QLCXNstrohwYFsvb0rL3HvnJKDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673973504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dF/RawRwAVpX5NJ8OnT918Hpy9OW0s+M2aq7EOzXLiI=; b=X+PNeCYrOFLHhQ0Na5iayItq3JwwVsstmPYAdZlx1l5CQlApdrgzkO5HiWGOWnIj7djvbJ 47RYvlU7+qwmYP1iwLkw/DBHWOhKtns8j5jZMgmta+xDV340rMEno9i2kuJN/FWA1svBEZ fgUm/R+AES6G2fEIkyb8eD846WerppknpReL7p4tzWO3CgloQYB1Xq98vg1qkX5l6VVk7K g69XncVwyLE5i46mSpbOZ+afuHgSFVkstHIU7rw3g7lhz0fMOGdr+x8Xa+37fIwn/lsC0a BBi25QLvz8lFgm7Xunl6S9G/TzvpDOXBxJIhjiyX54U7Fbc4EnFZIISAeGvK/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673973504; a=rsa-sha256; cv=none; b=kJLdbD9UjKh7rMj3Ysb9IfbjSF7NqRfOwb18/TzAFXPBrGfvZOHmpLr4NVicCfbI08tcdE JLnr8YZNtqFT3sxyYDAZjFGh4OlJGtYJwL9jNbYAU5E6/GsJOD4HiSJ8ODH3bMboeb/EO5 EYcqKwTiOPA+x9blWKxB4wqwMtnJbJz8NdJLALG3g4pz90zIv0CiMdEkPQedDFrJEGWU3e 2kvItnJmMzbRVkdC6dtV0j6slcGTPvtpP2vSu6aHl3hrgm+LmKH9Tv6weX384znAxiaei6 zrFdDmqobtjpQ78QjeFzjq7OJ1b9SumZN1vIf2aAgDGA70gwxfMP7iJt4k5zGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxF2832vPzdv7; Tue, 17 Jan 2023 16:38:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HGcOqa091161; Tue, 17 Jan 2023 16:38:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HGcO67091160; Tue, 17 Jan 2023 16:38:24 GMT (envelope-from git) Date: Tue, 17 Jan 2023 16:38:24 GMT Message-Id: <202301171638.30HGcO67091160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: e1b610f76caa - main - arm64: Fix thread0.td_kstack_pages init List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1b610f76caa09bbc3910477da878ea5078c6569 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e1b610f76caa09bbc3910477da878ea5078c6569 commit e1b610f76caa09bbc3910477da878ea5078c6569 Author: Brooks Davis AuthorDate: 2023-01-17 16:35:08 +0000 Commit: Brooks Davis CommitDate: 2023-01-17 16:37:09 +0000 arm64: Fix thread0.td_kstack_pages init Commit 86a994d6537d7b5e1efb1019e466d86a688fd570 initialized thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an include of opt_kstack_pages.h it used the fallback value of 4 from machine/param.h. This meant that increasing KSTACK_PAGES in the kernel config resulted in a panic in _epoch_enter_preempt as the following assertion was false during network stack setup: MPASS((vm_offset_t)et >= td->td_kstack && (vm_offset_t)et + sizeof(struct epoch_tracker) <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); Switch to initializing with kstack_pages following other architectures. Reviewed by: imp, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D38048 --- 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 b099980634f6..2eaf4ef14390 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -365,7 +365,7 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_kstack_pages = kstack_pages; #if defined(PERTHREAD_SSP) thread0.td_md.md_canary = boot_canary; #endif From nobody Tue Jan 17 16:38:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxF294qPNz2skT3; Tue, 17 Jan 2023 16:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxF29472cz3DyW; Tue, 17 Jan 2023 16:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673973505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BId6xlhwqw81vBL8yvAvTE90S0X6x+OmH6l96Q4JHhc=; b=hNc3iqwH71Y1zAVEu+sPPZtQPYfCSq/O0Qg+ZBA2xoZs7gwfmCf35eBcT0PG+lNOUrpbTe 3QG3lPuYfpcy1Mg248RQa9HnDhCwNB6InOXPNZGVZZ/chx+92AunLueVB8KUvCpVnDCWog K7vXFEKpWOARIAbdDfwgrlaukCd2QQ3ER5aRubdiG/2m2dMzDU9/xS/MsZAkrTGueHbPEA jQS1/u+b0QzwdHKcjxlGa1YAYwat/Qk84mfwOJRrtuU1wE7bs+ds3YE7hNcPIN6DWjpwR3 9qFGHt6FPLgF45NBOWlvU0abULEMTXSgK008Jp6PDmyYrQviX/qDHN4D/w+eSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673973505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BId6xlhwqw81vBL8yvAvTE90S0X6x+OmH6l96Q4JHhc=; b=ePIoDGZ21aWkXVRv7uGC3aPgnsvu+sY1qakq3RU34dG7L+/hmtiSkugg1pvHPv3LVgg2uV hNJ7mhcrLAeDaoEZGuP4KFSK1uI6XoIYOHssVrPDEJwc+EKjJPhGR1vrGhLqt/v7z3aLgY l3CgSWxI1kFwyNp5lGT5Ov0gD8qaFHEHCHMmwbFDl6uMgk5WVh7IJTseUn2HOrJgDFLVcR zK0946qAJF2UWAgfnUyYBpRFWOJWK7CT3kvxdxd1iW19XfBkoc9h35HEogg5YVPbm+IG6l 1PXyVMazaFDK5XcJ10L2ZvrySBr4Leh3kCGusWbwq4gvqm7KwnQUJN5YdwGOKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673973505; a=rsa-sha256; cv=none; b=mryhDKHUFofhLpwcKW0EYEOfOanZJC6vuKFlQ8OuU8Rf1cQWoDLUrYScuS1tOFAWBHe0Vp br44IJjtf03yEfB7r8HdsQjZgPEDWzY46VxJQ9Mc4krw4r330wsFmyMyNLgQRLpDlaiYEf cbqJf+Tx2UTr8HlMA6SyOYEynlkD5XfGFqHLknohPftzZmnxJE10Vr1C9aFlZoT4Jifil5 Lrt79308yhkvIXZZvAtKZeaLYcPxUsdG6z5aW64OY0Cic9MSrEcqG/AFRlxr3t7+qptNMN Ga1WcgL5D0hK+eOfe55l0NU9aFAtIr2Ci2Ogryd7tokP0nYJMmo7Pjq7hcJD4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxF293CRjzfBL; Tue, 17 Jan 2023 16:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HGcPtM091185; Tue, 17 Jan 2023 16:38:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HGcP3C091184; Tue, 17 Jan 2023 16:38:25 GMT (envelope-from git) Date: Tue, 17 Jan 2023 16:38:25 GMT Message-Id: <202301171638.30HGcP3C091184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b75062f23431fbabef1e7d665cae270b144f71b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=b75062f23431fbabef1e7d665cae270b144f71b1 commit b75062f23431fbabef1e7d665cae270b144f71b1 Author: Brooks Davis AuthorDate: 2023-01-17 16:36:15 +0000 Commit: Brooks Davis CommitDate: 2023-01-17 16:37:42 +0000 riscv: Fix thread0.td_kstack_pages init Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an include of opt_kstack_pages.h it used the fallback value of 4 from machine/param.h. This meant that increasing KSTACK_PAGES in the kernel config resulted in a panic in _epoch_enter_preempt as the following assertion was false during network stack setup: MPASS((vm_offset_t)et >= td->td_kstack && (vm_offset_t)et + sizeof(struct epoch_tracker) <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); Switch to initializing with kstack_pages following other architectures. Reviewed by: imp, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D38049 --- sys/riscv/riscv/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index b03d45b018ec..0821a29d11c1 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -291,7 +291,7 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_kstack_pages = kstack_pages; thread0.td_pcb = (struct pcb *)(thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_fpflags = 0; From nobody Tue Jan 17 20:17:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxKtt5rzFz2ty7g; Tue, 17 Jan 2023 20:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxKtt5Lp0z3sYS; Tue, 17 Jan 2023 20:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673986646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dnOvKWUUJoJ0SPbqxxuWTJdTdOazNbd7CnH//2VbyHw=; b=T6ayRcJv+Lf0Cc7UWLDuARqvaGYNFWVOu5u1oh146yEjWPdeEkMyp6zMWlY8a+QOKQp+A+ NAT/KCDBBR4Vz3C5jH9wNIibzegOMv67R0FTfYRRzOWD1H2hMzT2RTMuQejN5+pJ4OU7bY Q4UJcvJq4x1okLcng13IhGXUBf06N92bavHty6gS4iqYYi4DgilDBBRhdjYUeaJw0e9KxA AZ0Ae6aYp7xaDqveP329t/OHViePX+a+4exjpq4EsG3B4/Tby6R6kAYvN8tti93IUe14HI KwW3RfZuwXLmldBUaJX3iIRlb7eT+bq7xiJfP37a6vRvLhN+vrHM+GhLkgvgTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673986646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dnOvKWUUJoJ0SPbqxxuWTJdTdOazNbd7CnH//2VbyHw=; b=hs2pQ54dUggh7ui7Ty/s2dLz0vCGCT9EQ78oiRNLOPbLHAs2GrpNjaG8mm4uM3GiOKK91M vdpW1ghVza93ZCWHKM/rN9a8mSngu9SDHwBKASoKKrG3xb74mfQlGs+ct6MePW5DbHIZx/ 81KEbcjGr1c+KZ+IDjR360JJtLSUa7W3HLbJUUHcWRGVo5rPPqtxe5QUwMbojmTestzxZL jeJ/a6kn9LN+/dLw/Bes6V2d67JTU25MzEVaJ4LWvGgCZgB/07bgTMPR0s1oV7JaGcDKgT J8X1UunQeqUCJ6V8AWyaPCSPC8+ZkWf4Um/+zwVaP5V/0ZNAEyKVTXAcyXD+6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673986646; a=rsa-sha256; cv=none; b=UqCPdKajUXU4wByA4loHkl01DWyVJOzwUcpbiHFC7G7tCFQCcnkyApDRbvdDiWAyR3agrN 74jZbACFa65RwlreNrlqFAhcUgHSX58f4MzzpoYpJoMhNZpqbMR8oQBr/+DAgJ0lBWuG/e SumSVZAPYhxQp41MjZ/wMsc2ALrK7M92mD3ni2PxQnHfC7crMlHqTU682XBnZKwBnOzwiL XuX0JR1qXu7YbY1hTOw4vDUbKoNdLznOW6Y//+0Hm2zTzqnZ0hZnkishusqd/7DEtNSekf kkbZq6sZYESAeE60vkWqOoZ9HYbl+O2uY0NMzXjTPn+zUKcTcf0n7sTaU42Fng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxKtt4MCZzkGP; Tue, 17 Jan 2023 20:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30HKHQFx006339; Tue, 17 Jan 2023 20:17:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HKHQc0006338; Tue, 17 Jan 2023 20:17:26 GMT (envelope-from git) Date: Tue, 17 Jan 2023 20:17:26 GMT Message-Id: <202301172017.30HKHQc0006338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 701bb67bc5f8 - main - ifnet: Rename DrvAPI to "IfAPI" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 701bb67bc5f8df9929a249265aabd96c3143e222 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=701bb67bc5f8df9929a249265aabd96c3143e222 commit 701bb67bc5f8df9929a249265aabd96c3143e222 Author: Justin Hibbits AuthorDate: 2023-01-17 20:08:43 +0000 Commit: Justin Hibbits CommitDate: 2023-01-17 20:15:51 +0000 ifnet: Rename DrvAPI to "IfAPI" "DrvAPI" is too generic a name. Make the name more specific as "IfAPI" (InterFace API). Sponsored by: Juniper Networks, Inc. --- tools/ifnet/{convert_drvapi.sh => convert_ifapi.sh} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ifnet/convert_drvapi.sh b/tools/ifnet/convert_ifapi.sh similarity index 98% rename from tools/ifnet/convert_drvapi.sh rename to tools/ifnet/convert_ifapi.sh index 228456dd244d..ac103dc5702c 100755 --- a/tools/ifnet/convert_drvapi.sh +++ b/tools/ifnet/convert_ifapi.sh @@ -235,7 +235,7 @@ then fi IFS= echo -n "Conversion for $file started, please wait: " -FAIL_PAT="XXX - DRVAPI" +FAIL_PAT="XXX - IFAPI" count=0 while read -r line do @@ -272,7 +272,7 @@ echo "" count=`grep $FAIL_PAT $file.tmp | wc -l` if [ $count -gt 0 ] then - echo "$count lines could not be converted to DRVAPI" + echo "$count lines could not be converted to IFAPI" echo "Look for /* $FAIL_PAT */ in the converted file" fi echo "original $file has been moved to $file.orig" From nobody Wed Jan 18 00:32:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxRXr1cMSz2sX7d; Wed, 18 Jan 2023 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxRXr1641z4Kw5; Wed, 18 Jan 2023 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674001932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7K9vD+zi8o8EmIgtKPeTrqIlHvmWJQZDf0T0JJnbfAM=; b=AZ5BFMkr7uWb99BueGa7sp8Bc/v+4DTzQsKH3L3IZCYDU573JRjcWnqJF9aO+87Y+bT6Kn tFKKGmX9RzJBbfiYYFtITWLta2+2RKwmFUfVQV3VCxX7DmXsmnDbVMsXrP+9g8HBKZ1Ja3 mlO/NVHoNGD5PEAdsW0svATh5z9U5Ps97m3yWTW8tXIPrGO3v/Tjw2LWZc7/G1oKK1d0EZ Qzup/Zr86GPYrsCnabnXrGItxZeCGcZ4PRg9ke2kIQhuqTHWX/FkngOG0RRdjAVfZCUMUw GKzHJYtgX0kwZse0G4+EGyP5jZbTPS1P8TctuQ3Q9UScOtyYexs/PuPNrLnhoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674001932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7K9vD+zi8o8EmIgtKPeTrqIlHvmWJQZDf0T0JJnbfAM=; b=J3oawkkZ8uR+9nIxOwAMhtJypfb0CYpWVpx2vKIeWxZEUos4bzHllt9Eb8rXDoJLhSeYBb doUxfBzIQqeI/T8aBhxgKxAUnI/QZZVJdkh6mz/FGA3eQmv/dcuYmCfJwE+Zf7m9X4wHM/ 0khOngVnJWPytTVeg+IjKmKhgupxqhCm9tpZdYazbboI5162h9iWYWfm+d/YA88rrdQWZT MQq1MsULz4RDXGpH9l6KLFhMNv2J6zKU6ziBKYyNWk9T2S7qXxdv8IaI1+0zaQVAiBR6hs VyTHfVaQxnt487gR1mZuiHUgWyKlca2NmNKJLDAA6bGlJ2I6OqKUBbzu1CE7Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674001932; a=rsa-sha256; cv=none; b=GVS4IRZ/hbQY/XQmuo8HSXyXO5wyCBY8OFIhSkyR0eHj8gl6IqsKQuV+/Rghk+E9QgePHV HilITFZr65AMjagMfi7O7fjTXPQDQJrFTiLyaNFwh4JigyIqwAoq7KE5Wiu5e+AXoTZtxu lsN5dGcOCkh40iuwjcXp++spCTHZs1d25C0UYOIN5cJALsPU9jABAWFoj0+pR21+rGROG6 r++Rd3w9JL4qolM6qPXR5rxoTNsFjN2bhOz4toc6EejX6K28HA8oTaILlW04+HK4enoDJy HhVmjQLn9DauwJcFwCFRe/m7ibn1TzW6SZeH8zAZ+bXoaDOyo1Gx16zMoo6Wjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxRXr035Rzrs7; Wed, 18 Jan 2023 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I0WBA8080002; Wed, 18 Jan 2023 00:32:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I0WBae080001; Wed, 18 Jan 2023 00:32:11 GMT (envelope-from git) Date: Wed, 18 Jan 2023 00:32:11 GMT Message-Id: <202301180032.30I0WBae080001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 3f908eed27b4 - stable/13 - Enable taking snapshots on UFS/FFS filesystems using journaled soft updates. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f908eed27b47ae40947e3fec2b262acdb5efcd5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=3f908eed27b47ae40947e3fec2b262acdb5efcd5 commit 3f908eed27b47ae40947e3fec2b262acdb5efcd5 Author: Kirk McKusick AuthorDate: 2022-11-13 06:56:03 +0000 Commit: Kirk McKusick CommitDate: 2023-01-18 00:30:46 +0000 Enable taking snapshots on UFS/FFS filesystems using journaled soft updates. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36491 (cherry picked from commit 78f41298760509f5c2b5865b2158c801d4023363) --- sbin/newfs/newfs.8 | 4 +--- sbin/tunefs/tunefs.8 | 4 +--- sys/ufs/ffs/ffs_snapshot.c | 9 --------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 43896fe0bdb4..803b3221503d 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -205,9 +205,7 @@ is running. Running a full fsck on a UFS filesystem is the equivalent of running a scrub on a ZFS filesystem. .Pp -Presently it is not possible to take a snapshot on a UFS filesystem -running with journaled soft updates. -Thus it is not possible to reliably dump mounted filesystems or +Presently it is not possible to run background fsck on filesystems enabled for journaling. .It Fl k Ar held-for-metadata-blocks Set the amount of space to be held for metadata blocks in each cylinder group. diff --git a/sbin/tunefs/tunefs.8 b/sbin/tunefs/tunefs.8 index b9a581df6784..0264c3e5f772 100644 --- a/sbin/tunefs/tunefs.8 +++ b/sbin/tunefs/tunefs.8 @@ -131,9 +131,7 @@ is running. Running a full fsck on a UFS filesystem is the equivalent of running a scrub on a ZFS filesystem. .Pp -Presently it is not possible to take a snapshot on a UFS filesystem -running with journaled soft updates. -Thus it is not possible to reliably dump mounted filesystems or +Presently it is not possible to run background fsck on filesystems enabled for journaling. .It Fl J Cm enable | disable Turn on/off gjournal flag. diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 89301576f48a..709038db071f 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -226,15 +226,6 @@ ffs_snapshot(struct mount *mp, char *snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; - /* - * At the moment, journaled soft updates cannot support - * taking snapshots. - */ - if (MOUNTEDSUJ(mp)) { - vfs_mount_error(mp, "%s: Snapshots are not yet supported when " - "running with journaled soft updates", fs->fs_fsmnt); - return (EOPNOTSUPP); - } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); From nobody Wed Jan 18 07:54:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxdLr0sHJz2sTgp; Wed, 18 Jan 2023 07:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxdLr0FqRz3pvr; Wed, 18 Jan 2023 07:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674028452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1nZTvt9hKkj5+FTUga+oR5v+7mv7LeNsz3Kky9Fp9/Q=; b=KWJjZl0rIwasfIMxfCOuw0mn37TsTur2twK44Ya6T2nge0ccT/3GgNZJJvFFYNWyK4L9OV SO7agRyFnuxVvwxFRsnvftpY5Ynv3tIXvVutddgr4a1ID6WI6vwAX7im8Gr7lPuE/1DfI7 Pu4dWpyVuhWSN5bSl2xFXhrxvOSQoXdKqCdw0yfS3/NT5uRPs+CSBswPRfPsQ+gPkH3LSA r3VDIDzTLrKmTFPWc4qX+EuBQxGJdxos5P4ncOt+fpCEidONz249G8ykzhf9KhL2Ljy12l YOujGpnHu44GQEvAhobdYf1Yh7e9NIubBKh8ewIbjH0aSfLnty5irR7RexeoRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674028452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1nZTvt9hKkj5+FTUga+oR5v+7mv7LeNsz3Kky9Fp9/Q=; b=Ze1ID0fSHN4UXx5GlqP402XxgdDwXUu85BxAxCZvJ+Wr7+6oW53qM/Fd4XViMDYJJ3agop 3FMEzl4Xrpo3njOmS0RewZYex0N3nqXPIYy9qsAUqEz03Z1u/+f1QKqLDl9sTRYamnZRGP m1JSq1+1fYYs3VAUKaOJ+ar70D3LovcSboGQYphnefVhQ07XWL1Wto2nOB3v2XVwJ2xicM +KFE0+5BZSOgu5FemS8cndexB078ffoVShkm6+VOAotfWq9wcYkW4quWQOseu0mGj007cV nYfoIoPLFiBJESGGtg3jk+XLxskep84nxPm0kYiC0Vc+fC5uHEhxy4Q0zbmLmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674028452; a=rsa-sha256; cv=none; b=iVEKW99DzSyjFGRJxf2CFBJNdxyrwf6BlNTULFtH9QHI4h1jn72pHOl1gCW5O3h3nux/hU TwD7t2JBtXLACtXgaFM6yJBHXstLUxsyWrVeJXi5Wg3emjJX1DHkJMaLK96wpGmpudMyAa 5Nn7zZ5qTFf7HevHVw3kSF+y2MToQF2f4kiPO+nsd3s7BVzFDCTq10mVV8BkudrCjmX+B0 9NSnlrKGDPpsUp6XGvhpX6ii3prbFKhvgEXMmGe3AvU4bGFgA6AIzG+Bwu8qv+RufyULv7 5B6DCW25s0B5Com/dWidLehUklvEGlTdSNXqkHwAlN/djwfJZP1kR6RtoHXILA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxdLq6QMDz13kh; Wed, 18 Jan 2023 07:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I7sBsc008608; Wed, 18 Jan 2023 07:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I7sBnW008607; Wed, 18 Jan 2023 07:54:11 GMT (envelope-from git) Date: Wed, 18 Jan 2023 07:54:11 GMT Message-Id: <202301180754.30I7sBnW008607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Juraj Lutter Subject: git: 1d577bedbae8 - main - unbound: Fix config file 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: otis X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d577bedbae80ced38ccb834e6835e5fd98bc411 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by otis (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1d577bedbae80ced38ccb834e6835e5fd98bc411 commit 1d577bedbae80ced38ccb834e6835e5fd98bc411 Author: Juraj Lutter AuthorDate: 2023-01-17 17:25:47 +0000 Commit: Juraj Lutter CommitDate: 2023-01-18 07:50:07 +0000 unbound: Fix config file path Commit 1838dec31895fd4752fa8631322ab93be0705a66 changed the config file path to /usr/local/etc/unbound/unbound.conf which is wrong for unbound in base. Reported by: Ihor Antonov Reviewed by: zlei Approved by: zlei Differential Revision: https://reviews.freebsd.org/D38106 Fixes: 1838dec31895fd4752fa8631322ab93be0705a66 MFC after: 1 month X-MFC with: 1838dec31895fd4752fa8631322ab93be0705a66 --- usr.sbin/unbound/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/unbound/config.h b/usr.sbin/unbound/config.h index bd36bb7573f8..2068cbfe7295 100644 --- a/usr.sbin/unbound/config.h +++ b/usr.sbin/unbound/config.h @@ -21,7 +21,7 @@ #define CONFCMDLINE "--with-ssl=/usr --with-libexpat=/usr --disable-dnscrypt --disable-dnstap --enable-ecdsa --disable-event-api --enable-gost --with-libevent --disable-subnet --disable-tfo-client --disable-tfo-server --with-pthreads--prefix=/usr --localstatedir=/var/unbound --mandir=/usr/share/man --build=freebsd" /* Pathname to the Unbound configuration file */ -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" +#define CONFIGFILE "/var/unbound/unbound.conf" /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work */ From nobody Wed Jan 18 09:39:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxghh3vjRz2sj1s; Wed, 18 Jan 2023 09:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxghh3RmSz40Nr; Wed, 18 Jan 2023 09:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRikmio3G5UWWgq/YfEeCRwPryr1b9xP9tfh7qnUL/w=; b=X+BpgutIB+ARHDgxHLP2BsB5MhKJJ7bfjEMEd4TqGBij34ZodyWg/suNsKkqQF9AL9sUiY TiLZ3YfXjuWANefOkXHlCmr30b0ymfXDDTbhjz5CaAyY19gLScjYQRAO+ME4U7ZJJ6QQLg P5VSc9PNrIkdRSIANxaFLiieFlEmgHth91B+vJJ0NqyUfTTQDi3DdViSwjN5u6vGx88HE4 Y74GBPWMvXaZG5/lCrpMNWAMCcxSNm6mMZ1uSzDlzT4TiM7uAZ65vmyqlAlOYV9hHh2tzd HBiyKPhNfgk1YJl3GRJaJhz7osjP6rmu7m/HTL77pZnzDIAc4snUPcklLlCFzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRikmio3G5UWWgq/YfEeCRwPryr1b9xP9tfh7qnUL/w=; b=NeaHrDsIo05fnOIUA4YVzFb+MBVtJb+qO1uh+lPLOklrLNG+ry/OwBEYNr2FUk1XYoG5g8 CL+7FmcaWfdBVN5ff8nNC1scVToxsNi8FK32bDUw/ulIqGHqHfHDs+fIgyvh18ziW4Mgwy xibvK8A2e46afs9ToRzD0wE7ZrkG+91piEo+B3Hi8XL56d/QSZvCk/MLxsQr3OFOS94IpI Gi0a2OncZ1u38+5CfKjUZDUv8R3E0eXqaTBXooK7dnMXOVcaCT0mA+eYEADlfWvToA0cVX SxbPqKARlbmmWxRpirpNfdEF3J11u0vBFZluRbF9OjK1KUS4pYqyLPsvborjOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674034788; a=rsa-sha256; cv=none; b=mFcCBTXKJoCf8xy33Eis9WCp+UJ4f4gmYvosPkUHnOz5Vp/OWJGwOpVOicS7fWn44T9jsJ 8saDJTKWY9SrxlWOYHkwDkThFbMcptep3C7zMFhkMNrKgPeLFRkRrEtTiOtdOzJ660kAMG PHSyKr4jx5IHzQMVe1HXdhPPfm5KRt89hFpCF4+m/DIUjpyplqvoIF0WHhRqJoeg5W4iAu Hoe+q1Rhcbt3k6qhLmAXVjnY+AQiGHT1IV+U/6R20D7UcEhg6NhoyLmRtUTu9B2L04G7vf G82ySptDwLMhLZ8boIdKvy6Q7+vwgCy/bS7Z+KCOaxpBxANfla8vIZss8Xka4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxghh2VSyz161c; Wed, 18 Jan 2023 09:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I9dmsQ053045; Wed, 18 Jan 2023 09:39:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I9dm1k053044; Wed, 18 Jan 2023 09:39:48 GMT (envelope-from git) Date: Wed, 18 Jan 2023 09:39:48 GMT Message-Id: <202301180939.30I9dm1k053044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 95dd6974b591 - main - Always read the VFP regs in the arm64 fill_fpregs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95dd6974b591ce76bf8d29adcc0dd01b4b281ffd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=95dd6974b591ce76bf8d29adcc0dd01b4b281ffd commit 95dd6974b591ce76bf8d29adcc0dd01b4b281ffd Author: Andrew Turner AuthorDate: 2023-01-18 09:30:20 +0000 Commit: Andrew Turner CommitDate: 2023-01-18 09:31:35 +0000 Always read the VFP regs in the arm64 fill_fpregs The PCB_FP_STARTED is used to indicate that the current VFP context has been used since either 1. the start of the thread, or 2. exiting a kernel FP context. When case 2 was added to the kernel this could cause incorrect results to be returned when a thread exits the kernel FP context and fill_fpregs is called before it has restored the VFP state, e.g. by trappin on a userspace VFP instruction. In both of the cases the base save area is still valid so reduce the use of the PCB_FP_STARTED flag check to help decide if we need to store the current threads VFP state. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D37994 --- sys/arm64/arm64/exec_machdep.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index 6109a866a2d0..12c23149ec7f 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -153,16 +153,17 @@ fill_fpregs(struct thread *td, struct fpreg *regs) */ if (td == curthread) vfp_save_state(td, pcb); + } - KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, - ("Called fill_fpregs while the kernel is using the VFP")); - memcpy(regs->fp_q, pcb->pcb_fpustate.vfp_regs, - sizeof(regs->fp_q)); - regs->fp_cr = pcb->pcb_fpustate.vfp_fpcr; - regs->fp_sr = pcb->pcb_fpustate.vfp_fpsr; - } else + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Called fill_fpregs while the kernel is using the VFP")); + memcpy(regs->fp_q, pcb->pcb_fpustate.vfp_regs, + sizeof(regs->fp_q)); + regs->fp_cr = pcb->pcb_fpustate.vfp_fpcr; + regs->fp_sr = pcb->pcb_fpustate.vfp_fpsr; +#else + memset(regs, 0, sizeof(*regs)); #endif - memset(regs, 0, sizeof(*regs)); return (0); } From nobody Wed Jan 18 09:39:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxghk0lgXz2sjG3; Wed, 18 Jan 2023 09:39:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxghj4s0jz40Z2; Wed, 18 Jan 2023 09:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DTXtpfZAQqmyZIhiUPzcCnpLkavLseTbpRffRv5u4hY=; b=yafLs9qF/1luqUgw5e9Lwnp9iuKYMIXKoAosAN8KPgWuVoKYYyXE5ewe1IPIMsGTO6FjBM kAnSSQgpO3ARqrINmDS8Ok2Gs6rf3BlBl9ZnIFXNS/AYrn2evsHCzTZy2RBaq9OPHAk/Cl hvSY2M0F/J8HUIxNJe/F8Iz4JJZYTOCQ8NcDGrLshePEmOZQH12z6aOmaS2CtHy9Lm65AW ZC83sP3BAp6CIsGl7dSqeNa86bu5Pu/ikLwuXiZLEAOyI1cEDoPF3L8vbqzuautfYJBOB4 UlUKjHaJdjAU3lTqyeTIrKg3XFQUkny7sH8B6LIPu/7T6YtZXA/4LiCN/LZpdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DTXtpfZAQqmyZIhiUPzcCnpLkavLseTbpRffRv5u4hY=; b=FO/KOs+BkFrLgre0452fgM/G2o3PYupo2XiKsDGuVH39looSy/eNwGJkk64I2XqQ78ItCG 60q+HEKcGM3soFVhnB83EyMaWE+oiP/E8wFMEardvjtzAIlhuylPrwxdJ/Sf3ufg+ac3px Bl16akII9hqiAKpzKbZryw1cWXDaOFNgTItbdyCO46ZbTr3Km9xV8/XLukXD/DjHoa8a1Y /C702vJML7LUMJSXtBsgAujaex9cNaKeJHexBrn889MsQIueRqx/Ffix7DBbZOUZXNR/Zp Ms5wtDByeXme+6XIXUxE8iVFjz7R6jHYw56oHSOsIzJEIt/fOfV1wzjL2ReziA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674034789; a=rsa-sha256; cv=none; b=nWnt5oSGej2Hwj02JGBREsyvf4Y28mFi9WZA+jCbJgzfoXnkzBThqG9ejqJNrCUgVkhmyS PfvF9BQYc7MML4Lm9wz9BdmZGL8pwgAe/turrdliIe8Vnxceu6I58K4R6JQnQYosROwguE KBUqBM5hD8SJCTqu6I7G5Fv/QGqg1vveS7PJSBn42lJaqqzaBrQ2n7T9+WgPGSQiSsd7pS 45yK2nIgS5E1AwD/0vZLqGRXyxWh13NuqXLayRaM/nFO9/SryNltYXndtIYlLr0KGqWOaZ uSHe56aGmBERv3sfmkjZ+sIsu0Nzrc7Zw20KbYf+33f3Zb4OXAdURgk7DxgXhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxghj3fcmz166M; Wed, 18 Jan 2023 09:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I9dnaF053077; Wed, 18 Jan 2023 09:39:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I9dnU5053076; Wed, 18 Jan 2023 09:39:49 GMT (envelope-from git) Date: Wed, 18 Jan 2023 09:39:49 GMT Message-Id: <202301180939.30I9dnU5053076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 61f5462fde6c - main - Always store the arm64 VFP context List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61f5462fde6c38c1f4f5c34a05fab506b6869375 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=61f5462fde6c38c1f4f5c34a05fab506b6869375 commit 61f5462fde6c38c1f4f5c34a05fab506b6869375 Author: Andrew Turner AuthorDate: 2023-01-18 09:30:32 +0000 Commit: Andrew Turner CommitDate: 2023-01-18 09:31:45 +0000 Always store the arm64 VFP context If a thread enters a kernel FP context the PCB_FP_STARTED may be unset when calling get_fpcontext even if the VFP unit has been used by the current thread. Reduce the use of this flag to just decide when to store the VFP state. While here add an assert to check the assumption that the passed in thread is the current thread and remove the unneeded critical section. The latter is unneeded as the only place we would need it is in vfp_save_state and this already has a critical section when needed. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D37998 --- sys/arm64/arm64/exec_machdep.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index 12c23149ec7f..258cb5d26b13 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -489,30 +489,27 @@ get_fpcontext(struct thread *td, mcontext_t *mcp) #ifdef VFP struct pcb *curpcb; - critical_enter(); + MPASS(td == curthread); curpcb = curthread->td_pcb; - if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) { /* * If we have just been running VFP instructions we will * need to save the state to memcpy it below. */ vfp_save_state(td, curpcb); - - KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, - ("Called get_fpcontext while the kernel is using the VFP")); - KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, - ("Non-userspace FPU flags set in get_fpcontext")); - memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_fpustate.vfp_regs, - sizeof(mcp->mc_fpregs.fp_q)); - mcp->mc_fpregs.fp_cr = curpcb->pcb_fpustate.vfp_fpcr; - mcp->mc_fpregs.fp_sr = curpcb->pcb_fpustate.vfp_fpsr; - mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; - mcp->mc_flags |= _MC_FP_VALID; } - critical_exit(); + KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, + ("Called get_fpcontext while the kernel is using the VFP")); + KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + ("Non-userspace FPU flags set in get_fpcontext")); + memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_fpustate.vfp_regs, + sizeof(mcp->mc_fpregs.fp_q)); + mcp->mc_fpregs.fp_cr = curpcb->pcb_fpustate.vfp_fpcr; + mcp->mc_fpregs.fp_sr = curpcb->pcb_fpustate.vfp_fpsr; + mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; + mcp->mc_flags |= _MC_FP_VALID; #endif } From nobody Wed Jan 18 09:39:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxghl07Hgz2sjSc; Wed, 18 Jan 2023 09:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxghk5FFGz40fG; Wed, 18 Jan 2023 09:39:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Q7H+/t2vuQt52/yQ4Ms3g+86eubimeQZjmNTgzrGWo=; b=KO+HZBKyWc4KE0aSP/ZEQDrME1BiUtTp/h8r11LAUnwOluQtUbStDGtoJCNmnNjnhlEegB 8hYCwsS9uuq/f2VscsgCv0GozE1wHgav2eCqwLwn3FO8jUIrKeKYmjMdVM/wrSvMcUndJ7 9wSPbm6XYWZl2GavhmhaC7tk9YiHBE4G45W0oePZfqtsOKlcIHiB4MHq2hP9/yOTd6yhCS OTFlrCFQgtequbkImx4e3IyMB03u76xmU5IikpA8Ae0UBusl9rIhOBrq2S0M1zsENS1a89 xRUenLvgibbYtrboI5cxgLcmjctneqPqyuS3CpKEl/q+niju1wtd6nrfOGo6+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Q7H+/t2vuQt52/yQ4Ms3g+86eubimeQZjmNTgzrGWo=; b=Zch/UDFKg1eU3pseMBxpcvGauEgCKByt0y0x4BFR1wX09x3aJqt+qH1u7vJqYSzTcwR4va iCIbQU0fSm1jiZ3yUJimU/lcAaM7fAyxadgTndyLCT0lcjDjhbkI6+Q7QDv7IuHuqxKFYe zI6G8jS/jeqs0elqIaYEqSDcslPnRazP35sVUEBKqMjfj+bv3Pcj+pq46Oog3wJ/8F4pGs MbdzyyiZPfP/sUY/ERl0ZOphqXwjulm3vQPZfHAhjtzWA8I+yWgL1dirFwXim7eCMwLzY3 K95/ruYly6Ku8yc8bBLskAtuB7yWpoJ65ng8hRtMZn8Upytik9z5DYci1HDjyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674034790; a=rsa-sha256; cv=none; b=g2asX++4UQn0vmqYsG/AQ3FesLoYuNQY3ZouiwxUu1MfTqbJc0lCh/JhMqZP1gva8uhTvF ZdXRKGXV3C2rQ+YGfGn2xjTYvkW+XSeObV3HOvLHqOSJFiwm5l/2vwh9CfZeVI41VoC6DC P0MEkPm804AN8UWKVWuXU3/RJBy9Ku+KPSwkMZ+GM5xTH1nxBmttMyyUdVdZileyqNfNUK LgLM7dd5Q8jbBchmKG3frG3cXCWqiLa0ixugPMSYW/p9LFlG2iT8Cp6y3dSnvh3vZf3/tI aYOPqW9sH0gYNXdO9GD/icOgeX0Pct7QlXuhA7HfOfk2LYHjspNn0M0bcSKxrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxghk4M2Fz161d; Wed, 18 Jan 2023 09:39:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I9do6c053101; Wed, 18 Jan 2023 09:39:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I9doJs053100; Wed, 18 Jan 2023 09:39:50 GMT (envelope-from git) Date: Wed, 18 Jan 2023 09:39:50 GMT Message-Id: <202301180939.30I9doJs053100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a85cf421d1bf - main - Reduce an arm64 VFP critical 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a85cf421d1bfec7e753bfee781355785b00d89d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a85cf421d1bfec7e753bfee781355785b00d89d4 commit a85cf421d1bfec7e753bfee781355785b00d89d4 Author: Andrew Turner AuthorDate: 2023-01-18 09:30:36 +0000 Commit: Andrew Turner CommitDate: 2023-01-18 09:31:50 +0000 Reduce an arm64 VFP critical section In set_fpcontext we only need a critical section around vfp_discard. The remainder of the code can run without it. While here add an assert to check the passed in thread is the current thread as the code already this. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38000 --- sys/arm64/arm64/exec_machdep.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index 258cb5d26b13..27ee2f80858d 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -519,8 +519,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) #ifdef VFP struct pcb *curpcb; - critical_enter(); - + MPASS(td == curthread); if ((mcp->mc_flags & _MC_FP_VALID) != 0) { curpcb = curthread->td_pcb; @@ -528,7 +527,9 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) * Discard any vfp state for the current thread, we * are about to override it. */ + critical_enter(); vfp_discard(td); + critical_exit(); KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, ("Called set_fpcontext while the kernel is using the VFP")); @@ -538,8 +539,6 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) curpcb->pcb_fpustate.vfp_fpsr = mcp->mc_fpregs.fp_sr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; } - - critical_exit(); #endif } From nobody Wed Jan 18 09:39:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxghl72zhz2sjCj; Wed, 18 Jan 2023 09:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxghl64Lxz40Zd; Wed, 18 Jan 2023 09:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fSDHDYE9QnSKsJGkhZ9BFaSn9WI4yr0+r7esrI75GIA=; b=NnxwlcCZFox3aUX0TsYF+EDIEoln8WDXC6HOUEigZhx92/l3jhqoi1QDbdzBWzhDrpyKY5 U+qqZYRxtMC443ywbiDHERU4lm2sDdJ8mpjSL5bMkvd97YRHqPcWLiiKM10S4RSt0BOkdD E7GJPy4ogjmUfxNPl1E4vJje4GB79KSIvQsyxH7BS/QnG+9H09ALNi+0EtnQTJ+W2c+9C2 NWwT1rwak18gfV6T05SLlqipgcXcROPGGxLsJcOwkdog9aEg4J95YMwY2PuuHrEDJPhCsb AIm2706TrJpWAGc6L6k7GJr8dy974NwcsO13jgZ/O6jBK3dosU9MO7Yv/QoboQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fSDHDYE9QnSKsJGkhZ9BFaSn9WI4yr0+r7esrI75GIA=; b=I7f3b00+0DvqIkVmJsJ6xVMk9Bxkzad5WBw2slalJ8u3mI7kQoZs3+G9UHQx73+8aSll42 /ohlDmXx7vgiEW74/kCP/z1MdVPIanwINTn9GdGVnmLvTYs7XCuXSYTkXOcY807viS2k1I Ju3U2F1R0QdGOxXH+kNiGJYaGIvNzeIb8uwPA5nY84nvJQvzlYfc4Smiadu0d5C+7ThkEK mkwJVBhvUYuSZ+7YL+mQutRnqJYe0lC02fgdv7tvR3WjsVGh6LlCYj+Xt5djlZ5k8GoMAH tJ8rAveX+fd7UA6rB3xiXM4XN4oxLYQc09dOoXW4Wl/nLVdcYByOvN3vRO0HLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674034791; a=rsa-sha256; cv=none; b=CKOFLa4/hl1GlmTP1q5o9IRIrZHejYwoeKnqjAvhjffx83b6vnGrhZPuBtirRF/RZhv1bF ygfj49HvVnkXk01aw/XedcVmEkvw1i1n9jfJrxaQGONDCfMHGUgl6vL6a+VMBoBL4y30b1 XV26rmCxY8ZNPPfCgW8BEwuurcmXnA/rjSOU5idu705M214kX4fbo4+2Pz39Ihwfbwg2QW ay4gp/PZgVJ2Ea70bOeC7ZAOVDtLcr1OCN97ru/d1vXzp6kJA7ZprYXDQ3Et+JtAAy9DCV bQnZJVWr8Tfx+BGw/ksI9CVM7GLl5WLUxBHPnIwQJiKJPpaW5tIyUnFCCKkgTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxghl5BLRz166N; Wed, 18 Jan 2023 09:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I9dpYS053125; Wed, 18 Jan 2023 09:39:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I9dpJ3053124; Wed, 18 Jan 2023 09:39:51 GMT (envelope-from git) Date: Wed, 18 Jan 2023 09:39:51 GMT Message-Id: <202301180939.30I9dpJ3053124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 896f556205c8 - main - Add the fixed memory type to the pci ecam 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 896f556205c8d87ef842dc844752daa7d2385336 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=896f556205c8d87ef842dc844752daa7d2385336 commit 896f556205c8d87ef842dc844752daa7d2385336 Author: Andrew Turner AuthorDate: 2023-01-18 09:30:46 +0000 Commit: Andrew Turner CommitDate: 2023-01-18 09:31:50 +0000 Add the fixed memory type to the pci ecam driver Add ACPI_RESOURCE_TYPE_FIXED_MEMORY32 to the PCI ECAM driver. This is used on the Microsoft Dev Kit 2023 and reportedly the Lenovo x13s. Reviewed by: Robert Clausecker (Earlier version) Tested by: Robert Clausecker (Earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38031 --- sys/dev/pci/pci_host_generic_acpi.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c index 4a565c846339..8ef97a3ae1ae 100644 --- a/sys/dev/pci/pci_host_generic_acpi.c +++ b/sys/dev/pci/pci_host_generic_acpi.c @@ -142,25 +142,42 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) device_t dev = (device_t)arg; struct generic_pcie_acpi_softc *sc; rman_res_t min, max, off; - int r; + int r, restype; sc = device_get_softc(dev); r = sc->base.nranges; switch (res->Type) { case ACPI_RESOURCE_TYPE_ADDRESS16: + restype = res->Data.Address16.ResourceType; min = res->Data.Address16.Address.Minimum; max = res->Data.Address16.Address.Maximum; break; case ACPI_RESOURCE_TYPE_ADDRESS32: + restype = res->Data.Address32.ResourceType; min = res->Data.Address32.Address.Minimum; max = res->Data.Address32.Address.Maximum; off = res->Data.Address32.Address.TranslationOffset; break; case ACPI_RESOURCE_TYPE_ADDRESS64: + restype = res->Data.Address64.ResourceType; min = res->Data.Address64.Address.Minimum; max = res->Data.Address64.Address.Maximum; off = res->Data.Address64.Address.TranslationOffset; break; + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + /* + * The Microsoft Dev Kit 2023 uses a fixed memory region + * for some PCI controllers. For this memory the + * ResourceType is ACPI_IO_RANGE meaning we create an IO + * resource. As drivers expect it to be a memory resource + * force the type here. + */ + restype = ACPI_MEMORY_RANGE; + min = res->Data.FixedMemory32.Address; + max = res->Data.FixedMemory32.Address + + res->Data.FixedMemory32.AddressLength - 1; + off = 0; + break; default: return (AE_OK); } @@ -171,9 +188,9 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) sc->base.ranges[r].pci_base = min; sc->base.ranges[r].phys_base = min + off; sc->base.ranges[r].size = max - min + 1; - if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) + if (restype == ACPI_MEMORY_RANGE) sc->base.ranges[r].flags |= FLAG_TYPE_MEM; - else if (res->Data.Address.ResourceType == ACPI_IO_RANGE) + else if (restype == ACPI_IO_RANGE) sc->base.ranges[r].flags |= FLAG_TYPE_IO; sc->base.nranges++; } else if (res->Data.Address.ResourceType == ACPI_BUS_NUMBER_RANGE) { From nobody Wed Jan 18 11:18:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxjtY5DDJz2svbL; Wed, 18 Jan 2023 11:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxjtY4mJ5z49Lq; Wed, 18 Jan 2023 11:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674040709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C31LSDNqXwBraa1oESgbIXDzJjZ4ELQfOVFSqLDHa4Y=; b=nzINegJGFD5tUyIcawGdCmD0opHkLqVJC9nYtnTov/hxMKv477wlByfeKkxFBVL7ah5Y1P ROZcivfBJEOYVG9Ii6/x55VjKY5elvsrbGzJLtoTaSj2q+QJ46rQxo94d4eOfQX+uj9E/o S6yM1Q9OfUuZuQLI6GR5Nm9d+epHQskdLKTn6oJmOOhSXr1X7F3NmelxKJEp5orySiDnXG xCb5XG70bJahvygvxomKeJtDyzl+D2LuyhnI9VE6C67u/E3XGHPvJYJftUzBRAnA7WQwTR BzFtkv5rlB4z8lKD1UgWXY1Bu8nJGDl4iQg8BwrwLWVDltW6C01icsXQShbgJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674040709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C31LSDNqXwBraa1oESgbIXDzJjZ4ELQfOVFSqLDHa4Y=; b=G/dWpoWfgu2ypyflInNTCcX9nZNPQ2vHD9iU0YlCOthxLHzX7YaMU4AGBmcSSU0b5+ftSQ 6e86QiwYIajWZRWTOsTADlRypjgxKsiX937ZlGRcHlf2EuWbCx4jvW4qRNy4QK6iA6OG7V v59vyTB/Zalfqnjgf9lOYPQFNFRNY4bVSDWOiguj7W/CgVitAPZw/EzybFVwJ7gS/SM6DG cQReJf/RaLrRB6AbHjG0BrcLBM6fHNC5p5PIy2wiV1WfBe0/n938aJgQ3RN4qydWcAtxgC 0vWUN6OpozafIyCmSQS1MTfh+UNXJ1zVOIIW44CKu+zJiMJ6d9VgBz1lT6/byQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674040709; a=rsa-sha256; cv=none; b=QyeUnOXrHF0ALt6LcQlKh6381nOIQ1peU3HxPAALnCP2fwP4T/5B/ct9tKSsDurmPBqlHG dC+v3IlwBE62oYuBDWZUYqo2f0rSDybbP6HYv4glJm2phwHwQzDADsksnQdnQau5YgNpKR cV9lNcdq61xVaYqiJSFRT/iXdoPeW7WgS8/mJ/uaEEckutIf05R/uXHDVG7nHaE0OQFbkp bkjruuqUCEHYc1Jyws1HkHpf+TzxKlcRouFO45zBXt08hV67oaC8Ct+HbCMfTeowoe7g5q Oq46ip8VEgty8UeG10+KKGGT9W7vNkcFNVhRGXiboZ7KL0lQQeUPMnRPtdCxvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxjtY3prhz1840; Wed, 18 Jan 2023 11:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IBITsH096267; Wed, 18 Jan 2023 11:18:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IBIT1J096266; Wed, 18 Jan 2023 11:18:29 GMT (envelope-from git) Date: Wed, 18 Jan 2023 11:18:29 GMT Message-Id: <202301181118.30IBIT1J096266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 73c3e8b1dee6 - main - umodem: add quirk to ignore CDC_CM 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73c3e8b1dee6cd42de32287ea8a57762b961d8ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=73c3e8b1dee6cd42de32287ea8a57762b961d8ee commit 73c3e8b1dee6cd42de32287ea8a57762b961d8ee Author: Steffen Dirkwinkel AuthorDate: 2023-01-17 07:58:46 +0000 Commit: Corvin Köhne CommitDate: 2023-01-18 11:17:09 +0000 umodem: add quirk to ignore CDC_CM descriptor Some devices have CDC_CM descriptors that would point us to the wrong interfaces. Add a quirk to ignore those (prefering the CDC_UNION descriptor effectively) Reviewed by: manu MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37942 --- share/man/man4/usb_quirk.4 | 2 ++ sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/quirk/usb_quirk.h | 1 + sys/dev/usb/serial/umodem.c | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4 index c176993bdbc3..892c85aa6fba 100644 --- a/share/man/man4/usb_quirk.4 +++ b/share/man/man4/usb_quirk.4 @@ -100,6 +100,8 @@ select configuration index 4 by default select configuration index 0 by default .It UQ_ASSUME_CM_OVER_DATA assume cm over data feature +.It UQ_IGNORE_CDC_CM +ignore cm descriptor .It UQ_WMT_IGNORE device should be ignored by wmt driver .El diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 68e4910202b0..3baa3acba187 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -662,6 +662,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = { [UQ_CFG_INDEX_4] = "UQ_CFG_INDEX_4", [UQ_CFG_INDEX_0] = "UQ_CFG_INDEX_0", [UQ_ASSUME_CM_OVER_DATA] = "UQ_ASSUME_CM_OVER_DATA", + [UQ_IGNORE_CDC_CM] = "UQ_IGNORE_CDC_CM", [UQ_MSC_NO_TEST_UNIT_READY] = "UQ_MSC_NO_TEST_UNIT_READY", [UQ_MSC_NO_RS_CLEAR_UA] = "UQ_MSC_NO_RS_CLEAR_UA", [UQ_MSC_NO_START_STOP] = "UQ_MSC_NO_START_STOP", diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h index 85bec036f84d..755465576684 100644 --- a/sys/dev/usb/quirk/usb_quirk.h +++ b/sys/dev/usb/quirk/usb_quirk.h @@ -66,6 +66,7 @@ enum { UQ_CFG_INDEX_4, /* select configuration index 4 by default */ UQ_CFG_INDEX_0, /* select configuration index 0 by default */ UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ + UQ_IGNORE_CDC_CM, /* ignore cm descriptor */ /* * USB Mass Storage Quirks. See "storage/umass.c" for a diff --git a/sys/dev/usb/serial/umodem.c b/sys/dev/usb/serial/umodem.c index e9de2950fb9d..d059559bd39f 100644 --- a/sys/dev/usb/serial/umodem.c +++ b/sys/dev/usb/serial/umodem.c @@ -359,7 +359,9 @@ umodem_attach(device_t dev) /* get the data interface number */ - cmd = umodem_get_desc(uaa, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); + cmd = NULL; + if (!usb_test_quirk(uaa, UQ_IGNORE_CDC_CM)) + cmd = umodem_get_desc(uaa, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); if ((cmd == NULL) || (cmd->bLength < sizeof(*cmd))) { cud = usbd_find_descriptor(uaa->device, NULL, From nobody Wed Jan 18 11:18:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxjtZ6Xxmz2svbQ; Wed, 18 Jan 2023 11:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxjtZ5tklz49df; Wed, 18 Jan 2023 11:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674040710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JatkXbZJFpiWDNm7FqqGRX3SszPNcis2MzKdRCW8WJI=; b=uOyV9nEh411fJOY2nPLZ7x6CrDHrIoRkiSqteenOYjjE/BvvPRJH5FvvOmQKNkP48R980K 1CAJU2osM9ZSIcyvd8bGTdhdlsFj+TtrKudFjLAOlbJDEiH7bugGfvluViKrZJQX4/xf9C PVDabDLOiXuqSe55QPwbScVos7lUMNwkPitDqLdCAyd9FcUfTY/U+uBfTjYtUV062HQSWh RfLr6mXSwRs7rcyF+QgIDyXz9+xNih3u4dCRPv6A7ufk0zgFVlaO4jFTuRDr43oWs7cKjJ 489CLNPuwOfEmLB6bOuEVB3/bcvbcSufbjBsRYlOVxWe6S3Fnf1+fbBCP/r+2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674040710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JatkXbZJFpiWDNm7FqqGRX3SszPNcis2MzKdRCW8WJI=; b=cTzgs3Siga5cVkJ4BI7AEi/gIzyFZI5PcHHO8sRubEUe2Gd+rUwNa0gFyCnSNR3TIz/qhn g+ZCE0r6lTlgr7pazpMwpPhFLJpAzR/FN1itPos5EKZ0sTlZdHvL6knJQNXNXtk5kUhiLX Tos7/O6PWBgbZJdEG7jmIo/yJjNlefCEatQ7igD5ILA96Xi2qEQ3XXf3R9fowMBz8iXGbQ XR3TpYyIGAzZZlDYw6YDtapg/AHSu9JCYJe26pca8SNlZBRtFrlxaa9icqQJW3t2UUyA1J 5GwHibfX7gsWQM9jTZtejR7vxg0UUqPRCBVUuaxi13lmaQyG/IYzJKzOKC9vXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674040710; a=rsa-sha256; cv=none; b=xFFAvxaTCgEa0jq0HXnirtxXnvdR7xo71kmCjuAhmAmY5hNnHjOCMvCigTbTXIrBDtKyr1 s+VPHa1QrC87kQgF1DjeZVTsohmUCAH8FMgnmIoEvyPiA1R+L0z8FbevqKXqVoWwILKIRy IwYypLfOUlUrO7XLkfa9NRKoxqnyDZZmJGEr6yOH1lKWMqQqycSyMOrj6NOBERBCIQevt6 sFfL+pIvhkz8sIwpd0Lip6FVg/J+IkSuSGLrjHYGgtbSDyyvr9RXTe5sgsStMAh66/oMJH HY9fB2n+kyoySWAe66r+xMdkgyk1RzyuGlgP7EFvs7WmId/1BNdHafe/hihriQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxjtZ4m5Rz17q0; Wed, 18 Jan 2023 11:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IBIU4w096303; Wed, 18 Jan 2023 11:18:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IBIUnO096302; Wed, 18 Jan 2023 11:18:30 GMT (envelope-from git) Date: Wed, 18 Jan 2023 11:18:30 GMT Message-Id: <202301181118.30IBIUnO096302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 8580e334b075 - main - umodem: ignore CDC_CM descriptor for baltech smartcard reader List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8580e334b0757c8d55e51b8dc7fc4051521beedf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=8580e334b0757c8d55e51b8dc7fc4051521beedf commit 8580e334b0757c8d55e51b8dc7fc4051521beedf Author: Steffen Dirkwinkel AuthorDate: 2022-11-04 14:46:07 +0000 Commit: Corvin Köhne CommitDate: 2023-01-18 11:17:17 +0000 umodem: ignore CDC_CM descriptor for baltech smartcard reader The CDC_CM descriptor points to the wrong interface for serial port use. Ignore it to use the CDC_UNION descriptor. usbconfig dump (spec at: https://usb.org/sites/default/files/CDC1.2_WMC1.1_012011.zip): ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (300mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x13ad idProduct = 0xf019 bcdDevice = 0x0100 iManufacturer = 0x0001 iProduct = 0x0002 iSerialNumber = 0x0003 <45031910> bNumConfigurations = 0x0001 Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0064 bNumInterfaces = 0x0003 bConfigurationValue = 0x0001 iConfiguration = 0x0000 bmAttributes = 0x0080 bMaxPower = 0x0096 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0001 bInterfaceClass = 0x0003 bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 Additional Descriptor bLength = 0x09 bDescriptorType = 0x21 bDescriptorSubType = 0x11 RAW dump: 0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xd0, 0x08 | 0x00 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0003 wMaxPacketSize = 0x0040 bInterval = 0x0001 bRefresh = 0x0000 bSynchAddress = 0x0000 Additional Descriptor bLength = 0x08 bDescriptorType = 0x0b bDescriptorSubType = 0x01 RAW dump: 0x00 | 0x08, 0x0b, 0x01, 0x02, 0x02, 0x02, 0x00, 0x00 Interface 1 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x0000 bNumEndpoints = 0x0001 bInterfaceClass = 0x0002 bInterfaceSubClass = 0x0002 bInterfaceProtocol = 0x0000 iInterface = 0x0000 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 bDescriptorSubType = 0x00 RAW dump: 0x00 | 0x05, 0x24, 0x00, 0x10, 0x01 Additional Descriptor bLength = 0x04 bDescriptorType = 0x24 bDescriptorSubType = 0x02 RAW dump: 0x00 | 0x04, 0x24, 0x02, 0x00 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 bDescriptorSubType = 0x06 RAW dump: 0x00 | 0x05, 0x24, 0x06, 0x01, 0x02 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 bDescriptorSubType = 0x01 RAW dump: 0x00 | 0x05, 0x24, 0x01, 0x00, 0x01 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0085 bmAttributes = 0x0003 wMaxPacketSize = 0x0008 bInterval = 0x0010 bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 2 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0002 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x000a bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0086 bmAttributes = 0x0002 wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0006 bmAttributes = 0x0002 wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Reviewed by: manu MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37942 --- sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 3baa3acba187..d67007012251 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -188,6 +188,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { USB_QUIRK(CURITEL, UM150, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM175, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(VERTEX, VW110L, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(BALTECH, SMARTCARDREADER, 0x0000, 0xffff, UQ_IGNORE_CDC_CM), /* USB Mass Storage Class Quirks */ USB_QUIRK_VP(USB_VENDOR_ASAHIOPTICAL, 0, UQ_MSC_NO_RS_CLEAR_UA, diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 77a7908d45c3..005a5d9c1037 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1337,6 +1337,7 @@ product AZUREWAVE RTL8192SU_5 0x3325 RTL8192SU /* Baltech products */ product BALTECH CARDREADER 0x9999 Card reader +product BALTECH SMARTCARDREADER 0xf019 SmartCard reader /* Bayer products */ product BAYER CONTOUR_CABLE 0x6001 FTDI compatible adapter From nobody Wed Jan 18 13:35:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxmww00HZz2tyB8; Wed, 18 Jan 2023 13:35:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxmwv2xcvz4NGT; Wed, 18 Jan 2023 13:35:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; none Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 30IDZYst009977; Wed, 18 Jan 2023 05:35:34 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 30IDZYr6009976; Wed, 18 Jan 2023 05:35:34 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202301181335.30IDZYr6009976@gndrsh.dnsmgr.net> Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-Reply-To: <202301180754.30I7sBnW008607@gitrepo.freebsd.org> To: Juraj Lutter Date: Wed, 18 Jan 2023 05:35:34 -0800 (PST) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Nxmwv2xcvz4NGT X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > The branch main has been updated by otis (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=1d577bedbae80ced38ccb834e6835e5fd98bc411 > > commit 1d577bedbae80ced38ccb834e6835e5fd98bc411 > Author: Juraj Lutter > AuthorDate: 2023-01-17 17:25:47 +0000 > Commit: Juraj Lutter > CommitDate: 2023-01-18 07:50:07 +0000 > > unbound: Fix config file path > > Commit 1838dec31895fd4752fa8631322ab93be0705a66 changed the > config file path to /usr/local/etc/unbound/unbound.conf which > is wrong for unbound in base. > > Reported by: Ihor Antonov > Reviewed by: zlei > Approved by: zlei > Differential Revision: https://reviews.freebsd.org/D38106 > > Fixes: 1838dec31895fd4752fa8631322ab93be0705a66 > MFC after: 1 month > X-MFC with: 1838dec31895fd4752fa8631322ab93be0705a66 > --- > usr.sbin/unbound/config.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/usr.sbin/unbound/config.h b/usr.sbin/unbound/config.h > index bd36bb7573f8..2068cbfe7295 100644 > --- a/usr.sbin/unbound/config.h > +++ b/usr.sbin/unbound/config.h > @@ -21,7 +21,7 @@ > #define CONFCMDLINE "--with-ssl=/usr --with-libexpat=/usr --disable-dnscrypt --disable-dnstap --enable-ecdsa --disable-event-api --enable-gost --with-libevent --disable-subnet --disable-tfo-client --disable-tfo-server --with-pthreads--prefix=/usr --localstatedir=/var/unbound --mandir=/usr/share/man --build=freebsd" > > /* Pathname to the Unbound configuration file */ > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > +#define CONFIGFILE "/var/unbound/unbound.conf" Should this redirect through the /etc/unbound symbolic link? For example if I have modified the /etc/unbound -> ../var/unbound symbolic link /etc/unbound -> ../nodedata/etc/unbound your change is going to cause me to scratch my head why unbound is not reading my config file. Further it appears as if local-unbound.conf refers to the /etc/unbound path and does not mention /var/unbound. And an existing bug that may no longer be present is why do all the manpages installed have a local- prefix on them, but the binaries are installed without that? It also appears as if there is some @foo_path@ stuff in the man pages that should of been fixed up by the installer process to use the values compiled in. Thanks, Rod > > /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work > */ > -- Rod Grimes rgrimes@freebsd.org From nobody Wed Jan 18 14:53:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxpg92tD6z2v7FF; Wed, 18 Jan 2023 14:53: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 4Nxpg90bY2z4TVQ; Wed, 18 Jan 2023 14:53:57 +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 ESMTP id I5fPpAou4c9C4I9p6pRdKB; Wed, 18 Jan 2023 14:53:56 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id I9p4ph8KoyAOeI9p5pWBML; Wed, 18 Jan 2023 14:53:56 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=63c80804 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=RvmDmJFTN0MA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=xs_zb_Srkt0rRL9ledgA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id EFE4510AD; Wed, 18 Jan 2023 06:53:53 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id DCA42134; Wed, 18 Jan 2023 06:53:53 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-reply-to: <202301181335.30IDZYr6009976@gndrsh.dnsmgr.net> References: <202301181335.30IDZYr6009976@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Wed, 18 Jan 2023 05:35:34 -0800." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Jan 2023 06:53:53 -0800 Message-Id: <20230118145353.DCA42134@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBxEidjHClkzOA3nu4p0jhXLdo9qyf18gY3mKm7hkxajXaKt6YhRjg+sQB4+rVD/dbQJu0JZFZ3FSTznkHB0mA2bDbTH2BEQRsu9bCEHI5fNXlb3qBe9 lWB/WSjuR7RJ7i732NrOql8fK/IV5Pf3rN06Pc747w0c7LGbA4wIPF9I23CKvYLrCLmfav9HTzlMaprXw9LvU09Rh6bWUrORd7FvakjLocwNeuittKyv9nAA VaRrQI17jc3f0G4DUdnum/nIi4v9QpXpagPNhQi9H0FbPKtAXVsfbc6h8cmuNV4LWAKoFIuSZAvmsO714+obeWwmG86m737Sr2nu3iHUFpbrPhLLsbGGnLfF rYnYrk2i X-Rspamd-Queue-Id: 4Nxpg90bY2z4TVQ X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202301181335.30IDZYr6009976@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > The branch main has been updated by otis (ports committer): > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1d577bedbae80ced38ccb834e6835e > 5fd98bc411 > > > > commit 1d577bedbae80ced38ccb834e6835e5fd98bc411 > > Author: Juraj Lutter > > AuthorDate: 2023-01-17 17:25:47 +0000 > > Commit: Juraj Lutter > > CommitDate: 2023-01-18 07:50:07 +0000 > > > > unbound: Fix config file path > > > > Commit 1838dec31895fd4752fa8631322ab93be0705a66 changed the > > config file path to /usr/local/etc/unbound/unbound.conf which > > is wrong for unbound in base. > > > > Reported by: Ihor Antonov > > Reviewed by: zlei > > Approved by: zlei > > Differential Revision: https://reviews.freebsd.org/D38106 > > > > Fixes: 1838dec31895fd4752fa8631322ab93be0705a66 > > MFC after: 1 month > > X-MFC with: 1838dec31895fd4752fa8631322ab93be0705a66 > > --- > > usr.sbin/unbound/config.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/usr.sbin/unbound/config.h b/usr.sbin/unbound/config.h > > index bd36bb7573f8..2068cbfe7295 100644 > > --- a/usr.sbin/unbound/config.h > > +++ b/usr.sbin/unbound/config.h > > @@ -21,7 +21,7 @@ > > #define CONFCMDLINE "--with-ssl=/usr --with-libexpat=/usr --disable-dnscry > pt --disable-dnstap --enable-ecdsa --disable-event-api --enable-gost --with-l > ibevent --disable-subnet --disable-tfo-client --disable-tfo-server --with-pth > reads--prefix=/usr --localstatedir=/var/unbound --mandir=/usr/share/man --bui > ld=freebsd" > > > > /* Pathname to the Unbound configuration file */ > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > Should this redirect through the /etc/unbound symbolic link? > > For example if I have modified the /etc/unbound -> ../var/unbound > symbolic link /etc/unbound -> ../nodedata/etc/unbound your change > is going to cause me to scratch my head why unbound is not reading > my config file. > > Further it appears as if local-unbound.conf refers to the > /etc/unbound path and does not mention /var/unbound. > > And an existing bug that may no longer be present is why do all > the manpages installed have a local- prefix on them, but the > binaries are installed without that? It also appears as if there > is some @foo_path@ stuff in the man pages that should of been > fixed up by the installer process to use the values compiled in. That was my mistake I missed changing it back after generating a new config.h and fixed by otis@ in 1d577bedbae8. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Jan 18 15:34:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxqYj2f93z2y9gB; Wed, 18 Jan 2023 15:34:17 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxqYj0S7lz4XLy; Wed, 18 Jan 2023 15:34:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; none Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 30IFY9TK010385; Wed, 18 Jan 2023 07:34:09 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 30IFY9Au010384; Wed, 18 Jan 2023 07:34:09 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202301181534.30IFY9Au010384@gndrsh.dnsmgr.net> Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-Reply-To: <20230118145353.DCA42134@slippy.cwsent.com> To: Cy Schubert Date: Wed, 18 Jan 2023 07:34:09 -0800 (PST) CC: rgrimes@freebsd.org, Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4NxqYj0S7lz4XLy X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > In message <202301181335.30IDZYr6009976@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > > The branch main has been updated by otis (ports committer): > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1d577bedbae80ced38ccb834e6835e > > 5fd98bc411 > > > > > > commit 1d577bedbae80ced38ccb834e6835e5fd98bc411 > > > Author: Juraj Lutter > > > AuthorDate: 2023-01-17 17:25:47 +0000 > > > Commit: Juraj Lutter > > > CommitDate: 2023-01-18 07:50:07 +0000 > > > > > > unbound: Fix config file path > > > > > > Commit 1838dec31895fd4752fa8631322ab93be0705a66 changed the > > > config file path to /usr/local/etc/unbound/unbound.conf which > > > is wrong for unbound in base. > > > > > > Reported by: Ihor Antonov > > > Reviewed by: zlei > > > Approved by: zlei > > > Differential Revision: https://reviews.freebsd.org/D38106 > > > > > > Fixes: 1838dec31895fd4752fa8631322ab93be0705a66 > > > MFC after: 1 month > > > X-MFC with: 1838dec31895fd4752fa8631322ab93be0705a66 > > > --- > > > usr.sbin/unbound/config.h | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/usr.sbin/unbound/config.h b/usr.sbin/unbound/config.h > > > index bd36bb7573f8..2068cbfe7295 100644 > > > --- a/usr.sbin/unbound/config.h > > > +++ b/usr.sbin/unbound/config.h > > > @@ -21,7 +21,7 @@ > > > #define CONFCMDLINE "--with-ssl=/usr --with-libexpat=/usr --disable-dnscry > > pt --disable-dnstap --enable-ecdsa --disable-event-api --enable-gost --with-l > > ibevent --disable-subnet --disable-tfo-client --disable-tfo-server --with-pth > > reads--prefix=/usr --localstatedir=/var/unbound --mandir=/usr/share/man --bui > > ld=freebsd" > > > > > > /* Pathname to the Unbound configuration file */ > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > Should this redirect through the /etc/unbound symbolic link? > > > > For example if I have modified the /etc/unbound -> ../var/unbound > > symbolic link /etc/unbound -> ../nodedata/etc/unbound your change > > is going to cause me to scratch my head why unbound is not reading > > my config file. > > > > Further it appears as if local-unbound.conf refers to the > > /etc/unbound path and does not mention /var/unbound. > > > > And an existing bug that may no longer be present is why do all > > the manpages installed have a local- prefix on them, but the > > binaries are installed without that? It also appears as if there > > is some @foo_path@ stuff in the man pages that should of been > > fixed up by the installer process to use the values compiled in. > > That was my mistake I missed changing it back after generating a new > config.h and fixed by > otis@ in 1d577bedbae8. No, otis fixed it thus: -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" +#define CONFIGFILE "/var/unbound/unbound.conf" I am suggesting that it should be #define CONFIGFILE "/etc/unbound/unbound.conf" ALL base system configuration files *should* be relative to /etc, not /var. > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > > > -- Rod Grimes rgrimes@freebsd.org From nobody Wed Jan 18 15:36:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxqcQ36dRz2yBcG; Wed, 18 Jan 2023 15:36:38 +0000 (UTC) (envelope-from otis@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxqcQ2ZPmz4Y6y; Wed, 18 Jan 2023 15:36:38 +0000 (UTC) (envelope-from otis@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674056198; 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=0jdRbcgZKG3AWk/PWd9Jpbz9MDgEb92ceuuXWAJuCVQ=; b=No4mPSFnO8wiZ1EeLL0OD3IWWA1nJCTCG40Gf4Ku4w3UagDcChyWZhYwtx7HN7Z0t5Vzmq g3+/3pwlSMCADK00xP9iXXnQUfrWaHLI5wBD1OgAIA1bcDVZa2ULWK7WYq5RBe14+2u8L5 Y8+4LetlGaN6vJ8etVG5RgFEtonGAhPraZL9EEThP5OQcyXW3sCImvQ3pfSOXN85kwRead zpSrUt4g+9TNptPZd6R/zgeogloElgUJWtzYq6k33QpJZmpDpAcN0QbQHc7RoFLPiumJk2 eiWjBnQzDqN/7IC+0yx6gi/hlV0fIXB4dY8Wk7YcgRof6JsPFyhgobkHaykqAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674056198; 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=0jdRbcgZKG3AWk/PWd9Jpbz9MDgEb92ceuuXWAJuCVQ=; b=Z3Z8uEvgCtshAGBtWHb3lOIzF1XEFrYR9POZVDy/bOvaXEp4KL/hGaxg5OhQ3oioYllKis 6smXRb+zNlz4mW+9KdtBV/eXL2YofmWaZ8kUgExqyq5Q0a0BKAZdKctds42ivhz1rRZxwG 0b30pDGiEoZsQKA1WuX69MHxAJlDEDbq8BvFltWMSBV4B05zKaEMFYNdtrClneCcVzP3vq 961OVSj/7xCzAPXDGqzW6vqUuZjNxXoVslVV4PnAg4zNpogKAe3wRa/KCcdGLm/zqVTJrl Ce03yE+VPdG5gSJUIbPdT/zuKcFQte5Bz0e9eCbaYF/NtH6iSStq1vEyM96Kqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674056198; a=rsa-sha256; cv=none; b=aMvkjzg48sq71aSI7Z1Cau8H5XHF1nsbe4Eok5CEVXMEQKa1/2EK9mFd4P+Dv/liW1BVQk ZNRrxvsNAkBg5E0TDmVnWaMk/j5brEtyuabgGZDvhdc4p8fk7XHD8B1WBFgbNOT3Quw/+S LBjP+YbxjjRhMe9t9oRESHa7nZLg0Ts0YpxMyJBt3jZg5c/sLooIxNqmdSIEl6+WXh7vod BpsI8Ww8RnjuOGIBKMp4kNMZpa1jy82nhuGuRQV3pnHd59BfsgrXxzli7SvgCYgYMNF3CK 4OUgHJd8krdxfF0W0/UYbnDRKlSwAPu/xkTNDkcr4epIbpBQZgDTK5QHlB+Kmw== Received: from ns2.wilbury.net (ns2.wilbury.net [IPv6:2a01:b200:0:1:f816:3eff:fecd:13e6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "svc.wilbury.net", Issuer "R3" (verified OK)) (Authenticated sender: otis) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NxqcQ0sDbzMCZ; Wed, 18 Jan 2023 15:36:38 +0000 (UTC) (envelope-from otis@FreeBSD.org) Received: from smtpclient.apple (unknown [86.110.242.24]) (Authenticated sender: juraj@lutter.sk) by svc.wilbury.net (Postfix) with ESMTPSA id 3641745CE84; Wed, 18 Jan 2023 16:36:35 +0100 (CET) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path From: Juraj Lutter In-Reply-To: <202301181534.30IFY9Au010384@gndrsh.dnsmgr.net> Date: Wed, 18 Jan 2023 16:36:33 +0100 Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <459C4261-C860-4761-98AC-8F9B867BA918@FreeBSD.org> References: <202301181534.30IFY9Au010384@gndrsh.dnsmgr.net> To: "Rodney W. Grimes" X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,MAY_BE_FORGED, RDNS_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on ns2.wilbury.net X-ThisMailContainsUnwantedMimeParts: N > On 18 Jan 2023, at 16:34, Rodney W. Grimes = wrote: >=20 > No, otis fixed it thus: > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > +#define CONFIGFILE "/var/unbound/unbound.conf" >=20 > I am suggesting that it should be > #define CONFIGFILE "/etc/unbound/unbound.conf" >=20 > ALL base system configuration files *should* be relative to /etc, not = /var. >=20 Would this need any mtree changes or similar? =E2=80=94 Juraj Lutter otis@FreeBSD.org From nobody Wed Jan 18 15:51:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxqxn1J64z2yD2X; Wed, 18 Jan 2023 15:51:41 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxqxm4CKVz4bRs; Wed, 18 Jan 2023 15:51:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; none Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 30IFpb3Y010475; Wed, 18 Jan 2023 07:51:37 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 30IFpbRu010474; Wed, 18 Jan 2023 07:51:37 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net> Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-Reply-To: <459C4261-C860-4761-98AC-8F9B867BA918@FreeBSD.org> To: Juraj Lutter Date: Wed, 18 Jan 2023 07:51:37 -0800 (PST) CC: "Rodney W. Grimes" , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Nxqxm4CKVz4bRs X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N [ Charset UTF-8 unsupported, converting... ] > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes wrote: > > > > No, otis fixed it thus: > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > I am suggesting that it should be > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > ALL base system configuration files *should* be relative to /etc, not /var. > > > > Would this need any mtree changes or similar? No, /etc/unbound is a symbolic link already installed by the build system, and /var/unbound is already a directory, again, installed by the build system. This is a one line change that actually makes the /etc/unbound link work correctly, without this change the binary has a hard coded path that ignores the /etc/unbound symbolic link and requires a recompile if I want to move things around, or maintanance of 2 symbolic links. Personally I dont see *why* unbound has a /var/unbound directory, can someone tell me why that was done? Is this some attempt and maintaining read only root? Does unbound scribble in the config directory, or is this simply mirroring some of the stuff that bind did? > ? > Juraj Lutter > otis@FreeBSD.org -- Rod Grimes rgrimes@freebsd.org From nobody Wed Jan 18 15:56:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxr3H6Cnzz2yF2s; Wed, 18 Jan 2023 15:56:27 +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 4Nxr3H40Gpz4c9J; Wed, 18 Jan 2023 15:56:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id HzdOpGLK0l2xSIAnapRKRh; Wed, 18 Jan 2023 15:56:26 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id IAnYpqgQKcyvuIAnZpyKIg; Wed, 18 Jan 2023 15:56:26 +0000 X-Authority-Analysis: v=2.4 cv=VbHkgXl9 c=1 sm=1 tr=0 ts=63c816aa a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=RvmDmJFTN0MA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=iQT5K8H0XoTOApLSRvMA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 5763311C0; Wed, 18 Jan 2023 07:56:24 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id F3FFD298; Wed, 18 Jan 2023 07:56:23 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Juraj Lutter , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-reply-to: <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net> References: <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Wed, 18 Jan 2023 07:51:37 -0800." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Jan 2023 07:56:23 -0800 Message-Id: <20230118155623.F3FFD298@slippy.cwsent.com> X-CMAE-Envelope: MS4xfJeV5qQNXQ5bez02nJAUiCRWtcDvLicmwgzwwdr86P0aCLKc+qlBS6dLn1NrzRxWBaxWNL/3urcfX41MDZ5+q8b5xCAsRoSovi+zQWqUZJJV0Num3jkC igEq43TN0oEQU6VAe7EUnXuHuhwIBOAA75itzUXwwqPYJafhbJgg6SXqEIoWi1JBwcxMly8+yYh20rlq6xO/rJGnO+Pbi9itgvKzrkWV87HFhL3PcJc0P1Lg E17n+vePto06YEvaHeKFAHnhY28j6SltFWCIAb14ZXSZgY+1522ZauiAMBy0xNa4PLAecdQmg/vkpR1Z8bRcpeQyoXdew5FYgWFw32nFKd9XgNMIAUT1mMx4 2xD5iDVJ X-Rspamd-Queue-Id: 4Nxr3H40Gpz4c9J X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > [ Charset UTF-8 unsupported, converting... ] > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes wr > ote: > > > > > > No, otis fixed it thus: > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > I am suggesting that it should be > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > ALL base system configuration files *should* be relative to /etc, not /va > r. > > > > > > > Would this need any mtree changes or similar? > > No, /etc/unbound is a symbolic link already installed by the build system, > and /var/unbound is already a directory, again, installed by the build system > . > > This is a one line change that actually makes the /etc/unbound link work > correctly, without this change the binary has a hard coded path that ignores > the > /etc/unbound symbolic link and requires a recompile if I want to move > things around, or maintanance of 2 symbolic links. > > Personally I dont see *why* unbound has a /var/unbound directory, can > someone tell me why that was done? Is this some attempt and maintaining > read only root? Does unbound scribble in the config directory, or > is this simply mirroring some of the stuff that bind did? I don't know why it was done but it should be in /etc. I'll submit a review to change it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Jan 18 16:08:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrK43jkbz2yGPN; Wed, 18 Jan 2023 16:08:24 +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 4NxrK42bmJz4kqn; Wed, 18 Jan 2023 16:08:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id I9oIpBAnmc9C4IAz9pRv3p; Wed, 18 Jan 2023 16:08:23 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id IAz7pqkcpcyvuIAz8pyMR5; Wed, 18 Jan 2023 16:08:23 +0000 X-Authority-Analysis: v=2.4 cv=VbHkgXl9 c=1 sm=1 tr=0 ts=63c81977 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=RvmDmJFTN0MA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=m0upQfrsCj9ja754TEkA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id BE23911DD; Wed, 18 Jan 2023 08:08:21 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id AACA6227; Wed, 18 Jan 2023 08:08:21 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Juraj Lutter , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-reply-to: <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net> References: <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Wed, 18 Jan 2023 07:51:37 -0800." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Jan 2023 08:08:21 -0800 Message-Id: <20230118160821.AACA6227@slippy.cwsent.com> X-CMAE-Envelope: MS4xfKT3KDYRgU3MAkLMsU2ikbcc4I08xmGVsTtehAowQfG4GghHxqSybRV0Ag+DHuY1fDulf4YLjp13zMO/cT5eTSyVeewSyg1flXmqwtrgtKmRVMBqRhtf Zei/v3XgijhCOhk7cM31h12wRo3eOI6LUWLJMfHK5uMkPS3/DVDIXTIUJN0Rm+dEXWjjkUpJQzA2f4/E6nYT+CqRNQniTcnXZDdaHwWEdhMEDDx7H/A1IjRl DyRC7pFLAQMss921WTJvOgLyU+I7vvWDAcZHz3GrMDYBwNNjzS3p915SK6Vu3OEyOmYG7bRqDYaeTc4KpAShcwoV6NR9EL4dqhIlWcT3unF5F+vMApPgXG8j o/SIMgaE X-Rspamd-Queue-Id: 4NxrK42bmJz4kqn X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > [ Charset UTF-8 unsupported, converting... ] > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes wr > ote: > > > > > > No, otis fixed it thus: > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > I am suggesting that it should be > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > ALL base system configuration files *should* be relative to /etc, not /va > r. > > > > > > > Would this need any mtree changes or similar? > > No, /etc/unbound is a symbolic link already installed by the build system, > and /var/unbound is already a directory, again, installed by the build system > . > > This is a one line change that actually makes the /etc/unbound link work > correctly, without this change the binary has a hard coded path that ignores > the > /etc/unbound symbolic link and requires a recompile if I want to move > things around, or maintanance of 2 symbolic links. > > Personally I dont see *why* unbound has a /var/unbound directory, can > someone tell me why that was done? Is this some attempt and maintaining > read only root? Does unbound scribble in the config directory, or > is this simply mirroring some of the stuff that bind did? I see why it does this. Looking at usr.sbin/unbound/setup/local-unbound-setu p.sh, it installs its config files in $workdir. Looking at git log 49cede74eecf4 (SVN r255809), the last paragraph in the commit log entry says: Note that these scripts place the unbound configuration files in /var/unbound rather than /etc/unbound. This is necessary so that unbound can reload its configuration while chrooted. We should probably provide symlinks in /etc. Providing symlinks in /etc/unbound appears to be the correct solution. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Jan 18 16:24:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgm1VzPz2yJNP; Wed, 18 Jan 2023 16:24:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgm0n1Cz3D8K; Wed, 18 Jan 2023 16:24:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y8JtkdSUjBVpKIDakFs6+PAejfk+QgW2FhEsxhdzZfg=; b=AXAMBqCE9FU7bs2cPJEF18WnEQNIMA1qi0cncCBJi4Ftr2VvQaO+O1nhLEYdNbwA1C9Oai /Cj0qwHDkBDzsbVflqQ5yP27Grp/uAeZ92+nuatkjiP+j1NBDTuc7bny2tygdEXqkgjUIT 5lH+idMGpxkIhLsIjZqdtYBbTf8a/WN6r1R1LTOmRuXrP3/AWE30rdKGwUgVkdFyXv+Ulo q3ItEMyUwMXt/SokdlLRVqdoDor9EmRoy8oGDSl+p8e6vU0JGYNzguhsHLu+jKM9S5RKXd UvnyMQnuUIUOY3J6L24Ss/U9pXFtVcxV9fuIg1ooxb2/o2A3yty+LjkZruMtDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y8JtkdSUjBVpKIDakFs6+PAejfk+QgW2FhEsxhdzZfg=; b=nyT19eoPd8mv/1faYCNBBTK6nEdeP7IWEW08Bg3i0xwlQHx4SRzjXIiYkqHOAhDW8QnjMR sPWXGLTJ+njsuboPkzFRydsPh85DYvmzIIXlTWs5xes6Bh0FAbkMhGfnmKAbLDB5lfcwI/ OKMhQgWrALGjRG9flqZYqy+4wEruWt8BfR8uFJry6GZ0YWC+qn7reoF1NbEsuAm3dKSojY HVAJxwXNIxR0Upm1djH3sHGWVJhTsAb/5i8feKtIeDM/ElLQTNUhnB5Ww/rj9zjPWpHcqN Qm3+izfLZM5p6YfzHcTJ4tlidaAPn/zAn0GpftcnmBoITIKZGQm+OhLRvUQFnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059076; a=rsa-sha256; cv=none; b=NNFcI1pWDD5076av31zIy1aV5iNb/QrcH7lt/1mXDw4xj7ZChPzI52D+jkIGQvfLXaj1Zs UBTZO+mRQgj8s4b28kJqph+DDOT2MKIx+k34j6L6zSW38k7u7A3Iz+nVb/VCSD72KhJmZt 2uDreNKSxAdkHhb3qhVaYUY1x+4uFANcKy2Gp+2HPqDxoruTCPubw6A1FPaJnIOH1RChYJ GkeuQxtiDrBLXk+S5LkBmQNuyy2SyQ6L6ehKdBo07hPY9f8VYIo8h+SJHntSBFP0oYpD0X liIHYspI4sbU2qOrKkiu9WtLHLyA3O1ZViLE5Tvdm9zd3UbVXE3mM5HDvTqrSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgl6vzvzHp5; Wed, 18 Jan 2023 16:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOZdZ037654; Wed, 18 Jan 2023 16:24:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOZAF037653; Wed, 18 Jan 2023 16:24:35 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:35 GMT Message-Id: <202301181624.30IGOZAF037653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b3e602d9ac5e - stable/13 - device_get_property: add a HANDLE 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b3e602d9ac5e3157874dfe3986dc819971d2142c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b3e602d9ac5e3157874dfe3986dc819971d2142c commit b3e602d9ac5e3157874dfe3986dc819971d2142c Author: Bjoern A. Zeeb AuthorDate: 2022-09-29 12:41:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:22:13 +0000 device_get_property: add a HANDLE case This will resolve a reference and return the appropriate handle, a node on the simplebus or an ACPI_HANDLE for ACPI. For now we do not try to further abstract the return type. Reviewed by: mw Differential Revision: https://reviews.freebsd.org/D36793 (cherry picked from commit 99e6980fcf5e12654c3e89b97b774de807d740a4) --- share/man/man9/device_get_property.9 | 5 +++- sys/dev/acpica/acpi.c | 47 ++++++++++++++++++++++++++++++++++++ sys/dev/fdt/simplebus.c | 19 +++++++++++++-- sys/kern/subr_bus.c | 1 + sys/sys/bus.h | 1 + 5 files changed, 70 insertions(+), 3 deletions(-) diff --git a/share/man/man9/device_get_property.9 b/share/man/man9/device_get_property.9 index d925f5f224db..93c01f199477 100644 --- a/share/man/man9/device_get_property.9 +++ b/share/man/man9/device_get_property.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 18, 2022 +.Dd September 29, 2022 .Dt DEVICE_GET_PROPERTY 9 .Os .Sh NAME @@ -54,6 +54,9 @@ Currently the following types are supported: The underlying property is a string of bytes. .It Dv DEVICE_PROP_ANY Wildcard property type. +.It Dv DEVICE_PROP_HANDLE +Following a reference the underlying property is a handle of the +respective bus. .It Dv DEVICE_PROP_UINT32 The underlying property is an array of unsigned 32 bit integers. The diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 9005448ddee9..8f4419a76c58 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1824,6 +1824,35 @@ acpi_find_dsd(struct acpi_device *ad) return (AE_NOT_FOUND); } +static ssize_t +acpi_bus_get_prop_handle(const ACPI_OBJECT *hobj, void *propvalue, size_t size) +{ + ACPI_OBJECT *pobj; + ACPI_HANDLE h; + + if (hobj->Type != ACPI_TYPE_PACKAGE) + goto err; + if (hobj->Package.Count != 1) + goto err; + + pobj = &hobj->Package.Elements[0]; + if (pobj == NULL) + goto err; + if (pobj->Type != ACPI_TYPE_LOCAL_REFERENCE) + goto err; + + h = acpi_GetReference(NULL, pobj); + if (h == NULL) + goto err; + + if (propvalue != NULL && size >= sizeof(ACPI_HANDLE)) + *(ACPI_HANDLE *)propvalue = h; + return (sizeof(ACPI_HANDLE)); + +err: + return (-1); +} + static ssize_t acpi_bus_get_prop(device_t bus, device_t child, const char *propname, void *propvalue, size_t size, device_property_type_t type) @@ -1842,6 +1871,8 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname, case DEVICE_PROP_UINT32: case DEVICE_PROP_UINT64: break; + case DEVICE_PROP_HANDLE: + return (acpi_bus_get_prop_handle(obj, propvalue, size)); default: return (-1); } @@ -1873,6 +1904,22 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname, MIN(size, obj->Buffer.Length)); return (obj->Buffer.Length); + case ACPI_TYPE_PACKAGE: + if (propvalue != NULL && size >= sizeof(ACPI_OBJECT *)) { + *((ACPI_OBJECT **) propvalue) = + __DECONST(ACPI_OBJECT *, obj); + } + return (sizeof(ACPI_OBJECT *)); + + case ACPI_TYPE_LOCAL_REFERENCE: + if (propvalue != NULL && size >= sizeof(ACPI_HANDLE)) { + ACPI_HANDLE h; + + h = acpi_GetReference(NULL, + __DECONST(ACPI_OBJECT *, obj)); + memcpy(propvalue, h, sizeof(ACPI_HANDLE)); + } + return (sizeof(ACPI_HANDLE)); default: return (0); } diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index ab7868f245bf..a29b28f2a016 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -359,7 +359,7 @@ static ssize_t simplebus_get_property(device_t bus, device_t child, const char *propname, void *propvalue, size_t size, device_property_type_t type) { - phandle_t node = ofw_bus_get_node(child); + phandle_t node, xref; ssize_t ret, i; uint32_t *buffer; uint64_t val; @@ -369,11 +369,13 @@ simplebus_get_property(device_t bus, device_t child, const char *propname, case DEVICE_PROP_BUFFER: case DEVICE_PROP_UINT32: case DEVICE_PROP_UINT64: + case DEVICE_PROP_HANDLE: break; default: return (-1); } + node = ofw_bus_get_node(child); if (propvalue == NULL || size == 0) return (OF_getproplen(node, propname)); @@ -404,7 +406,20 @@ simplebus_get_property(device_t bus, device_t child, const char *propname, ((uint64_t *)buffer)[i / 2] = val; } return (ret); - } + } + + if (type == DEVICE_PROP_HANDLE) { + if (size < sizeof(node)) + return (-1); + ret = OF_getencprop(node, propname, &xref, sizeof(xref)); + if (ret <= 0) + return (ret); + + node = OF_node_from_xref(xref); + if (propvalue != NULL) + *(uint32_t *)propvalue = node; + return (ret); + } return (OF_getprop(node, propname, propvalue, size)); } diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index c70e0e7b5ec1..c1383add7e47 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2683,6 +2683,7 @@ device_get_property(device_t dev, const char *prop, void *val, size_t sz, switch (type) { case DEVICE_PROP_ANY: case DEVICE_PROP_BUFFER: + case DEVICE_PROP_HANDLE: /* Size checks done in implementation. */ break; case DEVICE_PROP_UINT32: if (sz % 4 != 0) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index c017f38dcf11..a308810f158f 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -73,6 +73,7 @@ typedef enum device_property_type { DEVICE_PROP_BUFFER = 1, DEVICE_PROP_UINT32 = 2, DEVICE_PROP_UINT64 = 3, + DEVICE_PROP_HANDLE = 4, } device_property_type_t; /** From nobody Wed Jan 18 16:24:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgp3YS7z2yJNR; Wed, 18 Jan 2023 16:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgp3CsKz3DNp; Wed, 18 Jan 2023 16:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dw3OmD4V5izTiJ9fqVdNXK6eN1NVqITX7P8GkAkYWM8=; b=L8XBKxvuTV3uzWGhy7RhfL+ryqZcACgKFHm+7x/Gs+BOnVe5KqDzlzkDIGyjAKxPFe0y8J tHsckiph/5hkGO7G7UNTOf3KlMHQ3JYKXulgZAzBxv9t5+ZLSk6wHfOlsNzdcLdbBNWb23 a4+iWYVdcbxPLx6kMAcWJi636yBeNQ70x5dc42AG2FqMEillp1IBJLzC7AP5CuNFVmw0ee bQ1LMLKWf0bNYD8R7qHoWuXXGTTtUolCkj9iNCZBhDHUguZEX0DHEP64tEKlWjyFkoab6D 0FUXFe4UtyPCCICaf/LFM6IB34ywY6qwOfSatOHvacByyqcl+/PGSUcOnNKoEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dw3OmD4V5izTiJ9fqVdNXK6eN1NVqITX7P8GkAkYWM8=; b=XVzfKo7TxlI/mGLzS2rA2exrv2C43NRAxhBWKQFhK2gY9M8VVFEDmYkJac0/+pGCOkVZmi o+pSs/g2w9RLfTufMkCAHpGIxxH5pn7RZi/IGE65jZqERWiGX2Nl+EA2W3l0aqlys1HmT1 JrlxLkMGSNvyWwy9dGpBEBZ9nSObPC6dfp5pQTxez29Bz6JpYjVF2qEEsogr90BJ+DnrdW 66MMKZKGStT19LVIInhIPTSDj7izzRqXGLnGFoh8iTyM7SRXv3JFWfsWBaVSkLRtnEXeFm wjhmDdDI0UT5/obDep2ok5oSkcNBnGy6B+Og31pK5S6hmYXefw/rc7YKWzPd6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059078; a=rsa-sha256; cv=none; b=QtfiTObQ2l46I4duZets/1FvMeFhrmEe5aAZPgL6PeDZue5d9a0NjPHMxxZCuR96LZ1wQ9 gz+8ypub2NyLQc5bQWUdNgDdyNyMMiulnRnDrASGQKSKjNK/y8MqTvMCj4zannpS3YhZ90 j3/yV1SzjIk2c9Zx5ycEGJrzz8sfN7n5JysHgZDYrEm9uN0zcOH46MJzeQneMZxoT1jgnh yWgIcOAzGjbLh18BYdbmMCjRU+1OyeciIH7zDv+C7fTiEjjlxlFX1nHPEfO/liG3e7BAlT t3Aq9BWhHLPElu6JkxejSLLG1eItmjemlTKKdgOdg+IUZlVE6GUrpe88caW3mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgp1w22zHZY; Wed, 18 Jan 2023 16:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOcLi037678; Wed, 18 Jan 2023 16:24:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGObst037677; Wed, 18 Jan 2023 16:24:37 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:37 GMT Message-Id: <202301181624.30IGObst037677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6ce9424029aa - stable/13 - rtw89: import Realtek's rtw89 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ce9424029aa34232ac5af1818ba2d6e5249ffe4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6ce9424029aa34232ac5af1818ba2d6e5249ffe4 commit 6ce9424029aa34232ac5af1818ba2d6e5249ffe4 Author: Bjoern A. Zeeb AuthorDate: 2022-09-09 12:41:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:22:24 +0000 rtw89: import Realtek's rtw89 driver Import rtw89 based on wireless-testing at (tag: wt-2022-09-02) 78667a29c116c6b186a37e28cd8dd7fa9923aee8 with adjustments for FreeBSD. For the moment this will stay disconnected from the build until the last bits are flushed out, but this will help people with a card to do testing and possibly help improving. Given the lack of full license texts on non-local files this is imported under the draft policy for handling SPDX files (D29226). [1] Approved by: core.11 (imp) [1] [2022-03-27] (cherry picked from commit 8e93258f2686c76b4e3b384a904d8b4413976229) --- sys/contrib/dev/rtw89/Kconfig | 68 + sys/contrib/dev/rtw89/Makefile | 40 + sys/contrib/dev/rtw89/cam.c | 765 + sys/contrib/dev/rtw89/cam.h | 391 + sys/contrib/dev/rtw89/chan.c | 235 + sys/contrib/dev/rtw89/chan.h | 64 + sys/contrib/dev/rtw89/coex.c | 6600 ++++ sys/contrib/dev/rtw89/coex.h | 189 + sys/contrib/dev/rtw89/core.c | 3318 ++ sys/contrib/dev/rtw89/core.h | 4193 +++ sys/contrib/dev/rtw89/debug.c | 2667 ++ sys/contrib/dev/rtw89/debug.h | 92 + sys/contrib/dev/rtw89/efuse.c | 330 + sys/contrib/dev/rtw89/efuse.h | 13 + sys/contrib/dev/rtw89/fw.c | 2625 ++ sys/contrib/dev/rtw89/fw.h | 2701 ++ sys/contrib/dev/rtw89/mac.c | 4673 +++ sys/contrib/dev/rtw89/mac.h | 967 + sys/contrib/dev/rtw89/mac80211.c | 879 + sys/contrib/dev/rtw89/pci.c | 3942 +++ sys/contrib/dev/rtw89/pci.h | 1128 + sys/contrib/dev/rtw89/phy.c | 3879 ++ sys/contrib/dev/rtw89/phy.h | 499 + sys/contrib/dev/rtw89/ps.c | 181 + sys/contrib/dev/rtw89/ps.h | 16 + sys/contrib/dev/rtw89/reg.h | 4283 +++ sys/contrib/dev/rtw89/regd.c | 358 + sys/contrib/dev/rtw89/rtw8852a.c | 2213 ++ sys/contrib/dev/rtw89/rtw8852a.h | 111 + sys/contrib/dev/rtw89/rtw8852a_rfk.c | 3868 ++ sys/contrib/dev/rtw89/rtw8852a_rfk.h | 24 + sys/contrib/dev/rtw89/rtw8852a_rfk_table.c | 1607 + sys/contrib/dev/rtw89/rtw8852a_rfk_table.h | 86 + sys/contrib/dev/rtw89/rtw8852a_table.c | 51045 +++++++++++++++++++++++++++ sys/contrib/dev/rtw89/rtw8852a_table.h | 28 + sys/contrib/dev/rtw89/rtw8852ae.c | 89 + sys/contrib/dev/rtw89/rtw8852c.c | 3050 ++ sys/contrib/dev/rtw89/rtw8852c.h | 88 + sys/contrib/dev/rtw89/rtw8852c_rfk.c | 4081 +++ sys/contrib/dev/rtw89/rtw8852c_rfk.h | 29 + sys/contrib/dev/rtw89/rtw8852c_rfk_table.c | 781 + sys/contrib/dev/rtw89/rtw8852c_rfk_table.h | 67 + sys/contrib/dev/rtw89/rtw8852c_table.c | 36704 +++++++++++++++++++ sys/contrib/dev/rtw89/rtw8852c_table.h | 36 + sys/contrib/dev/rtw89/rtw8852ce.c | 94 + sys/contrib/dev/rtw89/sar.c | 298 + sys/contrib/dev/rtw89/sar.h | 26 + sys/contrib/dev/rtw89/ser.c | 745 + sys/contrib/dev/rtw89/ser.h | 15 + sys/contrib/dev/rtw89/txrx.h | 433 + sys/contrib/dev/rtw89/util.h | 47 + sys/modules/rtw89/Makefile | 40 + 52 files changed, 150701 insertions(+) diff --git a/sys/contrib/dev/rtw89/Kconfig b/sys/contrib/dev/rtw89/Kconfig new file mode 100644 index 000000000000..93e09400aac4 --- /dev/null +++ b/sys/contrib/dev/rtw89/Kconfig @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +menuconfig RTW89 + tristate "Realtek 802.11ax wireless chips support" + depends on MAC80211 + help + This module adds support for mac80211-based wireless drivers that + enables Realtek IEEE 802.11ax wireless chipsets. + + If you choose to build a module, it'll be called rtw89. + +if RTW89 + +config RTW89_CORE + tristate + +config RTW89_PCI + tristate + +config RTW89_8852A + tristate + +config RTW89_8852C + tristate + +config RTW89_8852AE + tristate "Realtek 8852AE PCI wireless network (Wi-Fi 6) adapter" + depends on PCI + select RTW89_CORE + select RTW89_PCI + select RTW89_8852A + help + Select this option will enable support for 8852AE chipset + + 802.11ax PCIe wireless network (Wi-Fi 6) adapter + +config RTW89_8852CE + tristate "Realtek 8852CE PCI wireless network (Wi-Fi 6E) adapter" + depends on PCI + select RTW89_CORE + select RTW89_PCI + select RTW89_8852C + help + Select this option will enable support for 8852CE chipset + + 802.11ax PCIe wireless network (Wi-Fi 6E) adapter + +config RTW89_DEBUG + bool + +config RTW89_DEBUGMSG + bool "Realtek rtw89 debug message support" + depends on RTW89_CORE + select RTW89_DEBUG + help + Enable debug message support + + If unsure, say Y to simplify debug problems + +config RTW89_DEBUGFS + bool "Realtek rtw89 debugfs support" + depends on RTW89_CORE + select RTW89_DEBUG + help + Enable debugfs support + + If unsure, say Y to simplify debug problems + +endif diff --git a/sys/contrib/dev/rtw89/Makefile b/sys/contrib/dev/rtw89/Makefile new file mode 100644 index 000000000000..a87f2aff4def --- /dev/null +++ b/sys/contrib/dev/rtw89/Makefile @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + +obj-$(CONFIG_RTW89_CORE) += rtw89_core.o +rtw89_core-y += core.o \ + mac80211.o \ + mac.o \ + phy.o \ + fw.o \ + cam.o \ + efuse.o \ + regd.o \ + sar.o \ + coex.o \ + ps.o \ + chan.o \ + ser.o + +obj-$(CONFIG_RTW89_8852A) += rtw89_8852a.o +rtw89_8852a-objs := rtw8852a.o \ + rtw8852a_table.o \ + rtw8852a_rfk.o \ + rtw8852a_rfk_table.o + +obj-$(CONFIG_RTW89_8852AE) += rtw89_8852ae.o +rtw89_8852ae-objs := rtw8852ae.o + +obj-$(CONFIG_RTW89_8852C) += rtw89_8852c.o +rtw89_8852c-objs := rtw8852c.o \ + rtw8852c_table.o \ + rtw8852c_rfk.o \ + rtw8852c_rfk_table.o + +obj-$(CONFIG_RTW89_8852CE) += rtw89_8852ce.o +rtw89_8852ce-objs := rtw8852ce.o + +rtw89_core-$(CONFIG_RTW89_DEBUG) += debug.o + +obj-$(CONFIG_RTW89_PCI) += rtw89_pci.o +rtw89_pci-y := pci.o + diff --git a/sys/contrib/dev/rtw89/cam.c b/sys/contrib/dev/rtw89/cam.c new file mode 100644 index 000000000000..f5301c2bbf13 --- /dev/null +++ b/sys/contrib/dev/rtw89/cam.c @@ -0,0 +1,765 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2019-2020 Realtek Corporation + */ + +#include "cam.h" +#include "debug.h" +#include "fw.h" +#include "mac.h" + +static struct sk_buff * +rtw89_cam_get_sec_key_cmd(struct rtw89_dev *rtwdev, + struct rtw89_sec_cam_entry *sec_cam, + bool ext_key) +{ + struct sk_buff *skb; + u32 cmd_len = H2C_SEC_CAM_LEN; + u32 key32[4]; + u8 *cmd; + int i, j; + + skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, cmd_len); + if (!skb) + return NULL; + + skb_put_zero(skb, cmd_len); + + for (i = 0; i < 4; i++) { + j = i * 4; + j += ext_key ? 16 : 0; + key32[i] = FIELD_PREP(GENMASK(7, 0), sec_cam->key[j + 0]) | + FIELD_PREP(GENMASK(15, 8), sec_cam->key[j + 1]) | + FIELD_PREP(GENMASK(23, 16), sec_cam->key[j + 2]) | + FIELD_PREP(GENMASK(31, 24), sec_cam->key[j + 3]); + } + + cmd = skb->data; + RTW89_SET_FWCMD_SEC_IDX(cmd, sec_cam->sec_cam_idx + (ext_key ? 1 : 0)); + RTW89_SET_FWCMD_SEC_OFFSET(cmd, sec_cam->offset); + RTW89_SET_FWCMD_SEC_LEN(cmd, sec_cam->len); + RTW89_SET_FWCMD_SEC_TYPE(cmd, sec_cam->type); + RTW89_SET_FWCMD_SEC_EXT_KEY(cmd, ext_key); + RTW89_SET_FWCMD_SEC_SPP_MODE(cmd, sec_cam->spp_mode); + RTW89_SET_FWCMD_SEC_KEY0(cmd, key32[0]); + RTW89_SET_FWCMD_SEC_KEY1(cmd, key32[1]); + RTW89_SET_FWCMD_SEC_KEY2(cmd, key32[2]); + RTW89_SET_FWCMD_SEC_KEY3(cmd, key32[3]); + + return skb; +} + +static int rtw89_cam_send_sec_key_cmd(struct rtw89_dev *rtwdev, + struct rtw89_sec_cam_entry *sec_cam) +{ + struct sk_buff *skb, *ext_skb; + int ret; + + skb = rtw89_cam_get_sec_key_cmd(rtwdev, sec_cam, false); + if (!skb) { + rtw89_err(rtwdev, "failed to get sec key command\n"); + return -ENOMEM; + } + + rtw89_h2c_pkt_set_hdr(rtwdev, skb, + FWCMD_TYPE_H2C, + H2C_CAT_MAC, + H2C_CL_MAC_SEC_CAM, + H2C_FUNC_MAC_SEC_UPD, 1, 0, + H2C_SEC_CAM_LEN); + ret = rtw89_h2c_tx(rtwdev, skb, false); + if (ret) { + rtw89_err(rtwdev, "failed to send sec key h2c: %d\n", ret); + dev_kfree_skb(skb); + return ret; + } + + if (!sec_cam->ext_key) + return 0; + + ext_skb = rtw89_cam_get_sec_key_cmd(rtwdev, sec_cam, true); + if (!ext_skb) { + rtw89_err(rtwdev, "failed to get ext sec key command\n"); + return -ENOMEM; + } + + rtw89_h2c_pkt_set_hdr(rtwdev, ext_skb, + FWCMD_TYPE_H2C, + H2C_CAT_MAC, + H2C_CL_MAC_SEC_CAM, + H2C_FUNC_MAC_SEC_UPD, + 1, 0, H2C_SEC_CAM_LEN); + ret = rtw89_h2c_tx(rtwdev, ext_skb, false); + if (ret) { + rtw89_err(rtwdev, "failed to send ext sec key h2c: %d\n", ret); + dev_kfree_skb(ext_skb); + return ret; + } + + return 0; +} + +static int rtw89_cam_get_avail_sec_cam(struct rtw89_dev *rtwdev, + u8 *sec_cam_idx, bool ext_key) +{ + const struct rtw89_chip_info *chip = rtwdev->chip; + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + u8 sec_cam_num = chip->scam_num; + u8 idx = 0; + + if (!ext_key) { + idx = find_first_zero_bit(cam_info->sec_cam_map, sec_cam_num); + if (idx >= sec_cam_num) + return -EBUSY; + + set_bit(idx, cam_info->sec_cam_map); + *sec_cam_idx = idx; + + return 0; + } + +again: + idx = find_next_zero_bit(cam_info->sec_cam_map, sec_cam_num, idx); + if (idx >= sec_cam_num - 1) + return -EBUSY; + /* ext keys need two cam entries for 256-bit key */ + if (test_bit(idx + 1, cam_info->sec_cam_map)) { + idx++; + goto again; + } + + set_bit(idx, cam_info->sec_cam_map); + set_bit(idx + 1, cam_info->sec_cam_map); + *sec_cam_idx = idx; + + return 0; +} + +static int rtw89_cam_get_addr_cam_key_idx(struct rtw89_addr_cam_entry *addr_cam, + struct rtw89_sec_cam_entry *sec_cam, + struct ieee80211_key_conf *key, + u8 *key_idx) +{ + u8 idx; + + /* RTW89_ADDR_CAM_SEC_NONE : not enabled + * RTW89_ADDR_CAM_SEC_ALL_UNI : 0 - 6 unicast + * RTW89_ADDR_CAM_SEC_NORMAL : 0 - 1 unicast, 2 - 4 group, 5 - 6 BIP + * RTW89_ADDR_CAM_SEC_4GROUP : 0 - 1 unicast, 2 - 5 group, 6 BIP + */ + switch (addr_cam->sec_ent_mode) { + case RTW89_ADDR_CAM_SEC_NONE: + return -EINVAL; + case RTW89_ADDR_CAM_SEC_ALL_UNI: + if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) + return -EINVAL; + idx = find_first_zero_bit(addr_cam->sec_cam_map, + RTW89_SEC_CAM_IN_ADDR_CAM); + if (idx >= RTW89_SEC_CAM_IN_ADDR_CAM) + return -EBUSY; + *key_idx = idx; + break; + case RTW89_ADDR_CAM_SEC_NORMAL: + if (sec_cam->type == RTW89_SEC_KEY_TYPE_BIP_CCMP128) { + idx = find_next_zero_bit(addr_cam->sec_cam_map, + RTW89_SEC_CAM_IN_ADDR_CAM, 5); + if (idx > 6) + return -EBUSY; + *key_idx = idx; + break; + } + + if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { + idx = find_next_zero_bit(addr_cam->sec_cam_map, + RTW89_SEC_CAM_IN_ADDR_CAM, 0); + if (idx > 1) + return -EBUSY; + *key_idx = idx; + break; + } + + /* Group keys */ + idx = find_next_zero_bit(addr_cam->sec_cam_map, + RTW89_SEC_CAM_IN_ADDR_CAM, 2); + if (idx > 4) + return -EBUSY; + *key_idx = idx; + break; + case RTW89_ADDR_CAM_SEC_4GROUP: + if (sec_cam->type == RTW89_SEC_KEY_TYPE_BIP_CCMP128) { + if (test_bit(6, addr_cam->sec_cam_map)) + return -EINVAL; + *key_idx = 6; + break; + } + + if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { + idx = find_next_zero_bit(addr_cam->sec_cam_map, + RTW89_SEC_CAM_IN_ADDR_CAM, 0); + if (idx > 1) + return -EBUSY; + *key_idx = idx; + break; + } + + /* Group keys */ + idx = find_next_zero_bit(addr_cam->sec_cam_map, + RTW89_SEC_CAM_IN_ADDR_CAM, 2); + if (idx > 5) + return -EBUSY; + *key_idx = idx; + break; + } + + return 0; +} + +static int rtw89_cam_attach_sec_cam(struct rtw89_dev *rtwdev, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_key_conf *key, + struct rtw89_sec_cam_entry *sec_cam) +{ + struct rtw89_sta *rtwsta = sta_to_rtwsta_safe(sta); + struct rtw89_vif *rtwvif; + struct rtw89_addr_cam_entry *addr_cam; + u8 key_idx = 0; + int ret; + + if (!vif) { + rtw89_err(rtwdev, "No iface for adding sec cam\n"); + return -EINVAL; + } + + rtwvif = (struct rtw89_vif *)vif->drv_priv; + addr_cam = rtw89_get_addr_cam_of(rtwvif, rtwsta); + ret = rtw89_cam_get_addr_cam_key_idx(addr_cam, sec_cam, key, &key_idx); + if (ret) { + rtw89_err(rtwdev, "failed to get addr cam key idx %d, %d\n", + addr_cam->sec_ent_mode, sec_cam->type); + return ret; + } + + key->hw_key_idx = key_idx; + addr_cam->sec_ent_keyid[key_idx] = key->keyidx; + addr_cam->sec_ent[key_idx] = sec_cam->sec_cam_idx; + addr_cam->sec_entries[key_idx] = sec_cam; + set_bit(key_idx, addr_cam->sec_cam_map); + ret = rtw89_chip_h2c_dctl_sec_cam(rtwdev, rtwvif, rtwsta); + if (ret) { + rtw89_err(rtwdev, "failed to update dctl cam sec entry: %d\n", + ret); + return ret; + } + ret = rtw89_fw_h2c_cam(rtwdev, rtwvif, rtwsta, NULL); + if (ret) { + rtw89_err(rtwdev, "failed to update addr cam sec entry: %d\n", + ret); + clear_bit(key_idx, addr_cam->sec_cam_map); + addr_cam->sec_entries[key_idx] = NULL; + return ret; + } + + return 0; +} + +static int rtw89_cam_sec_key_install(struct rtw89_dev *rtwdev, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_key_conf *key, + u8 hw_key_type, bool ext_key) +{ + struct rtw89_sec_cam_entry *sec_cam = NULL; + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + u8 sec_cam_idx; + int ret; + + /* maximum key length 256-bit */ + if (key->keylen > 32) { + rtw89_err(rtwdev, "invalid sec key length %d\n", key->keylen); + return -EINVAL; + } + + ret = rtw89_cam_get_avail_sec_cam(rtwdev, &sec_cam_idx, ext_key); + if (ret) { + rtw89_warn(rtwdev, "no available sec cam: %d ext: %d\n", + ret, ext_key); + return ret; + } + + sec_cam = kzalloc(sizeof(*sec_cam), GFP_KERNEL); + if (!sec_cam) { + ret = -ENOMEM; + goto err_release_cam; + } + + sec_cam->sec_cam_idx = sec_cam_idx; + sec_cam->type = hw_key_type; + sec_cam->len = RTW89_SEC_CAM_LEN; + sec_cam->ext_key = ext_key; + memcpy(sec_cam->key, key->key, key->keylen); + ret = rtw89_cam_send_sec_key_cmd(rtwdev, sec_cam); + if (ret) { + rtw89_err(rtwdev, "failed to send sec key cmd: %d\n", ret); + goto err_release_cam; + } + + /* associate with addr cam */ + ret = rtw89_cam_attach_sec_cam(rtwdev, vif, sta, key, sec_cam); + if (ret) { + rtw89_err(rtwdev, "failed to attach sec cam: %d\n", ret); + goto err_release_cam; + } + + return 0; + +err_release_cam: + kfree(sec_cam); + clear_bit(sec_cam_idx, cam_info->sec_cam_map); + if (ext_key) + clear_bit(sec_cam_idx + 1, cam_info->sec_cam_map); + + return ret; +} + +int rtw89_cam_sec_key_add(struct rtw89_dev *rtwdev, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_key_conf *key) +{ + const struct rtw89_chip_info *chip = rtwdev->chip; + u8 hw_key_type; + bool ext_key = false; + int ret; + + switch (key->cipher) { + case WLAN_CIPHER_SUITE_WEP40: + hw_key_type = RTW89_SEC_KEY_TYPE_WEP40; + break; + case WLAN_CIPHER_SUITE_WEP104: + hw_key_type = RTW89_SEC_KEY_TYPE_WEP104; + break; + case WLAN_CIPHER_SUITE_CCMP: + hw_key_type = RTW89_SEC_KEY_TYPE_CCMP128; + key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; + break; + case WLAN_CIPHER_SUITE_CCMP_256: + hw_key_type = RTW89_SEC_KEY_TYPE_CCMP256; + key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; + ext_key = true; + break; + case WLAN_CIPHER_SUITE_GCMP: + hw_key_type = RTW89_SEC_KEY_TYPE_GCMP128; + key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; + break; + case WLAN_CIPHER_SUITE_GCMP_256: + hw_key_type = RTW89_SEC_KEY_TYPE_GCMP256; + key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; + ext_key = true; + break; + default: + return -EOPNOTSUPP; + } + + if (!chip->hw_sec_hdr) + key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; + + ret = rtw89_cam_sec_key_install(rtwdev, vif, sta, key, hw_key_type, + ext_key); + if (ret) { + rtw89_err(rtwdev, "failed to install key type %d ext %d: %d\n", + hw_key_type, ext_key, ret); + return ret; + } + + return 0; +} + +int rtw89_cam_sec_key_del(struct rtw89_dev *rtwdev, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_key_conf *key, + bool inform_fw) +{ + struct rtw89_sta *rtwsta = sta_to_rtwsta_safe(sta); + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + struct rtw89_vif *rtwvif; + struct rtw89_addr_cam_entry *addr_cam; + struct rtw89_sec_cam_entry *sec_cam; + u8 key_idx = key->hw_key_idx; + u8 sec_cam_idx; + int ret = 0; + + if (!vif) { + rtw89_err(rtwdev, "No iface for deleting sec cam\n"); + return -EINVAL; + } + + rtwvif = (struct rtw89_vif *)vif->drv_priv; + addr_cam = rtw89_get_addr_cam_of(rtwvif, rtwsta); + sec_cam = addr_cam->sec_entries[key_idx]; + if (!sec_cam) + return -EINVAL; + + /* detach sec cam from addr cam */ + clear_bit(key_idx, addr_cam->sec_cam_map); + addr_cam->sec_entries[key_idx] = NULL; + if (inform_fw) { + ret = rtw89_chip_h2c_dctl_sec_cam(rtwdev, rtwvif, rtwsta); + if (ret) + rtw89_err(rtwdev, "failed to update dctl cam del key: %d\n", ret); + ret = rtw89_fw_h2c_cam(rtwdev, rtwvif, rtwsta, NULL); + if (ret) + rtw89_err(rtwdev, "failed to update cam del key: %d\n", ret); + } + + /* clear valid bit in addr cam will disable sec cam, + * so we don't need to send H2C command again + */ + sec_cam_idx = sec_cam->sec_cam_idx; + clear_bit(sec_cam_idx, cam_info->sec_cam_map); + if (sec_cam->ext_key) + clear_bit(sec_cam_idx + 1, cam_info->sec_cam_map); + + kfree(sec_cam); + + return ret; +} + +static void rtw89_cam_reset_key_iter(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_key_conf *key, + void *data) +{ + struct rtw89_dev *rtwdev = (struct rtw89_dev *)data; + + rtw89_cam_sec_key_del(rtwdev, vif, sta, key, false); +} + +void rtw89_cam_deinit_addr_cam(struct rtw89_dev *rtwdev, + struct rtw89_addr_cam_entry *addr_cam) +{ + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + + addr_cam->valid = false; + clear_bit(addr_cam->addr_cam_idx, cam_info->addr_cam_map); +} + +void rtw89_cam_deinit_bssid_cam(struct rtw89_dev *rtwdev, + struct rtw89_bssid_cam_entry *bssid_cam) +{ + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + + bssid_cam->valid = false; + clear_bit(bssid_cam->bssid_cam_idx, cam_info->bssid_cam_map); +} + +void rtw89_cam_deinit(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) +{ + struct rtw89_addr_cam_entry *addr_cam = &rtwvif->addr_cam; + struct rtw89_bssid_cam_entry *bssid_cam = &rtwvif->bssid_cam; + + rtw89_cam_deinit_addr_cam(rtwdev, addr_cam); + rtw89_cam_deinit_bssid_cam(rtwdev, bssid_cam); +} + +void rtw89_cam_reset_keys(struct rtw89_dev *rtwdev) +{ + rcu_read_lock(); + ieee80211_iter_keys_rcu(rtwdev->hw, NULL, rtw89_cam_reset_key_iter, rtwdev); + rcu_read_unlock(); +} + +static int rtw89_cam_get_avail_addr_cam(struct rtw89_dev *rtwdev, + u8 *addr_cam_idx) +{ + const struct rtw89_chip_info *chip = rtwdev->chip; + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + u8 addr_cam_num = chip->acam_num; + u8 idx; + + idx = find_first_zero_bit(cam_info->addr_cam_map, addr_cam_num); + if (idx >= addr_cam_num) + return -EBUSY; + + set_bit(idx, cam_info->addr_cam_map); + *addr_cam_idx = idx; + + return 0; +} + +int rtw89_cam_init_addr_cam(struct rtw89_dev *rtwdev, + struct rtw89_addr_cam_entry *addr_cam, + const struct rtw89_bssid_cam_entry *bssid_cam) +{ + u8 addr_cam_idx; + int i; + int ret; + + if (unlikely(addr_cam->valid)) { + rtw89_debug(rtwdev, RTW89_DBG_FW, + "addr cam is already valid; skip init\n"); + return 0; + } + + ret = rtw89_cam_get_avail_addr_cam(rtwdev, &addr_cam_idx); + if (ret) { + rtw89_err(rtwdev, "failed to get available addr cam\n"); + return ret; + } + + addr_cam->addr_cam_idx = addr_cam_idx; + addr_cam->len = ADDR_CAM_ENT_SIZE; + addr_cam->offset = 0; + addr_cam->valid = true; + addr_cam->addr_mask = 0; + addr_cam->mask_sel = RTW89_NO_MSK; + addr_cam->sec_ent_mode = RTW89_ADDR_CAM_SEC_NORMAL; + bitmap_zero(addr_cam->sec_cam_map, RTW89_SEC_CAM_IN_ADDR_CAM); + + for (i = 0; i < RTW89_SEC_CAM_IN_ADDR_CAM; i++) { + addr_cam->sec_ent_keyid[i] = 0; + addr_cam->sec_ent[i] = 0; + } + + /* associate addr cam with bssid cam */ + addr_cam->bssid_cam_idx = bssid_cam->bssid_cam_idx; + + return 0; +} + +static int rtw89_cam_get_avail_bssid_cam(struct rtw89_dev *rtwdev, + u8 *bssid_cam_idx) +{ + const struct rtw89_chip_info *chip = rtwdev->chip; + struct rtw89_cam_info *cam_info = &rtwdev->cam_info; + u8 bssid_cam_num = chip->bcam_num; + u8 idx; + + idx = find_first_zero_bit(cam_info->bssid_cam_map, bssid_cam_num); + if (idx >= bssid_cam_num) + return -EBUSY; + + set_bit(idx, cam_info->bssid_cam_map); + *bssid_cam_idx = idx; + + return 0; +} + +int rtw89_cam_init_bssid_cam(struct rtw89_dev *rtwdev, + struct rtw89_vif *rtwvif, + struct rtw89_bssid_cam_entry *bssid_cam, + const u8 *bssid) +{ + u8 bssid_cam_idx; + int ret; + + if (unlikely(bssid_cam->valid)) { + rtw89_debug(rtwdev, RTW89_DBG_FW, + "bssid cam is already valid; skip init\n"); + return 0; + } + + ret = rtw89_cam_get_avail_bssid_cam(rtwdev, &bssid_cam_idx); + if (ret) { + rtw89_err(rtwdev, "failed to get available bssid cam\n"); + return ret; + } + + bssid_cam->bssid_cam_idx = bssid_cam_idx; + bssid_cam->phy_idx = rtwvif->phy_idx; + bssid_cam->len = BSSID_CAM_ENT_SIZE; + bssid_cam->offset = 0; + bssid_cam->valid = true; + ether_addr_copy(bssid_cam->bssid, bssid); + + return 0; +} + +void rtw89_cam_bssid_changed(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) +{ + struct rtw89_bssid_cam_entry *bssid_cam = &rtwvif->bssid_cam; + + ether_addr_copy(bssid_cam->bssid, rtwvif->bssid); +} + +int rtw89_cam_init(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) +{ + struct rtw89_addr_cam_entry *addr_cam = &rtwvif->addr_cam; + struct rtw89_bssid_cam_entry *bssid_cam = &rtwvif->bssid_cam; + int ret; + + ret = rtw89_cam_init_bssid_cam(rtwdev, rtwvif, bssid_cam, rtwvif->bssid); + if (ret) { + rtw89_err(rtwdev, "failed to init bssid cam\n"); + return ret; + } + + ret = rtw89_cam_init_addr_cam(rtwdev, addr_cam, bssid_cam); + if (ret) { + rtw89_err(rtwdev, "failed to init addr cam\n"); + return ret; + } + + return 0; +} + +int rtw89_cam_fill_bssid_cam_info(struct rtw89_dev *rtwdev, + struct rtw89_vif *rtwvif, + struct rtw89_sta *rtwsta, u8 *cmd) +{ + struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif); + struct rtw89_bssid_cam_entry *bssid_cam = rtw89_get_bssid_cam_of(rtwvif, rtwsta); + u8 bss_color = vif->bss_conf.he_bss_color.color; + u8 bss_mask; + + if (vif->bss_conf.nontransmitted) + bss_mask = RTW89_BSSID_MATCH_5_BYTES; + else + bss_mask = RTW89_BSSID_MATCH_ALL; + + FWCMD_SET_ADDR_BSSID_IDX(cmd, bssid_cam->bssid_cam_idx); + FWCMD_SET_ADDR_BSSID_OFFSET(cmd, bssid_cam->offset); + FWCMD_SET_ADDR_BSSID_LEN(cmd, bssid_cam->len); + FWCMD_SET_ADDR_BSSID_VALID(cmd, bssid_cam->valid); + FWCMD_SET_ADDR_BSSID_MASK(cmd, bss_mask); + FWCMD_SET_ADDR_BSSID_BB_SEL(cmd, bssid_cam->phy_idx); + FWCMD_SET_ADDR_BSSID_BSS_COLOR(cmd, bss_color); + + FWCMD_SET_ADDR_BSSID_BSSID0(cmd, bssid_cam->bssid[0]); + FWCMD_SET_ADDR_BSSID_BSSID1(cmd, bssid_cam->bssid[1]); + FWCMD_SET_ADDR_BSSID_BSSID2(cmd, bssid_cam->bssid[2]); + FWCMD_SET_ADDR_BSSID_BSSID3(cmd, bssid_cam->bssid[3]); + FWCMD_SET_ADDR_BSSID_BSSID4(cmd, bssid_cam->bssid[4]); + FWCMD_SET_ADDR_BSSID_BSSID5(cmd, bssid_cam->bssid[5]); + + return 0; +} + +static u8 rtw89_cam_addr_hash(u8 start, const u8 *addr) +{ + u8 hash = 0; + u8 i; + + for (i = start; i < ETH_ALEN; i++) + hash ^= addr[i]; + + return hash; +} + +void rtw89_cam_fill_addr_cam_info(struct rtw89_dev *rtwdev, + struct rtw89_vif *rtwvif, + struct rtw89_sta *rtwsta, + const u8 *scan_mac_addr, + u8 *cmd) +{ + struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif); + struct rtw89_addr_cam_entry *addr_cam = rtw89_get_addr_cam_of(rtwvif, rtwsta); + struct ieee80211_sta *sta = rtwsta_to_sta_safe(rtwsta); + const u8 *sma = scan_mac_addr ? scan_mac_addr : rtwvif->mac_addr; + u8 sma_hash, tma_hash, addr_msk_start; + u8 sma_start = 0; + u8 tma_start = 0; + u8 *tma = sta ? sta->addr : rtwvif->bssid; + + if (addr_cam->addr_mask != 0) { + addr_msk_start = __ffs(addr_cam->addr_mask); + if (addr_cam->mask_sel == RTW89_SMA) + sma_start = addr_msk_start; + else if (addr_cam->mask_sel == RTW89_TMA) + tma_start = addr_msk_start; + } + sma_hash = rtw89_cam_addr_hash(sma_start, sma); + tma_hash = rtw89_cam_addr_hash(tma_start, tma); + + FWCMD_SET_ADDR_IDX(cmd, addr_cam->addr_cam_idx); + FWCMD_SET_ADDR_OFFSET(cmd, addr_cam->offset); + FWCMD_SET_ADDR_LEN(cmd, addr_cam->len); + + FWCMD_SET_ADDR_VALID(cmd, addr_cam->valid); + FWCMD_SET_ADDR_NET_TYPE(cmd, rtwvif->net_type); + FWCMD_SET_ADDR_BCN_HIT_COND(cmd, rtwvif->bcn_hit_cond); + FWCMD_SET_ADDR_HIT_RULE(cmd, rtwvif->hit_rule); + FWCMD_SET_ADDR_BB_SEL(cmd, rtwvif->phy_idx); + FWCMD_SET_ADDR_ADDR_MASK(cmd, addr_cam->addr_mask); + FWCMD_SET_ADDR_MASK_SEL(cmd, addr_cam->mask_sel); + FWCMD_SET_ADDR_SMA_HASH(cmd, sma_hash); + FWCMD_SET_ADDR_TMA_HASH(cmd, tma_hash); + + FWCMD_SET_ADDR_BSSID_CAM_IDX(cmd, addr_cam->bssid_cam_idx); + + FWCMD_SET_ADDR_SMA0(cmd, sma[0]); + FWCMD_SET_ADDR_SMA1(cmd, sma[1]); + FWCMD_SET_ADDR_SMA2(cmd, sma[2]); + FWCMD_SET_ADDR_SMA3(cmd, sma[3]); + FWCMD_SET_ADDR_SMA4(cmd, sma[4]); + FWCMD_SET_ADDR_SMA5(cmd, sma[5]); + + FWCMD_SET_ADDR_TMA0(cmd, tma[0]); + FWCMD_SET_ADDR_TMA1(cmd, tma[1]); + FWCMD_SET_ADDR_TMA2(cmd, tma[2]); + FWCMD_SET_ADDR_TMA3(cmd, tma[3]); + FWCMD_SET_ADDR_TMA4(cmd, tma[4]); + FWCMD_SET_ADDR_TMA5(cmd, tma[5]); + + FWCMD_SET_ADDR_PORT_INT(cmd, rtwvif->port); + FWCMD_SET_ADDR_TSF_SYNC(cmd, rtwvif->port); + FWCMD_SET_ADDR_TF_TRS(cmd, rtwvif->trigger); + FWCMD_SET_ADDR_LSIG_TXOP(cmd, rtwvif->lsig_txop); + FWCMD_SET_ADDR_TGT_IND(cmd, rtwvif->tgt_ind); + FWCMD_SET_ADDR_FRM_TGT_IND(cmd, rtwvif->frm_tgt_ind); + FWCMD_SET_ADDR_MACID(cmd, rtwsta ? rtwsta->mac_id : rtwvif->mac_id); + if (rtwvif->net_type == RTW89_NET_TYPE_INFRA) + FWCMD_SET_ADDR_AID12(cmd, vif->cfg.aid & 0xfff); + else if (rtwvif->net_type == RTW89_NET_TYPE_AP_MODE) + FWCMD_SET_ADDR_AID12(cmd, sta ? sta->aid & 0xfff : 0); + FWCMD_SET_ADDR_WOL_PATTERN(cmd, rtwvif->wowlan_pattern); + FWCMD_SET_ADDR_WOL_UC(cmd, rtwvif->wowlan_uc); + FWCMD_SET_ADDR_WOL_MAGIC(cmd, rtwvif->wowlan_magic); + FWCMD_SET_ADDR_WAPI(cmd, addr_cam->wapi); + FWCMD_SET_ADDR_SEC_ENT_MODE(cmd, addr_cam->sec_ent_mode); + FWCMD_SET_ADDR_SEC_ENT0_KEYID(cmd, addr_cam->sec_ent_keyid[0]); + FWCMD_SET_ADDR_SEC_ENT1_KEYID(cmd, addr_cam->sec_ent_keyid[1]); + FWCMD_SET_ADDR_SEC_ENT2_KEYID(cmd, addr_cam->sec_ent_keyid[2]); + FWCMD_SET_ADDR_SEC_ENT3_KEYID(cmd, addr_cam->sec_ent_keyid[3]); + FWCMD_SET_ADDR_SEC_ENT4_KEYID(cmd, addr_cam->sec_ent_keyid[4]); + FWCMD_SET_ADDR_SEC_ENT5_KEYID(cmd, addr_cam->sec_ent_keyid[5]); + FWCMD_SET_ADDR_SEC_ENT6_KEYID(cmd, addr_cam->sec_ent_keyid[6]); + + FWCMD_SET_ADDR_SEC_ENT_VALID(cmd, addr_cam->sec_cam_map[0] & 0xff); + FWCMD_SET_ADDR_SEC_ENT0(cmd, addr_cam->sec_ent[0]); + FWCMD_SET_ADDR_SEC_ENT1(cmd, addr_cam->sec_ent[1]); + FWCMD_SET_ADDR_SEC_ENT2(cmd, addr_cam->sec_ent[2]); + FWCMD_SET_ADDR_SEC_ENT3(cmd, addr_cam->sec_ent[3]); + FWCMD_SET_ADDR_SEC_ENT4(cmd, addr_cam->sec_ent[4]); + FWCMD_SET_ADDR_SEC_ENT5(cmd, addr_cam->sec_ent[5]); + FWCMD_SET_ADDR_SEC_ENT6(cmd, addr_cam->sec_ent[6]); +} + +void rtw89_cam_fill_dctl_sec_cam_info_v1(struct rtw89_dev *rtwdev, + struct rtw89_vif *rtwvif, + struct rtw89_sta *rtwsta, + u8 *cmd) +{ + struct rtw89_addr_cam_entry *addr_cam = rtw89_get_addr_cam_of(rtwvif, rtwsta); + + SET_DCTL_MACID_V1(cmd, rtwsta ? rtwsta->mac_id : rtwvif->mac_id); + SET_DCTL_OPERATION_V1(cmd, 1); + + SET_DCTL_SEC_ENT0_KEYID_V1(cmd, addr_cam->sec_ent_keyid[0]); + SET_DCTL_SEC_ENT1_KEYID_V1(cmd, addr_cam->sec_ent_keyid[1]); + SET_DCTL_SEC_ENT2_KEYID_V1(cmd, addr_cam->sec_ent_keyid[2]); + SET_DCTL_SEC_ENT3_KEYID_V1(cmd, addr_cam->sec_ent_keyid[3]); + SET_DCTL_SEC_ENT4_KEYID_V1(cmd, addr_cam->sec_ent_keyid[4]); + SET_DCTL_SEC_ENT5_KEYID_V1(cmd, addr_cam->sec_ent_keyid[5]); + SET_DCTL_SEC_ENT6_KEYID_V1(cmd, addr_cam->sec_ent_keyid[6]); + + SET_DCTL_SEC_ENT_VALID_V1(cmd, addr_cam->sec_cam_map[0] & 0xff); + SET_DCTL_SEC_ENT0_V1(cmd, addr_cam->sec_ent[0]); + SET_DCTL_SEC_ENT1_V1(cmd, addr_cam->sec_ent[1]); + SET_DCTL_SEC_ENT2_V1(cmd, addr_cam->sec_ent[2]); + SET_DCTL_SEC_ENT3_V1(cmd, addr_cam->sec_ent[3]); + SET_DCTL_SEC_ENT4_V1(cmd, addr_cam->sec_ent[4]); + SET_DCTL_SEC_ENT5_V1(cmd, addr_cam->sec_ent[5]); + SET_DCTL_SEC_ENT6_V1(cmd, addr_cam->sec_ent[6]); +} diff --git a/sys/contrib/dev/rtw89/cam.h b/sys/contrib/dev/rtw89/cam.h new file mode 100644 index 000000000000..83c160a614e6 --- /dev/null +++ b/sys/contrib/dev/rtw89/cam.h @@ -0,0 +1,391 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* Copyright(c) 2019-2020 Realtek Corporation + */ + +#ifndef __RTW89_CAM_H__ +#define __RTW89_CAM_H__ + +#include "core.h" + +#define RTW89_SEC_CAM_LEN 20 *** 150106 LINES SKIPPED *** From nobody Wed Jan 18 16:24:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgq548Nz2yJL1; Wed, 18 Jan 2023 16:24:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgq49C3z3DH7; Wed, 18 Jan 2023 16:24:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XlRIlA8U+1zPXwSXelmA532VGpkcnQPk6Qzhn4rsQFU=; b=RcFHpMHn7v3uHGgeHX7dWAbueBrgf5JBKWrUmL+m7GqGOIRXfMRN/HzJ0Wdz5jOeu2qRVw M8bg1HyxiKLUaxnLTT+1xnKQWVm1OMEUODcDTMjRKjR1fNirbWU9Ds/h+xvlOq+KS1Qg9i QEzZXxBw+Bwd41XoSDTaKfP7WqIgRY15tujzQ+YcsW12z6DWnDIEz7B1w6slfaSgD/UIzg 3NJhycOr/I3BafViWpcrkLK7XN2MUAZjLu/B0ZLgSmRFld3pDDcFINPtMCxAA0LdFn1GNG x6K85JtaRc/zXiQssPMEf7iePQ7tV3Uj4+ZWyxzTnkWyV5REvULVxl+CH1CMHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XlRIlA8U+1zPXwSXelmA532VGpkcnQPk6Qzhn4rsQFU=; b=lYiOoXxIrNuvtsdte6Z9u7j/183OajfIh59wGGWzY4dJ88uPe8XJK+ovWsjUYLUd+infwv kBtBo6fkhQUG/jkT5ubp/+xiHol+7zo5AP9qajH2ANc7ThLyXdOqOub4XwtZ/HioUNvh1L HWCFs5hFmwpI/QtiaYS3TewxcFBxl66JC79d9M/6WoWYZbivSpLF75Qrt9Tweyq9fcu3um WjSaj9SZqRaOgeSGeDvqZOgsCoAm0FXyG0V93hECzBWX80N3MtL5paadatH6WbMD071Abo uihcjg6ZQgzb2WwvXKWqokkfKJdxvg+HETTGn1Q2Fz+JUd11llBNy5B9uw2iDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059079; a=rsa-sha256; cv=none; b=F1e8Je6unVB1P+fODHBtHY11VU2inREWR0aKN47CZNvqvC9RDGGPA9lJb/n6D0wt+2uJ6D xfWICpn8i3rr5oM2JLwJtx5g1RWCOvIZazuNnnc9+iPPGBMcKUpjXl1nYFwaP4EUl/6O8y 0IGgK/wT08+Y/HJJDO11Ka15D7hPuh9Z4ZvN1zHhTIBPLrFa5OtXIkO/8VrUP5+S3Q89wG 6y+RWI4r915v4AuAZgWhmb/TjsTJNgkoK/9mwGNaJ+a3aw/wAFEl5lHmyUGmifvzK6ampt v/H8R1nxUCiTYEOLtEf5EsFDUPNeOl2pXQ2rnxvkGNbVWG2WfMJnt0k/shwcww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgq3GWCzHp6; Wed, 18 Jan 2023 16:24:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOdnR037709; Wed, 18 Jan 2023 16:24:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOdTG037708; Wed, 18 Jan 2023 16:24:39 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:39 GMT Message-Id: <202301181624.30IGOdTG037708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b8262cc1340e - stable/13 - rtw89: import firmware for Realtek's rtw89 supported chipsets. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b8262cc1340e993829dc7f6512b4773cd167b89e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b8262cc1340e993829dc7f6512b4773cd167b89e commit b8262cc1340e993829dc7f6512b4773cd167b89e Author: Bjoern A. Zeeb AuthorDate: 2022-09-09 12:52:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:22:44 +0000 rtw89: import firmware for Realtek's rtw89 supported chipsets. Import the most recent versions of the firmware images for the rtw89 driver. This is based on linux-firmware at 2f2f0181581d3e35bfdb9fc65f609ee9d3fbaeb7. The license of the firmware matches the previously added rtw88(4) firmware and you can find a copy in sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt. Add build infrastructure to create the .ko files but do not yet hook it up to the build until all parts are in the tree. Approved by: core.11 (imp) [2022-03-27] (cherry picked from commit 866e021654cfb72c050fd228dee476fb92fa6f48) --- .../dev/rtw89fw/LICENCE.rtlwifi_firmware.txt | 39 +++++++++++++++++++++ sys/contrib/dev/rtw89fw/WHENCE | 8 +++++ sys/contrib/dev/rtw89fw/rtw8852a_fw.bin | Bin 0 -> 1423232 bytes sys/contrib/dev/rtw89fw/rtw8852c_fw.bin | Bin 0 -> 1340192 bytes sys/modules/rtw89fw/Makefile | 7 ++++ sys/modules/rtw89fw/Makefile.inc | 17 +++++++++ sys/modules/rtw89fw/rtw8852a/Makefile | 6 ++++ sys/modules/rtw89fw/rtw8852c/Makefile | 6 ++++ 8 files changed, 83 insertions(+) diff --git a/sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt b/sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt new file mode 100644 index 000000000000..d70921f49379 --- /dev/null +++ b/sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt @@ -0,0 +1,39 @@ +Copyright (c) 2010, Realtek Semiconductor Corporation +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Realtek Semiconductor Corporation nor the names of its + suppliers may be used to endorse or promote products derived from this + software without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Realtek Semiconductor Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. 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. diff --git a/sys/contrib/dev/rtw89fw/WHENCE b/sys/contrib/dev/rtw89fw/WHENCE new file mode 100644 index 000000000000..496ef115ef0b --- /dev/null +++ b/sys/contrib/dev/rtw89fw/WHENCE @@ -0,0 +1,8 @@ + +Driver: rtw89 - Realtek 802.11ax WLAN driver for RTL8852A + +File: rtw89/rtw8852a_fw.bin +File: rtw89/rtw8852c_fw.bin + +Licence: Redistributable. See LICENCE.rtlwifi_firmware.txt for details. + diff --git a/sys/contrib/dev/rtw89fw/rtw8852a_fw.bin b/sys/contrib/dev/rtw89fw/rtw8852a_fw.bin new file mode 100644 index 000000000000..00d139b3f2f1 Binary files /dev/null and b/sys/contrib/dev/rtw89fw/rtw8852a_fw.bin differ diff --git a/sys/contrib/dev/rtw89fw/rtw8852c_fw.bin b/sys/contrib/dev/rtw89fw/rtw8852c_fw.bin new file mode 100644 index 000000000000..86b634aeb69f Binary files /dev/null and b/sys/contrib/dev/rtw89fw/rtw8852c_fw.bin differ diff --git a/sys/modules/rtw89fw/Makefile b/sys/modules/rtw89fw/Makefile new file mode 100644 index 000000000000..2db828c06f00 --- /dev/null +++ b/sys/modules/rtw89fw/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +SUBDIR= \ + rtw8852a \ + rtw8852c + +.include diff --git a/sys/modules/rtw89fw/Makefile.inc b/sys/modules/rtw89fw/Makefile.inc new file mode 100644 index 000000000000..96ab73502152 --- /dev/null +++ b/sys/modules/rtw89fw/Makefile.inc @@ -0,0 +1,17 @@ +# $FreeBSD$ +# +# Common rules for building firmware. Note this gets auto-included +# by the subdir Makefile's as a consequence of included bsd.kmod.mk. + +_NAME= rtw${NAME}_fw.bin + +IMG= ${_NAME} +KMOD= ${_NAME} + +CLEANFILES+= ${IMG} + +FIRMWS= ${IMG}:${IMG}:${VERSION} + +${IMG}: ${SRCTOP}/sys/contrib/dev/rtw89fw/${IMG} + cp ${.ALLSRC} ${.TARGET} + diff --git a/sys/modules/rtw89fw/rtw8852a/Makefile b/sys/modules/rtw89fw/rtw8852a/Makefile new file mode 100644 index 000000000000..7ed7ad1f6c71 --- /dev/null +++ b/sys/modules/rtw89fw/rtw8852a/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 013360 +NAME= 8852a + +.include diff --git a/sys/modules/rtw89fw/rtw8852c/Makefile b/sys/modules/rtw89fw/rtw8852c/Makefile new file mode 100644 index 000000000000..7b871745cde4 --- /dev/null +++ b/sys/modules/rtw89fw/rtw8852c/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +VERSION= 027200 +NAME= 8852c + +.include From nobody Wed Jan 18 16:24:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgr68ntz2yJ12; Wed, 18 Jan 2023 16:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgr5M21z3DDt; Wed, 18 Jan 2023 16:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=erQjhqyisNDiY2GeFioAvKq3aGr8+rgn9nE1Gb028dM=; b=l1ygI2qShjmt4LywZag73ryS78jRbHZQzV3L6cWTVYpVTtN+4ZJkTP/e7PCWQc4IsU/HaJ ABLRhWYVwcYJQlOxhsGGr6NXYOIcwQIPyKZucQLEoKzTNB+wH9uEVf0sZvgB6DErtP1dHh kIDhRd6BbVO5juI4mgNEyM/jkvhl+BN6B8HnWwvfyF0kQ9F9p2WImnvgGMazYFWUWeZHf6 KSs5k0Hqfx9Ar8/LKwyGAUwxOiLDwq9bZ6pN7zjNfiiJKo5lnC/Zsk/ooqqXHxIhiW0ghi w/jAOH+rEwc3/OOzwXuJLDaHwlwDq40NtKkZTpdJhM2jtjfSC8r+mmhHyT1BWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=erQjhqyisNDiY2GeFioAvKq3aGr8+rgn9nE1Gb028dM=; b=fkKKdIDZPUlZlTKnJwnlDImjpMut6/uChow089ULwRjEm/GFUCDdHGjMOhiuvHRj2lKuWS A3iyPGR+7txIfYp4fhZ7cSUypRQvql1j8EqFIW/dUaQmFW0PvYuLY9+QO9gpE8ojv5/TZC ffkzpsmybEGuSSAiEFFrfqymPL7ZpfXDJdn1RdUNOBDhPdcYz4ef7VSiJdC/hO5URntw6R DCUldA530W8/Z16c8CcQxUnRJyNLSPfaPVEwLbEUKVeNseiDXdLNwlfpxtX8dzsgXIdsD3 yUuPx7t6X+X2Q+ltBeRYt4wsEZ4xfhUR5LuQtVyVvPcaGVgfsy+sOm78kzgT1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059080; a=rsa-sha256; cv=none; b=GuCvANO4jV3GhU9eoSpoJxWHMgQD02URTDoTIOL65DIl74WpWTHcmIlWsxeMtSYqEJGPY8 AQdgiV2IrBz7AJ1G210MwKdhSvqufgCHfamYwl/CQwC0qdCuAyC1M/i3avqYGLkXr5E/xm QkJV3m+qDV5uhthDYOI/yqebvsM1k50f2Taz05wBrQPcjq1gn7l3fgD6FVc+MOyjA2/lgi dGaCUrB4zSqHEYCQcpxVVQVkJQX9P5eNqKEcRTcBCAtGpXRtYMA+7+J7PV8osue8Mf/gDt Trog3TjPpgzu7EQ8OBi+GULoOsAKzUjco4oPtDP5yU01yfH6RL8Y4udd5CXIYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgr40cdzHp7; Wed, 18 Jan 2023 16:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOeES037733; Wed, 18 Jan 2023 16:24:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOepA037732; Wed, 18 Jan 2023 16:24:40 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:40 GMT Message-Id: <202301181624.30IGOepA037732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2cf1918dfce3 - stable/13 - lindebugfs,rtw88,rtw89: correct module dependencies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cf1918dfce36f3db1fb263ca6e247a8c259ac28 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2cf1918dfce36f3db1fb263ca6e247a8c259ac28 commit 2cf1918dfce36f3db1fb263ca6e247a8c259ac28 Author: Bjoern A. Zeeb AuthorDate: 2022-09-25 21:36:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:22:52 +0000 lindebugfs,rtw88,rtw89: correct module dependencies In f697b9432d9c7aa4c5ab5f5445ef5dc1bd40ce00 the name of the PSEUDOFS was changed from debugsfs to lindebugfs but the in-tree consumers were not updated now leaving the drivers not loading if compiled with debugfs support due to missing dependencies. (cherry picked from commit 1a2b55732ff27fba2533724a72a39d33516c9417) --- sys/contrib/dev/rtw88/pci.c | 2 +- sys/contrib/dev/rtw89/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/dev/rtw88/pci.c b/sys/contrib/dev/rtw88/pci.c index 6c836be771bc..bad6dd5b5b98 100644 --- a/sys/contrib/dev/rtw88/pci.c +++ b/sys/contrib/dev/rtw88/pci.c @@ -1955,6 +1955,6 @@ MODULE_VERSION(rtw_pci, 1); MODULE_DEPEND(rtw_pci, linuxkpi, 1, 1, 1); MODULE_DEPEND(rtw_pci, linuxkpi_wlan, 1, 1, 1); #ifdef CONFIG_RTW88_DEBUGFS -MODULE_DEPEND(rtw_pci, debugfs, 1, 1, 1); +MODULE_DEPEND(rtw_pci, lindebugfs, 1, 1, 1); #endif #endif diff --git a/sys/contrib/dev/rtw89/pci.c b/sys/contrib/dev/rtw89/pci.c index 046bcdf4dbc9..078d6f0e5866 100644 --- a/sys/contrib/dev/rtw89/pci.c +++ b/sys/contrib/dev/rtw89/pci.c @@ -3937,6 +3937,6 @@ MODULE_VERSION(rtw89_pci, 1); MODULE_DEPEND(rtw89_pci, linuxkpi, 1, 1, 1); MODULE_DEPEND(rtw89_pci, linuxkpi_wlan, 1, 1, 1); #ifdef CONFIG_RTW89_DEBUGFS -MODULE_DEPEND(rtw89_pci, debugfs, 1, 1, 1); +MODULE_DEPEND(rtw89_pci, lindebugfs, 1, 1, 1); #endif #endif From nobody Wed Jan 18 16:24:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgt1K7Rz2yJLB; Wed, 18 Jan 2023 16:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgs727Lz3DXW; Wed, 18 Jan 2023 16:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fZwSvQtyv4Df3AeXowsSwrppgk0zL045WJOTBKSYqpg=; b=pNXzdC46nb/4PjwwYfSgylEworaRkx+su7AitCPk/w8uFtrkPHBhR6ap7IK66/G/kYjfBp oEPeY+BKe1tq/q87avkEjuAQK8UbBFumnUbDBGBH1ifc//mD9jwWf3m30F8ufoNNMse1Lo K6G5IBMvOFIqc6X+bqHFmPiB87Gl9FFyRXF3HGcNdLhLlIlQ8pq1WjAGChDxP6Brh/E1UG KpQOMIAz2FUkhVQT7Y526AB/8v1vuAP9C192AsKdLvdCDtVtdj9/idDFInPLTT4Dodh7UQ Lo2A0OaWwMCOycG3/GUr5Ldb/RU3MSs5z0CVEqK8zol0b8sPtiTzCxiEcNdr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fZwSvQtyv4Df3AeXowsSwrppgk0zL045WJOTBKSYqpg=; b=BAlGrTcECr7di9i9VFfBK4GvCWAw2o1p+QXe+WhPO+IWtReql/voDkpdsG3dxRVC5bP6rS 3NBRtusJB5HUr+fHmMBvOCc75FnnffhvYvWgTWq+LKJ9vY/yVWI6X1N/O50UyC6AKNQ9sn WZiqNOyKKY1PwqZWpFug0KydMj0izM29KgN5TbnyY8i9gOmyxZhvlMV6CyKDBNaM7DF5B+ c4hB4lnBu67fqZ4o/cVJk9sUWa2GMXS3BhwB3QJsODbsbgzpZq52NXz6oGgJ4Bjb9hEVbN zgXTAk7gF/cCli2rzXVWGL1ky1PR/OrePnQ4ONuTDlRwZ+yqwkhC9OGwkKgRUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059082; a=rsa-sha256; cv=none; b=nvhvhPknBFVcWbVj87nNehG5aRdSfvJrn1wRua52YMr7Fvq4PgJmYvLgTFCuNCJAKOoFHv 37fyl80fmEKgG8R7hmxNuS2NxR20V6L7BmKiDDRg7Du76+YJ981Edh11Iir6H7OoEZV66m Wt5hxvqsIPMQSrjjklN69T39yVUeNzjtxemkXJndTH3jB3jmd5vx3TD7x1XodN7w7h3TAG HjYJ9GCqHgTR8AJ94wlwXXV58oJ4Nn+PWldB0kYgiwKnP3Md4e7Cb18F/iqp+8Rbn6LlM5 8dtZoOiXdZzigovWxKuiYkQnH5hVXnfToFNmVyjDzg8zBkWcaOl4EmnN002q1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgs58hkzHp8; Wed, 18 Jan 2023 16:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOfW7037757; Wed, 18 Jan 2023 16:24:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOfJc037756; Wed, 18 Jan 2023 16:24:41 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:41 GMT Message-Id: <202301181624.30IGOfJc037756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 07adc4446abc - stable/13 - LinuxKPI: SKB update List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07adc4446abcd49e678a01fe1e9c6f732e420982 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=07adc4446abcd49e678a01fe1e9c6f732e420982 commit 07adc4446abcd49e678a01fe1e9c6f732e420982 Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 20:54:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:23:37 +0000 LinuxKPI: SKB update - skb_reset_tail_pointer(): we do not do offsets so do a plain reset - skb_add_rx_frag(): adjust data_len to keep track of the frag - based on that implement skb_is_nonlinear() and skb_linearize() - implement build_skb() and adjust linuxkpi_kfree_skb() and ddb macro. Sponsored by: The FreeBSD Foundation (partially) (cherry picked from commit 5504bd59a39ba0bd0014308ff1aa5d4899432a3e) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 56 +++++++++++++---------- sys/compat/linuxkpi/common/src/linux_skbuff.c | 33 ++++++++++++- 2 files changed, 62 insertions(+), 27 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index d3a795344f86..b54f5a91769f 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -143,7 +143,8 @@ struct sk_buff { uint16_t l4hdroff; /* transport header offset from *head */ uint32_t priority; uint16_t qmap; /* queue mapping */ - uint16_t _spareu16_0; + uint16_t _flags; /* Internal flags. */ +#define _SKB_FLAGS_SKBEXTFRAG 0x0001 enum sk_buff_pkt_type pkt_type; /* "Scratch" area for layers to store metadata. */ @@ -174,6 +175,7 @@ struct sk_buff { struct sk_buff *linuxkpi_alloc_skb(size_t, gfp_t); struct sk_buff *linuxkpi_dev_alloc_skb(size_t, gfp_t); +struct sk_buff *linuxkpi_build_skb(void *, size_t); void linuxkpi_kfree_skb(struct sk_buff *); struct sk_buff *linuxkpi_skb_copy(struct sk_buff *, gfp_t); @@ -241,6 +243,16 @@ dev_kfree_skb_irq(struct sk_buff *skb) dev_kfree_skb(skb); } +static inline struct sk_buff * +build_skb(void *data, unsigned int fragsz) +{ + struct sk_buff *skb; + + skb = linuxkpi_build_skb(data, fragsz); + SKB_TRACE(skb); + return (skb); +} + /* -------------------------------------------------------------------------- */ /* XXX BZ review this one for terminal condition as Linux "queues" are special. */ @@ -467,6 +479,7 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, shinfo->frags[fragno].size = size; shinfo->nr_frags = fragno + 1; skb->len += size; + skb->data_len += size; skb->truesize += truesize; /* XXX TODO EXTEND truesize? */ @@ -736,13 +749,6 @@ skb_frag_size(const skb_frag_t *frag) return (-1); } -static inline bool -skb_is_nonlinear(struct sk_buff *skb) -{ - SKB_TRACE(skb); - return ((skb->data_len > 0) ? true : false); -} - #define skb_walk_frags(_skb, _frag) \ for ((_frag) = (_skb); false; (_frag)++) @@ -847,6 +853,13 @@ skb_network_header(struct sk_buff *skb) return (skb->head + skb->l3hdroff); } +static inline bool +skb_is_nonlinear(struct sk_buff *skb) +{ + SKB_TRACE(skb); + return ((skb->data_len > 0) ? true : false); +} + static inline int __skb_linearize(struct sk_buff *skb) { @@ -855,6 +868,13 @@ __skb_linearize(struct sk_buff *skb) return (ENXIO); } +static inline int +skb_linearize(struct sk_buff *skb) +{ + + return (skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0); +} + static inline int pskb_expand_head(struct sk_buff *skb, int x, int len, gfp_t gfp) { @@ -936,7 +956,10 @@ skb_reset_tail_pointer(struct sk_buff *skb) { SKB_TRACE(skb); +#ifdef SKB_DOING_OFFSETS_US_NOT skb->tail = (uint8_t *)(uintptr_t)(skb->data - skb->head); +#endif + skb->tail = skb->data; SKB_TRACE(skb); } @@ -965,14 +988,6 @@ skb_copy_from_linear_data(const struct sk_buff *skb, void *dst, size_t len) memcpy(dst, skb->data, len); } -static inline struct sk_buff * -build_skb(void *data, unsigned int fragsz) -{ - - SKB_TODO(); - return (NULL); -} - static inline int skb_pad(struct sk_buff *skb, int pad) { @@ -998,15 +1013,6 @@ napi_consume_skb(struct sk_buff *skb, int budget) SKB_TODO(); } -static inline bool -skb_linearize(struct sk_buff *skb) -{ - - SKB_TRACE(skb); - SKB_TODO(); - return (false); -} - #define SKB_WITH_OVERHEAD(_s) \ (_s) - ALIGN(sizeof(struct skb_shared_info), CACHE_LINE_SIZE) diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c index df8e3fda8d56..c23a59b3c536 100644 --- a/sys/compat/linuxkpi/common/src/linux_skbuff.c +++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c @@ -150,6 +150,28 @@ linuxkpi_dev_alloc_skb(size_t size, gfp_t gfp) return (skb); } +struct sk_buff * +linuxkpi_build_skb(void *data, size_t fragsz) +{ + struct sk_buff *skb; + + if (data == NULL || fragsz == 0) + return (NULL); + + /* Just allocate a skb without data area. */ + skb = linuxkpi_alloc_skb(0, GFP_KERNEL); + if (skb == NULL) + return (NULL); + + skb->_flags |= _SKB_FLAGS_SKBEXTFRAG; + skb->truesize = fragsz; + skb->head = skb->data = data; + skb_reset_tail_pointer(skb); /* XXX is that correct? */ + skb->end = (void *)((uintptr_t)skb->head + fragsz); + + return (skb); +} + struct sk_buff * linuxkpi_skb_copy(struct sk_buff *skb, gfp_t gfp) { @@ -233,6 +255,13 @@ linuxkpi_kfree_skb(struct sk_buff *skb) } } + if ((skb->_flags & _SKB_FLAGS_SKBEXTFRAG) != 0) { + void *p; + + p = skb->head; + skb_free_frag(p); + } + #ifdef __LP64__ if (__predict_true(linuxkpi_skb_memlimit == 0)) free(skb, M_LKPISKB); @@ -268,6 +297,7 @@ DB_SHOW_COMMAND(skb, db_show_skb) skb->pkt_type, skb->dev, skb->sk); db_printf("\tcsum_offset %d csum_start %d ip_summed %d protocol %d\n", skb->csum_offset, skb->csum_start, skb->ip_summed, skb->protocol); + db_printf("\t_flags %#06x\n", skb->_flags); /* XXX-BZ print names? */ db_printf("\thead %p data %p tail %p end %p\n", skb->head, skb->data, skb->tail, skb->end); db_printf("\tshinfo %p m %p m_free_func %p\n", @@ -298,7 +328,6 @@ DB_SHOW_COMMAND(skb, db_show_skb) } db_printf("}\n"); - db_printf("\t_spareu16_0 %#06x __scratch[0] %p\n", - skb->_spareu16_0, skb->__scratch); + db_printf("\t__scratch[0] %p\n", skb->__scratch); }; #endif From nobody Wed Jan 18 16:24:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgv22Wfz2yJSt; Wed, 18 Jan 2023 16:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgv0Fhpz3Db2; Wed, 18 Jan 2023 16:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8uBw/ON4w21frUHyxQiLzX7mqmTkTEkPQANuQbsYeQ=; b=ljz8qa49VMctqv1c9V9taVX6+1Jn2pjB5Qbf0mRLPRRI7Gb2XASvrDqxGu+HI0llG7g6At zDEVHkGImieH+S4RaezLEarIH21WhJC7P+wiptVnbo23an34zw+UfXeAWEDCyOprVpLCr7 7wwAPmrn/8IjANJP5CiVNlvBsdXb9z2DF5CXi05QvTdFV9VKuDyhekJIik3bjPklcSa13D /eqZUKZ8doSzEkrGCY1f7fbBuSGSfRJlYzoRhYLNv2DlEdY/2YlgdQdU4L0snE1wzBRv3E 0AMw8MIJ4uS0+12XRZlyh4OwEs1e2LdOzACb6F0HgyQrzrv899Z61mKotrbNWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8uBw/ON4w21frUHyxQiLzX7mqmTkTEkPQANuQbsYeQ=; b=M+hSaozz2xQG6Z7yZKJPDWMFTPzAgz25iTI4VDLwLqPN3IKMGJU51j2gsIL6SZq1TOx1CQ yGsohY1wZaZM+fPpWE9SUuoYt38eWVL1pX7H5Zv9fj31Smu2rZM0qZiR40F36iNv16S7ek Ol7rm60tkVZhlJI5W6nurcgjv5w67A8L2VEP01yovY2yem9lSHdpgTZ1+HPGNd2fjL9tCu nm3GKE6BihSKHmAqjEwOGJFByfvcXI6HHKBVpO16iGiuOFYfuBQNrjmK9Fg5Nc149C0CYk rSNbq3/cszQHi5zkHxhxUkOpwFKf4Ui8E0RmstJVfylY/VpjNRbifgrxTFPndw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059083; a=rsa-sha256; cv=none; b=YphQ1M3QT/DqaSEPshGDSdI0pB4qjEb+9zQBUBwDEPMS8iBuam16Qz3tBbVHZn8vFjMJeL KmdqepotTAFbwKFMQEcNGqhFT854EbTsdhhAbtu07l4latv8Vjkk0Dd8aPJ+q8fHZliFz7 HnyO1wjIlvGOWOcrTX4v7fbZy7CwobaLE1TFA7/W6nAOf8L7xXGEXk5AtcYeQDiepYJMsz XHnineqTjixeuhsZMer9joab5v5Mie/o0qX5OhbSwj7v4Ry7cG+G3BqMuA1cMzpt2HHLbw sG9pJn+FOELoEsXnIYs8pT3VBav3NTELxh6hd4murD3UH6ZHnfdaIgjAKQBKcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgt670qzHSb; Wed, 18 Jan 2023 16:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOgjc037781; Wed, 18 Jan 2023 16:24:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOgNE037780; Wed, 18 Jan 2023 16:24:42 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:42 GMT Message-Id: <202301181624.30IGOgNE037780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 95df5d822353 - stable/13 - LinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 95df5d822353e3fc8f7165df854040a726b8b65e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=95df5d822353e3fc8f7165df854040a726b8b65e commit 95df5d822353e3fc8f7165df854040a726b8b65e Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 15:12:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:23:43 +0000 LinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add() In preparation for future updates remove the budget argument from the netif_napi_add() in drivers and update LinuxKPI to reflect that it is gone and only set it internally. This required changes to the currently committed wireless drivers based on LinuxKPI (iwlwifi, rtw88, rtw89). Sponsored by: The FreeBSD Foundation (cherry picked from commit 23c73dbae7b2f64014b275643efbe92f449feaa2) --- sys/compat/linuxkpi/common/include/linux/netdevice.h | 6 +++--- sys/compat/linuxkpi/common/src/linux_netdev.c | 4 ++-- sys/contrib/dev/iwlwifi/pcie/rx.c | 3 +-- sys/contrib/dev/rtw88/pci.c | 3 +-- sys/contrib/dev/rtw89/core.c | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h index a904b7e70490..fdfd650a55e5 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h @@ -229,7 +229,7 @@ struct napi_struct { void linuxkpi_init_dummy_netdev(struct net_device *); void linuxkpi_netif_napi_add(struct net_device *, struct napi_struct *, - int(*napi_poll)(struct napi_struct *, int), int); + int(*napi_poll)(struct napi_struct *, int)); void linuxkpi_netif_napi_del(struct napi_struct *); bool linuxkpi_napi_schedule_prep(struct napi_struct *); void linuxkpi___napi_schedule(struct napi_struct *); @@ -243,8 +243,8 @@ void linuxkpi_napi_synchronize(struct napi_struct *); #define init_dummy_netdev(_n) \ linuxkpi_init_dummy_netdev(_n) -#define netif_napi_add(_nd, _ns, _p, _b) \ - linuxkpi_netif_napi_add(_nd, _ns, _p, _b) +#define netif_napi_add(_nd, _ns, _p) \ + linuxkpi_netif_napi_add(_nd, _ns, _p) #define netif_napi_del(_n) \ linuxkpi_netif_napi_del(_n) #define napi_schedule_prep(_n) \ diff --git a/sys/compat/linuxkpi/common/src/linux_netdev.c b/sys/compat/linuxkpi/common/src/linux_netdev.c index 3055b9c46767..69adcff67930 100644 --- a/sys/compat/linuxkpi/common/src/linux_netdev.c +++ b/sys/compat/linuxkpi/common/src/linux_netdev.c @@ -326,12 +326,12 @@ lkpi_napi_task(void *ctx, int pending) void linuxkpi_netif_napi_add(struct net_device *ndev, struct napi_struct *napi, - int(*napi_poll)(struct napi_struct *, int), int budget) + int(*napi_poll)(struct napi_struct *, int)) { napi->dev = ndev; napi->poll = napi_poll; - napi->budget = budget; + napi->budget = NAPI_POLL_WEIGHT; INIT_LIST_HEAD(&napi->rx_list); napi->rx_count = 0; diff --git a/sys/contrib/dev/iwlwifi/pcie/rx.c b/sys/contrib/dev/iwlwifi/pcie/rx.c index e91121dda102..480cc9c765d8 100644 --- a/sys/contrib/dev/iwlwifi/pcie/rx.c +++ b/sys/contrib/dev/iwlwifi/pcie/rx.c @@ -1113,8 +1113,7 @@ static int _iwl_pcie_rx_init(struct iwl_trans *trans) if (trans_pcie->msix_enabled) poll = iwl_pcie_napi_poll_msix; - netif_napi_add(&trans_pcie->napi_dev, &rxq->napi, - poll, NAPI_POLL_WEIGHT); + netif_napi_add(&trans_pcie->napi_dev, &rxq->napi, poll); napi_enable(&rxq->napi); } diff --git a/sys/contrib/dev/rtw88/pci.c b/sys/contrib/dev/rtw88/pci.c index bad6dd5b5b98..151400f6f892 100644 --- a/sys/contrib/dev/rtw88/pci.c +++ b/sys/contrib/dev/rtw88/pci.c @@ -1801,8 +1801,7 @@ static void rtw_pci_napi_init(struct rtw_dev *rtwdev) struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; init_dummy_netdev(&rtwpci->netdev); - netif_napi_add(&rtwpci->netdev, &rtwpci->napi, rtw_pci_napi_poll, - NAPI_POLL_WEIGHT); + netif_napi_add(&rtwpci->netdev, &rtwpci->napi, rtw_pci_napi_poll); } static void rtw_pci_napi_deinit(struct rtw_dev *rtwdev) diff --git a/sys/contrib/dev/rtw89/core.c b/sys/contrib/dev/rtw89/core.c index 98f47c4daeac..25940c141f84 100644 --- a/sys/contrib/dev/rtw89/core.c +++ b/sys/contrib/dev/rtw89/core.c @@ -1803,7 +1803,7 @@ void rtw89_core_napi_init(struct rtw89_dev *rtwdev) { init_dummy_netdev(&rtwdev->netdev); netif_napi_add(&rtwdev->netdev, &rtwdev->napi, - rtwdev->hci.ops->napi_poll, NAPI_POLL_WEIGHT); + rtwdev->hci.ops->napi_poll); } EXPORT_SYMBOL(rtw89_core_napi_init); From nobody Wed Jan 18 16:24:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgw2NZxz2yJNg; Wed, 18 Jan 2023 16:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgw1Stvz3DSH; Wed, 18 Jan 2023 16:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DewsACwR4XBQWN53ZQF84L6q7Zt6PmeE5spyEPZgE6o=; b=GRxV1eqhO7Re55vhiRi5q1E927ZVABDWb+0Iob7N6Y91rxM8jSGuDrG0fyLZyiz3HK2zbg 3BN8vBsIAbXd2p0/zhiPNRJcsDZbz//MPATLGZlgUH9oojUEqbTyFczAGpSCfKN33r82jR zk+W+heuYm2xaZgO43AUGiN9gwPh5oP65QGYbBEBYo1Sip1mIhF4nsorSmBlSX2szc8pfa NrpvzpkY2/nihvRSpDjgLQudNl5UKUxDyLEVrDF/7FT4gFJxmCbhKRRx4hHmDuKuIOM+O8 TB7pqJT1I1UQXudT457dPukaJGFx3/98SwM4tVuEzyyWJVyNuCZsiCRkklSvZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DewsACwR4XBQWN53ZQF84L6q7Zt6PmeE5spyEPZgE6o=; b=rUawEXQqS+qeRxIOsMUVZvyQvLfenB0xI6Z6j3Lw4EDdd5lAbNYx4LwZEfJjuq1L8yuBsv SiLmsV5e5wPu05+fnPiQszg3NQYc1elSJx/U9e7iMkZ+hH8hamebvVEWHxLQ4PRBF/4GqZ LMWfT/hT6Z2yUFR+253SU1HXKtM6L+qOOLqDXJaJPFWSiH4eI2A0NdMxQKaGnIODHF5J46 1IaCh3j88dofWBsuyliqdiqCLa1tMRKFVroJKP1Ln3519oAor9zJ2MPxSTyCYlgG36bxNA mXcpmXOoaPWWhUgTnGnVzCXNc2wFn0IBvkkFZHR5UPLNWz+G3sm/M4Er7CG4rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059084; a=rsa-sha256; cv=none; b=WM4bDsTOiVbMUFA2WYcVlCZAwxravGV2cDAVY/9PQ/WnrfHPaO5oT+V0RQUwGIILMrReoe CUb1uR6ca48H55XE51G2Me5O9l42IoNM//NZcqppCMpRba4vvdUkvOKFMrOLa+LUR9uFwF RPIWPAgoImXI/12y3b5XRoaoi1FFdBO8AVpLWNHaJcs+466DzX40udTCeRsXZGj/9bKdOG ZdKjiXuPbSSyVtVEOnvOroVhafTAPk10+wqiPUohqkvoAqLm48DUnYr/TH8P3u17Wainpj L0JKIsbob8EuIhH6/2N+6IrTz4vzMu6CW55wty034Fsnsswo+ZBEWNWfXgPpuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgv6qsVzHp9; Wed, 18 Jan 2023 16:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOhd2037805; Wed, 18 Jan 2023 16:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOhA6037804; Wed, 18 Jan 2023 16:24:43 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:43 GMT Message-Id: <202301181624.30IGOhA6037804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a6a22afc62de - stable/13 - LinuxKPI: add a no-op generic_file_llseek() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6a22afc62de3069dc4d99edeebb58d258e8adab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a6a22afc62de3069dc4d99edeebb58d258e8adab commit a6a22afc62de3069dc4d99edeebb58d258e8adab Author: Bjoern A. Zeeb AuthorDate: 2022-10-22 20:27:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:23:49 +0000 LinuxKPI: add a no-op generic_file_llseek() This is needed for debugfs implementations in drivers. Sponsored by: The FreeBSD Foundation OKed by: jfree Differential Revision: https://reviews.freebsd.org/D37092 (cherry picked from commit af393426b321e885d1db5f0a0571f34969a59a9f) --- sys/compat/linuxkpi/common/include/linux/fs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 55c2ee3e00c6..656b81b7be36 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -306,6 +306,12 @@ default_llseek(struct file *file, loff_t offset, int whence) return (no_llseek(file, offset, whence)); } +static inline loff_t +generic_file_llseek(struct file *file, loff_t offset, int whence) +{ + return (no_llseek(file, offset, whence)); +} + static inline loff_t noop_llseek(struct linux_file *file, loff_t offset, int whence) { From nobody Wed Jan 18 16:24:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgx2w7Hz2yJLP; Wed, 18 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgx23HPz3Ddr; Wed, 18 Jan 2023 16: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=1674059085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fqKKorZ69JUqLSFxwgRV+2A0f/XNvDDgSsJp+UwgnuI=; b=v6QzCX/ii+YPN+2Po9NyzYWPnxfr6ykRR8wD7hZX+TYjcu8ByW7LjQsS8WMeHExKWh9LV/ lQGxFAGDubJ6Nzu1bgQWJUBhQHHwk7x9Tz2CjTC8ohntll/rspijZuxfgOBcERqI+5TTeg y+h8ybR8PUZPNpROTiHujPbHX613ERNR1X5nU+JQU2cMuVbuIkb/QZpeQ8QMmhKTLtp7dB p8o47Qlh812a6vgk9EUSKSdU54WM4RmUlEQNTDqlxW1GpQcXdp+vbUriOxv067ynOTZZhS 9MLWsHmheCqa80opNeiDl+oi4YKxap1iilZ0yX1in3n2QY57Kx19tiL2XexsfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fqKKorZ69JUqLSFxwgRV+2A0f/XNvDDgSsJp+UwgnuI=; b=gomfYZhUEKEyPwoKwfTAqBAn6+ZmWrbyXJYTtwbH+Hu8AsLtFWoAV739ZnWmjTS0La2w/q mPvqdpgqAeKJdu41iI30h7PseEDxHgE9BeUnwsgM7d9AGceUrRgSqdpK42Lp90UK0B7Udz WaIzSSLnm7C6q3V+H6YH9336DrP2KaXSmpbw1aXur1hXlGKCxV8ovW+kAiH9BBYRAOEm3t CJkvQS2wvL7IKTuvr7TqdQGHzmtXlA16MCzn/Ohybh7k7odxIBK0+kPv0pFrQ1FoAtz4Io pE+MZwCdq7kyxyUgCmOpVDKrE/OML4s646nVdMShizobZWSq/UTg2/Oo4fF1Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059085; a=rsa-sha256; cv=none; b=OT+dhvHPx4yTmHIQ+lY/WbKCID8G8Ivr8s+zIMTkZeYvdCWri8e4PN2YEtuXEbW6snSpNz 2f+UzxF4ciajwpUKtYujuUWysznLylZVmM/5gw9KA5+yjH0FV78ebTj7QTsl/xCnbD8S0/ GptM3SoH0J6H6XwmDGms+KLy+BT/2/Cb9qYohTTB2ike+8CHcY/myEHewoj82j6DivZFF5 N3lgbRDhoM8iUlx8vBeeWZ33UjYhBu8v/1FhcRAcrRUJJ6fnTQg3DdDxmtYh8tVuWg2638 tXfb9CKR/n67zQrpI1eJpZeFf7uiNjtsWWYAnK1qHinnhntN46zKsG/frFWXNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgx0v6HzJ3b; Wed, 18 Jan 2023 16:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOjTh037835; Wed, 18 Jan 2023 16:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOjsu037834; Wed, 18 Jan 2023 16:24:45 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:45 GMT Message-Id: <202301181624.30IGOjsu037834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2078d0ea1e9f - stable/13 - LinuxKPI: ethtool.h add more definitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2078d0ea1e9f3c18422c30725687e7f861c2e560 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2078d0ea1e9f3c18422c30725687e7f861c2e560 commit 2078d0ea1e9f3c18422c30725687e7f861c2e560 Author: Bjoern A. Zeeb AuthorDate: 2022-10-30 17:07:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:23:55 +0000 LinuxKPI: ethtool.h add more definitions While we do not currently use ethtool, add the definitions to avoid other longer-term maintenance problems with drivers. Also migrate ETH_GSTRING_LEN into here from if_ether.h as it seems this is where it belongs. Differential Revision: https://reviews.freebsd.org/D37214 (cherry picked from commit 1b91eba37b294fd191a9dc79a80f52495af9418d) --- sys/compat/linuxkpi/common/include/linux/ethtool.h | 20 +++++++++++++++++++- sys/compat/linuxkpi/common/include/linux/if_ether.h | 2 -- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ethtool.h b/sys/compat/linuxkpi/common/include/linux/ethtool.h index 9195766f752d..99f5219d0187 100644 --- a/sys/compat/linuxkpi/common/include/linux/ethtool.h +++ b/sys/compat/linuxkpi/common/include/linux/ethtool.h @@ -32,10 +32,28 @@ #include -#define ETHTOOL_FWVERS_LEN 64 +#define ETH_GSTRING_LEN (2 * IF_NAMESIZE) /* Increase if not large enough */ + +#define ETHTOOL_FWVERS_LEN 32 struct ethtool_stats { uint8_t __dummy[0]; }; +enum ethtool_ss { + ETH_SS_STATS, +}; + +struct ethtool_drvinfo { + char driver[32]; + char version[32]; + char fw_version[ETHTOOL_FWVERS_LEN]; + char bus_info[32]; +}; + +struct net_device; +struct ethtool_ops { + void(*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *); +}; + #endif /* _LINUXKPI_LINUX_ETHTOOL_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/if_ether.h b/sys/compat/linuxkpi/common/include/linux/if_ether.h index c27583e62ebd..cb3e34a0823f 100644 --- a/sys/compat/linuxkpi/common/include/linux/if_ether.h +++ b/sys/compat/linuxkpi/common/include/linux/if_ether.h @@ -71,6 +71,4 @@ struct ethhdr { uint16_t h_proto; } __packed; -#define ETH_GSTRING_LEN (2 * IF_NAMESIZE) /* Increase if not large enough */ - #endif /* _LINUXKPI_LINUX_IF_ETHER_H_ */ From nobody Wed Jan 18 16:24:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgy4zh8z2yJ1C; Wed, 18 Jan 2023 16:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgy2rQWz3DWg; Wed, 18 Jan 2023 16:24:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3tORZCknIdq368zNdnZxa+YY6uc0EKI5tH6rVDcyXZE=; b=vmej1lVJ7MFQzVI3/AQuiPqK3aMaVmT5kcJX77Ef2/9/VMvcxlCOZRRyCqiaRWfMd5C1YP Cf24o2uzxMvt+7B1L3YmjTTsDYSwQP1hBNwkAdUzG4I3O61B50eNkBX7WT2rULUg/lk0z8 gnLjY2ZAaiI8SsX7GqHIWjue435yTO5IQ+T1rwi7cDhz6c55AEewJnFMvWl6UaHuhhjZMX 6NQVN/aFa9Vv89DbrWBH/6UZp/Ju4ijum/wtG5d+yT/0J7laChnFkOKO9DPjhTC1YUhUb+ Rowk3Nb37yoPCzjhoOd2QV2UHkLqbtXPsF0lITUErrDTDa67MGeKkgR5A/wKtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3tORZCknIdq368zNdnZxa+YY6uc0EKI5tH6rVDcyXZE=; b=cHaX7tdEU+AspunqeVNXPzktl5yU12+GyadhIu/XyqW+EqSoRowQDuWYteZK9yh/xrkigb +a/IAaqSeumgjNHMlTzEs+Hm5jS3eFEfV58oXeaBT1qglZVYQedMhaolT3JGGtmJ1aaJS/ cGGJkg+/2SpWZvFNY7oBc8ApG3pzg+IHGQ7jLFcqV4rioJgKLrjRvDrLu4b/xFZ4Tq9j/e BpR9euT8vItVhy8eZd5UANoBBEGAgZHbCglhwGNXif9F9ZsRdL1DB+HJARlI4Fiq5rwWxp DPwdFfGojRM+s9aDQV5+HvrILcsal5x0QNhcuFqmTnAXSc54hVSotc3g3R9Zcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059086; a=rsa-sha256; cv=none; b=KSh2bGKPp7DowF9OTKa5Bk+l7zga5q9qLSTXCb0czxix3FbeCDKVFjjN+QOuTbjrhD1gU0 ES9zvGqrk3Spf8ZB3pDd03BgHn40Ook8qDrbADhh8R7MLw7lTcJkv0lI2bl9l6avEwqJHB 6ygny12a4rIRROM9izQ3z18yQnOxwqIf0mzG+PSgne85cYhR17Ij4DBZM+9sO5rkFtBehv YjiiTjH/JC6zBm8HC5G34OljSsepfSXgDnrR4gYTjWV26mEwUs3JiZMmu7MkjzxjBmJo0p N2YYfX6P2kvCYm28rcgWAoH6PBOfqA7W8QQWw3aZoJj3S5WhVuUfmQy+3Cf0Cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgy1rf3zJB1; Wed, 18 Jan 2023 16:24:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOkbL037861; Wed, 18 Jan 2023 16:24:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOkh1037860; Wed, 18 Jan 2023 16:24:46 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:46 GMT Message-Id: <202301181624.30IGOkh1037860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4a9e77caec57 - stable/13 - LinuxKPI: 802.11: minor header updates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a9e77caec57fa8272c55986a2f0464780c011b2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4a9e77caec57fa8272c55986a2f0464780c011b2 commit 4a9e77caec57fa8272c55986a2f0464780c011b2 Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 21:21:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:01 +0000 LinuxKPI: 802.11: minor header updates - add comments for enum values constantly looked up, and another one to a net80211 equivalent (should possibly re-define those in the future?) - add another nl80211_sta_info flag - add enum environment_cap used in cfg80211.h in the future. (cherry picked from commit 69cc1630014b7c50f754f5d49cfd4ed2905a5c48) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 12 ++++++------ sys/compat/linuxkpi/common/include/linux/nl80211.h | 1 + sys/compat/linuxkpi/common/include/net/regulatory.h | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index c797967f357a..fef68bda4882 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -350,11 +350,11 @@ enum ieee80211_smps_mode { /* net80211::IEEE80211_S_* different but represents the state machine. */ /* Note: order here is important! */ enum ieee80211_sta_state { - IEEE80211_STA_NOTEXIST, - IEEE80211_STA_NONE, - IEEE80211_STA_AUTH, - IEEE80211_STA_ASSOC, - IEEE80211_STA_AUTHORIZED, /* 802.1x */ + IEEE80211_STA_NOTEXIST = 0, + IEEE80211_STA_NONE = 1, + IEEE80211_STA_AUTH = 2, + IEEE80211_STA_ASSOC = 3, + IEEE80211_STA_AUTHORIZED = 4, /* 802.1x */ }; enum ieee80211_sta_rx_bw { @@ -553,7 +553,7 @@ enum ieee80211_eid { WLAN_EID_MULTI_BSSID_IDX = 85, WLAN_EID_EXT_CAPABILITY = 127, WLAN_EID_VHT_CAPABILITY = 191, /* IEEE80211_ELEMID_VHT_CAP */ - WLAN_EID_VENDOR_SPECIFIC = 221, + WLAN_EID_VENDOR_SPECIFIC = 221, /* IEEE80211_ELEMID_VENDOR */ }; enum ieee80211_eid_ext { diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index e4c904ff5cac..76f97b1faaea 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -248,6 +248,7 @@ enum nl80211_sta_info { NL80211_STA_INFO_TX_BITRATE, NL80211_STA_INFO_TX_PACKETS, NL80211_STA_INFO_TX_BYTES, + NL80211_STA_INFO_TX_BYTES64, NL80211_STA_INFO_TX_FAILED, NL80211_STA_INFO_TX_RETRIES, NL80211_STA_INFO_RX_DURATION, diff --git a/sys/compat/linuxkpi/common/include/net/regulatory.h b/sys/compat/linuxkpi/common/include/net/regulatory.h index a7b31812e308..a020323ae7dd 100644 --- a/sys/compat/linuxkpi/common/include/net/regulatory.h +++ b/sys/compat/linuxkpi/common/include/net/regulatory.h @@ -32,6 +32,10 @@ #ifndef _LINUXKPI_NET_REGULATORY_H #define _LINUXKPI_NET_REGULATORY_H +enum environment_cap { + ENVIRON_INDOOR = 1, /* keep != 0 */ +}; + #define REG_RULE(_begin, _end, _bw, _mag, _meirp, _flags) \ { \ .flags = (_flags), \ From nobody Wed Jan 18 16:24:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrgz5RDFz2yJNp; Wed, 18 Jan 2023 16:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrgz4Syyz3DZC; Wed, 18 Jan 2023 16:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R1RwJQVNwtPpC9E8zdh9OfWqhztjqGYkaEEbXZUoxoU=; b=V5yG2mWgBV0u2z2Ez+wI2/CXDb5Smtb9zqw0NzusNeWC7TVHpkiOugA6d38L4L4GMG6qad gp5lozqvO6+Kv8wpIEkftLinzVrZbGrwk3x3VUhHdtJ+CZaP5StQ7jtROgtZqBxg6zX9i+ 6JCEV1d0KprKnuQaeMyHyKWSCnM8G0RO/YCs1SEmepebbQTvfYukQ8nMUSeUnHfVScY8r+ VWeibZy6eLm0xMyRWoZNMUkycna8tHpu6XtpKVklYBpgE4a/ozl2Ia/YGZYhmGbk9LRulK o2r2jYkC+fkFW9aUrHaclRejYN9hy0zjEj9GVYGJ90mcIaIQlLS9yZyIKfshjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R1RwJQVNwtPpC9E8zdh9OfWqhztjqGYkaEEbXZUoxoU=; b=kgUo76GJRx+DBJt/GCZQWwYL41+Ht7JWyGWbIksOETbD7btl5bBTQ9R4JCuaRajthWOKl3 1erl99dGzZB/PZEBLHvoaipJ1OTRMVLlV85DGKwM5eyA/6HuW23LaC1bPBoQeBy9amZs2C blU1uuIzUr1PvQlnJKVxNajkJ2dVYatp3apVE8uExKpnK0uVUAJgsl6LXJGLJjo3Ncu5Bg 15BhA30RpCdtd8uK+JkxuzMy/j21hSLLdQ5zGXTVbpRyr35GEcWU6zupUe7cY7ry6YJejM ZGS41F0cRHvbYANEcBJf1iQJ3l6YOIz0DTNBdvPDA5zZKNl0Ov2r4Sxcz0p2FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059087; a=rsa-sha256; cv=none; b=FEXMzCQ9RXmxUACp/cheg1GoN26AkQrqVz0Ils/zyKV3i2iSkTJLxaolI1VUtWdCqttjkv zyQ73yLUDbPL8I7RJP1ZIl3bXgbBhLGB2vLOOV9GG5Fcn4KDnO+7QHSAzjjrsIhBOrJjyH H3uKo76ZyGd2GQzD6UcaxBIm545kytNRvIcDQ9tzmEOZlH0/fBJJ0fclqe6Lg/DWPRAjFi 9a0Ah3oMwuYuPdZeS4cktRM/DsDsncjZ9y1WgVQVRuzT1Mmak0qtOjcG0mQ9rsXmYF8WDe XJvYhoVT2PuZdIhwviuNIKwL08O5xRXxG8D76vdtgGHDFke7x+8BSzQwvTumbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrgz2qNrzJ5F; Wed, 18 Jan 2023 16:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOlDb037885; Wed, 18 Jan 2023 16:24:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOlGS037884; Wed, 18 Jan 2023 16:24:47 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:47 GMT Message-Id: <202301181624.30IGOlGS037884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c1e13c43f7a6 - stable/13 - rtw88: correct SRCS+= in Makefile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c1e13c43f7a60e43419956df331f17fdfbbf77b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1e13c43f7a60e43419956df331f17fdfbbf77b4 commit c1e13c43f7a60e43419956df331f17fdfbbf77b4 Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 15:48:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:07 +0000 rtw88: correct SRCS+= in Makefile Properly spell a SRCS+= for an optional file (this is why it stayed unnoticed so far). (cherry picked from commit 4495b4eb510d87277ed2dd4d27f7cebc7a76b4a8) --- sys/modules/rtw88/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index 396dd91726b2..c27d922d1124 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -18,7 +18,7 @@ SRCS+= rtw8822c.c rtw8822c_table.c rtw8822ce.c # 11ac SRCS+= rx.c sar.c sec.c tx.c util.c .if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0 -SRCR+= wow.c +SRCS+= wow.c CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM} .endif From nobody Wed Jan 18 16:24:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh05Y4Lz2yJWL; Wed, 18 Jan 2023 16:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh052G0z3Dn9; Wed, 18 Jan 2023 16:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rwU734/YDibAi2UlCJ+QsOEski/QxX2xvvxFtWbAyE=; b=iTUhb7Q4q6yqnjh9zPT5HqlOQdNRKPqTnuviRp9NaDtDPPFJWFgNHctXOk1MJCf9JH8Zv8 Tg1cMpODIfJVGSvojSOxx1a43c3nu/sOb8FSbFfqoMqJqAoE7LufxbVdBJgVQOhUZzLW40 r4o+Fjxgl1VSzTgSFaducusTigBE3hS6nsC69UzR4dbEtCww5lAoQPrS17CwzxtjZxZJEu MQHv0UyrZ+Shn5JfJz7pIC4O8lcFEUwwMTKkPmLHTm6ZZNqKV3Pm9Uh0Sl2tl8uDN0LM/F 8bxtOtc5uNnYhot8asdzpfUrF2YAvRVCyuxnnaBCYcau2R8OeNUYfmjcVdfjGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rwU734/YDibAi2UlCJ+QsOEski/QxX2xvvxFtWbAyE=; b=RSRvulGk/nx/rsv2GSojgGvbYjbF1RWYOK6ToECA2hp7tleKo18JAK+WehHFwwahJywr/R Aba93ob/vcsQrrvwbUtzuc/oKtvFZD/xeKZu3H0NakKK6u/CwnJ+ZonRLl5wx1jANNJylj w/LwTw3Fn0RkuAOLBnAvipWamcmNkmnC/H5fPpmBCFrEqaj+LnG3LvzY3zrlgw3CurwRXl kXRVCrl6dR3P8Wp8fA+sTN4Wnr3AcOdlDqpafHwSLMI/Om8V0AbphynaM9pfKLdcGFMfpZ Anu5fe27D+v1UH3qxZyqYUMk1i6KCzEDcgUbpXmehJRpJpQZroV+eByCPfPh1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059088; a=rsa-sha256; cv=none; b=HEB7UyzmCk7zyM46QyxGProfgSkEKQjUiIFlTl5Mk6/OZQiqPumA6+s8tWl+yWm5jeurq9 J+rC2kEfEzi/E3HAzloh+W+YDcY4qaeYezdW3ytM7V7+0USWvECn8MSi9XAn6GaKcKOcTt 2ZbcSdP7zMoq4ZIshzukdCO/OMwwJZPMFsz8pmAPi69tIKIBFDzmyry2c8ugNTi1ztZJr4 /nPGda1MjOPlacQlDQj318JCsnlw2YYeD7JptsBY1BYNyjKjNS7qDDePSzRKhJq3uAbitv x4MsiRcDZJFBJsXneeUT5QjE0jJcKSFzPO37l92gdi0aKfsD/+vRIb2eyUPv2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh03nmpzHbx; Wed, 18 Jan 2023 16:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOmob037909; Wed, 18 Jan 2023 16:24:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOm76037908; Wed, 18 Jan 2023 16:24:48 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:48 GMT Message-Id: <202301181624.30IGOm76037908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e75ba4c620ff - stable/13 - LinuxKPI: SKB: implement skb_peek() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e75ba4c620ff9169c29a89274810cb2c332efecc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e75ba4c620ff9169c29a89274810cb2c332efecc commit e75ba4c620ff9169c29a89274810cb2c332efecc Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 18:47:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:11 +0000 LinuxKPI: SKB: implement skb_peek() Sponsored by: The FreeBSD Foundation (cherry picked from commit ce9f36610ea9ff29d42a2bcfed44b020c2e56dcb) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index b54f5a91769f..35d5a1fd9b80 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -571,6 +571,18 @@ skb_queue_tail(struct sk_buff_head *q, struct sk_buff *skb) return (__skb_queue_tail(q, skb)); } +static inline struct sk_buff * +skb_peek(struct sk_buff_head *q) +{ + struct sk_buff *skb; + + skb = q->next; + SKB_TRACE2(q, skb); + if (skb == (struct sk_buff *)q) + return (NULL); + return (skb); +} + static inline struct sk_buff * skb_peek_tail(struct sk_buff_head *q) { @@ -930,14 +942,6 @@ skb_reset_mac_header(struct sk_buff *skb) SKB_TODO(); } -static inline struct sk_buff * -skb_peek(struct sk_buff_head *q) -{ - SKB_TRACE(q); - SKB_TODO(); - return (NULL); -} - static inline __sum16 csum_unfold(__sum16 sum) { From nobody Wed Jan 18 16:24:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh16RBdz2yJNt; Wed, 18 Jan 2023 16:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh15HXJz3Djk; Wed, 18 Jan 2023 16:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CBF0X8JxmjJ7Hu459xBrwpaIBvLE2cE7qanoDGACM6w=; b=X7NAG2RNhXMKqKkr/Ssipz/eWbFJPC1BAcgdf2kTbyjISvyFGirc6GWfJouHyde4A3uWq5 Y5PNf008emP8r4UAGtJcJdEyJp1dUW1coH7Kflnz/HLd+60ZYFj+E1Y/+DX9bvC0TD/59W EH+GBkVslyE5R5kKUt4r2jkHqPsem1hi8qWOaoBGiPmK/Olj8iXTkaug231jvMQdw0Voav uijEaMpZzJUvCRts96UkR9BEiiujZm96c5QMusp8v62G//EcOJo0GjG5Sf6p4IE/YjtC7y sXZ+qaq+ho+Ka5BHydM4meGw/XSudd795PJ48iAZ1EeoTasDG879QtJT6PRtkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CBF0X8JxmjJ7Hu459xBrwpaIBvLE2cE7qanoDGACM6w=; b=akvJEPho3FnFHLTLuEwUh1l6nlkRs8O1Eq9S1RQFvSwvhWvVHj0UANNvCJjqM8LMVtYDwS jVQmP6Ba4vBoQepI65I+bi+RiYeySeT9pFbj80SrdCwpsq+uOvrWrugL5E5E5uRMltkNpp dyavtR2TbeecptUOwvL6sPpkVyRugUckpHSqdiZKB/hzONy5BPdcDGpbTI94PmEWfk7FDw oVe21Sk2/yVLdV6Xvgf0S30fnaDE6R8JfGXPvknwATlxlBuAvvK8Doj7W6mVJwtdEekqpX YOBxez1wXYtM/OuOz/t7SJ4pwgLfbXTlw4hJUHbq9NsT/DGqHyuWRdxne+XPgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059089; a=rsa-sha256; cv=none; b=rD/1KcQUzkfOGIyZdysn6grrOBB3AkJzbo6SpZyuRO2+quBWtUsSKXSUdPWQA4yR7lEbFs L+LtyXvTtksxq20D1tFP753GF3eyJGXu7F1tWE+nlzMJEU2vOHSth52p0C5vGYf2wLm8Zp Etp8kjAJ6W25FAki0B8KQoIWmzWpKpCpHiwjDIDppQj3Ig+9mqyVH5aSMuMXeJjIhYvmIu 416t3PGaH67EwjAZzsV0LO4lEbNdftR4PFV9r+K8dYB7cFrWzBCpI7yS+r3byts7l0rRFO EaDPHYHjwQDFHK7Kmup8uDfhDPO22r1n2vNzIdiPH3k28m0nDKyvo9OTuf5jow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh14P2pzJ3c; Wed, 18 Jan 2023 16:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOnr6037933; Wed, 18 Jan 2023 16:24:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOnEv037932; Wed, 18 Jan 2023 16:24:49 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:49 GMT Message-Id: <202301181624.30IGOnEv037932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: aa0370996eca - stable/13 - LinuxKPI,lindebugfs: add u8 base type and blob support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa0370996eca5c8d4a8cd2c09888300bbb253994 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=aa0370996eca5c8d4a8cd2c09888300bbb253994 commit aa0370996eca5c8d4a8cd2c09888300bbb253994 Author: Bjoern A. Zeeb AuthorDate: 2022-10-22 18:12:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:15 +0000 LinuxKPI,lindebugfs: add u8 base type and blob support Add debugfs_create_u8() based on other already present implementations. Add a read-only implementation for debugfs_create_blob(). Both are needed for iwlwifi debugfs support. Sponsored by: The FreeBSD Foundation OKed by: jfree (earlier version) Differential Revision: https://reviews.freebsd.org/D37090 (cherry picked from commit 0fce2dc1573019d0732f33fa7c26cc228655d3e8) --- sys/compat/lindebugfs/lindebugfs.c | 66 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/debugfs.h | 11 +++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c index b88caf9c3140..b72ceb5e0be9 100644 --- a/sys/compat/lindebugfs/lindebugfs.c +++ b/sys/compat/lindebugfs/lindebugfs.c @@ -367,6 +367,35 @@ debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, bool &fops_bool_ro, &fops_bool_wo); } + +static int +debugfs_u8_get(void *data, uint64_t *value) +{ + uint8_t *u8data = data; + *value = *u8data; + return (0); +} + +static int +debugfs_u8_set(void *data, uint64_t value) +{ + uint8_t *u8data = data; + *u8data = (uint8_t)value; + return (0); +} + +DEFINE_DEBUGFS_ATTRIBUTE(fops_u8, debugfs_u8_get, debugfs_u8_set, "%u\n"); +DEFINE_DEBUGFS_ATTRIBUTE(fops_u8_ro, debugfs_u8_get, NULL, "%u\n"); +DEFINE_DEBUGFS_ATTRIBUTE(fops_u8_wo, NULL, debugfs_u8_set, "%u\n"); + +void +debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent, uint8_t *value) +{ + debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u8, + &fops_u8_ro, &fops_u8_wo); +} + + static int debugfs_ulong_get(void *data, uint64_t *value) { @@ -394,6 +423,43 @@ debugfs_create_ulong(const char *name, umode_t mode, struct dentry *parent, unsi &fops_ulong_ro, &fops_ulong_wo); } + +static ssize_t +fops_blob_read(struct file *filp, char __user *ubuf, size_t read_size, loff_t *ppos) +{ + struct debugfs_blob_wrapper *blob; + + blob = filp->private_data; + if (blob == NULL) + return (-EINVAL); + if (blob->size == 0 || blob->data == NULL) + return (-EINVAL); + + return (simple_read_from_buffer(ubuf, read_size, ppos, blob->data, blob->size)); +} + +static int +fops_blob_open(struct inode *inode, struct file *filp) +{ + return (simple_open(inode, filp)); +} + +static const struct file_operations __fops_blob_ro = { + .owner = THIS_MODULE, + .open = fops_blob_open, + .read = fops_blob_read, + .llseek = no_llseek +}; + +struct dentry * +debugfs_create_blob(const char *name, umode_t mode, struct dentry *parent, + struct debugfs_blob_wrapper *value) +{ + /* Blobs are read-only. */ + return (debugfs_create_file(name, mode & 0444, parent, value, &__fops_blob_ro)); +} + + static int lindebugfs_init(PFS_INIT_ARGS) { diff --git a/sys/compat/linuxkpi/common/include/linux/debugfs.h b/sys/compat/linuxkpi/common/include/linux/debugfs.h index ba1fa009dc62..4c9f52a0bc0f 100644 --- a/sys/compat/linuxkpi/common/include/linux/debugfs.h +++ b/sys/compat/linuxkpi/common/include/linux/debugfs.h @@ -47,6 +47,11 @@ struct debugfs_regset32 { int nregs; }; +struct debugfs_blob_wrapper { + void *data; + size_t size; +}; + struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *parent, void *data, const struct file_operations *fops); @@ -75,8 +80,12 @@ void debugfs_remove_recursive(struct dentry *dentry); void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, bool *value); - +void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent, + uint8_t *value); void debugfs_create_ulong(const char *name, umode_t mode, struct dentry *parent, unsigned long *value); +struct dentry *debugfs_create_blob(const char *name, umode_t mode, + struct dentry *parent, struct debugfs_blob_wrapper *value); + #endif /* _LINUXKPI_LINUX_DEBUGFS_H_ */ From nobody Wed Jan 18 16:24:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh32nFSz2yJRN; Wed, 18 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh26M0gz3Dtn; Wed, 18 Jan 2023 16: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=1674059090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yY3nLDIotnDsi6egIHIdlzHTb1sB2hSXExm6LhwT45w=; b=L0UXr7zDFIFKIvf5dmSO7kUr2vP7pVDJXRj433RTlWBpNrLQpF+lRgYlYPo+kkD/5TtkH/ Lzf6nQBlwBqAcPBUuWYKjKBUN0e0mi0l2iKpr+iD/KJdeXOQjslGBq0YSFLa4+eHbVhSod zAHXZGqbHM0QLrs4cn8fnerj0sEPigDBP+4m7Sw/zoJoYKZUV7SyLkZV3L3ABrYzSSv3Xy HeWyVJMzHY9BqnoBOV0pEVH/iMe7XoyByKtehGameKsk+paGu8hkZRGP6EGmO1HXhWJQlW Wg7z38xBjGgTfs/TNbHfNkttPkABL4aFXDiwB4/tCWKliDn+ksNrGSLbZii6Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yY3nLDIotnDsi6egIHIdlzHTb1sB2hSXExm6LhwT45w=; b=rIXuXPTWidZPZQlNoHBIAZ8//A23JxZKX5w1Zd/lgXE8aHvvDFY3eKF5qKZQXjQVOySTQl 9uzYbwdq4dvVPVObXtZx6WdyOHcDvaet9PyoEIKCBMMKd3WVsmSM8JV6UFEs9z8NW7cY1k Q5QP48ywQJQwcjqifnb5kguJK6Lt217eyt2FE/KFaXwRh95p3Nd03byvYQXuvCofYm5W49 TNOtzsjxc9LCiLhYDE0CyZZH2oHqWvXUAGu21TXUKA6cN5MCoreeTQnuLL/I6OigdAcFnh dMCIxxVk36fvp2DV/gtZET8Xw/B8IdCMI0/oOkX7GSixi1Zz0xhc51ZJ31KmNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059090; a=rsa-sha256; cv=none; b=AwYLyRxWTTHvtN2BfXqI5DkpR/Aqy+Sn0BJlNpptJIbR0Yl21aJujBDgrTchs1VSwk8Pfz 6aUwdWVUKVdsB9BXPXrGFXGM04ofLcnLc6XRu2Wv2kCc4fgqyZvEGfsruRRcQyKxBTkR+N yUiQCTV4RNC8s+xk/4FbNJ8n6U/Wts6h4133eCihh/kroPnJWmNGNi2elRBxDgBMiEI7iL OpmRbxG/OEtngqOzfjbOc8A1wslZiHvLHISy+4in5Faks11Dg9L1v1SF7IKniNJJ+nOQzZ SzZfQvNvWUjDfrZSbVsTulFn1/DHRMn5kKY0TH6a8jTJ+xKkyott/tDVjTEBxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh25Q31zHpB; Wed, 18 Jan 2023 16:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOo7D037963; Wed, 18 Jan 2023 16:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOogt037962; Wed, 18 Jan 2023 16:24:50 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:50 GMT Message-Id: <202301181624.30IGOogt037962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4073b7ddf14a - stable/13 - LinuxKPI: pci.h add more MSI related constanst and pci_is_enabled() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4073b7ddf14a2ff5adf5f18e3cc37a3fbb7994f3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4073b7ddf14a2ff5adf5f18e3cc37a3fbb7994f3 commit 4073b7ddf14a2ff5adf5f18e3cc37a3fbb7994f3 Author: Bjoern A. Zeeb AuthorDate: 2022-10-31 22:14:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:22 +0000 LinuxKPI: pci.h add more MSI related constanst and pci_is_enabled() Add more MSI related constansts defined to our native defines and pci_is_enabled(). All are needed for another wireless driver. Differential Revision: https://reviews.freebsd.org/D37225 (cherry picked from commit 5f2f582ccceec8729ee85bf191a2f7373c2994a4) --- sys/compat/linuxkpi/common/include/linux/pci.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 79999c3912f7..f870b039254c 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -163,6 +163,11 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ #define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ #define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ +#define PCI_MSI_ADDRESS_LO PCIR_MSI_ADDR +#define PCI_MSI_ADDRESS_HI PCIR_MSI_ADDR_HIGH +#define PCI_MSI_FLAGS PCIR_MSI_CTRL +#define PCI_MSI_FLAGS_ENABLE PCIM_MSICTRL_MSI_ENABLE + #define PCI_EXP_LNKCAP_CLKPM 0x00040000 #define PCI_EXP_DEVSTA_TRPND 0x0020 @@ -1611,4 +1616,12 @@ pcie_get_readrq(struct pci_dev *dev) return (128 << ((ctl & PCI_EXP_DEVCTL_READRQ) >> 12)); } +static inline bool +pci_is_enabled(struct pci_dev *pdev) +{ + + return ((pci_read_config(pdev->dev.bsddev, PCIR_COMMAND, 2) & + PCIM_CMD_BUSMASTEREN) != 0); +} + #endif /* _LINUXKPI_LINUX_PCI_H_ */ From nobody Wed Jan 18 16:24:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh430CXz2yJNx; Wed, 18 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh40R72z3Dm9; Wed, 18 Jan 2023 16: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=1674059092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zo1FVrFZ1dS65A4hnbMRtoZ8btNednOuLaJSwD/ZR0U=; b=qpIlurthlibhLZgp/kf+BMJmecJUoVQM6juZDI8z7IhTFURsmp6C7JfOgziih3Mzbohpg5 fUApfYqd2znlnWpNnDXCspanZ09dNeq3PrLftw7aYnxvWkO9D1PY1L/Tf/shzxOpVaHsQV sTvjjjO1A2jDIxDBHWKJoXWRyWL3box5b/4npRCIbTXHWxut47Mw3zpjFsWVpzrJd/IyZy R7afzRTS9vdJ0eVJtHapXLfV9rqC8Mm+/FGlN+XfhINXJJQgiRg93aSWxZ89VLCkygZAeT e3SjizuLHEVF188z69VhDSEbnjCv/DOnoDeLLJe8WllQqv73XBzTwmLoU0/TeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zo1FVrFZ1dS65A4hnbMRtoZ8btNednOuLaJSwD/ZR0U=; b=HWP+ZTO5lePKQBXBxSUFmux+SoJcYW4fmU5Qt6VwW6zBjUailJF8pz1C8oggvk4gNBoKzl UAPAaXLGfd/+LIFFf0U+H84Wb0/K+kEf2dxf0DJzo2RurG+EY26HNfAsu7GlB14S/o8Eir Ivn7ulFtNzQq0Z0wSWA3yY0+kVhu/qOUr40jaFE8YlyA5dc59m7T4mSrpAcdRT5mpF5Ivb KkjIGb5yVFEmEVTE5XfCoGt1XSlgNDiW6IFgE2QKZ/IRks17x/24+q8kMHKTrZJ46fuyVx arf1pTYelST/2OEhKHlTyUVxW8KCjEtcgb+YLR65jc3ebZb4FSfbAMlxpxieJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059092; a=rsa-sha256; cv=none; b=snrxYUwIlhnDnP6SzYhM0ydUPyXeDdO8ViqY6rZbgL8xlOVNZ0kxQ/crZ8jR4hw8I4+/l3 /JHVnfT/LC+KvhqUjQgJVx7hjnZ9PVL1qw7fBqpMVsiIsrGzphS2H/cHBFkP+fL43NSPay rM0rtCG8HMdjst4ufhjA8QQVn+uD+upAB7LcslRm19lT3928YHNImIRlzOZ8UHIfhuzJXA Fjr7aw17dsBPff54eDSNivPtL3j7E0uv+iJMn4QKRPOViymXhTVbGV5z3A8pMIyO7uh10U xRByFbOo+I4uf7CDCivXtJqy8eCW5OgsmoD0ZJ+X9OqehTWQia7X8AYtMjiaGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh36QQtzHZZ; Wed, 18 Jan 2023 16:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOpe7037987; Wed, 18 Jan 2023 16:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOp4M037986; Wed, 18 Jan 2023 16:24:51 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:51 GMT Message-Id: <202301181624.30IGOp4M037986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: aca218556485 - stable/13 - LinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aca2185564859f967943058925ccc71975df911c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=aca2185564859f967943058925ccc71975df911c commit aca2185564859f967943058925ccc71975df911c Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 22:31:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:27 +0000 LinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS Extend pm.h by pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS(). For the moment this duplicates some parts (as can be seen in the earlier review I tried to simplify bits but given our implementation this was easier in the end). While here and cleanup the SIMPLE_DEV_PM_OPS() bits (white-space only). Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D37527 (cherry picked from commit 4052b0e4b218f916b1f491a5ec9e41d38029215b) --- sys/compat/linuxkpi/common/include/linux/pm.h | 28 +++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h index d67cebb9764a..eb3316088787 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm.h +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -47,20 +47,36 @@ struct dev_pm_domain { #define PM_EVENT_FREEZE 0x0001 #define PM_EVENT_SUSPEND 0x0002 +#define pm_sleep_ptr(_p) \ + IS_ENABLED(CONFIG_PM_SLEEP) ? (_p) : NULL + #ifdef CONFIG_PM_SLEEP #define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ const struct dev_pm_ops _name = { \ - .suspend = _suspendfunc, \ - .resume = _resumefunc, \ - .freeze = _suspendfunc, \ - .thaw = _resumefunc, \ - .poweroff = _suspendfunc, \ - .restore = _resumefunc, \ + .suspend = _suspendfunc, \ + .resume = _resumefunc, \ + .freeze = _suspendfunc, \ + .thaw = _resumefunc, \ + .poweroff = _suspendfunc, \ + .restore = _resumefunc, \ +} + +#define DEFINE_SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ + .suspend = _suspendfunc, \ + .resume = _resumefunc, \ + .freeze = _suspendfunc, \ + .thaw = _resumefunc, \ + .poweroff = _suspendfunc, \ + .restore = _resumefunc, \ } #else #define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ const struct dev_pm_ops _name = { \ } +#define DEFINE_SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ +} #endif #endif /* _LINUXKPI_LINUX_PM_H */ From nobody Wed Jan 18 16:24:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh51YNXz2yJRS; Wed, 18 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh513QHz3DvS; Wed, 18 Jan 2023 16: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=1674059093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wxvtHQqoLS1JgOGS2D0v3fEWUm5ufwO/iKutEyUIWv4=; b=bfq3VkzmSXJnVnV/XQ/yEOh6uCSnduxMfuLsxiNObXvOjjdzDUxkt66nqodl74ZdnWAvkP lCHKbE/9GiKt8WsExI4EfzGliw6NZAPu1I5LwAS5UDjeUqWgI3mex1N55g9JUZ1+vx1pso FvQHvSsowPk9/aV93kNadIbxJmtIYNVgLzdE1oUNC7pyjJdXf1shqZtLGcz4BordxB4KeT zNtzQqdyDgrksC3n0Lfk9Lo8l2W8aW1nWMhBcOjr+B6QVlxTzGtg34C8Fj8G7/A3+Unt0W LYL9QRYOj78ZZgoJL/QXG+gE5hwQEKgRSZ1HfMAWyhPB2L+8PJM7lEgSbTtwZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wxvtHQqoLS1JgOGS2D0v3fEWUm5ufwO/iKutEyUIWv4=; b=QvlmUMBr0yzjxaWc5ADvpVvXTJfP62NPAFHxSiuLnXSWgz+Ugr5elnd7Rz4BV7BG0/BX5F c8rB6mVZqHQ2bVqy1PZT5UMUk2u7Ha2DtadNzvne7oikZ+PBUfweiS4Ho3OpIJUmYjXXB9 XSl7vu0yY6CCnpx0UnEQEH0XE8guvwI5gVkl8uQ2ybZcbB0sgKl+Q/ZymIfdGO4WwbePeo ArmKfj7rpiGtRUqtOg4khQgCx5fUBqNxvXuXlcjG0TcBmqR2l+hSr0s9zwTVTXuCtxfvfW ZBus+ylZukhfGfaZ0HZ57KL6HjBVJXKvCLZ6ksXNR7kLuogdfcE+9p7aMWWPxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059093; a=rsa-sha256; cv=none; b=FpxNM0r1n+CsZqMlRWk1kYr+SyDoSgP7XrOY6BAifldwtMEKPmCzl5RwPQhGCsUICgNk5L 7aJEYvIjkpmjbTQ/IpOp4LFtXj12+IZvHv1JizI6Yd3EV7JU0lui9V98/vxxtiE4Ig0NZE obnfrdNTXi61quxF7nWRxoVwzb5q+/60i4TI2OK8aaBBTrNaXc1sJ/GJEss96LKTnsgWdX PRUrY2ktBDl0st00FEorvnXZRukMHUZ5enCIoECZ1yhdvH/v2lqTsqkx3p0cQRi6EgCV2q K1ZfdeFHq306950t/vUebarfQpKCTVcrIB/kUJ+x2s5nmXYwNpUMiVZB7DvaLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh506LZzJDD; Wed, 18 Jan 2023 16:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOq3Z038011; Wed, 18 Jan 2023 16:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOqNO038010; Wed, 18 Jan 2023 16:24:52 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:52 GMT Message-Id: <202301181624.30IGOqNO038010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9bf3a5616c51 - stable/13 - LinuxKPI: add simplified version of page_frag_cache List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9bf3a5616c51081b221cbb794f559a5aab07aabc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf3a5616c51081b221cbb794f559a5aab07aabc commit 9bf3a5616c51081b221cbb794f559a5aab07aabc Author: Bjoern A. Zeeb AuthorDate: 2022-12-03 00:33:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:25:11 +0000 LinuxKPI: add simplified version of page_frag_cache For the moment and the currently only consumer (mt76) add a simplified version of the page_frag_cache. We will only accept fragement sizes up to 1 PAGE_SIZE (KASSERT) and we will always return a full page. Should we add more consumers or small (or large) objects would become a problem we can always add a more elaborate version. Discussed with: markj Reviewed by: markj (,hselasky commented as well) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D37595 (cherry picked from commit 55038a6306a570c9f2df89f5ad076de0f7d98152) LinuxKPI: fix possible NULL dereference in linuxkpi_page_frag_alloc() Reported by: Coverity via emaste Coverity ID: 1502345 Sponsored by: The FreeBSD Foundation (cherry picked from commit 51e94a4658d23016dd0ae67c189a89f53281cbcd) --- sys/compat/linuxkpi/common/include/linux/gfp.h | 29 ++++++++++++++++ sys/compat/linuxkpi/common/src/linux_page.c | 47 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index 6273fa969db8..7657e78b0950 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -80,6 +80,11 @@ CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); +struct page_frag_cache { + void *va; + int pagecnt_bias; +}; + /* * Resolve a page into a virtual address: * @@ -94,6 +99,9 @@ extern void *linux_page_address(struct page *); */ extern vm_page_t linux_alloc_pages(gfp_t flags, unsigned int order); extern void linux_free_pages(vm_page_t page, unsigned int order); +void *linuxkpi_page_frag_alloc(struct page_frag_cache *, size_t, gfp_t); +void linuxkpi_page_frag_free(void *); +void linuxkpi__page_frag_cache_drain(struct page *, size_t); static inline struct page * alloc_page(gfp_t flags) @@ -175,6 +183,27 @@ free_page(uintptr_t addr) linux_free_kmem(addr, 0); } +static inline void * +page_frag_alloc(struct page_frag_cache *pfc, size_t fragsz, gfp_t gfp) +{ + + return (linuxkpi_page_frag_alloc(pfc, fragsz, gfp)); +} + +static inline void +page_frag_free(void *addr) +{ + + linuxkpi_page_frag_free(addr); +} + +static inline void +__page_frag_cache_drain(struct page *page, size_t count) +{ + + linuxkpi__page_frag_cache_drain(page, count); +} + static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags) { diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index df4a124cf3e2..5fa370147045 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -429,3 +429,50 @@ lkpi_arch_phys_wc_del(int reg) free(mrdesc, M_LKMTRR); #endif } + +/* + * This is a highly simplified version of the Linux page_frag_cache. + * We only support up-to 1 single page as fragment size and we will + * always return a full page. This may be wasteful on small objects + * but the only known consumer (mt76) is either asking for a half-page + * or a full page. If this was to become a problem we can implement + * a more elaborate version. + */ +void * +linuxkpi_page_frag_alloc(struct page_frag_cache *pfc, + size_t fragsz, gfp_t gfp) +{ + vm_page_t pages; + + if (fragsz == 0) + return (NULL); + + KASSERT(fragsz <= PAGE_SIZE, ("%s: fragsz %zu > PAGE_SIZE not yet " + "supported", __func__, fragsz)); + + pages = alloc_pages(gfp, flsl(howmany(fragsz, PAGE_SIZE) - 1)); + if (pages == NULL) + return (NULL); + pfc->va = linux_page_address(pages); + + /* Passed in as "count" to __page_frag_cache_drain(). Unused by us. */ + pfc->pagecnt_bias = 0; + + return (pfc->va); +} + +void +linuxkpi_page_frag_free(void *addr) +{ + vm_page_t page; + + page = PHYS_TO_VM_PAGE(vtophys(addr)); + linux_free_pages(page, 0); +} + +void +linuxkpi__page_frag_cache_drain(struct page *page, size_t count __unused) +{ + + linux_free_pages(page, 0); +} From nobody Wed Jan 18 16:24:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh633T3z2yJM1; Wed, 18 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh62Bdyz3FDF; Wed, 18 Jan 2023 16: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=1674059094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZE9dH6vMfl3tFp9N2hc+EEheh4AhlERPP50kwSzLz5s=; b=T4P2M+gXeZrmHxemyAeLEsMeUCh25PbWpggog/AD8WS7LZh00zu97sR/CVl429qxVkClsY g1dq1CrSnR+Gn+2yZlyH0lCLWcqLv4zvzIjsNx83muoz5xp9t4pBP7fb45kOJPRoXKb89r un8XpAz4T3dincCQtEmmPWJabcrV9MTUPqdZwMsr6jZSwXbdS60hTGbX834h1kRJ2hdQCv dn+d1yxSTp84aDD/ZlNdtCZAg0ztZRGQhAdzwQHq1rXQ29oLKL4uQF92LuC3i83NaJvRxY Y0rSh8+39FUemYtIseFl8zj9Nxt0/+jtkKpZiQyeyKMO7CXIfzlqGmKEpN9OfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZE9dH6vMfl3tFp9N2hc+EEheh4AhlERPP50kwSzLz5s=; b=fNFocOkFdpHyWT+IUJJQFYowm1OSGIOGS/MDUWc2kmQQL1E8Vaq/mADVVPtUtcy+Iu4w9h +FhT7AXEh1Iydq+lZfR25bm5h/GeuQpU46rgX87gKmuw8S9nLLfYYYJCeCK8KbFei9pG0c kgZZTApjyI1USLWqo1QuoFct5Sysg+v4Ej7TBv/HsmJ57YdVLRCH1KYGatleesr7mmzFN8 Uw3q2Osd5J+Il9D4eAVyRmsXJeTgiCu2lZlqhao8eDcWvI1Ugc37zftU5/4zCbK+yXvWB6 GPEZIboX+3QUJXy9RxUhu0d0uEcV4t1r7uryyNNvfNTTuJfXc8Ta/GL3qhSruQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059094; a=rsa-sha256; cv=none; b=XLFvgg3RCwybKhN9mHhYW5VN6kkGGLlSZbDOBekAXd3q/z+iBzwso1l4/nZETMyWYePs41 6W9mw13rqTnDRGgXoAl9SOYcudoFPf4RVpgfRf6OCY6+NTYXbv1aXgIgJ7fsOda5I7DyPd YRH7yc816XkvkDtJuJYahBXEVBm60D+Sp60XtSiwuT29qeuNKu2OOi7WKmGv7Qizi2nLYm HkezUierujYqwKOicMUDm7JI0Xskqc+/IbTc7nPu3XOZhJHrmhwOcjFtGNvb1eEisy28CQ GFWoxaNRV9vaMfmHaX7prgpWNUZSqsvTPTWuI6A5whxZ2GISlCKTQq/FKWOi1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh61BYtzJB3; Wed, 18 Jan 2023 16:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOsmF038036; Wed, 18 Jan 2023 16:24:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOsWg038035; Wed, 18 Jan 2023 16:24:54 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:54 GMT Message-Id: <202301181624.30IGOsWg038035@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 44b254d9d329 - stable/13 - LinuxKPI: 802.11: implement cfg80211_get_ies_channel_number() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 44b254d9d32939ef223cb0e3df1ea085a3a5efd2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=44b254d9d32939ef223cb0e3df1ea085a3a5efd2 commit 44b254d9d32939ef223cb0e3df1ea085a3a5efd2 Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 01:59:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:25:46 +0000 LinuxKPI: 802.11: implement cfg80211_get_ies_channel_number() Using the previous changes implement cfg80211_get_ies_channel_number() either based on DSPARMS (or for the future HTINFO). Sponsored by: The FreeBSD Foundation (cherry picked from commit 13d87d92e401523f8d8e817720d40dc31cdfa444) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 28 +++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index e6f1bd88309d..ee6697bb4d4a 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1677,12 +1677,36 @@ cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel) return (false); } -static __inline int +static inline int cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len, enum nl80211_band band, enum cfg80211_bss_frame_type ftype) { + const struct element *elem; - TODO(); + switch (band) { + case NL80211_BAND_6GHZ: + TODO(); + break; + case NL80211_BAND_5GHZ: + case NL80211_BAND_2GHZ: + /* DSPARAMS has the channel number. */ + elem = cfg80211_find_elem(IEEE80211_ELEMID_DSPARMS, ie, len); + if (elem != NULL && elem->datalen == 1) + return (elem->data[0]); + /* HTINFO has the primary center channel. */ + elem = cfg80211_find_elem(IEEE80211_ELEMID_HTINFO, ie, len); + if (elem != NULL && + elem->datalen >= (sizeof(struct ieee80211_ie_htinfo) - 2)) { + const struct ieee80211_ie_htinfo *htinfo; + htinfo = (const struct ieee80211_ie_htinfo *)elem; + return (htinfo->hi_ctrlchannel); + } + /* What else? */ + break; + default: + IMPROVE("Unsupported"); + break; + } return (-1); } From nobody Wed Jan 18 16:24:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh75QrMz2yJRT; Wed, 18 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh72pdtz3F1c; Wed, 18 Jan 2023 16: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=1674059095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2MlkFr8/a1I8O8MjTi/BlUh4vnIaZYtTyld/m2hzYL0=; b=HfGsmE/0nUwnbKjOJkqv1Us3Q4XEI1B3bfkleAg1ZNQY77PPIInhQAl6+5nbSzTTYtnNrp jA5mF6d3JgV72xSWJVd9AQQRCNSaOibzSsZEjGX7bEqSvUqKeRx3M7rH389pc/0NNpUExb qdofax4x8E6DewLlileBLWjZYdG3jj3YJ8tBJr9VcJbeW7zI9fieqp/d7Hb+YEf7AadsAY gJPQw5emI0B4NH040VmEup7IIxuIlpm+xAjDE68VEEq7mLZO+QIylsBLG1zkEiujhAp7w0 O25PQwQuqyBhnDcpKjTOiHSJ+sFl0Wys4K0RShRPAz9JWOj5kKfPm9hAco3eEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2MlkFr8/a1I8O8MjTi/BlUh4vnIaZYtTyld/m2hzYL0=; b=VETlRV0ycVVY6O9fDOjrsGnqqvXT9BCRUvKiNSXV3GEnQRaDHnObSTZJ3Ze+9ERR2JdgxC Eg6x4BABs2RMZYh1x4ht1vuyVQXNPGif8yB6sTkhkSj9XPhKHoofyC9DLlrTfm3YONHCB0 RTFK2jpD7SApOhgVYjnlMsLziplAR1lSJJ+YVVN9JMpjzlxEaVjVpLlBHbLeUC9npyYsHd RRlGceRAyWn3dNZjFwsuhz/4Nmotn78lawvnOu+oe37RbG6Bij3wgTdeUESIlmKNuD1WZ9 wfAEa670aGm4pJnic/gBFPfp/WvtVU8YRJmAlIJnn0XT4ZcQrp1G9Tk21s6lnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059095; a=rsa-sha256; cv=none; b=K78IwPJnXnma9gdXT78v/wS37maXJpUaHArZo2xaLtELnzLiL0x6lr5r2A5dxIUGpeFnI+ IIXH2UauARBUiwvyQReeTPCqm496r3BkxccylZWEOV+Xhh3G7Yb3wkxFkq25H5fAyQxHj6 lVZFqnttUcjEZuuWk36WLx1mTdcnuKOEjoZH/qDV3HazKSayBuQ6C0LzzLMhAAFyUcT6qy UR2vhByjjlkkS66DnWcWV7sUZ2A3PzXDnUghP2Ogg+qPVoNcVEMGZaao3d9ENhIJFjtJ/L 8JuAecb7mQppFgO2gOndmgsg4r76H/+KNXvvHCxZvR0ysqAK4AjHj7JJRjW6Rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh71swYzHc0; Wed, 18 Jan 2023 16:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOt2H038060; Wed, 18 Jan 2023 16:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOtvU038059; Wed, 18 Jan 2023 16:24:55 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:55 GMT Message-Id: <202301181624.30IGOtvU038059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ca6485cbf420 - stable/13 - LinuxKPI: 802.11: implement cfg80211_{get,put}_bss List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca6485cbf42038c3575e2acaf17fb7f7b048e477 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ca6485cbf42038c3575e2acaf17fb7f7b048e477 commit ca6485cbf42038c3575e2acaf17fb7f7b048e477 Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 01:18:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:25:52 +0000 LinuxKPI: 802.11: implement cfg80211_{get,put}_bss Implement cfg80211_{get,put}_bss currently doing malloc/free bits, so hopefully the drivers get the calls right. cfg80211_get_bss() sets up a lookup structure which may also take a result (first hit wins) and calls ieee80211_scan_iterate() comparing the various values in the iterator funcion. Some of the checks are partially pointless (as it seems the drivers are not interested in these parts [ANY] but we keep them for documentation purposes should futher values arise in the future). We currently only iterate over the first VAP which will do for now. Sponsored by: The FreeBSD Foundation (cherry picked from commit 5edde07c2aba02d0f7d30bbb0f203ec3e920e273) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 51 +++--- sys/compat/linuxkpi/common/src/linux_80211.c | 194 +++++++++++++++++++--- 2 files changed, 199 insertions(+), 46 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index ee6697bb4d4a..8d69ff0891d9 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1118,6 +1118,10 @@ uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t); struct linuxkpi_ieee80211_channel * linuxkpi_ieee80211_get_channel(struct wiphy *, uint32_t); +struct cfg80211_bss *linuxkpi_cfg80211_get_bss(struct wiphy *, + struct linuxkpi_ieee80211_channel *, const uint8_t *, + const uint8_t *, size_t, enum ieee80211_bss_type, enum ieee80211_privacy); +void linuxkpi_cfg80211_put_bss(struct wiphy *, struct cfg80211_bss *); void linuxkpi_cfg80211_bss_flush(struct wiphy *); /* -------------------------------------------------------------------------- */ @@ -1189,6 +1193,32 @@ wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked, /* -------------------------------------------------------------------------- */ +static inline struct cfg80211_bss * +cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, + const uint8_t *bssid, const uint8_t *ssid, size_t ssid_len, + enum ieee80211_bss_type bss_type, enum ieee80211_privacy privacy) +{ + + return (linuxkpi_cfg80211_get_bss(wiphy, chan, bssid, ssid, ssid_len, + bss_type, privacy)); +} + +static inline void +cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss) +{ + + linuxkpi_cfg80211_put_bss(wiphy, bss); +} + +static inline void +cfg80211_bss_flush(struct wiphy *wiphy) +{ + + linuxkpi_cfg80211_bss_flush(wiphy); +} + +/* -------------------------------------------------------------------------- */ + static __inline bool rfkill_blocked(int rfkill) /* argument type? */ { @@ -1383,20 +1413,6 @@ freq_reg_info(struct wiphy *wiphy, uint32_t center_freq) return (NULL); } -static __inline struct cfg80211_bss * -cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, - const uint8_t *bssid, void *p, int x, uint32_t f1, uint32_t f2) -{ - TODO(); - return (NULL); -} - -static __inline void -cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss) -{ - TODO(); -} - static __inline void wiphy_apply_custom_regulatory(struct wiphy *wiphy, const struct linuxkpi_ieee80211_regdomain *regd) @@ -1658,13 +1674,6 @@ ieee80211_get_hdrlen_from_skb(struct sk_buff *skb) return (-1); } -static __inline void -cfg80211_bss_flush(struct wiphy *wiphy) -{ - - linuxkpi_cfg80211_bss_flush(wiphy); -} - static __inline bool cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 01263a642abd..947878449db4 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -524,31 +524,6 @@ linuxkpi_ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) return (NULL); } -void -linuxkpi_cfg80211_bss_flush(struct wiphy *wiphy) -{ - struct lkpi_hw *lhw; - struct ieee80211com *ic; - struct ieee80211vap *vap; - - lhw = wiphy_priv(wiphy); - ic = lhw->ic; - - /* - * If we haven't called ieee80211_ifattach() yet - * or there is no VAP, there are no scans to flush. - */ - if (ic == NULL || - (lhw->sc_flags & LKPI_MAC80211_DRV_STARTED) == 0) - return; - - /* Should only happen on the current one? Not seen it late enough. */ - IEEE80211_LOCK(ic); - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) - ieee80211_scan_flush(vap); - IEEE80211_UNLOCK(ic); -} - #ifdef LKPI_80211_HW_CRYPTO static int _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, @@ -4566,6 +4541,175 @@ linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *vif) ieee80211_beacon_miss(vap->iv_ic); } +/* -------------------------------------------------------------------------- */ + +struct lkpi_cfg80211_bss { + u_int refcnt; + struct cfg80211_bss bss; +}; + +struct lkpi_cfg80211_get_bss_iter_lookup { + struct wiphy *wiphy; + struct linuxkpi_ieee80211_channel *chan; + const uint8_t *bssid; + const uint8_t *ssid; + size_t ssid_len; + enum ieee80211_bss_type bss_type; + enum ieee80211_privacy privacy; + + /* + * Something to store a copy of the result as the net80211 scan cache + * is not refoucnted so a scan entry might go away any time. + */ + bool match; + struct cfg80211_bss *bss; +}; + +static void +lkpi_cfg80211_get_bss_iterf(void *arg, const struct ieee80211_scan_entry *se) +{ + struct lkpi_cfg80211_get_bss_iter_lookup *lookup; + size_t ielen; + + lookup = arg; + + /* Do not try to find another match. */ + if (lookup->match) + return; + + /* Nothing to store result. */ + if (lookup->bss == NULL) + return; + + if (lookup->privacy != IEEE80211_PRIVACY_ANY) { + /* if (se->se_capinfo & IEEE80211_CAPINFO_PRIVACY) */ + /* We have no idea what to compare to as the drivers only request ANY */ + return; + } + + if (lookup->bss_type != IEEE80211_BSS_TYPE_ANY) { + /* if (se->se_capinfo & (IEEE80211_CAPINFO_IBSS|IEEE80211_CAPINFO_ESS)) */ + /* We have no idea what to compare to as the drivers only request ANY */ + return; + } + + if (lookup->chan != NULL) { + struct linuxkpi_ieee80211_channel *chan; + + chan = linuxkpi_ieee80211_get_channel(lookup->wiphy, + se->se_chan->ic_freq); + if (chan == NULL || chan != lookup->chan) + return; + } + + if (lookup->bssid && !IEEE80211_ADDR_EQ(lookup->bssid, se->se_bssid)) + return; + + if (lookup->ssid) { + if (lookup->ssid_len != se->se_ssid[1] || + se->se_ssid[1] == 0) + return; + if (memcmp(lookup->ssid, se->se_ssid+2, lookup->ssid_len) != 0) + return; + } + + ielen = se->se_ies.len; + + lookup->bss->ies = malloc(sizeof(*lookup->bss->ies) + ielen, + M_LKPI80211, M_NOWAIT | M_ZERO); + if (lookup->bss->ies == NULL) + return; + + lookup->bss->ies->data = (uint8_t *)lookup->bss->ies + sizeof(*lookup->bss->ies); + lookup->bss->ies->len = ielen; + if (ielen) + memcpy(lookup->bss->ies->data, se->se_ies.data, ielen); + + lookup->match = true; +} + +struct cfg80211_bss * +linuxkpi_cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, + const uint8_t *bssid, const uint8_t *ssid, size_t ssid_len, + enum ieee80211_bss_type bss_type, enum ieee80211_privacy privacy) +{ + struct lkpi_cfg80211_bss *lbss; + struct lkpi_cfg80211_get_bss_iter_lookup lookup; + struct lkpi_hw *lhw; + struct ieee80211vap *vap; + + lhw = wiphy_priv(wiphy); + + /* Let's hope we can alloc. */ + lbss = malloc(sizeof(*lbss), M_LKPI80211, M_NOWAIT | M_ZERO); + if (lbss == NULL) { + ic_printf(lhw->ic, "%s: alloc failed.\n", __func__); + return (NULL); + } + + lookup.wiphy = wiphy; + lookup.chan = chan; + lookup.bssid = bssid; + lookup.ssid = ssid; + lookup.ssid_len = ssid_len; + lookup.bss_type = bss_type; + lookup.privacy = privacy; + lookup.match = false; + lookup.bss = &lbss->bss; + + IMPROVE("Iterate over all VAPs comparing perm_addr and addresses?"); + vap = TAILQ_FIRST(&lhw->ic->ic_vaps); + ieee80211_scan_iterate(vap, lkpi_cfg80211_get_bss_iterf, &lookup); + if (!lookup.match) { + free(lbss, M_LKPI80211); + return (NULL); + } + + refcount_init(&lbss->refcnt, 1); + return (&lbss->bss); +} + +void +linuxkpi_cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss) +{ + struct lkpi_cfg80211_bss *lbss; + + lbss = container_of(bss, struct lkpi_cfg80211_bss, bss); + + /* Free everything again on refcount ... */ + if (refcount_release(&lbss->refcnt)) { + free(lbss->bss.ies, M_LKPI80211); + free(lbss, M_LKPI80211); + } +} + +void +linuxkpi_cfg80211_bss_flush(struct wiphy *wiphy) +{ + struct lkpi_hw *lhw; + struct ieee80211com *ic; + struct ieee80211vap *vap; + + lhw = wiphy_priv(wiphy); + ic = lhw->ic; + + /* + * If we haven't called ieee80211_ifattach() yet + * or there is no VAP, there are no scans to flush. + */ + if (ic == NULL || + (lhw->sc_flags & LKPI_MAC80211_DRV_STARTED) == 0) + return; + + /* Should only happen on the current one? Not seen it late enough. */ + IEEE80211_LOCK(ic); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + ieee80211_scan_flush(vap); + IEEE80211_UNLOCK(ic); +} + +/* -------------------------------------------------------------------------- */ + MODULE_VERSION(linuxkpi_wlan, 1); MODULE_DEPEND(linuxkpi_wlan, linuxkpi, 1, 1, 1); MODULE_DEPEND(linuxkpi_wlan, wlan, 1, 1, 1); From nobody Wed Jan 18 16:24:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh850NHz2yJWn; Wed, 18 Jan 2023 16:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh83v0pz3F6V; Wed, 18 Jan 2023 16:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D5l2HKSo1CIQ0yZztqS7B5WCBCnuydsvqwRZJgr+bVE=; b=b8+UZzjXlHvIoHkBe1YOvrtHzwb7YuzOEe6v7dCIBVnnAqToMiJnYCoMy7HdrVzQOmQMjx hcaupHhLT3B6tvL3jBjRLk8oTof+KU9k6DMx+D2Efd4I1sHZqAp4JWUBzTdHOZRQLI9btZ qO0SVq0JWLha3wgGAKMe0SA0lP+aOKPa4cs6dIACl06i794ta9MmimdafwV7gcOmEYL4CK 6kzW6I011vEjz0uJ54SjvWGr6MFNPeQKqJbblu17Gu8oqgYZiMPBWrtcnGu6QUraCME8i+ WqZ83Hf6D84iDv6jdabvW9iKtVwXSr5e3h0nvuLQkBK4hMGFVQ/ig/zQAy5yIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D5l2HKSo1CIQ0yZztqS7B5WCBCnuydsvqwRZJgr+bVE=; b=BORPOUiK5194V1u+gPkIrWpDQt/w3xNgI36LCf0pGJ8VOZLW1gRfIK332ptvLMKOi937B5 7iO0yYmTRIUSXXJHuVetl+G0CaB/SAgJLSmGxZ9rOJaqBPh7ndZYPlQUmUoUIE9gibR31o WMYZBZ6YzorYIyncJ+PLY+LZu8OKGuwysWNgf1ysLbgkw15wcKB2JzE5Kk7PCaFn5htEuk asyWmFm/GTbcF4Tmap9l6ed8qMZEZE/q4NmaSDZM4lI7IvbyGHObb7Im4HSFg6uWWvffjT nWZkXwmNHqLPVrrH5Z9Syby34ZWRJ/3p53i+kmnA+H6UuFgoL8kPN+Y4NGTxwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059096; a=rsa-sha256; cv=none; b=vVHsFbB46WRQmcUKwy57NRHyWuEoY4Aijy+nU9QFTI2gY+4Iy5QeuL/D20nM58xRW2XXi+ RxDoJGAnZWtqMckRDzKJ1HKkSPcj+gxD1jW75hzMmbAFphy9oFlbJ26rkBvIA3MxZ4QAHc mWvIgNNR0z8zN1gSxG+WymLRwHDer6ObKkRzf6rSFUnAz3j733CYTF5OHBNbviv/otnsm1 9cwN0PgdMNiXUAn4hp3SAzHNuFunWMK4AoXsfIhx0kdv83br8KxmlQDLPLNGd1+7H3YnkT oVt9tofyRWpHpXFwL0KdDihMpIkYJIbcQTzW3I4BWJP5983KJCg2d9PS+U677Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh82z0VzHSc; Wed, 18 Jan 2023 16:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOupX038090; Wed, 18 Jan 2023 16:24:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOuoq038089; Wed, 18 Jan 2023 16:24:56 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:56 GMT Message-Id: <202301181624.30IGOuoq038089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d42205c0ba27 - stable/13 - LinuxKPI: 802.11: set sta supported legacy rates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d42205c0ba27c2d223d5dbd6bec3d30e1d4e8c45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d42205c0ba27c2d223d5dbd6bec3d30e1d4e8c45 commit d42205c0ba27c2d223d5dbd6bec3d30e1d4e8c45 Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 00:33:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:25:57 +0000 LinuxKPI: 802.11: set sta supported legacy rates When initializing the sta set the per-band supported legacy rates as some drivers take the information from there. Sponsored by: The FreeBSD Foundation (cherry picked from commit b6b352e4c7125e7d85ba382f05b1bad8454b6233) --- sys/compat/linuxkpi/common/src/linux_80211.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 947878449db4..170f6162cd6b 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -192,7 +192,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], struct lkpi_vif *lvif; struct ieee80211_vif *vif; struct ieee80211_sta *sta; - int tid; + int band, i, tid; lsta = malloc(sizeof(*lsta) + hw->sta_data_size, M_LKPI80211, M_NOWAIT | M_ZERO); @@ -216,6 +216,8 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta = LSTA_TO_STA(lsta); IEEE80211_ADDR_COPY(sta->addr, mac); + + /* TXQ */ for (tid = 0; tid < nitems(sta->txq); tid++) { struct lkpi_txq *ltxq; @@ -243,6 +245,24 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->txq[tid] = <xq->txq; } + /* Deflink information. */ + for (band = 0; band < NUM_NL80211_BANDS; band++) { + struct ieee80211_supported_band *supband; + + supband = hw->wiphy->bands[band]; + if (supband == NULL) + continue; + + for (i = 0; i < supband->n_bitrates; i++) { + + IMPROVE("Further supband->bitrates[i]* checks?"); + /* or should we get them from the ni? */ + sta->deflink.supp_rates[band] |= BIT(i); + } + } + IMPROVE("ht, vht, he, ... bandwidth, smps_mode, .."); + /* bandwidth = IEEE80211_STA_RX_... */ + /* Deferred TX path. */ mtx_init(&lsta->txq_mtx, "lsta_txq", NULL, MTX_DEF); TASK_INIT(&lsta->txq_task, 0, lkpi_80211_txq_task, lsta); From nobody Wed Jan 18 16:24:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxrh95S0Jz2yJMN; Wed, 18 Jan 2023 16:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxrh94zwFz3F6x; Wed, 18 Jan 2023 16:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wOLB1GtlC4l8JJwjJ4k6RGywJD+xqdhm6IkCvfG9kHM=; b=sprdx+7AnUMpWuYuSL2Ykj4s8LVAwwKaqQ43vxg/26AdUAqy8x5Jfqgj4qENxIv0y5GOJd Ip9OZc30fofd6b152xLplz00HcLQ1MNg4iw4mME1/LKwfYHo2KHe4NX/pFxv5DvUqlnXgR o1X/OT7xMQWVOPyNUY4ajXuiZDxwF5jZgPKpajSlOmqagyYdCq+adt9zGUOFCGZx3hZJxj 8OfN9fkN6f9xG7mR+BeXLu9DnHBd27MtMs6TAzxeyoyyx9+N+70++V5NDz7eEde7uGANOK KaK+wRE2kvXYNNSI+gZZKyBRTlj9FqsmTruw/U1vsqbgR1vNL4sZXc4PF1QEtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wOLB1GtlC4l8JJwjJ4k6RGywJD+xqdhm6IkCvfG9kHM=; b=aozowBzm/qdp7wQ7RDN2bcZcibA0QIi3Ky0KUobqsBRL/+LRBEAC87J6btAXblMx4a3nVK /ou9WQZCn+xuETKEa7HVit/w+Kxg2psEaqHSIqrgh3teSGfhM+a2VNYF7SX2KqFq6QfHnj q+RFDNEMpa1KH12yagHB6OIoWU0KlaGiYc6joIpVuolNrzwFfrIcArpvI8/S+mXgd2Au1k B9HosN32IYh0xLos0UTnFnM+ggAQpLiVA9qa9rzFuc7nIft7Xf7RoYew/vUSPrlX9ZGAGR H4x4Pl8FlPdI0hvwBnCDxUoCyCV6DDD01DIFE1oBGb21XaFkj9vGOT4W4F9+6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059097; a=rsa-sha256; cv=none; b=LAHTh/SyqgT98trwKXr5xyiLDwi/OlsS/b3KB0m7Sj3LHpsYopBZS8Q67ZdxaP3EM8iKDU nngLiqU2LtzWKgjzuKxGNRzYmDDandMJK3vr+Zk+TSuAP8Rhm7B6U5sNFgLPp3oyTEDaId LHABN2aVsOmZH3hD/Ea9pj15GW4EjxCYjHwVFQV5P8Q4WN9ZFnFkCIzCWTn5zpkn2D6LGO VLWraiZuynawY9l21i6HlEfLKs7kXslxOXwpR3UEJ9BXkqH13l3/fOi38ya+MC3jks/yZt 0gBBZHSou6m5rmwWtzYB42qpgP3fm16ikBk0FJJT7mWpl9sR3nLot/95H5/KWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxrh944wSzHSd; Wed, 18 Jan 2023 16:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOveW038114; Wed, 18 Jan 2023 16:24:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOvrR038113; Wed, 18 Jan 2023 16:24:57 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:57 GMT Message-Id: <202301181624.30IGOvrR038113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 931d322d4082 - stable/13 - LinuxKPI: 802.11: implement ieee80211_get_hdrlen_from_skb() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 931d322d40822180237329cef442278eb078b370 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=931d322d40822180237329cef442278eb078b370 commit 931d322d40822180237329cef442278eb078b370 Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 02:02:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:02 +0000 LinuxKPI: 802.11: implement ieee80211_get_hdrlen_from_skb() Implement ieee80211_get_hdrlen_from_skb() doing basic sanity checks on lengths (minimal length or skb data length vs. header length). Sponsored by: The FreeBSD Foundation (cherry picked from commit 339119949660916aa40b1d67dbe002dd7eb0d709) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 8d69ff0891d9..b5135f34981e 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1666,12 +1666,23 @@ ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) return (linuxkpi_ieee80211_get_channel(wiphy, freq)); } -static __inline size_t +static inline size_t ieee80211_get_hdrlen_from_skb(struct sk_buff *skb) { + const struct ieee80211_hdr *hdr; + size_t len; - TODO(); - return (-1); + if (skb->len < 10) /* sizeof(ieee80211_frame_[ack,cts]) */ + return (0); + + hdr = (const struct ieee80211_hdr *)skb->data; + len = ieee80211_hdrlen(hdr->frame_control); + + /* If larger than what is in the skb return. */ + if (len > skb->len) + return (0); + + return (len); } static __inline bool From nobody Wed Jan 18 16:24:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhB6sTrz2yJPG; Wed, 18 Jan 2023 16:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhB68fVz3FLY; Wed, 18 Jan 2023 16:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U8hjE1IsKIqAoEJssUUEoityHohTw/bXsOboTKINSiQ=; b=EprzeHlQkk4IH77GHf8MbBFXeFo6vFQlAOlFGrVKgHlzW5bQkDN3st5bQb4JpaTH/woF2X auY2voKxGA3ko8qqfAT9TRGIgUEx9ypoZOoAc/ob8rPNIkIFSBh0AMAEwnkBAYsdBjsscS WjJbCsNxhK+DArQ6W2j1ehOcGcm7B7E8NEZFaGvceEQNcAysIKVZg7h0wXTJUQUktFUYvg qe0iaMJ3sbo4/l7h3gFdgv10kQ/EHwFdeSj0UGQxM33rLDCX/W4FdsEBsvu5zar2NrvL6J o/xfrlrv3Plnx6yuuy97O2F08kzt+j8Q/3rERcV+lXFGn35GKkU6GrEjwTW0Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U8hjE1IsKIqAoEJssUUEoityHohTw/bXsOboTKINSiQ=; b=DMyuxQ6c4LKswAatDDlzhlL/YFFPbaJUPHswRx2P4AplKXLaJJD7pVzbiScV/uX96BOkwl vH4rfnRB2J1pbcYy4s+EHGVWz6BBbZYU+5jZaqAxLTK+URH1cd9inNF32QO6oFuHlSl5Lo 5juv88KfQZTxSs9KeEkozQ+MdEknRO1q3W/UfQfRZwPUpp4gHBlC7pGoVrpA3rTDfA9+3C nGOGn5r//vIajMGl1ZlNqdisfq5FosNxztFTFP8rSb3Yny8uWFt/4Bv1oyd6Uboq0nWvkH X0kZLwFO+qfoCt0WnJB2fZQmQfEW1UhMNEtrPy3ne5BzBzaEMfd8mcBPzBqsqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059098; a=rsa-sha256; cv=none; b=bHkf82USp9xGNJXxdhGF+GhbJE0VwP+oQLnWcLCzMUPcpmCiQeYfK1ebR9sWcfjfuj+rCh DDHIgE2ummZqmSTY7ejenXQySPbT7kMAKj6g1IFXJG/N5wSp1O385xZobqwvZyhgs2aLCk g1hQodD3v6zKdIzS87IkucooVhiy2Ld19sYU8qNRXJgZn4NENDqpn0epf4GF8DLMwSv5qv T9pFbhnmiyBH/1ek+s+eUQ4hdVY0MNix/H30y0PQya3tpZstwDNNUpPCo2/tAO79FagvCz a4HXUv6Y/Kvu1LTLneVMSjohUFB6E1HUY4QSCdgj/KImd9pz9y+PYgQYc1rrDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhB5GYRzHSf; Wed, 18 Jan 2023 16:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOwhJ038142; Wed, 18 Jan 2023 16:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOwai038141; Wed, 18 Jan 2023 16:24:58 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:58 GMT Message-Id: <202301181624.30IGOwai038141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5ba6ef0ac529 - stable/13 - LinuxKPI; 802.11: update mac80211.h structures and fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ba6ef0ac52986ec9861b9aa0a908ca50011d668 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5ba6ef0ac52986ec9861b9aa0a908ca50011d668 commit 5ba6ef0ac52986ec9861b9aa0a908ca50011d668 Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 02:15:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:07 +0000 LinuxKPI; 802.11: update mac80211.h structures and fields Cleanup some fields and structures and add new ones. Sponsored by: The FreeBSD Foundation (cherry picked from commit c990500bf1028d55cdd370037c78ea808956e0fc) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 75f2dac02be2..22b00726a727 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -224,6 +224,10 @@ struct ieee80211_chanctx_conf { uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); }; +struct ieee80211_rate_status { + struct rate_info rate_idx; +}; + #define WLAN_MEMBERSHIP_LEN (8) #define WLAN_USER_POSITION_LEN (16) @@ -557,15 +561,12 @@ struct ieee80211_rx_status { uint8_t rate_idx; }; -struct ieee80211_tx_rate_status { -}; - struct ieee80211_tx_status { struct ieee80211_sta *sta; struct ieee80211_tx_info *info; u8 n_rates; - struct ieee80211_tx_rate_status *rates; + struct ieee80211_rate_status *rates; struct sk_buff *skb; struct list_head *free_list; @@ -609,6 +610,11 @@ struct ieee80211_sta_txpwr { short power; }; +struct ieee80211_sta_agg { + /* XXX TODO */ + int max_amsdu_len; +}; + struct ieee80211_link_sta { uint32_t supp_rates[NUM_NL80211_BANDS]; struct ieee80211_sta_ht_cap ht_cap; @@ -617,6 +623,8 @@ struct ieee80211_link_sta { struct ieee80211_sta_he_6ghz_capa he_6ghz_capa; uint8_t rx_nss; enum ieee80211_sta_rx_bw bandwidth; + enum ieee80211_smps_mode smps_mode; + struct ieee80211_sta_agg agg; struct ieee80211_sta_txpwr txpwr; }; @@ -682,6 +690,7 @@ enum ieee80211_vif_driver_flags { struct ieee80211_vif_cfg { uint16_t aid; bool assoc; + bool ps; int arp_addr_cnt; uint32_t arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; /* big endian */ }; From nobody Wed Jan 18 16:24:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhD2PsPz2yJ1d; Wed, 18 Jan 2023 16:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhC6ydrz3FCr; Wed, 18 Jan 2023 16:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmxB06OSkEEONIFB2KLcDXd8m8rCx3IF6TQiqUvtmZs=; b=VSWrTAb7Sf47YaA1lKbL3GooIYplT8nmd6zmsCdnREtIHAoMXNyXRT1D+TtDxEdRw62D9s oQbd4gvkgqFE48klQznhhJ35u9b/6gXA6QnjSZXJUZqunyGkJJF1ECviI4jiy5UbTZz7oo fFa3MkOQ0qyvrHmshLSqOq1ceDJa1j4N6HJmnkqmA9B60JGdzDJP6fFXxKLaqvjhCQl21j 3ofJOEd0ejcZwvN4pvpAIRuZgUkHB4CGr6sUmAXpU392v/++VgSebpfvnWp7V58Vvxe92a FPq2PEqRaCbWV7V75G+wAhkRUPVO6AxDUUfv9O2TcRZ2D0o6MEPOMJEH2qKaAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmxB06OSkEEONIFB2KLcDXd8m8rCx3IF6TQiqUvtmZs=; b=t4s6Dwot/2VS8PeYWG5zn5LWZt/ybF/llgpP0eIO7Kba6kjoPOB//Taa81oxB0Tj7eCytv Y7gUVX4Uc09fr16Fx3Ynu9TWDadn+h0pkZxg8eEy0Xs6yeyRVN/GeIbhjSxt7QAEnDzJJ1 UWTeOyJtDFyLg5iqSGz05LoUYFZv2Vkpj1BV+FoAuNit+JMmpKyagrsgPauHC0atFhV8qz Wex3QWJjwyKNEYXQySAz+63At+fYcS6bTcJ5G/6l1QqU/CqlO9e19F5y0WpzJ5QvWzsyvJ GeaJjcEI/ZI13nTRvVrQenNhneR1xO/m/FxFOY0CGd/CUcCiI1dzIftRAZH5ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059100; a=rsa-sha256; cv=none; b=mGFaWxR2c82t12gp6IIQcEJvwtJUmNuw4T3U1XdRK2I2bIykmnq3QiLgYWhOXF7EPsHLMP 4i6XmG8Ui3oaFJ6At1FQQ6pXE+Cu6ls5OJuRlO4w9+3osyWPeP8M8GE6Na9KAYTIPT6Ktd 9gOhG4y3+fftU07DFdaivW97Yoe8zF2y2UaqihN/8txQLsONML5D9VDS5Gd9Z5MWJZGhpp rn46HwEOZdiGK1IEtTT1zNbZneLzD2voWBZghqoUUG5XsoktJw7/rxjmJCfF6QpGNmZ6Fx C9HmhtpBw7kIkKqXWfoNOFEbEqDxmb4bLd16GEApF6pdQJT6jGAFICMIpmEAIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhC63HvzJ3d; Wed, 18 Jan 2023 16:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGOxGM038172; Wed, 18 Jan 2023 16:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOx7J038171; Wed, 18 Jan 2023 16:24:59 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:59 GMT Message-Id: <202301181624.30IGOx7J038171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 43f7ed9d85ac - stable/13 - LinuxKPI: 802.11: move ieee80211_{unregister,restart}_hw out of header List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 43f7ed9d85ac42a1e9e412694b6baaa64dd966b5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=43f7ed9d85ac42a1e9e412694b6baaa64dd966b5 commit 43f7ed9d85ac42a1e9e412694b6baaa64dd966b5 Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 02:24:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:13 +0000 LinuxKPI: 802.11: move ieee80211_{unregister,restart}_hw out of header Migrate the two functions from the header into the implementation file in order to have access to more facilities and not to run into possible allocation/locking/... problems in the future. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4b0af114370a5cb876012c381d3156c8fbdf7f40) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 22 +++++++++++----------- sys/compat/linuxkpi/common/src/linux_80211.c | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 22b00726a727..230d42947e7b 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -980,7 +980,9 @@ void linuxkpi_ieee80211_iffree(struct ieee80211_hw *); void linuxkpi_set_ieee80211_dev(struct ieee80211_hw *, char *); int linuxkpi_ieee80211_ifattach(struct ieee80211_hw *); void linuxkpi_ieee80211_ifdetach(struct ieee80211_hw *); +void linuxkpi_ieee80211_unregister_hw(struct ieee80211_hw *); struct ieee80211_hw * linuxkpi_wiphy_to_ieee80211_hw(struct wiphy *); +void linuxkpi_ieee80211_restart_hw(struct ieee80211_hw *); void linuxkpi_ieee80211_iterate_interfaces( struct ieee80211_hw *hw, enum ieee80211_iface_iter flags, void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), @@ -1110,14 +1112,11 @@ ieee80211_register_hw(struct ieee80211_hw *hw) return (error); } -static __inline void +static inline void ieee80211_unregister_hw(struct ieee80211_hw *hw) { - wiphy_unregister(hw->wiphy); - linuxkpi_ieee80211_ifdetach(hw); - - IMPROVE(); + linuxkpi_ieee80211_unregister_hw(hw); } static __inline struct ieee80211_hw * @@ -1127,6 +1126,13 @@ wiphy_to_ieee80211_hw(struct wiphy *wiphy) return (linuxkpi_wiphy_to_ieee80211_hw(wiphy)); } +static inline void +ieee80211_restart_hw(struct ieee80211_hw *hw) +{ + linuxkpi_ieee80211_restart_hw(hw); +} + + /* -------------------------------------------------------------------------- */ static __inline bool @@ -1830,12 +1836,6 @@ ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb) linuxkpi_ieee80211_free_txskb(hw, skb, 0x455458); } -static __inline void -ieee80211_restart_hw(struct ieee80211_hw *hw) -{ - TODO(); -} - static __inline void ieee80211_ready_on_channel(struct ieee80211_hw *hw) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 170f6162cd6b..ee4b58e60f4d 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2345,6 +2345,23 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], return (vap); } +void +linuxkpi_ieee80211_unregister_hw(struct ieee80211_hw *hw) +{ + + wiphy_unregister(hw->wiphy); + linuxkpi_ieee80211_ifdetach(hw); + + IMPROVE(); +} + +void +linuxkpi_ieee80211_restart_hw(struct ieee80211_hw *hw) +{ + + TODO(); +} + static void lkpi_ic_vap_delete(struct ieee80211vap *vap) { From nobody Wed Jan 18 16:25:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhF2LGZz2yJS2; Wed, 18 Jan 2023 16:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhF0mcsz3FPX; Wed, 18 Jan 2023 16:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJXA6E/8vg86uMSDHXiD44gq19n4D3QIAVrUrDrXeCU=; b=oEY5yyPIxRDzTPkPQs3Um05nFOW7KTI2fc7G+gmeR30vo0Erjp01sqWIZv4SjWuLCwPtcf QHoBGKTueQKlKeZKe9X4m/qEqkxWJrr5mxPe6KtjaJ9g7kGEryBbKbPuPSCAR+fgpw5dW+ r2x8e+C0pMwVerJm3F2sMyC3x3tYAiM6V4pbSQJ+1BEFOnHT3Bn9ThZTR7vHYz98z3xMm7 sZI22oQRilQD6twQZJ3A7Bn++qPn2DtLbrvtRj13h4FkFTJJJ1X1IjaImFHqm3gqxvJEhb s1/Rf8S8UMtWD3GgaVXSHI1ZvniSUFE07fN1+6hO7N+TfrkvI6F5lqWtTDC70g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CJXA6E/8vg86uMSDHXiD44gq19n4D3QIAVrUrDrXeCU=; b=hDvL70HqWNBuBWNonxQI9ZeQ/Ue/ZNRHqCdh/pR4QMrJm4tc9g2RwuT8/eKd4RlSbac6hr hSlB2TAYC15MuSgHXol569B2syIomolhIn9WgPViOREuSCpP1LspxrWBo3+0wzeYErRChb iJO0Mphd+EhAFktMF/4s888QSAjUrG7BQikqGqaLLlO28VQjTKV5K5RdREF3G1pjBMSIqs KBwPW/+H1cZBELfi2NThmmxgkQzrRu3y5IAhydZ2lh+VW7b0LfejfJBe/cdq43QooaIDZA JS+0tPlOFAjSaO3EX4x2FzF2dAddTv+9ZkvGr3uLU+Nf+gjZc7CpHE24pBQ4lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059101; a=rsa-sha256; cv=none; b=unFepYg+vL1W16vYQMMCtwdgvnJLPXgRlIAHCovyOboRpcfA5nWmcwK0QTffCAa78/9ZbL Sch8hJcvK9j6vtpDB9CzVw6GL7nCP3PayZgN00Ctx6QUWcpBGn5OJLu2UalJaq7uEdM7Fv ZVsxn/8i85hbZTx9C17WyC6RlXMgnSz1vRFy4eJIwTmtfHT5z3WHO9NDIdf00hJiKPF1Qi qCcneA/JjZ+DvtjnOUMjpGoM8CCuxWHQpogjWHa9yJNCwWK2fbQ/QdBfXUbJpDpdXVOOwJ 3OZPO6J5/qNCTHafvytDEXOIMcXtEWH3sGlazYnblkpDyi8vqJ+jpILp+x5Jyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhD70M1zJB4; Wed, 18 Jan 2023 16:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP08h038202; Wed, 18 Jan 2023 16:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP0Hg038201; Wed, 18 Jan 2023 16:25:00 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:00 GMT Message-Id: <202301181625.30IGP0Hg038201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ba26206ad9e3 - stable/13 - LinuxKPI: 802.11: implement some *eleme/ie* lookup functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba26206ad9e34af730095f5e20f3ecf517dbd89c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ba26206ad9e34af730095f5e20f3ecf517dbd89c commit ba26206ad9e34af730095f5e20f3ecf517dbd89c Author: Bjoern A. Zeeb AuthorDate: 2022-12-31 01:33:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:21 +0000 LinuxKPI: 802.11: implement some *eleme/ie* lookup functions Implement cfg80211_find_elem(), ieee80211_bss_get_elem(), ieee80211_bss_get_ie(), and cfg80211_find_vendor_ie() with the last one having a short cut always also checking oui_type in the pattern. Sponsored by: The FreeBSD Foundation (cherry picked from commit 5db817d864241232c51d654836996282c69f5e28) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 76 +++++++++++++++++++---- sys/compat/linuxkpi/common/include/net/mac80211.h | 14 ----- 2 files changed, 65 insertions(+), 25 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index b5135f34981e..55a74227a338 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1321,13 +1321,75 @@ struct element { uint8_t data[0]; } __packed; -static __inline const struct element * -cfg80211_find_elem(enum ieee80211_eid eid, uint8_t *data, size_t len) +static inline const struct element * +lkpi_cfg80211_find_elem_pattern(enum ieee80211_eid eid, + const uint8_t *data, size_t len, uint8_t *pattern, size_t plen) { - TODO(); + const struct element *elem; + const uint8_t *p; + size_t ielen; + + p = data; + elem = (const struct element *)p; + ielen = len; + while (elem != NULL && ielen > 1) { + if ((2 + elem->datalen) > ielen) + /* Element overruns our memory. */ + return (NULL); + if (elem->id == eid) { + if (pattern == NULL) + return (elem); + if (elem->datalen >= plen && + memcmp(elem->data, pattern, plen) == 0) + return (elem); + } + ielen -= 2 + elem->datalen; + p += 2 + elem->datalen; + elem = (const struct element *)p; + } + return (NULL); } +static inline const struct element * +cfg80211_find_elem(enum ieee80211_eid eid, const uint8_t *data, size_t len) +{ + + return (lkpi_cfg80211_find_elem_pattern(eid, data, len, NULL, 0)); +} + +static inline const struct element * +ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid) +{ + + if (bss->ies == NULL) + return (NULL); + return (cfg80211_find_elem(eid, bss->ies->data, bss->ies->len)); +} + +static inline const uint8_t * +ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid) +{ + + return ((const uint8_t *)ieee80211_bss_get_elem(bss, eid)); +} + +static inline uint8_t * +cfg80211_find_vendor_ie(unsigned int oui, int oui_type, + uint8_t *data, size_t len) +{ + const struct element *elem; + uint8_t pattern[4] = { oui << 16, oui << 8, oui, oui_type }; + uint8_t plen = 4; /* >= 3? oui_type always part of this? */ + IMPROVE("plen currently always incl. oui_type"); + + elem = lkpi_cfg80211_find_elem_pattern(IEEE80211_ELEMID_VENDOR, + data, len, pattern, plen); + if (elem == NULL) + return (NULL); + return (__DECONST(uint8_t *, elem)); +} + static __inline uint32_t cfg80211_calculate_bitrate(struct rate_info *rate) { @@ -1439,14 +1501,6 @@ wiphy_read_of_freq_limits(struct wiphy *wiphy) #endif } -static __inline uint8_t * -cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, - uint8_t *data, size_t len) -{ - TODO(); - return (NULL); -} - static __inline void wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef) { diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 230d42947e7b..d548b9bb956f 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2183,13 +2183,6 @@ SET_IEEE80211_PERM_ADDR (struct ieee80211_hw *hw, uint8_t *addr) ether_addr_copy(hw->wiphy->perm_addr, addr); } -static __inline uint8_t * -ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid) -{ - TODO(); - return (NULL); -} - static __inline void ieee80211_report_low_ack(struct ieee80211_sta *sta, int x) { @@ -2368,13 +2361,6 @@ ieee80211_tx_status_ext(struct ieee80211_hw *hw, TODO(); } -static __inline const struct element * -ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid) -{ - TODO(); - return (NULL); -} - static __inline void ieee80211_color_change_finish(struct ieee80211_vif *vif) { From nobody Wed Jan 18 16:25:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhG3w7vz2yJg5; Wed, 18 Jan 2023 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhG1YCYz3FZn; Wed, 18 Jan 2023 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzthT3G7oLash7aCHS22CUvenm7LRboCsmTeWvjpxoI=; b=PTf6mNT+vWJoEKkU2H4UltUqa7BAUMnwjaWZFQh/HBGRSVe/1AEScrSpLsi+W5RD6+eJcv +YzwK6uhr2lbETySLk0D6oQ1GaHn1dIcDFZCMIU1c7qaBuSQpioHBD4XptiHjc9KGQbETf WYESNe17ja8FWSW+9+SXSKceU4/NoxCIgAQnOFEj/3yzjZ8MJXmK34z9vZKU5XDLn2kqkn s5t38eNG6dBMXZNTpwGp1sfQ9xJM5fbMC4DZUuoWaKxNagi/mgUe7pc6XthM4mcXcPzoKz 69Id5lkMTTnouV8fu5/ha9DdhM1ZLY5QdUbMduHSTEOw4fx/2y4bsdlsRATymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzthT3G7oLash7aCHS22CUvenm7LRboCsmTeWvjpxoI=; b=VIwxiHvS6qIF+hQbehhsVgo4GsW3x+7qh3GxRgRTU0hTcCnH6vcK7s1RSxKYHHQtzcUnfj Frp/nPB/BbfFhT5LC3O2e0ZeWjcF8o2c2Nzv7lCvEVMsWl7Jhso+dIj8h4nGclMFIjI7vo w5J01yl+wzT42zvXAuwXfvGCkPTXiZ7fYNEhUB4FC9VJbNMikJ7xqYHFgugKh65G5+VU+8 Mhe41HDrTHihXmA2FSr3DU4+HQbC8r0SjDhThGcG+3wdGjQvC+aHrhMtM/1htZA2IxEdBV RGLGpYvnVHFWCqDALvR5jpROKg8jcU0EwypRWtgPxaTG9Itp8iF2FQkcrVveUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059102; a=rsa-sha256; cv=none; b=p8rdhbdR4f+fmgjMYpoyKzG5aR/uiuvAC486+K7AgkQ/a6dUMcrtgHtQbVcz75t1cweFHb obBdV5sJKfGA7NL1zfPSftTxv3dMxmeyzzTVzVN/QuhATlqTPagcGPIPAWILYnUap3xVaL bZDpUqCoY+cE3WSaQZ+564xCQP/x2ppzP/y5hhxQUI99IiGitHoI/ZhTz3grPeCaoRk9PH LsMJDZv5moQ1U3owYfe4cuilR/5QLas1pjterdSW9xbxVmc6sBhfW7TWQOk7qzGjAYt0rd Uiwqpw0w178a7gfFtr/Y5Kc5Qq+djjQEijvaF97j6XhdfUYb6zmeV1/5wA5Pbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhG0NvPzJB5; Wed, 18 Jan 2023 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP1Zf038233; Wed, 18 Jan 2023 16:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP1iQ038232; Wed, 18 Jan 2023 16:25:01 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:01 GMT Message-Id: <202301181625.30IGP1iQ038232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a96d4c86f1d4 - stable/13 - iwlwifi: mark a declaration for a non-existent 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a96d4c86f1d4e22182bc8b5de92ac84a1e1dff22 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a96d4c86f1d4e22182bc8b5de92ac84a1e1dff22 commit a96d4c86f1d4e22182bc8b5de92ac84a1e1dff22 Author: Bjoern A. Zeeb AuthorDate: 2023-01-13 01:00:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:26 +0000 iwlwifi: mark a declaration for a non-existent function iwl_trans_pcie_send_hcmd() does not seem to exist (anymore). Mark it as __linux__ so we can submit the cleanup with the next upstream run. Sponsored by: The FreeBSD Foundation (cherry picked from commit f797d5f37089de8134b4599bb033635ac7d07bef) --- sys/contrib/dev/iwlwifi/pcie/internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/pcie/internal.h b/sys/contrib/dev/iwlwifi/pcie/internal.h index f7e4f868363d..cd2fb7811e4e 100644 --- a/sys/contrib/dev/iwlwifi/pcie/internal.h +++ b/sys/contrib/dev/iwlwifi/pcie/internal.h @@ -526,7 +526,9 @@ void iwl_trans_pcie_txq_set_shared_mode(struct iwl_trans *trans, u32 txq_id, int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, struct iwl_device_tx_cmd *dev_cmd, int txq_id); void iwl_pcie_txq_check_wrptrs(struct iwl_trans *trans); +#if defined(__linux__) int iwl_trans_pcie_send_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd); +#endif void iwl_pcie_hcmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb); void iwl_trans_pcie_tx_reset(struct iwl_trans *trans); From nobody Wed Jan 18 16:25:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhJ4Prwz2yJcw; Wed, 18 Jan 2023 16:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhH2TXYz3FjH; Wed, 18 Jan 2023 16:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGoFyAC4YgdRYoXf4J4vthg0MrtKVF0wA+Kg5G640NE=; b=eQlsFIsvXh0ZRwRsnOdl13HyTPP6hC3bQjnGpogVy6apvtJ8wa1NgOz5B4nai+DS6Fq0ZJ ZHnO1ors6ssO9OK/sgBkpIwYIpMOOmwSSmpHzIVYzom6jeGu1fUT9GTuvPZH8F+iDVFvGJ HYNVnQ46ng0js87s9QfYX1ZabIauxSoUcdKR8usC+7Wg+VGByv0S5ugcBZ49c5I1gWMl0D mtzx9YrXlFh+3NsfXs3sR1A1L2GQA4tzwEPx/k7hMuExTs+UWJj3bO+kWq8If5rntGZvTs z1PBFmOPnCg/Od0vRWwe36koVrwSpHtg7aclimUZF/02NF5gNxnLx8BwGyWu5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGoFyAC4YgdRYoXf4J4vthg0MrtKVF0wA+Kg5G640NE=; b=G9A97lZlRYYSKq27RxHo0PMOFg47wRgJ8HS7nE9TQ7a48jakUMo8gSN/g4wMdEv+FN4q4l FiiGvQAajDqSVg/1DrBvw6ro0q68KlV3Fvs8KOOKzJD5WXWdFmjJsF1DSoM3heJ2yVRojk 9nF3eikL5ODy5V3zqGCTHMW4KW2jmn4LHgaLV4NBVyGyLpkMc+zYhm+Kq5mrjfrGJ5kj9A vI/PfU3rZI9XRWkcyMSmvuTYUp8sWbDpXw+Xhb1dfGeS2aZFJklMWmgmODRj2sQeKTqnqs gRCF5THrJIOWz1x8msccL9o0mDUa/rYmSz0WVT4CEV2UulYK7Ne7J3UVNVddjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059103; a=rsa-sha256; cv=none; b=w4Qo3nxdWaB9w+3smfDYLX0dXVGNfv3cIMpWyej+57vlr3NJ2UQKEwyPEJHrUxZDFtrplx MGVdjYiMXMMSjsfVZq9bQBNQgO6k7vGRmyuZRZ2QjNwEl41d/alP9ewjj4KAfXurD+xetL pFS+hdj1MB0xfD6yIhcV+ICJyHnFEd/jjxDWuoG9X1T7mKl8XhX59ZlaJ+ILfCOLoZsZeR 9yV8EyYEACQjv4TV3yeI9MOkf/lqQmlbadoj/Isk3y2juALrK0N3hJaE+pikxtVux36HZJ wayFWshLzTQeV2pF5qFiIIOrWzACBIhGZmGjOZVE3oNzsYnajr7PfxqyqbRacQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhH1KNSzHSg; Wed, 18 Jan 2023 16:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP3eM038257; Wed, 18 Jan 2023 16:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP3u9038256; Wed, 18 Jan 2023 16:25:03 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:03 GMT Message-Id: <202301181625.30IGP3u9038256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4c7aee8a7009 - stable/13 - rtw88: use #define for NL80211_BAND_2GHZ instead of hardcoded number List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c7aee8a700974218831d5ad1e04a6b4f42c7e2e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4c7aee8a700974218831d5ad1e04a6b4f42c7e2e commit 4c7aee8a700974218831d5ad1e04a6b4f42c7e2e Author: Bjoern A. Zeeb AuthorDate: 2023-01-13 01:05:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:32 +0000 rtw88: use #define for NL80211_BAND_2GHZ instead of hardcoded number Use NL80211_BAND_2GHZ instead of a hard coded 0 as array index for the band. While LinuxKPI provides a KPI compatibility some of these values may not necessarily be KBI compatible (in this case they shoule be so this is a NOP) and after all it is better style. No functional change. (cherry picked from commit 8aaefd0512daea0f9869cd2fe3cee9443d5fb6aa) --- sys/contrib/dev/rtw88/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/dev/rtw88/main.c b/sys/contrib/dev/rtw88/main.c index 35381a35f5d9..deac3564d847 100644 --- a/sys/contrib/dev/rtw88/main.c +++ b/sys/contrib/dev/rtw88/main.c @@ -1189,7 +1189,11 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si, RA_MASK_OFDM_IN_HT_2G; wireless_set = WIRELESS_CCK | WIRELESS_OFDM | WIRELESS_HT; +#if defined(__linux__) } else if (sta->deflink.supp_rates[0] <= 0xf) { +#elif defined(__FreeBSD__) + } else if (sta->deflink.supp_rates[NL80211_BAND_2GHZ] <= 0xf) { +#endif wireless_set = WIRELESS_CCK; } else { ra_mask &= RA_MASK_OFDM_RATES | RA_MASK_CCK_IN_BG; From nobody Wed Jan 18 16:25:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhL2QxVz2yJY2; Wed, 18 Jan 2023 16:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhK3tsFz3FgB; Wed, 18 Jan 2023 16:25:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IwecL/Mkv/8Y5qiBCQKib1p5lnsULQ3G++GR42qcS9k=; b=OSwv0HVn/2eox+QOKRpRvUalxKS9MBh7NM8wQCSqIv0FEuG/UgQ+zbW5lbHV2pBNCl16NR mGpxYLM3OAhO+feNhd317heSLdK8f3GcY9Sa9zpWzcbuSJhaOk+WvLb7G8FoONO1G2iu9B ru1ZjNMnafBtlxW/NT2DpvHhLfREmgsbPFPsFrmDJ7lhLAkEtqtBjThC+z+0l9AQWKUk2M kzPjtqiq8MJezXKSY1v4zA/RA0y8VvKNj2o+HkMah5tY36mOwv7N/1/euEs+cd4bWA/b8n lrOZ+k6w+I2AEBQZs4gUEBhgS/dUe2XJjKmt5XHjDsqxpW2ai4RmWaQbk5THqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IwecL/Mkv/8Y5qiBCQKib1p5lnsULQ3G++GR42qcS9k=; b=PvJrwRSWOsG5bCatXvK8GFo2jMiRIr6vV45yD7vZNI5hjz+vv26kz1vg04Z3iwmAPr5eyR 2mzBVBFTHRC+1HHujh9Xzygx+jJJMU02wftRYhh/ZzlBhYSghhoiHLzIqya0dFRFQUDmJP pVkrM06r00WadktAf69mVLoIvdMwFZdXB6yfZvfoYJ6dGzbvFRgtyHPhpzmdYK8bFfGT97 80FkUqagg19t5M8xQHOwW8DrPofNfI3wchJCc452vHLi5lf+Se1zo08y2/wjJs5b2vhq+O Syeq3UECS/Cvb4mqTRV5OssPMGryNXe6rMr2oCVDh1oAOm4SqDACHdTEozno4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059105; a=rsa-sha256; cv=none; b=s/eP4t+ie1ugkLGMOKkbuUa9BxTD1tZDXTpUBBRp9NZ0HQ0p+xFZArYI9mvMZ6t8Rkj8Cm LlFRMMuT4GhiFXwKO7FeSnKsa2pV1k49B2QgXPzgLV3hY9XCL9JCLIghTAL9OV7OvUeJ6R 9TO1Y113Q2CWcERSIcQ+36S+MVWAve6HwgHpJwldzo7OrlQaO0jE7/Xh7qPQnFi/7w3BTM bM3iL9uRCIqGPfI0nocbz+rSGJiu1AUqbg/akvke9oaodRSe9b2Y003KVQ8TXVvZkGHBGU HT89f3trk53lJxUgDRIiwhloUYAaBTf5LBjj3HBusJQkbUwG3OXMO1CNStnIgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhK2yPdzHc2; Wed, 18 Jan 2023 16:25:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP5dZ038306; Wed, 18 Jan 2023 16:25:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP5N5038305; Wed, 18 Jan 2023 16:25:05 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:05 GMT Message-Id: <202301181625.30IGP5N5038305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3292a54f1ba9 - stable/13 - LinuxKPI: fix pci_alloc_irq_vectors() for MSI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3292a54f1ba9ccbc18e15290eb35665dc964b1c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3292a54f1ba9ccbc18e15290eb35665dc964b1c3 commit 3292a54f1ba9ccbc18e15290eb35665dc964b1c3 Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 18:05:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:44 +0000 LinuxKPI: fix pci_alloc_irq_vectors() for MSI pci_alloc_irq_vectors() is given a min and max vector value. pci_enable_msi() will always succeed independent of these arguments as it does not know about them. Further it will only ever allocate 1 "vector" not supporting any other amount. So upfront check that (a) the available pci_msi_count() can satisfy the requested minv and (b) given the pci_enable_msi() hard coded limit check that minv is not larger than 1. If we cannot satisfy either requirement return an error. This fixes problems with drivers which check that the returned value of allocated "vectors" will match their requests and only otherwise try to fall back to ask for 1 or deal otherwise. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky (earlier version) Differential Revision: https://reviews.freebsd.org/D37522 (cherry picked from commit e9715b1c4474333ff119aba3a9a74bff91f72372) --- sys/compat/linuxkpi/common/src/linux_pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index b0820c9b2c3e..a9c859d29623 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -928,6 +928,11 @@ out: return (pdev->dev.irq_end - pdev->dev.irq_start); } if (flags & PCI_IRQ_MSI) { + if (pci_msi_count(pdev->dev.bsddev) < minv) + return (-ENOSPC); + /* We only support 1 vector in pci_enable_msi() */ + if (minv != 1) + return (-ENOSPC); error = pci_enable_msi(pdev); if (error == 0 && pdev->msi_enabled) return (pdev->dev.irq_end - pdev->dev.irq_start); From nobody Wed Jan 18 16:25:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhL2hQYz2yJNS; Wed, 18 Jan 2023 16:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhJ46sdz3FdL; Wed, 18 Jan 2023 16:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bOrLOlMwwooxrqFSe4MVbTOeyrHb8AIGtIguwckbEQ=; b=xASR3k5cWG1O6Jtl0OozqaHOI1ZG1REvua5nn9BdDfQWe6q7FSbd6xGRID4PJMQL3ug7ET 70stmKvnb2ReCcWsQmFu1tLa20m5j4lFs5P2FqAmClemQf7Ktt/Suo25smhFXD8qi7qL81 J67376XhRnCVN917YSsUnYCAvP8EhsEfV3EQqWiTTj7CYb4WaGGhBdU3mmunApkDSTzFr1 6fzDnHNK53cWtRQaY8FUfj+YMvs+2c3vKbIZE7CZClC4rksaNbbBWVwUgxdsnc7++W9qFy jd00E5pMdgc806KX6htV9vl2GxH2aMIk9jogzR0vPylah75wzuP0ytDXreLEBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bOrLOlMwwooxrqFSe4MVbTOeyrHb8AIGtIguwckbEQ=; b=wAoZGx85Q4/9vGZyBzf5SQrqZXn7OQDj5zFkbIlP7ue4CdrMTEDjzZ/vqKJW/aIP9Daep1 cWHzBgHDwnvIeZavQRv04nDutUyik9nclpE+7XVmKb05V4ZnH57X3PnbQ0QiKJAbrGZVhx sGuiAiMSAuiVgHzW+iAESK+SeN7DhHH55NuHQuASPmC2EPieaKFgRPX1IIu/m+nOxuby67 lgJ+Vy2yN8TEwgsbA4NzPFlkSchZbBSbh8O/fRF5+bKDRo9EilbMi8USkK4E03Pf3WE8I2 DR7ssjYl3XNW7U8VY6Y2Ks9+5NrIfRNHdK9CNCwSNMFgnRCcXffd+evRvGy4IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059104; a=rsa-sha256; cv=none; b=hXom7I10HMN9KSulflHJ70bzXKCtn3JEN5e6VVQEGfLvSNx6Um9K2Dui3KqWiIzSY8MeW4 hZSHSGtMF2IuOM8QIEMKy4DtdeoZziaPSNmqIqpUaoChDxSoDJX1NUVtHJNBG9IEq+9eUI RSfElsvZtk+fs1hUYG9wuTqWPHq5NYaq0e4iybfC+u+I0PbvuXwzwO9ebwZ1VGgnbOY2Ix /ptxkW5fLpbuUz+yCfIOwFzX6QVu0amaXtf6xCeHdOmD6Z+6LqxeUHwidVNmuIIYNgj2YS ldr9SeQ69t3BYvi5GUp7M7SxaHt9oJ8QE2CkiSU3UP1NIjoesZbm2NVoiZyX7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhJ2nQ3zHc1; Wed, 18 Jan 2023 16:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP4xw038282; Wed, 18 Jan 2023 16:25:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP42c038281; Wed, 18 Jan 2023 16:25:04 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:04 GMT Message-Id: <202301181625.30IGP42c038281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b1479a5409cf - stable/13 - LinuxKPI: add kstrtou32_from_user() and mac_pton() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1479a5409cfe186b45322dbed034f024bfc6ed0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b1479a5409cfe186b45322dbed034f024bfc6ed0 commit b1479a5409cfe186b45322dbed034f024bfc6ed0 Author: Bjoern A. Zeeb AuthorDate: 2022-10-22 18:02:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:37 +0000 LinuxKPI: add kstrtou32_from_user() and mac_pton() While here: - fix an argument of kstrtouint_from_user() to correct signedness. - make kstrtou32() call kstrtouint() to avoid duplication (keep inline function) Add kstrtou32_from_user() based on other examples in the file making it a copy of the now fixed kstrtouint_from_user(). Also add a rudimentarily hacked up version of mac_pton() which is leanient accepting non-well-formed input but so far only with ':' separators. It does not seem to obviously belong to any networking header file so add it here. Both new functions are needed for debugfs support for iwlwifi hence coming together in one commit. Sponsored by: The FreeBSD Foundation Commented on by: emaste Differential Revision: https://reviews.freebsd.org/D37088 (cherry picked from commit f82cf28b317b6b3ffd1418ab9c5b230145da8f75) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 65 ++++++++++++++++++----- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 2c40b2f33c41..f3078d94b2b5 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -437,19 +437,8 @@ kstrtou16(const char *cp, unsigned int base, u16 *res) static inline int kstrtou32(const char *cp, unsigned int base, u32 *res) { - char *end; - unsigned long temp; - - *res = temp = strtoul(cp, &end, base); - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - if (temp != (u32)temp) - return (-ERANGE); - return (0); + return (kstrtouint(cp, base, res)); } static inline int @@ -530,7 +519,7 @@ kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, static inline int kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, - int *p) + unsigned int *p) { char buf[36] = {}; @@ -543,6 +532,14 @@ kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, return (kstrtouint(buf, base, p)); } +static inline int +kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, + unsigned int *p) +{ + + return (kstrtouint_from_user(s, count, base, p)); +} + static inline int kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *p) @@ -716,6 +713,48 @@ hex2bin(uint8_t *bindst, const char *hexsrc, size_t binlen) return (0); } +static inline bool +mac_pton(const char *macin, uint8_t *macout) +{ + const char *s, *d; + uint8_t mac[6], hx, lx;; + int i; + + if (strlen(macin) < (3 * 6 - 1)) + return (false); + + i = 0; + s = macin; + do { + /* Should we also support '-'-delimiters? */ + d = strchrnul(s, ':'); + hx = lx = 0; + while (s < d) { + /* Fail on abc:123:xxx:... */ + if ((d - s) > 2) + return (false); + /* We do support non-well-formed strings: 3:45:6:... */ + if ((d - s) > 1) { + hx = _h2b(*s); + if (hx < 0) + return (false); + s++; + } + lx = _h2b(*s); + if (lx < 0) + return (false); + s++; + } + mac[i] = (hx << 4) | lx; + i++; + if (i >= 6) + return (false); + } while (d != NULL && *d != '\0'); + + memcpy(macout, mac, 6); + return (true); +} + #define DECLARE_FLEX_ARRAY(_t, _n) \ struct { struct { } __dummy_ ## _n; _t _n[0]; } From nobody Wed Jan 18 16:25:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhM4PFdz2yJYC; Wed, 18 Jan 2023 16:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhL4zC2z3FXM; Wed, 18 Jan 2023 16:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxRiSTPY4RhRZIhxKXr34NlhXd8gsEXfXSrVdRABJVY=; b=aagI4HA+EwsSME+/QNEL5R4wXLx7SCze+ljEZeEshcpIqkl7/UDU6mfXJ/+qR34yFkoeTg eLXndN/DTG6EPUan+rGKKSHjEOydRCEARsXU//f4vINhIMJo0qhEtjeSaFM/t0eLurN6z0 W2XExixQVIrh1shSgRxpuh6WmsCG81TiC45NTzQq/HLlFfYQDRxFA5JDz9nloNncfntHCO 8T1tfiUSa/8D2UgYrss0jQ6ieQSzyslTqxKAj+a6qYIazB8T5gAylBcgqm23YXftw+Uo7q jpHjEv48lpy37S5+lv2AAHmrviVGugDLiP8G8S1uI10k20eAVwJIwlKKrOcngg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxRiSTPY4RhRZIhxKXr34NlhXd8gsEXfXSrVdRABJVY=; b=Q/T8zrhRgBmKWY4gNMcG6szIx3GzO6not9acEEUT7cDpK8Tcic9H2zWnnvHCLuLuAdiArh kTqdf5CiEjrKpcA/fY2pv62TrL2U8YK0BWzZWbg0BTfU1i/JU/UpG6JBcZ7d9G0N3iyS+E 5DMJseQIxzAvSZO9ymNqhkWY9xgHi49k8kEaHKXc+F1cAcYR/lwXFh3DPsQgCSO4hkhJcF TDBFmbIkKWjFLCCaYqC7SpyTVXQKfUcR3Yv+IBOTraYgxBKux/LM3ZIGWfI4WGiML2mxj7 YjDPeS6XhF9Glq+AWI7NDWqG4yBi0i+UBGK9uFBrOaEylzA9DHA2L8EYXrSYsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059106; a=rsa-sha256; cv=none; b=StfmCDdKmCMltlv8W+LbkhJO1Wi5pnXQ/u2v2tJZj1TwpsAfUqClDqxi+FzyyhOnBX+YNd fZ4YYB6yBPrmbi8YEbN5a1lq3WxrbTNKkb382MA6g6Y80Bedb0PoigB4tIevhuXhLpeVZL 2tVDqrFbbA3FaL5esCMNe6ml4N2lHe+bLh8j+UvMPWlcsRnqOgJd2g9akxFssSO/3E1hn3 KkPnZF/DPcl3nCvCDpRHGGF5Rt4JNb17AToyO350Vs8tPpxeqFBfBzjNtQPwJku0zQW6TY Cqxb1X31ZKNEzn5c2YYan0DdAAkxxWeKHN5etjAw4yflpUAfh3+DePI4DdMs2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhL4298zJB6; Wed, 18 Jan 2023 16:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP6MM038330; Wed, 18 Jan 2023 16:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP6qb038329; Wed, 18 Jan 2023 16:25:06 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:06 GMT Message-Id: <202301181625.30IGP6qb038329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0b0eb6b1e6a3 - stable/13 - LinuxKPI: pci: add [linuxkpi_]pci_get_device() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0b0eb6b1e6a30495e9bc5991e56ca0221a9730c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0b0eb6b1e6a30495e9bc5991e56ca0221a9730c8 commit 0b0eb6b1e6a30495e9bc5991e56ca0221a9730c8 Author: Bjoern A. Zeeb AuthorDate: 2022-12-02 22:14:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:51 +0000 LinuxKPI: pci: add [linuxkpi_]pci_get_device() Add a version of pci_get_device() as linuxkpi_pci_get_device() not (yet) supporting the last argument. Due to conflicts we cannot redefine it as we would normally do in LinuxKPI so drivers have to be adjusted. Differential Revision: https://reviews.freebsd.org/D37593 (cherry picked from commit 8f61992d7cc1108cebc1337451a15a0af420984c) --- sys/compat/linuxkpi/common/include/linux/pci.h | 14 ++++++++++++++ sys/compat/linuxkpi/common/src/linux_pci.c | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index f870b039254c..de041fa966ea 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -358,6 +358,7 @@ void lkpi_pci_devres_release(struct device *, void *); struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size); struct pcim_iomap_devres *lkpi_pcim_iomap_devres_find(struct pci_dev *pdev); void lkpi_pcim_iomap_table_release(struct device *, void *); +struct pci_dev *lkpi_pci_get_device(uint16_t, uint16_t, struct pci_dev *); static inline bool dev_is_pci(struct device *dev) @@ -1579,6 +1580,19 @@ err: return (-EINVAL); } +/* + * We cannot simply re-define pci_get_device() as we would normally do + * and then hide it in linux_pci.c as too many semi-native drivers still + * inlucde linux/pci.h and run into the conflict with native PCI. Linux drivers + * using pci_get_device() need to be changed to call linuxkpi_pci_get_device(). + */ +static inline struct pci_dev * +linuxkpi_pci_get_device(uint16_t vendor, uint16_t device, struct pci_dev *odev) +{ + + return (lkpi_pci_get_device(vendor, device, odev)); +} + /* This is a FreeBSD extension so we can use bus_*(). */ static inline void linuxkpi_pcim_want_to_use_bus_functions(struct pci_dev *pdev) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index a9c859d29623..54780adfda14 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -273,6 +273,23 @@ linux_pci_find(device_t dev, const struct pci_device_id **idp) return (NULL); } +struct pci_dev * +lkpi_pci_get_device(uint16_t vendor, uint16_t device, struct pci_dev *odev) +{ + struct pci_dev *pdev; + + KASSERT(odev == NULL, ("%s: odev argument not yet supported\n", __func__)); + + spin_lock(&pci_lock); + list_for_each_entry(pdev, &pci_devices, links) { + if (pdev->vendor == vendor && pdev->device == device) + break; + } + spin_unlock(&pci_lock); + + return (pdev); +} + static void lkpi_pci_dev_release(struct device *dev) { From nobody Wed Jan 18 16:25:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxrhN40jwz2yJd7; Wed, 18 Jan 2023 16:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxrhN04Yhz3FXh; Wed, 18 Jan 2023 16:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ObEUu1q3zMhOTTP5ZB4vVOK+mi/Wp/PmzrE440y/ZkM=; b=VXoYreCT8STFyFff3arTwUAj3ecEAUEUt4Wa9RkijQYyLJPppDTQIo1a0brYC99Kkxo2zl xS5pHK47rpvI5/LL4Zw9BYZR4FgqIMlF6a2sHj97h7sYB/2ir2R3EEY1bJM3Kb8WpRng/s a3NznXhZ+YgPLWxiKAeJ6Nf546+y1cyDTcnzwXUo6MI1vRvnEf3MBwEx7td3q0BvY+Sr4k HcRc8X4DHkUgWdvl50zw/b6/RYqHjqA38hnXgoJXZnN1B1eO6SUI3rfh1XndHWdXO+6nnP FAVV3/kMWHuGKRcuh8fyYRJDWsuTFL4ju9TUs+vCsn4z5vy5NnDX8wsJ7SXFGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ObEUu1q3zMhOTTP5ZB4vVOK+mi/Wp/PmzrE440y/ZkM=; b=oIvzxuRKXpYs0PiAove+0QpnRE3/lZ8c5rojuagCCiIzqevo1CmjaDgmNo73f1ZJapjL9k QmdLYmBNdgPyMYXU6LNEX61oc88/mRUWr4TmUYfYrbTMSaSvvjPrRYr9LE3wh/xqc9kNwK J2twHq6PbL3U21YskGsLFKTh5Zczzf7BZHwyiZYicssdcLVZ+uuDX7PePl1M2rSh2PO6cv T+QWQ1qbvzKo55iPE6H66heO2Zgs8U8noR5oKao8/XmLoIZ1/nrW2VuYgoNEiZmAyer+uB AuNDaKMQCeQQKLrPV1Xmlg4+d94VVdvS4gAsQYdLwOO6bvjJ6UrsAGCCmXQiLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059108; a=rsa-sha256; cv=none; b=JIE3cdBk+5SVO3/V4Q8GRKU/srWmEqWnucc+WAYYb6wowHCRPRBVEsUPn3CO/UvJhRtH2p cZR7m4az3OMIY+4mWp1ccQ3JlYKcCN9/v29zvSWpvV9eSWSLr0v3vJHXAXV8SGgf2cNSjl mM7/WHaa5f8fQmtbiaYfOeXHgVdOrbB+gUFDVda7sW+mRZjns3nhZZFWC/PXJXU718w9Eg 1peRmD1yVoEjxPih30ofML83dtKHj0c3lQLfW6KycGtnmU0h5vKke/l4jQtXGSY81CKrqf Pty3OTPTtPkR1cauol0p4l/IsYMD17bK7oiDa85mVr08UsofFSocrK8Q3Nkj3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxrhM4jgbzJ3f; Wed, 18 Jan 2023 16:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IGP7D8038362; Wed, 18 Jan 2023 16:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGP73A038361; Wed, 18 Jan 2023 16:25:07 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:25:07 GMT Message-Id: <202301181625.30IGP73A038361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 649f21d4d7a8 - stable/13 - LinuxKPI: add (skeleton) functions to make drivers compile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 649f21d4d7a838acfa36925c717ce99df33c9c9f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=649f21d4d7a838acfa36925c717ce99df33c9c9f commit 649f21d4d7a838acfa36925c717ce99df33c9c9f Author: Bjoern A. Zeeb AuthorDate: 2022-12-03 23:00:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:26:55 +0000 LinuxKPI: add (skeleton) functions to make drivers compile Add more functions to netdevice.h (netif_napi_add_tx() being the only one implemented) and add platform_device.h and netlink.h in order to make driver code compile. The skeleton functions are used only in very limited scope and not at all in our usage so far but add (invasive) #ifdef if removed. Add pr_debug() calls to each of them in order to log a TODO (if DEBUG compiled in) and someone should hit them in the future. Commented on by: hselasky (earlier version) Differential Revision: https://reviews.freebsd.org/D37599 (cherry picked from commit 75388b9ca5e566fb7cbd62a37cea1f66d8203fc6) --- .../linuxkpi/common/include/linux/netdevice.h | 132 +++++++++++++++++++++ .../common/include/linux/platform_device.h | 79 ++++++++++++ sys/compat/linuxkpi/common/include/net/netlink.h | 53 +++++++++ 3 files changed, 264 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h index fdfd650a55e5..8653b5df68bd 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -134,6 +135,7 @@ struct net_device { /* Not properly typed as-of now. */ int flags, type; int name_assign_type, needed_headroom; + int threaded; void (*priv_destructor)(struct net_device *); @@ -266,6 +268,15 @@ void linuxkpi_napi_synchronize(struct napi_struct *); #define napi_synchronize(_n) \ linuxkpi_napi_synchronize(_n) + +static inline void +netif_napi_add_tx(struct net_device *dev, struct napi_struct *napi, + int(*napi_poll)(struct napi_struct *, int)) +{ + + netif_napi_add(dev, napi, napi_poll); +} + /* -------------------------------------------------------------------------- */ static inline void @@ -308,6 +319,126 @@ synchronize_net(void) synchronize_rcu(); } +static __inline void +netif_receive_skb_list(struct list_head *head) +{ + + pr_debug("%s: TODO\n", __func__); +} + +static __inline int +napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) +{ + + pr_debug("%s: TODO\n", __func__); + return (-1); +} + +static __inline void +ether_setup(struct net_device *ndev) +{ + + pr_debug("%s: TODO\n", __func__); +} + +static __inline void +dev_net_set(struct net_device *dev, void *p) +{ + + pr_debug("%s: TODO\n", __func__); +} + +/* -------------------------------------------------------------------------- */ + +static __inline bool +netif_carrier_ok(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); + return (false); +} + +static __inline void +netif_carrier_off(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); +} + +static __inline void +netif_carrier_on(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); +} + +/* -------------------------------------------------------------------------- */ + +static __inline bool +netif_queue_stopped(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); + return (false); +} + +static __inline void +netif_stop_queue(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); +} + +static __inline void +netif_wake_queue(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); +} + +/* -------------------------------------------------------------------------- */ + +static __inline int +register_netdevice(struct net_device *ndev) +{ + + /* assert rtnl_locked? */ + pr_debug("%s: TODO\n", __func__); + return (0); +} + +static __inline int +register_netdev(struct net_device *ndev) +{ + int error; + + /* lock */ + error = register_netdevice(ndev); + /* unlock */ + pr_debug("%s: TODO\n", __func__); + return (error); +} + +static __inline void +unregister_netdev(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); +} + +static __inline void +unregister_netdevice(struct net_device *ndev) +{ + pr_debug("%s: TODO\n", __func__); +} + +/* -------------------------------------------------------------------------- */ + +static __inline void +netif_rx(struct sk_buff *skb) +{ + pr_debug("%s: TODO\n", __func__); +} + +static __inline void +netif_rx_ni(struct sk_buff *skb) +{ + pr_debug("%s: TODO\n", __func__); +} + /* -------------------------------------------------------------------------- */ struct net_device *linuxkpi_alloc_netdev(size_t, const char *, uint32_t, @@ -331,5 +462,6 @@ netdev_priv(const struct net_device *ndev) #define rtnl_lock() do { } while(0) #define rtnl_unlock() do { } while(0) +#define rcu_dereference_rtnl(x) READ_ONCE(x) #endif /* _LINUXKPI_LINUX_NETDEVICE_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/platform_device.h b/sys/compat/linuxkpi/common/include/linux/platform_device.h new file mode 100644 index 000000000000..f07b5aac967b --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/platform_device.h @@ -0,0 +1,79 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2022 Bjoern A. Zeeb + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_PLATFORM_DEVICE_H +#define _LINUXKPI_LINUX_PLATFORM_DEVICE_H + +#include +#include + +struct platform_device { + struct device dev; +}; + +struct platform_driver { + int (*remove)(struct platform_device *); + struct device_driver driver; +}; + + +static __inline int +platform_driver_register(struct platform_driver *pdrv) +{ + + pr_debug("%s: TODO\n", __func__); + return (-ENXIO); +} + +static __inline void * +dev_get_platdata(struct device *dev) +{ + + pr_debug("%s: TODO\n", __func__); + return (NULL); +} + +static __inline int +platform_driver_probe(struct platform_driver *pdrv, + int(*pd_probe_f)(struct platform_device *)) +{ + + pr_debug("%s: TODO\n", __func__); + return (-ENODEV); +} + +static __inline void +platform_driver_unregister(struct platform_driver *pdrv) +{ + + pr_debug("%s: TODO\n", __func__); + return; +} + +#endif /* _LINUXKPI_LINUX_PLATFORM_DEVICE_H */ diff --git a/sys/compat/linuxkpi/common/include/net/netlink.h b/sys/compat/linuxkpi/common/include/net/netlink.h new file mode 100644 index 000000000000..ae250177d18b --- /dev/null +++ b/sys/compat/linuxkpi/common/include/net/netlink.h @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2020,2022 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LINUXKPI_NET_NETLINK_H +#define _LINUXKPI_NET_NETLINK_H + +#include + +struct nla_policy { +}; + +struct netlink_callback { + int args[8]; +}; + +static __inline int +nla_put(struct sk_buff *skb, int attr, size_t len, void *data) +{ + + pr_debug("%s: TODO -- now native?\n", __func__); + return (-ENXIO); +} + +static __inline int +nla_put_u16(struct sk_buff *skb, int attr, uint32_t val) +{ + + return (nla_put(skb, attr, sizeof(uint32_t), &val)); +} + +#endif /* _LINUXKPI_NET_NETLINK_H */ From nobody Wed Jan 18 16:40:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxs2941tFz2yLGy; Wed, 18 Jan 2023 16:40:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxs291gRdz3Njc; Wed, 18 Jan 2023 16:40:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; none Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 30IGeTJn010752; Wed, 18 Jan 2023 08:40:29 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 30IGeTbo010751; Wed, 18 Jan 2023 08:40:29 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202301181640.30IGeTbo010751@gndrsh.dnsmgr.net> Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-Reply-To: <20230118160821.AACA6227@slippy.cwsent.com> To: Cy Schubert Date: Wed, 18 Jan 2023 08:40:29 -0800 (PST) CC: rgrimes@freebsd.org, Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Nxs291gRdz3Njc X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes wr > > ote: > > > > > > > > No, otis fixed it thus: > > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > > > > > I am suggesting that it should be > > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > > > ALL base system configuration files *should* be relative to /etc, not /va > > r. > > > > > > > > > > Would this need any mtree changes or similar? > > > > No, /etc/unbound is a symbolic link already installed by the build system, > > and /var/unbound is already a directory, again, installed by the build system > > . > > > > This is a one line change that actually makes the /etc/unbound link work > > correctly, without this change the binary has a hard coded path that ignores > > the > > /etc/unbound symbolic link and requires a recompile if I want to move > > things around, or maintanance of 2 symbolic links. > > > > Personally I dont see *why* unbound has a /var/unbound directory, can > > someone tell me why that was done? Is this some attempt and maintaining > > read only root? Does unbound scribble in the config directory, or > > is this simply mirroring some of the stuff that bind did? > > I see why it does this. Looking at usr.sbin/unbound/setup/local-unbound-setu > p.sh, it installs its config files in $workdir. Looking at git log > 49cede74eecf4 (SVN r255809), the last paragraph in the commit log entry > says: > > Note that these scripts place the unbound configuration files in > /var/unbound rather than /etc/unbound. This is necessary so that > unbound can reload its configuration while chrooted. We should > probably provide symlinks in /etc. > > Providing symlinks in /etc/unbound appears to be the correct solution. For the forth or fith time, there already IS a symbolic link etc/unbound -> ../var/unbound. Just make the change I suggested and all is fine... -- Rod Grimes rgrimes@freebsd.org From nobody Wed Jan 18 16:45:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxs7S3WJWz2yMBH; Wed, 18 Jan 2023 16:45:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxs7S11mRz3PjT; Wed, 18 Jan 2023 16:45:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; none Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 30IGj49o010784; Wed, 18 Jan 2023 08:45:04 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 30IGj4Ra010783; Wed, 18 Jan 2023 08:45:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202301181645.30IGj4Ra010783@gndrsh.dnsmgr.net> Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-Reply-To: <202301181640.30IGeTbo010751@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org Date: Wed, 18 Jan 2023 08:45:04 -0800 (PST) CC: Cy Schubert , Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Nxs7S11mRz3PjT X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > > In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. > > Grimes" > > writes: > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes wr > > > ote: > > > > > > > > > > No, otis fixed it thus: > > > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > > > > > > > > > I am suggesting that it should be > > > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > > > > > ALL base system configuration files *should* be relative to /etc, not /va > > > r. > > > > > > > > > > > > > Would this need any mtree changes or similar? > > > > > > No, /etc/unbound is a symbolic link already installed by the build system, > > > and /var/unbound is already a directory, again, installed by the build system > > > . > > > > > > This is a one line change that actually makes the /etc/unbound link work > > > correctly, without this change the binary has a hard coded path that ignores > > > the > > > /etc/unbound symbolic link and requires a recompile if I want to move > > > things around, or maintanance of 2 symbolic links. > > > > > > Personally I dont see *why* unbound has a /var/unbound directory, can > > > someone tell me why that was done? Is this some attempt and maintaining > > > read only root? Does unbound scribble in the config directory, or > > > is this simply mirroring some of the stuff that bind did? > > > > I see why it does this. Looking at usr.sbin/unbound/setup/local-unbound-setu > > p.sh, it installs its config files in $workdir. Looking at git log > > 49cede74eecf4 (SVN r255809), the last paragraph in the commit log entry > > says: > > > > Note that these scripts place the unbound configuration files in > > /var/unbound rather than /etc/unbound. This is necessary so that > > unbound can reload its configuration while chrooted. We should > > probably provide symlinks in /etc. Hang on a second... where is unbound chrooted to? If it is chrooted to /var/unbound would it not then look for /var/unbound/var/unbound/unbound.conf? I got a feeling something is not well thought out here... -- Rod Grimes rgrimes@freebsd.org From nobody Wed Jan 18 16:46:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxs8l6kN6z2yMHM; Wed, 18 Jan 2023 16:46:15 +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 4Nxs8l5QPwz3PyW; Wed, 18 Jan 2023 16:46:15 +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 ESMTP id I7eKpAyUBc9C4IBZnpS8Hr; Wed, 18 Jan 2023 16:46:15 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id IBZlphjR2yAOeIBZmpWU9W; Wed, 18 Jan 2023 16:46:15 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=63c82257 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=RvmDmJFTN0MA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=C4B0vsJxOSi1_OTPh5EA:9 a=CjuIK1q_8ugA:10 a=PaZFhfb9_QoA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id A0F4B12F4; Wed, 18 Jan 2023 08:46:13 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 82F2B23D; Wed, 18 Jan 2023 08:46:13 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Cy Schubert , Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-reply-to: <202301181640.30IGeTbo010751@gndrsh.dnsmgr.net> References: <202301181640.30IGeTbo010751@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Wed, 18 Jan 2023 08:40:29 -0800." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Jan 2023 08:46:13 -0800 Message-Id: <20230118164613.82F2B23D@slippy.cwsent.com> X-CMAE-Envelope: MS4xfLP7Owybg8kfDnLvGbXkUAAy0OqKAfuXORRM0ZyiLybm0cgFdkIxl3YD5w18q3gKo5SNTa/3vX1C5KfZbLA+eF9luhwDsU11befxbgxQL7I9bg35IUOF rfOAhMePHBGgSVp8lbXBM08GeeWE5oQHT6fUJt6FSv48F9bQA8DSVJZhWnruEVy9yrhE0Xa3vjynRaqCl5c/8obA97bVAuM1CvmJRBXyAEToyoyAiTwZPYJg 356KWeiC0bOj9HJrUnODR8JNH/86FF4MzNhTmHR4N8UAIw25hqTdPegDHiTvn5Yz9Zws3T6CFrQYAnXHiNTGAsa+ojtpbMWgp0BNBmaTryIuUwY6k+QdSkiK 9oVfQblP X-Rspamd-Queue-Id: 4Nxs8l5QPwz3PyW X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202301181640.30IGeTbo010751@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. > > Grimes" > > writes: > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes > wr > > > ote: > > > > > > > > > > No, otis fixed it thus: > > > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > > > > > > > > > I am suggesting that it should be > > > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > > > > > ALL base system configuration files *should* be relative to /etc, not > /va > > > r. > > > > > > > > > > > > > Would this need any mtree changes or similar? > > > > > > No, /etc/unbound is a symbolic link already installed by the build system > , > > > and /var/unbound is already a directory, again, installed by the build sy > stem > > > . > > > > > > This is a one line change that actually makes the /etc/unbound link work > > > correctly, without this change the binary has a hard coded path that igno > res > > > the > > > /etc/unbound symbolic link and requires a recompile if I want to move > > > things around, or maintanance of 2 symbolic links. > > > > > > Personally I dont see *why* unbound has a /var/unbound directory, can > > > someone tell me why that was done? Is this some attempt and maintaining > > > read only root? Does unbound scribble in the config directory, or > > > is this simply mirroring some of the stuff that bind did? > > > > I see why it does this. Looking at usr.sbin/unbound/setup/local-unbound-set > u > > p.sh, it installs its config files in $workdir. Looking at git log > > 49cede74eecf4 (SVN r255809), the last paragraph in the commit log entry > > says: > > > > Note that these scripts place the unbound configuration files in > > /var/unbound rather than /etc/unbound. This is necessary so that > > unbound can reload its configuration while chrooted. We should > > probably provide symlinks in /etc. > > > > Providing symlinks in /etc/unbound appears to be the correct solution. > > For the forth or fith time, there already IS a symbolic link > etc/unbound -> ../var/unbound. Hmm. slippy$ lh /etc/unbound ls: /etc/unbound: No such file or directory slippy$ cwsys# lh /etc/unbound ls: /etc/unbound: No such file or directory cwsys# Seems it got deleted on two of my systems and never recreated. > > Just make the change I suggested and all is fine... On second thought, if the comment in the commit log is correct, the change you suggested would break running unbound chroot. Or do I misunderstand? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Jan 18 16:47:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxsBm0DHDz2yMXj; Wed, 18 Jan 2023 16:48: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 4NxsBl4ydzz3Qg8; Wed, 18 Jan 2023 16:47:59 +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 ESMTP id HyeqpADtVc9C4IBbTpS94Y; Wed, 18 Jan 2023 16:47:59 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id IBbRpNx3W3fOSIBbSpXxIF; Wed, 18 Jan 2023 16:47:59 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=63c822bf a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=RvmDmJFTN0MA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=extXo1mnNIs0al6sDOMA:9 a=CjuIK1q_8ugA:10 a=PaZFhfb9_QoA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id AE9B2130E; Wed, 18 Jan 2023 08:47:56 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 84556148; Wed, 18 Jan 2023 08:47:56 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Cy Schubert , Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-reply-to: <202301181645.30IGj4Ra010783@gndrsh.dnsmgr.net> References: <202301181645.30IGj4Ra010783@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Wed, 18 Jan 2023 08:45:04 -0800." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Jan 2023 08:47:56 -0800 Message-Id: <20230118164756.84556148@slippy.cwsent.com> X-CMAE-Envelope: MS4xfNONaaCev5zztMqnOLIpMJrlvUGk295vgaTWslpqVtducjW8KzAIgKg8W/j38eAJvNj0S/Dnse4J8f/NksFqaObMA2R1oAqs7XyrYjLq3iaChOW2aWjU uUDuJhLDehWu9T9EcOnfyd9Kd18KSkXTsyoQc0/L/CzWc34UFsWiDR8X7OCdXQbX9+qzJMjOIa8ZtUluS3uYemdm4pk0Whk50KCJbgleDUxCBkU8rPuSk8+g KbJPATSqTY93K1yQ7KCyHglZ/smQbmxbXRGPynThKFHAYeeG2bWChlWsEr2gg9rc5e2JZ5UmQINlw1J53ghXwCe0ahFp9Gnz3TUYOSZnGOG7SH01sxFRyxx+ 6XgJ9Hi0 X-Rspamd-Queue-Id: 4NxsBl4ydzz3Qg8 X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202301181645.30IGj4Ra010783@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > > In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. > > > Grimes" > > > writes: > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes et> wr > > > > ote: > > > > > > > > > > > > No, otis fixed it thus: > > > > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > > > > > > > > > > > > > I am suggesting that it should be > > > > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > > > > > > > ALL base system configuration files *should* be relative to /etc, n > ot /va > > > > r. > > > > > > > > > > > > > > > > Would this need any mtree changes or similar? > > > > > > > > No, /etc/unbound is a symbolic link already installed by the build syst > em, > > > > and /var/unbound is already a directory, again, installed by the build > system > > > > . > > > > > > > > This is a one line change that actually makes the /etc/unbound link wor > k > > > > correctly, without this change the binary has a hard coded path that ig > nores > > > > the > > > > /etc/unbound symbolic link and requires a recompile if I want to move > > > > things around, or maintanance of 2 symbolic links. > > > > > > > > Personally I dont see *why* unbound has a /var/unbound directory, can > > > > someone tell me why that was done? Is this some attempt and maintainin > g > > > > read only root? Does unbound scribble in the config directory, or > > > > is this simply mirroring some of the stuff that bind did? > > > > > > I see why it does this. Looking at usr.sbin/unbound/setup/local-unbound-s > etu > > > p.sh, it installs its config files in $workdir. Looking at git log > > > 49cede74eecf4 (SVN r255809), the last paragraph in the commit log entry > > > says: > > > > > > Note that these scripts place the unbound configuration files in > > > /var/unbound rather than /etc/unbound. This is necessary so that > > > unbound can reload its configuration while chrooted. We should > > > probably provide symlinks in /etc. > > Hang on a second... where is unbound chrooted to? If it is chrooted > to /var/unbound would it not then look for /var/unbound/var/unbound/unbound.c > onf? > > I got a feeling something is not well thought out here... Probably and it needs someone to investigate and possibly fix. I can put this on my todo list. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Jan 18 17:02:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxsX35rrcz2sSF3; Wed, 18 Jan 2023 17:02:59 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxsX33m7Dz3hlD; Wed, 18 Jan 2023 17:02:59 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Authentication-Results: mx1.freebsd.org; none Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 30IH2u0P010891; Wed, 18 Jan 2023 09:02:56 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 30IH2toO010890; Wed, 18 Jan 2023 09:02:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202301181702.30IH2toO010890@gndrsh.dnsmgr.net> Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-Reply-To: <20230118164756.84556148@slippy.cwsent.com> To: Cy Schubert Date: Wed, 18 Jan 2023 09:02:55 -0800 (PST) CC: rgrimes@freebsd.org, Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4NxsX33m7Dz3hlD X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > In message <202301181645.30IGj4Ra010783@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > > > In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W. > > > > Grimes" > > > > writes: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes > et> wr > > > > > ote: > > > > > > > > > > > > > > No, otis fixed it thus: > > > > > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > > > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > > > > > > > > > > > > > > > > > I am suggesting that it should be > > > > > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > > > > > > > > > ALL base system configuration files *should* be relative to /etc, n > > ot /va > > > > > r. > > > > > > > > > > > > > > > > > > > Would this need any mtree changes or similar? > > > > > > > > > > No, /etc/unbound is a symbolic link already installed by the build syst > > em, > > > > > and /var/unbound is already a directory, again, installed by the build > > system > > > > > . > > > > > > > > > > This is a one line change that actually makes the /etc/unbound link wor > > k > > > > > correctly, without this change the binary has a hard coded path that ig > > nores > > > > > the > > > > > /etc/unbound symbolic link and requires a recompile if I want to move > > > > > things around, or maintanance of 2 symbolic links. > > > > > > > > > > Personally I dont see *why* unbound has a /var/unbound directory, can > > > > > someone tell me why that was done? Is this some attempt and maintainin > > g > > > > > read only root? Does unbound scribble in the config directory, or > > > > > is this simply mirroring some of the stuff that bind did? > > > > > > > > I see why it does this. Looking at usr.sbin/unbound/setup/local-unbound-s > > etu > > > > p.sh, it installs its config files in $workdir. Looking at git log > > > > 49cede74eecf4 (SVN r255809), the last paragraph in the commit log entry > > > > says: > > > > > > > > Note that these scripts place the unbound configuration files in > > > > /var/unbound rather than /etc/unbound. This is necessary so that > > > > unbound can reload its configuration while chrooted. We should > > > > probably provide symlinks in /etc. > > > > Hang on a second... where is unbound chrooted to? If it is chrooted > > to /var/unbound would it not then look for /var/unbound/var/unbound/unbound.c > > onf? > > > > I got a feeling something is not well thought out here... > > Probably and it needs someone to investigate and possibly fix. I can put > this on my todo list. I've read a few of the linux how to's on running unbound chrooted and it leads me to belive that /etc/unbound/unbound.conf is the correct value of the path to the config file. I'll also spend some ENOTIME idle cycles looking closer at what has happened here. My gut says that if unbound is running chroot to /var/unbound then the config file should live in /var/unbound/etc/unbound/unbound.conf This would mimic what I am seeing done with /var/lib/unbound on linux systems. Then the symlink at /etc would need to be updated to point to /etc/unbound -> ../var/unbound/etc/unbound -- Rod Grimes rgrimes@freebsd.org From nobody Wed Jan 18 17:07:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxsdM28Ctz2sStt; Wed, 18 Jan 2023 17:07:35 +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 4NxsdM175Fz3jHd; Wed, 18 Jan 2023 17:07:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id IBdKpHOull2xSIBuQpRlke; Wed, 18 Jan 2023 17:07:34 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id IBuOpr6TZcyvuIBuPpyaHm; Wed, 18 Jan 2023 17:07:34 +0000 X-Authority-Analysis: v=2.4 cv=VbHkgXl9 c=1 sm=1 tr=0 ts=63c82756 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=RvmDmJFTN0MA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=JZogqisxDOvIRNnNG9cA:9 a=CjuIK1q_8ugA:10 a=_fOGpDza7iMA:10 a=PaZFhfb9_QoA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 88A7D132C; Wed, 18 Jan 2023 09:07:32 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 6E5A714E; Wed, 18 Jan 2023 09:07:32 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Cy Schubert , Juraj Lutter , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1d577bedbae8 - main - unbound: Fix config file path In-reply-to: <202301181702.30IH2toO010890@gndrsh.dnsmgr.net> References: <202301181702.30IH2toO010890@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Wed, 18 Jan 2023 09:02:55 -0800." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Jan 2023 09:07:32 -0800 Message-Id: <20230118170732.6E5A714E@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBSkrZ+5aWdf00amlArqmersBzrLYfho2HDwACrBBFyZ01gHJ8l90bLmnEbEXGjJvZouXGnZVZSGgIOIeqWy4dFLu+H8bD4avFc40tBuqzbYiz/Wujaz cROCLAigExQ5nLStAovpDDYPwTPdUCTE6HT01PL3Ga5zTyOuYJbu+sUX3zEuX8Lf4QZrIAIOkrftrhaQ5MPO5dXXyZThFCvmoqe4xf0nPZJ3wuqM4nHcfoef Epww8mufAWhS2eDz01adDxrLn0hqKcmt7CiDrGldR+L8iXsRGLBQYY5CgPscl2DwrPzHq2jx3ZECJc5YTm1GxXKdMbydeb6f/+mXOQJyDf5WA2PcIsT703LZ Pe5iKPVo X-Rspamd-Queue-Id: 4NxsdM175Fz3jHd X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202301181702.30IH2toO010890@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > In message <202301181645.30IGj4Ra010783@gndrsh.dnsmgr.net>, "Rodney W. > > Grimes" > > writes: > > > > > In message <202301181551.30IFpbRu010474@gndrsh.dnsmgr.net>, "Rodney W > . > > > > > Grimes" > > > > > writes: > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > > > > > > > > > > > On 18 Jan 2023, at 16:34, Rodney W. Grimes gr.n > > > et> wr > > > > > > ote: > > > > > > > > > > > > > > > > No, otis fixed it thus: > > > > > > > > -#define CONFIGFILE "/usr/local/etc/unbound/unbound.conf" > > > > > > > > +#define CONFIGFILE "/var/unbound/unbound.conf" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I am suggesting that it should be > > > > > > > > #define CONFIGFILE "/etc/unbound/unbound.conf" > > > > > > > > > > > > > > > > ALL base system configuration files *should* be relative to /et > c, n > > > ot /va > > > > > > r. > > > > > > > > > > > > > > > > > > > > > > Would this need any mtree changes or similar? > > > > > > > > > > > > No, /etc/unbound is a symbolic link already installed by the build > syst > > > em, > > > > > > and /var/unbound is already a directory, again, installed by the bu > ild > > > system > > > > > > . > > > > > > > > > > > > This is a one line change that actually makes the /etc/unbound link > wor > > > k > > > > > > correctly, without this change the binary has a hard coded path tha > t ig > > > nores > > > > > > the > > > > > > /etc/unbound symbolic link and requires a recompile if I want to mo > ve > > > > > > things around, or maintanance of 2 symbolic links. > > > > > > > > > > > > Personally I dont see *why* unbound has a /var/unbound directory, c > an > > > > > > someone tell me why that was done? Is this some attempt and mainta > inin > > > g > > > > > > read only root? Does unbound scribble in the config directory, or > > > > > > is this simply mirroring some of the stuff that bind did? > > > > > > > > > > I see why it does this. Looking at usr.sbin/unbound/setup/local-unbou > nd-s > > > etu > > > > > p.sh, it installs its config files in $workdir. Looking at git log > > > > > 49cede74eecf4 (SVN r255809), the last paragraph in the commit log ent > ry > > > > > says: > > > > > > > > > > Note that these scripts place the unbound configuration files in > > > > > /var/unbound rather than /etc/unbound. This is necessary so that > > > > > unbound can reload its configuration while chrooted. We should > > > > > probably provide symlinks in /etc. > > > > > > Hang on a second... where is unbound chrooted to? If it is chrooted > > > to /var/unbound would it not then look for /var/unbound/var/unbound/unbou > nd.c > > > onf? > > > > > > I got a feeling something is not well thought out here... > > > > Probably and it needs someone to investigate and possibly fix. I can put > > this on my todo list. > > I've read a few of the linux how to's on running unbound chrooted and > it leads me to belive that /etc/unbound/unbound.conf is the correct > value of the path to the config file. > > I'll also spend some ENOTIME idle cycles looking closer at what has > happened here. My gut says that if unbound is running chroot to > /var/unbound then the config file should live in > /var/unbound/etc/unbound/unbound.conf If you have more ENOTIME than I do, the help would be appreciated. Otherwise I'll just add it to my multitasking list. > > This would mimic what I am seeing done with /var/lib/unbound on > linux systems. This also mimics how one would run named chrooted. > > Then the symlink at /etc would need to be updated to point to > /etc/unbound -> ../var/unbound/etc/unbound -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Jan 18 17:50:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxtZN3KyPz2sYTf; Wed, 18 Jan 2023 17:50:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxtZN2tQ6z3mTD; Wed, 18 Jan 2023 17:50:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674064204; h=from:from:reply-to:subject: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=8HBj0laqcaZbo+PMier8lLQDoX7EXR4wqPDZvF4YJAk=; b=SsQFFkdtAI7dIAyvaks7QxnVcrrnAytjv+oSn3XpGp1lkjnHBc2gglAYNuIRWOVDv3oO1Q u/MYtzFveRMjU/zvrne39tXhUKGQS23EurwBmQXTOKOCFJtre6Po4BkZAbgwdk/LDqN141 t/vnmL2YT7MhtHzmciO6XmBrryaqrwKL2H/eGZvSineY/cOOXEgHNCNZzzQxF7K1HK3sLn 9YDZghiz/AfbNNJnxsCwWPuQkfz6OHM/xSHnWlw3ataigsc3i5dZvF/MasvFu4TGT4p9YW 3RulBxWO6mqI0mg9UmMX0jh4UAaZWh4fR2p5PMvvqLXSnpI6oFgUgR13wBR9Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674064204; h=from:from:reply-to:subject: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=8HBj0laqcaZbo+PMier8lLQDoX7EXR4wqPDZvF4YJAk=; b=rI5z0BPc4dEqx58rwjtLzs+1MEcZscTQFr7iHzteyhJal1vAH63jPv9nzs68nGORH+ya5E 6LU6pmhSvcc5csxWKmr0vhKDpHgeIG9H9k0YHiEbOYdOWddnpu4/wuI2RcSf50PjJVhUx1 dWxlFJEc5fkJ7/FOf87hEWis0/3ojLJU7cnzO+0Z02+crCMDTy/7va1tdRX6daMO4ZOPvo wGJ3nqxWffo6XqyojxOU09uMTcfr2NGknYKdw3e1jLUU1WIN5iFT68O/FghUiJ0Nk1r9Q7 jPqchFH2/OoTJag3KXP+9z9pEjGwBwNofgWpe+AI4J5RKsfYazJqiROT+reARQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674064204; a=rsa-sha256; cv=none; b=ZnLPi8UvYY3AQkhyEr7OrLh7lTcwwu8X/wle9FeVBnbpT74n0eXCkI07+5O60nXevXq1Aw +BvCFwdDjj1rayX/RzPSD5lW2psWTmTJ7C01MStstEW73h8ynmxfYNPhVT6wRAXv/CZI5m +dfSZ56Py/oWaqIIl0WWHZXmqrZ8aXcnzNSEecZvXIAtXtiTalmLYvY5UDseiJEo7sib27 CrJ1akbscmaLqjS6e3k1VoOl1BVtIT4oShDc0LYjxKNcNCxFeny54sU99/0COA5SOGvVmT Alsspm/7cYDvPOv/66FUPTBflR3h120nuhaT3685Zh5HiQmpldvJV2aNdvqUkw== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NxtZM5jJ2zNXJ; Wed, 18 Jan 2023 17:50:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Wed, 18 Jan 2023 09:50:02 -0800 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US To: Hans Petter Selasky , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202301131019.30DAJXWf081968@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: e0d8add4af0b - main - tcp_lro: Fix for undefined behaviour. In-Reply-To: <202301131019.30DAJXWf081968@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 1/13/23 2:19 AM, Hans Petter Selasky wrote: > The branch main has been updated by hselasky: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e0d8add4af0be1d37ede9a16f46424dc08f0d95e > > commit e0d8add4af0be1d37ede9a16f46424dc08f0d95e > Author: Hans Petter Selasky > AuthorDate: 2022-11-28 22:56:16 +0000 > Commit: Hans Petter Selasky > CommitDate: 2023-01-13 10:18:19 +0000 > > tcp_lro: Fix for undefined behaviour. > > Make sure the size of the raw[] array in the lro_address union is > correctly set at compile time, so that static code analysis tools > do not report undefined behaviour. > > MFC after: 1 week > Sponsored by: NVIDIA Networking > --- > sys/netinet/tcp_lro.h | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h > index 427657df47e7..e01e451c1e77 100644 > --- a/sys/netinet/tcp_lro.h > +++ b/sys/netinet/tcp_lro.h > @@ -34,6 +34,8 @@ > #define _TCP_LRO_H_ > > #include > +#include param.h should always be the first header, and it also sorts before time.h. > + > #include > > #ifndef TCP_LRO_ENTRIES > @@ -65,8 +67,12 @@ > > struct inpcb; > > +/* Precompute the LRO_RAW_ADDRESS_MAX value: */ > +#define LRO_RAW_ADDRESS_MAX \ > + howmany(12 + 2 * sizeof(struct in6_addr), sizeof(u_long)) > + > union lro_address { > - u_long raw[1]; > + u_long raw[LRO_RAW_ADDRESS_MAX]; In OFED this anti-pattern uses 'u_long raw[0]' which I think is probably at least better than '[1]'. My worry is that LRO_RAW_ADDRESS_MAX is fairly fragile and gross, though the static assertion at least catches if it is wrong. In general though for both OFED and this, I think is is actually cleaner to remove the weird aliasing 'raw' member and just use a plain (u_long *) cast. If you did that, you could revert this commit and have the simpler definition of LRO_RAW_ADDRESS_MAX derived from the sizeof() the type. -- John Baldwin From nobody Wed Jan 18 19:13:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxwQZ577Nz2skbC; Wed, 18 Jan 2023 19:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxwQZ4Xyfz3rqq; Wed, 18 Jan 2023 19:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674069206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LbH2mTk1x9sEqzXbGamBBDcOUiocOXb/C3HYvR9JZtQ=; b=XkdyrAq4P9kR0Kg3mNVJAIbWnQiwykxvbH26QsdeOBXP1D6neL59DAcdKeqhNEUKZrAdBF e3U4ylRaZRv5oJZ2/Jf0qJ0YCsnfQtnZetVBGJ9eWWuwik9saVMTkQ0qF7h+PZ0ThJnYj5 EAKNS9CrLnV0NNt/8OA6150N/YPZ7q49fhYDKYqH3uKpcHtwfhIRdR+xQc5cekx24rLmnN PqzYZsZFM5nvVF6Pjs53tqCzSGZlm++k+m5CSbrQ8e9o7VxogGo6uFs/7Ih9LVvo8DGUQZ S+7lgtBiAWuaITdzL5czpdN38i+jY42CusJ0uDieRGBJnoAweI0FXuwUu1mbRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674069206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LbH2mTk1x9sEqzXbGamBBDcOUiocOXb/C3HYvR9JZtQ=; b=cAslxscjqJ8s5XDYqtdS6xpGtleFENwAVGbx2fVjnIbsJIXYv4Wp7AFqF08zyrtyZIkvZP YmriyayL3ufvRL8moZ8JSLr6neyN0KOW3lz246VdfPBZwp+i/eSsGo5EPWZwKzOK8jEnUf Z2EeSw+LMtJodlp0ZiJRvFfgHWcGBCFZMrUNlIoymmepmgabUexcx12vwqWj+FZQZ9Lcfw j57RTQPoetYN19cpGL3SKUsXv2B3+e1lhFqCxj/GbO1IrLHuCERdMF8gi52jSi9pu5Jvbs 1gWWiFrfVhG9T9S2JUrHwFYWTLFenM1sIQEPr+JdTnT+7B+61MJtm41MyT1FVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674069206; a=rsa-sha256; cv=none; b=QfGH6Lfdwmgig3e5ZI8XObc+4VMFAYZNws8Sj2rBfY3cfzpSUWVcac0MzsCDCozcnZqm5B t/AhIrbt4cGkYSKB6yEABkMd9vUh91ULaO6aeDzb3gOEl5V1yDjeIzTlzY3ekTeAXHj8VH gj2CO5woMKaAhzYR5xVXf5V09H5Dst0DgFE2qXWFnbWTqCuByZ7rn9bMwRx9Tt29RTgnX6 3S605wvxAwyHcJP5KJheCETzLo1OECY33SL4w0DuiwfUVsTrxASPGH4yuoENftRLGzWirY d5Xw7DvNFj4STHgVn9ex+2O0XaHvzs2mOa58rEXCxs9EOkJleca5uwW/zzM7gA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxwQZ3ZwPzMhm; Wed, 18 Jan 2023 19:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IJDQhW082143; Wed, 18 Jan 2023 19:13:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IJDQ10082142; Wed, 18 Jan 2023 19:13:26 GMT (envelope-from git) Date: Wed, 18 Jan 2023 19:13:26 GMT Message-Id: <202301181913.30IJDQ10082142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 61456545d957 - stable/13 - xdr: store chars consistently List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 61456545d957be9a41aa83f5178b73509a4c2a1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=61456545d957be9a41aa83f5178b73509a4c2a1f commit 61456545d957be9a41aa83f5178b73509a4c2a1f Author: Brooks Davis AuthorDate: 2023-01-18 19:13:15 +0000 Commit: Brooks Davis CommitDate: 2023-01-18 19:13:15 +0000 xdr: store chars consistently Cast char's through unsigned char before storing as an integer in xdr_char(), this ensures that the encoded form is consistently not sign-extended following Open Solaris's example. Prior to this change, platforms with signed chars would sign extend values with the high bit set but ones with unsigned chars would not so 0xff would be stored as 0x000000ff on unsigned char platforms and 0xffffffff on signed char platforms. Decoding has the same result for either form so this is a largely cosmetic change, but it seems best to produce consistent output. For more discussion, see https://github.com/openzfs/zfs/issues/14173 Reviewed by: mav, imp Differential Revision: https://reviews.freebsd.org/D37992 (cherry picked from commit a872c37054172f3f7a03aef263ca5886a749771f) --- lib/libc/xdr/xdr.c | 8 ++++---- sys/xdr/xdr.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c index fcf4e9029074..48b4cdbecd02 100644 --- a/lib/libc/xdr/xdr.c +++ b/lib/libc/xdr/xdr.c @@ -429,13 +429,13 @@ xdr_uint16_t(XDR *xdrs, uint16_t *u_int16_p) bool_t xdr_char(XDR *xdrs, char *cp) { - int i; + u_int i; - i = (*cp); - if (!xdr_int(xdrs, &i)) { + i = *((unsigned char *)cp); + if (!xdr_u_int(xdrs, &i)) { return (FALSE); } - *cp = i; + *((unsigned char *)cp) = i; return (TRUE); } diff --git a/sys/xdr/xdr.c b/sys/xdr/xdr.c index 0a0bf3f66744..b57eb7d66ef4 100644 --- a/sys/xdr/xdr.c +++ b/sys/xdr/xdr.c @@ -358,13 +358,13 @@ xdr_uint16_t(XDR *xdrs, uint16_t *uint16_p) bool_t xdr_char(XDR *xdrs, char *cp) { - int i; + u_int i; - i = (*cp); - if (!xdr_int(xdrs, &i)) { + i = *((unsigned char *)cp); + if (!xdr_u_int(xdrs, &i)) { return (FALSE); } - *cp = i; + *((unsigned char *)cp) = i; return (TRUE); } From nobody Wed Jan 18 20:51:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxycC5jZYz2syM7; Wed, 18 Jan 2023 20:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxycC5Bltz424K; Wed, 18 Jan 2023 20:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674075115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z/QqVkTk67vYDzXqV7D3HDbMVC5hMprZqYMmyvSDjdE=; b=a2fGE+4yY+8N3fTIkILPPaplXZI6RvUYtBN8cJ/+wVQIetLW/W+ZVw/FShI2P+tKAw9QSM JFVqF4nrL+QRl6/chXkVnMzKiezPPrNzDKBb0uWqKLmzMp3D1FoagJy2ZsEyOyp32QkCpn EtU29idq9lZ6Qcgz7BIkDBvJRo1RMyuaEtG5SA9kxkLdBO6GS1VKCWRZK0cIIGZQ7QEA6A IU3d2F1haIqU0yebZJ0/GTd9VP2PM3ENIxxXQ42bChTReF8C4WUdK9x8WuAJC/HC/M17uO u4BUyr/6kSZ/aO+arK9RfzNoT9ds6N+wpMycgjsKgj3icrZZVwnmOeFRZtAWzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674075115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z/QqVkTk67vYDzXqV7D3HDbMVC5hMprZqYMmyvSDjdE=; b=sxa2wDkR7Lhm5dbzdIUcP3S04mvBtM34POsnqxgunm01LVlOTxvrLKbcG0Lvx87B+JLubB RLfopYhCGq/UTEdR4gk7MrshdSj9lbVB3ulE0RjR2mYAd71Ydk0bYdk2wqazbMTPWdp7WB R9eoUH36UJeAua8lJMWln1fXRvHMDe3ECwGJ3KAfwNBu+Zxyh5aZ1PzQBlybTDCbiL9FUn K2AtMqSqXCBREHdISB8r3HKUrFn3gl7/W9619LpIMd7u5qN+0WnOhFDKwGt+4VVHHqvqIf hMNmJlY6h3496ztsoAGqhWNGI4DLVkwfvZZHDPOxvh2CPdccOGVtTFfN93aUCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674075115; a=rsa-sha256; cv=none; b=EgsRy3/Jy/Ri+HEyx13CVhfg756bgJ7RR0fOTgP4edwg2wzf4jTmVS7BU+6y3qv7LN9Okg mS21jStAO8dHJVUoEm2kS6HFXuT5pOVn3SbTDc7ZYWqSvzhSMfzwLaa0vHFBKB7crHUlhS h4WtsBejDiHkelOdVt2AZJMV8qkiPX0HnwkkIlT7AL7pLU83aKjS8ZhLiVacZIbdN/UqSq 9KnCq2Ez1zsMtNnAmfWeZq9v2uDxgLueioOkku/sGfo7lz6T0tvCkVGz9SlksPe0tIyqcx fqOcmjDgbCnv7zgqYoCG7vaoFC0Czk2fxqYqHYByVSD5UxeO1PK0uDbZwsqXlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxycC4GFGzPxm; Wed, 18 Jan 2023 20:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IKptjO025025; Wed, 18 Jan 2023 20:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IKptvY025024; Wed, 18 Jan 2023 20:51:55 GMT (envelope-from git) Date: Wed, 18 Jan 2023 20:51:55 GMT Message-Id: <202301182051.30IKptvY025024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pau Amma Subject: git: 5faf9f4dff8d - main - Refresh CPU types and classes from sys/sys/pmc.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pauamma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5faf9f4dff8da11e3893c9fd1d7c15a02c4b5b78 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pauamma (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5faf9f4dff8da11e3893c9fd1d7c15a02c4b5b78 commit 5faf9f4dff8da11e3893c9fd1d7c15a02c4b5b78 Author: Pau Amma AuthorDate: 2022-05-28 18:49:17 +0000 Commit: Pau Amma CommitDate: 2023-01-18 20:50:49 +0000 Refresh CPU types and classes from sys/sys/pmc.h. While here, fix a few nits. Inspired by reviewing D35342. Sources for trademark info - https://www.arm.com/company/policies/trademarks (no Arm8, curiously) - https://www.ibm.com/legal/copytrade?mhsrc=ibmsearch_a&mhq=trademark Reviewed by: carlavilla, luporl, mhorne Approved by: carlavilla (mentor), mhorne (src) Differential Revision: https://reviews.freebsd.org/D35344 --- lib/libpmc/pmc.3 | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/lib/libpmc/pmc.3 b/lib/libpmc/pmc.3 index abe9f3208030..68fa46a5c337 100644 --- a/lib/libpmc/pmc.3 +++ b/lib/libpmc/pmc.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2022 +.Dd June 3, 2022 .Dt PMC 3 .Os .Sh NAME @@ -131,7 +131,7 @@ The CPUs known to the PMC library are named by the enumeration. Supported CPUs include: .Pp -.Bl -tag -width "Li PMC_CPU_INTEL_CORE2" -compact +.Bl -tag -width "Li PMC_CPU_ARMV7_CORTEX_A15" -compact .It Li PMC_CPU_AMD_K7 .Tn "AMD Athlon" CPUs. @@ -161,14 +161,66 @@ and CPUs, and other CPUs conforming to version 2 of the .Tn Intel performance measurement architecture. +.It Li PMC_CPU_PPC_7450 +.Tn PowerPC +MPC7450 CPUs. +.It Li PMC_CPU_PPC_E500 +.Tn PowerPC +e500 Core CPUs. +.It Li PMC_CPU_PPC_970 +.Tn IBM +.Tn PowerPC +970 CPUs. +.It Li PMC_CPU_PPC_POWER8 +.Tn IBM +.Tn POWER8 and +.Tn POWER9 +CPUs. +.It Li GENERIC +Generic +.It Li PMC_CPU_ARMV7_CORTEX_A5 +.Tn ARMv7 +.Tn Cortex A5 +CPUs. +.It Li PMC_CPU_ARMV7_CORTEX_A7 +.Tn ARMv7 +.Tn Cortex A7 +CPUs. +.It Li PMC_CPU_ARMV7_CORTEX_A8 +.Tn ARMv7 +.Tn Cortex A8 +CPUs. +.It Li PMC_CPU_ARMV7_CORTEX_A9 +.Tn ARMv7 +.Tn Cortex A9 +CPUs. +.It Li PMC_CPU_ARMV7_CORTEX_A15 +.Tn ARMv7 Cortex A15 +CPUs. +.It Li PMC_CPU_ARMV7_CORTEX_A17 +.Tn ARMv7 +.Tn Cortex A17 +CPUs. +.It Li PMC_CPU_ARMV8_CORTEX_A53 +ARMv8 +.Tn Cortex A53 +CPUs. +.It Li PMC_CPU_ARMV8_CORTEX_A57 +ARMv8 +.Tn Cortex A57 +CPUs. +.It Li PMC_CPU_ARMV8_CORTEX_A76 +ARMv8 +.Tn Cortex A76 +CPUs. .El .Ss Supported PMCs -PMC supported by this library are named by the +PMCs supported by this library are named by the .Vt enum pmc_class enumeration. -Supported PMC kinds include: +Supported PMC classes include: .Pp -.Bl -tag -width "Li PMC_CLASS_IAF" -compact +.Bl -tag -width "Li PMC_CLASS_POWER8" -compact .It Li PMC_CLASS_IAF Fixed function hardware counters presents in CPUs conforming to the .Tn Intel @@ -187,6 +239,18 @@ Programmable hardware counters present in CPUs. .It Li PMC_CLASS_TSC The timestamp counter on i386 and amd64 architecture CPUs. +.It Li PMC_CLASS_ARMV7 +.Tn ARMv7 +.It Li PMC_CLASS_ARMV8 +.Tn ARMv8 +.It Li PMC_CLASS_PPC970 +.Tn IBM +.Tn PowerPC +970 class. +.It Li PMC_CLASS_POWER8 +.Tn IBM +.Tn POWER8 +class. .It Li PMC_CLASS_SOFT Software events. .El @@ -361,10 +425,10 @@ driver will send a PMC owning process a signal if: .Bl -bullet .It -If any process-mode PMC allocated by it loses all its +any process-mode PMC allocated by it loses all its target processes. .It -If the driver encounters an error when writing log data to a +the driver encounters an error when writing log data to a configured log file. This error may be retrieved by a subsequent call to .Fn pmc_flush_logfile . @@ -409,7 +473,7 @@ and process scope PMCs are detached from their targets using function .Fn pmc_detach . .It -Before the process exits, its may release its PMCs using function +Before the process exits, it may release its PMCs using function .Fn pmc_release . Any configured log file may be closed using function .Fn pmc_configure_logfile . From nobody Wed Jan 18 21:05:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxyw61VQLz2t0fW; Wed, 18 Jan 2023 21:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxyw60nfXz42tx; Wed, 18 Jan 2023 21:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674075942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=baH/tLL2tyLXBQxvdzwD5IdYTMTmCojMVybPSP65aUU=; b=ibuxUsF/Q+tSVcrbj7zOequnKYKh/z4YWywGzGqSbjZM54hpA1+nRFh7F9MO3TYrBynCxM nG+Zq6hJMNGJaZaYNOXv0na+boGZKrX3yeTKSA3PfkYdDNCgKfvajGUUc4F2+tO0ViGzhj 7zvh8U7Om+kh0OslAjcrAbwqEsVuJsz9G5ZZ9Tz99BuBuTBfx4EFZ8cUmsmacpLBC1mFrL xNNShEq+WpSWYym2UFjuJBCRAEZ8Ya0D1SsqdzD5nv4X97Dt/7l2TB+Pk4fiqfNoUonN16 wW6Pp9PmHb6tiDrvwUXj7Jx+cGc1IXVfXjipWmZA0vSi9/X0J6gr7GRiMejbeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674075942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=baH/tLL2tyLXBQxvdzwD5IdYTMTmCojMVybPSP65aUU=; b=EI9WEvRASJ9k6yGmwhCOWLc/7aSWErTxuLTKCTMSbETy+3XyLYzfJcAzc940qtbIQ7iCdt vTlXLQlwjimlccsglLvt7cwtqvKtjfeKsrZ/lsEhPGhqp7DKXMEqUNqspZ+o3rlnLoUVqU obGcq2o7KwjxRtdpnGnFlsk1oW7xMRQL1nSMKTlGVDvZZ6XQRZntaFHpW0oV8nlevavGFP Q85yk18TdqgYlQkYU243k/smKUO26m8W5QiZ89R4ZjH7pvgU7m1cjk+mKhij2e9NG0Vsp9 eq7hJkfAJt9sBsHUwM0NB7rpFUyiJuz7+8Uz4WqifD7qprzE3raYIqfqsBXGYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674075942; a=rsa-sha256; cv=none; b=E1ILFA/F4jqSjRPfjJrIFL+lRXazih6c3UCe21gppv3+pclgmpOln6pY+P0wmwnVtQuerD 2wbOSBRYaiG0ZyHD4RsK0K5S7OazgaR/fCD+72b0qnJxkLxdRRgfhJkRiBttzj+BubU69x e6HHyIPNVmRrHm+/ZVi7dwPnbhN5TT1G2o8zCYrsxvicIOGpZv9Q/GPRsdaEmHnfUsOc9x Le9xl7DTN4Zaa9+d6g62kg7u5ejKHcAsSgbJIoYKi5E8+lfgRAC1VM/uHSuV4afW86VShO vSec0vHeM3w5X57Tqc7Mm+CKal+KPR8uXVGlLcBtafZhuNR2I6M4NI580MrKuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxyw56hqyzQ6d; Wed, 18 Jan 2023 21:05:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IL5fns040366; Wed, 18 Jan 2023 21:05:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IL5fig040365; Wed, 18 Jan 2023 21:05:41 GMT (envelope-from git) Date: Wed, 18 Jan 2023 21:05:41 GMT Message-Id: <202301182105.30IL5fig040365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: fd5e9210598c - main - Add CPU Ident for Qualcomm Kryo 400 (used in MS Dev Kit) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd5e9210598cfafbecc05b5ec03da25483833f90 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=fd5e9210598cfafbecc05b5ec03da25483833f90 commit fd5e9210598cfafbecc05b5ec03da25483833f90 Author: Allan Jude AuthorDate: 2022-12-20 21:31:38 +0000 Commit: Allan Jude CommitDate: 2023-01-18 21:04:49 +0000 Add CPU Ident for Qualcomm Kryo 400 (used in MS Dev Kit) Reviewed by: imp Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37767 --- sys/arm64/arm64/identcpu.c | 10 +++++++++- sys/arm64/include/cpu.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 4f176ceef0b8..dadb589e9294 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -199,6 +199,7 @@ static const struct cpu_parts cpu_parts_arm[] = { { CPU_PART_NEOVERSE_N1, "Neoverse-N1" }, { CPU_PART_NEOVERSE_N2, "Neoverse-N2" }, { CPU_PART_NEOVERSE_V1, "Neoverse-V1" }, + { CPU_PART_NEOVERSE_V2, "Neoverse-V2" }, CPU_PART_NONE, }; @@ -215,6 +216,13 @@ static const struct cpu_parts cpu_parts_apm[] = { CPU_PART_NONE, }; +/* Qualcomm */ +static const struct cpu_parts cpu_parts_qcom[] = { + { CPU_PART_KRYO400_GOLD, "Kryo 400 Gold" }, + { CPU_PART_KRYO400_SILVER, "Kryo 400 Silver" }, + CPU_PART_NONE, +}; + /* Unknown */ static const struct cpu_parts cpu_parts_none[] = { CPU_PART_NONE, @@ -237,7 +245,7 @@ const struct cpu_implementers cpu_implementers[] = { { CPU_IMPL_INTEL, "Intel", cpu_parts_none }, { CPU_IMPL_MARVELL, "Marvell", cpu_parts_none }, { CPU_IMPL_NVIDIA, "NVIDIA", cpu_parts_none }, - { CPU_IMPL_QUALCOMM, "Qualcomm", cpu_parts_none }, + { CPU_IMPL_QUALCOMM, "Qualcomm", cpu_parts_qcom }, CPU_IMPLEMENTER_NONE, }; diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 2318c9d54cf3..280a759a4f06 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -111,6 +111,7 @@ #define CPU_PART_CORTEX_X1C 0xD4C #define CPU_PART_CORTEX_A715 0xD4D #define CPU_PART_CORTEX_X3 0xD4E +#define CPU_PART_NEOVERSE_V2 0xD4F /* Cavium Part numbers */ #define CPU_PART_THUNDERX 0x0A1 @@ -126,6 +127,10 @@ /* APM / Ampere Part Number */ #define CPU_PART_EMAG8180 0x000 +/* Qualcomm */ +#define CPU_PART_KRYO400_GOLD 0x804 +#define CPU_PART_KRYO400_SILVER 0x805 + #define CPU_IMPL(midr) (((midr) >> 24) & 0xff) #define CPU_PART(midr) (((midr) >> 4) & 0xfff) #define CPU_VAR(midr) (((midr) >> 20) & 0xf) From nobody Wed Jan 18 21:10:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxz254LYzz2t1CZ for ; Wed, 18 Jan 2023 21:10:53 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxz252kfbz43VY for ; Wed, 18 Jan 2023 21:10:53 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f51.google.com with SMTP id k16so125053wms.2 for ; Wed, 18 Jan 2023 13:10:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dqJtMbgcnlhC67gdMHi6/DpMdEHJ1ZMQzd8tUX7uL0o=; b=mlczpMAx7isJZtZqGXKpGc9nSFrO8oXDfaT7OPWuCv5M/9qtfn+YcFXNA92KaWRzkX BVEY6KSh1HPc64sJFd7voqXqm/bmQahE8avoRur2gSyAxnAtugMDZpCgpWtdSDe9B3FT gGG3lzNhsXy5h8Rc7YW7DlE2RWEaNmZ74irCAwUr5JXa/nJ9C87PVlMVuGXGoUhno8ei +DE/2yUkANI+mUt6SAqH+wHEBSf1iljsa29Mp+YuLj3ChPzl82bmrv3olbKI0FQhSctX rheFfD41w+e2PByVN3AfYKhWS+B4BAjodpVJZRr2q89sISf3MWWpuzA8C6N263WW56eJ OmOg== X-Gm-Message-State: AFqh2kqtLYWW+EOdPnd94Dqy0utND14a8ZuLTQH2GQSJSK5/yi4VJhW3 FeUmVh4Jf4CMt4eovGMQ3E+qXg== X-Google-Smtp-Source: AMrXdXuKgTh84/ukYhiXJhBwtTLQ7Xg9bt5mlnudCCfgYDE73V1o3OgtkRlQRw9k2TMlF8Qro94qlA== X-Received: by 2002:a05:600c:3ac8:b0:3da:f67c:aca6 with SMTP id d8-20020a05600c3ac800b003daf67caca6mr7983411wms.34.1674076251503; Wed, 18 Jan 2023 13:10:51 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id hu29-20020a05600ca29d00b003db0f4e12c8sm2704739wmb.34.2023.01.18.13.10.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2023 13:10:51 -0800 (PST) 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: fd5e9210598c - main - Add CPU Ident for Qualcomm Kryo 400 (used in MS Dev Kit) From: Jessica Clarke In-Reply-To: <202301182105.30IL5fig040365@gitrepo.freebsd.org> Date: Wed, 18 Jan 2023 21:10:50 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <85B5BFC4-C076-4959-B214-1ECA1975CA6D@freebsd.org> References: <202301182105.30IL5fig040365@gitrepo.freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4Nxz252kfbz43VY X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 18 Jan 2023, at 21:05, Allan Jude wrote: >=20 > The branch main has been updated by allanjude: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dfd5e9210598cfafbecc05b5ec03da254= 83833f90 >=20 > commit fd5e9210598cfafbecc05b5ec03da25483833f90 > Author: Allan Jude > AuthorDate: 2022-12-20 21:31:38 +0000 > Commit: Allan Jude > CommitDate: 2023-01-18 21:04:49 +0000 >=20 > Add CPU Ident for Qualcomm Kryo 400 (used in MS Dev Kit) >=20 > Reviewed by: imp > Sponsored by: Klara, Inc. > Differential Revision: https://reviews.freebsd.org/D37767 > --- > sys/arm64/arm64/identcpu.c | 10 +++++++++- > sys/arm64/include/cpu.h | 5 +++++ > 2 files changed, 14 insertions(+), 1 deletion(-) >=20 > diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c > index 4f176ceef0b8..dadb589e9294 100644 > --- a/sys/arm64/arm64/identcpu.c > +++ b/sys/arm64/arm64/identcpu.c > @@ -199,6 +199,7 @@ static const struct cpu_parts cpu_parts_arm[] =3D = { > { CPU_PART_NEOVERSE_N1, "Neoverse-N1" }, > { CPU_PART_NEOVERSE_N2, "Neoverse-N2" }, > { CPU_PART_NEOVERSE_V1, "Neoverse-V1" }, > + { CPU_PART_NEOVERSE_V2, "Neoverse-V2" }, This (and the #define) isn't for a Qualcomm core... Jess > CPU_PART_NONE, > }; >=20 > @@ -215,6 +216,13 @@ static const struct cpu_parts cpu_parts_apm[] =3D = { > CPU_PART_NONE, > }; >=20 > +/* Qualcomm */ > +static const struct cpu_parts cpu_parts_qcom[] =3D { > + { CPU_PART_KRYO400_GOLD, "Kryo 400 Gold" }, > + { CPU_PART_KRYO400_SILVER, "Kryo 400 Silver" }, > + CPU_PART_NONE, > +}; > + > /* Unknown */ > static const struct cpu_parts cpu_parts_none[] =3D { > CPU_PART_NONE, > @@ -237,7 +245,7 @@ const struct cpu_implementers cpu_implementers[] =3D= { > { CPU_IMPL_INTEL, "Intel", cpu_parts_none }, > { CPU_IMPL_MARVELL, "Marvell", cpu_parts_none }, > { CPU_IMPL_NVIDIA, "NVIDIA", cpu_parts_none }, > - { CPU_IMPL_QUALCOMM, "Qualcomm", cpu_parts_none }, > + { CPU_IMPL_QUALCOMM, "Qualcomm", cpu_parts_qcom }, > CPU_IMPLEMENTER_NONE, > }; >=20 > diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h > index 2318c9d54cf3..280a759a4f06 100644 > --- a/sys/arm64/include/cpu.h > +++ b/sys/arm64/include/cpu.h > @@ -111,6 +111,7 @@ > #define CPU_PART_CORTEX_X1C 0xD4C > #define CPU_PART_CORTEX_A715 0xD4D > #define CPU_PART_CORTEX_X3 0xD4E > +#define CPU_PART_NEOVERSE_V2 0xD4F >=20 > /* Cavium Part numbers */ > #define CPU_PART_THUNDERX 0x0A1 > @@ -126,6 +127,10 @@ > /* APM / Ampere Part Number */ > #define CPU_PART_EMAG8180 0x000 >=20 > +/* Qualcomm */ > +#define CPU_PART_KRYO400_GOLD 0x804 > +#define CPU_PART_KRYO400_SILVER 0x805 > + > #define CPU_IMPL(midr) (((midr) >> 24) & 0xff) > #define CPU_PART(midr) (((midr) >> 4) & 0xfff) > #define CPU_VAR(midr) (((midr) >> 20) & 0xf) From nobody Wed Jan 18 21:19:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxzCV5NTTz2t23Y; Wed, 18 Jan 2023 21:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxzCV4vGXz44qF; Wed, 18 Jan 2023 21:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674076742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U/k6hEkQcS3omuM8JcgCek6q6E9BV9pJwCbTb3yuXEo=; b=QgqeSHlovzvRZhx7MjjviXci+h/ghH0uq5vLuJl41pcGzNnOzMqTut6bkdlvplnkzyzKmY C4U9+1s6eNvDvH1ua/51dSuCqh/LvmFoER8jbMr+lmSGhp2/FPj4mtNpJh5XghTvYug6FI zqbzuqjOS0a4HCs+b8GCPOgrr+Ucxil1E6qinj73uzJy94QJsXzDiliZcsVw74JLd01K3r XU/QMlMyVck9oUke4f1f811t2+szIOcLDfJ88AvQ9q0XpIgOrVZQBPBEd4zHqB3viwqa3J vbtfMHP7DchbaFit1PnQtFd+Pv7/sdkxah74afFXG6zbLIjZCVVGomXM/IbAmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674076742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U/k6hEkQcS3omuM8JcgCek6q6E9BV9pJwCbTb3yuXEo=; b=xlinOR9TQix56UY609dc47rw1Rp2WcgE/q+oRsdDsCT5q5b+K7xHE6K2uqljyDnSDaEkxr CS3cF8s3mlpq7OmN8lKEdSd7E5he9qItA6si0qO3CXUthszLdLdMADXUMQiL46L9vbN8AQ SwBf6/U7IYK/r5mjDzBNxGTAummKEXpQH6smxryk92DzEj793drBOi/sPHdp/z62pns6F7 a53ya7LhsBTBD8cBB5i8hvLwygvdoGJh6f+fBmx5FFbApGgcxzRh9x8WslP7B8EER+ldin pOjDQd/03KQXYJK9xYZY54C0Zepbp9efFMmCEeCjX+S7rTMxXZiUgeRB2JG01Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674076742; a=rsa-sha256; cv=none; b=UIsr7bEfHXn8xysXv0GPGAKSFo/dWTKSLKqcRWX3fBikgQvGCnbUNu+V0tfg4bTpsqDXTg DLB8DW/ChqO4P+7sNYpSNgt5Wn5YtSxHpsu8apDcM+tgMOFpDlDI7A9NP147wWtUufrpe6 e6rRNhaN/ZRVDnv0BmiUR9F+pk5kdjUkfx8Fh57t5XsPVtrWN0xA7UPW+XkB1rV+l3+sX/ VQwDNDQqtGQaSWwdy+LOD0JT49BL57h1zqBvdk9X53r3u5QzXQV47xAP3jR18NtSi8Kwr0 r39+DVgcHPHxlCtQM099sBquDStgNvXU+KMZUVFR0DSCi4/yQ/NETu6VPC8x5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxzCV3xN2zQhF; Wed, 18 Jan 2023 21:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30ILJ2AW055115; Wed, 18 Jan 2023 21:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30ILJ2cw055114; Wed, 18 Jan 2023 21:19:02 GMT (envelope-from git) Date: Wed, 18 Jan 2023 21:19:02 GMT Message-Id: <202301182119.30ILJ2cw055114@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: eac971545baa - main - if_ipsec(4): protect against user supplying unknown address family List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: eac971545baa3857903e0107439f00d8438c5847 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eac971545baa3857903e0107439f00d8438c5847 commit eac971545baa3857903e0107439f00d8438c5847 Author: Konstantin Belousov AuthorDate: 2023-01-17 01:37:45 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-18 21:18:39 +0000 if_ipsec(4): protect against user supplying unknown address family Reviewed by: ae, hselasky Sponsored by: NVIDIA Networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38093 --- sys/net/if_ipsec.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index b170ac177a64..3952b5edb681 100644 --- a/sys/net/if_ipsec.c +++ b/sys/net/if_ipsec.c @@ -813,13 +813,17 @@ ipsec_srcaddr(void *arg __unused, const struct sockaddr *sa, { struct ipsec_softc *sc; struct secasindex *saidx; + struct ipsec_iflist *iflist; /* Check that VNET is ready */ if (V_ipsec_idhtbl == NULL) return; NET_EPOCH_ASSERT(); - CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { + iflist = ipsec_srchash(sa); + if (iflist == NULL) + return; + CK_LIST_FOREACH(sc, iflist, srchash) { if (sc->family == 0) continue; saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sa->sa_family); @@ -1015,12 +1019,18 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockaddr *src, struct sockaddr *dst, uint32_t reqid) { struct epoch_tracker et; + struct ipsec_iflist *iflist; struct secpolicy *sp[IPSEC_SPCOUNT]; int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); /* Allocate SP with new addresses. */ + iflist = ipsec_srchash(src); + if (iflist == NULL) { + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + return (EAFNOSUPPORT); + } if (ipsec_newpolicies(sc, sp, src, dst, reqid) == 0) { /* Add new policies to SPDB */ if (key_register_ifnet(sp, IPSEC_SPCOUNT) != 0) { @@ -1033,7 +1043,7 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockaddr *src, for (i = 0; i < IPSEC_SPCOUNT; i++) sc->sp[i] = sp[i]; sc->family = src->sa_family; - CK_LIST_INSERT_HEAD(ipsec_srchash(src), sc, srchash); + CK_LIST_INSERT_HEAD(iflist, sc, srchash); } else { sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (ENOMEM); From nobody Wed Jan 18 21:20:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxzF52G1kz2t2Hc; Wed, 18 Jan 2023 21:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxzF51QJgz45SG; Wed, 18 Jan 2023 21:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674076825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=niM/hyAWbme3ihsBSHxqWvN2lsTHagrnuBylqNfKag4=; b=GuWM1JgCzZdQB2/X9al4/oJXjOK00OHHr9jm3BkPHlDZ9rEoq7JQtVy3k+DOuMNZVZ6esm woUK3U9KWeNTHwRkMbiS6W+D8kOQNsQ3Mxl0lHyNQvv2xu8OIFZ2iIhkerYnIs55r6T1rQ usEUMU1cmEfVjJJ4ZqXdFUO8NeXf9XxIjUyI6/Yc4ANppLCUxtF09uvbuQ+68qf7tlZGoC BdVK/EDkrfl3sVL5Y3zJpmG1+M8GaX3VEXPlictgfpnT3a7bSJIZn1aH5zlwtu/oKA2QZn 1lbAVC6VXEDuDy9tZ0x8MU+fUHAB4B84Z7J3z0G1vekLGbMjoigsyNV2xy+ozQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674076825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=niM/hyAWbme3ihsBSHxqWvN2lsTHagrnuBylqNfKag4=; b=ogIMRPQ4L6admDTo+n8OgfcjWWnx6Rx3tt1YNtwt7zOsJGt3a5OK6E8aSU6ActhhLk0y0n gxxAs0sLnuya4Iu89iphzYS7N5CY9/on7LReyR5SPsN8x4Efj+re5p2dADmxSFH76NRy0b YsnwHL/7JfsQbdpCKRWJ13rh/rg3wKMnKOUjf4Ld+X2Iw6s9gCcZ9s8uASNvGsRJXBZGvw goWY7fJzJTu72ToVvNlI45M5c9Bn7S+hCyt+o2b+kR64BMN/sLuK6/IhnkLUIu7AzIhC61 C9S+TrxM4+olHiCQnMt5azteY691LflL6lyFZ6u4Wmci9Tuj0r+2t1FSJBmWZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674076825; a=rsa-sha256; cv=none; b=EMn4f/ikDiTTHKcW7UVh/1xDYLwd84/ppb4Li/XogZD0+blhmuF6RGLoKEdvQqDhyoToL5 +EpkMUb0EwRGcasnEueLKMBZhVzbS2HV039Ro0QKT6K0XMe5xGcKuK9NfHmnbRcPv3LMNT J27n1OM+x14zsrZTzLEkxAf17DMW+w6JA5jVw39fbr/tZ7jsk7ROMkrrkBrlkp44u2xR5L YbtitirjBq5GSl9qpMVzL2XRD0jQUUa+l3ikc+9sF70aEVfr7zss9xG1lHlh3sKdgKUbtc YTzeCQkbBIiI1d6p0z2K6qtL/bxUAQBsl1SqfEJ+Pt6OoXD/5ouW0BRkaFf36w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxzF50T5szR46; Wed, 18 Jan 2023 21:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30ILKOJP063784; Wed, 18 Jan 2023 21:20:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30ILKOqS063783; Wed, 18 Jan 2023 21:20:24 GMT (envelope-from git) Date: Wed, 18 Jan 2023 21:20:24 GMT Message-Id: <202301182120.30ILKOqS063783@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: b1d10b49e24a - main - if_ipsec(4): handle situations where there are no policy or SADB entry for if List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b1d10b49e24a4fd3af80f8491cd95bd0766ca1f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b1d10b49e24a4fd3af80f8491cd95bd0766ca1f1 commit b1d10b49e24a4fd3af80f8491cd95bd0766ca1f1 Author: Konstantin Belousov AuthorDate: 2023-01-17 01:59:56 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-18 21:18:39 +0000 if_ipsec(4): handle situations where there are no policy or SADB entry for if Reviewed by: ae, hselasky Sponsored by: NVIDIA Networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38093 --- sys/net/if_ipsec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index 3952b5edb681..a2f690b4cffb 100644 --- a/sys/net/if_ipsec.c +++ b/sys/net/if_ipsec.c @@ -666,6 +666,10 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sc->family); + if (saidx == NULL) { + error = ENXIO; + break; + } switch (cmd) { #ifdef INET case SIOCGIFPSRCADDR: @@ -783,6 +787,8 @@ ipsec_set_running(struct ipsec_softc *sc) int localip; saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sc->family); + if (saidx == NULL) + return; localip = 0; switch (sc->family) { #ifdef INET From nobody Wed Jan 18 21:23:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NxzJz0pHWz2t2tD; Wed, 18 Jan 2023 21:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NxzJz0Grjz45yw; Wed, 18 Jan 2023 21:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674077027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0P9lShW6HGboYSyKWqZKSex4U7BjP1OZ7ZfGdqaNIbs=; b=DYKRiRCKPqqHVvKfUpoT6ZunpVobsX5Rjlm9liiKPbjrMdFVdGm/2vz31h8EpQ16FLTHPq FnopSx9g5r9kIzqs5RvDqjXD5bOQApTFWIMBs8c60x43XbI50x+6cfveMUmHDHe3gD6rPA N8p4dpi17RKPUJADyNRLOqUyrlM+TmOzCmdZvAQ8SEQvqJNei40nr3CQ5Ieg5U2it8Ymao vVqKR4Xh2br3CUkX6jBaRk0jldwsnyOdbUB+eMgbWFhdikGgeOFjcZQ+yI3mH6Jp/HnOyv DIoTwH1/ZoHNVbcbKCoWZwrSjAU37nwHoGFZ2NJv+jKDOQSKBMJe3lxnBn3R7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674077027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0P9lShW6HGboYSyKWqZKSex4U7BjP1OZ7ZfGdqaNIbs=; b=qU0IUQSW5IU4jOrv2IGr9HA1AaoXmRjS0eDRbQ/jQDofwNjhtOWqH7v+85evOP9X+278uY 8zoxz0ZAN7Q2ThoBb5a0dVCgr45Vwgm1WQz0KspaF8fRHzwuKkDNHpBPjnXpHxcdPHwJJV s+RUcdkherXrqoN5CEc5LTGpz6l82ep4NZATS81lWl2hrSpYqoiQNwi0OYPlhsvdzF1C0+ Q0h7G1EB0LiyWE494AMfEJvwAVhNmOVKAHrGR9NbX1WoVrlxyB176feDnoaYaU03z3WwUA krzAPN+a8pX6IK/+3iVxhpdgHtAOgyXAEyGViL9nc68EPqvUyr7SBJDJpXI2dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674077027; a=rsa-sha256; cv=none; b=OpJ6a9CouyfhOW1Sc0sTiMFgpv59PnSH9fMou3iTAwU1BBtYs/M+HqlCrW+LAQ6KrBkfNi 3EFw+nh7ULc227kgndIdlQiLcfIpfJQ7K5O6no3pTiNXTG7yhMHtepYnyuCYtbn3Eeqx6g SUidlj5RHgEvx0Y/Gs6IMTDPjy8vMJ/n1eJAUgmOa4+Pg6XsaGzMcECcDoFvqc5FtCtK+2 0oARFqZrkv7gFLuLhuOShqFs7farU6eeGcSLbap9Zqr3l8tEKNVPlW/yh0IVwl6PS6W2ti E2cHrERqyC2/ITRPUoZjXzmoRgTVHQ2Hr4jPw2qZxBCRoFAYKQ88bl+V1Xgq4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NxzJy6S3CzQyn; Wed, 18 Jan 2023 21:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30ILNks5069238; Wed, 18 Jan 2023 21:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30ILNk7g069237; Wed, 18 Jan 2023 21:23:46 GMT (envelope-from git) Date: Wed, 18 Jan 2023 21:23:46 GMT Message-Id: <202301182123.30ILNk7g069237@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: 424f1296bd73 - main - ipsec.c: typos in the 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 424f1296bd73f2661b556ddfdfb4bcc8f9df898a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=424f1296bd73f2661b556ddfdfb4bcc8f9df898a commit 424f1296bd73f2661b556ddfdfb4bcc8f9df898a Author: Konstantin Belousov AuthorDate: 2021-09-04 13:42:33 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-18 21:22:35 +0000 ipsec.c: typos in the comment Sponsored by: NVIDIA Networking MFC after: 3 days --- sys/netipsec/ipsec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c index 94eb68658e30..08a226b1123a 100644 --- a/sys/netipsec/ipsec.c +++ b/sys/netipsec/ipsec.c @@ -1011,7 +1011,7 @@ ipsec_check_history(const struct mbuf *m, struct secpolicy *sp, u_int idx) /* * Check security policy requirements against the actual * packet contents. Return one if the packet should be - * reject as "invalid"; otherwiser return zero to have the + * rejected as "invalid"; otherwise return zero to have the * packet treated as "valid". * * OUT: From nobody Wed Jan 18 22:07:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny0H84Lktz2t8mM; Wed, 18 Jan 2023 22:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny0H83jjKz4CWF; Wed, 18 Jan 2023 22:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674079636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z8EKZs65nn9BJljAEx8MxI/21hmwZ2rRKIls7YvsFe8=; b=jofMpkCcAvzVHvSwSUFDCICFrVyJ2QhiCX5tLQwTLvNkSNF7fBQb0tUEZuJRVOQXr+dBSa z7ghQWvDktHqW9MYjaYrQFauoZbm92o+YWKpa3I5T+TsjcvgCgbOlHeJYbM8wvZectbj8G AwG0PdgulWsLNXBke3bCuWeX2201SeE0NmxrS6pCRGQxyX5KNiCQSoVF2OIwiIhHs8R5VL EcRPGC9/PTXq+DcbhLy++OdtjOGBOPNZZQKNek+hqtVfFu43e6dl+LkwRsrUtIYBWgNmvH hBMZJ2Ho0DRqf8xISZZroq9vKELMFabDcQm4rv4eX/EkKamh2yKnOfgyjW31Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674079636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z8EKZs65nn9BJljAEx8MxI/21hmwZ2rRKIls7YvsFe8=; b=dnnDcr46pGGyWwWqj/w0D6AY0BxFmjJur7S1ghGuct9Wy7cF2+wrtnjdddlABQ+UXU/I2R qgfrBBDnFPDmf2b9ZQ8sY4g5VEXDd470q60j+pFFuca+U73/0epeXmpHGTYQ3t6QRQAjLo 2zeInqBN8Kwml+jSSGSzWQTlT3sYguLIF61xdAIIkVrA3noh2+R1ng0QosWNqElMxV5Tbn Hh0v9bX+wvK4mTCnDhXFM4LwAT3XqQ2eZcXpv0CkkPgxAzTSFXvbOxZE8fySkFTwM+Jbi2 rXoFoinm7Lq6/PfAqCjUC5ne9Bd21bWaVGlhrJeMHTfhN79kPx2D07BbjBAkhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674079636; a=rsa-sha256; cv=none; b=A5MH6jOj9LXQE3KGdwHtbCJG62rZ9FqCyPmoPsaa8wNUqy+1kiRaKS5iUcQAE+2dgKh5eF Jiwyu3Ztos2cYsiARXiRztcItSwsdf/71w1ymyaydTLvWAW/5+ut/osPT0ool7EfA9sB34 s4fY29gr1cnO9a/mUyWWWH0j+r0fNAM+/WubJbEJYFybK6sLRKqA8P0OQYq0wmvpgda/j5 ZJKfhN17B9K52fvsntBRAFVmMyAqsWJ3j65vQx7/c6U1/OEMt5LT3KYvj6htE09kZXKTX9 wxljlJvyJiEcDWm2HNFWlXSfeDRAgZS7oSl7Hncl2Ru9POper8nJXtb9Kr3wsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny0H82m8WzRj3; Wed, 18 Jan 2023 22:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30IM7Gea027365; Wed, 18 Jan 2023 22:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IM7Gvf027364; Wed, 18 Jan 2023 22:07:16 GMT (envelope-from git) Date: Wed, 18 Jan 2023 22:07:16 GMT Message-Id: <202301182207.30IM7Gvf027364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: bb651c77f5f7 - main - linuxkpi: Define `hrtimer_try_to_cancel()` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb651c77f5f71a38dd90b2eee214e7a2224421a7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bb651c77f5f71a38dd90b2eee214e7a2224421a7 commit bb651c77f5f71a38dd90b2eee214e7a2224421a7 Author: Jean-Sébastien Pédron AuthorDate: 2023-01-11 01:00:57 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-18 22:02:24 +0000 linuxkpi: Define `hrtimer_try_to_cancel()` It is the same as callout_stop(9) but the return values are different. Reviewed by: hselasky Approved by: hselasky Differential Revision: https://reviews.freebsd.org/D38081 --- sys/compat/linuxkpi/common/include/linux/hrtimer.h | 2 ++ sys/compat/linuxkpi/common/src/linux_hrtimer.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/hrtimer.h b/sys/compat/linuxkpi/common/include/linux/hrtimer.h index 23e707d906b4..4a63db80cc12 100644 --- a/sys/compat/linuxkpi/common/include/linux/hrtimer.h +++ b/sys/compat/linuxkpi/common/include/linux/hrtimer.h @@ -53,6 +53,7 @@ struct hrtimer { }; #define hrtimer_active(hrtimer) linux_hrtimer_active(hrtimer) +#define hrtimer_try_to_cancel(hrtimer) linux_hrtimer_try_to_cancel(hrtimer) #define hrtimer_cancel(hrtimer) linux_hrtimer_cancel(hrtimer) #define hrtimer_init(hrtimer, clock, mode) do { \ @@ -79,6 +80,7 @@ struct hrtimer { } while (0) bool linux_hrtimer_active(struct hrtimer *); +int linux_hrtimer_try_to_cancel(struct hrtimer *); int linux_hrtimer_cancel(struct hrtimer *); void linux_hrtimer_init(struct hrtimer *); void linux_hrtimer_set_expires(struct hrtimer *, ktime_t); diff --git a/sys/compat/linuxkpi/common/src/linux_hrtimer.c b/sys/compat/linuxkpi/common/src/linux_hrtimer.c index a56485512a14..5d9b376f9561 100644 --- a/sys/compat/linuxkpi/common/src/linux_hrtimer.c +++ b/sys/compat/linuxkpi/common/src/linux_hrtimer.c @@ -65,6 +65,28 @@ linux_hrtimer_active(struct hrtimer *hrtimer) return (ret); } +/* + * Try to cancel active hrtimer. + * Return 1 if timer was active and cancellation succeeded, 0 if timer was + * inactive, or -1 if the timer is being serviced and can't be cancelled. + */ +int +linux_hrtimer_try_to_cancel(struct hrtimer *hrtimer) +{ + int ret; + + mtx_lock(&hrtimer->mtx); + ret = callout_stop(&hrtimer->callout); + mtx_unlock(&hrtimer->mtx); + if (ret > 0) { + return (1); + } else if (ret < 0) { + return (0); + } else { + return (-1); + } +} + /* * Cancel active hrtimer. * Return 1 if timer was active and cancellation succeeded, or 0 otherwise. From nobody Wed Jan 18 22:07:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny0Hn0hHbz2t91f; Wed, 18 Jan 2023 22:07:49 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny0Hm6LrJz4D8K; Wed, 18 Jan 2023 22:07:48 +0000 (UTC) (envelope-from mhorne@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674079668; h=from:from:reply-to:subject: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=0z39l9jrtcycb1/9hiFXgdt3zQYtY7X/ARSg0z5ZDX8=; b=t/I7k8GWakr6ynZO5W8pipe3W8lEAAWVBEjGeBZi9zXCc0xoQTFHMfJiY6atTYAHrJFhsU qw2CuLvS+jjICjX2VVLBdchBCVeVMR4CtOA7AnAt/Wc1RLYobXAqbArBUpqxAHBwSUis22 Xi11dBEIM3DnhKj6xdTM3ZelqIPWXFGu4NqNbJ7TGei4NGmGFE3ohG/CiFRhuBxyn6yTjt gDcztNWWoRCPKQOBrqit6FQKkTuomJn66iyETwRIgGJZcdolxV2l+pDwzk79IbBNxbAdkU 5u1+AJ6jiJQROLkBHY8nQshVr610F4b8e971xsca1xRjiIARY3Hz0SR72VfASw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674079668; h=from:from:reply-to:subject: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=0z39l9jrtcycb1/9hiFXgdt3zQYtY7X/ARSg0z5ZDX8=; b=XFtUW59m2YLTAPeki85/kaedcYzEIsn7Gxeg44nG2FcONJ+3X3+TsWnnxYH07QLMcGj8oV IAgsHPi+FJTsioLoaQEDkckohYcPAnWDc2UYY8beCfScABKmHxKBiywCb/yWQeIzYWFg+l brQloe4f/IbDjFCyqTkN0Hl8S8cy+Fx0t/qA2Dun84WLuxrpB+1DNdp9R2WGie07hzgbXm FEILuQVqMBtoyDDp13AM8wc8pkuBZ4Zp400Oh9VsB/Th41dKPliRaJ1mre1I40vth3O/vJ pMTjeLaqRwJ+zizEZmbn5HTiox4/nr+44vlWx4y1vVY5caT8xHG10RluB5Nnxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674079668; a=rsa-sha256; cv=none; b=pGBMyNztWVbkjE8EytSydyOWP0H8/+30woJeE6abBzM+VOISlgUfD+jtGgrGJb46ntvoUB 7HwMNuLY9W4FDS3JGgVqc4CNttLdZMuk5t/Z/goBY/3QD6eiX+CC9TG06jxyAHrv3P3YVz /zCVGRMQ1Bhym2A8BKNBnLNJljX7XdKLFTjIZmaG2yZZnJXXI1ayuvIljQOi3jYeHFwCM5 axrMOogg93CN3O03jAVQjq29/FNK8mL9h3oTcxYA2MZwqeCBVhA7W0IVBGFl7acScrKVqJ 6WugtkPMSapm+GB61BzCl/YUs0jKehFbkGguphx4ky0qTZKX+Zzhk5HYeJ5m2g== Received: from [192.168.1.151] (host-173-212-76-127.public.eastlink.ca [173.212.76.127]) (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: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Ny0Hm3WrDzSt9; Wed, 18 Jan 2023 22:07:48 +0000 (UTC) (envelope-from mhorne@freebsd.org) Message-ID: Date: Wed, 18 Jan 2023 18:07: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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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.6.1 Subject: Re: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init Content-Language: en-CA To: Brooks Davis , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202301171638.30HGcP3C091184@gitrepo.freebsd.org> From: Mitchell Horne In-Reply-To: <202301171638.30HGcP3C091184@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 1/17/23 12:38, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b75062f23431fbabef1e7d665cae270b144f71b1 > > commit b75062f23431fbabef1e7d665cae270b144f71b1 > Author: Brooks Davis > AuthorDate: 2023-01-17 16:36:15 +0000 > Commit: Brooks Davis > CommitDate: 2023-01-17 16:37:42 +0000 > > riscv: Fix thread0.td_kstack_pages init > > Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized > thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an > include of opt_kstack_pages.h it used the fallback value of 4 from > machine/param.h. Does this mean that we could/should include opt_kstack_pages.h within machine/param.h (under #ifdef _KERNEL)? This header is both a consumer and provider of the KSTACK_PAGES definition, by virtue of the #ifndef. I think the hidden dependency should be avoided, if possible. Of course, the problem at hand has been fixed and we want to keep direct consumers of KSTACK_PAGES to a minimum, but I think the point still stands. Mitchell > This meant that increasing KSTACK_PAGES in the kernel > config resulted in a panic in _epoch_enter_preempt as the following > assertion was false during network stack setup: > > MPASS((vm_offset_t)et >= td->td_kstack && > (vm_offset_t)et + sizeof(struct epoch_tracker) <= > td->td_kstack + td->td_kstack_pages * PAGE_SIZE); > > Switch to initializing with kstack_pages following other architectures. > > Reviewed by: imp, markj > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D38049 > --- > sys/riscv/riscv/machdep.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c > index b03d45b018ec..0821a29d11c1 100644 > --- a/sys/riscv/riscv/machdep.c > +++ b/sys/riscv/riscv/machdep.c > @@ -291,7 +291,7 @@ init_proc0(vm_offset_t kstack) > > proc_linkup0(&proc0, &thread0); > thread0.td_kstack = kstack; > - thread0.td_kstack_pages = KSTACK_PAGES; > + thread0.td_kstack_pages = kstack_pages; > thread0.td_pcb = (struct pcb *)(thread0.td_kstack + > thread0.td_kstack_pages * PAGE_SIZE) - 1; > thread0.td_pcb->pcb_fpflags = 0; From nobody Wed Jan 18 23:16:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny1pd1SfHz2v2yC; Wed, 18 Jan 2023 23:16:09 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_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 4Ny1pc63KDz4M7b; Wed, 18 Jan 2023 23:16:08 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id D20B63C0199; Wed, 18 Jan 2023 23:16:02 +0000 (UTC) Date: Wed, 18 Jan 2023 23:16:02 +0000 From: Brooks Davis To: Mitchell Horne Cc: Brooks Davis , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init Message-ID: References: <202301171638.30HGcP3C091184@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Rspamd-Queue-Id: 4Ny1pc63KDz4M7b X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, Jan 18, 2023 at 06:07:47PM -0400, Mitchell Horne wrote: >=20 >=20 > On 1/17/23 12:38, Brooks Davis wrote: > > The branch main has been updated by brooks: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db75062f23431fbabef1e7d66= 5cae270b144f71b1 > >=20 > > commit b75062f23431fbabef1e7d665cae270b144f71b1 > > Author: Brooks Davis > > AuthorDate: 2023-01-17 16:36:15 +0000 > > Commit: Brooks Davis > > CommitDate: 2023-01-17 16:37:42 +0000 > >=20 > > riscv: Fix thread0.td_kstack_pages init > > =20 > > Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized > > thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an > > include of opt_kstack_pages.h it used the fallback value of 4 from > > machine/param.h.=20 >=20 > Does this mean that we could/should include opt_kstack_pages.h within=20 > machine/param.h (under #ifdef _KERNEL)? This header is both a consumer=20 > and provider of the KSTACK_PAGES definition, by virtue of the #ifndef. I= =20 > think the hidden dependency should be avoided, if possible. It's possible we should be doing it in that case, but it's not something we normally do (the only header I can find that does this is sys/terminal.h). If we wanted to do this I'd be tempted to make machine/param.h define some sort of _KSTACK_PAGES_DEFAULT and move the definition of KSTACK_PAGES to sys/param.h. It's a bit unfortunate that the kernel config system means KSTACK_PAGES is only defined if set explicitly and there's no way to tell the opt_ header has been included since it doesn't include guards. -- Brooks From nobody Wed Jan 18 23:39:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny2KP0JNBz2v5JN; Wed, 18 Jan 2023 23:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny2KN6sf7z4Q2r; Wed, 18 Jan 2023 23:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674085161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5hop1fx2g2nGTwOr9tIhtm5QDp1ezkj4qb+oUmDSuN0=; b=XpMwpxpjMIpUe+inF/LbpPcU8qMCibcyFEcrkjLzS4MQB14rpXnxdg2S3Zu27drsm3tCMr Au27fazpidGU26BbElYArnoXokk3X0p43tof0sGM1Dpui61GKBFsihx9vJVB9ioxKy1hBV Tc9wwEuXo6c5WcXvcTgHrPSh9zA24Elxm9O5VoE1eCiwS80r3sy+Zca+DuZJTPyqlxeQFt h1RQh2O+ErgyMjD+36TDvzgNvEOxtQdo9R9zJy6GE2b0FaTmXKBma+eXtako8G8g6ujLqr u6B5g3MFIpqmmGV7irlA+Ybsz7lchEO6AitCYJx3kvLDNC7DgNL53orBgJJ/zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674085161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5hop1fx2g2nGTwOr9tIhtm5QDp1ezkj4qb+oUmDSuN0=; b=pcFadtb6m7YK9b63ZHyTwqjMrBTSumXfy5CvMuXhUc68wKC9QDZ9U2lyblIttSP9O0ypA4 PLLchgBz3vPjd9/IkerxsUuRSUj9SH8Fbap6VArcBwiBbsq9wh6lEU//ubTHKYLfQKkHdS I5iqTHUHcOiOfdNNEz72TAWmZUcsDgPVHobX0EPUK48w7uWqgFbCVewTy8j8f3BrOrY4vb JjrzDjf/nTjnn5sSYYGzY1+SNIbV+IWyliWnoKxNxx/C1Ffuli5c9Xq27XHGzMtWTtRcSA glmeVMF8Nw8NcZ5SZ7+TZ7Eq12SaQm44EKhjcxrgVi/BbyqlNmYDJdQXRvY3rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674085161; a=rsa-sha256; cv=none; b=ARmjYCYPB/OWYZHN1wNPKbMEiPpqmyxqWWy0g3oeyhhiBYlAVqhuAFAe/JGXEXoa9LhK7D ANUM+yihRQpV6STgbYYCckGl8aucRB41/NWswd/fjypfwTHN9pr3Y1pkPPny5I0y5njjfh umRN38nLQqhOiGWDG7l2NPkP8Za7kOUPdDXYvl7qBa/68fwqgoeGfc5hy+IxSfLWDCdU4G /W75dzsEAHGgigEhKr06gq0A+RhYIwgVkpU1l6QP2uSVSa87WtyPvdl9bdOGdWtr8zW1hJ tv0SrLuu3Ykjm7dDBZlcveZn83XRusu6yAhzGfts+5QNRKYc8jTJDYCjwR4jmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny2KN5v7TzVKr; Wed, 18 Jan 2023 23:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30INdKpT056679; Wed, 18 Jan 2023 23:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30INdK04056678; Wed, 18 Jan 2023 23:39:20 GMT (envelope-from git) Date: Wed, 18 Jan 2023 23:39:20 GMT Message-Id: <202301182339.30INdK04056678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 846e4a206fab - main - ktls_disable_ifnet_help: Set curvnet around sorele(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 846e4a206fabf18b7ace01f6a41f65252da3dd95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=846e4a206fabf18b7ace01f6a41f65252da3dd95 commit 846e4a206fabf18b7ace01f6a41f65252da3dd95 Author: John Baldwin AuthorDate: 2023-01-18 23:39:04 +0000 Commit: John Baldwin CommitDate: 2023-01-18 23:39:04 +0000 ktls_disable_ifnet_help: Set curvnet around sorele(). This is required in kernels with VIMAGE such as GENERIC. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/kern/uipc_ktls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 330a7a2dbdcd..ac55268728e9 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -3210,7 +3210,9 @@ ktls_disable_ifnet_help(void *context, int pending __unused) } out: + CURVNET_SET(so->so_vnet); sorele(so); + CURVNET_RESTORE(); if (!in_pcbrele_wlocked(inp)) INP_WUNLOCK(inp); ktls_free(tls); From nobody Wed Jan 18 23:48:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny2X61NL8z2v67F; Wed, 18 Jan 2023 23:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny2X60sdNz3CCg; Wed, 18 Jan 2023 23:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674085718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12/OG0T9hYtcwN6o8Cm65cHVgX+lgirdsCyGvVkbFQ4=; b=xLpXuZE6NNtXtxIKi6N0LAH6xmpeQiPs4X3ztMuYP8Gtil3tZPeoG8k4tuSPhcNGKpykov DufuxBwrAsDMGD4IklH2IRTb+ktHZ7k/wOZiH5MAxdZG/C1rDMcGDKuH97s1ilZ0d4zvQO FbQgrbOW75N5dBkr2QzMXnT1hg4gpJjbjaO/KTSIzyB8iQaBZXgQprHgWDYwmS75UzwUQe 2aB8XVTQiTPx5cxDa1O2/8LlE4gHzVsg5tSihhzByvaleOmktJF5AGSHLUs2P4O8fI68qC 5knP+O18GqjOqsV2x3ktfimHjIQhxWNYju0M1lJM6o/05ZRVFO0t+HulaGDT4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674085718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12/OG0T9hYtcwN6o8Cm65cHVgX+lgirdsCyGvVkbFQ4=; b=wgsHf8Poj7EveXoWkRORJ3Dr1r8K2wj2UkNj3cDa5Zk9551rBukWCnw7ZqabjH5CDVfk8o cPQfLuAB1uEVqagdCC/8OE/fzljtjLqBckHMraI9PxsfF/3IOPkO2yplFz9kfoUC2RIy9A 06ZZUMLYmjndNRlgqkOAwKVX3CwqE8lIWUfO4ANNrQMPssFzWcEWuXfWj1KOFVUbTXevMf T6AM7Vmz0+zS97xKo0wEQXcpJ8pqkSEeD2mi0j/NcWu5awLc7m739jOCv0TnNKtXGtx1wI 456wEL9Gx2GqWrs0rUkxrnrbyeaedLMTx7hI9NcLPgRMB/b/cmiYPToDZZqnYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674085718; a=rsa-sha256; cv=none; b=IiuaL1yUgCkfNhlcxWe9KOIyUkUn71YP4DR4rYIAqde2JIib3uJrMOPCmx7vRmqaXM9Qt6 oD+cqNBp5TvlY2z+xhY/cKglgqy2sKUwnRKJ9l0P1l3rlW9N4gnt7hAwHAHz5JatG/IjRD QhVG1+bD0vS+bLtK8Pj1FdktyKAVq6+r8sF7awSz9GlNdLWrb4lQJTHkZjYLVScrUTsRsu MNlAVvFWFtmbOgUvMbXa046w+Mv+U8M7T9Qs6igwJFZ8MXRriNJPRPmKoaSjdu+1FC5sig OPDreoBApD6tdC5mC4Y8i0xj6m4EKB8yReB/4ymgn7FxFYPHA6tRPTqU5DBfDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny2X56nS0zVrQ; Wed, 18 Jan 2023 23:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30INmbxn070585; Wed, 18 Jan 2023 23:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30INmbAR070584; Wed, 18 Jan 2023 23:48:37 GMT (envelope-from git) Date: Wed, 18 Jan 2023 23:48:37 GMT Message-Id: <202301182348.30INmbAR070584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: ad23377e244c - stable/12 - xdr: store chars consistently List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ad23377e244c1f234f922aacfdb32be4e0a9713e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ad23377e244c1f234f922aacfdb32be4e0a9713e commit ad23377e244c1f234f922aacfdb32be4e0a9713e Author: Brooks Davis AuthorDate: 2023-01-18 23:48:18 +0000 Commit: Brooks Davis CommitDate: 2023-01-18 23:48:18 +0000 xdr: store chars consistently Cast char's through unsigned char before storing as an integer in xdr_char(), this ensures that the encoded form is consistently not sign-extended following Open Solaris's example. Prior to this change, platforms with signed chars would sign extend values with the high bit set but ones with unsigned chars would not so 0xff would be stored as 0x000000ff on unsigned char platforms and 0xffffffff on signed char platforms. Decoding has the same result for either form so this is a largely cosmetic change, but it seems best to produce consistent output. For more discussion, see https://github.com/openzfs/zfs/issues/14173 Reviewed by: mav, imp Differential Revision: https://reviews.freebsd.org/D37992 (cherry picked from commit a872c37054172f3f7a03aef263ca5886a749771f) --- lib/libc/xdr/xdr.c | 8 ++++---- sys/xdr/xdr.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c index fcf4e9029074..48b4cdbecd02 100644 --- a/lib/libc/xdr/xdr.c +++ b/lib/libc/xdr/xdr.c @@ -429,13 +429,13 @@ xdr_uint16_t(XDR *xdrs, uint16_t *u_int16_p) bool_t xdr_char(XDR *xdrs, char *cp) { - int i; + u_int i; - i = (*cp); - if (!xdr_int(xdrs, &i)) { + i = *((unsigned char *)cp); + if (!xdr_u_int(xdrs, &i)) { return (FALSE); } - *cp = i; + *((unsigned char *)cp) = i; return (TRUE); } diff --git a/sys/xdr/xdr.c b/sys/xdr/xdr.c index 349e53d02387..6e66b90453c4 100644 --- a/sys/xdr/xdr.c +++ b/sys/xdr/xdr.c @@ -372,13 +372,13 @@ xdr_uint16_t(XDR *xdrs, uint16_t *uint16_p) bool_t xdr_char(XDR *xdrs, char *cp) { - int i; + u_int i; - i = (*cp); - if (!xdr_int(xdrs, &i)) { + i = *((unsigned char *)cp); + if (!xdr_u_int(xdrs, &i)) { return (FALSE); } - *cp = i; + *((unsigned char *)cp) = i; return (TRUE); } From nobody Wed Jan 18 23:53:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny2dx2npNz2v6yd for ; Wed, 18 Jan 2023 23:53:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny2dx0nXvz3CYW for ; Wed, 18 Jan 2023 23:53:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x629.google.com with SMTP id u19so1406677ejm.8 for ; Wed, 18 Jan 2023 15:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=J1NDRvETvwLioi3nQN1oKSQuoOaUSYkmvq1RsNR8k+A=; b=zIyH+WzKoS8il5G8qyGnXIxfog+jKYnHgYxefwiWTEPS4pjkX2Ccn33hjkEuiNSmI3 zq9l+HeEkOUVT9gbK6r0jmvkqU7dHw44QoYG/b+ufXqDuJNic27FQz6P9xuKD4JnsluY TQY1F8o7l5iBV4UVlyx7NYjaeylvC7VPV1VXSlj5IJd8HgGgLl4rgS5vi6uP8yFdtItV +77Ri3MJmtBhE+5IKdM/gb2q7t8Vm4dzy9RDeceDE7oHprDWeouoVq/wAOPyxmUN11nK diw5z7rBxHWpEnRXgG9CEjwZxvDUIZxbLtTQKwEt7UNhPxybLX1iwJ5TC85MMMdzBV7X +quw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=J1NDRvETvwLioi3nQN1oKSQuoOaUSYkmvq1RsNR8k+A=; b=uSC/8tajm1gBspSnuCjk752bR/RP7Y33VMuOfjFTqHVb19jnATOvz/UlwsSR952GL9 TBSHCmm+29ejnZtq1jXpf/fMTcyG2zlXTcN2kscbK1fa8H1HNm7J1jB6UIMpOhhNl1Tb HgTF5lylaloKhpRagul0JL4jTT2Qm6tMnHk8sYzyC3JB2cou4kIBsg689mY96IrGx8+F H/1OlhTYmbOBtwbSt5ailvdORFCufb1phlN2Mt9e0PW+N0CWaq3jTpgRQR/Oxlfa3+Rq uJ7m+74sVckOfQn27fUh+MMn4dcIq6rFkZy0UdAn5/va3OAjegz6PRCKtY1fj4U75fkb KG9w== X-Gm-Message-State: AFqh2kq67Hr9lHnVtJ1BqucPZNWW7YNuKQ0MKRG+eFpyJfpgkNwZMJjG Sz4LJZnm1wJzkdlW6cmm1iogrR2t+ev1C6b8e1HWD2C97W0Dsw== X-Google-Smtp-Source: AMrXdXtn/Gmgg/qEecyfteKzkSzUDnE4xd8HV+SnnT/dEls+roXOGRe9yBS6fT1U4651a+Tg5KJOmX1OcYCzNY71sXA= X-Received: by 2002:a17:906:a3c3:b0:870:7c88:466e with SMTP id ca3-20020a170906a3c300b008707c88466emr600413ejb.140.1674086019751; Wed, 18 Jan 2023 15:53:39 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301171638.30HGcP3C091184@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 18 Jan 2023 16:53:51 -0700 Message-ID: Subject: Re: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init To: Mitchell Horne Cc: Brooks Davis , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000087f81c05f292864d" X-Rspamd-Queue-Id: 4Ny2dx0nXvz3CYW X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000087f81c05f292864d Content-Type: text/plain; charset="UTF-8" On Wed, Jan 18, 2023 at 3:07 PM Mitchell Horne wrote: > > > On 1/17/23 12:38, Brooks Davis wrote: > > The branch main has been updated by brooks: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=b75062f23431fbabef1e7d665cae270b144f71b1 > > > > commit b75062f23431fbabef1e7d665cae270b144f71b1 > > Author: Brooks Davis > > AuthorDate: 2023-01-17 16:36:15 +0000 > > Commit: Brooks Davis > > CommitDate: 2023-01-17 16:37:42 +0000 > > > > riscv: Fix thread0.td_kstack_pages init > > > > Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized > > thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an > > include of opt_kstack_pages.h it used the fallback value of 4 from > > machine/param.h. > > Does this mean that we could/should include opt_kstack_pages.h within > machine/param.h (under #ifdef _KERNEL)? This header is both a consumer > and provider of the KSTACK_PAGES definition, by virtue of the #ifndef. I > think the hidden dependency should be avoided, if possible. > No. Including opt_XXXX.h is never OK in our .h files. They are used in too many places, some of which "cheat" and define _KERNEL becuse, well, they need to get to the kernel bits.... That will break... I do agree, however, that the current interface is less than ideal... > Of course, the problem at hand has been fixed and we want to keep direct > consumers of KSTACK_PAGES to a minimum, but I think the point still stands. > I think it's a good point, but the current way is likely the least-bad way to accomplish things. It would be much better if we could remove it from machine/param.h and opt_XXX.h always defines it, even the default value when it's not otherwise specified. However, we don't (currently) have a way to set default values in config(8). We could add it, since the efforts at config++ have thus far fallen flat.... Warner > Mitchell > > > This meant that increasing KSTACK_PAGES in the kernel > > config resulted in a panic in _epoch_enter_preempt as the following > > assertion was false during network stack setup: > > > > MPASS((vm_offset_t)et >= td->td_kstack && > > (vm_offset_t)et + sizeof(struct epoch_tracker) <= > > td->td_kstack + td->td_kstack_pages * PAGE_SIZE); > > > > Switch to initializing with kstack_pages following other > architectures. > > > > Reviewed by: imp, markj > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D38049 > > --- > > sys/riscv/riscv/machdep.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c > > index b03d45b018ec..0821a29d11c1 100644 > > --- a/sys/riscv/riscv/machdep.c > > +++ b/sys/riscv/riscv/machdep.c > > @@ -291,7 +291,7 @@ init_proc0(vm_offset_t kstack) > > > > proc_linkup0(&proc0, &thread0); > > thread0.td_kstack = kstack; > > - thread0.td_kstack_pages = KSTACK_PAGES; > > + thread0.td_kstack_pages = kstack_pages; > > thread0.td_pcb = (struct pcb *)(thread0.td_kstack + > > thread0.td_kstack_pages * PAGE_SIZE) - 1; > > thread0.td_pcb->pcb_fpflags = 0; > --00000000000087f81c05f292864d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Jan 18, 2023 at 3:07 PM Mitch= ell Horne <mhorne@freebsd.org&= gt; wrote:


On 1/17/23 12:38, Brooks Davis wrote:
> The branch main has been updated by brooks:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3Db75062f23431fbabef1e7d665cae270b144f71b1<= /a>
>
> commit b75062f23431fbabef1e7d665cae270b144f71b1
> Author:=C2=A0 =C2=A0 =C2=A0Brooks Davis <brooks@FreeBSD.org>
> AuthorDate: 2023-01-17 16:36:15 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Brooks Davis <brooks@FreeBSD.org>
> CommitDate: 2023-01-17 16:37:42 +0000
>
>=C2=A0 =C2=A0 =C2=A0 riscv: Fix thread0.td_kstack_pages init
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 in= itialized
>=C2=A0 =C2=A0 =C2=A0 thread0.td_kstack_pages to KSTACK_PAGES.=C2=A0 Due= to the lack of an
>=C2=A0 =C2=A0 =C2=A0 include of opt_kstack_pages.h it used the fallback= value of 4 from
>=C2=A0 =C2=A0 =C2=A0 machine/param.h.

Does this mean that we could/should include opt_kstack_pages.h within
machine/param.h (under #ifdef _KERNEL)? This header is both a consumer
and provider of the KSTACK_PAGES definition, by virtue of the #ifndef. I think the hidden dependency should be avoided, if possible.

No. Including opt_XXXX.h is never OK in our .h files. = They are used in too many places, some of which "cheat" and defin= e _KERNEL becuse, well, they need to get to the kernel bits....=C2=A0 That = will break...

I do agree, however, that the curren= t interface is less than ideal...
=C2=A0
Of course, the problem at hand has been fixed and we want to keep direct consumers of KSTACK_PAGES to a minimum, but I think the point still stands.=

I think it's a good point, but the= current way is likely the least-bad way to accomplish things.
It would be much better if we could remove it from machine/par= am.h and opt_XXX.h always defines it, even the default value when it's = not otherwise specified. However, we don't (currently) have a way to se= t default values in config(8). We could add it, since the efforts at config= ++ have thus far fallen flat....

Warner
=C2=A0
Mitchell

>=C2=A0 =C2=A0 =C2=A0 This meant that increasing KSTACK_PAGES in the ker= nel
>=C2=A0 =C2=A0 =C2=A0 config resulted in a panic in _epoch_enter_preempt= as the following
>=C2=A0 =C2=A0 =C2=A0 assertion was false during network stack setup: >=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MPASS((vm_offset_t)et = >=3D td->td_kstack &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (vm_offs= et_t)et + sizeof(struct epoch_tracker) <=3D
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 td->t= d_kstack + td->td_kstack_pages * PAGE_SIZE);
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Switch to initializing with kstack_pages following= other architectures.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, markj
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0DARPA, AFRL
>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0
https://revi= ews.freebsd.org/D38049
> ---
>=C2=A0 =C2=A0sys/riscv/riscv/machdep.c | 2 +-
>=C2=A0 =C2=A01 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c
> index b03d45b018ec..0821a29d11c1 100644
> --- a/sys/riscv/riscv/machdep.c
> +++ b/sys/riscv/riscv/machdep.c
> @@ -291,7 +291,7 @@ init_proc0(vm_offset_t kstack)
>=C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0proc_linkup0(&proc0, &thread0);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0thread0.td_kstack =3D kstack;
> -=C2=A0 =C2=A0 =C2=A0thread0.td_kstack_pages =3D KSTACK_PAGES;
> +=C2=A0 =C2=A0 =C2=A0thread0.td_kstack_pages =3D kstack_pages;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0thread0.td_pcb =3D (struct pcb *)(thread0.td= _kstack +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0thread0.td_kstack_pages * PAGE= _SIZE) - 1;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0thread0.td_pcb->pcb_fpflags =3D 0;
--00000000000087f81c05f292864d-- From nobody Thu Jan 19 00:57:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny43Y0KdYz2sX7y; Thu, 19 Jan 2023 00:57:29 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_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 4Ny43X72sNz3HFD; Thu, 19 Jan 2023 00:57:28 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 89C453C0199; Thu, 19 Jan 2023 00:57:28 +0000 (UTC) Date: Thu, 19 Jan 2023 00:57:28 +0000 From: Brooks Davis To: Warner Losh Cc: Mitchell Horne , Brooks Davis , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init Message-ID: References: <202301171638.30HGcP3C091184@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Rspamd-Queue-Id: 4Ny43X72sNz3HFD X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, Jan 18, 2023 at 04:53:51PM -0700, Warner Losh wrote: > On Wed, Jan 18, 2023 at 3:07 PM Mitchell Horne wrote: >=20 > > > > > > On 1/17/23 12:38, Brooks Davis wrote: > > > The branch main has been updated by brooks: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3Db75062f23431fbabef1e7d665cae2= 70b144f71b1 > > > > > > commit b75062f23431fbabef1e7d665cae270b144f71b1 > > > Author: Brooks Davis > > > AuthorDate: 2023-01-17 16:36:15 +0000 > > > Commit: Brooks Davis > > > CommitDate: 2023-01-17 16:37:42 +0000 > > > > > > riscv: Fix thread0.td_kstack_pages init > > > > > > Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized > > > thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an > > > include of opt_kstack_pages.h it used the fallback value of 4 fr= om > > > machine/param.h. > > > > Does this mean that we could/should include opt_kstack_pages.h within > > machine/param.h (under #ifdef _KERNEL)? This header is both a consumer > > and provider of the KSTACK_PAGES definition, by virtue of the #ifndef. I > > think the hidden dependency should be avoided, if possible. > > >=20 > No. Including opt_XXXX.h is never OK in our .h files. They are used in too > many places, some of which "cheat" and define _KERNEL becuse, well, they > need to get to the kernel bits.... That will break... We could potentially use the __has_include extension. I don't think we care about building the kernel with a compiler that isn't clang or gcc and the usage pattern defined by gcc is safe for compilers that don't define it. We could do something like: #ifdef _KERNEL #ifndef KSTACK_PAGES #ifdef __has_include #if __has_include("opt_kstack_pages.h") #include "opt_kstack_pages.h" #endif #endif #endif #endif >=20 > I do agree, however, that the current interface is less than ideal... >=20 >=20 > > Of course, the problem at hand has been fixed and we want to keep direct > > consumers of KSTACK_PAGES to a minimum, but I think the point still sta= nds. > > >=20 > I think it's a good point, but the current way is likely the least-bad way > to accomplish things. >=20 > It would be much better if we could remove it from machine/param.h and > opt_XXX.h always defines it, even the default value when it's not otherwi= se > specified. However, we don't (currently) have a way to set default values > in config(8). We could add it, since the efforts at config++ have thus far > fallen flat.... I think this is probably the better direction to move. There aren't any in-tree uses of KSTACK_PAGES so removing the definition should be fine. -- Brooks From nobody Thu Jan 19 03:52:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7x35ZM3z2svbw; Thu, 19 Jan 2023 03:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7x33zZvz3RG3; Thu, 19 Jan 2023 03:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3QLP9k+V8hHcpfR3iNB8OKlcBJBq0Vgv/WPrr4U1YA=; b=oGGwG4UuBdxua0xPpAZCUEgGlse+NFHKLqGOSTKzVMaxQZQD8G8HUm2nRvsJdWvMvhWp8i PY4leEGx3tb7J92L0+J91ISfSW8OTc8KsW9WalFiqg5/RRC8AM5FgKSkHpnyG8YqpjAf4K VKHfJvbWIsH/bk7xDnYOvpLbZNb580iVj9APz/l+gXWac+bZClQT7Cq+xB594OtWj/Hihk FcQ+/vpsHO512nCHh2Cmp+kO/ABM9qkkYjPcNdr74hcGf2UVVlpgeNfxO/E6RxL6YOIyBv xmXbQutEfxDPN2zW2NBx/BRhaQNXxUpcWaT5IDqiRvKDLIshUPsjr8k2FSgfTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3QLP9k+V8hHcpfR3iNB8OKlcBJBq0Vgv/WPrr4U1YA=; b=xg9Urvl0vHDhqEGXD6A08G0ooD2+SXtucpStP2aQjPGusMMWwoeq6I1iH3mm1J2zNjw2c7 ttUBeda6h2C5blxvwkmlj5XLg7r2mrKp/xn3rQCThPHyMkBe5JciL9yRenxBq4SqjLmUaj uWDSQuDdIomcOMZJqONFGqoVT42/z2i5VWbCnvRGUAOFk6KFpF2JPu4YVhpxm7AUjKrkJB 3gYEIIYWG9rJML3fiaqL2LBtVcRKe/y5r6VolqZVBcEx/zjySkh+Ib9imkS7niH/hBePZ1 21kEWtBxxxc+uaW34q/Pn+fsPMWeqef3UqD3we5+Fygexige67cEU/z1NULgsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100327; a=rsa-sha256; cv=none; b=uMcCyNJ0YMO6iRcn4tFPK3RxEZJd+T6zBE3yxxHC+eCvJ4I5XRAKFmgbDbYOi+hIIrElbr 1NkF4jXBfZ8ojPhMvYSt0rNbJnkoWCw1eAlv0lnSPIqDWGCXHr0LVY0KEorZbPQqiKKeN7 BUZVWJavlkd3a2TeVxrUjET3H+Mk0nwre5+8qTA1KvnJJ8db7sIoatv3+jdnDU7GacvvlJ tVkx2x81nTNx5C5VFNMaShkOcepZkC3sAGmry6UdrEQcPiqqOBqrZMGEa8jQMM/Wq0PGZM wMUaj8jhKV3cL65vWBTWcB7xADrInqUQB+49GaKw6v3tHV0V32tdBIqYDGODGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7x334gMzcQW; Thu, 19 Jan 2023 03:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3q7Ga021821; Thu, 19 Jan 2023 03:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3q7fT021820; Thu, 19 Jan 2023 03:52:07 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:07 GMT Message-Id: <202301190352.30J3q7fT021820@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: eee5ebb851be - stable/13 - bnxt: Remove dead write to cp_ring_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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: eee5ebb851beb1874b5e9d6f8b329b4ab67990c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eee5ebb851beb1874b5e9d6f8b329b4ab67990c0 commit eee5ebb851beb1874b5e9d6f8b329b4ab67990c0 Author: Warner Losh AuthorDate: 2022-02-28 17:13:27 +0000 Commit: Warner Losh CommitDate: 2023-01-19 00:59:42 +0000 bnxt: Remove dead write to cp_ring_id Since this is read from memory, reading it and then ignoring it is dead code... Sponsored by: Netflix (cherry picked from commit 44b4f0370fe90d11306e9d3fdcacdc5b4ccc946e) --- sys/dev/bnxt/bnxt_hwrm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 60485cd06799..0009ffa25053 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -119,7 +119,6 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len) struct hwrm_err_output *resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; uint32_t *data = msg; int i; - uint16_t cp_ring_id; uint8_t *valid; uint16_t err; uint16_t max_req_len = HWRM_MAX_REQ_LEN; @@ -128,7 +127,6 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len) /* TODO: DMASYNC in here. */ req->seq_id = htole16(softc->hwrm_cmd_seq++); memset(resp, 0, PAGE_SIZE); - cp_ring_id = le16toh(req->cmpl_ring); if (softc->flags & BNXT_FLAG_SHORT_CMD) { void *short_cmd_req = softc->hwrm_short_cmd_req_addr.idi_vaddr; From nobody Thu Jan 19 03:52:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7x51Gckz2svbx; Thu, 19 Jan 2023 03:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7x45Nd0z3h8T; Thu, 19 Jan 2023 03:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohqBI8tFfTYvn4d5puZPrf6obfR1eq/6bc8jMgtFL3E=; b=Y/Efc00dONWGves+D9ArvepMxGHufZw4R9UvL1y89Qf1vI1xDYJxdaQ9NQNxKkGp4FSQOi kWIndCgCztLO8zMBEQIGjfGLEPXIbXNPIrtW4iaYyRyZy0G5nznho/2dMsRTwdqvqqiDH7 TkG9sP0fENIB0U30KVamVILKpguSTyfYPU3pMFKEna3yuVXlOIEOC59GGRutoDacRVSqm7 g+MK2DM6vLHNGRmZ8m81pF8JxQve2HazyeQ4hWmQ6JrpzfwifzRFFB76H3uJtxnpfUTJK8 zNo6eLWHCSZNe+FpLDoubVx7bwNjE5ysIffj9JS8diIB97gxBKA9MvtMstG9Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohqBI8tFfTYvn4d5puZPrf6obfR1eq/6bc8jMgtFL3E=; b=OiFUJAGRd/VgDT69AITM5wW+SDNE2PqPc8xFZ2owT1g3qSFKmhTt5dqJDB3c1Ofyr9/HQe nszKNkS4RVyMMTgRPMPex2AMahZUUFP3xRYj9PneUybRlBNsk2YJeFqDX7j1OXCmpXTPRn qEvlrAU7FAJZu7+fMY0scMDM8cwytT8SWKc+5hJRGG5JpwlnCwMZQaAUQ6tj77Lz0+eDhF Sc/ayFH+kE6TDp/Fcq0IDiiXjIAJ6yDn6smwRkoHvmIfzOS+bmDdMV3QRJaf8klv2MKOLb JBi5yZ2/sDON92JU3vrMbCAwm+ZjfztGnZInxSq/PH9MjldZmaA9nXAZZl2nZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100328; a=rsa-sha256; cv=none; b=gcC8Vmluwmds02X2rtstR+SlGjLm1VMQY+GxJGtJ0yW7OtVWjhmgxCQbqOlMDLaV/042Cx 3XaCeX0JxvXmex+W11AAKCXWyA7NLnNonZi4pg0iL+rPdHS442msh8TdzwjzyhoeaOLXP3 k4afasS0rorT0kcx0kbZXOGZbRvyucVRW9Ptk2GlR+5flDM4P2O52Evo40ZCVzVkQh47OX TOnUXEiSkGpZKaUDxPosypt3xQsiH0whC4WVGn58xjvxgRC+T8cHnE+qViapLdyE05/V3Z J5AOMjLu+nzT35kHz9irdszNqB4oP06bnLrNvcnlVZnxmD0ZGZERQQe7Y5ueUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7x44Cy8zcfY; Thu, 19 Jan 2023 03:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3q8nc021855; Thu, 19 Jan 2023 03:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3q8m2021854; Thu, 19 Jan 2023 03:52:08 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:08 GMT Message-Id: <202301190352.30J3q8m2021854@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: a815cf3b7221 - stable/13 - bnxt: Remove unused devclass argument to DRIVER_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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: a815cf3b7221decf5ce4c1fcfc1f9a91e87a958a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a815cf3b7221decf5ce4c1fcfc1f9a91e87a958a commit a815cf3b7221decf5ce4c1fcfc1f9a91e87a958a Author: John Baldwin AuthorDate: 2022-05-09 19:22:00 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:05 +0000 bnxt: Remove unused devclass argument to DRIVER_MODULE. (cherry picked from commit 64d3221c61122b9a6a73f107c8145e92b47eb4c8) --- sys/dev/bnxt/if_bnxt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 1805a1f24f93..a2ec25a9ad31 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -237,8 +237,7 @@ static driver_t bnxt_driver = { "bnxt", bnxt_methods, sizeof(struct bnxt_softc), }; -devclass_t bnxt_devclass; -DRIVER_MODULE(bnxt, pci, bnxt_driver, bnxt_devclass, 0, 0); +DRIVER_MODULE(bnxt, pci, bnxt_driver, 0, 0); MODULE_DEPEND(bnxt, pci, 1, 1, 1); MODULE_DEPEND(bnxt, ether, 1, 1, 1); From nobody Thu Jan 19 03:52:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7x65v2kz2svBw; Thu, 19 Jan 2023 03:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7x65W8rz3hj6; Thu, 19 Jan 2023 03:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=26fdM8//19OiWoUTp2/VzcE9OLSWo1lWEuWrFl+xJLo=; b=twU5qCErvPW3lEDhJHMd4LWPhJQTC2j2bl/uHQJuy6y0I6ABhGnbViuu1BCVNFeilHFkcB WsHaI4gl9fXTwPrPraIQrBEzA26nJ7GAq9krPsQjmEd4WCOEH7OiN/Nnj8rAnHBEsVnnlz oxuKoI7QbZL6VampUVR+vH1ya8O0qImpjSRapcQodWUtzSBEAMkiICipMQGVBB+bdrGOke ieAx4nGX37O7Ym7jrgzO+z00yAnt/kiF1PzLSs7d3c8Vg7ObB3+jccQt9kWejmqZkX66Nn EmIo0KBwT6wyJNLT6Ht7nrqagCkPzdGDq/UuxFhqS5ZsDaYbQwYiXTC4X2CTng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=26fdM8//19OiWoUTp2/VzcE9OLSWo1lWEuWrFl+xJLo=; b=GYY2ZdBxmKyi7Ff9fOHisazkx2iqhbldVFE2MM4ExrYpKwd8tpE9LHWcpkpxX7xBXXn21c HbOofDqp45VGO7EUyZwjYiIrnJlI3Xl2ZpDyDndu6e2xx4n0UUMl6gL8Fa40nxymQg8X5r bsC3Q2gc0MdjN+9oWn7U+kI8MaS/mjLGzbq8v+739p4Oyp35srz8ASapooln4lcnHW6fBV TyNADxvb82WqN7c++yzGRtEncY/hUVRi59/yc4gTHyjzyQn+dlxGgXkUpZ/65ZhWYkwWsA irE+yJm6ICbpfvV2HOxj3jMEhUBjBokC+2kVUtzRtgTK99qqWK4Dks4xPX453A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100330; a=rsa-sha256; cv=none; b=xhrqXlRvbMXb292EM3gy1NuFle9n+piQDjaL/nnmvZJ272PakQ4HkE6YEHZZw06gXDhTKb xHP0LE1rXtXvm3Heo+T1idfa9wgJWqdylUqDoK5YSlUcmW0tNZBDIswvfAZ+nBDncINfsx Xfr8BpcKD8uns58zoNbo1qQBgCN4OB//yB/0tEdm+ed/vi6xmX2evmeLEY5c5dsjD/eD76 KTM6taOX1MCkCSeUC1lzwsIe9lERN8zWK7BjC9bEY3cx35N9db9/2VARxQSlXTbJx4Yvvt vM1xE5Bk0X79FOGWB8kPcLttLYK8DcTOesBK7nzRjtC0F+6NVU6i1HYRmGb1fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7x64c1MzcWQ; Thu, 19 Jan 2023 03:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qACd021898; Thu, 19 Jan 2023 03:52:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3q95V021883; Thu, 19 Jan 2023 03:52:09 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:09 GMT Message-Id: <202301190352.30J3q95V021883@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: e1741d6fd5af - stable/13 - if_bnxt: update hsi_struct_def.h headers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e1741d6fd5aff3b7e337e36f648ba4b4eb563302 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e1741d6fd5aff3b7e337e36f648ba4b4eb563302 commit e1741d6fd5aff3b7e337e36f648ba4b4eb563302 Author: Sumit Saxena AuthorDate: 2022-11-04 21:56:50 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:05 +0000 if_bnxt: update hsi_struct_def.h headers Updates the drivers to Broadcom's latest: HWRM Version 1.10.2.34 using HSI definition version 1.8.4 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36436 (cherry picked from commit 97315f68fe87ae391d2dd2f8c636beac9754ab73) --- sys/dev/bnxt/bnxt_hwrm.c | 34 +- sys/dev/bnxt/bnxt_sysctl.c | 14 +- sys/dev/bnxt/bnxt_txrx.c | 4 +- sys/dev/bnxt/hsi_struct_def.h | 84290 ++++++++++++++++++++++++++++------------ 4 files changed, 59077 insertions(+), 25265 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 0009ffa25053..d474e5b81e19 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -286,31 +286,31 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) goto fail; snprintf(softc->ver_info->hwrm_if_ver, BNXT_VERSTR_SIZE, "%d.%d.%d", - resp->hwrm_intf_maj, resp->hwrm_intf_min, resp->hwrm_intf_upd); - softc->ver_info->hwrm_if_major = resp->hwrm_intf_maj; - softc->ver_info->hwrm_if_minor = resp->hwrm_intf_min; - softc->ver_info->hwrm_if_update = resp->hwrm_intf_upd; + resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b, resp->hwrm_intf_upd_8b); + softc->ver_info->hwrm_if_major = resp->hwrm_intf_maj_8b; + softc->ver_info->hwrm_if_minor = resp->hwrm_intf_min_8b; + softc->ver_info->hwrm_if_update = resp->hwrm_intf_upd_8b; snprintf(softc->ver_info->hwrm_fw_ver, BNXT_VERSTR_SIZE, "%d.%d.%d", - resp->hwrm_fw_maj, resp->hwrm_fw_min, resp->hwrm_fw_bld); + resp->hwrm_fw_major, resp->hwrm_fw_minor, resp->hwrm_fw_build); strlcpy(softc->ver_info->driver_hwrm_if_ver, HWRM_VERSION_STR, BNXT_VERSTR_SIZE); strlcpy(softc->ver_info->hwrm_fw_name, resp->hwrm_fw_name, BNXT_NAME_SIZE); - if (resp->mgmt_fw_maj == 0 && resp->mgmt_fw_min == 0 && - resp->mgmt_fw_bld == 0) { + if (resp->mgmt_fw_major == 0 && resp->mgmt_fw_minor == 0 && + resp->mgmt_fw_build == 0) { strlcpy(softc->ver_info->mgmt_fw_ver, naver, BNXT_VERSTR_SIZE); strlcpy(softc->ver_info->mgmt_fw_name, nastr, BNXT_NAME_SIZE); } else { snprintf(softc->ver_info->mgmt_fw_ver, BNXT_VERSTR_SIZE, - "%d.%d.%d", resp->mgmt_fw_maj, resp->mgmt_fw_min, - resp->mgmt_fw_bld); + "%d.%d.%d", resp->mgmt_fw_major, resp->mgmt_fw_minor, + resp->mgmt_fw_build); strlcpy(softc->ver_info->mgmt_fw_name, resp->mgmt_fw_name, BNXT_NAME_SIZE); } - if (resp->netctrl_fw_maj == 0 && resp->netctrl_fw_min == 0 && - resp->netctrl_fw_bld == 0) { + if (resp->netctrl_fw_major == 0 && resp->netctrl_fw_minor == 0 && + resp->netctrl_fw_build == 0) { strlcpy(softc->ver_info->netctrl_fw_ver, naver, BNXT_VERSTR_SIZE); strlcpy(softc->ver_info->netctrl_fw_name, nastr, @@ -318,20 +318,20 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) } else { snprintf(softc->ver_info->netctrl_fw_ver, BNXT_VERSTR_SIZE, - "%d.%d.%d", resp->netctrl_fw_maj, resp->netctrl_fw_min, - resp->netctrl_fw_bld); + "%d.%d.%d", resp->netctrl_fw_major, resp->netctrl_fw_minor, + resp->netctrl_fw_build); strlcpy(softc->ver_info->netctrl_fw_name, resp->netctrl_fw_name, BNXT_NAME_SIZE); } - if (resp->roce_fw_maj == 0 && resp->roce_fw_min == 0 && - resp->roce_fw_bld == 0) { + if (resp->roce_fw_major == 0 && resp->roce_fw_minor == 0 && + resp->roce_fw_build == 0) { strlcpy(softc->ver_info->roce_fw_ver, naver, BNXT_VERSTR_SIZE); strlcpy(softc->ver_info->roce_fw_name, nastr, BNXT_NAME_SIZE); } else { snprintf(softc->ver_info->roce_fw_ver, BNXT_VERSTR_SIZE, - "%d.%d.%d", resp->roce_fw_maj, resp->roce_fw_min, - resp->roce_fw_bld); + "%d.%d.%d", resp->roce_fw_major, resp->roce_fw_minor, + resp->roce_fw_build); strlcpy(softc->ver_info->roce_fw_name, resp->roce_fw_name, BNXT_NAME_SIZE); } diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index ef624d487953..c2518d7e2675 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -186,8 +186,8 @@ bnxt_create_tx_sysctls(struct bnxt_softc *softc, int txr) "discard_pkts", CTLFLAG_RD, &tx_stats[txr].tx_discard_pkts, "discarded transmit packets"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "drop_pkts", CTLFLAG_RD, &tx_stats[txr].tx_drop_pkts, - "dropped transmit packets"); + "error_pkts", CTLFLAG_RD, &tx_stats[txr].tx_error_pkts, + "Error transmit packets"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "ucast_bytes", CTLFLAG_RD, &tx_stats[txr].tx_ucast_bytes, "unicast bytes sent"); @@ -237,7 +237,7 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "Transmitted 512b 1023b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_1024b_1518_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_1024b_1518_frames, + &softc->tx_port_stats->tx_1024b_1518b_frames, "Transmitted 1024b 1518 frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_good_vlan_frames", CTLFLAG_RD, @@ -245,7 +245,7 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "Transmitted good vlan frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_1519b_2047_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_1519b_2047_frames, + &softc->tx_port_stats->tx_1519b_2047b_frames, "Transmitted 1519b 2047 frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_2048b_4095b_frames", CTLFLAG_RD, @@ -421,7 +421,7 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "Received 512b 1023b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_1024b_1518_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_1024b_1518_frames, + &softc->rx_port_stats->rx_1024b_1518b_frames, "Received 1024b 1518 frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_good_vlan_frames", CTLFLAG_RD, @@ -679,8 +679,8 @@ bnxt_create_rx_sysctls(struct bnxt_softc *softc, int rxr) "discard_pkts", CTLFLAG_RD, &rx_stats[rxr].rx_discard_pkts, "discarded receive packets"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "drop_pkts", CTLFLAG_RD, &rx_stats[rxr].rx_drop_pkts, - "dropped receive packets"); + "error_pkts", CTLFLAG_RD, &rx_stats->rx_error_pkts, + "Error receive packets"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "ucast_bytes", CTLFLAG_RD, &rx_stats[rxr].rx_ucast_bytes, "unicast bytes received"); diff --git a/sys/dev/bnxt/bnxt_txrx.c b/sys/dev/bnxt/bnxt_txrx.c index a9bc6a4df740..9727230b578f 100644 --- a/sys/dev/bnxt/bnxt_txrx.c +++ b/sys/dev/bnxt/bnxt_txrx.c @@ -128,8 +128,8 @@ bnxt_isc_txd_encap(void *sc, if_pkt_info_t pi) pi->ipi_new_pidx = RING_NEXT(txr, pi->ipi_new_pidx); tbdh = &((struct tx_bd_long_hi *)txr->vaddr)[pi->ipi_new_pidx]; - tbdh->mss = htole16(pi->ipi_tso_segsz); - tbdh->hdr_size = htole16((pi->ipi_ehdrlen + pi->ipi_ip_hlen + + tbdh->kid_or_ts_high_mss = htole16(pi->ipi_tso_segsz); + tbdh->kid_or_ts_low_hdr_size = htole16((pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen) >> 1); tbdh->cfa_action = 0; lflags = 0; diff --git a/sys/dev/bnxt/hsi_struct_def.h b/sys/dev/bnxt/hsi_struct_def.h index 7416545480d0..db3baa8d75c7 100644 --- a/sys/dev/bnxt/hsi_struct_def.h +++ b/sys/dev/bnxt/hsi_struct_def.h @@ -30,25150 +30,52849 @@ #include __FBSDID("$FreeBSD$"); -/**************************************************************************** - * - * Description: Definition of HSI data structures - * - * Date: 08/31/17 17:55:46 +/* + * Copyright(c) 2001-2021, Broadcom. All rights reserved. The + * term Broadcom refers to Broadcom Inc. and/or its subsidiaries. + * Proprietary and Confidential Information. * - * Note: This file is scripted generated by hsi_decode.py. - * DO NOT modify this file manually !!!! + * This source file is the property of Broadcom Corporation, and + * may not be copied or distributed in any isomorphic form without + * the prior written consent of Broadcom Corporation. * - ****************************************************************************/ + * DO NOT MODIFY!!! This file is automatically generated. + */ + #ifndef _HSI_STRUCT_DEF_EXTERNAL_H_ #define _HSI_STRUCT_DEF_EXTERNAL_H_ -/* HSI and HWRM Specification 1.8.1 */ -#define HWRM_VERSION_MAJOR 1 -#define HWRM_VERSION_MINOR 8 -#define HWRM_VERSION_UPDATE 1 - -#define HWRM_VERSION_RSVD 7 -#define HWRM_VERSION_STR "1.8.1.7" -/* - * Following is the signature for HWRM message field that indicates not - * applicable (All F's). Need to cast it the size of the field if needed. - */ -#define HWRM_NA_SIGNATURE ((uint32_t)(-1)) -#define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */ -#define HWRM_MAX_RESP_LEN (272) /* hwrm_selftest_qlist */ -#define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */ -#define HW_HASH_KEY_SIZE 40 -#define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */ -#define ROCE_SP_HSI_VERSION_MAJOR 1 -#define ROCE_SP_HSI_VERSION_MINOR 8 -#define ROCE_SP_HSI_VERSION_UPDATE 1 - -#define ROCE_SP_HSI_VERSION_STR "1.8.1" -/* - * Following is the signature for ROCE_SP_HSI message field that indicates not - * applicable (All F's). Need to cast it the size of the field if needed. - */ -#define ROCE_SP_HSI_NA_SIGNATURE ((uint32_t)(-1)) -/* - * Note: The Host Software Interface (HSI) and Hardware Resource Manager (HWRM) - * specification describes the data structures used in Ethernet packet or RDMA - * message data transfers as well as an abstract interface for managing Ethernet - * NIC hardware resources. - */ -/* Ethernet Data path Host Structures */ -/* - * Description: The following three sections document the host structures used - * between device and software drivers for communicating Ethernet packets. - */ -/* BD Ring Structures */ -/* - * Description: This structure is used to inform the NIC of a location for and - * an aggregation buffer that will be used for packet data that is received. An - * aggregation buffer creates a different kind of completion operation for a - * packet where a variable number of BDs may be used to place the packet in the - * host. RX Rings that have aggregation buffers are known as aggregation rings - * and must contain only aggregation buffers. - */ -/* - * Note: BD Ring structures are written by the driver to TX Rings and RX Rings - * to indicate to the chip there is more buffer space in the host that needs to - * be transmitted or is available for receive data. - */ -/* BD Base (8 bytes) */ +/* This is the HWRM command header. */ +/* hwrm_cmd_hdr (size:128b/16B) */ -struct bd_base { - uint8_t type; - /* This value identifies the type of buffer descriptor. */ - #define BD_BASE_TYPE_MASK UINT32_C(0x3f) - #define BD_BASE_TYPE_SFT 0 +typedef struct hwrm_cmd_hdr { + /* The HWRM command request type. */ + uint16_t req_type; /* - * Indicates that this BD is 16B long and is used for normal L2 - * packet transmission. + * The completion ring to send the completion event on. This should + * be the NQ ID returned from the `nq_alloc` HWRM command. */ - #define BD_BASE_TYPE_TX_BD_SHORT UINT32_C(0x0) + uint16_t cmpl_ring; /* - * Indicates that this BD is 1BB long and is an empty TX BD. Not - * valid for use by the driver. + * The sequence ID is used by the driver for tracking multiple + * commands. This ID is treated as opaque data by the firmware and + * the value is returned in the `hwrm_resp_hdr` upon completion. */ - #define BD_BASE_TYPE_TX_BD_EMPTY UINT32_C(0x1) + uint16_t seq_id; /* - * Indicates that this BD is 16B long and is an RX Producer (ie. - * empty) buffer descriptor. + * The target ID of the command: + * * 0x0-0xFFF8 - The function ID + * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors + * * 0xFFFD - Reserved for user-space HWRM interface + * * 0xFFFF - HWRM */ - #define BD_BASE_TYPE_RX_PROD_PKT UINT32_C(0x4) + uint16_t target_id; /* - * Indicates that this BD is 16B long and is an RX Producer - * Buffer BD. + * A physical address pointer pointing to a host buffer that the + * command's response data will be written. This can be either a host + * physical address (HPA) or a guest physical address (GPA) and must + * point to a physically contiguous block of memory. */ - #define BD_BASE_TYPE_RX_PROD_BFR UINT32_C(0x5) + uint64_t resp_addr; +} hwrm_cmd_hdr_t, *phwrm_cmd_hdr_t; + +/* This is the HWRM response header. */ +/* hwrm_resp_hdr (size:64b/8B) */ + +typedef struct hwrm_resp_hdr { + /* The specific error status for the command. */ + uint16_t error_code; + /* The HWRM command request type. */ + uint16_t req_type; + /* The sequence ID from the original command. */ + uint16_t seq_id; + /* The length of the response data in number of bytes. */ + uint16_t resp_len; +} hwrm_resp_hdr_t, *phwrm_resp_hdr_t; + +/* + * TLV encapsulated message. Use the TLV type field of the + * TLV to determine the type of message encapsulated. + */ +#define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000) +#define CMD_DISCR_LAST CMD_DISCR_TLV_ENCAP + + +/* HWRM request message */ +#define TLV_TYPE_HWRM_REQUEST UINT32_C(0x1) +/* HWRM response message */ +#define TLV_TYPE_HWRM_RESPONSE UINT32_C(0x2) +/* RoCE slow path command */ +#define TLV_TYPE_ROCE_SP_COMMAND UINT32_C(0x3) +/* RoCE slow path command to query CC Gen1 support. */ +#define TLV_TYPE_QUERY_ROCE_CC_GEN1 UINT32_C(0x4) +/* RoCE slow path command to modify CC Gen1 support. */ +#define TLV_TYPE_MODIFY_ROCE_CC_GEN1 UINT32_C(0x5) +/* Engine CKV - The Alias key EC curve and ECC public key information. */ +#define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001) +/* Engine CKV - Initialization vector. */ +#define TLV_TYPE_ENGINE_CKV_IV UINT32_C(0x8003) +/* Engine CKV - Authentication tag. */ +#define TLV_TYPE_ENGINE_CKV_AUTH_TAG UINT32_C(0x8004) +/* Engine CKV - The encrypted data. */ +#define TLV_TYPE_ENGINE_CKV_CIPHERTEXT UINT32_C(0x8005) +/* Engine CKV - Supported host_algorithms. */ +#define TLV_TYPE_ENGINE_CKV_HOST_ALGORITHMS UINT32_C(0x8006) +/* Engine CKV - The Host EC curve name and ECC public key information. */ +#define TLV_TYPE_ENGINE_CKV_HOST_ECC_PUBLIC_KEY UINT32_C(0x8007) +/* Engine CKV - The ECDSA signature. */ +#define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE UINT32_C(0x8008) +/* Engine CKV - The firmware EC curve name and ECC public key information. */ +#define TLV_TYPE_ENGINE_CKV_FW_ECC_PUBLIC_KEY UINT32_C(0x8009) +/* Engine CKV - Supported firmware algorithms. */ +#define TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS UINT32_C(0x800a) +#define TLV_TYPE_LAST TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS + + +/* tlv (size:64b/8B) */ + +typedef struct tlv { + /* + * The command discriminator is used to differentiate between various + * types of HWRM messages. This includes legacy HWRM and RoCE slowpath + * command messages as well as newer TLV encapsulated HWRM commands. + * + * For TLV encapsulated messages this field must be 0x8000. + */ + uint16_t cmd_discr; + uint8_t reserved_8b; + uint8_t flags; + /* + * Indicates the presence of additional TLV encapsulated data + * follows this TLV. + */ + #define TLV_FLAGS_MORE UINT32_C(0x1) + /* Last TLV in a sequence of TLVs. */ + #define TLV_FLAGS_MORE_LAST UINT32_C(0x0) + /* More TLVs follow this TLV. */ + #define TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1) + /* + * When an HWRM receiver detects a TLV type that it does not + * support with the TLV required flag set, the receiver must + * reject the HWRM message with an error code indicating an + * unsupported TLV type. + */ + #define TLV_FLAGS_REQUIRED UINT32_C(0x2) + /* No */ + #define TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1) + /* Yes */ + #define TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1) + #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES + /* + * This field defines the TLV type value which is divided into + * two ranges to differentiate between global and local TLV types. + * Global TLV types must be unique across all defined TLV types. + * Local TLV types are valid only for extensions to a given + * HWRM message and may be repeated across different HWRM message + * types. There is a direct correlation of each HWRM message type + * to a single global TLV type value. + * + * Global TLV range: `0 - (63k-1)` + * + * Local TLV range: `63k - (64k-1)` + */ + uint16_t tlv_type; + /* + * Length of the message data encapsulated by this TLV in bytes. + * This length does not include the size of the TLV header itself + * and it must be an integer multiple of 8B. + */ + uint16_t length; +} tlv_t, *ptlv_t; + +/* Input */ +/* input (size:128b/16B) */ + +typedef struct input { + /* + * This value indicates what type of request this is. The format + * for the rest of the command is determined by this field. + */ + uint16_t req_type; + /* + * This value indicates the what completion ring the request will + * be optionally completed on. If the value is -1, then no + * CR completion will be generated. Any other value must be a + * valid CR ring_id value for this function. + */ + uint16_t cmpl_ring; + /* This value indicates the command sequence number. */ + uint16_t seq_id; /* - * Indicates that this BD is 16B long and is an RX Producer - * Assembly Buffer Descriptor. + * Target ID of this command. + * + * 0x0 - 0xFFF8 - Used for function ids + * 0xFFF8 - 0xFFFE - Reserved for internal processors + * 0xFFFF - HWRM */ - #define BD_BASE_TYPE_RX_PROD_AGG UINT32_C(0x6) + uint16_t target_id; /* - * Indicates that this BD is 32B long and is used for normal L2 - * packet transmission. + * This is the host address where the response will be written + * when the request is complete. This area must be 16B aligned + * and must be cleared to zero before the request is made. */ - #define BD_BASE_TYPE_TX_BD_LONG UINT32_C(0x10) - uint8_t unused_1[7]; -} __attribute__((packed)); + uint64_t resp_addr; +} input_t, *pinput_t; -/* Short TX BD (16 bytes) */ +/* Output */ +/* output (size:64b/8B) */ -struct tx_bd_short { - uint16_t flags_type; +typedef struct output { /* - * All bits in this field must be valid on the first BD of a packet. - * Only the packet_end bit must be valid for the remaining BDs of a - * packet. + * Pass/Fail or error type + * + * Note: receiver to verify the in parameters, and fail the call + * with an error when appropriate */ - /* This value identifies the type of buffer descriptor. */ - #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f) - #define TX_BD_SHORT_TYPE_SFT 0 + uint16_t error_code; + /* This field returns the type of original request. */ + uint16_t req_type; + /* This field provides original sequence number of the command. */ + uint16_t seq_id; /* - * Indicates that this BD is 16B long and is used for normal L2 - * packet transmission. + * This field is the length of the response in bytes. The + * last byte of the response is a valid flag that will read + * as '1' when the command has been completely written to + * memory. */ - #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0) + uint16_t resp_len; +} output_t, *poutput_t; + +/* Short Command Structure */ +/* hwrm_short_input (size:128b/16B) */ + +typedef struct hwrm_short_input { /* - * If set to 1, the packet ends with the data in the buffer pointed to - * by this descriptor. This flag must be valid on every BD. + * This field indicates the type of request in the request buffer. + * The format for the rest of the command (request) is determined + * by this field. */ - #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40) + uint16_t req_type; /* - * If set to 1, the device will not generate a completion for this - * transmit packet unless there is an error in it's processing. If this - * bit is set to 0, then the packet will be completed normally. This bit - * must be valid only on the first BD of a packet. + * This field indicates a signature that is used to identify short + * form of the command listed here. This field shall be set to + * 17185 (0x4321). */ - #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80) + uint16_t signature; + /* Signature indicating this is a short form of HWRM command */ + #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321) + #define HWRM_SHORT_INPUT_SIGNATURE_LAST HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD + /* The target ID of the command */ + uint16_t target_id; + /* Default target_id (0x0) to maintain compatibility with old driver */ + #define HWRM_SHORT_INPUT_TARGET_ID_DEFAULT UINT32_C(0x0) + /* Reserved for user-space HWRM interface */ + #define HWRM_SHORT_INPUT_TARGET_ID_TOOLS UINT32_C(0xfffd) + #define HWRM_SHORT_INPUT_TARGET_ID_LAST HWRM_SHORT_INPUT_TARGET_ID_TOOLS + /* This value indicates the length of the request. */ + uint16_t size; /* - * This value indicates how many 16B BD locations are consumed in the - * ring by this packet. A value of 1 indicates that this BD is the only - * BD (and that the it is a short BD). A value of 3 indicates either 3 - * short BDs or 1 long BD and one short BD in the packet. A value of 0 - * indicates that there are 32 BD locations in the packet (the maximum). - * This field is valid only on the first BD of a packet. + * This is the host address where the request was written. + * This area must be 16B aligned. */ - #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00) - #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8 + uint64_t req_addr; +} hwrm_short_input_t, *phwrm_short_input_t; + +#define GET_HWRM_REQ_TYPE(x) \ + (((x) < 0x80) ? \ + ((x) == 0x0 ? "HWRM_VER_GET": \ + ((x) == 0xb ? "HWRM_FUNC_ECHO_RESPONSE": \ + ((x) == 0xc ? "HWRM_ERROR_RECOVERY_QCFG": \ + ((x) == 0xd ? "HWRM_FUNC_DRV_IF_CHANGE": \ + ((x) == 0xe ? "HWRM_FUNC_BUF_UNRGTR": \ + ((x) == 0xf ? "HWRM_FUNC_VF_CFG": \ + ((x) == 0x10 ? "HWRM_RESERVED1": \ + ((x) == 0x11 ? "HWRM_FUNC_RESET": \ + ((x) == 0x12 ? "HWRM_FUNC_GETFID": \ + ((x) == 0x13 ? "HWRM_FUNC_VF_ALLOC": \ + ((x) == 0x14 ? "HWRM_FUNC_VF_FREE": \ + ((x) == 0x15 ? "HWRM_FUNC_QCAPS": \ + ((x) == 0x16 ? "HWRM_FUNC_QCFG": \ + ((x) == 0x17 ? "HWRM_FUNC_CFG": \ + ((x) == 0x18 ? "HWRM_FUNC_QSTATS": \ + ((x) == 0x19 ? "HWRM_FUNC_CLR_STATS": \ + ((x) == 0x1a ? "HWRM_FUNC_DRV_UNRGTR": \ + ((x) == 0x1b ? "HWRM_FUNC_VF_RESC_FREE": \ + ((x) == 0x1c ? "HWRM_FUNC_VF_VNIC_IDS_QUERY": \ + ((x) == 0x1d ? "HWRM_FUNC_DRV_RGTR": \ + ((x) == 0x1e ? "HWRM_FUNC_DRV_QVER": \ + ((x) == 0x1f ? "HWRM_FUNC_BUF_RGTR": \ + ((x) == 0x20 ? "HWRM_PORT_PHY_CFG": \ + ((x) == 0x21 ? "HWRM_PORT_MAC_CFG": \ + ((x) == 0x22 ? "HWRM_PORT_TS_QUERY": \ + ((x) == 0x23 ? "HWRM_PORT_QSTATS": \ + ((x) == 0x24 ? "HWRM_PORT_LPBK_QSTATS": \ + ((x) == 0x25 ? "HWRM_PORT_CLR_STATS": \ + ((x) == 0x26 ? "HWRM_PORT_LPBK_CLR_STATS": \ + ((x) == 0x27 ? "HWRM_PORT_PHY_QCFG": \ + ((x) == 0x28 ? "HWRM_PORT_MAC_QCFG": \ + ((x) == 0x29 ? "HWRM_PORT_MAC_PTP_QCFG": \ + ((x) == 0x2a ? "HWRM_PORT_PHY_QCAPS": \ + ((x) == 0x2b ? "HWRM_PORT_PHY_I2C_WRITE": \ + ((x) == 0x2c ? "HWRM_PORT_PHY_I2C_READ": \ + ((x) == 0x2d ? "HWRM_PORT_LED_CFG": \ + ((x) == 0x2e ? "HWRM_PORT_LED_QCFG": \ + ((x) == 0x2f ? "HWRM_PORT_LED_QCAPS": \ + ((x) == 0x30 ? "HWRM_QUEUE_QPORTCFG": \ + ((x) == 0x31 ? "HWRM_QUEUE_QCFG": \ + ((x) == 0x32 ? "HWRM_QUEUE_CFG": \ + ((x) == 0x33 ? "HWRM_FUNC_VLAN_CFG": \ + ((x) == 0x34 ? "HWRM_FUNC_VLAN_QCFG": \ + ((x) == 0x35 ? "HWRM_QUEUE_PFCENABLE_QCFG": \ + ((x) == 0x36 ? "HWRM_QUEUE_PFCENABLE_CFG": \ + ((x) == 0x37 ? "HWRM_QUEUE_PRI2COS_QCFG": \ + ((x) == 0x38 ? "HWRM_QUEUE_PRI2COS_CFG": \ + ((x) == 0x39 ? "HWRM_QUEUE_COS2BW_QCFG": \ + ((x) == 0x3a ? "HWRM_QUEUE_COS2BW_CFG": \ + ((x) == 0x3b ? "HWRM_QUEUE_DSCP_QCAPS": \ + ((x) == 0x3c ? "HWRM_QUEUE_DSCP2PRI_QCFG": \ + ((x) == 0x3d ? "HWRM_QUEUE_DSCP2PRI_CFG": \ + ((x) == 0x40 ? "HWRM_VNIC_ALLOC": \ + ((x) == 0x41 ? "HWRM_VNIC_FREE": \ + ((x) == 0x42 ? "HWRM_VNIC_CFG": \ + ((x) == 0x43 ? "HWRM_VNIC_QCFG": \ + ((x) == 0x44 ? "HWRM_VNIC_TPA_CFG": \ + ((x) == 0x45 ? "HWRM_VNIC_TPA_QCFG": \ + ((x) == 0x46 ? "HWRM_VNIC_RSS_CFG": \ + ((x) == 0x47 ? "HWRM_VNIC_RSS_QCFG": \ + ((x) == 0x48 ? "HWRM_VNIC_PLCMODES_CFG": \ + ((x) == 0x49 ? "HWRM_VNIC_PLCMODES_QCFG": \ + ((x) == 0x4a ? "HWRM_VNIC_QCAPS": \ + ((x) == 0x4b ? "HWRM_VNIC_UPDATE": \ + ((x) == 0x50 ? "HWRM_RING_ALLOC": \ + ((x) == 0x51 ? "HWRM_RING_FREE": \ + ((x) == 0x52 ? "HWRM_RING_CMPL_RING_QAGGINT_PARAMS": \ + ((x) == 0x53 ? "HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS": \ + ((x) == 0x54 ? "HWRM_RING_AGGINT_QCAPS": \ + ((x) == 0x55 ? "HWRM_RING_SCHQ_ALLOC": \ + ((x) == 0x56 ? "HWRM_RING_SCHQ_CFG": \ + ((x) == 0x57 ? "HWRM_RING_SCHQ_FREE": \ + ((x) == 0x5e ? "HWRM_RING_RESET": \ + ((x) == 0x60 ? "HWRM_RING_GRP_ALLOC": \ + ((x) == 0x61 ? "HWRM_RING_GRP_FREE": \ + ((x) == 0x62 ? "HWRM_RING_CFG": \ + ((x) == 0x63 ? "HWRM_RING_QCFG": \ + ((x) == 0x64 ? "HWRM_RESERVED5": \ + ((x) == 0x65 ? "HWRM_RESERVED6": \ + ((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \ + ((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \ + "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + (((x) < 0x100) ? \ + ((x) == 0x80 ? "HWRM_QUEUE_MPLS_QCAPS": \ + ((x) == 0x81 ? "HWRM_QUEUE_MPLSTC2PRI_QCFG": \ + ((x) == 0x82 ? "HWRM_QUEUE_MPLSTC2PRI_CFG": \ + ((x) == 0x83 ? "HWRM_QUEUE_VLANPRI_QCAPS": \ + ((x) == 0x84 ? "HWRM_QUEUE_VLANPRI2PRI_QCFG": \ + ((x) == 0x85 ? "HWRM_QUEUE_VLANPRI2PRI_CFG": \ + ((x) == 0x86 ? "HWRM_QUEUE_GLOBAL_CFG": \ + ((x) == 0x87 ? "HWRM_QUEUE_GLOBAL_QCFG": \ + ((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \ + ((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \ + ((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \ + ((x) == 0x93 ? "HWRM_CFA_L2_SET_RX_MASK": \ + ((x) == 0x94 ? "HWRM_CFA_VLAN_ANTISPOOF_CFG": \ + ((x) == 0x95 ? "HWRM_CFA_TUNNEL_FILTER_ALLOC": \ + ((x) == 0x96 ? "HWRM_CFA_TUNNEL_FILTER_FREE": \ + ((x) == 0x97 ? "HWRM_CFA_ENCAP_RECORD_ALLOC": \ + ((x) == 0x98 ? "HWRM_CFA_ENCAP_RECORD_FREE": \ + ((x) == 0x99 ? "HWRM_CFA_NTUPLE_FILTER_ALLOC": \ + ((x) == 0x9a ? "HWRM_CFA_NTUPLE_FILTER_FREE": \ + ((x) == 0x9b ? "HWRM_CFA_NTUPLE_FILTER_CFG": \ + ((x) == 0x9c ? "HWRM_CFA_EM_FLOW_ALLOC": \ + ((x) == 0x9d ? "HWRM_CFA_EM_FLOW_FREE": \ + ((x) == 0x9e ? "HWRM_CFA_EM_FLOW_CFG": \ + ((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \ + ((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \ + ((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \ + ((x) == 0xaf ? "HWRM_STAT_CTX_ENG_QUERY": \ + ((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \ + ((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \ + ((x) == 0xb2 ? "HWRM_STAT_CTX_QUERY": \ + ((x) == 0xb3 ? "HWRM_STAT_CTX_CLR_STATS": \ + ((x) == 0xb4 ? "HWRM_PORT_QSTATS_EXT": \ + ((x) == 0xb5 ? "HWRM_PORT_PHY_MDIO_WRITE": \ + ((x) == 0xb6 ? "HWRM_PORT_PHY_MDIO_READ": \ + ((x) == 0xb7 ? "HWRM_PORT_PHY_MDIO_BUS_ACQUIRE": \ + ((x) == 0xb8 ? "HWRM_PORT_PHY_MDIO_BUS_RELEASE": \ + ((x) == 0xb9 ? "HWRM_PORT_QSTATS_EXT_PFC_WD": \ + ((x) == 0xba ? "HWRM_RESERVED7": \ + ((x) == 0xbb ? "HWRM_PORT_TX_FIR_CFG": \ + ((x) == 0xbc ? "HWRM_PORT_TX_FIR_QCFG": \ + ((x) == 0xbd ? "HWRM_PORT_ECN_QSTATS": \ + ((x) == 0xbe ? "HWRM_FW_LIVEPATCH_QUERY": \ + ((x) == 0xbf ? "HWRM_FW_LIVEPATCH": \ + ((x) == 0xc0 ? "HWRM_FW_RESET": \ + ((x) == 0xc1 ? "HWRM_FW_QSTATUS": \ + ((x) == 0xc2 ? "HWRM_FW_HEALTH_CHECK": \ + ((x) == 0xc3 ? "HWRM_FW_SYNC": \ + ((x) == 0xc4 ? "HWRM_FW_STATE_QCAPS": \ + ((x) == 0xc5 ? "HWRM_FW_STATE_QUIESCE": \ + ((x) == 0xc6 ? "HWRM_FW_STATE_BACKUP": \ + ((x) == 0xc7 ? "HWRM_FW_STATE_RESTORE": \ + ((x) == 0xc8 ? "HWRM_FW_SET_TIME": \ + ((x) == 0xc9 ? "HWRM_FW_GET_TIME": \ + ((x) == 0xca ? "HWRM_FW_SET_STRUCTURED_DATA": \ + ((x) == 0xcb ? "HWRM_FW_GET_STRUCTURED_DATA": \ + ((x) == 0xcc ? "HWRM_FW_IPC_MAILBOX": \ + ((x) == 0xcd ? "HWRM_FW_ECN_CFG": \ + ((x) == 0xce ? "HWRM_FW_ECN_QCFG": \ + ((x) == 0xcf ? "HWRM_FW_SECURE_CFG": \ + ((x) == 0xd0 ? "HWRM_EXEC_FWD_RESP": \ + ((x) == 0xd1 ? "HWRM_REJECT_FWD_RESP": \ + ((x) == 0xd2 ? "HWRM_FWD_RESP": \ + ((x) == 0xd3 ? "HWRM_FWD_ASYNC_EVENT_CMPL": \ + ((x) == 0xd4 ? "HWRM_OEM_CMD": \ + ((x) == 0xd5 ? "HWRM_PORT_PRBS_TEST": \ + ((x) == 0xd6 ? "HWRM_PORT_SFP_SIDEBAND_CFG": \ + ((x) == 0xd7 ? "HWRM_PORT_SFP_SIDEBAND_QCFG": \ + ((x) == 0xd8 ? "HWRM_FW_STATE_UNQUIESCE": \ + ((x) == 0xd9 ? "HWRM_PORT_DSC_DUMP": \ + ((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \ + ((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \ + ((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \ + ((x) == 0xe3 ? "HWRM_REG_POWER_HISTOGRAM": \ + ((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \ + ((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \ + ((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \ + ((x) == 0xf3 ? "HWRM_WOL_REASON_QCFG": \ + ((x) == 0xf4 ? "HWRM_CFA_METER_QCAPS": \ + ((x) == 0xf5 ? "HWRM_CFA_METER_PROFILE_ALLOC": \ + ((x) == 0xf6 ? "HWRM_CFA_METER_PROFILE_FREE": \ + ((x) == 0xf7 ? "HWRM_CFA_METER_PROFILE_CFG": \ + ((x) == 0xf8 ? "HWRM_CFA_METER_INSTANCE_ALLOC": \ + ((x) == 0xf9 ? "HWRM_CFA_METER_INSTANCE_FREE": \ + ((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \ + ((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \ + ((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + (((x) < 0x180) ? \ + ((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \ + ((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \ + ((x) == 0x102 ? "HWRM_CFA_VF_PAIR_INFO": \ + ((x) == 0x103 ? "HWRM_CFA_FLOW_ALLOC": \ + ((x) == 0x104 ? "HWRM_CFA_FLOW_FREE": \ + ((x) == 0x105 ? "HWRM_CFA_FLOW_FLUSH": \ + ((x) == 0x106 ? "HWRM_CFA_FLOW_STATS": \ + ((x) == 0x107 ? "HWRM_CFA_FLOW_INFO": \ + ((x) == 0x108 ? "HWRM_CFA_DECAP_FILTER_ALLOC": \ + ((x) == 0x109 ? "HWRM_CFA_DECAP_FILTER_FREE": \ + ((x) == 0x10a ? "HWRM_CFA_VLAN_ANTISPOOF_QCFG": \ + ((x) == 0x10b ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC": \ + ((x) == 0x10c ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE": \ + ((x) == 0x10d ? "HWRM_CFA_PAIR_ALLOC": \ + ((x) == 0x10e ? "HWRM_CFA_PAIR_FREE": \ + ((x) == 0x10f ? "HWRM_CFA_PAIR_INFO": \ + ((x) == 0x110 ? "HWRM_FW_IPC_MSG": \ + ((x) == 0x111 ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO": \ + ((x) == 0x112 ? "HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE": \ + ((x) == 0x113 ? "HWRM_CFA_FLOW_AGING_TIMER_RESET": \ + ((x) == 0x114 ? "HWRM_CFA_FLOW_AGING_CFG": \ + ((x) == 0x115 ? "HWRM_CFA_FLOW_AGING_QCFG": \ + ((x) == 0x116 ? "HWRM_CFA_FLOW_AGING_QCAPS": \ + ((x) == 0x117 ? "HWRM_CFA_CTX_MEM_RGTR": \ + ((x) == 0x118 ? "HWRM_CFA_CTX_MEM_UNRGTR": \ + ((x) == 0x119 ? "HWRM_CFA_CTX_MEM_QCTX": \ + ((x) == 0x11a ? "HWRM_CFA_CTX_MEM_QCAPS": \ + ((x) == 0x11b ? "HWRM_CFA_COUNTER_QCAPS": \ + ((x) == 0x11c ? "HWRM_CFA_COUNTER_CFG": \ + ((x) == 0x11d ? "HWRM_CFA_COUNTER_QCFG": \ + ((x) == 0x11e ? "HWRM_CFA_COUNTER_QSTATS": \ + ((x) == 0x11f ? "HWRM_CFA_TCP_FLAG_PROCESS_QCFG": \ + ((x) == 0x120 ? "HWRM_CFA_EEM_QCAPS": \ + ((x) == 0x121 ? "HWRM_CFA_EEM_CFG": \ + ((x) == 0x122 ? "HWRM_CFA_EEM_QCFG": \ + ((x) == 0x123 ? "HWRM_CFA_EEM_OP": \ + ((x) == 0x124 ? "HWRM_CFA_ADV_FLOW_MGNT_QCAPS": \ + ((x) == 0x125 ? "HWRM_CFA_TFLIB": \ + ((x) == 0x126 ? "HWRM_CFA_LAG_GROUP_MEMBER_RGTR": \ + ((x) == 0x127 ? "HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR": \ + ((x) == 0x12e ? "HWRM_ENGINE_CKV_STATUS": \ + ((x) == 0x12f ? "HWRM_ENGINE_CKV_CKEK_ADD": \ + ((x) == 0x130 ? "HWRM_ENGINE_CKV_CKEK_DELETE": \ + ((x) == 0x131 ? "HWRM_ENGINE_CKV_KEY_ADD": \ + ((x) == 0x132 ? "HWRM_ENGINE_CKV_KEY_DELETE": \ + ((x) == 0x133 ? "HWRM_ENGINE_CKV_FLUSH": \ + ((x) == 0x134 ? "HWRM_ENGINE_CKV_RNG_GET": \ + ((x) == 0x135 ? "HWRM_ENGINE_CKV_KEY_GEN": \ + ((x) == 0x136 ? "HWRM_ENGINE_CKV_KEY_LABEL_CFG": \ + ((x) == 0x137 ? "HWRM_ENGINE_CKV_KEY_LABEL_QCFG": \ + ((x) == 0x13c ? "HWRM_ENGINE_QG_CONFIG_QUERY": \ + ((x) == 0x13d ? "HWRM_ENGINE_QG_QUERY": \ + ((x) == 0x13e ? "HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY": \ + ((x) == 0x13f ? "HWRM_ENGINE_QG_METER_PROFILE_QUERY": \ + ((x) == 0x140 ? "HWRM_ENGINE_QG_METER_PROFILE_ALLOC": \ + ((x) == 0x141 ? "HWRM_ENGINE_QG_METER_PROFILE_FREE": \ + ((x) == 0x142 ? "HWRM_ENGINE_QG_METER_QUERY": \ + ((x) == 0x143 ? "HWRM_ENGINE_QG_METER_BIND": \ + ((x) == 0x144 ? "HWRM_ENGINE_QG_METER_UNBIND": \ + ((x) == 0x145 ? "HWRM_ENGINE_QG_FUNC_BIND": \ + ((x) == 0x146 ? "HWRM_ENGINE_SG_CONFIG_QUERY": \ + ((x) == 0x147 ? "HWRM_ENGINE_SG_QUERY": \ + ((x) == 0x148 ? "HWRM_ENGINE_SG_METER_QUERY": \ + ((x) == 0x149 ? "HWRM_ENGINE_SG_METER_CONFIG": \ + ((x) == 0x14a ? "HWRM_ENGINE_SG_QG_BIND": \ + ((x) == 0x14b ? "HWRM_ENGINE_QG_SG_UNBIND": \ + ((x) == 0x154 ? "HWRM_ENGINE_CONFIG_QUERY": \ + ((x) == 0x155 ? "HWRM_ENGINE_STATS_CONFIG": \ + ((x) == 0x156 ? "HWRM_ENGINE_STATS_CLEAR": \ + ((x) == 0x157 ? "HWRM_ENGINE_STATS_QUERY": \ + ((x) == 0x158 ? "HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR": \ + ((x) == 0x15e ? "HWRM_ENGINE_RQ_ALLOC": \ + ((x) == 0x15f ? "HWRM_ENGINE_RQ_FREE": \ + ((x) == 0x160 ? "HWRM_ENGINE_CQ_ALLOC": \ + ((x) == 0x161 ? "HWRM_ENGINE_CQ_FREE": \ + ((x) == 0x162 ? "HWRM_ENGINE_NQ_ALLOC": \ + ((x) == 0x163 ? "HWRM_ENGINE_NQ_FREE": \ + ((x) == 0x164 ? "HWRM_ENGINE_ON_DIE_RQE_CREDITS": \ + ((x) == 0x165 ? "HWRM_ENGINE_FUNC_QCFG": \ + "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + (((x) < 0x200) ? \ + ((x) == 0x190 ? "HWRM_FUNC_RESOURCE_QCAPS": \ + ((x) == 0x191 ? "HWRM_FUNC_VF_RESOURCE_CFG": \ + ((x) == 0x192 ? "HWRM_FUNC_BACKING_STORE_QCAPS": \ + ((x) == 0x193 ? "HWRM_FUNC_BACKING_STORE_CFG": \ + ((x) == 0x194 ? "HWRM_FUNC_BACKING_STORE_QCFG": \ + ((x) == 0x195 ? "HWRM_FUNC_VF_BW_CFG": \ + ((x) == 0x196 ? "HWRM_FUNC_VF_BW_QCFG": \ + ((x) == 0x197 ? "HWRM_FUNC_HOST_PF_IDS_QUERY": \ + ((x) == 0x198 ? "HWRM_FUNC_QSTATS_EXT": \ + ((x) == 0x199 ? "HWRM_STAT_EXT_CTX_QUERY": \ + ((x) == 0x19a ? "HWRM_FUNC_SPD_CFG": \ + ((x) == 0x19b ? "HWRM_FUNC_SPD_QCFG": \ + ((x) == 0x19c ? "HWRM_FUNC_PTP_PIN_QCFG": \ + ((x) == 0x19d ? "HWRM_FUNC_PTP_PIN_CFG": \ + ((x) == 0x19e ? "HWRM_FUNC_PTP_CFG": \ + ((x) == 0x19f ? "HWRM_FUNC_PTP_TS_QUERY": \ + "Unknown decode" )))))))))))))))) : \ + (((x) < 0x280) ? \ + ((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \ + ((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \ + ((x) == 0x202 ? "HWRM_SELFTEST_IRQ": \ + ((x) == 0x203 ? "HWRM_SELFTEST_RETRIEVE_SERDES_DATA": \ + ((x) == 0x204 ? "HWRM_PCIE_QSTATS": \ + ((x) == 0x205 ? "HWRM_MFG_FRU_WRITE_CONTROL": \ + ((x) == 0x206 ? "HWRM_MFG_TIMERS_QUERY": \ + ((x) == 0x207 ? "HWRM_MFG_OTP_CFG": \ + ((x) == 0x208 ? "HWRM_MFG_OTP_QCFG": \ + ((x) == 0x209 ? "HWRM_MFG_HDMA_TEST": \ + ((x) == 0x20a ? "HWRM_MFG_FRU_EEPROM_WRITE": \ + ((x) == 0x20b ? "HWRM_MFG_FRU_EEPROM_READ": \ + ((x) == 0x20c ? "HWRM_MFG_SOC_IMAGE": \ + ((x) == 0x20d ? "HWRM_MFG_SOC_QSTATUS": \ + ((x) == 0x20e ? "HWRM_MFG_PARAM_SEEPROM_SYNC": \ + ((x) == 0x20f ? "HWRM_MFG_PARAM_SEEPROM_READ": \ + ((x) == 0x210 ? "HWRM_MFG_PARAM_SEEPROM_HEALTH": \ + "Unknown decode" ))))))))))))))))) : \ + (((x) < 0x300) ? \ + ((x) == 0x2bc ? "HWRM_TF": \ + ((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \ + ((x) == 0x2c6 ? "HWRM_TF_SESSION_OPEN": \ + ((x) == 0x2c7 ? "HWRM_TF_SESSION_ATTACH": \ + ((x) == 0x2c8 ? "HWRM_TF_SESSION_REGISTER": \ + ((x) == 0x2c9 ? "HWRM_TF_SESSION_UNREGISTER": \ + ((x) == 0x2ca ? "HWRM_TF_SESSION_CLOSE": \ + ((x) == 0x2cb ? "HWRM_TF_SESSION_QCFG": \ + ((x) == 0x2cc ? "HWRM_TF_SESSION_RESC_QCAPS": \ + ((x) == 0x2cd ? "HWRM_TF_SESSION_RESC_ALLOC": \ + ((x) == 0x2ce ? "HWRM_TF_SESSION_RESC_FREE": \ + ((x) == 0x2cf ? "HWRM_TF_SESSION_RESC_FLUSH": \ + ((x) == 0x2d0 ? "HWRM_TF_SESSION_RESC_INFO": \ + ((x) == 0x2da ? "HWRM_TF_TBL_TYPE_GET": \ + ((x) == 0x2db ? "HWRM_TF_TBL_TYPE_SET": \ + ((x) == 0x2dc ? "HWRM_TF_TBL_TYPE_BULK_GET": \ + ((x) == 0x2e2 ? "HWRM_TF_CTXT_MEM_ALLOC": \ + ((x) == 0x2e3 ? "HWRM_TF_CTXT_MEM_FREE": \ + ((x) == 0x2e4 ? "HWRM_TF_CTXT_MEM_RGTR": \ + ((x) == 0x2e5 ? "HWRM_TF_CTXT_MEM_UNRGTR": \ + ((x) == 0x2e6 ? "HWRM_TF_EXT_EM_QCAPS": \ + ((x) == 0x2e7 ? "HWRM_TF_EXT_EM_OP": \ + ((x) == 0x2e8 ? "HWRM_TF_EXT_EM_CFG": \ + ((x) == 0x2e9 ? "HWRM_TF_EXT_EM_QCFG": \ + ((x) == 0x2ea ? "HWRM_TF_EM_INSERT": \ + ((x) == 0x2eb ? "HWRM_TF_EM_DELETE": \ + ((x) == 0x2ec ? "HWRM_TF_EM_HASH_INSERT": \ + ((x) == 0x2ed ? "HWRM_TF_EM_MOVE": \ + ((x) == 0x2f8 ? "HWRM_TF_TCAM_SET": \ + ((x) == 0x2f9 ? "HWRM_TF_TCAM_GET": \ + ((x) == 0x2fa ? "HWRM_TF_TCAM_MOVE": \ + ((x) == 0x2fb ? "HWRM_TF_TCAM_FREE": \ + ((x) == 0x2fc ? "HWRM_TF_GLOBAL_CFG_SET": \ + ((x) == 0x2fd ? "HWRM_TF_GLOBAL_CFG_GET": \ + ((x) == 0x2fe ? "HWRM_TF_IF_TBL_SET": \ + ((x) == 0x2ff ? "HWRM_TF_IF_TBL_GET": \ + "Unknown decode" )))))))))))))))))))))))))))))))))))) : \ + (((x) < 0x480) ? \ + ((x) == 0x400 ? "HWRM_SV": \ + "Unknown decode" ) : \ + (((x) < 0xff80) ? \ + ((x) == 0xff10 ? "HWRM_DBG_READ_DIRECT": \ + ((x) == 0xff11 ? "HWRM_DBG_READ_INDIRECT": \ + ((x) == 0xff12 ? "HWRM_DBG_WRITE_DIRECT": \ + ((x) == 0xff13 ? "HWRM_DBG_WRITE_INDIRECT": \ + ((x) == 0xff14 ? "HWRM_DBG_DUMP": \ + ((x) == 0xff15 ? "HWRM_DBG_ERASE_NVM": \ + ((x) == 0xff16 ? "HWRM_DBG_CFG": \ + ((x) == 0xff17 ? "HWRM_DBG_COREDUMP_LIST": \ + ((x) == 0xff18 ? "HWRM_DBG_COREDUMP_INITIATE": \ + ((x) == 0xff19 ? "HWRM_DBG_COREDUMP_RETRIEVE": \ + ((x) == 0xff1a ? "HWRM_DBG_FW_CLI": \ + ((x) == 0xff1b ? "HWRM_DBG_I2C_CMD": \ + ((x) == 0xff1c ? "HWRM_DBG_RING_INFO_GET": \ + ((x) == 0xff1d ? "HWRM_DBG_CRASHDUMP_HEADER": \ + ((x) == 0xff1e ? "HWRM_DBG_CRASHDUMP_ERASE": \ + ((x) == 0xff1f ? "HWRM_DBG_DRV_TRACE": \ + ((x) == 0xff20 ? "HWRM_DBG_QCAPS": \ + ((x) == 0xff21 ? "HWRM_DBG_QCFG": \ + ((x) == 0xff22 ? "HWRM_DBG_CRASHDUMP_MEDIUM_CFG": \ + ((x) == 0xff23 ? "HWRM_DBG_USEQ_ALLOC": \ + ((x) == 0xff24 ? "HWRM_DBG_USEQ_FREE": \ + ((x) == 0xff25 ? "HWRM_DBG_USEQ_FLUSH": \ + ((x) == 0xff26 ? "HWRM_DBG_USEQ_QCAPS": \ + ((x) == 0xff27 ? "HWRM_DBG_USEQ_CW_CFG": \ + ((x) == 0xff28 ? "HWRM_DBG_USEQ_SCHED_CFG": \ + ((x) == 0xff29 ? "HWRM_DBG_USEQ_RUN": \ + ((x) == 0xff2a ? "HWRM_DBG_USEQ_DELIVERY_REQ": \ + ((x) == 0xff2b ? "HWRM_DBG_USEQ_RESP_HDR": \ + "Unknown decode" )))))))))))))))))))))))))))) : \ + (((x) <= 0xffff) ? \ + ((x) == 0xffed ? "HWRM_NVM_REQ_ARBITRATION": \ + ((x) == 0xffee ? "HWRM_NVM_FACTORY_DEFAULTS": \ + ((x) == 0xffef ? "HWRM_NVM_VALIDATE_OPTION": \ + ((x) == 0xfff0 ? "HWRM_NVM_FLUSH": \ + ((x) == 0xfff1 ? "HWRM_NVM_GET_VARIABLE": \ + ((x) == 0xfff2 ? "HWRM_NVM_SET_VARIABLE": \ + ((x) == 0xfff3 ? "HWRM_NVM_INSTALL_UPDATE": \ + ((x) == 0xfff4 ? "HWRM_NVM_MODIFY": \ + ((x) == 0xfff5 ? "HWRM_NVM_VERIFY_UPDATE": \ + ((x) == 0xfff6 ? "HWRM_NVM_GET_DEV_INFO": \ + ((x) == 0xfff7 ? "HWRM_NVM_ERASE_DIR_ENTRY": \ + ((x) == 0xfff8 ? "HWRM_NVM_MOD_DIR_ENTRY": \ + ((x) == 0xfff9 ? "HWRM_NVM_FIND_DIR_ENTRY": \ + ((x) == 0xfffa ? "HWRM_NVM_GET_DIR_ENTRIES": \ + ((x) == 0xfffb ? "HWRM_NVM_GET_DIR_INFO": \ + ((x) == 0xfffc ? "HWRM_NVM_RAW_DUMP": \ + ((x) == 0xfffd ? "HWRM_NVM_READ": \ + ((x) == 0xfffe ? "HWRM_NVM_WRITE": \ + ((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \ + "Unknown decode" ))))))))))))))))))) : \ + "Unknown decode" ))))))))) + + +/* + * Command numbering + * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml + * # So only structure definition is provided here. + */ +/* cmd_nums (size:64b/8B) */ + +typedef struct cmd_nums { + /* + * This version of the specification defines the commands listed in + * the table below. The following are general implementation + * requirements for these commands: + * + * # All commands listed below that are marked neither + * reserved nor experimental shall be implemented by the HWRM. + * # A HWRM client compliant to this specification should not use + * commands outside of the list below. + * # A HWRM client compliant to this specification should not use + * command numbers marked reserved below. + * # A command marked experimental below may not be implemented + * by the HWRM. + * # A command marked experimental may change in the + * future version of the HWRM specification. + * # A command not listed below may be implemented by the HWRM. + * The behavior of commands that are not listed below is outside + * the scope of this specification. + */ + uint16_t req_type; + #define HWRM_VER_GET UINT32_C(0x0) + #define HWRM_FUNC_ECHO_RESPONSE UINT32_C(0xb) + #define HWRM_ERROR_RECOVERY_QCFG UINT32_C(0xc) + #define HWRM_FUNC_DRV_IF_CHANGE UINT32_C(0xd) + #define HWRM_FUNC_BUF_UNRGTR UINT32_C(0xe) + #define HWRM_FUNC_VF_CFG UINT32_C(0xf) + /* Reserved for future use. */ + #define HWRM_RESERVED1 UINT32_C(0x10) + #define HWRM_FUNC_RESET UINT32_C(0x11) + #define HWRM_FUNC_GETFID UINT32_C(0x12) + #define HWRM_FUNC_VF_ALLOC UINT32_C(0x13) + #define HWRM_FUNC_VF_FREE UINT32_C(0x14) + #define HWRM_FUNC_QCAPS UINT32_C(0x15) + #define HWRM_FUNC_QCFG UINT32_C(0x16) + #define HWRM_FUNC_CFG UINT32_C(0x17) + #define HWRM_FUNC_QSTATS UINT32_C(0x18) + #define HWRM_FUNC_CLR_STATS UINT32_C(0x19) + #define HWRM_FUNC_DRV_UNRGTR UINT32_C(0x1a) + #define HWRM_FUNC_VF_RESC_FREE UINT32_C(0x1b) + #define HWRM_FUNC_VF_VNIC_IDS_QUERY UINT32_C(0x1c) + #define HWRM_FUNC_DRV_RGTR UINT32_C(0x1d) + #define HWRM_FUNC_DRV_QVER UINT32_C(0x1e) + #define HWRM_FUNC_BUF_RGTR UINT32_C(0x1f) + #define HWRM_PORT_PHY_CFG UINT32_C(0x20) + #define HWRM_PORT_MAC_CFG UINT32_C(0x21) + /* Experimental */ + #define HWRM_PORT_TS_QUERY UINT32_C(0x22) + #define HWRM_PORT_QSTATS UINT32_C(0x23) + #define HWRM_PORT_LPBK_QSTATS UINT32_C(0x24) + /* Experimental */ + #define HWRM_PORT_CLR_STATS UINT32_C(0x25) + /* Experimental */ + #define HWRM_PORT_LPBK_CLR_STATS UINT32_C(0x26) *** 88566 LINES SKIPPED *** From nobody Thu Jan 19 03:52:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7x809Crz2svc6; Thu, 19 Jan 2023 03:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7x766R8z3hZg; Thu, 19 Jan 2023 03:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJ/BcBZ7NesP0J2nXVmmH60T+zr2MRcHyaKZPdQgv2Q=; b=UrqPX5gFLqHWVndll5MlnyxYAPYTh9b9Csdy0FPjL/CW1JdMImcwL2T68cW0icLBl/2unO aqpmnHD9Lgj1c3vxAaNvjZEQv1Z6Aj+iRRQbhx0F5i4Q4c45C9EZ6vxWPnCxsOuCdom0K2 p8SFvxODWwgSJL10KRTZEX/MvtoUq5qAeP18UwIKNC5mNc3PTntvZTxI9cm840U8zkoT7/ PcwURr7P2Ec0YR3FvlAKSWP9Z0DhcT45bP3MzdCprs2Azm9QEqDyd53Up+MI0haIVZa9/2 NAyOrcnep46JscGHCLCp3ZFEzIHEVC2mXTCFaBO/WXiEudAGRXEVDmUS9pWsNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJ/BcBZ7NesP0J2nXVmmH60T+zr2MRcHyaKZPdQgv2Q=; b=FhGzfQDwdvEJ51aDOsJ2zry4p0jV/hREjPvQRlLiG9lj5JFeXtCxbasGTqcoQKMlFIzrII pxZcT1RqBlnVmDUBlOX34PynkRMsFlvte9g1Cv8ZNujgVO9TRazYxm0R3bCw2L2YkICBdE Q2O5rOZn2vCKLRh+9d6fwDO+NI7IVIT1HtUyEPPB65Jnh5tzt2Afr7qvotc5J7npVhuDKi ugBKVT75keBLfNq7X+A6kVTxR929aTmRuoaa4PCEfFQTMAaXXjr7C2KgdvAPmQKyHGksRl m0KLYFwAOuUmWgDZ+GrTPvUD8yGq5EpO7g4ZaBbf+qyEbuTO+VHsqwpukvBexg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100331; a=rsa-sha256; cv=none; b=QdXRRZTmWPZeS3vPRB7G/LW5hCymX58Lr2x0luQrSAH/Kg9tW/om5kp8e3zTgDVhmjgj1I JGCedd755mdOExT/YfRIwq+Lj2td2HusYaBR/cvPm/AyWaqo6MOF+NqGxtG/iZnEmwDoeL fAX/8+fKRlzD7VSMze/U0bABHkrxwtKio6+5/GayA2AaiBhA9QNfrndF47phs2ct+NRdZL juJD7quYrL19UTltVwZOFXrEGAuk9UudDnVxIunbU+HY6GzscE7v3+95YjAmZyba4cGkSv Kb52HRfkA/oGNtqetMp9h+hF7DxZBjgHeQBVY7cQHM7VsjNHmxNaZauxjWPFYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7x75DPtzcff; Thu, 19 Jan 2023 03:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qBsN021922; Thu, 19 Jan 2023 03:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qBYu021921; Thu, 19 Jan 2023 03:52:11 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:11 GMT Message-Id: <202301190352.30J3qBYu021921@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: 86bf3fd82f1f - stable/13 - if_bnxt: Convert all doorbell writes into function pointers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 86bf3fd82f1f2c51968df01f483a0524d6168af0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=86bf3fd82f1f2c51968df01f483a0524d6168af0 commit 86bf3fd82f1f2c51968df01f483a0524d6168af0 Author: Sumit Saxena AuthorDate: 2022-11-04 22:01:30 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:05 +0000 if_bnxt: Convert all doorbell writes into function pointers This is preparatory patch for making a base for Broadcom's Thor controller support. It converts all doorbell writes into function pointers. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36437 (cherry picked from commit 49a3df78c75f29dfa4991314535c0eac4f5a73fa) --- sys/dev/bnxt/bnxt.h | 95 +++++++----------------------------------------- sys/dev/bnxt/bnxt_txrx.c | 14 ++----- sys/dev/bnxt/if_bnxt.c | 87 ++++++++++++++++++++++++++++++++++---------- 3 files changed, 86 insertions(+), 110 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index f371388a411e..8d806c3a4877 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -127,87 +127,6 @@ __FBSDID("$FreeBSD$"); (CACHE_LINE_SIZE / sizeof(struct cmpl_base))) & \ ((cpr)->ring.ring_size - 1)]) -/* - * If we update the index, a write barrier is needed after the write to ensure - * the completion ring has space before the RX/TX ring does. Since we can't - * make the RX and AG doorbells covered by the same barrier without remapping - * MSI-X vectors, we create the barrier over the enture doorbell bar. - * TODO: Remap the MSI-X vectors to allow a barrier to only cover the doorbells - * for a single ring group. - * - * A barrier of just the size of the write is used to ensure the ordering - * remains correct and no writes are lost. - */ -#define BNXT_CP_DISABLE_DB(ring) do { \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, 4, \ - BUS_SPACE_BARRIER_WRITE); \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, 0, \ - (ring)->softc->doorbell_bar.size, BUS_SPACE_BARRIER_WRITE); \ - bus_space_write_4((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, \ - htole32(CMPL_DOORBELL_KEY_CMPL | CMPL_DOORBELL_MASK)); \ -} while (0) - -#define BNXT_CP_ENABLE_DB(ring) do { \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, 4, \ - BUS_SPACE_BARRIER_WRITE); \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, 0, \ - (ring)->softc->doorbell_bar.size, BUS_SPACE_BARRIER_WRITE); \ - bus_space_write_4((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, \ - htole32(CMPL_DOORBELL_KEY_CMPL)); \ -} while (0) - -#define BNXT_CP_IDX_ENABLE_DB(ring, cons) do { \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, 4, \ - BUS_SPACE_BARRIER_WRITE); \ - bus_space_write_4((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, \ - htole32(CMPL_DOORBELL_KEY_CMPL | CMPL_DOORBELL_IDX_VALID | \ - (cons))); \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, 0, \ - (ring)->softc->doorbell_bar.size, BUS_SPACE_BARRIER_WRITE); \ -} while (0) - -#define BNXT_CP_IDX_DISABLE_DB(ring, cons) do { \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, 4, \ - BUS_SPACE_BARRIER_WRITE); \ - bus_space_write_4((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, \ - htole32(CMPL_DOORBELL_KEY_CMPL | CMPL_DOORBELL_IDX_VALID | \ - CMPL_DOORBELL_MASK | (cons))); \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, 0, \ - (ring)->softc->doorbell_bar.size, BUS_SPACE_BARRIER_WRITE); \ -} while (0) - -#define BNXT_TX_DB(ring, idx) do { \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, 4, \ - BUS_SPACE_BARRIER_WRITE); \ - bus_space_write_4( \ - (ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, \ - (ring)->doorbell, htole32(TX_DOORBELL_KEY_TX | (idx))); \ -} while (0) - -#define BNXT_RX_DB(ring, idx) do { \ - bus_space_barrier((ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, (ring)->doorbell, 4, \ - BUS_SPACE_BARRIER_WRITE); \ - bus_space_write_4( \ - (ring)->softc->doorbell_bar.tag, \ - (ring)->softc->doorbell_bar.handle, \ - (ring)->doorbell, htole32(RX_DOORBELL_KEY_RX | (idx))); \ -} while (0) - /* Lock macros */ #define BNXT_HWRM_LOCK_INIT(_softc, _name) \ mtx_init(&(_softc)->hwrm_lock, _name, "BNXT HWRM Lock", MTX_DEF) @@ -243,6 +162,19 @@ __FBSDID("$FreeBSD$"); #define BNXT_MIN_FRAME_SIZE 52 /* Frames must be padded to this size for some A0 chips */ +typedef void (*bnxt_doorbell_tx)(void *, uint16_t idx); +typedef void (*bnxt_doorbell_rx)(void *, uint16_t idx); +typedef void (*bnxt_doorbell_rx_cq)(void *, bool); +typedef void (*bnxt_doorbell_tx_cq)(void *, bool); +typedef void (*bnxt_doorbell_nq)(void *, bool); + +typedef struct bnxt_doorbell_ops { + bnxt_doorbell_tx bnxt_db_tx; + bnxt_doorbell_rx bnxt_db_rx; + bnxt_doorbell_rx_cq bnxt_db_rx_cq; + bnxt_doorbell_tx_cq bnxt_db_tx_cq; + bnxt_doorbell_nq bnxt_db_nq; +} bnxt_dooorbell_ops_t; /* NVRAM access */ enum bnxt_nvm_directory_type { BNX_DIR_TYPE_UNUSED = 0, @@ -611,6 +543,7 @@ struct bnxt_softc { struct bnxt_cp_ring def_cp_ring; struct iflib_dma_info def_cp_ring_mem; struct grouptask def_cp_task; + struct bnxt_doorbell_ops db_ops; struct sysctl_ctx_list hw_stats; struct sysctl_oid *hw_stats_oid; diff --git a/sys/dev/bnxt/bnxt_txrx.c b/sys/dev/bnxt/bnxt_txrx.c index 9727230b578f..f8b1c7656f2b 100644 --- a/sys/dev/bnxt/bnxt_txrx.c +++ b/sys/dev/bnxt/bnxt_txrx.c @@ -180,9 +180,7 @@ bnxt_isc_txd_flush(void *sc, uint16_t txqid, qidx_t pidx) struct bnxt_ring *tx_ring = &softc->tx_rings[txqid]; /* pidx is what we last set ipi_new_pidx to */ - BNXT_TX_DB(tx_ring, pidx); - /* TODO: Cumulus+ doesn't need the double doorbell */ - BNXT_TX_DB(tx_ring, pidx); + softc->db_ops.bnxt_db_tx(tx_ring, pidx); return; } @@ -244,7 +242,7 @@ done: if (clear && avail) { cpr->cons = last_cons; cpr->v_bit = last_v_bit; - BNXT_CP_IDX_DISABLE_DB(&cpr->ring, cpr->cons); + softc->db_ops.bnxt_db_tx_cq(cpr, 0); } return avail; @@ -313,12 +311,8 @@ bnxt_isc_rxd_flush(void *sc, uint16_t rxqid, uint8_t flid, * or we will overrun the completion ring and the device will wedge for * RX. */ - if (softc->rx_cp_rings[rxqid].cons != UINT32_MAX) - BNXT_CP_IDX_DISABLE_DB(&softc->rx_cp_rings[rxqid].ring, - softc->rx_cp_rings[rxqid].cons); - BNXT_RX_DB(rx_ring, pidx); - /* TODO: Cumulus+ doesn't need the double doorbell */ - BNXT_RX_DB(rx_ring, pidx); + softc->db_ops.bnxt_db_rx_cq(&softc->rx_cp_rings[rxqid], 0); + softc->db_ops.bnxt_db_rx(rx_ring, pidx); return; } diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index a2ec25a9ad31..75f01f556e8d 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -661,6 +661,55 @@ static int bnxt_alloc_hwrm_short_cmd_req(struct bnxt_softc *softc) return rc; } +/* + * If we update the index, a write barrier is needed after the write to ensure + * the completion ring has space before the RX/TX ring does. Since we can't + * make the RX and AG doorbells covered by the same barrier without remapping + * MSI-X vectors, we create the barrier over the enture doorbell bar. + * TODO: Remap the MSI-X vectors to allow a barrier to only cover the doorbells + * for a single ring group. + * + * A barrier of just the size of the write is used to ensure the ordering + * remains correct and no writes are lost. + */ + +static void bnxt_cuw_db_rx(void *db_ptr, uint16_t idx) +{ + struct bnxt_ring *ring = (struct bnxt_ring *) db_ptr; + struct bnxt_bar_info *db_bar = &ring->softc->doorbell_bar; + + bus_space_barrier(db_bar->tag, db_bar->handle, ring->doorbell, 4, + BUS_SPACE_BARRIER_WRITE); + bus_space_write_4(db_bar->tag, db_bar->handle, ring->doorbell, + htole32(RX_DOORBELL_KEY_RX | idx)); +} + +static void bnxt_cuw_db_tx(void *db_ptr, uint16_t idx) +{ + struct bnxt_ring *ring = (struct bnxt_ring *) db_ptr; + struct bnxt_bar_info *db_bar = &ring->softc->doorbell_bar; + + bus_space_barrier(db_bar->tag, db_bar->handle, ring->doorbell, 4, + BUS_SPACE_BARRIER_WRITE); + bus_space_write_4(db_bar->tag, db_bar->handle, ring->doorbell, + htole32(TX_DOORBELL_KEY_TX | idx)); +} + +static void bnxt_cuw_db_cq(void *db_ptr, bool enable_irq) +{ + struct bnxt_cp_ring *cpr = (struct bnxt_cp_ring *) db_ptr; + struct bnxt_bar_info *db_bar = &cpr->ring.softc->doorbell_bar; + + bus_space_barrier(db_bar->tag, db_bar->handle, cpr->ring.doorbell, 4, + BUS_SPACE_BARRIER_WRITE); + bus_space_write_4(db_bar->tag, db_bar->handle, cpr->ring.doorbell, + htole32(CMPL_DOORBELL_KEY_CMPL | + ((cpr->cons == UINT32_MAX) ? 0 : + (cpr->cons | CMPL_DOORBELL_IDX_VALID)) | + ((enable_irq) ? 0 : CMPL_DOORBELL_MASK))); + bus_space_barrier(db_bar->tag, db_bar->handle, 0, db_bar->size, + BUS_SPACE_BARRIER_WRITE); +} /* Device setup and teardown */ static int bnxt_attach_pre(if_ctx_t ctx) @@ -754,6 +803,11 @@ bnxt_attach_pre(if_ctx_t ctx) &softc->nvm_info->available_size); } + softc->db_ops.bnxt_db_tx = bnxt_cuw_db_tx; + softc->db_ops.bnxt_db_rx = bnxt_cuw_db_rx; + softc->db_ops.bnxt_db_rx_cq = bnxt_cuw_db_cq; + softc->db_ops.bnxt_db_tx_cq = bnxt_cuw_db_cq; + /* Register the driver with the FW */ rc = bnxt_hwrm_func_drv_rgtr(softc); if (rc) { @@ -1067,9 +1121,7 @@ bnxt_init(if_ctx_t ctx) HWRM_NA_SIGNATURE, false); if (rc) goto fail; - BNXT_RX_DB(&softc->rx_rings[i], 0); - /* TODO: Cumulus+ doesn't need the double doorbell */ - BNXT_RX_DB(&softc->rx_rings[i], 0); + softc->db_ops.bnxt_db_rx(&softc->rx_rings[i], 0); /* Allocate the AG ring */ rc = bnxt_hwrm_ring_alloc(softc, @@ -1078,9 +1130,7 @@ bnxt_init(if_ctx_t ctx) HWRM_NA_SIGNATURE, false); if (rc) goto fail; - BNXT_RX_DB(&softc->rx_rings[i], 0); - /* TODO: Cumulus+ doesn't need the double doorbell */ - BNXT_RX_DB(&softc->ag_rings[i], 0); + softc->db_ops.bnxt_db_rx(&softc->ag_rings[i], 0); /* Allocate the ring group */ softc->grp_info[i].stats_ctx = @@ -1156,9 +1206,7 @@ bnxt_init(if_ctx_t ctx) softc->tx_cp_rings[i].stats_ctx_id, false); if (rc) goto fail; - BNXT_TX_DB(&softc->tx_rings[i], 0); - /* TODO: Cumulus+ doesn't need the double doorbell */ - BNXT_TX_DB(&softc->tx_rings[i], 0); + softc->db_ops.bnxt_db_tx(&softc->tx_rings[i], 0); } bnxt_do_enable_intr(&softc->def_cp_ring); @@ -1444,20 +1492,20 @@ bnxt_if_timer(if_ctx_t ctx, uint16_t qid) static void inline bnxt_do_enable_intr(struct bnxt_cp_ring *cpr) { + struct bnxt_softc *softc = cpr->ring.softc; + if (cpr->ring.phys_id != (uint16_t)HWRM_NA_SIGNATURE) { - /* First time enabling, do not set index */ - if (cpr->cons == UINT32_MAX) - BNXT_CP_ENABLE_DB(&cpr->ring); - else - BNXT_CP_IDX_ENABLE_DB(&cpr->ring, cpr->cons); + softc->db_ops.bnxt_db_rx_cq(cpr, 1); } } static void inline bnxt_do_disable_intr(struct bnxt_cp_ring *cpr) { + struct bnxt_softc *softc = cpr->ring.softc; + if (cpr->ring.phys_id != (uint16_t)HWRM_NA_SIGNATURE) - BNXT_CP_DISABLE_DB(&cpr->ring); + softc->db_ops.bnxt_db_rx_cq(cpr, 0); } /* Enable all interrupts */ @@ -1469,7 +1517,7 @@ bnxt_intr_enable(if_ctx_t ctx) bnxt_do_enable_intr(&softc->def_cp_ring); for (i = 0; i < softc->nrxqsets; i++) - bnxt_do_enable_intr(&softc->rx_cp_rings[i]); + softc->db_ops.bnxt_db_rx_cq(&softc->rx_cp_rings[i], 1); return; } @@ -2246,9 +2294,10 @@ static int bnxt_handle_rx_cp(void *arg) { struct bnxt_cp_ring *cpr = arg; + struct bnxt_softc *softc = cpr->ring.softc; /* Disable further interrupts for this queue */ - BNXT_CP_DISABLE_DB(&cpr->ring); + softc->db_ops.bnxt_db_rx_cq(cpr, 0); return FILTER_SCHEDULE_THREAD; } @@ -2257,7 +2306,7 @@ bnxt_handle_def_cp(void *arg) { struct bnxt_softc *softc = arg; - BNXT_CP_DISABLE_DB(&softc->def_cp_ring.ring); + softc->db_ops.bnxt_db_rx_cq(&softc->def_cp_ring, 0); GROUPTASK_ENQUEUE(&softc->def_cp_task); return FILTER_HANDLED; } @@ -2391,7 +2440,7 @@ bnxt_def_cp_task(void *context) cpr->cons = last_cons; cpr->v_bit = last_v_bit; - BNXT_CP_IDX_ENABLE_DB(&cpr->ring, cpr->cons); + softc->db_ops.bnxt_db_rx_cq(cpr, 1); } static uint8_t From nobody Thu Jan 19 03:52:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7x90GBZz2svSg; Thu, 19 Jan 2023 03:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7x8733xz3hmC; Thu, 19 Jan 2023 03:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pwnoApNYNlrP5DuEb+xpAQVT6rmCizwKHfLZzv2LQ5U=; b=E7tcD+wmBozOkB9WUIcHsvHfjoXHt+8Oxu+xZbY6pX+ofKI5nKumGO/bUx52kFKlWSwLRV f9OjCZZw8g14QpnIpVcEFC2vZuV0DgDunGctIpqp+daeG5gohQ3p3tRFGyFUd9stDyBQCX K49BvJxpitfptll8x4tTxGfdPXqVYFAgJdSKLarub9jpJrEPxE21c79z87DlUkR8x/PsDK IaL/kzCioUmvpRy7vWiFqdTGUuQNlqwuFMUYz0+wrei+M55aCxO4n1VGKYjrCFDfhAv8vm 6CgxpJUX/ftHVdW/MarHr4QU37MKUbfyNTeJ4CSRjuQxV948LE1IkLTYgzY1cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pwnoApNYNlrP5DuEb+xpAQVT6rmCizwKHfLZzv2LQ5U=; b=PIFZiYAOP/9YORnC6wzXJSjsBL/f1659SM4tdoh4u/yjt1Ur7fFg1KgTBnLnk6A/FVDMAI HWakqjaKMI3Z5QFkUlqi8uWRj4mgPt6eLDqcpn69N8GhUydYUFzSMvdaLAZXegWOaPmBw6 Bn+zzfWb1emYm4ZB8YziVY1B0gsbc36nxzC/ibNRKMQbfMq6AqYj29YbJn0M5tlNhWWyPT sK//J6+9QKRbEBrAA6mJnFyetPDNdE9+VYDmDm+MiMVxfdaHSZzFOQocjV/yPWQ8zH9O+O VRtq13O2NHedLT/EIZ7QzXZgS0abgqXJwKEOWgbAIqrHBXwc0iRTVHnhA7BKFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100333; a=rsa-sha256; cv=none; b=f1uDud4Q8mGxKknloTnSZCRd0BttnkmWpkGZwxbor7N7O6tL/MxqkiGncWjb+9R1qUN7mq PyZ6ZD1hkbscDDiQWs+5rpwYaSfmCT8RyfSuKfGKynkuJomke6H7YfzfpFls+ZsCbJbig5 2jbOK2xXt2caIcqIObVowwLO+LiCu7f9onnkNjLD7QlYFYdrc4q6gjlw+hrH3OW324Vup3 zU4X9ojXe3KsHltMFS+ezFI9XftDZuLogwOVePi2ZWTZJCSrq+LmC9ka5cHaZOD9JZAjhY jM9f5QMU8G1+eCYJ12AC/8IXYO+BS+3wiOyBdVTRoxUDfOGCDsC9IRUGQeP/2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7x865bjzcT1; Thu, 19 Jan 2023 03:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qC36021946; Thu, 19 Jan 2023 03:52:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qCiS021945; Thu, 19 Jan 2023 03:52:12 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:12 GMT Message-Id: <202301190352.30J3qCiS021945@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: de0aaf9eca0a - stable/13 - if_bnxt: add support for Thor controller List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: de0aaf9eca0ae7d7f44042c24fba92a6db491b98 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=de0aaf9eca0ae7d7f44042c24fba92a6db491b98 commit de0aaf9eca0ae7d7f44042c24fba92a6db491b98 Author: Sumit Saxena AuthorDate: 2022-11-04 22:05:57 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:05 +0000 if_bnxt: add support for Thor controller Added support for Thor controller. Below are the supported operations: 1. IPv4 ping (ICMP) 2. iperf / netperf (IPv4 TCP) 3. Promiscuous (tcpdump) 4. Can achieve 20 Gbps on a 25 G link (Uni-Di) 5. Can achieve 60 Gbps on a 100 G link (Uni-Di) 6. Port level and queue level driver stats. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36438 (cherry picked from commit 8945584f93ee3689c90fd6b6ee6d824381813ef2) --- sys/dev/bnxt/bnxt.h | 187 +++++++++- sys/dev/bnxt/bnxt_hwrm.c | 520 +++++++++++++++++++++++++--- sys/dev/bnxt/bnxt_hwrm.h | 11 +- sys/dev/bnxt/bnxt_sysctl.c | 285 +++++++-------- sys/dev/bnxt/bnxt_txrx.c | 5 +- sys/dev/bnxt/if_bnxt.c | 840 +++++++++++++++++++++++++++++++++++++++------ 6 files changed, 1547 insertions(+), 301 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 8d806c3a4877..5a68b24e44f5 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); #define BCM57417_SFP 0x16e2 #define BCM57454 0x1614 #define BCM58700 0x16cd +#define BCM57508 0x1750 +#define BCM57504 0x1751 +#define BCM57502 0x1752 #define NETXTREME_C_VF1 0x16cb #define NETXTREME_C_VF2 0x16e1 #define NETXTREME_C_VF3 0x16e5 @@ -110,10 +113,52 @@ __FBSDID("$FreeBSD$"); #define bnxt_wol_supported(softc) (!((softc)->flags & BNXT_FLAG_VF) && \ ((softc)->flags & BNXT_FLAG_WOL_CAP )) +/* 64-bit doorbell */ +#define DBR_INDEX_MASK 0x0000000000ffffffULL +#define DBR_PI_LO_MASK 0xff000000UL +#define DBR_PI_LO_SFT 24 +#define DBR_XID_MASK 0x000fffff00000000ULL +#define DBR_XID_SFT 32 +#define DBR_PI_HI_MASK 0xf0000000000000ULL +#define DBR_PI_HI_SFT 52 +#define DBR_PATH_L2 (0x1ULL << 56) +#define DBR_VALID (0x1ULL << 58) +#define DBR_TYPE_SQ (0x0ULL << 60) +#define DBR_TYPE_RQ (0x1ULL << 60) +#define DBR_TYPE_SRQ (0x2ULL << 60) +#define DBR_TYPE_SRQ_ARM (0x3ULL << 60) +#define DBR_TYPE_CQ (0x4ULL << 60) +#define DBR_TYPE_CQ_ARMSE (0x5ULL << 60) +#define DBR_TYPE_CQ_ARMALL (0x6ULL << 60) +#define DBR_TYPE_CQ_ARMENA (0x7ULL << 60) +#define DBR_TYPE_SRQ_ARMENA (0x8ULL << 60) +#define DBR_TYPE_CQ_CUTOFF_ACK (0x9ULL << 60) +#define DBR_TYPE_NQ (0xaULL << 60) +#define DBR_TYPE_NQ_ARM (0xbULL << 60) +#define DBR_TYPE_PUSH_START (0xcULL << 60) +#define DBR_TYPE_PUSH_END (0xdULL << 60) +#define DBR_TYPE_NULL (0xfULL << 60) + +#define BNXT_MAX_NUM_QUEUES 32 + /* Completion related defines */ #define CMP_VALID(cmp, v_bit) \ ((!!(((struct cmpl_base *)(cmp))->info3_v & htole32(CMPL_BASE_V))) == !!(v_bit) ) +/* Chip class phase 5 */ +#define BNXT_CHIP_P5(sc) ((softc->flags & BNXT_FLAG_CHIP_P5)) + +#define DB_PF_OFFSET_P5 0x10000 +#define NQ_VALID(cmp, v_bit) \ + ((!!(((nq_cn_t *)(cmp))->v & htole32(NQ_CN_V))) == !!(v_bit) ) + +#ifndef DIV_ROUND_UP +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#endif +#ifndef roundup +#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) +#endif + #define NEXT_CP_CONS_V(ring, cons, v_bit) do { \ if (__predict_false(++(cons) == (ring)->ring_size)) \ ((cons) = 0, (v_bit) = !v_bit); \ @@ -400,6 +445,7 @@ struct bnxt_ring { uint32_t ring_size; /* Must be a power of two */ uint16_t id; /* Logical ID */ uint16_t phys_id; + uint16_t idx; struct bnxt_full_tpa_start *tpa_start; }; @@ -413,6 +459,7 @@ struct bnxt_cp_ring { uint32_t last_idx; /* Used by RX rings only * set to the last read pidx */ + uint64_t int_count; }; struct bnxt_full_tpa_start { @@ -484,12 +531,129 @@ struct bnxt_hw_lro { uint32_t min_agg_len; }; +/* The hardware supports certain page sizes. Use the supported page sizes + * to allocate the rings. + */ +#if (PAGE_SHIFT < 12) +#define BNXT_PAGE_SHIFT 12 +#elif (PAGE_SHIFT <= 13) +#define BNXT_PAGE_SHIFT PAGE_SHIFT +#elif (PAGE_SHIFT < 16) +#define BNXT_PAGE_SHIFT 13 +#else +#define BNXT_PAGE_SHIFT 16 +#endif + +#define BNXT_PAGE_SIZE (1 << BNXT_PAGE_SHIFT) + +#define MAX_CTX_PAGES (BNXT_PAGE_SIZE / 8) +#define MAX_CTX_TOTAL_PAGES (MAX_CTX_PAGES * MAX_CTX_PAGES) +struct bnxt_ring_mem_info { + int nr_pages; + int page_size; + uint16_t flags; +#define BNXT_RMEM_VALID_PTE_FLAG 1 +#define BNXT_RMEM_RING_PTE_FLAG 2 +#define BNXT_RMEM_USE_FULL_PAGE_FLAG 4 + uint16_t depth; + uint8_t init_val; + struct iflib_dma_info *pg_arr; + struct iflib_dma_info pg_tbl; + int vmem_size; + void **vmem; +}; + +struct bnxt_ctx_pg_info { + uint32_t entries; + uint32_t nr_pages; + struct iflib_dma_info ctx_arr[MAX_CTX_PAGES]; + struct bnxt_ring_mem_info ring_mem; + struct bnxt_ctx_pg_info **ctx_pg_tbl; +}; + +struct bnxt_ctx_mem_info { + uint32_t qp_max_entries; + uint16_t qp_min_qp1_entries; + uint16_t qp_max_l2_entries; + uint16_t qp_entry_size; + uint16_t srq_max_l2_entries; + uint32_t srq_max_entries; + uint16_t srq_entry_size; + uint16_t cq_max_l2_entries; + uint32_t cq_max_entries; + uint16_t cq_entry_size; + uint16_t vnic_max_vnic_entries; + uint16_t vnic_max_ring_table_entries; + uint16_t vnic_entry_size; + uint32_t stat_max_entries; + uint16_t stat_entry_size; + uint16_t tqm_entry_size; + uint32_t tqm_min_entries_per_ring; + uint32_t tqm_max_entries_per_ring; + uint32_t mrav_max_entries; + uint16_t mrav_entry_size; + uint16_t tim_entry_size; + uint32_t tim_max_entries; + uint8_t tqm_entries_multiple; + uint8_t ctx_kind_initializer; + + uint32_t flags; + #define BNXT_CTX_FLAG_INITED 0x01 + + struct bnxt_ctx_pg_info qp_mem; + struct bnxt_ctx_pg_info srq_mem; + struct bnxt_ctx_pg_info cq_mem; + struct bnxt_ctx_pg_info vnic_mem; + struct bnxt_ctx_pg_info stat_mem; + struct bnxt_ctx_pg_info mrav_mem; + struct bnxt_ctx_pg_info tim_mem; + struct bnxt_ctx_pg_info *tqm_mem[9]; +}; + +struct bnxt_hw_resc { + uint16_t min_rsscos_ctxs; + uint16_t max_rsscos_ctxs; + uint16_t min_cp_rings; + uint16_t max_cp_rings; + uint16_t resv_cp_rings; + uint16_t min_tx_rings; + uint16_t max_tx_rings; + uint16_t resv_tx_rings; + uint16_t max_tx_sch_inputs; + uint16_t min_rx_rings; + uint16_t max_rx_rings; + uint16_t resv_rx_rings; + uint16_t min_hw_ring_grps; + uint16_t max_hw_ring_grps; + uint16_t resv_hw_ring_grps; + uint16_t min_l2_ctxs; + uint16_t max_l2_ctxs; + uint16_t min_vnics; + uint16_t max_vnics; + uint16_t resv_vnics; + uint16_t min_stat_ctxs; + uint16_t max_stat_ctxs; + uint16_t resv_stat_ctxs; + uint16_t max_nqs; + uint16_t max_irqs; + uint16_t resv_irqs; +}; + +#define BNXT_LLQ(q_profile) \ + ((q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE) +#define BNXT_CNPQ(q_profile) \ + ((q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP) + +#define BNXT_HWRM_MAX_REQ_LEN (softc->hwrm_max_req_len) + struct bnxt_softc { device_t dev; if_ctx_t ctx; if_softc_ctx_t scctx; if_shared_ctx_t sctx; struct ifmedia *media; + struct bnxt_ctx_mem_info *ctx_mem; + struct bnxt_hw_resc hw_resc; struct bnxt_bar_info hwrm_bar; struct bnxt_bar_info doorbell_bar; @@ -497,7 +661,10 @@ struct bnxt_softc { #define BNXT_FLAG_VF 0x0001 #define BNXT_FLAG_NPAR 0x0002 #define BNXT_FLAG_WOL_CAP 0x0004 -#define BNXT_FLAG_SHORT_CMD 0x0008 +#define BNXT_FLAG_SHORT_CMD 0x0008 +#define BNXT_FLAG_FW_CAP_NEW_RM 0x0010 +#define BNXT_FLAG_CHIP_P5 0x0020 +#define BNXT_FLAG_TPA 0x0040 uint32_t flags; uint32_t total_msix; @@ -514,10 +681,16 @@ struct bnxt_softc { struct if_irq irq; struct mtx hwrm_lock; uint16_t hwrm_max_req_len; + uint16_t hwrm_max_ext_req_len; + uint32_t hwrm_spec_code; -#define BNXT_MAX_QUEUE 8 +#define BNXT_MAX_COS_QUEUE 8 uint8_t max_tc; - struct bnxt_cos_queue q_info[BNXT_MAX_QUEUE]; + uint8_t max_lltc; /* lossless TCs */ + struct bnxt_cos_queue q_info[BNXT_MAX_COS_QUEUE]; + uint8_t tc_to_qidx[BNXT_MAX_COS_QUEUE]; + uint8_t q_ids[BNXT_MAX_COS_QUEUE]; + uint8_t max_q; uint64_t admin_ticks; struct iflib_dma_info hw_rx_port_stats; @@ -527,9 +700,11 @@ struct bnxt_softc { int num_cp_rings; + struct bnxt_cp_ring *nq_rings; + struct bnxt_ring *tx_rings; struct bnxt_cp_ring *tx_cp_rings; - struct iflib_dma_info tx_stats; + struct iflib_dma_info tx_stats[BNXT_MAX_NUM_QUEUES]; int ntxqsets; struct bnxt_vnic_info vnic_info; @@ -537,11 +712,13 @@ struct bnxt_softc { struct bnxt_ring *rx_rings; struct bnxt_cp_ring *rx_cp_rings; struct bnxt_grp_info *grp_info; - struct iflib_dma_info rx_stats; + struct iflib_dma_info rx_stats[BNXT_MAX_NUM_QUEUES]; int nrxqsets; struct bnxt_cp_ring def_cp_ring; + struct bnxt_cp_ring def_nq_ring; struct iflib_dma_info def_cp_ring_mem; + struct iflib_dma_info def_nq_ring_mem; struct grouptask def_cp_task; struct bnxt_doorbell_ops db_ops; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index d474e5b81e19..981bab37c181 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -121,19 +121,30 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len) int i; uint8_t *valid; uint16_t err; - uint16_t max_req_len = HWRM_MAX_REQ_LEN; + uint16_t max_req_len = BNXT_HWRM_MAX_REQ_LEN; struct hwrm_short_input short_input = {0}; /* TODO: DMASYNC in here. */ req->seq_id = htole16(softc->hwrm_cmd_seq++); memset(resp, 0, PAGE_SIZE); - if (softc->flags & BNXT_FLAG_SHORT_CMD) { + if ((softc->flags & BNXT_FLAG_SHORT_CMD) || + msg_len > BNXT_HWRM_MAX_REQ_LEN) { void *short_cmd_req = softc->hwrm_short_cmd_req_addr.idi_vaddr; + uint16_t max_msg_len; + + /* Set boundary for maximum extended request length for short + * cmd format. If passed up from device use the max supported + * internal req length. + */ + + max_msg_len = softc->hwrm_max_ext_req_len; + memcpy(short_cmd_req, req, msg_len); - memset((uint8_t *) short_cmd_req + msg_len, 0, softc->hwrm_max_req_len- - msg_len); + if (msg_len < max_msg_len) + memset((uint8_t *) short_cmd_req + msg_len, 0, + max_msg_len - msg_len); short_input.req_type = req->req_type; short_input.signature = @@ -228,12 +239,12 @@ hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len) int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc) { + int rc = 0; struct hwrm_queue_qportcfg_input req = {0}; struct hwrm_queue_qportcfg_output *resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; - - int rc = 0; - uint8_t *qptr; + uint8_t i, j, *qptr; + bool no_rdma; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_QPORTCFG); @@ -247,18 +258,283 @@ bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc) goto qportcfg_exit; } softc->max_tc = resp->max_configurable_queues; - if (softc->max_tc > BNXT_MAX_QUEUE) - softc->max_tc = BNXT_MAX_QUEUE; + softc->max_lltc = resp->max_configurable_lossless_queues; + if (softc->max_tc > BNXT_MAX_COS_QUEUE) + softc->max_tc = BNXT_MAX_COS_QUEUE; + + /* Currently no RDMA support */ + no_rdma = true; qptr = &resp->queue_id0; - for (int i = 0; i < softc->max_tc; i++) { - softc->q_info[i].id = *qptr++; - softc->q_info[i].profile = *qptr++; + for (i = 0, j = 0; i < softc->max_tc; i++) { + softc->q_info[j].id = *qptr; + softc->q_ids[i] = *qptr++; + softc->q_info[j].profile = *qptr++; + softc->tc_to_qidx[j] = j; + if (!BNXT_CNPQ(softc->q_info[j].profile) || + (no_rdma && BNXT_PF(softc))) + j++; } + softc->max_q = softc->max_tc; + softc->max_tc = max_t(uint32_t, j, 1); + + if (resp->queue_cfg_info & HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG) + softc->max_tc = 1; + + if (softc->max_lltc > softc->max_tc) + softc->max_lltc = softc->max_tc; qportcfg_exit: BNXT_HWRM_UNLOCK(softc); - return (rc); + return rc; +} + +int bnxt_hwrm_func_backing_store_qcaps(struct bnxt_softc *softc) +{ + struct hwrm_func_backing_store_qcaps_input req = {0}; + struct hwrm_func_backing_store_qcaps_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + int rc; + + if (softc->hwrm_spec_code < 0x10902 || BNXT_VF(softc) || softc->ctx_mem) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_BACKING_STORE_QCAPS); + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (!rc) { + struct bnxt_ctx_pg_info *ctx_pg; + struct bnxt_ctx_mem_info *ctx; + int i; + + ctx = malloc(sizeof(*ctx), M_DEVBUF, M_NOWAIT | M_ZERO); + if (!ctx) { + rc = -ENOMEM; + goto ctx_err; + } + ctx_pg = malloc(sizeof(*ctx_pg) * (softc->max_q + 1), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!ctx_pg) { + free(ctx, M_DEVBUF); + rc = -ENOMEM; + goto ctx_err; + } + for (i = 0; i < softc->max_q + 1; i++, ctx_pg++) + ctx->tqm_mem[i] = ctx_pg; + + softc->ctx_mem = ctx; + ctx->qp_max_entries = le32toh(resp->qp_max_entries); + ctx->qp_min_qp1_entries = le16toh(resp->qp_min_qp1_entries); + ctx->qp_max_l2_entries = le16toh(resp->qp_max_l2_entries); + ctx->qp_entry_size = le16toh(resp->qp_entry_size); + ctx->srq_max_l2_entries = le16toh(resp->srq_max_l2_entries); + ctx->srq_max_entries = le32toh(resp->srq_max_entries); + ctx->srq_entry_size = le16toh(resp->srq_entry_size); + ctx->cq_max_l2_entries = le16toh(resp->cq_max_l2_entries); + ctx->cq_max_entries = le32toh(resp->cq_max_entries); + ctx->cq_entry_size = le16toh(resp->cq_entry_size); + ctx->vnic_max_vnic_entries = + le16toh(resp->vnic_max_vnic_entries); + ctx->vnic_max_ring_table_entries = + le16toh(resp->vnic_max_ring_table_entries); + ctx->vnic_entry_size = le16toh(resp->vnic_entry_size); + ctx->stat_max_entries = le32toh(resp->stat_max_entries); + ctx->stat_entry_size = le16toh(resp->stat_entry_size); + ctx->tqm_entry_size = le16toh(resp->tqm_entry_size); + ctx->tqm_min_entries_per_ring = + le32toh(resp->tqm_min_entries_per_ring); + ctx->tqm_max_entries_per_ring = + le32toh(resp->tqm_max_entries_per_ring); + ctx->tqm_entries_multiple = resp->tqm_entries_multiple; + if (!ctx->tqm_entries_multiple) + ctx->tqm_entries_multiple = 1; + ctx->mrav_max_entries = le32toh(resp->mrav_max_entries); + ctx->mrav_entry_size = le16toh(resp->mrav_entry_size); + ctx->tim_entry_size = le16toh(resp->tim_entry_size); + ctx->tim_max_entries = le32toh(resp->tim_max_entries); + ctx->ctx_kind_initializer = resp->ctx_kind_initializer; + } else { + rc = 0; + } +ctx_err: + BNXT_HWRM_UNLOCK(softc); + return rc; +} + +#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_DFLT_ENABLES \ + (HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP | \ + HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ | \ + HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ | \ + HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC | \ + HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT) + +static void bnxt_hwrm_set_pg_attr(struct bnxt_ring_mem_info *rmem, uint8_t *pg_attr, + uint64_t *pg_dir) +{ + uint8_t pg_size = 0; + + if (BNXT_PAGE_SHIFT == 13) + pg_size = 1 << 4; + else if (BNXT_PAGE_SIZE == 16) + pg_size = 2 << 4; + + *pg_attr = pg_size; + if (rmem->depth >= 1) { + if (rmem->depth == 2) + *pg_attr |= HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2; + else + *pg_attr |= HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1; + *pg_dir = htole64(rmem->pg_tbl.idi_paddr); + } else { + *pg_dir = htole64(rmem->pg_arr[0].idi_paddr); + } +} + +int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) +{ + struct hwrm_func_backing_store_cfg_input req = {0}; + struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; + struct bnxt_ctx_pg_info *ctx_pg; + uint32_t *num_entries; + uint64_t *pg_dir; + uint8_t *pg_attr; + int i, rc; + uint32_t ena; + + if (!ctx) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_BACKING_STORE_CFG); + req.enables = htole32(enables); + + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP) { + ctx_pg = &ctx->qp_mem; + req.qp_num_entries = htole32(ctx_pg->entries); + req.qp_num_qp1_entries = htole16(ctx->qp_min_qp1_entries); + req.qp_num_l2_entries = htole16(ctx->qp_max_l2_entries); + req.qp_entry_size = htole16(ctx->qp_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.qpc_pg_size_qpc_lvl, + &req.qpc_page_dir); + } + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ) { + ctx_pg = &ctx->srq_mem; + req.srq_num_entries = htole32(ctx_pg->entries); + req.srq_num_l2_entries = htole16(ctx->srq_max_l2_entries); + req.srq_entry_size = htole16(ctx->srq_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.srq_pg_size_srq_lvl, + &req.srq_page_dir); + } + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ) { + ctx_pg = &ctx->cq_mem; + req.cq_num_entries = htole32(ctx_pg->entries); + req.cq_num_l2_entries = htole16(ctx->cq_max_l2_entries); + req.cq_entry_size = htole16(ctx->cq_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.cq_pg_size_cq_lvl, + &req.cq_page_dir); + } + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV) { + ctx_pg = &ctx->mrav_mem; + req.mrav_num_entries = htole32(ctx_pg->entries); + req.mrav_entry_size = htole16(ctx->mrav_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.mrav_pg_size_mrav_lvl, + &req.mrav_page_dir); + } + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM) { + ctx_pg = &ctx->tim_mem; + req.tim_num_entries = htole32(ctx_pg->entries); + req.tim_entry_size = htole16(ctx->tim_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.tim_pg_size_tim_lvl, + &req.tim_page_dir); + } + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC) { + ctx_pg = &ctx->vnic_mem; + req.vnic_num_vnic_entries = + htole16(ctx->vnic_max_vnic_entries); + req.vnic_num_ring_table_entries = + htole16(ctx->vnic_max_ring_table_entries); + req.vnic_entry_size = htole16(ctx->vnic_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.vnic_pg_size_vnic_lvl, + &req.vnic_page_dir); + } + if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT) { + ctx_pg = &ctx->stat_mem; + req.stat_num_entries = htole32(ctx->stat_max_entries); + req.stat_entry_size = htole16(ctx->stat_entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.stat_pg_size_stat_lvl, + &req.stat_page_dir); + } + for (i = 0, num_entries = &req.tqm_sp_num_entries, + pg_attr = &req.tqm_sp_pg_size_tqm_sp_lvl, + pg_dir = &req.tqm_sp_page_dir, + ena = HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP; + i < 9; i++, num_entries++, pg_attr++, pg_dir++, ena <<= 1) { + if (!(enables & ena)) + continue; + + req.tqm_entry_size = htole16(ctx->tqm_entry_size); + ctx_pg = ctx->tqm_mem[i]; + *num_entries = htole32(ctx_pg->entries); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); + } + rc = hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + rc = -EIO; + return rc; +} + +int bnxt_hwrm_func_resc_qcaps(struct bnxt_softc *softc, bool all) +{ + struct hwrm_func_resource_qcaps_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_func_resource_qcaps_input req = {0}; + struct bnxt_hw_resc *hw_resc = &softc->hw_resc; + int rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_RESOURCE_QCAPS); + req.fid = htole16(0xffff); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) { + rc = -EIO; + goto hwrm_func_resc_qcaps_exit; + } + + hw_resc->max_tx_sch_inputs = le16toh(resp->max_tx_scheduler_inputs); + if (!all) + goto hwrm_func_resc_qcaps_exit; + + hw_resc->min_rsscos_ctxs = le16toh(resp->min_rsscos_ctx); + hw_resc->max_rsscos_ctxs = le16toh(resp->max_rsscos_ctx); + hw_resc->min_cp_rings = le16toh(resp->min_cmpl_rings); + hw_resc->max_cp_rings = le16toh(resp->max_cmpl_rings); + hw_resc->min_tx_rings = le16toh(resp->min_tx_rings); + hw_resc->max_tx_rings = le16toh(resp->max_tx_rings); + hw_resc->min_rx_rings = le16toh(resp->min_rx_rings); + hw_resc->max_rx_rings = le16toh(resp->max_rx_rings); + hw_resc->min_hw_ring_grps = le16toh(resp->min_hw_ring_grps); + hw_resc->max_hw_ring_grps = le16toh(resp->max_hw_ring_grps); + hw_resc->min_l2_ctxs = le16toh(resp->min_l2_ctxs); + hw_resc->max_l2_ctxs = le16toh(resp->max_l2_ctxs); + hw_resc->min_vnics = le16toh(resp->min_vnics); + hw_resc->max_vnics = le16toh(resp->max_vnics); + hw_resc->min_stat_ctxs = le16toh(resp->min_stat_ctx); + hw_resc->max_stat_ctxs = le16toh(resp->max_stat_ctx); + + if (BNXT_CHIP_P5(softc)) { + hw_resc->max_nqs = le16toh(resp->max_msix); + hw_resc->max_hw_ring_grps = hw_resc->max_rx_rings; + } + +hwrm_func_resc_qcaps_exit: + BNXT_HWRM_UNLOCK(softc); + return rc; } int @@ -297,6 +573,16 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) strlcpy(softc->ver_info->hwrm_fw_name, resp->hwrm_fw_name, BNXT_NAME_SIZE); + softc->hwrm_spec_code = resp->hwrm_intf_maj_8b << 16 | + resp->hwrm_intf_min_8b << 8 | + resp->hwrm_intf_upd_8b; + if (resp->hwrm_intf_maj_8b < 1) { + device_printf(softc->dev, "HWRM interface %d.%d.%d is older " + "than 1.0.0.\n", resp->hwrm_intf_maj_8b, + resp->hwrm_intf_min_8b, resp->hwrm_intf_upd_8b); + device_printf(softc->dev, "Please update firmware with HWRM " + "interface 1.0.0 or newer.\n"); + } if (resp->mgmt_fw_major == 0 && resp->mgmt_fw_minor == 0 && resp->mgmt_fw_build == 0) { strlcpy(softc->ver_info->mgmt_fw_ver, naver, BNXT_VERSTR_SIZE); @@ -341,10 +627,16 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) softc->ver_info->chip_bond_id = resp->chip_bond_id; softc->ver_info->chip_type = resp->chip_platform_type; - if (resp->max_req_win_len) + + if (resp->hwrm_intf_maj_8b >= 1) { softc->hwrm_max_req_len = le16toh(resp->max_req_win_len); - if (resp->def_req_timeout) - softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout); + softc->hwrm_max_ext_req_len = le16toh(resp->max_ext_req_len); + } +#define DFLT_HWRM_CMD_TIMEOUT 500 + softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout); + if (!softc->hwrm_cmd_timeo) + softc->hwrm_cmd_timeo = DFLT_HWRM_CMD_TIMEOUT; + dev_caps_cfg = le32toh(resp->dev_caps_cfg); if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) && @@ -464,7 +756,7 @@ fail: return rc; } -int +int bnxt_hwrm_func_qcfg(struct bnxt_softc *softc) { struct hwrm_func_qcfg_input req = {0}; @@ -609,11 +901,11 @@ bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause, if (!rc) { if (set_pause) { - /* since changing of 'force pause' setting doesn't + /* since changing of 'force pause' setting doesn't * trigger any link change event, the driver needs to * update the current pause result upon successfully i * return of the phy_cfg command */ - if (!softc->link_info.flow_ctrl.autoneg) + if (!softc->link_info.flow_ctrl.autoneg) bnxt_report_link(softc); } } @@ -634,14 +926,25 @@ bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) req.flags |= htole32(HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE); if (vnic->flags & BNXT_VNIC_FLAG_VLAN_STRIP) req.flags |= htole32(HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE); - req.enables = htole32(HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP | - HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE | - HWRM_VNIC_CFG_INPUT_ENABLES_MRU); - req.vnic_id = htole16(vnic->id); - req.dflt_ring_grp = htole16(vnic->def_ring_grp); + if (BNXT_CHIP_P5 (softc)) { + req.default_rx_ring_id = + htole16(softc->rx_rings[0].phys_id); + req.default_cmpl_ring_id = + htole16(softc->rx_cp_rings[0].ring.phys_id); + req.enables |= + htole32(HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID | + HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID); + req.vnic_id = htole16(vnic->id); + } else { + req.enables = htole32(HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP | + HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE); + req.vnic_id = htole16(vnic->id); + req.dflt_ring_grp = htole16(vnic->def_ring_grp); + } req.rss_rule = htole16(vnic->rss_id); req.cos_rule = htole16(vnic->cos_rule); req.lb_rule = htole16(vnic->lb_rule); + req.enables |= htole32(HWRM_VNIC_CFG_INPUT_ENABLES_MRU); req.mru = htole16(vnic->mru); return hwrm_send_message(softc, &req, sizeof(req)); @@ -719,6 +1022,9 @@ bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp) return EDOOFUS; } + if (BNXT_CHIP_P5 (softc)) + return 0; + resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_RING_GRP_ALLOC); req.cr = htole16(grp->cp_ring_id); @@ -743,11 +1049,12 @@ fail: */ int bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type, - struct bnxt_ring *ring, uint16_t cmpl_ring_id, uint32_t stat_ctx_id, - bool irq) + struct bnxt_ring *ring) { struct hwrm_ring_alloc_input req = {0}; struct hwrm_ring_alloc_output *resp; + uint16_t idx = ring->idx; + struct bnxt_cp_ring *cp_ring; int rc; if (ring->phys_id != (uint16_t)HWRM_NA_SIGNATURE) { @@ -760,27 +1067,72 @@ bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type, bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_RING_ALLOC); req.enables = htole32(0); req.fbo = htole32(0); - - if (stat_ctx_id != HWRM_NA_SIGNATURE) { - req.enables |= htole32( - HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID); - req.stat_ctx_id = htole32(stat_ctx_id); - } req.ring_type = type; req.page_tbl_addr = htole64(ring->paddr); - req.length = htole32(ring->ring_size); req.logical_id = htole16(ring->id); - req.cmpl_ring_id = htole16(cmpl_ring_id); - req.queue_id = htole16(softc->q_info[0].id); -#if 0 - /* MODE_POLL appears to crash the firmware */ - if (irq) - req.int_mode = HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX; - else - req.int_mode = HWRM_RING_ALLOC_INPUT_INT_MODE_POLL; -#else - req.int_mode = HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX; -#endif + req.length = htole32(ring->ring_size); + + switch (type) { + case HWRM_RING_ALLOC_INPUT_RING_TYPE_TX: + cp_ring = &softc->tx_cp_rings[idx]; + + req.cmpl_ring_id = htole16(cp_ring->ring.phys_id); + /* queue_id - what CoS queue the TX ring is associated with */ + req.queue_id = htole16(softc->q_info[0].id); + + req.stat_ctx_id = htole32(cp_ring->stats_ctx_id); + req.enables |= htole32( + HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID); + break; + case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX: + if (!BNXT_CHIP_P5(softc)) + break; + + cp_ring = &softc->rx_cp_rings[idx]; + + req.stat_ctx_id = htole32(cp_ring->stats_ctx_id); + req.rx_buf_size = htole16( + softc->scctx->isc_max_frame_size); + req.enables |= htole32( + HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID | + HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID); + break; + case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG: + if (!BNXT_CHIP_P5(softc)) { + req.ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_RX; + break; + } + + cp_ring = &softc->rx_cp_rings[idx]; + + req.rx_ring_id = htole16(softc->rx_rings[idx].phys_id); + req.stat_ctx_id = htole32(cp_ring->stats_ctx_id); + req.rx_buf_size = htole16( + softc->scctx->isc_max_frame_size); + req.enables |= htole32( + HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID | + HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID | + HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID); + break; + case HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL: + if (!BNXT_CHIP_P5(softc)) { + req.int_mode = HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX; + break; + } + + req.cq_handle = htole64(ring->id); + req.nq_ring_id = htole16(softc->nq_rings[idx].ring.phys_id); + req.enables |= htole32( + HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID); + break; + case HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ: + req.int_mode = HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX; + break; + default: + printf("hwrm alloc invalid ring type %d\n", type); + return -1; + } + BNXT_HWRM_LOCK(softc); rc = _hwrm_send_message(softc, &req, sizeof(req)); if (rc) @@ -813,6 +1165,10 @@ bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, req.update_period_ms = htole32(1000); req.stats_dma_addr = htole64(paddr); + if (BNXT_CHIP_P5(softc)) + req.stats_dma_length = htole16(sizeof(struct ctx_hw_stats_ext) - 8); + else + req.stats_dma_length = htole16(sizeof(struct ctx_hw_stats)); BNXT_HWRM_LOCK(softc); rc = _hwrm_send_message(softc, &req, sizeof(req)); @@ -943,6 +1299,9 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, { struct hwrm_vnic_rss_cfg_input req = {0}; + /* TBD */ + if (BNXT_CHIP_P5(softc)) + return 0; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG); req.hash_type = htole32(hash_type); @@ -953,6 +1312,32 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, return hwrm_send_message(softc, &req, sizeof(req)); } +int +bnxt_hwrm_reserve_pf_rings(struct bnxt_softc *softc) +{ + struct hwrm_func_cfg_input req = {0}; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); + + req.fid = htole16(0xffff); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX); + req.enables |= htole32(HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS); + req.num_msix = htole16(BNXT_MAX_NUM_QUEUES); + req.num_rsscos_ctxs = htole16(0x8); + req.num_cmpl_rings = htole16(BNXT_MAX_NUM_QUEUES * 2); + req.num_tx_rings = htole16(BNXT_MAX_NUM_QUEUES); + req.num_rx_rings = htole16(BNXT_MAX_NUM_QUEUES); + req.num_vnics = htole16(BNXT_MAX_NUM_QUEUES); + req.num_stat_ctxs = htole16(BNXT_MAX_NUM_QUEUES * 2); + + return hwrm_send_message(softc, &req, sizeof(req)); +} + int bnxt_cfg_async_cr(struct bnxt_softc *softc) { @@ -1008,6 +1393,9 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc) return 0; } + if (!(softc->flags & BNXT_FLAG_TPA)) + return 0; + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG); if (softc->hw_lro.enable) { @@ -1548,14 +1936,14 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) link_info->auto_mode = resp->auto_mode; /* - * When AUTO_PAUSE_AUTONEG_PAUSE bit is set to 1, + * When AUTO_PAUSE_AUTONEG_PAUSE bit is set to 1, * the advertisement of pause is enabled. * 1. When the auto_mode is not set to none and this flag is set to 1, * then the auto_pause bits on this port are being advertised and * autoneg pause results are being interpreted. * 2. When the auto_mode is not set to none and this flag is set to 0, - * the pause is forced as indicated in force_pause, and also - * advertised as auto_pause bits, but the autoneg results are not + * the pause is forced as indicated in force_pause, and also + * advertised as auto_pause bits, but the autoneg results are not * interpreted since the pause configuration is being forced. * 3. When the auto_mode is set to none and this flag is set to 1, * auto_pause bits should be ignored and should be set to 0. @@ -1565,7 +1953,7 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) link_info->flow_ctrl.tx = false; link_info->flow_ctrl.rx = false; - if ((resp->auto_mode) && + if ((resp->auto_mode) && (resp->auto_pause & BNXT_AUTO_PAUSE_AUTONEG_PAUSE)) { link_info->flow_ctrl.autoneg = true; } @@ -1739,7 +2127,7 @@ int bnxt_hwrm_set_coal(struct bnxt_softc *softc) buf_tmr_irq << 16 | buf_tmr, flags, &req_tx); for (i = 0; i < softc->nrxqsets; i++) { - + req = &req_rx; /* * TBD: @@ -1765,14 +2153,18 @@ int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bm uint32_t *events; int i; -#define AE_BMAP_SZ_BITS 256 - async_events_bmap = bit_alloc(AE_BMAP_SZ_BITS, M_DEVBUF, M_WAITOK); +#define BNXT_MAX_NUM_ASYNC_EVENTS 256 + async_events_bmap = bit_alloc(BNXT_MAX_NUM_ASYNC_EVENTS, M_DEVBUF, + M_WAITOK|M_ZERO); + events = (uint32_t *)async_events_bmap; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR); req.enables = htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD); + memset(async_events_bmap, 0, sizeof(BNXT_MAX_NUM_ASYNC_EVENTS / 8)); + bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE); bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD); bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED); @@ -1786,14 +2178,30 @@ int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bm } } -#define AE_BMAP_SZ_WORDS (AE_BMAP_SZ_BITS / 8 / sizeof(uint32_t)) - events = (uint32_t *)async_events_bmap; - for (i = 0; i < AE_BMAP_SZ_WORDS; i++) *** 2072 LINES SKIPPED *** From nobody Thu Jan 19 03:52:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xB0qk6z2svWh; Thu, 19 Jan 2023 03:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xB0cc4z3hpX; Thu, 19 Jan 2023 03:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pb1ydH9QxqO70ye0FgyP7MsvDYDDA4sPQ408VUD48ng=; b=egdd2ZfRTLPhXtZeGf3zFtBKRzuKrFDtdZQiPwxGNDItYOmJsfzLIwffgjvnJ46YCh4N4s BERLe1/7le+pl4ObmNO4CHjkQSOxbIF+8Byv7lNLs/NoS2AKiaiOKt/bv27zb+InKHgdCu n+6lAtC3nx8TAj3uDHV5v/UU+qr0vvgldA2IYYshqmA+6pnG5kMPfBj317yhVhDFTwLx/P nBdIfMxHrEOzonu97BnXaL3pLVOTz0FXLG1+2I/1m+HMqQNMeQWJ66vsIV4IOkY1YT4Ufg pJ3vxPgGR26kQ0K+mhnDa52z0PqtRR4bv6LCKQS0vLUZkevkptkq5OwRQGP90g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pb1ydH9QxqO70ye0FgyP7MsvDYDDA4sPQ408VUD48ng=; b=ZAOSuDpNkKZ025eP9623taim6ldoxGbutC+x1uglzNYOnumLCktiUq76d1/6BW7IdFZxfN jCFPRYaZ+TuxRymDt1xBcCosTpSkw+oyrwK2Jug/gQoUMlXoFYFH1O1ZouUVhvhwIZZdTg HP7rOuD8Lpsbh6tyfGhT3+2FxkaupuJUSDmR45p56M7cULSumbvayZSiU9/vSOrDd3x9Do bnhHbPR8rSDR4sGxGQwBhPO66Me89h/DehkOcQZJlnIuWnlPcl7jJqg8UrXTOwW5RTBGhl Xp+RifpKwh8iYCZhXUb2uWWpeQwD47+hdIsVTyrxOaNgijrYnKN6WqQfveFOFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100334; a=rsa-sha256; cv=none; b=q+D2kxY81NNTW+S5zTBqh10Ou775zHaIJ05bPxVWdLw29L2uYLNKywUnewvDCg5OV7agpC H2hID0MP1KeNM9BEEkCjLvjTZKj8eSH2mGtE3yiqSdEotQFf/dZuI2BLghIaFfFYHYu/PQ bwhLt72F9WUbxH4/Wgm9jcyXYAMPjLSESbnkfTM3mGoRAZNkl9kQ8AjcLeXw8DuHXY0cjq Djf8Eqp46O4LeXIknN2OoAX7uj5lANYPasG3qz6NMY+uQevPMyMLumxRWn0DMRiz5qAuza 9RRB0asTSw8kLBgxhURgRUoZT2oBSNyC/n8ufEtiRovEd9riRX1ctEA5FJJFfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7x96qRfzcPZ; Thu, 19 Jan 2023 03:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qDIQ021971; Thu, 19 Jan 2023 03:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qDUP021970; Thu, 19 Jan 2023 03:52:13 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:13 GMT Message-Id: <202301190352.30J3qDUP021970@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: c4cad5c10820 - stable/13 - if_bnxt: Add support for admin down/up and jumbo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: c4cad5c10820b2196f123467ce39a182784533b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c4cad5c10820b2196f123467ce39a182784533b8 commit c4cad5c10820b2196f123467ce39a182784533b8 Author: Sumit Saxena AuthorDate: 2022-11-04 22:11:10 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Add support for admin down/up and jumbo Make ifconfig up/down work, as well as adding support for jumbo frames. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36439 (cherry picked from commit 055196a7d777509bebab0e718a0d333cf2660178) --- sys/dev/bnxt/bnxt.h | 1 + sys/dev/bnxt/bnxt_hwrm.c | 181 +++++++++++++++++++++++++++++++++++++++++++++-- sys/dev/bnxt/bnxt_hwrm.h | 10 ++- sys/dev/bnxt/bnxt_txrx.c | 2 +- sys/dev/bnxt/if_bnxt.c | 116 ++++++++++++++++++++++++++++-- 5 files changed, 296 insertions(+), 14 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 5a68b24e44f5..61c0a0f8bd36 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -714,6 +714,7 @@ struct bnxt_softc { struct bnxt_grp_info *grp_info; struct iflib_dma_info rx_stats[BNXT_MAX_NUM_QUEUES]; int nrxqsets; + uint16_t rx_buf_size; struct bnxt_cp_ring def_cp_ring; struct bnxt_cp_ring def_nq_ring; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 981bab37c181..761b08f6925d 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -913,6 +913,29 @@ bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause, return rc; } +int +bnxt_hwrm_vnic_set_hds(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) +{ + struct hwrm_vnic_plcmodes_cfg_input req = {0}; + + if (!BNXT_CHIP_P5(softc)) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_PLCMODES_CFG); + + /* + * TBD -- Explore these flags + * 1. VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV4 + * 2. VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6 + * 3. req.jumbo_thresh + * 4. req.hds_threshold + */ + req.flags = htole32(HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT); + req.vnic_id = htole16(vnic->id); + + return hwrm_send_message(softc, &req, sizeof(req)); +} + int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) { @@ -950,6 +973,29 @@ bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) return hwrm_send_message(softc, &req, sizeof(req)); } +int +bnxt_hwrm_vnic_free(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) +{ + struct hwrm_vnic_free_input req = {0}; + int rc = 0; + + if (vnic->id == (uint16_t)HWRM_NA_SIGNATURE) + return rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_FREE); + + req.vnic_id = htole32(vnic->id); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto fail; + +fail: + BNXT_HWRM_UNLOCK(softc); + return (rc); +} + int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) { @@ -981,6 +1027,27 @@ fail: return (rc); } +int +bnxt_hwrm_vnic_ctx_free(struct bnxt_softc *softc, uint16_t ctx_id) +{ + struct hwrm_vnic_rss_cos_lb_ctx_free_input req = {0}; + int rc = 0; + + if (ctx_id == (uint16_t)HWRM_NA_SIGNATURE) + return rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_COS_LB_CTX_FREE); + req.rss_cos_lb_ctx_id = htole16(ctx_id); + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto fail; + +fail: + BNXT_HWRM_UNLOCK(softc); + return rc; +} + int bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id) { @@ -1044,6 +1111,64 @@ fail: return rc; } +int +bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *grp) +{ + struct hwrm_ring_grp_free_input req = {0}; + int rc = 0; + + if (grp->grp_id == (uint16_t)HWRM_NA_SIGNATURE) + return 0; + + if (BNXT_CHIP_P5 (softc)) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_RING_GRP_FREE); + + req.ring_group_id = htole32(grp->grp_id); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto fail; + +fail: + BNXT_HWRM_UNLOCK(softc); + return rc; +} + +int bnxt_hwrm_ring_free(struct bnxt_softc *softc, uint32_t ring_type, + struct bnxt_ring *ring, int cmpl_ring_id) +{ + struct hwrm_ring_free_input req = {0}; + struct hwrm_ring_free_output *resp; + int rc = 0; + uint16_t error_code; + + if (ring->phys_id == (uint16_t)HWRM_NA_SIGNATURE) + return 0; + + resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_RING_FREE); + req.cmpl_ring = htole16(cmpl_ring_id); + req.ring_type = ring_type; + req.ring_id = htole16(ring->phys_id); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + error_code = le16toh(resp->error_code); + + if (rc || error_code) { + device_printf(softc->dev, "hwrm_ring_free type %d failed. " + "rc:%x err:%x\n", ring_type, rc, error_code); + if (!rc) + rc = -EIO; + } + + BNXT_HWRM_UNLOCK(softc); + return rc; +} + /* * Ring allocation message to the firmware */ @@ -1091,8 +1216,7 @@ bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type, cp_ring = &softc->rx_cp_rings[idx]; req.stat_ctx_id = htole32(cp_ring->stats_ctx_id); - req.rx_buf_size = htole16( - softc->scctx->isc_max_frame_size); + req.rx_buf_size = htole16(softc->rx_buf_size); req.enables |= htole32( HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID | HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID); @@ -1107,8 +1231,7 @@ bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type, req.rx_ring_id = htole16(softc->rx_rings[idx].phys_id); req.stat_ctx_id = htole32(cp_ring->stats_ctx_id); - req.rx_buf_size = htole16( - softc->scctx->isc_max_frame_size); + req.rx_buf_size = htole16(softc->rx_buf_size); req.enables |= htole32( HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID | HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID | @@ -1145,6 +1268,29 @@ fail: return rc; } +int +bnxt_hwrm_stat_ctx_free(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr) +{ + struct hwrm_stat_ctx_free_input req = {0}; + int rc = 0; + + if (cpr->stats_ctx_id == HWRM_NA_SIGNATURE) + return rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_STAT_CTX_FREE); + + req.stat_ctx_id = htole16(cpr->stats_ctx_id); + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto fail; + +fail: + BNXT_HWRM_UNLOCK(softc); + + return rc; +} + int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, uint64_t paddr) @@ -1253,6 +1399,29 @@ bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, return hwrm_send_message(softc, &req, sizeof(req)); } +int +bnxt_hwrm_free_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) +{ + struct hwrm_cfa_l2_filter_free_input req = {0}; + int rc = 0; + + if (vnic->filter_id == -1) + return rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_CFA_L2_FILTER_FREE); + + req.l2_filter_id = htole64(vnic->filter_id); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto fail; + +fail: + BNXT_HWRM_UNLOCK(softc); + return (rc); +} + int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) { @@ -1403,12 +1572,12 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc) HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA | HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN | HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ; - + if (softc->hw_lro.is_mode_gro) flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO; else flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE; - + req.flags = htole32(flags); req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS | diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index ef1071e0aad6..ad308f0bbbdd 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -43,6 +43,8 @@ int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc); void bnxt_free_hwrm_dma_mem(struct bnxt_softc *softc); int bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type, struct bnxt_ring *ring); +int bnxt_hwrm_ring_free(struct bnxt_softc *softc, uint32_t type, + struct bnxt_ring *ring, int cmpl_ring_id); int bnxt_hwrm_ver_get(struct bnxt_softc *softc); int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc); int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc); @@ -54,16 +56,22 @@ int bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause, bool set_eee, bool set_link); int bnxt_hwrm_set_pause(struct bnxt_softc *softc); int bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id); +int bnxt_hwrm_vnic_ctx_free(struct bnxt_softc *softc, uint16_t ctx_id); +int bnxt_hwrm_vnic_set_hds(struct bnxt_softc *sc, struct bnxt_vnic_info *vnic); int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); +int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); +int bnxt_hwrm_vnic_free(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, uint64_t paddr); +int bnxt_hwrm_stat_ctx_free(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr); int bnxt_hwrm_port_qstats(struct bnxt_softc *softc); int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp); -int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); +int bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *gr); int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); +int bnxt_hwrm_free_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnc); int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t hash_type); int bnxt_cfg_async_cr(struct bnxt_softc *softc); diff --git a/sys/dev/bnxt/bnxt_txrx.c b/sys/dev/bnxt/bnxt_txrx.c index 7ea5beab3180..c6e05be29e0e 100644 --- a/sys/dev/bnxt/bnxt_txrx.c +++ b/sys/dev/bnxt/bnxt_txrx.c @@ -282,7 +282,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) for (i=0; iscctx->isc_max_frame_size); + rxbd[pidx].len = htole16(softc->rx_buf_size); /* No need to byte-swap the opaque value */ rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16) | (frag_idxs[i])); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 2bdae7f452d3..06b5bbfb907e 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -1560,6 +1560,8 @@ bnxt_attach_post(if_ctx_t ctx) softc->scctx->isc_max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + softc->rx_buf_size = min(softc->scctx->isc_max_frame_size, BNXT_PAGE_SIZE); + failed: return rc; } @@ -1613,6 +1615,108 @@ bnxt_detach(if_ctx_t ctx) return 0; } +static void +bnxt_hwrm_resource_free(struct bnxt_softc *softc) +{ + int i, rc = 0; + + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL, + &softc->def_cp_ring.ring, + (uint16_t)HWRM_NA_SIGNATURE); + if (rc) + goto fail; + + for (i = 0; i < softc->ntxqsets; i++) { + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_TX, + &softc->tx_rings[i], + softc->tx_cp_rings[i].ring.phys_id); + if (rc) + goto fail; + + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL, + &softc->tx_cp_rings[i].ring, + (uint16_t)HWRM_NA_SIGNATURE); + if (rc) + goto fail; + + rc = bnxt_hwrm_stat_ctx_free(softc, &softc->tx_cp_rings[i]); + if (rc) + goto fail; + } + rc = bnxt_hwrm_free_filter(softc, &softc->vnic_info); + if (rc) + goto fail; + + rc = bnxt_hwrm_vnic_free(softc, &softc->vnic_info); + if (rc) + goto fail; + + rc = bnxt_hwrm_vnic_ctx_free(softc, softc->vnic_info.rss_id); + if (rc) + goto fail; + + for (i = 0; i < softc->nrxqsets; i++) { + rc = bnxt_hwrm_ring_grp_free(softc, &softc->grp_info[i]); + if (rc) + goto fail; + + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG, + &softc->ag_rings[i], + (uint16_t)HWRM_NA_SIGNATURE); + if (rc) + goto fail; + + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_RX, + &softc->rx_rings[i], + softc->rx_cp_rings[i].ring.phys_id); + if (rc) + goto fail; + + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL, + &softc->rx_cp_rings[i].ring, + (uint16_t)HWRM_NA_SIGNATURE); + if (rc) + goto fail; + + if (BNXT_CHIP_P5(softc)) { + rc = bnxt_hwrm_ring_free(softc, + HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ, + &softc->nq_rings[i].ring, + (uint16_t)HWRM_NA_SIGNATURE); + if (rc) + goto fail; + } + + rc = bnxt_hwrm_stat_ctx_free(softc, &softc->rx_cp_rings[i]); + if (rc) + goto fail; + } + +fail: + return; +} + + +static void +bnxt_func_reset(struct bnxt_softc *softc) +{ + + if (!BNXT_CHIP_P5(softc)) { + bnxt_hwrm_func_reset(softc); + return; + } + + bnxt_hwrm_resource_free(softc); + return; +} + + /* Device configuration */ static void bnxt_init(if_ctx_t ctx) @@ -1689,8 +1793,6 @@ skip_def_cp_ring: goto fail; softc->db_ops.bnxt_db_rx(&softc->rx_rings[i], 0); - if (!(softc->flags & BNXT_FLAG_TPA)) - goto skip_agg_rings; /* Allocate the AG ring */ rc = bnxt_hwrm_ring_alloc(softc, HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG, @@ -1698,7 +1800,6 @@ skip_def_cp_ring: if (rc) goto fail; softc->db_ops.bnxt_db_rx(&softc->ag_rings[i], 0); -skip_agg_rings: /* Allocate the ring group */ softc->grp_info[i].stats_ctx = @@ -1724,6 +1825,9 @@ skip_agg_rings: if (rc) goto fail; rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); + if (rc) + goto fail; + rc = bnxt_hwrm_vnic_set_hds(softc, &softc->vnic_info); if (rc) goto fail; rc = bnxt_hwrm_set_filter(softc, &softc->vnic_info); @@ -1783,7 +1887,7 @@ skip_agg_rings: return; fail: - bnxt_hwrm_func_reset(softc); + bnxt_func_reset(softc); bnxt_clear_ids(softc); return; } @@ -1795,8 +1899,7 @@ bnxt_stop(if_ctx_t ctx) bnxt_do_disable_intr(&softc->def_cp_ring); bnxt_hwrm_func_reset(softc); - if (!BNXT_CHIP_P5(softc)) - bnxt_hwrm_func_reset(softc); + bnxt_func_reset(softc); bnxt_clear_ids(softc); return; } @@ -1853,6 +1956,7 @@ bnxt_mtu_set(if_ctx_t ctx, uint32_t mtu) return EINVAL; softc->scctx->isc_max_frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + softc->rx_buf_size = min(softc->scctx->isc_max_frame_size, BNXT_PAGE_SIZE); return 0; } From nobody Thu Jan 19 03:52:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xC1mmwz2sv8P; Thu, 19 Jan 2023 03:52:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xC1Kz1z3hqT; Thu, 19 Jan 2023 03:52:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9CpEXYa5UIl8qwZLLT6irWPGCRZEcVgHdYML725MSBY=; b=hAeWh2L9gMQP/vUmD5MUtgo9Fr084hMhDAssYVwb7Iy6ROe4555CopxcouNQu8WpQSdPcz OHF++u3N1MbG6ne+hkZTtSoXOI6LF7pHVtqn5nLrG/fcn7VFV1q3TJYUxzERi4Z4xzSLLG imkDWhBucK3VIzeio7007FbQZ2CgLoB8M57yTfLCNmKkU+t8JB9COvM77CK5LZADtxBizD ThbzKBy50DXdo0NPPoL/N3O+6K2uPIpb+TZWScPyWn+kEZDGld95AaVWhmAbiZxeBfHXEg 4nM0mYcPSp+gnDznf++ElyxhNrTPoegLttPed6yAWCpiP0lRf5v0K4lx1ueBIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9CpEXYa5UIl8qwZLLT6irWPGCRZEcVgHdYML725MSBY=; b=QLtoUl7ki+7htQuaYfYo9hKTLwVDe1k6DLLFceJS9dN2LUlSaM6pLjD5s6wyfuNLC0cAiT JdXweKj9YU6+iQ6otbUsVd/GBd/Z/IJsgmS4Ekmb5Ro8965Xi7KcJKKd8BxtKk5DhoZUmY fQpXav/VCai8JHMO2JVLJLRFc1Zzhz+WbOfyHzv02A4d/sDJLOAk6D4S4Kf8J0Xcc5K+b5 I2P8a6Fy9zqNaLceGj+GbtpyxZTOk6ENCITHqlOhwjEzEzOpZRl1ORztf+psXlZskhty+h BxMY9RGTozOE3PmimZbrfMqd2KcEyPJJRO56wmGcZDplAUBB0dc2jJ3mxMQKzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100335; a=rsa-sha256; cv=none; b=gxXfoRcePnAKWA6GkpfSQeAdiLnhbGzqnOFMDwOpgoz1zJ36eJ5A0AR1XKz7DXchQPQQrQ kGfYFekoisP1xlt2WdIqPpqtHAXlIGyCtbLAkGBb0e+DPe+0Ozqh9Y9pa3Mb5gPahxjANM B35OerXRiE+6Ac0Kl2yYiauvph8VP3JuEiMBuZtUVaGMtUdHfF3uKAKhkDZJs7cHafYB2c Y65i1vb0gGAFGZLIO8xc6sEuZ52YQib16WQwnDKINIWVhENzTjfTV2nimIXHBMOolSZMO6 iZWDvQe9vUxPeGSHXtnbwlv5zqnF6yOBhx3C50FWMbJ983Aw5tZSuh4IreOLgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xC0RKpzcZL; Thu, 19 Jan 2023 03:52:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qEQg022001; Thu, 19 Jan 2023 03:52:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qEvB022000; Thu, 19 Jan 2023 03:52:14 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:14 GMT Message-Id: <202301190352.30J3qEvB022000@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: 2f1d2b99e734 - stable/13 - if_bnxt: Add support for async link status update List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2f1d2b99e73442a143da20d91971f0dd89209881 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f1d2b99e73442a143da20d91971f0dd89209881 commit 2f1d2b99e73442a143da20d91971f0dd89209881 Author: Sumit Saxena AuthorDate: 2022-11-04 22:14:49 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Add support for async link status update Reivewed by: imp Differential Revision: https://reviews.freebsd.org/D36440 (cherry picked from commit fb4b7e02d236c2c06a87fc3dacd8af6bcfbfb5c1) --- sys/dev/bnxt/bnxt.h | 4 +++ sys/dev/bnxt/bnxt_hwrm.c | 27 +++++++---------- sys/dev/bnxt/if_bnxt.c | 75 +++++++++++++++++++++++++++++++++++++----------- 3 files changed, 73 insertions(+), 33 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 61c0a0f8bd36..753d1aac92de 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -666,6 +667,9 @@ struct bnxt_softc { #define BNXT_FLAG_CHIP_P5 0x0020 #define BNXT_FLAG_TPA 0x0040 uint32_t flags; +#define BNXT_STATE_LINK_CHANGE (0) +#define BNXT_STATE_MAX (BNXT_STATE_LINK_CHANGE + 1) + bitstr_t *state_bv; uint32_t total_msix; struct bnxt_func_info func; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 761b08f6925d..eb1c60ac35d6 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include "bnxt.h" #include "bnxt_hwrm.h" @@ -1511,28 +1510,22 @@ int bnxt_cfg_async_cr(struct bnxt_softc *softc) { int rc = 0; + struct hwrm_func_cfg_input req = {0}; - if (BNXT_PF(softc)) { - struct hwrm_func_cfg_input req = {0}; + if (!BNXT_PF(softc)) + return 0; - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); - req.fid = htole16(0xffff); - req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.fid = htole16(0xffff); + req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + if (BNXT_CHIP_P5(softc)) + req.async_event_cr = htole16(softc->nq_rings[0].ring.phys_id); + else req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id); - rc = hwrm_send_message(softc, &req, sizeof(req)); - } - else { - struct hwrm_func_vf_cfg_input req = {0}; - - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG); - - req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); - req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id); + rc = hwrm_send_message(softc, &req, sizeof(req)); - rc = hwrm_send_message(softc, &req, sizeof(req)); - } return rc; } diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 06b5bbfb907e..6b4e7b516b67 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -1514,6 +1514,8 @@ bnxt_attach_pre(if_ctx_t ctx) /* Initialize the vlan list */ SLIST_INIT(&softc->vnic_info.vlan_tags); softc->vnic_info.vlan_tag_list.idi_vaddr = NULL; + softc->state_bv = bit_alloc(BNXT_STATE_MAX, M_DEVBUF, + M_WAITOK|M_ZERO); return (rc); @@ -1609,6 +1611,7 @@ bnxt_detach(if_ctx_t ctx) bnxt_free_hwrm_short_cmd_req(softc); BNXT_HWRM_LOCK_DESTROY(softc); + free(softc->state_bv, M_DEVBUF); pci_disable_busmaster(softc->dev); bnxt_pci_mapping_free(softc); @@ -1746,11 +1749,6 @@ bnxt_init(if_ctx_t ctx) if (rc) goto fail; skip_def_cp_ring: - /* And now set the default CP ring as the async CP ring */ - rc = bnxt_cfg_async_cr(softc); - if (rc) - goto fail; - for (i = 0; i < softc->nrxqsets; i++) { /* Allocate the statistics context */ rc = bnxt_hwrm_stat_ctx_alloc(softc, &softc->rx_cp_rings[i], @@ -1813,6 +1811,11 @@ skip_def_cp_ring: goto fail; } + /* And now set the default CP / NQ ring for the async */ + rc = bnxt_cfg_async_cr(softc); + if (rc) + goto fail; + /* Allocate the VNIC RSS context */ rc = bnxt_hwrm_vnic_ctx_alloc(softc, &softc->vnic_info.rss_id); if (rc) @@ -2138,10 +2141,20 @@ bnxt_update_admin_status(if_ctx_t ctx) /* * When SR-IOV is enabled, avoid each VF sending this HWRM - * request every sec with which firmware timeouts can happen - */ - if (BNXT_PF(softc)) { - bnxt_hwrm_port_qstats(softc); + * request every sec with which firmware timeouts can happen + */ + if (!BNXT_PF(softc)) + return; + + bnxt_hwrm_port_qstats(softc); + + if (BNXT_CHIP_P5(softc)) { + struct ifmediareq ifmr; + + if (bit_test(softc->state_bv, BNXT_STATE_LINK_CHANGE)) { + bit_clear(softc->state_bv, BNXT_STATE_LINK_CHANGE); + bnxt_media_status(softc->ctx, &ifmr); + } } return; @@ -2155,7 +2168,7 @@ bnxt_if_timer(if_ctx_t ctx, uint16_t qid) uint64_t ticks_now = ticks; /* Schedule bnxt_update_admin_status() once per sec */ - if (ticks_now - softc->admin_ticks >= hz) { + if (ticks_now - softc->admin_ticks >= hz) { softc->admin_ticks = ticks_now; iflib_admin_intr_deferred(ctx); } @@ -2222,6 +2235,34 @@ bnxt_tx_queue_intr_enable(if_ctx_t ctx, uint16_t qid) return 0; } +static void +bnxt_process_cmd_cmpl(struct bnxt_softc *softc, hwrm_cmpl_t *cmd_cmpl) +{ + device_printf(softc->dev, "cmd sequence number %d\n", + cmd_cmpl->sequence_id); + return; +} + +static void +bnxt_process_async_msg(struct bnxt_cp_ring *cpr, tx_cmpl_t *cmpl) +{ + struct bnxt_softc *softc = cpr->ring.softc; + uint16_t type = cmpl->flags_type & TX_CMPL_TYPE_MASK; + + switch (type) { + case HWRM_CMPL_TYPE_HWRM_DONE: + bnxt_process_cmd_cmpl(softc, (hwrm_cmpl_t *)cmpl); + break; + case HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT: + bnxt_handle_async_event(softc, (cmpl_base_t *) cmpl); + break; + default: + device_printf(softc->dev, "%s:%d Unhandled async message %x\n", + __FUNCTION__, __LINE__, type); + break; + } +} + static void process_nq(struct bnxt_softc *softc, uint16_t nqid) { @@ -2235,14 +2276,13 @@ process_nq(struct bnxt_softc *softc, uint16_t nqid) if (!NQ_VALID(&cmp[cons], v_bit)) goto done; - NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); - nqe_cnt++; - nq_type = NQ_CN_TYPE_MASK & cmp[cons].type; - /* TBD - Handle Async events */ if (nq_type != NQ_CN_TYPE_CQ_NOTIFICATION) - device_printf(softc->dev, "%s: %d nq_type 0x%x\n", __FUNCTION__, __LINE__, nq_type); + bnxt_process_async_msg(cpr, (tx_cmpl_t *)&cmp[cons]); + + NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); + nqe_cnt++; } done: if (nqe_cnt) { @@ -3110,7 +3150,10 @@ bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl) case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE: case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE: case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: - bnxt_media_status(softc->ctx, &ifmr); + if (BNXT_CHIP_P5(softc)) + bit_set(softc->state_bv, BNXT_STATE_LINK_CHANGE); + else + bnxt_media_status(softc->ctx, &ifmr); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE: case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE: From nobody Thu Jan 19 03:52:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xD3sWRz2sv67; Thu, 19 Jan 2023 03:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xD2SMXz3hvg; Thu, 19 Jan 2023 03:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rmRH9QaB4M7o94MDp2okezDiG6hEoqwFdbEy3vDRW4=; b=PHQKe3a2mzvdwuefa03Bsjc+OO9rrY5q6928gDX85brJg6ik8tVDSPTTX6qVYMgtsm7uJ4 IHsHJXnutF8TSo2Fp52Yq+vpgVtgYCtSB9g6kVXLM7nwCeg8dtpVZDfg0xBTdlgGh/mGIs OSiHnOzWaLUQZn9k2V1nfkK/J59IXYvnqNRH/oMUnV8PdhNG6mOPfnbanA5KdUzboqaGe8 /j105/iVmf9wtBev50cl2IFmv8jnAuxY2VJ0wcnZApX7TR3tqkBvJMJ+D9YAKWu+HdJJLM soyFrKUTCaTpZfdxepea4/e1sxP9DOspB7hgIzNY6DzDpFLinbMm24OE5AiF3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rmRH9QaB4M7o94MDp2okezDiG6hEoqwFdbEy3vDRW4=; b=hyp5tcyM2N6NZPDFvJdH4frrZjJkxJC9WTM89bGZvj5zjCrm6ew0/gLx1fw/4Jy0pGfYnm m5juyfq65Yr7humc9MYU6jG17G4NM6Iw+EcNoPBU2AhL8YpKUQFAi1Y+hybzO6uJjwyC4i nFF0goRL8hXk4zZSKWcbklLhIjyfhfsyROdzdcP1dWCejbqPn5T6/AtpBMa744Zy5rW97s WjvWXlCrdrXBDLraN5pk4tPJg5m7FN6KI9nDY1o/T3MJHiAE7HO5JM45G8HoL0iYAh0eg6 6VhyWrOPOnBo+LncG3bnT8+HgUtOVeieS4vvzMmDpRN9W5dfMv7rXF/GS/3gag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100336; a=rsa-sha256; cv=none; b=ayo6bRjEmjGSkC1ZCZSD+/YBNCyAojBiQQ78j/ZEpCkYk32eePGQ6oNVrUhj+JR1NK5FKm MvRMJG0952NhK4XinUq/9bK7BBtqxKjXi6s45GQkfjCvMZdpA85Wof7q2hn0L6EaugXAY5 JIUykUTF/QtFEnZun13rj7WA/f5xd5AFVXJ344ASqBnq48HH/V7DE+mE3n//pwyVD8s4g+ maMQtU2om7qxY7FJl7WaE9H8K3YCHxyIKyAsMXsdVQ1uguorDFlzdW4c6TtM9g5zTKVOeI j4ZrMUDoJgEHjB1Tn4RguiPl3PGdEsvP39iL3QogY9Q/1Wm5pqEJv4Fzbeckaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xD1YbdzcT3; Thu, 19 Jan 2023 03:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qGUp022026; Thu, 19 Jan 2023 03:52:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qGu8022025; Thu, 19 Jan 2023 03:52:16 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:16 GMT Message-Id: <202301190352.30J3qGu8022025@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: 9142a68da29f - stable/13 - if_bnxt: Display firmware version along with SIT package version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9142a68da29fdfe28f9b1f3eeee34e661c5eed4f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9142a68da29fdfe28f9b1f3eeee34e661c5eed4f commit 9142a68da29fdfe28f9b1f3eeee34e661c5eed4f Author: Sumit Saxena AuthorDate: 2022-11-04 22:18:38 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Display firmware version along with SIT package version Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36441 (cherry picked from commit 6033382aab2e6108e6faa273fd945274e161cd5b) --- sys/dev/bnxt/bnxt.h | 3 +++ sys/dev/bnxt/bnxt_hwrm.c | 28 ++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_sysctl.c | 3 +++ 3 files changed, 34 insertions(+) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 753d1aac92de..9638ad78fb6d 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -471,6 +471,8 @@ struct bnxt_full_tpa_start { /* All the version information for the part */ #define BNXT_VERSTR_SIZE (3*3+2+1) /* ie: "255.255.255\0" */ #define BNXT_NAME_SIZE 17 +#define FW_VER_STR_LEN 32 +#define BC_HWRM_STR_LEN 21 struct bnxt_ver_info { uint8_t hwrm_if_major; uint8_t hwrm_if_minor; @@ -481,6 +483,7 @@ struct bnxt_ver_info { char mgmt_fw_ver[BNXT_VERSTR_SIZE]; char netctrl_fw_ver[BNXT_VERSTR_SIZE]; char roce_fw_ver[BNXT_VERSTR_SIZE]; + char fw_ver_str[FW_VER_STR_LEN]; char phy_ver[BNXT_VERSTR_SIZE]; char pkg_ver[64]; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index eb1c60ac35d6..91e6865449ac 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -546,6 +546,7 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) const char nastr[] = ""; const char naver[] = ""; uint32_t dev_caps_cfg; + uint16_t fw_maj, fw_min, fw_bld, fw_rsv, len; softc->hwrm_max_req_len = HWRM_MAX_REQ_LEN; softc->hwrm_cmd_timeo = 1000; @@ -620,6 +621,32 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) strlcpy(softc->ver_info->roce_fw_name, resp->roce_fw_name, BNXT_NAME_SIZE); } + + fw_maj = le32toh(resp->hwrm_fw_major); + if (softc->hwrm_spec_code > 0x10803 && fw_maj) { + fw_min = le16toh(resp->hwrm_fw_minor); + fw_bld = le16toh(resp->hwrm_fw_build); + fw_rsv = le16toh(resp->hwrm_fw_patch); + len = FW_VER_STR_LEN; + } else { + fw_maj = resp->hwrm_fw_maj_8b; + fw_min = resp->hwrm_fw_min_8b; + fw_bld = resp->hwrm_fw_bld_8b; + fw_rsv = resp->hwrm_fw_rsvd_8b; + len = BC_HWRM_STR_LEN; + } + + snprintf (softc->ver_info->fw_ver_str, len, "%d.%d.%d.%d", + fw_maj, fw_min, fw_bld, fw_rsv); + + if (strlen(resp->active_pkg_name)) { + int fw_ver_len = strlen (softc->ver_info->fw_ver_str); + + snprintf(softc->ver_info->fw_ver_str + fw_ver_len, + FW_VER_STR_LEN - fw_ver_len - 1, "/pkg %s", + resp->active_pkg_name); + } + softc->ver_info->chip_num = le16toh(resp->chip_num); softc->ver_info->chip_rev = resp->chip_rev; softc->ver_info->chip_metal = resp->chip_metal; @@ -1470,6 +1497,7 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, /* TBD */ if (BNXT_CHIP_P5(softc)) return 0; + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG); req.hash_type = htole32(hash_type); diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index e8b3edc27e4d..36afed71a726 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -834,6 +834,9 @@ bnxt_create_ver_sysctls(struct bnxt_softc *softc) SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "roce_fw", CTLFLAG_RD, vi->roce_fw_ver, 0, "RoCE firmware version"); + SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "fw_ver", CTLFLAG_RD, vi->fw_ver_str, 0, + "Firmware version"); SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "phy", CTLFLAG_RD, vi->phy_ver, 0, "PHY version"); From nobody Thu Jan 19 03:52:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xF5Mqzz2svWq; Thu, 19 Jan 2023 03:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xF4D3fz3j2J; Thu, 19 Jan 2023 03:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Cm5H3/wm7glkrMHHL7WjSFYHwUwUCgG6NKkpl23aIM=; b=tnrDvto1tt4dp7fBugapflU5he6VDHV9zTuNrO+9gRADUklDH+C94bJDZV2BIlYSRievpU fg2Ln2TwI9psrNCphPhkzFCG1aa/TFo10h2QmLFcidAtgKnI7EBVaV2g2L0PqFEGdBpZ6p 0CB3GGov7nUBRyoAt9gG42klcLRKkEQelSLEA2hJCYQqXyRh5jbGJCd9BRFZfmAJ04XWlr TYsSKpMBTaKkIf8GtAHhuJPyv7bEKNHfNEna3Sph9zhNwAo/RzXXKkxJOdm8KshgW0B0uL 1QnJdnCrulyJ6Bu5H1PELwZBCMPfeE7Pekwu0TnAQyICnz5zu632P5XcZUwxhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Cm5H3/wm7glkrMHHL7WjSFYHwUwUCgG6NKkpl23aIM=; b=QDytTLXxvbIlTr20serJAUacbXViH4V9qH8fmQdIUQtimEPmvZ9FZo5Wk4qN0PHco3bBR6 NaSc84xvxFOlWL/OjIgfPBXdRxKpqtlDkfZMEh1vZDajg14r5yDgguvsYcYoXAR/ajjbKh bzmQoE13odvV7g5iOOpMaECAWMNQmphbVTJJ6gbgGb2KswGrWthO76mifYdcf/d5aIJGED XFZa+0xm/8tC5tVi//kg+d5BHqm3ceu2M4OYRaVgnjFhcqOdEcJ6r4OoM/g6SpEIYEf8z4 KbIRirTeOeBzGEWI6C8a4XhZrFyH27MHcyaDinxtXPThac0maCRNoMdsAI0jaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100337; a=rsa-sha256; cv=none; b=Fg2TRvENYjEfLUdnGtyLdLUuxUjELXwJGkSYtjRjAGQt8c0HmOSWnRjKxBx4Lp5vtBLDBy 9PGZk1UsDs8CSPMCv9uJIDfzc3LTd473YpZTGa5MQxfV2EoaTXkc9fN76SopZCCnIxEwot WrrWxgtEG6E8XhyYkSuVFTqtC7FWUIGtNao1tq/Siihd25LUB2Bzr1CWqOfeKUrlP9sgdH CNOq26dwkRaVDpMS6UaNyb4UpxEsI3QMbA9FlTswCoXM7c0rkkEmJEEolHHv/AR/fkKpnh jLRWCo1WJZn2lumQfV7614r3kMdtTG4AUed7YVBG8InyalByb0NJCgb8Xa0fXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xF2Rw8zcfh; Thu, 19 Jan 2023 03:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qHnL022727; Thu, 19 Jan 2023 03:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qHtt022726; Thu, 19 Jan 2023 03:52:17 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:17 GMT Message-Id: <202301190352.30J3qHtt022726@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: 2bab173f73dc - stable/13 - if_bnxt: Add support for RSS on Thor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2bab173f73dc9b849da18bf4884e9ed6711e678c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2bab173f73dc9b849da18bf4884e9ed6711e678c commit 2bab173f73dc9b849da18bf4884e9ed6711e678c Author: Sumit Saxena AuthorDate: 2022-11-04 22:21:20 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Add support for RSS on Thor Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36442 (cherry picked from commit cfdca95f7834d2c10749fb14e12495d8aa7d1be0) --- sys/dev/bnxt/bnxt_hwrm.c | 9 +++++---- sys/dev/bnxt/if_bnxt.c | 28 +++++++++++++++++++--------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 91e6865449ac..ebcfc5ef03ff 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -1494,16 +1494,17 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, { struct hwrm_vnic_rss_cfg_input req = {0}; - /* TBD */ - if (BNXT_CHIP_P5(softc)) - return 0; - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG); req.hash_type = htole32(hash_type); req.ring_grp_tbl_addr = htole64(vnic->rss_grp_tbl.idi_paddr); req.hash_key_tbl_addr = htole64(vnic->rss_hash_key_tbl.idi_paddr); req.rss_ctx_idx = htole16(vnic->rss_id); + req.hash_mode_flags = HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT; + if (BNXT_CHIP_P5(softc)) { + req.vnic_id = htole16(vnic->id); + req.ring_table_pair_index = 0x0; + } return hwrm_send_message(softc, &req, sizeof(req)); } diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 6b4e7b516b67..c63b47da4a89 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -1719,6 +1719,23 @@ bnxt_func_reset(struct bnxt_softc *softc) return; } +static void +bnxt_rss_grp_tbl_init(struct bnxt_softc *softc) +{ + uint16_t *rgt = (uint16_t *) softc->vnic_info.rss_grp_tbl.idi_vaddr; + int i, j; + + for (i = 0, j = 0; i < HW_HASH_INDEX_SIZE; i++) { + if (BNXT_CHIP_P5(softc)) { + rgt[i++] = htole16(softc->rx_rings[j].phys_id); + rgt[i] = htole16(softc->rx_cp_rings[j].ring.phys_id); + } else { + rgt[i] = htole16(softc->grp_info[j].grp_id); + } + if (++j == softc->nrxqsets) + j = 0; + } +} /* Device configuration */ static void @@ -1726,7 +1743,7 @@ bnxt_init(if_ctx_t ctx) { struct bnxt_softc *softc = iflib_get_softc(ctx); struct ifmediareq ifmr; - int i, j; + int i; int rc; if (!BNXT_CHIP_P5(softc)) { @@ -1837,14 +1854,7 @@ skip_def_cp_ring: if (rc) goto fail; - /* Enable RSS on the VNICs */ - for (i = 0, j = 0; i < HW_HASH_INDEX_SIZE; i++) { - ((uint16_t *) - softc->vnic_info.rss_grp_tbl.idi_vaddr)[i] = - htole16(softc->grp_info[j].grp_id); - if (++j == softc->nrxqsets) - j = 0; - } + bnxt_rss_grp_tbl_init(softc); rc = bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, softc->vnic_info.rss_hash_type); From nobody Thu Jan 19 03:52:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xG5Z70z2svJ9; Thu, 19 Jan 2023 03:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xG4XLSz3hsg; Thu, 19 Jan 2023 03:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GLkIbd7NaXQyXqwLTbDjZqWlXlEPyhKiLNY0LVcUScU=; b=UurUy9nZzWSQ542yzdyBx25QQ13qS4HopAIUK9spMhL/h9+0eBQ6LmKP2bbkEiDYQ10ALw U8ddP5Jty3PT1A5z8uo7VqZVRnYtmyE5uE7jEmmyYBVADtOcWEeJO5Uh3LLGRTuu3cz4E7 V0Ij3WbXOHJhQ8yz6CWKDeuOVwFahVxTBLuPlAOkzH+Mt2MHycGdl5WMo2Hb+5Ss/56dpG WpMzvgWe4117rarx4GiGVIhYL8KLw/hkAcUX9piUbRASUZb4oEW7GGVJmGhO74t7hbd4z6 0Z70/+obEmGcp1L7lt4p6trj7yWjyO6qVD9qzU/Waonx1cqujtDBjgJjcYDyYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GLkIbd7NaXQyXqwLTbDjZqWlXlEPyhKiLNY0LVcUScU=; b=RfW3/GO6OI1ZX8IYVcKoWVumAl5XsPu+rhkUPgYF2WVUMfr0vYvb9s/eXVZvqJODReQ/Js 5IO1izUALTvxLd8dD3/7OJa7uFwdDZVyhskXBg3SjraXnLsOX6voD6DKOBEQ4alQpHsX+4 Z6FNfuH4nvXURfxhHX8rYBwqCukM+pCTgOaC462kJwGe+1pdX4otcg83pEGby/3Zl6dtf1 2M1cd6XXlntFvjrb9RWPplmNABt3RMUurHEPnHZWqkkYDM5rD5st6gzyttHr0bDzB3UkHY tOXjLQ6e5dsu70ikxLk0uWH5JdDwLXL+Z+BxEuxtz1td6GbRFFAWfsLjcsUtrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100338; a=rsa-sha256; cv=none; b=MjaELr1swdFMfwS/tQa5IoANMmu5OhlCRBDhpqp8IxShBbxpVOF2jsDxZhjg9fw+5ePmvY m5E/9dOyXg0TdbiOVX3DeVVbqqLnP7YBBtxyjBgmB05YajEFb0aVWYafBmErnjn+gVWXmj zgz0YyuWjzEFB34GxzbtX206UFtPYCah7b6l18L8YMWhDMdTSCyOJ6odBwOaxDGQn7pq8b WbihcZUN4GwiuL9U5yWqVITmp11FPvvVGlUnB7R7ChKrdcynqFr/eiI4MgoGaNlith4R2U sEsOfwxnno8tGJpr3Ohl7dBgOPs6ebD+ajFNkzC9OvzNLaOOK4OEVJBKEPUrsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xG3Nv9zc4L; Thu, 19 Jan 2023 03:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qICU023177; Thu, 19 Jan 2023 03:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qIO3023176; Thu, 19 Jan 2023 03:52:18 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:18 GMT Message-Id: <202301190352.30J3qIO3023176@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: 2db35273502b - stable/13 - if_bnxt: Add support for VLAN on Thor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2db35273502b3c35aa653effc5c97618567367ab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2db35273502b3c35aa653effc5c97618567367ab commit 2db35273502b3c35aa653effc5c97618567367ab Author: Sumit Saxena AuthorDate: 2022-11-04 22:24:32 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Add support for VLAN on Thor Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36443 (cherry picked from commit 91fcacc355971f74aa26fc7861020dc3a2a2d717) --- sys/dev/bnxt/bnxt.h | 3 +- sys/dev/bnxt/bnxt_hwrm.c | 110 ++++++++++++++++++++++++++++------------------- sys/dev/bnxt/bnxt_hwrm.h | 7 ++- sys/dev/bnxt/if_bnxt.c | 7 ++- 4 files changed, 74 insertions(+), 53 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 9638ad78fb6d..4cf93f1c7eeb 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -396,7 +396,7 @@ struct bnxt_vf_info { struct bnxt_vlan_tag { SLIST_ENTRY(bnxt_vlan_tag) next; - uint16_t tpid; + uint64_t filter_id; uint16_t tag; }; @@ -419,7 +419,6 @@ struct bnxt_vnic_info { #define BNXT_VNIC_FLAG_VLAN_STRIP 0x04 uint64_t filter_id; - uint32_t flow_id; uint16_t rss_id; uint32_t rss_hash_type; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index ebcfc5ef03ff..40c47ffe372c 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -1379,64 +1379,29 @@ bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) { struct hwrm_cfa_l2_set_rx_mask_input req = {0}; - struct bnxt_vlan_tag *tag; - uint32_t *tags; - uint32_t num_vlan_tags = 0; - uint32_t i; uint32_t mask = vnic->rx_mask; - int rc; - - SLIST_FOREACH(tag, &vnic->vlan_tags, next) - num_vlan_tags++; - - if (num_vlan_tags) { - if (!(mask & - HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN)) { - if (!vnic->vlan_only) - mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN; - else - mask |= - HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY; - } - if (vnic->vlan_tag_list.idi_vaddr) { - iflib_dma_free(&vnic->vlan_tag_list); - vnic->vlan_tag_list.idi_vaddr = NULL; - } - rc = iflib_dma_alloc(softc->ctx, 4 * num_vlan_tags, - &vnic->vlan_tag_list, BUS_DMA_NOWAIT); - if (rc) - return rc; - tags = (uint32_t *)vnic->vlan_tag_list.idi_vaddr; - i = 0; - SLIST_FOREACH(tag, &vnic->vlan_tags, next) { - tags[i] = htole32((tag->tpid << 16) | tag->tag); - i++; - } - } bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_CFA_L2_SET_RX_MASK); req.vnic_id = htole32(vnic->id); req.mask = htole32(mask); req.mc_tbl_addr = htole64(vnic->mc_list.idi_paddr); req.num_mc_entries = htole32(vnic->mc_list_count); - req.vlan_tag_tbl_addr = htole64(vnic->vlan_tag_list.idi_paddr); - req.num_vlan_tags = htole32(num_vlan_tags); return hwrm_send_message(softc, &req, sizeof(req)); } int -bnxt_hwrm_free_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) +bnxt_hwrm_l2_filter_free(struct bnxt_softc *softc, uint64_t filter_id) { struct hwrm_cfa_l2_filter_free_input req = {0}; int rc = 0; - if (vnic->filter_id == -1) + if (filter_id == -1) return rc; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_CFA_L2_FILTER_FREE); - req.l2_filter_id = htole64(vnic->filter_id); + req.l2_filter_id = htole64(filter_id); BNXT_HWRM_LOCK(softc); rc = _hwrm_send_message(softc, &req, sizeof(req)); @@ -1449,16 +1414,40 @@ fail: } int -bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) +bnxt_hwrm_free_filter(struct bnxt_softc *softc) +{ + struct bnxt_vnic_info *vnic = &softc->vnic_info; + struct bnxt_vlan_tag *tag; + int rc = 0; + + rc = bnxt_hwrm_l2_filter_free(softc, softc->vnic_info.filter_id); + if (rc) + goto end; + + SLIST_FOREACH(tag, &vnic->vlan_tags, next) { + rc = bnxt_hwrm_l2_filter_free(softc, tag->filter_id); + if (rc) + goto end; + tag->filter_id = -1; + } + +end: + return rc; +} + +int +bnxt_hwrm_l2_filter_alloc(struct bnxt_softc *softc, uint16_t vlan_tag, + uint64_t *filter_id) { struct hwrm_cfa_l2_filter_alloc_input req = {0}; struct hwrm_cfa_l2_filter_alloc_output *resp; + struct bnxt_vnic_info *vnic = &softc->vnic_info; uint32_t enables = 0; int rc = 0; - if (vnic->filter_id != -1) { - device_printf(softc->dev, - "Attempt to re-allocate l2 ctx filter\n"); + if (*filter_id != -1) { + device_printf(softc->dev, "Attempt to re-allocate l2 ctx " + "filter (fid: 0x%lx)\n", *filter_id); return EDOOFUS; } @@ -1469,6 +1458,17 @@ bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) enables = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR | HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK | HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID; + + if (vlan_tag != 0xffff) { + enables |= + HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN | + HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK | + HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS; + req.l2_ivlan_mask = 0xffff; + req.l2_ivlan = vlan_tag; + req.num_vlans = 1; + } + req.enables = htole32(enables); req.dst_id = htole16(vnic->id); memcpy(req.l2_addr, if_getlladdr(iflib_get_ifp(softc->ctx)), @@ -1480,14 +1480,34 @@ bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) if (rc) goto fail; - vnic->filter_id = le64toh(resp->l2_filter_id); - vnic->flow_id = le64toh(resp->flow_id); - + *filter_id = le64toh(resp->l2_filter_id); fail: BNXT_HWRM_UNLOCK(softc); return (rc); } +int +bnxt_hwrm_set_filter(struct bnxt_softc *softc) +{ + struct bnxt_vnic_info *vnic = &softc->vnic_info; + struct bnxt_vlan_tag *tag; + int rc = 0; + + rc = bnxt_hwrm_l2_filter_alloc(softc, 0xffff, &vnic->filter_id); + if (rc) + goto end; + + SLIST_FOREACH(tag, &vnic->vlan_tags, next) { + rc = bnxt_hwrm_l2_filter_alloc(softc, tag->tag, + &tag->filter_id); + if (rc) + goto end; + } + +end: + return rc; +} + int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t hash_type) diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index ad308f0bbbdd..8033ddb50136 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -70,8 +70,11 @@ int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, int bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *gr); int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); -int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); -int bnxt_hwrm_free_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnc); +int bnxt_hwrm_set_filter(struct bnxt_softc *softc); +int bnxt_hwrm_free_filter(struct bnxt_softc *softc); +int bnxt_hwrm_l2_filter_alloc(struct bnxt_softc *softc, uint16_t vlan_tag, + uint64_t *filter_id); +int bnxt_hwrm_l2_filter_free(struct bnxt_softc *softc, uint64_t filter_id); int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t hash_type); int bnxt_cfg_async_cr(struct bnxt_softc *softc); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index c63b47da4a89..bc6dd1c2b1c5 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -653,7 +653,6 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, /* And finally, the VNIC */ softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; - softc->vnic_info.flow_id = (uint16_t)HWRM_NA_SIGNATURE; softc->vnic_info.filter_id = -1; softc->vnic_info.def_ring_grp = (uint16_t)HWRM_NA_SIGNATURE; softc->vnic_info.cos_rule = (uint16_t)HWRM_NA_SIGNATURE; @@ -1649,7 +1648,7 @@ bnxt_hwrm_resource_free(struct bnxt_softc *softc) if (rc) goto fail; } - rc = bnxt_hwrm_free_filter(softc, &softc->vnic_info); + rc = bnxt_hwrm_free_filter(softc); if (rc) goto fail; @@ -1850,7 +1849,7 @@ skip_def_cp_ring: rc = bnxt_hwrm_vnic_set_hds(softc, &softc->vnic_info); if (rc) goto fail; - rc = bnxt_hwrm_set_filter(softc, &softc->vnic_info); + rc = bnxt_hwrm_set_filter(softc); if (rc) goto fail; @@ -2406,7 +2405,7 @@ bnxt_vlan_register(if_ctx_t ctx, uint16_t vtag) if (new_tag == NULL) return; new_tag->tag = vtag; - new_tag->tpid = 8100; + new_tag->filter_id = -1; SLIST_INSERT_HEAD(&softc->vnic_info.vlan_tags, new_tag, next); }; From nobody Thu Jan 19 03:52:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xH74QSz2svCM; Thu, 19 Jan 2023 03: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xH5tMTz3j71; Thu, 19 Jan 2023 03: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=1674100339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3NqrGG3fEB3GbUdaSa+A4wck2zFBfoCxQ+WsqUtGFh8=; b=Iv+B7+Tkf57Kdu+BnaSi3iKV12JIlMkX+CpcZky6auWHP0qUvZlsfg3uAHa+60dmiOAIRw YFfE4j02/W1HNnxCgpVWkFR3eet1lTSlenJp05KET+C9IqWIlFwknV4s8cnJXLaFvtAwrA 1w7AipRhJRsPUJLW9NrGN8lRe3/yqb/MifGT6rN9mCBNSup4wsJV9W7iIUDiT/AbKDVNLV +ercRxpL8ECiEDyX8ufoLbOwo+4rSRYW26F1qvQQtFz7oqRJ2ThVxyeWDWdKr99Z9h/JPf iQhSxPzgmnuJUQus9GHSkG7B/FQuDuf/wt71a5R+paadS88QQuA3QTmexb6V3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3NqrGG3fEB3GbUdaSa+A4wck2zFBfoCxQ+WsqUtGFh8=; b=Va4NJf4+i9i8fVKiTTjwrkN4gpJTsGF2iBucmA/Xc+PLe0BAEeC5XcFlJk59zkVGMNfikh 2D8gcDLub5inmoHBCTmT1oqf50gUhGBLRhKwmOXhijUfmansUyJMHQWcz3nOab+cfj6QyF kanTQ5nivYkjA13QicrfpGNZ84wZk5G/0RTtiCJEkflzWb4P93fWK3RKoDAIdbxytGBFfE bB480rDbDtDW+1aptn3mqI9yIE6Pd8qn78+hNxBkSZn6Zx/+UNkGX1V2Mr9Ic7XJ4PVtfl ibKuAjHMiC5IhsoJ2ZGyxW2Y8ZtzQaY1aIdJbV3In9JkA1wt1igLCFlirzQQNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100339; a=rsa-sha256; cv=none; b=k+PLEkrEyKGB1GPuOvjmvRxhma+sH3ADSzyYdn9ZLy9Oo3LpijGwLwn5khmxdbK5KgnECd lFr/ewxIcfbOAS0o0qgcO9qACKAC+TNSp1qgHI550a/trA6fwvmpsHT/x4G/mQcuYhwGK7 1c52Fi306TSLGGI0HLI9TBUPcoP62NNtUmWR8smDHTrtz7EeRySc2Rt7xFjojYb2qrV5yP BftmS9Sed6v78QsfXHEP71HBT99ggnci2SDh3MxfNmSmHxcBQS2Vv9Dj6aPY962XhpIOAW TigdS21M9hTeZuTMtowbTBgVPYvtiydu6MU9Co7U3fwYgt3dGmM0ZN12wmqDlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xH3zT1zcZN; Thu, 19 Jan 2023 03:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qJOC023222; Thu, 19 Jan 2023 03:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qJPf023211; Thu, 19 Jan 2023 03:52:19 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:19 GMT Message-Id: <202301190352.30J3qJPf023211@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: 5fe5b1576347 - stable/13 - if_bnxt: Remove sysctl node vlan_only which is not being 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 5fe5b15763471ce0473abb8ea144a7b9795a8c75 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5fe5b15763471ce0473abb8ea144a7b9795a8c75 commit 5fe5b15763471ce0473abb8ea144a7b9795a8c75 Author: Sumit Saxena AuthorDate: 2022-11-04 22:26:03 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Remove sysctl node vlan_only which is not being used Removed sysctl node vlan_only which is not being used after migrating from l2_set_rx_mask to l2_filter_alloc. Reviewed by: imp Differential Revsion: https://reviews.freebsd.org/D36444 (cherry picked from commit 72e9dbb58cad5262190cf2eae47f764021072128) --- sys/dev/bnxt/bnxt.h | 1 - sys/dev/bnxt/bnxt_sysctl.c | 38 +------------------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 4cf93f1c7eeb..f8f3f4ccc2f5 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -408,7 +408,6 @@ struct bnxt_vnic_info { uint16_t mru; uint32_t rx_mask; - bool vlan_only; struct iflib_dma_info mc_list; int mc_list_count; #define BNXT_MAX_MC_ADDRS 16 diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index 36afed71a726..677dc2c1c0c1 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "bnxt_hwrm.h" #include "bnxt_sysctl.h" -static int bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS); /* * We want to create: * dev.bnxt.0.hwstats.txq0 @@ -1388,45 +1387,10 @@ bnxt_create_hw_lro_sysctls(struct bnxt_softc *softc) return 0; } -static int -bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS) { - struct bnxt_softc *softc = arg1; - int rc; - int val; - - if (softc == NULL) - return EBUSY; - - val = softc->vnic_info.vlan_only; - rc = sysctl_handle_int(oidp, &val, 0, req); - if (rc || !req->newptr) - return rc; - - if (val) - val = 1; - - if (val != softc->vnic_info.vlan_only) { - softc->vnic_info.vlan_only = val; - if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) - rc = bnxt_hwrm_cfa_l2_set_rx_mask(softc, - &softc->vnic_info); - } - - return rc; -} int bnxt_create_config_sysctls_post(struct bnxt_softc *softc) { - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(softc->dev); - struct sysctl_oid_list *children; - - children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_only", - CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, softc, 0, - bnxt_vlan_only_sysctl, "I", - "require vlan tag on received packets when vlan is enabled"); - + /* Nothing for now, meant for future expansion */ return 0; } From nobody Thu Jan 19 03:52:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xK2Pj0z2svYg; Thu, 19 Jan 2023 03:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xK1Pfrz3j7K; Thu, 19 Jan 2023 03:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SEKL27m47ZJNOzhYTYffYUVeKvzr4xUPsmEvI+MWTPE=; b=Mlyuj4eXBiWxgG3mguHZiJsXWqaNdI9fng0VISU5EY46CtMy1IYxNa0lDBHt9QcZd+5Ddl a2d61aUh0Z6vTeomnzMaDFwLmQrPhd61IQ/jdZgP0rS4Rxm8eLcy/nc1cQKT5KH6Pu6Ejs ruq82xRgqdnIozDKKRMZ97Bnl/gRleXwTdmSFcgGXO18MsBc/0c+4hUxkonW9KNSSyo8px l8+EUJmr+9SvQj5gp6LvDuXtQMlf+gyNJAnyC5Je+O78uUxmG8831U1G4YqgqlhbM4XaTp SB8xjWhRIDkg735EuHfoJ/zPdNBjt1Bg0x3Xg/2A+kGEoFIhH3B3xOCTsJ+Rdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SEKL27m47ZJNOzhYTYffYUVeKvzr4xUPsmEvI+MWTPE=; b=Y7p2N1J0RrJeQmxXISoC+P92PChq4KIEW0Qf7uiNnmGhCyGWBeeO1IW9LdEu3xNbepyLtm F+PC6/aro+iacNnWXi6QA5mFzFW/syvGT8VGM9G1AZ5xHC4TL7j+hvaUe8qfCONTFbE0OF zayXiL969uPtVF0KnfrjQyTkCgKXYTXUS9u3ez5GXHo9ijyAaqqUVh0eBn6xGcBvGMQEE+ KJne/jZsJQug2LACSzB2CoTlt+FoHVsC6A/4MOXfmtjAp7svbH+qZ1S1mBSlhA76lSR9RT T0H6KEJtSskrDp4vjMTgL8ORBxf3wonrNATowLr0gjUhXFPtp4lAG+uGtGxAjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100341; a=rsa-sha256; cv=none; b=K//Bq1ik8qauLBq1hjTM0z04LCDyKLZA+vNtJTLtqAyCE/JM+o0Y1wSti3zYWqlmpXKbw5 g6amOKkJnMa5GKiX2CAdP/Mp9XwWTFkzUgPLOtdOOyKmtdAPwnUmfp8qIn857OucTMXTDI zgoAbt8SRupBiIAbHzAVy6gBizm4HDrxxyqbD3c891ooo6VKLqw5CrhbI8nngfCV8ojv9q Qn83sDLCiYr1SauBXsi2l4Fq07F0tYZ4G98qEPNIY+j8N/we/VdfG6jR08NtTYnEnHMnQd gB+RDqOMdN7tU/ksuMvdcCywKxFw5KgydQ3I79bgpjVvIVUlxmQtT0lAHxrXpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xJ4T7jzcfm; Thu, 19 Jan 2023 03:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qKhY024675; Thu, 19 Jan 2023 03:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qKf0024662; Thu, 19 Jan 2023 03:52:20 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:20 GMT Message-Id: <202301190352.30J3qKf0024662@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: eed0ac16edb5 - stable/13 - if_bnxt: Fix the issue when kernel invokes _init() again without _stop() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: eed0ac16edb5aa0bb60780e2c11db40661716ab2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eed0ac16edb5aa0bb60780e2c11db40661716ab2 commit eed0ac16edb5aa0bb60780e2c11db40661716ab2 Author: Sumit Saxena AuthorDate: 2022-11-04 22:28:51 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Fix the issue when kernel invokes _init() again without _stop() Fixed the issue when kernel invokes _init() when it is already in _init() state by invoking _stop() in such case. Reviewed by: imp Differential Revsion: https://reviews.freebsd.org/D36445 (cherry picked from commit baef1301a2bc60be3908f44dff1f83dbbd8f812a) --- sys/dev/bnxt/bnxt.h | 1 + sys/dev/bnxt/if_bnxt.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index f8f3f4ccc2f5..0d5824722b41 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -738,6 +738,7 @@ struct bnxt_softc { struct bnxt_ver_info *ver_info; struct bnxt_nvram_info *nvm_info; bool wol; + bool is_dev_init; struct bnxt_hw_lro hw_lro; uint8_t wol_filter_id; uint16_t rx_coal_usecs; diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index bc6dd1c2b1c5..8b26b4d64436 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -1749,7 +1749,11 @@ bnxt_init(if_ctx_t ctx) rc = bnxt_hwrm_func_reset(softc); if (rc) return; + } else if (softc->is_dev_init) { + bnxt_stop(ctx); } + + softc->is_dev_init = true; bnxt_clear_ids(softc); // TBD -- Check if it is needed for Thor as well @@ -1909,8 +1913,8 @@ bnxt_stop(if_ctx_t ctx) { struct bnxt_softc *softc = iflib_get_softc(ctx); + softc->is_dev_init = false; bnxt_do_disable_intr(&softc->def_cp_ring); - bnxt_hwrm_func_reset(softc); bnxt_func_reset(softc); bnxt_clear_ids(softc); return; From nobody Thu Jan 19 03:52:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xL184Vz2svhX; Thu, 19 Jan 2023 03:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xK6Ztxz3jHg; Thu, 19 Jan 2023 03:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9LizdutOXY5+vShZmHavEvTd2Bnq9b5gBeHGixtXgg4=; b=Y3OjwdgCRsKr2LCyEhy+s3g143lI+Vmmfe+lDP4BjBo2zbSA7c3tEukEyFkv5b6O8tOSO5 g9b1gt/NmwdSsd891gUrE/npJhQxajZNer9AAA90+XZGfLa3rXw7kOFsn6qlWLB9VJiwuC erLlvC+YBdFfU2scHSQrzLQ1vT3A31es1Gx0ZolrLItc75P3InVCR1fGQP4kYAIJw7tN9t AgxACTAqT/2OTlcabEcnfmQDiqRzuRgRHpiJUkdbobxA8xmeCuSemoDsPrgFTH5RLPy1ef 3iWu9jxFCZLGEMg1jo+fhqB9junFOrGzzmAl61LESbW0s6lDUOJToBvT9EM6hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9LizdutOXY5+vShZmHavEvTd2Bnq9b5gBeHGixtXgg4=; b=srXePdez8FA/EivJs98NSHQ6MpRr3S2wmgx7ViC8Qw9Qa8g292IG2qgOesd0blkmqU//Me W8q4WH2u1vaiG2a6YaaY55On+fyjzskMWxjzcvNy+jSyWb+sz5DKbdz3tZDzDd9YvRLpz/ yPllD9vrzgwOzuiP0Ialq8vg6PHnJ8j0R7HeP5GfgWDUuheo3f5thbFDGN3o3YP2CLLLjM q7OWpXG41d/0fEi1nZH00ZLFTJGsekKNNP0gheFhSb5kn44gFO8wZjAHCYdDmj7JuDnG0E 5l9J3Ee7//sJsII00p1GJk1+ZbsguJ9rqwUW2FhivjqsJQ4x9pZA2kpYB0RKig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100342; a=rsa-sha256; cv=none; b=V3ZPg96hkypKvFgeH2/WlQpAV+W+NoWjgui/U2ksKbjS1OBF3fdFasaL3LT/06kDzJ0179 sqf9Ak0wnmTX49Nq83QiXFSUS9Uj2DKwvv8gS6B6TslWYw3Z30JnjOgQRiAekeKUuPGejv 5P7ThvPwkklMu90MjC/So0vMV+meLz86EGMJWbJEVWLw5ROMmWcSaW98+sIW/CNu2s2peC Slsx+m6yf8BrVPDNQy8Q0kT86kZHRTt9XnlhyLwizmnNxTc/jfBtgJSaVz5Hz+3fEsW1EN gWDnHLDcCJWy1eufpEw766XVx1SA+dfcVRHJANhG1IXLbCvABxxcD9/8fiT/sQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xK5Pb9zcZR; Thu, 19 Jan 2023 03:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qLAH025734; Thu, 19 Jan 2023 03:52:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qLrr025733; Thu, 19 Jan 2023 03:52:21 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:21 GMT Message-Id: <202301190352.30J3qLrr025733@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: ef55d4aaceff - stable/13 - if_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: ef55d4aaceff3ea2283373c36b181839b7a36487 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ef55d4aaceff3ea2283373c36b181839b7a36487 commit ef55d4aaceff3ea2283373c36b181839b7a36487 Author: Sumit Saxena AuthorDate: 2022-11-04 22:31:24 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36446 (cherry picked from commit 19a57f85baac915a3642733c8a856517f4e95cb3) --- sys/dev/bnxt/bnxt_hwrm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 40c47ffe372c..9d74b1ebf65b 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -868,6 +868,9 @@ bnxt_hwrm_set_pause_common(struct bnxt_softc *softc, HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX; req->enables |= htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE); + req->auto_pause = req->force_pause; + req->enables |= + htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE); } } From nobody Thu Jan 19 03:52:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xM1grMz2svWy; Thu, 19 Jan 2023 03:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xM0Twtz3jHs; Thu, 19 Jan 2023 03:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mu/uxZaxW9+85hS7juDhnAqWCGdbpsQoK55URrzr0Sg=; b=B8e5RdZqrbeabDKufAdjNUbJJwYLnLM557OFbAO7sUqH1iaKx2wXfIm0Mj1di+CT9N6eID fhCxi+v/H5Lo8WJktMpslwhGRHublWTnssbL46qvkivi7y9ddjZe3CDfIncUri47mlbAX4 8mJNUYvvix6ltdvvVQ4oQhRVAbGSaH5uf9+mey/W+Gj9f0DLlFm+Kvpo3vmKkjmIZzwLRk OQnJK1iR5CmfK6tEsiIOP/v5cjqRCuXMSGhyFKPNI/AtxF2yQZRpcRUlaNGX+ujvQcquBP JWdLi8ifQI+Y0bUZZgGuN7NYME0U00JG0RwdOPuBQk5Zr1brf9h02Dl4ywZcgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mu/uxZaxW9+85hS7juDhnAqWCGdbpsQoK55URrzr0Sg=; b=BflZTWwuvI/wNYIE/TCXF8IsaKJpj5AVfZXNigFPRC3t8+2JGngl3mS3GvsBFEYb5pfvTv wNcvKum1w8vYgACcDm8zVRXOBRcoNcEyJs7dCWwqFNRl3OhDj6lqSJYwvqk7KFZg8FgtEX diNbkX57xMmjJKJrO49LEhz9ZHjsZlqMeuhUysAV+hdfAA9HT7t8nqa1PH//4OpDsVYjs7 Dg8zdPT00A3hmNrimaJ47vC/0dKAB358LY/M5t4tJibvVTKAcKdEf5HkKZnSU3LwifvdUZ u0NQfvnd1vZLRNHICya5uQHjcQf6brYXdi6m53Ckhms2PSSCPQL2QKsf3usGjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100343; a=rsa-sha256; cv=none; b=eKQimm+sYDGNGoW9nnelKy2O4FfGOMONBBN4/nbFSWgwINdiZpnpAKi4BzF4Urd9bKNwRj 5BSSAchpH8nJRgyt//QDPh8J63mdbSj51qbOaKN4/cACY9anpicNCuNKlKcrD3OnN6y55C DVvK2YPWdoQVgb8HPdpCKOrXzz/Ko6og49uPdCm084CneVl2izppWt5GaLaBPOCt/4hk3D Di0U+9e/bhTlUTWScjjYWDxRizXRllEo7GR5LrPQD5fKxcdMspuyduAK5TJHWbqDvzsgzA i+TQdvu3dkpqOfEDCHJ+iawBu78TVxaxos/LyaYO1PjA9yQJlJ67NP/Vw7g0DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xL65Qrzcdv; Thu, 19 Jan 2023 03:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qMH7025758; Thu, 19 Jan 2023 03:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qMtj025757; Thu, 19 Jan 2023 03:52:22 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:22 GMT Message-Id: <202301190352.30J3qMtj025757@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: 74eacab8dc47 - stable/13 - if_bnxt: Add support for smaller backing_store_cfg message 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 74eacab8dc479a343e93c13aa9cff466706b26bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=74eacab8dc479a343e93c13aa9cff466706b26bc commit 74eacab8dc479a343e93c13aa9cff466706b26bc Author: Sumit Saxena AuthorDate: 2022-11-04 22:33:21 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Add support for smaller backing_store_cfg message size Add compat logic to fallback to the older/smaller backing_store_cfg message size. Reviewed by: imp Differentil Revision: https://reviews.freebsd.org/D36447 (cherry picked from commit 2ed061f08d9e2fe35bb8ff925cc19768d2430e77) --- sys/dev/bnxt/bnxt_hwrm.c | 8 ++++++-- sys/dev/bnxt/bnxt_hwrm.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 9d74b1ebf65b..46dd8f34a6c5 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -394,7 +394,7 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) struct hwrm_func_backing_store_cfg_input req = {0}; struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; struct bnxt_ctx_pg_info *ctx_pg; - uint32_t *num_entries; + uint32_t *num_entries, req_len = sizeof(req); uint64_t *pg_dir; uint8_t *pg_attr; int i, rc; @@ -481,7 +481,11 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) *num_entries = htole32(ctx_pg->entries); bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); } - rc = hwrm_send_message(softc, &req, sizeof(req)); + + if (req_len > softc->hwrm_max_ext_req_len) + req_len = BNXT_BACKING_STORE_CFG_LEGACY_LEN; + + rc = hwrm_send_message(softc, &req, req_len); if (rc) rc = -EIO; return rc; diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index 8033ddb50136..dde82c0aaff8 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \ (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE) #define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input) +#define BNXT_BACKING_STORE_CFG_LEGACY_LEN 256 /* HWRM Function Prototypes */ int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc); From nobody Thu Jan 19 03:52:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xN2Q1Cz2svcV; Thu, 19 Jan 2023 03:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xN23frz3jNq; Thu, 19 Jan 2023 03:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CqWBDbT0hzkAvR/KNq5K2KO8btMcdgbeeOjbFBKmLQo=; b=HNbAg1MgKCVaBMngmH9cRFV0OmGeGUQpEd/XiQHHWmJ/L/DvHmNoAPQhbvsEMCKEcv9k3C 0LRy8SqHevyrCioLQr6H2MS1WMB8zRysSgRJgDBprl7oChXqpZOI86ky9UGx07C9LYz3MS JGsVvDQfBQ+HRuOQo+o8/xKM+lEewUNS92tRgX7wkRWaDGLQHB7TSkIQLRAt7CfaL6Nwe1 HudfmDl5GmbuTnFseeVL/Y6HDzRtS7xJFXLQnt7VhJM1PJmWlDhbwPnDzXn4z7Ta1aAgCy noScnp/tbaRMUUWLcTF6aUT0MmcfN5gViDAGSfyKDFvEU3sSD08cEyLeihMYUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CqWBDbT0hzkAvR/KNq5K2KO8btMcdgbeeOjbFBKmLQo=; b=mgqnpMiZpqQcgqb2QhqhtfgUP0xOot6zQqwmKvlDdyQ9P5PAXdMfy/1c0zYWM0PYer7vs5 68lhceCJVaUJDeh9GNRYbOfS0mELzNYsV5AJ6Uu8JQSenRDWxeq/tAZKssSKMmVh46FRA3 /+hzphc9NS1e0NFZXEkp6UxFZFosfpluE6ErDoIK0+dvsyZLDHAXOUgI+m1pISjcJwo0oL PnTDCiOyyCmPp+6KV7Mj/7XtRKL5qcW4pD14IyMXUMtH0BPg8UW6XZp/iVM+JKu8vlbEJL yxiPs//MD00KhD9Nt/J+U4xQjmNdkdalooAzjJJhGbmHpYvht+XjsPSgoGOP3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100344; a=rsa-sha256; cv=none; b=tORHqaI3wPBkaoJscz+P4LOMx7DDAbL2J8gv77QyJvkCtHI1MWgMWzl2/Kd313Pipyx0D3 XZySxkkT4y8Xh9UQyu5ORcsJmIPoK0bqYM+8qQnqDBGs2RoDRErbfCElEHjcsvavhwWj7O hiZupHs4WMQ58snlR8xWrUSQrtEHB+TAN2AiULUs4tEc4zdos6a3VPlLNPevSq8MdxBLYo RhP0qe03aCpCLQXtupRQWbQI4jWizDUg0RJgdZ2mqKtEEFGTpvTHfOc+X514WQMcuY8OBZ O3fhPxnTXAlFaldJXE969zR2Tmiw0wyB/7ybB7yhv2I5sAQokX7FJvsZAJt1Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xM71xrzcfq; Thu, 19 Jan 2023 03:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qN8H025782; Thu, 19 Jan 2023 03:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qNQx025781; Thu, 19 Jan 2023 03:52:23 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:23 GMT Message-Id: <202301190352.30J3qNQx025781@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: 28497d1445db - stable/13 - if_bnxt: Added support for mgmt interface for passthrough hwrms List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 28497d1445dbf7b5e7a858ada1623920a5a76dd1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=28497d1445dbf7b5e7a858ada1623920a5a76dd1 commit 28497d1445dbf7b5e7a858ada1623920a5a76dd1 Author: Sumit Saxena AuthorDate: 2022-11-04 22:40:29 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:07 +0000 if_bnxt: Added support for mgmt interface for passthrough hwrms Added support for application management interface. There are two types of commands supported: 1. Firmware IOCTLs: These ioctls are meant for firmware consumption. Driver acts as a transport for these. 2. Driver only IOCTLs: These ioctls are meant for driver consumption. Driver will serve these ioctls without sending them down to firmware. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36448 (cherry picked from commit 58d84ef87094691bf1ad9608964ec85f120cd34a) --- sys/conf/files | 1 + sys/dev/bnxt/bnxt.h | 13 ++ sys/dev/bnxt/bnxt_hwrm.c | 35 ++++- sys/dev/bnxt/bnxt_hwrm.h | 2 + sys/dev/bnxt/bnxt_mgmt.c | 373 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_mgmt.h | 126 ++++++++++++++++ sys/dev/bnxt/if_bnxt.c | 43 +++++- sys/modules/bnxt/Makefile | 5 +- 8 files changed, 592 insertions(+), 6 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index be8449a92048..d97ad247a7bd 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1397,6 +1397,7 @@ dev/bhnd/siba/siba_erom.c optional siba bhnd dev/bhnd/siba/siba_subr.c optional siba bhnd # dev/bnxt/bnxt_hwrm.c optional bnxt iflib pci +dev/bnxt/bnxt_mgmt.c optional bnxt iflib pci dev/bnxt/bnxt_sysctl.c optional bnxt iflib pci dev/bnxt/bnxt_txrx.c optional bnxt iflib pci dev/bnxt/if_bnxt.c optional bnxt iflib pci diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 0d5824722b41..27abccc6b324 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -208,6 +208,7 @@ __FBSDID("$FreeBSD$"); #define BNXT_MIN_FRAME_SIZE 52 /* Frames must be padded to this size for some A0 chips */ +extern char bnxt_driver_version[]; typedef void (*bnxt_doorbell_tx)(void *, uint16_t idx); typedef void (*bnxt_doorbell_rx)(void *, uint16_t idx); typedef void (*bnxt_doorbell_rx_cq)(void *, bool); @@ -648,14 +649,25 @@ struct bnxt_hw_resc { #define BNXT_HWRM_MAX_REQ_LEN (softc->hwrm_max_req_len) +struct bnxt_softc_list { + SLIST_ENTRY(bnxt_softc_list) next; + struct bnxt_softc *softc; +}; + struct bnxt_softc { device_t dev; if_ctx_t ctx; if_softc_ctx_t scctx; if_shared_ctx_t sctx; + uint32_t domain; + uint32_t bus; + uint32_t slot; + uint32_t function; + uint32_t dev_fn; struct ifmedia *media; struct bnxt_ctx_mem_info *ctx_mem; struct bnxt_hw_resc hw_resc; + struct bnxt_softc_list list; struct bnxt_bar_info hwrm_bar; struct bnxt_bar_info doorbell_bar; @@ -788,5 +800,6 @@ struct bnxt_filter_info { /* Function declarations */ void bnxt_report_link(struct bnxt_softc *softc); bool bnxt_check_hwrm_version(struct bnxt_softc *softc); +struct bnxt_softc *bnxt_find_dev(uint32_t domain, uint32_t bus, uint32_t dev_fn, char *name); #endif /* _BNXT_H */ diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 46dd8f34a6c5..c362e01a1f8b 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -540,6 +540,37 @@ hwrm_func_resc_qcaps_exit: return rc; } +int +bnxt_hwrm_passthrough(struct bnxt_softc *softc, void *req, uint32_t req_len, + void *resp, uint32_t resp_len, uint32_t app_timeout) +{ + int rc = 0; + void *output = (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct input *input = req; + uint32_t old_timeo; + + input->resp_addr = htole64(softc->hwrm_cmd_resp.idi_paddr); + BNXT_HWRM_LOCK(softc); + old_timeo = softc->hwrm_cmd_timeo; + if (input->req_type == HWRM_NVM_INSTALL_UPDATE) + softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO; + else + softc->hwrm_cmd_timeo = max(app_timeout, softc->hwrm_cmd_timeo); + rc = _hwrm_send_message(softc, req, req_len); + softc->hwrm_cmd_timeo = old_timeo; + if (rc) { + device_printf(softc->dev, "%s: %s command failed with rc: 0x%x\n", + __FUNCTION__, GET_HWRM_REQ_TYPE(input->req_type), rc); + goto fail; + } + + memcpy(resp, output, resp_len); +fail: + BNXT_HWRM_UNLOCK(softc); + return rc; +} + + int bnxt_hwrm_ver_get(struct bnxt_softc *softc) { @@ -657,7 +688,6 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) softc->ver_info->chip_bond_id = resp->chip_bond_id; softc->ver_info->chip_type = resp->chip_platform_type; - if (resp->hwrm_intf_maj_8b >= 1) { softc->hwrm_max_req_len = le16toh(resp->max_req_win_len); softc->hwrm_max_ext_req_len = le16toh(resp->max_ext_req_len); @@ -666,8 +696,7 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout); if (!softc->hwrm_cmd_timeo) softc->hwrm_cmd_timeo = DFLT_HWRM_CMD_TIMEOUT; - - + dev_caps_cfg = le32toh(resp->dev_caps_cfg); if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) && (dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED)) diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index dde82c0aaff8..5e2be49b643d 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -129,4 +129,6 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt_softc *softc, bool all); int bnxt_hwrm_reserve_pf_rings (struct bnxt_softc *softc); void bnxt_hwrm_ring_info_get(struct bnxt_softc *softc, uint8_t ring_type, uint32_t ring_id, uint32_t *prod, uint32_t *); +int bnxt_hwrm_passthrough(struct bnxt_softc *softc, void *req, uint32_t req_len, + void *resp, uint32_t resp_len, uint32_t timeout); #endif diff --git a/sys/dev/bnxt/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_mgmt.c new file mode 100644 index 000000000000..d54d7a2a2fe1 --- /dev/null +++ b/sys/dev/bnxt/bnxt_mgmt.c @@ -0,0 +1,373 @@ +/* + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2022 Broadcom, All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * 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 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. + */ + +#include "bnxt_mgmt.h" +#include "bnxt.h" +#include "bnxt_hwrm.h" +#include +#include +#include +#include + +/* Function prototypes */ +static d_open_t bnxt_mgmt_open; +static d_close_t bnxt_mgmt_close; +static d_ioctl_t bnxt_mgmt_ioctl; + +/* Character device entry points */ +static struct cdevsw bnxt_mgmt_cdevsw = { + .d_version = D_VERSION, + .d_open = bnxt_mgmt_open, + .d_close = bnxt_mgmt_close, + .d_ioctl = bnxt_mgmt_ioctl, + .d_name = "bnxt_mgmt", +}; + +/* Global vars */ +static struct cdev *bnxt_mgmt_dev; +struct mtx mgmt_lock; + +MALLOC_DEFINE(M_BNXT, "bnxt_mgmt_buffer", "buffer for bnxt_mgmt module"); + +/* + * This function is called by the kld[un]load(2) system calls to + * determine what actions to take when a module is loaded or unloaded. + */ +static int +bnxt_mgmt_loader(struct module *m, int what, void *arg) +{ + int error = 0; + + switch (what) { + case MOD_LOAD: + error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &bnxt_mgmt_dev, + &bnxt_mgmt_cdevsw, + 0, + UID_ROOT, + GID_WHEEL, + 0600, + "bnxt_mgmt"); + if (error != 0) { + printf("%s: %s:%s:%d Failed to create the" + "bnxt_mgmt device node\n", DRIVER_NAME, + __FILE__, __FUNCTION__, __LINE__); + return (error); + } + + mtx_init(&mgmt_lock, "BNXT MGMT Lock", NULL, MTX_DEF); + + break; + case MOD_UNLOAD: + mtx_destroy(&mgmt_lock); + destroy_dev(bnxt_mgmt_dev); + break; + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +static int +bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, + int flag, struct thread *td) +{ + struct bnxt_softc *softc = NULL; + struct bnxt_mgmt_req mgmt_req = {}; + struct bnxt_mgmt_fw_msg msg_temp, *msg, *msg2 = NULL; + struct iflib_dma_info dma_data = {}; + void *user_ptr, *req, *resp; + int ret = 0; + uint16_t num_ind = 0; + + memcpy(&user_ptr, data, sizeof(user_ptr)); + if (copyin(user_ptr, &mgmt_req, sizeof(struct bnxt_mgmt_req))) { + printf("%s: %s:%d Failed to copy data from user\n", + DRIVER_NAME, __FUNCTION__, __LINE__); + return -EFAULT; + } + softc = bnxt_find_dev(mgmt_req.hdr.domain, mgmt_req.hdr.bus, + mgmt_req.hdr.devfn, NULL); + if (!softc) { + printf("%s: %s:%d unable to find softc reference\n", + DRIVER_NAME, __FUNCTION__, __LINE__); + return -ENODEV; + } + + if (copyin((void*)mgmt_req.req.hreq, &msg_temp, sizeof(msg_temp))) { + device_printf(softc->dev, "%s:%d Failed to copy data from user\n", + __FUNCTION__, __LINE__); + return -EFAULT; + } + + if (msg_temp.len_req > BNXT_MGMT_MAX_HWRM_REQ_LENGTH || + msg_temp.len_resp > BNXT_MGMT_MAX_HWRM_RESP_LENGTH) { + device_printf(softc->dev, "%s:%d Invalid length\n", + __FUNCTION__, __LINE__); + return -EINVAL; + } + + if (msg_temp.num_dma_indications > 1) { + device_printf(softc->dev, "%s:%d Max num_dma_indications " + "supported is 1 \n", __FUNCTION__, __LINE__); + return -EINVAL; + } + + req = malloc(msg_temp.len_req, M_BNXT, M_WAITOK | M_ZERO); + if(!req) { + device_printf(softc->dev, "%s:%d Memory allocation failed", + __FUNCTION__, __LINE__); + return -ENOMEM; + } + + resp = malloc(msg_temp.len_resp, M_BNXT, M_WAITOK | M_ZERO); + if(!resp) { + device_printf(softc->dev, "%s:%d Memory allocation failed", + __FUNCTION__, __LINE__); + ret = -ENOMEM; + goto end; + } + + if (copyin((void *)msg_temp.usr_req, req, msg_temp.len_req)) { + device_printf(softc->dev, "%s:%d Failed to copy data from user\n", + __FUNCTION__, __LINE__); + ret = -EFAULT; + goto end; + } + + msg = &msg_temp; + num_ind = msg_temp.num_dma_indications; + if (num_ind) { + int size; + void *dma_ptr; + uint64_t *dmap; + + size = sizeof(struct bnxt_mgmt_fw_msg) + + (num_ind * sizeof(struct dma_info)); + + msg2 = malloc(size, M_BNXT, M_WAITOK | M_ZERO); + if(!msg2) { + device_printf(softc->dev, "%s:%d Memory allocation failed", + __FUNCTION__, __LINE__); + ret = -ENOMEM; + goto end; + } + + if (copyin((void *)mgmt_req.req.hreq, msg2, size)) { + device_printf(softc->dev, "%s:%d Failed to copy" + "data from user\n", __FUNCTION__, __LINE__); + ret = -EFAULT; + goto end; + } + msg = msg2; + + ret = iflib_dma_alloc(softc->ctx, msg->dma[0].length, &dma_data, + BUS_DMA_NOWAIT); + if (ret) { + device_printf(softc->dev, "%s:%d iflib_dma_alloc" + "failed with ret = 0x%x\n", __FUNCTION__, + __LINE__, ret); + ret = -ENOMEM; + goto end; + } + + if (!(msg->dma[0].read_or_write)) { + if (copyin((void *)msg->dma[0].data, + dma_data.idi_vaddr, + msg->dma[0].length)) { + device_printf(softc->dev, "%s:%d Failed to copy" + "data from user\n", __FUNCTION__, + __LINE__); + ret = -EFAULT; + goto end; + } + } + dma_ptr = (void *) ((uint64_t) req + msg->dma[0].offset); + dmap = dma_ptr; + *dmap = htole64(dma_data.idi_paddr); + } + + ret = bnxt_hwrm_passthrough(softc, req, msg->len_req, resp, msg->len_resp, msg->timeout); + if(ret) + goto end; + + if (num_ind) { + if ((msg->dma[0].read_or_write)) { + if (copyout(dma_data.idi_vaddr, + (void *)msg->dma[0].data, + msg->dma[0].length)) { + device_printf(softc->dev, "%s:%d Failed to copy data" + "to user\n", __FUNCTION__, __LINE__); + ret = -EFAULT; + goto end; + } + } + } + + if (copyout(resp, (void *) msg->usr_resp, msg->len_resp)) { + device_printf(softc->dev, "%s:%d Failed to copy response to user\n", + __FUNCTION__, __LINE__); + ret = -EFAULT; + goto end; + } + +end: + if (req) + free(req, M_BNXT); + if (resp) + free(resp, M_BNXT); + if (msg2) + free(msg2, M_BNXT); + if (dma_data.idi_paddr) + iflib_dma_free(&dma_data); + return ret; +} + +static int +bnxt_mgmt_get_dev_info(struct cdev *dev, u_long cmd, caddr_t data, + int flag, struct thread *td) +{ + struct bnxt_softc *softc = NULL; + struct bnxt_dev_info dev_info; + void *user_ptr; + uint32_t dev_sn_lo, dev_sn_hi; + int dev_sn_offset = 0; + char dsn[16]; + uint16_t lnk; + int capreg; + + memcpy(&user_ptr, data, sizeof(user_ptr)); + if (copyin(user_ptr, &dev_info, sizeof(dev_info))) { + printf("%s: %s:%d Failed to copy data from user\n", + DRIVER_NAME, __FUNCTION__, __LINE__); + return -EFAULT; + } + + softc = bnxt_find_dev(0, 0, 0, dev_info.nic_info.dev_name); + if (!softc) { + printf("%s: %s:%d unable to find softc reference\n", + DRIVER_NAME, __FUNCTION__, __LINE__); + return -ENODEV; + } + + strncpy(dev_info.nic_info.driver_version, bnxt_driver_version, 64); + strncpy(dev_info.nic_info.driver_name, device_get_name(softc->dev), 64); + dev_info.pci_info.domain_no = softc->domain; + dev_info.pci_info.bus_no = softc->bus; + dev_info.pci_info.device_no = softc->slot; + dev_info.pci_info.function_no = softc->function; + dev_info.pci_info.vendor_id = pci_get_vendor(softc->dev); + dev_info.pci_info.device_id = pci_get_device(softc->dev); + dev_info.pci_info.sub_system_vendor_id = pci_get_subvendor(softc->dev); + dev_info.pci_info.sub_system_device_id = pci_get_subdevice(softc->dev); + dev_info.pci_info.revision = pci_read_config(softc->dev, PCIR_REVID, 1); + dev_info.pci_info.chip_rev_id = (dev_info.pci_info.device_id << 16); + dev_info.pci_info.chip_rev_id |= dev_info.pci_info.revision; + if (pci_find_extcap(softc->dev, PCIZ_SERNUM, &dev_sn_offset)) { + device_printf(softc->dev, "%s:%d device serial number is not found" + "or not supported\n", __FUNCTION__, __LINE__); + } else { + dev_sn_lo = pci_read_config(softc->dev, dev_sn_offset + 4, 4); + dev_sn_hi = pci_read_config(softc->dev, dev_sn_offset + 8, 4); + snprintf(dsn, sizeof(dsn), "%02x%02x%02x%02x%02x%02x%02x%02x", + (dev_sn_lo & 0x000000FF), + (dev_sn_lo >> 8) & 0x0000FF, + (dev_sn_lo >> 16) & 0x00FF, + (dev_sn_lo >> 24 ) & 0xFF, + (dev_sn_hi & 0x000000FF), + (dev_sn_hi >> 8) & 0x0000FF, + (dev_sn_hi >> 16) & 0x00FF, + (dev_sn_hi >> 24 ) & 0xFF); + strncpy(dev_info.nic_info.device_serial_number, dsn, sizeof(dsn)); + } + + if_t ifp = iflib_get_ifp(softc->ctx); + dev_info.nic_info.mtu = ifp->if_mtu; + memcpy(dev_info.nic_info.mac, softc->func.mac_addr, ETHER_ADDR_LEN); + + if (pci_find_cap(softc->dev, PCIY_EXPRESS, &capreg)) { + device_printf(softc->dev, "%s:%d pci link capability is not found" + "or not supported\n", __FUNCTION__, __LINE__); + } else { + lnk = pci_read_config(softc->dev, capreg + PCIER_LINK_STA, 2); + dev_info.nic_info.pci_link_speed = (lnk & PCIEM_LINK_STA_SPEED); + dev_info.nic_info.pci_link_width = (lnk & PCIEM_LINK_STA_WIDTH) >> 4; + } + + if (copyout(&dev_info, user_ptr, sizeof(dev_info))) { + device_printf(softc->dev, "%s:%d Failed to copy data to user\n", + __FUNCTION__, __LINE__); + return -EFAULT; + } + + return 0; +} + +/* + * IOCTL entry point. + */ +static int +bnxt_mgmt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, + struct thread *td) +{ + int ret = 0; + + switch(cmd) { + case BNXT_MGMT_OPCODE_GET_DEV_INFO: + ret = bnxt_mgmt_get_dev_info(dev, cmd, data, flag, td); + break; + case BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM: + mtx_lock(&mgmt_lock); + ret = bnxt_mgmt_process_hwrm(dev, cmd, data, flag, td); + mtx_unlock(&mgmt_lock); + break; + default: + printf("%s: Unknown command 0x%lx\n", DRIVER_NAME, cmd); + ret = -EINVAL; + break; + } + + return ret; +} + +static int +bnxt_mgmt_close(struct cdev *dev, int flags, int devtype, struct thread *td) +{ + return (0); +} + +static int +bnxt_mgmt_open(struct cdev *dev, int flags, int devtype, struct thread *td) +{ + return (0); +} + +DEV_MODULE(bnxt_mgmt, bnxt_mgmt_loader, NULL); + diff --git a/sys/dev/bnxt/bnxt_mgmt.h b/sys/dev/bnxt/bnxt_mgmt.h new file mode 100644 index 000000000000..f130ad386809 --- /dev/null +++ b/sys/dev/bnxt/bnxt_mgmt.h @@ -0,0 +1,126 @@ +/* + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2022 Broadcom, All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * 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 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. + */ + +#include "bnxt.h" +#include +#include +#include +#include +#include +#include +#include +#include + + +#define DRIVER_NAME "if_bnxt" + +#define BNXT_MGMT_OPCODE_GET_DEV_INFO 0x80000000 +#define BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM 0x80000001 + +#define BNXT_MGMT_MAX_HWRM_REQ_LENGTH HWRM_MAX_REQ_LEN +#define BNXT_MGMT_MAX_HWRM_RESP_LENGTH (512) + +struct bnxt_nic_info { +#define BNXT_MAX_STR 64 + char dev_name[BNXT_MAX_STR]; + char driver_version[BNXT_MAX_STR]; + char driver_name[BNXT_MAX_STR]; + char device_serial_number[64]; + uint32_t mtu; + uint8_t mac[ETHER_ADDR_LEN]; + uint32_t pci_link_speed; + uint32_t pci_link_width; + uint32_t rsvd[4]; +} __packed; + +struct bnxt_pci_info { + uint16_t domain_no; + uint16_t bus_no; + uint16_t device_no; + uint16_t function_no; + uint16_t vendor_id; + uint16_t device_id; + uint16_t sub_system_vendor_id; + uint16_t sub_system_device_id; + uint16_t revision; + uint32_t chip_rev_id; + uint32_t rsvd[2]; +} __packed; + +struct bnxt_dev_info { + struct bnxt_nic_info nic_info; + struct bnxt_pci_info pci_info; +} __packed; + +struct dma_info { + uint64_t data; + uint32_t length; + uint16_t offset; + uint8_t read_or_write; + uint8_t unused; +}; + +struct bnxt_mgmt_fw_msg { + uint64_t usr_req; + uint64_t usr_resp; + uint32_t len_req; + uint32_t len_resp; + uint32_t timeout; + uint32_t num_dma_indications; + struct dma_info dma[0]; +}; + +struct bnxt_mgmt_generic_msg { + uint8_t key; +#define BNXT_LFC_KEY_DOMAIN_NO 1 + uint8_t reserved[3]; + uint32_t value; +}; + +enum bnxt_mgmt_req_type { + BNXT_MGMT_NVM_GET_VAR_REQ = 1, + BNXT_MGMT_NVM_SET_VAR_REQ, + BNXT_MGMT_NVM_FLUSH_REQ, + BNXT_MGMT_GENERIC_HWRM_REQ, +}; + +struct bnxt_mgmt_req_hdr { + uint32_t ver; + uint32_t domain; + uint32_t bus; + uint32_t devfn; + enum bnxt_mgmt_req_type req_type; +}; + +struct bnxt_mgmt_req { + struct bnxt_mgmt_req_hdr hdr; + union { + uint64_t hreq; + } req; +}; + diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 8b26b4d64436..d6cb4d613c96 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "bnxt_ioctl.h" #include "bnxt_sysctl.h" #include "hsi_struct_def.h" +#include "bnxt_mgmt.h" /* * PCI Device ID Table @@ -159,6 +160,9 @@ static pci_vendor_info_t bnxt_vendor_info_array[] = * Function prototypes */ +SLIST_HEAD(softc_list, bnxt_softc_list) pf_list; +int bnxt_num_pfs = 0; + static void *bnxt_register(device_t dev); /* Soft queue setup and teardown */ @@ -297,7 +301,7 @@ static driver_t bnxt_iflib_driver = { * iflib shared context */ -#define BNXT_DRIVER_VERSION "1.0.0.2" +#define BNXT_DRIVER_VERSION "2.20.0.1" char bnxt_driver_version[] = BNXT_DRIVER_VERSION; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { @@ -1203,6 +1207,28 @@ static void bnxt_thor_db_nq(void *db_ptr, bool enable_irq) BUS_SPACE_BARRIER_WRITE); } +struct bnxt_softc *bnxt_find_dev(uint32_t domain, uint32_t bus, uint32_t dev_fn, char *dev_name) +{ + struct bnxt_softc_list *sc = NULL; + + SLIST_FOREACH(sc, &pf_list, next) { + /* get the softc reference based on device name */ + if (dev_name && !strncmp(dev_name, iflib_get_ifp(sc->softc->ctx)->if_xname, BNXT_MAX_STR)) { + return sc->softc; + } + /* get the softc reference based on domain,bus,device,function */ + if (!dev_name && + (domain == sc->softc->domain) && + (bus == sc->softc->bus) && + (dev_fn == sc->softc->dev_fn)) { + return sc->softc; + + } + } + + return NULL; +} + /* Device setup and teardown */ static int bnxt_attach_pre(if_ctx_t ctx) @@ -1242,6 +1268,19 @@ bnxt_attach_pre(if_ctx_t ctx) break; } +#define PCI_DEVFN(device, func) ((((device) & 0x1f) << 3) | ((func) & 0x07)) + softc->domain = pci_get_domain(softc->dev); + softc->bus = pci_get_bus(softc->dev); + softc->slot = pci_get_slot(softc->dev); + softc->function = pci_get_function(softc->dev); + softc->dev_fn = PCI_DEVFN(softc->slot, softc->function); + + if (bnxt_num_pfs == 0) + SLIST_INIT(&pf_list); + bnxt_num_pfs++; + softc->list.softc = softc; + SLIST_INSERT_HEAD(&pf_list, &softc->list, next); + pci_enable_busmaster(softc->dev); if (bnxt_pci_mapping(softc)) @@ -1575,6 +1614,8 @@ bnxt_detach(if_ctx_t ctx) struct bnxt_vlan_tag *tmp; int i; + SLIST_REMOVE(&pf_list, &softc->list, bnxt_softc_list, next); + bnxt_num_pfs--; bnxt_wol_config(ctx); bnxt_do_disable_intr(&softc->def_cp_ring); bnxt_free_sysctl_ctx(softc); diff --git a/sys/modules/bnxt/Makefile b/sys/modules/bnxt/Makefile index 861a0b4c4d4a..f27e9934034e 100644 --- a/sys/modules/bnxt/Makefile +++ b/sys/modules/bnxt/Makefile @@ -6,8 +6,9 @@ KMOD = if_bnxt SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += bnxt_txrx.c if_bnxt.c -SRCS += bnxt_hwrm.c bnxt_hwrm.h -SRCS += bnxt_sysctl.c bnxt_sysctl.h +SRCS += bnxt_hwrm.c +SRCS += bnxt_sysctl.c +SRCS += bnxt_mgmt.c CFLAGS+= -DIFLIB From nobody Thu Jan 19 03:52:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xP272Rz2svhc; Thu, 19 Jan 2023 03:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xP1f9lz3jDT; Thu, 19 Jan 2023 03:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61J0aNzy4EelEy5svob1BOrO/FtoqWlfR6pkAcNWGww=; b=FRByYHMQYmCGGyOS2zJABPZzHCgpUaPbuR7P6bnlOfjsKHZfEYPQSYcS8GeIOW5KdSp4Sa +DBeogUvaQVd5Skp97WvqgeoxVLFEmX7/VQeeMJIEQSFYPv7jLcGTjHsPufADaqNYn4Nq+ 5/woZzRyX9gExYsXqLtaHIDbSCmelyLfrKITYsdM0DqSrG1fi+qN8v1HWpIg0wxkLrshwH 86o0d0ndlNe7DB6zvZUV/R8M70juAXrSQIj5gc6ir2CImdrCxUjDSB/FMgF4hOeJzumO8d RbATMQox3UaUa9mEUxHM1xlVCRl0k8PtJs7ECXvzjZaDESq9rLR+cWkYzKmIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61J0aNzy4EelEy5svob1BOrO/FtoqWlfR6pkAcNWGww=; b=TaEHVwww9alNTTiEQeWlZVd1os7TNsGIzUfqAbMYoH158dN4x8IbT9BZs7EwxmuFTJwoP5 go7uQzTLMPGFBnuOiUoa5NImM7TnPYhJ5lvANh8PYxA4X0vXHIiljm2V9tczSxCtVgvm51 Hu28mBxqxCrFhmIocFt+GLUTaDBrAqFc1SBBjx3qn2KCynrt1Bc9P/RapFDpIjTA+z3m6O mnaYxTVX/yspeiBRVb3mpaiQEVsRGmay5Ge5oLKzgcQe7QTvtbQG3NZsn1gBzoEl4HbQkv SfrMGnRUMqbJILv/fVZA2gcHx3+C6eFabI4VrtfNY+4RY8Rb7iRHNYZFdILktA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100345; a=rsa-sha256; cv=none; b=i1lvke2hEmpASJzI3bJgkQMh1VCg5xxJXoCXfs2FxnLfNkuWKeK5qjGoX5atXCjTb52mJ9 uHBjoEgQBkdq9IN1v25nkGsmVCj4ZetX13I8Uavv5vZoscVEbXIu/fJTYiRIChI3MFdH4b OcIhCt/tp4y3GQFswvPop8JL0577iI3hid5eWlf27BBBfOxD+TrLGOQxyVdKZviEeWzXn/ YCZp4BCc3WkAtY2a+M088AO+6HtB5CdfpbHv7HmoYYEr1tTGLBYU/nxXa1IWdCg7eznG8P L/fm8kPZq4nuBNKxWxWa+k6si9KjHOBkB4C/sZxBNrsOkfYW3a31yF3neWwprQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xP0YFTzcPc; Thu, 19 Jan 2023 03:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qOiE025807; Thu, 19 Jan 2023 03:52:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qOSc025806; Thu, 19 Jan 2023 03:52:24 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:24 GMT Message-Id: <202301190352.30J3qOSc025806@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: 05410bd672c7 - stable/13 - bnxt: Only filter out i386 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 05410bd672c74eaa348ffd481ac5ad2a995ce184 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=05410bd672c74eaa348ffd481ac5ad2a995ce184 commit 05410bd672c74eaa348ffd481ac5ad2a995ce184 Author: Warner Losh AuthorDate: 2022-11-05 04:35:37 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:02:26 +0000 bnxt: Only filter out i386 Only i386 is missing bus_read_8. The other 32-bit platforms can be fixed with a cast to a printf. Suggested by: kevans Sponsored by: Netflix (cherry picked from commit eb40e3e757a7eb80c2b5c38ce05fc4b411b369f9) --- sys/dev/bnxt/bnxt_hwrm.c | 2 +- sys/modules/Makefile | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index c362e01a1f8b..efea33327dc7 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -1483,7 +1483,7 @@ bnxt_hwrm_l2_filter_alloc(struct bnxt_softc *softc, uint16_t vlan_tag, if (*filter_id != -1) { device_printf(softc->dev, "Attempt to re-allocate l2 ctx " - "filter (fid: 0x%lx)\n", *filter_id); + "filter (fid: 0x%jx)\n", (uintmax_t)*filter_id); return EDOOFUS; } diff --git a/sys/modules/Makefile b/sys/modules/Makefile index a1521c48a1f7..53936d77d6ff 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -69,7 +69,7 @@ SUBDIR= \ ${_bxe} \ ${_bios} \ ${_blake2} \ - bnxt \ + ${_bnxt} \ bridgestp \ bwi \ bwn \ @@ -428,6 +428,11 @@ SUBDIR+= dtrace SUBDIR+= opensolaris .endif +# Requires bus_space_read_8 +.if ${MACHINE_ARCH} != "i386" +_bnxt= bnxt +.endif + .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if exists(${SRCTOP}/sys/opencrypto) _crypto= crypto From nobody Thu Jan 19 03:58:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny84k0L3Mz2sw0R; Thu, 19 Jan 2023 03:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny84j6qm5z3mjB; Thu, 19 Jan 2023 03:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgp013iOt5LF2YGvOKFySbrTIJIG20uFEYk7Yf/PjW0=; b=ZP38X5JYQCgAx2B7KKFgnEQEh2WjsmFDPB1tXtBYOKJ+HWX+8CJete3BbiN7a1u3qtm3NC IPX/tJAIs2SMSI6begnLUufuiRW2U/l3n/HxCoKbtsj1HAVTAyvzymz0ZAR8Ozl1PmNc/F L0kK1rQnyAdcLQQAKhP+JY4sYN5Jad099aqjpDXYrbivsqwtvZmEBeua4ImLObWYN4gg0/ 8jD+GAEA91q5ClrRtY0advY4W5lcdxzW3UWu3NSFDYh43MEhUyyHI9XzvHt7UNoikRbzHd EHsgZWA5NF2iIuZJtyuazCCsNLod1W6r9jmXBiVSb19ifnsCpKEcjv72xb/uRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgp013iOt5LF2YGvOKFySbrTIJIG20uFEYk7Yf/PjW0=; b=f9Y+EVf6zk9eFaYsP7shWOv8rTR7ec7KNvoxkB8v8II/4YMRpxM/H+rJSRShk2u4q4lTDT TZR9eafeXm4p4K5Jp2+1k/wWJ1LQJbLHDyW4car6ujg0+8lmQRqgbvyDjRtUaUXO8dMMaf Tr7mqEHJsSd1rL/TRjwYXlAB6vLxjmlNwt/Ul1mMmUhTGJ89YFGtVfaJ1KiwtwGZvoIhMs L7I6pq0BGo5jWtib8JchrA3gzuCES68sMshfeBC2qhSzz9rL2T/Jkuw6A6k+cu3CiDfG4Y 2lIFUndDMC+ejIhgkjtcws7nkXQ840ATivVfdrGCxM9P8dB3ZTJ6N+CNLgn8rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100726; a=rsa-sha256; cv=none; b=qI70tXQJCy5uVbarp/q1pgYoC57/ORzUY5SqcrjmDqIOhRsrgjfJNnY3FYnaHFh8YL78BA e8/+bzoueYsmxOebR6vT2TFmCW1Pj8q6Iio1HOO6bvPKGzw+g4nnZlr7jezZvzoeIDkhpT 2roqbrC9a8bfaRMgF7xiNHoy0hovdKNxI3j0nYxnyjGW4fiCHvPfcGlwgoYxUD+964dmGi iSgbPwW3e51FKX4iLv4IYtxlgn4IYMnmVMypooiWpYYelqDmZjJBfVd6rWNwyAjs5f0hzm BLOp2LPTN9Qdb3JleDSacrbzdbUQR9wfSG3g/JHx+A4/mnKM/khcr23AnmdwDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny84j5sqDzcg1; Thu, 19 Jan 2023 03:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3wjkI027821; Thu, 19 Jan 2023 03:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3wjwW027820; Thu, 19 Jan 2023 03:58:45 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:58:45 GMT Message-Id: <202301190358.30J3wjwW027820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: 5a4a83fd0e67 - main - Improve debuggability of VOP_* locking assertions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a4a83fd0e67a0d7787d2f3e09ef0e5552a1ffb6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=5a4a83fd0e67a0d7787d2f3e09ef0e5552a1ffb6 commit 5a4a83fd0e67a0d7787d2f3e09ef0e5552a1ffb6 Author: Jason A. Harmening AuthorDate: 2023-01-16 20:07:19 +0000 Commit: Jason A. Harmening CommitDate: 2023-01-19 04:11:05 +0000 Improve debuggability of VOP_* locking assertions Include the phase and argument field to make it easier to determine at a glance where the failure originated. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D38091 --- sys/tools/vnode_if.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 486f0e6b2ce1..415c33c52420 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -73,14 +73,14 @@ function add_debug_code(name, arg, pos, ind) else star = ""; if (lockdata[name, arg, pos] && (lockdata[name, arg, pos] != "-")) { - printc(ind"ASSERT_VI_UNLOCKED("star"a->a_"arg", \""uname"\");"); + printc(ind"ASSERT_VI_UNLOCKED("star"a->a_"arg", \""uname" "pos" ("arg")\");"); # Add assertions for locking if (lockdata[name, arg, pos] == "L") - printc(ind"ASSERT_VOP_LOCKED(" star "a->a_"arg", \""uname"\");"); + printc(ind"ASSERT_VOP_LOCKED(" star "a->a_"arg", \""uname" "pos" ("arg")\");"); else if (lockdata[name, arg, pos] == "U") - printc(ind"ASSERT_VOP_UNLOCKED(" star "a->a_"arg", \""uname"\");"); + printc(ind"ASSERT_VOP_UNLOCKED(" star "a->a_"arg", \""uname" "pos" ("arg")\");"); else if (lockdata[name, arg, pos] == "E") - printc(ind"ASSERT_VOP_ELOCKED(" star "a->a_"arg", \""uname"\");"); + printc(ind"ASSERT_VOP_ELOCKED(" star "a->a_"arg", \""uname" "pos" ("arg")\");"); else if (0) { # XXX More checks! } From nobody Thu Jan 19 06:42:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyCk63vjfz2v1lZ; Thu, 19 Jan 2023 06:42:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyCk63Rp3z3xsP; Thu, 19 Jan 2023 06:42:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674110574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2E6qvyfAOfOlKNEqRZw74w1QBGAqpXAdl64Med+tWoY=; b=HgrBFx4axtwwRe8ZZnR6oFJl5ALF1cozZO4KkA27hvK3MESKMpjW2q/HUdKEvQHwsHWUWu hIZt22I8RUoMB/dXNlzh4WFspciN9fv7WE4YOmXuI/A068k/o2lOxXti/TUsiZx8XmbE2A 8if39ZQvz6T1kW+I70dBxDmdH2zPzuQyNx7+bhoI8TKaz9RYa800Nb4z4d0CuxD677viqG mArVqCNI5CYb8QQ1atIldas6PS0C6kiI0AdzNLc9ibZsBHiV2+Pqi7xTbSPUGXtfEVDfBz hSh06Jn2trLii4X1DBz4mCdVqBtiGSk/yrxB5l6VPExzsx7o1C33bMZiCMeDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674110574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2E6qvyfAOfOlKNEqRZw74w1QBGAqpXAdl64Med+tWoY=; b=LAH8yuRGMsizsDCt22IqyRiOFLecB6fiTfs7D1+rUOWSAiwdRCxnfhVM5DGg33qRV3EIET XKRSuj8hvI99BQDaQi2Wbk50FUewa6SSDhyUD9i5qmdqdUaxXsD9K+biNmITu9t5HAGAa/ IrG+bcL906E91d5Kal1bIwaQ0vVy30hjJeDAPjwdOIWlPHSJ5K+UuAA5WPHsWocmNlkpjD m3v40o7HWt/eKxS/w4r0NlhriZzyqTqyxmNNh3HCBvlXMOkqkQN+IHRxAQu5P5nWRZ0W6Q PZ1xLcjYpsN49q8eUS92pVcsdlU9tnPC0c+T6EeY1hbJmzCLLeABL/K20Mk70g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674110574; a=rsa-sha256; cv=none; b=iF3ELheRBO5P/LU+PDFGH4oshnZtvFvds5SyBmep/RirqAkD5vrQ6Vsi7AiZd/xRH1dBAj jH3gjudyucndgneBIz+II6IiRcABpXn8r9eiqVdLMhT4kNCP21/28FeluPGzTTWYD4ovjl b5H5eNrgts3Oq5wzKdXVucODJPvWudSWhz6I0ARweG1xasDLSm1tfD1AtomNu8nWHbiwst iSMNg3Ws2wyxjQzBPcISuZHuxkARt3bt6FH8cGD8FuafrKhhKDLcYtF9Wv0IdLhsqZxvgm nL+SJQiDFhetTAsqkRBhhZUNxsdcvbbJO2uHTjsX2Fi9URxFXpOVgYDfX4WxLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyCk62WHHzh87; Thu, 19 Jan 2023 06:42:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J6gsxU069150; Thu, 19 Jan 2023 06:42:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J6gsq3069149; Thu, 19 Jan 2023 06:42:54 GMT (envelope-from git) Date: Thu, 19 Jan 2023 06:42:54 GMT Message-Id: <202301190642.30J6gsq3069149@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 5648f730c0cc - stable/13 - x86: ignore stepping for APL30 errata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5648f730c0cc4c4836e265087199971bac256d7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=5648f730c0cc4c4836e265087199971bac256d7f commit 5648f730c0cc4c4836e265087199971bac256d7f Author: Corvin Köhne AuthorDate: 2022-08-09 07:07:59 +0000 Commit: Corvin Köhne CommitDate: 2023-01-19 06:42:41 +0000 x86: ignore stepping for APL30 errata The issue is present in all apollolake cpus and it doesn't look like there'll be a fix in the future. See https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-celeron-n-series-j-series-datasheet-spec-update.pdf MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37621 (cherry picked from commit 122405c9034b624dd6771d578ef2467aa96cc145) x86: Remove redundant parentheses Reported by: avg Sponsored by: Beckhoff Automation GmbH & Co. KG MFC after: 1 week MFC-With: b223c1f1a0ac ("x86: Add another cpuid for Apollo Lake errata APL30") (cherry picked from commit 821b850a3bb73a78eef97ea22d1dc6ea82195b65) x86: Add another cpuid for Apollo Lake errata APL30 Sponsored by: Beckhoff Automation GmbH & Co. KG MFC after: 1 week (cherry picked from commit b223c1f1a0ac83a3bd1475add9b794bad1749b2f) --- sys/x86/x86/cpu_machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index 1ec3fb669d01..37db1e85a374 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -827,7 +827,8 @@ cpu_idle_tun(void *unused __unused) mwait_cpustop_broken = true; } - if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_id == 0x506c9) { + if (cpu_vendor_id == CPU_VENDOR_INTEL && + CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) == 0x5c) { /* * Apollo Lake errata APL31 (public errata APL30). * Stores to the armed address range may not trigger From nobody Thu Jan 19 13:11:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNLC3PmZz2stCJ; Thu, 19 Jan 2023 13:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNLC2ghWz3FHs; Thu, 19 Jan 2023 13:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674133875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUaLMXFcolU38BU7uQbo43yRU67D3uki+KBQ46HnZLk=; b=yLirf95cFJyKz9Lt9BfJdnr5dIA1zyB7jNgH3elO8NP3BnQkLAhJvjEQFh2f3RGbIm9HUQ 2UJT7ofFDA1l4du17qU+HWhkxw3oh5NtAwxtGJVPjavw7HN1ffvLwZ6YgSU53lTit0pFYn ykzc3jVBQW+D+tz156jMGeVSNm6AN9nuV7PmPeSwGyTBm4cRFqb7ot+gwzEbYkb+NcN3zh iGGmuzYZe7SCsKNCPh16PvukCn+ypV4hLGLE6bcJCw+mFfs/RrHsE0fYiwY3kfuQwjMA97 Gtgd8qFjPTUAI0R8IkPdVnGnR+Y0H5wOdR9y3mElw/aqyOUnyw/mlcXWTfNhfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674133875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUaLMXFcolU38BU7uQbo43yRU67D3uki+KBQ46HnZLk=; b=SiI969QZ0F7P0MsmV6lOY6WleiS8jGL0WW5xkJfsH4MUUi7vsHIm68xVKKIR91xwZ9fs8f XLSbd58N6Yo+GcwlqQ4/DCGE1NufCKvBZWD6oimZpBmuQbn2S8vpok94gyqZmWGcbMw00P Qkp756Y0l5S0dHxg7DPVtgLv62zMWGBCa4a1oAUGB8qPEOGVbfjSr/NlqMA6xOzAT1wxdN BLYJ+YBg46Dk9SO135B7oGAXbJZeCp6KCs9fPI4aIzJwsyFTI7CyO30DMALz/wKyX8ErM+ gMUNymTOLyka8Mkq+gZmpfRzIPp/ZsJjWqXQH9ozR1a5NTSmEk4JXZNaHaSyrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674133875; a=rsa-sha256; cv=none; b=c5XfOmBxgZE3GWeG7q/GbgPdxSAyIGrGkHGgS3eVYct6E8grizJm+t8SNOQMMkLw1gQY1Q X1TlsalK3XUYJQYBONUSzSA8OTtr8vjI2MtI80kTmddBBdhyRaXsYcYYe0/xaT9H5g2/1w /Fb81LneuCbrKjZut4vqiEV7TTs4lvRL5RdeMlYm02IUSIksvTYY8KCkPyWabXAJCZM/JT UgjsmXM3IE5NSm+dTIL4VviqrDGl2CdXPCthmz2Vnmwn/SvQXXw5sftMdkgGrFHIoPi7tF Vm9bxlGYEOjre1y9aNL8EgcVrVd/dU33PMc6xwlkhWNqBBYQcJ+2Ba7wdcMG4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNLC1lxGzrbx; Thu, 19 Jan 2023 13:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDBFb8020217; Thu, 19 Jan 2023 13:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDBFTx020216; Thu, 19 Jan 2023 13:11:15 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:11:15 GMT Message-Id: <202301191311.30JDBFTx020216@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: 73e994a99810 - main - extra_tcp_stacks: Fix a common typo 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 73e994a99810edf519d85e96dcb4a56e57be25cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=73e994a99810edf519d85e96dcb4a56e57be25cc commit 73e994a99810edf519d85e96dcb4a56e57be25cc Author: Gordon Bergling AuthorDate: 2023-01-19 13:11:00 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:11:00 +0000 extra_tcp_stacks: Fix a common typo in source code comments - s/orginal/original/ MFC after: 3 days --- sys/netinet/tcp_stacks/bbr.c | 2 +- sys/netinet/tcp_stacks/rack.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 4f74fdd1dd76..1080d53116b4 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -6924,7 +6924,7 @@ bbr_log_sack_passed(struct tcpcb *tp, TAILQ_FOREACH_REVERSE_FROM(nrsm, &bbr->r_ctl.rc_tmap, bbr_head, r_tnext) { if (nrsm == rsm) { - /* Skip orginal segment he is acked */ + /* Skip original segment he is acked */ continue; } if (nrsm->r_flags & BBR_ACKED) { diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index a9eccfac1878..25a4f8dd3197 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -5659,7 +5659,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tcpcb *tp, uint32_t cts, * (or now) pacing time set. We want to * slow down the processing of sacks by some * amount (if it is an attacker). Set the default - * slot for attackers in place (unless the orginal + * slot for attackers in place (unless the original * interval is longer). Its stored in * micro-seconds, so lets convert to msecs. */ @@ -7974,7 +7974,7 @@ rack_log_sack_passed(struct tcpcb *tp, TAILQ_FOREACH_REVERSE_FROM(nrsm, &rack->r_ctl.rc_tmap, rack_head, r_tnext) { if (nrsm == rsm) { - /* Skip orginal segment he is acked */ + /* Skip original segment he is acked */ continue; } if (nrsm->r_flags & RACK_ACKED) { From nobody Thu Jan 19 13:13:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNNZ4DrFz2stpM; Thu, 19 Jan 2023 13:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNNZ3fj8z3FV3; Thu, 19 Jan 2023 13:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674133998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4QmG5+t+7sFuRGUaXxTZUv1B5196ByqEqlonSh6zSBE=; b=U4duBuxwVZi8535hLD2Y7L0DlbL+VLcSQbizvrnaadFY/N/eXFXc19fSr3eOENfNEKb9zC QuMOB5lDxIRjBQR/PQh4n7E86MP8G3L/MAYp4TDIO02sLTt9RDuT+yRX/BKI23z2ppL8St QI1E0sdokH2GiPT+WTI5FzR+Ute5mWcf8YbpqoLQksbryYXFbgva6wtZtpar9bOCocrR8f 2VHINpkLgfTqpn87puOOOAXtvvYSgkGqCfNXTKd7ALD6HMRMibZfOH+i8ML7cze1XdTzgP odJJN3I2WrHMaT5l4ihjQc38yn2hlmdEDPZ8KV8qq9DLUtTk1t40tgAXyMLK1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674133998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4QmG5+t+7sFuRGUaXxTZUv1B5196ByqEqlonSh6zSBE=; b=TGuKIbfK60SDJelk2KkKlLiapCcXfwVYuNHZs6j9k1FGYSxV9eU8DlCIh6a5rumWk9poL+ UyzjTqh3+VrVKQv58Zt5l0767Bw3jHgaDnhIf4DBgS/2ngPPrvsooXLWs4ENWvWc0V/7Lh tfQU4r0ktwHZzps41q5hPJF/Nkb+ozfYAfbZbrfpuyf6J2QPe2sDqmcanZTUqV+0KlWOjC oaAb/u8WB+aXr9qD6Pjme3EY6BYQ5CzUCeZVUxI5HujBiE2BdevL39jmwzxu7PRwTLVLR8 +Aix8hHqzoM2o/YvVsmlSxcycZbar73QzKwGGJWXwl6vI112jMTwTN8aay0R/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674133998; a=rsa-sha256; cv=none; b=LgLJf1WhEkS+Besk8BFGo8FZ7/wVbEavlfFWKxFv3uDGHaPjQFwD3LyP/+0pNjhUsNtHBl 4JNEiJGgO7LB3qaFpoqs0PCavFQAH0k9hr2vyvtjoYlQSGnqwnvswg+lKwrdjHa4bfhlF3 gNrboV0EEjCtmvC4ZFQZ/tOP1CKFXnv6CaJScYIeJadQHH3ackFyfLb1Je422bHBKUf/JB j676Lq6BlGB5AmWklveO3MQClugDpanvdhAdcF9uyrcYsZvuq6W2E/C3isJ/AfT3Ejrey3 niFgKhv6NKHQYVfu7vzRF+n865uQHs3h+kMZdrtQ05hRAeeX++T9VJQDssktiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNNZ2g1pzs6t; Thu, 19 Jan 2023 13:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDDIEY025373; Thu, 19 Jan 2023 13:13:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDDICM025372; Thu, 19 Jan 2023 13:13:18 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:13:18 GMT Message-Id: <202301191313.30JDDICM025372@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: fa7de6dcb9b7 - main - ip_gre: Fix a common typo 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: fa7de6dcb9b7314d4736f1fc21b3fdceefe34173 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fa7de6dcb9b7314d4736f1fc21b3fdceefe34173 commit fa7de6dcb9b7314d4736f1fc21b3fdceefe34173 Author: Gordon Bergling AuthorDate: 2023-01-19 13:13:02 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:13:02 +0000 ip_gre: Fix a common typo in source code comments - s/addres/address/ MFC after: 3 days --- sys/netinet/ip_gre.c | 2 +- sys/netinet6/ip6_gre.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index 93261a094a36..12c13cbce2e7 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -258,7 +258,7 @@ in_gre_setup_socket(struct gre_softc *sc) * NOTE: we are protected with gre_ioctl_sx lock. * * First check that socket is already configured. - * If so, check that source addres was not changed. + * If so, check that source address was not changed. * If address is different, check that there are no other tunnels * and close socket. */ diff --git a/sys/netinet6/ip6_gre.c b/sys/netinet6/ip6_gre.c index 9057a95e109b..2bae6d754a03 100644 --- a/sys/netinet6/ip6_gre.c +++ b/sys/netinet6/ip6_gre.c @@ -254,7 +254,7 @@ in6_gre_setup_socket(struct gre_softc *sc) * NOTE: we are protected with gre_ioctl_sx lock. * * First check that socket is already configured. - * If so, check that source addres was not changed. + * If so, check that source address was not changed. * If address is different, check that there are no other tunnels * and close socket. */ From nobody Thu Jan 19 13:16:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNS3153Vz2stxT; Thu, 19 Jan 2023 13:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNS3011Hz3G02; Thu, 19 Jan 2023 13:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DXF6Qi4u6szi6muaBiu5EXthg0yy4IQraqEd3QQAh3I=; b=ghsTzu7sc+TMm6zCuw8cdgb560obWzEGNDDk5ocNGlW/iQkmDjzsB6Eny1wCdXNxU1ASMS H167DO0XGJHNvyeasZSAQd1e8UXKS56vACRjcF2VvvjW+cFqxFemb/ePP9/6w4Mpflbtrk SU4lJGUDY9LBbPJXZ7U58pvnU1OdPJKd9sdsudpvSDd/A97QVV10xGmQafeDhMRnp9+vwp ktgGxcCodYi7ie1Ym7i+zZhIDL9vibffkHDYidl22hAXT136f83l09bIcPoxEAnA2NQohm b+fVyAWmxjo5SrahizHNeaE2652gt1k/S66g5Q8Al52JSgb7ae6UQSZ+WS2dqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DXF6Qi4u6szi6muaBiu5EXthg0yy4IQraqEd3QQAh3I=; b=xCVS1sPJZRtTs4UWaHHj5EA0jvpS5/sDBilobRR+Hf8PSaqRhWFctWFH+zXD2Xhh7sW7i2 zXuENeN5L14c0Lf8wChVO0i9iG+7XYMaaUMVEHwLuStSrm3WQFAIA5LYN396ye5R8COIdJ vSgJJKHecToKTL2grFwAFs6xfNToaUlz4Pm7edlzTMjGDo7whNtedZN+hIHHK1yc6FgFF/ u1Y+PE04ls3u61Pjd7j61TY7CSNTaaGeiImLfUSuMw/taakkJ0z2s+ITcZJj1xiAxkXAKo V7vg46W67TUEL1xZSnbLqSyLe/FBOgCRKupxe8/siFZdJb3HHFKBYysYJyypiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134179; a=rsa-sha256; cv=none; b=pjdmHDjXM3Van8cC7oCh1ullXIulW8Bv8Oi+jGHDlMfbL3jtL9E0zBeNUnD0lKuawP1FV7 /DyQ/ZuA76B2dWmhB868/1+4sDelzJyCzRmsJAbxPxpTNYlOeI6vPlU5Rn1vyOsbV81+cs EoRv8OGM6beUcISCtCObbSH1McqjoNeOD6/VgjCqNhH/k726+QhCFz7Bperw+m+LNiv9h5 xEDoxNZ9UWk7OY8IoP5oKo6tUdLsQLkvCjbA1GnA5wQeY0YMDJEjIrSmN2uob5zeVpWdkC 6vxq19mGQrAtF2Iwc0dN+kVA8eBIByzVWBL0p2poCcR/12IEB1DwhKmENJR/5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNS26CkfzrfN; Thu, 19 Jan 2023 13:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDGIm8025848; Thu, 19 Jan 2023 13:16:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDGISk025847; Thu, 19 Jan 2023 13:16:18 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:16:18 GMT Message-Id: <202301191316.30JDGISk025847@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: e4b7980c5ca9 - main - ath(4): Fix a sysctl description and a typo in a 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e4b7980c5ca9c701242f3c395a042360db0ad7a7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e4b7980c5ca9c701242f3c395a042360db0ad7a7 commit e4b7980c5ca9c701242f3c395a042360db0ad7a7 Author: Gordon Bergling AuthorDate: 2023-01-19 13:16:05 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:16:05 +0000 ath(4): Fix a sysctl description and a typo in a comment - s/delimeter/delimiter/ MFC after: 7 days --- sys/dev/ath/if_ath_sysctl.c | 2 +- sys/dev/ath/if_ath_tx_ht.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/if_ath_sysctl.c b/sys/dev/ath/if_ath_sysctl.c index de852158f991..b095dad2488f 100644 --- a/sys/dev/ath/if_ath_sysctl.c +++ b/sys/dev/ath/if_ath_sysctl.c @@ -1237,7 +1237,7 @@ ath_sysctl_stats_attach(struct ath_softc *sc) SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_2040", CTLFLAG_RD, &sc->sc_stats.ast_rx_2040, 0, "number of HT/40 frames received"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_pre_crc_err", CTLFLAG_RD, - &sc->sc_stats.ast_rx_pre_crc_err, 0, "number of delimeter-CRC errors detected"); + &sc->sc_stats.ast_rx_pre_crc_err, 0, "number of delimiter-CRC errors detected"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_post_crc_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_post_crc_err, 0, "number of post-delimiter CRC errors detected"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_decrypt_busy_err", CTLFLAG_RD, diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index 7c7a5ac493f6..1af1ec9120c7 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -457,7 +457,7 @@ ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, ndelim += ATH_AGGR_ENCRYPTDELIM; /* - * For AR9380, there's a minimum number of delimeters + * For AR9380, there's a minimum number of delimiters * required when doing RTS. * * XXX TODO: this is only needed if (a) RTS/CTS is enabled for From nobody Thu Jan 19 13:17:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNTm6MT5z2sv8J; Thu, 19 Jan 2023 13:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNTm5tzqz3GRw; Thu, 19 Jan 2023 13:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134268; h=from:from:reply-to:subject:subject: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+36RRCOQLdbutIR90DHS1wQWa1k5NJM4ILmCfbum/c=; b=m14TTQRhkSWc1gWO94IXFiSmL6cXxMzpdg7FzhtaPEcMRrFpAEANl39XsOu3s8Qn3SfEPU pD8Z4mJzgMQWqYzfV245AwgfAgE7/yShHjKZUGDIc9bik5XjJp48k6gQbdevBIKBVsEfnI 60EtbKbEpIotFM6+2h1ezvvsfvohL6l2T56rSbvI5Ho9lmB6/pRk1kYPyh59nyubkygydl M9kbckafP1v0eSrNywmO29GiQu2kUbcpgiK7H4VKYuGLakq52zk3FKYm6KOhJVvDFj161m OnavndhgMUERXnn0FMWYhjPPb1SKdj5RagDNXtl7/17uO40gko2PoXoYCRSVaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134268; h=from:from:reply-to:subject:subject: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+36RRCOQLdbutIR90DHS1wQWa1k5NJM4ILmCfbum/c=; b=gHTGC8+plEa9iO+vrp/dcb6D0YXIfpgMbzEC2gkFkpilY5QJOWxDUZ00TYgpsoZ8sxLm5x x9n9UxM6pBukDcR8r0eIChwf+B1cJykiIZp01yguRmtDsNUkuQeWPyzUK6jDStmexE7W6K 4jFQhdYLBC/s8IAAPqhjbS9E+o/B6X09IKI9GdPcYaYn7Z4b+2hrXMm1pqg85At7qzk6tK mLroR1G5VL9HR7AX/SC93PewuNdzxPhBuOfzUVgv4hIZRqlwRzJsL19+cFl981vnnCuPvi mHyf1wDBdZsJEpMSWWyliRPHyX8CYorocASLEN4xnmtTShpGRj4A6mB5neNQeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134268; a=rsa-sha256; cv=none; b=OJ/ELX/ER1pQNsRqKr/Q/eqCb0Cgyppw7de4ejdPwxtE7TD29L2Qm5aG7jm2V+1xjX5rsd n9zCWA5BjEN+AaQJSdsgN22xkr+CXuPw1Wkz8xTLhvqlF/RuOCTS0wGyukMRSIkROCD1U5 15q/swdAuLmY7ETiv+zV3uWb/I0hYtWPC5jFiLEkKDIrW40ia0GVWE6Nusg3Mxu2LbhOeo bGQKlOz43T1cTQ+31WgSyRYkirIvLCLnQwpNAfNdHmpJiefxArXWCb54hUFxaCjXSxJ1oP VKjraS8UETKNJ6Qqs/WxPOWbgz32wDNB1y/RqJ+alwD7gKHn7OJgqbttV1SOhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNTm4xL9zsG8; Thu, 19 Jan 2023 13:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDHmGL026159; Thu, 19 Jan 2023 13:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDHmhQ026158; Thu, 19 Jan 2023 13:17:48 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:17:48 GMT Message-Id: <202301191317.30JDHmhQ026158@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: 30985d19b00d - main - rc.initdiskless: Fix a typo in a 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 30985d19b00da3ea3ba808b57e5a46ce6403b8d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=30985d19b00da3ea3ba808b57e5a46ce6403b8d7 commit 30985d19b00da3ea3ba808b57e5a46ce6403b8d7 Author: Gordon Bergling AuthorDate: 2023-01-19 13:17:37 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:17:37 +0000 rc.initdiskless: Fix a typo in a comment - s/attemping/attempting/ MFC after:5 days --- libexec/rc/rc.initdiskless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.initdiskless b/libexec/rc/rc.initdiskless index 60cfa8b174f8..164e89e9e78c 100644 --- a/libexec/rc/rc.initdiskless +++ b/libexec/rc/rc.initdiskless @@ -306,7 +306,7 @@ handle_remount /conf # be sure to export those filesystems -alldirs, however. # If the diskless_remount file contains a string beginning with a # '/' it is assumed that the local nfsroot should be prepended to -# it before attemping to the remount. This allows the root to be +# it before attempting to the remount. This allows the root to be # relocated without needing to change the remount files. # log "templates are ${templates}" From nobody Thu Jan 19 13:19:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNW9483Gz2svHv; Thu, 19 Jan 2023 13:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNW93YL7z3GTp; Thu, 19 Jan 2023 13:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRlPBdEnU1Se7yHKHiFpgVw8hfD9ZNJ77kf2vVNkJRU=; b=GA4jFpGZ1DWuQBlgzBZ+VII/r3Ka6JrU1w4op6UyEoYHFxC5S2YJ73br9XwwDl7HzqCcHb EsZ3afgIooBbOCL+G9ROI+K221mgT3BcJQouSgEo56y51c6IXuexqXW7vA3Wo8ZVZePyfy KDiL8Gd2oVTCXkOOm+kIIKoODy4mK+icw+P6oM3id3oodjFLqudmtbNRDufSVaLL2GRrLU tj3ZC8nGwbpxqnGVaBrKP6ims+vTViaRkv1DqtntrTQMyfZx5w4qXXeJPeDqzjy9/gIFAC jhnzNO+OME+0qa3q5ufIthBrP7nISQldA6UaYH+o0wB89FGuWzf5Y/wlhi0Law== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRlPBdEnU1Se7yHKHiFpgVw8hfD9ZNJ77kf2vVNkJRU=; b=ExLVSGXG8UmbzduRLhDhViV+lnvOBAWqWLx0H/En9Q/5kNyaXn80GEH8fhl6FwYudhEn12 TrEAX6qutlNP/DC8OJ9sVxEeaZnu4EoEUum7x0NZ4s+ZPSnnBiMtA/u0NgyHYHO5WU8OQ/ y8OHJZc3d8CmLhUq/wBPd6FG/Tpiixu3Eb3Iiw2LI+Ty3MH/mSdSFHeLyAEjWA9cwd7oG5 MRDqxIvUvlkjfTQI6TsZRtfARYgoo8UfLMTswYMCHW8b5vetzAxxLc+TWN/mtjIP+7hDIK r72AKapQHCjYiOaCzIwbmnhNh5q1p/2x1O0HcGNFKV84MM3N0lenNcQuLC+Lhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134341; a=rsa-sha256; cv=none; b=pCzBviFocOJbzobNMW+6RLFX4dXkawekS1xRvI0mmcK8K3Oic2M19NeeC1mLJcaL1w6ykl tSjc3O5+4OATsKust9BxD+tLWw/pa4w+8yT4rr48gZMvDKBV0rEmrzQqPV0ZHXAshOTEuI NhVyefvJKOx25krbWQx3u/8dxg5eSGuY4S89rTuqX7ODOOwruS/BIAesZk4wjdAK8xPySz u34zjPtl7MRzRLrvjoZGSu1Z5akCUy3ezI+NO7ZZWKyfHhLUw2lGuGRCI7YXioHNOy9tlz Mf86dTJeEh06K69rGnPN2Tnx4fhYSimZzQX8QBAT0Hpth/GO10pHQLge5qUSXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNW92bThzrrX; Thu, 19 Jan 2023 13:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDJ1jC026424; Thu, 19 Jan 2023 13:19:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDJ1Gh026423; Thu, 19 Jan 2023 13:19:01 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:19:01 GMT Message-Id: <202301191319.30JDJ1Gh026423@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: 7a184a41c6a3 - main - bsnmpget.1: Fix a typo in 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 7a184a41c6a31a1dcf82c2e35446f96dde78dbce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7a184a41c6a31a1dcf82c2e35446f96dde78dbce commit 7a184a41c6a31a1dcf82c2e35446f96dde78dbce Author: Gordon Bergling AuthorDate: 2023-01-19 13:18:52 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:18:52 +0000 bsnmpget.1: Fix a typo in the man page - s/ingore/ignore/ MFC after: 3 days --- usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 index 95abc87a5720..ea3a2c5ce189 100644 --- a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 +++ b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 @@ -136,7 +136,7 @@ digest. By default SNMPv3 PDUs are sent unauthenticated. .It Fl a Skip any sanity checks when adding OIDs to a Protocol Data Unit (PDU): -ingore syntax/access type, allow adding of non-leaf objects for GetPdu and +ignore syntax/access type, allow adding of non-leaf objects for GetPdu and read-only objects to a SetPDU. .It Fl b Ar buffersize Tune the size of buffers used to send and receive packets. From nobody Thu Jan 19 13:22:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNZy46t2z2svpn; Thu, 19 Jan 2023 13:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNZy3gZHz3H9C; Thu, 19 Jan 2023 13:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xp56jgAR7gssfo3MnllxNqyYw86AiEohwfgIRv5IEb8=; b=p5OSVL3omhCEHQBBcVJAyLzN5XQLzH/PPGi46vLSPfk5CehinLpVyZ6Lh8o+8av9xA1lsP of1v30z1J7pY9S8vidApcDCVjYficoG6xfrTg3sDTz/AbKW8Onxz1j8nwfvTYJolJQICl2 prBH8pf2zSrgP65+wFehA+Kd6yxG354IVBOqKmYFByOPCgo682S9B/jOdPgnQvJb9ifsiw tt5chxvvnEyljNg1U4Gl+qO45E83hcAOhkgEm+h5UG2O8sFUAlD5qoJrccZy0KGa/x4ee4 aVDSscrZ77r4ik6H1X3JD06NGIs/ljCl1+79VbYPPRlfSwjGINgOJlKG9GTcFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xp56jgAR7gssfo3MnllxNqyYw86AiEohwfgIRv5IEb8=; b=S8GaqXrp0bcfmuYG7KLoBawr3WORI6GkFr3eKzRkXEl915kIr4gegYNIpaJp7NsmiJYMrT r077TFRib5CSdGvz5XEIBYh8nto2hJfVmopHijD6iUgkYbagHnzmXomH3prFRVAmF3QNx0 vNZBc0PBdZ8Sr4THP9Xvt9jHVJiH4a+H57NMO2tyvyUe5kNdwrT+HhdxHGrdICDc9jJoEA XEhJlrGLiag41mEWY8XtpMGfFvxJb6O6TFSHiSuE9oRQTlP1tFjGK6PS6hidSuluHQBKAZ iqAmIJrjIIQnJL4wTJnDgd0xH2noHBJbWcyO7CoJtnqVaO1AIL9l0wbwfd+oFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134538; a=rsa-sha256; cv=none; b=T02NxJt2u76lO5TOvaKgzuTpFyFzNW2Q3IOpT1H/XOLk+14aoIMr7KPcBORe9onlyEyVpq R8NBf7mMmdtZxOaHsmlGiH7Y9+oq2T78dDM5ym8p5OUTlan9fbMjaA16Z6t48CdIBzbYiZ 1ehAVNqk6EB27pf8dtSXNPleIsjObd0huqwdEL4QcVcABlc/EzPTZByACt0umflcChcPui OIjpTf9yZNh/jF99XO0LHie2+51ZzMnO987LHdDDkQNgaubgB93hC6QdLIYbLysoMHCiD2 3CtQmXkdcyntM6pv/5Ea7D5jlk78tFrCIwSwtnjpDeyf1+OLXQHWmFp/Ts8Big== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNZy2kvHzs7Q; Thu, 19 Jan 2023 13:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDMIwM039483; Thu, 19 Jan 2023 13:22:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDMI1w039482; Thu, 19 Jan 2023 13:22:18 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:22:18 GMT Message-Id: <202301191322.30JDMI1w039482@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: 74d2a3c16d74 - main - cxgbetool(8): Fix common typos in sysctl descriptions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 74d2a3c16d74376f594162ee622ba470d631b386 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=74d2a3c16d74376f594162ee622ba470d631b386 commit 74d2a3c16d74376f594162ee622ba470d631b386 Author: Gordon Bergling AuthorDate: 2023-01-19 13:22:00 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:22:00 +0000 cxgbetool(8): Fix common typos in sysctl descriptions - s/addres/address/ MFC after: 5 days --- usr.sbin/cxgbetool/tcbinfot4.c | 2 +- usr.sbin/cxgbetool/tcbinfot5.c | 2 +- usr.sbin/cxgbetool/tcbinfot6.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/cxgbetool/tcbinfot4.c b/usr.sbin/cxgbetool/tcbinfot4.c index 9daff0af3338..9ee72458d38d 100644 --- a/usr.sbin/cxgbetool/tcbinfot4.c +++ b/usr.sbin/cxgbetool/tcbinfot4.c @@ -872,7 +872,7 @@ _TCBVAR g_tcb_info4[]={ NULL , 0, 0, /* faka,flo,fhi */ "rq_start" , /* aka */ COMP_NONE , /* comp */ - "DW aligned starting addres of RQ", /*desc*/ + "DW aligned starting address of RQ", /*desc*/ NULL, /*akadesc */ }, {"rq_MSN" , 2, 986, 998, /* name,aux,lo,hi */ diff --git a/usr.sbin/cxgbetool/tcbinfot5.c b/usr.sbin/cxgbetool/tcbinfot5.c index b4baa31a82e2..e15dc998c683 100644 --- a/usr.sbin/cxgbetool/tcbinfot5.c +++ b/usr.sbin/cxgbetool/tcbinfot5.c @@ -879,7 +879,7 @@ _TCBVAR g_tcb_info5[]={ NULL , 0, 0, /* faka,flo,fhi */ "rq_start" , /* aka */ COMP_NONE , /* comp */ - "DW aligned starting addres of RQ", /*desc*/ + "DW aligned starting address of RQ", /*desc*/ NULL, /*akadesc */ }, {"rq_MSN" , 2, 986, 998, /* name,aux,lo,hi */ diff --git a/usr.sbin/cxgbetool/tcbinfot6.c b/usr.sbin/cxgbetool/tcbinfot6.c index 81499136807a..d1f2c24ae7a6 100644 --- a/usr.sbin/cxgbetool/tcbinfot6.c +++ b/usr.sbin/cxgbetool/tcbinfot6.c @@ -879,7 +879,7 @@ _TCBVAR g_tcb_info6[]={ NULL , 0, 0, /* faka,flo,fhi */ "rq_start" , /* aka */ COMP_NONE , /* comp */ - "DW aligned starting addres of RQ", /*desc*/ + "DW aligned starting address of RQ", /*desc*/ NULL, /*akadesc */ }, {"rq_MSN" , 2, 986, 998, /* name,aux,lo,hi */ From nobody Thu Jan 19 13:24:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNcw4g1sz2svtW; Thu, 19 Jan 2023 13:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNcw4CLXz3HfM; Thu, 19 Jan 2023 13:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4m1yiiOiw8f33XjF5qHnLpJKy+8/nd+oJGEh36GK3uY=; b=Y7J9SXf5l9m7VCiOAhp5+WLxPMWrPsePFRaN9E99EmDW3j5Vo8NkuQTxob3T9rKD7knulH CmxF9NSeCXejZtsZoc+D4OTNhZ+4LS56W+O8xZ9VpVvDHxBa/2Ad2s+Igtjbdo2g3tm6M6 cM9sw4GEspR/dTaNlWKw09slxFbBG+83dF+RERq25G8whbWbPnUG8YIZkly17P05GskZUb /licfogp0jocMs7g+0E2KJo11/F7CyMHgtKgJVG3ZYbcmcxBmq/ZvEQz5TS5sOMndchCO4 c3vR7kOCjqgctufJ93K7aBecH+NSaio3j0BXCbolhWl8EuKamiqO/GBQLCSm7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4m1yiiOiw8f33XjF5qHnLpJKy+8/nd+oJGEh36GK3uY=; b=IMs+KUB44IIHCO9uPJ01N4EgL6r/F9wCgs+6eGSFXYjN3aYgRpYcZtX5KCZ1g3FTDeIeUF yNQfqPu+kKn4Bre1MigVco8prJT3Kr5+hjIKBKFx5CW9dPFUBATgniJYXcnxnjMsshWsI6 zr7UMYrc90tnUs2ELEngStJAYl/016moZ+SECCzR2WwWI14swvp7gcbQrhVyoUwLiYW9Ki MIBRIsfiwETbF1Dpyq5zGDLPfT/yaKTgh7fB+dgi+vGoOiXUYvmItBYqVrTvWivzAs+lpN IHpefvlQkdmUy3g748sM9610GHSBw35OFfEWo6/Q9hK7hVt4ycNV3ohTn+Iniw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134640; a=rsa-sha256; cv=none; b=qK+ZQNuzp1/wgiYFs+tbAVBW+jI/9YJ6z4izIOENMlNve5v6GsnjTzAeuLRQ1Pzsbxs8nf 6Fa2bXAKWCR3cxJtzEDYHYwxsv8uTnkfP8BisVkmqy5oVDQj940zp9Gao4ktVaxLkoVT/F cYxrx6ARZhoG0Q+zDLSMRK0VBE2pOdNCc+HRcte8Jeh0RodFz3H03DtentV4nka1ZxL5kX SmzSE3rDGea1jOSwA5Vj3cP1/qmmM1gdl3malhhXgC2jqPQNe+xGPd8OjjZTrW1WeaA0ea 2cPk/8K3ttzKpzedMFR4KfLFFxioGW7gbShMtaQbpLoU+6+hjGBYC4kxNqudIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNcw3FkRzsN1; Thu, 19 Jan 2023 13:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDO0tU039812; Thu, 19 Jan 2023 13:24:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDO08f039811; Thu, 19 Jan 2023 13:24:00 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:24:00 GMT Message-Id: <202301191324.30JDO08f039811@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: afc55510b117 - main - mountd(8): 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: afc55510b1178ba94d2bdcef0eb666b10abcfc42 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=afc55510b1178ba94d2bdcef0eb666b10abcfc42 commit afc55510b1178ba94d2bdcef0eb666b10abcfc42 Author: Gordon Bergling AuthorDate: 2023-01-19 13:23:51 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:23:51 +0000 mountd(8): Fix a typo in a source code comment - s/ingore/ignore/ MFC after: 3 days --- usr.sbin/mountd/mountd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 569ea0fbf707..d985dd00acf8 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -779,7 +779,7 @@ main(int argc, char **argv) /* * This routine creates and binds sockets on the appropriate * addresses. It gets called one time for each transport. - * It returns 0 upon success, 1 for ingore the call and -1 to indicate + * It returns 0 upon success, 1 for ignore the call and -1 to indicate * bind failed with EADDRINUSE. * Any file descriptors that have been created are stored in sock_fd and * the total count of them is maintained in sock_fdcnt. From nobody Thu Jan 19 13:26:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNgX21Rqz2swBP; Thu, 19 Jan 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNgX0drfz3J5c; Thu, 19 Jan 2023 13: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=1674134776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yile6BhGmBHRQhSE/w9hVVU0S/N2BI+1BFwGlCFNhwk=; b=nMx0NUYHIbsqSs3E7DjjMr82lQdCxlfczhqayxYS/1Wola2HCkESKwHaLVpupqHz5IyAKI r0fHVok+7mrfX5KBQ6Q07ipQVVT8JcNmaewCZOYJ0kQEl/f1VsYoCptvEIyUR7RHnptCAu CPYVu0GbOESjNLUPuidQhnnSe78KW5tiK3VvCctO5rFBZCWEvFVVGqUxcLC2yoF2cuKalc 62iI/Y+lDu+7N2ta+s8DA/DzAbxCGUG3rZys76yPC7pMVlEI7Gbhqu7ecGBMr/VJJoaIVw mTUK/eOtst3CCeTdaH+4KsdOQOPCkLR3bH6OTBR2A3to7mLfnAAMo2hHfaw+Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yile6BhGmBHRQhSE/w9hVVU0S/N2BI+1BFwGlCFNhwk=; b=uRLBPc1iw3aItpYvILFDHxg98HmfEyxBK2zTLSqXeNjaoaXG/fmKWLVXK1vfsA2W3n1+7G Pj6uQXYTrTjWw4IGpgwvNcGl29v864NtlkT6vnOBNzRMtRX7ael1rL/bGKScnnEIBPJP+m pKOzMLwja5nGC0XAdHW5rzduI6B4UDcqHRSs456q8kiXyX6g9HQRaev8AjmU5b/ADRatFz Vsz5+ZKqDr9z4SDV+kNws2G4tPOnsFTUSfTS/LO2LjqsAOxmw3TvyZcStgKd/cdgLCLe7u 3/dAu253WkxGlSnIbZd9e2X/cU1HUZwIxFoUpTR8TPj+IFqypneTPziUC/LLOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134776; a=rsa-sha256; cv=none; b=KyREMRoeTjBGd125fph9gSMUwvI6aU7KJ7QgHg6e2Cb3fU/lUENTtkHKXSsQfGQFSkcCLq FcShUmimWSn88pNbaMv5DMGSZZzjWLN+wVKzCN3ChVZ7vvNR29WOyTaTkkVZhWy7eCChNf +I6b79mAr6pPmp0fMi4TRfPePsd8LGwEKKzwGnTDTgPo0nNVxdYeYot3+SNp3eN1DxkUxG iNozJcJts7TuVR+rkdM/+XD17/ewdg0CY6YBr/vRJNfU8W3PSc3CS8CKkg7wVQrEo4q55v 41vIM+lBDGWI3R5KUasrhDTGsQnbto8iS/z13xiBB+KnKc0HV0csijn53U+8Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNgW6nD8zsbp; Thu, 19 Jan 2023 13:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDQFMe040194; Thu, 19 Jan 2023 13:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDQFWR040193; Thu, 19 Jan 2023 13:26:15 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:26:15 GMT Message-Id: <202301191326.30JDQFWR040193@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: 72e709040f36 - main - nfs: Fix a common typo 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 72e709040f3691911c7b58d5a14b4d19b276f478 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=72e709040f3691911c7b58d5a14b4d19b276f478 commit 72e709040f3691911c7b58d5a14b4d19b276f478 Author: Gordon Bergling AuthorDate: 2023-01-19 13:26:06 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:26:06 +0000 nfs: Fix a common typo in source code comments - s/ingore/ignore/ MFC after: 3 days --- usr.sbin/rpc.lockd/lockd.c | 2 +- usr.sbin/rpc.statd/statd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index e25cef9993bb..24dacc81a37a 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -489,7 +489,7 @@ main(int argc, char **argv) * * It gets called one time for each transport. * - * It returns 0 upon success, 1 for ingore the call and -1 to indicate + * It returns 0 upon success, 1 for ignore the call and -1 to indicate * bind failed with EADDRINUSE. * * Any file descriptors that have been created are stored in sock_fd and diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c index ecd31b8ddf68..a1cd8582e7a6 100644 --- a/usr.sbin/rpc.statd/statd.c +++ b/usr.sbin/rpc.statd/statd.c @@ -319,7 +319,7 @@ main(int argc, char **argv) /* * This routine creates and binds sockets on the appropriate * addresses. It gets called one time for each transport. - * It returns 0 upon success, 1 for ingore the call and -1 to indicate + * It returns 0 upon success, 1 for ignore the call and -1 to indicate * bind failed with EADDRINUSE. * Any file descriptors that have been created are stored in sock_fd and * the total count of them is maintained in sock_fdcnt. From nobody Thu Jan 19 13:27:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyNhw5L3rz2swWC; Thu, 19 Jan 2023 13:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyNhw4qhzz3JFX; Thu, 19 Jan 2023 13:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcHwelOc/7Aky1lRvJX4BD9XXInxB0qFa9vk11ef7GY=; b=OnHuCnNVJmf4mPdjo3+FJoMXxXOdENMSjxqMWW+1vqC0NvklukICwfGVDDTrEfjnMrKnPB tG5pfyuAGLMQGUTOmNztLCyOPj5ub40gC6EazSspB3xtdXXfM139GlsZJmWTzhNEfH96iR X+gZ6W/X4B0p7ua7966mtxtGMaQn3I6sPP5lvkeLoHNNaW8vAP0iRmxYV/9ffCRhZvIOJf MSgCgycqCLmT82q1kjfqZQpI6RyfUhiOfWTrEl+PMww524TLFWpCVRnUkhYatIFU7D63cn Nz5TKwMRnft2dDEbiMGZY4EJsmNA004XlNKtUemks9dzkZTpkvjQLSTocr0b2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674134848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcHwelOc/7Aky1lRvJX4BD9XXInxB0qFa9vk11ef7GY=; b=OFPdXGuhPxZF/RqClWhGn7t8o+m9QM5UR5c0erhnDvH2gonTWLOFsXaVYlPv30nqvJHKkZ OPUxDgMZYHsQMSzGWFLsC7GSTT4u8xQS97nmIhb9rNYOXOAijcV4VYJJ+uWOFAoSEm8i72 72llGtHd3vNzrWEfl9SLQzEkJLoyCGGLQwzdskgA1loTAh1G9fEtWwzmfE/IN3NCsezsKi cOa6Zi75k7MOM0++x/a8ME+cHpegYrQ5W/YR9Hi8W5aRpaNNbK7/nlIDVM3sUZF5jXJEGV L4ND/KZ8un1+ty+rywLwB8ttRYt4ryNgPXKUDBrTSyhjJLaW52fmbp/3iQdG2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674134848; a=rsa-sha256; cv=none; b=HFi13VVnlh0GSDxWRGn06OYr4cA/jX3k2rLkhg9p7NGCnff7n6uQsYLWlBOaIFeZILD8e/ kzNk/ibYkH+h9prqvkisDmjUIoQxu0V3Ls9C02jb2/WBRaBVQgDgHp3YMBzgVRE47GsuWw T17PyT6LaWXhpPumaX6dhNSQ1Uv6QMFyQolhq/SXAx6GcxyH8RToPVF0zTyIIhGiaQtV8a xFebxUk5U8Ocs0pUbW2gEnkQvGNlTks86b+qGzGN4cbW6xAciVSi6fRhZhCzfanEVtELpa irvi62/KdtquMAV/LLPrAVk8cQ3OZFQupG09n2+2reicKHLKNQ9U3LSZCQwdWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyNhw3vFlzsN2; Thu, 19 Jan 2023 13:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JDRScv040469; Thu, 19 Jan 2023 13:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JDRSL3040467; Thu, 19 Jan 2023 13:27:28 GMT (envelope-from git) Date: Thu, 19 Jan 2023 13:27:28 GMT Message-Id: <202301191327.30JDRSL3040467@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: 05187f2ffc79 - main - amd64: Fix a common typo 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 05187f2ffc79e5959762ab8ce7067b7b8a1cdfd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=05187f2ffc79e5959762ab8ce7067b7b8a1cdfd9 commit 05187f2ffc79e5959762ab8ce7067b7b8a1cdfd9 Author: Gordon Bergling AuthorDate: 2023-01-19 13:27:18 +0000 Commit: Gordon Bergling CommitDate: 2023-01-19 13:27:18 +0000 amd64: Fix a common typo in source code comments - s/comparision/comparison/ MFC after: 3 days --- sys/amd64/amd64/support.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 223a9cc7f444..d8958cda430a 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -922,7 +922,7 @@ copy_fault: /* * casueword32. Compare and set user integer. Returns -1 on fault, - * 0 if access was successful, and 1 when comparision failed. + * 0 if access was successful, and 1 when comparison failed. * Old value is written to *oldp. * dst = %rdi, old = %esi, oldp = %rdx, new = %ecx */ @@ -1002,7 +1002,7 @@ END(casueword32_smap) /* * casueword. Compare and set user long. Returns -1 on fault, - * 0 if access was successful, and 1 when comparision failed. + * 0 if access was successful, and 1 when comparison failed. * Old value is written to *oldp. * dst = %rdi, old = %rsi, oldp = %rdx, new = %rcx */ From nobody Thu Jan 19 14:02:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyPVC4h94z2t1Vl for ; Thu, 19 Jan 2023 14:03:15 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyPVC4B1yz3MXQ; Thu, 19 Jan 2023 14:03:15 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674136995; 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=HeQojazkEGRUftISaC1Md1zLMHhqFivgdLb9iyc9Adg=; b=mm6xflHtgqlOKJkFmENu7bat8haP85h1hmAz8umCRVl6JTpLGcWyvUnkFVBT/nig+JAt/g kP+l2VTTyDAnHvF/wDYtPAnCOWcSnl2jzSmZx/rGzKRIOd43MF3oCzbG3qif6oq0T7Geyk g40qCAlwKSb6INMElstxu16Sd0e/qELpgYabm6wQkPE6zLbyWAvopprmAh0L8q0xSJ9yN6 qu/Mt5IfEP3Mlfx9I3RxnypE1FmG8ZKjuNZJ9RQ7D5YxkRF1zR72Kk55BjpF7swVp+n0rg vGAhtnHrT7SVI5l+PJyOyx1DDr93D42Cj960T8SYcEF1rCIltmoynMjTKFJV0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674136995; 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=HeQojazkEGRUftISaC1Md1zLMHhqFivgdLb9iyc9Adg=; b=cgu5k78zqoMKBFUOIbRY9IMYQQv+3xtW4/UJFBxksFHDY0j8QyWU5NOH+CV9VfWWPOQUh2 POcyYbGdBOsr+lXs30YNpJ//wptYBA0xpCXLTM98jbenIiQ7lbfC++bTURNDIedu7bCiVt kMyo3eqV8zjOfjY33DrJBCvGLf8gwI6jAo7DAI8Ayg7l7KN6RoNILSAsWF4xSUVqDzu89o katF2xHCwp/k7IxLez/lDexkQqYgtmLFl8Qqv4Di0h+2nzNFqPJW9hxvthEU37LbKI1MtX x9ZnWA0UJLKMvWAzAbKqM2eKBkAMC0qInhLy/5JN5wD9IsyotvYjnwTl6Y2vuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674136995; a=rsa-sha256; cv=none; b=QlE+TXGE1UlBJd2SdYdojipTo7RRsFWezaEwErDg1KNP6YM2r5M9naoF3k0PrVmKh79nnW dYKOURgmQT5Yksjb+IZIyGnDNeMXWwf80PaPgwVq6WB2sktiolKYozZACegzTp2ksov7Q5 oy1omI/IisZcYQU1ETVXEtFfKZ/4Gnzo+nC0Am5lJy3j8Z5hkyvV7N4yQ8xnL4CRPtPIuo HMF+EaIkXnKRzUFMZHe1knHcN5UQ1EURiB+x5naHetp91uW+FXP6hX+a4cpIM1qaWhdRAz KgtJCM1TQkXpMyuhpcGTKgtiFlBGrnVXqj/oMbKZZCse3PUexpR9c4JvJxIlNg== Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.3 with cipher TLS_AES_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: dbaio/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NyPVC39Rrzkd6; Thu, 19 Jan 2023 14:03:15 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id F047827C0054; Thu, 19 Jan 2023 09:03:13 -0500 (EST) Received: from imap41 ([10.202.2.91]) by compute3.internal (MEProxy); Thu, 19 Jan 2023 09:03:13 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddutddgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgesth dtredtreertdenucfhrhhomhepfdffrghnihhlohcuifdruceurghiohdfuceouggsrghi oheshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepffdvvdeufffhleekvd ekkedvkeekieeigeethffgtedtjefgteehueetkeeukeegnecuffhomhgrihhnpehfrhgv vggsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepuggsrghiohdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidquddu kedufeeluddvtddqvdeikedtvdejieekqdgusggrihhopeephfhrvggvuefuffdrohhrgh esfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i9d2946a4:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id ADE61234007B; Thu, 19 Jan 2023 09:03:13 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Message-Id: <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> In-Reply-To: <202301091857.309Iv87L068285@gitrepo.freebsd.org> References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> Date: Thu, 19 Jan 2023 11:02:11 -0300 From: "Danilo G. Baio" To: asomers@FreeBSD.org Cc: dev-commits-src-all@freebsd.org Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT Content-Type: text/plain X-ThisMailContainsUnwantedMimeParts: N On Mon, Jan 9, 2023, at 15:57, Alan Somers wrote: > The branch main has been updated by asomers: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=2c24ad3377a6f584e484656db8390e4eb7cfc119 > > commit 2c24ad3377a6f584e484656db8390e4eb7cfc119 > Author: Alan Somers > AuthorDate: 2022-12-26 02:06:21 +0000 > Commit: Alan Somers > CommitDate: 2023-01-10 02:56:18 +0000 > > ifconfig: abort if loading a module fails other than for ENOENT > > If "ifconfig create" tries to load a kernel module, and the module > exists but can't be loaded, fail the command with a useful error > message. This is helpful, for example, when trying to create a cloned > interface in a vnet jail. But ignore ENOENT, because sometimes ifconfig > can't correctly guess the name of the required kernel module. > > MFC after: 2 weeks > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D37873 > --- > sbin/ifconfig/ifconfig.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c > index 462d543125c4..120207a6927e 100644 > --- a/sbin/ifconfig/ifconfig.c > +++ b/sbin/ifconfig/ifconfig.c > @@ -1719,11 +1719,19 @@ ifmaybeload(const char *name) > } > } > > - /* > - * Try to load the module. But ignore failures, because ifconfig can't > - * infer the names of all drivers (eg mlx4en(4)). > - */ > - (void) kldload(ifkind); > + /* Try to load the module. */ > + if (kldload(ifkind) < 0) { > + switch (errno) { > + case ENOENT: > + /* > + * Ignore ENOENT, because ifconfig can't infer the > + * names of all drivers (eg mlx4en(4)). > + */ > + break; > + default: > + err(1, "kldload(%s)", ifkind); > + } > + } > } > > static struct cmd basic_cmds[] = { Hi. I have a jail with vnet where the interface is renamed that stopped working after this. from inside the jail: root@test:/ # ifconfig lo0: flags=8049 metric 0 mtu 16384 options=680003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x10 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=21 vnet0b_test: flags=8862 metric 0 mtu 1500 options=8 ether 02:27:72:a7:28:0b groups: epair media: Ethernet 10Gbase-T (10Gbase-T ) status: active nd6 options=29 root@test:/ # ifconfig vnet0b_test ifconfig: kldload(if_vnet): Operation not permitted If I don't rename the interface, that works. jail.conf: test { vnet; $index = "0"; vnet.interface = "vnet${index}b_${name}"; exec.prestart += "ifconfig epair${index} create"; exec.prestart += "ifconfig ${bridge} addm epair${index}a"; exec.prestart += "ifconfig epair${index}a up name vnet${index}a_${name}"; exec.prestart += "ifconfig epair${index}b up name vnet${index}b_${name}"; exec.poststop += "ifconfig ${bridge} deletem vnet${index}a_${name}"; exec.poststop += "ifconfig vnet${index}a_${name} destroy"; devfs_ruleset = "11"; # add path 'bpf*' unhide (devfs.rules) } That's a bit odd, I know, could be using description instead. Just reporting. Regards. -- Danilo G. Baio From nobody Thu Jan 19 15:06:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyQvZ6K4zz2t8fp; Thu, 19 Jan 2023 15:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyQvZ5nztz3gyy; Thu, 19 Jan 2023 15:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674140810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s7NyP5VEm4y6jx17KCSAGQzDd2q6EE008z/i9gODJKg=; b=W4Sy5H0g9AXMMveA7Boy1R3sct0vluPodCulp91pSk5eJZetvdH8p3a1b5JkTa0XIyJz2s r74fesYN6KH4Yd3pwtmL+vbBMadu6XwhBDGxRo7w7soXPgLnP3hLsOCWuAJfCMxQPtU3Hg bn3R40jndDst/iP89hiP1K5XrsGvgdsr4Z2s10FLrtL6Y/Ob7plDLLMMIcj7vwvE7JfdlQ w+ZJ2y9wgOsBX4mo0VAAg/LxG8OepRK5ks5wIdiCnfSNj8kjlVI62BziA2DI+WbOHb1sBp auu3k/rD/KqoNPkbqKcT0wwLAfG/iABMa66qEHnC+usUUpHFYPy1Wxro61QkXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674140810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s7NyP5VEm4y6jx17KCSAGQzDd2q6EE008z/i9gODJKg=; b=U+i/YdrfBySCbSSzZV9U+dZ8j6LVZzuaWVq9JDCFVOiGD9hXVrxNwCsoJ2I/B3tBxwrze0 w+WzG60PUPzwOkTwOkrisIGldISSHjzoQIPj7hLE+TWalDhT81B1igp5TranFcOILodHod jN1RqnIsWpOWT2q7ELfGERLtel/ZWty2RRjlkHHQ4eHtcLn/CGJjwrHsQ98i7Wp1Vfvyje EhSDTgu0X6Uu/yNHV4pS0uApRuB3my/vXl1zuYa0TKTN+eEYsbBjVIOA42VO5kLZ8b57Ms F+2/rFbvcf0C7RtRxgEDTI3gNX0mbEM9yIIqG5A9yrncnXsWPflzFiC4ZZuH+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674140810; a=rsa-sha256; cv=none; b=li0gRVsJPRb2LFMZVwvqcmdZxwQHGB01gwr4j/GxGmUN2y9p/hF7K/l7W6Wz7HrRDFnvBh LBI6R/OrmUw+F3tzbygAZjZsDxr/oyd22sk1nqixdJ49jE6HWWYvh0YNKotw8QBgbJTWhg FjhpENw1yVz+ZXDOUzN/D+H3W0KgXoEq5LXBmXUOdtAsxlzha1E97QqRbp92fcbktyqo6h +r8pO9BrGMyKTCmzmSrQVCvamBnGWItmqh9X7xKp6F4UNl21bi/isGTzuViqNoC7vtp0+N 8qy92V8bC3J04RSr0nzZhtlVjPwAbFz87QAkux1mhfc5DYRDCUSJT1Ib+eE/2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyQvZ4rPJzvLr; Thu, 19 Jan 2023 15:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JF6oci082829; Thu, 19 Jan 2023 15:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JF6oNM082828; Thu, 19 Jan 2023 15:06:50 GMT (envelope-from git) Date: Thu, 19 Jan 2023 15:06:50 GMT Message-Id: <202301191506.30JF6oNM082828@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: 4d8dd8c29480 - stable/12 - devfs.rules: Do not expose "log" in the default devfs rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 4d8dd8c29480c4cb8985d65e10689ab83dae4512 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4d8dd8c29480c4cb8985d65e10689ab83dae4512 commit 4d8dd8c29480c4cb8985d65e10689ab83dae4512 Author: Zhenlei Huang AuthorDate: 2022-05-24 13:54:38 +0000 Commit: Zhenlei Huang CommitDate: 2023-01-19 15:01:00 +0000 devfs.rules: Do not expose "log" in the default devfs rules /etc/rc.d/jail no longer creates /dev/log as a symbolic link since commit 84b354cb9ab61224713c159b1484e8f070fd37be. PR: 228351 Reviewed by: jamie, markj Differential Revision: https://reviews.freebsd.org/D34563 (cherry picked from commit 2670ea8a075ea29a0eee9d227c4cdf585a7b3b55) (cherry picked from commit 02fe4484379c1e67c22ad6abbeea10c8a20d10eb) --- sbin/devfs/devfs.rules | 1 - 1 file changed, 1 deletion(-) diff --git a/sbin/devfs/devfs.rules b/sbin/devfs/devfs.rules index 4f5373d1c4c3..6c82e497f5ec 100644 --- a/sbin/devfs/devfs.rules +++ b/sbin/devfs/devfs.rules @@ -26,7 +26,6 @@ add hide # Requires: devfsrules_hide_all # [devfsrules_unhide_basic=2] -add path log unhide add path null unhide add path zero unhide add path crypto unhide From nobody Thu Jan 19 15:34:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyRWB2hPGz2txcV; Thu, 19 Jan 2023 15:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyRWB28KTz3knm; Thu, 19 Jan 2023 15:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674142454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y+metXuqyD9On8IxMYre85zUD1cTOTbz5jRMe3V8fzc=; b=MjO+C+mlwcLUlEd2b3q1oJPI6z/8fbkU9f8oMa7zH9NLaIGRaSOJNQdfeZUKH6eJ8+V5Zy NlOdzyfdNgUuhmeczw1rNNd/ZzA324kbKP52kxVg3UbV3WvUPNv5jGr4Uy+bd4vlIPYSvi DtYFH4m29AeiHxOXh/h3llGUNJwCxNMq47KVga8kODXqlW1uFZQYNqQmz3l+CaM9cdnWfk YHuwmwAN0cszr8h7dAWxXG5xaxQjSmvVHFynsg5smjIMjIFTYcXHDhCsEDjhqxIufnPaEU AE0QaXAC7Lw3lAXH0l6gEq+5FbM+XzlIrSG8TKRZQqnK3c6wt9Snm/Is5a4J+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674142454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y+metXuqyD9On8IxMYre85zUD1cTOTbz5jRMe3V8fzc=; b=v3rYjWiNocD79Go4/6rkZkwNKt2G6NUgxoHba6HokZlioiSK6GEpblLV/sLTybhQuMfDLZ Me+5VQSLjvnKrBrrRO1ABBuBIBE++7C2N7sYBKqVeNAMdhVxqDp48rmTtVKg/qX1i3F5qu ktoLPQ9EuUgBQrLNyEWqCSNHTWQuovQwN2BILugvqXZ5uxXJ6q2hiFLD2M8Jo4z3vVAOSX UozIj1WAyAF1/2xDjPO+i9rGaP7Te4r3udjy+s8QvRlqyzyFcCREL054Kk2c21BLtU207l SYgqGba50V22BsZ0UTjhgn59fij1DHknLVapLaGg/Ght7ZA1OGjmhvi9uz7H2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674142454; a=rsa-sha256; cv=none; b=hVs1iv0NCKKgXHKqD6qmcNYE0H0tW8yvy6GYsjOUmQZQVk3Sj1MrsDTzsLglRFHDCHQ5xX /ZYxy37CRBDWOhGD9rz2s7l+fxcTiUI3q3cQz1ShiUTvYs5SVpk9Kx+yVCCLPAD5XIOptt CKskoGr7vFZ3LiNWDQ95ZTgirEDFfYNOx+MbDdLgLZJiG829/as80RkFe0OAdBxQ7C0T1S 77P9SGQPmd8wAAbHQj5UyV1Nqmg6eOelgnYHotsVWPYAoj5wcHH8S91GGqBcnytwmBOoHw yc9hVALhOU8I4qzXy7a9b3eqkGufrl/qqUppZLPD31Bmb9wBLFHBSVEyxKAsGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyRWB19ffzw5g; Thu, 19 Jan 2023 15:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JFYEAb024526; Thu, 19 Jan 2023 15:34:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JFYE3d024525; Thu, 19 Jan 2023 15:34:14 GMT (envelope-from git) Date: Thu, 19 Jan 2023 15:34:14 GMT Message-Id: <202301191534.30JFYE3d024525@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: 43ca2ae44949 - stable/13 - LINT: Omit bnxt on i386 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 43ca2ae44949cbb8dd43601cfda902ab8d098fb5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=43ca2ae44949cbb8dd43601cfda902ab8d098fb5 commit 43ca2ae44949cbb8dd43601cfda902ab8d098fb5 Author: Warner Losh AuthorDate: 2023-01-19 15:31:51 +0000 Commit: Warner Losh CommitDate: 2023-01-19 15:32:47 +0000 LINT: Omit bnxt on i386 bnxt is broken on i386, so omit it from all the LINT builds. Sponsored by: Netflix --- sys/i386/conf/NOTES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 3144adf12c90..763ba321380a 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -916,3 +916,5 @@ options VM_KMEM_SIZE_MAX options VM_KMEM_SIZE_SCALE +# This is broken on i386 +nodevice bnxt From nobody Thu Jan 19 15:46:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyRmp1KNMz2tyn2; Thu, 19 Jan 2023 15:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyRmp0gjLz3lyF; Thu, 19 Jan 2023 15:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674143162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tpb2DphgUW+djgSrfpKX87IDl02bScSO/9NVPzIeB4c=; b=sbMQG2YxeYIDD6CoZXG4L5+Dp4IDnydW3R8jK/Nz7Al61H69ZxH9SgYb3ww21VMMvgrTKm pCpPbI63qHcAcgC5mpu0H9Oh4WjlQ2hON0wpLSS7NIt4oO2C+wYkrVVq5swaGigrXoPJHD t39hD67rDu5qplKr+PFw8UrdJrWkHRtEh+8m5FRCgKiFKPoNaiNDg7DATcvYGtDihDL5qr y17iO1BNiT2GB9sS2xlEk3z7VzedXbTskPiNFdenzVZ4T4TZq9SSFlMx5veKELPfelCaEW 6fVkUhQ9fvsy2Ic+zVH0SLhYwuabtzN13tkPMMjMW+FCiDiJg2hlvwD2banyOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674143162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tpb2DphgUW+djgSrfpKX87IDl02bScSO/9NVPzIeB4c=; b=ydCnIqu23EgxvLN9pyMcFhcqI7VRUM6c1S6ZVHyxXYtAifWgCd4P+cDWI64ErLiTPTV2kC qDhU9QA2UfkNUmZwjgUHvXbMBpNHgK9Xo7ZJahBRRpA35B/mciRa5iwmN59+2Mja7Z6b6K MzVEcRt7sdozQ7r6WGeI6Wp7XK5aUkWDX+Z+zYsRKbqGpZfd7aIv9mAv+63RKYe+npuXiY zCuNTtY2FLjC9buZB0Ish0osJ2CcWpcPncVH9g0oyiC1ZYJ0Dc+hUmqCDeyO9MAi/78um6 bsNiZ61DUCBVMBPzKFXQeu3AWUyf3QGzfq9IYhUmOe6dmnzBC+MvUNfvCVqoIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674143162; a=rsa-sha256; cv=none; b=Ww7tw+lsV8uHW0QdikqsME4AYBMZ3oB0UV67cZ2syZEoaqQ7UQvVEQV+fF6K8mtryNXR2t LilklDS95MMBMaxlMTWTXhZ8lA2aLgWfeA6MY8ygZBx148SynnUAmr72rDCqJC/cwXbOEV Ab9Yubp2mTAxGGO0Y0VpKD5xUwyDdw7DHGrJEPQOdROhOp6LJG6T4Cq1ybJ8UyYeCsuK1O c/fgQaM9tl3oyNLtKfeZJh9DK2s6hxlIBwcqvWhm3/n18fy6tdhZSHv6DVWaHFkgLzcFXE J0cxb/2wafMXwJzGC9FquuX0I+0V9rlOEIqbeCfSExq9862yUwzNndGyZrPnzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyRmn6mvJzwSR; Thu, 19 Jan 2023 15:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JFk1GP039316; Thu, 19 Jan 2023 15:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JFk1Ov039315; Thu, 19 Jan 2023 15:46:01 GMT (envelope-from git) Date: Thu, 19 Jan 2023 15:46:01 GMT Message-Id: <202301191546.30JFk1Ov039315@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: 0d44c5ae3735 - stable/13 - lio: Remove unneeded include List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0d44c5ae3735fb8285fce7662adc86a21ce05768 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0d44c5ae3735fb8285fce7662adc86a21ce05768 commit 0d44c5ae3735fb8285fce7662adc86a21ce05768 Author: Zhenlei Huang AuthorDate: 2022-09-21 20:52:00 +0000 Commit: Zhenlei Huang CommitDate: 2023-01-19 15:44:05 +0000 lio: Remove unneeded include Reviewed by: adiran, imp Differential Revision: https://reviews.freebsd.org/D36501 (cherry picked from commit d819ddba9aa458f6e91df059426d9a2f1ac0b92d) --- sys/dev/liquidio/lio_bsd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/liquidio/lio_bsd.h b/sys/dev/liquidio/lio_bsd.h index fd6402ea2297..1c8e8e50b189 100644 --- a/sys/dev/liquidio/lio_bsd.h +++ b/sys/dev/liquidio/lio_bsd.h @@ -52,7 +52,6 @@ #include #include -#include #include #include From nobody Thu Jan 19 15:50:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyRsV4gnTz2tysN; Thu, 19 Jan 2023 15:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyRsV46bNz3mGS; Thu, 19 Jan 2023 15:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674143406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ifMyU3CHMK5R9Si+VK4HWiGyaMFghcgpFl+GfhV2WPE=; b=Qm9LPYBNPiaiHa2LZ7K4tVn4vzLYqDcfzUuLxdtEzDVm2Bz/fMO7BXXkZK9BNd8hx0vhJH roKe2ezDUlAGr/skY/nFzU0mmVWAwPxGwS0nctxEDg5FEvOwsFegysM03KIfjI7az4Y2+D NxC/JZUlIHjfEq4YMjCBoaV2MokD56d0JN1m/gctZDfRflZeM0i3oyV9XjKl7SAAVfw1KX ff0AOxeYR32NtFHmvEyDXNANipcXjzc5BzNoNDzhao06zu5xxuKF9/e18FZxESN2E6mDO9 WKJCkmLxbDeJq6jgs1zWP34rS2/NeyZQcRR4HOiuc6GQ008jNRhmLmFc7fYeZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674143406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ifMyU3CHMK5R9Si+VK4HWiGyaMFghcgpFl+GfhV2WPE=; b=B/MSkTctB58VnkMCMkL1AvcRsIudaAerGZTRXRqeR7ufgk4x2Uod9lN4zNDGmp5rKxIQcx /4Xp9CltwS5+x2SqqAOoRusjBbgM3lA08PyNsoSqI2viOkL2IHY2Ci8qf21VvNCDBNYH6V 9ql8+MEGhSudRqa/fCVP0eIRj7Pc2DVhgr4RMw9pJkzy9FhruTA77HZmbN4XXxzVr25NcO V6Csf6wyDiv/M7GNz1FlWjBS2EC4iEBdTKfoSCJSriWcRWXyICpK//NhW3fGUpYL+D3X9X SBcnmm+d/h8Ip3eOHpUq4XBRCbSKMAk5lGTMZkF3TtD9JvQeemjJCNegeIzWVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674143406; a=rsa-sha256; cv=none; b=uJpglOlOrpbDvzSRTb32fZswULa+dcG4dSRXIgJM0Mj3pn0mIryF4LVJ/cAuTyViNCIRZc yrXNrsS3Ca8bh02Oa4QvxHT+ShZyNdN7jLH6/R/SrUifWUF6vGTx5YXpkIjVy9fB5qQQ0r ATzd1QXk+yPBAld5+bQVY3+9DZaEnrBnyxMojySz7S8ydBmUqV4y2AyWwSM4wmUUhJy0uz TsOazsI7uvPSsS1dUgIxmigTR6D75QNADwJhbJhHsbjPRQC7Z2R5/ybKc3G3kdRTGFueju y1msyuz4sklPB6QqN6FbdNdVWngz1kwC7nRkp37WJ5OXIJr6QyMzVOQdgkaqaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyRsV3CfXzw3d; Thu, 19 Jan 2023 15:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JFo6B3042773; Thu, 19 Jan 2023 15:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JFo6dl042770; Thu, 19 Jan 2023 15:50:06 GMT (envelope-from git) Date: Thu, 19 Jan 2023 15:50:06 GMT Message-Id: <202301191550.30JFo6dl042770@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: d89fd4115ecd - stable/12 - lio: Remove unneeded include List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: d89fd4115ecd322dd03f8c4dbff1879db393ab42 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d89fd4115ecd322dd03f8c4dbff1879db393ab42 commit d89fd4115ecd322dd03f8c4dbff1879db393ab42 Author: Zhenlei Huang AuthorDate: 2022-09-21 20:52:00 +0000 Commit: Zhenlei Huang CommitDate: 2023-01-19 15:47:14 +0000 lio: Remove unneeded include Reviewed by: adiran, imp Differential Revision: https://reviews.freebsd.org/D36501 (cherry picked from commit d819ddba9aa458f6e91df059426d9a2f1ac0b92d) (cherry picked from commit 0d44c5ae3735fb8285fce7662adc86a21ce05768) --- sys/dev/liquidio/lio_bsd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/liquidio/lio_bsd.h b/sys/dev/liquidio/lio_bsd.h index c14ffed79472..d70c9395dd8b 100644 --- a/sys/dev/liquidio/lio_bsd.h +++ b/sys/dev/liquidio/lio_bsd.h @@ -51,7 +51,6 @@ #include #include -#include #include #include From nobody Thu Jan 19 16:21:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NySYZ09Wjz2v3Dy; Thu, 19 Jan 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NySYY6jCrz3q1Y; Thu, 19 Jan 2023 16: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=1674145281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1/z8ZHBKa3bfUxPLdy8gdzb7073g+8vR19cL79pQhTM=; b=I4Ytos6xitZclGkwChYTLxQt0ccE2y6lgQJGpKP6eSSaHeLiKgIH2d/Vl7SY2+AQqrlzqE SfdFh9VD0rlDnWvBFnSJrNStcuM7Ax42jUlFFigblX8PepVE38oEt/xQcQYA2ozlqe7+HR rAyhuQ16+wsWo6HC3Zq3fEiAOsgRrTyiOg9883W+Vpg/nY/0H7dorL4JYv1gL0hArB8aJY 5NYff/zf8hRbAItkBMi3SbrnVqwWwhn1XU8YD4E+ZDd8E98oNxz4cL/Qxn1jJ1Ty298xtp rxMRn1guPFNzQGoWDGunCGfW+boCvNNrkCNEi6XtDNPJUQDgNFHSWmm1QsV7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674145281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1/z8ZHBKa3bfUxPLdy8gdzb7073g+8vR19cL79pQhTM=; b=O0tvsqWKKsQi93QMOx+QQxuJldmqMjeVb2erkWGVpSzKKDzQe5ID9GmsXS/Bz/PwYPRH6+ SXjOiskx/e6L2+r6Dby3b3k7LX8F7xochloWa2hoLfpXRPTRSzxuf4wz8+MmTSD/5aXA/y Cy4vSo0Hta9dM/dOGJhThf56+E4U9uwvByIp3yUbBfZnkQwNBymQcALlnBNw92fO7TpI62 Bl58Izxov5hBjr/QYgN+SKLa1PLfH/kfi7A9Sc7/5bJKMAtqiioKpDNlNBNgq0VWLxd0np thZ1Vx1326oVYm6rYcYl3oQV0rKPr1axtKUWFxY/og2NKZHBcQJ0/b2UxB28DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674145281; a=rsa-sha256; cv=none; b=QkwAEX4nRKQzkgOaDE2d+f6JDOyfaJj/JuwvaRTiOt91wBofgG0bg+3pEFU1NQbxMxkaZq g8vDMFkbyXbTZIsawR0+2A5j0oLM+bfflzMqhpVimtFXovB1tFJEJGba4CIotwPmq13r2A fF0p28qXA5nppIj0ZCDBxKT2hVA1pKm6ZPALbF8BQBuKyCkuXJclEaMu4MQj6q80O3c1Zk 0HnsdgS7icWsdH6d/JcfT4hwGz3eh1GNsutVPx8UPvVIRDyGGWCk5N8PrOFqPCEgSo+GQs jc9Wsp/Q3z5JvANYZkN7Qv2+14HgHJGdtGr0+BvqDcA3C+0vUPcl61gKQi/wwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NySYY5ntYzxJL; Thu, 19 Jan 2023 16:21:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JGLLQB094999; Thu, 19 Jan 2023 16:21:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JGLLBA094998; Thu, 19 Jan 2023 16:21:21 GMT (envelope-from git) Date: Thu, 19 Jan 2023 16:21:21 GMT Message-Id: <202301191621.30JGLLBA094998@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: 4a8af507ebe5 - stable/13 - routing: Use NET_EPOCH_[CALL|WAIT] 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 4a8af507ebe5cabe87928e36d6f203756903df90 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4a8af507ebe5cabe87928e36d6f203756903df90 commit 4a8af507ebe5cabe87928e36d6f203756903df90 Author: Zhenlei Huang AuthorDate: 2022-12-21 01:33:31 +0000 Commit: Zhenlei Huang CommitDate: 2023-01-19 16:18:11 +0000 routing: Use NET_EPOCH_[CALL|WAIT] macros Reviewed by: melifaro, kp Differential Revision: https://reviews.freebsd.org/D37729 (cherry picked from commit 73336a6fd85b0267cebdbe1c91dc009a5ef8059e) --- sys/net/route/fib_algo.c | 2 +- sys/net/route/nhgrp_ctl.c | 3 +-- sys/net/route/nhop.c | 3 +-- sys/net/route/nhop_ctl.c | 3 +-- sys/net/route/route_rtentry.c | 3 +-- sys/net/route/route_subscription.c | 9 +++------ sys/net/route/route_tables.c | 2 +- 7 files changed, 9 insertions(+), 16 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 1274e5e90bd4..3c2ffa45afbb 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1738,7 +1738,7 @@ fib_set_algo_ptr(struct fib_data *fd, void *algo_data) void fib_epoch_call(epoch_callback_t callback, epoch_context_t ctx) { - epoch_call(net_epoch_preempt, callback, ctx); + NET_EPOCH_CALL(callback, ctx); } /* diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c index 5d6fb219f877..b829b1125597 100644 --- a/sys/net/route/nhgrp_ctl.c +++ b/sys/net/route/nhgrp_ctl.c @@ -385,8 +385,7 @@ nhgrp_free(struct nhgrp_object *nhg) NET_EPOCH_EXIT(et); KASSERT((nhg_priv->nhg_idx == 0), ("gr_idx != 0")); - epoch_call(net_epoch_preempt, destroy_nhgrp_epoch, - &nhg_priv->nhg_epoch_ctx); + NET_EPOCH_CALL(destroy_nhgrp_epoch, &nhg_priv->nhg_epoch_ctx); } /* diff --git a/sys/net/route/nhop.c b/sys/net/route/nhop.c index e087ee1fb6c0..782bdd037d3e 100644 --- a/sys/net/route/nhop.c +++ b/sys/net/route/nhop.c @@ -170,8 +170,7 @@ nhops_destroy_rib(struct rib_head *rh) * Postpone destruction till the end of current epoch * so nhop_free() can safely use nh_control pointer. */ - epoch_call(net_epoch_preempt, destroy_ctl_epoch, - &ctl->ctl_epoch_ctx); + NET_EPOCH_CALL(destroy_ctl_epoch, &ctl->ctl_epoch_ctx); } /* diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index d5d921dd66c7..9359a0b5126e 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -638,8 +638,7 @@ nhop_free(struct nhop_object *nh) } NET_EPOCH_EXIT(et); - epoch_call(net_epoch_preempt, destroy_nhop_epoch, - &nh_priv->nh_epoch_ctx); + NET_EPOCH_CALL(destroy_nhop_epoch, &nh_priv->nh_epoch_ctx); } void diff --git a/sys/net/route/route_rtentry.c b/sys/net/route/route_rtentry.c index 41e4ff8ac49f..64900ae3ae39 100644 --- a/sys/net/route/route_rtentry.c +++ b/sys/net/route/route_rtentry.c @@ -154,8 +154,7 @@ rt_free(struct rtentry *rt) KASSERT(rt != NULL, ("%s: NULL rt", __func__)); - epoch_call(net_epoch_preempt, destroy_rtentry_epoch, - &rt->rt_epoch_ctx); + NET_EPOCH_CALL(destroy_rtentry_epoch, &rt->rt_epoch_ctx); } void diff --git a/sys/net/route/route_subscription.c b/sys/net/route/route_subscription.c index 65b1bdae9900..2c2b3e94e6b4 100644 --- a/sys/net/route/route_subscription.c +++ b/sys/net/route/route_subscription.c @@ -157,8 +157,7 @@ rib_unsubscribe(struct rib_subscription *rs) CK_STAILQ_REMOVE(&rnh->rnh_subscribers, rs, rib_subscription, next); RIB_WUNLOCK(rnh); - epoch_call(net_epoch_preempt, destroy_subscription_epoch, - &rs->epoch_ctx); + NET_EPOCH_CALL(destroy_subscription_epoch, &rs->epoch_ctx); } void @@ -171,8 +170,7 @@ rib_unsubscribe_locked(struct rib_subscription *rs) CK_STAILQ_REMOVE(&rnh->rnh_subscribers, rs, rib_subscription, next); - epoch_call(net_epoch_preempt, destroy_subscription_epoch, - &rs->epoch_ctx); + NET_EPOCH_CALL(destroy_subscription_epoch, &rs->epoch_ctx); } /* @@ -205,8 +203,7 @@ rib_destroy_subscriptions(struct rib_head *rnh) RIB_WLOCK(rnh); while ((rs = CK_STAILQ_FIRST(&rnh->rnh_subscribers)) != NULL) { CK_STAILQ_REMOVE_HEAD(&rnh->rnh_subscribers, next); - epoch_call(net_epoch_preempt, destroy_subscription_epoch, - &rs->epoch_ctx); + NET_EPOCH_CALL(destroy_subscription_epoch, &rs->epoch_ctx); } RIB_WUNLOCK(rnh); NET_EPOCH_EXIT(et); diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index f5fe4b5d2a81..65829676d76f 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -245,7 +245,7 @@ grow_rtables(uint32_t num_tables) /* Wait till all cpus see new pointers */ atomic_thread_fence_rel(); - epoch_wait_preempt(net_epoch_preempt); + NET_EPOCH_WAIT(); /* Set number of fibs to a new value */ V_rt_numfibs = num_tables; From nobody Thu Jan 19 16:49:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyT9k3K3vz2v68g; Thu, 19 Jan 2023 16:49:14 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyT9k2q7xz3rhm; Thu, 19 Jan 2023 16:49:14 +0000 (UTC) (envelope-from mhorne@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674146954; 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=9It0UWgx15zW1E2apS7Ke/XSQeYt8uCUU9/OsyoO33I=; b=ZJwzY4fZd/dl150fvX4jUrAJkNsCHcCV4QW5V7FVIIH4F9BMuAWfg+zs/BmT8bgvnCnNVp /FniRK+wyETe+vI5ZqBKcXjlapOR2V12T4ZCHLuQIxSGmYuJo0dHnurBffBe1mT3WWvDQl nG1Vs0cAwnVISE6o1a3oTE3QPf+XtKchsZwUDthS8J4h2fDeF/Br8gQ2uwUqT5Vq+AIPKY FsqzQc3wMbJnto4NiKMXxjSMC/OeZ+EvX0VgRyCDxE2QlgVtr/tdasHptD3wMJwlBH+SFy aEHRS0p44GkOvHXplSJISA457VtyMTKv0xD6FurHZ8cVZqpJp9yru4hePiA62A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674146954; 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=9It0UWgx15zW1E2apS7Ke/XSQeYt8uCUU9/OsyoO33I=; b=C0jRVhcAjuQlqIOgLrWPFn2zgXSIr0Fdc3w0TubyoX31doJr2mYYbyjXWFOaMsNkRFGomc eYzCbys2L3AocSOq5VvvpdOPqZxAjtJMiyNJ+BQM0R9KWepqI1cw4p8I/X0hAsLk4N7VFv 3zsHAbeVhTksFp9Mq/9vm3MIZUgiujaH+JhUkB4YGYLSWeTVhLPUJ4UBLMfd75bIfFMLlS /oAX1iTxP3GFBPBr990v6Lo1hBARcMhcAawljTWm+kFh/wSdK/YzS+LTd8CL8zmQauP8NP MyFtuxemteizYkRuPKxVsZM8hx4Ha7PneLwiyMhW+/XwCIWlJ92cOxMLccmb/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674146954; a=rsa-sha256; cv=none; b=vxCfDkvVmp+v9q/+tVDGEX1t+TxrQ1rdsdJSz+DOC+eSJPPXB7W8F9Zasqb/LeCfe5eJUf h1bz+BREWBL0eCUjQJk/hwXFZi2VZk5tW8E8fOYeUIJyOyP5mfA6ot2bahhu45chNdueMf eKRGN0aOFT/b+X+nMeZvX1Mbj+Dul8Lr5TYph6WJlz9bbcnKd4Cof4VNN74k9Q5xt6uPZJ uCfusdGSfw3mtPFJFDDfCoJ/nGOE84SWJZoZypYq3iPOxtmemEbrblu+0PB0fT3hhZ5aI/ s8o84KWp7uGriellZWtOgHNmGVtcXHW01rJI/BsRLMKpNSQS96zcz9jFWZl27Q== Received: from [192.168.1.151] (host-173-212-76-127.public.eastlink.ca [173.212.76.127]) (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: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NyT9j6p3gznk8; Thu, 19 Jan 2023 16:49:13 +0000 (UTC) (envelope-from mhorne@freebsd.org) Message-ID: Date: Thu, 19 Jan 2023 12:49:12 -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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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.6.1 Subject: Re: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init To: Brooks Davis , Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202301171638.30HGcP3C091184@gitrepo.freebsd.org> Content-Language: en-CA From: Mitchell Horne In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 1/18/23 20:57, Brooks Davis wrote: > On Wed, Jan 18, 2023 at 04:53:51PM -0700, Warner Losh wrote: >> On Wed, Jan 18, 2023 at 3:07 PM Mitchell Horne wrote: >> >>> >>> >>> On 1/17/23 12:38, Brooks Davis wrote: >>>> The branch main has been updated by brooks: >>>> >>>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=b75062f23431fbabef1e7d665cae270b144f71b1 >>>> >>>> commit b75062f23431fbabef1e7d665cae270b144f71b1 >>>> Author: Brooks Davis >>>> AuthorDate: 2023-01-17 16:36:15 +0000 >>>> Commit: Brooks Davis >>>> CommitDate: 2023-01-17 16:37:42 +0000 >>>> >>>> riscv: Fix thread0.td_kstack_pages init >>>> >>>> Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized >>>> thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an >>>> include of opt_kstack_pages.h it used the fallback value of 4 from >>>> machine/param.h. >>> >>> Does this mean that we could/should include opt_kstack_pages.h within >>> machine/param.h (under #ifdef _KERNEL)? This header is both a consumer >>> and provider of the KSTACK_PAGES definition, by virtue of the #ifndef. I >>> think the hidden dependency should be avoided, if possible. >>> >> >> No. Including opt_XXXX.h is never OK in our .h files. They are used in too >> many places, some of which "cheat" and define _KERNEL becuse, well, they >> need to get to the kernel bits.... That will break... > Riiiiiight, I was forgetting the _KERNEL liars always ruin the fun. You are right, and the "never include opt_ headers in a header" rule is a good one. > We could potentially use the __has_include extension. I don't think we > care about building the kernel with a compiler that isn't clang or gcc > and the usage pattern defined by gcc is safe for compilers that don't > define it. We could do something like: > > #ifdef _KERNEL > #ifndef KSTACK_PAGES > #ifdef __has_include > #if __has_include("opt_kstack_pages.h") > #include "opt_kstack_pages.h" > #endif > #endif > #endif > #endif > > Yeah this would work, but I think we can agree it's one step more complicated than necessary for this edge-case which is unlikely to show up again often, if at all. I say let's just add a comment to each machine/param.h explaining the situation and that will be enough. Mitchell >> >> I do agree, however, that the current interface is less than ideal... >> >> >>> Of course, the problem at hand has been fixed and we want to keep direct >>> consumers of KSTACK_PAGES to a minimum, but I think the point still stands. >>> >> >> I think it's a good point, but the current way is likely the least-bad way >> to accomplish things. >> >> It would be much better if we could remove it from machine/param.h and >> opt_XXX.h always defines it, even the default value when it's not otherwise >> specified. However, we don't (currently) have a way to set default values >> in config(8). We could add it, since the efforts at config++ have thus far >> fallen flat.... > > I think this is probably the better direction to move. There aren't any > in-tree uses of KSTACK_PAGES so removing the definition should be fine. > > -- Brooks From nobody Thu Jan 19 17:11:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyTgr0LNNz2v8R1 for ; Thu, 19 Jan 2023 17:11:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyTgq5qRMz3wZF; Thu, 19 Jan 2023 17:11:51 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vk1-f171.google.com with SMTP id b81so1268221vkf.1; Thu, 19 Jan 2023 09:11:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vPgXUyqNeU0GQCcbupm8EUczJJRgWhf5WQoF55Xi70w=; b=gCCbi6YJsnIK/1DENtyuFzRoucgaYUkWilX9+FnooIUJfhPZUGNZRDFzCsxrvSoSjn mzVUJ7RneDVjEQAlGajca8LTiJX72yGFSsRgJZV6a1GHTJyrn3lB8a2eVrdonCISIYvE Mr9ydatTjhLJh1iye7I93+caOwwtmT7CtWFJNL3w+7KLbS7FzSnBilrerffkeLCb+E3p 1w2guQUt9hM/qJixb7JNrFb/86dgTWJz2SI/jY0YmwPZ2Z0e6/8e+lF652sx3IMDqyqd oISXkbKAuTaC0DAtum2f2MjQPUOBTVjRHZ2+ZKtn6cIs5PXGIMLomRaPEeZwZ+YIaLow Wttg== X-Gm-Message-State: AFqh2krAB2p2irqbxm/l/FeQJ3ZmWQ3BfzXuVqA0dQ7JO9PclwgV8iH9 lx7MjZAhMcXAW+G51GD/tH5ASG53AlMpfqWaiBVuD7Ff4n8= X-Google-Smtp-Source: AMrXdXtFCyc7D502hKhzs+l/AOXqkMmZJ04w4YEy7d6/TmdbTF9HduwQOg4Wbxn4Q+UjGTFKOsG2WMoTZFHdRNCs3bk= X-Received: by 2002:a1f:3055:0:b0:380:5dbd:1076 with SMTP id w82-20020a1f3055000000b003805dbd1076mr1560183vkw.22.1674148310602; Thu, 19 Jan 2023 09:11:50 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> In-Reply-To: <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> From: Alan Somers Date: Thu, 19 Jan 2023 10:11:38 -0700 Message-ID: Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT To: "Danilo G. Baio" Cc: dev-commits-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4NyTgq5qRMz3wZF X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, Jan 19, 2023 at 7:03 AM Danilo G. Baio wrote: > > > > On Mon, Jan 9, 2023, at 15:57, Alan Somers wrote: > > The branch main has been updated by asomers: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=2c24ad3377a6f584e484656db8390e4eb7cfc119 > > > > commit 2c24ad3377a6f584e484656db8390e4eb7cfc119 > > Author: Alan Somers > > AuthorDate: 2022-12-26 02:06:21 +0000 > > Commit: Alan Somers > > CommitDate: 2023-01-10 02:56:18 +0000 > > > > ifconfig: abort if loading a module fails other than for ENOENT > > > > If "ifconfig create" tries to load a kernel module, and the module > > exists but can't be loaded, fail the command with a useful error > > message. This is helpful, for example, when trying to create a cloned > > interface in a vnet jail. But ignore ENOENT, because sometimes ifconfig > > can't correctly guess the name of the required kernel module. > > > > MFC after: 2 weeks > > Reviewed by: jhb > > Differential Revision: https://reviews.freebsd.org/D37873 > > --- > > sbin/ifconfig/ifconfig.c | 18 +++++++++++++----- > > 1 file changed, 13 insertions(+), 5 deletions(-) > > > > diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c > > index 462d543125c4..120207a6927e 100644 > > --- a/sbin/ifconfig/ifconfig.c > > +++ b/sbin/ifconfig/ifconfig.c > > @@ -1719,11 +1719,19 @@ ifmaybeload(const char *name) > > } > > } > > > > - /* > > - * Try to load the module. But ignore failures, because ifconfig can't > > - * infer the names of all drivers (eg mlx4en(4)). > > - */ > > - (void) kldload(ifkind); > > + /* Try to load the module. */ > > + if (kldload(ifkind) < 0) { > > + switch (errno) { > > + case ENOENT: > > + /* > > + * Ignore ENOENT, because ifconfig can't infer the > > + * names of all drivers (eg mlx4en(4)). > > + */ > > + break; > > + default: > > + err(1, "kldload(%s)", ifkind); > > + } > > + } > > } > > > > static struct cmd basic_cmds[] = { > > > Hi. > > I have a jail with vnet where the interface is renamed that stopped working after this. > > from inside the jail: > > root@test:/ # ifconfig > lo0: flags=8049 metric 0 mtu 16384 > options=680003 > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x10 > inet 127.0.0.1 netmask 0xff000000 > groups: lo > nd6 options=21 > vnet0b_test: flags=8862 metric 0 mtu 1500 > options=8 > ether 02:27:72:a7:28:0b > groups: epair > media: Ethernet 10Gbase-T (10Gbase-T ) > status: active > nd6 options=29 > > root@test:/ # ifconfig vnet0b_test > ifconfig: kldload(if_vnet): Operation not permitted > > > If I don't rename the interface, that works. > > jail.conf: > > test { > vnet; > $index = "0"; > vnet.interface = "vnet${index}b_${name}"; > exec.prestart += "ifconfig epair${index} create"; > exec.prestart += "ifconfig ${bridge} addm epair${index}a"; > exec.prestart += "ifconfig epair${index}a up name vnet${index}a_${name}"; > exec.prestart += "ifconfig epair${index}b up name vnet${index}b_${name}"; > exec.poststop += "ifconfig ${bridge} deletem vnet${index}a_${name}"; > exec.poststop += "ifconfig vnet${index}a_${name} destroy"; > devfs_ruleset = "11"; # add path 'bpf*' unhide (devfs.rules) > } > > That's a bit odd, I know, could be using description instead. > > Just reporting. > > Regards. > -- > Danilo G. Baio Ugh, it looks like kldload(2) is doing the privilege check before the file existence check. I'm not sure of the best solution: * Change kern_kldload to check for file existence first. This would ring some alarm bells among security folks, and it isn't totally easy to do, either. * Change ifconfig(8) to do an existence check of its own. This would be ugly. * Change ifconfig(8) so that it doesn't attempt to load modules when just listing an interface. This might be incomplete, but is probably worth doing anyway. From nobody Thu Jan 19 18:22:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyWDy5mFKz310PX; Thu, 19 Jan 2023 18:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyWDy5Mnmz42ZW; Thu, 19 Jan 2023 18:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674152530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqjsaOtPFFdHsN8DI73HxfgX5h6bhC1FEiNB9Hzvgdo=; b=v/1rWx9hHo/ZaCaCLOh+AZxr/IRM4PAZljotkdW+g07C77F4dqeqAERm9/un0coOwxwNaZ Ul3GVTqaWAsxIipK0HSSJZypR/NFwlkMffcUDskNpCIvp3W5kCLEhzOcuzkr8cFboq0HWP tUWFdS5p5mhMMLgFty1GiKrfkPdpIFD2XpZ/lSceV1x5IjpFZDUCgM0LnJfoOewHekVJKJ eEFpVMYrCCtJq/hD3PsRG0YpdSYoEZDDATLG2214WEVxE2MPXW6dLWM3rzvG3Ckgq9jc0e BPVEfOqzadwXS1VjapewyPHvJzlDDyQQe27QBoA2USf7urLxXoLj4at5E+Y2EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674152530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqjsaOtPFFdHsN8DI73HxfgX5h6bhC1FEiNB9Hzvgdo=; b=NOsZ+60/4Zw++APhjcSTpNaathq2wD1qkzmkFV2XJgDRUpvmARN/H2SHU/+fYV/rSVYFzv j4mrpV1F8pCoj7UW0Bd5LWNfOMvNoEYAFhglsSqbeNfFvGfJddB0ygxYNa2btOFcF0lA3r 0wMGG2l92fxyByYngK/zPNxe6ZYh5v1dYW0NiUfntNETUMbh68YCGV2DyW+MewzPD+rMlM wNq7XlpdVsK9ieEXbiwHYiAxADbXHvAiy9yf2GVRLupLWuVVTih6i5NC69KCF7Il6tSx6z 3GW3brs36/WGDzLx5NMb7+fbkzwUug2Vb92dOkn0gcXKatdsEydJ+kLMQhYnEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674152530; a=rsa-sha256; cv=none; b=m6QxXXRMkEhEk7avQk4R8ZcEUWXRoM+ySivtFfHwAg/2XiI1JgvBF5cLUcLJNLDF10VLgy VQBz+vC2duQM3sb0GmzfsSL6knCJ2JvDJDdwbCXuPu2tmQIaUWmmFy0mK/HskxuBq+0EG5 rSUyGSoaSncM3xLdAMmADCoCrb5b2qpZfVhmGadFkqnc9UNLiOdGjhEusZuGNxN/RDCUrH kes8/JxAZpseWhNZ9UhMXr97S1nmbs/waLti4GzQ/NLfq9tcC7SvhhKHJ5yhfBHVqoSJK/ jLUWDhRLaqti6pX/FEOoCymisAss9VTkMBQS1o9s5q0sKdin/gTtxwAZFFuoLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyWDy49Jcz116b; Thu, 19 Jan 2023 18:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JIMAE5067445; Thu, 19 Jan 2023 18:22:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JIMAIT067444; Thu, 19 Jan 2023 18:22:10 GMT (envelope-from git) Date: Thu, 19 Jan 2023 18:22:10 GMT Message-Id: <202301191822.30JIMAIT067444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b36b14beda4f - main - bhyve: Avoid triggering false -Wfree-nonheap-object warnings. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b36b14beda4ff7ecbb906ada756141f76fcb81aa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b36b14beda4ff7ecbb906ada756141f76fcb81aa commit b36b14beda4ff7ecbb906ada756141f76fcb81aa Author: John Baldwin AuthorDate: 2023-01-19 18:21:50 +0000 Commit: John Baldwin CommitDate: 2023-01-19 18:21:50 +0000 bhyve: Avoid triggering false -Wfree-nonheap-object warnings. XHCI port and slot numbers are 1-based rather than 0-based. To handle this, bhyve was subtracting one item from the pointers saved in the softc so that index 1 accessed index 0 of the allocated array. However, this is UB and confused GCC 12. The compiler noticed that the calls to free() were using an offset and emitted a warning. Rather than storing UB pointers in the softc, push the decrement operation into the existing macros that wrap accesses to the relevant arrays. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D36829 --- usr.sbin/bhyve/pci_xhci.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c index 5bc9498a4eb4..1eceb6fe0fd3 100644 --- a/usr.sbin/bhyve/pci_xhci.c +++ b/usr.sbin/bhyve/pci_xhci.c @@ -290,10 +290,10 @@ struct pci_xhci_softc { }; -/* portregs and devices arrays are set up to start from idx=1 */ -#define XHCI_PORTREG_PTR(x,n) &(x)->portregs[(n)] -#define XHCI_DEVINST_PTR(x,n) (x)->devices[(n)] -#define XHCI_SLOTDEV_PTR(x,n) (x)->slots[(n)] +/* port and slot numbering start from 1 */ +#define XHCI_PORTREG_PTR(x,n) &((x)->portregs[(n) - 1]) +#define XHCI_DEVINST_PTR(x,n) ((x)->devices[(n) - 1]) +#define XHCI_SLOTDEV_PTR(x,n) ((x)->slots[(n) - 1]) #define XHCI_HALTED(sc) ((sc)->opregs.usbsts & XHCI_STS_HCH) @@ -2738,10 +2738,6 @@ pci_xhci_parse_devices(struct pci_xhci_softc *sc, nvlist_t *nvl) sc->devices = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_dev_emu *)); sc->slots = calloc(XHCI_MAX_SLOTS, sizeof(struct pci_xhci_dev_emu *)); - /* port and slot numbering start from 1 */ - sc->devices--; - sc->slots--; - ndevices = 0; slots_nvl = find_relative_config_node(nvl, "slot"); @@ -2835,7 +2831,6 @@ pci_xhci_parse_devices(struct pci_xhci_softc *sc, nvlist_t *nvl) portsfinal: sc->portregs = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_portregs)); - sc->portregs--; if (ndevices > 0) { for (i = 1; i <= XHCI_MAX_DEVS; i++) { @@ -2851,8 +2846,8 @@ bad: free(XHCI_DEVINST_PTR(sc, i)); } - free(sc->devices + 1); - free(sc->slots + 1); + free(sc->devices); + free(sc->slots); return (-1); } From nobody Thu Jan 19 18:30:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyWQm5nG5z311PQ; Thu, 19 Jan 2023 18:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyWQm5bqNz42xv; Thu, 19 Jan 2023 18:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674153040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRWIZ31pDlzJLBAJli7tQn14vkPxCO6dMXd93gjkHcc=; b=Hl/XfZaXmczAIKB2hxjk/F6XRfSniGVO5u9yJ/B7mFisyv38Z82c6qe3bWROcItQvv5vO7 xh/YDfaf7eUGPtI0XeloQv/MN7jbZ6xRFTw5aEZoMwFcvR2deZLMA2JyIwIeUSMQd/uT5O uZKFscu+0kZnq9YqfpJW+K76auHDd5UMbwCW85gpn1eHmZfIWMqaLZo4hu17AQwvjJUL6U DwJ3cxo5tIvDvLLvFAxDB73c9A2C5n7oIasB5sC7qXXyaE1MRWaSOgYacmVgnFPOPbbLWs nOi+diJqSAmEhU1Zd5WHBClN9llNDNTyFCw97QXo1/6LsY/LVXojGKBNAFanBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674153040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRWIZ31pDlzJLBAJli7tQn14vkPxCO6dMXd93gjkHcc=; b=aRL8kGuQ4zdA7lzYxXrn3JazqtD9GMqmcwKuzRSc0p182XMKwppKxeCJjDdiQWtGGJh52z KySNU3F2rNxS6d2kJ3eWVaZ+TeZ7e+j++et042gYMvfciW7DA6bvFjHLklC7nSKU35W3BF En4XA0k9pFeq7lAZhvLGTigW+kEZrlGu2EU8+ZS1ZTsBx7pJ3lMryLTDomsSmZq8KFEJTA apkX7wRKGtPRlJ8ejpBRZqlIM3QlEO3svuSIEXU4xC/pYonUjHJeTHyTc6SxBWD+xyGQ6P DWsj8cWvioxe9SVG/V2aUOEASDnAM44aUiJJtHmm2GQdRtv7WGUv02qopnrq4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674153040; a=rsa-sha256; cv=none; b=I1FDCQu0wQyqYhZYtQo+qHbIMyLXxjawVhek2LgcBKtcRbXl6al9byeeSRPWVdyoSOYS/+ XePw0F/3N1Oso0Lw7tWc5m9YFsiEDnfhHuOgmfXzEJE+xctPQlXUUqJpQqI9TxkTcgtgQ9 p1FF2gr+aphtNGSPZ1Y/oa9/Mqix5aJ+INkp9mtDmbXR8n6E8JQ0h3XvdXFiJrmixinSkb qItPvIPlhhc3KPjiW9x3RxN3LA8KF36d8z5RdLNkn+PYpqigEUqS2iTWqyyX813qeKfXFu VdxOYqmu3eT2rBrGU0UW/3FWY8hh9wM6DXT4hrHE4/JDDED7/dl1OS/3RcRYjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyWQm4h92z116q; Thu, 19 Jan 2023 18:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JIUed6077821; Thu, 19 Jan 2023 18:30:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JIUeNW077820; Thu, 19 Jan 2023 18:30:40 GMT (envelope-from git) Date: Thu, 19 Jan 2023 18:30:40 GMT Message-Id: <202301191830.30JIUeNW077820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 6a284cacb1e5 - main - bhyve: Remove vmctx argument from PCI device model methods. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a284cacb1e56a81dff7f5c34bbbd7ed1a0b6cb1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6a284cacb1e56a81dff7f5c34bbbd7ed1a0b6cb1 commit 6a284cacb1e56a81dff7f5c34bbbd7ed1a0b6cb1 Author: John Baldwin AuthorDate: 2023-01-19 18:30:18 +0000 Commit: John Baldwin CommitDate: 2023-01-19 18:30:18 +0000 bhyve: Remove vmctx argument from PCI device model methods. Most of these arguments were unused. Device models which do need access to the vmctx in one of these methods can obtain it from the pi_vmctx member of the pci_devinst argument instead. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D38096 --- usr.sbin/bhyve/bhyverun.c | 4 +- usr.sbin/bhyve/pci_ahci.c | 12 +++--- usr.sbin/bhyve/pci_e82545.c | 10 ++--- usr.sbin/bhyve/pci_emul.c | 66 ++++++++++++++--------------- usr.sbin/bhyve/pci_emul.h | 25 +++++------ usr.sbin/bhyve/pci_fbuf.c | 21 +++++----- usr.sbin/bhyve/pci_hda.c | 19 ++++----- usr.sbin/bhyve/pci_hostbridge.c | 3 +- usr.sbin/bhyve/pci_lpc.c | 17 ++++---- usr.sbin/bhyve/pci_nvme.c | 27 ++++++------ usr.sbin/bhyve/pci_passthru.c | 84 ++++++++++++++++++------------------- usr.sbin/bhyve/pci_uart.c | 8 ++-- usr.sbin/bhyve/pci_virtio_9p.c | 2 +- usr.sbin/bhyve/pci_virtio_block.c | 3 +- usr.sbin/bhyve/pci_virtio_console.c | 3 +- usr.sbin/bhyve/pci_virtio_input.c | 3 +- usr.sbin/bhyve/pci_virtio_net.c | 3 +- usr.sbin/bhyve/pci_virtio_rnd.c | 3 +- usr.sbin/bhyve/pci_virtio_scsi.c | 5 +-- usr.sbin/bhyve/pci_xhci.c | 10 ++--- usr.sbin/bhyve/snapshot.c | 12 +++--- usr.sbin/bhyve/snapshot.h | 8 ++-- usr.sbin/bhyve/virtio.c | 10 ++--- usr.sbin/bhyve/virtio.h | 13 +++--- 24 files changed, 167 insertions(+), 204 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index aeafed1d0c69..caa284a8dd63 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1491,7 +1491,7 @@ main(int argc, char *argv[]) #ifdef BHYVE_SNAPSHOT if (restore_file != NULL) { fprintf(stdout, "Pausing pci devs...\r\n"); - if (vm_pause_user_devs(ctx) != 0) { + if (vm_pause_user_devs() != 0) { fprintf(stderr, "Failed to pause PCI device state.\n"); exit(1); } @@ -1515,7 +1515,7 @@ main(int argc, char *argv[]) } fprintf(stdout, "Resuming pci devs...\r\n"); - if (vm_resume_user_devs(ctx) != 0) { + if (vm_resume_user_devs() != 0) { fprintf(stderr, "Failed to resume PCI device state.\n"); exit(1); } diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 700170885a13..9c023d93cab9 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -2197,8 +2197,7 @@ pci_ahci_host_write(struct pci_ahci_softc *sc, uint64_t offset, uint64_t value) } static void -pci_ahci_write(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size, +pci_ahci_write(struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { struct pci_ahci_softc *sc = pi->pi_arg; @@ -2292,8 +2291,7 @@ pci_ahci_port_read(struct pci_ahci_softc *sc, uint64_t offset) } static uint64_t -pci_ahci_read(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t regoff, int size) +pci_ahci_read(struct pci_devinst *pi, int baridx, uint64_t regoff, int size) { struct pci_ahci_softc *sc = pi->pi_arg; uint64_t offset; @@ -2420,7 +2418,7 @@ pci_ahci_hd_legacy_config(nvlist_t *nvl, const char *opts) } static int -pci_ahci_init(struct vmctx *ctx __unused, struct pci_devinst *pi, nvlist_t *nvl) +pci_ahci_init(struct pci_devinst *pi, nvlist_t *nvl) { char bident[sizeof("XXX:XXX:XXX")]; char node_name[sizeof("XX")]; @@ -2668,7 +2666,7 @@ done: } static int -pci_ahci_pause(struct vmctx *ctx __unused, struct pci_devinst *pi) +pci_ahci_pause(struct pci_devinst *pi) { struct pci_ahci_softc *sc; struct blockif_ctxt *bctxt; @@ -2688,7 +2686,7 @@ pci_ahci_pause(struct vmctx *ctx __unused, struct pci_devinst *pi) } static int -pci_ahci_resume(struct vmctx *ctx __unused, struct pci_devinst *pi) +pci_ahci_resume(struct pci_devinst *pi) { struct pci_ahci_softc *sc; struct blockif_ctxt *bctxt; diff --git a/usr.sbin/bhyve/pci_e82545.c b/usr.sbin/bhyve/pci_e82545.c index 49c5f986a341..bec8edb17caf 100644 --- a/usr.sbin/bhyve/pci_e82545.c +++ b/usr.sbin/bhyve/pci_e82545.c @@ -2112,8 +2112,7 @@ e82545_read_register(struct e82545_softc *sc, uint32_t offset) } static void -e82545_write(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size, +e82545_write(struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { struct e82545_softc *sc; @@ -2163,8 +2162,7 @@ e82545_write(struct vmctx *ctx __unused, } static uint64_t -e82545_read(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size) +e82545_read(struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct e82545_softc *sc; uint64_t retval; @@ -2307,7 +2305,7 @@ e82545_reset(struct e82545_softc *sc, int drvr) } static int -e82545_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) +e82545_init(struct pci_devinst *pi, nvlist_t *nvl) { char nstr[80]; struct e82545_softc *sc; @@ -2319,7 +2317,7 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) pi->pi_arg = sc; sc->esc_pi = pi; - sc->esc_ctx = ctx; + sc->esc_ctx = pi->pi_vmctx; pthread_mutex_init(&sc->esc_mtx, NULL); pthread_cond_init(&sc->esc_rx_cond, NULL); diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index cca0932180d6..93411751d635 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -140,8 +140,8 @@ SYSRES_MEM(PCI_EMUL_ECFG_BASE, PCI_EMUL_ECFG_SIZE); static struct pci_devemu *pci_emul_finddev(const char *name); static void pci_lintr_route(struct pci_devinst *pi); static void pci_lintr_update(struct pci_devinst *pi); -static void pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot, - int func, int coff, int bytes, uint32_t *val); +static void pci_cfgrw(int in, int bus, int slot, int func, int coff, + int bytes, uint32_t *val); static __inline void CFGWRITE(struct pci_devinst *pi, int coff, uint32_t val, int bytes) @@ -447,7 +447,7 @@ pci_msix_pba_bar(struct pci_devinst *pi) } static int -pci_emul_io_handler(struct vmctx *ctx, int in, int port, +pci_emul_io_handler(struct vmctx *ctx __unused, int in, int port, int bytes, uint32_t *eax, void *arg) { struct pci_devinst *pdi = arg; @@ -464,10 +464,10 @@ pci_emul_io_handler(struct vmctx *ctx, int in, int port, pdi->pi_bar[i].addr + pdi->pi_bar[i].size) { offset = port - pdi->pi_bar[i].addr; if (in) - *eax = (*pe->pe_barread)(ctx, pdi, i, + *eax = (*pe->pe_barread)(pdi, i, offset, bytes); else - (*pe->pe_barwrite)(ctx, pdi, i, offset, + (*pe->pe_barwrite)(pdi, i, offset, bytes, *eax); return (0); } @@ -476,7 +476,7 @@ pci_emul_io_handler(struct vmctx *ctx, int in, int port, } static int -pci_emul_mem_handler(struct vmctx *ctx, int vcpu __unused, int dir, +pci_emul_mem_handler(struct vmctx *ctx __unused, int vcpu __unused, int dir, uint64_t addr, int size, uint64_t *val, void *arg1, long arg2) { struct pci_devinst *pdi = arg1; @@ -494,22 +494,22 @@ pci_emul_mem_handler(struct vmctx *ctx, int vcpu __unused, int dir, if (dir == MEM_F_WRITE) { if (size == 8) { - (*pe->pe_barwrite)(ctx, pdi, bidx, offset, + (*pe->pe_barwrite)(pdi, bidx, offset, 4, *val & 0xffffffff); - (*pe->pe_barwrite)(ctx, pdi, bidx, offset + 4, + (*pe->pe_barwrite)(pdi, bidx, offset + 4, 4, *val >> 32); } else { - (*pe->pe_barwrite)(ctx, pdi, bidx, offset, + (*pe->pe_barwrite)(pdi, bidx, offset, size, *val); } } else { if (size == 8) { - *val = (*pe->pe_barread)(ctx, pdi, bidx, + *val = (*pe->pe_barread)(pdi, bidx, offset, 4); - *val |= (*pe->pe_barread)(ctx, pdi, bidx, + *val |= (*pe->pe_barread)(pdi, bidx, offset + 4, 4) << 32; } else { - *val = (*pe->pe_barread)(ctx, pdi, bidx, + *val = (*pe->pe_barread)(pdi, bidx, offset, size); } } @@ -563,7 +563,7 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration) } else error = unregister_inout(&iop); if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi->pi_vmctx, pi, idx, registration, + (*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr); break; case PCIBAR_MEM32: @@ -581,13 +581,13 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration) } else error = unregister_mem(&mr); if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi->pi_vmctx, pi, idx, registration, + (*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr); break; case PCIBAR_ROM: error = 0; if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi->pi_vmctx, pi, idx, registration, + (*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr); break; default: @@ -993,7 +993,7 @@ pci_emul_init(struct vmctx *ctx, struct pci_devemu *pde, int bus, int slot, pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_BUSMASTEREN); - err = (*pde->pe_init)(ctx, pdi, fi->fi_config); + err = (*pde->pe_init)(pdi, fi->fi_config); if (err == 0) fi->fi_devi = pdi; else @@ -1294,7 +1294,7 @@ pci_emul_fallback_handler(struct vmctx *ctx __unused, int vcpu __unused, } static int -pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu __unused, int dir, +pci_emul_ecfg_handler(struct vmctx *ctx __unused, int vcpu __unused, int dir, uint64_t addr, int bytes, uint64_t *val, void *arg1 __unused, long arg2 __unused) { @@ -1307,7 +1307,7 @@ pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu __unused, int dir, in = (dir == MEM_F_READ); if (in) *val = ~0UL; - pci_cfgrw(ctx, in, bus, slot, func, coff, bytes, (uint32_t *)val); + pci_cfgrw(in, bus, slot, func, coff, bytes, (uint32_t *)val); return (0); } @@ -2054,8 +2054,8 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff, uint32_t new, int bytes) } static void -pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot, int func, - int coff, int bytes, uint32_t *eax) +pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, + uint32_t *eax) { struct businfo *bi; struct slotinfo *si; @@ -2108,7 +2108,7 @@ pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot, int func, if (in) { /* Let the device emulation override the default handler */ if (pe->pe_cfgread != NULL) { - needcfg = pe->pe_cfgread(ctx, pi, coff, bytes, eax); + needcfg = pe->pe_cfgread(pi, coff, bytes, eax); } else { needcfg = 1; } @@ -2120,7 +2120,7 @@ pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot, int func, } else { /* Let the device emulation override the default handler */ if (pe->pe_cfgwrite != NULL && - (*pe->pe_cfgwrite)(ctx, pi, coff, bytes, *eax) == 0) + (*pe->pe_cfgwrite)(pi, coff, bytes, *eax) == 0) return; /* @@ -2247,7 +2247,7 @@ pci_emul_cfgaddr(struct vmctx *ctx __unused, int in, INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr); static int -pci_emul_cfgdata(struct vmctx *ctx, int in, int port, +pci_emul_cfgdata(struct vmctx *ctx __unused, int in, int port, int bytes, uint32_t *eax, void *arg __unused) { int coff; @@ -2256,8 +2256,7 @@ pci_emul_cfgdata(struct vmctx *ctx, int in, int port, coff = cfgoff + (port - CONF1_DATA_PORT); if (cfgenable) { - pci_cfgrw(ctx, in, cfgbus, cfgslot, cfgfunc, coff, bytes, - eax); + pci_cfgrw(in, cfgbus, cfgslot, cfgfunc, coff, bytes, eax); } else { /* Ignore accesses to cfgdata if not enabled by cfgaddr */ if (in) @@ -2395,7 +2394,7 @@ pci_snapshot(struct vm_snapshot_meta *meta) } int -pci_pause(struct vmctx *ctx, const char *dev_name) +pci_pause(const char *dev_name) { struct pci_devemu *pde; struct pci_devinst *pdi; @@ -2420,11 +2419,11 @@ pci_pause(struct vmctx *ctx, const char *dev_name) return (0); } - return (*pde->pe_pause)(ctx, pdi); + return (*pde->pe_pause)(pdi); } int -pci_resume(struct vmctx *ctx, const char *dev_name) +pci_resume(const char *dev_name) { struct pci_devemu *pde; struct pci_devinst *pdi; @@ -2449,7 +2448,7 @@ pci_resume(struct vmctx *ctx, const char *dev_name) return (0); } - return (*pde->pe_resume)(ctx, pdi); + return (*pde->pe_resume)(pdi); } #endif @@ -2469,8 +2468,7 @@ struct pci_emul_dsoftc { #define PCI_EMUL_MSIX_MSGS 16 static int -pci_emul_dinit(struct vmctx *ctx __unused, struct pci_devinst *pi, - nvlist_t *nvl __unused) +pci_emul_dinit(struct pci_devinst *pi, nvlist_t *nvl __unused) { int error; struct pci_emul_dsoftc *sc; @@ -2499,8 +2497,7 @@ pci_emul_dinit(struct vmctx *ctx __unused, struct pci_devinst *pi, } static void -pci_emul_diow(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size, +pci_emul_diow(struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { int i; @@ -2567,8 +2564,7 @@ pci_emul_diow(struct vmctx *ctx __unused, } static uint64_t -pci_emul_dior(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size) +pci_emul_dior(struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct pci_emul_dsoftc *sc = pi->pi_arg; uint32_t value; diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h index 8a7bcb7cc83a..117fc78898a2 100644 --- a/usr.sbin/bhyve/pci_emul.h +++ b/usr.sbin/bhyve/pci_emul.h @@ -54,8 +54,7 @@ struct pci_devemu { const char *pe_emu; /* Name of device emulation */ /* instance creation */ - int (*pe_init)(struct vmctx *, struct pci_devinst *, - nvlist_t *); + int (*pe_init)(struct pci_devinst *, nvlist_t *); int (*pe_legacy_config)(nvlist_t *, const char *); const char *pe_alias; @@ -63,28 +62,24 @@ struct pci_devemu { void (*pe_write_dsdt)(struct pci_devinst *); /* config space read/write callbacks */ - int (*pe_cfgwrite)(struct vmctx *ctx, - struct pci_devinst *pi, int offset, + int (*pe_cfgwrite)(struct pci_devinst *pi, int offset, int bytes, uint32_t val); - int (*pe_cfgread)(struct vmctx *ctx, - struct pci_devinst *pi, int offset, + int (*pe_cfgread)(struct pci_devinst *pi, int offset, int bytes, uint32_t *retval); /* BAR read/write callbacks */ - void (*pe_barwrite)(struct vmctx *ctx, - struct pci_devinst *pi, int baridx, + void (*pe_barwrite)(struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value); - uint64_t (*pe_barread)(struct vmctx *ctx, - struct pci_devinst *pi, int baridx, + uint64_t (*pe_barread)(struct pci_devinst *pi, int baridx, uint64_t offset, int size); - void (*pe_baraddr)(struct vmctx *ctx, struct pci_devinst *pi, + void (*pe_baraddr)(struct pci_devinst *pi, int baridx, int enabled, uint64_t address); /* Save/restore device state */ int (*pe_snapshot)(struct vm_snapshot_meta *meta); - int (*pe_pause)(struct vmctx *ctx, struct pci_devinst *pi); - int (*pe_resume)(struct vmctx *ctx, struct pci_devinst *pi); + int (*pe_pause)(struct pci_devinst *pi); + int (*pe_resume)(struct pci_devinst *pi); }; #define PCI_EMUL_SET(x) DATA_SET(pci_devemu_set, x); @@ -266,8 +261,8 @@ uint64_t pci_ecfg_base(void); int pci_bus_configured(int bus); #ifdef BHYVE_SNAPSHOT int pci_snapshot(struct vm_snapshot_meta *meta); -int pci_pause(struct vmctx *ctx, const char *dev_name); -int pci_resume(struct vmctx *ctx, const char *dev_name); +int pci_pause(const char *dev_name); +int pci_resume(const char *dev_name); #endif static __inline void diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c index 4cfe872bd934..91215a124c59 100644 --- a/usr.sbin/bhyve/pci_fbuf.c +++ b/usr.sbin/bhyve/pci_fbuf.c @@ -117,8 +117,7 @@ static struct pci_fbuf_softc *fbuf_sc; #define PCI_FBUF_MSI_MSGS 4 static void -pci_fbuf_write(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size, +pci_fbuf_write(struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { struct pci_fbuf_softc *sc; @@ -172,8 +171,7 @@ pci_fbuf_write(struct vmctx *ctx __unused, } static uint64_t -pci_fbuf_read(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size) +pci_fbuf_read(struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct pci_fbuf_softc *sc; uint8_t *p; @@ -218,8 +216,8 @@ pci_fbuf_read(struct vmctx *ctx __unused, } static void -pci_fbuf_baraddr(struct vmctx *ctx, struct pci_devinst *pi, int baridx, - int enabled, uint64_t address) +pci_fbuf_baraddr(struct pci_devinst *pi, int baridx, int enabled, + uint64_t address) { struct pci_fbuf_softc *sc; int prot; @@ -229,12 +227,13 @@ pci_fbuf_baraddr(struct vmctx *ctx, struct pci_devinst *pi, int baridx, sc = pi->pi_arg; if (!enabled) { - if (vm_munmap_memseg(ctx, sc->fbaddr, FB_SIZE) != 0) + if (vm_munmap_memseg(pi->pi_vmctx, sc->fbaddr, FB_SIZE) != 0) EPRINTLN("pci_fbuf: munmap_memseg failed"); sc->fbaddr = 0; } else { prot = PROT_READ | PROT_WRITE; - if (vm_mmap_memseg(ctx, address, VM_FRAMEBUFFER, 0, FB_SIZE, prot) != 0) + if (vm_mmap_memseg(pi->pi_vmctx, address, VM_FRAMEBUFFER, 0, + FB_SIZE, prot) != 0) EPRINTLN("pci_fbuf: mmap_memseg failed"); sc->fbaddr = address; } @@ -371,7 +370,7 @@ pci_fbuf_render(struct bhyvegc *gc, void *arg) } static int -pci_fbuf_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) +pci_fbuf_init(struct pci_devinst *pi, nvlist_t *nvl) { int error; struct pci_fbuf_softc *sc; @@ -391,8 +390,8 @@ pci_fbuf_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_DISPLAY); pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_DISPLAY_VGA); - sc->fb_base = vm_create_devmem( - ctx, VM_FRAMEBUFFER, "framebuffer", FB_SIZE); + sc->fb_base = vm_create_devmem(pi->pi_vmctx, VM_FRAMEBUFFER, + "framebuffer", FB_SIZE); if (sc->fb_base == MAP_FAILED) { error = -1; goto done; diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index a85935a5cae8..9b0d4bd02ba0 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -209,11 +209,11 @@ static uint64_t hda_get_clock_ns(void); /* * PCI HDA function declarations */ -static int pci_hda_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl); -static void pci_hda_write(struct vmctx *ctx, struct pci_devinst *pi, - int baridx, uint64_t offset, int size, uint64_t value); -static uint64_t pci_hda_read(struct vmctx *ctx, struct pci_devinst *pi, - int baridx, uint64_t offset, int size); +static int pci_hda_init(struct pci_devinst *pi, nvlist_t *nvl); +static void pci_hda_write(struct pci_devinst *pi, int baridx, uint64_t offset, + int size, uint64_t value); +static uint64_t pci_hda_read(struct pci_devinst *pi, int baridx, + uint64_t offset, int size); /* * HDA global data */ @@ -1223,11 +1223,10 @@ static uint64_t hda_get_clock_ns(void) * PCI HDA function definitions */ static int -pci_hda_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) +pci_hda_init(struct pci_devinst *pi, nvlist_t *nvl) { struct hda_softc *sc = NULL; - assert(ctx != NULL); assert(pi != NULL); pci_set_cfgdata16(pi, PCIR_VENDOR, INTEL_VENDORID); @@ -1256,8 +1255,7 @@ pci_hda_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) } static void -pci_hda_write(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size, +pci_hda_write(struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { struct hda_softc *sc = pi->pi_arg; @@ -1274,8 +1272,7 @@ pci_hda_write(struct vmctx *ctx __unused, } static uint64_t -pci_hda_read(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size) +pci_hda_read(struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct hda_softc *sc = pi->pi_arg; uint64_t value = 0; diff --git a/usr.sbin/bhyve/pci_hostbridge.c b/usr.sbin/bhyve/pci_hostbridge.c index 50c334d8e408..f0878d97a77e 100644 --- a/usr.sbin/bhyve/pci_hostbridge.c +++ b/usr.sbin/bhyve/pci_hostbridge.c @@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" static int -pci_hostbridge_init(struct vmctx *ctx __unused, struct pci_devinst *pi, - nvlist_t *nvl) +pci_hostbridge_init(struct pci_devinst *pi, nvlist_t *nvl) { const char *value; u_int vendor, device; diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c index e275946d9621..548726e27d0d 100644 --- a/usr.sbin/bhyve/pci_lpc.c +++ b/usr.sbin/bhyve/pci_lpc.c @@ -398,8 +398,7 @@ pci_lpc_uart_dsdt(void) LPC_DSDT(pci_lpc_uart_dsdt); static int -pci_lpc_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, - int coff, int bytes, uint32_t val) +pci_lpc_cfgwrite(struct pci_devinst *pi, int coff, int bytes, uint32_t val) { int pirq_pin; @@ -410,7 +409,7 @@ pci_lpc_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, if (coff >= 0x68 && coff <= 0x6b) pirq_pin = coff - 0x68 + 5; if (pirq_pin != 0) { - pirq_write(ctx, pirq_pin, val); + pirq_write(pi->pi_vmctx, pirq_pin, val); pci_set_cfgdata8(pi, coff, pirq_read(pirq_pin)); return (0); } @@ -419,16 +418,14 @@ pci_lpc_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, } static void -pci_lpc_write(struct vmctx *ctx __unused, - struct pci_devinst *pi __unused, int baridx __unused, +pci_lpc_write(struct pci_devinst *pi __unused, int baridx __unused, uint64_t offset __unused, int size __unused, uint64_t value __unused) { } static uint64_t -pci_lpc_read(struct vmctx *ctx __unused, - struct pci_devinst *pi __unused, int baridx __unused, uint64_t offset __unused, - int size __unused) +pci_lpc_read(struct pci_devinst *pi __unused, int baridx __unused, + uint64_t offset __unused, int size __unused) { return (0); } @@ -437,7 +434,7 @@ pci_lpc_read(struct vmctx *ctx __unused, #define LPC_VENDOR 0x8086 static int -pci_lpc_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl __unused) +pci_lpc_init(struct pci_devinst *pi, nvlist_t *nvl __unused) { /* * Do not allow more than one LPC bridge to be configured. @@ -457,7 +454,7 @@ pci_lpc_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl __unused) return (-1); } - if (lpc_init(ctx) != 0) + if (lpc_init(pi->pi_vmctx) != 0) return (-1); /* initialize config space */ diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 75e6f247501a..cf1c815096d3 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1100,7 +1100,7 @@ pci_nvme_reset(struct pci_nvme_softc *sc) } static int -pci_nvme_init_controller(struct vmctx *ctx, struct pci_nvme_softc *sc) +pci_nvme_init_controller(struct pci_nvme_softc *sc) { uint16_t acqs, asqs; @@ -1119,8 +1119,8 @@ pci_nvme_init_controller(struct vmctx *ctx, struct pci_nvme_softc *sc) return (-1); } sc->submit_queues[0].size = asqs; - sc->submit_queues[0].qbase = vm_map_gpa(ctx, sc->regs.asq, - sizeof(struct nvme_command) * asqs); + sc->submit_queues[0].qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, + sc->regs.asq, sizeof(struct nvme_command) * asqs); if (sc->submit_queues[0].qbase == NULL) { EPRINTLN("%s: ASQ vm_map_gpa(%lx) failed", __func__, sc->regs.asq); @@ -1140,8 +1140,8 @@ pci_nvme_init_controller(struct vmctx *ctx, struct pci_nvme_softc *sc) return (-1); } sc->compl_queues[0].size = acqs; - sc->compl_queues[0].qbase = vm_map_gpa(ctx, sc->regs.acq, - sizeof(struct nvme_completion) * acqs); + sc->compl_queues[0].qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, + sc->regs.acq, sizeof(struct nvme_completion) * acqs); if (sc->compl_queues[0].qbase == NULL) { EPRINTLN("%s: ACQ vm_map_gpa(%lx) failed", __func__, sc->regs.acq); @@ -2930,8 +2930,8 @@ pci_nvme_bar0_reg_dumps(const char *func, uint64_t offset, int iswrite) } static void -pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvme_softc* sc, - uint64_t offset, int size, uint64_t value) +pci_nvme_write_bar_0(struct pci_nvme_softc *sc, uint64_t offset, int size, + uint64_t value) { uint32_t ccreg; @@ -3014,7 +3014,7 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvme_softc* sc, /* transition 1-> causes controller reset */ pci_nvme_reset_locked(sc); else - pci_nvme_init_controller(ctx, sc); + pci_nvme_init_controller(sc); } /* Insert the iocqes, iosqes and en bits from the write */ @@ -3062,8 +3062,8 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvme_softc* sc, } static void -pci_nvme_write(struct vmctx *ctx, struct pci_devinst *pi, - int baridx, uint64_t offset, int size, uint64_t value) +pci_nvme_write(struct pci_devinst *pi, int baridx, uint64_t offset, int size, + uint64_t value) { struct pci_nvme_softc* sc = pi->pi_arg; @@ -3078,7 +3078,7 @@ pci_nvme_write(struct vmctx *ctx, struct pci_devinst *pi, switch (baridx) { case 0: - pci_nvme_write_bar_0(ctx, sc, offset, size, value); + pci_nvme_write_bar_0(sc, offset, size, value); break; default: @@ -3125,8 +3125,7 @@ static uint64_t pci_nvme_read_bar_0(struct pci_nvme_softc* sc, static uint64_t -pci_nvme_read(struct vmctx *ctx __unused, - struct pci_devinst *pi, int baridx, uint64_t offset, int size) +pci_nvme_read(struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct pci_nvme_softc* sc = pi->pi_arg; @@ -3276,7 +3275,7 @@ pci_nvme_resized(struct blockif_ctxt *bctxt __unused, void *arg, } static int -pci_nvme_init(struct vmctx *ctx __unused, struct pci_devinst *pi, nvlist_t *nvl) +pci_nvme_init(struct pci_devinst *pi, nvlist_t *nvl) { struct pci_nvme_softc *sc; uint32_t pci_membar_sz; diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index 3dbb80eec9fa..f42bbbda655f 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -386,8 +386,8 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size) } static void -msix_table_write(struct vmctx *ctx, struct passthru_softc *sc, - uint64_t offset, int size, uint64_t data) +msix_table_write(struct passthru_softc *sc, uint64_t offset, int size, + uint64_t data) { struct pci_devinst *pi; struct msix_table_entry *entry; @@ -445,7 +445,7 @@ msix_table_write(struct vmctx *ctx, struct passthru_softc *sc, /* If the entry is masked, don't set it up */ if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 || (vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { - (void)vm_setup_pptdev_msix(ctx, 0, + (void)vm_setup_pptdev_msix(sc->psc_pi->pi_vmctx, 0, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, index, entry->addr, entry->msg_data, entry->vector_control); @@ -454,7 +454,7 @@ msix_table_write(struct vmctx *ctx, struct passthru_softc *sc, } static int -init_msix_table(struct vmctx *ctx __unused, struct passthru_softc *sc) +init_msix_table(struct passthru_softc *sc) { struct pci_devinst *pi = sc->psc_pi; struct pci_bar_mmap pbm; @@ -515,7 +515,7 @@ init_msix_table(struct vmctx *ctx __unused, struct passthru_softc *sc) } static int -cfginitbar(struct vmctx *ctx __unused, struct passthru_softc *sc) +cfginitbar(struct passthru_softc *sc) { int i, error; struct pci_devinst *pi; @@ -596,7 +596,7 @@ cfginitbar(struct vmctx *ctx __unused, struct passthru_softc *sc) } static int -cfginit(struct vmctx *ctx, struct pci_devinst *pi, int bus, int slot, int func) +cfginit(struct pci_devinst *pi, int bus, int slot, int func) { int error; struct passthru_softc *sc; @@ -615,7 +615,7 @@ cfginit(struct vmctx *ctx, struct pci_devinst *pi, int bus, int slot, int func) goto done; } - if (cfginitbar(ctx, sc) != 0) { + if (cfginitbar(sc) != 0) { warnx("failed to initialize BARs for PCI %d/%d/%d", bus, slot, func); goto done; @@ -629,7 +629,7 @@ cfginit(struct vmctx *ctx, struct pci_devinst *pi, int bus, int slot, int func) * a BAR was enabled, as otherwise the PCIOCBARMMAP might fail on us. */ if (pci_msix_table_bar(pi) >= 0) { - error = init_msix_table(ctx, sc); + error = init_msix_table(sc); if (error != 0) { warnx( "failed to initialize MSI-X table for PCI %d/%d/%d: %d", @@ -682,8 +682,7 @@ passthru_legacy_config(nvlist_t *nvl, const char *opts) } static int -passthru_init_rom(struct vmctx *const ctx __unused, - struct passthru_softc *const sc, const char *const romfile) +passthru_init_rom(struct passthru_softc *const sc, const char *const romfile) { if (romfile == NULL) { return (0); @@ -799,7 +798,7 @@ passthru_lookup_pptdev(const char *name, int *bus, int *slot, int *func) } static int -passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) +passthru_init(struct pci_devinst *pi, nvlist_t *nvl) { int bus, slot, func, error, memflags; struct passthru_softc *sc; @@ -808,7 +807,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) sc = NULL; error = 1; - memflags = vm_get_memflags(ctx); + memflags = vm_get_memflags(pi->pi_vmctx); if (!(memflags & VM_MEM_F_WIRED)) { warnx("passthru requires guest memory to be wired"); return (error); @@ -837,7 +836,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) GET_INT_CONFIG(func, "func"); } - if (vm_assign_pptdev(ctx, bus, slot, func) != 0) { + if (vm_assign_pptdev(pi->pi_vmctx, bus, slot, func) != 0) { warnx("PCI device at %d/%d/%d is not using the ppt(4) driver", bus, slot, func); goto done; @@ -849,11 +848,11 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) sc->psc_pi = pi; /* initialize config space */ - if ((error = cfginit(ctx, pi, bus, slot, func)) != 0) + if ((error = cfginit(pi, bus, slot, func)) != 0) goto done; /* initialize ROM */ - if ((error = passthru_init_rom(ctx, sc, + if ((error = passthru_init_rom(sc, get_config_value_node(nvl, "rom"))) != 0) goto done; @@ -861,7 +860,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) done: if (error) { free(sc); - vm_unassign_pptdev(ctx, bus, slot, func); + vm_unassign_pptdev(pi->pi_vmctx, bus, slot, func); } return (error); } @@ -903,8 +902,7 @@ msixcap_access(struct passthru_softc *sc, int coff) } static int -passthru_cfgread(struct vmctx *ctx __unused, struct pci_devinst *pi, int coff, - int bytes, uint32_t *rv) +passthru_cfgread(struct pci_devinst *pi, int coff, int bytes, uint32_t *rv) { struct passthru_softc *sc; @@ -948,8 +946,7 @@ passthru_cfgread(struct vmctx *ctx __unused, struct pci_devinst *pi, int coff, } static int -passthru_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, int coff, - int bytes, uint32_t val) +passthru_cfgwrite(struct pci_devinst *pi, int coff, int bytes, uint32_t val) { int error, msix_table_entries, i; struct passthru_softc *sc; @@ -969,7 +966,7 @@ passthru_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, int coff, if (msicap_access(sc, coff)) { pci_emul_capwrite(pi, coff, bytes, val, sc->psc_msi.capoff, PCIY_MSI); - error = vm_setup_pptdev_msi(ctx, 0, sc->psc_sel.pc_bus, + error = vm_setup_pptdev_msi(pi->pi_vmctx, 0, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.addr, pi->pi_msi.msg_data, pi->pi_msi.maxmsgnum); @@ -984,7 +981,7 @@ passthru_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, int coff, if (pi->pi_msix.enabled) { msix_table_entries = pi->pi_msix.table_count; for (i = 0; i < msix_table_entries; i++) { - error = vm_setup_pptdev_msix(ctx, 0, + error = vm_setup_pptdev_msix(pi->pi_vmctx, 0, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, i, pi->pi_msix.table[i].addr, @@ -995,8 +992,9 @@ passthru_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, int coff, err(1, "vm_setup_pptdev_msix"); } } else { - error = vm_disable_pptdev_msix(ctx, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, sc->psc_sel.pc_func); + error = vm_disable_pptdev_msix(pi->pi_vmctx, + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func); if (error) err(1, "vm_disable_pptdev_msix"); } @@ -1029,8 +1027,8 @@ passthru_cfgwrite(struct vmctx *ctx, struct pci_devinst *pi, int coff, } static void -passthru_write(struct vmctx *ctx, struct pci_devinst *pi, int baridx, - uint64_t offset, int size, uint64_t value) +passthru_write(struct pci_devinst *pi, int baridx, uint64_t offset, int size, + uint64_t value) { struct passthru_softc *sc; struct pci_bar_ioreq pio; @@ -1038,7 +1036,7 @@ passthru_write(struct vmctx *ctx, struct pci_devinst *pi, int baridx, sc = pi->pi_arg; if (baridx == pci_msix_table_bar(pi)) { - msix_table_write(ctx, sc, offset, size, value); + msix_table_write(sc, offset, size, value); } else { assert(pi->pi_bar[baridx].type == PCIBAR_IO); assert(size == 1 || size == 2 || size == 4); @@ -1057,8 +1055,7 @@ passthru_write(struct vmctx *ctx, struct pci_devinst *pi, int baridx, } static uint64_t -passthru_read(struct vmctx *ctx __unused, struct pci_devinst *pi, int baridx, - uint64_t offset, int size) +passthru_read(struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct passthru_softc *sc; struct pci_bar_ioreq pio; @@ -1089,8 +1086,8 @@ passthru_read(struct vmctx *ctx __unused, struct pci_devinst *pi, int baridx, } static void -passthru_msix_addr(struct vmctx *ctx, struct pci_devinst *pi, int baridx, - int enabled, uint64_t address) +passthru_msix_addr(struct pci_devinst *pi, int baridx, int enabled, + uint64_t address) { struct passthru_softc *sc; size_t remaining; @@ -1100,13 +1097,14 @@ passthru_msix_addr(struct vmctx *ctx, struct pci_devinst *pi, int baridx, table_offset = rounddown2(pi->pi_msix.table_offset, 4096); if (table_offset > 0) { if (!enabled) { - if (vm_unmap_pptdev_mmio(ctx, sc->psc_sel.pc_bus, + if (vm_unmap_pptdev_mmio(pi->pi_vmctx, + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, address, table_offset) != 0) warnx("pci_passthru: unmap_pptdev_mmio failed"); } else { - if (vm_map_pptdev_mmio(ctx, sc->psc_sel.pc_bus, + if (vm_map_pptdev_mmio(pi->pi_vmctx, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, *** 398 LINES SKIPPED *** From nobody Thu Jan 19 18:33:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyWV04wtzz31205; Thu, 19 Jan 2023 18:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyWV03rrPz43bN; Thu, 19 Jan 2023 18:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674153208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQ5TFdocosVWewQ5Qyf7vVZW4AptGQ6va2im6xf2cDM=; b=AOc8/jNwAssER5jC18QRnhE1+8mcaZWWpmI5Gc39yLdLJ45YJQd7IDEiKgdQbixrBEK8L9 l8haD/UKwk8USb7X1c8UFnGAM0a1dsZWdBoRHfC2TtD3FpiUQAex2Nmg2N6Cv+VHrM4MoC flGZmOew9c9Nl9QtdU8+wTHet9/MEubek9Dve3VMrvcQ/pEbzX3Y5R8zHxrez5sxQC4XNj iHkznAt6g6vFcwAe3XfTJ+wvUYakLhB0Z2kczf6GJIHGKwIxY62uLpmYWUaFRWGS9r7pyw /BM81K3YhNcoD8Gt8W0To11hxmDJdIRlXnelUzLGs8Vl0EdBEZJGuTB5PMl7SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674153208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQ5TFdocosVWewQ5Qyf7vVZW4AptGQ6va2im6xf2cDM=; b=QUyYp5FMpO6Oy+A4OchGDgf2fMTvxw7caUWd42iHnJcUEKiRGpPVF4rCfl2xxfKbbDSzuX 46z/AyhCM+IPc8sAZgIwAECDZrfTcYP8J9XJHw2IiPMUsP3bp5JV51UWwiVmQ7r6dlUCU1 o6ksfS+cNwXuQVpcjdWy42mIe1gV9j8pRjPkRnVFO7hK3lpVW0A0mVYVubZmrObkuGrK0/ /OGHquocUyZXPvmkVrPz9bP5xQpXsA8wo4hYlXZf9MUPTs2hWRwgD1FqnJZd9yy0oInlGj jkznVmEawrN2RDwElg26vlEYLWI6IHPlqgr4gkhK7LOo6QU5mLNWvt0s8g8JjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674153208; a=rsa-sha256; cv=none; b=wf/k+7CyUoDaqPUmuODtcU5P2CBVDR4zepgXpjO6ep600gWp5TJtFdhx9FvfNcW/CL8bnu wCpLI6fbJxc3hTvz+IWkPfo61UV3Llbv9jS96QvDgQeOgp+XwBis7mmwjJ5HBXdfBU1F7u l1R9lNDh/9owYS3KkKQkLQh9dCBJ1myYJbbgcPOmWjIuuNAumOR6p7LxxJ05tNAfNGIHwI jbcw7yPJlftZmf00RLSIiUC4rUVl/wxSA40bu83A8vaJrbr/HL9657KFLSerlOd59UWscb LSo8K+0s25dJoM28CceMZ9Gz2LXhm9sge+q3wxYUJ1D3qI9eQkZTwmre4EKhZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyWV02wKWz11Jx; Thu, 19 Jan 2023 18:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JIXSg5083097; Thu, 19 Jan 2023 18:33:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JIXSf8083096; Thu, 19 Jan 2023 18:33:28 GMT (envelope-from git) Date: Thu, 19 Jan 2023 18:33:28 GMT Message-Id: <202301191833.30JIXSf8083096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: fc1901abcfa9 - main - : Reduce overly broad header pollution. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc1901abcfa95bbdf985ee86ce24fa73c30d5076 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fc1901abcfa95bbdf985ee86ce24fa73c30d5076 commit fc1901abcfa95bbdf985ee86ce24fa73c30d5076 Author: John Baldwin AuthorDate: 2023-01-19 18:32:45 +0000 Commit: John Baldwin CommitDate: 2023-01-19 18:32:45 +0000 : Reduce overly broad header pollution. Commit d3f96f661050e9bd21fe29931992a8b9e67ff189 removed and replaced it with the very broad . However, none of the changes to sysctl.h in that commit require anything defined in . On the other hand, does still make use of queue macros. Drop the include of and re-add . Reviewed by: imp, kib, asomers Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D37950 --- sys/sys/sysctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 207ffe4a62e7..79da4772615f 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -39,8 +39,8 @@ #define _SYS_SYSCTL_H_ #ifdef _KERNEL +#include #include -#include #endif /* From nobody Thu Jan 19 22:25:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nycdx6n84z2srFQ; Thu, 19 Jan 2023 22:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nycdx6HZrz4LbY; Thu, 19 Jan 2023 22:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674167141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mK1mny0hRRjLks7CyGJ3nsedMyPNCeJNh6kZcYhypTk=; b=sBO/aODWw/zjkTLR44qa5g09NPiSoTDlmfdVFlH6nXEcFSVSgJLCR165wTVgTTlAOkOslg auV72iX4KFxZRGFZOa+GjL+7NPyg+slVcSj25OrRnLJt0P0fpRuLqyqmHQy9AH7t0024KC 00qSJtQjj7GeHifXjQgKtVKo/WbA8bP1TF2FtAomMnw6t42Lba+zZLhvfDFv9fs1b5Q4Bm Fyyxf8JNC8tdVbtY9pomQqCf/kIBSe6swCKEnKyMr1gB4L+gNqxrL+Tx3fCeRdt38FERI7 0/OHrtSVYYiguExGdLsgmyD0ErDJYgbjNmsao6aRcbXUk36hC7/Gom5qlSwJhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674167141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mK1mny0hRRjLks7CyGJ3nsedMyPNCeJNh6kZcYhypTk=; b=MSKdwL3y8Jr2NNIVLlZf4WgB8MNw/Kz+AXyVrPFUsEj/JsKSnSksI/gUWqCNyId2YJBk6g WyX2HuTtiOiO4zl5lwHjyI8YLDcY8Kt312U6xGIvzZj6eBcvop9Jt9jgdBZoFXn6D/LU9D QxKZaNAJNb8ENATgQXXqHzc1tn1AlBuBBzO3fIIw4axbOOaw8n+V59CvEtkw+ln+6Obs+S dLfH/2JuybGdVzl6Gbfu9rVMjoYFC9j4M0snTggzcvWNwiQLqD6VQwTUpkBBbeZ9IcgBUI qPeQc0peW0Ovme/MgkkloNlMYqgx2mNS9JXrBCTzu22UBNqWFHOteAnz+1HD0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674167141; a=rsa-sha256; cv=none; b=tWAOItmbPfR91XBPK+8Lzg35JPiBD0B7Dqs//fCUXiT7bHJ2brruglI4XiuxNBXGm8LRJ5 abUK2LEKmF/TB/TDtsCjruVKcV/iSvcdgwHXQ8LTe86OeJB0q7hCL+mbKSNbVf8CC/eMJI Auv1+G5BMCobmXMhr5fBT3cW8vqlGJFqX0jsHM+kJEy895tQIQfWBIW5MV2peyCF29meoX mdVpsVtgc1mZAN684brOH+J2mfHQWCdGi7VijEZhou39ACbA5cXIKiy8rpLY3o6yh7l/AR EnGUIkIW629TE7SJ1u2/keth2e67f9jF8oYvdphP+4tv1BFXAOOltHiW04opJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nycdx5LCkz16Qy; Thu, 19 Jan 2023 22:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JMPf2j011701; Thu, 19 Jan 2023 22:25:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JMPfqW011700; Thu, 19 Jan 2023 22:25:41 GMT (envelope-from git) Date: Thu, 19 Jan 2023 22:25:41 GMT Message-Id: <202301192225.30JMPfqW011700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 16fbf0191243 - main - Makefile: Avoid sanitizing PATH on non-FreeBSD systems List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16fbf0191243e7c9dff6615b1424b5d39186b36c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=16fbf0191243e7c9dff6615b1424b5d39186b36c commit 16fbf0191243e7c9dff6615b1424b5d39186b36c Author: Jake Freeland AuthorDate: 2023-01-19 22:24:44 +0000 Commit: Jessica Clarke CommitDate: 2023-01-19 22:24:44 +0000 Makefile: Avoid sanitizing PATH on non-FreeBSD systems Allow the build process to find host binaries during the host-symlinks target when cross-building on non-FreeBSD systems. Whilst most non-FreeBSD systems have all the needed tools in /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin (the final path added by host-symlinks itself), Homebrew for macOS on Arm defaults to /opt/homebrew/bin, other more niche systems may also deviate and users may expect tools in a customised PATH to be picked up, unlike on FreeBSD where we want to ensure everything comes from base. In particular, (un)xz are needed from Homebrew on macOS, and thus cannot be found on Arm without this. Note that non-FreeBSD builds enforce BUILD_WITH_STRICT_TMPPATH, and so the actual main build steps will still use a sanitised PATH. Reviewed by: jrtc27, arichardson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37991 --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 7ca6d5d9c218..62d2869bfc03 100644 --- a/Makefile +++ b/Makefile @@ -217,7 +217,12 @@ META_TGT_WHITELIST+= \ .ORDER: buildkernel reinstallkernel .ORDER: buildkernel reinstallkernel.debug +# Only sanitize PATH on FreeBSD. +# PATH may include tools that are required to cross-build +# on non-FreeBSD systems. +.if ${.MAKE.OS} == "FreeBSD" PATH= /sbin:/bin:/usr/sbin:/usr/bin +.endif MAKEOBJDIRPREFIX?= /usr/obj _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ From nobody Thu Jan 19 22:49:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nyd9452Rtz2svPS; Thu, 19 Jan 2023 22:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nyd944VN6z4PBR; Thu, 19 Jan 2023 22:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674168552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f28niiw2d7uqRnSGieiAW1txXQcMDXUnq9ngYLMTt4=; b=y3vB6MT+GBQnh8CSiM6H4jCef/7YlLkriMfYpdqApt7vDlZPwLuLQ3m2yx3+3B8AXfuS0V 8URkxrbcKVYnBe2QYvcj/wfecmgsOsKq1prHqhZ5FEfKzuZlBEWnwDkHBYDVAF34zuLEcz LlOcFOe4TKB/+BFO3r+dtoA8wzBHNuqEbU46OSmeWVwB8nbJG3Qp4w44Uasi5gwnM/nrgx VrYUClVpIm9VLgTz8C+GCVa44nYF6iTyqkEhnrJYG7z8DmKNAx5Hz98OUk4nlXXltciKj2 ZukPr21jzWbHfuQHYWEGxxSD83J786SFsp7O+dB9Z1DxtX/ZLU59ynE/BLPifw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674168552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f28niiw2d7uqRnSGieiAW1txXQcMDXUnq9ngYLMTt4=; b=VAytz0axJROd3lRRVNGjPDu87wtW2AD96DTCRBJKuT60n820VeyMmQqXe80BL6VruqHCsY DInV+SwezpiR7lX1I/v0rcjz/bcZf/k+q7RrnMXO5pqX3D3Wh6ut1Qo+n191QQ3qJSNWdk QDxxp6h2DLSHwCAtOdcBrcI+zBadrZBcM0lP/CVkoY/yuMaSDaycS83fK/55ILsld1Kg5j kuAOGEhwrW5EQrC3pylLlAKoVuen70idZ3epjq6u8OVyxZ0KeN8aOb9lTBrT323+hfRJ9T H4OQem23Ze29LEhVw6HRArmuXOZZSYXDL5bifmHnxbkSN+g3i7yVefaAm0dUhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674168552; a=rsa-sha256; cv=none; b=llnoqqDX1HyDM6i4NqgvBvhrhnF3xOcUaIgm3zGn4a17Xb2Botvwdo2q9bcn6Bgz7yPnGe dJZc7Y+PBtpD03vZdMWOH16qS6xCy1fHl5pPMUT4YUt/6NbcTXTHtnt26uTGCH5+ReB/Kg JTjAlgep0Sb1W5kGl8U19kUXFa4w7TjZvRKgVYiF5PgIypaQTzFyxzZv5uf8zYKBem0QSa a2TKDpI8lwjYoaHy595nAC5YKyx7TciyOKq02CZEAH4d/cWE2Ny23iZOF0kW6dmRq/5LdC bTN+7nzHHuw5pHvKCPUUAd4S056dUmJsypRvn7tsaSVq0OVIo8M3O3BKbssWRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nyd943XVPz172P; Thu, 19 Jan 2023 22:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30JMnCl4040411; Thu, 19 Jan 2023 22:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JMnCXf040410; Thu, 19 Jan 2023 22:49:12 GMT (envelope-from git) Date: Thu, 19 Jan 2023 22:49:12 GMT Message-Id: <202301192249.30JMnCXf040410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 43703bc489ec - main - stdlib.h: Fix qsort_r compatibility with GCC 12. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43703bc489ec504b947b869045c492ed38c1a69c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=43703bc489ec504b947b869045c492ed38c1a69c commit 43703bc489ec504b947b869045c492ed38c1a69c Author: John Baldwin AuthorDate: 2023-01-19 22:48:52 +0000 Commit: John Baldwin CommitDate: 2023-01-19 22:48:52 +0000 stdlib.h: Fix qsort_r compatibility with GCC 12. GCC 12 (unlike GCC 9) does not match a function argument passed to the old qsort_r() API (as is used in the qsort_r_compat test) to a function pointer type via __generic. It treats the function type as a distinct type from a function pointer. As a workaround, add a second definition of qsort_r for GCC 12 which uses the bare function type. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D37410 --- include/stdlib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/stdlib.h b/include/stdlib.h index 754e8f5f5fd4..30d24aea1c10 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -352,9 +352,15 @@ void __qsort_r_compat(void *, size_t, size_t, void *, __sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0); #endif #if defined(__generic) && !defined(__cplusplus) +#if __GNUC__ == 12 +#define qsort_r(base, nel, width, arg4, arg5) \ + __generic(arg5, int (void *, const void *, const void *), \ + __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) +#else #define qsort_r(base, nel, width, arg4, arg5) \ __generic(arg5, int (*)(void *, const void *, const void *), \ __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) +#endif #elif defined(__cplusplus) __END_DECLS extern "C++" { From nobody Thu Jan 19 23:11:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NydfX4gF2z2syM9 for ; Thu, 19 Jan 2023 23:11:16 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NydfX2zj9z4Qk6 for ; Thu, 19 Jan 2023 23:11:16 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f45.google.com with SMTP id o17-20020a05600c511100b003db021ef437so2448735wms.4 for ; Thu, 19 Jan 2023 15:11:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hNyihUG+xqV0Jr16I7HNSjlPlaecKCo3MYRwsLarIfc=; b=dxIvHHQII4yPrDNGQoi5AsR0bzDy9dPrGxt3WDKCdKWuKeUl6JwF1E2j4OH3+wOZ5y 5LSWpmiU+5FKlP8FpMROflHvkvHSAFkE/o2qSQGC5b8082zmUQmau4UEmQIHoYY/69Fk LIFOBF6ocUr0q0gMux34Azx0RhOv3U6bMkI8WP3Dwf4xzejIjjvR13sAiHVo81vDnxYL MI5cXjsOgCqFGrZmety4d359EgGYVWgI3rfbhCwGu3S8jBMFyTXE+nRXbfLPIFoEHTIv wL6/NFw+7bRoZbLZccR/nukHpzbrlB06CJk9rIvteTqAw2ut5V3JYt9vkHJvKocvA3+3 HOiw== X-Gm-Message-State: AFqh2kpgCrJC7NeWXeKSmhZ6QuuGTLg/VpcE5jtcFANfKSlqc1+Fo/Y1 h8LAsR31n/kBkD3JHqn+ozuDaA== X-Google-Smtp-Source: AMrXdXsgYNhPQkKfBv4Ico8VFslQe9fCTflxBQnYq6AWOARVAYHPHiYow/IqzyrTcQnTzp8xMPWVhg== X-Received: by 2002:a05:600c:600e:b0:3c6:e62e:2e74 with SMTP id az14-20020a05600c600e00b003c6e62e2e74mr8200340wmb.15.1674169874533; Thu, 19 Jan 2023 15:11:14 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id v7-20020a05600c444700b003db06493ee7sm456472wmn.47.2023.01.19.15.11.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2023 15:11:14 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 43703bc489ec - main - stdlib.h: Fix qsort_r compatibility with GCC 12. From: Jessica Clarke In-Reply-To: <202301192249.30JMnCXf040410@gitrepo.freebsd.org> Date: Thu, 19 Jan 2023 23:11:13 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202301192249.30JMnCXf040410@gitrepo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4NydfX2zj9z4Qk6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 19 Jan 2023, at 22:49, John Baldwin wrote: >=20 > The branch main has been updated by jhb: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D43703bc489ec504b947b869045c492ed= 38c1a69c >=20 > commit 43703bc489ec504b947b869045c492ed38c1a69c > Author: John Baldwin > AuthorDate: 2023-01-19 22:48:52 +0000 > Commit: John Baldwin > CommitDate: 2023-01-19 22:48:52 +0000 >=20 > stdlib.h: Fix qsort_r compatibility with GCC 12. >=20 > GCC 12 (unlike GCC 9) does not match a function argument passed to = the > old qsort_r() API (as is used in the qsort_r_compat test) to a > function pointer type via __generic. It treats the function type = as a > distinct type from a function pointer. As a workaround, add a = second > definition of qsort_r for GCC 12 which uses the bare function type. As far as I can tell both versions of GCC behave the same. The difference is whether __generic is using _Generic or __builtin_choose_expr with __builtin_types_compatible_p, since function and function pointer types are not compatible. Clang will take the __has_extension path, but GCC will take the builtins path, and so Clang works but GCC doesn=E2=80=99t. As a result of this change you=E2=80=99ve likely broken code that does qsort_r(..., &f) as that will have the opposite problem. The right fix is to force arg5 to decay, such as by (ab)using the comma operator with __generic((0, arg5), ...). I guess that probably belongs in the fallback implementation of __generic though, not here, which would give the following real fix: diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 83ba7584e5b9..f7eff4768151 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -312,6 +312,9 @@ * __generic(). Unlike _Generic(), this macro can only distinguish * between a single type, so it requires nested invocations to * distinguish multiple cases. + * + * Note that the comma operator is used to force expr to decay in order = to + * match _Generic. */ =20 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >=3D 201112L) || \ @@ -321,7 +324,7 @@ #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __generic(expr, t, yes, no) = \ __builtin_choose_expr( = \ - __builtin_types_compatible_p(__typeof(expr), t), yes, no) + __builtin_types_compatible_p(__typeof((0, expr)), t), yes, = no) #endif =20 /* Does that work instead for you after reverting this commit? Jess > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D37410 > --- > include/stdlib.h | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/include/stdlib.h b/include/stdlib.h > index 754e8f5f5fd4..30d24aea1c10 100644 > --- a/include/stdlib.h > +++ b/include/stdlib.h > @@ -352,9 +352,15 @@ void __qsort_r_compat(void *, size_t, size_t, = void *, > __sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0); > #endif > #if defined(__generic) && !defined(__cplusplus) > +#if __GNUC__ =3D=3D 12 > +#define qsort_r(base, nel, width, arg4, arg5) = \ > + __generic(arg5, int (void *, const void *, const void *), = \ > + __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) > +#else > #define qsort_r(base, nel, width, arg4, arg5) = \ > __generic(arg5, int (*)(void *, const void *, const void *), = \ > __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) > +#endif > #elif defined(__cplusplus) > __END_DECLS > extern "C++" { From nobody Thu Jan 19 23:31:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nyf5x6mD0z2t1HW for ; Thu, 19 Jan 2023 23:31:33 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nyf5x1WpTz3D2H for ; Thu, 19 Jan 2023 23:31:33 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wr1-f52.google.com with SMTP id r30so3374855wrr.10 for ; Thu, 19 Jan 2023 15:31:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9XHDxxph9npO1ci8/XwVp8KvjPPWrleqGDgxEhFaCTI=; b=47IiaUWoOam0k0HiBza2iJDzEsiR6uUT6xEX0arjkTim+DxHqybtdYodfa9XRBI+6y byjWhSYhE5hWSp6YwSjwFtcgslWKXbUWa7xv9Mzig/RBOjoUwv2mO0S6CfgEWSKY01Ww rNcAcnbNJbIEJgkIqTKLbofn7T4xpHNutuQ+SSuy6F//dVWc7wXYUiTHuyb05sZiKtaO rAiq+zufQIP+M1loyRwS178cT9Iby+tgyWtnLkDeih1kop/hDEec6dNto+wk+OaCHK2Z tj7O9XTB2E0NbgbVVgRyjPbGlEHK1FSLucsZOfM45gDgP+eOZ4bX7mdagovFk53pXPMz qciw== X-Gm-Message-State: AFqh2kqcgmSypNeipraEOE9SggZ9tWpA8QDTN1QLPI46tsmq8wBF0gv3 q0LYBuUwzxYhHGRnvBo1eiJGwQ== X-Google-Smtp-Source: AMrXdXvJenTA5AayZFD4lpbH6aHgPW89ikniVCpM1QTO9CvD93/KT0EebwayKSwWYnpKIqqE1RNy1g== X-Received: by 2002:adf:e6cc:0:b0:2be:53d1:51ce with SMTP id y12-20020adfe6cc000000b002be53d151cemr884355wrm.37.1674171091671; Thu, 19 Jan 2023 15:31:31 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id r9-20020adff709000000b00291f1a5ced6sm13911907wrp.53.2023.01.19.15.31.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2023 15:31:31 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 43703bc489ec - main - stdlib.h: Fix qsort_r compatibility with GCC 12. From: Jessica Clarke In-Reply-To: Date: Thu, 19 Jan 2023 23:31:30 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8C902ED3-D9F8-4F88-8D43-F8E4809C9D44@freebsd.org> References: <202301192249.30JMnCXf040410@gitrepo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.52:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.52:from] X-Rspamd-Queue-Id: 4Nyf5x1WpTz3D2H X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 19 Jan 2023, at 23:11, Jessica Clarke wrote: >=20 > On 19 Jan 2023, at 22:49, John Baldwin wrote: >>=20 >> The branch main has been updated by jhb: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D43703bc489ec504b947b869045c492ed= 38c1a69c >>=20 >> commit 43703bc489ec504b947b869045c492ed38c1a69c >> Author: John Baldwin >> AuthorDate: 2023-01-19 22:48:52 +0000 >> Commit: John Baldwin >> CommitDate: 2023-01-19 22:48:52 +0000 >>=20 >> stdlib.h: Fix qsort_r compatibility with GCC 12. >>=20 >> GCC 12 (unlike GCC 9) does not match a function argument passed to = the >> old qsort_r() API (as is used in the qsort_r_compat test) to a >> function pointer type via __generic. It treats the function type = as a >> distinct type from a function pointer. As a workaround, add a = second >> definition of qsort_r for GCC 12 which uses the bare function type. >=20 > As far as I can tell both versions of GCC behave the same. The > difference is whether __generic is using _Generic or > __builtin_choose_expr with __builtin_types_compatible_p, since = function > and function pointer types are not compatible. Clang will take the > __has_extension path, but GCC will take the builtins path, and so = Clang > works but GCC doesn=E2=80=99t. >=20 > As a result of this change you=E2=80=99ve likely broken code that does > qsort_r(..., &f) as that will have the opposite problem. The right fix > is to force arg5 to decay, such as by (ab)using the comma operator = with > __generic((0, arg5), ...). I guess that probably belongs in the > fallback implementation of __generic though, not here, which would = give > the following real fix: >=20 > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > index 83ba7584e5b9..f7eff4768151 100644 > --- a/sys/sys/cdefs.h > +++ b/sys/sys/cdefs.h > @@ -312,6 +312,9 @@ > * __generic(). Unlike _Generic(), this macro can only distinguish > * between a single type, so it requires nested invocations to > * distinguish multiple cases. > + * > + * Note that the comma operator is used to force expr to decay in = order to > + * match _Generic. > */ >=20 > #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >=3D 201112L) || \ > @@ -321,7 +324,7 @@ > #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) > #define __generic(expr, t, yes, no) = \ > __builtin_choose_expr( = \ > - __builtin_types_compatible_p(__typeof(expr), t), yes, no) > + __builtin_types_compatible_p(__typeof((0, expr)), t), yes, = no) With (expr) instead of expr, of course... Jess > #endif >=20 > /* >=20 > Does that work instead for you after reverting this commit? >=20 > Jess >=20 >> Reviewed by: emaste >> Differential Revision: https://reviews.freebsd.org/D37410 >> --- >> include/stdlib.h | 6 ++++++ >> 1 file changed, 6 insertions(+) >>=20 >> diff --git a/include/stdlib.h b/include/stdlib.h >> index 754e8f5f5fd4..30d24aea1c10 100644 >> --- a/include/stdlib.h >> +++ b/include/stdlib.h >> @@ -352,9 +352,15 @@ void __qsort_r_compat(void *, size_t, size_t, = void *, >> __sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0); >> #endif >> #if defined(__generic) && !defined(__cplusplus) >> +#if __GNUC__ =3D=3D 12 >> +#define qsort_r(base, nel, width, arg4, arg5) = \ >> + __generic(arg5, int (void *, const void *, const void *), = \ >> + __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) >> +#else >> #define qsort_r(base, nel, width, arg4, arg5) = \ >> __generic(arg5, int (*)(void *, const void *, const void *), = \ >> __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) >> +#endif >> #elif defined(__cplusplus) >> __END_DECLS >> extern "C++" { From nobody Thu Jan 19 23:36:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyfCF1fzlz2t1t1 for ; Thu, 19 Jan 2023 23:36:09 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyfCD4TM2z3Dwv for ; Thu, 19 Jan 2023 23:36:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wm1-f42.google.com with SMTP id f12-20020a7bc8cc000000b003daf6b2f9b9so4717807wml.3 for ; Thu, 19 Jan 2023 15:36:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0E5blZrwouTbMzb5jg+vbAyiqrzXujdiKqNsy19G0Mk=; b=cLtMVqX1MR2fNTHF43L1+5RT7RphHfYI9HseYVj3JN+FPcM6FdEldhwPOMrkFdr6sJ wEcZLEpq8TrXByoJ2b0fN/mSKhv+851y5MgeXm6RY0GOFmqBrZGlU/NId7wZpTfo32rp tnlGl+g5/cOiQVcF0rI579QJQaCrZfv3LYAMLs/xdXuHAiAUqHsIoTuu5qon0Khjii4v 4CxFWu0hC18Zf6K6phHNwujrz4suh2gnfINZ9KgMnUhTO9gok6QCGRM3tqACRZYFX5Gc vs7Hr0LqLJfIUQ7zcMA8Sm+9xlH2W+mdIkrkkYRj3LqSto5Ri2rgyE8s0dbBdVfur+mB 3Ikg== X-Gm-Message-State: AFqh2koF5qIhvbw4+E4+xEfUfHwdfcn6sMpa3jQJUab31k8XDaiV2cV1 Q0H/iuxaZG9SN96AD5g5wmmjqw== X-Google-Smtp-Source: AMrXdXuVKkC+sxHkt9mdoKLVkUY/atpqdKmCsmZ79pR9KGZHC/cWb8qcvYv/LJh2JO7pzBObF1R+uw== X-Received: by 2002:a05:600c:33a8:b0:3d9:ed3b:5b3e with SMTP id o40-20020a05600c33a800b003d9ed3b5b3emr11567466wmp.19.1674171366754; Thu, 19 Jan 2023 15:36:06 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c310a00b003d99da8d30asm527240wmo.46.2023.01.19.15.36.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2023 15:36:06 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 43703bc489ec - main - stdlib.h: Fix qsort_r compatibility with GCC 12. From: Jessica Clarke In-Reply-To: <8C902ED3-D9F8-4F88-8D43-F8E4809C9D44@freebsd.org> Date: Thu, 19 Jan 2023 23:36:05 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <0F50986C-BC29-4A7A-89F0-DAB3863BF51B@freebsd.org> References: <202301192249.30JMnCXf040410@gitrepo.freebsd.org> <8C902ED3-D9F8-4F88-8D43-F8E4809C9D44@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.42:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.42:from] X-Rspamd-Queue-Id: 4NyfCD4TM2z3Dwv X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 19 Jan 2023, at 23:31, Jessica Clarke wrote: >=20 > On 19 Jan 2023, at 23:11, Jessica Clarke wrote: >>=20 >> On 19 Jan 2023, at 22:49, John Baldwin wrote: >>>=20 >>> The branch main has been updated by jhb: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D43703bc489ec504b947b869045c492ed= 38c1a69c >>>=20 >>> commit 43703bc489ec504b947b869045c492ed38c1a69c >>> Author: John Baldwin >>> AuthorDate: 2023-01-19 22:48:52 +0000 >>> Commit: John Baldwin >>> CommitDate: 2023-01-19 22:48:52 +0000 >>>=20 >>> stdlib.h: Fix qsort_r compatibility with GCC 12. >>>=20 >>> GCC 12 (unlike GCC 9) does not match a function argument passed to = the >>> old qsort_r() API (as is used in the qsort_r_compat test) to a >>> function pointer type via __generic. It treats the function type = as a >>> distinct type from a function pointer. As a workaround, add a = second >>> definition of qsort_r for GCC 12 which uses the bare function type. >>=20 >> As far as I can tell both versions of GCC behave the same. The >> difference is whether __generic is using _Generic or >> __builtin_choose_expr with __builtin_types_compatible_p, since = function >> and function pointer types are not compatible. Clang will take the >> __has_extension path, but GCC will take the builtins path, and so = Clang >> works but GCC doesn=E2=80=99t. >>=20 >> As a result of this change you=E2=80=99ve likely broken code that = does >> qsort_r(..., &f) as that will have the opposite problem. The right = fix >> is to force arg5 to decay, such as by (ab)using the comma operator = with >> __generic((0, arg5), ...). I guess that probably belongs in the >> fallback implementation of __generic though, not here, which would = give >> the following real fix: >>=20 >> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >> index 83ba7584e5b9..f7eff4768151 100644 >> --- a/sys/sys/cdefs.h >> +++ b/sys/sys/cdefs.h >> @@ -312,6 +312,9 @@ >> * __generic(). Unlike _Generic(), this macro can only distinguish >> * between a single type, so it requires nested invocations to >> * distinguish multiple cases. >> + * >> + * Note that the comma operator is used to force expr to decay in = order to >> + * match _Generic. >> */ >>=20 >> #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >=3D 201112L) || \ >> @@ -321,7 +324,7 @@ >> #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) >> #define __generic(expr, t, yes, no) = \ >> __builtin_choose_expr( = \ >> - __builtin_types_compatible_p(__typeof(expr), t), yes, no) >> + __builtin_types_compatible_p(__typeof((0, expr)), t), yes, = no) >=20 > With (expr) instead of expr, of course... And as for why GCC 9 works: It doesn=E2=80=99t. The tests just aren=E2=80=99t built because = MK_CXX=3Dno disables MK_TESTS. GCC 12 only hits it because it=E2=80=99s new enough to be able = to build libc++ and not force MK_CXX=3Dno. It would be nice to unpick that... Jess > Jess >=20 >> #endif >>=20 >> /* >>=20 >> Does that work instead for you after reverting this commit? >>=20 >> Jess >>=20 >>> Reviewed by: emaste >>> Differential Revision: https://reviews.freebsd.org/D37410 >>> --- >>> include/stdlib.h | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>>=20 >>> diff --git a/include/stdlib.h b/include/stdlib.h >>> index 754e8f5f5fd4..30d24aea1c10 100644 >>> --- a/include/stdlib.h >>> +++ b/include/stdlib.h >>> @@ -352,9 +352,15 @@ void __qsort_r_compat(void *, size_t, size_t, = void *, >>> __sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0); >>> #endif >>> #if defined(__generic) && !defined(__cplusplus) >>> +#if __GNUC__ =3D=3D 12 >>> +#define qsort_r(base, nel, width, arg4, arg5) = \ >>> + __generic(arg5, int (void *, const void *, const void *), = \ >>> + __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) >>> +#else >>> #define qsort_r(base, nel, width, arg4, arg5) = \ >>> __generic(arg5, int (*)(void *, const void *, const void *), = \ >>> __qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) >>> +#endif >>> #elif defined(__cplusplus) >>> __END_DECLS >>> extern "C++" { From nobody Thu Jan 19 23:50:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyfWM4YS1z2t3Kk; Thu, 19 Jan 2023 23:50:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyfWM43fPz3GFn; Thu, 19 Jan 2023 23:50:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674172207; 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=yOdS/3pe1JMneN6kDKnXBxqPe2bAulXPrwv853sHWmo=; b=yFJ90uCAPmj+vdQWFKr9iYtgvwMZzkchGsgeAOc1qNw1gEqd4Mz4Q2oQSS1HA5D3ji9K/Q Vehcj9BGRmmz7kK4xcEiIlOYogpietny+HfeOLbb24twucQDNRD6DW+kiag1BDoXEYCBCl 5kLFrYytrDfguai0+Jp42+f5zJrkrlkugDQihcF8SHLUbKX4H6ezFTvn0kAMHgTafaTyvC svFKOEL4ZWGwFn18F48IzhtCfa0jm1Q5u8CCMn4xgrJgl6cv/RWIq/EfEGoLIJQYNXUDpI nbF4ib9WNP8doq2BdYJH2SSayw2UhOhXnlyHiyyPdIi6N4YPjh8wsqovi01MsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674172207; 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=yOdS/3pe1JMneN6kDKnXBxqPe2bAulXPrwv853sHWmo=; b=sSzQ3YJTIrX5dzs/jjFeZpvYPmYT1buBUJL7fbY3MoVvfz042rDp+vdSWk3Zy6x3qlg5sD XEaUYK/0GqVb5BEebr4MzhTOFQXrmzeeRBW+V/4lXy9nvxLJOl7YrENsIBmBF3kAsLKGnD Aks3AfuppNFs9FjOSIKc26AHLwZCVeudcmpe4Ms2YZyPLa/Y66iCS6QbaSBZpvlRhrTt/c AubEMzaZqAEYGtT6f2BH8mfWGlmn9to8J12tpATV9zuckNgVyTr0jmXhjlmSixCKctmmvp tIrGscqAH+V0aW+j8a72x3o6TndHP7398MOos5Rw/i6fmK4WzN4HFf2j+SBkvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674172207; a=rsa-sha256; cv=none; b=nuDcGKXFozYk95Mdly/3OIuEozd03+NUtcXk+SH76QjHZUNVeBZW71QoAymNB5g+NH5+jP tCqwE/refEYL79ofniJlMt7EinuuIYWGuzIbjCnnEhhl3ek5oyuBFBO8O7yfXk1NHQCE5w OfL8WhoByy3+tpU77vhsMRaBHVKCXo0mtESWK2ipLwj4Twrvkk/BRxVfOYqG8mzt9P5mi3 sOj5+29QFAUk/18eNVgW0VQ0yVU4FgITvORaZdD1Fggcu9CbRso3C7yvu1dgfL36MsRen1 1xrqn+DU1jaTuygjV7KDeehIY6W76WjdDl7WVKbRAW15Bp3rP7O70GxKTq6XpQ== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NyfWL6sfkzxpZ; Thu, 19 Jan 2023 23:50:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <343ea0b5-28fa-efa6-b3d3-4126570e40f2@FreeBSD.org> Date: Thu, 19 Jan 2023 15:50:06 -0800 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: git: 43703bc489ec - main - stdlib.h: Fix qsort_r compatibility with GCC 12. Content-Language: en-US To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202301192249.30JMnCXf040410@gitrepo.freebsd.org> <8C902ED3-D9F8-4F88-8D43-F8E4809C9D44@freebsd.org> <0F50986C-BC29-4A7A-89F0-DAB3863BF51B@freebsd.org> From: John Baldwin In-Reply-To: <0F50986C-BC29-4A7A-89F0-DAB3863BF51B@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 1/19/23 3:36 PM, Jessica Clarke wrote: > On 19 Jan 2023, at 23:31, Jessica Clarke wrote: >> >> On 19 Jan 2023, at 23:11, Jessica Clarke wrote: >>> >>> On 19 Jan 2023, at 22:49, John Baldwin wrote: >>>> >>>> The branch main has been updated by jhb: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=43703bc489ec504b947b869045c492ed38c1a69c >>>> >>>> commit 43703bc489ec504b947b869045c492ed38c1a69c >>>> Author: John Baldwin >>>> AuthorDate: 2023-01-19 22:48:52 +0000 >>>> Commit: John Baldwin >>>> CommitDate: 2023-01-19 22:48:52 +0000 >>>> >>>> stdlib.h: Fix qsort_r compatibility with GCC 12. >>>> >>>> GCC 12 (unlike GCC 9) does not match a function argument passed to the >>>> old qsort_r() API (as is used in the qsort_r_compat test) to a >>>> function pointer type via __generic. It treats the function type as a >>>> distinct type from a function pointer. As a workaround, add a second >>>> definition of qsort_r for GCC 12 which uses the bare function type. >>> >>> As far as I can tell both versions of GCC behave the same. The >>> difference is whether __generic is using _Generic or >>> __builtin_choose_expr with __builtin_types_compatible_p, since function >>> and function pointer types are not compatible. Clang will take the >>> __has_extension path, but GCC will take the builtins path, and so Clang >>> works but GCC doesn’t. >>> >>> As a result of this change you’ve likely broken code that does >>> qsort_r(..., &f) as that will have the opposite problem. The right fix >>> is to force arg5 to decay, such as by (ab)using the comma operator with >>> __generic((0, arg5), ...). I guess that probably belongs in the >>> fallback implementation of __generic though, not here, which would give >>> the following real fix: >>> >>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >>> index 83ba7584e5b9..f7eff4768151 100644 >>> --- a/sys/sys/cdefs.h >>> +++ b/sys/sys/cdefs.h >>> @@ -312,6 +312,9 @@ >>> * __generic(). Unlike _Generic(), this macro can only distinguish >>> * between a single type, so it requires nested invocations to >>> * distinguish multiple cases. >>> + * >>> + * Note that the comma operator is used to force expr to decay in order to >>> + * match _Generic. >>> */ >>> >>> #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ >>> @@ -321,7 +324,7 @@ >>> #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) >>> #define __generic(expr, t, yes, no) \ >>> __builtin_choose_expr( \ >>> - __builtin_types_compatible_p(__typeof(expr), t), yes, no) >>> + __builtin_types_compatible_p(__typeof((0, expr)), t), yes, no) >> >> With (expr) instead of expr, of course... > > And as for why GCC 9 works: > > It doesn’t. The tests just aren’t built because MK_CXX=no disables > MK_TESTS. GCC 12 only hits it because it’s new enough to be able to > build libc++ and not force MK_CXX=no. > > It would be nice to unpick that... Hmm, ok I thought I had managed to build this test with GCC 9 previously, but perhaps not. I will give the cdefs.h change a go locally though and see what happens. -- John Baldwin From nobody Fri Jan 20 01:55:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyjHv2Dvlz2v2w7; Fri, 20 Jan 2023 01:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyjHv1jXYz3QP6; Fri, 20 Jan 2023 01:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674179723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U3JTqyi98sIRhlYfpcx+gp6S9grWtBtPBbD3zBLLZ2E=; b=XkFw6Q7/u83psOi9lkjZESHRrynZ520/7K25V3i9/hOoW0sp9z3FrLz4TrcHtRvbLguugf GqNEQKIBBj7IqQIaauo7wmNv3xBgz2fK1Bp4HKo4rZHLFyn/YGUVgDCYMHLP61UeLIWiax JAJaF2c6AoUlPFuVdVaiPoJtpUPZMMfID59xD5VXrKsCTb+H7BAOmQAot78oClI9YXHgO4 LyXAB1Fh6q2bSNaN0Nn8DrzJ8qcNwPaEsoiVOIYQTXBaTNdZr7mSEyDmkVsMDgNe+shDjq AXlwZ1j7Xu12AQ3lE6XhVIn2BjfCHBRCjqVnyoXFLeoN8sI4ZFjHsxMRyEOPhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674179723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U3JTqyi98sIRhlYfpcx+gp6S9grWtBtPBbD3zBLLZ2E=; b=EKzM3jYBCGT/3QbwfCyHxfyPC+6lMveqwzPLKIA7ynX6dcIkf6qIpyLEWSKxtl4hZ/qQNk QNd92+Vw1I7n3xzIMc+x1fkHqczttWs9BH5kFRwqOYlKuIb8ArYg3CgnvNyqSVNt6s66AE gO74qxWyDAx9pH7cRf3SLVTlqYEjF+sH8ZjqGgwfuUhCjy9OAIbwrD20mSGsDXZN6+CgPh mO6ejFCkVNEDnoYdDq1R7XEQLSsw9vWV7wFp5r74WGpt7aYc6Y54KwkiIQGptekCbL7Wtx 8tir22nLrwk98FkeSjOsGuPg7ulUShy/iCgPV6qrYSc+ZntnbvX9rG+q77smaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674179723; a=rsa-sha256; cv=none; b=TRrAZ5sxdR+fAMeQq9AOMRoQD6d0tTK+K477PPcgaNeVguJ9cRNsHbVZ2xYT4gMy25fyMG EBrjmUxmN0F+t4pJndi5ODateNaKfshpD39+z4UENdg6JnPslzDv384JFAjrUHhgDAR8PR mEYsPqY6Y36pBfSQyXnPG//XVHJFM+La464OMzgLNJcgcEYc14I+vsSMCwVpseQsxTS2T/ ZjjaTphBl4clVGC0J3v2Gn/mGgbVsE9YcNGc0fTDHhP8CAr+vhLtlRCqPpn+t/ebqBQZSK CCDmrvjanLzFsklQu/tNSCQKUTOEu6+GPfmpTG8lYcGXQi/EXct5SbZ/mDnApw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyjHv0mz0z1CdQ; Fri, 20 Jan 2023 01:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K1tN8v011553; Fri, 20 Jan 2023 01:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K1tNZk011552; Fri, 20 Jan 2023 01:55:23 GMT (envelope-from git) Date: Fri, 20 Jan 2023 01:55:23 GMT Message-Id: <202301200155.30K1tNZk011552@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: 70e1b11216c4 - main - vm_object.c: minor 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 70e1b11216c43e95118728f3684a1b8abc7034a1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=70e1b11216c43e95118728f3684a1b8abc7034a1 commit 70e1b11216c43e95118728f3684a1b8abc7034a1 Author: Konstantin Belousov AuthorDate: 2023-01-19 18:32:16 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 01:54:42 +0000 vm_object.c: minor style Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/vm/vm_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 99b28d9460a3..8e146318f0dc 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1212,7 +1212,7 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size, vm_object_mightbedirty(object) != 0 && ((vp = object->handle)->v_vflag & VV_NOSYNC) == 0) { VM_OBJECT_WUNLOCK(object); - (void) vn_start_write(vp, &mp, V_WAIT); + (void)vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (syncio && !invalidate && offset == 0 && atop(size) == object->size) { From nobody Fri Jan 20 01:55:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyjHw3QTZz2v3C7; Fri, 20 Jan 2023 01:55:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyjHw2yNGz3QgK; Fri, 20 Jan 2023 01:55:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674179724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7647YPsQmPeQOTs2URXEgmQSPqmJ7/yO5tfN4V7IDBs=; b=Vg/6bsBGnvaU3LiuMNy8vsrGYVZsYg1SPM7lFO9tzRDRAi+9GkechmfZDJ0iRJl94ZQZ75 bQzRHHUUd2seZcSmT7KV62rlBHF3L+IB7RvvA5UBodbQg7D1b89XXRdKrvx9K05+ZdyKmp kAKoxO/Q2K2p7bFpIqI8ij6O+cKPcnmrR1jZlx8RX7851vKPj9G2c9ZV0gdt8jiJYfvVva emYWXNOTFghlJY4OVhj17ENdV1h1/XBvCVaPrEn4XCwQtlrutNPCf4uXnDsRzkc/aielbV kwopLdJTy3Ve6ZIwV5IXK8xvuH8NU9xj/rtK8wDWkaVUfoxtrCgtDW1y1EpIFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674179724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7647YPsQmPeQOTs2URXEgmQSPqmJ7/yO5tfN4V7IDBs=; b=wZqePfDPVUtjZhL72zYF050kRARL76Z60udpfc2VkeH4hIUGKKQlYij6udbSzDsmwmqVyV NRs+lF0bDMOyGVmZaid+9xPIa31qUqjQTfAdS0EBfK9G2m6bXVbqlGg+HHZI5t+tN4fox6 iSjA01VGdVenj6sVnoaDFnwMtri5NHx52Q4m4pz4CtmtwWgL+i6EEFdQFGUg8060m+he4z O/ZnIQ2iB5Y+54n5gZGFI03TOa+x+smiOZqSOP9tjT4Veo212ZlEpc0VWELS7z836m5Xzh xpSvWI/6xA1SHUqk7POvWueQK7herVU3XESHZdDQ47ZzBUOZnITwPUhwxOPTwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674179724; a=rsa-sha256; cv=none; b=sNvfhTMpPxa9kCRUXBkSANylGQ5LcfiC1sRztnaNI5pOSzN0tuN1MafghJyHRxc3T2LKBS aZMFY8PZ0F9IyG+XcaWOSmwDScAuCk5Po63PYW1KlBGOBF2Vfk/Kkc8ynFn3eALkSgs4mk x3XSSdd4Z1jNo9gfK7tOeBCYdL88w6kqyXFHfA07cwDeALpUys14la7Pe/yJ3Yfu9tg0f0 LBCQ1upQL4qEWdLwDHZmccgRncmbeNeNLqj19mrinlPRjzoNww1Iim4zbciVYheTO8uAwH QJXswP5O1R7GIcCQBysyr3oQM18blE4niJrgOfftsoBqtN3/fXIMuXragX2t+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 4NyjHw1kCDz1CbP; Fri, 20 Jan 2023 01:55:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K1tOIo011578; Fri, 20 Jan 2023 01:55:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K1tO9Q011577; Fri, 20 Jan 2023 01:55:24 GMT (envelope-from git) Date: Fri, 20 Jan 2023 01:55:24 GMT Message-Id: <202301200155.30K1tO9Q011577@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: 6189672e6008 - main - Handle ERELOOKUP from VOP_FSYNC() in several other places List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6189672e600814fec4cc165d25ae050fb2f3a999 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6189672e600814fec4cc165d25ae050fb2f3a999 commit 6189672e600814fec4cc165d25ae050fb2f3a999 Author: Konstantin Belousov AuthorDate: 2023-01-18 21:09:10 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 01:54:56 +0000 Handle ERELOOKUP from VOP_FSYNC() in several other places We need to repeat the operation if the vnode was relocked. Reported and reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38114 --- sys/dev/md/md.c | 12 +++++++----- sys/vm/vm_object.c | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 9b8773fc3c91..44358278a237 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -917,11 +917,13 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) */ if (bp->bio_cmd == BIO_FLUSH) { - (void) vn_start_write(vp, &mp, V_WAIT); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_FSYNC(vp, MNT_WAIT, td); - VOP_UNLOCK(vp); - vn_finished_write(mp); + do { + (void) vn_start_write(vp, &mp, V_WAIT); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_FSYNC(vp, MNT_WAIT, td); + VOP_UNLOCK(vp); + vn_finished_write(mp); + } while (error == ERELOOKUP); return (error); } else if (bp->bio_cmd == BIO_DELETE) { error = vn_deallocate(vp, &off, &len, 0, diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 8e146318f0dc..341c8aaec01a 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1233,8 +1233,23 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size, res = vm_object_page_clean(object, offset, offset + size, flags); VM_OBJECT_WUNLOCK(object); - if (fsync_after) - error = VOP_FSYNC(vp, MNT_WAIT, curthread); + if (fsync_after) { + for (;;) { + error = VOP_FSYNC(vp, MNT_WAIT, curthread); + if (error != ERELOOKUP) + break; + + /* + * Allow SU/bufdaemon to handle more + * dependencies in the meantime. + */ + VOP_UNLOCK(vp); + vn_finished_write(mp); + + (void)vn_start_write(vp, &mp, V_WAIT); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + } + } VOP_UNLOCK(vp); vn_finished_write(mp); if (error != 0) From nobody Fri Jan 20 02:40:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NykHs70G0z2v7S7; Fri, 20 Jan 2023 02:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NykHs6Fmtz3k0M; Fri, 20 Jan 2023 02:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674182425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f3/3h7Qjr579FiUeW1JXH1ktTlLdFUBdZWUBzUn/ylA=; b=afBMTbfeRO45hlvxsN3CSznSdpgLbBEmgXcCwxZY7OtaVWOEKExI0zcsA/EaCeBHLVj9+S iSdAhB0V+t7sqI70lv4fScjYLNvIYsKm7DZjNu31p/cyRXM5emH5aR4v6jkH9p8DmMiWE6 NWbaB5Rq86bxr3ah/edinSdrq2qj4DkyDTHLb0weM+ATLna9bfahpjQkeqbDilmyVon1Ct jog+unx67RFlWODYJHzc+UKf2mOTHO7QCv1mDrVsAIu0Ha3w8wdjbmQtFv0MYIXRXsk18T TgMLYB3M8nT2/tF4kYjqevB3Ld0S2SDKUj6tDszo0F5cRBs/EMmaQWDU8sTdsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674182425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f3/3h7Qjr579FiUeW1JXH1ktTlLdFUBdZWUBzUn/ylA=; b=qK04VP70aKB3xwNMlz5iOJY7GDdM0VeL+3fh3Kc+0/vDAALiJjoJNF+Bv9Cb4pk4khMquR CRPID5nTllRrwOFVtKHSOGsPIJqdyaaZYFj/cjjj2Mq/Fl6uQO/TtoiGigMxuoeuKpVn7D oPR33AZ3cdDxjmZaEsomCco+SgOOF25E29FABj0K5wGL4Nru4TcBDDYHRNX+0QVqjCCB4Z MU+QhgXXZrLr5s+Ttjhpovj2+Cnx204XHogyrKnhzw17dIfpAp+B+Fj3pypTxlxAzZTLP1 W/CH/w29t456jp6TpaLZB0c7Rjv3T5/OGbNFEK7zkuH8chCv3T7tHF3jPiKy7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674182425; a=rsa-sha256; cv=none; b=K6SkP5hRWkuEIcl1bHKHQDyF/9BA5pIHmLNGXD6eg/g529Z7kIUDEadKl6QlJeIk+1CIqT 6Dm5dAhWrLkhk7KbZKsPctxLb4Wjh6Ws1f5d2/gu+EEAmT6M/e04cRjeiSYkTIN3ZzRUdW p5IN0WhJzbijhtVg6ruA23hxXDu+lcwyApLY6YBBf+Z5BpfbXgf2p39OhltJYexJx9Pxdw TZEIRzyy3pcdB1LqpzqnZCapr/TyHmYziUefh/mrUDZEa84+zVk2LMWtYHB76tKGloCjoN ftRnQ0K5pl6mYeKEpnk8q5VDAfX3+7AYYAjDPkOME2aU8v3mDV36DG8aJQ51bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NykHs5KsWzDrX; Fri, 20 Jan 2023 02:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K2eP60077959; Fri, 20 Jan 2023 02:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K2ePhl077958; Fri, 20 Jan 2023 02:40:25 GMT (envelope-from git) Date: Fri, 20 Jan 2023 02:40:25 GMT Message-Id: <202301200240.30K2ePhl077958@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: ad8feb1ed999 - main - md.c: another style 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ad8feb1ed9996593df8b4b7259057c6e263aa130 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ad8feb1ed9996593df8b4b7259057c6e263aa130 commit ad8feb1ed9996593df8b4b7259057c6e263aa130 Author: Konstantin Belousov AuthorDate: 2023-01-20 02:39:36 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 02:39:36 +0000 md.c: another style fix Noted by: jkim Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/dev/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 44358278a237..bb4b61783c93 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -918,7 +918,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) if (bp->bio_cmd == BIO_FLUSH) { do { - (void) vn_start_write(vp, &mp, V_WAIT); + (void)vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(vp, MNT_WAIT, td); VOP_UNLOCK(vp); From nobody Fri Jan 20 02:53:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NykZT1Hy6z2v8W0; Fri, 20 Jan 2023 02:53:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NykZT0WhNz3ksm; Fri, 20 Jan 2023 02:53:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674183185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kH/QdqziyEKu5XQeLqTjZ19wp43T6RbViFYDrMqLjHU=; b=aMMlp6WAXk6/Z25OCBTAlru1eHSdSPq0hRUef+Hho3f/Tdt5NSPER8zhOsFEJdzkyMpus2 yvhZ7KsXAQ0A2NZBunn2FrzUvyYDQiv7JtUGn3Lbg1YjIT1jWH6RgKL1lPGB//yyoamEyy Cdp4d3LQlyy/0R9ncRkpHhgYiH5j/cwOvWe001tMw7XDWNkZ7ct3hXINZSQciMACpQSU4j 0ZjxUmDGl3DD7tjGPuSUhaP3vaLZAPhAzoLQ6jvHLu+gtHIlZgdqHONY9kJNfXcYyBrmGl fGD70LYkSPoKhjrItUSWhLZ0JxfitedXl8rECZyVE4mSj1ivMTsbT5bfUgZGRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674183185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kH/QdqziyEKu5XQeLqTjZ19wp43T6RbViFYDrMqLjHU=; b=o3xZqxCfDukSDmP0ewqWR/akjTJyNTPbtaUXLDkno5OsteEDYCX3E456Mb89YvLvMQtQjb z+u7tUPA1TH+90GeNDXYVU/9Us5d/6VsZDtsDUuUWAGYWWiVuGNvqDJ53CPkr9zyDz18no Te/DiPXqzhwuqM58bqH+4++C+4yFdxH1zzF9j5mZnWVws+thX0mwqLE81ibP96mlLL/iUm IFRD/Eday/c26vV35aCU7rE2+verl61wNZv+Naa3mI7mvbpCPntuBlfJsO/biBLwhpxjGV JQ7FYRHg2QfugERQIHxJd+U797OtSfPIYN9Id//Id/fjZRjGRNJQvvN1HAAygQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674183185; a=rsa-sha256; cv=none; b=QLVYiAyBK7khNJMBrknqv0mkiROmM+6ql7v4KqsEHKM/6wg0XlnOBr4zVJWIBgsj8dAby4 OI5Rm9KfZan1shImotqyGPP1K0rQMIvxkVt8XRCs2nWLj4gyFQTPaiepq53jI66RQfNZkq 0LZ6ioOtdVMnNlDZiBiZU525dT9lGMP1OEm7hfQ8zbKYX/MWHgDAIW/TQ8WjMOSOsvWJmT i3FFPp5Fq8D9ohnlgMmUz9It1a2KpYom7lkUW+9NrQvUm4uMlyR6IbujYK7HHdQm97FVHb zH03EZPOQ+7x0RseZztQgH8+lZnScXd8STXbP8xPlecVlNI7KJmv+ElIkj8qTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NykZS6ZT8zDmK; Fri, 20 Jan 2023 02:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K2r4Vc097286; Fri, 20 Jan 2023 02:53:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K2r4Tb097285; Fri, 20 Jan 2023 02:53:04 GMT (envelope-from git) Date: Fri, 20 Jan 2023 02:53:04 GMT Message-Id: <202301200253.30K2r4Tb097285@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: d4d797184967 - main - vmstat: remove shadow variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d4d79718496753493f059cb8f2b2e87e0b7019b0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4d79718496753493f059cb8f2b2e87e0b7019b0 commit d4d79718496753493f059cb8f2b2e87e0b7019b0 Author: Elliott Mitchell AuthorDate: 2022-09-21 02:18:23 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 02:51:12 +0000 vmstat: remove shadow variables These appear to simply be the style of arguments are left untouched and only local variables are modified. While some may prefer that style this simply serves to complicate things as they're perfectly writeable. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36628 --- usr.bin/vmstat/vmstat.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 674ae2ab6728..07988da9d99d 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1284,29 +1284,26 @@ static void print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts, char *intrnames, unsigned int nintr, size_t istrnamlen, long long period_ms) { - unsigned long *intrcnt, *old_intrcnt; - char *intrname; uint64_t inttotal, old_inttotal, total_count, total_rate; unsigned long count, rate; unsigned int i; inttotal = 0; old_inttotal = 0; - intrname = intrnames; xo_open_list("interrupt"); - for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) { - if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) { - count = *intrcnt - *old_intrcnt; + for (i = 0; i < nintr; i++) { + if (intrnames[0] != '\0' && (*intrcnts != 0 || aflag)) { + count = *intrcnts - *old_intrcnts; rate = ((uint64_t)count * 1000 + period_ms / 2) / period_ms; xo_open_instance("interrupt"); xo_emit("{d:name/%-*s}{ket:name/%s} " "{:total/%20lu} {:rate/%10lu}\n", - (int)istrnamlen, intrname, intrname, count, rate); + (int)istrnamlen, intrnames, intrnames, count, rate); xo_close_instance("interrupt"); } - intrname += strlen(intrname) + 1; - inttotal += *intrcnt++; - old_inttotal += *old_intrcnt++; + intrnames += strlen(intrnames) + 1; + inttotal += *intrcnts++; + old_inttotal += *old_intrcnts++; } total_count = inttotal - old_inttotal; total_rate = (total_count * 1000 + period_ms / 2) / period_ms; From nobody Fri Jan 20 02:53:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NykZV1PFpz2v8xh; Fri, 20 Jan 2023 02:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NykZV0mYxz3l75; Fri, 20 Jan 2023 02:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674183186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bSWmR+qFmWfEwEF8BXelR36msw9UZ2zpDxvOSjNABTQ=; b=h9NZ6VNRHuwCt4H+0vq2gBEeNJfe+5m1TuT2ns88/UdC1RU1CkprqipkiH6MuChQQBq4oW Kyx/o5x0L7KPQjqF1grNEP/aaSbQij8UryWdDEJfXvwRXSTnUE24hMptrigOKwymiCsM+q 1bzcR5BndF7jKyDnJdx4E9HbIohmMC3tCLKfLJBp5U9X7/64CZoy3NNUIaA3HLQ7aivdWe SB2LHg62ZsyT0VckH0qFYJGbjpljPcE/JZUI1ELfXWkyGVngbnT43NpslWyNTOhRt30m24 xt29hoXQsZBgmecJcyZyUJMiELIe2eGseUj9c3wg4qrOIXJFVtuR0HTed2Y3VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674183186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bSWmR+qFmWfEwEF8BXelR36msw9UZ2zpDxvOSjNABTQ=; b=LhP6R/jWDLrueWxeMmpakwbSaByM7Q823LtVQbLJzye9lhdqnrt4ao8aFWHbHScE75cJGl mJWH94fYwQYxpWvc+NybP5KM8V/BOu6FXIJG1Rmmv2lSRaEU+td4UzfcXBebWYkexZFrXT Y9OBpKLy0Wnz0iIurusy3QAvXV0gNbtacFlG4UZJ0y8w6yBmTg6sLg6IvG4WAPqYm9hra7 6VbdpNK82zIr3V20o8SfR6La6uAl3g026C69dykQWdhAiVA+PzOg370wodL0BN07Q2bmhD ehgxbDsW5SH0VXQBZhyp3xd8XFIZaEq3lv7OKHHcppGLrXcS1F9nQaru+8HmLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674183186; a=rsa-sha256; cv=none; b=HYsyat+kDMk4dnU6EDmF9G//7wnOnGYXCBhvDKZfllyIgdBogT2p4NxwkP3S8uoB69e66U i5cx2jkJyRGBizUG1MxlwN+GQWKjLEu0PrEf86m8vFRwfFaH9ybjhsY5/iDdgkZhZOhkl0 Zir6SUoZrvXYMAa9hf6RsQkOzlKRWhrqpnAhnNZLa0MS5930BiDcol6aCB43TlhiynahZL t+PAaP+xn9ZLyjBVShQ2Gr0bBMdXMK/9sSe4QWrAxeRhYTlGk68Bw3DpyHf5U7ltuJ+Fwo BiRQyIp8jp2hEkJY+j7PHwERJ0piPE+s+AyZVOpfe98rDo3ANnrrv2af55FNmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NykZT6z5CzFPV; Fri, 20 Jan 2023 02:53:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K2r5Da097311; Fri, 20 Jan 2023 02:53:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K2r5Fx097310; Fri, 20 Jan 2023 02:53:05 GMT (envelope-from git) Date: Fri, 20 Jan 2023 02:53:05 GMT Message-Id: <202301200253.30K2r5Fx097310@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: e5c30ac93055 - main - vmstat: fix overflow of interrupt name buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e5c30ac93055e708e26e075937263608b3eeb17d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5c30ac93055e708e26e075937263608b3eeb17d commit e5c30ac93055e708e26e075937263608b3eeb17d Author: Elliott Mitchell AuthorDate: 2022-11-26 16:21:33 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 02:51:13 +0000 vmstat: fix overflow of interrupt name buffer sysctl() provides a count of number of bytes in the buffer. That is the actual buffer length. Whereas looking for an interrupt entry with an empty name could terminate too early, or overflow the end of the buffer. The overflow will occur if the table of interrupt names is full. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36628 --- 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 07988da9d99d..d007d4f6098f 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1349,7 +1349,7 @@ dointr(unsigned int interval, int reps) /* Determine the length of the longest interrupt name */ intrname = intrnames; istrnamlen = strlen("interrupt"); - while(*intrname != '\0') { + while (intrname < intrnames + inamlen) { clen = strlen(intrname); if (clen > istrnamlen) istrnamlen = clen; From nobody Fri Jan 20 03:23:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFQ6z4rz30vfD; Fri, 20 Jan 2023 03:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFQ4G0Zz3mmX; Fri, 20 Jan 2023 03:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G0DazLaKvHUWR0lyHnk5N9+KcwbbL5p112IPAmweEDk=; b=bVY9Wa3sHtAiUQZhIJ/9fjvgm5G39n/1G7iykoY8QzfN1yIpPbMT35P1a4J+eX9hp/911W +VuRoSiBp3hKLQv1cyGDAdX+zoc6K1CsSAegW17yMDsqEu9/jTykm39pbWA2cLN1+sYpXD YIVAQPHHn3KyQ3NKza3uxcYHKfdQq+2GguXRBvBRY7KibNBTZFj5HVVhJPSKDy0SyB7HMf aLkwXgiQHXXXgZfTk+Xyi1afYbcXNVCiMRRqtUoVA2NTzR2rzrwudl1Qth7TTQs4xfngZa SEyZLnOmAgwAt8C51o2eDKDG3stcLgNOncHHedgesti8SfApF/TUFopSN7FMbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G0DazLaKvHUWR0lyHnk5N9+KcwbbL5p112IPAmweEDk=; b=dPu7pBNqAZidV5sx9Up15SLNjez7AFQ/2VvLNkERI8ct/A9KUwowC/glW0KM48neHINbW1 LLfoKUiIUQ74AJjrxBYpzjkiJK1lcRhM5LEHVNJUf10Xybbx0TiBs/AbrIAHPEoYPVSzv4 oVM5QO4SeDKmmWxpZxGLPBVFib2Ik5koZttBByz7cGt0SIcLPAup6qJbOk5BHxXlO37Qhi grqlU3LwMMmfX9bljtTDp0nh0KORb//s4bKdp5zEExR9f5B5ta2mOsbMZL6O7dBhSmJV5V HHBpVm2SbgDu9SK/x6/r99zKBYl+KcR8vSRGgS0LqrDhxiF+sqtRzjaOEeT4Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185002; a=rsa-sha256; cv=none; b=XgNKmZcTUIyv/i/lzbtCjKskdcGDx2LgQr2QgeS0wL16SrO17HC8ZGiTQKK9V+iwWXooRf +qnYDDtwvo4/gqGuabYskemGj+uxXzXfPKA29VpoZQ59i7zOBY1un3iFPjzr7To7MewYVC fSk4AUjlHFHnl+nbl3X/MHfvfdPxMFFuSLB6Mg0UZeT2mzvK6N3dtHxBhtu0yQAsYL4CJ1 7smstNLQSibdSSLPg+mya6idlhDtDGZ9mLVMX4rAun0prnrTVGI6fEqTR0mx6L9d2Ii/Qf tfXKGgbZyllF62tPJU+YBes0cCsT8RB2N/9d5v9ODcAVcQk2pbzdUuGIOi5Jrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFQ3KH3zGDJ; Fri, 20 Jan 2023 03:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NMSj042061; Fri, 20 Jan 2023 03:23:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NMt6042060; Fri, 20 Jan 2023 03:23:22 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:22 GMT Message-Id: <202301200323.30K3NMt6042060@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: 8fa2644171ce - stable/13 - uiomove_object: hide diagnostic under bootverbose List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 8fa2644171cea455dbe8e24e7a0902066c3cf1b7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa2644171cea455dbe8e24e7a0902066c3cf1b7 commit 8fa2644171cea455dbe8e24e7a0902066c3cf1b7 Author: Konstantin Belousov AuthorDate: 2022-10-23 11:36:17 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:18:49 +0000 uiomove_object: hide diagnostic under bootverbose Tested by: pho (cherry picked from commit 7ec4b29b086b67b8c778d2bc50c90e9e0655c03e) --- sys/kern/uipc_shm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 2bd7c3a038df..4f06d9bea40e 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -221,8 +221,10 @@ uiomove_object_page(vm_object_t obj, size_t len, struct uio *uio) VM_ALLOC_NORMAL | VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY); if (rv != VM_PAGER_OK) { VM_OBJECT_WUNLOCK(obj); - printf("uiomove_object: vm_obj %p idx %jd pager error %d\n", - obj, idx, rv); + if (bootverbose) { + printf("uiomove_object: vm_obj %p idx %jd " + "pager error %d\n", obj, idx, rv); + } return (EIO); } VM_OBJECT_WUNLOCK(obj); From nobody Fri Jan 20 03:23:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFS3kbYz30vRD; Fri, 20 Jan 2023 03:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFR5qydz3n9k; Fri, 20 Jan 2023 03:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q0GXGPGai++zQrXtD5oIaiPfMf7IZF6AuKoSqy8fHv8=; b=IGEqgRHQH/1udzJlnibYkhhwinD5zb0qqloutUXoZmmKdnzpaTzKHJw4Tz3a+UHPFR59wI qdDCZp8ToABhBhAtdkF6KGu+sQp3034cIZg6VvwwVxiZsSHB92SrcdkEJXLahoUzHuIGt2 FyC7MFlm8UuT63IjwyfbiEr+XDoSB4OM4SR4iK9cxYV9X8rucneRgpx0mkwqRwNyvty9jq dT/zD84LPc/qwKM0bcFULYCiv1U8mmA5bM3EP/K/ZCn39QMdVT6LISfaPvn+DRGO2FocZb /RkCvBjCVZQTvnJIMuV9sJMrkf/R1ZLy8q9KNrA1wztLeSOamuMnDn61//4Kfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q0GXGPGai++zQrXtD5oIaiPfMf7IZF6AuKoSqy8fHv8=; b=LEc3i7u0v6+1h/XJtqqdJvGISgbMOahfXPUE0QehcBdZShuhswLv6kYe+A/buMx9bM5WGg MDR68DvOlwX6+suw5IGY29XJ6QPXkbclFBVTgOUY1RGaHRmFZO54vL8jxuattvfeEdeTAa WLEAZpnc9egIefdSQuZQiLpwtHv9yF1klOg00S5P019KrCFhBA0bsRd/JHxw4Yy2MV5wg0 T5I7ELFV3U5NeNQJj4ruHWBoUrdBnnmrhwzPxHRV/pcBhtfUd+XxlHI0PDo8jQLIM8UVar +SuKJcHaez3btlYv6lKIrN+A/mYEmf+ckoQpSPd06RU8V+pesb1kGBT79hMy9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185003; a=rsa-sha256; cv=none; b=vjv1YKbNqGzf3hUDXVTiN53lPPrnMhIsGu8t9KtzPR4G28RTvHGr7lLpyGtgSBqpILeu2s r8GgbjUXQyufJEiLeZpMHiDBMkJgCs+6BfKLg0bvEaloG+Cd2I9vttcF+GY0BPwru9UYwV N3OVe88WpULGWwKvJPqr4YNPtsw+Jn5Y57DvwwjCQu6Cx1hjq9marqZkkTkj/qIVSjBCSv D4AgzE3odW1mp2xI6CoNwGuUJD23o4g2RtHzPnreEHg6PB1HUNj5SwCPAS8d77kXQHF8de na9zNC6vhdj2ijQsjIuHQW9NCBE5AJfpGuqU2hXH+x6MgEjgGHJ6dE8FEJM1bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFR4VsbzG9J; Fri, 20 Jan 2023 03:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NNgv042085; Fri, 20 Jan 2023 03:23:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NN6m042084; Fri, 20 Jan 2023 03:23:23 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:23 GMT Message-Id: <202301200323.30K3NN6m042084@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: 1797e69477cd - stable/13 - tmpfs: minor 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 1797e69477cdfbd3f0e59c52fda8a9877f5a6544 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1797e69477cdfbd3f0e59c52fda8a9877f5a6544 commit 1797e69477cdfbd3f0e59c52fda8a9877f5a6544 Author: Konstantin Belousov AuthorDate: 2022-10-24 13:30:38 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:18:56 +0000 tmpfs: minor style Tested by: pho (cherry picked from commit e77f2f9dc683bb5ac725c5844fc36c831138e841) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index f46c0ef9490f..788e966fedb7 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -479,8 +479,9 @@ tmpfs_stat(struct vop_stat_args *v) if (vp->v_type == VREG) { obj = node->tn_reg.tn_aobj; sb->st_blocks = (u_quad_t)obj->resident_page_count * PAGE_SIZE; - } else + } else { sb->st_blocks = node->tn_size; + } sb->st_blocks /= S_BLKSIZE; return (vop_stat_helper_post(v, error)); } @@ -513,12 +514,13 @@ tmpfs_getattr(struct vop_getattr_args *v) vap->va_gen = node->tn_gen; vap->va_flags = node->tn_flags; vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ? - node->tn_rdev : NODEV; + node->tn_rdev : NODEV; if (vp->v_type == VREG) { obj = node->tn_reg.tn_aobj; vap->va_bytes = (u_quad_t)obj->resident_page_count * PAGE_SIZE; - } else + } else { vap->va_bytes = node->tn_size; + } vap->va_filerev = 0; return (0); From nobody Fri Jan 20 03:23:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFT2Bl1z30vCK; Fri, 20 Jan 2023 03:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFT0mtWz3nB4; Fri, 20 Jan 2023 03:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAVfhn2R+opd/9oOmRP1cX0ThFZ1o8vo2pZMYOAjkQY=; b=g+Lnoy1G9M3OWzz7mSo+i9t6jaavg09WAdak2DLCXuV02O/cR0uv9DjjrZa53ZD0GrbyYq QG5xWZwHIzG6kW4TbIDQlsrAr37lnUwq02uSiWXhvqnx0tdS88BYJPJhN3VSk1KvG8PKzs oEqwcRsAPkFc9an6WLFkb7txo8viu+W1j8qs95aRSYcBChBoPxw/kK2g1nnVgaY855RsVD XR1KYq/EeF95vk7jxlXOO4v2sXBhDoARDROeEvTquZxyS7SiNrp1NbGMELaEnFe4jgmrTG ysAb/FqEVkXgX3A2IgWXJENmRgrSJ9kFvldDpv3i+O+LY5Hf1f0g7oJKt7hIeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HAVfhn2R+opd/9oOmRP1cX0ThFZ1o8vo2pZMYOAjkQY=; b=BhYtwJpdznL9cU7G7osmBMlFs5jPItC9od1Y1lL8bm1IA20QTXbBbCOsMETXNP8TSkUntL CBOM3cEj4sXeouWnv/8BSyQpZQRR98B2cHuT21YYFWobJ7/lvhA7+8aCdweliu1tw1Uj6q jn4aUxmxArIFdrkPHaZH9UluU8HZDBY8F8IGPpdU/hWTitCq+c6hHpHvvro8Y8nhmPzR0G epboHbHV9uaJzQjZC+Mg+06kjddA1+t77d9WH3Nzj5Zicds5w4vehbDtch9+5FMvJindUt 0T50HPpaKQt7puDo+KiQPPRqtxjTEJboMdPRggoOBtxmgtg+4g67Hma1sISPLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185005; a=rsa-sha256; cv=none; b=Kziqm214CQpJqLj+P3gynI3qUzG7Zc0AiSBiIzqg1ruQdXjXjr4OpGqcd+vSqrHJurkxwa j0vCnpuP2kjjdI2JSczvDtAihR9V94RP28UnHL2QuIBmJENeZLzZKcTRRPRBzdMyypfO8q ZX/izjyFaVISQqjPoFzekX3pPEXt0+r1hZtjOXo8YxnLH/gWx0MJ248Psk9SghraS689l6 rYJdo8F8QewKkBwoZjAOpdDQTdeDUBOdrwh5G5OuivnExFEsaTLpOlWKVhWw610F/HKzxA 5drrOECD7qMMQrBSBO4KWoFCmQO2csFlU40VsPVMFu5Zcvl6xlYAeP/2VsfGww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFS5X15zFdy; Fri, 20 Jan 2023 03:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NOgv042116; Fri, 20 Jan 2023 03:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NOpG042115; Fri, 20 Jan 2023 03:23:24 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:24 GMT Message-Id: <202301200323.30K3NOpG042115@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: 9b2f554dca7d - stable/13 - Add 'show tmpfs' ddb 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9b2f554dca7d3a8104a760df69e011acec592df9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9b2f554dca7d3a8104a760df69e011acec592df9 commit 9b2f554dca7d3a8104a760df69e011acec592df9 Author: Konstantin Belousov AuthorDate: 2022-10-20 14:30:00 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:01 +0000 Add 'show tmpfs' ddb command Tested by: pho (cherry picked from commit 83aff0f08c525ea3c394f3dd6598665cd369d53c) --- sys/fs/tmpfs/tmpfs_vfsops.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index b8ecedbb0348..c80042286948 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -43,6 +43,7 @@ * allocate and release resources. */ +#include "opt_ddb.h" #include "opt_tmpfs.h" #include @@ -696,3 +697,44 @@ struct vfsops tmpfs_vfsops = { .vfs_uninit = tmpfs_uninit, }; VFS_SET(tmpfs_vfsops, tmpfs, VFCF_JAIL); + +#ifdef DDB +#include + +static void +db_print_tmpfs(struct mount *mp, struct tmpfs_mount *tmp) +{ + db_printf("mp %p (%s) tmp %p\n", mp, + mp->mnt_stat.f_mntonname, tmp); + db_printf( + "\tsize max %ju pages max %lu pages used %lu\n" + "\tinodes max %ju inodes inuse %ju refcount %ju\n" + "\tmaxfilesize %ju r%c %snamecache %smtime\n", + (uintmax_t)tmp->tm_size_max, tmp->tm_pages_max, tmp->tm_pages_used, + (uintmax_t)tmp->tm_nodes_max, (uintmax_t)tmp->tm_nodes_inuse, + (uintmax_t)tmp->tm_refcount, (uintmax_t)tmp->tm_maxfilesize, + tmp->tm_ronly ? 'o' : 'w', tmp->tm_nonc ? "no" : "", + tmp->tm_nomtime ? "no" : ""); +} + +DB_SHOW_COMMAND(tmpfs, db_show_tmpfs) +{ + struct mount *mp; + struct tmpfs_mount *tmp; + + if (have_addr) { + mp = (struct mount *)addr; + tmp = VFS_TO_TMPFS(mp); + db_print_tmpfs(mp, tmp); + return; + } + + TAILQ_FOREACH(mp, &mountlist, mnt_list) { + if (strcmp(mp->mnt_stat.f_fstypename, tmpfs_vfsconf.vfc_name) == + 0) { + tmp = VFS_TO_TMPFS(mp); + db_print_tmpfs(mp, tmp); + } + } +} +#endif /* DDB */ From nobody Fri Jan 20 03:23:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFV1xwNz30vSq; Fri, 20 Jan 2023 03:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFV0WSYz3mps; Fri, 20 Jan 2023 03:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T0ozILaBICe3043rcVvyYomSAJngI/O2KdscrmWGi5s=; b=gkl0jAlmqHrgEs0T2Lhu5uAyqC9Tcw3dRrnr/PJTwzKIXE6e+VUsRsM8IDZBnSqlmsdeZY 0XhPt0FUZ8YHwBVMNPsLRYZn21YpI6aHDoc4z8NfpPl0YbgSZjVxgxl75FSvz3BawHrcub b20Vw3d6mafRYDdZyGxprTTfEtdd++INHcvx/GyOmwdcPWr1/CHJDLJOgNs3pU6tiPVT36 fxpOqcfF2wCVlRLlG9ci8r1yWKzw+ff74gaTUUwwYGsZiv9yc1a6ryB5rSs4FSdsFux5Ar fYZoW2OT9SgVmmWXTlKEqWhqskjgHIQlvokfeeXaM03ncgSTROC+G3vGmxygIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T0ozILaBICe3043rcVvyYomSAJngI/O2KdscrmWGi5s=; b=IwL3WcFVN9k5KPKbkCDV+UDgs2mhhn1H/rz138v3BoQC8IRZit0cPvgrOL40/+6jrGjm3B 0kMp8WGjtw6NhAt93HvDMfmEDuLOWAcWc9ejoHRk/OOXFku8uSQKvuUZa9gMiLvYSxvWPs k1Yt5kS5hKtoOzN7nOlturb7d9LP14fLM5BTX0rtayWXPLkBX+c5/sZd3lqQ8+ew9B39Ho Db6lGHgRSLLZXAVjoFwMLqU7DNQSf9YknFNQuHvCwO5YT9mzRz++FIjqA+PNqUoFYKyd2g 3cuYtrjgmfmAnnfN+NND59SAFbuwu5GdkoLebhR8J56IVxxAQuKbDiaK3ruPRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185006; a=rsa-sha256; cv=none; b=Z84t0hdQ6jqSpfU4tAEqUcmZmO86vbxdZgAV3zMOWc9TdIxgZO1SID0LBHHw+M+Uz/7zMa RoMtFS2jk/djbaQqIpTsMwAvS5v4cvLUI7J+hce4GOqUVBig+biHsyWzb1O5JKHglAxmB6 /btG8mgiYVyxLjXlyI/+Pu5Y2fwVuDcocvv8NR4zw8i6x7yipYEPai40Lp5DROhoq3ba3W 7pcaUT8YIjcxdQE8bk/iUCT6sNh7R6oB9U76FZnjF1OXevkmx/jXZiFXMu8ykXQCiO+DTZ a7F1y+TA/oe3A2Lr/gWtzSBTG1jgAjQ22hLgak0QPtdCQnf7fAM4VV1yESO0Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFT6NX9zFyp; Fri, 20 Jan 2023 03:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NPga042140; Fri, 20 Jan 2023 03:23:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NP1m042139; Fri, 20 Jan 2023 03:23:25 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:25 GMT Message-Id: <202301200323.30K3NP1m042139@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: 86ea175ec2ed - stable/13 - Make swap_pager_freespace() global List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 86ea175ec2ed58e43020c64d82b35605ab425ec2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=86ea175ec2ed58e43020c64d82b35605ab425ec2 commit 86ea175ec2ed58e43020c64d82b35605ab425ec2 Author: Konstantin Belousov AuthorDate: 2022-10-26 22:13:27 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:07 +0000 Make swap_pager_freespace() global Tested by: pho (cherry picked from commit baa1ccceefdf4954a88e54ca18c6ab1762faa326) --- sys/vm/swap_pager.c | 54 +++++++++++++++++++++++++++++++++++++++++------------ sys/vm/swap_pager.h | 2 ++ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 0cd8b498dc4f..407ef1473760 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -436,7 +436,7 @@ static void swap_pager_update_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); static void swap_pager_release_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); -static void swap_pager_freespace(vm_object_t object, vm_pindex_t start, +static void swap_pager_freespace_pgo(vm_object_t object, vm_pindex_t start, vm_size_t size); const struct pagerops swappagerops = { @@ -451,7 +451,7 @@ const struct pagerops swappagerops = { .pgo_pageunswapped = swap_pager_unswapped, /* remove swap related to page */ .pgo_update_writecount = swap_pager_update_writecount, .pgo_release_writecount = swap_pager_release_writecount, - .pgo_freespace = swap_pager_freespace, + .pgo_freespace = swap_pager_freespace_pgo, }; /* @@ -483,9 +483,10 @@ static daddr_t swp_pager_getswapspace(int *npages); * Metadata functions */ static daddr_t swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); -static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_pindex_t); +static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_size_t, + vm_size_t *); static void swp_pager_meta_transfer(vm_object_t src, vm_object_t dst, - vm_pindex_t pindex, vm_pindex_t count); + vm_pindex_t pindex, vm_pindex_t count, vm_size_t *freed); static void swp_pager_meta_free_all(vm_object_t); static daddr_t swp_pager_meta_lookup(vm_object_t, vm_pindex_t); @@ -960,11 +961,21 @@ sysctl_swap_fragmentation(SYSCTL_HANDLER_ARGS) * * The object must be locked. */ +void +swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size, + vm_size_t *freed) +{ + MPASS((object->flags & OBJ_SWAP) != 0); + + swp_pager_meta_free(object, start, size, freed); +} + static void -swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) +swap_pager_freespace_pgo(vm_object_t object, vm_pindex_t start, vm_size_t size) { + MPASS((object->flags & OBJ_SWAP) != 0); - swp_pager_meta_free(object, start, size); + swp_pager_meta_free(object, start, size, NULL); } /* @@ -988,7 +999,7 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_pindex_t size) n = MIN(size - i, INT_MAX); blk = swp_pager_getswapspace(&n); if (blk == SWAPBLK_NONE) { - swp_pager_meta_free(object, start, i); + swp_pager_meta_free(object, start, i, NULL); VM_OBJECT_WUNLOCK(object); return (-1); } @@ -1077,7 +1088,8 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dstobject, /* * Transfer source to destination. */ - swp_pager_meta_transfer(srcobject, dstobject, offset, dstobject->size); + swp_pager_meta_transfer(srcobject, dstobject, offset, dstobject->size, + NULL); /* * Free left over swap blocks in source. @@ -2150,16 +2162,22 @@ allocated: */ static void swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, - vm_pindex_t pindex, vm_pindex_t count) + vm_pindex_t pindex, vm_pindex_t count, vm_size_t *moved) { struct swblk *sb; + vm_page_t m; daddr_t n_free, s_free; vm_pindex_t offset, last; + vm_size_t mc; int i, limit, start; VM_OBJECT_ASSERT_WLOCKED(srcobject); + MPASS(moved == NULL || dstobject == NULL); + + mc = 0; + m = NULL; if ((srcobject->flags & OBJ_SWAP) == 0 || count == 0) - return; + goto out; swp_pager_init_freerange(&s_free, &n_free); offset = pindex; @@ -2181,6 +2199,14 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, swp_pager_update_freerange(&s_free, &n_free, sb->d[i]); } + if (moved != NULL) { + if (m != NULL && m->pindex != pindex + i - 1) + m = NULL; + m = m != NULL ? vm_page_next(m) : + vm_page_lookup(srcobject, pindex + i); + if (m == NULL || vm_page_none_valid(m)) + mc++; + } sb->d[i] = SWAPBLK_NONE; } pindex = sb->p + SWAP_META_PAGES; @@ -2192,6 +2218,9 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, } } swp_pager_freeswapspace(s_free, n_free); +out: + if (moved != NULL) + *moved = mc; } /* @@ -2205,9 +2234,10 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, * with resident pages. */ static void -swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count) +swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, + vm_size_t *freed) { - swp_pager_meta_transfer(object, NULL, pindex, count); + swp_pager_meta_transfer(object, NULL, pindex, count, freed); } /* diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 6761d4f99ee4..616f6c46164a 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -76,6 +76,8 @@ struct xswdev; int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len); void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int); vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex); +void swap_pager_freespace(vm_object_t object, vm_pindex_t start, + vm_size_t size, vm_size_t *freed); void swap_pager_swap_init(void); int swap_pager_nswapdev(void); int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_pindex_t); From nobody Fri Jan 20 03:23:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFW3HnLz30vb1; Fri, 20 Jan 2023 03:23:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFW0jm9z3n66; Fri, 20 Jan 2023 03:23:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldHR0/RBGzzMUcjCX/XzQjAmAYkDBwGiyr28KMe0ToU=; b=hIJ9HcLJekvT4Ip04y4kVpAoch8LcqERyzMM6j1zSjzXA+oz+6UlG4XBKIX0WiVoPtkEhu zVicPg3IbP+Lo+HJlTqxE4M6Klml5oW0mRAM/ObMAo5Z9iV5z8nVW9c7F+TsjeznnBVkTj iG0EFxALRRjYVOa/ACZWyFSMnzNrvibOZnaZGClq/bpd+oxagQbyMRVIMEwmcn62csVSQ5 4SMFTAmouqXSDItypUaYqsIIs/2pSvPCnvMFJ5mhMGMD8vikwyWyO6kiTImGLefXs7lB0f FidZdBa6x5jEJMAmUU3bwdCCYn91s9FRKPTLFuaUnsJuG8eKUcKlDAjdzKdZ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldHR0/RBGzzMUcjCX/XzQjAmAYkDBwGiyr28KMe0ToU=; b=DdW9bfZnGlw51eBoh70GGoCIxEun6CMtytFjw2FEwwvs0+gcdNcn7Nybz+FTkJeA4GAqDj /RHSliViRDgnLT0T21YyyrYnad+tlP0AQTDPb3fCQKBlppj+1XV5fG3KwLJ4TPPBAjt6Tj mTAoUPwVijzwWrb12D23VbNFJaX+S18l2Wa+QZcfvM/LuAjqAWU/foZeJa4KSIK8Cc0hSr OnpxyEAQsBxtKkVHSRbX34SzcJzU/3odKvq66DvC1ccI1OX7CBPiRp51o2VzuZWAbYwLv3 aGmY5dmIkInr1MTGT+kZ0yAczGVzaRGeN1hR6s+OjK4A8flLUTzBh2Iaxc9MCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185007; a=rsa-sha256; cv=none; b=wAR6ArzskRysMOW1HtOd0PEZmfIjjFdySv9ZjGU6JjHyZ3cDCTqlT0xM5dK7ABet6o/qum Skz1GicfzlbkyOEWauUJ96HwO2EhnLli3TZFmX5aT2KdtkDGeFW1A7poyIygtzbnJDQYYP h7WgYd4HLTkETJ0vXjtXnpOJFLMECX5qT7vu8C56oxSiK5GoWZGPaACKjNCTapSeD86Jx0 qaPssVqWsaosH+JIsRElRyRm8Kq0NGqxgfWNfppF/I/EtQ7sTHuxNiVH/8WoZLv13AG66a ffB4kF5HAuA375UZDgsfNUsve0KBGwXoI7sx2d/KbTpccOzCH5+zAnhX1o5ZjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFV6xd1zGDK; Fri, 20 Jan 2023 03:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NQIp042165; Fri, 20 Jan 2023 03:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NQ5M042164; Fri, 20 Jan 2023 03:23:26 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:26 GMT Message-Id: <202301200323.30K3NQ5M042164@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: d81d67edb1cb - stable/13 - Provide consistent prototype for swp_pager_meta_free() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d81d67edb1cb372fb2833ecda05f8f35ac815a03 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d81d67edb1cb372fb2833ecda05f8f35ac815a03 commit d81d67edb1cb372fb2833ecda05f8f35ac815a03 Author: Konstantin Belousov AuthorDate: 2022-12-09 15:21:16 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:12 +0000 Provide consistent prototype for swp_pager_meta_free() Tested by: pho (cherry picked from commit 645510e62e34d9af4c2d57c7a6443a494511918d) --- sys/vm/swap_pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 407ef1473760..372019affa46 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -483,7 +483,7 @@ static daddr_t swp_pager_getswapspace(int *npages); * Metadata functions */ static daddr_t swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); -static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_size_t, +static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_pindex_t, vm_size_t *); static void swp_pager_meta_transfer(vm_object_t src, vm_object_t dst, vm_pindex_t pindex, vm_pindex_t count, vm_size_t *freed); From nobody Fri Jan 20 03:23:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFX3wxwz30vb3; Fri, 20 Jan 2023 03:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFX1vPjz3n6N; Fri, 20 Jan 2023 03:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekn/hMCwR0/1eLi47UHSs51RRzc0TFs0bfz7eiJyKjc=; b=ODgSG0uyetexr6NPIZF+Mz6qks1XTRbitQmg8DBKEs8TVvAK7THW1APxbQdA/ybVXeqacR E7L99YCAvRVyVS75JhCKIMDzf8s/sM8Y7SYfl7qOY5loGKtc32Hum5ahnZJsoiKp5pVKLj T8m0cLZ4YzmY4nHu/6YvpWtxlnEFvZtH5O2kTtK2QfDkIyt9m7G29MnQk/CyhKYYumZKmX XHBDMvNzPIF6tXDa73LtyZvuDi7SkWDzcGmbViZRuz9xF/zIZZxzvfCVmVaOv5aq57iyfT nlNw9oR1QqANA/Yv9p1uwwLV8mlndOe9GWSKMBncpT0UNcnfaBQteQaHMUJ7Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekn/hMCwR0/1eLi47UHSs51RRzc0TFs0bfz7eiJyKjc=; b=ZMHva+WdaFTd4ZiVC8bK3J/qAsV10nYiQFb17rVNW1vGJ4dPMoEbUsNjG1T0kQF7X8n5Yr 08XGpUZF8+udE+l78NrxOcA1rdmS3NomyYcEN49g0yU7thzmgWN9gS8N7ln3ANjvacm5A1 X64NZLWnuKKmTl8zkreflGRXFrzoqleCtp8yV6h3Zdg7DpPYe1izWvXYxDHyVshFvjQNFf WTM4Fima+StNDEqLIAj4zHKK2pIReC8B4pnXgOJagFZuE8eImfaew+CYfoHmudX5kJQzCW R9oQiDthEiBDRVM22oqh6nW726uQxU8l85Gln8rjn1wz8tVu/pfrzreZbn3x7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185008; a=rsa-sha256; cv=none; b=tF3fKf+1UPzabLtLmyi2gQ8YCKoYu0mrvLNT+H6hXw2G4NhmO87pM5cl2Um1EGBc2lAnYW T24WBjTYcdJIOYQhdYcbPYdVObSWO1hu90EEBzXvDlwVHxs/lHeMd3jDmTbIX2LGZ1s5j6 Odlb0fDrOPNlsgxDaIDK6eBziUA5iDJTC7tUwmmmNijcV+boVEIUFf+bR5vMxgvN4CYCUu Pd51BfxYI82r6V8SUjOUJYGnE5HTkjJd5Wa7Xo4VpnHjeV0PcZFhVT4g0+sBsXlvhwvBX5 St1H3ftJtGxlvVFMaDH500TGK9Iq2BGuoCpM1K/fo9O32TpHfG5wLb42nAYJsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFX0CpszFf0; Fri, 20 Jan 2023 03:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NRqr042190; Fri, 20 Jan 2023 03:23:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NRca042189; Fri, 20 Jan 2023 03:23:27 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:27 GMT Message-Id: <202301200323.30K3NRca042189@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: e2d3dbe4ced6 - stable/13 - tmpfs: make vm_object point to the tmpfs node instead of vnode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e2d3dbe4ced68454afe0be0cb426bb2036c37454 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2d3dbe4ced68454afe0be0cb426bb2036c37454 commit e2d3dbe4ced68454afe0be0cb426bb2036c37454 Author: Konstantin Belousov AuthorDate: 2022-10-20 12:00:21 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:17 +0000 tmpfs: make vm_object point to the tmpfs node instead of vnode Tested by: pho (cherry picked from commit d9dc64f1589360f2062ad92d63f69e13121e472a) --- sys/fs/tmpfs/tmpfs.h | 17 +++++++++++++++++ sys/fs/tmpfs/tmpfs_subr.c | 25 ++++++++----------------- sys/fs/tmpfs/tmpfs_vfsops.c | 2 +- sys/vm/vm_object.h | 15 ++++----------- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 99368d67aaaa..40f32ed62a7b 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -527,6 +527,23 @@ extern int tmpfs_pager_type; * specific ones. */ +static inline struct vnode * +VM_TO_TMPFS_VP(vm_object_t obj) +{ + struct tmpfs_node *node; + + MPASS((obj->flags & OBJ_TMPFS) != 0); + + /* + * swp_priv is the back-pointer to the tmpfs node, if any, + * which uses the vm object as backing store. The object + * handle is not used to avoid locking sw_alloc_sx on tmpfs + * node instantiation/destroy. + */ + node = obj->un_pager.swp.swp_priv; + return (node->tn_vnode); +} + static inline struct tmpfs_mount * VFS_TO_TMPFS(struct mount *mp) { diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index f0ed8ee404fa..7125b16dea33 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -113,7 +113,7 @@ tmpfs_pager_writecount_recalc(vm_object_t object, vm_offset_t old, VM_OBJECT_ASSERT_WLOCKED(object); - vp = object->un_pager.swp.swp_tmpfs; + vp = VM_TO_TMPFS_VP(object); /* * Forced unmount? @@ -194,15 +194,14 @@ tmpfs_pager_getvp(vm_object_t object, struct vnode **vpp, bool *vp_heldp) /* * Tmpfs VREG node, which was reclaimed, has tmpfs_pager_type - * type, but not OBJ_TMPFS flag. In this case there is no - * v_writecount to adjust. + * type. In this case there is no v_writecount to adjust. */ if (vp_heldp != NULL) VM_OBJECT_RLOCK(object); else VM_OBJECT_ASSERT_LOCKED(object); if ((object->flags & OBJ_TMPFS) != 0) { - vp = object->un_pager.swp.swp_tmpfs; + vp = VM_TO_TMPFS_VP(object); if (vp != NULL) { *vpp = vp; if (vp_heldp != NULL) { @@ -572,9 +571,10 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, case VREG: nnode->tn_reg.tn_aobj = vm_pager_allocate(tmpfs_pager_type, NULL, 0, - VM_PROT_DEFAULT, 0, - NULL /* XXXKIB - tmpfs needs swap reservation */); - /* OBJ_TMPFS is set together with the setting of vp->v_object */ + VM_PROT_DEFAULT, 0, + NULL /* XXXKIB - tmpfs needs swap reservation */); + nnode->tn_reg.tn_aobj->un_pager.swp.swp_priv = nnode; + vm_object_set_flag(nnode->tn_reg.tn_aobj, OBJ_TMPFS); nnode->tn_reg.tn_tmp = tmp; break; @@ -667,14 +667,9 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, uobj = node->tn_reg.tn_aobj; if (uobj != NULL && uobj->size != 0) atomic_subtract_long(&tmp->tm_pages_used, uobj->size); - tmpfs_free_tmp(tmp); - - if (uobj != NULL) { - KASSERT((uobj->flags & OBJ_TMPFS) == 0, - ("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj)); + if (uobj != NULL) vm_object_deallocate(uobj); - } break; case VLNK: tmpfs_free_tmp(tmp); @@ -816,8 +811,6 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) want_vrele = true; } - vm_object_clear_flag(obj, OBJ_TMPFS); - obj->un_pager.swp.swp_tmpfs = NULL; if (vp->v_writecount < 0) vp->v_writecount = 0; VI_UNLOCK(vp); @@ -970,8 +963,6 @@ loop: VI_LOCK(vp); KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); vp->v_object = object; - object->un_pager.swp.swp_tmpfs = vp; - vm_object_set_flag(object, OBJ_TMPFS); vn_irflag_set_locked(vp, VIRF_PGREAD); VI_UNLOCK(vp); VM_OBJECT_WUNLOCK(object); diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index c80042286948..7cba983a1847 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -246,7 +246,7 @@ again: VM_OBJECT_RUNLOCK(object); continue; } - vp = object->un_pager.swp.swp_tmpfs; + vp = VM_TO_TMPFS_VP(object); if (vp->v_mount != mp) { VM_OBJECT_RUNLOCK(object); continue; diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 4a3c27514eb6..f221f1b0759b 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -156,20 +156,13 @@ struct vm_object { /* * Swap pager * - * swp_tmpfs - back-pointer to the tmpfs vnode, - * if any, which uses the vm object - * as backing store. The handle - * cannot be reused for linking, - * because the vnode can be - * reclaimed and recreated, making - * the handle changed and hash-chain - * invalid. - * - * swp_blks - pc-trie of the allocated swap blocks. + * swp_priv - pager-private. + * swp_blks - pc-trie of the allocated swap blocks. + * writemappings - count of bytes mapped for write * */ struct { - void *swp_tmpfs; + void *swp_priv; struct pctrie swp_blks; vm_ooffset_t writemappings; } swp; From nobody Fri Jan 20 03:23:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFY3PkLz30vc2; Fri, 20 Jan 2023 03:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFY2FJ8z3nHb; Fri, 20 Jan 2023 03:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DaD1tEOtcb8e+gw5AwI/aG5xU4dLkGXliOkCq6vMJA4=; b=uCeOo5gkeDVEI5ZM23jThVGZphzJpnxKXT7L16h2ZxxEAKejo7RM+JHNudvgU0MBlgSz8G s1JOXN/Ia5Wwkbebq0FVKH+HLUpQ8acdp0WeFWBDH8VIhxIdAOw2o2lrjxn2YRHYRfl2N0 Nk6Xs6fl3lYQST8L0Qfee3NRLEYlVrNcUa+bMTl5bp41tGnS9IKSo8aiLgUsrujptZe1yF yQDx2p0Sk1Z6HzmuM431SlMWS+k3KerFfzG5P48zjfTQR07ODf4HYtXyMdYy+a6XQ8mfKZ jT6sN02iZ5Fzzgictb+CWf8/iwdmG3P1QqTGuqtpV1Qy7zUxI2EU3T4B2dn9qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DaD1tEOtcb8e+gw5AwI/aG5xU4dLkGXliOkCq6vMJA4=; b=fRU3AyEq+BZfllHKeQopMtzofQqv4z1K7GQRxuDhusECsYWikIR15Zymb7Gz0RbU+kNJuj T9i3ydwtkvQZzeQ9QnuoI6THMP6X8O1v7FHxOXBza5jLz/rTliiXnE561Aej9PYnmo41ka 56gPlSFMt+ymCgz1r1H3EtUfWyXPxkcBNrA1sCr/2nXH7mrggj5xuNvqknX+h22eYJWKXb Td6v8evdM5PngdId1ePfLixFrK3Q5h/imunQFmIJLJ3+78LMwQUJwdaXOMxHNer9YXUe3c hGsToL90mr1t2F0GMewoBaQJfwPAqcQNQpXdEx3OavABBDNouwfE2pEC3mJuvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185009; a=rsa-sha256; cv=none; b=r3TMavoMimZwEFsahNjjFXfeKCMXxF1vqEbNw4ZRZmKTU3P0kY3ae+csrR7IyJYJ9QL0AI 5e10Nfcl5klV/Xwuc55z5Y4bUVgFrX9dpcJvMzF0IT2N3Yf4o/k0/+lSzAOAPCMdY/a7Qc NV4KPjK+NsymItzRnJhV8afJATWpFFnBD0VwQKxR89cihamPGt3pGCy/Nw7JXVBza+53Go +cUJ3ADQ6cFzWVFhP+50JmfWj+kjNtjNnGyNfrSAgW10afcHlAzpmGXclvFDb+GeIL54iV qD2pwMHe+5pIbmAY4LPLGVoDnDly9Rko4L3bi+RLqJSyTPFqGaPVR7ZLMK5Owg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFY1L4wzFtm; Fri, 20 Jan 2023 03:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NTsY042215; Fri, 20 Jan 2023 03:23:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NTCo042214; Fri, 20 Jan 2023 03:23:29 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:29 GMT Message-Id: <202301200323.30K3NTCo042214@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: 6219bd0436b8 - stable/13 - vm_pager: add methods for page insertion and removal notifications List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6219bd0436b88ba75ab062046fc3cd174ba03d08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6219bd0436b88ba75ab062046fc3cd174ba03d08 commit 6219bd0436b88ba75ab062046fc3cd174ba03d08 Author: Konstantin Belousov AuthorDate: 2022-10-20 12:55:38 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:22 +0000 vm_pager: add methods for page insertion and removal notifications Tested by: pho (cherry picked from commit d537d1f12e8829faccd395115193b03b578f1176) --- sys/vm/vm_page.c | 4 ++++ sys/vm/vm_pager.c | 2 ++ sys/vm/vm_pager.h | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 5d94962c312b..0030bf47c814 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1483,6 +1483,7 @@ vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, return (1); } vm_page_insert_radixdone(m, object, mpred); + vm_pager_page_inserted(object, m); return (0); } @@ -1557,6 +1558,8 @@ vm_page_object_remove(vm_page_t m) if ((m->a.flags & PGA_SWAP_FREE) != 0) vm_pager_page_unswapped(m); + vm_pager_page_removed(object, m); + m->object = NULL; mrem = vm_radix_remove(&object->rtree, m->pindex); KASSERT(mrem == m, ("removed page %p, expected page %p", mrem, m)); @@ -1879,6 +1882,7 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex) vm_page_insert_radixdone(m, new_object, mpred); vm_page_dirty(m); + vm_pager_page_inserted(new_object, m); return (0); } diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index d81e5ec8692d..5ba37189a273 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -422,6 +422,8 @@ vm_pager_alloc_dyn_type(struct pagerops *ops, int base_type) FIX(mightbedirty); FIX(getvp); FIX(freespace); + FIX(page_inserted); + FIX(page_removed); #undef FIX } pagertab[res] = ops; /* XXXKIB should be rel, but acq is too much */ diff --git a/sys/vm/vm_pager.h b/sys/vm/vm_pager.h index e332231a77c6..5917bf651760 100644 --- a/sys/vm/vm_pager.h +++ b/sys/vm/vm_pager.h @@ -69,6 +69,8 @@ typedef void pgo_getvp_t(vm_object_t object, struct vnode **vpp, bool *vp_heldp); typedef void pgo_freespace_t(vm_object_t object, vm_pindex_t start, vm_size_t size); +typedef void pgo_page_inserted_t(vm_object_t object, vm_page_t m); +typedef void pgo_page_removed_t(vm_object_t object, vm_page_t m); struct pagerops { int pgo_kvme_type; @@ -87,6 +89,8 @@ struct pagerops { pgo_mightbedirty_t *pgo_mightbedirty; pgo_getvp_t *pgo_getvp; pgo_freespace_t *pgo_freespace; + pgo_page_inserted_t *pgo_page_inserted; + pgo_page_removed_t *pgo_page_removed; }; extern const struct pagerops defaultpagerops; @@ -249,6 +253,26 @@ vm_pager_freespace(vm_object_t object, vm_pindex_t start, method(object, start, size); } +static __inline void +vm_pager_page_inserted(vm_object_t object, vm_page_t m) +{ + pgo_page_inserted_t *method; + + method = pagertab[object->type]->pgo_page_inserted; + if (method != NULL) + method(object, m); +} + +static __inline void +vm_pager_page_removed(vm_object_t object, vm_page_t m) +{ + pgo_page_removed_t *method; + + method = pagertab[object->type]->pgo_page_removed; + if (method != NULL) + method(object, m); +} + int vm_pager_alloc_dyn_type(struct pagerops *ops, int base_type); void vm_pager_free_dyn_type(objtype_t type); From nobody Fri Jan 20 03:23:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFZ4kM9z30vfS; Fri, 20 Jan 2023 03:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFZ3RNHz3n9J; Fri, 20 Jan 2023 03:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XmSmKRBt2+Y1ba8rZts3H3yyWLOw7/fERFOaMCxCDas=; b=O5g6GcjjSOK4OqpdgGabCwLdKYUVeQlAleQa+mR+fq10AW9veb48klZAN09jvdvPfbWcxB aYq1sZ2O5KO3OdpDQEDWJ1R7On23YMkJToU+AK0EYh1+IDWpHXstPPZAEOn0jkkoi7biPD uGDNc9/D5kTmbhToYdg6Fsn8RD7q3dQLYuk8xau16zVvJW9eupTKqyJo1zE1c26GKHrh49 Wl9UlOl32Ehuejt3QifzsWZyD4EhSq0t0mgAF6N3M8GOa36fnCN7p48armP57B1LbrZERt CkSxctPvpNHhfqYoFhnND2uRYWecCelXD1HXr4+KoP/0Pjn6mlr2dQwj6zqCfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XmSmKRBt2+Y1ba8rZts3H3yyWLOw7/fERFOaMCxCDas=; b=mnGLmop8in78050R7ZLZF8KYapwKLkbhnoSHfCyBRLHxhiE1CLodPJAR1h+jya2NvVtmab YnEiV2UMNxSfThEFLAKGzEiUn7iN4ouvF9DGZSB9hq8iJq/kJfC1ASSmCoLAajH4zu0Tx8 2SAQEa+KaFvvV2Qp2MOoxiWSmrgvcKpQ2rSwhZOF98Q6BUyoW7iyTFFHr5GDhm7ekPzc/Q 4EW3q8wLOpiVtAWhUGqzRLQKejMPAGazE4dcLqHvTZjwF+NcAwKR0vMdjWhnqrjzJzusYD 5Oncus3Q0w3FS3/wKkHlh/z5+BdwCy6k1eXdoQAqFldQW5mZy33Yna8IvJvhRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185010; a=rsa-sha256; cv=none; b=BzNOABvBCBG+MO9tTiZvzafcSDZKarUvTW8dj6kKJ3nbIEky/oRX/FWUBO21gbTSNbQjfl rahZNJo5cVzW/nO9gXyH+GOS2D1nfuvJtTyr3x07ebYF+VQJh67QbvTS6D+J9uVjtStCBG wWFRwbKf0I1CZzXR/JH/f/zuHkLkDc35ci7KL4ip9kj+2YB7NAg9HapcWxAhYhmEbetoYT +Lp+Ra4htYPAoh3HmW5lfa8LOFNC4NLPF5AH/vT6vOP4E5qzmkRaAC8mBpi7miLhGhpja0 ZLBa9M+1kjFKJdR0EFNntjEAjeLBFq+snJyrFpwb9m8Tuk8wQL4s2lUDJgD4Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFZ2MHNzFtn; Fri, 20 Jan 2023 03:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NUCm042245; Fri, 20 Jan 2023 03:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NUmW042244; Fri, 20 Jan 2023 03:23:30 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:30 GMT Message-Id: <202301200323.30K3NUmW042244@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: 7d05e01b3e59 - stable/13 - vm_pager: add method to veto page 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 7d05e01b3e59c12f1b7a07dbf3b0ed11ac62ed13 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7d05e01b3e59c12f1b7a07dbf3b0ed11ac62ed13 commit 7d05e01b3e59c12f1b7a07dbf3b0ed11ac62ed13 Author: Konstantin Belousov AuthorDate: 2022-10-20 13:15:46 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:29 +0000 vm_pager: add method to veto page allocation Tested by: pho (cherry picked from commit ec201dddfbddd3a77dd3f3afc9b007d0e13e7ad1) --- sys/vm/vm_fault.c | 4 ++++ sys/vm/vm_page.c | 4 ++++ sys/vm/vm_pager.c | 1 + sys/vm/vm_pager.h | 11 +++++++++++ 4 files changed, 20 insertions(+) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 32b09fc469d7..605cf1203554 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1192,6 +1192,10 @@ vm_fault_allocate(struct faultstate *fs) #if VM_NRESERVLEVEL > 0 vm_object_color(fs->object, atop(fs->vaddr) - fs->pindex); #endif + if (!vm_pager_can_alloc_page(fs->object, fs->pindex)) { + unlock_and_deallocate(fs); + return (FAULT_FAILURE); + } alloc_req = P_KILLED(curproc) ? VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL; if (fs->object->type != OBJT_VNODE && diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 0030bf47c814..736b25a1f2b5 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2029,6 +2029,8 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pindex_t pindex, int domain, flags = 0; m = NULL; + if (!vm_pager_can_alloc_page(object, pindex)) + return (NULL); pool = object != NULL ? VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT; again: #if VM_NRESERVLEVEL > 0 @@ -4676,6 +4678,8 @@ retrylookup: *mp = NULL; return (VM_PAGER_FAIL); } else if ((m = vm_page_alloc(object, pindex, pflags)) == NULL) { + if (!vm_pager_can_alloc_page(object, pindex)) + return (VM_PAGER_AGAIN); goto retrylookup; } diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 5ba37189a273..ea5ce36f1963 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -424,6 +424,7 @@ vm_pager_alloc_dyn_type(struct pagerops *ops, int base_type) FIX(freespace); FIX(page_inserted); FIX(page_removed); + FIX(can_alloc_page); #undef FIX } pagertab[res] = ops; /* XXXKIB should be rel, but acq is too much */ diff --git a/sys/vm/vm_pager.h b/sys/vm/vm_pager.h index 5917bf651760..0e248d871250 100644 --- a/sys/vm/vm_pager.h +++ b/sys/vm/vm_pager.h @@ -71,6 +71,7 @@ typedef void pgo_freespace_t(vm_object_t object, vm_pindex_t start, vm_size_t size); typedef void pgo_page_inserted_t(vm_object_t object, vm_page_t m); typedef void pgo_page_removed_t(vm_object_t object, vm_page_t m); +typedef boolean_t pgo_can_alloc_page_t(vm_object_t object, vm_pindex_t pindex); struct pagerops { int pgo_kvme_type; @@ -91,6 +92,7 @@ struct pagerops { pgo_freespace_t *pgo_freespace; pgo_page_inserted_t *pgo_page_inserted; pgo_page_removed_t *pgo_page_removed; + pgo_can_alloc_page_t *pgo_can_alloc_page; }; extern const struct pagerops defaultpagerops; @@ -273,6 +275,15 @@ vm_pager_page_removed(vm_object_t object, vm_page_t m) method(object, m); } +static __inline bool +vm_pager_can_alloc_page(vm_object_t object, vm_pindex_t pindex) +{ + pgo_can_alloc_page_t *method; + + method = pagertab[object->type]->pgo_can_alloc_page; + return (method != NULL ? method(object, pindex) : true); +} + int vm_pager_alloc_dyn_type(struct pagerops *ops, int base_type); void vm_pager_free_dyn_type(objtype_t type); From nobody Fri Jan 20 03:23:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFc0L5yz30vhl; Fri, 20 Jan 2023 03:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFb4PjXz3my7; Fri, 20 Jan 2023 03:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F4ksGdXZc9EcWhl3ddPEC3/Oh4L7CcBpdG1MlGeSN9Q=; b=vyKNE+GZ292/upOzm1zDnusnpPoiP6uPAIS3nFp0rwjVSbdvlxUSPoWC38CaIkxXpokP/O pYYDJToe4O4XM3VylFk83bqG0xgtqxuSgjejzrPIT3t9enTesyoUGR5iLuAzJORgWIzgK9 uZcnK5MuIkER/PGZW6+wnYd7ZzvR+liOTwLSN1sQqGOl5UHFMDX6FaYzNxKCRXsBry6WGy 4znMu5w1vKGbF+owv+jI0xJ4T1+KsXikZKqbYvLM9QCi+Y/wETwrUJ0Gv8yuiQfQqhzqY/ ZN5EYxe2aXoFFsj5dk8/sM9wz1zSadaZmBO0TZ/jB0V6Ku8NPZqAfxaPuBuz3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F4ksGdXZc9EcWhl3ddPEC3/Oh4L7CcBpdG1MlGeSN9Q=; b=ocfjQw+Y54P46L3yEUSt91C2vvh8G/vUPELMdq4POE5FOaKc9+NIROpZxHsJvdvfD4eBqC eApuJzu6g6KX2JEHKz4fbbMP7X/7JeDwHyaeLYvNJsFbWPreunSa9y6a+A2j/2bppLohmf 7f9n3XkTch4ioYJNnKBuq/kAOQL56UB17xEsMTVIzab9ZtVn5P5b9EcaRXFTlRnNYZBwp0 Q2cMvjsjONSE+t4pH1n8cX4BTW9T9ZEzK4gdxqn1pBE4Zm2cMX+JiM36Wlckk8APlZLwqv GDd1Zw8ZkRRhyiIrKXUmcsnhbGCfsn45Pv6wMSk3BL6ttQCgfuSNE/fYP7EINQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185011; a=rsa-sha256; cv=none; b=UaqR68ewwq1I7Y7CIbUQpOQ0A1ryJxLSNO8qMOwPB7CTkbz1VwI6wPSaai66VwuxRoWjPp r2hIXj59W6C3Y9ItWhqVBGRFqnUx/yyjHvKMLHeCo/VSQVQ/CeHkSAUTLd3NNJPj/sMH1p 7GGjnCMiZFTmY8OQmWVqbYv81hq2oUro9ycuhw7etO5HdNP2Ai0fykFrhW6ZeVu45zWzhH zpLlQIf9MWeqmrjwQ5P1tLc6I6Ow81XgGv9uTjUu8azTMIlejQ2xZjJa2LSR+QekzABwwl ALVFwLq736OJF1p+Wfhv7Z8vr09ObCebkcX5Ootve5vUjbVy088HBcey06TQYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFb3K4ZzGDL; Fri, 20 Jan 2023 03:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NVS4042269; Fri, 20 Jan 2023 03:23:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NVpg042268; Fri, 20 Jan 2023 03:23:31 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:31 GMT Message-Id: <202301200323.30K3NVpg042268@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: aaac643676bc - stable/13 - vm_page_grab_valid(): clear *mp in case of pager denying page 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: aaac643676bce2c80a78069e2c4a45deb50448dc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aaac643676bce2c80a78069e2c4a45deb50448dc commit aaac643676bce2c80a78069e2c4a45deb50448dc Author: Konstantin Belousov AuthorDate: 2022-12-17 00:12:14 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:35 +0000 vm_page_grab_valid(): clear *mp in case of pager denying page allocation Tested by: pho (cherry picked from commit 3249449190c2c71ecfc4fa5f518f94ff552df440) --- sys/vm/vm_page.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 736b25a1f2b5..ecabd6c4798e 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -4678,8 +4678,10 @@ retrylookup: *mp = NULL; return (VM_PAGER_FAIL); } else if ((m = vm_page_alloc(object, pindex, pflags)) == NULL) { - if (!vm_pager_can_alloc_page(object, pindex)) + if (!vm_pager_can_alloc_page(object, pindex)) { + *mp = NULL; return (VM_PAGER_AGAIN); + } goto retrylookup; } From nobody Fri Jan 20 03:23:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFd008yz30vc9; Fri, 20 Jan 2023 03:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFc5cCrz3nNF; Fri, 20 Jan 2023 03:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PTwnmlXNGA1YnxIC8pKM/sn1h2xWpPdcpc6FUvt5LjM=; b=k4XEsW6ZnXUnng/u58+sO516nZmcvAsoyUfKcL5CflOZWQ+Y0G8CNEwSS338ozLOvQPO45 /loJIKK0UXar7jXteEtZ0p1HVsLyNtmgLQyo/EnXsseKeOmBaQ5kyVibwte160J0m+qDml oKAzPJnRVkeKvjmrPT/9chSQBnwxOuT+8gEqBiB3uC5H6pEFwFJadp98w87pJ0Xn+IDn7A 0TilGdynfZm3JrRlM2v3nDMLRWy2zwd1WDOEtUB9gLAg5Q3jhGBiOGI5hVS1wQupEzxsRx KDEeDP338Ao+Ky4vo/6A/n3vWEfF8sWCq2wpk+AYFpN7nVaU63/hX8skwFl7gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PTwnmlXNGA1YnxIC8pKM/sn1h2xWpPdcpc6FUvt5LjM=; b=wmnW0GlD8pkariqjTnSBpMT+bKL01TJ0KHZ1d6X1yiUO4aL5wDDyTjsBKGWNXeIQ540Z29 nIlMrtiZYS/bxnUXVrDvPWdtRSv8YaiWWYMQr03KwjNcfe8u4q/Vx12+9ft/RjJJwq8PoZ K+/Utps9nxS8MUxFrlzz93nsO1JTQuuyNw/fTnqQuCuqB31SVJ6TLfGrIyUfGhB1F5OwyM B+8bSyihfdXXEe2vcNvK/XculBSfW14SgLRcDdg15Yz5RUgU0vHR5A+oNHnmOX7slN/p/6 /kSGx/Y+8ITvbmBCx8WfvxmtlVGSTxP6Gjt+2DbkF11YW9+HGzssNelz7jH2aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185012; a=rsa-sha256; cv=none; b=aARXRQlmS0dObLqEUur4BzC/S0CBaS5pdpDoS74ZuEkOldhCP5SkVJJSBfy7EwDtj9aChy 7auN5O0J2DRwSb90/d4jvnwfkanaUQXP5iVoUSkdiI9oXADgtlOE+VFnuZOnVQbnMC17nz l/nryHXMGuyaGivOpK20pkew9/u465k9UrnWS70DX9YbQnKkjXiO3SJyN81j2JYe2jhYRa 7HXisTeeYrjxI8rMlywKQwPA1LQr9AHrXNnNdztt6AoSq9ayDUSn8D4pMpfo0ZOr+m0EVd J3UxOiWqsgoBCBt6rdERyCiXydZu5hiwBjy+oaVPjebjWcxVLu7f0brc2B24qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFc4GBvzGDM; Fri, 20 Jan 2023 03:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NWlF042295; Fri, 20 Jan 2023 03:23:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NWSk042294; Fri, 20 Jan 2023 03:23:32 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:32 GMT Message-Id: <202301200323.30K3NWSk042294@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: c9e7aae6e6f9 - stable/13 - vm_pager_allocate(): override resulting object type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: c9e7aae6e6f90f700516f0a67fc5cf264daaf610 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c9e7aae6e6f90f700516f0a67fc5cf264daaf610 commit c9e7aae6e6f90f700516f0a67fc5cf264daaf610 Author: Konstantin Belousov AuthorDate: 2022-12-04 00:37:28 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:41 +0000 vm_pager_allocate(): override resulting object type Tested by: pho (cherry picked from commit cd086696c2cb6d23bac3bc749836d36a9280ae98) --- sys/vm/vm_pager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index ea5ce36f1963..cff8f5f9bdc3 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -250,9 +250,14 @@ vm_object_t vm_pager_allocate(objtype_t type, void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t off, struct ucred *cred) { + vm_object_t object; + MPASS(type < nitems(pagertab)); - return ((*pagertab[type]->pgo_alloc)(handle, size, prot, off, cred)); + object = (*pagertab[type]->pgo_alloc)(handle, size, prot, off, cred); + if (object != NULL) + object->type = type; + return (object); } /* From nobody Fri Jan 20 03:23:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFd6lPVz30vfc; Fri, 20 Jan 2023 03:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFd5sbJz3nTR; Fri, 20 Jan 2023 03:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G3IWk3H61+p5Tgu3V0P1rolnjkS7NrmQkUhV9WeJASw=; b=aYR2xgg+PW/ue4KKHLI9N4rjQeO5YGL4kjXnF0bIjK8qlogI+i9LJRTu9dYQfZiRJEbFl9 9XXvYG76X0+F4TbOOMYy/kWMr78GYqtNzbUQNdK+IHnfLA2LQmgtK3wqFQwyO/20uuic4w V7/zkOEaf7bv3GgtpLal+ST4vZS3DB3Btvli29gywvDtpah8jGlAIHAsmCeJSEw/DAsu4k OXLKU+V9++DcPUs63lqMq920KhoPu3E7AXX/oV4iJjP4hyo1VZ3NWRIy30HD64Q5GOALvt +s6zzkyVqeuuef0rcD8MrVvjPJRkD33+TnZVNmQ/RtnAizGOdRn3iuBTC0z5lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G3IWk3H61+p5Tgu3V0P1rolnjkS7NrmQkUhV9WeJASw=; b=bCfIZ4Q1CIt78qrM2sC6gvl6xLkhOqOoXsvoEB0ffZviZJAywBdp3ol+9JGVYgR7dvK2lc huRjp0jMwn1iBZ0+KeEiDMn2TJET+YJ8A75/g3NDv744N/kBiSq1YM67e7U8cg3HCDRsE5 GtpBSPNw0QNAyO4Mzr0m7HfCPJwbl0BvjeRWC81scrRMJpZXvOu+R4SnXyR+Mkzg7hbYmg bltVIMOdum8weaV1UbsWTfYOr/r2AdwcN/6QEGO3QUy9PbPQeA2MG/t+fVU69wU4N0wCpm wwqqFtJOUwJIuZ4WAnCpw1Tn6N00pRzAyUdTEcOmBmXdCS1sJ9Eq37PcFrshbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185013; a=rsa-sha256; cv=none; b=oYE2h/Mk0UskuSlxIGe8V6acb3MWxkXryvKb8mnubQgmORvXmmMPwOXnNbMREmqjdhBA77 975Wkb6ecsrkIe3anTlmyk5Z3E1g0dHC+dYINgaoHwAePKAaTwBdOtf+LPfqzjjy+kSPin ESHiKY8fIlPmlbVrGdENBaS6Aj1rcJfG19ASPo7bz4Mo0KrQOlihQBQSwWRcJHQbzT2ewU qSRz+XwmhypKrKPtqv2y1S5Zb7A7acnKyOnkDLWwWdKGHWv+B2fSmjd96NjyWxAyplFvoS IxQRBWsvQEuAyaJ6zUH5jFGWoUAKTMDqL2K/FC1B9T91ceo8jHtddoQWN60hxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFd4yDDzFyq; Fri, 20 Jan 2023 03:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NXCM042319; Fri, 20 Jan 2023 03:23:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NXN1042318; Fri, 20 Jan 2023 03:23:33 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:33 GMT Message-Id: <202301200323.30K3NXN1042318@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: 06e03b4b0d24 - stable/13 - tmpfs: for used pages, account really allocated pages, instead of file sizes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 06e03b4b0d24bc0c513eb7dc5651664565d0c219 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=06e03b4b0d24bc0c513eb7dc5651664565d0c219 commit 06e03b4b0d24bc0c513eb7dc5651664565d0c219 Author: Konstantin Belousov AuthorDate: 2022-10-20 13:17:43 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:50 +0000 tmpfs: for used pages, account really allocated pages, instead of file sizes PR: 223015 Tested by: pho (cherry picked from commit 37aea2649ff707f23d35309d882b38e9ac818e42) --- sys/fs/tmpfs/tmpfs.h | 18 ++++++- sys/fs/tmpfs/tmpfs_subr.c | 118 ++++++++++++++++++++++++++++++++++++++++---- sys/fs/tmpfs/tmpfs_vfsops.c | 6 ++- sys/fs/tmpfs/tmpfs_vnops.c | 17 +++++-- sys/kern/uipc_shm.c | 2 +- 5 files changed, 144 insertions(+), 17 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 40f32ed62a7b..30c80ad70d48 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -148,6 +148,7 @@ RB_HEAD(tmpfs_dir, tmpfs_dirent); * (i) tn_interlock * (m) tmpfs_mount tm_allnode_lock * (c) stable after creation + * (v) tn_reg.tn_aobj vm_object lock */ struct tmpfs_node { /* @@ -299,6 +300,7 @@ struct tmpfs_node { */ vm_object_t tn_aobj; /* (c) */ struct tmpfs_mount *tn_tmp; /* (c) */ + vm_pindex_t tn_pages; /* (v) */ } tn_reg; } tn_spec; /* (v) */ }; @@ -532,7 +534,8 @@ VM_TO_TMPFS_VP(vm_object_t obj) { struct tmpfs_node *node; - MPASS((obj->flags & OBJ_TMPFS) != 0); + if ((obj->flags & OBJ_TMPFS) == 0) + return (NULL); /* * swp_priv is the back-pointer to the tmpfs node, if any, @@ -544,6 +547,19 @@ VM_TO_TMPFS_VP(vm_object_t obj) return (node->tn_vnode); } +static inline struct tmpfs_mount * +VM_TO_TMPFS_MP(vm_object_t obj) +{ + struct tmpfs_node *node; + + if ((obj->flags & OBJ_TMPFS) == 0) + return (NULL); + + node = obj->un_pager.swp.swp_priv; + MPASS(node->tn_type == VREG); + return (node->tn_reg.tn_tmp); +} + static inline struct tmpfs_mount * VFS_TO_TMPFS(struct mount *mp) { diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 7125b16dea33..1c0b4406e460 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -214,6 +214,87 @@ tmpfs_pager_getvp(vm_object_t object, struct vnode **vpp, bool *vp_heldp) VM_OBJECT_RUNLOCK(object); } +static void +tmpfs_pager_freespace(vm_object_t obj, vm_pindex_t start, vm_size_t size) +{ + struct tmpfs_node *node; + struct tmpfs_mount *tm; + vm_size_t c; + + swap_pager_freespace(obj, start, size, &c); + if ((obj->flags & OBJ_TMPFS) == 0 || c == 0) + return; + + node = obj->un_pager.swp.swp_priv; + MPASS(node->tn_type == VREG); + tm = node->tn_reg.tn_tmp; + + KASSERT(tm->tm_pages_used >= c, + ("tmpfs tm %p pages %jd free %jd", tm, + (uintmax_t)tm->tm_pages_used, (uintmax_t)c)); + atomic_add_long(&tm->tm_pages_used, -c); + KASSERT(node->tn_reg.tn_pages >= c, + ("tmpfs node %p pages %jd free %jd", node, + (uintmax_t)node->tn_reg.tn_pages, (uintmax_t)c)); + node->tn_reg.tn_pages -= c; +} + +static void +tmpfs_page_inserted(vm_object_t obj, vm_page_t m) +{ + struct tmpfs_node *node; + struct tmpfs_mount *tm; + + if ((obj->flags & OBJ_TMPFS) == 0) + return; + + node = obj->un_pager.swp.swp_priv; + MPASS(node->tn_type == VREG); + tm = node->tn_reg.tn_tmp; + + if (!vm_pager_has_page(obj, m->pindex, NULL, NULL)) { + atomic_add_long(&tm->tm_pages_used, 1); + node->tn_reg.tn_pages += 1; + } +} + +static void +tmpfs_page_removed(vm_object_t obj, vm_page_t m) +{ + struct tmpfs_node *node; + struct tmpfs_mount *tm; + + if ((obj->flags & OBJ_TMPFS) == 0) + return; + + node = obj->un_pager.swp.swp_priv; + MPASS(node->tn_type == VREG); + tm = node->tn_reg.tn_tmp; + + if (!vm_pager_has_page(obj, m->pindex, NULL, NULL)) { + KASSERT(tm->tm_pages_used >= 1, + ("tmpfs tm %p pages %jd free 1", tm, + (uintmax_t)tm->tm_pages_used)); + atomic_add_long(&tm->tm_pages_used, -1); + KASSERT(node->tn_reg.tn_pages >= 1, + ("tmpfs node %p pages %jd free 1", node, + (uintmax_t)node->tn_reg.tn_pages)); + node->tn_reg.tn_pages -= 1; + } +} + +static boolean_t +tmpfs_can_alloc_page(vm_object_t obj, vm_pindex_t pindex) +{ + struct tmpfs_mount *tm; + + tm = VM_TO_TMPFS_MP(obj); + if (tm == NULL || vm_pager_has_page(obj, pindex, NULL, NULL) || + tm->tm_pages_max == 0) + return (true); + return (tm->tm_pages_max > atomic_load_long(&tm->tm_pages_used)); +} + struct pagerops tmpfs_pager_ops = { .pgo_kvme_type = KVME_TYPE_VNODE, .pgo_alloc = tmpfs_pager_alloc, @@ -222,6 +303,10 @@ struct pagerops tmpfs_pager_ops = { .pgo_release_writecount = tmpfs_pager_release_writecount, .pgo_mightbedirty = vm_object_mightbedirty_, .pgo_getvp = tmpfs_pager_getvp, + .pgo_freespace = tmpfs_pager_freespace, + .pgo_page_inserted = tmpfs_page_inserted, + .pgo_page_removed = tmpfs_page_removed, + .pgo_can_alloc_page = tmpfs_can_alloc_page, }; static int @@ -576,6 +661,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, nnode->tn_reg.tn_aobj->un_pager.swp.swp_priv = nnode; vm_object_set_flag(nnode->tn_reg.tn_aobj, OBJ_TMPFS); nnode->tn_reg.tn_tmp = tmp; + nnode->tn_reg.tn_pages = 0; break; default: @@ -665,11 +751,31 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, switch (node->tn_type) { case VREG: uobj = node->tn_reg.tn_aobj; - if (uobj != NULL && uobj->size != 0) - atomic_subtract_long(&tmp->tm_pages_used, uobj->size); + node->tn_reg.tn_aobj = NULL; + if (uobj != NULL) { + VM_OBJECT_WLOCK(uobj); + KASSERT((uobj->flags & OBJ_TMPFS) != 0, + ("tmpfs node %p uobj %p not tmpfs", node, uobj)); + vm_object_clear_flag(uobj, OBJ_TMPFS); + KASSERT(tmp->tm_pages_used >= node->tn_reg.tn_pages, + ("tmpfs tmp %p node %p pages %jd free %jd", tmp, + node, (uintmax_t)tmp->tm_pages_used, + (uintmax_t)node->tn_reg.tn_pages)); + atomic_add_long(&tmp->tm_pages_used, + -node->tn_reg.tn_pages); + VM_OBJECT_WUNLOCK(uobj); + } tmpfs_free_tmp(tmp); + + /* + * vm_object_deallocate() must not be called while + * owning tm_allnode_lock, because deallocate might + * sleep. Call it after tmpfs_free_tmp() does the + * unlock. + */ if (uobj != NULL) vm_object_deallocate(uobj); + break; case VLNK: tmpfs_free_tmp(tmp); @@ -1705,7 +1811,6 @@ tmpfs_dir_whiteout_remove(struct vnode *dvp, struct componentname *cnp) int tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) { - struct tmpfs_mount *tmp; struct tmpfs_node *node; vm_object_t uobj; vm_pindex_t idx, newpages, oldpages; @@ -1717,7 +1822,6 @@ tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) node = VP_TO_TMPFS_NODE(vp); uobj = node->tn_reg.tn_aobj; - tmp = VFS_TO_TMPFS(vp->v_mount); /* * Convert the old and new sizes to the number of pages needed to @@ -1735,10 +1839,6 @@ tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) return (0); } - if (newpages > oldpages && - !tmpfs_pages_check_avail(tmp, newpages - oldpages)) - return (ENOSPC); - VM_OBJECT_WLOCK(uobj); if (newsize < oldsize) { /* @@ -1764,8 +1864,6 @@ tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) uobj->size = newpages; VM_OBJECT_WUNLOCK(uobj); - atomic_add_long(&tmp->tm_pages_used, newpages - oldpages); - node->tn_size = newsize; return (0); } diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 7cba983a1847..19d67b79c2e3 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -557,7 +557,11 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp) TMPFS_UNLOCK(tmp); mtx_destroy(&tmp->tm_allnode_lock); - MPASS(tmp->tm_pages_used == 0); + /* + * We cannot assert that tmp->tm_pages_used == 0 there, + * because tmpfs vm_objects might be still mapped by some + * process and outlive the mount due to reference counting. + */ MPASS(tmp->tm_nodes_inuse == 0); free(tmp, M_TMPFSMNT); diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 788e966fedb7..661004595f18 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -444,7 +444,6 @@ tmpfs_stat(struct vop_stat_args *v) { struct vnode *vp = v->a_vp; struct stat *sb = v->a_sb; - vm_object_t obj; struct tmpfs_node *node; int error; @@ -477,8 +476,16 @@ tmpfs_stat(struct vop_stat_args *v) sb->st_flags = node->tn_flags; sb->st_gen = node->tn_gen; if (vp->v_type == VREG) { - obj = node->tn_reg.tn_aobj; - sb->st_blocks = (u_quad_t)obj->resident_page_count * PAGE_SIZE; +#ifdef __ILP32__ + vm_object_t obj = node->tn_reg.tn_aobj; + + /* Handle torn read */ + VM_OBJECT_RLOCK(obj); +#endif + sb->st_blocks = ptoa(node->tn_reg.tn_pages); +#ifdef __ILP32__ + VM_OBJECT_RUNLOCK(obj); +#endif } else { sb->st_blocks = node->tn_size; } @@ -517,7 +524,9 @@ tmpfs_getattr(struct vop_getattr_args *v) node->tn_rdev : NODEV; if (vp->v_type == VREG) { obj = node->tn_reg.tn_aobj; - vap->va_bytes = (u_quad_t)obj->resident_page_count * PAGE_SIZE; + VM_OBJECT_RLOCK(obj); + vap->va_bytes = ptoa(node->tn_reg.tn_pages); + VM_OBJECT_RUNLOCK(obj); } else { vap->va_bytes = node->tn_size; } diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 4f06d9bea40e..a1f26b40f343 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -225,7 +225,7 @@ uiomove_object_page(vm_object_t obj, size_t len, struct uio *uio) printf("uiomove_object: vm_obj %p idx %jd " "pager error %d\n", obj, idx, rv); } - return (EIO); + return (rv == VM_PAGER_AGAIN ? ENOSPC : EIO); } VM_OBJECT_WUNLOCK(obj); From nobody Fri Jan 20 03:23:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFg0zQxz30vhq; Fri, 20 Jan 2023 03:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFf6kh1z3nMG; Fri, 20 Jan 2023 03:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iDHo9Xr43FCBOM8fJZMcwlOzlL5U3t9MyoW7KUV9+R8=; b=kZKf41kJnmsbfpv7SMJ1d0m6wFiyd0S2/XD16BznmufBaj1Zndd0a9sEJi8dING21BPdUU rHqrW1SI0ymF8wfhIsSg6JWY22bwZxYU9+wiMNfTZ+S/adFoshyL+CcDZT5g99huUMAPPi D09eFebV/CLGMtQlyg3As1OlXQpaquC8g2gqLKFBQlY4QYmmypoWguoG1XgGAK8lThI3ds AwP7AinQkuOR4qfSOE2GLTeuvYcXRuoOoz8jlTSmEPQ//RyNDmzfW/0R35ff50r8MptSHk 7IsjxoI2oQsszuO/ehLi8sZwYz4NoLv/srSu2umbwTgUxCXsl46alHjfPIFORQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iDHo9Xr43FCBOM8fJZMcwlOzlL5U3t9MyoW7KUV9+R8=; b=XkUlGf24uRtqrngUOLMUf/20syiWsTs869mmu0GbYhqhG08ENZl0Iz51HVDzN/z1rCj55U G+deSiQs6RgGDt+Uan51U1x/Cahn3Y+naNbHkWYdvN76HK3SAfkLgYGTtLD4d9TkqH4JVg I46C9M0lwROCuAH+v2NdEaUIHd2bPnGrJcjnKafQriJv+C1mNaIfWVUNOSrcLSjmJo+hfG WMFYfnOmhTZc32Wn2TW8NLRrKg6MArp1+DBs3gafTMIZ31auHE66M9s7XeRfjrpeR04Pad 8eSslo0xHolaiS6rUcoWq+kuR1Y1sfs7lEnK39gnXhN5AwrhRKb2Une1Vt8ovQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185014; a=rsa-sha256; cv=none; b=ARhW9vUCUlHykxcYTMe7Wr5ZLOOOqtLcAjlVDFsWvwsbf6n1NkQbE88L5tr/vDRthwJUQF x4KyiWkEGasmHfb2cBqnVQoxd853HPtYHEerqPo29chxp4vggBZoye09+DDlsHEILOTRXP R4/Ag44LIhJoDt1hKjPDwMY5UJ/Wm/WpJFz0GLRoEKUw348pHYvpfnRFIjm3eb2xmdZG7q g1pwLwffRV9caU4FRXhtO1w/byN1o7e29RwzNCa8/nhC5FsV9r/LyCiCfNpseAe4IsgFw4 MXkFaFkhjyIJeWsXt6JUiGRFusH7hp5WhDV6TK/5n+hMgUxtja1AJpfaxiYirg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFf5rfKzG9K; Fri, 20 Jan 2023 03:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NY2L042343; Fri, 20 Jan 2023 03:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NY1v042342; Fri, 20 Jan 2023 03:23:34 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:34 GMT Message-Id: <202301200323.30K3NY1v042342@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: cf77a28cffc3 - stable/13 - tmpfs_getattr(): Only take vm_object lock on 32bit machines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: cf77a28cffc32a6d529ce7421b1e66beced49c5c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf77a28cffc32a6d529ce7421b1e66beced49c5c commit cf77a28cffc32a6d529ce7421b1e66beced49c5c Author: Konstantin Belousov AuthorDate: 2022-12-17 11:03:32 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:56 +0000 tmpfs_getattr(): Only take vm_object lock on 32bit machines Tested by: pho (cherry picked from commit 4d903a1a74d9526aba4d177e89c10f97df5662f2) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 661004595f18..0074e3203bbb 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -498,7 +498,6 @@ tmpfs_getattr(struct vop_getattr_args *v) { struct vnode *vp = v->a_vp; struct vattr *vap = v->a_vap; - vm_object_t obj; struct tmpfs_node *node; node = VP_TO_TMPFS_NODE(vp); @@ -523,10 +522,15 @@ tmpfs_getattr(struct vop_getattr_args *v) vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ? node->tn_rdev : NODEV; if (vp->v_type == VREG) { - obj = node->tn_reg.tn_aobj; +#ifdef __ILP32__ + vm_object_t obj = node->tn_reg.tn_aobj; + VM_OBJECT_RLOCK(obj); +#endif vap->va_bytes = ptoa(node->tn_reg.tn_pages); +#ifdef __ILP32__ VM_OBJECT_RUNLOCK(obj); +#endif } else { vap->va_bytes = node->tn_size; } From nobody Fri Jan 20 03:23:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFh2PZGz30vfh; Fri, 20 Jan 2023 03:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFh0XxRz3nR6; Fri, 20 Jan 2023 03:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frLRGfloMeFF5Apc/ESOAnLRd0G05nrj7pxMdthRDcA=; b=gIBsOcdlxfqAJIRiFExzBODUjGjQEX0uuLvc8OQ8DK4o9rCqn8D8ed7FLI57vduTqOxEKE 9ceCamur9aKUNyxUE1veq1mPw5Le31n+98/YuDQ6JVMAzfCWY0XLXKSWsANYpRrh0SE40I WfvEcc8vJCsnchAd8o9FmLBNaAvLzvvkt0vPZVGjBxTTxNsBEHU3jt6CVodJTZ1r3d3foX nLx8mf+NrGnFfq9wAZWbM8o/9M/3xg7DsLbIqgFoK5qupjAFsLdhlpRFZup9AnRHtUmtKH KQCC5+szDiDnWblJ6NSXfDnv2mPeId5ThHvtUcOmJiIvP/0qvdUBf/FPuSeJ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frLRGfloMeFF5Apc/ESOAnLRd0G05nrj7pxMdthRDcA=; b=xYV96IhAYGB2u/atIg7gQJlt2/2eAcujxkBCWD/TGdLLQfgLUteX+I7SvEGX0N4aVDYYU7 Y5okaI7tylTNGwG8K3prcOhQz9tXnMWOCLfWlOqm9YEbEseZJtcZyNZSD5PpROwhE/N13k z1+42Y4rw0jDmSOB6sXJnCW3XGZY+XKGOihmU4Tg5OFFXY1BRjw/k+vJeC0qRtQmmmSSQv v6Y9q59UqCGRIMF34qfkMW9UM21B52RJDpuMahnrRZAImZ4CYCYULMkOICW4D9nA++5wkN RgAj6wMwtXNTElyYZ0rF95PkbHtq+nmN6RfGK7EhMDz2Rnhgp7DWLNjwjBEeqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185016; a=rsa-sha256; cv=none; b=Db8MU938xpNGCOCUazgV7a0MSnVaG2zVJKqPUT7RcBlZjd19M0oRkso4WYaMHrGavIk5Xa 774/2EoLNmnqy7fnF450ZniZzgRp/zWM15ceO3nmG1ThKRPSbyC4s9TozHgcQ5d4XYHsP5 rZ+vUZxWiYUp2HsXNMjkqzaBkwbhgqwgZ61b+tGcCxx4Mu+Y1BywnksiOtaXJd6UBHFzcG QsvzaLp/6WEJkRCviHxEGsoerD3hqiCiP2MzVTEOi8SYD+wLRGlO4TQGyvv5QQoem3vph6 hTl2/ET4v5bOjexBALGV565a0LXRf80CTkGKVXGenPTg0HjbwfcPUYZWCekj9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFg6mQVzGDN; Fri, 20 Jan 2023 03:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NZha042376; Fri, 20 Jan 2023 03:23:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NZis042375; Fri, 20 Jan 2023 03:23:35 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:35 GMT Message-Id: <202301200323.30K3NZis042375@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: d689fda0703b - stable/13 - shmfd: account for the actually allocated 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d689fda0703bd7bf7320fe6e34f2abf260650f8e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d689fda0703bd7bf7320fe6e34f2abf260650f8e commit d689fda0703bd7bf7320fe6e34f2abf260650f8e Author: Konstantin Belousov AuthorDate: 2022-11-23 21:26:38 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:02 +0000 shmfd: account for the actually allocated pages Tested by: pho (cherry picked from commit 0919f29d91031cf42eca99266bffe7b0faef8f1b) --- sys/kern/uipc_shm.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++---- sys/sys/mman.h | 1 + 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index a1f26b40f343..f1dc0f828b23 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -343,6 +343,61 @@ shm_largepage(struct shmfd *shmfd) return (shmfd->shm_object->type == OBJT_PHYS); } +static void +shm_pager_freespace(vm_object_t obj, vm_pindex_t start, vm_size_t size) +{ + struct shmfd *shm; + vm_size_t c; + + swap_pager_freespace(obj, start, size, &c); + if (c == 0) + return; + + shm = obj->un_pager.swp.swp_priv; + if (shm == NULL) + return; + KASSERT(shm->shm_pages >= c, + ("shm %p pages %jd free %jd", shm, + (uintmax_t)shm->shm_pages, (uintmax_t)c)); + shm->shm_pages -= c; +} + +static void +shm_page_inserted(vm_object_t obj, vm_page_t m) +{ + struct shmfd *shm; + + shm = obj->un_pager.swp.swp_priv; + if (shm == NULL) + return; + if (!vm_pager_has_page(obj, m->pindex, NULL, NULL)) + shm->shm_pages += 1; +} + +static void +shm_page_removed(vm_object_t obj, vm_page_t m) +{ + struct shmfd *shm; + + shm = obj->un_pager.swp.swp_priv; + if (shm == NULL) + return; + if (!vm_pager_has_page(obj, m->pindex, NULL, NULL)) { + KASSERT(shm->shm_pages >= 1, + ("shm %p pages %jd free 1", shm, + (uintmax_t)shm->shm_pages)); + shm->shm_pages -= 1; + } +} + +static struct pagerops shm_swap_pager_ops = { + .pgo_kvme_type = KVME_TYPE_SWAP, + .pgo_freespace = shm_pager_freespace, + .pgo_page_inserted = shm_page_inserted, + .pgo_page_removed = shm_page_removed, +}; +static int shmfd_pager_type = -1; + static int shm_seek(struct file *fp, off_t offset, int whence, struct thread *td) { @@ -560,7 +615,6 @@ shm_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, bzero(sb, sizeof(*sb)); sb->st_blksize = PAGE_SIZE; sb->st_size = shmfd->shm_size; - sb->st_blocks = howmany(sb->st_size, sb->st_blksize); mtx_lock(&shm_timestamp_lock); sb->st_atim = shmfd->shm_atime; sb->st_ctim = shmfd->shm_ctime; @@ -573,8 +627,12 @@ shm_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, sb->st_dev = shm_dev_ino; sb->st_ino = shmfd->shm_ino; sb->st_nlink = shmfd->shm_object->ref_count; - sb->st_blocks = shmfd->shm_object->size / - (pagesizes[shmfd->shm_lp_psind] >> PAGE_SHIFT); + if (shm_largepage(shmfd)) { + sb->st_blocks = shmfd->shm_object->size / + (pagesizes[shmfd->shm_lp_psind] >> PAGE_SHIFT); + } else { + sb->st_blocks = shmfd->shm_pages; + } return (0); } @@ -858,6 +916,7 @@ struct shmfd * shm_alloc(struct ucred *ucred, mode_t mode, bool largepage) { struct shmfd *shmfd; + vm_object_t obj; shmfd = malloc(sizeof(*shmfd), M_SHMFD, M_WAITOK | M_ZERO); shmfd->shm_size = 0; @@ -870,8 +929,12 @@ shm_alloc(struct ucred *ucred, mode_t mode, bool largepage) VM_PROT_DEFAULT, 0, ucred); shmfd->shm_lp_alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; } else { - shmfd->shm_object = vm_pager_allocate(OBJT_SWAP, NULL, + obj = vm_pager_allocate(shmfd_pager_type, NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); + VM_OBJECT_WLOCK(obj); + obj->un_pager.swp.swp_priv = shmfd; + VM_OBJECT_WUNLOCK(obj); + shmfd->shm_object = obj; } KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate")); vfs_timestamp(&shmfd->shm_birthtime); @@ -900,6 +963,7 @@ shm_hold(struct shmfd *shmfd) void shm_drop(struct shmfd *shmfd) { + vm_object_t obj; if (refcount_release(&shmfd->shm_refs)) { #ifdef MAC @@ -907,7 +971,13 @@ shm_drop(struct shmfd *shmfd) #endif rangelock_destroy(&shmfd->shm_rl); mtx_destroy(&shmfd->shm_mtx); - vm_object_deallocate(shmfd->shm_object); + obj = shmfd->shm_object; + if (!shm_largepage(shmfd)) { + VM_OBJECT_WLOCK(obj); + obj->un_pager.swp.swp_priv = NULL; + VM_OBJECT_WUNLOCK(obj); + } + vm_object_deallocate(obj); free(shmfd, M_SHMFD); } } @@ -946,6 +1016,9 @@ shm_init(void *arg) new_unrhdr64(&shm_ino_unr, 1); shm_dev_ino = devfs_alloc_cdp_inode(); KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized")); + shmfd_pager_type = vm_pager_alloc_dyn_type(&shm_swap_pager_ops, + OBJT_SWAP); + MPASS(shmfd_pager_type != -1); for (i = 1; i < MAXPAGESIZES; i++) { if (pagesizes[i] == 0) diff --git a/sys/sys/mman.h b/sys/sys/mman.h index 71172bfd49a3..0413249dee2c 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -268,6 +268,7 @@ struct file; struct shmfd { vm_ooffset_t shm_size; vm_object_t shm_object; + vm_pindex_t shm_pages; /* allocated pages */ int shm_refs; uid_t shm_uid; gid_t shm_gid; From nobody Fri Jan 20 03:23:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFj2rrsz30vbH; Fri, 20 Jan 2023 03:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFj1WfZz3nVN; Fri, 20 Jan 2023 03:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DWJ29W5Fhvena/vI3muoEwD1Ly7RAvkNk3jwzf0anPs=; b=c/EQ6K8ldG79Ylhc3+fZ3ZkvCHBVPIg/nTwkuLHcvSBfQc3GCJV7Z6J/vNCLU4O2rxIcZN q9o2iPKTJDDxADQn86FiTFBnAbYzVG5sFelC31UvuHQJAvT2LtEPLJ3Ww+MbC1dG8qjuUp XV0jrl6HQ45vvuSfOKbo2q046x9hjx+xNG1dlh0M9vJa3fxL++FSg/MegEFFYxerBFmNaN I0gFdD+GigZIsQN2ubkJLaFQqGzRZsjY1Uml1Veuq9z6+BoW6LcQy9R0WRhmXY4Y18RCys ntuZ+5LFjLAcbWcf5M17DkYExmFYSqA5tqAemNkR4N7WbPazkmiEAgyYGZXG/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DWJ29W5Fhvena/vI3muoEwD1Ly7RAvkNk3jwzf0anPs=; b=iLahXXVzd5pP0MWtMARaQgoXovDfSJXbLW3Ox6HwXE/HsLKKChTwQRBNS+Eo9vfECBOrc2 Scyd2MgtxjhOYfiKV/Vyhrf3GNjeGvNro/f0ku5dX8LYBrmqnEzQg4286X/Mv0XYH2G6G/ W1Vi/C9Vp427NCJ0onwgaZpver7OEieFcgmM/ml8EvcokylIMAWF/uF72G73CKjFCxQoBh T/9xKlWBxXbz79dJZYHvflsCKoVbw1DVUPhqJQ8R+8IBoLnvx8UFG/Md8CFVL/qhMdbS1B VeDus/Lwhla+PSCprGw4Qnb9KdhIVQYThn24OBDPhEegZJYTyc1iB1ZSUhb4LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185017; a=rsa-sha256; cv=none; b=ui1WDGiypKcY8k2JRTIlPqE7cR7ljja3cccIeyiBmbfZ5JlCvbdP8ipIlUSx1JiXGAc5UZ YWiftC6ZfisQuvS+fCpVWWFR6XrY8ojuPPN7ViCvdcsTVT/ssM4WVbHKZaevbXF4ZG8Mdw TALB5//ZRCFXou/TNtltsKzGL+222SAc/IoViA1xH2yaXFe/5WyAWBRIfVzssL0V7feDAi 4AQ5FZWeHcLplxZ6w7H74KGY9fcWwhY40Bixd8Mlrecri9kTXYINi4lUZ3b9Ku4t8xrfpx MgfZ3t9a5xrAjxFdBqDIX7CAt2SArCT/Y/+7tR4QKlA1HOtezJLhjIZw3p3V2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFj0dD7zG7C; Fri, 20 Jan 2023 03:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Na4V042400; Fri, 20 Jan 2023 03:23:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NaWm042399; Fri, 20 Jan 2023 03:23:36 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:36 GMT Message-Id: <202301200323.30K3NaWm042399@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: 376418fcbd4e - stable/13 - posixshmcontrol(1): for regular shmfd, report used pages number List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 376418fcbd4e933f7dc3fbc687a2814699fbb7cf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=376418fcbd4e933f7dc3fbc687a2814699fbb7cf commit 376418fcbd4e933f7dc3fbc687a2814699fbb7cf Author: Konstantin Belousov AuthorDate: 2022-11-23 22:01:05 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:11 +0000 posixshmcontrol(1): for regular shmfd, report used pages number Tested by: pho (cherry picked from commit 1bbc5101348b9ca23cef6bde6c22751e69e8cf91) --- usr.bin/posixshmcontrol/posixshmcontrol.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.bin/posixshmcontrol/posixshmcontrol.c b/usr.bin/posixshmcontrol/posixshmcontrol.c index f64fcd3dd663..3b9d1dc256c3 100644 --- a/usr.bin/posixshmcontrol/posixshmcontrol.c +++ b/usr.bin/posixshmcontrol/posixshmcontrol.c @@ -404,6 +404,8 @@ stat_one_shm(const char *path, bool hsize, bool uname) char sizebuf[8]; struct stat st; int error, fd, ret; + struct shm_largepage_conf conf_dummy; + bool largepage; fd = shm_open(path, O_RDONLY, 0); if (fd == -1) { @@ -442,9 +444,13 @@ stat_one_shm(const char *path, bool hsize, bool uname) (long)st.st_ctim.tv_nsec); printf("birth\t%ld.%09ld\n", (long)st.st_birthtim.tv_sec, (long)st.st_birthtim.tv_nsec); - if (st.st_blocks != 0) + error = ioctl(fd, FIOGSHMLPGCNF, &conf_dummy); + largepage = error == 0; + if (st.st_blocks != 0 && largepage) printf("pagesz\t%jd\n", roundup((uintmax_t)st.st_size, PAGE_SIZE) / st.st_blocks); + else + printf("pages\t%jd\n", st.st_blocks); } close(fd); return (ret); From nobody Fri Jan 20 03:23:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFk4TSMz30vbM; Fri, 20 Jan 2023 03:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFk2vlSz3nVl; Fri, 20 Jan 2023 03:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvX+GEeoWRJEVAkU7OTTAR09Xtv0LnzZ8vtOjsT3i2o=; b=iG1ilI/SZySBRQUFJUEObP1Z02G4tb+aB1kzvHKyokcVYf1Ra8XBInulc5OsOUte+0Rhah sw0Lg6VsgiCHO67pnYBKBA0nULgooymCV1EOddLb+2y+fAt2kr4emI9h2nur+lYvZJjNMt slMEZWQ9lZwCpz/WbTZd2S8VkKcFkwuzV0VExUNIkwZ6rTc3IKrABy7zelac70VJdg6BHp oUDZrwJdgRhnU5o78TEqYVSWkXTlpp28smptfKH7l7ARN9NhRZPyK409jEAgMROupAzHwK fYjW0vGRu55sT2JM4mcqhL9jvIbG7shW65AaTxlIHHJB2Bqq6q/od+U7gSJSww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvX+GEeoWRJEVAkU7OTTAR09Xtv0LnzZ8vtOjsT3i2o=; b=Itqcyem7W28NVtYvTr4eO0w3lOlbo5DXYPqpw1JIRCioa+TvDFV4PVc9AQ4UZhSW8F1Yu5 qEAlWq4MrHluWksgLnMz3kKs4sx+5CTnr66TlwZMEfsQdHXnXbmoeSeWzzrGC4/jvRZOUj 2pud9muCLjuSJrUP6lS2R7KSRWgEWtbDQrS9iKEjAPO6zvkt9Nj8hl2rEpnDkGSMWBOIt6 KhfLjWZoCw5HmoOo7MiODvq8AQibV7YN0p56FDAptOSX1glEm2wg2d0ATyROdTyON1eK67 lRT2ptUWqtOy6IGBX4LcFCo4tBKGN2xmp0368lGUAqp8g2o7UefxYU72fMy6KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185018; a=rsa-sha256; cv=none; b=kemMA+duO4XJ6u5U8W/zwYbXVLoNxsfRV8UjWLi8vsnmURuBZcCJgoP7/CaAI0Iw65SEqJ N3ZlH4lJMgzsFQiNp/n1w3kvkYjif2sWD+yMZ8iSeTtej7HKbo8ketJPRUS9jtnDqqer0z eX3KeSAKBIEYEZO6NqoWkZvYxAz8qdbA7DqPPu9VfAYVErb9mJf0QyIxa8wt9g29+ZtXZT MC+os76+Cb+KRkDJqjOG6aDNvcLrQFWPa+rQOErHizK9cE6rTOCYWe+fl337Wr9gTdDgIc o75HrjIbv1MG73CXSNIFQVsJDGcP9jK8ZiPytjpsPqW/WNs87pdB0u0NnE1pyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFk1fNKzGDP; Fri, 20 Jan 2023 03:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NcdH042424; Fri, 20 Jan 2023 03:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3Ncnm042423; Fri, 20 Jan 2023 03:23:38 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:38 GMT Message-Id: <202301200323.30K3Ncnm042423@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: 6ca462ee004d - stable/13 - posixshm_test: small 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6ca462ee004d13422be4827c5e596dfbea3d3b86 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6ca462ee004d13422be4827c5e596dfbea3d3b86 commit 6ca462ee004d13422be4827c5e596dfbea3d3b86 Author: Konstantin Belousov AuthorDate: 2022-12-03 22:54:13 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:17 +0000 posixshm_test: small style fixes Tested by: pho (cherry picked from commit f1f030246f3e72af0ee3ba82a0e8b9f6d9559b69) --- tests/sys/posixshm/posixshm_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index 6329f0eb4f7d..06624de7c13c 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -953,7 +953,7 @@ ATF_TC_BODY(fallocate, tc) ATF_REQUIRE_MSG((error = posix_fallocate(fd, sz, sz)) == 0, "posix_fallocate failed; error=%d", error); ATF_REQUIRE(fstat(fd, &st) == 0); - ATF_REQUIRE(st.st_size == (sz * 2)); + ATF_REQUIRE(st.st_size == sz * 2); close(fd); } From nobody Fri Jan 20 03:23:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFl4hlKz30vcR; Fri, 20 Jan 2023 03:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFl3hknz3nZw; Fri, 20 Jan 2023 03:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8wvwEABtadwECSBUdCjVYvCHYQYa/d6tXV1kQkaySBk=; b=BJPmiUvnNE+D+4OVSPKHGh4geoW33ZFFnh20JfaNs01uJ36rF5/jI0Ew+y5MMXYr3SGVuc TCflphxhDdxA3eFRcEdIbzSjs9I2uGjxUfXxDQgqydJYACcV5NjrMcx+TjlNNs3fPIvAZ1 nDGhMafRsN66KbHcMfAUdtnJhb5Gj4VI7smhWoEc/dTmTjs3SbbFAoecN7Zi0W4bVqyvQa t+LQusJu6Qzd+QwvDrAla7ca+qUnZiw7zvjY8TwY0qWEIlkC+SEdGhoklIi8qBaSNSiIpk KpiobhUoF/ZfVWnuGzS2wzrsIqJA8LIYXbUcGhSiHRbY2mQwgDj72QlNdTN7fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8wvwEABtadwECSBUdCjVYvCHYQYa/d6tXV1kQkaySBk=; b=bJVIperikuW4Dx+CqVgSY/m7eLs3jp75pc/aBoT5YEr1fwJCtwYZ5PrH53Ms5eSJVfiRW6 nE8MQXkyunmkb3hgyd5tLK2lg+tq0LHAeo9KuWmYNQ4o682xtFjBwV/qRAaABRsg9BOLTv Y8iUfokSSaf/ZVDKwiaipJuhyzEknkuzBHSvfxxzC8mOVygcV2knCdsfgrfz3AR5Oh+Dzl rfS5CW7VN1bJ1dWI7opRZMWppJey2RrlzP1hS+JilYwQ6EfZaPOpE0mCU9njVJ/XQUvHoS 4S6w8rIkg4b2GLuW7jHObe8haE2MkxUsYEp7Ek67NFRsnaB/tl5OHs7R34sn1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185019; a=rsa-sha256; cv=none; b=pCRiAKNY13ygFAnGCIjBfLTLkx2KtVXZY+0oFarWpdoSUnH2xR8/OBq9YMlwO00Fdpxj5Q 4MHzbh+EvCuO6geWAsG2NLiEhtY4K8CtO2THMg7Iv1mLqiY1N/MKhKJsYI9xzIQjbnwwXJ WCS5LD+KIghUghCbREY+fIJ9RTKWCOaVvFS4jdDYhnGQXhlmk4ohOA3TRHolP3KkxwvAoG wRvX9jSrF66HfSXF91NRowTQlOUXLNXrJXdrtpMfXPMjJ7HtDsNjwpdMq7wyhpoa7/ETJA TxHU/cdnQFlQSy7znaQaIgf91Hl+cSNvbErZxXoT5VgcR/8S5uSgBUzWip14AQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFl2j6mzFtp; Fri, 20 Jan 2023 03:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Nd7e042452; Fri, 20 Jan 2023 03:23:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NdwP042451; Fri, 20 Jan 2023 03:23:39 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:39 GMT Message-Id: <202301200323.30K3NdwP042451@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: af13904908ee - stable/13 - posixshm_test: add naive page accounting test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: af13904908ee59a0fca89001078af5d6d66c79e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=af13904908ee59a0fca89001078af5d6d66c79e4 commit af13904908ee59a0fca89001078af5d6d66c79e4 Author: Konstantin Belousov AuthorDate: 2022-12-03 22:54:36 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:22 +0000 posixshm_test: add naive page accounting test For MFC, the deallocation part of the test is disabled because it is not merged to stable/13. Tested by: pho (cherry picked from commit 91ddfd352f59beb8262f98c2e8a22722207e5aa6) --- tests/sys/posixshm/posixshm_test.c | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index 06624de7c13c..a7b2e19f38af 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -173,6 +173,37 @@ verify_object(const char *path, char expected_value) close(fd); } +static off_t shm_max_pages = 32; +static const char byte_to_fill = 0x5f; + +static int +shm_fill(int fd, off_t offset, off_t len) +{ + int error; + size_t blen, page_size; + char *buf; + + error = 0; + page_size = getpagesize(); + buf = malloc(page_size); + if (buf == NULL) + return (1); + + while (len > 0) { + blen = len < (off_t)page_size ? (size_t)len : page_size; + memset(buf, byte_to_fill, blen); + if (pwrite(fd, buf, blen, offset) != (ssize_t)blen) { + error = 1; + break; + } + len -= blen; + offset += blen; + } + + free(buf); + return (error); +} + ATF_TC_WITHOUT_HEAD(remap_object); ATF_TC_BODY(remap_object, tc) { @@ -958,6 +989,40 @@ ATF_TC_BODY(fallocate, tc) close(fd); } +ATF_TC_WITHOUT_HEAD(accounting); +ATF_TC_BODY(accounting, tc) +{ + struct spacectl_range range; + struct stat st; + off_t shm_sz, len; + size_t page_size; + int fd, error; + + page_size = getpagesize(); + shm_sz = shm_max_pages * page_size; + + fd = shm_open("/testtest1", O_RDWR | O_CREAT, 0666); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno:%d", errno); + ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, shm_sz)) == 0, + "posix_fallocate failed; error=%d", error); + + ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE(st.st_blksize * st.st_blocks == (blkcnt_t)shm_sz); + +#if 0 + range.r_offset = page_size; + range.r_len = len = (shm_max_pages - 1) * page_size - + range.r_offset; + ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, + "SPACECTL_DEALLOC failed; errno=%d", errno); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE(st.st_blksize * st.st_blocks == (blkcnt_t)(shm_sz - len)); + + ATF_REQUIRE(close(fd) == 0); +#endif +} + static int shm_open_large(int psind, int policy, size_t sz) { @@ -1716,6 +1781,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cloexec); ATF_TP_ADD_TC(tp, mode); ATF_TP_ADD_TC(tp, fallocate); +<<<<<<< HEAD +||||||| parent of 91ddfd352f59 (posixshm_test: add naive page accounting test) + ATF_TP_ADD_TC(tp, fspacectl); +======= + ATF_TP_ADD_TC(tp, fspacectl); + ATF_TP_ADD_TC(tp, accounting); +>>>>>>> 91ddfd352f59 (posixshm_test: add naive page accounting test) ATF_TP_ADD_TC(tp, largepage_basic); ATF_TP_ADD_TC(tp, largepage_config); ATF_TP_ADD_TC(tp, largepage_mmap); From nobody Fri Jan 20 03:23:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFm6XmBz30vfp; Fri, 20 Jan 2023 03:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFm5DW1z3ndM; Fri, 20 Jan 2023 03:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8M7LhAUAXWfe+RAAluBZ+AjgoZpUJjqdaU26IjfgMM=; b=ZNQ1Bm3UXSBnnyrTOxoErBu2fqeqXHdgtfld1kCohK61t5+uBTQoQbuz5IrJ58XuOnmb9W It4ZptSCOuvBzV43TLbqvfBXxuRHeypzph9F+DPGWWlSe97vAjpg05lJqM5IMUef/WYDCw eVobGAxOwgRcEJDXc5Ywyt26cR30LUn8iRClmc7PtV1QbSVF2T31r1GrE6l5x2oqY7X0l6 EXCI1WLQce5DomczfCF/r27Z6DlPayypZm4EcRkuXT/jI/gPdHlo2x1Ljhpyhob/jgoCCN lvBILAI+sfxlRhw21pHACnH7A1W8EJ4dsOpmkjKZ+wSEJpONCpbKH6JP5+7+aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8M7LhAUAXWfe+RAAluBZ+AjgoZpUJjqdaU26IjfgMM=; b=JymwwRcf6eLIuBtwxO9OxC4lswv62Sz/vGcQH7rMjasLDloZAopuqkqsXN1EoW629eZlqY vtZRn/OvJeCvJb2cDdNyfQOaYNkOscDUdFJQR8V1dmITPh2N3sSTIzRy/PR46QY2rME/t0 yKRwE/rFGNT2TV+czFcoOuNjUgn0NbOhjVz1p1IN9Tq3o4/ZuZg/VSqNmJZSs0ApybmqXO hO3Si+H+gJsJR1R32giXagJ1Zh4d4DgLdq8mFz7RudYbzVIoDZt3fttMDJdU/FCJGatJwi icaZreI36x3VBbSwTsss95EgSiTeO/wSr6CSovqXnjnPh1mhTUr3FCj828+meg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185020; a=rsa-sha256; cv=none; b=Vnoe6kXj1sSVsJH6DIVZ+YsFauZi2fabOYubxJumrp1oQACKtLNtMeULPmompM0IakkaQu /4PSg8DNFuJQlO4fKOVn1iKm/QNgHaJoFVwDEXBxmKwmCwEe/duUGE/wFgXvLh0hEBvsRi BmIjx0HwQLY/CDhV9ENhUd+SqMWsULR2E0nOJRIZJLY8d9VVn8wrsEQrIZYYXiU4rAx22e W1VMboRrTW/uH7thHVv5tuOzGGDmF7y8nneY+PsKofUfepHCMTQyf8gSoo8MUhm6HIESCC UumR08J85iY/8hWyFP2VM8G2T5mIpNf80UuAALyG9vhIgcNdqxXWHHFYNc4h6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFm3SZ6zGNk; Fri, 20 Jan 2023 03:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NexK042476; Fri, 20 Jan 2023 03:23:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NePa042475; Fri, 20 Jan 2023 03:23:40 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:40 GMT Message-Id: <202301200323.30K3NePa042475@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: cf5d6ae3a1b1 - stable/13 - compat32: move struct ptrace_sc_ret32 definition from .c to .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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: cf5d6ae3a1b14b35d94da5544d273ad05a887a94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf5d6ae3a1b14b35d94da5544d273ad05a887a94 commit cf5d6ae3a1b14b35d94da5544d273ad05a887a94 Author: Konstantin Belousov AuthorDate: 2022-12-01 01:31:58 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:29 +0000 compat32: move struct ptrace_sc_ret32 definition from .c to .h Tested by: pho (cherry picked from commit f081a291a17de0e28e5b7f5adba312f0dcb59b0f) --- sys/compat/freebsd32/freebsd32.h | 5 +++++ sys/compat/freebsd32/freebsd32_misc.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index 2e4f5155cbf4..8d5eae2817f3 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -429,6 +429,11 @@ struct timex32 { int32_t stbcnt; }; +struct ptrace_sc_ret32 { + uint32_t sr_retval[2]; + int sr_error; +}; + struct ptrace_coredump32 { int pc_fd; uint32_t pc_flags; diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 14f2e2a4b752..269286ab90dc 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -130,11 +130,6 @@ struct ptrace_io_desc32 { uint32_t piod_len; }; -struct ptrace_sc_ret32 { - uint32_t sr_retval[2]; - int sr_error; -}; - struct ptrace_vm_entry32 { int pve_entry; int pve_timestamp; From nobody Fri Jan 20 03:23:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFp0Hlnz30vj1; Fri, 20 Jan 2023 03:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFn5WYGz3nS5; Fri, 20 Jan 2023 03:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cCqtjI5gcKoM7VJ13Swg5VB/8rP35cFDg1fTHXRmZKY=; b=mvwHdcoenIOuI6JXm4Xp/p1EUcHUr5rk1OVHDY4p5DNiZqSmEx2Oy/o6HYznQCTOpc6uWg CAikcYYoorS92afABX6vvMi1Jva/URR8xJozE+ii5JaoHhNUX8qWILYXvMnLlLH5rKuT9Y +3NO5Lv2aAf5PmlVmX0g/ubsl3t9LWS4HauwwnY4Teh/wXobORRBGNvS5mlsKBbydYdH6/ yfkqOcegAvaOPIFA/Nu6a8PZLpZFN2JbPuMiFMgMfyOsFtbK5eo16j3oVMnNKuXBZQg77o Ebrt0HL2srU4O1UNDRqTxAzs0hsnh6RLiFzB6unJQyAF71cYanwaliU9D65qXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cCqtjI5gcKoM7VJ13Swg5VB/8rP35cFDg1fTHXRmZKY=; b=p6MqGUrccraCkmuux29urK7Tz7nbM5kHoXDu9UPMxWSW0+zZeYbFVlyv0ydfVSPtCwEoMO aP38/pZnMHf7bus+xGHeFCzsZ32DbhtK9jWLekruEjF+SA53fks06CBU+ReI5Ht4ZlS21d VX2oWJAvjff7iTRIxYIWc9jwh4AP6MwTIvyyOa5ZK0KfXV8HLXFaOopzCM0XXutKy/POFP +7OHa13lgYpjfzt267uMEpUVygPGRBGCthsvHcg9340FzOj//yu282K3QRypPpC/8kuccw 5M8OCzWb6Z1QftQXtFqbJJlXwwK8FNxeUhf5oB8K+z1ueGjZ3eOl4R1CVHOmLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185021; a=rsa-sha256; cv=none; b=TilHi+ueWJitE86O07Qyj1R7Rh+6X7bcjEPI8IZDRFa9QmDTd5sj8QME+e0jtrQg8E7hCD hLqV+hooJb2Ldu/zP1i5Jh/p9XwbySqVGOYikYnFmpmCWNHQpcVk7gR2mguxY6iL52mSmR eSJbrYtBcF64UdrE0lkirP5XD3hfZ9/R5Zlj8rs+MpQxD2MTRoPY01D6FvBiym/jwKmwte LC6dk/oZ2PEyePjCksCs7m+hqm+3pSFEoadNzUC9obnZg+ibq5mHL+6PW7difUvNwsWwJZ 0+RUBKGD8c+TSrZRmMCwI/B5KbePpuKzZcJ7LNydrXwL670zRhsspN9ipjYHaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFn4c3LzFf1; Fri, 20 Jan 2023 03:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Nfhx042508; Fri, 20 Jan 2023 03:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NfrX042507; Fri, 20 Jan 2023 03:23:41 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:41 GMT Message-Id: <202301200323.30K3NfrX042507@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: 55df3e814f61 - stable/13 - sys: rename td_coredump to td_remotereq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 55df3e814f61ed28d497af8f8b640bf18e1de94f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=55df3e814f61ed28d497af8f8b640bf18e1de94f commit 55df3e814f61ed28d497af8f8b640bf18e1de94f Author: Konstantin Belousov AuthorDate: 2022-11-30 08:48:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:35 +0000 sys: rename td_coredump to td_remotereq Tested by: pho (cherry picked from commit e6feeae2f915c76275b83b7365ae966a8f8dd016) --- sys/kern/kern_sig.c | 12 ++++++------ sys/kern/sys_process.c | 8 ++++---- sys/sys/proc.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 8f35747b4687..df9ca8076a64 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2565,12 +2565,12 @@ ptrace_coredump(struct thread *td) MPASS(td == curthread); p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); - if ((td->td_dbgflags & TDB_COREDUMPRQ) == 0) + if ((td->td_dbgflags & TDB_COREDUMPREQ) == 0) return; KASSERT((p->p_flag & P_STOPPED_TRACE) != 0, ("not stopped")); - tcq = td->td_coredump; - KASSERT(tcq != NULL, ("td_coredump is NULL")); + tcq = td->td_remotereq; + KASSERT(tcq != NULL, ("td_remotereq is NULL")); if (p->p_sysent->sv_coredump == NULL) { tcq->tc_error = ENOSYS; @@ -2586,8 +2586,8 @@ ptrace_coredump(struct thread *td) vn_rangelock_unlock(tcq->tc_vp, rl_cookie); PROC_LOCK(p); wake: - td->td_dbgflags &= ~TDB_COREDUMPRQ; - td->td_coredump = NULL; + td->td_dbgflags &= ~TDB_COREDUMPREQ; + td->td_remotereq = NULL; wakeup(p); } @@ -2721,7 +2721,7 @@ stopme: td->td_dbgflags |= TDB_SSWITCH; thread_suspend_switch(td, p); td->td_dbgflags &= ~TDB_SSWITCH; - if ((td->td_dbgflags & TDB_COREDUMPRQ) != 0) { + if ((td->td_dbgflags & TDB_COREDUMPREQ) != 0) { PROC_SUNLOCK(p); ptrace_coredump(td); PROC_SLOCK(p); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 2876283ce388..b8f5fda8ade3 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1561,7 +1561,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) error = EBUSY; goto coredump_cleanup_locked; } - KASSERT((td2->td_dbgflags & TDB_COREDUMPRQ) == 0, + KASSERT((td2->td_dbgflags & TDB_COREDUMPREQ) == 0, ("proc %d tid %d req coredump", p->p_pid, td2->td_tid)); tcq->tc_vp = fp->f_vnode; @@ -1571,10 +1571,10 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) tcq->tc_flags |= SVC_NOCOMPRESS; if ((pc->pc_flags & PC_ALL) != 0) tcq->tc_flags |= SVC_ALL; - td2->td_coredump = tcq; - td2->td_dbgflags |= TDB_COREDUMPRQ; + td2->td_remotereq = tcq; + td2->td_dbgflags |= TDB_COREDUMPREQ; thread_run_flash(td2); - while ((td2->td_dbgflags & TDB_COREDUMPRQ) != 0) + while ((td2->td_dbgflags & TDB_COREDUMPREQ) != 0) msleep(p, &p->p_mtx, PPAUSE, "crdmp", 0); error = tcq->tc_error; coredump_cleanup_locked: diff --git a/sys/sys/proc.h b/sys/sys/proc.h index cd1b530095e9..861f81232927 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -376,7 +376,7 @@ struct thread { int td_oncpu; /* (t) Which cpu we are on. */ void *td_lkpi_task; /* LinuxKPI task struct pointer */ int td_pmcpend; - void *td_coredump; /* (c) coredump request. */ + void *td_remotereq; /* (c) dbg remote request. */ off_t td_ktr_io_lim; /* (k) limit for ktrace file size */ #ifdef EPOCH_TRACE SLIST_HEAD(, epoch_tracker) td_epochs; @@ -487,7 +487,7 @@ do { \ #define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ #define TDB_STEP 0x00002000 /* (x86) PSL_T set for PT_STEP */ #define TDB_SSWITCH 0x00004000 /* Suspended in ptracestop */ -#define TDB_COREDUMPRQ 0x00008000 /* Coredump request */ +#define TDB_COREDUMPREQ 0x00008000 /* Coredump request */ /* * "Private" flags kept in td_pflags: From nobody Fri Jan 20 03:23:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFq15TGz30vnX; Fri, 20 Jan 2023 03:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFp6TNqz3ns8; Fri, 20 Jan 2023 03:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2YeHGQMdrj8Br8+dcaw8EkLvcrZpCMiXazZBlXx0cs=; b=giBb9ikHynHvu5LcwVBLvFP6E73os3WDGdDC8IEIq5g1gPTbpoBjeNhzEXlwP6mcS9p0w4 xwC+WGUmHsxuZB8F2A9j3fMGy8Ou623SGjFdNwIpoRZEnOhAU+Zxsltugn0qxwLGyTwsu7 3Mq4IzlZHIuuGnViaeJP/K8oLL/IOpFdIVS5GeUEaO0camyIRS8fTHzNszCq2Ys9erq7MZ P2lHoRByRmzYhg5xSL4tAOB71MoV1KeSG0E3L7LeATJP7pVdUho+BGYwobMsZgafWKXhaI MFDc906yBml8sRAu6jiogEbl16HywHPadcHetzEpJosuk1HvLUshU8SDXrlL9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2YeHGQMdrj8Br8+dcaw8EkLvcrZpCMiXazZBlXx0cs=; b=ag0+e5i2qm1mwHDUi5EJmL3yL7fFKK27W3japfsPk/3xt1d8ibC52h7MKPnZZUJYi2ewdO 0J2JJqNr7uifdVVbCBsxS2fbere8EFi1LunOJrots/c63AD34aeBhU8t8KhwNKaJHh+ba/ B1dR/yjlRoM4Lbqkllm3aUDQwLd5epDfNpP3TwHkwKNtvbP3KWDQidLHGdS6RrZUGX72oK fvqhauWInvRUjCTJYIRt0/3eOYMQ3icS4MZNIlQ4VW/6YszpJ52wXpsHgmheTNyPCbmaoW wmNiFyiLUaDz5LVqXbUdC9U8EGrfekznc8CJrLtk/cthfNpm4H0U3e1E3IIhqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185022; a=rsa-sha256; cv=none; b=Duk2um72oQMisYXeVXEsM0wLxFNdM8xoYlslYvatrm9oPIPRE2SPKKrVfw+mKkUwKW/v70 /hiYhJy4d+Bf+fDiHawGAxWY72rkxLiZ4vEhBCc1ZLr2fKsRoUHIyzfkmE/nUXYJ63b4W3 9D1AHhFUD05s2kjUYDODYG/GDQQBr/M8ZiEafgTr/IIPmx967I/ph8uXSQNEikQGbM/YGu qgR9np9VhSpmnKQ+MVkalZZom2XvL1utxM5zpsBPI0R5N+CpjHH8CGj69BEwM2BjXieTHG WhY/2C3p5crkLew1Kold/rc6voAFHKnILyoqwaAJWzQVRuxyka3Hd4Oc6Ob3Qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFp5W1SzG9L; Fri, 20 Jan 2023 03:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NgYT042534; Fri, 20 Jan 2023 03:23:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NgHW042533; Fri, 20 Jan 2023 03:23:42 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:42 GMT Message-Id: <202301200323.30K3NgHW042533@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: a0cfea8c38d6 - stable/13 - Add a thread debugging flag TDB_BOUNDARY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: a0cfea8c38d64bddd114804507e5f5a05892b2ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a0cfea8c38d64bddd114804507e5f5a05892b2ca commit a0cfea8c38d64bddd114804507e5f5a05892b2ca Author: Konstantin Belousov AuthorDate: 2022-12-01 00:29:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:40 +0000 Add a thread debugging flag TDB_BOUNDARY Tested by: pho (cherry picked from commit f0592b3c8dd8e172f0e7165c11371108d4d8838d) --- sys/kern/subr_syscall.c | 11 ++++++++--- sys/kern/subr_trap.c | 5 ++++- sys/sys/proc.h | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 8507c5393c01..a61003ec7203 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -73,6 +73,7 @@ syscallenter(struct thread *td) traced = (p->p_flag & P_TRACED) != 0; if (__predict_false(traced || td->td_dbgflags & TDB_USERWR)) { PROC_LOCK(p); + MPASS((td->td_dbgflags & TDB_BOUNDARY) == 0); td->td_dbgflags &= ~TDB_USERWR; if (traced) td->td_dbgflags |= TDB_SCE; @@ -201,7 +202,7 @@ syscallenter(struct thread *td) td->td_retval[1]); if (__predict_false(traced)) { PROC_LOCK(p); - td->td_dbgflags &= ~TDB_SCE; + td->td_dbgflags &= ~(TDB_SCE | TDB_BOUNDARY); PROC_UNLOCK(p); } (p->p_sysent->sv_set_syscall_retval)(td, error); @@ -281,9 +282,13 @@ syscallret(struct thread *td) */ if (traced && ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || - (p->p_ptevents & PTRACE_SCX) != 0)) + (p->p_ptevents & PTRACE_SCX) != 0)) { + MPASS((td->td_dbgflags & TDB_BOUNDARY) == 0); + td->td_dbgflags |= TDB_BOUNDARY; ptracestop(td, SIGTRAP, NULL); - td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); + } + td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK | + TDB_BOUNDARY); PROC_UNLOCK(p); } diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index c2c27a4d40cb..be5041fe516f 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -214,7 +214,7 @@ ast(struct trapframe *framep) { struct thread *td; struct proc *p; - int flags, sig; + int flags, old_boundary, sig; bool resched_sigs; td = curthread; @@ -330,12 +330,15 @@ ast(struct trapframe *framep) !SIGISEMPTY(p->p_siglist)) { sigfastblock_fetch(td); PROC_LOCK(p); + old_boundary = ~TDB_BOUNDARY | (td->td_dbgflags & TDB_BOUNDARY); + td->td_dbgflags |= TDB_BOUNDARY; mtx_lock(&p->p_sigacts->ps_mtx); while ((sig = cursig(td)) != 0) { KASSERT(sig >= 0, ("sig %d", sig)); postsig(sig); } mtx_unlock(&p->p_sigacts->ps_mtx); + td->td_dbgflags &= old_boundary; PROC_UNLOCK(p); resched_sigs = true; } else { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 861f81232927..4ba7522ab5f2 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -487,7 +487,8 @@ do { \ #define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ #define TDB_STEP 0x00002000 /* (x86) PSL_T set for PT_STEP */ #define TDB_SSWITCH 0x00004000 /* Suspended in ptracestop */ -#define TDB_COREDUMPREQ 0x00008000 /* Coredump request */ +#define TDB_BOUNDARY 0x00008000 /* ptracestop() at boundary */ +#define TDB_COREDUMPREQ 0x00010000 /* Coredump request */ /* * "Private" flags kept in td_pflags: From nobody Fri Jan 20 03:23:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFr1Qvhz30vfx; Fri, 20 Jan 2023 03:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFr0tg4z3nf4; Fri, 20 Jan 2023 03:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LZ7z9UR6Nv1z8upoOAy9ArYV6Fgkopy6KynjWDfhZmo=; b=PvPR/SliBKzBSHbJjNH46NsQ19Yl5RvB9/2LUMLvuHcH/dumBEgi1EkNCwtvtHD+9WdjTH IrcAZRgr6ncMAKiBZxJUDGEQKJFMcf2F4ImE5pxShPDPyM+BA1unuRXHWBKLNXFD0AHc+6 vxjd8YIrIlY0Hfk8gUI9uKTEAWAl8j4wMJxlgw2jf1EWKgBdyQRXz8zNIykv2RgPE7k8jn QhJvpuL87H0vdpkBkuRaHqxS7Sv353Fqn2vi1GQTHowpLcqcVW0HD/y7EkTkIoy3PGGKxJ 2mTcsQQk7ZMx4oe3OPvZSAbTX7mubqkBQ8dcm0ryGLNv52pvLcHYrNZHjScyRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LZ7z9UR6Nv1z8upoOAy9ArYV6Fgkopy6KynjWDfhZmo=; b=LqGz0pPkGw1BQYOfBtwD4iCZT9Zpo7re2XgXEs8wis4EcXY13ukAnKZhYIqYQYvBZ9Q1+S zJsNfYfgReARfdyJ9UaD/nrxbt7shFGm4ImVEvwh/yl/nmkAQoau1CbfN2W+OFeeOr6zY6 u/ESUVfNZe9zfLhjH5k51N2pgnRl1lTsSLSo7/2tn9Ia+gGHx5tYrLkcKefSx55k/acRkR +cgya30fsnF0YMHdTM33LedYHH59pzEYVToUpu+zdF4M3BRvTWIgYt44zexMAdn220MOEc tc43CWnpT7lSvE+Hu+xnUQSAAsG1ls9f3nA3Z6rR7ZDFy+A4dun02FaFTfimOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185024; a=rsa-sha256; cv=none; b=jSXZhZsYOyAJJjyqTqrL9CuWuzvyqF0pHUI9+M/PMMM/Hljph7wnOjuFD0MS69WlkXTLnE w12V7gNtnGzEhmA92bLzzCTd9SgfDtvA+PZRZnezPxOGWh3g9RdbUZbv9/7BSCh6Gt/jlJ AQwYoYM72L7Lfk/mHhdYhSMUSzEkfseoW+28/ErgS5s0elLfNlKFPfCMJIHpPZRHRH8Way COPR/cw+3+CDLQaVrdsvRAX91Z9vKZhCliGQWRajR5gL1IpmC50qAOmgdvgxXe2uLtNSzy Ii14dsIoRMtLzbSUMKS3t9avTqZ+B1F2jGRIVXmFSw053ef+TcTniL+MVVaSHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFq6xx4zFtq; Fri, 20 Jan 2023 03:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NhXf042562; Fri, 20 Jan 2023 03:23:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NhHP042561; Fri, 20 Jan 2023 03:23:43 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:43 GMT Message-Id: <202301200323.30K3NhHP042561@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: 7616d35f91cb - stable/13 - ptrace(2): explain how to select specific thread to operate 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 7616d35f91cb0d4f1a741fb385078581096f6953 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7616d35f91cb0d4f1a741fb385078581096f6953 commit 7616d35f91cb0d4f1a741fb385078581096f6953 Author: Konstantin Belousov AuthorDate: 2022-12-05 22:43:18 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:45 +0000 ptrace(2): explain how to select specific thread to operate on Tested by: pho (cherry picked from commit 0e07241c372d7352537a4a786c96a580a721be3c) --- lib/libc/sys/ptrace.2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index 74bf646efd3c..b107dcef97ae 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -122,6 +122,25 @@ Kernel drops any signals queued to the traced children, which could be either generated by not yet consumed debug events, or sent by other means, the later should not be done anyway. +.Sh SELECTING THE TARGET +The +.Fa pid +argument of the call specifies the target on which to perform +the requested operation. +For operations affecting the global process state, the process ID +is typically passed there. +Similarly, for operations affecting only a thread, the thread ID +needs to be passed. +.Pp +Still, for global operations, the ID of any thread can be used as the +target, and system will perform the request on the process owning +that thread. +If a thread operation got the process ID as +.Fa pid , +the system randomly selects a thread from among the threads owned +by the process. +For single-threaded processes there is no difference between specifying +process or thread ID as the target. .Sh DISABLING PTRACE The .Nm From nobody Fri Jan 20 03:23:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFs2t6Zz30vcf; Fri, 20 Jan 2023 03:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFs1zJCz3nvc; Fri, 20 Jan 2023 03:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2hgGZ7EAwCRWYF97FGhKGdgyrb9v6WtPldtX4eN5a3Y=; b=PPIIJZUtz4wjXn0mibjDAiR4qJFywTMmz5Vn9dPVO515+bYU/2G2sMfhOlk+kYmhuqEsm9 vXLVmC+TmhKoer92JOU90NzQXR1PslMKMUnOUsYYHomwZCMMWp0t45//jC8rpKdsg50Qom XkESQsuK2jaTbFU6XVqcRcapWHFZmR7FZAn6AdpO91Gm9PPRDFYdQN9W0VPvXLyzN+dW/m Rn3KgfRsFoxN755XfDQbbAuprpLRCCpYd25OG6ZAvs/2UrbET9KlTmc/TTW7MS20n8gB20 4/FpS+8iiXQAJgSqsRgTjY7FibN8aGqB9l4kWQFcl97rtM19Xy3NMRO/V+/Pwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2hgGZ7EAwCRWYF97FGhKGdgyrb9v6WtPldtX4eN5a3Y=; b=XoIjSq6moppo/HQEG9fZ0lna6+FOWr80UXsq+rX0KTG8ShTvGs44OMeSq1XzmjI4Ysvp53 cUIS64AK20wfet/qR1tlveFPwSw9UAwRKEQHLBMRRpPgonPWxAyw7q3ldZfKJPs9ocjJmA ug4i8ZzAiaYtQpQvK1NSPb0V7afguvmCrsZU/ly+Pf4Js6TvAYGdtyynJYGhbIG4PY1hiE r9M3D3CoUYNNtN4oSvOepY9AH6nMiW6LOb+GHh0hvEVhHZnhjB1J9w8DwP7y61a3pWWCIU GW86S69uL+EZZfIDo+IwuJitsPXMATg2a+Mi67ThZLeXw/KGNv8o/TXqXYvxQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185025; a=rsa-sha256; cv=none; b=A5PcJHs8FGM6uoyCMXqjeZM4YX7WQWjON98sj9QKtib5ZArMWO/RdYpLXyq0mhz4Z0ogtj r0CDaKIcE8n0W3UuQYokATLlFB1pFe6yGeXpn9DiYJQ2zAbb+r6qoHYbb052FrmMHnUv9h AyS6Xr9Jcx+snpsaiAh8gmfKyq1lpznPwY9/Ne2Ic+Uqm5EX3oezP9EsAiVUTYOfi9f72M fmyQF/VLiicf4SIaq66MieGXK5EGaZZ5/BOor0LpvLmgudDRTl5L5iDm51AGtQF78yPZZU g2sIQTfpn5T83BFkcnFJ0PinArWrMM+U8tcDYRXMsS1+T/3nE532H2ECcEHt5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFs10bFzFf2; Fri, 20 Jan 2023 03:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Njh2042586; Fri, 20 Jan 2023 03:23:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NjGD042585; Fri, 20 Jan 2023 03:23:45 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:45 GMT Message-Id: <202301200323.30K3NjGD042585@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: aaf570313289 - stable/13 - ptrace(2): add PT_SC_REMOTE remote syscall request List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: aaf570313289aad6f96eb49d3b19663d85512c82 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf570313289aad6f96eb49d3b19663d85512c82 commit aaf570313289aad6f96eb49d3b19663d85512c82 Author: Konstantin Belousov AuthorDate: 2022-11-30 08:45:52 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:53 +0000 ptrace(2): add PT_SC_REMOTE remote syscall request Tested by: pho (cherry picked from commit 140ceb5d956bb8795a77c23d3fd5ef047b0f3c68) --- sys/compat/freebsd32/freebsd32.h | 6 ++ sys/compat/freebsd32/freebsd32_misc.c | 32 ++++++++ sys/kern/kern_sig.c | 142 +++++++++++++++++++++++++++++----- sys/kern/sys_process.c | 74 +++++++++++++++++- sys/sys/proc.h | 1 + sys/sys/ptrace.h | 16 ++++ 6 files changed, 249 insertions(+), 22 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index 8d5eae2817f3..851fa248b6f2 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -440,5 +440,11 @@ struct ptrace_coredump32 { uint32_t pc_limit1, pc_limit2; }; +struct ptrace_sc_remote32 { + struct ptrace_sc_ret32 pscr_ret; + u_int pscr_syscall; + u_int pscr_nargs; + uint32_t pscr_args; +}; #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */ diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 269286ab90dc..da49b4b7b415 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -915,6 +915,7 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) struct ptrace_lwpinfo pl; struct ptrace_vm_entry pve; struct ptrace_coredump pc; + struct ptrace_sc_remote sr; struct dbreg32 dbreg; struct fpreg32 fpreg; struct reg32 reg; @@ -928,10 +929,13 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) struct ptrace_lwpinfo32 pl; struct ptrace_vm_entry32 pve; struct ptrace_coredump32 pc; + struct ptrace_sc_remote32 sr; uint32_t args[nitems(td->td_sa.args)]; struct ptrace_sc_ret32 psr; struct iovec32 vec; } r32; + register_t pscr_args[nitems(td->td_sa.args)]; + u_int pscr_args32[nitems(td->td_sa.args)]; void *addr; int data, error, i; @@ -1030,6 +1034,28 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) r.pc.pc_limit = PAIR32TO64(off_t, r32.pc.pc_limit); data = sizeof(r.pc); break; + case PT_SC_REMOTE: + if (uap->data != sizeof(r32.sr)) { + error = EINVAL; + break; + } + error = copyin(uap->addr, &r32.sr, uap->data); + if (error != 0) + break; + CP(r32.sr, r.sr, pscr_syscall); + CP(r32.sr, r.sr, pscr_nargs); + if (r.sr.pscr_nargs > nitems(td->td_sa.args)) { + error = EINVAL; + break; + } + error = copyin(PTRIN(r32.sr.pscr_args), pscr_args32, + sizeof(u_int) * r32.sr.pscr_nargs); + if (error != 0) + break; + for (i = 0; i < r32.sr.pscr_nargs; i++) + pscr_args[i] = pscr_args32[i]; + r.sr.pscr_args = pscr_args; + break; default: addr = uap->addr; break; @@ -1090,6 +1116,12 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) error = copyout(&r32.psr, uap->addr, MIN(uap->data, sizeof(r32.psr))); break; + case PT_SC_REMOTE: + ptrace_sc_ret_to32(&r.sr.pscr_ret, &r32.sr.pscr_ret); + error = copyout(&r32.sr.pscr_ret, uap->addr + + offsetof(struct ptrace_sc_remote32, pscr_ret), + sizeof(r32.psr)); + break; } return (error); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index df9ca8076a64..970c756d4a8e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -39,9 +39,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_capsicum.h" #include "opt_ktrace.h" #include +#include #include #include #include @@ -75,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -82,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2556,37 +2560,128 @@ out: } static void -ptrace_coredump(struct thread *td) +ptrace_coredumpreq(struct thread *td, struct proc *p, + struct thr_coredump_req *tcq) { - struct proc *p; - struct thr_coredump_req *tcq; void *rl_cookie; - MPASS(td == curthread); - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - if ((td->td_dbgflags & TDB_COREDUMPREQ) == 0) - return; - KASSERT((p->p_flag & P_STOPPED_TRACE) != 0, ("not stopped")); - - tcq = td->td_remotereq; - KASSERT(tcq != NULL, ("td_remotereq is NULL")); - if (p->p_sysent->sv_coredump == NULL) { tcq->tc_error = ENOSYS; - goto wake; + return; } - PROC_UNLOCK(p); rl_cookie = vn_rangelock_wlock(tcq->tc_vp, 0, OFF_MAX); - tcq->tc_error = p->p_sysent->sv_coredump(td, tcq->tc_vp, tcq->tc_limit, tcq->tc_flags); - vn_rangelock_unlock(tcq->tc_vp, rl_cookie); +} + +static void +ptrace_syscallreq(struct thread *td, struct proc *p, + struct thr_syscall_req *tsr) +{ + struct sysentvec *sv; + struct sysent *se; + register_t rv_saved[2]; + int error, nerror; + int sc; + bool audited, sy_thr_static; + + sv = p->p_sysent; + if (sv->sv_table == NULL || sv->sv_size < tsr->ts_sa.code) { + tsr->ts_ret.sr_error = ENOSYS; + return; + } + + sc = tsr->ts_sa.code; + if (sc == SYS_syscall || sc == SYS___syscall) { + memmove(&tsr->ts_sa.args[0], &tsr->ts_sa.args[1], + sizeof(register_t) * (tsr->ts_nargs - 1)); + } + + tsr->ts_sa.callp = se = &sv->sv_table[sc]; + + VM_CNT_INC(v_syscall); + td->td_pticks = 0; + if (__predict_false(td->td_cowgen != atomic_load_int( + &td->td_proc->p_cowgen))) + thread_cow_update(td); + +#ifdef CAPABILITY_MODE + if (IN_CAPABILITY_MODE(td) && (se->sy_flags & SYF_CAPENABLED) == 0) { + tsr->ts_ret.sr_error = ECAPMODE; + return; + } +#endif + + sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; + audited = AUDIT_SYSCALL_ENTER(tsr->ts_syscall, td) != 0; + + if (!sy_thr_static) { + error = syscall_thread_enter(td, se); + if (error != 0) { + tsr->ts_ret.sr_error = error; + return; + } + } + + rv_saved[0] = td->td_retval[0]; + rv_saved[1] = td->td_retval[1]; + nerror = td->td_errno; + td->td_retval[0] = 0; + td->td_retval[1] = 0; + +#ifdef KDTRACE_HOOKS + if (se->sy_entry != 0) + (*systrace_probe_func)(&tsr->ts_sa, SYSTRACE_ENTRY, 0); +#endif + tsr->ts_ret.sr_error = se->sy_call(td, tsr->ts_sa.args); +#ifdef KDTRACE_HOOKS + if (se->sy_return != 0) + (*systrace_probe_func)(&tsr->ts_sa, SYSTRACE_RETURN, + tsr->ts_ret->sr_error != 0 ? -1 : td->td_retval[0]); +#endif + + tsr->ts_ret.sr_retval[0] = td->td_retval[0]; + tsr->ts_ret.sr_retval[1] = td->td_retval[1]; + td->td_retval[0] = rv_saved[0]; + td->td_retval[1] = rv_saved[1]; + td->td_errno = nerror; + + if (audited) + AUDIT_SYSCALL_EXIT(error, td); + if (!sy_thr_static) + syscall_thread_exit(td, se); +} + +static void +ptrace_remotereq(struct thread *td, int flag) +{ + struct proc *p; + + MPASS(td == curthread); + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + if ((td->td_dbgflags & flag) == 0) + return; + KASSERT((p->p_flag & P_STOPPED_TRACE) != 0, ("not stopped")); + KASSERT(td->td_remotereq != NULL, ("td_remotereq is NULL")); + + PROC_UNLOCK(p); + switch (flag) { + case TDB_COREDUMPREQ: + ptrace_coredumpreq(td, p, td->td_remotereq); + break; + case TDB_SCREMOTEREQ: + ptrace_syscallreq(td, p, td->td_remotereq); + break; + default: + __unreachable(); + } PROC_LOCK(p); -wake: - td->td_dbgflags &= ~TDB_COREDUMPREQ; + + MPASS((td->td_dbgflags & flag) != 0); + td->td_dbgflags &= ~flag; td->td_remotereq = NULL; wakeup(p); } @@ -2721,9 +2816,14 @@ stopme: td->td_dbgflags |= TDB_SSWITCH; thread_suspend_switch(td, p); td->td_dbgflags &= ~TDB_SSWITCH; - if ((td->td_dbgflags & TDB_COREDUMPREQ) != 0) { + if ((td->td_dbgflags & (TDB_COREDUMPREQ | + TDB_SCREMOTEREQ)) != 0) { + MPASS((td->td_dbgflags & (TDB_COREDUMPREQ | + TDB_SCREMOTEREQ)) != + (TDB_COREDUMPREQ | TDB_SCREMOTEREQ)); PROC_SUNLOCK(p); - ptrace_coredump(td); + ptrace_remotereq(td, td->td_dbgflags & + (TDB_COREDUMPREQ | TDB_SCREMOTEREQ)); PROC_SLOCK(p); goto stopme; } diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index b8f5fda8ade3..72e631c70e59 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -592,6 +592,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) struct ptrace_lwpinfo pl; struct ptrace_vm_entry pve; struct ptrace_coredump pc; + struct ptrace_sc_remote sr; struct dbreg dbreg; struct fpreg fpreg; struct reg reg; @@ -600,6 +601,7 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) struct ptrace_sc_ret psr; int ptevents; } r; + register_t pscr_args[nitems(td->td_sa.args)]; void *addr; int error; @@ -657,6 +659,24 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) else error = copyin(uap->addr, &r.pc, uap->data); break; + case PT_SC_REMOTE: + if (uap->data != sizeof(r.sr)) { + error = EINVAL; + break; + } + error = copyin(uap->addr, &r.sr, uap->data); + if (error != 0) + break; + if (r.sr.pscr_nargs > nitems(td->td_sa.args)) { + error = EINVAL; + break; + } + error = copyin(r.sr.pscr_args, pscr_args, + sizeof(u_long) * r.sr.pscr_nargs); + if (error != 0) + break; + r.sr.pscr_args = pscr_args; + break; default: addr = uap->addr; break; @@ -703,6 +723,11 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) error = copyout(&r.psr, uap->addr, MIN(uap->data, sizeof(r.psr))); break; + case PT_SC_REMOTE: + error = copyout(&r.sr.pscr_ret, uap->addr + + offsetof(struct ptrace_sc_remote, pscr_ret), + sizeof(r.sr.pscr_ret)); + break; } return (error); @@ -812,9 +837,11 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) struct ptrace_io_desc *piod = NULL; struct ptrace_lwpinfo *pl; struct ptrace_sc_ret *psr; + struct ptrace_sc_remote *pscr; struct file *fp; struct ptrace_coredump *pc; struct thr_coredump_req *tcq; + struct thr_syscall_req *tsr; int error, num, tmp; lwpid_t tid = 0, *buf; #ifdef COMPAT_FREEBSD32 @@ -1561,7 +1588,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) error = EBUSY; goto coredump_cleanup_locked; } - KASSERT((td2->td_dbgflags & TDB_COREDUMPREQ) == 0, + KASSERT((td2->td_dbgflags & (TDB_COREDUMPREQ | + TDB_SCREMOTEREQ)) == 0, ("proc %d tid %d req coredump", p->p_pid, td2->td_tid)); tcq->tc_vp = fp->f_vnode; @@ -1586,6 +1614,50 @@ coredump_cleanup_nofp: PROC_LOCK(p); break; + case PT_SC_REMOTE: + pscr = addr; + CTR2(KTR_PTRACE, "PT_SC_REMOTE: pid %d, syscall %d", + p->p_pid, pscr->pscr_syscall); + if ((td2->td_dbgflags & TDB_BOUNDARY) == 0) { + error = EBUSY; + break; + } + PROC_UNLOCK(p); + MPASS(pscr->pscr_nargs <= nitems(td->td_sa.args)); + + tsr = malloc(sizeof(struct thr_syscall_req), M_TEMP, + M_WAITOK | M_ZERO); + + tsr->ts_sa.code = pscr->pscr_syscall; + tsr->ts_nargs = pscr->pscr_nargs; + memcpy(&tsr->ts_sa.args, pscr->pscr_args, + sizeof(register_t) * tsr->ts_nargs); + + PROC_LOCK(p); + error = proc_can_ptrace(td, p); + if (error != 0) { + free(tsr, M_TEMP); + break; + } + if (td2->td_proc != p) { + free(tsr, M_TEMP); + error = ESRCH; + break; + } + KASSERT((td2->td_dbgflags & (TDB_COREDUMPREQ | + TDB_SCREMOTEREQ)) == 0, + ("proc %d tid %d req coredump", p->p_pid, td2->td_tid)); + + td2->td_remotereq = tsr; + td2->td_dbgflags |= TDB_SCREMOTEREQ; + thread_run_flash(td2); + while ((td2->td_dbgflags & TDB_SCREMOTEREQ) != 0) + msleep(p, &p->p_mtx, PPAUSE, "pscrx", 0); + error = 0; + memcpy(&pscr->pscr_ret, &tsr->ts_ret, sizeof(tsr->ts_ret)); + free(tsr, M_TEMP); + break; + default: #ifdef __HAVE_PTRACE_MACHDEP if (req >= PT_FIRSTMACH) { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 4ba7522ab5f2..23b8fcfe9bd7 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -489,6 +489,7 @@ do { \ #define TDB_SSWITCH 0x00004000 /* Suspended in ptracestop */ #define TDB_BOUNDARY 0x00008000 /* ptracestop() at boundary */ #define TDB_COREDUMPREQ 0x00010000 /* Coredump request */ +#define TDB_SCREMOTEREQ 0x00020000 /* Remote syscall request */ /* * "Private" flags kept in td_pflags: diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 197ac1692dfb..0eecb64bf769 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -87,6 +87,7 @@ #define PT_VM_ENTRY 41 /* Get VM map (entry) */ #define PT_GETREGSET 42 /* Get a target register set */ #define PT_SETREGSET 43 /* Set a target register set */ +#define PT_SC_REMOTE 44 /* Execute a syscall */ #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ @@ -192,8 +193,17 @@ struct ptrace_coredump { #define PC_COMPRESS 0x00000001 /* Allow compression */ #define PC_ALL 0x00000002 /* Include non-dumpable entries */ +struct ptrace_sc_remote { + struct ptrace_sc_ret pscr_ret; + u_int pscr_syscall; + u_int pscr_nargs; + register_t *pscr_args; +}; + #ifdef _KERNEL +#include + struct thr_coredump_req { struct vnode *tc_vp; /* vnode to write coredump to. */ off_t tc_limit; /* max coredump file size. */ @@ -201,6 +211,12 @@ struct thr_coredump_req { int tc_error; /* request result */ }; +struct thr_syscall_req { + struct ptrace_sc_ret ts_ret; + u_int ts_nargs; + struct syscall_args ts_sa; +}; + int ptrace_set_pc(struct thread *_td, unsigned long _addr); int ptrace_single_step(struct thread *_td); int ptrace_clear_single_step(struct thread *_td); From nobody Fri Jan 20 03:23:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFv14kzz30vrC; Fri, 20 Jan 2023 03:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFt45B4z3njD; Fri, 20 Jan 2023 03:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C0vVx04fdAbUnWEora5S4Mzb6yxq8ph5fAfChjgdHGA=; b=PD1rFBzJMd1Q/D7o9jZe+arTlvNS+8YtrnStPv5YOW5Ej2ShUSisq4RajL7UAh9oVI+nyX Tt+kmVLLrPqIS7bPaK5Hs4ONJzWNlrhRyyP5PXM9Zdfg5vYKvotvZTUHYFcpOTUSqZIWJW xQ08HQTcryIepLF5Ju0YDMXcAKZv52fASRsqYzjjx3edzSWHDWxYxgvzjLRXDdDSt4SaXv cU5oxaY4KzKwSwkTF5DN7uq3hrs+bHHPQJR25NZUZZ5scUnahvN3qAQ74oUfLYijiw77X7 85Msr8nAefI3Lc+/tM1KaDbPCFUYgzj73LYa23MYN9ih2M09fdR4NMXcXjuwCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C0vVx04fdAbUnWEora5S4Mzb6yxq8ph5fAfChjgdHGA=; b=pRHtLI/g4qdeE2bBg6il7y52yY6ZCmPCdixZY7lCu/lwX8DmZ5sU7cYcknZlYFH3LSOByI Bqr82qTi81vGNhYi1bURilWsBWxPR53JCYVozebvuvFj4RSUVRlHAtqPAVuT41CriCADjM +hBuI8XAlqWUy/UrDkMEF3IXUKqIrZQ8vyagk3MSiQvkiJZg9kRlRS30Z6zXmlDQnusBwf DYWREGbzgNgHcOKTksrnovzYvPKunekpEJgZYcuHYVVx48SPU8JSPiHjzCChkXoPpbgdEd 7ppTdCDau8izPjMfRXXJ+yhNMfNO57gkzeDggE27zBFnLVB+3hzPkekk8ldlWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185026; a=rsa-sha256; cv=none; b=OPOa6f+7VbXqeWJZt0fp9H9IXyLPQprl7ZHXDLUt4r5f6hGnjtRqT+6QRSWH3vt3wG8+OP kYBE0vyzKLolfeCHwPEmLoLXkmKctAJlTvg+4TFrslEdp02VBXkthpbQ77AaxHwBEFAm9b J7j93e6sS1hfQCFtLUybpsEPgbSR/wk/y7Ztt6bN0zLKPyKd+oZgbDZ5VsDzpN2LyN+bTf ILvrHPl4XdmaajXtkMxT7JP9S2oy0o00vkvXadx5jUIm2jEq13ha0VWyaQ1YhQdS96G9MH KIhiJricb3B9AE/brcH068uwSkfxks+XMeZoNVjIju1DltY4DvaPvmIhXIAuZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFt2CpnzGKf; Fri, 20 Jan 2023 03:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NkYF042613; Fri, 20 Jan 2023 03:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NkDr042612; Fri, 20 Jan 2023 03:23:46 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:46 GMT Message-Id: <202301200323.30K3NkDr042612@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: 287fe4003e2b - stable/13 - Fixes for ptrace_syscallreq() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 287fe4003e2b05bfbbe40996a927a420addded77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=287fe4003e2b05bfbbe40996a927a420addded77 commit 287fe4003e2b05bfbbe40996a927a420addded77 Author: Konstantin Belousov AuthorDate: 2022-12-22 23:51:34 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:20:59 +0000 Fixes for ptrace_syscallreq() Tested by: pho (cherry picked from commit 974be51b3f6070f9aae02e115ea6099f90bc9175) --- sys/kern/kern_sig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 970c756d4a8e..63d73cf7a909 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2595,6 +2595,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p, sc = tsr->ts_sa.code; if (sc == SYS_syscall || sc == SYS___syscall) { + sc = tsr->ts_sa.args[0]; memmove(&tsr->ts_sa.args[0], &tsr->ts_sa.args[1], sizeof(register_t) * (tsr->ts_nargs - 1)); } @@ -2615,7 +2616,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p, #endif sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - audited = AUDIT_SYSCALL_ENTER(tsr->ts_syscall, td) != 0; + audited = AUDIT_SYSCALL_ENTER(sc, td) != 0; if (!sy_thr_static) { error = syscall_thread_enter(td, se); @@ -2639,7 +2640,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p, #ifdef KDTRACE_HOOKS if (se->sy_return != 0) (*systrace_probe_func)(&tsr->ts_sa, SYSTRACE_RETURN, - tsr->ts_ret->sr_error != 0 ? -1 : td->td_retval[0]); + tsr->ts_ret.sr_error != 0 ? -1 : td->td_retval[0]); #endif tsr->ts_ret.sr_retval[0] = td->td_retval[0]; From nobody Fri Jan 20 03:23:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFw0HFFz30vnf; Fri, 20 Jan 2023 03:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFv4Frfz3nqm; Fri, 20 Jan 2023 03:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GZhfMgzpoav5zvP0OnjBHgj1bSrS/bV6OTc9R/+F8dM=; b=c6v7s058PDtKnGwA4F0lUp0ZIcbpNuMU+LT53W+CkaIP44SajN2CPP3mklFU8RZIDq7L8G 5c48Hnlf/dor2zv32qJIdTaO0uH9tEMqocMFFh7bLlw0x3agePLT9HMuZfr2C743/24LTV NBRjmWnvq+0dXsiHIHNMXWCgXKIjaGqFn/Y49tVdBKPaLyObX8mlD9xXLRR4u8BWm71CXR 5JwcxpHseK7jJlsz0+j/qiZ223lstFQBI/qChWqmME6xWShBEkji/m7fQ519AwHQLkoXul cn3p3S76lDXpbPoyajmR9svGSli840E2fg/c+2jQ5xyQlVeUDliDD+kL/X1qIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GZhfMgzpoav5zvP0OnjBHgj1bSrS/bV6OTc9R/+F8dM=; b=qpXqn0chfU6/hoEZLkMR12kbiGjGIgos0h/K3kfGVVoH/WrTl3uvuQv0y8asPN7aa7qWLn ZSNGRWrUlL8pBcs3SV5HQwtJIHi01LTJSiOfcGaQtX9uSu6uwcxZYG/2XOe5S2q6TG7rid F3deWCq9C7kxmSN53cLqrBInezsJM5fJ7j42CbF1jbskgcxR4UxiPAfFMSkztchAErjXLe z+Sarz5phbHd+9LtR/A5uVOiNfZMIO7raDSfuv/t/QkpQw44DSTbCy5XkB8WPBWu7CTwxn XWX7UrM8aQ9/qDqrnm7QplQ3WQkogYOup0+bGEKtzkGCvlr/hUKB5Mi6fAMpjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185027; a=rsa-sha256; cv=none; b=i2fWiVUOvgMy5KYwVylt02/mCgYBAvOrFNTpjI0rCxw3d6P5ltGBIAw3mV7hLiVKrW/JSz 0MeHowf+NOp6yrdjVATuhBlRFzUaTNFhjwWR1iHJagCHaKAnemxOhKYy8Ldh+AdNtSVeGo Do+DOONifLD11CZiWd3i9mmD9AwLmXrGI9U92NGhPm0kvLehevmbEBs34me4JtuRuplZT+ f1NVT/r96FAARLvUzzA0EPdyo74rExpoTcan3lhT+OdR+QXPv0sj+JqbzkR8iJjxyhr82k 5vx02InimEqCqZys1g9ojz2AzhHlkDMoaHSIBj/EdzactDQu7Q9FgC6Lxqh1+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 4NylFv3BSKzGDQ; Fri, 20 Jan 2023 03:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NlPX042644; Fri, 20 Jan 2023 03:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NlNE042643; Fri, 20 Jan 2023 03:23:47 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:47 GMT Message-Id: <202301200323.30K3NlNE042643@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: efde0099aacd - stable/13 - ptrace(2): document PT_SC_REMOTE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: efde0099aacdb14bfcb8eb77498ccf2800219b78 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=efde0099aacdb14bfcb8eb77498ccf2800219b78 commit efde0099aacdb14bfcb8eb77498ccf2800219b78 Author: Konstantin Belousov AuthorDate: 2022-12-02 03:00:08 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:11 +0000 ptrace(2): document PT_SC_REMOTE Tested by: pho (cherry picked from commit a98613f2389227effeb9d86e47e53ea01ecddfe5) --- lib/libc/sys/ptrace.2 | 73 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index b107dcef97ae..a5e67c745422 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -976,10 +976,44 @@ The size of .Vt "struct ptrace_coredump" must be passed in .Fa data . -.Pp -The process must be stopped before dumping core. +.It Dv PT_SC_REMOTE +Request to execute a syscall in the context of the traced process, +in the specified thread. +The +.Fa addr +argument must point to the +.Vt "struct ptrace_sc_remote" , +which describes the requested syscall and its arguments, and receives +the result. +The size of +.Vt "struct ptrace_sc_remote" +must be passed in +.Fa data. +.Bd -literal +struct ptrace_sc_remote { + struct ptrace_sc_ret pscr_ret; + u_int pscr_syscall; + u_int pscr_nargs; + u_long *pscr_args; +}; +.Ed +The +.Dv pscr_syscall +contains the syscall number to execute, the +.Dv pscr_nargs +is the number of supplied arguments, which are supplied in the +.Dv pscr_args +array. +Result of the execution is returned in the +.Dv pscr_ret +member. +Note that the request and its result do not affect the returned value from +the currently executed syscall, if any. +.El +.Sh PT_COREDUMP and PT_SC_REMOTE usage +The process must be stopped before dumping or initiating a remote system call. A single thread in the target process is temporarily unsuspended -in kernel to write the dump. +in the kernel to perform the action. If the .Nm call fails before a thread is unsuspended, there is no event to @@ -996,9 +1030,38 @@ an error occurred, it is recommended to unconditionally perform with .Dv WNOHANG flag after -.Dv PT_COREDUMP , +.Dv PT_COREDUMP +and +.Dv PT_SC_REMOTE , and silently accept zero result from it. -.El +.Pp +For +.Dv PT_SC_REMOTE , +the selected thread must be stopped in the safe place, which is +currently defined as a syscall exit, or a return from kernel to +user mode (basically, a signal handler call place). +Kernel returns +.Er EBUSY +status if attempt is made to execute remote syscall at unsafe stop. +.Pp +Note that neither +.Dv kern.trap_enotcap +sysctl setting, nor the corresponding +.Xr procctl 2 +flag +.Dv PROC_TRAPCAP_CTL_ENABLE +are obeyed during the execution of the syscall by +.Dv PT_SC_REMOTE . +In other words, +.Dv SIGTRAP +signal is not sent to a process executing in capability mode, +which violated a mode access restriction. +.Pp +Note that due to the mode of execution for the remote syscall, in +particular, the setting where only one thread is allowed to run, +the syscall might block on resources owned by suspended threads. +This might result in the target process deadlock. +In this situation, the only way out is to kill the target. .Sh ARM MACHINE-SPECIFIC REQUESTS .Bl -tag -width "Dv PT_SETVFPREGS" .It Dv PT_GETVFPREGS From nobody Fri Jan 20 03:23:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFx0mL9z30vg4; Fri, 20 Jan 2023 03:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFw5zYnz3nyb; Fri, 20 Jan 2023 03:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y4bQYe1K6HYfmjsf8H4YyMpUSPfGoGGzzXaDFskeuwk=; b=xiR1iNdEhvbSd+OxbXXhYoldfh6juTjzG7C3EPGp/Y31NAQhmwxI2jaDzBNDEMFiALkT8G RMk/bmCmYfFsVAKzMrlrx8mIx/XXafUtHehbGPc5Fzjn5ahD6SHhT0puiapPVq7jKRXsy2 VkNnsnbZACuOoEM0dWavyhRmWsRIpr2806ibpemMDVS6w0eD+zDarqGOsL1diWAOrUn3rl abxYT57AdMu0UEoE+1LGVTk9TXAAdWWeg8ZQDXo+MMbtKeo9DmCsLa1Th54c95l6o/0jh3 0k01G5uT8+1Byc1YERpMBtoxzaSb8EzJs73g2LF0gcvqDqLE5UiVTrj9cRnd9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y4bQYe1K6HYfmjsf8H4YyMpUSPfGoGGzzXaDFskeuwk=; b=b8a5DPUVwZyqGGNMdza9Z1JBv+unJXdpbOxXSiKSXqQeE4JLLWX/0Xs3Nhi+f+mBUHO8SC u7afnfEMUbL2bigTl3R1eGxBr05AXsnsrFDcEfcYfqBf0iFrfnx3/0eENNn3XnOTcLzBs4 0icbxRCenEUcKwJH5/y0i45j1SY71jZOorsWDzHVd3HCuIMDDy2QDJbvLYyv7ne0sGyq7c jf9XGxA6hPZPSal6vGkhL9dbyqcARdaZLfThZydvmfbSBog3Wb+sOXZCPFMe5xFbJmmSmF yPxApTVFHEsJTki5qfpRtTfDNadyHsh4F4IEkw2H+iny1JvJ1vqYHVoBPgfyzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185028; a=rsa-sha256; cv=none; b=ttMRCaKHLnIetG4qsmvQyzaCOZWCP/5qt9LKW5Ong+QUBkPRHigNUlF9x38ReJB7rpxCKL rbpXAi1Yz3F6kgQ1UAMWHH9SkXyLC+ZeyUaYfwEczuPj6Mc1IU9zqt7n9XRcwGLFTJl2yr W6/XgbmdQ2jbeGv4DmieiOJ2kSXsVBgncWFajiEn0odwO+FrmzSf5wM0VU/f7iTDdZn5Ie /Jq9BfjHpjRaSZWSDggqq88KitULvTWwP/0bgOTwrA09vvECXnghHiZxiHeEqDxSd+njmk 7IYzNtSxTeh8Le4yE4/4rrN+NG4u8YfvOD5VmObcCo+FA3PdSXfQ+fCVIzDScw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFw4g1FzFys; Fri, 20 Jan 2023 03:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NmxG042668; Fri, 20 Jan 2023 03:23:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NmvC042667; Fri, 20 Jan 2023 03:23:48 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:48 GMT Message-Id: <202301200323.30K3NmvC042667@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: 1610f04c9dac - stable/13 - tools/test/ptrace: update scescx to do remote getpid(2) on each SCX event List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 1610f04c9daceb5b4f2849e48d0021ecc975bb60 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1610f04c9daceb5b4f2849e48d0021ecc975bb60 commit 1610f04c9daceb5b4f2849e48d0021ecc975bb60 Author: Konstantin Belousov AuthorDate: 2022-12-02 01:26:13 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:16 +0000 tools/test/ptrace: update scescx to do remote getpid(2) on each SCX event Tested by: pho (cherry picked from commit 6403a140243d4f5377f589f93aeb44fe75ea8d59) --- tools/test/ptrace/scescx.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/tools/test/ptrace/scescx.c b/tools/test/ptrace/scescx.c index 582d1734427e..8f19f9a55889 100644 --- a/tools/test/ptrace/scescx.c +++ b/tools/test/ptrace/scescx.c @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -213,9 +214,13 @@ wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) printf("\n"); } +static int trace_syscalls = 1; +static int remote_getpid = 0; + static int trace_sc(int pid) { + struct ptrace_sc_remote pscr; struct ptrace_lwpinfo lwpinfo; int status; @@ -269,6 +274,24 @@ trace_sc(int pid) wait_info(pid, status, &lwpinfo); assert(lwpinfo.pl_flags & PL_FLAG_SCX); + if (remote_getpid) { + memset(&pscr, 0, sizeof(pscr)); + pscr.pscr_syscall = SYS_getpid; + pscr.pscr_nargs = 0; + if (ptrace(PT_SC_REMOTE, pid, (caddr_t)&pscr, + sizeof(pscr)) < 0) { + perror("PT_SC_REMOTE"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } else { + printf(TRACE "remote getpid %ld errno %d\n", + pscr.pscr_ret.sr_retval[0], pscr.pscr_ret.sr_error); + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + } + } if (lwpinfo.pl_flags & PL_FLAG_EXEC) get_pathname(pid); @@ -322,8 +345,6 @@ trace_cont(int pid) return (0); } -static int trace_syscalls = 1; - static int trace(pid_t pid) { @@ -340,12 +361,16 @@ main(int argc, char *argv[]) pid_t pid, pid1; trace_syscalls = 1; + remote_getpid = 0; use_vfork = 0; - while ((c = getopt(argc, argv, "csv")) != -1) { + while ((c = getopt(argc, argv, "crsv")) != -1) { switch (c) { case 'c': trace_syscalls = 0; break; + case 'r': + remote_getpid = 1; + break; case 's': trace_syscalls = 1; break; @@ -354,7 +379,8 @@ main(int argc, char *argv[]) break; default: case '?': - fprintf(stderr, "Usage: %s [-c] [-s] [-v]\n", argv[0]); + fprintf(stderr, "Usage: %s [-c] [-r] [-s] [-v]\n", + argv[0]); return (2); } } From nobody Fri Jan 20 03:23:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFy1GhSz30vhF; Fri, 20 Jan 2023 03:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFy05mDz3ntr; Fri, 20 Jan 2023 03:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fqkylt0UCXSrPeMccBsHoxpAYhIxWf/sswjfEPH0K7c=; b=bpw4YBpw5MpAWsWrxnMJ2Ind+CyFmeEnzhDzeL/NUklKNBCcRuMHNOBAbdOdb7yAjrmmW/ 1j2fjUAF2pKHZureN8ywVyR4ZKLSyd2i7gf1JzSWDZe4TlUQgxlONoUxQxVSupCZjCz+u2 eYd9M4W6mf/VQT7ozkNrtD5tRZYBsVqtFo+NBS3uxEQc8nilqp7wBf2tvu05gFlLWGgvc9 IR1K5EQBAQzNl1BD6Hdpstef6N0a8MFIzLAt8TWYm5aPP8VLNzVMbgMcWpWWndgYirMXkD Qr0i2MNC8AM7ytBqs+JphOwGgfVR0owxXoCtndhg4YsLrooTRu7cUOLU9LGL5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fqkylt0UCXSrPeMccBsHoxpAYhIxWf/sswjfEPH0K7c=; b=YLM5r6qPcMdPbMowTZ2X3OrvVIacet0EJlQr3IdwJCBD0deAeBijhRvnzlSEAYSZ9sKNMm fx2ZQq8Z5RtGP9WotMrxW9dc242KGKoliyE1fd75UiiAmB/wL49YAUTajXGRCz6KhneMxe Gtp4KmQVT9zxpmoBkbDsah84yhuf5OysfhisAWb5gtXWzplDvp2/6YtKH8JqFAoQ3BByT9 15b3yQL+ZZ9q1hth96nlHmlnCuH0+/e6rOzYazvZdz4Y3R45MMgyfenCuoV6hE0t2bnsSs Qx14wJP/rGbErDj5eA7ay7OrK9vs0v0r3v61HwROf83Nw7KEfRFPLNA7ND0mDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185030; a=rsa-sha256; cv=none; b=C/dsfK7djVbCsxIEO+kxIjC9G8nNFynD0CbBIXpzQvSEYvkgcTRC4IkDYSVNoXYPqT5YTP zOCyM7i62lC9azQWH/Bq0+rTzXFiZbY19MwAE/EkufgY5b1EE5Mg5rYIOca9+JZQnTr/YZ qMzM5df6TaefmxIh6+7aHf4NVyUntIsqJl8eLxebVFuUtQxDAEFpwss4jEty/3uPfXBnqE X5kmKszadbnXqunQ3pK6Gw/JQUjcQO+MnOB8BsahSj8TX4YcsIt+Qzg0w3q08IAw1zlDNh AQZxTGeU5DA2wU+Z3xbBoZazbkgHrMHw/Sq28aoOva0dC+NaZcG3/vHX6q+NzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFx5ppPzGKg; Fri, 20 Jan 2023 03:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Nncv042692; Fri, 20 Jan 2023 03:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NnkX042691; Fri, 20 Jan 2023 03:23:49 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:49 GMT Message-Id: <202301200323.30K3NnkX042691@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: e1d9d8fe64ee - stable/13 - Add descrip_check_write_mp() helper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: e1d9d8fe64ee94f78d679235bb76b2a01068b4b2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e1d9d8fe64ee94f78d679235bb76b2a01068b4b2 commit e1d9d8fe64ee94f78d679235bb76b2a01068b4b2 Author: Konstantin Belousov AuthorDate: 2022-12-28 18:13:01 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:23 +0000 Add descrip_check_write_mp() helper Tested by: pho (cherry picked from commit 37b9fb169686e867987c8a1a9868f81137b9df2b) --- sys/kern/kern_descrip.c | 25 +++++++++++++++++++++++++ sys/sys/filedesc.h | 2 ++ 2 files changed, 27 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index ff999cc82f97..6b2d95d53db0 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -4238,6 +4238,31 @@ mountcheckdirs(struct vnode *olddp, struct vnode *newdp) vrele(olddp); } +int +descrip_check_write_mp(struct filedesc *fdp, struct mount *mp) +{ + struct file *fp; + struct vnode *vp; + int error, i, lastfile; + + error = 0; + FILEDESC_SLOCK(fdp); + lastfile = fdlastfile(fdp); + for (i = 0; i <= lastfile; i++) { + fp = fdp->fd_ofiles[i].fde_file; + if (fp->f_type != DTYPE_VNODE || + (atomic_load_int(&fp->f_flag) & FWRITE) == 0) + continue; + vp = fp->f_vnode; + if (vp->v_mount == mp) { + error = EDEADLK; + break; + } + } + FILEDESC_SUNLOCK(fdp); + return (error); +} + struct filedesc_to_leader * filedesc_to_leader_alloc(struct filedesc_to_leader *old, struct filedesc *fdp, struct proc *leader) diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 345576438c67..5a4b3de33104 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -214,6 +214,7 @@ enum { #define falloc(td, resultfp, resultfd, flags) \ falloc_caps(td, resultfp, resultfd, flags, NULL) +struct mount; struct thread; static __inline void @@ -230,6 +231,7 @@ void filecaps_free(struct filecaps *fcaps); int closef(struct file *fp, struct thread *td); void closef_nothread(struct file *fp); +int descrip_check_write_mp(struct filedesc *fdp, struct mount *mp); int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode, int openerror, int *indxp); int falloc_caps(struct thread *td, struct file **resultfp, int *resultfd, From nobody Fri Jan 20 03:23:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylFz24F1z30vpB; Fri, 20 Jan 2023 03:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylFz1D2Dz3p6w; Fri, 20 Jan 2023 03:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8AaxYugtUqxcAeo5L9mFBT29pgS+RMnAz8zaG9JfYc4=; b=hjw87TVms3tVDcCwIX3clJOMwT2lhapmMxYKzQdO/g2/5JgZOPzsURQAVB0YRcR2AeiCnh No+WeTVVsQRcrS3CdfMDH+vv8yAeRP0cmhrp7Qx8CJqgcWmmTr64FtCfUjCVsw3aqtLFWv YXyGVJmd+koH3Jh9jynlJf6IedHOdM1/qzcaeZRe2pYMhSkW8jHqCU0Bgr4fS0BRJh22GN mLN0ar+/m7xbFNwKKL4lWBkGaNKTMj0BNvUNZLch5PlMIwuEjhPS7QM9NwubxiI86d219I HgTx55vmLp1WMOGeON4k4ofwBiBypAIhh66pplI0T/9zfBHqBpjosTMj8QE2HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8AaxYugtUqxcAeo5L9mFBT29pgS+RMnAz8zaG9JfYc4=; b=WhfTq7nLo1fKFw0gtmQgUJfgGdOssU1wRapqi/SkKeh9d9H+dmd4Ef8xgMpDXWSyYZmBWH 1kStGaCfljf1x40Noe+gm95l/wEgDhrkm/rspJuFI6iequiOq1m44KCNpmVqAssuRKO2bj idPRNUmppHLLGDvy32ykQ7K1tjv+zxj2d2K4rfX6JZpccIBfTMcg7I8ACLeNm/G+ShfzB1 vuV5dvlved8vZ/DBFer3ueQ3IFCS6eMFY6rBO+cdEZO1ZP5u+pr9AfrBVyujGGnHqAg7xb KuQtbSiJ4pldcEnIpxrSU2JgC9Ab3QIm+Ddl0cJCJPnnZzNsWGZXtiOm6MV4EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185031; a=rsa-sha256; cv=none; b=Md0lLl4RqOC86TteI6wR702cT4UvyqFYas/ZZx4psfiwAAUJF3H6d9oyIGnW3LdRCV9bht AoKkBBkQwPq3Ztfe+iWMFCbpVFaZ4F5C4zjBpLmjrc90ZJfviuK9gp6ALMAd8gGaeYiK3G xXACqB0SEs0TW5gj1X5v2IYkiNF897k30HjeNXZVzAZeziaIlOb/DVLXkA1NaOTKXKufN1 cuP2nwaCYKLKKiY9MmuvB2Tvk2IpEuDCBJB9tvAVmjCEJcnDpOgJ+RKa+I3zCA820T+Hml PzdTtnDP8G+kFoHWcfJ6c4UjlTi3Pm5wHAv3VE+YVdzKDy03xK9yIfRDlsAb2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylFy6K0jzGDR; Fri, 20 Jan 2023 03:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NovB042716; Fri, 20 Jan 2023 03:23:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NoU3042715; Fri, 20 Jan 2023 03:23:50 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:50 GMT Message-Id: <202301200323.30K3NoU3042715@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: da5871423955 - stable/13 - ffs_suspend.c: clean up includes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: da5871423955e5313cac01e3d6c1f47876e18411 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=da5871423955e5313cac01e3d6c1f47876e18411 commit da5871423955e5313cac01e3d6c1f47876e18411 Author: Konstantin Belousov AuthorDate: 2022-12-28 18:17:53 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:30 +0000 ffs_suspend.c: clean up includes Tested by: pho (cherry picked from commit 68912701700ca3230f3e2d4b7858a038f884a327) --- sys/ufs/ffs/ffs_suspend.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index d13097109758..e7c976b6e921 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -33,15 +33,14 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include -#include -#include -#include #include +#include #include +#include #include +#include #include From nobody Fri Jan 20 03:23:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG05tcJz30vrh; Fri, 20 Jan 2023 03:23:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG01c30z3p0V; Fri, 20 Jan 2023 03:23:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xdscgEqS8kDE4Q4ILmdrpOgMm3Yz5ZqDlPTkcisvJsk=; b=uyPI+mfNHvGmUAHXCpS3KYSzilptR6Hb5j2ljHWD8RHidsevSMYBFZOC7MWLb4RWEy322s HXWsO/P4Z5ajIgVWvqzvMDfG851dcf+rOTZIroAE2OhVkcuHHp+3jolNiMIDWWvs+X7lBv voQxxjxC/YzG0XwgwZ3Cy0/5XLOm53XCwtoDpOeJ4+Okj8EcGk1iCBAHEMD4WuovfSeX3H XqgFhf8DPHJwFUmRp0nm6DEkc0z/YrRBbd36PJbK3iBlxFkLbg6/1b/Yf8fQ/0hziq9p+a wn1hMsGUIwUUrISgZiszFPqm0tDPnny2ChRXC6frEOyqtahwhU2t9B0srzwsFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xdscgEqS8kDE4Q4ILmdrpOgMm3Yz5ZqDlPTkcisvJsk=; b=Lhm7YYUXyqc/mcN9OXZml95PEYyqZ40msslfUscuGd0sjsueiyWyEAjMzgwai1d25NP9KO X6lU5yH+BfsafEMapm+d3MJeVxAnJBcniPkcaMpndLJz9xNhr1coTt/Yc6GvAq6aaQ4x6g kzDr/rZLceW5S8ICl9acCe9IrMgd/ZCkSHGyKoMNeH6p3yzqVTPiE2WULDcb+lOk2iC2hf FC/lbSqghFzSof6BW5fjJtpJ8DukTelk07G51jjfCOV7FdRXifeURb4BEE1rvfmtbfvRiV tvNawg8QNvNGUgFVyGnCH2NB3r2u+anGlcQm/XAZyAPoBJprEpLSLo+rpjn1JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185032; a=rsa-sha256; cv=none; b=GXqqQC8lRpgsTpRLyt8X7iVvsMWZb9VkrcLwcqTC2iDkaDF+fT6yMP/qxZuKclY/9LvdN4 eAq0FsfbyUEv6ln0XMoSeiBxxitQo1eYg6uHuHbjgCxyiRH1PbD5QyHxBWkTdemOne+l6v VrFPQYeVkUANt437/tzRHpsUxpbiZIVy+v8tJHUIe0yY/BGwlhzewPHKfAxdl7eOxt3k4w EKAehOV+DByVxeyPfPHFcK30Y0XE2y6yGMmg4VfmODCIhGlieF1az24VLEOlKOFc+sNABP Gmybra73y8GLFgOdHoJrRlYEA35prIordQxCoL8ekGKhPiG5RRIqyDc6emuIvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG00SL5zFyt; Fri, 20 Jan 2023 03:23:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NpCr042740; Fri, 20 Jan 2023 03:23:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3Npe1042739; Fri, 20 Jan 2023 03:23:51 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:51 GMT Message-Id: <202301200323.30K3Npe1042739@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: 00c0e20c5180 - stable/13 - ufs/suspend: deny suspension if the calling process has a file from mp opened for write List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 00c0e20c5180284298910dcf0a677243b2c28f7d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=00c0e20c5180284298910dcf0a677243b2c28f7d commit 00c0e20c5180284298910dcf0a677243b2c28f7d Author: Konstantin Belousov AuthorDate: 2022-12-28 18:14:52 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:35 +0000 ufs/suspend: deny suspension if the calling process has a file from mp opened for write PR: 267628, 267630 Tested by: pho (cherry picked from commit 701b36961cbd2084c36eb828402d0ef89211d929) --- sys/ufs/ffs/ffs_suspend.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index e7c976b6e921..a68f25d5eed2 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -302,6 +303,16 @@ ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, vfs_rel(mp); if (error != 0) break; + + /* + * Require single-thread curproc so that the check is not racey. + * XXXKIB: might consider to singlethread curproc instead. + */ + error = curproc->p_numthreads > 1 ? EDEADLK : + descrip_check_write_mp(curproc->p_fd, mp); + if (error != 0) + break; + error = ffs_susp_suspend(mp); if (error != 0) { vfs_unbusy(mp); From nobody Fri Jan 20 03:23:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG167Z2z30vk9; Fri, 20 Jan 2023 03:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG1288Bz3pFx; Fri, 20 Jan 2023 03:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Q5U2rrdcRHTCBlTkK9R8V//PTGjutgHiQH84znftMc=; b=pbIakTgE+/PertXG7jwdOh9cRPFC3H6R9Xh2par6UEIqK6cdyaeOHYswEgYXGCe0FBU81g h3J+gr8HqatKGafuqWsVwJCzImgBQM50qVKG9fOtzO0dsggbBi2JSxMFFn6IZlq4YM8mf7 mPYQyX5PUdrC0AS0RqIoFuVhQKRRDy9SLBz0AK/5qFWIx0+lN5LHpgKDm/1MoT5ZFQwwDd J2daZqU+bRP+ahCoqV0qftj5HIOJlzAcBMRyaEc3jXV0Kilk+pMXlKf7iQlucvR4rbAga4 X80yn9hCgQu2itJVHufYmQAIsGus+51jzBC0vMF2dusBTr1ihh2sNjA7Swl03g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Q5U2rrdcRHTCBlTkK9R8V//PTGjutgHiQH84znftMc=; b=ZFmuaRo10ecKDHO8uz7jFQfFq0/crsUm+07I5YasgvnQSZNjapZNfuVlFmWXsVnBgStzYM cJU9igTzvoYtmPicUFkf9uhfKIox8Yn04lyfAGN5SAQpbDGH6b2eMA/YIszQO5ccyCAvNa ulgHkSsdPb7vSHQKWHdzHoBz7rzF1iUwZiJqG0kHSTT8jGPNbq6KRJ6Rextjf6NEZ4Y2zh 7vNrMEjA939dcJAJBgImmXbX5DGnmvuF7zl9t646U7NpgM2QU8O0cQXy+gvNbfGnBzubaE hyEiHmZyZHN1wlU2R/cDVtKzXavXMQwlPe0T+FutkdlOCeSny2h2kt7+BIfDCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185033; a=rsa-sha256; cv=none; b=kWlZLnXcZMVo+efeRkx6RIcRB3QF1A3t58/34lhCX9IAu+U+/4vRgQFfBNy/qfK3PDOR2W QH99BphArTosoC3KPgZ1533FlxB9loII7TLQQZC6unuibdSJ4oWh5FCmIZcxEq9DDEHB5I lr4dRqRougY7ZB8CVTgEmR9EF0ZTshrSracTH52QVxFoD1Z7Yk+TxP3shlpo5dxIDv3+of 3Of1lwms4H6ZN2NDVlMIUd0yhpSNlrcObEoGkZxgRtLo6SHNY4RiLDT3yJYejF3lKtcSa+ mFSX7kwfcEtomzRv9TzLrM6HJxXRJBQF2shAd38WYBHug3QrqlrjYLy6xAqSxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG11D4tzG9M; Fri, 20 Jan 2023 03:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NrMF042772; Fri, 20 Jan 2023 03:23:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NrMO042771; Fri, 20 Jan 2023 03:23:53 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:53 GMT Message-Id: <202301200323.30K3NrMO042771@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: 9bdaaaaa3221 - stable/13 - UFSSUSPEND: unbusy mp in EDADLK 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9bdaaaaa3221f410f20d19d785d27487094d0fd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9bdaaaaa3221f410f20d19d785d27487094d0fd9 commit 9bdaaaaa3221f410f20d19d785d27487094d0fd9 Author: Konstantin Belousov AuthorDate: 2022-12-29 22:09:57 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:44 +0000 UFSSUSPEND: unbusy mp in EDADLK case Tested by: pho (cherry picked from commit a5ff86646ee4602a141a24eee95c1c60bb375030) --- sys/ufs/ffs/ffs_suspend.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index a68f25d5eed2..5e3258089fd0 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -310,8 +310,10 @@ ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, */ error = curproc->p_numthreads > 1 ? EDEADLK : descrip_check_write_mp(curproc->p_fd, mp); - if (error != 0) + if (error != 0) { + vfs_unbusy(mp); break; + } error = ffs_susp_suspend(mp); if (error != 0) { From nobody Fri Jan 20 03:23:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG25Bjmz30vkJ; Fri, 20 Jan 2023 03:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG23XJVz3p0v; Fri, 20 Jan 2023 03:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umZBbA7wJG+G4TeQbRoml4/fw7TPt7OTvb0ltF+44Sw=; b=BDUUwrYDG6TEZ725NVi0C8ix4O8DUwgXbEE+yG/P0xfLFWE6twN2n94VU6LyOxkI1x6wb1 Lr2DZanSGuS+JuikV9rMWlDE+8AZElAq8cjW9/A/zQX0tDcU/1iL9en57oHyYYemMFUVEB xHi9frCpl0/PVz0Vj6c1A53m6oMrYR7LDyE3dTv/Je+epLluZjaopnOQmWSMpwU1sysaA3 ga3tqnip8Edu/yiA/FVpxcckXETRiD/1dZeZ4bnbhlwVlycQcYoO4yFQvXQXnm5M3UaYva y76aPdps5sbgCT7Iw/XpzvNPjBr9WwWpk/cfr8spFNBkkjA8LkI1HMz/ZEhxtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umZBbA7wJG+G4TeQbRoml4/fw7TPt7OTvb0ltF+44Sw=; b=AfuV+i+rTQBB5PAbk6KM3hyOTX9ms2/pzfkRIBilpkb/VHl2FG+MsOo9Iouqhx4coPefdr jjjcrbbhtMaexvSFW8oLbqqhjeIexKH4q+pRR9z9Hgaz84HGaPo3tZRqZ5BWIm/+9fBK1R 3jOmmOvUiLMqI2lfqsxa0nsBlyQYynwNtAiMhylK2pwFOu0AjaMz6u9I5415jSd0K/3uta Ov+KVxIPJi9awNWVIlu/NyO5OARrbGpbAAFdt+D49x19Kb9k7wIZxc2XhrKbg0hpIZ4PUd n3P6EnoRsVfzEn2yFFytCV7Nz0nKuMf8BKsAOvHLqsy5cklgxq/uiEJ2lmwoiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185034; a=rsa-sha256; cv=none; b=uGLa3omHcM/vG7OK0kfgTgq9Ky0Cj9YCAYz6CPYcAgN/ez8MbohQ5Vth9hAOeQ5lHfIeRr PqD6xXIDIVTH+69BpOebTr89b+q5zw15pLNx7OPKqUC37nhlrTHY+Lj7mXupJCsq/u9c0U Cs11jTdjfkmYrt5ykEmoJrN2rvd1Mti4FSb3yu4C5ZDKbV8Yya1D8oMZW5dfIZEJzcYYXP Wqca4Qhh2vNhyHs4JFA+wWWC54pNFTZ1Mh9r7rzB9xMQyQEX9haAFxUJN0UP00SaiQosgc GSBL5B5uCuf1Qc2Luz5egXcaVMipY62aAlMCExRb4hcXBBJPgTvShNhYovlOzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG22LprzGDS; Fri, 20 Jan 2023 03:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NsV5042796; Fri, 20 Jan 2023 03:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NspS042795; Fri, 20 Jan 2023 03:23:54 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:54 GMT Message-Id: <202301200323.30K3NspS042795@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: eb2e82b9ca8e - stable/13 - amd64: identify small cores List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: eb2e82b9ca8e39c0c2045b19cf93489063d57beb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eb2e82b9ca8e39c0c2045b19cf93489063d57beb commit eb2e82b9ca8e39c0c2045b19cf93489063d57beb Author: Konstantin Belousov AuthorDate: 2022-12-21 11:04:14 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:52 +0000 amd64: identify small cores Tested by: pho (cherry picked from commit 45ac7755a7c5d8508176b3d015bb27ff58485c80) --- sys/amd64/amd64/initcpu.c | 9 +++++++++ sys/amd64/include/pcpu.h | 3 ++- sys/x86/include/specialreg.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 1a251208cfd6..1b731821889e 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -255,6 +255,7 @@ initializecpu(void) { uint64_t msr; uint32_t cr4; + u_int r[4]; cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { @@ -317,6 +318,14 @@ initializecpu(void) if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) wrmsr(MSR_TSC_AUX, cpu_auxmsr()); + + if (cpu_high >= 0x1a) { + cpuid_count(0x1a, 0, r); + if ((r[0] & CPUID_HYBRID_CORE_MASK) == + CPUID_HYBRID_SMALL_CORE) { + PCPU_SET(small_core, 1); + } + } } void diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index 6326fbdae0be..c0b8ee456f25 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -99,7 +99,8 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); uint32_t pc_smp_tlb_gen; \ u_int pc_smp_tlb_op; \ uint64_t pc_ucr3_load_mask; \ - char __pad[2916] /* pad to UMA_PCPU_ALLOC_SIZE */ + u_int pc_small_core; \ + char __pad[2912] /* pad to UMA_PCPU_ALLOC_SIZE */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index ddac2b9ea2b2..bc3fd2e563a1 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -490,6 +490,11 @@ #define CPUID_STDEXT3_CORE_CAP 0x40000000 #define CPUID_STDEXT3_SSBD 0x80000000 +/* CPUID_HYBRID_ID leaf 0x1a */ +#define CPUID_HYBRID_CORE_MASK 0xff000000 +#define CPUID_HYBRID_SMALL_CORE 0x20000000 +#define CPUID_HYBRID_LARGE_CORE 0x40000000 + /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 #define IA32_ARCH_CAP_IBRS_ALL 0x00000002 From nobody Fri Jan 20 03:23:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG35WQlz30vvC; Fri, 20 Jan 2023 03:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG34Tk1z3nxY; Fri, 20 Jan 2023 03:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lJGqVQbk6gbdl7sJRm1uKVS/FwZqGkleeuttEQv1sTU=; b=q47UIeTwGrmaRpU6sXD+RoReUSwZoRq6LBuwnrH4nES+9cjbI+2Ywp3tirnnGr09ufdvu5 JiMYvFEiI8F64MCaATU1NnTWgvrfbud5T6lDYzkkRWU4l5ep3wXf96exWRc1sjIjW7Gi3z crYqqCsT1GU0paN97NY8QTQj6poEt+pVyn4nuluCVuulXqLFxMVUmDnGUFepx/WYMwoTQg AGhtMHqk8NNhyeC4w/yFBnwB55Zm9KRBhr+vfN+j/xeLPPBqcMV8ClfF2VWONFoxm4QbEn SY3MhBeL1Vti0b9IZJQVXgXRqMSK8LAXWpyca61l1UmLsgSyynYZg8z5+MY/9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lJGqVQbk6gbdl7sJRm1uKVS/FwZqGkleeuttEQv1sTU=; b=rM4eqwjtHMgICZP5Ia5d4Hgvgv4AuAh3/arebhehcniyuYGFwN3Qw8YDiduknnxGxP4iRI Ps9ZR7PRu6YN782Kve0EGFjh58RM36ZlGxcVkoXentQb6Gwsryt1kDNnEfL7hZK1n5ssX3 epRYzavDiIrZ7glZYUdD1IfkNqQl7nsF1yw2Voy4DGRjAMmrZzzA06ASoLAoX+bySh95Bp UGDd/YtUR8vTTyxeR7UmkLk4sIzIKTaI9hlMKjgLh3OgDkUFuaC2SmrqH7NP63IonqwXlm bwHyoUUFXsaDURSn+QLOyZDaS9vJ+R/pKpkmYuMvO4KwFxHus5a9JWqtLZOgqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185035; a=rsa-sha256; cv=none; b=Hf7zNK5foats5j7/upf81FRSmVVLqhqUBfC7SMscMOTc8+uLz/8A1go9wcD4qLk11J7NF0 DHl0mpn8zUqlewOCSCdpRs7gwvuKQ8ywrNPoaw72ICatpC6A4WXHhvyRyDkbQxWlKIzNfJ XFZZperEe2b7o9Zc2Ja7mlHXJb7WeuZvF/cfKGg6Uz7YECE1qLkyUI4khrzLpYtC36+3cg VdhlDiyaos18BibCZpdl6Iu4GrSm6O83x36wKyAvvyEAVvBHCRh2xfPYPPh+lv/gJ/m/3j qnNxZvNaSNb7lUlUP4OGiTwtR6hFrWL2lgnRctVK2IefN/2PidaoguyRz2sqNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG33XhfzGNm; Fri, 20 Jan 2023 03:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NtdD042820; Fri, 20 Jan 2023 03:23:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NtXL042819; Fri, 20 Jan 2023 03:23:55 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:55 GMT Message-Id: <202301200323.30K3NtXL042819@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: 567cc4e6bfd9 - stable/13 - amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 567cc4e6bfd92d7351e385569f2bb4b7c89b6db0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=567cc4e6bfd92d7351e385569f2bb4b7c89b6db0 commit 567cc4e6bfd92d7351e385569f2bb4b7c89b6db0 Author: Konstantin Belousov AuthorDate: 2022-10-10 23:08:55 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:21:57 +0000 amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG PR: 261169, 266145 Tested by: pho (cherry picked from commit cde70e312c3fde5b37a29be1dacb7fde9a45b94a) --- sys/amd64/amd64/initcpu.c | 5 +++++ sys/amd64/amd64/mp_machdep.c | 16 +++++++++++----- sys/amd64/amd64/pmap.c | 36 +++++++++++++++++++++++++++++------- sys/amd64/include/pcpu.h | 3 ++- sys/amd64/include/pmap.h | 20 ++++++++++++++++++++ 5 files changed, 67 insertions(+), 13 deletions(-) diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 1b731821889e..08385d3095d0 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -324,6 +324,11 @@ initializecpu(void) if ((r[0] & CPUID_HYBRID_CORE_MASK) == CPUID_HYBRID_SMALL_CORE) { PCPU_SET(small_core, 1); + if (pmap_pcid_enabled && + pmap_pcid_invlpg_workaround_uena) { + PCPU_SET(pcid_invlpg_workaround, 1); + pmap_pcid_invlpg_workaround = 1; + } } } } diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 5e94ba822871..650f83b1aad4 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -863,7 +863,7 @@ invlpg_invpcid_handler(pmap_t smp_tlb_pmap, vm_offset_t smp_tlb_addr1) (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - invlpg(smp_tlb_addr1); + pmap_invlpg(smp_tlb_pmap, smp_tlb_addr1); if (smp_tlb_pmap == PCPU_GET(curpmap) && smp_tlb_pmap->pm_ucr3 != PMAP_NO_CR3 && PCPU_GET(ucr3_load_mask) == PMAP_UCR3_NOMASK) { @@ -933,10 +933,16 @@ invlrng_invpcid_handler(pmap_t smp_tlb_pmap, vm_offset_t smp_tlb_addr1, #endif /* COUNT_IPIS */ addr = smp_tlb_addr1; - do { - invlpg(addr); - addr += PAGE_SIZE; - } while (addr < smp_tlb_addr2); + if (smp_tlb_pmap == kernel_pmap && PCPU_GET(pcid_invlpg_workaround)) { + struct invpcid_descr d = { 0 }; + + invpcid(&d, INVPCID_CTXGLOB); + } else { + do { + invlpg(addr); + addr += PAGE_SIZE; + } while (addr < smp_tlb_addr2); + } if (smp_tlb_pmap == PCPU_GET(curpmap) && smp_tlb_pmap->pm_ucr3 != PMAP_NO_CR3 && PCPU_GET(ucr3_load_mask) == PMAP_UCR3_NOMASK) { diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 233c58b83f2d..62fa64881c7b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -517,6 +517,12 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); +int pmap_pcid_invlpg_workaround = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_invlpg_workaround, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pmap_pcid_invlpg_workaround, 0, + "Enable small core PCID/INVLPG workaround"); +int pmap_pcid_invlpg_workaround_uena = 1; int __read_frequently pti = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pti, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, @@ -2518,6 +2524,9 @@ pmap_init(void) VM_PAGE_TO_PHYS(m); } } + + TUNABLE_INT_FETCH("vm.pmap.pcid_invlpg_workaround", + &pmap_pcid_invlpg_workaround_uena); } SYSCTL_UINT(_vm_pmap, OID_AUTO, large_map_pml4_entries, @@ -2749,7 +2758,7 @@ pmap_update_pde_invalidate(pmap_t pmap, vm_offset_t va, pd_entry_t newpde) if ((newpde & PG_PS) == 0) /* Demotion: flush a specific 2MB page mapping. */ - invlpg(va); + pmap_invlpg(pmap, va); else if ((newpde & PG_G) == 0) /* * Promotion: flush every 4KB page mapping from the TLB @@ -3088,7 +3097,7 @@ pmap_invalidate_page_curcpu_cb(pmap_t pmap, vm_offset_t va, vm_offset_t addr2 __unused) { if (pmap == kernel_pmap) { - invlpg(va); + pmap_invlpg(kernel_pmap, va); } else if (pmap == PCPU_GET(curpmap)) { invlpg(va); pmap_invalidate_page_cb(pmap, va); @@ -3179,8 +3188,14 @@ pmap_invalidate_range_curcpu_cb(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) vm_offset_t addr; if (pmap == kernel_pmap) { - for (addr = sva; addr < eva; addr += PAGE_SIZE) - invlpg(addr); + if (PCPU_GET(pcid_invlpg_workaround)) { + struct invpcid_descr d = { 0 }; + + invpcid(&d, INVPCID_CTXGLOB); + } else { + for (addr = sva; addr < eva; addr += PAGE_SIZE) + invlpg(addr); + } } else if (pmap == PCPU_GET(curpmap)) { for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); @@ -3717,7 +3732,7 @@ pmap_flush_cache_phys_range(vm_paddr_t spa, vm_paddr_t epa, vm_memattr_t mattr) for (; spa < epa; spa += PAGE_SIZE) { sched_pin(); pte_store(pte, spa | pte_bits); - invlpg(vaddr); + pmap_invlpg(kernel_pmap, vaddr); /* XXXKIB atomic inside flush_cache_range are excessive */ pmap_flush_cache_range(vaddr, vaddr + PAGE_SIZE); sched_unpin(); @@ -7527,7 +7542,7 @@ pmap_kenter_temporary(vm_paddr_t pa, int i) va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE); pmap_kenter(va, pa); - invlpg(va); + pmap_invlpg(kernel_pmap, va); return ((void *)crashdumpmap); } @@ -10223,7 +10238,7 @@ pmap_map_io_transient(vm_page_t page[], vm_offset_t vaddr[], int count, page[i]->md.pat_mode, 0); pte_store(pte, paddr | X86_PG_RW | X86_PG_V | cache_bits); - invlpg(vaddr[i]); + pmap_invlpg(kernel_pmap, vaddr[i]); } } } @@ -10272,7 +10287,14 @@ pmap_quick_remove_page(vm_offset_t addr) if (addr != qframe) return; pte_store(vtopte(qframe), 0); + + /* + * Since qframe is exclusively mapped by + * pmap_quick_enter_page() and that function doesn't set PG_G, + * we can use INVLPG here. + */ invlpg(qframe); + mtx_unlock_spin(&qframe_mtx); } diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index c0b8ee456f25..13de60f650de 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -100,7 +100,8 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); u_int pc_smp_tlb_op; \ uint64_t pc_ucr3_load_mask; \ u_int pc_small_core; \ - char __pad[2912] /* pad to UMA_PCPU_ALLOC_SIZE */ + u_int pc_pcid_invlpg_workaround; \ + char __pad[2908] /* pad to UMA_PCPU_ALLOC_SIZE */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 8f1e77806a25..7b86f9e139e1 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -461,6 +461,8 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int pmap_pcid_invlpg_workaround; +extern int pmap_pcid_invlpg_workaround_uena; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) @@ -546,6 +548,24 @@ pmap_invalidate_cpu_mask(pmap_t pmap) return (&pmap->pm_active); } +/* + * It seems that AlderLake+ small cores have some microarchitectural + * bug, which results in the INVLPG instruction failing to flush all + * global TLB entries when PCID is enabled. Work around it for now, + * by doing global invalidation on small cores instead of INVLPG. + */ +static __inline void +pmap_invlpg(pmap_t pmap, vm_offset_t va) +{ + if (pmap == kernel_pmap && PCPU_GET(pcid_invlpg_workaround)) { + struct invpcid_descr d = { 0 }; + + invpcid(&d, INVPCID_CTXGLOB); + } else { + invlpg(va); + } +} + #endif /* _KERNEL */ /* Return various clipped indexes for a given VA */ From nobody Fri Jan 20 03:23:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG4613Rz30vrp; Fri, 20 Jan 2023 03:23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG45XNjz3pGq; Fri, 20 Jan 2023 03:23:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNjVrHcXU4q9QyS4jiM18xZ5Mv9W+ZdilangifYL/Ms=; b=MmHH1i+GnGi+Fz/D6WCQhpvr9uCoh3aHfSetGDaAVlS8FGWuqF/zovZSfIxZzMm+bnHrlv HOW5X/3+TqeyDmZRAvtlsCqroZIRR8zuZSvNcjQXp1GluzqTDktlPdnHtH7nEn61d0n/qK a55GPZz+ASrA4l/63/ya1SfU7dLBXxcgmWKdg8StcvW0ZYO9DgamYh6V86gLX1K6Q6jLH/ lMGTfKwbwVrtIlx2geHjXKGwOAWukhSMAgXYtqMf8GMEF7jaiiiIEH1ZTp8lJGdStocy5P Vtw4tpP6GjQ77FUEO7ImQv1NiQM11FX6MjrzJa+ky4DvoOXzd6lcnDp/RZAxew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNjVrHcXU4q9QyS4jiM18xZ5Mv9W+ZdilangifYL/Ms=; b=GDKRqhYtVZDUcqQHpgcVQq2anuWP8ocJevAty3R0CPAX4E2C0H6CisUNGU6/oJ4qGWwTjQ xcycmy1vDNAQwD0o/P4RJ8/PxZCtd6lGJj3NqVtTIzahSXq1vLT0lopNa5MC3qUAo9TPXa n+8mx+bxeNC4VK7/sac4TK6pGGcY6fDl462W44QCZ48esYoXCD+SkvNl6RpobAuBXIOkYd JtbNMGfSL9I7TWFxz4pKG068GOZ3CEyGeFv12qfzUHbD4PgdN5Bs214RvLj4F++vyIMDe5 13YVPPEjO0YU5hct0Ch8alU18FqPOzEwILmE2Rj5M6Bw0rvHykVmOPETLfIOZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185036; a=rsa-sha256; cv=none; b=pZ5fnlfHkohr2xk2fOI6l7EfkAN8LErDQXi5uvpCLzRfGljEK19wO3SqGLiRs8XHrCHAV5 Emkr+t6/gXVKVLWbZCftN31d5gTzKSRrDDNqzxma9LZoxyVPnu6in9JUJkByyS9Xsu+IVV cbDX9m4phntUIKHBISwNvJHNO3BpGy6H3H67SLOhtccfgCgCrRPekpbWpVnXvBpzCSPhOL tT8W/Fecq4epIuZUwtuYkg3TY+dEUujoJ/3EufPBAb7PUBqWpnVTQkvbYaHbZhBWmTAQjl wuZdJq6kEU/Uq4lnsjhMOQzViqVACvQHKO7f4hpkoiUTxEcqZWRjXy6sKyFFVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG44Z6pzG9N; Fri, 20 Jan 2023 03:23:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Nu6g042848; Fri, 20 Jan 2023 03:23:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3Nu6w042847; Fri, 20 Jan 2023 03:23:56 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:56 GMT Message-Id: <202301200323.30K3Nu6w042847@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: 4ab02274ed39 - stable/13 - Move INVLPG to pmap_quick_enter_page() from pmap_quick_remove_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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 4ab02274ed392d088f4bbd17811a668d657a63bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4ab02274ed392d088f4bbd17811a668d657a63bc commit 4ab02274ed392d088f4bbd17811a668d657a63bc Author: Konstantin Belousov AuthorDate: 2022-12-29 20:48:51 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:22:02 +0000 Move INVLPG to pmap_quick_enter_page() from pmap_quick_remove_page(). Tested by: pho (cherry picked from commit 231d75568f169fe6adc30373c12512b992c5c672) --- sys/amd64/amd64/pmap.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 62fa64881c7b..e990ed0b93af 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10275,6 +10275,13 @@ pmap_quick_enter_page(vm_page_t m) return (PHYS_TO_DMAP(paddr)); mtx_lock_spin(&qframe_mtx); KASSERT(*vtopte(qframe) == 0, ("qframe busy")); + + /* + * Since qframe is exclusively mapped by us, and we do not set + * PG_G, we can use INVLPG here. + */ + invlpg(qframe); + pte_store(vtopte(qframe), paddr | X86_PG_RW | X86_PG_V | X86_PG_A | X86_PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0)); return (qframe); @@ -10287,14 +10294,6 @@ pmap_quick_remove_page(vm_offset_t addr) if (addr != qframe) return; pte_store(vtopte(qframe), 0); - - /* - * Since qframe is exclusively mapped by - * pmap_quick_enter_page() and that function doesn't set PG_G, - * we can use INVLPG here. - */ - invlpg(qframe); - mtx_unlock_spin(&qframe_mtx); } From nobody Fri Jan 20 03:23:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG63LdHz30vxQ; Fri, 20 Jan 2023 03:23:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG56RWLz3p8H; Fri, 20 Jan 2023 03:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g1uezIMgK1mZ97FI6HFwiFnbi53Cu2TPWlYVIZZ361c=; b=mY7K5sai7/rbR5hFYauZ8Tvuyz/LDE7t7Io57K/JoHJ0ursXDq0pWJ+b2g+mwvk53Nm8ew yZe7fhyhVPLsl6nghgd8gnWUA4XTBiyV3IfalpJFAcqIIIO+aIwTxluiNykYCbpmM24JjD YX6AJuzGJWtkTQnmGdiuYYFO7motQb5FDmc9QudFMtN/L2+QYpOd5OdATA6z1KwQllVIb9 bE156Wqe4Gb9bYIgjaqsIF2BE4QQAp9MTYxWWIQXNxtK5bVsKyRbm7FuRl6DXih9etcdKZ 28tV+CK78s/ajpLxUeEtqq0W17amBZj2rqmVKAlxErXgdJmpgTjjxdRggMqBwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g1uezIMgK1mZ97FI6HFwiFnbi53Cu2TPWlYVIZZ361c=; b=ugSC8glHcv/xamPORQOLxZUFA5l9YtBFxsZFDvn818AYNmg57d+4UropYgrt8tXYMIqETg GNUyUBEbKPUCoFcqZtKSSpcIzGvcBfuOSpQLwbt+zw5gui1gdO9Lpw+VnxHaT2Xyto68qh AwMh1xvTZKXyWI+pby1av8hHPEF/7MHLiH3+Wc9+ZZXW4dnltEIEBxKFJ5+55ijxWbfVYL LQKrGCjJKQB5uJmEZGbsOcD0fub1iwLvFiefhttIgA+MTM2o0IMe0QsCNIawRxyyb0X7Rs 98ioKFYXz1Z/17Zu0TkTco62m431I2RPVoJ5rPwvpEXoQj0OV22p5OGFfe1W4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185037; a=rsa-sha256; cv=none; b=uczk1xwKc0Ryd6Ja5pQPnCvggoKYi0+3EdBGkkUKTZyNy+k/6Bbq/wgokJTp3d+PUebS+A pvpA+vaCO7IMZX4ql6+rxcRtsEHG/iK3Tq5c7QwKZK2AVBz43qzRfISfzll0xVw8WwLnvL fzYYofCkdRZjNE1w//S9mHxP1WZUp//LquUck8YzHxehQWAUT3M79D66lejaxsmlKjzC6N Z50VxbYlrwaqEQJ5pHp2uzvKk5leo7b2WOnL3gSQOfmmeqAsTPdKAUEL4OInM+Iy87sZk6 Kg1/MLOfeLUnS6DD7olvVDkpZMTMRCl2Qz4dNiKcqHUzDTccE8+QtThRt3mHhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG55XtDzG9P; Fri, 20 Jan 2023 03:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3Nvjg042872; Fri, 20 Jan 2023 03:23:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NvKn042871; Fri, 20 Jan 2023 03:23:57 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:57 GMT Message-Id: <202301200323.30K3NvKn042871@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: 1532ec2ba279 - stable/13 - amd64: be more precise when enabling the AlderLake small core PCID workaround List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 1532ec2ba2794af0d0b20832a154eeda2fa0e1cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1532ec2ba2794af0d0b20832a154eeda2fa0e1cc commit 1532ec2ba2794af0d0b20832a154eeda2fa0e1cc Author: Konstantin Belousov AuthorDate: 2023-01-03 10:13:07 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:22:10 +0000 amd64: be more precise when enabling the AlderLake small core PCID workaround Tested by: pho (cherry picked from commit a2c08eba43a2c0ebeac7117f708fb9392022a300) --- sys/amd64/amd64/initcpu.c | 35 ++++++++++++++++++++++------------- sys/amd64/amd64/machdep.c | 8 ++++++++ sys/amd64/amd64/pmap.c | 3 --- sys/amd64/include/md_var.h | 1 + 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 08385d3095d0..cddf8502437e 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -247,6 +247,26 @@ cpu_auxmsr(void) return (PCPU_GET(cpuid)); } +void +cpu_init_small_core(void) +{ + u_int r[4]; + + if (cpu_high < 0x1a) + return; + + cpuid_count(0x1a, 0, r); + if ((r[0] & CPUID_HYBRID_CORE_MASK) != CPUID_HYBRID_SMALL_CORE) + return; + + PCPU_SET(small_core, 1); + if (pmap_pcid_enabled && invpcid_works && + pmap_pcid_invlpg_workaround_uena) { + PCPU_SET(pcid_invlpg_workaround, 1); + pmap_pcid_invlpg_workaround = 1; + } +} + /* * Initialize CPU control registers */ @@ -255,7 +275,6 @@ initializecpu(void) { uint64_t msr; uint32_t cr4; - u_int r[4]; cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { @@ -319,18 +338,8 @@ initializecpu(void) (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) wrmsr(MSR_TSC_AUX, cpu_auxmsr()); - if (cpu_high >= 0x1a) { - cpuid_count(0x1a, 0, r); - if ((r[0] & CPUID_HYBRID_CORE_MASK) == - CPUID_HYBRID_SMALL_CORE) { - PCPU_SET(small_core, 1); - if (pmap_pcid_enabled && - pmap_pcid_invlpg_workaround_uena) { - PCPU_SET(pcid_invlpg_workaround, 1); - pmap_pcid_invlpg_workaround = 1; - } - } - } + if (!IS_BSP()) + cpu_init_small_core(); } void diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index cfe7e2518e58..3c365b5d6e62 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1352,6 +1352,14 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) pmap_pcid_enabled = 0; } + /* + * Now we can do small core initialization, after the PCID + * CPU features and user knobs are evaluated. + */ + TUNABLE_INT_FETCH("vm.pmap.pcid_invlpg_workaround", + &pmap_pcid_invlpg_workaround_uena); + cpu_init_small_core(); + link_elf_ireloc(kmdp); /* diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index e990ed0b93af..facbc6d3dd81 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2524,9 +2524,6 @@ pmap_init(void) VM_PAGE_TO_PHYS(m); } } - - TUNABLE_INT_FETCH("vm.pmap.pcid_invlpg_workaround", - &pmap_pcid_invlpg_workaround_uena); } SYSCTL_UINT(_vm_pmap, OID_AUTO, large_map_pml4_entries, diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 53139711bbff..c8610f495bfe 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -66,6 +66,7 @@ void amd64_bsp_ist_init(struct pcpu *pc); void amd64_syscall(struct thread *td, int traced); void amd64_syscall_ret_flush_l1d(int error); void amd64_syscall_ret_flush_l1d_recalc(void); +void cpu_init_small_core(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); void flush_l1d_sw_abi(void); From nobody Fri Jan 20 03:23:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG73THKz30vrw; Fri, 20 Jan 2023 03:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG70gD4z3pF3; Fri, 20 Jan 2023 03:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pahgU0hMgRco8aZRhDyzNnu8U4gcQuPJml38c1cbUx4=; b=sr7U0crWJXQdR1yHSKy17LJnrfO3PKqedrek4SLrc7OBtDQRfLVlK4ZwZCsbqUrCxP5pWX ySO5h2LEVU6GDr5te3+lOI4yjt606RetqhBHmnMqDUdWQn0wLNxfC8UZHwAHGyEVjlsJtD CPKdy0g7hE2f03q+zVzks25gQgfpQ5ZXtHIwxgLKPyCN4AJNE5O7sydELv+Br4UlZt/30B YgfG/j9icD+TZem6vh5OzU2Q93Oxa/2EBfmncSi6LUGtbhHiA0v0l+47JZ33te8ihBlYXi 9NUJqC/ad/FsECEK1eMaGwy6zCuHJtegFdGFRYPiO3PTRJ3XWrOtKASjeIz/7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pahgU0hMgRco8aZRhDyzNnu8U4gcQuPJml38c1cbUx4=; b=rzsDSVJ+hIDPMTUf02amt/slXQK6sFevZD/F1Bw32/FMkvFYKbwch5Tri+2MFhYkd6irnb I8mWCl3aKcFx/0J0HnBo19zxMMiPfozm5h5RnCxCpWQThnnJcgSGU0xOZKiMq9IDkTeOmP 59jd1TTj5Fd/BIeTfFmF1ACDkTR/wtJoMZU3bPx067meT13/i8RYPLeLAtDOtvUuSYkfFY CbLf9bjx2O0ECAVP6Q+bqpkE9YYEXQj4EsLr8j/DX2Cz6BWOKhANcN2pvVmkiaJpam65g5 JOKzm4eNkChJRyK770+vG4+417r43zPlc3J4cMA3jWs/22NyCTMCAIOSz2n/Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185039; a=rsa-sha256; cv=none; b=ZK7liFZ13UjVUx1F2518rJ1zGL3xHL3cPazohSjxHqrQ3Ky6kaiVeMHyRz+VKrnak2wY8v vjjl8AXHze6l9T14WCpeUwgAc/gkAOXQTNQ3dOfxY12M0d87gwnUhk68Di4gYLXQjZuwHV yjxjUCeGjrHN9F1Jk4p61WRBYz+pMjGO3eUYMkOMetHE7LJobdr2TCtA0h12aGjWEKAdm+ uyNxavwI3MQXV0WuDljSSSxOckga8fjTIbdxFQF+6+qMjA6SvzeAKggD6bUzNVutKuSjDF 7x2J2MKfFky0XlV6ZgPSyNQFL7Vbqh1Mad6d5TadgH9PCdelQgIaBZxVq9SWcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG66v1MzFyv; Fri, 20 Jan 2023 03:23:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NwMA042902; Fri, 20 Jan 2023 03:23:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NwZ2042901; Fri, 20 Jan 2023 03:23:58 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:58 GMT Message-Id: <202301200323.30K3NwZ2042901@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: 2e6132536f70 - stable/13 - amd64 pmap.h: make it easier to use the header for other consumers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 2e6132536f703a56648def0b9007c1506dccd9cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2e6132536f703a56648def0b9007c1506dccd9cd commit 2e6132536f703a56648def0b9007c1506dccd9cd Author: Konstantin Belousov AuthorDate: 2023-01-04 10:31:16 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:22:17 +0000 amd64 pmap.h: make it easier to use the header for other consumers Tested by: pho (cherry picked from commit ad97b9bbfccdb36f17788033903b1dbf508fcb96) --- sys/amd64/include/pmap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 7b86f9e139e1..0faee81a67c5 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -548,6 +548,7 @@ pmap_invalidate_cpu_mask(pmap_t pmap) return (&pmap->pm_active); } +#if defined(_SYS_PCPU_H_) && defined(_MACHINE_CPUFUNC_H_) /* * It seems that AlderLake+ small cores have some microarchitectural * bug, which results in the INVLPG instruction failing to flush all @@ -565,6 +566,7 @@ pmap_invlpg(pmap_t pmap, vm_offset_t va) invlpg(va); } } +#endif /* sys/pcpu.h && machine/cpufunc.h */ #endif /* _KERNEL */ From nobody Fri Jan 20 03:24:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG83KChz30vmp; Fri, 20 Jan 2023 03:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG81lrXz3pFQ; Fri, 20 Jan 2023 03:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=snIIuZ+APLEhima/bk5YYSL0liOeNsABEDHJ/eX4hQs=; b=LEbqHdIlNkJiZVH+vyMf+p+RnIgdsawSimVrl9f8Kt0C7/tcVMzQk0HD0MxsSNcGmg8hTJ xSUiuBalNqYlww04Rk8o9e4FUfNzOaVQDuYNqgECIe+NzuuBvYaFtwuMe8Z/tFp/N8WFTd N7+tiPIIHCG8KJFexGnHc/kkdmT2eygL3Upnsdx5knA7AQrCLmeBI3NzmGYCiCfznUrPI7 tKRx4A/5LzOjWt7bHEtjHAtpAFqFUh3rOHk/qwpPa+TQFtZqau/LdzbN70Zh97d6oJ/SLY N67ZyhObraeikmm0TGu0L7WJz6+bIdAMLe8aZL7c4mcH4PbXx8TjXLXizwHkoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=snIIuZ+APLEhima/bk5YYSL0liOeNsABEDHJ/eX4hQs=; b=KjXDzvgXCti6/qFTHTDzoDvA0lAvGPh+ylt3emjqn61hePpUBYAxuaxCdJiSxYcQzjH02T 1dsp+P3tmtczki+L600YJ9MAlaw1ZefMpg1vqeoqfFggZG7y+SNis+CFy+jWV0vIxtTejp Rtyw5aB8zXy2DzwuFjKi7FN30IeAWBnXoBd/17DaqnlEes3/ds2eJCO1PwPcyxNLLeJFQQ LmGyciKcxB77qT1mSxTYQunUxmLCVHqQ+fyHaFxquJJFKpGrZqK3/y5dHba7JBPFSUZKns hOKedeWcK8U0smyi8CRohu8NZ7gqnwSqyc2lWdezlQhuURkmcvKvHO8vB0TSEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185040; a=rsa-sha256; cv=none; b=ZEbTWcbp1lDiCKCcSwDopfBjFY4d4KkaRiAXUgp8sWLhERW02swwQe6KqRtTfOd5iV/WED IKXPYKCuni1NwjbhaLSoonrqsTxlEQJGRUoNIOXhCJICWpCxk/Ix5PAzbiqPbJ7GZDLL99 4xMu6+1UmXgcibrDCRAeeN3ly2/ad7fujgA/9CsrNSuBL+mVlDVbp6LZhi5cvfI9/mdlY1 d9czbY55O5y/EphJuAZB6OXke03CFHrAu7TPxYebmq+yUL+ZlvjxoWsjdZpEW1XL9nf/jk IW0QAJCp0KoBpQdtmeN4QC8o3aQMnKYYzOOdeoVttPtRX63+kxyW91jK7cgE/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 4NylG80jvtzFf3; Fri, 20 Jan 2023 03:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3O0ZV042930; Fri, 20 Jan 2023 03:24:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3O0mo042929; Fri, 20 Jan 2023 03:24:00 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:24:00 GMT Message-Id: <202301200324.30K3O0mo042929@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: 99dcb59a67c2 - stable/13 - i386: print trampoline disposition value for verbose boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 99dcb59a67c269df380b3b0474ddf91a898d4d34 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=99dcb59a67c269df380b3b0474ddf91a898d4d34 commit 99dcb59a67c269df380b3b0474ddf91a898d4d34 Author: Konstantin Belousov AuthorDate: 2023-01-06 18:18:51 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:22:26 +0000 i386: print trampoline disposition value for verbose boot Tested by: pho (cherry picked from commit 29bfaf1c6d8bc0a06aaa7e09363544769eade3c0) --- sys/i386/i386/machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 22a40a4151c3..27a323bce62a 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1654,6 +1654,8 @@ machdep_init_trampoline(void) /* Re-initialize new IDT since the handlers were relocated */ setidt_disp = trampoline - start_exceptions; + if (bootverbose) + printf("Trampoline disposition %#zx\n", setidt_disp); fixup_idt(); r_idt.rd_limit = sizeof(struct gate_descriptor) * NIDT - 1; From nobody Fri Jan 20 03:24:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NylG954c1z30vpd; Fri, 20 Jan 2023 03:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NylG92ZKxz3pMj; Fri, 20 Jan 2023 03:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T1LQVm2Ts+HzcN4C9OL9fQTcQ1xSofDUMSTliIrP2lM=; b=U8Vth8TK5s0QHjjjwh+AO36AK2q68yzjDi4db/EWUH20/ruiWXievJIsZqHr8rPFFKXDHx jmMw7vEMAxyRUUMJhIH1fssx3UMgeEc+6C3xqHjaS4Dz88Er+lHQ+o1OU1dwLExnRk5aLT eHbc4p1W1RDYh3zvxQS4GaI9UnBImWtTOFXuxyqmrTKTNG2c2WLv8Q596PGZXH9fC5EKYj Mkenmpsh0KTQG8bKfbCY67NWvHAyWTUyeAIHiwpgTHPbY7FZiJ1JeRp7fsXVgP237fqR7v +ybOYYET5/msc4LlnAvZaowPiJWxU++UZaZP1UZc0CyM9DQkoX1TZSeCG8ciwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T1LQVm2Ts+HzcN4C9OL9fQTcQ1xSofDUMSTliIrP2lM=; b=BzUjRaJxswMalGx3KwQBeicL62rjzlnzZgC6FPv9oD1k3D+4b8Cm/EP6i/6I8ORgU742MI QQkVGD69al7HG37A5twITzFQBwipf6iThLmoxtgAvNBQzShtlv1nxu+evz00HOOVeiKN7i LvvEMqB9QMYeC9HuBmsmvu0t5yVc1xLb8fvcAqvzLi3B4pxLpM667q/hrtFTFCuSZt7v3B gJixr6y5f35eWk8umRNQOGFS7KpqnX10MdEnWL69J3ZgfWSyKrwefwPraLANVQGPP5DxVC 5h/ba2t+ogMsX7Fz9JkX/lkgLTEAVRRHwEBCFRzLyQ3ecU+VTTOK4i78Ure9Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185041; a=rsa-sha256; cv=none; b=MVB2TAyvV7+3aeEhtWmy+PG4OV8wV17ZW32ORflKFixt8KQ1CP4Enb16dCfO1asv80heZV A9jjdsyw7uA+whPPmV//h5EGqTyhdiHIcOAnrGkl10C/kU3PoA/KDA8COdfzNoR+pRoTDy Y24xC5SIVsQtmmTp2RFnO/koAyjA5JVJSDPfb1De2WNejSH+lW7MZa8iu2wU95hEzcfNrN 8RHE5BUt0LCamIqT5FwEpo3cY1gxfWyyKQsgTCvcEDQ7a8N725oLS38+MiNIG6jZlG7uiY s3EeaFwmUrRwRb1pSgslM+Q235p+S5yJIlEqB4VkPNlXa3bRBjiEFzywCzxW7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NylG91h5TzFyw; Fri, 20 Jan 2023 03:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3O1SI042954; Fri, 20 Jan 2023 03:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3O1jp042953; Fri, 20 Jan 2023 03:24:01 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:24:01 GMT Message-Id: <202301200324.30K3O1jp042953@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: 9b9f054e7398 - stable/13 - Stop cleaning MNT_LOCAL on unmount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 9b9f054e739887d18f2f5985d91ba5b954ad4a6a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9b9f054e739887d18f2f5985d91ba5b954ad4a6a commit 9b9f054e739887d18f2f5985d91ba5b954ad4a6a Author: Konstantin Belousov AuthorDate: 2023-01-06 16:38:44 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:22:32 +0000 Stop cleaning MNT_LOCAL on unmount Tested by: pho (cherry picked from commit 1d9f3a37eb20305bfdd67788cfac5c51938226a4) --- sys/fs/cd9660/cd9660_vfsops.c | 3 --- sys/fs/ext2fs/ext2_vfsops.c | 3 --- sys/fs/msdosfs/msdosfs_vfsops.c | 3 --- sys/fs/smbfs/smbfs_vfsops.c | 3 --- sys/fs/tmpfs/tmpfs_vfsops.c | 4 ---- sys/fs/udf/udf_vfsops.c | 4 ---- sys/ufs/ffs/ffs_vfsops.c | 3 --- 7 files changed, 23 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 5d475bec93b8..6fd89be0f8c8 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -527,9 +527,6 @@ cd9660_unmount(mp, mntflags) dev_rel(isomp->im_dev); free(isomp, M_ISOFSMNT); mp->mnt_data = NULL; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); return (error); } diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index 74a7a08128b4..e35b989c285b 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -1056,9 +1056,6 @@ ext2_unmount(struct mount *mp, int mntflags) free(fs, M_EXT2MNT); free(ump, M_EXT2MNT); mp->mnt_data = NULL; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); return (error); } diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index cbfb0aead8b7..d7efa103581b 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -872,9 +872,6 @@ msdosfs_unmount(struct mount *mp, int mntflags) lockdestroy(&pmp->pm_checkpath_lock); free(pmp, M_MSDOSFSMNT); mp->mnt_data = NULL; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); return (error); } diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index d19816a7869c..c27b62693d7a 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -299,9 +299,6 @@ smbfs_unmount(struct mount *mp, int mntflags) mp->mnt_data = NULL; SMB_UNLOCK(); free(smp, M_SMBFSDATA); - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); out: smbfs_free_scred(scred); return error; diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 19d67b79c2e3..883cdd060ce6 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -536,10 +536,6 @@ tmpfs_unmount(struct mount *mp, int mntflags) tmpfs_free_tmp(tmp); vfs_write_resume(mp, VR_START_WRITE); - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); - return (0); } diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 132f4e7703d7..502d927ac0fe 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -542,10 +542,6 @@ udf_unmount(struct mount *mp, int mntflags) free(udfmp, M_UDFMOUNT); mp->mnt_data = NULL; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); - return (0); } diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 754a6bedee13..8e719516b9ce 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1482,9 +1482,6 @@ ffs_unmount(struct mount *mp, int mntflags) free(ump->um_fsfail_task, M_UFSMNT); free(ump, M_UFSMNT); mp->mnt_data = NULL; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); if (td->td_su == mp) { td->td_su = NULL; vfs_rel(mp); From nobody Fri Jan 20 07:37:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyrvC5Dssz2smmg for ; Fri, 20 Jan 2023 07:37:59 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-256)) (Client CN "mailgate.leidinger.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyrvC3K8wz4Lnn for ; Fri, 20 Jan 2023 07:37:59 +0000 (UTC) (envelope-from Alexander@leidinger.net) Authentication-Results: mx1.freebsd.org; none Received: from outgoing.leidinger.net (p5b165a22.dip0.t-ipconnect.de [91.22.90.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) client-signature ECDSA (P-256)) (Client CN "outgoing.leidinger.net", Issuer "R3" (verified OK)) by mailgate.Leidinger.net (Postfix) with ESMTPSA id 8F94923202 for ; Fri, 20 Jan 2023 08:37:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leidinger.net; s=outgoing-alex; t=1674200274; 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=CPE0iRKVry8n9XavKPzVVn1P6Mjw7rPajLOjnKTjO/Y=; b=LWpxKCFG5wkxBvb0DILkQ6xtsaAk5JRSVZzRvk6UBbTQQRs73JObcpeZlFm/gAb6cjy+q5 cqDKeHdwMaJbrAyNTPGCZVkTQ8sYrU0Thz+7U6WnPBdHQKmWuQzmyWGV8kNUng1qUxAzVZ P/v6Jk0T8oDQY3ld4AqEoanLYo18vtU6olNDxuvRbnlaWhnjCMpx+0KCjF3x13gA2IUJZg Ia1oVkjXxiU/nTP9XrRb2Unm5QJIohkCQDEnZgFEXRKqabcpZn2bsdsORf+OaJq/7m+AZS 6qKzWQZ8d8sI3Q9gCz5Q5/NNr4zEuVEpYV2FAqbAvRfGbb6wm1mgoNNFHOA3FQ== Received: from webmail.leidinger.net (localhost [127.0.0.1]) by outgoing.leidinger.net (Postfix) with ESMTP id 2A0F5AE36 for ; Fri, 20 Jan 2023 08:37:22 +0100 (CET) Received: from www (uid 80) (envelope-from Alexander@leidinger.net) id 97a64 by webmail.leidinger.net (DragonFly Mail Agent v0.13+ on webmail.leidinger.net); Fri, 20 Jan 2023 08:37:21 +0100 Date: Fri, 20 Jan 2023 08:37:21 +0100 Message-ID: <20230120083721.Horde.w2KDmblCBL6A2zxfE-TrZbB@webmail.leidinger.net> From: Alexander Leidinger To: Alan Somers Cc: "Danilo G. Baio" , dev-commits-src-all@freebsd.org Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> In-Reply-To: Accept-Language: de,en Content-Type: multipart/signed; boundary="=_KFNq1ig_f1GyIqzBxHmZVg6"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 X-Rspamd-Queue-Id: 4NyrvC3K8wz4Lnn X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:34240, ipnet:89.238.64.0/18, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N This message is in MIME format and has been PGP signed. --=_KFNq1ig_f1GyIqzBxHmZVg6 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Alan Somers (from Thu, 19 Jan 2023=20=20 10:11:38=20-0700): > Ugh, it looks like kldload(2) is doing the privilege check before the > file existence check. I'm not sure of the best solution: > * Change kern_kldload to check for file existence first. This would > ring some alarm bells among security folks, and it isn't totally easy > to do, either. > * Change ifconfig(8) to do an existence check of its own. This=20=20 >=20would be ugly. > * Change ifconfig(8) so that it doesn't attempt to load modules when > just listing an interface. This might be incomplete, but is probably > worth doing anyway. Isn't this affecting all ifconfig operations in a _vnet_ jail, not=20=20 only=20listing an interface? Would it be sensible to revert the commit until there is a solution? From a quick look I have the impression it makes sense to set noload=20=20 to=20true in a jail (in that case ifmaybeload returns and the problem=20=20 should=20go away). Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_KFNq1ig_f1GyIqzBxHmZVg6 Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmPKRLAACgkQEg2wmwP4 2Ib3Jg/9FLJN2CnlKXnOFCLS4cyuU7INZVDbJDO9kT1p44jrfr/AWNfwXZhAVSY9 O6YGVHkgducA08tjHCJdg9ERfXPGXs0uve6WjcTEcBySBp8H1AvNHvxTS/2Ot/da 9qmeKOVDPgDEl3CEAB4jTlB/Khow7S8grF5iAYXD5jQw3QaVmydgj/RGh5/Eeliq zsZHxFxKjcxtF1m6+DO3OZcWaROhppoNJGasqMLHeP8VQuaX8KTs8VOIqGw6+hzX eNnd6+dt65pxuoQnjN3WXWoYgeBoJFVPdsMSc+OTij2QCM78tznURK4guw0C1VTP qNiFrZ9YPzRZq4SzVO3KEGmt80roYMzmo8ZIK80C/5WOddAJuXkbkH5NYiPhJkGX GvhAaXw6Pfhb9800wb7t2wVAx3H2f/R/FDzcg/8Me1vpRwcY4AGGRSUwt+sAxVV7 xBQHv3JrR5MgOsiKohqOFLO86XqrJpEjbXTqHCX9N0mlgguPIyLPL4EwLdewkFXN hqBfgs6pu9B1EAx1NflkDfMswmrwIcJDHXzvW4ZFKrIDSGNt4q8wkXI80IDurux1 +mXM++Mh7OD/2gIDajApN5mrb09Ei8D5PwItq47vgo0UpLJcHJPFeD7SvLEpqjGz TJrXjBOLVEbIO1NjsBTfay1UhJg5FgGG2VClXtwwK5y1Dg93jTM= =qXXz -----END PGP SIGNATURE----- --=_KFNq1ig_f1GyIqzBxHmZVg6-- From nobody Fri Jan 20 10:48:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nyx6Z66pqz2twr4; Fri, 20 Jan 2023 10:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nyx6Z5MrGz3HgB; Fri, 20 Jan 2023 10:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674211686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T1pWYdqcY0Xs8tF6nJ+4s+2AbPgxvD1rvzrG7YIVFJ0=; b=NSzrbN2YAkCfrgv2+1efbDvOLxUA5Zovh8MculUjgWLlQdHxcpqTVhcf6daNE4iBP2ab79 z7D1uAxy7yRoBheHZhip/FqU22mf6lYD1BUJh8jL5cbeHU0OCxCCaXsgCaGYlEQZM3DkV3 MLLjAE/VKdmvvuE7sbiHxm1PI6p18LTZ6+/DSjpUpatMJvgrfZ35VfBP8grW3XY8teAgsE 9YBli4mxAdj2KxgoCyJ380TGp36pwil7I/FC+G3LZE8nKE/jueJMO1FBFQMaawMIyixCoi t2ulT+DQAGsMhV6xOL/rO8neBlPeICBbDy/PxVEDWQU9x/n0buLobQ5Y91hnhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674211686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T1pWYdqcY0Xs8tF6nJ+4s+2AbPgxvD1rvzrG7YIVFJ0=; b=ciwRV9S74I6HpITLXNcpaWCEFYENc7c9jznz1IkBewzHfHFxSXB4KWw7lT9TKiGoxLAflD 4nhMaIb7g2W1irD5eKhF3fco1MBcUK3xSm2AlqW1WGCdRz8/APOnPbh7EYXs1p/92rBqWy +OWzVne0fvLzvzOkbE3AspP6LsE64PnxfJMuFt679E7hsHQOiPLDZekMUMYlt6uMem+TKw znUV3GWNG/8/+45V4IfQ4/OSrLj+52r4i046LfUILQlrha0nE4LgMgP8Vn6JYBIgFcdPBB MaOxeDlpKeaj4Og/ijuWaeUIknQmlJPAlxvYPXyWLn7+vnQ8xf9R8fI6ctqEIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674211686; a=rsa-sha256; cv=none; b=abjKBZST6+Nf8J/BtM11lUIkP2fr/jw3nxu/z1SyLB0cThIQ9GUbUb4DN/AmUciwTRZQ1p a/2sEMIBjMFm8krtXZYrxLT2FI03WjW+YiofBdLtCvH7dRYRMq6Jpe1KstVhmTGviigutx Wq9t9ytI/40KBwAA3MuV+LECaDIEz1WUULVo8s+FIKlOfVt+oNrDYjptTbjy4QRi5kdg/L 18amqXMVCQV1pQZEPg4vVSTP5m2ALMR7dE//XGmbqi0KtQyR7Gv4EYSzWn+qxn0iPaPai7 jxKy29SybxtKE86nIbqffD7QrynZ1JrbpM1XxSi4Vvv4ER5Hk55yryHLtXnFUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nyx6Z4K4TzSQn; Fri, 20 Jan 2023 10:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KAm6rk070888; Fri, 20 Jan 2023 10:48:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KAm6lx070887; Fri, 20 Jan 2023 10:48:06 GMT (envelope-from git) Date: Fri, 20 Jan 2023 10:48:06 GMT Message-Id: <202301201048.30KAm6lx070887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 34ac629b40e6 - main - Shell-escape assignments to PATH in the top-level makefiles List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34ac629b40e68e5394fe0a27e47c73a875d9f8cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=34ac629b40e68e5394fe0a27e47c73a875d9f8cb commit 34ac629b40e68e5394fe0a27e47c73a875d9f8cb Author: Alex Richardson AuthorDate: 2023-01-20 10:47:17 +0000 Commit: Alex Richardson CommitDate: 2023-01-20 10:47:17 +0000 Shell-escape assignments to PATH in the top-level makefiles Since 16fbf0191243e7c9dff6615b1424b5d39186b36c PATH is no longer set to a hardcoded value on non-FreeBSD build hosts, so we can end up with spaces in $PATH. Instead of only escaping PATH I updated all `env PATH=` uses in the toplevel makefile. While many of these currently can't contain any special characters (since the build would have failed already), in theory this gets us closer to allowing build/source directory to contain e.g. spaces. --- Makefile | 6 +++--- Makefile.inc1 | 46 +++++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 62d2869bfc03..2860b31a043c 100644 --- a/Makefile +++ b/Makefile @@ -224,7 +224,7 @@ META_TGT_WHITELIST+= \ PATH= /sbin:/bin:/usr/sbin:/usr/bin .endif MAKEOBJDIRPREFIX?= /usr/obj -_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ +_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH:Q} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ SRCCONF=${SRCCONF} SRC_ENV_CONF= \ -f /dev/null -V MAKEOBJDIRPREFIX dummy @@ -267,7 +267,7 @@ SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk .endif -_MAKE= PATH=${PATH} MAKE_CMD="${MAKE}" ${SUB_MAKE} -f Makefile.inc1 \ +_MAKE= PATH=${PATH:Q} MAKE_CMD="${MAKE}" ${SUB_MAKE} -f Makefile.inc1 \ TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} ${_MAKEARGS} .if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" @@ -595,7 +595,7 @@ universe-toolchain: .PHONY universe_prologue @echo "> Toolchain bootstrap started on `LC_ALL=C date`" @echo "--------------------------------------------------------------" ${_+_}@cd ${.CURDIR}; \ - env PATH=${PATH} ${SUB_MAKE} ${JFLAG} kernel-toolchain \ + env PATH=${PATH:Q} ${SUB_MAKE} ${JFLAG} kernel-toolchain \ TARGET=${MACHINE} TARGET_ARCH=${MACHINE_ARCH} \ OBJTOP="${HOST_OBJTOP}" \ WITHOUT_SYSTEM_COMPILER=yes \ diff --git a/Makefile.inc1 b/Makefile.inc1 index 112f335d7c11..1396a8e7a172 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -697,7 +697,7 @@ BOOTSTRAPPING_OSRELDATE?=${OSRELDATE} # bootstrap-tools stage BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \ - PATH=${BPATH}:${PATH} \ + PATH=${BPATH:Q}:${PATH:Q} \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" # need to keep this in sync with targets/pseudo/bootstrap-tools/Makefile @@ -765,7 +765,7 @@ XMAKE= ${BMAKE} \ # kernel-tools stage KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ - PATH=${BPATH}:${PATH} \ + PATH=${BPATH:Q}:${PATH:Q} \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" @@ -792,13 +792,13 @@ KTMAKE= ${TIME_ENV} \ # world stage WMAKEENV= ${CROSSENV} \ INSTALL="${INSTALL_CMD} -U" \ - PATH=${TMPPATH} \ + PATH=${TMPPATH:Q} \ SYSROOT=${WORLDTMP} # make hierarchy -HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} +HMAKE= PATH=${TMPPATH:Q} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} .if defined(NO_ROOT) -HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT +HMAKE+= PATH=${TMPPATH:Q} METALOG=${METALOG} -DNO_ROOT .endif CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \ @@ -909,12 +909,12 @@ IMAKEENV= ${CROSSENV} IMAKE= ${TIME_ENV} ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ ${IMAKE_INSTALL} ${IMAKE_MTREE} .if empty(.MAKEFLAGS:M-n) -IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ - LD_LIBRARY_PATH=${INSTALLTMP} \ +IMAKEENV+= PATH=${STRICTTMPPATH:Q}:${INSTALLTMP:Q} \ + LD_LIBRARY_PATH=${INSTALLTMP:Q} \ PATH_LOCALE=${INSTALLTMP}/locale IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh .else -IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} +IMAKEENV+= PATH=${TMPPATH:Q}:${INSTALLTMP:Q} .endif # When generating install media, do not allow user and group information from @@ -1023,7 +1023,7 @@ _worldtmp: .PHONY # so we remove that assingnment from $WMAKE and prepend the new $PATH ${_+_}@if [ -e "${WORLDTMP}" ]; then \ echo ">>> Deleting stale files in build tree..."; \ - cd ${.CURDIR}; env PATH=${TMPPATH}:${PATH} ${WMAKE:NPATH=*} \ + cd ${.CURDIR}; env PATH=${TMPPATH:Q}:${PATH:Q} ${WMAKE:NPATH=*} \ -DBATCH_DELETE_OLD_FILES delete-old \ delete-old-libs >/dev/null; \ fi @@ -1367,7 +1367,7 @@ MTREE_MAGIC?= mtree 2.0 distributeworld installworld stageworld: _installcheck_world .PHONY mkdir -p ${INSTALLTMP} progs=$$(for prog in ${ITOOLS}; do \ - if progpath=`env PATH=${TMPPATH} which $$prog`; then \ + if progpath=`env PATH=${TMPPATH:Q} which $$prog`; then \ echo $$progpath; \ else \ echo "Required tool $$prog not found in PATH ($$PATH)." >&2; \ @@ -1442,7 +1442,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY .endif .endfor -mkdir ${DESTDIR}/${DISTDIR}/base - ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH:Q} ${MAKE} \ METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \ LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs @@ -1452,7 +1452,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY ${IMAKEENV} rm -rf ${INSTALLTMP} .if !make(packageworld) && ${MK_CAROOT} != "no" @if which openssl>/dev/null; then \ - PATH=${TMPPATH}:${PATH} \ + PATH=${TMPPATH:Q}:${PATH:Q} \ sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} rehash; \ else \ echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."; \ @@ -1537,7 +1537,7 @@ sysent: .PHONY .for _dir in ${_sysent_dirs} sysent-${_dir}: .PHONY @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent" - ${_+_}@env PATH=${_sysent_PATH} ${MAKE} -C ${.CURDIR}/${_dir} sysent + ${_+_}@env PATH=${_sysent_PATH:Q} ${MAKE} -C ${.CURDIR}/${_dir} sysent sysent: sysent-${_dir} .endfor @@ -1585,10 +1585,10 @@ redistribute: .MAKE .PHONY .endif distrib-dirs distribution: .MAKE .PHONY - ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH:Q} ${MAKE} \ ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET} .if make(distribution) - ${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH} \ + ${_+_}cd ${.CURDIR}; ${CROSSENV} PATH=${TMPPATH:Q} \ ${MAKE} -f Makefile.inc1 ${IMAKE_INSTALL} \ METALOG=${METALOG} MK_TESTS=no \ MK_TESTS_SUPPORT=${MK_TESTS_SUPPORT} installconfig @@ -1696,7 +1696,7 @@ buildkernel: .MAKE .PHONY @echo ">>> stage 1: configuring the kernel" @echo "--------------------------------------------------------------" cd ${KRNLCONFDIR}; \ - PATH=${TMPPATH} \ + PATH=${TMPPATH:Q} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ -I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \ '${KERNCONFDIR}/${_kernel}' @@ -1763,7 +1763,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY @echo ">>> Installing kernel ${INSTALLKERNEL} on $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ - ${CROSSENV} PATH=${TMPPATH} \ + ${CROSSENV} PATH=${TMPPATH:Q} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C date)" @@ -1775,7 +1775,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY @echo ">>> Installing kernel ${_kernel} $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ - ${CROSSENV} PATH=${TMPPATH} \ + ${CROSSENV} PATH=${TMPPATH:Q} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)" @@ -1795,7 +1795,7 @@ distributekernel distributekernel.debug: .PHONY .endif ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ - ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ + ${IMAKE_MTREE} PATH=${TMPPATH:Q} ${MAKE} KERNEL=${INSTKERNNAME} \ DESTDIR=${INSTALL_DDIR}/kernel \ ${.TARGET:S/distributekernel/install/} .if defined(NO_ROOT) @@ -1810,7 +1810,7 @@ distributekernel distributekernel.debug: .PHONY .endif ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ - ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \ + ${IMAKE_MTREE} PATH=${TMPPATH:Q} ${MAKE} \ KERNEL=${INSTKERNNAME}.${_kernel} \ DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \ ${.TARGET:S/distributekernel/install/} @@ -3405,7 +3405,7 @@ DTBOUTPUTPATH= ${.CURDIR} # Build 'standalone' Device Tree Blob # builddtb: .PHONY - @PATH=${TMPPATH} MACHINE=${TARGET} \ + @PATH=${TMPPATH:Q} MACHINE=${TARGET} \ sh ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} @@ -3502,8 +3502,8 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} CDTMP= ${OBJTOP}/${XDDIR}/tmp -CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${CDMAKEARGS} ${NOFUN} -CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} \ +CDMAKE=${CDENV} PATH=${CDTMP:Q}/usr/bin:${PATH:Q} ${MAKE} ${CDMAKEARGS} ${NOFUN} +CD2MAKE=${CD2ENV} PATH=${CDTMP:Q}/usr/bin:${XDDESTDIR:Q}/usr/bin:${PATH:Q} \ ${MAKE} ${CD2MAKEARGS} ${NOFUN} .if ${MK_META_MODE} != "no" # Don't rebuild build-tools targets during normal build. From nobody Fri Jan 20 11:04:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyxTn6b9Cz2tyqN for ; Fri, 20 Jan 2023 11:04:45 +0000 (UTC) (envelope-from melifaro@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyxTn5xPtz3KFj; Fri, 20 Jan 2023 11:04:45 +0000 (UTC) (envelope-from melifaro@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674212685; 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=OuiYCb1ZOtJGwbifDgyW9ghl/QLRIF/opYMoHbTB/Dw=; b=G9YjJstSmX3u/Q5Gz11r3GpqbxC7bjpnivL2xJN3UYebELnLt6YqetdkOWau1pcDxyIGA7 RCvMPRn86IrusP1ZDHeJW+J+oxigUJt/XdY7HPGWnFfz1WIYKvBGBxnpditSdpYNjiZ/7D Qi9ofehjOi39v3sS0L+H8sRET0HfzvWcKqZUK6x/EH3m6khYVKO8afOGVmx2anSETCum/5 B5nL9gu3971bpxWmyTfCPif2jJz3NBTMVgce0xzxXjWDG8BRJlxmX8PS/xUV3Qb74cqv5K Pv5Oki/giwGkxFns+8DCqMWLuESa1QlX2VzT9fHkXzq5L0ymUmkPlI7CkWhPQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674212685; 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=OuiYCb1ZOtJGwbifDgyW9ghl/QLRIF/opYMoHbTB/Dw=; b=IN2NUPkWVSU80y1sNyVzuw7c59CQPIAmbCbcOas5LwkZAlbGZfIqbJ/gpfDCkEHQ+O+nVn fhFQTt/n/b61U2GYcyY7uF1InOJ+VxFfSPxAgkTIhgM5wy59CTMYuz/cl66KgPbchzHPSH IEHEtFY71fbzxzarkEFP1KUbkgfEnDSYW0bnKeCmM56mE35nH/DjyaqshISJ0yEbrBqaNZ itwRhxj9QKwRECbtmYEWocTWzafeswhQMt3BBx7TsbIBWHOvFMdNOdATDqPyITCCZzcero 56lA9Bz5CHgClyN+IFmnuAokPPRhNkV1KPGKJGDOBesFALduq2Ld89THHZH9zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674212685; a=rsa-sha256; cv=none; b=mL884vwRIy8HfyHRDEJko31wvPR13ZgpQJn3qKDjKxtPRwEQqIyk6LsL/tRxvXTxaKXZQI iCPEGycAGtfo6f0bTqPGp8QemaiKLgvGSMPjIbUp+a2S6YqPFOsMDjP3QlH0Ov3+GbSL0/ 2DVQM2q2ErSDRVAZWVv4BSSHgbUutaZZUiHBoOMlY3txcTiZHZcbjyVCGM6VwubABgRh/R DuCujZzVPILpqkRgb6j+ubZddUPDwoVyzJeYNExmljq4c+pkNkd6mtktdBqR4tw0cQwI6d BI7iyuohXsa/OkG/c1tT3gnEko4YuukE6AoW/mhScguqFdBs3VfheQQpU6ApyA== Received: from smtpclient.apple (unknown [IPv6:2a02:8084:d6bb:510:2daa:c4ca:2eed:fc35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: melifaro/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NyxTn21Xqz18LJ; Fri, 20 Jan 2023 11:04:45 +0000 (UTC) (envelope-from melifaro@freebsd.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT From: Alexander Chernikov In-Reply-To: Date: Fri, 20 Jan 2023 11:04:33 +0000 Cc: "Danilo G. Baio" , dev-commits-src-all@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> To: Alan Somers X-Mailer: Apple Mail (2.3731.200.110.1.12) X-ThisMailContainsUnwantedMimeParts: N > On 19 Jan 2023, at 17:11, Alan Somers wrote: >=20 > On Thu, Jan 19, 2023 at 7:03 AM Danilo G. Baio = wrote: >>=20 >>=20 >>=20 >> On Mon, Jan 9, 2023, at 15:57, Alan Somers wrote: >>> The branch main has been updated by asomers: >>>=20 >>> URL: >>> = https://cgit.FreeBSD.org/src/commit/?id=3D2c24ad3377a6f584e484656db8390e4e= b7cfc119 >>>=20 >>> commit 2c24ad3377a6f584e484656db8390e4eb7cfc119 >>> Author: Alan Somers >>> AuthorDate: 2022-12-26 02:06:21 +0000 >>> Commit: Alan Somers >>> CommitDate: 2023-01-10 02:56:18 +0000 >>>=20 >>> ifconfig: abort if loading a module fails other than for ENOENT >>>=20 >>> If "ifconfig create" tries to load a kernel module, and the module >>> exists but can't be loaded, fail the command with a useful error >>> message. This is helpful, for example, when trying to create a = cloned >>> interface in a vnet jail. But ignore ENOENT, because sometimes = ifconfig >>> can't correctly guess the name of the required kernel module. >>>=20 >>> MFC after: 2 weeks >>> Reviewed by: jhb >>> Differential Revision: https://reviews.freebsd.org/D37873 >>> --- >>> sbin/ifconfig/ifconfig.c | 18 +++++++++++++----- >>> 1 file changed, 13 insertions(+), 5 deletions(-) >>>=20 >>> diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c >>> index 462d543125c4..120207a6927e 100644 >>> --- a/sbin/ifconfig/ifconfig.c >>> +++ b/sbin/ifconfig/ifconfig.c >>> @@ -1719,11 +1719,19 @@ ifmaybeload(const char *name) >>> } >>> } >>>=20 >>> - /* >>> - * Try to load the module. But ignore failures, because = ifconfig can't >>> - * infer the names of all drivers (eg mlx4en(4)). >>> - */ >>> - (void) kldload(ifkind); >>> + /* Try to load the module. */ >>> + if (kldload(ifkind) < 0) { >>> + switch (errno) { >>> + case ENOENT: >>> + /* >>> + * Ignore ENOENT, because ifconfig can't infer = the >>> + * names of all drivers (eg mlx4en(4)). >>> + */ >>> + break; >>> + default: >>> + err(1, "kldload(%s)", ifkind); >>> + } >>> + } >>> } >>>=20 >>> static struct cmd basic_cmds[] =3D { >>=20 >>=20 >> Hi. >>=20 >> I have a jail with vnet where the interface is renamed that stopped = working after this. >>=20 >> from inside the jail: >>=20 >> root@test:/ # ifconfig >> lo0: flags=3D8049 metric 0 mtu 16384 >> options=3D680003= >> inet6 ::1 prefixlen 128 >> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x10 >> inet 127.0.0.1 netmask 0xff000000 >> groups: lo >> nd6 options=3D21 >> vnet0b_test: flags=3D8862 metric = 0 mtu 1500 >> options=3D8 >> ether 02:27:72:a7:28:0b >> groups: epair >> media: Ethernet 10Gbase-T (10Gbase-T ) >> status: active >> nd6 options=3D29 >>=20 >> root@test:/ # ifconfig vnet0b_test >> ifconfig: kldload(if_vnet): Operation not permitted >>=20 >>=20 >> If I don't rename the interface, that works. >>=20 >> jail.conf: >>=20 >> test { >> vnet; >> $index =3D "0"; >> vnet.interface =3D "vnet${index}b_${name}"; >> exec.prestart +=3D "ifconfig epair${index} create"; >> exec.prestart +=3D "ifconfig ${bridge} addm epair${index}a"; >> exec.prestart +=3D "ifconfig epair${index}a up name = vnet${index}a_${name}"; >> exec.prestart +=3D "ifconfig epair${index}b up name = vnet${index}b_${name}"; >> exec.poststop +=3D "ifconfig ${bridge} deletem = vnet${index}a_${name}"; >> exec.poststop +=3D "ifconfig vnet${index}a_${name} destroy"; >> devfs_ruleset =3D "11"; # add path 'bpf*' unhide (devfs.rules) >> } >>=20 >> That's a bit odd, I know, could be using description instead. >>=20 >> Just reporting. >>=20 >> Regards. >> -- >> Danilo G. Baio >=20 > Ugh, it looks like kldload(2) is doing the privilege check before the > file existence check. I'm not sure of the best solution: > * Change kern_kldload to check for file existence first. This would > ring some alarm bells among security folks, and it isn't totally easy > to do, either. > * Change ifconfig(8) to do an existence check of its own. This would = be ugly. > * Change ifconfig(8) so that it doesn't attempt to load modules when > just listing an interface. This might be incomplete, but is probably > worth doing anyway. I think another question is that if if should be done by ifconfig(8) at = all. Kernel can take care of trying to load the required modules, = checking the privileges. I=E2=80=99m considering adding such code for the netlink-based interface = creation. >=20 From nobody Fri Jan 20 11:23:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NyxvH6vYKz2v1pM; Fri, 20 Jan 2023 11:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyxvH6RzQz3Mrs; Fri, 20 Jan 2023 11:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674213803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tRCrO+maIkGoNLHKVoCImgfrzPbvZv0yOoS3gVNeDRQ=; b=QVveyOeEa/WE9DEFAgejvRSo7a8xLnc+WIFZfvEtG5rF1M4pbZMF1zrMErdI10phaQUvqZ EfL5dt/A53UAPrTGmsEgmYKfMQlPJpjccxh5a24rqKIEv44FmyeLDLnNZeNkB+giKZx2AL WNQOQkzbuosKK+9T7lq73a6prcEvRI+oCJkQ85trsI4aXn5IpB8Gu4eJajzM5fhyZOX76F Ik3j+P3bhz+rgaBAomkPFyvZeR9s5IZL5syOGg48F1BBMKjQ396bKzvrB0CAgu1EYkem0c KsYCmvgVGDFGZ9cjZlAGYivAmcqE8RqZVl+qGEgpcEnfVH4ciJ1qVKzcbOol4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674213803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tRCrO+maIkGoNLHKVoCImgfrzPbvZv0yOoS3gVNeDRQ=; b=dfN6EhuHv6pQHzXC6cS4gxJYzJ0Z/rYAu5i11x+VAOjPp/Zaa3i6a8mA4japfPbALNRFJ+ KI2ZoiTIgJncnxTEb3baugKR/Ebww+oiKRJs1ugYeqimebViZh3bl3QaDQTo/07BLsVdxT xvmoZBXGjZbPdF8U2Z5OP1W3LQT45TJ1az7TynrEmHABD6Im5S88o5PhK4tfbVAqD/kotr nnC2YameNzVnAYjzTTNZJ+6zLzA4CQY3RWaTT2aTQMCMJurzdy1+IMMwQkemVlNZWrUFGc gSN4LZ8Q7GDw45zJTvf43VtE4c7drDVICvnOkK+R901ZU8wKZO9qg9gFocSh+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674213803; a=rsa-sha256; cv=none; b=T+UhFX2f/MVQ0xpv1EZWd0DH1AXXx5jPqTMGmIAJLg63mpRTxyTVjBKNzmd3p/BEeHqDBm uP+DHnliHf9FsPwaqGQ2IvbSui5XahLWVFjhjf6haIR9HgFSYgM4fwINwbTLz4D86iwbOF nEL44we9APoDFkyGLsLTY7wSt4POc0gp7J3Dn/R0A4JMZIENw6mykkxGOlogfG2Li51tli nnV1wkPwGxKb5PA82U82ll53jofH7vBkfHMbGSlBHrFmnrVsum0g45EFolJXKR6KCB9hqd 5Qdma2ipPTs2jw3G6bPilqaQk6N6mK0XccIO946Unmo1zU9hMFs48LZsWvG/WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NyxvH5VPkzTLY; Fri, 20 Jan 2023 11:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KBNNr8028074; Fri, 20 Jan 2023 11:23:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KBNNcW028073; Fri, 20 Jan 2023 11:23:23 GMT (envelope-from git) Date: Fri, 20 Jan 2023 11:23:23 GMT Message-Id: <202301201123.30KBNNcW028073@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: 1852ca25dd2e - stable/13 - Remove merge conflict leftovers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 1852ca25dd2e8862e1f84c45a1140d1c508d0f59 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1852ca25dd2e8862e1f84c45a1140d1c508d0f59 commit 1852ca25dd2e8862e1f84c45a1140d1c508d0f59 Author: Konstantin Belousov AuthorDate: 2023-01-20 11:21:08 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 11:22:57 +0000 Remove merge conflict leftovers This is a direct commit to stable/13. Reported by: Stefan Grundmann via https://github.com/freebsd/freebsd-src/pull/639 --- tests/sys/posixshm/posixshm_test.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index a7b2e19f38af..9d5832999b9d 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -1781,13 +1781,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cloexec); ATF_TP_ADD_TC(tp, mode); ATF_TP_ADD_TC(tp, fallocate); -<<<<<<< HEAD -||||||| parent of 91ddfd352f59 (posixshm_test: add naive page accounting test) - ATF_TP_ADD_TC(tp, fspacectl); -======= - ATF_TP_ADD_TC(tp, fspacectl); ATF_TP_ADD_TC(tp, accounting); ->>>>>>> 91ddfd352f59 (posixshm_test: add naive page accounting test) ATF_TP_ADD_TC(tp, largepage_basic); ATF_TP_ADD_TC(tp, largepage_config); ATF_TP_ADD_TC(tp, largepage_mmap); From nobody Fri Jan 20 13:03:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz06s0tGnz2sTx4; Fri, 20 Jan 2023 13:03:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz06s0P61z3m64; Fri, 20 Jan 2023 13:03:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674219813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hxzF7eKcQ98BTmk5AvB3chbENOujoYI6IrjCpOgSb/0=; b=DJ/PEzTYGHjPYWS2ALbuPZ60/Hd4gru+rZsO+onFKnt8a2jDHBDor/xMFatCk4wxsb/dmC KyTmWyd5TEOh6vMJrSWnvcSQFL2JifSDMEPxzv9ySPnjkWvbJzt40lM2wmTKDPyQhzqzPz RG+NrnWxjnFg8BgecBYmnND8hULyPvfSVYNZKgbmoNiZeJ8Ci1Ob6EKHJubX1tyI3CB3MK RXC04KGNT2jQxCXTVBKVWTiwWRwHvqP9l67IrTFQISHQhg/w86ArEO4jdYPiO/lM/VriPh BqkeVoZczwVcGAbNKGgPEfttrWjfGEH1VtO1FlKz40lwkVQfj7fwYWqY0+I+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674219813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hxzF7eKcQ98BTmk5AvB3chbENOujoYI6IrjCpOgSb/0=; b=Sh8N2bAnkvvpDXBtsJW/68iUkb6H8+WHtrbU4lo2SNQBKOYlt6yh/4u9KqMhRIHHmGIQ3H h3wHtEXPvhjIg6RaCGnt7YpfbVP4nBOHDyKJrIds2RaobDFGPt8x8GuKDBA0tboRyZH5AF X7UlSWEF2bypYYTCcBLU4grDI8B6deqVLGX7Vw6bXZtoSDTNrUvjcPikW1Pi8oKDFDSejM 8NgFsiPxpjppUYdqzMGiJCS2rntCOa0VRHiDc+5HYFXydrcjN59AUrr+oOJj+cGCThheK3 BDSyXQWlyfhT8uNQKIRdFZmBIsRzyenuOVi6Z4RylN0oM6d+EG/0beqHG+37gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674219813; a=rsa-sha256; cv=none; b=l7sJKdvPqqzakjD+iPWeSWnME3/vS54+wlo+uwzv/+7wUsYtGBiked0UzJAxUSMaGYxGcD OF7ThGIWmVnJISfAPm2zF+Hxx4rK2X/OPXx8N9L2dem3t5wyQ3OX1+QGOeTMtS/gpzwqQ2 gSITHn+2YM/x4Kmg6rd8DULtf2dCv2kvgBX4YWvIBP3r4TP/HfjaPbJhnIE6u7XrNMjOPb zdse8sVMCCDuSvR0/w9RZVHZ9e8CWt3tYjfjqditXv31vusk/BmSkZcROo5mrBe29no5eT rtyLRmTjrlLxJGzisYL1gtETs56w6oZ6wI2y4XYUSY7o9m/GbOfQXkmOHHET4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz06r6YDyzWlx; Fri, 20 Jan 2023 13:03:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KD3WA9070639; Fri, 20 Jan 2023 13:03:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KD3WKr070638; Fri, 20 Jan 2023 13:03:32 GMT (envelope-from git) Date: Fri, 20 Jan 2023 13:03:32 GMT Message-Id: <202301201303.30KD3WKr070638@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: c48e46d52876 - stable/13 - tests/sys/posixshm/posixshm_test.c: Fix build for real List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: c48e46d5287688950f6e787e783ce4f51db7d39d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c48e46d5287688950f6e787e783ce4f51db7d39d commit c48e46d5287688950f6e787e783ce4f51db7d39d Author: Konstantin Belousov AuthorDate: 2023-01-20 13:02:12 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 13:03:10 +0000 tests/sys/posixshm/posixshm_test.c: Fix build for real Remove unused variables. This is a direct commit to stable/13. --- tests/sys/posixshm/posixshm_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index 9d5832999b9d..f0784f7b8769 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -992,9 +992,8 @@ ATF_TC_BODY(fallocate, tc) ATF_TC_WITHOUT_HEAD(accounting); ATF_TC_BODY(accounting, tc) { - struct spacectl_range range; struct stat st; - off_t shm_sz, len; + off_t shm_sz; size_t page_size; int fd, error; From nobody Fri Jan 20 13:24:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz0b11MlYz2sY1C for ; Fri, 20 Jan 2023 13:24:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz0b05tf6z3pGD for ; Fri, 20 Jan 2023 13:24:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x832.google.com with SMTP id g16so2021095qtu.2 for ; Fri, 20 Jan 2023 05:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rTJ8YxqRnaB6TfeBHOGppTu6kW4rNZYAGuUoy0u7phc=; b=PCUbt2cmB5f1gyLWVWvb4sUAalC1MYzDVt4H5x79WAPNAlV5RwphESP1U1OFbzSgNe ZGxSq/ODoudVUe+AWPM844fFmoqzdXZP79E+fK9T45NBgb2ac56DH6cJlTgzbDk4DEpo y4EO2Ik+KdwKtSHEiU9PQKsOtGE/I0DuARMnlmI45R0KKnuK+No8+ngMUKeadj17KLVr SySm8FoLhSNbrGPctgTd5TRfMxJl6VdP686SKJ7LRHqIV2qnHamFLx5UCbUPpLbCjrh9 FphiJpLS9Q1WqYHGhaSEt4xDDmnrgeWFLh8Ws/z8/0fRGywvMCAUoikNy8Cpa9sc/eMU d2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rTJ8YxqRnaB6TfeBHOGppTu6kW4rNZYAGuUoy0u7phc=; b=gYQKf2Wst4ldwF222yHMm5qFSNc3G/TlHMM/Of/grLdgeEy2QgNNEyOe6Oe7N7Fvez g8mvhwHJTIdXvxPP2ehH/IF1nC39J8IlGYYNqFxuafKKNKz6yr7ty4tcNvuupppJitm9 Ou7IBgnGxZ88a5NPrLkkI3mFGGKdgfffaec+p8+LMzW75YC3SNhnSk1/y1se9JQ11Puy qiVvRaSh6rpnf+MrA6plolY7nnc+zG9m9mXb2K0P7XCfwb+EBhQIgh0Gm2iurts9DSpE noy/lqAaw81wQUdU1W3FNZOVjbeUtVsxp2DVp8Qf6GtpmAinIBLJoPb6wWkGN+nF33Or UcAw== X-Gm-Message-State: AFqh2koeP9ussctJ+x+C3Xi8P+qsKlxKZLc1ilz2VQfiURjax2XciCCQ UsvPJlUr4Ac1GSYOA5sF653nKg== X-Google-Smtp-Source: AMrXdXtaCV27fwtpRS5dwEsGjfftHiN54ENubVfs02pUIxi7TWAsInNkYsME5v921yL5Q2WeEzQUdA== X-Received: by 2002:ac8:5642:0:b0:3a8:11ab:c537 with SMTP id 2-20020ac85642000000b003a811abc537mr18536633qtt.63.1674221067892; Fri, 20 Jan 2023 05:24:27 -0800 (PST) Received: from mutt-hbsd (pool-100-16-219-215.bltmmd.fios.verizon.net. [100.16.219.215]) by smtp.gmail.com with ESMTPSA id bn10-20020a05622a1dca00b0039cc0fbdb61sm6672279qtb.53.2023.01.20.05.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 05:24:26 -0800 (PST) Date: Fri, 20 Jan 2023 08:24:26 -0500 From: Shawn Webb To: Alexander Chernikov Cc: Alan Somers , "Danilo G. Baio" , dev-commits-src-all@freebsd.org Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT Message-ID: <20230120132426.isyeq3bqpaeoymdb@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yjlfnrth6j5yzmaq" Content-Disposition: inline In-Reply-To: <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> X-Rspamd-Queue-Id: 4Nz0b05tf6z3pGD X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --yjlfnrth6j5yzmaq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 20, 2023 at 11:04:33AM +0000, Alexander Chernikov wrote: >=20 >=20 > > On 19 Jan 2023, at 17:11, Alan Somers wrote: > >=20 > > On Thu, Jan 19, 2023 at 7:03 AM Danilo G. Baio wrot= e: > >>=20 > >>=20 > >>=20 > >> On Mon, Jan 9, 2023, at 15:57, Alan Somers wrote: > >>> The branch main has been updated by asomers: > >>>=20 > >>> URL: > >>> https://cgit.FreeBSD.org/src/commit/?id=3D2c24ad3377a6f584e484656db83= 90e4eb7cfc119 > >>>=20 > >>> commit 2c24ad3377a6f584e484656db8390e4eb7cfc119 > >>> Author: Alan Somers > >>> AuthorDate: 2022-12-26 02:06:21 +0000 > >>> Commit: Alan Somers > >>> CommitDate: 2023-01-10 02:56:18 +0000 > >>>=20 > >>> ifconfig: abort if loading a module fails other than for ENOENT > >>>=20 > >>> If "ifconfig create" tries to load a kernel module, and the module > >>> exists but can't be loaded, fail the command with a useful error > >>> message. This is helpful, for example, when trying to create a clo= ned > >>> interface in a vnet jail. But ignore ENOENT, because sometimes ifc= onfig > >>> can't correctly guess the name of the required kernel module. > >>>=20 > >>> MFC after: 2 weeks > >>> Reviewed by: jhb > >>> Differential Revision: https://reviews.freebsd.org/D37873 > >>> --- > >>> sbin/ifconfig/ifconfig.c | 18 +++++++++++++----- > >>> 1 file changed, 13 insertions(+), 5 deletions(-) > >>>=20 > >>> diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c > >>> index 462d543125c4..120207a6927e 100644 > >>> --- a/sbin/ifconfig/ifconfig.c > >>> +++ b/sbin/ifconfig/ifconfig.c > >>> @@ -1719,11 +1719,19 @@ ifmaybeload(const char *name) > >>> } > >>> } > >>>=20 > >>> - /* > >>> - * Try to load the module. But ignore failures, because ifconf= ig can't > >>> - * infer the names of all drivers (eg mlx4en(4)). > >>> - */ > >>> - (void) kldload(ifkind); > >>> + /* Try to load the module. */ > >>> + if (kldload(ifkind) < 0) { > >>> + switch (errno) { > >>> + case ENOENT: > >>> + /* > >>> + * Ignore ENOENT, because ifconfig can't infer = the > >>> + * names of all drivers (eg mlx4en(4)). > >>> + */ > >>> + break; > >>> + default: > >>> + err(1, "kldload(%s)", ifkind); > >>> + } > >>> + } > >>> } > >>>=20 > >>> static struct cmd basic_cmds[] =3D { > >>=20 > >>=20 > >> Hi. > >>=20 > >> I have a jail with vnet where the interface is renamed that stopped wo= rking after this. > >>=20 > >> from inside the jail: > >>=20 > >> root@test:/ # ifconfig > >> lo0: flags=3D8049 metric 0 mtu 16384 > >> options=3D680003 > >> inet6 ::1 prefixlen 128 > >> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x10 > >> inet 127.0.0.1 netmask 0xff000000 > >> groups: lo > >> nd6 options=3D21 > >> vnet0b_test: flags=3D8862 metric = 0 mtu 1500 > >> options=3D8 > >> ether 02:27:72:a7:28:0b > >> groups: epair > >> media: Ethernet 10Gbase-T (10Gbase-T ) > >> status: active > >> nd6 options=3D29 > >>=20 > >> root@test:/ # ifconfig vnet0b_test > >> ifconfig: kldload(if_vnet): Operation not permitted > >>=20 > >>=20 > >> If I don't rename the interface, that works. > >>=20 > >> jail.conf: > >>=20 > >> test { > >> vnet; > >> $index =3D "0"; > >> vnet.interface =3D "vnet${index}b_${name}"; > >> exec.prestart +=3D "ifconfig epair${index} create"; > >> exec.prestart +=3D "ifconfig ${bridge} addm epair${index}a"; > >> exec.prestart +=3D "ifconfig epair${index}a up name vnet${index}a_${= name}"; > >> exec.prestart +=3D "ifconfig epair${index}b up name vnet${index}b_${= name}"; > >> exec.poststop +=3D "ifconfig ${bridge} deletem vnet${index}a_${name}= "; > >> exec.poststop +=3D "ifconfig vnet${index}a_${name} destroy"; > >> devfs_ruleset =3D "11"; # add path 'bpf*' unhide (devfs.rules) > >> } > >>=20 > >> That's a bit odd, I know, could be using description instead. > >>=20 > >> Just reporting. > >>=20 > >> Regards. > >> -- > >> Danilo G. Baio > >=20 > > Ugh, it looks like kldload(2) is doing the privilege check before the > > file existence check. I'm not sure of the best solution: > > * Change kern_kldload to check for file existence first. This would > > ring some alarm bells among security folks, and it isn't totally easy > > to do, either. > > * Change ifconfig(8) to do an existence check of its own. This would b= e ugly. > > * Change ifconfig(8) so that it doesn't attempt to load modules when > > just listing an interface. This might be incomplete, but is probably > > worth doing anyway. > I think another question is that if if should be done by ifconfig(8) at a= ll. Kernel can take care of trying to load the required modules, checking t= he privileges. > I=E2=80=99m considering adding such code for the netlink-based interface = creation. An interesting problem unique to HardenedBSD is that since the kld* syscalls are hardened such that unprivileged users cannot use them at all (so kldfind(2)/kldstat(8) are completely nonfunctional), this breaks even read-only operations with ifconfig when specifying the interface. Meaning, `ifconfig` works, but `ifconfig em0` does not, when run as an unprivileged user. I'm of the opinion that read-only operations (like `ifconfig em0`) should be read-only in every sense. Kernel state should be preserved unmodified. The change I made in HardenedBSD is rather simple: force -n to be enabled by default for all cases. Though, I don't think that's likely the right solution for FreeBSD. It seems natural that FreeBSD would want to take a more permissive route. https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/671eb92efc2c9e= ef485194e443f7fa8102b2fe97 Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --yjlfnrth6j5yzmaq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmPKlgIACgkQ/y5nonf4 4fouWA/9GUglzAeiEWtseHOgPSehp70J66FxrfVGeJ0dW9fhQ2akm8jaVsOyzNzg ZyqgJRbul6vzmy+lkkrfssCb+Hyhcz5blzZq07eG7s+ovp7wMUlpPobDa7Bh3u00 V6vaZiZz2RRhUMM0jAUQKsp86KocAOseQ37ijkOk7eX6JZJM/eRaF15cH03KkssS 03jdO2d8EiJG94ximcD0XcwIr7XWcOzbOwbUpjLZBPAnDpd7Z+U+catf9uFtWbkD oPkXZj7bfIb0TFYhbX34Bymh+3gQPzA1FdUbWthz/+tK44yclV86UavmS57a2POh /WOM322QuWjiKUWoCLZTNFGP26g+8NmpmQk+fqnC8GgNGhdq/1j7vkpwWneQQ7Ic vlAYQ+WrAikPLtZ5PM+7f3RLpNTfLqlxuTmlGGRzHy6BbyPwu/VlQN6Y1S+uJLtL ZSFROLIMyWFXSofNyApkZUapCUQTv8EwkBQlIl8G9lLAGjvaEe4WBxROQIK0eCeR XLPAaOi4MVJkKlS0CUTVANpaAAJb02Ip+9gYp+FEtEO5bMbvJEato2elQq1G0Agh AKfdmX858TM7aXckBwGS54LurYBGBAcxhNeNdvNxBjjgIU14N4QMwBylklzUQqYz OLcAE9vJeLVdIp/tC0zSwg+bJFTHKlRZ5GIxN5TCL4bJMXziCUs= =lSUQ -----END PGP SIGNATURE----- --yjlfnrth6j5yzmaq-- From nobody Fri Jan 20 16:49:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz5740YWjz2t0Hk for ; Fri, 20 Jan 2023 16:49:04 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4Nz5735PfFz4CLs; Fri, 20 Jan 2023 16:49:03 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id A3BF1E999; Fri, 20 Jan 2023 08:49:00 -0800 (PST) Date: Fri, 20 Jan 2023 08:49:00 -0800 From: Gleb Smirnoff To: Alexander Chernikov Cc: Alan Somers , "Danilo G. Baio" , dev-commits-src-all@freebsd.org Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT Message-ID: References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> X-Rspamd-Queue-Id: 4Nz5735PfFz4CLs X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Fri, Jan 20, 2023 at 11:04:33AM +0000, Alexander Chernikov wrote: A> I think another question is that if if should be done by ifconfig(8) at all. Kernel can take care of trying to load the required modules, checking the privileges. A> I’m considering adding such code for the netlink-based interface creation. This is already done in netgraph, but I won't call this solution a pretty one. You ask kernel to do some network related ioctl(2), but it actually does kldload(2). At what stage of the syscall we understand that kldload(2) needs to be done? Are we free of network locks at this stage? Cause kldload will take a very different set of locks, possibly creating a LOR, and in an edge case will go into NFS taking network locks. -- Gleb Smirnoff From nobody Fri Jan 20 17:12:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz5fp49sKz2t3N6 for ; Fri, 20 Jan 2023 17:13:06 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz5fn6r51z4Fb4; Fri, 20 Jan 2023 17:13:05 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-f49.google.com with SMTP id i23so1492897ual.13; Fri, 20 Jan 2023 09:13:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=UpeCCZpIBGbsvwwh+ADeImKfnWuFgzPCm4zytJd6JSk=; b=uQvcnk0m6LnmbClOWLpPEmtLUdLq81U8ts0RRH2JY7ZYvMKbOATf9Gz9pjQyTAnnYo VXkV7Gv4BLmbZamo+5VoRercMEN5blbXDQKvN6Yg3it3saa2hFyZBxNl1EF/unYBNPbp ndALqyN+RIOqX8k3ZG6i4RMkuKybHdtSCg1ivv0rkzD6pmSvjeSkZsHpNVnkVmNKhjMt 2zaRYX9E4Rh+68LmIs1BZbK8kGL2MGqYuYPho0zqzoVFObPxonsUnVc0OCBliuooy5Nm cIQSm3sqz0nyoXOyYhLumNGmeL7VI6Igodw5W69WUq1ZYsyxmJ6U0LAVXg0Bf2Q6QZ21 pYpA== X-Gm-Message-State: AFqh2kqtwheOq4Ofrja98h0QYG8Ko5kA2ciLozsGD2ib6yn5dPUAIuDj hMNPkLVaJXoXqM2XTzhDlmgifZZ7m/qFiu7/FLOT8gDe X-Google-Smtp-Source: AMrXdXvWYRrBORdWzLdqHD0BFFzVfNEi5WFAkrPGP+yNUj5DjXhAPj5sCz9vl+b0iqyS2oWRnmxEZNcvsK6lzEBgRGc= X-Received: by 2002:ab0:85e:0:b0:5ef:f384:b17a with SMTP id b30-20020ab0085e000000b005eff384b17amr1677407uaf.57.1674234784083; Fri, 20 Jan 2023 09:13:04 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 20 Jan 2023 10:12:52 -0700 Message-ID: Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT To: Gleb Smirnoff Cc: Alexander Chernikov , "Danilo G. Baio" , dev-commits-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Nz5fn6r51z4Fb4 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Fri, Jan 20, 2023 at 9:49 AM Gleb Smirnoff wrote: > > On Fri, Jan 20, 2023 at 11:04:33AM +0000, Alexander Chernikov wrote: > A> I think another question is that if if should be done by ifconfig(8) a= t all. Kernel can take care of trying to load the required modules, checkin= g the privileges. > A> I=E2=80=99m considering adding such code for the netlink-based interfa= ce creation. > > This is already done in netgraph, but I won't call this solution a > pretty one. You ask kernel to do some network related ioctl(2), but > it actually does kldload(2). > > At what stage of the syscall we understand that kldload(2) needs to > be done? Are we free of network locks at this stage? Cause kldload > will take a very different set of locks, possibly creating a LOR, > and in an edge case will go into NFS taking network locks. > > -- > Gleb Smirnoff ifconfig tries to load a KLD preemptively, long before it does the hard work (cloning an interface or something). Trying to teach the kernel to load the module on-demand would be hard, we would probably have to do it in many different places. From nobody Fri Jan 20 17:15:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz5k132qsz2t3Dn for ; Fri, 20 Jan 2023 17:15:53 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz5k10zkHz4G6C; Fri, 20 Jan 2023 17:15:53 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-f45.google.com with SMTP id i23so1494956ual.13; Fri, 20 Jan 2023 09:15:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sdVvVjFG2R1BSMEWXu45ZH2utqdxr+X2AGdnsWwi7Ms=; b=daFJgTpt5Dm3A1ZAYjoRLKuBYpK1lVXzNij2LpNtuMxDsAxOwJ5DQIS1Zfj4vWKUhH WaB2Em/goprz/QgDgDDga0UQ5gzJehSyrAzu0seYrUAN43yGRorOSh1h9yL4LZFYDG27 oMD5a9lJZ7rlyYG5At1ZvkeWjv33PYC0+YNw8WXCuA46MURCEjBv8D1glVd0TuYw8BYt dzoRrubHKSGOeN7mcGMq8xznIH+2B2krmifXiqJSs3zMLu0sLuRETFBFefdl1aWziaQp UZnZCGFRtbqYLwPVzW6a6xbWdAlcQVXapTxLPozQXgpjA0MN2rdiyY5/6wr3FAzGY3VZ 9HRA== X-Gm-Message-State: AFqh2kpL0h1C8QOUyOxIaEwRMZQ6IFNDyknjyYDc8APJHgUBcfDfNFA4 CD1TKLhp+LZE5fbp7NV3F8pjzqnJGjNkxFjZPA3jFtcK X-Google-Smtp-Source: AMrXdXuZGoKBjJl6uLs47GtJ4cywtVrkGXXz8Gak0s2JLTZDomag1n1DeJie+VOTao4qtxE8v/CE6dkJrvufF7+7r+k= X-Received: by 2002:ab0:31d0:0:b0:419:d115:2773 with SMTP id e16-20020ab031d0000000b00419d1152773mr1913763uan.29.1674234952237; Fri, 20 Jan 2023 09:15:52 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <20230120083721.Horde.w2KDmblCBL6A2zxfE-TrZbB@webmail.leidinger.net> In-Reply-To: <20230120083721.Horde.w2KDmblCBL6A2zxfE-TrZbB@webmail.leidinger.net> From: Alan Somers Date: Fri, 20 Jan 2023 10:15:39 -0700 Message-ID: Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT To: Alexander Leidinger Cc: "Danilo G. Baio" , dev-commits-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Nz5k10zkHz4G6C X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Fri, Jan 20, 2023 at 12:37 AM Alexander Leidinger wrote: > > Quoting Alan Somers (from Thu, 19 Jan 2023 > 10:11:38 -0700): > > > Ugh, it looks like kldload(2) is doing the privilege check before the > > file existence check. I'm not sure of the best solution: > > * Change kern_kldload to check for file existence first. This would > > ring some alarm bells among security folks, and it isn't totally easy > > to do, either. > > * Change ifconfig(8) to do an existence check of its own. This > > would be ugly. > > * Change ifconfig(8) so that it doesn't attempt to load modules when > > just listing an interface. This might be incomplete, but is probably > > worth doing anyway. > > Isn't this affecting all ifconfig operations in a _vnet_ jail, not > only listing an interface? > > Would it be sensible to revert the commit until there is a solution? > > From a quick look I have the impression it makes sense to set noload > to true in a jail (in that case ifmaybeload returns and the problem > should go away). I think this is the best idea I've heard so far. I'll prepare a change. From nobody Fri Jan 20 17:24:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz5wF2W5jz2t4jw; Fri, 20 Jan 2023 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz5wF21Y6z4Gpr; Fri, 20 Jan 2023 17: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=1674235485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8B7SwqTTWP/VbhSHre2F0kEErZm6ast5+6Vn/wpli6U=; b=ljDW60ui9U5GYVfgvjUGSlMmMH0yF7+rFxmyd6pSLJh+j0iFuw8VxAKOBHgGz2m4eN863I zEAE1qa+5hF4s3ba1IseAcoN7eKfnIX7+rR/AyojVyDoP1/Uh7LhlReU5kmbQD+O6xhOc5 jT9nFnssGRUdOllO5niJ/EgYaqdIatGQDzIV7qzYDWBhGRXLWxqI7acNHLykSM2g9AYMrB SAqxw+vzwZyD88J1f3a9OrDVqE4WnxCAr7ToOpTXifZA7wufiQxDAYt0sSYBZMwr+GFCB6 1Pm2r/LOqmAvj7MC7voR9fbhCdoCzwUGW7gu++zCYIZrosdnJMfc6a9YCBz/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674235485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8B7SwqTTWP/VbhSHre2F0kEErZm6ast5+6Vn/wpli6U=; b=v2SUYzfBj4wCNlQVV9jDpSFxO4vSUyjFEtEr2+P+yNlig4jq727qqLctOvKPY40/bgJMim Z5NLzEALo7ow5LdSRPSWiQXTR7ksvVbknusbd0FANegXoQP3ND6mSr+sySrHPHOG71a72b UTj0Pxap2TpmzedcDZoOLsRSWHNs8H9TIoV0h27ZH/o+AGEfrmzq2zN6rsoTqp22qaSKzN AyFj5DwlBxBOydcocZm4hz+7p6JbDqbEWax7smgscq4sGj1tWrn3zwfo/ptnPLs6rbx1Iz 6+hJk78wIgWLo9Z3HTIJMyf2XeoFhuabvY6wC1lDhViz8i4SanAm1CaQeFsduw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674235485; a=rsa-sha256; cv=none; b=Ug6tWT9n+0Kcq+r0uKQkMO7SCEURGx3/D78fdDEFXz7KA8SESbNO17Qw5kHP1diiuGSdKU wWVLdJpb66tyB3zZXCIaK47lMhQm/6NDCxMuS9bKTr0ig0QU81QCjs0Y/lyBqVOGHcNenu skWNrXDfi/cFnLmxpuO7TlODRaogwBGJ1+uidQiJa7Gdiv4f9wRiHtsSijKhNFYt7wX/K6 2+E3ujuZrdggMZxJdfMwGOAL024E4bdtYqu9++BKrqIZ1EyfWGWweXZtn21UbdxSxeQnbG utgDPkChfJkoov2GSFkaDW7/nlFBso+ofuhY06MEto7x++ARgsPxi7sYwiMdWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz5wF14ckzf5m; Fri, 20 Jan 2023 17:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KHOj4b041593; Fri, 20 Jan 2023 17:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KHOjEu041592; Fri, 20 Jan 2023 17:24:45 GMT (envelope-from git) Date: Fri, 20 Jan 2023 17:24:45 GMT Message-Id: <202301201724.30KHOjEu041592@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: 520590881667 - main - Revert "ifconfig: abort if loading a module fails other than for ENOENT" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 520590881667b4536e6861c710a80353a0564334 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=520590881667b4536e6861c710a80353a0564334 commit 520590881667b4536e6861c710a80353a0564334 Author: Alan Somers AuthorDate: 2023-01-20 17:17:21 +0000 Commit: Alan Somers CommitDate: 2023-01-20 17:17:21 +0000 Revert "ifconfig: abort if loading a module fails other than for ENOENT" This reverts commit 2c24ad3377a6f584e484656db8390e4eb7cfc119. This change causes some commands to fail, for example when working with renamed interfaces or when trying to list a nonexistent interface by name. PR: 269042 Reported by: dbaio, Michael Paepcke MFC with: 2c24ad3377a6f584e484656db8390e4eb7cfc119 --- sbin/ifconfig/ifconfig.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 120207a6927e..462d543125c4 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1719,19 +1719,11 @@ ifmaybeload(const char *name) } } - /* Try to load the module. */ - if (kldload(ifkind) < 0) { - switch (errno) { - case ENOENT: - /* - * Ignore ENOENT, because ifconfig can't infer the - * names of all drivers (eg mlx4en(4)). - */ - break; - default: - err(1, "kldload(%s)", ifkind); - } - } + /* + * Try to load the module. But ignore failures, because ifconfig can't + * infer the names of all drivers (eg mlx4en(4)). + */ + (void) kldload(ifkind); } static struct cmd basic_cmds[] = { From nobody Fri Jan 20 17:30:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz63V3Yz1z2t4vc for ; Fri, 20 Jan 2023 17:31:02 +0000 (UTC) (envelope-from melifaro@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz63V37Nvz4J1k; Fri, 20 Jan 2023 17:31:02 +0000 (UTC) (envelope-from melifaro@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674235862; 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=qmmQ2eNzD5zR2f1kNJCwkWA0h76XpPaq/vldstC93hQ=; b=Kru5sBdLh8bjUyVtWawLZs6WBCab4TVA7gP58QC2+d0mwu+SLaNAoeRArTQSc4/ODAErxz IwmmMA0VeCIhGGubYFSOgNri1NoUtpSIHGwU0g56UthVCsy3kiZQb6metXecOF7JgZiTSF SS2NOCSqP38SJrA/2Y8ODsnk487Gbdwu2lb5VSoIvcQcvH2TqlIAaY2j7OZIfxw70iHR8c 68xRdyTSvQakMoCsOfSiF4gjWEC4Z33vJZW7jVvItzFJmJn60jN/JTUkyXR5ZsUuUQ2Nof xpPCa9+o37w5GdaHTtg37Ksvtw1TnTBJFSKVicTfen1OHHNlBlocPAEXdy80Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674235862; 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=qmmQ2eNzD5zR2f1kNJCwkWA0h76XpPaq/vldstC93hQ=; b=CpMOtOUj9ydC1hoKxHcYVMJvEY5KBfR33OZOeFwi6lOCZGQnL9OjfQe3zEKdaSvCxHTabi naYq7BVEWxGiEtXBXzyefsHY3q8faaHGrPRYY5Et7eaNIDe1NbUoaCKnyyeD4dceMqC8e9 VeV02Fl+PJaOu7q2271O2dfZQcpcfKftWqmd+jp35Q3MymHbLu5MzAv9HcSRcozrdxtcSY Qc4smxCsBHJC+njdPak2OB3URshQzRcGNhB/Sew6znT2QrE9I5YMNFrL3h4FnPwk1eTxuH bI+iK7EOOJ9rNC68FaxjdAdnx5rGWUED1v0ghplX/hHsOfBwJrJDaWyC0d9jdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674235862; a=rsa-sha256; cv=none; b=WDS5ns4bz96/nPkO5WKABthEKUzN0H/DNY2voWWQra1z4zG+n1tS7L6f5d8OWBfBlAULL8 fA8Cpk1e+Hq12JdiM2eMQvEpSmNPS3n0CaBHN4MMoih5QGY8wXum+U1qszF+anNG4zSd2R P3LGU88vrrYOs0JUBQwh6a3Eg8B3t3DkYWIi+a8ebcNI9RQVMJ6OFNvcFSkr3+yNIzilnb xG6BSK+sMn17kokP8R+a5G0FDhDWQof19dqQa3CfnIvRBdwXppQ7ATg2hf6f6RDOevRktf MuZCTIwo7eX71cD11Z/qtUDwmvnqSFunjpMY79WZx5z0cT3VonSAaRYyaWRFpw== Received: from smtpclient.apple (unknown [IPv6:2a02:8084:d6bb:510:2daa:c4ca:2eed:fc35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: melifaro/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Nz63T5dsQz1GC3; Fri, 20 Jan 2023 17:31:01 +0000 (UTC) (envelope-from melifaro@freebsd.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: git: 2c24ad3377a6 - main - ifconfig: abort if loading a module fails other than for ENOENT From: Alexander Chernikov In-Reply-To: Date: Fri, 20 Jan 2023 17:30:49 +0000 Cc: Alan Somers , "Danilo G. Baio" , dev-commits-src-all@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202301091857.309Iv87L068285@gitrepo.freebsd.org> <2f4e4ccf-b19a-4f8f-a9e0-72298e500d7c@app.fastmail.com> <1E9FAE83-B5C2-4E1F-8D04-CF4F477F76C7@freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3731.200.110.1.12) X-ThisMailContainsUnwantedMimeParts: N > On 20 Jan 2023, at 16:49, Gleb Smirnoff wrote: >=20 > On Fri, Jan 20, 2023 at 11:04:33AM +0000, Alexander Chernikov wrote: > A> I think another question is that if if should be done by = ifconfig(8) at all. Kernel can take care of trying to load the required = modules, checking the privileges. > A> I=E2=80=99m considering adding such code for the netlink-based = interface creation. >=20 > This is already done in netgraph, but I won't call this solution a > pretty one. You ask kernel to do some network related ioctl(2), but > it actually does kldload(2). Partially I agree. Let me try to rephrase it. The intent is to create a network interface = and it is implemented using SIOCIFCREATE[2] and, potentially, = kldload(2). As the idea behind many ioctl=E2=80=99s is to do a single thing at a = time, coupling it with kldload may indeed not look pretty. For Netlink, it=E2=80=99s different - it=E2=80=99s meant to be a broker = and provide a higher-level interfaces. You can ask it to create an = interface, set its flags, description, fib, mtu and so on via a single = request. >=20 > At what stage of the syscall we understand that kldload(2) needs to > be done? Are we free of network locks at this stage? Cause kldload For example, if one decide to enhance `SIOCIFCREATE`, it can be done = somewhere around `if_clone_create()`. No locks are held in `ifioctl()` = that handles it. Also, we=E2=80=99re in the sys call and can sleep. For Netlink, - probably in the netlink = sys/netlink/route/iface.c:create_link before using the generic cloner. = Netlink handlers run in dedicated taskques and can sleep as well. > will take a very different set of locks, possibly creating a LOR, > and in an edge case will go into NFS taking network locks. >=20 > --=20 > Gleb Smirnoff From nobody Fri Jan 20 17:59:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz6h32GWYz2t8WN; Fri, 20 Jan 2023 17:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz6h31nrsz4Ky8; Fri, 20 Jan 2023 17:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674237555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0XuSXjl5B9cN+RUnZIfNx4FVkXjaYQzt9TfBp2KSBFg=; b=fIWbm6ETGExW9DCQbJ1GoWCpgicgBxYYF+MPfADc0Ors5IkkktpK+Y4ZeX0ZnjXu5i3XeV O4vs6Z9lrOv9cIkv0+fPBiucSj4pxUUlNEKPftYZvsH6r16TQVEBZnz+ic8lDpNAqODI4m 8jrkFiUxGgh4u2wmF2bNm/6CzFXbvnEBTom/BtKAcCn1/TxMyBlEpzypaspz/nzO8pnaT2 Yn8u05Ryum5cCcS2D5fI4CqMc4IRjwci3uNy/BV30n88DWrISw1znn9Co4f/5FsfLpQt1Q Faarr3EyxErK5bKY9p4Eddk8wuKM0mY3R8/cxB7lo0xryPswyWa2KB1JxQB50g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674237555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0XuSXjl5B9cN+RUnZIfNx4FVkXjaYQzt9TfBp2KSBFg=; b=NiGgxHbMsNt4SqZjALmbRcQ+WN+/GjNIBJpraOUPxNY7fdzRIbIDt0PVZiAt+rBTLaBg9q 9ADBbPOEnLJDtNJ2s8DtZxPdSozKbeUgQSbTIVPA+/DgpepW1ak7QTaEZC5VyGj8cldE0w Bd6E5Q9lTIqcOxy7L/IyFfGb9DJfNZwH0EOfKu+wT/mh6I4iwFjJw/Bs1TkdnjHu9mbsAu RAVvdacbAGe8wZuBQnGNYzzz4UBHSHzOE0flu0yb4514giC5gC0xadm9xjJgbfjiyMYfnU tNjLCgXOwgjhNhBOI09+Frp9hd2rkUZnDbDnTlqinuQXDw+fY4YTrKJyhkKkbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674237555; a=rsa-sha256; cv=none; b=NyUsi3UyqgnZnEPEhfY1ghBKK5Q5Xq59MyAZqPD4XRTFcoawC2TsUi/yCTotCjMja/XcGC bzfMn5Cv4tTkEk6LrC6TTRso+qbEXZMu2MMz4E1ozie6AaWNo/+gxbALHCF7TnYEbT7FSA J4FOsbI8hDW2yGzvnkXkT3xLhArVbis7sxSrrOFlKgblDM8kO04ET7Dy/P2ci71xtnn/AI Cs3sjvFoL2bKiE5UfHQ7euT0wpXcHEqNI/oguHLM09SleqmAiUDAmvA/HQcVRV/hEZmpaK 6XDGAAHSSyry0ACyu0LZiv4dG2fZvxTrtTCsBRHwcV6JjUMsn+rvmObWKE5Mmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz6h30rsWzfps; Fri, 20 Jan 2023 17:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KHxFvo084671; Fri, 20 Jan 2023 17:59:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KHxFAS084670; Fri, 20 Jan 2023 17:59:15 GMT (envelope-from git) Date: Fri, 20 Jan 2023 17:59:15 GMT Message-Id: <202301201759.30KHxFAS084670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: bfe8e339eb77 - main - bhyve: Fix a global buffer overread in the PCI hda device model. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfe8e339eb77910c2eb739b45aaa936148b33897 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bfe8e339eb77910c2eb739b45aaa936148b33897 commit bfe8e339eb77910c2eb739b45aaa936148b33897 Author: John Baldwin AuthorDate: 2023-01-20 17:57:45 +0000 Commit: John Baldwin CommitDate: 2023-01-20 17:57:45 +0000 bhyve: Fix a global buffer overread in the PCI hda device model. hda_write did not validate the relative register offset before using it as an index into the hda_set_reg_table array to lookup a function pointer to execute after updating the register's value. PR: 264435 Reported by: Robert Morris Reviewed by: corvink, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38127 --- usr.sbin/bhyve/pci_hda.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index 9b0d4bd02ba0..bb8fba1a54bb 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include "pci_hda.h" @@ -51,8 +52,6 @@ __FBSDID("$FreeBSD$"); #define HDA_CODEC_MAX 0x0f #define HDA_LAST_OFFSET \ (0x2084 + ((HDA_ISS_NO) * 0x20) + ((HDA_OSS_NO) * 0x20)) -#define HDA_SET_REG_TABLE_SZ \ - (0x80 + ((HDA_ISS_NO) * 0x20) + ((HDA_OSS_NO) * 0x20)) #define HDA_CORB_ENTRY_LEN 0x04 #define HDA_RIRB_ENTRY_LEN 0x08 #define HDA_BDL_ENTRY_LEN 0x10 @@ -246,8 +245,6 @@ static const hda_set_reg_handler hda_set_reg_table[] = { HDAC_OSTREAM(1, HDA_ISS_NO, HDA_OSS_NO) HDAC_OSTREAM(2, HDA_ISS_NO, HDA_OSS_NO) HDAC_OSTREAM(3, HDA_ISS_NO, HDA_OSS_NO) - - [HDA_SET_REG_TABLE_SZ] = NULL, }; static const uint16_t hda_corb_sizes[] = { @@ -714,7 +711,10 @@ hda_write(struct hda_softc *sc, uint32_t offset, uint8_t size, uint32_t value) uint32_t old = hda_get_reg_by_offset(sc, offset); uint32_t masks[] = {0x00000000, 0x000000ff, 0x0000ffff, 0x00ffffff, 0xffffffff}; - hda_set_reg_handler set_reg_handler = hda_set_reg_table[offset]; + hda_set_reg_handler set_reg_handler = NULL; + + if (offset < nitems(hda_set_reg_table)) + set_reg_handler = hda_set_reg_table[offset]; hda_set_field_by_offset(sc, offset, masks[size], value); From nobody Fri Jan 20 17:59:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz6h43BMWz2t8YZ; Fri, 20 Jan 2023 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz6h42kGqz4LF4; Fri, 20 Jan 2023 17: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=1674237556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ygPwe9XvrQTc6yeUmLb/rcOQ5W+aO50Cj+5WSHnPesk=; b=oWbM+G0PxmoBbvgarTH5A/04+InkDtHM81y0UuuXodYqt6n1LzNLx8kral55hc6HNm6E5n 0pAIxOygSUS6T9G+wmjP4RstUKjPVKEgB4mIG/4Yu7fRT7P71E/O+OnhoDmcyTAMCb1J7P /0+jls2gFB6THP6kj7KSHVT6PfOIcbWCGskzh8cScFY05YRUwLylgXAnxFCfMHLpewhggm tG1NENBgmjbkZRl2kUl8FTXgM0pxO90nWGw4mytCyDTKiDq17/SsmM1YEMpYQmC6YbZJgK 57kC9rivhh+NHNW1j9uu7SM1Qs6CZMDhNbBzwWlfSnbPEfw2VJNIcGm7tQ2QaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674237556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ygPwe9XvrQTc6yeUmLb/rcOQ5W+aO50Cj+5WSHnPesk=; b=GT3h35pNMtviEigjrQfoKa0F61kcXeJYN0684UDhYxxX+dwJC/RJtO8Q+7F1T5bnFP5O80 JYYpE7wQ/YcesRT0X6AO+Pst1vojmun1nyI+QI61FyqZbzRSDhHWkyBC1XczlwDwKxKPiO pQKBbZOgGYjefNbSLaCZmbzl/Xdn8qMPUVFTVuF+ELOqsKx7UadcB6iFg/rhZ05vuUCrb9 rxviqqNyYG6ICLdkrVhS2XVz7SRhjDOkWq092N09iCMogIgZxq9l6v00zzp7Ak+SAAyxVl hHo23HHwvAyyvMF9C+jyPHgBJPNOcSpYAzE9sjz9q1AA5JyuKg+k27rvu4vIlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674237556; a=rsa-sha256; cv=none; b=PnUEZpu2r5n6rudU31V717HE0wHPBncsYmYA+lBvg5EOhHLc6ShDfG6edHZiWKuOpBuvLd 1LA94tHyaynNKI1rY250vGdJG4fGmqI1IBzDdEPsew+aKiSCw7yJtBGyqQVHV1KMinvOki by+KpgI5Ibis34odvlthdqrxwEoV25XQfmAyBV09sN2oWmxG/0FpEP/Ru/HRgVFODBEFUW 1d2PQZQNLS6Sb9yl3lwLgXIhfwnIRBj7iajyHr2VgTiOq+Qrh71OEAdpX4CL4J2O4cMgz6 XBVxhAdQlNlyqHFLcVSRRX1YpMX4daRpyR9/WSD2w/fQt6aoJpz4Qc/bl44AtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz6h41n1rzfc4; Fri, 20 Jan 2023 17:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KHxGsv084697; Fri, 20 Jan 2023 17:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KHxGD9084696; Fri, 20 Jan 2023 17:59:16 GMT (envelope-from git) Date: Fri, 20 Jan 2023 17:59:16 GMT Message-Id: <202301201759.30KHxGD9084696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: cf57f20edcf9 - main - bhyve: Fix a buffer overread in the PCI hda device model. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf57f20edcf9c75f0f9f1ac1c44729184970b9d9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cf57f20edcf9c75f0f9f1ac1c44729184970b9d9 commit cf57f20edcf9c75f0f9f1ac1c44729184970b9d9 Author: John Baldwin AuthorDate: 2023-01-20 17:58:38 +0000 Commit: John Baldwin CommitDate: 2023-01-20 17:58:38 +0000 bhyve: Fix a buffer overread in the PCI hda device model. The sc->codecs array contains HDA_CODEC_MAX (15) entries. The guest-supplied cad field in the verb provided to hda_send_command is a 4-bit field that was used as an index into sc->codecs without any bounds checking. The highest value (15) would overflow the array. Other uses of sc->codecs in the device model used sc->codecs_no to determine which array indices have been initialized, so use a similar check to reject requests for uninitialized or invalid cad indices in hda_send_command. PR: 264582 Reported by: Robert Morris Reviewed by: corvink, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38128 --- usr.sbin/bhyve/pci_hda.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index bb8fba1a54bb..9e9d7ab5a626 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -475,12 +475,14 @@ hda_send_command(struct hda_softc *sc, uint32_t verb) struct hda_codec_class *codec = NULL; uint8_t cad = (verb >> HDA_CMD_CAD_SHIFT) & 0x0f; - hci = sc->codecs[cad]; - if (!hci) + if (cad >= sc->codecs_no) return (-1); DPRINTF("cad: 0x%x verb: 0x%x", cad, verb); + hci = sc->codecs[cad]; + assert(hci); + codec = hci->codec; assert(codec); From nobody Fri Jan 20 18:05:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz6q12Yr5z2t9HH; Fri, 20 Jan 2023 18: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz6q123bzz4Mn3; Fri, 20 Jan 2023 18:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674237917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qp3AF9QUyQAZVIgyKhzoaswnhnVpEK+NUzo/Os/TDCk=; b=pIAkZY3vW9iWKLw8A98+1RnCLyOHM8+MBQgM/d0zCmu6MNROYjFp2yOF21gc2J/d1lf4P7 FKK1im55VuYW/ZEioe99WCpisbJA7epOgCPSpYFCVR+TwWB1kzs0kaIBTep1tG1kWj/tMZ xzaFwdHrVzlS71as4JzjXqBX44UXYrI5onJxu1YqbShQHpF8U6xlitHPjTSFX4sKRz7Rir hBBXiT5ZV7ZvYJyyAYQOcvokl4IdLscdlXrdMKU8kd2XjDyUPK7gbf4umwqksjU538aR3f l04OTnzI9xMItDv08frYsFglklzNOXiNyK7+0Bn4l7ygJZ2mFTi5bsS0LGynUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674237917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qp3AF9QUyQAZVIgyKhzoaswnhnVpEK+NUzo/Os/TDCk=; b=ArrFOyVWZ6Kl0yvgrlSSmDGx3QCxKYztgPooyCHCovcQl/RBfQ2xOMh+kCvD9mLzLtvKPM fYJH633Nu2m/fpt0luqEmp1TM9YdJeHf9Ga5v8sL1JIu+kA+ihNdesfG+H8m3a/h+k/6XA tK5hU58yLTR42AXhODykq7aVsGrRHYBjaziIMrvRN68+RtZ+9dhPVMYkZvALd7s2d2e96U eBXfXi2tD05R3vUqWCDwwfQu3yQnFviN9Wj3WHKjlDFtl9bs7I3VUJOED2C0cgFE6g3qOG G5D7TxNi+6RjfyRKwBDvQxwEV4ewTrXj3ABFLLnH3Al0MGJDdQfRCO5DNPH1Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674237917; a=rsa-sha256; cv=none; b=rovQNFxyNOJ+r+wvndqGXaeBvizpUB7KAhPvacH33c7s4ts0QywRdynlVUaD3J/yf9rMTn QhSKy/nlurU8Ne1wWKwpV9tXZQz9/vp1IVfAUkVflSt084w27oQ5szcPHSb3c41eMD/yGp jxHqcdbLG5p3sAm3J6dayVNfaUmilCA5/HAIu1fooBoPYpxWRs9sJgBs+Y8Ew653e4jg7g 9RaAFvgvB4TzDvmf7Q6+nkYYGR/sU8LWVZvoQTaCXqK/51A8FK16siMeTDwQABwdx9IbRv 1u08nsGL12TY23ih5CSamHaJXeDZw51HY2U8ZGGKHFQOHhxqRq9t1DrY1ED2sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz6q116lhzfgH; Fri, 20 Jan 2023 18:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KI5HCI099188; Fri, 20 Jan 2023 18:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KI5Ht0099187; Fri, 20 Jan 2023 18:05:17 GMT (envelope-from git) Date: Fri, 20 Jan 2023 18:05:17 GMT Message-Id: <202301201805.30KI5Ht0099187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: fa1d803c0f65 - main - epoch: replace hand coded assertion List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa1d803c0f652d72840a3c59139baf9d30792860 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=fa1d803c0f652d72840a3c59139baf9d30792860 commit fa1d803c0f652d72840a3c59139baf9d30792860 Author: Brooks Davis AuthorDate: 2023-01-20 18:03:39 +0000 Commit: Brooks Davis CommitDate: 2023-01-20 18:04:40 +0000 epoch: replace hand coded assertion The assertion is equivalent to kstack_contains() so use that rather than spelling it out. Suggested by: jhb Reviewed by: jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D38107 --- sys/kern/subr_epoch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c index 100221cd62f9..98a560e44c9d 100644 --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -468,9 +468,7 @@ _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE) MPASS(cold || epoch != NULL); td = curthread; - MPASS((vm_offset_t)et >= td->td_kstack && - (vm_offset_t)et + sizeof(struct epoch_tracker) <= - td->td_kstack + td->td_kstack_pages * PAGE_SIZE); + MPASS(kstack_contains(td, (vm_offset_t)et, sizeof(*et))); INIT_CHECK(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); From nobody Fri Jan 20 19:04:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz87c5MDNz2v20S; Fri, 20 Jan 2023 19:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz87c4pSLz3DK2; Fri, 20 Jan 2023 19:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674241484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y2sIX6Vq8RWXqvy415piBIbJOPUvNwTlWkmL4NTTTdM=; b=lPEVG6lo5A4M8Oe6mG8+k7gZ9kGGD/MrrsezMp6RQBJjqK/aouLMTbllJnkxffN6+WSD8/ WN3LhXboPFJA+X0VpWn0IPsFftKrzuNEHuvAtDdSnDqkUo7fmV4jx3qKCduji2jylLZvkX ooh1baoBNU85amDbfEtMe6CXAJvBnZMJb8RzjGoJV9fyg/Ko4IRb3BgSORWvQkdrPqhVdW MqCbVnhvVhHYjhMWneja9u3x2lSI0mKE2mNJXP/dbbxblKbkHcdzWiCeMy5aLLr3pXr/1g 4Aa/pXkld2eRZZbF4jnRO0+wfUbsMtFCoNlFIUwlYetsb8IERq2DeepRla2bPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674241484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y2sIX6Vq8RWXqvy415piBIbJOPUvNwTlWkmL4NTTTdM=; b=g1uYwIwak1MVxTLCn6eX4dcEX7PI6XxUYwO3LbxkaXNZUTdMa71S8s7rwtatFYlwDMqpji NCJ/m20ApwhgoxIrm2uqwTNJPjuNBJ4aZ7McTe9ADwDiCk3TWaYF8oZP/IO1u8/O7uGK6L xvCPaauDhvQKlPN4XP/Vjl2VPcsyJArTxLLI6r32l2QceoZyI02+taiZn+GZrjJa5Hu5bI 8PLchI/6LSf3s1sZzAXSsq92WSL4ttWc9GrJfkfiNEDukgr0PiVPdTptYSVu10dL6ZegC5 KaQjW22MN6pT6bUsVRe3Br+r9kUbo2NpyFo7QtV/PCvs+R+JvULRt3I1gY77wA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674241484; a=rsa-sha256; cv=none; b=VLMib1KFgaAkULO2gcu2Imy7RAqKuFswJqWEgr9kJlvyUjIEqNjkce+WeSMAZsZWfpHbaW NhVcdZxxV9q15DS0AE/5+Ne+Iimo3NXtDTrueFte/+L/88vrXXsJl5IcQ2ZMI85X9J1R9r OOgxMWuJIKadaxx2KO5+zaHo+bOD6aSY2HQK2G7Oa6tVyMfQ4OSIy//YGaUS0KzKp3QBgl rW9odPcSDben5LxVpI3bG7bHVD5+4TDpvXwPR6HBVsP6m4n5NveXmhKuOcQ0sgCwOPU+sw excuIztBUmf3n1Gw+Jzex1B7aqLLpPqbCdzm9nHbBGYFLvG10AM69rYd+H99rA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz87c3qTDzhXs; Fri, 20 Jan 2023 19:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KJ4ic6084873; Fri, 20 Jan 2023 19:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KJ4iOV084872; Fri, 20 Jan 2023 19:04:44 GMT (envelope-from git) Date: Fri, 20 Jan 2023 19:04:44 GMT Message-Id: <202301201904.30KJ4iOV084872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: ccf32a68f821 - main - vmm: take exclusive mem_segs_lock when (un)assigning ppt 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccf32a68f821c5c724fb9a5b4b9576925122292f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf32a68f821c5c724fb9a5b4b9576925122292f commit ccf32a68f821c5c724fb9a5b4b9576925122292f Author: Robert Wing AuthorDate: 2023-01-20 10:03:59 +0000 Commit: Robert Wing CommitDate: 2023-01-20 10:03:59 +0000 vmm: take exclusive mem_segs_lock when (un)assigning ppt dev PR: 268744 Reported by: mmatalka@gmail.com Reviewed by: corvink, markj, jhb Fixes: 67b69e76e8ee ("vmm: Use an sx lock to protect the memory map.") Differential Revision: https://reviews.freebsd.org/D37962 --- sys/amd64/vmm/vmm_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index 98738b1f0692..2d8ff43a74dd 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -479,6 +479,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, case VM_ALLOC_MEMSEG_FBSD12: #endif case VM_ALLOC_MEMSEG: + case VM_BIND_PPTDEV: + case VM_UNBIND_PPTDEV: case VM_MMAP_MEMSEG: case VM_MUNMAP_MEMSEG: case VM_REINIT: @@ -491,8 +493,6 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, /* FALLTHROUGH */ case VM_MAP_PPTDEV_MMIO: case VM_UNMAP_PPTDEV_MMIO: - case VM_BIND_PPTDEV: - case VM_UNBIND_PPTDEV: #ifdef BHYVE_SNAPSHOT case VM_SNAPSHOT_REQ: case VM_RESTORE_TIME: From nobody Fri Jan 20 20:11:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz9cH61Gkz2vB4K; Fri, 20 Jan 2023 20:11:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz9cH5ZSGz3Jwp; Fri, 20 Jan 2023 20:11:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674245471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BhDlCJKrcohLtMeUBWSbAeT+eul5O6Fs9M6NWljFtsw=; b=D0GpmDPVBEsliQmIOcGs9JP2OSehf8GdmIW0TmA07tfdiyD6ZWxVG/1YGAVyeVpSwY08NT xuNIv6xbwWyJfXEteexXNr9Vl2f4Hzi4flX1KJS9MXpy6YpqB9UnQxfuIcePFuEARBxRGB kBC0bNqM1CJistgFyttxmWW2+lrvjgYlawP0YzzvRI5bUUmM8xDFjNqE6+4VmE8WU7qSDL oMjnpKkk3WjpXoFvrXBqbFTNyTmZqXfUjd0hcgiykKXsthqay2sPqT6fLwsJUB+esNJR5w /tWT4gU8llRt41w93x106vynKuCSCFStaAo1dqcl5XWOANF1vmHfk7OuWogh2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674245471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BhDlCJKrcohLtMeUBWSbAeT+eul5O6Fs9M6NWljFtsw=; b=mrpzQXrw8KMgpwByr5IHa8yvezR4D90KsuvrsTH1Lm61np446iAOjg4VfW/soo/gvo200O jWYzcrIwLAvr74XWaElljssuSRmhCOVZFwfB6K8C+P/mETloaRaIFoQsg6qG2+yJOkH57s c6WlnOzHf+0SgtNpKpYAaZTmtynCW47NIIJ8t3jzAOgS5GgET8t782U+x5XxHRFnWPzucs a1BM50fi+gy1A4/mW1NedLwTj4W8Jq0Jzo1ZY/w/TniBeIKbwUAZy6sl013ae3/Ew8LaqD QeJ64XkPS8wXt/rfZg+yCkmP10KjFlOseoCSDJkiMFbqBwBdUsKw4PWKJrOymA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674245471; a=rsa-sha256; cv=none; b=BCUVtKeKa8aZyFjk5/DJJW04oqiuhOEhRT/fNFM8/UzOyD+2VPaqcjlshZwZy0ZNHkaXfZ /ROAZnBW5nN2XOJMSLeMYgzmMGYDSqkukluLfopBgtZornRfPGpgyLQ8I/3Nl3uoEDQuKq 5XrNnp+3gwfVukSZLsdwySxDBg+Vzbe8auQf+Td3Ezw3SxdpqpuDB/xL+/Jwx46e1oSB4r LDKMt3g2b7mJHudBSdZ9VVx90GmBU52VkN9EzrV74mufecBT6DkOrLxFpyJtLMKPjjGyhw AlZjE+1WPSEPdDx6ZtFntJYo4d0kqyJVGRYUIoQXTbl2CmURm9YyhU4S1QgJTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz9cH4f3RzjqJ; Fri, 20 Jan 2023 20:11:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KKBBjj082543; Fri, 20 Jan 2023 20:11:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KKBBCi082542; Fri, 20 Jan 2023 20:11:11 GMT (envelope-from git) Date: Fri, 20 Jan 2023 20:11:11 GMT Message-Id: <202301202011.30KKBBCi082542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: c668e8173a8f - main - vmm: take exclusive mem_segs_lock in vm_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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c668e8173a8fc047b54a5c51b0fe4637e87836b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=c668e8173a8fc047b54a5c51b0fe4637e87836b6 commit c668e8173a8fc047b54a5c51b0fe4637e87836b6 Author: Robert Wing AuthorDate: 2023-01-20 11:10:53 +0000 Commit: Robert Wing CommitDate: 2023-01-20 11:10:53 +0000 vmm: take exclusive mem_segs_lock in vm_cleanup() The consumers of vm_cleanup() are vm_reinit() and vm_destroy(). The vm_reinit() call path is, here vmmdev_ioctl() takes mem_segs_lock: vmmdev_ioctl() vm_reinit() vm_cleanup(destroy=false) The call path for vm_destroy() is (mem_segs_lock not taken): sysctl_vmm_destroy() vmmdev_destroy() vm_destroy() vm_cleanup(destroy=true) Fix this by taking mem_segs_lock in vm_cleanup() when destroy == true. Reviewed by: corvink, markj, jhb Fixes: 67b69e76e8ee ("vmm: Use an sx lock to protect the memory map.") Differential Revision: https://reviews.freebsd.org/D38071 --- sys/amd64/vmm/vmm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 169109e8df6e..24f97a9244f0 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -651,6 +651,9 @@ vm_cleanup(struct vm *vm, bool destroy) struct mem_map *mm; int i; + if (destroy) + vm_xlock_memsegs(vm); + ppt_unassign_all(vm); if (vm->iommu != NULL) @@ -690,6 +693,7 @@ vm_cleanup(struct vm *vm, bool destroy) if (destroy) { for (i = 0; i < VM_MAX_MEMSEGS; i++) vm_free_memseg(vm, i); + vm_unlock_memsegs(vm); vmmops_vmspace_free(vm->vmspace); vm->vmspace = NULL; From nobody Fri Jan 20 20:25:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nz9wr5P81z30tQ3; Fri, 20 Jan 2023 20:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nz9wr4sSjz3LGk; Fri, 20 Jan 2023 20:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674246332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyGMabOUuJ4Hw7d/yY45Uk/rDHuAW5bcQmXA8X1kdTA=; b=XMdazZhqOcbQH2Ar7zJkw3uG0+C4prGWgM2XWNRqHqkBEt/VBEM47WEJMqVueAUJbyuRzL zxlD8eq+0xC3VNVeYGdKBKjgYt1GosM8O8CJz+j1qaC4BVuxShwCDIGTbdG6eaUhDxfmV9 liXIWKWtFKIgovBBk/oB/SCHxU1VDdsqOcAnrgyB7WXrD51f/R6jwPMOEPSAl6XvZQBxcB /PNhocM0W4b0+ov5PkorakClroJFa/tR3QNwZ9aSlnikBO3igX2MpG9pQ6XPSHwgFXb/z/ eRH03inSv1K0Fzugh6k2WPJA0ARtjhpsWvU0MoCergiTr8REM6On2+NRPnDufA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674246332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyGMabOUuJ4Hw7d/yY45Uk/rDHuAW5bcQmXA8X1kdTA=; b=V0if0gttV3s0MRXXAV0p3DP/yvx8dBBz3NYQAznneslWZjf72q3kDfZVKS/ZatPbF7Z/iG KpE3WTqQeAbHOdBvV277QrUlnDLtAU/CgSeOYc4hj2LkYqY8twh9R5gTred3afSGYFs9Vy ZwoAbrwVQhMbz6zeITMzZCvkCfchpuRmYah4XpTONF+3SJWviQUYqHF1+ZcGwK1xkLjuRx 1I286e2oKFuboP90Es8ZCkEqcNJM4GUrNI9CaM3R2CzEp+BGqJ7n7+uCTv9QGMUQK4PpRU UpQWOY9hHVChnx1Gj6irh/FliaAjDIpM4V05sZTaLGZ1IuMQNGw5ElqTsY3JCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674246332; a=rsa-sha256; cv=none; b=Vh5JhwsHUYUN9fc7i1IoOSYgSJB6UyH3GL8/E4mYZ44MUSEY70/sCZvAo2MoJ1sBAAFxbm CzX2h3ujTxQWL755pXY8GKMtcln73xAKx3WVPrHu2xc+GGllM+8d09SNwRTxJMczlxemg3 pNVXy9zclb1ppNRL5+fwCxyihUo1Mn5rCqYaeVAhCJjhnEp49k1ZmecFgbPXSM89aljv0q xD2bcPEHdsRRj5C8yhCPAHZ61dIysgt2nDYEft87CZugrZUWd0kydXUwDmo5kUDpFlCdQt C9QuHXGL5xQz4lugzpwqfBu/qicRWczsWbamga4q5USYSKgwdYR/dhQc3LUTXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nz9wr3wCmzkMf; Fri, 20 Jan 2023 20:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KKPW06000565; Fri, 20 Jan 2023 20:25:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KKPWfv000564; Fri, 20 Jan 2023 20:25:32 GMT (envelope-from git) Date: Fri, 20 Jan 2023 20:25:32 GMT Message-Id: <202301202025.30KKPWfv000564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 27029bc08f1d - main - vmm: fix use after free in ppt_detach() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27029bc08f1d7fdb39b2aee6ff8263f68dd93495 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=27029bc08f1d7fdb39b2aee6ff8263f68dd93495 commit 27029bc08f1d7fdb39b2aee6ff8263f68dd93495 Author: Robert Wing AuthorDate: 2023-01-20 11:25:27 +0000 Commit: Robert Wing CommitDate: 2023-01-20 11:25:27 +0000 vmm: fix use after free in ppt_detach() The vmm module destroys the host_domain before unloading the ppt module causing a use after free. This can happen when kldunload'ing vmm. Reviewed by: markj, jhb Differential Revision: https://reviews.freebsd.org/D38072 --- sys/amd64/vmm/intel/vtd.c | 2 ++ sys/amd64/vmm/io/iommu.c | 1 + sys/amd64/vmm/io/ppt.c | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c index 8f06dc823364..21e81223f6ee 100644 --- a/sys/amd64/vmm/intel/vtd.c +++ b/sys/amd64/vmm/intel/vtd.c @@ -446,6 +446,8 @@ vtd_add_device(void *arg, uint16_t rid) struct vtdmap *vtdmap; uint8_t bus; + KASSERT(dom != NULL, ("domain is NULL")); + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; pt_paddr = vtophys(dom->ptp); diff --git a/sys/amd64/vmm/io/iommu.c b/sys/amd64/vmm/io/iommu.c index 6a589f153815..01ce29539ec2 100644 --- a/sys/amd64/vmm/io/iommu.c +++ b/sys/amd64/vmm/io/iommu.c @@ -258,6 +258,7 @@ iommu_cleanup(void) } IOMMU_DISABLE(); IOMMU_DESTROY_DOMAIN(host_domain); + host_domain = NULL; IOMMU_CLEANUP(); } diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c index edb65a3ac07b..26dad1832b10 100644 --- a/sys/amd64/vmm/io/ppt.c +++ b/sys/amd64/vmm/io/ppt.c @@ -182,7 +182,9 @@ ppt_detach(device_t dev) num_pptdevs--; TAILQ_REMOVE(&pptdev_list, ppt, next); pci_disable_busmaster(dev); - iommu_add_device(iommu_host_domain(), pci_get_rid(dev)); + + if (iommu_host_domain() != NULL) + iommu_add_device(iommu_host_domain(), pci_get_rid(dev)); return (0); } From nobody Fri Jan 20 20:32:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzB4k24hkz30vfL; Fri, 20 Jan 2023 20:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzB4k1fbVz3M1L; Fri, 20 Jan 2023 20:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674246742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sEDybYUcjAf8nxtgYTaTSozs9oRXdoENE4hdIwQVFVU=; b=xaaoHR2p5x9q7A3WmsTcd9EfrEYKDYOlKbPY48hZtP2fABgYbO8lZcFUxOcCrJkD785KdS CzzNQePeAYqVONEdJVEju/IcX8EQqr45W5CbtSCW0gMNG20Spt0PfYysJy5Wm5uvUuEZkY jfea1c03oCSD594Dorp6ewA4K2WJFay1DDMemMWbl6U2iBCVNvChqbfFNsHdSKSRP6VW0t 4xdRTEMDSJCFUzr0U8+NkbexJgrsArIiV0elqioN5XGiVTguC1a3w5IPsSgYjxzqVlOWFe 3Er/rzM7FMY7nxsKj3MATn9wuqLqJZrdxISbZv8jzka3lQj4IxTySoiN8N2TBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674246742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sEDybYUcjAf8nxtgYTaTSozs9oRXdoENE4hdIwQVFVU=; b=kpb7QYTi77NiLknyPj56PgtdBe6q5+Vt/TOq+KBU7NDXpt5kCB1nYpJu0MwDJzayAC8aoV nw4INQmQusNSbRHbHcaiStMbNDo8uTd5Jr2U8lMBG86xN3ovBU3Xd5iMTrgWdtVKAvWtfH 7/o9GZLJxLCfkgZXB4VhlOiYBsR9o+Sz0nSX2p8aubXEZQMz6tCe8zHsJcKYxmWdzS8c2h F9/f+YmgCvqJtChnuPGzmhmOIdXeorpbjIM74S1nh0jk8AYUcl/6H2uUoC8Wqn0nE8NQ4e +AF9vUXj5pQQGWmyBpqfUs0V8rHXn/KIuHMUrqSYZvtLGHkKyIgYDgNjfygYqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674246742; a=rsa-sha256; cv=none; b=X5tqq7wEN2xaJVVF4cpa2BhO9/44ghEHR9xS36UXlJxYn6+tvVZq5RjCf2zFTPchYY2JRZ 27Y/qHk63SCu0BixUgHRWBRPZdAmF4gnGip3OAgQio1iGmgUMxCo9mmdzKwdqQpe4gykzo EloVtt1oaNS2OSTp8TP4VbXqJWD4iOckZuaLh2UpmtyrxHXgvznMDTezx1+73gR1n94qR7 nd0SqzE3FttNdXBWNrRrEylHyLINJgWpMHWlN4NibKyZQm1lUAf68F9/zEcXUeiOw04TqJ /TR38dw5L7R+YrGAoyV1yh0LbmsnV5vu7diSCrHkD6qvDajhsmr7qEmcTOWtyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzB4k0fmPzk8N; Fri, 20 Jan 2023 20:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KKWLuG014925; Fri, 20 Jan 2023 20:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KKWL2F014924; Fri, 20 Jan 2023 20:32:21 GMT (envelope-from git) Date: Fri, 20 Jan 2023 20:32:21 GMT Message-Id: <202301202032.30KKWL2F014924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6f7b5d5d3c2e - main - hms(4): Fix a copy/paste issue and check both _X and _Y List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 6f7b5d5d3c2e4704985723d5a23a2494050d8b6b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6f7b5d5d3c2e4704985723d5a23a2494050d8b6b commit 6f7b5d5d3c2e4704985723d5a23a2494050d8b6b Author: Yuri AuthorDate: 2023-01-20 20:25:17 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-01-20 20:29:53 +0000 hms(4): Fix a copy/paste issue and check both _X and _Y instead of checking _X 2 times. Reviewed by: wulf MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D38135 --- sys/dev/hid/hms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hms.c b/sys/dev/hid/hms.c index 87d207cc3f6b..f32760f60c4d 100644 --- a/sys/dev/hid/hms.c +++ b/sys/dev/hid/hms.c @@ -219,7 +219,7 @@ hms_probe(device_t dev) /* There should be at least one X or Y axis */ if (!hidmap_test_cap(sc->caps, HMS_REL_X) && - !hidmap_test_cap(sc->caps, HMS_REL_X) && + !hidmap_test_cap(sc->caps, HMS_REL_Y) && !hidmap_test_cap(sc->caps, HMS_ABS_X) && !hidmap_test_cap(sc->caps, HMS_ABS_Y)) return (ENXIO); From nobody Fri Jan 20 21:08:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzBst4KjMz310RY; Fri, 20 Jan 2023 21:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzBst3st0z3PnX; Fri, 20 Jan 2023 21:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674248882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZTBD/ZEhsb/VakqygxTM6CmoFuBCuMghLPUtxiBRueQ=; b=Rgy9mM7bbO2e4BdwW3panUmc+IplXWUt/3qY3flO7bRKKEpstodUmqcqnRYdUmD7lKno6C HlB0y0oJ8wzATJrYbXDbYkorhT/tDsUW5etzbXORkK66BGR4QGbJUhdzmiZtrBIVgv09XM VM2k+Xbdrys1MSns97BSPB/2zmlsp77gh1LXm0UZVderBRv3nxp9i8ZqQsOOpqVjhDW3sr dPZWEn8t9A9srs+0+98OyVSaFervdPoNWDeR5QucH98Il8gFleNhUT+Ct58YVcrWgxAxZJ r7/sfn8PoKQZ8/eMfvnhBTJMen+OqoUpbZJZTdKC2vWVyXV+QSPYpjRUnL9rzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674248882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZTBD/ZEhsb/VakqygxTM6CmoFuBCuMghLPUtxiBRueQ=; b=dlaZj3/Lpm44JncYHNs49nFWquFdE9qI2aKXCc3bJO5WmC3ffxEKek3wvngv+tWVPSnbeA YcwosAEkWG74wU/7eisj559RDUCDrSu8AXWj1M38+8el4ajWiQQLFUNnOGjHTVouooegzH 0r4WGq/SosD/w7QEqA0PAOgYQTG5axTMXtQ6lfe+ig4L1v9T3oRCY7lAxmpBWJND8WkI6T GC2U/ITV1dHJpxAG0AR4JLNE7e8h7YxOkyEAYa3zhgT+Ad/ef8asheqFzbWWWA4AcKag98 EfVIDTGZKsyAjZFs5ifwhsJ2EnJyM8yk4oLrm5r+hgNLF78DaLNKFLcmxdVk3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674248882; a=rsa-sha256; cv=none; b=aDNrWFdG060L8+ugwy/Bk6X0qokVKp1GdC9qwESbxG5pvd+3ga/TskPbdnSrDMr2daqH4+ V9QWuW7/FiPO/cAS8eReHxvT0G0vCmLnQaJ+MqRwMDoXHGNn7G8rJjXHwfU2PmsWF7tLeM uz3VEJNAbPEKh+9Y5qiSfQRRQcFvKLSUdNv318i3EG0j5FLmpYNuWfLHwK/XpXBO3GE4Yg snrD3wGOTwUYg8wXhXcTDjflZaky9ED20egYY4hbNSFfl/tDbnpVSUtO1xnDTd8hNvapuv +Swwqi2UBJV2RXmNbpg6wednoIEUEDAO2hTxXEcq/AnsxSVAHls9DKo+zqiSCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzBst2x7QzlJV; Fri, 20 Jan 2023 21:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KL82oO058490; Fri, 20 Jan 2023 21:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KL82pk058489; Fri, 20 Jan 2023 21:08:02 GMT (envelope-from git) Date: Fri, 20 Jan 2023 21:08:02 GMT Message-Id: <202301202108.30KL82pk058489@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: b338bdf7fb0d - stable/13 - openssh: remove mention of now-unused svn:keywords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b338bdf7fb0dfe771456a14cc4d8a08cc7b48033 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b338bdf7fb0dfe771456a14cc4d8a08cc7b48033 commit b338bdf7fb0dfe771456a14cc4d8a08cc7b48033 Author: Ed Maste AuthorDate: 2023-01-16 14:52:00 +0000 Commit: Ed Maste CommitDate: 2023-01-20 21:07:27 +0000 openssh: remove mention of now-unused svn:keywords Reported by: gshapiro (cherry picked from commit 9b7eddfeed465d4062dbad178261b806e97d6b62) --- crypto/openssh/FREEBSD-upgrade | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index fedbd80a2e3c..c8603577a2a2 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -73,10 +73,7 @@ $ git diff --diff-filter=M vendor/openssh/X.YpZ HEAD:crypto/openssh - Files that have modifications relative to the vendor code, and - only those files, must have the svn:keywords property set to - FreeBSD=%H and be listed in the 'keywords' file created by the - pre-merge script. + Review the diff for any unexpected changes. 12) Run the configure script: From nobody Fri Jan 20 21:08:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzBsv5JKyz310K0; Fri, 20 Jan 2023 21:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzBsv4c46z3Pnr; Fri, 20 Jan 2023 21:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674248883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y6Zjuzvwjz6eXgMWoCJfVGPYAKrgutfU5sfO6BEutuA=; b=oGN1viU4nDIh/d2B/bzAWE7YvIOhzH4TByONhMH//qdWYcJpK4v+ArpVWgqDGbAxNMF54t KhVUcnUSYqONkRg2kdfxUTP9iYvf+WiGoTscIOPKaOuQJeHJa/S8xX63w6SxMJg4kvbPz9 GjTSU9uqZcn724BVZKzSz3sQrjIuyK+mkCbTQeYBuFGdPrUKdWiHLGLWgWHaP7uvLVCuhE womAV25SzjAmgLB/H6fBM+wtY3d1rK6eSCsSpSVQdEwF7Ahg/E9QGNUt0HxCLjS5vbWH1K ihBllFt9Zi6MB8Ym6/v0hl//a8KuoUaaOGs2qG8UtQQBEx7HkrBjCUcXCGXTEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674248883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y6Zjuzvwjz6eXgMWoCJfVGPYAKrgutfU5sfO6BEutuA=; b=Ul9KTjokQWP6k/ezIFGviCuAWSSxrs4zh9FoWHIYPT0T5AJRmaCdmmgvtYLQOtTz9vA08Q kNRPiDYnA/7eQwnUVJLFZrYkh2CjHUwAJSE/88xhZRLa1q1Xdw05NVhaA6kuv3ybzDJsFE FI5k9gzHQOS9zq5j1w+PkMe05op5DJvM55JqEoVgQDh84SN/v7+i6frNsZywDPHjqAmonv tRDeBgd/s2zlyLE+6tGQ1tUDYsGPTzRTT5rERbOYEC3kQ6nWHloJWm+3byQgcaJZLTwUfO YeKzXeFDPeQtKyCuqnKzCNKvdvGNkV+88iUo9STQze0Hxq9jTXWlMO1vJ4Q7xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674248883; a=rsa-sha256; cv=none; b=ZiabOrdX99xLxolYlVDdJGffXjkxhtuE57CBeek6UFkPPlP/9EvvOFzYq3kze771lKKAYm mWQ1b7ZBguAJTUgarqQ/wPhGsW65hp1ceBFdKI1NW+HzJXylR21MnRqAACCAopQpCQhlGY F/I7ov6XFIznnVpkYSEYtn3u3zarJup9YAlHLDbzV/kDOkQ78vhZlLzRHRmVqPEkIm3P1b Yga3SHA/atHcnVtUe47/cDKppuTjLfDomBnzjp+R/in8nSHpg59BDZtNPUPE/BYGy/Bv7D PHj2KpgEM9k+exBI2v3DDccfWBVc2j/ShZreyeYbtNTe8gUi+zM6pHdHS63eFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzBsv3hJHzknc; Fri, 20 Jan 2023 21:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KL83Xw058515; Fri, 20 Jan 2023 21:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KL836E058514; Fri, 20 Jan 2023 21:08:03 GMT (envelope-from git) Date: Fri, 20 Jan 2023 21:08:03 GMT Message-Id: <202301202108.30KL836E058514@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: c84ec3076e7d - stable/13 - bhyve nvme: Fix uninitialized pointer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c84ec3076e7de10d7475fd9694ad64603e264d88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c84ec3076e7de10d7475fd9694ad64603e264d88 commit c84ec3076e7de10d7475fd9694ad64603e264d88 Author: Chuck Tuffli AuthorDate: 2022-06-09 20:05:46 +0000 Commit: Ed Maste CommitDate: 2023-01-20 21:07:27 +0000 bhyve nvme: Fix uninitialized pointer The Dataset Management code could free an uninitialized pointer if the device doesn't support the Dataset Management command. PR: 264548 Reported by: Robert Morris (cherry picked from commit 7376c08cc67e65ee660d51873129e34745ef5dd4) --- usr.sbin/bhyve/pci_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 9704081c12af..da19bef1b779 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -2598,7 +2598,7 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, uint16_t *status) { - struct nvme_dsm_range *range; + struct nvme_dsm_range *range = NULL; uint32_t nr, r, non_zero, dr; int err; bool pending = false; From nobody Fri Jan 20 21:08:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzBtz06G1z310Xj; Fri, 20 Jan 2023 21:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzBty6mNtz3QHm; Fri, 20 Jan 2023 21:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674248939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8tk6y0EzMHjXfn2t/8DZmd16SF7+5qndyVstM2xSnQs=; b=cp86enf/ab5idZT4ZHT2U1AoFkSvcAQLU+OwhoAzRjPCVts6Jwoobq3Ety/0izDk55XUqW 4NWZp7q6J+pSppkDMJsVhE1PLjJXvt/BjjktxV07zXTrRl0egZDZ8pKD5pR8BUwteTz8Zg 0JuGtrdQq7ggRFzETC6vZlAMDY6Wh92aVKZyP0O20HGDjC8jps+zYPQxmBSwUejDU6YUnb rlRFHZ5Qi6+5iT9vIgnNYHUPNFpZcNxxEciis2EaYMr4AA+yTCk8l4t/hox5f3Q36UsGp4 HxZrIAZi8L7YW9e1StYaPnPFWH/y4S+2D2KOLeMJ4iPBHVth/I3gHxMzWUdk8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674248938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8tk6y0EzMHjXfn2t/8DZmd16SF7+5qndyVstM2xSnQs=; b=AoqwC9msttOl3txEtP2Jrb5zRjJHGv1HgxWydxP9TIiSFKF7O2i8uW/v8dFBK9dwx6tdUK ojff5terk+xXsepFslTlLLZeMpW3+z86KNo+X5j6Zj9/ua90NoiNmjQ1dEx0RpwMhde7g8 J7MMY+7NWQJERYmBNJkANgzvfzDIUmstDdFlaqyS0B4HeV8PP3UsQafh9qgLaPIlOp/rgJ FMF2oDVTjR1uRCuHSe7JwhgIGJ6HONi3WHl1B6tfXUIrDHGkKDHKkEY8UO4Wef7coYpeBv 3HIMnOMGLtaN6BW8LuZYIh7e/8ekYz5//M/Bztuqp+O6/VxICudlEkxNBpVl5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674248938; a=rsa-sha256; cv=none; b=QZDjrBTxEmzkT0Crg2m1j/S1CMH/CJ15YlL8XkBifyUKr7h7jblPkF/MSMmOO1FeF+GQyR ONY/LMgBShGOKf9LIub90C8QTKAksWKvcz77sNtI8mpZOZx2sT896SsCOh/ZNkzJ+90SrT DxjTQ3gPoBUiorKioVBLf7wfDUn9b5FrDI13dNsflAb8A2TQzr4H7oD+MfGtI1+AfwhbJl RJo9k8YGjJp4RtsH9/USHQr0PkN9ht4jKCoOeyv9Qiz51aHz12mxfEL79TfUffoOtKiGVR 158+J/BTDtPXuc0va1HN5XRm/irCvz0oymmO8jqkk1LG6CknyxhetDOK46sXOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzBty5pB4zkyh; Fri, 20 Jan 2023 21:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KL8wma058782; Fri, 20 Jan 2023 21:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KL8wPt058781; Fri, 20 Jan 2023 21:08:58 GMT (envelope-from git) Date: Fri, 20 Jan 2023 21:08:58 GMT Message-Id: <202301202108.30KL8wPt058781@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: d4e643f6a51d - stable/12 - bhyve nvme: Fix uninitialized pointer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: d4e643f6a51d7fb8d8523419196449faa5fa047d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d4e643f6a51d7fb8d8523419196449faa5fa047d commit d4e643f6a51d7fb8d8523419196449faa5fa047d Author: Chuck Tuffli AuthorDate: 2022-06-09 20:05:46 +0000 Commit: Ed Maste CommitDate: 2023-01-20 21:08:28 +0000 bhyve nvme: Fix uninitialized pointer The Dataset Management code could free an uninitialized pointer if the device doesn't support the Dataset Management command. PR: 264548 Reported by: Robert Morris (cherry picked from commit 7376c08cc67e65ee660d51873129e34745ef5dd4) (cherry picked from commit c84ec3076e7de10d7475fd9694ad64603e264d88) --- usr.sbin/bhyve/pci_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 5f7a13d492f2..0d5324a8977b 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -2103,7 +2103,7 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, uint16_t *status) { - struct nvme_dsm_range *range; + struct nvme_dsm_range *range = NULL; uint32_t nr, r, non_zero, dr; int err; bool pending = false; From nobody Fri Jan 20 21:37:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzCX96l5Lz313ZG; Fri, 20 Jan 2023 21:37:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzCX96D3vz3jZl; Fri, 20 Jan 2023 21:37:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674250665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hk8Z59PVcc4fWPPY70z+psvVVbyuwfS9MXfvRimS5BU=; b=LTeQJLDlWyg71EwRX+8yiotUAyPqS5lloOegxdshTLGMaSXmZGg3EO2Ql5T5BHBhnBnLPQ lt+6eX3ZH08JXJenYpgjeHGRrHvErccnqtJX8oP7baGz8/EuMkZJop7Q2pYGTP+/UKzJvr pqy1wutCpo546yO8fgylyKV0sBdZ+ADCbRi0wV6B2qJQ/A1phKXHjipU3wP7tedmZxdGw4 sn4XL3AWG7bUiqw3OQnQ1jJQCYsOnLTuDDR1e85uBmonMno8YKD03xwLobw+zwMYmwLf7i 7IUv+iaTo5ULWhTIdZHoUbfgId4G78rPZfZUyENuYwpQeB9MypaM2VeFAxqyKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674250665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hk8Z59PVcc4fWPPY70z+psvVVbyuwfS9MXfvRimS5BU=; b=t28tH3gY26WKhN3etiWgVgekoG1He3Wx9zv3Knp09VzXx22x7/weUp6v8X/ToswmmEhUmx WypyQtk2trPOItN+qHDG/m5nUjt+BYBp7H/kf5NV7RiSwkr8H+/THb08lS2w1r9p9bJ2OA UQOq+G2Hn1r+raAGCJDAoRIqAKaWioHaYFegwZVk4mK4LHc8EFwfTkuhFWPlWjFkmvcIW7 DI6uBuGvpQbdAhcY/9vhJvDqxAvgm6bdkaxfzsu7AL9IucCY08waJL6wS+WSK7o8iS2Ucw N8oMxZFTolYsUZ5sG1xENUWxjwFKts81l5eVokpejzoxQ+A6G3nb1h+RjPHzQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674250665; a=rsa-sha256; cv=none; b=LttSWJeKUcxB77DE6isZPoX4mUCLgq/gMb9BUGuyNFu969GgAgWJ442bzIpGpk2hj/981f wbFd4pWSpoDt51hYLwJxoe8UkhT2il7MHZXdY7/m/FzJEooFIQOXwr8frHfugbMqtlsmmg h9ecXBHHqQ9nyynoDAdJ7CBXIw+uQ2hTQDTx97vgV5kjGyWFHBU7XNyejRoAbLI91VZT7X 6K38aeZ2QaCgrPK6SBOmX03FvoQC/EQVZID49dsyBPlU54dpogDGpm+8RD9uFsxk91llCu +WBYQCB1ndZZBuazYiv31bxSYEvEuRjqIIeaIcXKNCN0XPeKkqyXj9MEMU2j2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzCX95Ft5zl8K; Fri, 20 Jan 2023 21:37:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KLbj0V001273; Fri, 20 Jan 2023 21:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KLbjNm001272; Fri, 20 Jan 2023 21:37:45 GMT (envelope-from git) Date: Fri, 20 Jan 2023 21:37:45 GMT Message-Id: <202301202137.30KLbjNm001272@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: 5657f49ef33b - main - kern_umtx.c do_wait(): correct confusing indent List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 5657f49ef33b13934ccdc36e3990fdd71376baed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5657f49ef33b13934ccdc36e3990fdd71376baed commit 5657f49ef33b13934ccdc36e3990fdd71376baed Author: Konstantin Belousov AuthorDate: 2023-01-20 21:32:27 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 21:33:11 +0000 kern_umtx.c do_wait(): correct confusing indent Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/kern_umtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 75ce1dc43f81..86d644c835c7 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -1268,7 +1268,7 @@ do_wait(struct thread *td, void *addr, u_long id, uq = td->td_umtxq; if ((error = umtx_key_get(addr, TYPE_SIMPLE_WAIT, - is_private ? THREAD_SHARE : AUTO_SHARE, &uq->uq_key)) != 0) + is_private ? THREAD_SHARE : AUTO_SHARE, &uq->uq_key)) != 0) return (error); if (timeout != NULL) From nobody Fri Jan 20 21:56:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzCy21XRQz316FP; Fri, 20 Jan 2023 21:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzCy204nWz3lMd; Fri, 20 Jan 2023 21:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674251802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GR0oOb2Fu3clWqrLFfJHP7OC7tC2NZq/D4Brz+lTeLE=; b=IOX7buIFHRP95oHPhaBIPHVX66/L28zvJWoPJ9IV8l1u5TJ4f9I+fkuHr3G9X3mGpG00JH JuIpEcQpAr86Ha0cBk1fQZ/+Ct+HCuSCA2vqQgpjTKLZm0ZxmDR/9FCKBv2L6DyG/PqUsk Fo0SPNB8TUcy6JrcmTrJ72KAL7oYYdtD98AJo4yF9MXF/+GKwlanDrkdpAARzW1aYr5t7V o14dkY51fFelq6npEi8kZSKjk7RivqZg92RPgJIuLjbOJTcfIu0aFriBVlnq6ygIuP7GDB eDSI364bXwW5cFFzK8gZ1YAOhS4X/v0inW7Fii6StDcEU34026k+I+5FW7jguQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674251802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GR0oOb2Fu3clWqrLFfJHP7OC7tC2NZq/D4Brz+lTeLE=; b=EZeJkYeIn+BxodcYReMxH8X3iPsF8z5GaFQ60Jp88Z3IgS2Q/B6qJOYMQc3ByY8E5vEpFo um0KpJUzwNK7G8FyqJObnyHAtJPuRmi8cC/t4W6SK3EUbraPsENxU/02zI1wgSALBuAXtf bLaqozRSLtDsRyG3AC5lTa4mpwB0zJ8x1E1dhL3AiHGJUhzttV2aMGdNJgZScwULBD3+3l bzHb6Wcdo4zKpGOxbGhZHGv80VbMviHR/6mOpuaIuWvy08KYre0I7exwMyxsDZyjnBT5ts zYneqKa6Q3GmkKc/QbG9QwOEBDyK+Ng5D0ApHnLyEouU/OWC2yZZdAMkSkLgiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674251802; a=rsa-sha256; cv=none; b=ZWEI7IG8I3eJEIqbPhHlkxUHX+ZCJR+UqKkMMcprjWw20PLtRhhbJfEj4u1I/nknLNHt4g l0d4g/VC9UNQEkHApVXdoHWm/1LERfqKvyMaTAEhI99DQ2sc7SCDzRMZG031xSCImfOWhw cZd1upUMDYHo/i7AZPzGkpAO0z8hysxU8H6BeeCUETsW12CjtW+FnjC9A3t2I0cYzs65cw 7MQU0RHDqpKVGgdkgBXPYBk4ayC9C6lI5eolON4RaJIwAQ/tV8N4M8cKdVBIIY6OYseFkv 37126lHuf+cU2Suk5lPM9/LZ8rIJuB3xb9Y5U4+lvZZfEixaXLMVKmDWVuRV7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzCy16Dm6zlyD; Fri, 20 Jan 2023 21:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KLufhW030559; Fri, 20 Jan 2023 21:56:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KLufOn030558; Fri, 20 Jan 2023 21:56:41 GMT (envelope-from git) Date: Fri, 20 Jan 2023 21:56:41 GMT Message-Id: <202301202156.30KLufOn030558@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: 456f05756bbd - main - Handle int rank issues in in vn_getsize_locked() and vn_seek() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 456f05756bbdd818f7b2474faeef0d4d7baecd69 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=456f05756bbdd818f7b2474faeef0d4d7baecd69 commit 456f05756bbdd818f7b2474faeef0d4d7baecd69 Author: Konstantin Belousov AuthorDate: 2023-01-20 06:45:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 21:56:29 +0000 Handle int rank issues in in vn_getsize_locked() and vn_seek() In vn_getsize_locked(), when storing vattr.va_size of type u_quad_t into off_t size, we must avoid overflow. Then, the check for fsize < 0, introduced in the commit f45feecfb27ca51067d6789eaa43547cadc4990b 'vfs: add vn_getsize', is nop [1]. Reported and reviewed by: jhb Coverity CID: 1502346 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38133 --- sys/kern/vfs_subr.c | 9 +++++++-- sys/kern/vfs_vnops.c | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a1a73f2ddf38..008e646f2b7f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -7128,8 +7129,12 @@ vn_getsize_locked(struct vnode *vp, off_t *size, struct ucred *cred) ASSERT_VOP_LOCKED(vp, __func__); error = VOP_GETATTR(vp, &vattr, cred); - if (__predict_true(error == 0)) - *size = vattr.va_size; + if (__predict_true(error == 0)) { + if (vattr.va_size <= OFF_MAX) + *size = vattr.va_size; + else + error = EFBIG; + } return (error); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f3a6360eb250..48d15ce6ab25 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2656,9 +2656,7 @@ vn_seek(struct file *fp, off_t offset, int whence, struct thread *td) if (fsize == 0 && vp->v_type == VCHR && fo_ioctl(fp, DIOCGMEDIASIZE, &size, cred, td) == 0) fsize = size; - if (noneg && - (fsize > OFF_MAX || - (offset > 0 && fsize > OFF_MAX - offset))) { + if (noneg && offset > 0 && fsize > OFF_MAX - offset) { error = EOVERFLOW; break; } From nobody Fri Jan 20 23:17:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzFlH3gd7z2srDJ; Fri, 20 Jan 2023 23:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzFlH32X8z3qv9; Fri, 20 Jan 2023 23:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674256651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+RDb+kPgwlEVw9iD88qwXfezhSZS+JALmIuSoZcLhSc=; b=LLc9Vp0THD+jyggZdNxYAOba7WKPt77zBnLNhoZesjyctFo600PwaHpBoJQB9Bc1QwXpkP OX1OYlT9tghgdWC7lkT5XuhqZC8nY1tQ2AaAFa/FzydE5r2Gs3GMJPqTn7IijUOL5kvy0H C4pSCppaWDA4X6DYl5r1/hM+m7acuJJnAUESoXALKWVZcHCzKGrCZYNYlVTlb1qMdctbLF CMn9uQxv2N0EclOLdGzB800AN+HVSAVyjjqOdvAC7KWxadc11KJ3+0k3SYC5oiTYHOoWvC Kt2d2KD1lWOhM46RTzQG4+0cYfo7NX4D+/uXAMyqqyamd4ynLNlXHVohnDXCxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674256651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+RDb+kPgwlEVw9iD88qwXfezhSZS+JALmIuSoZcLhSc=; b=ZerEPLH7GdnV6mt7TzRmXbaLOq3oKLcrpAvjIsuy+B7hJJXFjNgij6BKCwQcjHrXq3eXn9 ZBocTkjJqcEPoyz8w+nRBppV/BngUj7J5ybLHj4IlFR36fZVMxs+fun2vHw5jEgFgLGsr6 cG4KdxFNk5Ap5PrbInk/E18xqcHi3Isjj1jUW2HAO25hZtG5lcVDSKI36SuoQ/44Cq+LTQ +IkXCFmj+dZx/H7nUW6lSoJByf3E5TLZLCLNnUKwG/R+Dumq5rxRFOpg0R94JgpfjiWq6D u6agrInAOa7XX4KHqR15eWrgzk4tiBhvQyZnuiU0oeXNTQArcL839h5+tdDkyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674256651; a=rsa-sha256; cv=none; b=ChvOoADTDmJ0FBz97vFtCr8KbF++5UJqrH4UbR7aAI8Jhr79kszNU53L9HMjNs0yT7rAgG nt7GG7nxcIt14PC+TVf3gLoRkjwfaUkjlVsKqbeC27kyqpC7iyEpQxEj3gHvLkUuLA+GNQ uEwpdWtyaI91EIZLYy7nvcpnINVLNv+iPQgyFM0sM4EPu+lKrzMCiChrkuS0Je76Daisoz PY9kASlE7gKTBJE4msBU5A6uL8uitBxL2K+97okOHUUzOWw9jJpbPvQv6lcfK8RT+2/Enh Q7+Td2aFFvf6nNOqTpyPYzl3mOvgtf1Lb5x04bwlMnBaBurIUMC810UGm8YK9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzFlH20Sxzp92; Fri, 20 Jan 2023 23:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KNHVoF045195; Fri, 20 Jan 2023 23:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KNHVqb045194; Fri, 20 Jan 2023 23:17:31 GMT (envelope-from git) Date: Fri, 20 Jan 2023 23:17:31 GMT Message-Id: <202301202317.30KNHVqb045194@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: 0cd612664eba - main - UPDATING: update notes on EFI booting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0cd612664ebaeaf960ffc8ebe4d3ff44be2a8eef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd612664ebaeaf960ffc8ebe4d3ff44be2a8eef commit 0cd612664ebaeaf960ffc8ebe4d3ff44be2a8eef Author: Warner Losh AuthorDate: 2023-01-20 23:13:54 +0000 Commit: Warner Losh CommitDate: 2023-01-20 23:13:54 +0000 UPDATING: update notes on EFI booting The notes on EFI booting and updating for ZFS had become dated and only partially updated. Expand the notes with a few more details and a pointer to laoder.efi(8) and uefi(8). Sponsored by: Netflix Discussed with: pauamma, karels Differential Revision: https://reviews.freebsd.org/D36629 --- UPDATING | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/UPDATING b/UPDATING index a0fdb839f668..689ddfedf6d3 100644 --- a/UPDATING +++ b/UPDATING @@ -2528,22 +2528,50 @@ COMMON ITEMS: ZFS notes --------- - When upgrading the boot ZFS pool to a new version, always follow - these two steps: + When upgrading the boot ZFS pool to a new version (via zpool upgrade), + always follow these three steps: - 1.) recompile and reinstall the ZFS boot loader and boot block + 1) recompile and reinstall the ZFS boot loader and boot block (this is part of "make buildworld" and "make installworld") - 2.) update the ZFS boot block on your boot drive + 2) update the ZFS boot block on your boot drive (only required when + doing a zpool upgrade): - The following example updates the ZFS boot block on the - freebsd-boot partition of a GPT partitioned drive ada0: - "gpart bootcode -p /boot/gptzfsboot -i $N ada0" - The value $N will typically be 1 (if booting from BIOS) or 2 (if - booting from EFI). + When booting on x86 via BIOS, use the following to update the ZFS boot + block on the freebsd-boot partition of a GPT partitioned drive ada0: + gpart bootcode -p /boot/gptzfsboot -i $N ada0 + The value $N will typically be 1. For EFI booting, see EFI notes. + + 3) zpool upgrade the root pool. New bootblocks will work with old + pools, but not vice versa, so they need to be updated before any + zpool upgrade. Non-boot pools do not need these updates. + EFI notes + --------- + + There are two locations the boot loader can be installed into. The + current location (and the default) is \efi\freebsd\loader.efi and using + efibootmgr(8) to configure it. The old location, that must be used on + deficient systems that don't honor efibootmgr(8) protocols, is the + fallback location of \EFI\BOOT\BOOTxxx.EFI. Generally, you will copy + /boot/loader.efi to this location, but on systems installed a long time + ago the ESP may be too small and /boot/boot1.efi may be needed unless + the ESP has been expanded in the meantime. + + Recent systems will have the ESP mounted on /boot/efi, but older ones + may not have it mounted at all, or mounted in a different + location. Older arm SD images with MBR used /boot/msdos as the + mountpoint. The ESP is a MSDOS filesystem. + + The EFI boot loader rarely needs to be updated. For ZFS booting, + however, you must update loader.efi before you do 'zpool upgrade' the + root zpool, otherwise the old loader.efi may reject the upgraded zpool + since it does not automatically understand some new features. + + See loader.efi(8) and uefi(8) for more details. + To build a kernel ----------------- If you are updating from a prior version of FreeBSD (even one just From nobody Fri Jan 20 23:17:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzFlJ4Qyvz2srGf; Fri, 20 Jan 2023 23:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzFlJ3q4Zz3rFW; Fri, 20 Jan 2023 23:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674256652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZR5alIsLT7fVXz/8c8+6HaDWnLJGCa7pvnJFUGLKkw=; b=RYa0XmM7wYiNFjBiIvEHC9B+AZRDpiGmrPkTj0hDuZyAhJVfii/Hpv1tcrCtm2kcaFOXO6 gFzNxhMrHOUJduTGfJwe8T3pVVqhoKzsGgLgl6UWw52kUnPOjO0q+yYEFwP2fQTQBeOyeD Ni88D+EuiHbxvX3nfeIlngq4DdiX8iFBLjMcR7jpen1A3EZke5f+j0Ll8fvOcpS0LI7gsJ GX9zULllar7UcV0dOaDqirU0Rr8IfpGrTVhQAfTLuxx65j2wq2j7qgKJmbXiF3Tr3fuLVs 9HVYzfaseYddD6LkHKEBCW1gZ9kiIZuRemJxUpPJTrvadHNEG7jMU29nOLBNog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674256652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZR5alIsLT7fVXz/8c8+6HaDWnLJGCa7pvnJFUGLKkw=; b=fCyraGhdoNq7vnn6bBDTDEBSM2PTKenGkvFGuzCLCvvLw5qFXCWAl9R4T6jCLOoUvs7grl +pkjNVVYKrT3Yy/KFZb/Rf3vLjAqCr5DgfjBTVMDh+FXvYuWjmiG6jK5cR497cfCMk1sfD hucKQDRmmaCCMFl7bB3eKbqSr5FvjzrPWn7eOS0oc1HJ9SobhAW4WQ7g2vRHXECu/vON3y iYDk/50pPst/X2c96dNUnsZou3gf/pCEwRM4JDr/nNItKul41oy3m/5gWdldFkBOBx/09a 9wR1zcrMGMF7nFIeAy1ZpnBv95H57Q7L+4KM44vTzaT3jKA0upg/2gvRG7RLGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674256652; a=rsa-sha256; cv=none; b=h2S0DZyv2mopA7ViDyn0GFS4kE0/v+lwuR+v4jz46qBVkI1f+BcgOLOUFBeBaMSv7sUgIJ MzvK1/qiU3t8McI4Ji5W2YSAQTpqoGm5C9oTr/fxn4OA6giLjtH3ca+2LUAha2HNCJw3GS PUwxxFDpGt3in0JMXyc1RP52sG0QAki0rCNSYrmd/TihGb5ocq6ffWfy5UZsz0NET4H68L 84Q7rfmH0rId6KbHUl86DYi0dEZ8zvQnUD96cuL28P7E/axQUOiM2xcvi3Pd1aKKwfmhD2 oH2mkdjQ0/siqiG8XhKO+SAU0EyV2G+YvsNLdPGrpLeSgG6MrAZcUAbYmy+ABg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzFlJ2fZlzp42; Fri, 20 Jan 2023 23:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KNHWP4045219; Fri, 20 Jan 2023 23:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KNHWgV045218; Fri, 20 Jan 2023 23:17:32 GMT (envelope-from git) Date: Fri, 20 Jan 2023 23:17:32 GMT Message-Id: <202301202317.30KNHWgV045218@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: 2c6b910716e9 - main - elf_common.h: define EF_ARM_EABI_VERSION List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 2c6b910716e93ebc1a2e24b63781419982edbd30 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2c6b910716e93ebc1a2e24b63781419982edbd30 commit 2c6b910716e93ebc1a2e24b63781419982edbd30 Author: Warner Losh AuthorDate: 2023-01-20 23:15:04 +0000 Commit: Warner Losh CommitDate: 2023-01-20 23:15:04 +0000 elf_common.h: define EF_ARM_EABI_VERSION The Linux distributions have had the EF_ARM_EABI_VERSION macro for a while now. The kernel of arm* targets build depends on it being in the host's elf.h environment. Add it here so it gets pulled in so there's one fewer hack required to build a Linux kernel on a FreeBSD host. Sponsored by: Netflix Reviewed by: jrtc27, kib, jhb Differential Revision: https://reviews.freebsd.org/D38139 --- sys/sys/elf_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 9366593b24bd..87b6d1fbaedd 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -332,6 +332,7 @@ typedef struct { #define EF_ARM_EABI_VER3 0x03000000 #define EF_ARM_EABI_VER4 0x04000000 #define EF_ARM_EABI_VER5 0x05000000 +#define EF_ARM_EABI_VERSION(x) (x & EF_ARM_EABIMASK) #define EF_ARM_INTERWORK 0x00000004 #define EF_ARM_APCS_26 0x00000008 #define EF_ARM_APCS_FLOAT 0x00000010 From nobody Fri Jan 20 23:19:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzFnR3dthz2srQ8; Fri, 20 Jan 2023 23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzFnR3Kxgz3rl8; Fri, 20 Jan 2023 23: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=1674256763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8AWvToi9IevfKJDfI34Pia8tLVbkQaoqF6k9U8qvKwM=; b=xkTpPE4mvKpXQ0egsK6aQZOmORxHcXRMAVkN3eSTyCjnI6ts57YpPfGjxPNFtyAlplwIut mF35LbrZ0glf42Qs+OoEiPlyXnr0K/FYu6NSFQoCcj9jOt654mp9G/T24OrqS6DJOKpKpb 9EPBzUqLeyPMbxOuGoYTApPc+OvcRvbuQVI1z2IYchq5bolU7pnI3b2UzQd6VgpO+EUUM+ R3XMUrA/gPmdyuoCqVRZeUvTBfYFq6jqTAJJwcJsHTqEYq7/8VgTjlfyHUn8XTuA8rcw4a o8D4W+ku5rQR9UsZxY4nfeQ6zV2xt8QNN7XQiJXEyrnpGYo5771N2vs0TpeGLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674256763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8AWvToi9IevfKJDfI34Pia8tLVbkQaoqF6k9U8qvKwM=; b=BXU4baQwyXLmsy6pGj4IMgyijs6q1RvkN4JBObz428RuoKxekcCdU/HmWY4L14R+kdcW0x RVgchMQgXZoiFLtgOpx4C4nqanxr87lBtR+QGYcw3fQn2IfZ9gWsHgThUSKdGDnJb3DbQN Tbmj0d4onZNyBixGnnXrLYhAyfMkB6FoRJm8CrgVhCE2wPcahAqGN8jpRuWZdpEU/mwW6L JJStwhESpPrpW00X4dnRBi4eaYXJnFH4KLVcsL4Pa9SHbYzAKI1urOXxCylSPuPLZTyyU2 eRLlpGD+30QiVjfGt/Tj46IHrCDwT5CRhv7JY17PH28swxFwbIbFxeFk5S3F8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674256763; a=rsa-sha256; cv=none; b=yPu2D7X1jCbmePZ/p22N8jzuTykHrwxpujoAmCKTi3y3tFjQO4oxr4zMs6hSICnHpFHGvc f//z4zi4t5SDBNVGVaE0dRnBJJ9eTQ2AtKorq8uL8HpmIt/59BKUQ6/OQNxBLIKgCQXaBR Debl/mgkucNXTOvJWpirj5FkGzPGhnRYHmDmtJZ22twLrYDMWm9B1UXnAnhJqXkGna6H4t v757fcWUE9XQEcjCgbwv7lj4HN9rdIVMM4iZBd45iHmgaDPO9Q3Qmce+fsmhOXoni+iBZV M4i4YiWn5uPI0sQIpdzV+1Ys951wrV4ukb25W7UjnqVLccGISny1DU/vAaCcvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzFnR2Mrjzp45; Fri, 20 Jan 2023 23:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KNJNNc045548; Fri, 20 Jan 2023 23:19:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KNJN6A045547; Fri, 20 Jan 2023 23:19:23 GMT (envelope-from git) Date: Fri, 20 Jan 2023 23:19:23 GMT Message-Id: <202301202319.30KNJN6A045547@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: e8c1bd7257bf - main - UPDATING: Remove old entries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e8c1bd7257bf0ec1f2315376e707b2171000502e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8c1bd7257bf0ec1f2315376e707b2171000502e commit e8c1bd7257bf0ec1f2315376e707b2171000502e Author: Warner Losh AuthorDate: 2023-01-20 23:17:45 +0000 Commit: Warner Losh CommitDate: 2023-01-20 23:17:45 +0000 UPDATING: Remove old entries Belatedly remove the entries older than the stable/11 branch point after stable/13 was created. This should be done shortly after the branch, not well after the branch point. Document this policy in UPDATING, though other checklists should likely be updated as well. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D37514 --- UPDATING | 854 +-------------------------------------------------------------- 1 file changed, 4 insertions(+), 850 deletions(-) diff --git a/UPDATING b/UPDATING index 689ddfedf6d3..970365c0fed3 100644 --- a/UPDATING +++ b/UPDATING @@ -1634,856 +1634,10 @@ https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html 20160708: The stable/11 branch has been created from head@r302406. -20160622: - The libc stub for the pipe(2) system call has been replaced with - a wrapper that calls the pipe2(2) system call and the pipe(2) - system call is now only implemented by the kernels that include - "options COMPAT_FREEBSD10" in their config file (this is the - default). Users should ensure that this option is enabled in - their kernel or upgrade userspace to r302092 before upgrading their - kernel. - -20160527: - CAM now strips the leading spaces from each SCSI disk's serial number. - This will affect users who create UFS filesystems on SCSI disks using - those disk's diskid device nodes. For example, if /etc/fstab - previously contained a line like - "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should - change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom - transforms like gmirror may also be affected. ZFS users should - generally be fine. - -20160523: - The bitstring(3) API has been updated with new functionality and - improved performance. But it is binary-incompatible with the old API. - Objects built with the new headers may not be linked against objects - built with the old headers. - -20160520: - The brk and sbrk functions have been removed from libc on arm64. - Binutils from ports has been updated to not link to these - functions and should be updated to the latest version before - installing a new libc. - -20160517: - The armv6 port now defaults to hard float ABI. Limited support - for running both hardfloat and soft float on the same system - is available using the libraries installed with -DWITH_LIBSOFT. - This has only been tested as an upgrade path for installworld - and packages may fail or need manual intervention to run. New - packages will be needed. - - To update an existing self-hosted armv6hf system, you must add - TARGET_ARCH=armv6 on the make command line for both the build - and the install steps. - -20160510: - Kernel modules compiled outside of a kernel build now default to - installing to /boot/modules instead of /boot/kernel. Many kernel - modules built this way (such as those in ports) already overrode - KMODDIR explicitly to install into /boot/modules. However, - manually building and installing a module from /sys/modules will - now install to /boot/modules instead of /boot/kernel. - -20160414: - The CAM I/O scheduler has been committed to the kernel. There should be - no user visible impact. This does enable NCQ Trim on ada SSDs. While the - list of known rogues that claim support for this but actually corrupt - data is believed to be complete, be on the lookout for data - corruption. The known rogue list is believed to be complete: - - o Crucial MX100, M550 drives with MU01 firmware. - o Micron M510 and M550 drives with MU01 firmware. - o Micron M500 prior to MU07 firmware - o Samsung 830, 840, and 850 all firmwares - o FCCT M500 all firmwares - - Crucial has firmware http://www.crucial.com/usa/en/support-ssd-firmware - with working NCQ TRIM. For Micron branded drives, see your sales rep for - updated firmware. Black listed drives will work correctly because these - drives work correctly so long as no NCQ TRIMs are sent to them. Given - this list is the same as found in Linux, it's believed there are no - other rogues in the market place. All other models from the above - vendors work. - - To be safe, if you are at all concerned, you can quirk each of your - drives to prevent NCQ from being sent by setting: - kern.cam.ada.X.quirks="0x2" - in loader.conf. If the drive requires the 4k sector quirk, set the - quirks entry to 0x3. - -20160330: - The FAST_DEPEND build option has been removed and its functionality is - now the one true way. The old mkdep(1) style of 'make depend' has - been removed. See 20160311 for further details. - -20160317: - Resource range types have grown from unsigned long to uintmax_t. All - drivers, and anything using libdevinfo, need to be recompiled. - -20160311: - WITH_FAST_DEPEND is now enabled by default for in-tree and out-of-tree - builds. It no longer runs mkdep(1) during 'make depend', and the - 'make depend' stage can safely be skipped now as it is auto ran - when building 'make all' and will generate all SRCS and DPSRCS before - building anything else. Dependencies are gathered at compile time with - -MF flags kept in separate .depend files per object file. Users should - run 'make cleandepend' once if using -DNO_CLEAN to clean out older - stale .depend files. - -20160306: - On amd64, clang 3.8.0 can now insert sections of type AMD64_UNWIND into - kernel modules. Therefore, if you load any kernel modules at boot time, - please install the boot loaders after you install the kernel, but before - rebooting, e.g.: - - make buildworld - make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installkernel KERNCONF=YOUR_KERNEL_HERE - make -C sys/boot install - - - Then follow the usual steps, described in the General Notes section, - below. - -20160305: - Clang, llvm, lldb and compiler-rt have been upgraded to 3.8.0. Please - see the 20141231 entry below for information about prerequisites and - upgrading, if you are not already using clang 3.5.0 or higher. - -20160301: - The AIO subsystem is now a standard part of the kernel. The - VFS_AIO kernel option and aio.ko kernel module have been removed. - Due to stability concerns, asynchronous I/O requests are only - permitted on sockets and raw disks by default. To enable - asynchronous I/O requests on all file types, set the - vfs.aio.enable_unsafe sysctl to a non-zero value. - -20160226: - The ELF object manipulation tool objcopy is now provided by the - ELF Tool Chain project rather than by GNU binutils. It should be a - drop-in replacement, with the addition of arm64 support. The - (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set - to obtain the GNU version if necessary. - -20160129: - Building ZFS pools on top of zvols is prohibited by default. That - feature has never worked safely; it's always been prone to deadlocks. - Using a zvol as the backing store for a VM guest's virtual disk will - still work, even if the guest is using ZFS. Legacy behavior can be - restored by setting vfs.zfs.vol.recursive=1. - -20160119: - The NONE and HPN patches has been removed from OpenSSH. They are - still available in the security/openssh-portable port. - -20160113: - With the addition of ypldap(8), a new _ypldap user is now required - during installworld. "mergemaster -p" can be used to add the user - prior to installworld, as documented in the handbook. - -20151216: - The tftp loader (pxeboot) now uses the option root-path directive. As a - consequence it no longer looks for a pxeboot.4th file on the tftp - server. Instead it uses the regular /boot infrastructure as with the - other loaders. - -20151211: - The code to start recording plug and play data into the modules has - been committed. While the old tools will properly build a new kernel, - a number of warnings about "unknown metadata record 4" will be produced - for an older kldxref. To avoid such warnings, make sure to rebuild - the kernel toolchain (or world). Make sure that you have r292078 or - later when trying to build 292077 or later before rebuilding. - -20151207: - Debug data files are now built by default with 'make buildworld' and - installed with 'make installworld'. This facilitates debugging but - requires more disk space both during the build and for the installed - world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes - in src.conf(5). - -20151130: - r291527 changed the internal interface between the nfsd.ko and - nfscommon.ko modules. As such, they must both be upgraded to-gether. - __FreeBSD_version has been bumped because of this. - -20151108: - Add support for unicode collation strings leads to a change of - order of files listed by ls(1) for example. To get back to the old - behaviour, set LC_COLLATE environment variable to "C". - - Databases administrators will need to reindex their databases given - collation results will be different. - - Due to a bug in install(1) it is recommended to remove the ancient - locales before running make installworld. - - rm -rf /usr/share/locale/* - -20151030: - The OpenSSL has been upgraded to 1.0.2d. Any binaries requiring - libcrypto.so.7 or libssl.so.7 must be recompiled. - -20151020: - Qlogic 24xx/25xx firmware images were updated from 5.5.0 to 7.3.0. - Kernel modules isp_2400_multi and isp_2500_multi were removed and - should be replaced with isp_2400 and isp_2500 modules respectively. - -20151017: - The build previously allowed using 'make -n' to not recurse into - sub-directories while showing what commands would be executed, and - 'make -n -n' to recursively show commands. Now 'make -n' will recurse - and 'make -N' will not. - -20151012: - If you specify SENDMAIL_MC or SENDMAIL_CF in make.conf, mergemaster - and etcupdate will now use this file. A custom sendmail.cf is now - updated via this mechanism rather than via installworld. If you had - excluded sendmail.cf in mergemaster.rc or etcupdate.conf, you may - want to remove the exclusion or change it to "always install". - /etc/mail/sendmail.cf is now managed the same way regardless of - whether SENDMAIL_MC/SENDMAIL_CF is used. If you are not using - SENDMAIL_MC/SENDMAIL_CF there should be no change in behavior. - -20151011: - Compatibility shims for legacy ATA device names have been removed. - It includes ATA_STATIC_ID kernel option, kern.cam.ada.legacy_aliases - and kern.geom.raid.legacy_aliases loader tunables, kern.devalias.* - environment variables, /dev/ad* and /dev/ar* symbolic links. - -20151006: - Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.7.0. - Please see the 20141231 entry below for information about prerequisites - and upgrading, if you are not already using clang 3.5.0 or higher. - -20150924: - Kernel debug files have been moved to /usr/lib/debug/boot/kernel/, - and renamed from .symbols to .debug. This reduces the size requirements - on the boot partition or file system and provides consistency with - userland debug files. - - When using the supported kernel installation method the - /usr/lib/debug/boot/kernel directory will be renamed (to kernel.old) - as is done with /boot/kernel. - - Developers wishing to maintain the historical behavior of installing - debug files in /boot/kernel/ can set KERN_DEBUGDIR="" in src.conf(5). - -20150827: - The wireless drivers had undergone changes that remove the 'parent - interface' from the ifconfig -l output. The rc.d network scripts - used to check presence of a parent interface in the list, so old - scripts would fail to start wireless networking. Thus, etcupdate(3) - or mergemaster(8) run is required after kernel update, to update your - rc.d scripts in /etc. - -20150827: - pf no longer supports 'scrub fragment crop' or 'scrub fragment drop-ovl' - These configurations are now automatically interpreted as - 'scrub fragment reassemble'. - -20150817: - Kernel-loadable modules for the random(4) device are back. To use - them, the kernel must have - - device random - options RANDOM_LOADABLE - - kldload(8) can then be used to load random_fortuna.ko - or random_yarrow.ko. Please note that due to the indirect - function calls that the loadable modules need to provide, - the build-in variants will be slightly more efficient. - - The random(4) kernel option RANDOM_DUMMY has been retired due to - unpopularity. It was not all that useful anyway. - -20150813: - The WITHOUT_ELFTOOLCHAIN_TOOLS src.conf(5) knob has been retired. - Control over building the ELF Tool Chain tools is now provided by - the WITHOUT_TOOLCHAIN knob. - -20150810: - The polarity of Pulse Per Second (PPS) capture events with the - uart(4) driver has been corrected. Prior to this change the PPS - "assert" event corresponded to the trailing edge of a positive PPS - pulse and the "clear" event was the leading edge of the next pulse. - - As the width of a PPS pulse in a typical GPS receiver is on the - order of 1 millisecond, most users will not notice any significant - difference with this change. - - Anyone who has compensated for the historical polarity reversal by - configuring a negative offset equal to the pulse width will need to - remove that workaround. - -20150809: - The default group assigned to /dev/dri entries has been changed - from 'wheel' to 'video' with the id of '44'. If you want to have - access to the dri devices please add yourself to the video group - with: - - # pw groupmod video -m $USER - -20150806: - The menu.rc and loader.rc files will now be replaced during - upgrades. Please migrate local changes to menu.rc.local and - loader.rc.local instead. - -20150805: - GNU Binutils versions of addr2line, c++filt, nm, readelf, size, - strings and strip have been removed. The src.conf(5) knob - WITHOUT_ELFTOOLCHAIN_TOOLS no longer provides the binutils tools. - -20150728: - As ZFS requires more kernel stack pages than is the default on some - architectures e.g. i386, it now warns if KSTACK_PAGES is less than - ZFS_MIN_KSTACK_PAGES (which is 4 at the time of writing). - - Please consider using 'options KSTACK_PAGES=X' where X is greater - than or equal to ZFS_MIN_KSTACK_PAGES i.e. 4 in such configurations. - -20150706: - sendmail has been updated to 8.15.2. Starting with FreeBSD 11.0 - and sendmail 8.15, sendmail uses uncompressed IPv6 addresses by - default, i.e., they will not contain "::". For example, instead - of ::1, it will be 0:0:0:0:0:0:0:1. This permits a zero subnet - to have a more specific match, such as different map entries for - IPv6:0:0 vs IPv6:0. This change requires that configuration - data (including maps, files, classes, custom ruleset, etc.) must - use the same format, so make certain such configuration data is - upgrading. As a very simple check search for patterns like - 'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'. To return to the old - behavior, set the m4 option confUSE_COMPRESSED_IPV6_ADDRESSES or - the cf option UseCompressedIPv6Addresses. - -20150630: - The default kernel entropy-processing algorithm is now - Fortuna, replacing Yarrow. - - Assuming you have 'device random' in your kernel config - file, the configurations allow a kernel option to override - this default. You may choose *ONE* of: - - options RANDOM_YARROW # Legacy /dev/random algorithm. - options RANDOM_DUMMY # Blocking-only driver. - - If you have neither, you get Fortuna. For most people, - read no further, Fortuna will give a /dev/random that works - like it always used to, and the difference will be irrelevant. - - If you remove 'device random', you get *NO* kernel-processed - entropy at all. This may be acceptable to folks building - embedded systems, but has complications. Carry on reading, - and it is assumed you know what you need. - - *PLEASE* read random(4) and random(9) if you are in the - habit of tweaking kernel configs, and/or if you are a member - of the embedded community, wanting specific and not-usual - behaviour from your security subsystems. - - NOTE!! If you use RANDOM_DUMMY and/or have no 'device - random', you will NOT have a functioning /dev/random, and - many cryptographic features will not work, including SSH. - You may also find strange behaviour from the random(3) set - of library functions, in particular sranddev(3), srandomdev(3) - and arc4random(3). The reason for this is that the KERN_ARND - sysctl only returns entropy if it thinks it has some to - share, and with RANDOM_DUMMY or no 'device random' this - will never happen. - -20150623: - An additional fix for the issue described in the 20150614 sendmail - entry below has been committed in revision 284717. - -20150616: - FreeBSD's old make (fmake) has been removed from the system. It is - available as the devel/fmake port or via pkg install fmake. - -20150615: - The fix for the issue described in the 20150614 sendmail entry - below has been committed in revision 284436. The work - around described in that entry is no longer needed unless the - default setting is overridden by a confDH_PARAMETERS configuration - setting of '5' or pointing to a 512 bit DH parameter file. - -20150614: - ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from - atf.test.mk (included from bsd.test.mk). Please upgrade devel/atf - and devel/kyua to version 0.20+ and adjust any calling code to work - with Kyuafile and kyua. - -20150614: - The import of openssl to address the FreeBSD-SA-15:10.openssl - security advisory includes a change which rejects handshakes - with DH parameters below 768 bits. sendmail releases prior - to 8.15.2 (not yet released), defaulted to a 512 bit - DH parameter setting for client connections. To work around - this interoperability, sendmail can be configured to use a - 2048 bit DH parameter by: - - 1. Edit /etc/mail/`hostname`.mc - 2. If a setting for confDH_PARAMETERS does not exist or - exists and is set to a string beginning with '5', - replace it with '2'. - 3. If a setting for confDH_PARAMETERS exists and is set to - a file path, create a new file with: - openssl dhparam -out /path/to/file 2048 - 4. Rebuild the .cf file: - cd /etc/mail/; make; make install - 5. Restart sendmail: - cd /etc/mail/; make restart - - A sendmail patch is coming, at which time this file will be - updated. - -20150604: - Generation of legacy formatted entries have been disabled by default - in pwd_mkdb(8), as all base system consumers of the legacy formatted - entries were converted to use the new format by default when the new, - machine independent format have been added and supported since FreeBSD - 5.x. - - Please see the pwd_mkdb(8) manual page for further details. - -20150525: - Clang and llvm have been upgraded to 3.6.1 release. Please see the - 20141231 entry below for information about prerequisites and upgrading, - if you are not already using 3.5.0 or higher. - -20150521: - TI platform code switched to using vendor DTS files and this update - may break existing systems running on Beaglebone, Beaglebone Black, - and Pandaboard: - - - dtb files should be regenerated/reinstalled. Filenames are the - same but content is different now - - GPIO addressing was changed, now each GPIO bank (32 pins per bank) - has its own /dev/gpiocX device, e.g. pin 121 on /dev/gpioc0 in old - addressing scheme is now pin 25 on /dev/gpioc3. - - Pandaboard: /etc/ttys should be updated, serial console device is - now /dev/ttyu2, not /dev/ttyu0 - -20150501: - soelim(1) from gnu/usr.bin/groff has been replaced by usr.bin/soelim. - If you need the GNU extension from groff soelim(1), install groff - from package: pkg install groff, or via ports: textproc/groff. - -20150423: - chmod, chflags, chown and chgrp now affect symlinks in -R mode as - defined in symlink(7); previously symlinks were silently ignored. - -20150415: - The const qualifier has been removed from iconv(3) to comply with - POSIX. The ports tree is aware of this from r384038 onwards. - -20150416: - Libraries specified by LIBADD in Makefiles must have a corresponding - DPADD_ variable to ensure correct dependencies. This is now - enforced in src.libnames.mk. - -20150324: - From legacy ata(4) driver was removed support for SATA controllers - supported by more functional drivers ahci(4), siis(4) and mvs(4). - Kernel modules ataahci and ataadaptec were removed completely, - replaced by ahci and mvs modules respectively. - -20150315: - Clang, llvm and lldb have been upgraded to 3.6.0 release. Please see - the 20141231 entry below for information about prerequisites and - upgrading, if you are not already using 3.5.0 or higher. - -20150307: - The 32-bit PowerPC kernel has been changed to a position-independent - executable. This can only be booted with a version of loader(8) - newer than January 31, 2015, so make sure to update both world and - kernel before rebooting. - -20150217: - If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014), - but before r278950, the RNG was not seeded properly. Immediately - upgrade the kernel to r278950 or later and regenerate any keys (e.g. - ssh keys or openssl keys) that were generated w/ a kernel from that - range. This does not affect programs that directly used /dev/random - or /dev/urandom. All userland uses of arc4random(3) are affected. - -20150210: - The autofs(4) ABI was changed in order to restore binary compatibility - with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to work - with the new kernel. - -20150131: - The powerpc64 kernel has been changed to a position-independent - executable. This can only be booted with a new version of loader(8), - so make sure to update both world and kernel before rebooting. - -20150118: - Clang and llvm have been upgraded to 3.5.1 release. This is a bugfix - only release, no new features have been added. Please see the 20141231 - entry below for information about prerequisites and upgrading, if you - are not already using 3.5.0. - -20150107: - ELF tools addr2line, elfcopy (strip), nm, size, and strings are now - taken from the ELF Tool Chain project rather than GNU binutils. They - should be drop-in replacements, with the addition of arm64 support. - The WITHOUT_ELFTOOLCHAIN_TOOLS= knob may be used to obtain the - binutils tools, if necessary. See 20150805 for updated information. - -20150105: - The default Unbound configuration now enables remote control - using a local socket. Users who have already enabled the - local_unbound service should regenerate their configuration - by running "service local_unbound setup" as root. - -20150102: - The GNU texinfo and GNU info pages have been removed. - To be able to view GNU info pages please install texinfo from ports. - -20141231: - Clang, llvm and lldb have been upgraded to 3.5.0 release. - - As of this release, a prerequisite for building clang, llvm and lldb is - a C++11 capable compiler and C++11 standard library. This means that to - be able to successfully build the cross-tools stage of buildworld, with - clang as the bootstrap compiler, your system compiler or cross compiler - should either be clang 3.3 or later, or gcc 4.8 or later, and your - system C++ library should be libc++, or libdstdc++ from gcc 4.8 or - later. - - On any standard FreeBSD 10.x or 11.x installation, where clang and - libc++ are on by default (that is, on x86 or arm), this should work out - of the box. - - On 9.x installations where clang is enabled by default, e.g. on x86 and - powerpc, libc++ will not be enabled by default, so libc++ should be - built (with clang) and installed first. If both clang and libc++ are - missing, build clang first, then use it to build libc++. - - On 8.x and earlier installations, upgrade to 9.x first, and then follow - the instructions for 9.x above. - - Sparc64 and mips users are unaffected, as they still use gcc 4.2.1 by - default, and do not build clang. - - Many embedded systems are resource constrained, and will not be able to - build clang in a reasonable time, or in some cases at all. In those - cases, cross building bootable systems on amd64 is a workaround. - - This new version of clang introduces a number of new warnings, of which - the following are most likely to appear: - - -Wabsolute-value - - This warns in two cases, for both C and C++: - * When the code is trying to take the absolute value of an unsigned - quantity, which is effectively a no-op, and almost never what was - intended. The code should be fixed, if at all possible. If you are - sure that the unsigned quantity can be safely cast to signed, without - loss of information or undefined behavior, you can add an explicit - cast, or disable the warning. - - * When the code is trying to take an absolute value, but the called - abs() variant is for the wrong type, which can lead to truncation. - If you want to disable the warning instead of fixing the code, please - make sure that truncation will not occur, or it might lead to unwanted - side-effects. - - -Wtautological-undefined-compare and - -Wundefined-bool-conversion - - These warn when C++ code is trying to compare 'this' against NULL, while - 'this' should never be NULL in well-defined C++ code. However, there is - some legacy (pre C++11) code out there, which actively abuses this - feature, which was less strictly defined in previous C++ versions. - - Squid and openjdk do this, for example. The warning can be turned off - for C++98 and earlier, but compiling the code in C++11 mode might result - in unexpected behavior; for example, the parts of the program that are - unreachable could be optimized away. - -20141222: - The old NFS client and server (kernel options NFSCLIENT, NFSSERVER) - kernel sources have been removed. The .h files remain, since some - utilities include them. This will need to be fixed later. - If "mount -t oldnfs ..." is attempted, it will fail. - If the "-o" option on mountd(8), nfsd(8) or nfsstat(1) is used, - the utilities will report errors. - -20141121: - The handling of LOCAL_LIB_DIRS has been altered to skip addition of - directories to top level SUBDIR variable when their parent - directory is included in LOCAL_DIRS. Users with build systems with - such hierarchies and without SUBDIR entries in the parent - directory Makefiles should add them or add the directories to - LOCAL_DIRS. - -20141109: - faith(4) and faithd(8) have been removed from the base system. Faith - has been obsolete for a very long time. - -20141104: - vt(4), the new console driver, is enabled by default. It brings - support for Unicode and double-width characters, as well as - support for UEFI and integration with the KMS kernel video - drivers. - - You may need to update your console settings in /etc/rc.conf, - most probably the keymap. During boot, /etc/rc.d/syscons will - indicate what you need to do. - - vt(4) still has issues and lacks some features compared to - syscons(4). See the wiki for up-to-date information: - https://wiki.freebsd.org/Newcons - - If you want to keep using syscons(4), you can do so by adding - the following line to /boot/loader.conf: - kern.vty=sc - -20141102: - pjdfstest has been integrated into kyua as an opt-in test suite. - Please see share/doc/pjdfstest/README for more details on how to - execute it. - -20141009: - gperf has been removed from the base system for architectures - that use clang. Ports that require gperf will obtain it from the - devel/gperf port. - -20140923: - pjdfstest has been moved from tools/regression/pjdfstest to - contrib/pjdfstest . - -20140922: - At svn r271982, The default linux compat kernel ABI has been adjusted - to 2.6.18 in support of the linux-c6 compat ports infrastructure - update. If you wish to continue using the linux-f10 compat ports, - add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are - encouraged to update their linux-compat packages to linux-c6 during - their next update cycle. - -20140729: - The ofwfb driver, used to provide a graphics console on PowerPC when - using vt(4), no longer allows mmap() of all physical memory. This - will prevent Xorg on PowerPC with some ATI graphics cards from - initializing properly unless x11-servers/xorg-server is updated to - 1.12.4_8 or newer. - -20140723: - The xdev targets have been converted to using TARGET and - TARGET_ARCH instead of XDEV and XDEV_ARCH. - -20140719: - The default unbound configuration has been modified to address - issues with reverse lookups on networks that use private - address ranges. If you use the local_unbound service, run - "service local_unbound setup" as root to regenerate your - configuration, then "service local_unbound reload" to load the - new configuration. - -20140709: - The GNU texinfo and GNU info pages are not built and installed - anymore, WITH_INFO knob has been added to allow to built and install - them again. - UPDATE: see 20150102 entry on texinfo's removal - -20140708: - The GNU readline library is now an INTERNALLIB - that is, it is - statically linked into consumers (GDB and variants) in the base - system, and the shared library is no longer installed. The - devel/readline port is available for third party software that - requires readline. - -20140702: - The Itanium architecture (ia64) has been removed from the list of - known architectures. This is the first step in the removal of the - architecture. - -20140701: - Commit r268115 has added NFSv4.1 server support, merged from - projects/nfsv4.1-server. Since this includes changes to the - internal interfaces between the NFS related modules, a full - build of the kernel and modules will be necessary. - __FreeBSD_version has been bumped. - -20140629: - The WITHOUT_VT_SUPPORT kernel config knob has been renamed - WITHOUT_VT. (The other _SUPPORT knobs have a consistent meaning - which differs from the behaviour controlled by this knob.) - -20140619: - Maximal length of the serial number in CTL was increased from 16 to - 64 chars, that breaks ABI. All CTL-related tools, such as ctladm - and ctld, need to be rebuilt to work with a new kernel. - -20140606: - The libatf-c and libatf-c++ major versions were downgraded to 0 and - 1 respectively to match the upstream numbers. They were out of - sync because, when they were originally added to FreeBSD, the - upstream versions were not respected. These libraries are private - and not yet built by default, so renumbering them should be a - non-issue. However, unclean source trees will yield broken test - programs once the operator executes "make delete-old-libs" after a - "make installworld". - - Additionally, the atf-sh binary was made private by moving it into - /usr/libexec/. Already-built shell test programs will keep the - path to the old binary so they will break after "make delete-old" - is run. - - If you are using WITH_TESTS=yes (not the default), wipe the object - tree and rebuild from scratch to prevent spurious test failures. - This is only needed once: the misnumbered libraries and misplaced - binaries have been added to OptionalObsoleteFiles.inc so they will - be removed during a clean upgrade. - -20140512: - Clang and llvm have been upgraded to 3.4.1 release. - -20140508: - We bogusly installed src.opts.mk in /usr/share/mk. This file should - be removed to avoid issues in the future (and has been added to - ObsoleteFiles.inc). - -20140505: - /etc/src.conf now affects only builds of the FreeBSD src tree. In the - past, it affected all builds that used the bsd.*.mk files. The old - behavior was a bug, but people may have relied upon it. To get this - behavior back, you can .include /etc/src.conf from /etc/make.conf - (which is still global and isn't changed). This also changes the - behavior of incremental builds inside the tree of individual - directories. Set MAKESYSPATH to ".../share/mk" to do that. - Although this has survived make universe and some upgrade scenarios, - other upgrade scenarios may have broken. At least one form of - temporary breakage was fixed with MAKESYSPATH settings for buildworld - as well... In cases where MAKESYSPATH isn't working with this - setting, you'll need to set it to the full path to your tree. - - One side effect of all this cleaning up is that bsd.compiler.mk - is no longer implicitly included by bsd.own.mk. If you wish to - use COMPILER_TYPE, you must now explicitly include bsd.compiler.mk - as well. - -20140430: - The lindev device has been removed since /dev/full has been made a - standard device. __FreeBSD_version has been bumped. - -20140424: - The knob WITHOUT_VI was added to the base system, which controls - building ex(1), vi(1), etc. Older releases of FreeBSD required ex(1) - in order to reorder files share/termcap and didn't build ex(1) as a - build tool, so building/installing with WITH_VI is highly advised for - build hosts for older releases. - - This issue has been fixed in stable/9 and stable/10 in r277022 and - r276991, respectively. - -20140418: - The YES_HESIOD knob has been removed. It has been obsolete for - a decade. Please move to using WITH_HESIOD instead or your builds - will silently lack HESIOD. - -20140405: - The uart(4) driver has been changed with respect to its handling - of the low-level console. Previously the uart(4) driver prevented - any process from changing the baudrate or the CLOCAL and HUPCL - control flags. By removing the restrictions, operators can make - changes to the serial console port without having to reboot. - However, when getty(8) is started on the serial device that is - associated with the low-level console, a misconfigured terminal - line in /etc/ttys will now have a real impact. - Before upgrading the kernel, make sure that /etc/ttys has the - serial console device configured as 3wire without baudrate to - preserve the previous behaviour. E.g: - ttyu0 "/usr/libexec/getty 3wire" vt100 on secure - -20140306: - Support for libwrap (TCP wrappers) in rpcbind was disabled by default - to improve performance. To re-enable it, if needed, run rpcbind - with command line option -W. - -20140226: - Switched back to the GPL dtc compiler due to updates in the upstream - dts files not being supported by the BSDL dtc compiler. You will need - to rebuild your kernel toolchain to pick up the new compiler. Core dumps - may result while building dtb files during a kernel build if you fail - to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler. - -20140216: - Clang and llvm have been upgraded to 3.4 release. - -20140216: - The nve(4) driver has been removed. Please use the nfe(4) driver - for NVIDIA nForce MCP Ethernet adapters instead. - -20140212: - An ABI incompatibility crept into the libc++ 3.4 import in r261283. - This could cause certain C++ applications using shared libraries built - against the previous version of libc++ to crash. The incompatibility - has now been fixed, but any C++ applications or shared libraries built - between r261283 and r261801 should be recompiled. - -20140204: - OpenSSH will now ignore errors caused by kernel lacking of Capsicum - capability mode support. Please note that enabling the feature in - kernel is still highly recommended. - -20140131: - OpenSSH is now built with sandbox support, and will use sandbox as - the default privilege separation method. This requires Capsicum - capability mode support in kernel. - -20140128: - The libelf and libdwarf libraries have been updated to newer - versions from upstream. Shared library version numbers for - these two libraries were bumped. Any ports or binaries - requiring these two libraries should be recompiled. - __FreeBSD_version is bumped to 1100006. - -20140110: - If a Makefile in a tests/ directory was auto-generating a Kyuafile - instead of providing an explicit one, this would prevent such - Makefile from providing its own Kyuafile in the future during - NO_CLEAN builds. This has been fixed in the Makefiles but manual - intervention is needed to clean an objdir if you use NO_CLEAN: - # find /usr/obj -name Kyuafile | xargs rm -f - -20131213: - The behavior of gss_pseudo_random() for the krb5 mechanism - has changed, for applications requesting a longer random string - than produced by the underlying enctype's pseudo-random() function. - In particular, the random string produced from a session key of - enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will - be different at the 17th octet and later, after this change. - The counter used in the PRF+ construction is now encoded as a - big-endian integer in accordance with RFC 4402. - __FreeBSD_version is bumped to 1100004. - -20131108: - The WITHOUT_ATF build knob has been removed and its functionality - has been subsumed into the more generic WITHOUT_TESTS. If you were - using the former to disable the build of the ATF libraries, you - should change your settings to use the latter. - -20131025: - The default version of mtree is nmtree which is obtained from - NetBSD. The output is generally the same, but may vary - slightly. If you found you need identical output adding - "-F freebsd9" to the command line should do the trick. For the - time being, the old mtree is available as fmtree. - -20131014: - libbsdyml has been renamed to libyaml and moved to /usr/lib/private. - This will break ports-mgmt/pkg. Rebuild the port, or upgrade to pkg - 1.1.4_8 and verify bsdyml not linked in, before running "make - delete-old-libs": - # make -C /usr/ports/ports-mgmt/pkg build deinstall install clean - or - # pkg install pkg; ldd /usr/local/sbin/pkg | grep bsdyml - -20131010: - The stable/10 branch has been created in subversion from head - revision r256279. +After branch N is created, entriels older than the N-2 branch point are removed +from this file. After stable/14 is branched and current becomes FreeBSD 15, +entries older than stable/12 branch point will be removed from current's +UPDATING file. COMMON ITEMS: From nobody Fri Jan 20 23:49:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzGSg1jQCz2sw5J; Fri, 20 Jan 2023 23:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzGSg19vKz3tpJ; Fri, 20 Jan 2023 23:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674258595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ahgFH1vg8fHv3wZbL7lxOUY3jOV1nYDW04nKcfS7/TU=; b=bxw3XWqqOqWyvoKPMy/S0jt2CP73mt/FCueIXcal7X+E/fuaVhyq7bjMTYLKirvs+D9Qrv 5wRJ0B8uKrhYp34qZlcOdIlQhm1F9R/+ZdJmIL8Dy9j5Cl7vmwgiBU/RcX/Wj9ygz/u0JD 0o3RNkUJ2sY63NHyGxl5rSCQhxkNJCnDV40DsNTMwCwN99CWOK3gL53oumkbYqwzs3Onzu f+CRx0SkuMmEfIz1MstrT0XVgMe7EdvyK9eMIl63QPmFSb5QD+VN8nkFsat7DF4JrDTeA5 csJ5obfTAplOVxWHc7sfvE/swB3lOYE94x6hAJbsPWXzUx35t+y+X7AddDplTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674258595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ahgFH1vg8fHv3wZbL7lxOUY3jOV1nYDW04nKcfS7/TU=; b=pyQ2MX1D+TPQGvl8E5TUkXAwoQ5m0uy9GdSVwS7gL/7ZAjm0Wgi81SSJDSWWNbnR66l19h vMZdFVVKEBeLCWmwEAJcgoKifDeBPjVff2TTi7b9M4fq1ag69hQLXzbV5LdKzSSzk33O3k Qc4SVPcDteCbBhJ68vG7zZdr4D7WblG3Sq7ZtynZYNFsINOeef6iSzV3Qkwoo8+DaxEGYj giMIcnJRJ4aNzh/ugyuunZ8r5GY2snwqBZe52RkkLJy5HhQTLni7es1AD9NS/datAWSmx3 oy0kszuXfudfftelbMlAaG5OhHDkrs7PLKUigHAy/GXrUGTpbpLf47ozLo0qfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674258595; a=rsa-sha256; cv=none; b=SprZaRxR9p38cF+//Jkjw3pz8MIpYHjThqFypqEh3JfYOu2d7MEeNHJbxnnZa10bvTMHT8 6fwUBgNa041+7o+8Vk1mqPNjS1N4QwluU8Blr2LjNC+RgcUPw5Hl/QkXEn97ccZi7cfo3o fkJJ1arzabIwb1/QPqbOC3em886nIqWc6oC5V9+gUr9FevJhtMUoF+FONcbpzuruHqaoH7 xHKLBzjlxKkBRThJNwrx0ILdw2b0U530ZyFQpSLeb1R/EupVp9lPNRv6xRH6+BI9w+EUd9 aXa/jAqdZODrZrjFc3VWq8cguEWHcUkuJQj2KpXxl7JeDCswt1RwBBtTqqlOnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzGSg0FG1zpkm; Fri, 20 Jan 2023 23:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KNnsci088177; Fri, 20 Jan 2023 23:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KNnsBc088176; Fri, 20 Jan 2023 23:49:54 GMT (envelope-from git) Date: Fri, 20 Jan 2023 23:49:54 GMT Message-Id: <202301202349.30KNnsBc088176@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: 30e0d2a51026 - main - linux: For better compatibility, provide compatible endian.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 30e0d2a51026830e5141ce3dd43854819bba910c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=30e0d2a51026830e5141ce3dd43854819bba910c commit 30e0d2a51026830e5141ce3dd43854819bba910c Author: Warner Losh AuthorDate: 2023-01-20 23:32:45 +0000 Commit: Warner Losh CommitDate: 2023-01-20 23:32:45 +0000 linux: For better compatibility, provide compatible endian.h Add endian.h. This includes sys/endian.h and then adds extra defines that glibc defines with double underscores for our _{BIG,BYTE,LITTLE,PDP}_ENDIAN macros. We also define __FLOAT_WORD_ORDER to be the same as _BYTE_ENDIAN since FreeBSD doesn't currently define this, and the default with glibc is exactly this for our platforms. Move common parts of endian.h and sys/endian.h into sys/_endian.h to limit namespace pollution from endian.h All this gives us good compatibility with Linux. There may be one or two upstreams that haven't integrated the patches I tried to send up. There are some minor differences: o The extra glibc macros are not defined. These are all controlled with either __ at the start, or only defined when glibc is being built. We also don't define macros that are used internally in glibc that would pollute the namespace. o For complete compatibility, this change must also be paired with providing a glibc-compatible byteswap.h. Sponsored by: Netflix Reviewed by: mhorne, markj, jhb Differential Revision: https://reviews.freebsd.org/D31962 --- include/Makefile | 4 ++-- include/endian.h | 43 +++++++++++++++++++++++++++++++++++++++++++ sys/sys/_endian.h | 36 +++++++++++++++++++++++++++++++++++- sys/sys/endian.h | 42 ++++++------------------------------------ 4 files changed, 86 insertions(+), 39 deletions(-) diff --git a/include/Makefile b/include/Makefile index 643451367b1b..aa4c115a3931 100644 --- a/include/Makefile +++ b/include/Makefile @@ -14,8 +14,8 @@ SUBDIR+= i386 SUBDIR_PARALLEL= INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ - dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ - fts.h ftw.h getopt.h glob.h grp.h \ + dirent.h dlfcn.h elf.h elf-hints.h endian.h err.h fmtmsg.h fnmatch.h \ + fstab.h fts.h ftw.h getopt.h glob.h grp.h \ ieeefp.h ifaddrs.h \ inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \ diff --git a/include/endian.h b/include/endian.h new file mode 100644 index 000000000000..c7b78217cedd --- /dev/null +++ b/include/endian.h @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2021 M. Warner Losh + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * A mostly Linux/glibc-compatible endian.h + */ + +#ifndef _ENDIAN_H_ +#define _ENDIAN_H_ + +/* + * FreeBSD's sys/_endian.h is very close to the interface provided on Linux by + * glibc's endian.h. + */ +#include + +/* + * glibc uses double underscore for these symbols. Define these unconditionally. + * The compiler defines __BYTE_ORDER__ these days, so we don't do anything + * with that since sys/endian.h defines _BYTE_ORDER based on it. + */ +#define __BIG_ENDIAN _BIG_ENDIAN +#define __BYTE_ORDER _BYTE_ORDER +#define __LITTLE_ENDIAN _LITTLE_ENDIAN +#define __PDP_ENDIAN _PDP_ENDIAN + +/* + * FreeBSD's sys/endian.h and machine/endian.h doesn't define a separate + * byte order for floats. Use the host non-float byte order. + */ +#define __FLOAT_WORD_ORDER _BYTE_ORDER + +/* + * We don't define BIG_ENDI, LITTLE_ENDI, HIGH_HALF and LOW_HALF macros that + * glibc's endian.h defines since those appear to be internal to internal to + * glibc. We also don't try to emulate the various helper macros that glibc + * uses to limit namespace visibility. + */ + +#endif /* _ENDIAN_H_ */ diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h index 936962cc729f..72e1a40a8deb 100644 --- a/sys/sys/_endian.h +++ b/sys/sys/_endian.h @@ -32,7 +32,7 @@ #ifndef _SYS__ENDIAN_H_ #define _SYS__ENDIAN_H_ -#ifndef _MACHINE_ENDIAN_H_ +#if !defined(_MACHINE_ENDIAN_H_) && !defined(_ENDIAN_H_) #error "sys/_endian.h should not be included directly" #endif @@ -89,4 +89,38 @@ #define __ntohs(x) ((__uint16_t)(x)) #endif +/* + * Host to big endian, host to little endian, big endian to host, and little + * endian to host byte order functions as detailed in byteorder(9). + */ +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define htobe16(x) __bswap16((x)) +#define htobe32(x) __bswap32((x)) +#define htobe64(x) __bswap64((x)) +#define htole16(x) ((uint16_t)(x)) +#define htole32(x) ((uint32_t)(x)) +#define htole64(x) ((uint64_t)(x)) + +#define be16toh(x) __bswap16((x)) +#define be32toh(x) __bswap32((x)) +#define be64toh(x) __bswap64((x)) +#define le16toh(x) ((uint16_t)(x)) +#define le32toh(x) ((uint32_t)(x)) +#define le64toh(x) ((uint64_t)(x)) +#else /* _BYTE_ORDER != _LITTLE_ENDIAN */ +#define htobe16(x) ((uint16_t)(x)) +#define htobe32(x) ((uint32_t)(x)) +#define htobe64(x) ((uint64_t)(x)) +#define htole16(x) __bswap16((x)) +#define htole32(x) __bswap32((x)) +#define htole64(x) __bswap64((x)) + +#define be16toh(x) ((uint16_t)(x)) +#define be32toh(x) ((uint32_t)(x)) +#define be64toh(x) ((uint64_t)(x)) +#define le16toh(x) __bswap16((x)) +#define le32toh(x) __bswap32((x)) +#define le64toh(x) __bswap64((x)) +#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ + #endif /* _SYS__ENDIAN_H_ */ diff --git a/sys/sys/endian.h b/sys/sys/endian.h index faac0458ae2c..d91c442e9238 100644 --- a/sys/sys/endian.h +++ b/sys/sys/endian.h @@ -55,6 +55,12 @@ typedef __uint64_t uint64_t; #define _UINT64_T_DECLARED #endif +/* + * Note: While tempting to try to avoid namespace pollution from this file, + * several software packages assume these marcos are defined, even when it + * defines _POSIX_C_SOURCE to request an unpolluted namespace. + */ + /* * General byte order swapping functions. */ @@ -62,42 +68,7 @@ typedef __uint64_t uint64_t; #define bswap32(x) __bswap32(x) #define bswap64(x) __bswap64(x) -/* - * Host to big endian, host to little endian, big endian to host, and little - * endian to host byte order functions as detailed in byteorder(9). - */ -#if _BYTE_ORDER == _LITTLE_ENDIAN -#define htobe16(x) __bswap16((x)) -#define htobe32(x) __bswap32((x)) -#define htobe64(x) __bswap64((x)) -#define htole16(x) ((uint16_t)(x)) -#define htole32(x) ((uint32_t)(x)) -#define htole64(x) ((uint64_t)(x)) - -#define be16toh(x) __bswap16((x)) -#define be32toh(x) __bswap32((x)) -#define be64toh(x) __bswap64((x)) -#define le16toh(x) ((uint16_t)(x)) -#define le32toh(x) ((uint32_t)(x)) -#define le64toh(x) ((uint64_t)(x)) -#else /* _BYTE_ORDER != _LITTLE_ENDIAN */ -#define htobe16(x) ((uint16_t)(x)) -#define htobe32(x) ((uint32_t)(x)) -#define htobe64(x) ((uint64_t)(x)) -#define htole16(x) __bswap16((x)) -#define htole32(x) __bswap32((x)) -#define htole64(x) __bswap64((x)) - -#define be16toh(x) ((uint16_t)(x)) -#define be32toh(x) ((uint32_t)(x)) -#define be64toh(x) ((uint64_t)(x)) -#define le16toh(x) __bswap16((x)) -#define le32toh(x) __bswap32((x)) -#define le64toh(x) __bswap64((x)) -#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ - /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ - static __inline uint16_t be16dec(const void *pp) { @@ -203,5 +174,4 @@ le64enc(void *pp, uint64_t u) le32enc(p, (uint32_t)(u & 0xffffffffU)); le32enc(p + 4, (uint32_t)(u >> 32)); } - #endif /* _SYS_ENDIAN_H_ */ From nobody Fri Jan 20 23:49:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzGSh31yxz2swV3; Fri, 20 Jan 2023 23:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzGSh2DcGz3tjv; Fri, 20 Jan 2023 23:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674258596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6sKFanVV68JxMpeS8vy+yX1MJ4pGL6qZ8BavUFD4iqE=; b=SaTwnBWXf31Mys4RHvquwW5YFN4BgrI8zHY+68wb3iUCKsjuUuryVaSkVzNu+/EnsgYHdm U1FyYxfxSkc78hMfGM1Gpie+FJN4aKidW62+Uaf4N8v1MBkK0ShrQwHXiPCt4xqq6QCceK T4GFWMDgn/cPG0b9JC2X4L7N9ACHAXLJp8GLQgE4M4WlOgxlV6yXBxe7TJWAhQWYYFl1oD bKpZC7P06Vtk+Bvz1LysYYueJVxqwiIVUUai0PCRjeGce1AOxDRAhtq2zgWAjFCNYptP7k j9FfZrpdwJf6PywXzvH0snJpLpJk0Y/77/IVKOxuD2QmgLMyF5c6r+YMFGxmvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674258596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6sKFanVV68JxMpeS8vy+yX1MJ4pGL6qZ8BavUFD4iqE=; b=hPk0ZGpEAc2TwzkS15ODus66cjv5kHugbQGk8M3i7X43BeViPjo2k9f65XKCONJZvUCd/R p829Z1qqANllpRf0khNwSCePpi8fR7THahseYhhW30jJ4F5hfybMIk0oLa9XundMq2TPE5 c0lErTJfpzTdWESzuSIipchlQg8vV94t5ewNpFQs0xMAQbB7uV6xirKQT3vunPS/bYt7C3 1JZNrX9DBiD0vYC8KocmaL+mNdhnL8W9tJk/mna68l925fttPoY9NeJhID6sRRrWOcf1w0 GYij7C1MDL/BhXBDEdEMW1BegIZezIVTWVw46i3kvQRlmBSQIPp6vVfei4mdtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674258596; a=rsa-sha256; cv=none; b=gpUxZAk6DqbXbJQRsK6F+HELCyoBa3h2wHPWvKnErntDCXvF3tylTbgf9gZO3a5V0aLfXM WrzWSaZ+BUED8OFlNNYkPY/yCFviMgH0XFphRYRAj+X2KkWGYSl6aWgHWMRL8Ud1/9ovhX OkJDRbAoOhiR97WPGkKQHupsiccQBYtHMXWa64Zx85pz/xKplgcV26wLmRSWM0mX1xcLHa VoSislYx9n5MwWd4Xm4Yyzkzwhol6FDV49cjQFzclb7lwRNQLmyz9H8GhoYHXaUijlEyZ7 OHqWrSD1lCLawBMCUyKLkCjyRM+e61TblZMI7QaSdsuOviZ2F90CKje2OEGVqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzGSh1L74zplP; Fri, 20 Jan 2023 23:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KNnucu088206; Fri, 20 Jan 2023 23:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KNnunt088205; Fri, 20 Jan 2023 23:49:56 GMT (envelope-from git) Date: Fri, 20 Jan 2023 23:49:56 GMT Message-Id: <202301202349.30KNnunt088205@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: 1761b09bf42d - main - byteswap.h: Add a glibc/linux compatible byteswap.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 1761b09bf42d2842e82c1ac614c23d31c4d4c0dc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1761b09bf42d2842e82c1ac614c23d31c4d4c0dc commit 1761b09bf42d2842e82c1ac614c23d31c4d4c0dc Author: Warner Losh AuthorDate: 2023-01-20 23:33:37 +0000 Commit: Warner Losh CommitDate: 2023-01-20 23:37:39 +0000 byteswap.h: Add a glibc/linux compatible byteswap.h For endian.h to work instead of sys/endian.h, some software needs byteswap.h available. It must define {__,}byteswap_{16,32,64}. Included sys/_endian.h to get an appropriate __byteswap16, etc and defines the new macros in terms of them. Enhance _endian.h to allow it to be included from here too. Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D32051 --- include/Makefile | 3 ++- include/byteswap.h | 41 +++++++++++++++++++++++++++++++++++++++++ sys/sys/_endian.h | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/include/Makefile b/include/Makefile index aa4c115a3931..24124a1f366b 100644 --- a/include/Makefile +++ b/include/Makefile @@ -12,7 +12,8 @@ SUBDIR= arpa protocols rpcsvc rpc xlocale SUBDIR+= i386 .endif SUBDIR_PARALLEL= -INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ +INCS= a.out.h ar.h assert.h bitstring.h byteswap.h \ + complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h endian.h err.h fmtmsg.h fnmatch.h \ fstab.h fts.h ftw.h getopt.h glob.h grp.h \ diff --git a/include/byteswap.h b/include/byteswap.h new file mode 100644 index 000000000000..a7b816ee82b0 --- /dev/null +++ b/include/byteswap.h @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2021 M. Warner Losh + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * A mostly Linux/glibc-compatible byteswap.h + */ + +#ifndef _BYTESWAP_H_ +#define _BYTESWAP_H_ + +/* + * sys/_endian.h brings in the shared interfaces between BSD's sys/endian.h, and + * glibc's endian.h. However, we need to include it here to get the + * __bswap{16,32,64} definitions that we use. sys/_endian.h has been consturcted to + * be compatible with including , or both in either order, + * as well as providing the BSD the bulk of sys/endian.h functionality. + */ +#include + +/* + * glibc's defines the bswap_* and __bswap_* macros below. Most + * software uses either just , or both and + * . However, one can't define bswap16, etc in because + * several software packages will define them only when they detect + * is included (but not when sys/endian.h is included). Defining bswap16, etc + * here causes compilation errors for those packages. and + * need to be paired together, with the below defines here, for + * the highest level of glibc compatibility. + */ +#define __bswap_16(x) __bswap16(x) +#define __bswap_32(x) __bswap32(x) +#define __bswap_64(x) __bswap64(x) + +#define bswap_16(x) __bswap16(x) +#define bswap_32(x) __bswap32(x) +#define bswap_64(x) __bswap64(x) + +#endif /* _BYTESWAP_H_ */ diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h index 72e1a40a8deb..ff909f532663 100644 --- a/sys/sys/_endian.h +++ b/sys/sys/_endian.h @@ -32,7 +32,7 @@ #ifndef _SYS__ENDIAN_H_ #define _SYS__ENDIAN_H_ -#if !defined(_MACHINE_ENDIAN_H_) && !defined(_ENDIAN_H_) +#if !defined(_MACHINE_ENDIAN_H_) && !defined(_BYTESWAP_H_) && !defined(_ENDIAN_H_) #error "sys/_endian.h should not be included directly" #endif From nobody Fri Jan 20 23:49:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzGSj3f9Sz2swP7; Fri, 20 Jan 2023 23:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzGSj38H2z3vBL; Fri, 20 Jan 2023 23:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674258597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/3KiZGf/mHLOky/RjALo4Jw7/WbtoXh6xEj8shEiys=; b=QXZjTIVsXS9ubSBsoiPOGL8R+kYQ9+/jM2NaPpHH3FwGDalr5vlBp5yke4H4jQzGoqBfd3 of+W2p8Yo25pNUUtKNxj1WyiIYbklfl7DSHT+yLZPtSc+Rh6WyGhhdLtooNM4KhmeEEHwu o8OgFO9KDrh6mgM4zaA0f5jYfcCd/mEqlQXwlm33FW7Zupi3RGHKdEbySpIeTOjJ97E+kC M9hYXBOo/QBZl4l7/r1SvxCkOT0NQkWfJ3oQk9sLNlarwBDYx74CIRvBAUhVOiEj1juxGZ 1dem4T5HzVp5UAPPauCViEBna8dcf/qEzwVeYBy7UJrcYv6AI1QgUBQK2lS4LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674258597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/3KiZGf/mHLOky/RjALo4Jw7/WbtoXh6xEj8shEiys=; b=UTNZPQdrRyaC3KtXEPgctNoj0+dbO1Otlaeu5IsODDioA3E+y0ujc4euFEGd1rZ8pdJHmg WkPxaRN4KtqVdPQ8B1+NGFaQZASP/A9dNPBbNtKK5N/e/jFe7Uj1e7kFFUOASHz2dvjqTt IxWUUN8j9R8TrEfMxu5aDUGn/iJdPdOQSN9ReiDUJfbcqN3Go0dFZ6xvnn3zQSUbDH+2ek tlOd1aFu36teqerSv9+9kHRhHNs3/IL0mr4IXbhrIOFxjbs4daZbGkhgKnWSixDFCii/CM IG//aVJHSSD0vj1rGKWKQJHYY4SWjefJ7XkNbI6o4B7mYKi7HtxmbyxiKXIXXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674258597; a=rsa-sha256; cv=none; b=RozBh/6+fMGOjYo18GHHSUvq0WQYdgShuP9bEzXEVlgdNCf51USThksU7Gw0CjpWbM+dEu wzCFoEpcaUxQgCewKkOtYH3X0z+eJuooc90reZKfmXDwid+bYUPc6nPcnJh2/+PSmPeirl YKFA5a0BLKArFXzK/74qS8303b2C61hOk9jijKkOOYSeBWhNDvj1tTPPfFjHUCeLiLBXUY gqvu1ntPfpf5nBjasVb3Myu1sbg/TqQWdOWmVL/D/kv0SNA8/P1DqMxEmLLqA81tWBBnWX TFhGO+w3OZCZrgRYd1DWsjln5VBWqd2rGJOG3yb3M2k7aU/RlQ979c+11a1O4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzGSj2FgzzpLS; Fri, 20 Jan 2023 23:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30KNnvpf088230; Fri, 20 Jan 2023 23:49:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30KNnvPw088229; Fri, 20 Jan 2023 23:49:57 GMT (envelope-from git) Date: Fri, 20 Jan 2023 23:49:57 GMT Message-Id: <202301202349.30KNnvPw088229@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: c52c98e69a2e - main - elf_common.h: Add parens to EF_ARM_EABI_VERSION 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c52c98e69a2e19879c20d3011eb1785de143dd5f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c52c98e69a2e19879c20d3011eb1785de143dd5f commit c52c98e69a2e19879c20d3011eb1785de143dd5f Author: Warner Losh AuthorDate: 2023-01-20 23:46:05 +0000 Commit: Warner Losh CommitDate: 2023-01-20 23:46:05 +0000 elf_common.h: Add parens to EF_ARM_EABI_VERSION macro Due to my haste, I missed John's suggestion in the review that I add () here. Belatedly add them. It didn't matter for my test case, but there's some pathological uses where it might matter. Suggested by: jrtc23, jhb Sponsored by: Netflix --- sys/sys/elf_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 87b6d1fbaedd..657846d80111 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -332,7 +332,7 @@ typedef struct { #define EF_ARM_EABI_VER3 0x03000000 #define EF_ARM_EABI_VER4 0x04000000 #define EF_ARM_EABI_VER5 0x05000000 -#define EF_ARM_EABI_VERSION(x) (x & EF_ARM_EABIMASK) +#define EF_ARM_EABI_VERSION(x) ((x) & EF_ARM_EABIMASK) #define EF_ARM_INTERWORK 0x00000004 #define EF_ARM_APCS_26 0x00000008 #define EF_ARM_APCS_FLOAT 0x00000010 From nobody Sat Jan 21 02:20:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzKp41fZrz2v0VY; Sat, 21 Jan 2023 02:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzKp41Dhrz4GLh; Sat, 21 Jan 2023 02:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674267612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RA3SY6mqGzIzDpe9sMq4Ct7ODhl8IwL0tL3A0OEJycs=; b=J0N1Xkt5BcqplRNpPJGK7tlKwElcysoj5QWqJv00KhB8IxrfXatg4vY4MhVni3r0aQfyLq Vv45pc/TrXcAT1uFEaV1E4WQHDlXfXGzkCTtr4Fcpk2xUdfaCGDsELu0ruI537fOCAIGPa n0o1wFv9dvor6Orc47qW82an3LT2L8oTTQySTKSs8SkvLbnGX9N0XcU/BPiUZBu1ICo6BK xosGj5kXiAg4lJRSbt1fUyEN0JSZNiaZ4N7jVRe/hsg/PpMmjfJzoPuSFcl9bc/kqAlTE0 I5raGb3ZLPJKKu2PjWPVfTC+AerxxRc1mqQ8ssBPdk8UHlG8rclBreT9S7Co+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674267612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RA3SY6mqGzIzDpe9sMq4Ct7ODhl8IwL0tL3A0OEJycs=; b=a9vHc7D0w8MhHuNIPW2jy4fxjzoPM6zYSuG/9cQbbm7ev5F1g/CtBNijDVrn1c9QJicRqN u82D8LwUv9phmNZ7fhZgvh4FKxYlz2BcJcUyAakNPMr6QruUsWEMneJp7t+H9aPvC1CGnh ACfSY6dSmIvA0UR+WQdM0cRKN6IE7vPAuQxnb5zMTvunPoDe1lf/OAXfmQ8SUrC8IMVQi2 f3cWRTioPDQ/umpsEZiQ8rCOCb2Uegz79WOqK92OD6166n+lTIIkEfsyjPgA5vviETIbX0 Zm+t/KXPpalH7C59quD2ZJeg/BQj2iSYZDbyPuleDTDNiMSJvsep9aN3L4yBHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674267612; a=rsa-sha256; cv=none; b=ORalqpckSAugr+yDFpYsB/2SouJlA0xMyfrMTrHTjcDkNmPXiZnGPDf//fPqJsL+EEAAC8 9PqmpS6VOXWp6u3WVWUlFbexEmjdI1QvimYu2gZVA3bhs+gK7MLzAcy4K2YSgrzL8pkqy3 fhMdi72io6Pp/lu9lOMj6ORm/4obMbZLVhGtMMRjjoEijbxgfug6OA8WGccui9vlG64rlS Vf8WHxIyg0plevxRXt5kY8sSw9p9AP26reDMJtNHhHzUFtU4MgmVEJ+lfWkFn539DvEadO 408YayVOb1VwsRrXRwgL0vU8uVxwyUSHJkWsHvQk0s7RhNdC5EVh15NHrVh5+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 4NzKp40J7RzsnB; Sat, 21 Jan 2023 02:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30L2KBeE006869; Sat, 21 Jan 2023 02:20:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30L2KBQv006863; Sat, 21 Jan 2023 02:20:11 GMT (envelope-from git) Date: Sat, 21 Jan 2023 02:20:11 GMT Message-Id: <202301210220.30L2KBQv006863@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: 34784d17eb2b - main - elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 34784d17eb2bcdcfaee39f570bff613b4055912d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=34784d17eb2bcdcfaee39f570bff613b4055912d commit 34784d17eb2bcdcfaee39f570bff613b4055912d Author: Warner Losh AuthorDate: 2023-01-21 02:15:52 +0000 Commit: Warner Losh CommitDate: 2023-01-21 02:18:15 +0000 elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way (at least differently than everybody else). We use this only in elf*machdep.c to make sure the image is new enough. Switch to the more standard way of defining this and adjust other constants to match. Fixes: c52c98e69a2e Sponsored by: Netflix --- sys/arm/include/elf.h | 3 +-- sys/arm64/arm64/elf32_machdep.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h index 35d0fa55ca1a..2ea60e8f10ee 100644 --- a/sys/arm/include/elf.h +++ b/sys/arm/include/elf.h @@ -74,9 +74,8 @@ __ElfType(Auxinfo); #define ELF_TARG_VER 1 /* Defines specific for arm headers */ -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) #define EF_ARM_EABI_VERSION_UNKNOWN 0 -#define EF_ARM_EABI_FREEBSD_MIN 4 +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 #define ET_DYN_LOAD_ADDR 0x01001000 diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index f637c5a65c05..627973ecfd3d 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -152,8 +152,7 @@ elf32_arm_abi_supported(struct image_params *imgp, int32_t *osrel __unused, ID_AA64PFR0_EL0_64_32) return (FALSE); -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) -#define EF_ARM_EABI_FREEBSD_MIN 4 +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 hdr = (const Elf32_Ehdr *)imgp->image_header; if (EF_ARM_EABI_VERSION(hdr->e_flags) < EF_ARM_EABI_FREEBSD_MIN) { if (bootverbose) From nobody Sat Jan 21 02:21:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzKrB4xClz2v0lY for ; Sat, 21 Jan 2023 02:22:02 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzKrB31bJz4GZG for ; Sat, 21 Jan 2023 02:22:02 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f45.google.com with SMTP id f19-20020a1c6a13000000b003db0ef4dedcso7007162wmc.4 for ; Fri, 20 Jan 2023 18:22:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fa22s5uaCzPukrVsXGSLc/lGjcfjey/dzjBGJ2Wi9R4=; b=6f5HI/P/tyTkupyJNv+l5gEEbnJmiFeHnwHl9kKfb2p/1wQAwKaoIZEdEZ0Lofe1wn fvfQQOh8OKd5wXkjOJ8+wtWenOofC1z1pClLAoPsDWB5B5ZlgYGu3G2BXtGrj1vpquV1 mQDoLZSB7W/g0a2E0B4vBBbUZ/EugtnqcPvE4cg070V52JHAHd2EOlxFt1WxP+VtYwwV oaxmgF9rEPJCrvDJ6IiIj40C/3XQHbl+ZGwvbBgYgwUG0hQ7cTH/v+5KkIASIWQ9NJfG rfmMUC++fTMA4dI8zUabuGb4efebp5owPo+BZS4Q0pLKuQFW9onUrGgMJiZTZzReg/JL YhhQ== X-Gm-Message-State: AFqh2koxI0xWwZCv7OwZ/Du86Xn9rEwe+/p+uridIvNG9MP5bVH6G50v 3GiHBNL7QYgXqVOEw0oeqNbARA== X-Google-Smtp-Source: AMrXdXsJcGBjcPk+ejaDO3A8H8pvTbcoWMsMa7JgOR9B9vD6BLwrQoTLQrZbi9dXCUciDNCFAffjpw== X-Received: by 2002:a05:600c:1695:b0:3da:f502:83b5 with SMTP id k21-20020a05600c169500b003daf50283b5mr16413586wmn.2.1674267720719; Fri, 20 Jan 2023 18:22:00 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id az41-20020a05600c602900b003dab77aa911sm3952701wmb.23.2023.01.20.18.22.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2023 18:22:00 -0800 (PST) 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 34784d17eb2b - main - elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h From: Jessica Clarke In-Reply-To: <202301210220.30L2KBQv006863@gitrepo.freebsd.org> Date: Sat, 21 Jan 2023 02:21:59 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202301210220.30L2KBQv006863@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4NzKrB31bJz4GZG X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 Jan 2023, at 02:20, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D34784d17eb2bcdcfaee39f570bff613b= 4055912d >=20 > commit 34784d17eb2bcdcfaee39f570bff613b4055912d > Author: Warner Losh > AuthorDate: 2023-01-21 02:15:52 +0000 > Commit: Warner Losh > CommitDate: 2023-01-21 02:18:15 +0000 >=20 > elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h >=20 > FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way (at least > differently than everybody else). We use this only in elf*machdep.c = to > make sure the image is new enough. Switch to the more standard way = of > defining this and adjust other constants to match. >=20 > Fixes: c52c98e69a2e > Sponsored by: Netflix > --- > sys/arm/include/elf.h | 3 +-- > sys/arm64/arm64/elf32_machdep.c | 3 +-- > 2 files changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h > index 35d0fa55ca1a..2ea60e8f10ee 100644 > --- a/sys/arm/include/elf.h > +++ b/sys/arm/include/elf.h > @@ -74,9 +74,8 @@ __ElfType(Auxinfo); > #define ELF_TARG_VER 1 >=20 > /* Defines specific for arm headers */ > -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) > #define EF_ARM_EABI_VERSION_UNKNOWN 0 Can also use EF_ARM_EABI_UNKNOWN in its place? Jess > -#define EF_ARM_EABI_FREEBSD_MIN 4 > +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 >=20 > #define ET_DYN_LOAD_ADDR 0x01001000 >=20 > diff --git a/sys/arm64/arm64/elf32_machdep.c = b/sys/arm64/arm64/elf32_machdep.c > index f637c5a65c05..627973ecfd3d 100644 > --- a/sys/arm64/arm64/elf32_machdep.c > +++ b/sys/arm64/arm64/elf32_machdep.c > @@ -152,8 +152,7 @@ elf32_arm_abi_supported(struct image_params *imgp, = int32_t *osrel __unused, > ID_AA64PFR0_EL0_64_32) > return (FALSE); >=20 > -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) > -#define EF_ARM_EABI_FREEBSD_MIN 4 > +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 > hdr =3D (const Elf32_Ehdr *)imgp->image_header; > if (EF_ARM_EABI_VERSION(hdr->e_flags) < EF_ARM_EABI_FREEBSD_MIN) = { > if (bootverbose) From nobody Sat Jan 21 02:27:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzKyx0Wftz2v1Ny for ; Sat, 21 Jan 2023 02:27:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzKyw48vYz4HJ2 for ; Sat, 21 Jan 2023 02:27:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62d.google.com with SMTP id rl14so14968703ejb.2 for ; Fri, 20 Jan 2023 18:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IpG7zkG9Kpcv2CsHPJTi1g8vc3hDj4S9+r7HB/weC5c=; b=YFUI1wT6mwpTDFrCrTaP2DwPD19HULfVQWvtTP7Ue00zlZV4v39weyycvfP4IjhNLr i7FnbFaMpBJeJrZOfO+Q9FV/eSZuObWE47Bt6aQe8hXNnY5Ih4fvdW/eVifSO8b+D3XY gGw7SCfuCeIsAkcNSeOlfo++3oYzBxcc7MM7+ZH0c94I26jNCszw+V0ANuKY9ZDp4sMs K4xZv7cyZfSsM075TgAEgEpPvdE+YkvUhg6hCNkkfkZGStAyZBDejSjp5SptNks9/e2B I0chdDZHpGioakgW3N2GcrnIZ4z4iRumh9eRiYVNfG3ff5h+HRvet7ietZiH+9CeDV+x jc6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IpG7zkG9Kpcv2CsHPJTi1g8vc3hDj4S9+r7HB/weC5c=; b=21bh3h786FaRqlwolPwvfFuPYmRz2kJVyyqyxXbIv7kG9TS8EtEGJgBE4OjReP6mar YGTXxL49T75fXFmgLyW8qxn+caNnGnqKu+z96zX328LGp/8MvoaCabqnQ69SG4u2QbPz K2LwJMR+TwZMFqHBsYumgMRc9aMEtKKzWahSst/bO0rGNRN4TXYL1pxa8TKA5gOsXLyV rSybwmxkK9eNAEdfjYbvoaW5IlRZK0EFIPGYa3rM0CW4WPlnJ1tNyV3LXwSQMz1yjcdr y9ZBMEJ7RmYsRH9YXAlV5WlcujsCImt6+psppzZNkxzHuUKdwOZNsiZWMS0R4J7WFXYI cBpA== X-Gm-Message-State: AFqh2koEtD3hUdhqaz1F5yZSp0+XXklYTAlHqwrwcZCNaQYleefkNWyZ tHgMx/nAtWpufdxABona8tuQESbV5JQtI4rgqmpRtQ== X-Google-Smtp-Source: AMrXdXviWer7M3rueLZrsxei6coCjPGo/MNadvrihM2DG6WqsUT/8HePXvlR8XpVlZl0DjgptZuvLrdhIdot5orHAgI= X-Received: by 2002:a17:906:961a:b0:872:8cb:3d87 with SMTP id s26-20020a170906961a00b0087208cb3d87mr1675655ejx.350.1674268071293; Fri, 20 Jan 2023 18:27:51 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301210220.30L2KBQv006863@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 20 Jan 2023 19:27:40 -0700 Message-ID: Subject: Re: git: 34784d17eb2b - main - elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000a608e705f2bce91e" X-Rspamd-Queue-Id: 4NzKyw48vYz4HJ2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000a608e705f2bce91e Content-Type: text/plain; charset="UTF-8" On Fri, Jan 20, 2023 at 7:22 PM Jessica Clarke wrote: > On 21 Jan 2023, at 02:20, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=34784d17eb2bcdcfaee39f570bff613b4055912d > > > > commit 34784d17eb2bcdcfaee39f570bff613b4055912d > > Author: Warner Losh > > AuthorDate: 2023-01-21 02:15:52 +0000 > > Commit: Warner Losh > > CommitDate: 2023-01-21 02:18:15 +0000 > > > > elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h > > > > FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way (at least > > differently than everybody else). We use this only in elf*machdep.c to > > make sure the image is new enough. Switch to the more standard way of > > defining this and adjust other constants to match. > > > > Fixes: c52c98e69a2e > > Sponsored by: Netflix > > --- > > sys/arm/include/elf.h | 3 +-- > > sys/arm64/arm64/elf32_machdep.c | 3 +-- > > 2 files changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h > > index 35d0fa55ca1a..2ea60e8f10ee 100644 > > --- a/sys/arm/include/elf.h > > +++ b/sys/arm/include/elf.h > > @@ -74,9 +74,8 @@ __ElfType(Auxinfo); > > #define ELF_TARG_VER 1 > > > > /* Defines specific for arm headers */ > > -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) > > #define EF_ARM_EABI_VERSION_UNKNOWN 0 > > Can also use EF_ARM_EABI_UNKNOWN in its place? > I'm not sure I understand the question... In what's place? Warner > Jess > > > -#define EF_ARM_EABI_FREEBSD_MIN 4 > > +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 > > > > #define ET_DYN_LOAD_ADDR 0x01001000 > > > > diff --git a/sys/arm64/arm64/elf32_machdep.c > b/sys/arm64/arm64/elf32_machdep.c > > index f637c5a65c05..627973ecfd3d 100644 > > --- a/sys/arm64/arm64/elf32_machdep.c > > +++ b/sys/arm64/arm64/elf32_machdep.c > > @@ -152,8 +152,7 @@ elf32_arm_abi_supported(struct image_params *imgp, > int32_t *osrel __unused, > > ID_AA64PFR0_EL0_64_32) > > return (FALSE); > > > > -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) > > -#define EF_ARM_EABI_FREEBSD_MIN 4 > > +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 > > hdr = (const Elf32_Ehdr *)imgp->image_header; > > if (EF_ARM_EABI_VERSION(hdr->e_flags) < EF_ARM_EABI_FREEBSD_MIN) { > > if (bootverbose) > > --000000000000a608e705f2bce91e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Jan 20, 2023 at 7:22 PM Jessi= ca Clarke <jrtc27@freebsd.org&= gt; wrote:
On 21= Jan 2023, at 02:20, Warner Losh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D34784d17eb2bcdcfaee39f570bff613b4055912d<= /a>
>
> commit 34784d17eb2bcdcfaee39f570bff613b4055912d
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2023-01-21 02:15:52 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-01-21 02:18:15 +0000
>
>=C2=A0 =C2=A0 elf: Catch up with defining EF_ARM_EABI_VERSION in elf_co= mmon.h
>
>=C2=A0 =C2=A0 FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way= (at least
>=C2=A0 =C2=A0 differently than everybody else). We use this only in elf= *machdep.c to
>=C2=A0 =C2=A0 make sure the image is new enough. Switch to the more sta= ndard way of
>=C2=A0 =C2=A0 defining this and adjust other constants to match.
>
>=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 c52c98e69a2e
>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Net= flix
> ---
> sys/arm/include/elf.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 3 +--<= br> > sys/arm64/arm64/elf32_machdep.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h
> index 35d0fa55ca1a..2ea60e8f10ee 100644
> --- a/sys/arm/include/elf.h
> +++ b/sys/arm/include/elf.h
> @@ -74,9 +74,8 @@ __ElfType(Auxinfo);
> #define=C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_TARG_VER=C2=A0 =C2=A0 1
>
> /* Defines specific for arm headers */
> -#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_VERSION(x) (((x) & EF_ARM= _EABIMASK) >> 24)
> #define=C2=A0 =C2=A0 =C2=A0 =C2=A0EF_ARM_EABI_VERSION_UNKNOWN 0

Can also use EF_ARM_EABI_UNKNOWN in its place?

I'm not sure I understand the question...=C2=A0=C2=A0 In what&#= 39;s place?

Warner
=C2=A0
Jess

> -#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_FREEBSD_MIN 4
> +#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4<= br> >
> #define=C2=A0 =C2=A0 =C2=A0 =C2=A0ET_DYN_LOAD_ADDR 0x01001000
>
> diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_m= achdep.c
> index f637c5a65c05..627973ecfd3d 100644
> --- a/sys/arm64/arm64/elf32_machdep.c
> +++ b/sys/arm64/arm64/elf32_machdep.c
> @@ -152,8 +152,7 @@ elf32_arm_abi_supported(struct image_params *imgp,= int32_t *osrel __unused,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ID_AA64PFR0_EL0_64_32)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (FALSE);<= br> >
> -#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_VERSION(x)=C2=A0 (((x) & = EF_ARM_EABIMASK) >> 24)
> -#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_FREEBSD_MIN 4
> +#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0hdr =3D (const Elf32_Ehdr *)imgp->image_h= eader;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (EF_ARM_EABI_VERSION(hdr->e_flags) <= ; EF_ARM_EABI_FREEBSD_MIN) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (bootverbose)=

--000000000000a608e705f2bce91e-- From nobody Sat Jan 21 02:29:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzL1c5npgz2v1lx for ; Sat, 21 Jan 2023 02:30:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzL1c0BGrz4Hk4 for ; Sat, 21 Jan 2023 02:30:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=wFQQzxe+; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::630) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ej1-x630.google.com with SMTP id mp20so18275786ejc.7 for ; Fri, 20 Jan 2023 18:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OmLs98obyvjBaRnOQOURshGG8gyUsiRijuYqB6ZFVOY=; b=wFQQzxe+KpusEfzUGikfIkyeufnE4gYspXuTkXRwa7STrlMuXoJQ052vwH9HWw5Bq+ b/VFkbvkDLmqrfYUIdzPoegbvxGCl/yo6wb3yud1/OOkXGSL7PLPaMS4HbRknphNmd71 g7Qf/KKMZXA02YrYfIDPnraI58iCFEU6bkYIyCT266ZXg6dNFfLB2NMFLfE/MGPPH+e2 GPqNd/TcShhobKXL2Ph0eqLwGFyVZrEFIanoNWuEMjsLyu07dJAXXU3RM7B75b9vsNz+ A9psQTVo6n9ez+X0tjE4wnDFG69lParuk8ZyQqDicC3aHvkEN7zh5jIxP729vH5N1np3 WcEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OmLs98obyvjBaRnOQOURshGG8gyUsiRijuYqB6ZFVOY=; b=jO6nWhw5O2tN4DKITRvrCsgL4XRVZIOOeDf5gRQfLKm4D6GYO0Ub+6EDQCw9LX4aMm OWSJ3BljHi4RATAFvPaGJt66Q9l+ZhlHfUsbzvVDII6rwyaZS8BPCXmAGhz7IfancExm hWl4TZzfJMkHCN0ufDJPwMLQrZwdSniUJAR/ZNFH1oGrS9a6iMnQzqmbF2jXtTbTqGLM tkX81Zd+RpSqqEHeVnTa/sQtRAG1A48WIMKFI+nGWvux55W9jqfs/GxSLJzvhUw1cjo2 gXx3ube64Nf+EYJEC2u7/dgNyuLNaN3E8rQTjiOTGfTtaB46d9M0EGRyLBO0h3FPw0rt 8GLA== X-Gm-Message-State: AFqh2kozEtD+yHmJdt+JTu6M4kOkP4G8yTXwtYE/lVRH+29CaDSsMYbE Dzor9R3XycCZ66MY27bKY5PpZhE5T6lc9CkIE9QO3dVXNaS7V/HH X-Google-Smtp-Source: AMrXdXtgjrxf5AvRUvpK4CVhGObG3NMvYTDW4HRtxt9Ko1vUiG/KGinUJy4Gf0+DfaXtvWdnP7esgZRYtLErVvJZfPI= X-Received: by 2002:a17:906:d8b5:b0:7c0:f5e7:af76 with SMTP id qc21-20020a170906d8b500b007c0f5e7af76mr1710834ejb.432.1674268210695; Fri, 20 Jan 2023 18:30:10 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202301210220.30L2KBQv006863@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 20 Jan 2023 19:29:59 -0700 Message-ID: Subject: Re: git: 34784d17eb2b - main - elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000f52e1905f2bcf1de" X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::630:from]; RCVD_TLS_LAST(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4NzL1c0BGrz4Hk4 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N --000000000000f52e1905f2bcf1de Content-Type: text/plain; charset="UTF-8" On Fri, Jan 20, 2023 at 7:27 PM Warner Losh wrote: > > > On Fri, Jan 20, 2023 at 7:22 PM Jessica Clarke wrote: > >> On 21 Jan 2023, at 02:20, Warner Losh wrote: >> > >> > The branch main has been updated by imp: >> > >> > URL: >> https://cgit.FreeBSD.org/src/commit/?id=34784d17eb2bcdcfaee39f570bff613b4055912d >> > >> > commit 34784d17eb2bcdcfaee39f570bff613b4055912d >> > Author: Warner Losh >> > AuthorDate: 2023-01-21 02:15:52 +0000 >> > Commit: Warner Losh >> > CommitDate: 2023-01-21 02:18:15 +0000 >> > >> > elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h >> > >> > FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way (at least >> > differently than everybody else). We use this only in elf*machdep.c >> to >> > make sure the image is new enough. Switch to the more standard way of >> > defining this and adjust other constants to match. >> > >> > Fixes: c52c98e69a2e >> > Sponsored by: Netflix >> > --- >> > sys/arm/include/elf.h | 3 +-- >> > sys/arm64/arm64/elf32_machdep.c | 3 +-- >> > 2 files changed, 2 insertions(+), 4 deletions(-) >> > >> > diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h >> > index 35d0fa55ca1a..2ea60e8f10ee 100644 >> > --- a/sys/arm/include/elf.h >> > +++ b/sys/arm/include/elf.h >> > @@ -74,9 +74,8 @@ __ElfType(Auxinfo); >> > #define ELF_TARG_VER 1 >> > >> > /* Defines specific for arm headers */ >> > -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) >> > #define EF_ARM_EABI_VERSION_UNKNOWN 0 >> >> Can also use EF_ARM_EABI_UNKNOWN in its place? >> > > I'm not sure I understand the question... In what's place? > Oh, I see... Yea... We can just delete EF_ARM_EABI_VERSION_UNKNOWN since it's unused. It was added for the OABI -> EABI transition... Warner > Warner > > >> Jess >> >> > -#define EF_ARM_EABI_FREEBSD_MIN 4 >> > +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 >> > >> > #define ET_DYN_LOAD_ADDR 0x01001000 >> > >> > diff --git a/sys/arm64/arm64/elf32_machdep.c >> b/sys/arm64/arm64/elf32_machdep.c >> > index f637c5a65c05..627973ecfd3d 100644 >> > --- a/sys/arm64/arm64/elf32_machdep.c >> > +++ b/sys/arm64/arm64/elf32_machdep.c >> > @@ -152,8 +152,7 @@ elf32_arm_abi_supported(struct image_params *imgp, >> int32_t *osrel __unused, >> > ID_AA64PFR0_EL0_64_32) >> > return (FALSE); >> > >> > -#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24) >> > -#define EF_ARM_EABI_FREEBSD_MIN 4 >> > +#define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 >> > hdr = (const Elf32_Ehdr *)imgp->image_header; >> > if (EF_ARM_EABI_VERSION(hdr->e_flags) < EF_ARM_EABI_FREEBSD_MIN) { >> > if (bootverbose) >> >> --000000000000f52e1905f2bcf1de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=


On Fri, Jan 20, 2023 at 7:22 PM Jessica Clarke <jrtc27@freebsd.org> wrote:
On = 21 Jan 2023, at 02:20, Warner Losh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D34784d17eb2bcdcfaee39f570bff613b4055912d<= /a>
>
> commit 34784d17eb2bcdcfaee39f570bff613b4055912d
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2023-01-21 02:15:52 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-01-21 02:18:15 +0000
>
>=C2=A0 =C2=A0 elf: Catch up with defining EF_ARM_EABI_VERSION in elf_co= mmon.h
>
>=C2=A0 =C2=A0 FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way= (at least
>=C2=A0 =C2=A0 differently than everybody else). We use this only in elf= *machdep.c to
>=C2=A0 =C2=A0 make sure the image is new enough. Switch to the more sta= ndard way of
>=C2=A0 =C2=A0 defining this and adjust other constants to match.
>
>=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 c52c98e69a2e
>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Net= flix
> ---
> sys/arm/include/elf.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 3 +--<= br> > sys/arm64/arm64/elf32_machdep.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h
> index 35d0fa55ca1a..2ea60e8f10ee 100644
> --- a/sys/arm/include/elf.h
> +++ b/sys/arm/include/elf.h
> @@ -74,9 +74,8 @@ __ElfType(Auxinfo);
> #define=C2=A0 =C2=A0 =C2=A0 =C2=A0ELF_TARG_VER=C2=A0 =C2=A0 1
>
> /* Defines specific for arm headers */
> -#define=C2=A0 =C2=A0 =C2=A0 EF_ARM_EABI_VERSION(x) (((x) & EF_ARM= _EABIMASK) >> 24)
> #define=C2=A0 =C2=A0 =C2=A0 =C2=A0EF_ARM_EABI_VERSION_UNKNOWN 0

Can also use EF_ARM_EABI_UNKNOWN in its place?


--000000000000f52e1905f2bcf1de-- From nobody Sat Jan 21 04:43:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzNzp0K4dz30yw2; Sat, 21 Jan 2023 04:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzNzn6Q5Pz3DD8; Sat, 21 Jan 2023 04:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674276229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56DF2E2BN0TxLyCZX5AYJLZahMUI8qzkEMOX0FnUQnM=; b=b1q50SznWUYnZgEj6ZQ6swtlUFmnbxLKfVcnpTh3MI30i63wDDH+yKNoix08QypHIBI83K lzMR4HlL68SuJpZc9jn1DswQVTu++sSXxQTuHABsWaRA9Xg7twUIm1eVAEq++DZxj4EUTD WukjGc45TsSDHQRVlYgWornVhugEVeiTnJIrLptfFwERkZeVO5P1Y9AcBgxGPl2TfZCAOY dcgfVEr8cin5rHYwGnUKBb5U1W81jslobj9eHFwbbJZHhDmmy6YXdPpnMojr0j+5DEzAlY IvkK4Lvy//aGcH5rTvXecrnnsX/cD3rjewRlFhz8+wIEMoEmnbSMQc18/9/C8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674276229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56DF2E2BN0TxLyCZX5AYJLZahMUI8qzkEMOX0FnUQnM=; b=YoXlVURgSHkgj6AbF5zFiO6Cz3zMrzoASa6h+fKw5kKtp+1aBiiA3QjrKAx0mFxTBZBwe2 g54zE12xctKVJ30RhU/8JVenY7CXwpEmBzSBVJdI5IXn8Cox+l8KfmgGZMhWrMtFWD8K6U VZ50FkcaDtniV9eXZhhmisyFgsdHFEkLlIH7Rjz6sKMVhatn2CWzZ98spLjLk/n7QwkDzC /sNhKAt2khiXqTatGSMPcKp9h27pU3GyakvtcpxTN/Gt9qcYO7wu/Bahe0hBU8+KkTD2zV Am5mHeEN9yNORMNn5dAZBEI2UcApUFwxMMCe9OjGbTDGRqyRKQ7vbzz/+a3kiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674276229; a=rsa-sha256; cv=none; b=kte8tDm4LQ67BxpUxsM1cx5BlkEKdM6YZo+AQa/a7RfkOIAC2vCjwpC1MWQmZntGUVEJbY OGlWMmcLMqRgqzkdzIXopf7dMQtHyreXja31yfhdIQUWrsFsZ6k/30GIEcOMlD0/20eD4y 63QWf2VcPxz5L0NmNguuoYhOyJ49wx5OTGBMWEdoq0u9lA4UEvJ7CxnIS3IvutVuwcwVQP w0CB3avFK482iIfPu3w8PFKCk9lTFw7s7vWDb3ywtqfMLsyF4/ar3skU22ibEKk0jzi7fd a2SHCd6mavMiwsvaWSAhVR+Ab0rym6mh7DATelVUmjardkWfaScy/t3jFE4dRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzNzn5TD3zxmp; Sat, 21 Jan 2023 04:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30L4hntg015212; Sat, 21 Jan 2023 04:43:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30L4hnw4015211; Sat, 21 Jan 2023 04:43:49 GMT (envelope-from git) Date: Sat, 21 Jan 2023 04:43:49 GMT Message-Id: <202301210443.30L4hnw4015211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: ffc58e2ca365 - main - asmc: Add MacbookAir6,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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffc58e2ca36546d866bb6bd36a3aa8f762a01663 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=ffc58e2ca36546d866bb6bd36a3aa8f762a01663 commit ffc58e2ca36546d866bb6bd36a3aa8f762a01663 Author: Adrian Chadd AuthorDate: 2023-01-21 04:34:31 +0000 Commit: Adrian Chadd CommitDate: 2023-01-21 04:34:31 +0000 asmc: Add MacbookAir6,2 Add in the zones for my MacbookAir6,2, a 2013 Macbook Air. Tested - said Macbook Air 2013. Thermal Zones and keyboard backlight control works fine. Differential Revision: https://reviews.freebsd.org/D38073 Approved by: jrtc27 --- sys/dev/asmc/asmc.c | 9 +++++++-- sys/dev/asmc/asmcvar.h | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index bec0054e2dd7..337f641e4513 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -427,7 +427,13 @@ static const struct asmc_model asmc_models[] = { ASMC_LIGHT_FUNCS, ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS }, - + { + "MacBookAir6,2", "Apple SMC MacBook Air 13-inch (Early 2013)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA6_TEMPS, ASMC_MBA6_TEMPNAMES, ASMC_MBA6_TEMPDESCS + }, { "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)", ASMC_SMS_FUNCS_DISABLED, @@ -435,7 +441,6 @@ static const struct asmc_model asmc_models[] = { ASMC_LIGHT_FUNCS, ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS }, - { "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)", ASMC_SMS_FUNCS_DISABLED, diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index a594710f1cbe..9db544a1450d 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -773,6 +773,31 @@ struct asmc_softc { "Ta0P", "Heatpipe", "Mainboard Proximity 1", "Mainboard Proximity 2", \ "Palm Rest", "Memory Proximity" } +/* + * TODO: validate the temp zones for MBA 6.x ! + */ +#define ASMC_MBA6_TEMPS { "TB0T", "TB1T", "TB2T", \ + "TC0E", "TC0F", "TC0P", \ + "TC1C", "TC2C", "TCGC", "TCSA", \ + "TCXC", "THSP", "TM0P", "TPCD", \ + "Ta0P", "Th1H", "Tm0P", \ + "Ts0P", "Ts0S", NULL } + +#define ASMC_MBA6_TEMPNAMES { "enclosure1", "enclosure2", "enclosure3", \ + "cputemp1", "cputemp2", "cpuproximity", \ + "cpucore1", "cpucore2", "cpupeci", "pecisa", \ + "TCXC", "THSP", "memorybank", "pchdie", \ + "Ta0P", "heatpipe", "mainboardproximity1", \ + "palmrest", "memoryproximity" } + +#define ASMC_MBA6_TEMPDESCS { "Enclosure Bottom 1", "Enclosure Bottom 2", "Enclosure Bottom 3", \ + "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \ + "CPU Core 1", "CPU Core 2", "CPU Peci Core", "PECI SA", \ + "TCXC", "THSP", "Memory Bank A", "PCH Die", \ + "Ta0P", "Heatpipe", "Mainboard Proximity 1", \ + "Palm Rest", "Memory Proximity" } + + #define ASMC_MBA7_TEMPS { "TB0T", "TB1T", "TB2T", \ "TC0E", "TC0F", "TC0P", \ "TC1C", "TC2C", \ From nobody Sat Jan 21 05:14:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzPgC5RqPz313Pm; Sat, 21 Jan 2023 05:14:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzPgC4tVxz3Grk; Sat, 21 Jan 2023 05:14:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674278071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jnromNKVXJqepXtEAeNUnJqaysifC4J/CTAhpZh4Sys=; b=PsDa8y0iqW6/QAVCAmmp+m/N1LyAmEPZRWI8jUJRMBsN8CL3r3yN95tLuniywSXCsg5gJD Qr07SXkE2DomZfWSVZ2mUUpuSWD1spHEPA6rdHj3XSqT5/BqD/UqH1F3v0FPT4XdTdD17V WazH9Gl4h28bwfmzBTvYEDlVsBuvCIG9mztIcwe6gdUudgMUTjsvfVGXDTneIgTfJlMtYY C3TbBiF9C5Vk9niydsv1gQFp4+4WuLmiThpRr38LCShh58DEEoVOoQcvtyTupneOwHASbH gRndIXSKMBCk20LVTCqfMZBB50HLdC9bFOgGAYAJxTRgAOhvYU/gWmgmwadJxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674278071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jnromNKVXJqepXtEAeNUnJqaysifC4J/CTAhpZh4Sys=; b=N1LY1pAjAZKv2vHC1K+z/NiTfF13UZpK7m+7N8h+cXtNxEB+JOUS9Duqd+F7rSMzGxTQD9 xbLfQJL3zhvk3m5p1+irVglNFbL+OX2yx4ftrtcDezmudh+6yIv086ezHKV7m1EgLw+kY2 vsfeAeEcQ8RKbGwUUES1s24d/iKKTkS0dIG9oMGSljr+NU49WsNA8O6jrc0ImDhaRHkT8Z iOFRNQcPhgHBJJFRRkb0iNVRpPJnr1aZa8TYgCSF8lQ2aCQF3/x8/iJeilkHv6q2By5va2 1OneMGc1FqWAfx9g2juo6dZ8BBdT2jUqNSAhQbYOiZOzTuvuGo7P99xePaR5KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674278071; a=rsa-sha256; cv=none; b=vgR6fU3YgF7EwfVv9RUA49MRYKOzVmFumBJQ7s9F2vxUc+cRSgVkPGiYP3dZY12REOI7AU yKsx79FVTSS1+sePKUPNRZeIbapjRQh7VZflKP4c4lQ2WWCokFHK0HdCJUMpEneryJomlq 8wpk4Ksmch3yRWAG7EBPtOe9COmL8kX78Y0cxe/Nszpc8iHv5Wva663Eq8ZY09jirH99E7 6f3WW2VShCryykw3/nzGM4MPKY2sVRBJxVIA61Eqlg6TW0e/DjmksJ2iisZybiUJQ7C5iB SIIhR4aWDUwIfam0HfrkEp75TcgIPro3wSJr5ERnK1P64Ngy3du4GaUUI8LziA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzPgC3y17zy16; Sat, 21 Jan 2023 05:14:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30L5EV6l058424; Sat, 21 Jan 2023 05:14:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30L5EVqm058423; Sat, 21 Jan 2023 05:14:31 GMT (envelope-from git) Date: Sat, 21 Jan 2023 05:14:31 GMT Message-Id: <202301210514.30L5EVqm058423@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: 03a1b75950c9 - main - elf: EF_ARM_EABI_VERSION_UNKNOWN is no longer used, retire List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 03a1b75950c95cd9360e5c283219b886d36afb53 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=03a1b75950c95cd9360e5c283219b886d36afb53 commit 03a1b75950c95cd9360e5c283219b886d36afb53 Author: Warner Losh AuthorDate: 2023-01-21 05:11:00 +0000 Commit: Warner Losh CommitDate: 2023-01-21 05:12:32 +0000 elf: EF_ARM_EABI_VERSION_UNKNOWN is no longer used, retire EF_ARM_EABI_VERSION_UNKNOWN was used when we could run either eabi or oabi. That was armv[45] only, and went away when we migrated to eabi many major releases ago. No standard defines this symbol, so retire it. Pointed out by: jrtc27 Sponsored by: Netflix --- sys/arm/include/elf.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h index 2ea60e8f10ee..d8c0887ee773 100644 --- a/sys/arm/include/elf.h +++ b/sys/arm/include/elf.h @@ -74,7 +74,6 @@ __ElfType(Auxinfo); #define ELF_TARG_VER 1 /* Defines specific for arm headers */ -#define EF_ARM_EABI_VERSION_UNKNOWN 0 #define EF_ARM_EABI_FREEBSD_MIN EF_ARM_EABI_VER4 #define ET_DYN_LOAD_ADDR 0x01001000 From nobody Sat Jan 21 05:55:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzQZr5rj6z328mN for ; Sat, 21 Jan 2023 05:55:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzQZr3Wmjz3KQr for ; Sat, 21 Jan 2023 05:55:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f52.google.com with SMTP id z5so6505523wrt.6 for ; Fri, 20 Jan 2023 21:55:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PJ1KorNOrt/Aac3z8OVKQ+DlSg9gf/kYsnKl3/NbKGI=; b=1X4l2xPUZ0iiaFzvQXioe+8zBmVc6tK2cPO/iQnIYIk3sDnh2pZG/VCyUgXN16sQUz J8LfW/HnUlxv/5TTuP0V/LdbeNeItr0qzkI0s4jnMWFi10V6u3BFmutyuLUA60Hdu1HF KKkOVntkl3l6TB/LNGPFEdQB0KzZjaQiyS6xxw3XuL1RPpruWci+2YqRga4vKJu6LE0p 12+RWNPGxYWeySgSfb8B15pVfCgJV6nLcVWragEDOF2Fnslh0Wn3RWV9rSDATy8fcjeR hzDR6B8K4KKQufg4U/bP5kzxpdDgtbXUfZL9Yxh4chbC/y+QsedKIaiNP7Lu8taPQgj5 NE4A== X-Gm-Message-State: AFqh2kp0CPtd9iWom7rfvlj3rXo8MjLd1cMprbYdOl/3Nbo8oCNrpJ27 1djAa4ujzqzSEzeVGK5G0P646Q== X-Google-Smtp-Source: AMrXdXtTQ9+sgIbSk8wXX3vXPckbt+VzsDfPOihT+jk7jJlvC570QkbESNR9klk6oAdjHdMjYNxq5w== X-Received: by 2002:a5d:6ac6:0:b0:29f:7c87:74ab with SMTP id u6-20020a5d6ac6000000b0029f7c8774abmr13410402wrw.10.1674280546663; Fri, 20 Jan 2023 21:55:46 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id m13-20020adfe94d000000b002714b3d2348sm37424169wrn.25.2023.01.20.21.55.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2023 21:55:46 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: ffc58e2ca365 - main - asmc: Add MacbookAir6,2 From: Jessica Clarke In-Reply-To: <202301210443.30L4hnw4015211@gitrepo.freebsd.org> Date: Sat, 21 Jan 2023 05:55:45 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202301210443.30L4hnw4015211@gitrepo.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4NzQZr3Wmjz3KQr X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 Jan 2023, at 04:43, Adrian Chadd wrote: >=20 > The branch main has been updated by adrian: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dffc58e2ca36546d866bb6bd36a3aa8f7= 62a01663 >=20 > commit ffc58e2ca36546d866bb6bd36a3aa8f762a01663 > Author: Adrian Chadd > AuthorDate: 2023-01-21 04:34:31 +0000 > Commit: Adrian Chadd > CommitDate: 2023-01-21 04:34:31 +0000 >=20 > asmc: Add MacbookAir6,2 >=20 > Add in the zones for my MacbookAir6,2, a 2013 Macbook Air. >=20 > Tested - said Macbook Air 2013. Thermal Zones and keyboard = backlight > control works fine. >=20 > Differential Revision: https://reviews.freebsd.org/D38073 > Approved by: jrtc27 Uh this is the first I=E2=80=99m hearing of this patch? Jess > --- > sys/dev/asmc/asmc.c | 9 +++++++-- > sys/dev/asmc/asmcvar.h | 25 +++++++++++++++++++++++++ > 2 files changed, 32 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c > index bec0054e2dd7..337f641e4513 100644 > --- a/sys/dev/asmc/asmc.c > +++ b/sys/dev/asmc/asmc.c > @@ -427,7 +427,13 @@ static const struct asmc_model asmc_models[] =3D = { > ASMC_LIGHT_FUNCS, > ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS > }, > - > + { > + "MacBookAir6,2", "Apple SMC MacBook Air 13-inch (Early 2013)", > + ASMC_SMS_FUNCS_DISABLED, > + ASMC_FAN_FUNCS2, > + ASMC_LIGHT_FUNCS, > + ASMC_MBA6_TEMPS, ASMC_MBA6_TEMPNAMES, ASMC_MBA6_TEMPDESCS > + }, > { > "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)", > ASMC_SMS_FUNCS_DISABLED, > @@ -435,7 +441,6 @@ static const struct asmc_model asmc_models[] =3D { > ASMC_LIGHT_FUNCS, > ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS > }, > - > { > "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)", > ASMC_SMS_FUNCS_DISABLED, > diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h > index a594710f1cbe..9db544a1450d 100644 > --- a/sys/dev/asmc/asmcvar.h > +++ b/sys/dev/asmc/asmcvar.h > @@ -773,6 +773,31 @@ struct asmc_softc { > "Ta0P", "Heatpipe", "Mainboard = Proximity 1", "Mainboard Proximity 2", \ > "Palm Rest", "Memory Proximity" } >=20 > +/* > + * TODO: validate the temp zones for MBA 6.x ! > + */ > +#define ASMC_MBA6_TEMPS { "TB0T", "TB1T", "TB2T", \ > + "TC0E", "TC0F", "TC0P", \ > + "TC1C", "TC2C", "TCGC", "TCSA", \ > + "TCXC", "THSP", "TM0P", "TPCD", \ > + "Ta0P", "Th1H", "Tm0P", \ > + "Ts0P", "Ts0S", NULL } > + > +#define ASMC_MBA6_TEMPNAMES { "enclosure1", "enclosure2", = "enclosure3", \ > + "cputemp1", "cputemp2", = "cpuproximity", \ > + "cpucore1", "cpucore2", "cpupeci", = "pecisa", \ > + "TCXC", "THSP", "memorybank", = "pchdie", \ > + "Ta0P", "heatpipe", = "mainboardproximity1", \ > + "palmrest", "memoryproximity" } > + > +#define ASMC_MBA6_TEMPDESCS { "Enclosure Bottom 1", = "Enclosure Bottom 2", "Enclosure Bottom 3", \ > + "CPU Temp 1", "CPU Temp 2", "CPU = Proximity", \ > + "CPU Core 1", "CPU Core 2", "CPU Peci = Core", "PECI SA", \ > + "TCXC", "THSP", "Memory Bank A", "PCH = Die", \ > + "Ta0P", "Heatpipe", "Mainboard = Proximity 1", \ > + "Palm Rest", "Memory Proximity" } > + > + > #define ASMC_MBA7_TEMPS { "TB0T", "TB1T", "TB2T", \ > "TC0E", "TC0F", "TC0P", \ > "TC1C", "TC2C", \ From nobody Sat Jan 21 14:59:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nzfdm0NCPz314Nr; Sat, 21 Jan 2023 14:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nzfdl6zq8z4Dfx; Sat, 21 Jan 2023 14:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674313148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kzewv1bhXM19iSEqLQ93tUMlMxX+FzAGsLvN/yzinxs=; b=Nb+rsUgO8qFEq9kvlIYAqdHjopvSnaF9hGdbeC6RhnDMC+N6OgqbyIP7N7+mY5gD53V9Xs ZyLYQ8i53MMBeilyjc9Gl7XJci7bZaDUZkC3VRmznTnxrmoXmnx36QFhVg4SJRdI4OBKxg NlbLCbaXxwNtK+yp+MX3D+qym1mz0qDDR3KzOV094DUpc/fZ07/SRAZYDV+nehQoUPN90X DjQR5QO3BrT2lbyaE9OUsbOmkkYNc4XWY4BW0eic3YK9/cpJxa5R6Ib92MVavRfdEuQqDy a29nkU+d3bGWlTqDxeu6sWOrXxV2ybyO6ytHWLkz/wkHSK+sRxQVYm7rW0nbwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674313148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kzewv1bhXM19iSEqLQ93tUMlMxX+FzAGsLvN/yzinxs=; b=rJRZZNJ+I9UBkrfWNKpkUFX7aVwIUR83ZUREd11LJJy7zvQIz9J7IE3VPy8vEizLEubDT+ ho9agbrUbV1N0sz8vb7kHBZIRVJ2bNkofJrZg+rKIzIFQjwgKxrcF6bOB2q/OARHdmunyu V9QXPYcgMPLGLD1zdrJpLPwpm8WodtWR+jgKby2SSadU1YDC6Hd1HWaHjrwyg1awIAajCu U24ZkUtrPe7VJzR1rsbSceJWNDtnV0BcEd7CAoBbisGKlTaOuJhhPSiJZkVQ79UL+AzOZ6 iViOFrpi3h6qOdac+C7cmh1hjzvXdMGdNrq+hrpRolydsvO3SBIvudUgj3AOlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674313148; a=rsa-sha256; cv=none; b=TbKCcmy3/NLe3WuhoDR71gkVskkob9mBpbQfCRBWHWrgFFUB9+4OsamcSSErfibUQhzJIH wd2KVnKnmhI2jP4XvlJU3afGbj1dE+aIYWsJSOaHcNk8KWgE91I2S+lHZTZlbxFbPBHCXx wLER7KbMvIg4MJfIzSvm2kLqzv5ph6u0ezuQEj7ufaPFAHDNSV2MJoKcYo9CllAQsYynwr AILPgDt7zNU/K63w5OokzKdirirvwzf5Cb5sqvtNUxWKVnC4cT8vTRZktw4j518QztN8MV qmvZs60pDKgbhsOG4ZPr/Sm/Yln57zXv3CSwGbfjbOcKSVorTrDqTAlGbA1EVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nzfdl5xQCz1Cv6; Sat, 21 Jan 2023 14:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30LEx7CS084457; Sat, 21 Jan 2023 14:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30LEx7Vo084456; Sat, 21 Jan 2023 14:59:07 GMT (envelope-from git) Date: Sat, 21 Jan 2023 14:59:07 GMT Message-Id: <202301211459.30LEx7Vo084456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 0079d177ab69 - main - netlink: allow creating sockets with SOCK_DGRAM. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0079d177ab69168df5e103128a2b15bd8e74d4eb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=0079d177ab69168df5e103128a2b15bd8e74d4eb commit 0079d177ab69168df5e103128a2b15bd8e74d4eb Author: Alexander V. Chernikov AuthorDate: 2023-01-21 14:36:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-21 14:58:19 +0000 netlink: allow creating sockets with SOCK_DGRAM. Some existing applications setup Netlink socket with SOCK_DGRAM instead of SOCK_RAW. Update the manpage to clarify that the default way of creating the socket should be with SOCK_RAW. Update the code to support both SOCK_RAW and SOCK_DGRAM. Reviewed By: pauamma Differential Revision: https://reviews.freebsd.org/D38075 --- share/man/man4/netlink.4 | 4 ++-- share/man/man4/rtnetlink.4 | 2 +- sys/netlink/netlink_domain.c | 44 +++++++++++++++++++++++---------------- tests/sys/netlink/Makefile | 1 + tests/sys/netlink/test_nl_core.py | 33 +++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 21 deletions(-) diff --git a/share/man/man4/netlink.4 b/share/man/man4/netlink.4 index 2aa4903a4594..1894de5841fe 100644 --- a/share/man/man4/netlink.4 +++ b/share/man/man4/netlink.4 @@ -34,7 +34,7 @@ .In netlink/netlink.h .In netlink/netlink_route.h .Ft int -.Fn socket AF_NETLINK SOCK_DGRAM int family +.Fn socket AF_NETLINK SOCK_RAW "int family" .Sh DESCRIPTION Netlink is a user-kernel message-based communication protocol primarily used for network stack configuration. @@ -293,7 +293,7 @@ This is the default level, not impacting production performance. Socket events such as groups memberships, privilege checks, commands and dumps are logged. This level does not incur significant performance overhead. -.It Dv LOG_DEBUG9(9) +.It Dv LOG_DEBUG3(9) All socket events, each dumped or modified entities are logged. Turning it on may result in significant performance overhead. .El diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index dc40b277d934..5849508b74c2 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -34,7 +34,7 @@ .In netlink/netlink.h .In netlink/netlink_route.h .Ft int -.Fn socket AF_NETLINK SOCK_DGRAM NETLINK_ROUTE +.Fn socket AF_NETLINK SOCK_RAW NETLINK_ROUTE .Sh DESCRIPTION The .Dv NETLINK_ROUTE diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index f35cc7f09991..4d34fd381c39 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -698,31 +698,39 @@ nl_setsbopt(struct socket *so, struct sockopt *sopt) return (result ? 0 : ENOBUFS); } -static struct protosw netlinksw = { - .pr_type = SOCK_RAW, - .pr_flags = PR_ATOMIC | PR_ADDR | PR_WANTRCVD, - .pr_ctloutput = nl_ctloutput, - .pr_setsbopt = nl_setsbopt, - .pr_abort = nl_pru_abort, - .pr_attach = nl_pru_attach, - .pr_bind = nl_pru_bind, - .pr_connect = nl_pru_connect, - .pr_detach = nl_pru_detach, - .pr_disconnect = nl_pru_disconnect, - .pr_peeraddr = nl_pru_peeraddr, - .pr_send = nl_pru_send, - .pr_rcvd = nl_pru_rcvd, - .pr_shutdown = nl_pru_shutdown, - .pr_sockaddr = nl_pru_sockaddr, +#define NETLINK_PROTOSW \ + .pr_flags = PR_ATOMIC | PR_ADDR | PR_WANTRCVD, \ + .pr_ctloutput = nl_ctloutput, \ + .pr_setsbopt = nl_setsbopt, \ + .pr_abort = nl_pru_abort, \ + .pr_attach = nl_pru_attach, \ + .pr_bind = nl_pru_bind, \ + .pr_connect = nl_pru_connect, \ + .pr_detach = nl_pru_detach, \ + .pr_disconnect = nl_pru_disconnect, \ + .pr_peeraddr = nl_pru_peeraddr, \ + .pr_send = nl_pru_send, \ + .pr_rcvd = nl_pru_rcvd, \ + .pr_shutdown = nl_pru_shutdown, \ + .pr_sockaddr = nl_pru_sockaddr, \ .pr_close = nl_pru_close + +static struct protosw netlink_raw_sw = { + .pr_type = SOCK_RAW, + NETLINK_PROTOSW +}; + +static struct protosw netlink_dgram_sw = { + .pr_type = SOCK_DGRAM, + NETLINK_PROTOSW }; static struct domain netlinkdomain = { .dom_family = PF_NETLINK, .dom_name = "netlink", .dom_flags = DOMF_UNLOADABLE, - .dom_nprotosw = 1, - .dom_protosw = { &netlinksw }, + .dom_nprotosw = 2, + .dom_protosw = { &netlink_raw_sw, &netlink_dgram_sw }, }; DOMAIN_SET(netlink); diff --git a/tests/sys/netlink/Makefile b/tests/sys/netlink/Makefile index 87cee15c9d33..880e5e6e4007 100644 --- a/tests/sys/netlink/Makefile +++ b/tests/sys/netlink/Makefile @@ -6,6 +6,7 @@ WARNS?= 1 TESTSDIR= ${TESTSBASE}/sys/netlink ATF_TESTS_C += test_snl +ATF_TESTS_PYTEST += test_nl_core.py ATF_TESTS_PYTEST += test_rtnl_iface.py ATF_TESTS_PYTEST += test_rtnl_ifaddr.py diff --git a/tests/sys/netlink/test_nl_core.py b/tests/sys/netlink/test_nl_core.py new file mode 100644 index 000000000000..7af421a929dc --- /dev/null +++ b/tests/sys/netlink/test_nl_core.py @@ -0,0 +1,33 @@ +import errno +import socket + +import pytest +from atf_python.sys.net.netlink import NetlinkTestTemplate +from atf_python.sys.net.netlink import NlConst +from atf_python.sys.net.vnet import SingleVnetTestTemplate + + +class TestNlCore(NetlinkTestTemplate, SingleVnetTestTemplate): + @pytest.mark.parametrize( + "params", + [ + pytest.param({"type": socket.SOCK_RAW}, id="SOCK_RAW"), + pytest.param({"type": socket.SOCK_DGRAM}, id="SOCK_DGRAM"), + ], + ) + def test_socket_type(self, params): + s = socket.socket(NlConst.AF_NETLINK, params["type"], NlConst.NETLINK_ROUTE) + s.close() + + @pytest.mark.parametrize( + "params", + [ + pytest.param({"type": socket.SOCK_STREAM}, id="SOCK_STREAM"), + pytest.param({"type": socket.SOCK_RDM}, id="SOCK_RDM"), + pytest.param({"type": socket.SOCK_SEQPACKET}, id="SOCK_SEQPACKET"), + ], + ) + def test_socket_type_unsup(self, params): + with pytest.raises(OSError) as exc_info: + socket.socket(NlConst.AF_NETLINK, params["type"], NlConst.NETLINK_ROUTE) + assert exc_info.value.errno == errno.EPROTOTYPE From nobody Sat Jan 21 18:06:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nzknz23M8z2spp7; Sat, 21 Jan 2023 18:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nzknz1XgJz4T0r; Sat, 21 Jan 2023 18:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674324391; h=from:from:reply-to:subject:subject: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+mj1vOuOlzXtxBT4ELtG/LK4MtY1OMhvbDXOUeRFyU=; b=j9v0LcwiR3FEwuWjsHtRshIYsj9XF0LFX+tjdxFEmG3q7uifapCFuePopPMD100thTCjL4 QmbaiPoUsgVa7iB7uTwFs5+HWUGWfJtlDF6tPMOGRNjR6y82032z2CJdRyrlyQtFJylnSB z8D06kpKde+F9k9reJcOCCXTN/jDDtmLgRz1JfBuT948mFme34kLHCHKtDRFAUqEYnhkSR nX1G9Ln7u6NHj+NG1yMy+EfkDLA+JXCgiGv3+8sPcaQtTszKOIT3W3KvJ8UIUYoJ/QmC/b Ab3QJVI+3O8mYMgUkL2+Fw13nOiSVaMtDoRLAV3T2hpLEsxUAvDIj83I12SjCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674324391; h=from:from:reply-to:subject:subject: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+mj1vOuOlzXtxBT4ELtG/LK4MtY1OMhvbDXOUeRFyU=; b=ETnw5uyqNapITc+B3bhdZupk9n2Bv8atLpY+Nq1DyXfWoYMT7YRe2m43KUWcx89pKGqhSD XOyX0d9CiSu16FecD1AgEmySOGRPCCdJ0yy7sDjsNC4FSStVbEMa0VMizdOLNAIpCFPoqZ HDA5R+iHSk37DC+SPC0ZxIGVk0GkvVeYWXwTjMwQ/N8dAorgFRe1UQ45RMWD5lY8n7XtZz GLSgXdGK363anmufPh8xQDIemd48TN6n+zulO8fPZE5E+n8wABiij9OwoJyW6G3BVdwA4r /WVWjtC2tT1Nm+NYalmP12vScASpEbvg17U8lKq0LVrLFmNQCHup/WOm6Q4wRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674324391; a=rsa-sha256; cv=none; b=G9vHfyFicLCyzxtRUHb541HZ5DJqYuYlmyGnYNoGVcJg1c/S7yh5cUOPKw0zwLdO3b1q0A iThm3r1Rq26nc3noGPDBoVeL+PxCA8CWJ803fk6Veb7PobiOrEjeDFV0VauwoPNlg6TCEf dZ7iazZ7VWRKgIwpVM4DNppzCP086w9/oPDFrEOG/AiigaqJC8vQJnWOtIjA/hPt73efGN GV2mDXVakvpvQ+sdeBLiup/VoKF8rGoiscBChzZAZzXhg3K/JWu5YHDF1QDaS9jd65UUpQ 6CXnDNae+tqZjTBxOFdxwm3WyKUUMrahxRNnqKUvXj+gYkueTZKpavgncmYC9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nzknz0bh8zKFP; Sat, 21 Jan 2023 18:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30LI6Uhc053722; Sat, 21 Jan 2023 18:06:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30LI6UYY053721; Sat, 21 Jan 2023 18:06:30 GMT (envelope-from git) Date: Sat, 21 Jan 2023 18:06:30 GMT Message-Id: <202301211806.30LI6UYY053721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 10f2a38769c7 - main - netlink: fix OOB write when creating attribute bitmask. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10f2a38769c7b2fa210a3ea077d3185448479013 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=10f2a38769c7b2fa210a3ea077d3185448479013 commit 10f2a38769c7b2fa210a3ea077d3185448479013 Author: Alexander V. Chernikov AuthorDate: 2023-01-21 18:03:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-21 18:03:47 +0000 netlink: fix OOB write when creating attribute bitmask. Fix wrong arithmetics by moving to the standard bitset(9) functions. Reported by: markj, KASAN --- sys/netlink/netlink_message_parser.c | 16 +++++++++++++--- sys/netlink/netlink_message_parser.h | 16 ++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/netlink/netlink_message_parser.c b/sys/netlink/netlink_message_parser.c index 451d9d497491..dc0c38712613 100644 --- a/sys/netlink/netlink_message_parser.c +++ b/sys/netlink/netlink_message_parser.c @@ -152,17 +152,27 @@ nl_get_attrs_bmask_raw(struct nlattr *nla_head, int len, struct nlattr_bmask *bm { struct nlattr *nla = NULL; - bzero(bm->mask, sizeof(bm->mask)); + BIT_ZERO(NL_ATTR_BMASK_SIZE, bm); NLA_FOREACH(nla, nla_head, len) { if (nla->nla_len < sizeof(struct nlattr)) return; int nla_type = nla->nla_type & NLA_TYPE_MASK; - if (nla_type <= sizeof(bm->mask) * 8) - bm->mask[nla_type / 8] |= 1 << (nla_type % 8); + if (nla_type < NL_ATTR_BMASK_SIZE) + BIT_SET(NL_ATTR_BMASK_SIZE, nla_type, bm); + else + NL_LOG(LOG_DEBUG2, "Skipping type %d in the mask: too short", + nla_type); } } +bool +nl_has_attr(const struct nlattr_bmask *bm, unsigned int nla_type) +{ + MPASS(nla_type < NL_ATTR_BMASK_SIZE); + + return (BIT_ISSET(NL_ATTR_BMASK_SIZE, nla_type, bm)); +} int nlattr_get_flag(struct nlattr *nla, struct nl_pstate *npt, const void *arg, void *target) diff --git a/sys/netlink/netlink_message_parser.h b/sys/netlink/netlink_message_parser.h index 3f64c1967f09..94f0ca5260d7 100644 --- a/sys/netlink/netlink_message_parser.h +++ b/sys/netlink/netlink_message_parser.h @@ -29,6 +29,9 @@ #define _NETLINK_NETLINK_MESSAGE_PARSER_H_ #ifdef _KERNEL + +#include + /* * It is not meant to be included directly */ @@ -152,18 +155,11 @@ static const struct nlhdr_parser _name = { \ .np_size = NL_ARRAY_LEN(_np), \ } -struct nlattr_bmask { - uint64_t mask[2]; -}; - -static inline bool -nl_has_attr(const struct nlattr_bmask *bm, unsigned int attr_type) -{ - MPASS(attr_type < sizeof(bm->mask) * 8); +#define NL_ATTR_BMASK_SIZE 128 +BITSET_DEFINE(nlattr_bmask, NL_ATTR_BMASK_SIZE); - return ((bm->mask[attr_type / 8] & (1 << (attr_type % 8)))); -} void nl_get_attrs_bmask_raw(struct nlattr *nla_head, int len, struct nlattr_bmask *bm); +bool nl_has_attr(const struct nlattr_bmask *bm, unsigned int nla_type); int nl_parse_attrs_raw(struct nlattr *nla_head, int len, const struct nlattr_parser *ps, int pslen, struct nl_pstate *npt, void *target); From nobody Sat Jan 21 19:30:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzmgM51HPz2t27V; Sat, 21 Jan 2023 19:30:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzmgM4Wpxz4ch2; Sat, 21 Jan 2023 19:30:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674329455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gd1A2cKJqfOyfR7xtmMNJLOGCfK75RWAg8BYWzS5bBc=; b=jXok7vVrhj9Jo4hZQCD+IRF4r53/pMMWRlXHw/QFkYfM6Xk/C4OaPrwWawu7Oxhd6t9dyU 3A+zsOxOKPzK76Vyd+odjtCX6omJWFlklDXizsXY6G6y0GcxnLVdBmw2ye1rUFt7Dh9cal kKNPeP/DyZ7v8JWJoGtwe8uG3eCrq8ScvW0gDBv32Li7F7RPGNf/O0ocG3vPa/o9bY7v2m auRBTO2SfRu8w8cwkIO8+zpMhMI3HIFvN7iTcfldKgds8xDWLtW9uMFhRkN5Et1/uEnR8p UxQHa2J2rdDaS3HnFk9rIrk7M0W6TsdNNrldrcpq/paalVemaGCGuoERnYKlKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674329455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gd1A2cKJqfOyfR7xtmMNJLOGCfK75RWAg8BYWzS5bBc=; b=jLhRtwL3f0T81izGPSCOBb0IrMdC/fGbxdna2RXX+PieCiN6dcI1HVU7wke6S1PLvq8u87 Vc+OsNqzRO9LzcWEKReWaJMCWc+7BPiVH0QiSlSoSIUUweLdZMWtZ8ViJykLm91TjxjAVq 9Im78kJCRyUZCmRd2ooyvxy4b3t0A0fSfN4Dh+CuRpvOvrg13k1hNGl/+boo3IE49WPHOm ykPa2lw+CS8Ip8YQFssmTemEEXlvztZaAnNj2Hx3dvrk9SfKJnTqcaDEUuz6J9uA7yKQ1H z4cnpUf5uIKJLq0UApb6SSKNrENhj1NByk/fPVmzzV+Hefcq66ex8Hnre4ryeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674329455; a=rsa-sha256; cv=none; b=rvdG94aSvilI+qz//MUxzxct0T3mA/dlvSXnby9y2TAWeLLGFIPXQIVhhumCB+p0liW46s ribUn/mwAkykRoj1FplzbY5qPomufzFtVMDmnEuwCCoLMk8ijZ7pCJ2r1LQKF/CZ1tSgj7 rs8UzIcZ7QJ3Oi24nQoZOnZzWrFcEFtwyJho46KEGZW8SWcN86qLaMWo+hhAgBT3ZdoCs5 aJ7bwgPr/mN5H+G/JNio5ohw3Ar6oK9O2Uttu7/XQ6Nlkx1i68IAZqmzCJ4DaG9uxApIXI yf6skx4XOEDY6s5Ovh7ZT3ZgxtWVjbaGSaWw+kjuiW76FnsSAZR60KEJSelI/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 4NzmgM3Vf7zLYd; Sat, 21 Jan 2023 19:30:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30LJUtTu075618; Sat, 21 Jan 2023 19:30:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30LJUt1l075617; Sat, 21 Jan 2023 19:30:55 GMT (envelope-from git) Date: Sat, 21 Jan 2023 19:30:55 GMT Message-Id: <202301211930.30LJUt1l075617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 9cb6ba29cb70 - main - vm: centralize VM_BATCHQUEUE_SIZE definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9cb6ba29cb704c180d5b82f409e280377a641a28 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=9cb6ba29cb704c180d5b82f409e280377a641a28 commit 9cb6ba29cb704c180d5b82f409e280377a641a28 Author: Andrew Gallatin AuthorDate: 2023-01-21 19:26:25 +0000 Commit: Andrew Gallatin CommitDate: 2023-01-21 19:30:00 +0000 vm: centralize VM_BATCHQUEUE_SIZE definition Remove the platform-specific definitions of VM_BATCHQUEUE_SIZE for amd64 and powerpc64, and instead treat all 64-bit platforms identically. This has the effect of increasing the arm64 and riscv VM_BATCHQUEUE_SIZE to match that of other platforms. Reviewed by: jhb, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37707 --- sys/amd64/include/vmparam.h | 6 ------ sys/powerpc/include/vmparam.h | 8 -------- sys/vm/vm_pagequeue.h | 4 +++- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 205848489644..880c46bba84d 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -289,12 +289,6 @@ #define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ -/* - * Use a fairly large batch size since we expect amd64 systems to have lots of - * memory. - */ -#define VM_BATCHQUEUE_SIZE 63 - /* * The pmap can create non-transparent large page mappings. */ diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h index 1b9873aede4a..0f3321379b47 100644 --- a/sys/powerpc/include/vmparam.h +++ b/sys/powerpc/include/vmparam.h @@ -258,14 +258,6 @@ extern int vm_level_0_order; #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ #endif -/* - * Use a fairly large batch size since we expect ppc64 systems to have lots of - * memory. - */ -#ifdef __powerpc64__ -#define VM_BATCHQUEUE_SIZE 63 -#endif - /* * On 32-bit OEA, the only purpose for which sf_buf is used is to implement * an opaque pointer required by the machine-independent parts of the kernel. diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 268d53a391db..9624d31a75b7 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -74,7 +74,9 @@ struct vm_pagequeue { uint64_t pq_pdpages; } __aligned(CACHE_LINE_SIZE); -#ifndef VM_BATCHQUEUE_SIZE +#if __SIZEOF_LONG__ == 8 +#define VM_BATCHQUEUE_SIZE 63 +#else #define VM_BATCHQUEUE_SIZE 15 #endif From nobody Sat Jan 21 21:33:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzqNk6wWZz2v3G4; Sat, 21 Jan 2023 21:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzqNk6LrXz3KfB; Sat, 21 Jan 2023 21:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674336806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6SDvAR/BaXDYcLLf0epsNamhcWmEYZVQAwjQARU49k4=; b=I5zo2ZApLXMgFRgCsMebUdi39fqDv9uuRcGECOpJ/y9H+510TrV5zcpgx2XwaLvw8IPY+x vO1DrtnQ3KwBpjTWvlKQI4ODiaEgxGPByM8wB2ZNuOn7J7RCkS6yghNqzBGeYHITjZvtf+ kACuvmt/VwrvIbRneX5cm6I/+1kbK3Y4c0FJY2pzFajRCp1MUolT8WSKB/OO+3rLsg88VU 63+vZDr0jZzpqpXN9tercVpmUsIDG4n6SVSMotGHqWV3Markr5szCVq2C4niQcuUqDALi3 vQ2XAM9SPkKsSI92D92zN+Z83yFHmt6JjxhHI4iZwSHzTNHHaT5TZydAVY4d4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674336806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6SDvAR/BaXDYcLLf0epsNamhcWmEYZVQAwjQARU49k4=; b=rgaWOYLxgClas3BIFDjizB5k6zVwHTUpxJ7siDg2sX/7hXup6WpKpl9aVAkh01jWB8iUT9 cVm4uH5xGsYFLphXet75kgsN8qpY5bysZigT8Nta45wlZifB/3tJ3oC4uangyiEiLQvKmg damuCA5JlZRUd0KDFNtxfDyYL1zaixFXtzm4uxDJQ9WHfTkO4gcfXDT2iEU0WFnAFD7YB1 MxYBtZMKnFiZJaGMIT1DRQdfOkfByKbtVptCLmvIxzVoM3tPJrHxb/sAGXbyabf1ZXJxq1 84bd+0r9MB+ft5/alqb0rpUz4XeBNqmM9wfkNm7hP0KF3L71KgY6FriB5EknoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674336806; a=rsa-sha256; cv=none; b=gym3kENk9BSaYxBsslHwyQ2z8g/qjunojTzdIxkBSVoAJZwYrHlafIzq4q6IJ420AisHE2 iWxKi10FCu5XcPlvV8xqM/h+T8yEvqwOTidERoY+wqb6V5YtHAsl4EAjyPbXg8aoSDXRaf SnQCkqOuEBYODU4AJilSdpdOsqYO/bUuAcz9dTHg6SRBfBmbYJq+nYk2owfBSxgqiJf7pm RFLuIl2Lc141ereW807FcKxtyUxoPbScjx13gbjN1NyNNoYNa0dpo+k1pGtda/vPjgGRiP XnNzHofZ3WyCSDpY2izEtX5iVMJSS5yJI7PS19P7DnDKAAcbqk4fhlWCoMQI6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzqNk5N1xzQDq; Sat, 21 Jan 2023 21:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30LLXQNq050386; Sat, 21 Jan 2023 21:33:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30LLXQZJ050385; Sat, 21 Jan 2023 21:33:26 GMT (envelope-from git) Date: Sat, 21 Jan 2023 21:33:26 GMT Message-Id: <202301212133.30LLXQZJ050385@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: 080dbf428796 - stable/13 - ng_bt: Remove an unused 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 080dbf428796bd2f7adfe086e8996e3e5617a86d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=080dbf428796bd2f7adfe086e8996e3e5617a86d commit 080dbf428796bd2f7adfe086e8996e3e5617a86d Author: John Baldwin AuthorDate: 2022-04-08 00:01:26 +0000 Commit: Ed Maste CommitDate: 2023-01-21 21:31:20 +0000 ng_bt: Remove an unused variable. Leave a comment describing the field in the packet it represented. (cherry picked from commit 9f566782e0ba9973a78fd2405427b5de887ac213) --- sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c index 64ab4f0b36b9..b2cdf01423a2 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c @@ -382,7 +382,6 @@ le_advertizing_report(ng_hci_unit_p unit, struct mbuf *event) bdaddr_t bdaddr; int error = 0; int num_reports = 0; - u_int8_t event_type; u_int8_t addr_type; NG_HCI_M_PULLUP(event, sizeof(*ep)); @@ -395,10 +394,10 @@ le_advertizing_report(ng_hci_unit_p unit, struct mbuf *event) ep = NULL; for (; num_reports > 0; num_reports --) { - /* Get remote unit address */ - NG_HCI_M_PULLUP(event, sizeof(u_int8_t)); - event_type = *mtod(event, u_int8_t *); + /* event_type */ m_adj(event, sizeof(u_int8_t)); + + /* Get remote unit address */ NG_HCI_M_PULLUP(event, sizeof(u_int8_t)); addr_type = *mtod(event, u_int8_t *); m_adj(event, sizeof(u_int8_t)); From nobody Sat Jan 21 21:33:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzqNm0kb3z2v2wD; Sat, 21 Jan 2023 21:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzqNl73FCz3KWY; Sat, 21 Jan 2023 21:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674336808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8gt22IPsClsrLjbeX+nk4CnItMq1mUKeLH/lW3njJGQ=; b=WkLjH/1M4sf7gyFFrPS8A1M8VEhKGc/4nkTkqMjSmvVrF2cXnNepGZvYn8GsVAqRbujtLk cdToXjurrLazbidxMODzeDJnxZbWL4ZPafx2M0h/ShRA0ex7eD1C5kbMeVHVUp56UcvnFG gEu/p8b9H6nerTQZoobb7RbqSPYYcAd0e57jBAl5MptLm3bSGf/S3xLDpo6NpU0CZyiIQQ C9qNXS9LWhkcV1PvnOmZZsRaJyaEgjCOm5Mw2H6DdVctdjvIBWqW+hD5yTwz2gdftJvlcF 164gPtrQQEvbxZYjBGRHkT/Xv7EdiIrli3RGvYH1pDVgEXKSdST9xf7jatIuPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674336808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8gt22IPsClsrLjbeX+nk4CnItMq1mUKeLH/lW3njJGQ=; b=mITg0IrD7Hx4txfHkD5wqhZRl5fZaOqAoSX+60TjddxfEjyL6NZ7XFrXnd+2mKxKxYVE7q zpPhmtLI+38UMSR+pSo4ibt1dHTppIybhWQIF+d1B6bWOtPESLMLVurPVa+HLgLhFONpWa Ih+OSbAtCx2ezpKHu+eGTbmc9MJyXWXSpy/XiiuUvwvMa9Kmry/qGPqsaaqZLfmnLc6Oap Se6WhYxssV2MZ5WFMIyZYTcxqRruBL8ZuKAUY23Ld41ZJAigXMwSntX1AHtC8NMtFvVpd1 NZjIl3GF8xnVP9Il2ABJmEUKnRu6d/NFq59OdVF88RvnV2YrWJe5zTxgIIm7Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674336808; a=rsa-sha256; cv=none; b=FKuScdCs5aYScVN36pv5/YNV+Fwccnwrez0f12OpgnXc8YmP15M6adsqA5LItlKfaM8qNP o1BbIPB+pbNLlODV9gifkWAnWS8915qUwZgoY2xsw/F9GZZIvNczuNOfTdw1tSHRx0v5pt 1TjEU4Rn1OrACb1CMk6BaXWNAg+m3LR9kZ1ose+QN5PV1ELo0JEE+J1GY01KfFhcqkMUTl /qGmangyWALvP8HrjqZqKvZhr7SM0vVXirlYpcOv1Q0ZmLMljO1m5GN/EKcQpi3gkDy6k6 P867ehDwl3VPzatQ3dqbZuwHO3GfBuWtOG050goYSaa0VnjVqkCQEORh/XyYjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzqNl5wklzPrD; Sat, 21 Jan 2023 21:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30LLXRU6050410; Sat, 21 Jan 2023 21:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30LLXRaj050409; Sat, 21 Jan 2023 21:33:27 GMT (envelope-from git) Date: Sat, 21 Jan 2023 21:33:27 GMT Message-Id: <202301212133.30LLXRaj050409@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: 65be931e99d4 - stable/13 - ng_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 65be931e99d4178f488b8e3066b164ad8c46fff2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=65be931e99d4178f488b8e3066b164ad8c46fff2 commit 65be931e99d4178f488b8e3066b164ad8c46fff2 Author: Ed Maste AuthorDate: 2022-11-01 13:55:22 +0000 Commit: Ed Maste CommitDate: 2023-01-21 21:31:25 +0000 ng_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report PR: 267396 Reported by: Robert Morris Reviewed by: takawata Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37228 (cherry picked from commit 05c0c99ea37f2558155f346769a00b4180cb59ed) --- sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c index b2cdf01423a2..fec039d1f1f6 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c @@ -399,6 +399,10 @@ le_advertizing_report(ng_hci_unit_p unit, struct mbuf *event) /* Get remote unit address */ NG_HCI_M_PULLUP(event, sizeof(u_int8_t)); + if (event == NULL) { + error = ENOBUFS; + goto out; + } addr_type = *mtod(event, u_int8_t *); m_adj(event, sizeof(u_int8_t));