From nobody Mon Jan 6 07:32:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRQr26d31z5k5cL; Mon, 06 Jan 2025 07:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRQr25lhSz441X; Mon, 6 Jan 2025 07:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736148754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=48V4NJZVvky7T+19gOmEhrfG6zp9/in7HGaAaLtN90g=; b=xmJF2r8eDDftUF/YZ8VUEgIidH9sWo0REDgPJH/bSl7KPAbcXBFq7JKw5Cniam8lYzb9cM GeSWVKJU3UTd2ppQsxE6iWBaepLKat83fRjl9vEujUgGHK/4/Kb0GNsAU384LOs305B/0f 27KVwC03OV2ElOJFI/Rq7rBk8iTevwuy/3BuccPwsLEyqUkzIbG20owrtuK0GmP9iaRsBl IA1QGpGd6a0SsqbGHWa7lkS7V2wwDkvYJQyPZScyES7gzmjr195kn8turMB4E94azVJ3zF xnEf6fMibxPd08S+H3g8gy3W6pFtuWpLsp2avHm+O9op9Ah6wJm9+qQw3FDpuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736148754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=48V4NJZVvky7T+19gOmEhrfG6zp9/in7HGaAaLtN90g=; b=ZBAEzk1UhFRc+zKgXI8sGBPv8gBb8ZDxGjrxsZvL/anRMgfzAGM9s+fY1H/zg7z8IxQbd/ QLN7C3s6gRIBQouGR8x51d0JJlfYVWaFPKkuo6uS/wgTlb1CC/q/sUBdilMfau1FrSXr7R GATtMU/g0eAk5N9ZJz79YH9JJWanxp/z27nTOKrdv4HS5pX+gMQ69wN/6lXukspawNzZg4 QuYnIfWZpxqgnY5y23TUyowyKEBytKWWq3Gnp03aES+IudrWA2TK55nH8+IyYgSsFtWRe5 M34dZTS2ZWCYa6KDnj8dapL1JPkSr5ex4EK+RhrPevhbFZO+W9Q2mviS3/5LHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736148754; a=rsa-sha256; cv=none; b=WDR0S7sNfujbvuYDzdu6Nk5uR8FN8B/uqy5072a+qdy8re0lS4GRLt6V7MN0YnfZkic5rI gFM6XjIxcGGew/xXTfR/xcmoNfpv31yevd5JuXO5p+z6xBWqHAgH9+mlwpfEMpzmAOkU3H v8yW551Su2ojYs21D7/YZOkDOcmP8pCB6RxvXw81GIDAR9/rkYSdfErycCd7rjvxq7K6o5 iUUXELq6JoUrd9Dd8uJwArUH5sJmybwDTwxHCZksK+4xrZehqrUGWvoess6jnbrY44qi1j 5l/konRytV88xJP1O+qVauhbwOD0Pvef4jjuWV9SuR8ia8xWXV9r3p+xHnv0LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRQr25MtHzq1; Mon, 06 Jan 2025 07:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5067WYLb026959; Mon, 6 Jan 2025 07:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5067WYuu026955; Mon, 6 Jan 2025 07:32:34 GMT (envelope-from git) Date: Mon, 6 Jan 2025 07:32:34 GMT Message-Id: <202501060732.5067WYuu026955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a0f06dfb0d18 - main - loader: Add a list of firmware name mapping List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0f06dfb0d188966bee7265ec7d9f20093186bb6 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a0f06dfb0d188966bee7265ec7d9f20093186bb6 commit a0f06dfb0d188966bee7265ec7d9f20093186bb6 Author: Emmanuel Vadot AuthorDate: 2025-01-06 07:34:02 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-06 07:34:02 +0000 loader: Add a list of firmware name mapping Since we started to ship raw firmware for iwm(4), users who loads the driver from loader are having problems as loader don't know that the firmwares are now raw files and not kernel modules anymore. Start a list of default entry for iwm(4) firmwares name mapping so it will still works when loaded from loader. Differential Revision: https://reviews.freebsd.org/D48211 Reviewed by: bz, imp, kevans Sponsored by: Beckhoff Automation GmbH & Co. KG --- stand/defaults/loader.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index d266c240955a..b1e87520a2d4 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -109,7 +109,7 @@ kernels_autodetect="YES" # Auto-detect kernel directories in /boot #comconsole_speed="115200" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device -module_path="/boot/modules;/boot/dtb;/boot/dtb/overlays" # Set the module search path +module_path="/boot/modules;/boot/firmware;/boot/dtb;/boot/dtb/overlays" # Set the module search path module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number @@ -182,3 +182,14 @@ module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist #module_before="cmd" # executes "cmd" before loading the module #module_after="cmd" # executes "cmd" after loading the module #module_error="cmd" # executes "cmd" if load fails + +### Firmware names mapping list +iwm3160fw_type="firmware" +iwm7260fw_type="firmware" +iwm7265fw_type="firmware" +iwm8265fw_type="firmware" +iwm9260fw_type="firmware" +iwm3168fw_type="firmware" +iwm7265Dfw_type="firmware" +iwm8000C_type="firmware" +iwm9000fw_type="firmware" From nobody Mon Jan 6 07:39:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRR0b66DLz5k6KV; Mon, 06 Jan 2025 07:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRR0b5WLNz44x8; Mon, 6 Jan 2025 07:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736149199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k0nZQ6/DKHgCOxYCGj+6JHCHtqiavd1ac9BQPaEY1e4=; b=QyhhsgQXFZwnCX4AM6W/zAcmpzJyxO8Q5cYIanFDe8uAkzQaDJp1iQFsDE7KXYrqby15D3 CJzG+RaYCw7PKa/jnQWjcUHQYd/IQrf2Yx53RjH5g2yvRdHY8LaoQzVaAdMWbO9czbZYd5 FVEMtDtWqdV2d8eHAats8VTjuJws67xFjI0MNZX+98rVXdBiKAhQdmKj1VaE+dKA+CW1Mf 5ltlnsFhuKED2R4d1rkrBLPu3O49+5QXTKz42577jFwnwtpfp598VOpMZ2QYGcfCRGyKXD Uc2wknZtSWkWrVrDypb2bszycNMuTAX9fPpyN5MMcPJZFVQmJlb7/YuGnXQNlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736149199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k0nZQ6/DKHgCOxYCGj+6JHCHtqiavd1ac9BQPaEY1e4=; b=aVmbfhG5+jLsOuVjPnOArm4Y//QRSw/9rJ7hBvqqmIU7Lk2j/b5JnHouJgELXAGV8P5Rpy rmjsrJ311ST3pU857ZpsmM7MJCnHHAXIcmhXe2WHA8Zbv4jTWglHBsRLLOHTSNrxTIv8KJ aawSueAilSmomcMWipWw1ocyPCXzBwZtd8GYvz+lYTbwWzTdYRvly08Z4274CKkeYgVzzB yi44awPZJqya51gVz0OqLxY1OlqEp6kwbiDfMfAgBRY6MDMMreUvvmGphDzA5l1KfDvaWA rERrZTS2tnJCU47v4BLWWjU5+h0fYNtQWmB0cqQYPi4//b8FmRxg290JlXKgfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736149199; a=rsa-sha256; cv=none; b=ibfh+FxkSl8NgkBLeYuJIWaSWFDY7Y7ut0O0toJxsSG/vSXyN/Gel8VZU7blCOhjBoJ0+8 djhtyIxHX+ITIvwYg6ppWvoAM2fC3AgCVnmoE65BU2WEwkvRBJMuYUMnzAO4qJIcv4qRRA rg0vrIGS4Y0KG/H4X6W0fW1XcfRnedrZr3Ms6QC/QAwPnJSiUw0oW4Ip2kAG3ueVKDhmqT bQzCxC9hfB7cOWOicDahiDtU6btZzI07xiFG7hMd8wW1Ota8LyPuVQ0RR9KzUpNKldengw OElg4/FyfZhiAVMKAqODox2Rf1Iqf3gXYfWFBITNjcZgrnnh1lgz8ImpKx9JJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRR0b4mqHz1CTF; Mon, 06 Jan 2025 07:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5067dxkt029407; Mon, 6 Jan 2025 07:39:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5067dx3R029404; Mon, 6 Jan 2025 07:39:59 GMT (envelope-from git) Date: Mon, 6 Jan 2025 07:39:59 GMT Message-Id: <202501060739.5067dx3R029404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 48db612d8939 - main - arm64: Add a new SOC_ROCKCHIP option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48db612d8939fab6081fc2bf16f0d42aef3c682d Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=48db612d8939fab6081fc2bf16f0d42aef3c682d commit 48db612d8939fab6081fc2bf16f0d42aef3c682d Author: Emmanuel Vadot AuthorDate: 2025-01-02 12:46:30 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-06 07:36:58 +0000 arm64: Add a new SOC_ROCKCHIP option A lot of drivers are shared between all rockchip SoCs, each time we add suppot for a new SoC we need to add the options in the files.arm64 lines. Add a new option SOC_ROCKCHIP that will help simplify this file. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D48286 --- sys/arm64/conf/std.rockchip | 1 + sys/conf/files.arm64 | 30 +++++++++++++++--------------- sys/conf/options.arm64 | 7 ++++--- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/sys/arm64/conf/std.rockchip b/sys/arm64/conf/std.rockchip index 3733ddc4eeae..d32de4e4fe79 100644 --- a/sys/arm64/conf/std.rockchip +++ b/sys/arm64/conf/std.rockchip @@ -3,6 +3,7 @@ # # SoC support +options SOC_ROCKCHIP options SOC_ROCKCHIP_RK3328 options SOC_ROCKCHIP_RK3399 options SOC_ROCKCHIP_RK3568 diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 3335dfe6cab1..b1f3aefadbe1 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -720,18 +720,18 @@ arm64/rockchip/rk3568_pciephy.c optional fdt pci soc_rockchip_rk3568 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 arm64/rockchip/rk_otp.c optional fdt soc_rockchip_rk3568 arm64/rockchip/rk_otp_if.m optional fdt soc_rockchip_rk3568 -dev/iicbus/pmic/rockchip/rk8xx.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/iicbus/pmic/rockchip/rk8xx_clocks.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 +dev/iicbus/pmic/rockchip/rk8xx.c optional fdt rk805 soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx_clocks.c optional fdt rk805 soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk805 soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 dev/iicbus/pmic/rockchip/rk808.c optional fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk817.c optional fdt rk817 soc_rockchip_rk3568 -arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 +arm64/rockchip/rk_grf.c optional fdt soc_rockchip +arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip +arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip arm64/rockchip/rk_iodomain.c optional fdt rk_iodomain -arm64/rockchip/rk_usb2phy.c optional fdt rk_usb2phy soc_rockchip_rk3328 | fdt rk_usb2phy soc_rockchip_rk3399 | fdt rk_usb2phy soc_rockchip_rk3568 +arm64/rockchip/rk_usb2phy.c optional fdt rk_usb2phy soc_rockchip arm64/rockchip/rk_typec_phy.c optional fdt rk_typec_phy soc_rockchip_rk3399 arm64/rockchip/rk_tsadc_if.m optional fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 arm64/rockchip/rk_tsadc.c optional fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 @@ -739,13 +739,13 @@ arm64/rockchip/rk_pcie.c optional fdt pci soc_rockchip_rk3399 arm64/rockchip/rk_pcie_phy.c optional fdt pci soc_rockchip_rk3399 # RockChip Clock support -dev/clk/rockchip/rk_cru.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/clk/rockchip/rk_clk_armclk.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/clk/rockchip/rk_clk_composite.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/clk/rockchip/rk_clk_fract.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/clk/rockchip/rk_clk_gate.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/clk/rockchip/rk_clk_mux.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 -dev/clk/rockchip/rk_clk_pll.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 | fdt soc_rockchip_rk3568 +dev/clk/rockchip/rk_cru.c optional fdt soc_rockchip +dev/clk/rockchip/rk_clk_armclk.c optional fdt soc_rockchip +dev/clk/rockchip/rk_clk_composite.c optional fdt soc_rockchip +dev/clk/rockchip/rk_clk_fract.c optional fdt soc_rockchip +dev/clk/rockchip/rk_clk_gate.c optional fdt soc_rockchip +dev/clk/rockchip/rk_clk_mux.c optional fdt soc_rockchip +dev/clk/rockchip/rk_clk_pll.c optional fdt soc_rockchip dev/clk/rockchip/rk3328_cru.c optional fdt soc_rockchip_rk3328 dev/clk/rockchip/rk3399_cru.c optional fdt soc_rockchip_rk3399 dev/clk/rockchip/rk3399_pmucru.c optional fdt soc_rockchip_rk3399 diff --git a/sys/conf/options.arm64 b/sys/conf/options.arm64 index e36f856ecb04..4bdd408f4651 100644 --- a/sys/conf/options.arm64 +++ b/sys/conf/options.arm64 @@ -37,7 +37,8 @@ SOC_INTEL_STRATIX10 opt_soc.h SOC_MARVELL_8K opt_soc.h SOC_NVIDIA_TEGRA210 opt_soc.h SOC_NXP_LS opt_soc.h -SOC_ROCKCHIP_RK3328 opt_soc.h -SOC_ROCKCHIP_RK3399 opt_soc.h -SOC_ROCKCHIP_RK3568 opt_soc.h +SOC_ROCKCHIP opt_soc.h +SOC_ROCKCHIP_RK3328 opt_soc.h # Depends on SOC_ROCKCHIP +SOC_ROCKCHIP_RK3399 opt_soc.h # Depends on SOC_ROCKCHIP +SOC_ROCKCHIP_RK3568 opt_soc.h # Depends on SOC_ROCKCHIP SOC_XILINX_ZYNQ opt_soc.h From nobody Mon Jan 6 07:40:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRR0d0BTdz5k616; Mon, 06 Jan 2025 07:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRR0c6WZgz450Y; Mon, 6 Jan 2025 07:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736149200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IZ6JbWo7OdbcbtiUgyCln8FUlG9D3IDUYSGztZlYyVk=; b=Uq0RxjYKiKZwSwnE01/ZYMnjasyJdIlQYgM/6ZfIV4K98gswLhAHc6pl4kQPXjeL1y4n8P T8LlP94qKvUJzgwxdYmR06rioK2jN2WxMPLz04bPL3si7gd1Hf9N41VYnCVQD8WKmVnKnL eaGbaIBmSZ3mfSWKnvHpULL6CHZp1xt42dbVYN2hBaQ7E7W1E8eyAxPgm23lvLHYxQmQlJ MURc2McGCurfbvm2aMl670G7R7eAGghJyLpMsppv7V6497txExxhw9pXY+kWa/lJlUCHCY YFoxFYflrEg+c59C7qqQNP0kL3bCsBQGWwNLq8cz72nIGp26ZkclPnvVJApf4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736149201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IZ6JbWo7OdbcbtiUgyCln8FUlG9D3IDUYSGztZlYyVk=; b=DF2P2cbLU3XFIZTYZY8zKsSHqIo/BTNd7TfzCxc/c3IE1KIs6djzf2ViwFCjtK/FNs+htI LU3GeJyajEFAPoI0Sxi6aIyX2k2ledLmx/QPUDp3lwHQVr/gmYDX33Mp4LtIM/NFvNxCm3 QhkS8OD1djHII6MGrrgyaPcPc1cd5ZdoUdhPXXGRRBmBwiO7nSVXP9+4h049GdQuf0NJEJ McsQwkq4pUj64rBFmxgD9ymSF6WKDxBr9d/lzprT++P8WcTLkwfa659dE1fm633AV4IarI BuoDJgRh7KVaG9GqMhVnZcjK0sL2Epir8IVepfwQqZbtxaAYANyTj/cQrvR6eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736149201; a=rsa-sha256; cv=none; b=O8zo+3snw0f5j0xliUFnpR85E7VUi3S8xfCdHs8AgqJq4dpANZ/cboRvo29pNQTuNwMFI2 /d1il4PxTzL6uENBap/ucLejpXBowY1/3GPuKxv6xYbDIfcB1qoT3IU477KddX3r8/2Mi3 HGVEV/UdrCigqwEhaoyDeDryz0eLJZ2SBNfRdp3g6otslkccpU1zvngr0G+iV90P80eOfj +vYzMBEv09Grf0eNL3Ias6ls7nCU7mKWvu8CYWFGGjOa3g2NJCAOyi1jn12FSsI9CxSOI5 n7djCi9cbqdCU59qajkA8DtjMtbETGvitKA1HxGNDjXUXXotaS0U/wKA5lH3OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRR0c5K3czd0; Mon, 06 Jan 2025 07:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5067e0MN030920; Mon, 6 Jan 2025 07:40:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5067e0jI030900; Mon, 6 Jan 2025 07:40:00 GMT (envelope-from git) Date: Mon, 6 Jan 2025 07:40:00 GMT Message-Id: <202501060740.5067e0jI030900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ad1bf74705e4 - main - arm64: rockchip: Add a new rk8xx device List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad1bf74705e4bbf116bf9e285088c4dfb31247e2 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ad1bf74705e4bbf116bf9e285088c4dfb31247e2 commit ad1bf74705e4bbf116bf9e285088c4dfb31247e2 Author: Emmanuel Vadot AuthorDate: 2025-01-02 12:51:09 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-06 07:37:29 +0000 arm64: rockchip: Add a new rk8xx device This device will select the base driver for Rockchip PMIC. While here also add a new rk808 device which selects the PMIC used for RK3399 Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D48287 --- sys/arm64/conf/std.rockchip | 2 ++ sys/conf/files.arm64 | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/arm64/conf/std.rockchip b/sys/arm64/conf/std.rockchip index d32de4e4fe79..dc4dfadfde39 100644 --- a/sys/arm64/conf/std.rockchip +++ b/sys/arm64/conf/std.rockchip @@ -21,7 +21,9 @@ device rk_i2c # RockChip I2C controller device fan53555 # Fairchild Semi FAN53555/SYR82x Regulator # Power management controllers +device rk8xx # RockChip RK8XX base support device rk805 # RockChip RK805 PMIC +device rk808 # RockChip RK805 PMIC device rk817 # RockChip RK817 PMIC device syr827 # Silergy SYR827 PMIC device tcs4525 # TCS 4525 PMIC diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index b1f3aefadbe1..ed251b7ae0d7 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -720,12 +720,12 @@ arm64/rockchip/rk3568_pciephy.c optional fdt pci soc_rockchip_rk3568 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 arm64/rockchip/rk_otp.c optional fdt soc_rockchip_rk3568 arm64/rockchip/rk_otp_if.m optional fdt soc_rockchip_rk3568 -dev/iicbus/pmic/rockchip/rk8xx.c optional fdt rk805 soc_rockchip -dev/iicbus/pmic/rockchip/rk8xx_clocks.c optional fdt rk805 soc_rockchip -dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk805 soc_rockchip -dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx.c optional fdt rk8xx soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx_clocks.c optional fdt rk8xx soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk8xx soc_rockchip +dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk8xx soc_rockchip dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 -dev/iicbus/pmic/rockchip/rk808.c optional fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk808.c optional fdt rk808 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk817.c optional fdt rk817 soc_rockchip_rk3568 arm64/rockchip/rk_grf.c optional fdt soc_rockchip arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip From nobody Mon Jan 6 07:40:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRR0f3BjRz5k6R7; Mon, 06 Jan 2025 07:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRR0d6smRz44tc; Mon, 6 Jan 2025 07:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736149202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVQCi1lP6aVrK4F8elzmcW7a8l9+0UTcaxR5z2733xw=; b=RC3MlDPRI2k7A2hGtNn6GvLIwG+hgUshKX7AQb2oJPrHu8a82jW4Kkx/Aw5mZMGMxaifAT ckc13DC3Gr5Fr2r8HSrn0kC0AsZK7W7QGW4Zugzq+fkNrQYJOqlGHTqL+SdPqI6m5AoDvs eVZYsQOJdXwz8aDvKaOuKga7pzRW0QTEBXOnYwhUBivZAom4F9XwXijvQpyrLGiVKPIRNj S8wlXuM6RdDZIpGcAFAea22uzHe2qSOqspi+XV9Od15nxTSqY6b8LbnKJzS2iGTBYr8hlN nl10Nfkrj5Cc955vmrdZlZZH+EWskIyrROOP8i018oHzuphMfUr59dlo0vQjsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736149202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVQCi1lP6aVrK4F8elzmcW7a8l9+0UTcaxR5z2733xw=; b=wvWJUCDB0Us5XAiRObmOFGhFmhxsZ2N6Pupix/1ImE88aPAdT9y4MYABIdA5xkWN5IJQLi U43o+Tg7zDN9Le+GRihru7wuLeo1ONpKaiOUBRvdsBiiK+Xt4K4GL54WndyMFYhrcZWr21 7rw15Whx5iHtSOVaogPTP5uYNCaQdvVYeNVULqO/190rOfpq8URwQv1BKB9kYQK4qN8JGc qkyvKti7u5SLF17nw1tUqX7rFTCZonIOcSObpwcJRH1210DmjoLZiQFA0PdkBYPJWCMzzs llDzaCmP2Nnr0jqrIgWcv2QocsEP2dbFMumK/0XcMwVP8IlTnM2SEJiyv9BSoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736149202; a=rsa-sha256; cv=none; b=RHZkIOluZ7lFUHNQUASHh1QOrsaTy+bgET+ryh+caywWM6Sm1tFkRVMXkNG2uEWxkNbJGI ESzggkW1xqrvEK4sxNuW1IsN681OHvEyKe+xzCTp01IdYI/7fH8+OTtdKT5yUQFF6559X6 1hDx3BS8kskAvzUDbtc2z0fFU3+TZxvWpGF8f4dfXHdNM5A/wGICIGK3T8Jy3uxSVST78W gWsAO/ABSYXsAOk69IUQHVWpmCPrSOof5GKyLW32ITFMeR5zlSenLU0+G5GhOE3PUS08Cf sbQ4iDIkN2BkR+fI1mp6h+nCe70tJ9Myd7e17gEd9f44q7KPxGLYKtYwIHDKRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRR0d64TZzM1; Mon, 06 Jan 2025 07:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5067e1bg031494; Mon, 6 Jan 2025 07:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5067e1J6031488; Mon, 6 Jan 2025 07:40:01 GMT (envelope-from git) Date: Mon, 6 Jan 2025 07:40:01 GMT Message-Id: <202501060740.5067e1J6031488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a071c76746f6 - main - UPDATING: Document recent Rockchip options and device List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a071c76746f6f10ac2254ae1d9d2c34beb21a981 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a071c76746f6f10ac2254ae1d9d2c34beb21a981 commit a071c76746f6f10ac2254ae1d9d2c34beb21a981 Author: Emmanuel Vadot AuthorDate: 2025-01-06 07:39:22 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-06 07:39:22 +0000 UPDATING: Document recent Rockchip options and device --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index 4fef13073431..412eb446f4fd 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20240106: + A new SOC_ROCKCHIP options appeared, so if you have a custom kernel configuration + targetting Rockchip SoC you need to add it so shared and mandatory drivers for + this SoC familly will be selected. + Also a new rk8xx device was added, this select the base driver for Rockchip PMIC. + 20241216: The iwm(4) firmwares are no longer compiled as kernel modules but instead shipped as raw files. For pkgbase users if you use iwm(4) you will need From nobody Mon Jan 6 11:52:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRXc66zb1z5kQ8c; Mon, 06 Jan 2025 11:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRXc667jvz4VXw; Mon, 6 Jan 2025 11:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736164358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=97dd5Gjrg5AZo8w4IyVgB9HDk4xEsBtCQqf/krlQ/QQ=; b=Rld0UanGgiCJ3DzuZc6VBlNjthtSFkh6rw7pouC743ceIsOBL9MBCXPIW3A1S9XkezgRM4 cVyc7k/b3rp6+Jc1IxESqDcRAXKsMGFj1ji8bjp7qQcKn1nrotux2mtN2KM1F8bpeMCSlH nKXU4xEFYFiwsk3DklQbylAwgvawvtinD1Jg3td+Ki5wk5QLO2kagU3fNnsVbrWd83xebx CA7rPSGnwZtO6R6IIO3AhOVqwjUBl6xuJt6HjjiS8Vq/CSkvahIoi4Tdrv8zJjP52JlVcR Kx87/VQNTMr10QCshlXpq7WUaM+YmQN6hIcQX8/k9oHy/NnJwt284PCyt2QYtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736164358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=97dd5Gjrg5AZo8w4IyVgB9HDk4xEsBtCQqf/krlQ/QQ=; b=PO2mVoeor02kJAv0JB2mtOG94h7CBYiZZ7PZljV7WdcDAPlJLdLypSQnC+KQY+E1ld0sXH IQerhFJetVF+D3Lcq2fgeSNryB6Lc2uu5ak1MIQizVtZGOzAiVSyMkwR+EgQckQi7pTBI8 P+4Jt/b4aa45Az+hsiS610DRseeVrEhW6wo9LNN48G8vSXAdgHo4ikUG32O5fd/G9Diqs+ sq+xSxI1dTVuuX9sEYZZL+jGQDZDeFNoIwgPjZETfvqQhpR+fKPht3scu19MMgQqMIXajJ Qe/sSxy+9CDnPGGcKDF/hIMyx4pOivK9zq5poJ92YWxP6yGwP42EInvvWk+Kgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736164358; a=rsa-sha256; cv=none; b=loN6KSmZE8bhusLfFvCruHlM/tqvUd/7JWgM9wXOoxnAOHvPBqzxtr5sQOwmqRk0QaVGfP 2705RPLNjrbNv7lBN6Bdg3g6067/RFStf4R66t1VaHamC9tglSP8nQ9eWXYVqRqRW6QgPP b3hv08eYl7Qt0C+h2OkVMBu4Lf2QaaICwwLLs3X+ohkuvnGR9qx5kuWhYtAzx8L3ZIexGv ylF1DqmQx5Rt3YrT1K3ld+SH7XIojV7dw7I9zVsUt06+MXL14iwwtjXBXsi5/QbTwOOiRE PR5b9Uzz9pU115nrVDg9viWf/Lm1FTR1uSWAboCdgcAfK2MWoF+IbWEGw5hv/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRXc65Sdrz7gJ; Mon, 06 Jan 2025 11:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506BqceN013637; Mon, 6 Jan 2025 11:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506Bqc05013634; Mon, 6 Jan 2025 11:52:38 GMT (envelope-from git) Date: Mon, 6 Jan 2025 11:52:38 GMT Message-Id: <202501061152.506Bqc05013634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 73ad5af7d908 - main - arm64: Unbreak LINT build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73ad5af7d90894cdf9f829cecb45af506bbe2dba Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=73ad5af7d90894cdf9f829cecb45af506bbe2dba commit 73ad5af7d90894cdf9f829cecb45af506bbe2dba Author: Emmanuel Vadot AuthorDate: 2025-01-06 11:50:51 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-06 11:50:51 +0000 arm64: Unbreak LINT build Add the recently added options SOC_ROCKCHIP and device rk8xx. While here add options SOC_ROCKCHIP_RK3568 and device rk808/rk817 which where never added. Fixes: 48db612d8939 ("arm64: Add a new SOC_ROCKCHIP option") Fixes: ad1bf74705e4 ("arm64: rockchip: Add a new rk8xx device") --- sys/arm64/conf/NOTES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm64/conf/NOTES b/sys/arm64/conf/NOTES index b3bf2fedd5f7..54bc7dcf1f09 100644 --- a/sys/arm64/conf/NOTES +++ b/sys/arm64/conf/NOTES @@ -43,8 +43,10 @@ options SOC_INTEL_STRATIX10 options SOC_MARVELL_8K options SOC_NVIDIA_TEGRA210 options SOC_NXP_LS +options SOC_ROCKCHIP options SOC_ROCKCHIP_RK3328 options SOC_ROCKCHIP_RK3399 +options SOC_ROCKCHIP_RK3568 options SOC_XILINX_ZYNQ # Timer drivers @@ -161,7 +163,10 @@ device aw_wdog # Allwinner Watchdog # Power management controllers device axp81x # X-Powers AXP81x PMIC +device rk8xx # RockChip RK8XX base support device rk805 # RockChip RK805 PMIC +device rk808 # RockChip RK808 PMIC +device rk817 # RockChip RK817 PMIC # EFUSE device aw_sid # Allwinner Secure ID EFUSE From nobody Mon Jan 6 16:22:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRfbS1k4cz5jntN; Mon, 06 Jan 2025 16:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRfbS12WHz41b9; Mon, 6 Jan 2025 16:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736180548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kR1FXyRfsKISjeN4ZDACDxnDYG0I5V+QgXzhZFlD1d0=; b=RdbbeV0lL8CKXBE0pskGiRWkMi9eC7/ondveeyRd9NsHIgDeSeH2/+jKlSUBxr5FKeTyrl /e/bJlw4FVMwyIA/t+WRGQpDEz4p1ximCpa2Kpb7gPqO9JbEjNjSLW1BvVzyGRjceEdHmz p4NYIe7BMWdowFMKz+qrSjs6EwXf/SYo8R8h0zsM8qshmGMr9CZRlxvXv0jYZds5uFzH2U avwdgeTQJTXQmtkzPDRhAHnE14o60D56ujm09yvbj8VrTVRyExro0SMRWp05w7gd2k1rdJ VL3EAFXt559NxmJi0XuUZqGdfp7P6cuJ12/fKsb6qy13oCDt9nPs/kaIeUzftA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736180548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kR1FXyRfsKISjeN4ZDACDxnDYG0I5V+QgXzhZFlD1d0=; b=PeAtN26u0yso653/x4jp483jgAo+fXJQlmnPTN5MwgFvVugu7sJk6XYVa+MWeaLpRofXU5 KZW1ibglU9aePWJJOgJHBV2Nhjv1Q0T6dHScsCGD7CMaLsl3YDxEAmyGboKeZ+oBN7r3X7 dmT59CF7g8WX8cxGG4iEiv0REbax6VMThIxrXdso1PKyXQYG6VAt/J2O0YfUf20XbZiYoL LhigauE+MIdnQDXHHCgfqJTHDNkMVK0GOXQpY2GGN2Rvw12rv6ezczdn1P+495Javt5kjS iN6unkFoobNAiulZGh+FWC8c64WeBfrcxoFBwT/AqGzuM7JCzsFVdpyn0/S64A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736180548; a=rsa-sha256; cv=none; b=Nqg50dQq5uiv5cF1cGlX10WGiX7/pOZZ50lKPxMlBLsvq1N/XnE1oUPtr5SjlbP+ufnAEx RrA5aaDdtYKpJcGt1ZJ4rviaHsDuShD6B/TTFOMm6RQTjV1t9OhhXk5NA67k10fmERDY+w 1+11h4gmYc4r6A/at1Otmuzjz5NPwTDxgcTRBTokE/5DNfDNkN88Xp20hRBzTi+7ymF9S3 x16WGwnV+Jdbs4tlV21N7m/6a8Kjx6v3QD5gCSuwNsRXwkPUBPR9cXavnVm4Lfhs59DCvK ymOGfF0BkLGI927R44WSiGDiSmPKG9BuVjzWG+K0F3LaH4goIZJJCwafv1mBCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRfbS0d49zXX9; Mon, 06 Jan 2025 16:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506GMRH2018926; Mon, 6 Jan 2025 16:22:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506GMR6U018923; Mon, 6 Jan 2025 16:22:27 GMT (envelope-from git) Date: Mon, 6 Jan 2025 16:22:27 GMT Message-Id: <202501061622.506GMR6U018923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 7f39f03c4d9a - main - libc/xdr: remove bogus lseek(2) for xdr streams List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f39f03c4d9a138f84a08931b2a6c016521cacf5 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=7f39f03c4d9a138f84a08931b2a6c016521cacf5 commit 7f39f03c4d9a138f84a08931b2a6c016521cacf5 Author: Gleb Smirnoff AuthorDate: 2025-01-06 16:22:14 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-06 16:22:14 +0000 libc/xdr: remove bogus lseek(2) for xdr streams Doing some debugging I noticed that applications using rpc(3) would often make lseek(2) on a totally bogus file descriptor, that looks more like a pointer. So, what happens here is that xdrrec type xdr doesn't keep a track of how many bytes were sent/received on the stream and tries to obtain this number via lseek(2). Then it adds/subtracts the offset in the internal buffer from the obtained number. This code originates from the original Sun RPC import in 1994. However, it was not a working code even if Solaris would support lseek(2) on a socket, because it was passing not the file descriptor, but a pointer to opaque data from upper RPC layer. It could be that previously (before import to FreeBSD) code was correct, but the Solaris 8 documentation says that lseek(2) on socket isn't supported [1]. Maybe supported on older Solaris? Anyway, this lseek(2) never worked and xdr_getpos() would always fail on xdrrec object, until 8f55a568f69c5 in 2008 it was slightly fixed to tolerate failure of lseek(2) and return a correct value within the small internal buffer for XDR_ENCODE mode and a an incorrect (negative to unsigned) result for XDR_DECODE. It seems no consumer ever calls xdr_getpos()/xdr_setpos() on this kind of descriptor when in XDR_DECODE mode. So, remove this lseek(2) and preserve operation within the small buffer only. Supposedly fix the operation for XDR_DECODE mode. Note that there is no use and no test coverage for the XDR_DECODE. Note that xdr(3) manual page already documents limitations for xdr_getpos() and xdr_setpos() for the stream type objects. [1] https://docs.oracle.com/cd/E19109-01/tsolaris8/835-8003/6ruu1b0or/index.html Reviewed by: asomers, markj Differential Revision: https://reviews.freebsd.org/D48205 --- lib/libc/xdr/xdr_rec.c | 69 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index f1167fdeaa65..7dc9bbb31ec3 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -318,27 +318,30 @@ xdrrec_putbytes(XDR *xdrs, const char *addr, u_int len) return (TRUE); } +/* + * XXX: xdrrec operates on a TCP stream and doesn't keep record of how many + * bytes were sent/received overall. Thus, the XDR_GETPOS() and XDR_SETPOS() + * can operate only within small internal buffer. So far, the limited set of + * consumers of this xdr are fine with that. It also seems that methods are + * never called in the XDR_DECODE mode. + */ static u_int xdrrec_getpos(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; - off_t pos; + ptrdiff_t pos; - pos = lseek((int)(u_long)rstrm->tcp_handle, (off_t)0, 1); - if (pos == -1) - pos = 0; switch (xdrs->x_op) { - case XDR_ENCODE: - pos += rstrm->out_finger - rstrm->out_base; + pos = rstrm->out_finger - rstrm->out_base; break; case XDR_DECODE: - pos -= rstrm->in_boundry - rstrm->in_finger; + pos = rstrm->in_finger - rstrm->in_base; break; - default: - pos = (off_t) -1; + case XDR_FREE: + pos = -1; break; } return ((u_int) pos); @@ -352,32 +355,30 @@ xdrrec_setpos(XDR *xdrs, u_int pos) int delta = currpos - pos; char *newpos; - if ((int)currpos != -1) - switch (xdrs->x_op) { - - case XDR_ENCODE: - newpos = rstrm->out_finger - delta; - if ((newpos > (char *)(void *)(rstrm->frag_header)) && - (newpos < rstrm->out_boundry)) { - rstrm->out_finger = newpos; - return (TRUE); - } - break; - - case XDR_DECODE: - newpos = rstrm->in_finger - delta; - if ((delta < (int)(rstrm->fbtbc)) && - (newpos <= rstrm->in_boundry) && - (newpos >= rstrm->in_base)) { - rstrm->in_finger = newpos; - rstrm->fbtbc -= delta; - return (TRUE); - } - break; - - case XDR_FREE: - break; + switch (xdrs->x_op) { + case XDR_ENCODE: + newpos = rstrm->out_finger - delta; + if ((newpos > (char *)(void *)(rstrm->frag_header)) && + (newpos < rstrm->out_boundry)) { + rstrm->out_finger = newpos; + return (TRUE); } + break; + + case XDR_DECODE: + newpos = rstrm->in_finger - delta; + if ((delta < (int)(rstrm->fbtbc)) && + (newpos <= rstrm->in_boundry) && + (newpos >= rstrm->in_base)) { + rstrm->in_finger = newpos; + rstrm->fbtbc -= delta; + return (TRUE); + } + break; + + case XDR_FREE: + break; + } return (FALSE); } From nobody Mon Jan 6 16:22:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRfbT2JRPz5jpDr; Mon, 06 Jan 2025 16:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRfbT1h3Rz41Jt; Mon, 6 Jan 2025 16:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736180549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1mJ1R2E5M0knmmGkxuCG8f1vTJBd9j8P/fEXx/fMESs=; b=VGzk2zLUn8z4fpGpGjTegsZcmscN7SWq3Rnz7oGnkw04SJFdA3Vs6kbOKMYQ4rOQDnfFVN novaihpM2FEtt6kAOAlmgdjznx7BnRVlMt/wIYZyv23ED6Rf7ckxAIasfmugCtVrgIENEh rrhCY6c8PAtQgC4kKa1usQimeFtxZ68b77NVC+RVsfNSIxNGC1HdfZZl4b51PugV2Cbzmw xF6V9mg1Xed0wjXcRkK1Nmpe9jqocMBb3KZ16FEMVrfMzV53Gmg1ysltoyfJk1RmgUSdI6 y7+KgUT8Fqg3HcOFPHESOUxdup+sdENVCzU2dIN8edW/7ixkdsjmSfQm72eNsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736180549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1mJ1R2E5M0knmmGkxuCG8f1vTJBd9j8P/fEXx/fMESs=; b=GYiYR8S/VZ69zYRZoo2zf5kMbM4P/IaYY/cFUR65fmMHvjvFKUgo/yjFk2Xpp16n/wxPC8 h8t9vINaToEyrAsIwYxrgvaD+PdKt9UhKBXYoSq5QR+e6q+TmL3HEM3kZe0EBcmaUb19Md gJLoZDMuTmpEwYNIXIVheXraGJr14L9W7J6UZEaNTanlQEZPuL74hudOsnf6589K6P7lrg 6nE5LrDbnT6D7/z+0xjqTN8LYedwXquGJcKYzWalDy/JbexUMwX5mBuOMnu+nqG7ktN6jn td7hp0jdXl0rb/2rz7z47ZD8z3wtQ2rfuaNfTwp7+BaYVZrDSeXN9gK3g1pcTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736180549; a=rsa-sha256; cv=none; b=ZwtRjbvdnUY7OC1GG2phgIBewIq6K+qlBT4k2/9nwiASxHX6Jv4EgSeOqhZqivl70utNZA Vbb01/Ke0+k/3uQbi9WxvUMQyWeGMowg3gko1fUsSFvynjbRotzH4sUFyURhyE0XTL5/aH ytmWeejN3XHaOEao5D/xFy9Dyf44q9BejQ/Zjq1cEj/A1A6TjvmkQ/RUxPP8+rsh7un8UP St4bHSdnY/4RPOhvLcpInN2TjI5j45vItwSHIf97+WvJUWd+mAbmBWULr02t4PS1lmLTYz MPmrr19o4+Gx8AuqutxC7TMdmUsCpOmCcpjJUH1NuKL4B+SpAajMMA3amGQdEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRfbT1Ft3zX26; Mon, 06 Jan 2025 16:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506GMTm7018974; Mon, 6 Jan 2025 16:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506GMTtJ018971; Mon, 6 Jan 2025 16:22:29 GMT (envelope-from git) Date: Mon, 6 Jan 2025 16:22:29 GMT Message-Id: <202501061622.506GMTtJ018971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: b5c1f7d479de - main - xdr: use C99 initializers for xdr_ops List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5c1f7d479de02f2c886b7453adbea312418ee7a Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b5c1f7d479de02f2c886b7453adbea312418ee7a commit b5c1f7d479de02f2c886b7453adbea312418ee7a Author: Gleb Smirnoff AuthorDate: 2025-01-06 16:22:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-06 16:22:15 +0000 xdr: use C99 initializers for xdr_ops No functional change. --- sys/xdr/xdr_mbuf.c | 16 ++++++++-------- sys/xdr/xdr_mem.c | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sys/xdr/xdr_mbuf.c b/sys/xdr/xdr_mbuf.c index 0ed807de903e..896e317f5526 100644 --- a/sys/xdr/xdr_mbuf.c +++ b/sys/xdr/xdr_mbuf.c @@ -46,14 +46,14 @@ static bool_t xdrmbuf_setpos(XDR *, u_int); static int32_t *xdrmbuf_inline(XDR *, u_int); static const struct xdr_ops xdrmbuf_ops = { - xdrmbuf_getlong, - xdrmbuf_putlong, - xdrmbuf_getbytes, - xdrmbuf_putbytes, - xdrmbuf_getpos, - xdrmbuf_setpos, - xdrmbuf_inline, - xdrmbuf_destroy + .x_getlong = xdrmbuf_getlong, + .x_putlong = xdrmbuf_putlong, + .x_getbytes = xdrmbuf_getbytes, + .x_putbytes = xdrmbuf_putbytes, + .x_getpostn = xdrmbuf_getpos, + .x_setpostn = xdrmbuf_setpos, + .x_inline = xdrmbuf_inline, + .x_destroy = xdrmbuf_destroy, }; /* diff --git a/sys/xdr/xdr_mem.c b/sys/xdr/xdr_mem.c index 1489aadf53a0..65a74836b7b3 100644 --- a/sys/xdr/xdr_mem.c +++ b/sys/xdr/xdr_mem.c @@ -63,27 +63,27 @@ static int32_t *xdrmem_inline_unaligned(XDR *, u_int); static bool_t xdrmem_control(XDR *xdrs, int request, void *info); static const struct xdr_ops xdrmem_ops_aligned = { - xdrmem_getlong_aligned, - xdrmem_putlong_aligned, - xdrmem_getbytes, - xdrmem_putbytes, - xdrmem_getpos, - xdrmem_setpos, - xdrmem_inline_aligned, - xdrmem_destroy, - xdrmem_control + .x_getlong = xdrmem_getlong_aligned, + .x_putlong = xdrmem_putlong_aligned, + .x_getbytes = xdrmem_getbytes, + .x_putbytes = xdrmem_putbytes, + .x_getpostn = xdrmem_getpos, + .x_setpostn = xdrmem_setpos, + .x_inline = xdrmem_inline_aligned, + .x_destroy = xdrmem_destroy, + .x_control = xdrmem_control, }; static const struct xdr_ops xdrmem_ops_unaligned = { - xdrmem_getlong_unaligned, - xdrmem_putlong_unaligned, - xdrmem_getbytes, - xdrmem_putbytes, - xdrmem_getpos, - xdrmem_setpos, - xdrmem_inline_unaligned, - xdrmem_destroy, - xdrmem_control + .x_getlong = xdrmem_getlong_unaligned, + .x_putlong = xdrmem_putlong_unaligned, + .x_getbytes = xdrmem_getbytes, + .x_putbytes = xdrmem_putbytes, + .x_getpostn = xdrmem_getpos, + .x_setpostn = xdrmem_setpos, + .x_inline = xdrmem_inline_unaligned, + .x_destroy = xdrmem_destroy, + .x_control = xdrmem_control }; /* From nobody Mon Jan 6 17:25:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRh0j5CFQz5jv3f; Mon, 06 Jan 2025 17:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRh0j464Tz46ZN; Mon, 6 Jan 2025 17:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736184357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GpVMz+i/SI/OA42IoFSUsdo0uPksZpKDlJSGMB6M9pI=; b=uLxewyb/McaRSyDoLxxJCH6/J4XcPcqNmWA+elpY+aeQu8+Qgx2S6tGmIExV07KApPNbEf sH5tHacnfMi6ad7/izwAvO2lI/9PD2x6xL+giSQVVU87D5lqcDYwiHVtJT8xl8QgyWjadr g5dciiiL3FHlfIhWLo31Ci4/QDDdDBRFTeTuSiqlfh3vyoOxVVzr1HvJJhy4QX7PvnG+0s mhIELsxwV40VoxuIJg4Ztv6rJBQ1eKB9bZ/98kW34mAdgR0KCPTKJtBnLdg5KnBvx8hEn1 gdPPZ1pt6EB6stjRO8ruxYVhtaSD0s625YS+hN1sSkgI982wN4Xb+SnaLXvhpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736184357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GpVMz+i/SI/OA42IoFSUsdo0uPksZpKDlJSGMB6M9pI=; b=D77kr4FqENOhezNhdg+EsOZVp7z6IGsNqY8CFREryTVpAOP9Mn7Hu1zwe070dmGwEW9GdX mzV6108VjDqHdm3WbKgP0ccOAf4v9pV5fotHBllqk0Hz6B1gcxeSB89JhiLMzCujUu+U+1 DQlLNiDo/VawCQtsFhCQ+TijuofnfxHpqyPcTpXS9cAgh57guOEpVrjfzwiTVz1K4SCRUq 4uQDJoExxqjh+onbUb/wGZsBTLXsZ/+9uv85DEv83YmgZqAgB1XLxc7rKV6vLLkpkIE7J0 HqnGIDjOtUKG0QjbOPJAhNDhpLUh2MeUHmfGM4lh7zDeR9hEA7Scm42JdBbRGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736184357; a=rsa-sha256; cv=none; b=HQWVDophr3XC0Mzr1MZRtGxZ2WxvCIYQx4Qo5hN0jSXLbfY9fAk5eR9SIi10OpyxBiF8u3 9Aop+xZbyRVM7pCM79D/oJcYgC1QdobQoN5ACyAAgck+nxy4Yvl3AzG3tAOY4C777+Ao30 Z2Aylf2wfshms0t1w+BV43zU0JRpGfgvs5Q8APy1hJxFfLQB/Ju+RjdnrurGRyIkbGl8F6 ir3jctq5x3/F1p5PjKpMZ+PUDY5MQ6Q0DDQ73GRzVsamMAuagbmr+8olS1qUKZ9eiRt8rz ud30U64LGvjfXp86j2lHMcpWEzROt2q0/0+zRgdMJxrzKmxMnZ8Higr4G/B3mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRh0j3Q8pzZ7t; Mon, 06 Jan 2025 17:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506HPvu7032897; Mon, 6 Jan 2025 17:25:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506HPvfB032894; Mon, 6 Jan 2025 17:25:57 GMT (envelope-from git) Date: Mon, 6 Jan 2025 17:25:57 GMT Message-Id: <202501061725.506HPvfB032894@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: c2153a533ffb - main - fusefs: minor cleanup in the tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2153a533ffb9691848a072c7628dcf56e0e6442 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=c2153a533ffb9691848a072c7628dcf56e0e6442 commit c2153a533ffb9691848a072c7628dcf56e0e6442 Author: Alan Somers AuthorDate: 2024-12-27 21:24:17 +0000 Commit: Alan Somers CommitDate: 2025-01-06 17:25:52 +0000 fusefs: minor cleanup in the tests Delete some unused includes and member variables. MFC after: 2 weeks Sponsored by: ConnectWise --- tests/sys/fs/fusefs/allow_other.cc | 3 --- tests/sys/fs/fusefs/forget.cc | 1 - tests/sys/fs/fusefs/io.cc | 1 - tests/sys/fs/fusefs/notify.cc | 1 - 4 files changed, 6 deletions(-) diff --git a/tests/sys/fs/fusefs/allow_other.cc b/tests/sys/fs/fusefs/allow_other.cc index dae6290ea8e5..24a161166a90 100644 --- a/tests/sys/fs/fusefs/allow_other.cc +++ b/tests/sys/fs/fusefs/allow_other.cc @@ -52,9 +52,6 @@ const static char RELPATH[] = "some_file.txt"; class NoAllowOther: public FuseTest { public: -/* Unprivileged user id */ -int m_uid; - virtual void SetUp() { if (geteuid() != 0) { GTEST_SKIP() << "This test must be run as root"; diff --git a/tests/sys/fs/fusefs/forget.cc b/tests/sys/fs/fusefs/forget.cc index 846198e75925..1e7764ac4782 100644 --- a/tests/sys/fs/fusefs/forget.cc +++ b/tests/sys/fs/fusefs/forget.cc @@ -31,7 +31,6 @@ extern "C" { #include #include -#include #include #include diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index f8684ee02100..ced291836da0 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -31,7 +31,6 @@ extern "C" { #include #include -#include #include #include diff --git a/tests/sys/fs/fusefs/notify.cc b/tests/sys/fs/fusefs/notify.cc index e3f539f57599..1e22bde13db7 100644 --- a/tests/sys/fs/fusefs/notify.cc +++ b/tests/sys/fs/fusefs/notify.cc @@ -30,7 +30,6 @@ extern "C" { #include -#include #include #include From nobody Mon Jan 6 18:01:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRhnN3KpMz5jxqJ; Mon, 06 Jan 2025 18:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRhnM5kQ2z4G1V; Mon, 6 Jan 2025 18:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736186471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h++1lBfpDLUoV05YMhKiwItBb4OqscdXGJcbqDGD4bQ=; b=bNvPMamxxcFUlkqbubhZA5ak7rDlkeHhr+MWSefdFcl9B5DONmCj8TYl8D0wbQ3s6MH+tZ LiwIxYyOlNCz8BYGOKaPRbCwgPlNsI6bbWM1Gw89aDSpkR/tEC8sh6ZwfXPrsnYKf8rPde dn/1bW8+XWbwvCdSWzm3TFAWy+A6pgmxhd8UxginlGg8o3SOr9cRHKgVf7V9zRYAJi/QC7 hTb9y17ESsuYefXgh4LhWF/vZtrVoSV5yYc/Pe76peaCRDjBI8akspYiJhX1AykbJo+WbX ymK41mhn+TZO50bSRjuDQJ84vAoHbkn63ej14WOOFxXMpznOJmYV9C+UG8p3BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736186471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h++1lBfpDLUoV05YMhKiwItBb4OqscdXGJcbqDGD4bQ=; b=bdUefLsW3SdtcOTpqDcDT9z5UYdWlB8eYkPFsm/ChjqfngSI5KE6g2qVJpd/5caKzMnvhV 1Og9KxEfkCQG28fP+2Al3ip5irRMNsBQaJVV7eaF/PJZJNZdvqegbucqGRRuVBKDG40MI1 mNKBlHelv9rBUHfA/oVuFnmu/IgtPCMUrBuU11p+s/PFXRfaUknLjW7nYLdOU2ZzIDgNdf 08zi3l9Z/v0O3DcaDVbsDLriLhqiBg53sYsZphI9ylGbyiH7AxT01A76G1G8TwC4fMdKB4 4gWu4DS2IAT2LY2EJ4z5QF5R3+wUNGeRMoX5gCO6/ERJ8CePK6KKXhyUvnmkqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736186471; a=rsa-sha256; cv=none; b=q1Uy+8K0CV/tUXQBkR3dwV7MhqlsmnUvLTZgri5wF7a0xSCQPiWy16IwZNdPUUbUFjgcSU QpH/pSSEJfJkJJB4fbiEZLUJAZ+g+I8GSmsfVvVswiUB1EwCAUclIIKnSz1apkI4GwoJqu BFxUM10fQ+SHYk9LSyYYT5R2ljCQGUWy5jRkUcW8XjLpkXk2h4o4t3tmWp+mRciqOpERTi 33Pb+IPC9ypgQ8SLZfKgOcvfzwnG04Zjk0XfAcQMKtROrcps/Tx9LyELtATM7DcVfARTGM ASQ1jqVj1rM4nNyTv2jqURiyHMvqqI3eAhss3uEtnM3PH1dADwbeMQcwQHlMZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRhnM4hnFzbpt; Mon, 06 Jan 2025 18:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506I1Bgw004042; Mon, 6 Jan 2025 18:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506I1BMJ004039; Mon, 6 Jan 2025 18:01:11 GMT (envelope-from git) Date: Mon, 6 Jan 2025 18:01:11 GMT Message-Id: <202501061801.506I1BMJ004039@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: 58610d1e0fbb - main - build: Sort distributekernel METALOG when using -DNO_ROOT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58610d1e0fbbd1a49927559ee3970d8e4594cc86 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=58610d1e0fbbd1a49927559ee3970d8e4594cc86 commit 58610d1e0fbbd1a49927559ee3970d8e4594cc86 Author: Pat Maddox AuthorDate: 2024-12-13 19:57:30 +0000 Commit: Ed Maste CommitDate: 2025-01-06 17:56:30 +0000 build: Sort distributekernel METALOG when using -DNO_ROOT The metalog is produced by install -M, which is not inherently sorted. This results in non-deterministic file ordering in kernel.txz. Order the files in kernel.txz to support reproducible builds. PR: 283214 Reviewed by: emaste Signed-off-by: Pat Maddox --- Makefile.inc1 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index bad747a0e551..fe799218ab0a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1903,9 +1903,7 @@ distributekernel distributekernel.debug: .PHONY false .endif mkdir -p ${DESTDIR}/${DISTDIR} -.if defined(NO_ROOT) - @echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta -.endif + rm -f ${DESTDIR}/${DISTDIR}/kernel.premeta ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH:Q} ${MAKE} KERNEL=${INSTKERNNAME} \ @@ -1913,15 +1911,14 @@ distributekernel distributekernel.debug: .PHONY METALOG=${METALOG:S/METALOG/kernel.premeta/} \ ${.TARGET:S/distributekernel/install/} .if defined(NO_ROOT) - @sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ - ${DESTDIR}/${DISTDIR}/kernel.meta + echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.meta + sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta | \ + ${METALOG_SORT_CMD} >> ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} -.if defined(NO_ROOT) - @echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta -.endif + rm -f ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH:Q} ${MAKE} \ @@ -1930,9 +1927,10 @@ distributekernel distributekernel.debug: .PHONY METALOG=${METALOG:S/METALOG/kernel.${_kernel}.premeta/} \ ${.TARGET:S/distributekernel/install/} .if defined(NO_ROOT) - @sed -e "s|^./kernel.${_kernel}|.|" \ - ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \ - ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta + echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta + sed -e "s|^./kernel.${_kernel}|.|" \ + ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta | \ + ${METALOG_SORT_CMD} >> ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta .endif .endfor .endif From nobody Mon Jan 6 19:30:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRkmW1vb3z5k5Bb; Mon, 06 Jan 2025 19:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRkmW1DFxz4R4N; Mon, 6 Jan 2025 19:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736191835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L5w5Ods4SSwZV4mL5o/yWtaBs/rQgH0q2QClU54jMc0=; b=YWO20CQ12NqywzweO2/0aOR4ITBz1gGH3Nf9gEdIWW/vLcLwZP22CYCBNgmtp0PaEPrvSB cJGU75scGwsDyH11cvbh4WReZ/W/AIOl9+EFGp6VprVPws4xJOM6OaB0zodfr/5bfmbt4L jyAUD/gzTNWOwLXMmp6JPoGSZtlnK4NWBxYezKLN7ArVy3SLAd7AG4TF0xY3SqDauh+hak UV1723Kgjr5yTJxqjMQqQQOgJS4tCvRwdp/6EiIhEWbVsTzvb+bWLrErzOsBAGPh+CqKrd PrO0JDDviKFxNM7KffaV2oj+THBZgo0QFgxGCOcyIR0/Wn910mG3niH61yCaSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736191835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L5w5Ods4SSwZV4mL5o/yWtaBs/rQgH0q2QClU54jMc0=; b=wnE9IwcSuyoEqKjNETHhR6/05hWXWBSBzfX5LLfUqGf7MyOgKCtZfw+45iR7hC4KF633Tp Km061tif7H/SI3tog2MsWgsitWVZ4x9H6yaXG2OXzPTWhLxFItsl+VIOwogYweFfSIHDmw /cnb5n9Ro5Xue+9fQ5Twnpu9Fpc9rqSjxyDUOCdMKa0ekgJ073T/A7ixcMFD3HZ9X6Vted axbNUoG9B+0QfCmH4ePteMlm9bZIFCPm3dlBWDl1C5Irxyhb+aL/ZGRz9rxhmygsMvTCzT S9oGM5N4mivv7wHn3Q3/G4NIUAC43VoUfrRYTrKcPhuMmytRqcmLo+R3FD4n9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736191835; a=rsa-sha256; cv=none; b=c2x1nun0sE1bs+m86mVo77Q+heUS8d8KghfQG8Rz+6GoBn8TJGps2rEjGf3Gu9+qm8fGAo Wefp35Ci0acGFt4T4Yfs9xqR/u335FZgDnBPWGqc1gEKmjEHNZ4rUDBE93Vu8vBZgVb75U 3Wa42oZ1Sm/BnHzzCd1CIIn79ZgrUR0I695Q6fzfMPqPwCnJc8q9DguVEeMwWwsWWHgQoC nIR6QgU5mCt8SH7wd4YkiPaEnVNK0G1TjacK23TLJBDbGd4cYvP3CKFaHByBiUbsqTswNm R6sGfhucfFj/P18/039iYmt1jBr9umjOrHCEl3WTY4IwoliD0iIjwNSLBlrwzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRkmW0MNVzdnY; Mon, 06 Jan 2025 19:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506JUY1q067720; Mon, 6 Jan 2025 19:30:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506JUYY2067717; Mon, 6 Jan 2025 19:30:34 GMT (envelope-from git) Date: Mon, 6 Jan 2025 19:30:34 GMT Message-Id: <202501061930.506JUYY2067717@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: f415b2ef30f7 - main - fusefs: Coverity cleanup in the lseek tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f415b2ef30f7bf0db753f09fbba7b0910475b0d2 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f415b2ef30f7bf0db753f09fbba7b0910475b0d2 commit f415b2ef30f7bf0db753f09fbba7b0910475b0d2 Author: Alan Somers AuthorDate: 2025-01-06 19:21:29 +0000 Commit: Alan Somers CommitDate: 2025-01-06 19:30:16 +0000 fusefs: Coverity cleanup in the lseek tests Always check the return value of open(). Reported by: Coverity Scan CID: 1471118 1471133 1471215 1471896 1471901 1472116 1473799 CID: 1473879 1473996 1555269 1558044 MFC after: 2 weeks Sponsored by: ConnectWise --- tests/sys/fs/fusefs/lseek.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/sys/fs/fusefs/lseek.cc b/tests/sys/fs/fusefs/lseek.cc index 2a1cb198bcce..12d41f7af1b2 100644 --- a/tests/sys/fs/fusefs/lseek.cc +++ b/tests/sys/fs/fusefs/lseek.cc @@ -71,6 +71,7 @@ TEST_F(LseekPathconf, already_enosys) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_in, lseek(fd, offset_in, SEEK_DATA)); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -105,6 +106,7 @@ TEST_F(LseekPathconf, already_seeked) out.body.lseek.offset = i.body.lseek.offset; }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset, lseek(fd, offset, SEEK_DATA)); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -171,6 +173,7 @@ TEST_F(LseekPathconf, eio) .WillRepeatedly(Invoke(ReturnErrno(EIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EIO, errno); @@ -203,6 +206,7 @@ TEST_F(LseekPathconf, enosys_now) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EINVAL, errno); @@ -266,6 +270,7 @@ TEST_F(LseekPathconf, seek_now) }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_initial, lseek(fd, offset_initial, SEEK_SET)); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); /* And check that the file pointer hasn't changed */ @@ -299,6 +304,7 @@ TEST_F(LseekPathconf, zerolength) ).WillOnce(Invoke(ReturnErrno(ENXIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); /* Check again, to ensure that the kernel recorded the response */ EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -327,6 +333,7 @@ TEST_F(LseekPathconf_7_23, already_enosys) ).Times(0); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EINVAL, errno); @@ -391,6 +398,7 @@ TEST_F(LseekSeekData, enosys) _) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); /* * Default behavior: ENXIO if offset is < 0 or >= fsize, offset @@ -431,6 +439,7 @@ TEST_F(LseekSeekHole, ok) out.body.lseek.offset = offset_out; }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_out, lseek(fd, offset_in, SEEK_HOLE)); EXPECT_EQ(offset_out, lseek(fd, 0, SEEK_CUR)); @@ -463,6 +472,7 @@ TEST_F(LseekSeekHole, enosys) _) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); /* * Default behavior: ENXIO if offset is < 0 or >= fsize, fsize @@ -500,6 +510,7 @@ TEST_F(LseekSeekHole, enxio) _) ).WillOnce(Invoke(ReturnErrno(ENXIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, lseek(fd, offset_in, SEEK_HOLE)); EXPECT_EQ(ENXIO, errno); From nobody Mon Jan 6 19:39:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRkz66cd4z5k66q; Mon, 06 Jan 2025 19:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRkz65r42z4S2Z; Mon, 6 Jan 2025 19:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736192386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NIDJaZxDig4ktYgiNDviSjp08sbh08JrjbjCCRzKGM=; b=HQ6huq6ZZDo8x9VsdpAdw44mhfWPVe4Hw4Fp6PDUj+tUpL5WsrCRbqtzX7TYJplnYwECMn DrH8y3P/vxpU8gH2YBRqE9nYyijQK7H83kW7mC1e+SmD9smNEADzhaxIqAnf2D4cEfCxN7 bEgJggscUZKZrEme3GeyGlQ4/1fNN+Wyf/Xec7brJ5hUg6SGVT4ibirhdY7pfAQHXIkBH8 sco5Ib01fL86UDD3FhuaFq7g4UpsGkH1knXQqP3gqcTq/p9ua0pU9lPknsgP02EceywUPC CmO3SN4gddb7ZhopV3PHuMtrxoAgQdA2sy+XnLXecncH40+O2TTlalLkhE1HjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736192386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NIDJaZxDig4ktYgiNDviSjp08sbh08JrjbjCCRzKGM=; b=i6IYtPkcO5r8BsG5fQH9l9XYYVTnOTnBjy9CJtDVjCG635n2R2TlPUZvtpX/h8hDROMPRG UrlyKP4H+YjSB22yi5dSw2koQjRYvGnZzAhMvR0n2zP9WJsUFty4bS4tR7QNkU2FjzNVgR Le+aimIiUP1qazTl0jTxStHwW/OxHLqfoXMQPfrGyExhOiwrN0tOOo65ui6j0JYtvla65F IGA2Zux135RfdEMLxW65EOOnV2Ir2/MvrJdN4HEUJy2gZuCGB4A8EEtXaYVkbG2oR3pgz9 lnt7xQnjwX87VSq2VCDTEMaH4ClK0udg06QtRiKEQBk7rh8qARPBRpQCMVzEbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736192386; a=rsa-sha256; cv=none; b=JXYyCC97UAN12ggw4CUMpdZzEBgpdDk8u378SXX2Hq89UGhbDQnsRjZGD1OVAZ/jBnMIgm n5hBvCKscARzL4U9jazM+iP0OkorZJXyIy8PUqL7/olwG4eW35zaOw0IgmQ7vugnG01awf e8gf/TKRmiiIleX26rT04tXqw1EbW8h5a3OHBS0YOYXFm/AZULXGCNoFa8tCAwdhZ5kf6U tkaafQ1FIYipMQ5T4kLWfcj+wssLvBdaua0K9PL/FbytYpzbcGAxWBCAYFat+hdoJMeCpX ByC5/OThtOD6SiUuLk++o5UBpILk13J0PnveHQfLnZ1juoR1QJjLoT5EC+7Xnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRkz656wBzdy0; Mon, 06 Jan 2025 19:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506JdkAV077226; Mon, 6 Jan 2025 19:39:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506JdkuK077223; Mon, 6 Jan 2025 19:39:46 GMT (envelope-from git) Date: Mon, 6 Jan 2025 19:39:46 GMT Message-Id: <202501061939.506JdkuK077223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: bb9525f30214 - main - TCP RACK: fix TCP fast open List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb9525f30214e8b6c53c6cccd9e8f02e8f8e8c42 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bb9525f30214e8b6c53c6cccd9e8f02e8f8e8c42 commit bb9525f30214e8b6c53c6cccd9e8f02e8f8e8c42 Author: Michael Tuexen AuthorDate: 2025-01-06 19:35:11 +0000 Commit: Michael Tuexen CommitDate: 2025-01-06 19:39:40 +0000 TCP RACK: fix TCP fast open Do not jump to a place in the code, which requires several variables to be set (segsize, minseg, idle, len, sb_offset), which is not true. To avoid using these variables, start the HPTS timer explicitly. This fix only applies to the client side using TCP fast open. Approved by: rrs CID: 1523766 CID: 1523770 CID: 1523786 CID: 1523801 CID: 1523809 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48322 --- sys/netinet/tcp_stacks/rack.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index cc0725324760..7baf1a626787 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -19943,10 +19943,11 @@ rack_output(struct tcpcb *tp) (tp->t_state == TCPS_SYN_SENT)) && SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */ (tp->t_rxtshift == 0)) { /* not a retransmit */ - cwnd_to_use = rack->r_ctl.cwnd_to_use = tp->snd_cwnd; - so = inp->inp_socket; - sb = &so->so_snd; - goto just_return_nolock; + rack_start_hpts_timer(rack, tp, cts, 0, 0, 0); +#ifdef TCP_ACCOUNTING + sched_unpin(); +#endif + return (0); } /* * Determine length of data that should be transmitted, and flags From nobody Mon Jan 6 19:43:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRl2y5P7Dz5k6Gq; Mon, 06 Jan 2025 19:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRl2y4c3Lz4Sct; Mon, 6 Jan 2025 19:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736192586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aAxDJDuDIYYxr91AfGz6E3utjaQx7VWXwMYpjTE2P4I=; b=WCt4d/fQ9TAhsmrzmgTZZVOJ+BFmWSLWoSbOnCZCbV/HZdIRiHZYPd9bUz1aH8esF7hJ/E lmdfWUkYodbpIFBzVk6Pel8dKeCne3tuj55XKyaFa3fXVbOOYdY1jnfrXZoWM0BXGjk4x6 pS/ZWe0UTYMDEx32W2vKveHumHBYCFYDKOML20prIDnoIaYr9Ca5C6J8jlluwSYbQRL3Vq rF5+40EfRWoMX1GzsCfCUridulPDZtrBlQaFBIE69K4RKzIDSVs9+BOZA9U1jeqq5RyqM1 KnsRtuIGCSOFsiQQGjeHFFPzHzvCdc8/+HbHT5lHQ09C6Uv3CTY1FqSHPgSu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736192586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aAxDJDuDIYYxr91AfGz6E3utjaQx7VWXwMYpjTE2P4I=; b=YuJkppLxPVfJxG8ZroqBXXOEgXJCOu3yeev/8svHcnTZb89yUs8EbZaPgPy2k+92dmMzBs iNGZmHn7kIQ1VGzVAyyVsRuYw9nMEukMg31oar0PNCNIkzQ8h/wsFo0x0/7b5yQFXkxuJQ uxkm+JiEjcBmenInALOB4DCosCKCBtE9+x8ovCTYNyehYj733ey14zi3Ca6zTmyZZi/AfU CQkfHGmHZiCS5ms1U9xPXtBPFYev51R8J0Rmz72Dft9o9iT0YNb75U0+nzORpHe3RzHSZU DH5c+T5r3Xo8rUmj4lpbjx95c8Oa2MqfiCKXM/QB3SS98t562qhOIXkTURDBOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736192586; a=rsa-sha256; cv=none; b=HWPgICEK9euxFYOoPVGSkuU+dSTbt786Knmvdpiy0yoFfYFXvcm7VcydkfpnxxFCZVnf5p sbZQnCCTRe3hnL1/XYmrNgFIYKtMIaSM83G1bkZpNTw1xXE2A7b0o6sScqkV6aQ5L21szp +zsHs+7aXz2TSMle4qN20qQL046bB0OgX1R5RfrYJYnOZWvp7OYWrlYcA8O9VQjVKthbBz +u2M5roAyS4HLGtNiMxgJdcC+uTRiXTYFzqMftLfcpaJpdKMANTsyi1vD6YYspTATm/6dc ziqPCGiKM4ZXTKpHblsw5iWEmdB4pURgN3Q3Ujr7TqsMq6FLKVQWCAQGvZ0WCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRl2y47SzzfBy; Mon, 06 Jan 2025 19:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506Jh6jn093989; Mon, 6 Jan 2025 19:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506Jh6Pm093986; Mon, 6 Jan 2025 19:43:06 GMT (envelope-from git) Date: Mon, 6 Jan 2025 19:43:06 GMT Message-Id: <202501061943.506Jh6Pm093986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: c28fefe1dc44 - main - TCP BBR: remove dead code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c28fefe1dc44b69743dd18d038440da38a2867a7 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c28fefe1dc44b69743dd18d038440da38a2867a7 commit c28fefe1dc44b69743dd18d038440da38a2867a7 Author: Michael Tuexen AuthorDate: 2025-01-06 19:40:33 +0000 Commit: Michael Tuexen CommitDate: 2025-01-06 19:40:33 +0000 TCP BBR: remove dead code bw is unsigned and not zero. So it cannot be smaller than 1. No functional change intended. Reviewed by: rrs, cc CID: 1523791 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48323 --- sys/netinet/tcp_stacks/bbr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 535766a0a1b0..97ff46f0b96b 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -2993,9 +2993,6 @@ use_initial_window: /* We should not be at 0, go to the initial window then */ goto use_initial_window; } - if (bw < 1) - /* Probably should panic */ - bw = 1; if (bw < min_bw) bw = min_bw; return (bw); From nobody Mon Jan 6 20:27:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRm2d02sxz5k9X3; Mon, 06 Jan 2025 20:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRm2c5mTcz4XhZ; Mon, 6 Jan 2025 20:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736195272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gBLXqYpc/b2XzaQmv+PT7Fhjf9KulvqoiPQNqHujq88=; b=Ni6n5kAaUzZeY3oh2e6mB9tuVaqLw3Z4KqPjAmwYkz+wW0KYEUR4G5Ew4y2dZerXICBt5D ubo1vv7fbnEUTUePPzcF8NTuV8pUf4ozYMT+Vus6eGMqAqM4dT//7hneTUfGF+hWfFrUq2 P1cYfA6BRbi9DAOfOCAvCSSh37Z5ewTg4PMUs87BCAOZOVKRgciOXlatVJ/gacY7oliaHp jnOsG1KwLGhItgQLlHF9QDNF9n58XqxBMk1bxDScBm1RyN2hKgyxIdYwRjYtTNteOXu4Zq kB+RXyA+RGKbBSIrma9vGRHqfBo+V2AxAU7rS4KQUfYuGi/ZrLS/13fA60GpXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736195272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gBLXqYpc/b2XzaQmv+PT7Fhjf9KulvqoiPQNqHujq88=; b=XG2jfrmxZJHsv1/rxANMY4Ud+2cL2reNMcaIqikwV+ZtBh76NfPY4TU0zB1QXF9oy9RlBT vZYrmOJsdcmj/60dI8rGnW9sPMWCP+a6twvQrh9EXbfKxQAmtFZ42B/1WwGzdzNM/RETAp 6M8rpcuHZQxKSWknPUwt4MaV4cqVti+q7ARxwSNGtq20upr3TkRl3L9v7wc40x5rblQ7yZ MIkJJRMOjr7VcllRllvFNd7jQaiqyJ6l0CbYdBDwU9a9v7fXE92nd9BGCK8py5os35bPWT ln6cmbJlcpt0tElY2Co2PqNxjMC0R88Xb4jile0ukO5Nzh30lhucQdn++1fD9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736195272; a=rsa-sha256; cv=none; b=V2C7pNZQvmr9clzM2u3dCsVSULHklQHYlLrQVeGolBlWuvmexTD9BDmTQEZJCJdRyE+ibH UvRmSZZmFFh+95WGMUWzll/wVpoHFEPji6Vy1r6m2GZbhEnIwaYJ6uTsS9wr7E81+U6wNY d2Cu0aFOv80wSi+op1n7C4igxTujnIpLQogGiy2Wzz1iVsQs5KepHg8MWnGqZQT8h29nx6 t0dGInBG94Yn/EoRERbS+ZSZ+zSYCm1A3HI6DTSFRS0IiPXEJn1n4MOdTGYz0U0enxq7bu /YfVdPN8P6Rzcf2dL4snznhFWrjX+/Y8/f6yxC18yEGrjGBOg/cL+60i/w7jIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRm2c4lMxzfv2; Mon, 06 Jan 2025 20:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506KRqa8070588; Mon, 6 Jan 2025 20:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506KRqTq070585; Mon, 6 Jan 2025 20:27:52 GMT (envelope-from git) Date: Mon, 6 Jan 2025 20:27:52 GMT Message-Id: <202501062027.506KRqTq070585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 061727efe1e3 - main - TCP BBR: remove dead code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 061727efe1e355fb2fde1b05e92718543d05bfe7 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=061727efe1e355fb2fde1b05e92718543d05bfe7 commit 061727efe1e355fb2fde1b05e92718543d05bfe7 Author: Michael Tuexen AuthorDate: 2025-01-06 20:25:58 +0000 Commit: Michael Tuexen CommitDate: 2025-01-06 20:25:58 +0000 TCP BBR: remove dead code No functional change intended. Reviewed by: rrs CID: 1523808 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48338 --- sys/netinet/tcp_stacks/bbr.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 97ff46f0b96b..4600088bd1a1 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -978,14 +978,6 @@ bbr_timer_audit(struct tcpcb *tp, struct tcp_bbr *bbr, uint32_t cts, struct sock * and we do */ return; - } else if (sbavail(&inp->inp_socket->so_snd) && - (tmr_up == PACE_TMR_RXT)) { - /* - * if we hit enobufs then we would expect the - * possibility of nothing outstanding and the RXT up - * (and the hptsi timer). - */ - return; } else if (((V_tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && (tp->t_state <= TCPS_CLOSING)) && From nobody Mon Jan 6 20:44:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRmPq2XrJz5kBjg; Mon, 06 Jan 2025 20:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRmPq197Rz4Zmr; Mon, 6 Jan 2025 20:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736196271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7z2ZGKCBo70/5rvF849l7mU7ZjvxBozmKi7J2oK2PaY=; b=aCzQC/LHNbzAapYgyxEa3Naxv0FYJnZPGuaxg/m0iunymzlbvyq2ybVxioiQvJD+z1o3pK bbPODrYTIQmzcJuuZQUMFcbyooFDZZK8LpqFu0mKPk7+Bvvq7SKAfg+GTa/yBqk1w6NUAd EJLO/Vw/LofeUHicofpHKY1XeO7dtQZj32rFUDkAS7fOexTPVTNxBbotbnYHW/5mlSzdOb LKNdt5Ig+2oJ0XhTMqESNY1t42CyLGbeTRrVkeTvsJq+jdGBirmaVwalXQClLpF9mVNL2+ 20V6/P7ysWqdIFFUKK6nH+X4vuTl3/latNC5Ng9MPPEePOtCEVd7joTzbqdXgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736196271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7z2ZGKCBo70/5rvF849l7mU7ZjvxBozmKi7J2oK2PaY=; b=QxIU/rcQ1gWWp9xFf/Boka3GbA0lNEmsj9grWbQ/l+8QeqbZB0danNIUsxytvsduY0Be7p s+GWcfn5lY3jMpmu8hgm1r9RAgPg5T0Vp5XSBPNqFvuN9tLsGpdMFvJkiqlpr6eH/97Tty Wx1x3209MHJO/CdZWQdSUYOJrUuUC/Ws+fJ9Qj/SsvV4soGr7Qt7d6k/BEjDxaFIu6hOLe +JLtScc1VDUx/BwaIGtKIfKVwiuxpPJNSpjxORS+YpydP0kRE3dLj5jbSYQayezIMC6UdI KEc8YZdoH6r3cPXD/NhGgTyySPba2aMauD2jhq5R/lZ8hs9Mm9uyWVvJXmkuAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736196271; a=rsa-sha256; cv=none; b=dH2WIQX5z5jyn9E+BvZXf2DrCkYhOZpIA3CZbbdIt1Vipu0oV8pMqHY22bUWDvceyF9lzW 9504NYT0APcqpHMLyuVLUN2SzYwD5ZEa/lmk9arNV5RqP7D2ssgqnIIkxBodMOo9BGZTv5 wUWywVrjTBzW0BNKXRXZ5p43CjK/+gZ59y8m0lBMhC3a3dJAr9y0Fq5RT059uFFcsZMEDz OqjIaeaFteSon9n8O0UslCVJmIrHriwEZ2DBkek1LJtHPe4jlgvKA3CT3rT8z6kZDAmxn4 S3NuUms90O16VwdMvgPHI3Sv2RCs0+KZGWnaj7GpJBtkCJ4dLw6v88/ViWYyww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRmPq0NF0zgCd; Mon, 06 Jan 2025 20:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506KiUJ7006414; Mon, 6 Jan 2025 20:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506KiUB7006411; Mon, 6 Jan 2025 20:44:30 GMT (envelope-from git) Date: Mon, 6 Jan 2025 20:44:30 GMT Message-Id: <202501062044.506KiUB7006411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e8ec28047df5 - main - TCP RACK: fix TCP_RACK_PACING_BETA socket option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8ec28047df5185582a95c5211ed75682fad5ec5 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e8ec28047df5185582a95c5211ed75682fad5ec5 commit e8ec28047df5185582a95c5211ed75682fad5ec5 Author: Michael Tuexen AuthorDate: 2025-01-06 20:38:34 +0000 Commit: Michael Tuexen CommitDate: 2025-01-06 20:38:34 +0000 TCP RACK: fix TCP_RACK_PACING_BETA socket option Bring back the code, which was accidentally removed. While there, indent a comment correctly. Reviewed by: rrs CID: 1540026 Fixes: e18b97bd63a8 ("Update to bring the rack stack with all its fixes in.") MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48340 --- sys/netinet/tcp_stacks/rack.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 7baf1a626787..f590edd71d9d 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -24486,15 +24486,29 @@ rack_get_sockopt(struct tcpcb *tp, struct sockopt *sopt) * when you exit recovery. */ case TCP_RACK_PACING_BETA: + if (strcmp(tp->t_cc->name, CCALGONAME_NEWRENO) != 0) + error = EINVAL; + else if (rack->rc_pacing_cc_set == 0) + optval = rack->r_ctl.rc_saved_beta.beta; + else { + /* + * Reach out into the CC data and report back what + * I have previously set. Yeah it looks hackish but + * we don't want to report the saved values. + */ + if (tp->t_ccv.cc_data) + optval = ((struct newreno *)tp->t_ccv.cc_data)->beta; + else + error = EINVAL; + } break; - /* - * Beta_ecn is the congestion control value for NewReno that influences how - * much of a backoff happens when a ECN mark is detected. It is normally set - * to 80 for 80% i.e. the cwnd is reduced by 20% of its previous value when - * you exit recovery. Note that classic ECN has a beta of 50, it is only - * ABE Ecn that uses this "less" value, but we do too with pacing :) - */ - + /* + * Beta_ecn is the congestion control value for NewReno that influences how + * much of a backoff happens when a ECN mark is detected. It is normally set + * to 80 for 80% i.e. the cwnd is reduced by 20% of its previous value when + * you exit recovery. Note that classic ECN has a beta of 50, it is only + * ABE Ecn that uses this "less" value, but we do too with pacing :) + */ case TCP_RACK_PACING_BETA_ECN: if (strcmp(tp->t_cc->name, CCALGONAME_NEWRENO) != 0) error = EINVAL; From nobody Mon Jan 6 21:03:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRmr60yqxz5kCrC; Mon, 06 Jan 2025 21:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRmr60PTwz4dF4; Mon, 6 Jan 2025 21:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736197430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K/4z8ZTf2w3kVBWL5M2bsi4J3e+YQcWWtShK0NEagR4=; b=swTDtjOstGeLa/wOXg/hQwUYRsE9wfQje2A+iKRR+aM5hqkjwz82rhCXd3RNC7e0uGEsMZ 9aXm55VfIbtg5y67VRhbO4E1ZRPp8icmWNXbacoEUwSOu7Pd0XiZjn7AyDajtq0GinudWX tQXL9ddzpOe1hEeUAazQry0Y5KwxiLJ9p24Eh+wzAvht96h9H6QlaMWYoK9PZcNfE+EaUC 9f5XDs9yTPMReFJkb1WboREuqU1ftABPz5OFkpN0ZySYIH9u4DsIFjexsRnk67HtnU9pEq sdB6teNoOewUiE4tng/ulEpArqXwpZ+cXWCRPObt7TyPTqF53B8/O/dtGKxVGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736197430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K/4z8ZTf2w3kVBWL5M2bsi4J3e+YQcWWtShK0NEagR4=; b=XG/kZCc+LkYRKIYnC9I/gT5jwjfWHbhBW911TKQBE/cr3rjU342oCLhE7FMO6tj1ROun8+ +vY4DixieGoDhu/PU2gsx7ABK/JcpyKpJzxxqrxSRVHCPULV4gURE8RlyJVXBT7LKC4ywQ sZ4aUvNcz1tPKUn1iNSnpFdIOn4gxg1QvfK4VcTq+VuGdCqi0tepqE1s8jmhHk6tu88y3k sDDejyzXsLb5D+yhnQW38mZhTh4nRkaTCRiM2zFOdJUoCOLGz+bxen9AatVGov5JpSMjOb 3AteFsAKIythYGl6l9xZqdMptj2aS9S6qYwUuxnUO0L/L8cYgj3sfBi8ilob7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736197430; a=rsa-sha256; cv=none; b=YcKQzzcQphdakqDzCOPdXEe0vsS3KS5aPosNMV5PLFpjGBQriYeZgb49eEr4Zcxcp7nMQu MvcBkmGjnoBdaKswOkcrxMfJe30IRq6DTboLrJ5m3sJ/EQaNcldORCia3ai6qup11KHy6m e2EdkqEQbYuGbuBSbRk85gIktC65b/pmaXkJTNtpPQqnRGMbhvbSKGrGnZvMyORFkOeGty yuRS4JfpSGOmIM/hZBeiQhACFjQS/oDowgBsnqufHOgR8WxepFLyFCcaKFyPs+m96Ioq5I u5tXUo2N7kVyhtwKSwfaJoaHHeKAS7N2TTLM+xGxz/b/sy8/f2MbpzqDm8CcmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRmr600lczhLr; Mon, 06 Jan 2025 21:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506L3nSa044761; Mon, 6 Jan 2025 21:03:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506L3n5g044756; Mon, 6 Jan 2025 21:03:49 GMT (envelope-from git) Date: Mon, 6 Jan 2025 21:03:49 GMT Message-Id: <202501062103.506L3n5g044756@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: 9743e9efdf5f - main - SO_SPLICE tests: Fix a comment typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9743e9efdf5f0d2338d7cfeed8f09d89d889bac4 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9743e9efdf5f0d2338d7cfeed8f09d89d889bac4 commit 9743e9efdf5f0d2338d7cfeed8f09d89d889bac4 Author: Mark Johnston AuthorDate: 2025-01-06 20:53:52 +0000 Commit: Mark Johnston CommitDate: 2025-01-06 21:03:00 +0000 SO_SPLICE tests: Fix a comment typo MFC after: 1 week Sponsored by: Klara, Inc. --- tests/sys/kern/socket_splice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/kern/socket_splice.c b/tests/sys/kern/socket_splice.c index 3970f16b34dc..3a85ae91ecc7 100644 --- a/tests/sys/kern/socket_splice.c +++ b/tests/sys/kern/socket_splice.c @@ -330,7 +330,7 @@ ATF_TC_BODY(splice_capsicum, tc) tcp4_socketpair(right); /* - * Make sure that we splice a socket that's missing recv rights. + * Make sure that we can't splice a socket that's missing recv rights. */ remove_rights(left[1], cap_rights_init(&rights, CAP_RECV)); splice_init(&sp, right[0], 0, NULL); From nobody Mon Jan 6 22:56:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRqLf2fC9z5kMQ1; Mon, 06 Jan 2025 22:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRqLf2CSHz4rf6; Mon, 6 Jan 2025 22:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieWiXLK3m/iUfsltk6RXefsASuAfTda0fuliACSwzuQ=; b=YBo4XqJrHBs+TD8cGAAq6/dR0eEvHaWuyvWpGXh3ept0KSvbZl15GIUIoNmCQvILVdXV3Q 1E9/ZK032FIdQ+e+JD+9b4AXxGAA3Z+kU9du1D7PC+IZMTSnIZQiVy+jl+YIE9uJu6HQPg 1D84HiIYdATeCoZfJmm00kQFQPAN7H30UUl2lwilURWyWfUuX/THhDYPxite5yIf31ExwE 2S0S/VDiO8EhsoDXvQP60CKXCmoowG7AfFez3QMcl/d8pEhCv+Pgj0bIlfJqj26/0qwVqN NC38caOSXe+ZmyrLFPtQa0pFzYu0trD1a1jyV9dmTJb72JN0Iw+p+6tbZl07xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieWiXLK3m/iUfsltk6RXefsASuAfTda0fuliACSwzuQ=; b=irGX9MBX+iEjBLBrjS3WUq+ALdVbznIm064Dqv1lnAOLj5CEs4ij8lpQTLWHUMJOIRVeXn wC+5PBkXKkCc/p9kq34vccEh5x1iKULl8u81b1XxEFx4UmN05eDvKWWSZvYOWZYedbUOdS K8YH2L/r+2nMfcB/uB6HgEgb9xGNZjPI65dGvrBOgfHwOwyvQFmEbFts71qpKWy/6lrPtE 5LnhDXJW0NctPy3mR/qD0hrYh1ZCRR/oH1K+drZVRuuZmSBwsBEnYI2odSnaSlaU8KfNkT s/IvyrRdjxKAX0c6XNihQMBwRIuoawmQhXnTNHL1JXabBJvEeXBBzllJfpioxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736204218; a=rsa-sha256; cv=none; b=hi347C+ypEztRfHjNI9jZeqPMtaruSagPmhM+Bu05FVDVES1eeeV67WonWn/F5+tDP3sIO uZ2hnYuycX1jsUEhizZ6pqDANWaTvWLIf8I6HTcq1k0uPlFxN9dQsLxX/RAtzP8BqBdAfY rnRER5mVmWblH1njw/kcOPfq+jrWkEVtuMpTeKObqa8cuTDrr5jqdEu+bSbdTjgslsMvXx aD1eDJFVnnLPNOtjeiDCad2e70alk8YD1eRBlMZfwyCinIKpcUr7zVJR/oGYRr+Ubz4fhE ZCUxCV0/eF38pATJZj8ikmhnh/XvowFRBxx15HhSa26pufB1h3ZMVLp1Xzhniw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRqLf1p2Qzkdt; Mon, 06 Jan 2025 22:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506MuwW5050052; Mon, 6 Jan 2025 22:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506MuwxS050049; Mon, 6 Jan 2025 22:56:58 GMT (envelope-from git) Date: Mon, 6 Jan 2025 22:56:58 GMT Message-Id: <202501062256.506MuwxS050049@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: 8c75c15d43e4 - main - jail: Avoid a potential use-after-free when destroying jails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c75c15d43e4123bc51f24f5bf99319289c45a6c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8c75c15d43e4123bc51f24f5bf99319289c45a6c commit 8c75c15d43e4123bc51f24f5bf99319289c45a6c Author: Mark Johnston AuthorDate: 2025-01-06 22:53:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-06 22:53:38 +0000 jail: Avoid a potential use-after-free when destroying jails prison_deref() and prison_deref_kill() have to handle the case where destruction of a jail will release the final reference on the jail's parent, resulting in destruction of the parent jail. They thus maintain a list of jails whose references have gone away; the loop at the end of prison_deref() then goes through the list and deallocates resources associated with each jail. In particular, if a jail's VNET is not the same as that of its parent, this loop destroys the VNET. Suppose prison_deref() removes the last reference on a jail, releasing a reference to its parent and causing the jail to be placed in the "freeprison" list. Suppose then that the parent jail is destroyed before the "freeprison" list is processed. When destroying the now-orphaned child jail, prison_deref() derefences its parent to see whether the child jail's VNET needs to be freed, but if this race occurs, this is a use-after-free. Fix the problem by using PR_VNET to decide whether the jail's VNET is to be destroyed, rather than dereferencing the parent jail pointer. Set it earlier so that a subsequent failure in kern_jail_set() cleans up the nascent VNET. Reviewed by: zlei (previous version), jamie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47992 --- sys/kern/kern_jail.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index ad6483ed374d..6ffeab59112b 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1687,9 +1687,18 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) sizeof(pr->pr_osrelease)); #ifdef VIMAGE - /* Allocate a new vnet if specified. */ - pr->pr_vnet = (pr_flags & PR_VNET) - ? vnet_alloc() : ppr->pr_vnet; + /* + * Allocate a new vnet if specified. + * + * Set PR_VNET now if so, so that the vnet is disposed of + * properly when the jail is destroyed. + */ + if (pr_flags & PR_VNET) { + pr->pr_flags |= PR_VNET; + pr->pr_vnet = vnet_alloc(); + } else { + pr->pr_vnet = ppr->pr_vnet; + } #endif /* * Allocate a dedicated cpuset for each jail. @@ -3207,9 +3216,12 @@ prison_deref(struct prison *pr, int flags) * Removing a prison frees references * from its parent. */ + ppr = pr->pr_parent; + pr->pr_parent = NULL; mtx_unlock(&pr->pr_mtx); + + pr = ppr; flags &= ~PD_LOCKED; - pr = pr->pr_parent; flags |= PD_DEREF | PD_DEUREF; continue; } @@ -3236,7 +3248,7 @@ prison_deref(struct prison *pr, int flags) */ TAILQ_FOREACH_SAFE(rpr, &freeprison, pr_list, tpr) { #ifdef VIMAGE - if (rpr->pr_vnet != rpr->pr_parent->pr_vnet) + if (rpr->pr_flags & PR_VNET) vnet_destroy(rpr->pr_vnet); #endif if (rpr->pr_root != NULL) From nobody Mon Jan 6 22:56:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRqLg4lNtz5kMHP; Mon, 06 Jan 2025 22:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRqLg2vMXz4rWT; Mon, 6 Jan 2025 22:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xmbcfBSxnNn+tCcag9Pn0vzTdcuHudhYi7ekjgNZhk=; b=bL3Pq4HmoLKL/k03HPFQnU5bn564W1rpXglH0UWoe9P67q9f3Tl1zFNoKiFVsZ6iVZwQbl oWP8k3Hd2uaxl1b22VQxq4NxSDo4uATGE6EuIVFJj/24HgnGuiNbaiHwIgrYnKHCJlorCs NxL7N1MVmIzPKFgkxR70OC1w3KoJAU5nsy6PP9Y2LtKV0VbF7At27qAFYfY2W18CoYTif3 f1Fe8SvqtYXv5s/fXrk2avku9iWBX21h+K9QWz/TVVuF/WrH6feEXo71uSt9u7MvT1v0ii U5JFERUcVmEqfzNhTUO1mqeR3qMdktuy4SChF/U0ZdSRITpNmM+szRlxKot0qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xmbcfBSxnNn+tCcag9Pn0vzTdcuHudhYi7ekjgNZhk=; b=tqdGlY7qyhMZHZyU3NFaVNhwcKcJhjdvxd6rUBfd+yjo+e3o+aL9xjEGRK+N7dgKw72fT8 lW4gFZLwxc7pHfFMg1b/UJgMuYdHUE4WHXVBHYnFJjTsCeNY/Lje0QmxPOpYzwT++Clb95 w2nqDYYMhHOYLriNkLGZtixy2IS9uCHsgy8Ae8tuHwDgWxxhHqlPh40ZYkHUbOlO7brzeb +KY0NmW8hYZLRNgWblxUpXZmcU24A76k/Vlw7YErg22GFnGSKwiHaidLO9Zi/wMDS5aBff 5dF+9zT4SkULty/Om5n95kQ03flGMtGrCWCbMsznjh6va54ssyYcSFxLU6UNeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736204219; a=rsa-sha256; cv=none; b=GaTRIiAo6josUuBBgSg1MjYWHSsxdnrgFfkqK+nlw1TgoWuh9KfxOCWwKUgACTVQQpTir7 ejrqCwSgnI4thuP7xMi4OO2i1k3gsSvNgY9w5SXQAbKnxiCLb4ZdFOb79Njs5m1HMoh3q1 IcYWZrvHIc6CI1tYHmuNv1WgXCeaFttbqbKK+rAQrvfJoqEz+iTUJ/Cd+iyvB7kpQcdlSF bbhJ4FBP8+OzGl7c/3njHlcZgsYc622B52xxC0wyNBM6KaBeFNVadkIaI33DLt5mQUCI5g Iz2DiVG+d2QiY9AOZ2ML5oZLg5VHBG9HsTBTyv02eGtc3Eq/ONyL2K7x/PQ72g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRqLg2W1yzkyw; Mon, 06 Jan 2025 22:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506Muxle050117; Mon, 6 Jan 2025 22:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506Muxq7050114; Mon, 6 Jan 2025 22:56:59 GMT (envelope-from git) Date: Mon, 6 Jan 2025 22:56:59 GMT Message-Id: <202501062256.506Muxq7050114@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: 1c933f464fdb - main - unix: Be consistent about error handling for unconnected sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c933f464fdbb630f9663751f04c29cdcda38902 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c933f464fdbb630f9663751f04c29cdcda38902 commit 1c933f464fdbb630f9663751f04c29cdcda38902 Author: Mark Johnston AuthorDate: 2025-01-06 22:55:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-06 22:56:34 +0000 unix: Be consistent about error handling for unconnected sockets SOCK_STREAM and SOCK_SEQPACKET sockets should get the same treatment here. PR: 176420 MFC after: 2 weeks --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 7af73a1d344b..3d7e5bcc5ad0 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1796,7 +1796,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt) if (unp->unp_flags & UNP_HAVEPC) xu = unp->unp_peercred; else { - if (so->so_type == SOCK_STREAM) + if (so->so_proto->pr_flags & PR_CONNREQUIRED) error = ENOTCONN; else error = EINVAL; From nobody Mon Jan 6 22:57:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRqLh6ZLyz5kMD3; Mon, 06 Jan 2025 22:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRqLh3RNnz4rNf; Mon, 6 Jan 2025 22:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNEb1MmyZdYtR/rBVSz7vBhn1Tvn+BT2Z6v2+YVJ/8U=; b=OUZ90eX+qammafQ7Mkf1XnnpbECIaQLMfaW28kcgoqQeJ+ql9gH0VGoWzsA8F2bu69xxv/ 8RsQ1W6CkLya9vUI4Z8XC+d1i9Hn+qsxLznA25GFYxRPz7hS34R6fO64GUkJfM82c9kIz+ l3JZpZfB77Hy/xptBqZ2AO15vDlYiu5Mc9Tac75+BPEa6RJG48agvNfEfRvujXNw4DN0Bh InZ+FQgbN7lRGWlubeGJR/vGko7L+oKEUCqGULq+kCTanXGsU6+RIdoQzjHiR3QeEptZyi IF68LPbyOTk2v+KQ3FPZNlvrNPFUvFuuv1Qr7cWgVfgApGqMyMe+PJAOOk11Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNEb1MmyZdYtR/rBVSz7vBhn1Tvn+BT2Z6v2+YVJ/8U=; b=ulaivpR+PLN437dJfHXQLrqc1lSlyVHADWI48w7k+DuizlSM18KbpkmOmCmK0XWOTC4eVU aB5JL7WUJHCYoLDbv5sErFLRn7IcoeqDtUBj9L7uKDezr96mhepJe3XHmGrB4S5mZ4PmS3 i4fBQ37Upj3J88cUVQjfqKvA9pL3pF4S/mGXEy9DE3iidBtXpQYx9kkn8BILTcB4vF6pLm gUY6j+Xs5RCHLHkQx/2B842ohmT1/E39NHKRKJ1yAeB5c+6YtW/MdzYEAat4vTWw7+36im u8sf8Q291UT5dP73eH3BEbqZLlabxWVYU6/+v1L1LkkB/Kr5kqb0J7xoVviI5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736204220; a=rsa-sha256; cv=none; b=O5xwS1WR9g2w4g8Q0DqjSJBQ2VpeiU5lrrT3TCcVQli2psp9sAwGwks0NcWTknJrB1edpb jEw6v/03qwqxsJAkhD3B7V5q/m+4h7Hc3LfCNxztGPCGcAusmArRUB5+hOYvtpwQc07csD UU7IsDgh8XZZi5bqDFUcWbR7bT1Qv1ViDjeBpTcUiH7L/4fNjPc5S9eRn0o8TptludGjjZ tKfNwOEzJlH1coFSWAS8l0aUJ83zhuek/uAkJ2qesTAja0c8R5aFZWErmFO329ccED0cBd 2pt1E458wwrFN1YeimCXmJ+ZfnpQoHG1RJIhja1qECu273Eg8mgSOxT+PqqDfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRqLh2qmjzkdv; Mon, 06 Jan 2025 22:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506Mv0Za050173; Mon, 6 Jan 2025 22:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506Mv0ke050170; Mon, 6 Jan 2025 22:57:00 GMT (envelope-from git) Date: Mon, 6 Jan 2025 22:57:00 GMT Message-Id: <202501062257.506Mv0ke050170@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: 5bf3ac7ae219 - main - bsdinstall: Fix a typo in a comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5bf3ac7ae219f126cf3965be97a2d718007c1be4 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5bf3ac7ae219f126cf3965be97a2d718007c1be4 commit 5bf3ac7ae219f126cf3965be97a2d718007c1be4 Author: Mark Johnston AuthorDate: 2025-01-06 22:56:07 +0000 Commit: Mark Johnston CommitDate: 2025-01-06 22:56:49 +0000 bsdinstall: Fix a typo in a comment PR: 283507 MFC after: 1 week --- usr.sbin/bsdinstall/scripts/zfsboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 45c023b06513..6f2244a918bc 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -139,7 +139,7 @@ f_include $BSDCFG_SHARE/variable.subr # # Default ZFS datasets for root zpool # -# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME +# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME # NOTE: Anything after pound/hash character [#] is ignored as a comment. # f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS=" From nobody Mon Jan 6 23:22:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRqwK5S6Bz5kPC3; Mon, 06 Jan 2025 23:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRqwK4b1fz40sZ; Mon, 6 Jan 2025 23:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736205761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGcjI9tkYx7fPq4rFSJ8UBeONIlr7LgiILxhUSnzCTE=; b=ua9pCe2T4OgE8x8fRDUpphhh4CeXVxYY5ohlHh9dTCYUH4QxA0yWJGylc4koLrsn7NZJ3S WVuebeHTYHmH6cJAtWezKUd6bnW33EkA9v+7VuP9A4FrsOQ8GDGl06RDG4vlp08ypfgM17 AViVSzQ53+WbebmFGRWyUddq4s/elwwo59YoifE4hHnFsDlFYXb5Qad8Icp1KE/5Jtddmc E8cieCM0a3PhQeqH+YsYFnmViWO+uOklhXShUPbsq5yjbjVwTM5pI7TCB/sliSjoDzpQnN Lk5dHFIkD7ETmr0llgQTBiqib0KM+YdVaz0aaQnbgn7Y91KZoMSp5WDsdDYMLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736205761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGcjI9tkYx7fPq4rFSJ8UBeONIlr7LgiILxhUSnzCTE=; b=jtEUJfTBXScoKIQNPbqKZXcWnP2mkS/4Qqv+H3Tx26BiJSD+0O7cearX7gAt18beBOhKkO 291iSQ1Bu0NDyIRExYW1s2Pd1UdKiyEmB25Mb0dhm5/8x893YHPIe1h5XlsERq4pNgJi7b 4mrvMi1IzPKLI83TXdDW83Epwb60hdqHK/VD6PS03f9pTsT89NXQap8o7u4a3WOOnloQed G6SX6MUI8ChhdMh1sYfongHQofdyQ73PGSAAKmecFIrnDEcuK0p4N7t3u/kLa93Rp3FHJK nGNHl2/8uBbcop7h0ZHDw4uR66AjsE49Ngyy6pVQ5POrMROyoISEjEoKZgguQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736205761; a=rsa-sha256; cv=none; b=nmUnQRUO05/K24Tvnatd08HGkFaHmZ1omxnA8qY/zjFoyoHH1Yo96x61nJ/OZGRsi1WXrC tK4xHrFg0ANhr0hGJ59CfyDkyiklSKWg7JavXr+c39mnEW/au8yhL4h3QjwhoA7RpxXuJc t70n95dljTnsVJkYipbgtlMIdGbk5TUVPUtotj+mzxiKaNb30omkyJIPzbCcWgMIJ3+BG1 8E7fjpC3bNYwtGidVmh19iWuD13Uh2DpOns0LtYmJABRGB43V2C8Kz4tuau7eRxoRCuhnC IsmYF9hrVdl/51GoUoO/VVmcCbGVHaNAiiQmNcE6o+mTJ5sUQ2mmjRGWwGXPAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRqwK3zGhzlw9; Mon, 06 Jan 2025 23:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506NMfv1007281; Mon, 6 Jan 2025 23:22:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506NMflq007278; Mon, 6 Jan 2025 23:22:41 GMT (envelope-from git) Date: Mon, 6 Jan 2025 23:22:41 GMT Message-Id: <202501062322.506NMflq007278@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: 872686b17e70 - main - rc: Document rtadvd_flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 872686b17e70636f031436b458262eb7dacc5832 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=872686b17e70636f031436b458262eb7dacc5832 commit 872686b17e70636f031436b458262eb7dacc5832 Author: Mark Johnston AuthorDate: 2025-01-06 23:20:00 +0000 Commit: Mark Johnston CommitDate: 2025-01-06 23:20:00 +0000 rc: Document rtadvd_flags PR: 283696 MFC after: 1 week --- libexec/rc/rc.conf | 1 + share/man/man5/rc.conf.5 | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 62756fece201..9540cca6c2f1 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -551,6 +551,7 @@ rtadvd_enable="NO" # Set to YES to enable an IPv6 router # advertisement daemon. If set to YES, # this router becomes a possible candidate # IPv6 default router for local subnets. +rtadvd_flags="" # Flags to the IPv6 router advertisement daemon. rtadvd_interfaces="" # Interfaces rtadvd sends RA packets. stf_interface_ipv4addr="" # Local IPv4 addr for 6to4 IPv6 over IPv4 # tunneling interface. Specify this entry diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index a66477ae4510..8ad503f792e8 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 14, 2024 +.Dd January 6, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -3133,6 +3133,14 @@ the interfaces specified in This should only be enabled with great care. You may want to fine-tune .Xr rtadvd.conf 5 . +.It Va rtadvd_flags +.Pq Vt str +If +.Va rtadvd_enable +is set to +.Dq Li YES , +these are the flags to pass to +.Xr rtadvd 8 . .It Va rtadvd_interfaces .Pq Vt str If From nobody Mon Jan 6 23:22:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRqwL6W19z5kP8V; Mon, 06 Jan 2025 23:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRqwL4y7Xz40qG; Mon, 6 Jan 2025 23:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736205762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GukgVugi5q12a1wcPP8jPys4PXQKBTrP0WJxXbC6HeA=; b=cGDp6vRrlEoLk37zELsU0glmITCzreUaIOl+oT7MhxflfuyREyIcKmERlMv4Rovv695wYx YGkCsQy/uPptZdicqTv/8vbPYbCm2aOKoi6+htqyGx6dzMaApl9/3gDQZ/Pe4aI+tXlRhY +OSxIQ4L+mPzL1ylGVeSIHe+buP2NtJpQzaQD3H6tMmxyT2ZyT8uIzn6octYu5mhDds2s7 f5Bqbh7itv2fVQYLpH3m5ebdf8YBVwuZYQ4kec1X2243RyORgwGwqfPLIX0WDLrJQDkaBp Ha6AacM0QEWUg/2U8NN+MUau0AOxBJcj0vdk5/bDz8fnseev78N6NdjzplhCcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736205762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GukgVugi5q12a1wcPP8jPys4PXQKBTrP0WJxXbC6HeA=; b=VmNWVnB3YE68oBm/NlVT/U/RVoZ9P4sIQKtU8CtvwHlkspC9RTWaRdLxvvKPXB8+Gmm3Zn O8Zv/UZMBcrZzu5BB4ep4f1ynJq4eQm12/J/Y0OSupCI2b0ObTvIA1rvFhtdclJrU7cqHl S0DkWEJYllaMnU1Z6wyhcMilH7xTELPcdFYRkT6x1jPqK7ds6QsMnsFb4H1v/+xWG3VidM QjCWULsVw5pPI3zbzXlUXPmL5vY20rA5yIX/Hb5Yoy/2kWGBRHISQt7o+6MlAlKr8I18rl /V7qnrVx8Z5gdwZwQ24QWWp+cTkB5Wze/w+vXuMRqz9iCvMAISRMQ1twlJ0tJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736205762; a=rsa-sha256; cv=none; b=IKf7oT4wDLf45XFudRBcgOyEWaLsiaatiVMVLYoRjrShzYEG53IPR4l9njX6SpCBMcrF4D NhyfvtZUsINcmLVlJfhCPqwfvYF+9ckfq4dhUQOwV2wbHKUgbbkSvRbXo5lExhsj6wqq4k XVHwPrJCzqSMb/EVnSnz4dMyM/Z5Mq4y/jZiiR1kgdBhQpxrxGz48UPUIwMA/c65DTVXJE LsiFeQqYHABSoXNB5d9nBMwq+/lCmqrVQuI41ApzOubfnupbfvQy4y/aDV6yun8+lQV2/M plV1+TZwl6eJIlamUihIddLSFi63RpH/a8iDeiRr2ePG22rGWZ4ituyGEAwPHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRqwL4YVkzlkR; Mon, 06 Jan 2025 23:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506NMgoD007326; Mon, 6 Jan 2025 23:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506NMgYH007323; Mon, 6 Jan 2025 23:22:42 GMT (envelope-from git) Date: Mon, 6 Jan 2025 23:22:42 GMT Message-Id: <202501062322.506NMgYH007323@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: 378a2b155aaf - main - netipsec: Pass the right mbuf up List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 378a2b155aaf853933df5b53e174b3880826488c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=378a2b155aaf853933df5b53e174b3880826488c commit 378a2b155aaf853933df5b53e174b3880826488c Author: Mark Johnston AuthorDate: 2025-01-06 23:20:08 +0000 Commit: Mark Johnston CommitDate: 2025-01-06 23:20:18 +0000 netipsec: Pass the right mbuf up Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE message handler is not set. PR: 243057 MFC after: 2 weeks --- sys/netipsec/key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index ad1d6164f158..3c64a65f024d 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -2595,7 +2595,7 @@ key_spdacquire(struct secpolicy *sp) mtod(result, struct sadb_msg *)->sadb_msg_len = PFKEY_UNIT64(result->m_pkthdr.len); - return key_sendup_mbuf(NULL, m, KEY_SENDUP_REGISTERED); + return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED); } /* From nobody Mon Jan 6 23:46:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRrRw0clwz5kR33; Mon, 06 Jan 2025 23:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRrRv6q2Mz44YQ; Mon, 6 Jan 2025 23:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736207196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4aXBUtrrRaCB5K2VL1LcXRGNdeocDSJ0jRGgTG6Kw6g=; b=NFu25rOuM/4y0kN/6wCed97/bT1wsGq7YTJdkqExYNQKEjDNy/xQvr/LyxhATkcS1yYug0 zsokSZwYCp7+KgFheOKrW8p0zAXeTufbocShUSev2S4+Tw8tTh0zhg7lHcda9ZqwMDFGG6 aShjJZbmnKnn8/wHxIZ2ploWjs7e+UWpXgYot6/DbQ0RvSrYAs5taykYeSMqGHUHlnbeSd bP8B+tCV+dQ9cHXSGojSldzgeRuDkaY0OhYgV47c9oxEXNu9v14iOTGJJrxpE0XfenrBF2 RDvDV7GeKgq8bRZKkkmG6XojfeAq88sRfDZlhA6OQtw3wAtSAZfA2Yln/aAzLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736207196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4aXBUtrrRaCB5K2VL1LcXRGNdeocDSJ0jRGgTG6Kw6g=; b=Tx2nx42bqFEgf1aQyQPAxZX2Kgp1Gu5hkOG/PEFs/ksgN6ySEXBwopipR2GqcEblLApbm2 H3UASulDdgjMYQMqiL/mvFdlZHbju+txShXq2dWQbs4dL0QuM+GAs70vYMgftHJ3RaS4gw FSJznKfTnLFcKrBvbAIJbj7Zps6G+zKDKtaB+TCaUlvK88tWjqQJb1O+lkz1Oo1OnOqrMz OB2QhBvuavNbzSB9ehP50T9ue4XJl4XgbOovOF6mqL5jxLzFm/QQ9zfOnG8uNBAOW8DOEN N9J3Nk7KM7ZxsgmamvxZVYKjSsX9Jp5bOuKMYVsnmxjX0/pVKhkFM1CNHUK+dA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736207196; a=rsa-sha256; cv=none; b=ipklQ/ZOeh0AawdvJi9mFBdGBmOYyrFlWmB5ZAHYm7FjRotdxU/ec1+zk/+ZYRD1+SjrD3 CIYJuVtCVlqFNwT4amOGKU3/cbb7qyAMolKW0RVTS2aAN0o+DNGs53hNrHt6awTp74ILAh mui16tPs5lS3+rW4I8l5T7Iy0OBtDq6l6gHymAKSkC/d46ua3rVkyrb0ou1rDMqxW54hPu PEFAX2K8zspFWcwH3l3t9/ffosr6eGmRWcn58MftBYe8DUZP2NYlWPo39ZzBzha0F5+GvO hZx2L0/eVCxaYut511OUK3XSmAS2NV+//IH1o5qNo9IQggabyD9tKxROtl86fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRrRv5jrnzmCv; Mon, 06 Jan 2025 23:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506NkZiI045172; Mon, 6 Jan 2025 23:46:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506NkZXQ045169; Mon, 6 Jan 2025 23:46:35 GMT (envelope-from git) Date: Mon, 6 Jan 2025 23:46:35 GMT Message-Id: <202501062346.506NkZXQ045169@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: 02ebbc781f08 - main - swab: Fix implementation to support overlapping copies List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02ebbc781f082df9714e74775700d8c08bac7850 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=02ebbc781f082df9714e74775700d8c08bac7850 commit 02ebbc781f082df9714e74775700d8c08bac7850 Author: Warner Losh AuthorDate: 2025-01-06 23:44:21 +0000 Commit: Warner Losh CommitDate: 2025-01-06 23:46:05 +0000 swab: Fix implementation to support overlapping copies A number of image processing packages assume that swab() can handle to and from being the same. However, POSIX.1 states that overlapping buffers produces undefined results. Our old implementation would produce coherent results, but the recent change to the musl-inspired code does not. Since there's complaints in the forums for these image processing packages for musl and now FreeBSD, update the algorithm to just read a word at a time and bswap16 the results. All FreeBSD's architecutres support unaligned access in userland, and swab is not used in the kernel (g_part_apm has its own copy), so opt for even simpler code that's easier to understand. This makes the overlapping behavior match i386 again, since its assembler routine for swab handles overlapping correctly. PR: 283698 Sponsored by: Netflix Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D48259 --- lib/libc/string/swab.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libc/string/swab.c b/lib/libc/string/swab.c index 2b044d68ca46..ed4436a49810 100644 --- a/lib/libc/string/swab.c +++ b/lib/libc/string/swab.c @@ -4,19 +4,22 @@ */ #include +#include void swab(const void * __restrict from, void * __restrict to, ssize_t len) { - const unsigned char *f = from; - unsigned char *t = to; + const uint16_t *f __aligned(1) = from; + uint16_t *t __aligned(1) = to; + /* + * POSIX says overlapping copy behavior is undefined, however many + * applications assume the old FreeBSD and current GNU libc behavior + * that will swap the bytes correctly when from == to. Reading both bytes + * and swapping them before writing them back accomplishes this. + */ while (len > 1) { - t[0] = f[1]; - t[1] = f[0]; - - f += 2; - t += 2; + *t++ = bswap16(*f++); len -= 2; } } From nobody Mon Jan 6 23:46:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRrRx0Qrfz5kR34; Mon, 06 Jan 2025 23:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRrRw6q9kz44Pq; Mon, 6 Jan 2025 23:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736207197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TDBSjpdTjE9JKHDdBcaXIhnlQcx287vG0ldmqtcLg8=; b=OCmPKCbMMQ2ZqHdaO9IGcnt5+aCkE4N/XCV7183X7Px0BOxvM//BBz2kl7UeV31QrtvSzY mfoEanVn1jq2PWpVrGRHx4AX4ayP7Ag/eLQ/QcSXVWBRqzAsMk1y34mqjuaPIn7UBXiaNY +kweOAW277qPyJXrAd66NDvRk/AxpRuSI2OTx5Knsy+qIY1hcAjJUW29kM/JvXwSir8Gqd EWhDlWT+Mh1I8B/sj7vnA+qSbXB3XIcCm25baE4qPk+h4v6Ostyyz3LGFKuPuIvBM+DoWU cRHUbwGGrBeDNxKue8y/zpLyOW8xmgLlnet2f4koXeF8Iv1q87LW63x3hUc2Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736207197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TDBSjpdTjE9JKHDdBcaXIhnlQcx287vG0ldmqtcLg8=; b=cdfEr6H5OniHRdQrQWl4FF+LgaAAokWGAqFnK8Rt/G1MEO1mK96y5tDisEleTj3O8+stDQ uIrqlaeejE8Kc7FI9JWro2EPXaGpTp12XX85AcTPwuPfz6Un6ge6gFnL7cZOq2ZgizR3ha K1VLUyoPvmPfQgRz9RUmFfAZrOKDQ98CNL5fvqSWmLGAMH5d2+ZRHK67Et5HDYJo+FJuSi JjtlMSiPBtfAPHCEFryN6my8in0DstHhVpB/falC+CApnt+3ZMOjy56AY9Fk6P6oC8KPXF zCn8dqXEhQOpzNDOEnuYXOQedyAv9/aYzM5F/L8JsRWN+W5thMMkZpC4AFAeaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736207197; a=rsa-sha256; cv=none; b=F4t+7VyhrlXd22RnEiO+nrb3MAogFavl07cyIAqMS/F4kZvUAYscaPWVxv6MwvgoWsRBDP h9z6zZVCpQoqlB94lu+jMi0AdpV7cC32U9bhZZqmQoPN0OSfDwNsH5H/Ig9yn3y+V5FQm+ mopUyMDEwcXOEzQW8iLMsoTSkGCIzDBDayIdlsx/20IuG0D7OH6vCNzlQR/xJGGnvnk44D HM+Ev/6HCmpOYOgliPYZBHJ222QuAGaqYiIUnnl6J9iRhPcrhCuxzMcwCxj0RSIG/j2DE8 /pwe1zW6ZWJF2YAvx8KU8yLzEz3HmqyNTwj62nwyu3FwJA6whwRy0naPop6DOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRrRw699kzlVG; Mon, 06 Jan 2025 23:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506NkakA045226; Mon, 6 Jan 2025 23:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506Nkaoa045223; Mon, 6 Jan 2025 23:46:36 GMT (envelope-from git) Date: Mon, 6 Jan 2025 23:46:36 GMT Message-Id: <202501062346.506Nkaoa045223@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: 6fc164c7775a - main - cdefs.9: Note only one programming environment at a time List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fc164c7775a5dc7a4277969870abd50eb62cd1e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6fc164c7775a5dc7a4277969870abd50eb62cd1e commit 6fc164c7775a5dc7a4277969870abd50eb62cd1e Author: Warner Losh AuthorDate: 2025-01-06 23:45:47 +0000 Commit: Warner Losh CommitDate: 2025-01-06 23:46:06 +0000 cdefs.9: Note only one programming environment at a time Only one programming environment at a time can be defined at a time. Posix states that when defining _POSIX_C_SOURCE, the system headers must define only the macros, variables, and functions that a given standard level defines. Selecting a different macro along with this is fundamentally incompatible with that. Sponsored by: Netflix --- share/man/man9/cdefs.9 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index b9821c70f2a1..2e6f1b440efb 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd December 6, 2024 +.Dd January 6, 2025 .Dt CDEFS 9 .Os .Sh NAME @@ -352,6 +352,7 @@ Defining the macros outlined below requests that the system header files provide only the functions, structures and macros (symbols) defined by the appropriate standard, while suppressing all extensions. However, system headers not defined by that standard may define extensions. +You may only define one of the following for any compilation unit. .Bl -column "---------------" .It Sy Macro Ta Sy Environment .It Dv _POSIX_SOURCE Ta St -p1003.1-88 including St -ansiC From nobody Mon Jan 6 23:46:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRrRy3L4qz5kQdY; Mon, 06 Jan 2025 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRrRy0nt8z44Q2; Mon, 6 Jan 2025 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736207198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcQPyx1NC3NITlHdFkbnO/SCfG/AoW110B1Hu1g0VH0=; b=Fbp1C5+VDIDfBq2yp5VxKnOkCRekX35s/A3dhXky8R9BsBWxqL5FYPt0bwFYRIfpM+nW5e hGU/DzM9VymBZlfWeo8XczHycsKDd53zr5CUB5Vwhgi+yPdJ9QebvUPzc+lcKIBJSxTViq 9MQVIkRRS/nMXGfTh9TtHS76tJiz95VTKxCP0CiK1VsO5M7Ubdgc58bkcYW2lVE0DSler3 P7tXO8J38knx/0Lv0MaXFWJqqBmjDHkuOvU6zI+JIaLcjQs134y7WLZFgzfXF1puy/Tk4p KL8twZatj5lI4DK6CvBKaCGpWvCfz/GO+7gOINfk2VsNkEHKWjYGyhGEVZ9bKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736207198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcQPyx1NC3NITlHdFkbnO/SCfG/AoW110B1Hu1g0VH0=; b=SeoLfWkARXnpP8+nhxiV5PZ9LFdvRxCWtLkN7Px4HuIB46S7R1eADFSq4yHz/cdE+eck5z rl5h8J/Y50dLMbAb/+6rVAYMfP8cO9ANLvgrCJHyb5RZCHy3KbX9OY4VoITFrsdiGruYSw dkfJeVnLkrvx4a5IWOTZpvUwY0t1lIBmzZOua1SDG76Lb9cuKrDVCWK5UdpxTlgvBx3P0m TauatWrPQlubZG05nnq7nQzAmgf2W8iGC0IGVc2VDu/Oc0AvRDL09My0jtKt035Tz7T/Ow /iAUWWhmxjaqBpCmIG/3hDH3iAuT+fBt4DBMV81bMGw+m30zOC+4GMaXdZ9D2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736207198; a=rsa-sha256; cv=none; b=WX+iFuI1PkNdnCYHSyq7rVK2xbZVasw+zPonSntrACs4Q+GMrpF/rB+OMxwrINOsmvxALt D5bc771WB4B4uqpJsjOh6FupXfd1KRBPQRVgZovMPwCxErpfmdgWahYuAaLyZdJFeTTQ32 84a3kJmhAH1dmN37e+3YVFGaH3Fj8CeTjXTMj/0ARvkBIgT54agsfxs6XAJVZA3ZLxFbLz 1SFafp6KuiUV63YtM/Z0LZ2odj2z+vM0DGmjkwVo1SoEqi92hWxiX5rhDaXMQgz8DyajN3 RPqDwX5ruRI+0epyHB63J/gcvWj/Bpy+FVvp4D+lqj1nrSywqDONbVUF5rVXAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRrRy06ynzmCw; Mon, 06 Jan 2025 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506Nkbuj045278; Mon, 6 Jan 2025 23:46:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506NkbV6045275; Mon, 6 Jan 2025 23:46:37 GMT (envelope-from git) Date: Mon, 6 Jan 2025 23:46:37 GMT Message-Id: <202501062346.506NkbV6045275@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: cfd8866818ab - main - cdefs.h: Add warning about defining __BSD_VISIBLE and friends List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfd8866818abb68fbfbffb925298c0b457cb32b5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cfd8866818abb68fbfbffb925298c0b457cb32b5 commit cfd8866818abb68fbfbffb925298c0b457cb32b5 Author: Warner Losh AuthorDate: 2025-01-06 23:45:51 +0000 Commit: Warner Losh CommitDate: 2025-01-06 23:46:06 +0000 cdefs.h: Add warning about defining __BSD_VISIBLE and friends Undefined things happen if users define these macros, be more explicit about documenting that. Sponsored by: Netflix --- share/man/man9/cdefs.9 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index 2e6f1b440efb..4efce132d393 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -401,7 +401,8 @@ are also included. These macros are set by .Nm to control the visibility of different standards. -Users should not use these, but they are documented here for developers. +Users must not define these, and doing so will produced undefined results. +They are documented here for developers working on system's header files. .Bl -column "---------------" .It Dv __XSI_VISIBLE Ta Restricts the visibility of XOPEN Single Unix Standard version. Possible values are 500, 600, 700 or 800, corresponding to Issue 5, 6, 7, or 8 From nobody Tue Jan 7 00:53:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRsxb72jBz5kWWl; Tue, 07 Jan 2025 00:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRsxb6Shbz4FSR; Tue, 7 Jan 2025 00:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736211235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IJ7G7Wgb42u71a4+RqiIHZQHhO+WL7Ddl7yZns0DrvI=; b=WLCzD9IAFvYvA68423J3FxH3rf2myj+DhEaMupkhfoSzrMpIpw2ILaUXxag/AzKnarDJt2 0868+rbtBKCxh2N4bRdBV1aDfMSaEiGAgnBsvgyT2DJVxTa4lcaIFefQsYoI2vU1+gNkCr 8WQVGMBz+lo9Kp7y+VKguiVQauSHcMlcd4TOfEr/XrcnnA4JkdRiBJnR6QOsgaiVvOiZIT Z+aSW2FXmxrFmhy3pvd5oxH1nKLvkUdBcA6cHxlhlzb2+bRXZgtpZ7mhEZgs7evVljgNCp eJTrn6CgqMDf20K9z5hF421PKpVb7e4lsZ4TwZ07RaSmhgP1DuAX1hfujm0jSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736211235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IJ7G7Wgb42u71a4+RqiIHZQHhO+WL7Ddl7yZns0DrvI=; b=UvOTRDoEWLbKLXqqwiANweUmXu/xO2ADf5TqBBIvOalgDOM+GxJ3EgWyHl3+EYN3W5Mk93 0XS4b6RRa6ZepSUpQjaYnoEWTBSLboXShdH1OXLO3PSgoEoJeCSJKrpsGcTfvmyAur/epk zEr1wUUeBa7qwTAcuMcYCsOOYYj9E3QzgvEmkSkhgiWp6sKMeC41heH8ajwdZGq6NUGuBU 6CMKqJZxEg8uzM4h3k/v+ysa0USV3bN9oD7FNNW0hqhP3k8/lkAdkclYMWSv1IesqIPTgQ sppl+/ghQcOKqVLOq1gXQVcCC9SIm27qunsjBMwDs2lTvvXUXtRBDO52GV7x/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736211235; a=rsa-sha256; cv=none; b=uLvPtmS4K/rqoA9FnGh9ki8Yox0vOPLBxtguXQNPL6zy2THrPf6RLK0AStXgEsMYwADntb 8lo1aEI9YmgXYhAb2uWglU9Sqc+QAaORLcwPUDe7ujrNhMovvnipyRVDXAFx74YSYFLczE z8/q1cyf+6JOd8q3iOvQQV7SgESb/BBswPA/jgeomIgZ1vTeYGlchxqZaKAUMkwUY0oUge ev23QH3mFx6Mw89fArwZkSM6zr57pehfTe7Eg1DAw4Fdj7Rd/9C09MJqVlpBYPFL/R0Xyd 7ai4euvlJk1v7sCybxFGYiCflsSjXm0LJcekgVQkLSqYJpLE+KZdGEofYRbXlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRsxb5sYyzpJF; Tue, 07 Jan 2025 00:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5070rtOY076374; Tue, 7 Jan 2025 00:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5070rtLT076372; Tue, 7 Jan 2025 00:53:55 GMT (envelope-from git) Date: Tue, 7 Jan 2025 00:53:55 GMT Message-Id: <202501070053.5070rtLT076372@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: 080f68d0ab0c - main - mlx5_core: Add steering support for IPsec with IPv6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 080f68d0ab0c87950ecd9b393a156b1e4d12c825 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=080f68d0ab0c87950ecd9b393a156b1e4d12c825 commit 080f68d0ab0c87950ecd9b393a156b1e4d12c825 Author: Ariel Ehrenberg AuthorDate: 2024-12-04 09:32:54 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-07 00:53:37 +0000 mlx5_core: Add steering support for IPsec with IPv6 ipv6 flow tables were not connected to previous FS tables. Created an additional table to serve as IPsec RX root. This table has 2 rules for redirecting the received packets to ipv4/ipv6 based on the IP family in the packet header. Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_accel/ipsec.h | 2 + sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c | 157 +++++++++++++++++++++++++++--- sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 4 +- 3 files changed, 149 insertions(+), 14 deletions(-) diff --git a/sys/dev/mlx5/mlx5_accel/ipsec.h b/sys/dev/mlx5/mlx5_accel/ipsec.h index 95742c4099f1..361b9f72d873 100644 --- a/sys/dev/mlx5/mlx5_accel/ipsec.h +++ b/sys/dev/mlx5/mlx5_accel/ipsec.h @@ -43,6 +43,7 @@ struct mlx5e_priv; struct mlx5e_tx_wqe; struct mlx5e_ipsec_tx; struct mlx5e_ipsec_rx; +struct mlx5e_ipsec_rx_ip_type; struct aes_gcm_keymat { u64 seq_iv; @@ -128,6 +129,7 @@ struct mlx5e_ipsec { struct mlx5e_ipsec_tx *tx; struct mlx5e_ipsec_rx *rx_ipv4; struct mlx5e_ipsec_rx *rx_ipv6; + struct mlx5e_ipsec_rx_ip_type *rx_ip_type; struct mlx5e_ipsec_aso *aso; u32 pdn; u32 mkey; diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c index f7950bf61269..fb9ca94278db 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c @@ -138,6 +138,14 @@ struct mlx5e_ipsec_rx_roce { struct mlx5_flow_namespace *ns_rdma; }; +struct mlx5e_ipsec_rx_ip_type { + struct mlx5_flow_table *ft; + struct mlx5_flow_namespace *ns; + struct mlx5_flow_handle *ipv4_rule; + struct mlx5_flow_handle *ipv6_rule; + struct mlx5e_ipsec_miss miss; +}; + struct mlx5e_ipsec_rx { struct mlx5e_ipsec_ft ft; struct mlx5e_ipsec_miss pol; @@ -497,6 +505,16 @@ static void setup_fte_addr6(struct mlx5_flow_spec *spec, __be32 *saddr, outer_headers.dst_ipv4_dst_ipv6.ipv6_layout.ipv6), 0xff, 16); } +static void +setup_fte_ip_version(struct mlx5_flow_spec *spec, u8 family) +{ + spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS; + + MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, outer_headers.ip_version); + MLX5_SET(fte_match_param, spec->match_value, outer_headers.ip_version, + family == AF_INET ? 4 : 6); +} + static int rx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) { struct mlx5e_ipsec_rule *ipsec_rule = &sa_entry->ipsec_rule; @@ -1598,9 +1616,18 @@ static void ipsec_fs_rx_roce_table_destroy(struct mlx5e_ipsec_rx_roce *rx_roce) mlx5_destroy_flow_table(rx_roce->ft); } +static void +ipsec_fs_rx_ip_type_catchall_rule_destroy(struct mlx5e_ipsec_rx_ip_type* rx_ip_type) +{ + mlx5_del_flow_rules(&rx_ip_type->ipv4_rule); + mlx5_del_flow_rules(&rx_ip_type->ipv6_rule); + mlx5_del_flow_rules(&rx_ip_type->miss.rule); + mlx5_destroy_flow_group(rx_ip_type->miss.group); + rx_ip_type->miss.group = NULL; +} + static void ipsec_fs_rx_table_destroy(struct mlx5_core_dev *mdev, struct mlx5e_ipsec_rx *rx) { - mutex_lock(&rx->ft.mutex); if (rx->chains) { ipsec_chains_destroy(rx->chains); } else { @@ -1610,7 +1637,6 @@ static void ipsec_fs_rx_table_destroy(struct mlx5_core_dev *mdev, struct mlx5e_i mlx5_destroy_flow_table(rx->ft.sa); mlx5_destroy_flow_table(rx->ft.status); ipsec_fs_rx_roce_table_destroy(&rx->roce); - mutex_unlock(&rx->ft.mutex); } static void ipsec_roce_setup_udp_dport(struct mlx5_flow_spec *spec, u16 dport) @@ -1831,6 +1857,90 @@ out: return err; } +static int +ipsec_fs_rx_ip_type_catchall_rules_create(struct mlx5e_priv *priv, + struct mlx5_flow_destination *defdst) +{ + struct mlx5_core_dev *mdev = priv->mdev; + struct mlx5e_ipsec *ipsec = priv->ipsec; + struct mlx5_flow_destination dst = {}; + struct mlx5_flow_act flow_act = {}; + struct mlx5_flow_handle *rule; + struct mlx5_flow_spec *spec; + int err = 0; + + spec = kvzalloc(sizeof(*spec), GFP_KERNEL); + if (!spec) { + return -ENOMEM; + } + dst.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; + + /* Set rule for ipv4 packets */ + dst.ft = ipsec->rx_ipv4->ft.pol; + setup_fte_ip_version(spec, AF_INET); + rule = mlx5_add_flow_rules(ipsec->rx_ip_type->ft, spec, &flow_act, &dst, 1); + if (IS_ERR(rule)) { + err = PTR_ERR(rule); + mlx5_core_err(mdev, "Failed to add ipv4 rule to ip_type table err=%d\n", + err); + goto out; + } + ipsec->rx_ip_type->ipv4_rule = rule; + + /* Set rule for ipv6 packets */ + dst.ft = ipsec->rx_ipv6->ft.pol; + setup_fte_ip_version(spec, AF_INET6); + rule = mlx5_add_flow_rules(ipsec->rx_ip_type->ft, spec, &flow_act, &dst, 1); + if (IS_ERR(rule)) { + err = PTR_ERR(rule); + mlx5_core_err(mdev, "Failed to add ipv6 rule to ip_type table err=%d\n", + err); + goto fail_add_ipv6_rule; + } + ipsec->rx_ip_type->ipv6_rule = rule; + + /* set miss rule */ + err = ipsec_miss_create(mdev, ipsec->rx_ip_type->ft, &ipsec->rx_ip_type->miss, defdst); + if (err) { + mlx5_core_err(mdev, "Failed to add miss rule to ip_type table err=%d\n", + err); + goto fail_miss_rule; + } + + goto out; + +fail_miss_rule: + mlx5_del_flow_rules(&ipsec->rx_ip_type->ipv6_rule); +fail_add_ipv6_rule: + mlx5_del_flow_rules(&ipsec->rx_ip_type->ipv4_rule); +out: + kvfree(spec); + return err; +} + +static int +ipsec_fs_rx_ip_type_table_create(struct mlx5e_priv *priv, + int level) +{ + struct mlx5e_ipsec *ipsec = priv->ipsec; + struct mlx5_flow_table *ft; + int err = 0; + + /* Create rx ip type table */ + ft = ipsec_rx_ft_create(ipsec->rx_ip_type->ns, level, 0, 1); + if (IS_ERR(ft)) { + err = PTR_ERR(ft); + goto out; + } + ipsec->rx_ip_type->ft = ft; + + priv->fts.ipsec_ft = priv->ipsec->rx_ip_type->ft; + +out: + return err; +} + static int ipsec_fs_rx_table_create(struct mlx5_core_dev *mdev, struct mlx5e_ipsec_rx *rx, int rx_init_level, int rdma_init_level) { @@ -1996,6 +2106,7 @@ void mlx5e_accel_ipsec_fs_rx_catchall_rules_destroy(struct mlx5e_priv *priv) if (!priv->ipsec) return; + ipsec_fs_rx_ip_type_catchall_rule_destroy(priv->ipsec->rx_ip_type); ipsec_fs_rx_catchall_rules_destroy(priv->mdev, priv->ipsec->rx_ipv4); ipsec_fs_rx_catchall_rules_destroy(priv->mdev, priv->ipsec->rx_ipv6); } @@ -2019,6 +2130,13 @@ int mlx5e_accel_ipsec_fs_rx_catchall_rules(struct mlx5e_priv *priv) err = ipsec_fs_rx_catchall_rules(priv, ipsec->rx_ipv4, &dest); if (err) ipsec_fs_rx_catchall_rules_destroy(priv->mdev, priv->ipsec->rx_ipv6); + + err = ipsec_fs_rx_ip_type_catchall_rules_create(priv, &dest); + if (err) { + ipsec_fs_rx_catchall_rules_destroy(priv->mdev, priv->ipsec->rx_ipv6); + ipsec_fs_rx_catchall_rules_destroy(priv->mdev, priv->ipsec->rx_ipv4); + } + out: return err; } @@ -2032,6 +2150,7 @@ void mlx5e_accel_ipsec_fs_rx_tables_destroy(struct mlx5e_priv *priv) if (!ipsec) return; + mlx5_destroy_flow_table(ipsec->rx_ip_type->ft); ipsec_fs_rx_table_destroy(mdev, ipsec->rx_ipv6); ipsec_fs_rx_table_destroy(mdev, ipsec->rx_ipv4); } @@ -2045,18 +2164,24 @@ int mlx5e_accel_ipsec_fs_rx_tables_create(struct mlx5e_priv *priv) if (!ipsec) return 0; - err = ipsec_fs_rx_table_create(ipsec->mdev, ipsec->rx_ipv4, 0, 0); + err = ipsec_fs_rx_ip_type_table_create(priv, 0); if (err) - goto out; + return err; - err = ipsec_fs_rx_table_create(ipsec->mdev, ipsec->rx_ipv6, 4, 1); - if (err) { - ipsec_fs_rx_table_destroy(priv->mdev, ipsec->rx_ipv4); - goto out; - } + err = ipsec_fs_rx_table_create(ipsec->mdev, ipsec->rx_ipv4, 1, 0); + if (err) + goto err_ipv4_table; - priv->fts.ipsec_ft = priv->ipsec->rx_ipv4->ft.pol; -out: + err = ipsec_fs_rx_table_create(ipsec->mdev, ipsec->rx_ipv6, 5, 1); + if (err) + goto err_ipv6_table; + + return 0; + +err_ipv6_table: + ipsec_fs_rx_table_destroy(priv->mdev, ipsec->rx_ipv4); +err_ipv4_table: + mlx5_destroy_flow_table(ipsec->rx_ip_type->ft); return err; } @@ -2067,6 +2192,7 @@ void mlx5e_accel_ipsec_fs_cleanup(struct mlx5e_ipsec *ipsec) mutex_destroy(&ipsec->rx_ipv4->ft.mutex); mutex_destroy(&ipsec->tx->ft.mutex); ipsec_fs_destroy_counters(ipsec); + kfree(ipsec->rx_ip_type); kfree(ipsec->rx_ipv6); kfree(ipsec->rx_ipv4); kfree(ipsec->tx); @@ -2089,9 +2215,13 @@ int mlx5e_accel_ipsec_fs_init(struct mlx5e_ipsec *ipsec) if (!ipsec->tx) return -ENOMEM; + ipsec->rx_ip_type = kzalloc(sizeof(*ipsec->rx_ip_type), GFP_KERNEL); + if (!ipsec->rx_ip_type) + goto err_tx; + ipsec->rx_ipv4 = kzalloc(sizeof(*ipsec->rx_ipv4), GFP_KERNEL); if (!ipsec->rx_ipv4) - goto err_tx; + goto err_ip_type; ipsec->rx_ipv6 = kzalloc(sizeof(*ipsec->rx_ipv6), GFP_KERNEL); if (!ipsec->rx_ipv6) @@ -2103,6 +2233,7 @@ int mlx5e_accel_ipsec_fs_init(struct mlx5e_ipsec *ipsec) ipsec->tx->ns = tns; mutex_init(&ipsec->tx->ft.mutex); + ipsec->rx_ip_type->ns = rns; ipsec->rx_ipv4->ns = rns; ipsec->rx_ipv6->ns = rns; mutex_init(&ipsec->rx_ipv4->ft.mutex); @@ -2116,6 +2247,8 @@ err_rx_ipv6: kfree(ipsec->rx_ipv6); err_rx_ipv4: kfree(ipsec->rx_ipv4); +err_ip_type: + kfree(ipsec->rx_ip_type); err_tx: kfree(ipsec->tx); return err; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c index f8be5b9e881c..6e24395b5577 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c @@ -1626,7 +1626,7 @@ mlx5e_create_vlan_flow_table(struct mlx5e_priv *priv) ft->num_groups = 0; ft_attr.max_fte = MLX5E_VLAN_TABLE_SIZE; - ft_attr.level = (priv->ipsec) ? 8 : 0; + ft_attr.level = (priv->ipsec) ? 9 : 0; ft->t = mlx5_create_flow_table(priv->fts.ns, &ft_attr); if (IS_ERR(ft->t)) { @@ -2014,7 +2014,7 @@ mlx5e_create_vxlan_flow_table(struct mlx5e_priv *priv) ft->num_groups = 0; ft_attr.max_fte = MLX5E_VXLAN_TABLE_SIZE; - ft_attr.level = (priv->ipsec) ? 9 : 1; + ft_attr.level = (priv->ipsec) ? 10 : 1; ft->t = mlx5_create_flow_table(priv->fts.ns, &ft_attr); if (IS_ERR(ft->t)) { From nobody Tue Jan 7 02:19:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRvrV0pfdz5kctl; Tue, 07 Jan 2025 02:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRvrT5Hf2z4Lmb; Tue, 7 Jan 2025 02:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0LngD/dh5DxEG1Tv1noB4MMZSPpo5UJSVBcoSo4pEs4=; b=UNYlF75Grg5V3Ez3up84MhGvx9OryGs9NtWt+VrprYBUwTqyAS0uN/QPk2Gp/RSUimbN8z A6aIU7jV5boRSNHDKqJyEUk5nBWE5B7xk/aDmKR6ecUAptlpOEXmMxE5WqFUKBbuq5veqO x1lgyK2a7aJKz71N++MWGVGfc+vMX6GcoOZMiVPtVOtSY4BeneAYlpEwowtndwu0HxFMa9 /W/AGEZvC25sZ5D0bRiBrWjjy1Sz3opEGScHeDYshmMiZIktw+a+n51XXnBx1/QwKoQPQF YAYNU1Qc0H1+4UAb/Db/XBtR/lfWtMr7jcg3/FMbNP1jBvrvoUxnme5RMeQKxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0LngD/dh5DxEG1Tv1noB4MMZSPpo5UJSVBcoSo4pEs4=; b=PDtak6m2rXx6mMkN/mDvYKJPZViOjBlc+bbLBDbaATl81UgJmEwOQleZdP0BybAGzuNYai xCM77e10Ut3cCMtPZ+wMkOFzAM+zs3LynAaHIGwRUfgLiXLZywlTvVWZqaaNF/KrjHJC7m FPAB/CndY1E+oJDnDMXRj+dGgT/6geWXGGiXXMYjv6pdgmkLFl6d3Tn6JgcOtJ9Esgxo68 RCkDIPuE1cfAAFzp1bPossHh9ZMEmcZAaJjzE7MZEbKFPHQu+s8BnU8TjQPKkptuanqoW5 el941MfvOU/90VENOcTQPIxpHwBnxfFFFn/1SJvCyLA4UU19B/EEvU1wLh/rrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736216377; a=rsa-sha256; cv=none; b=bixId6PmQti1H/lvOE4r12kFZPmSQjqi+bqboH2VONk5U6SimT2ItUrhShvmWX5x8JcZb3 VgWTDjPqDiK61dD9FodwMzePZHNTNrFFDXBu3UdzSgDxhll6qw41RdT5G0nVVd/IEo7GX/ kXkdt2i4A8bkCzb7pAlK3l8MV807MVFJbEfLji7OcZSS4hBra8i45zO5DgoC9MaRD3JVtc BINJoXK1dkQsnQxHUszCXjpxI/kMo81Oq7KphbAm5MaD4i1knfCnmtD+/zCiviqPGRNIpi DtvfLgg4JjNgACgsoXxEdpkUxQGSawnaz1dXYqRxR0iXht3kSn3Rs3oaPWEbIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRvrT4b4Jzqcw; Tue, 07 Jan 2025 02:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072JbR5029093; Tue, 7 Jan 2025 02:19:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072JbeR029090; Tue, 7 Jan 2025 02:19:37 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:19:37 GMT Message-Id: <202501070219.5072JbeR029090@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: 215c8b79c498 - main - riscv/vmm: Make vcpu sleep periods consistent with other platforms List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 215c8b79c498f647afcbe9fa9076c2c3329e09b4 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=215c8b79c498f647afcbe9fa9076c2c3329e09b4 commit 215c8b79c498f647afcbe9fa9076c2c3329e09b4 Author: Mark Johnston AuthorDate: 2025-01-07 02:15:23 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 02:15:23 +0000 riscv/vmm: Make vcpu sleep periods consistent with other platforms There's no apparent reason for the difference here, so let's be consistent to make merging easier. Tested by: br --- sys/riscv/vmm/vmm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c index 0596e0de2e43..f7cbfc1dfea5 100644 --- a/sys/riscv/vmm/vmm.c +++ b/sys/riscv/vmm/vmm.c @@ -1125,8 +1125,7 @@ vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate, if (from_idle) { while (vcpu->state != VCPU_IDLE) { vcpu_notify_event_locked(vcpu); - msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", - hz / 1000); + msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", hz); } } else { KASSERT(vcpu->state != VCPU_IDLE, ("invalid transition from " @@ -1425,7 +1424,7 @@ vm_handle_wfi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) * XXX msleep_spin() cannot be interrupted by signals so * wake up periodically to check pending signals. */ - msleep_spin(vcpu, &vcpu->mtx, "vmidle", hz / 1000); + msleep_spin(vcpu, &vcpu->mtx, "vmidle", hz); vcpu_require_state_locked(vcpu, VCPU_FROZEN); } vcpu_unlock(vcpu); From nobody Tue Jan 7 02:19:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRvrW1nXHz5kd2Y; Tue, 07 Jan 2025 02:19:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRvrV5PZSz4Lxw; Tue, 7 Jan 2025 02:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yc+19Hr9SEk9Rfc8xNpE5l/MG4+vZHfIqnPzs/nsUDg=; b=SNw1uarS0k3rQkPeM4k/8+R4QJKpg7BY99gPaeO6nP9zYOZDIBrryThBVzz7bpTK63CqrJ JtkWA6FY4eaevD/H9IBpgL1/vRRycuWNjlZg5kANpmVP6ZJffGwyJxCmyREy0R8Bv9Bd66 gxeQ7It0AFbnn88+AH98u+rgSO3nCWkSGZdZA4OMGXRxa7PRchS/ImMXcj1ZoIZUA/cZTW 3DHguXTsbcj0uy8vG1sFClcKAWdV66x23jLsJh0ocMAiv+5dg2ieU/lYd0qMP2IN6mMLkN F0hr/JCEyQMZ/iYrp6UFRt95URlyX1/b7i4uO/MnLO7mSmDNQe/yPwNhsm5GMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yc+19Hr9SEk9Rfc8xNpE5l/MG4+vZHfIqnPzs/nsUDg=; b=pY1pb/aOaKqwrdSgrOVpvUcxw7QIVtt+fNsknq3Q34BuwaAxVk+VqEJXi0O4v7J37odqis 99CUDu13MKUSQQu8B/7ARVRXUDdosTrwtIESm5bYxbEF+6lAbUTSTAsGOW3Llvo/jwA3bA RuIW+JjydT35wPyfvEyCM8ENw7LMW64L0IAqfhsjMkqCA50L47NhYhwSwjkGAGvftUMs9k zlfwpUmp1SDiAsC6UgEcMF6pnHxEfwj2sbHV0gnHVB0i+ge8vBevjMN2UqBjg2UFnMOYmM /6MHg1y+2MP5DbmQiIpA+uWe1uS9tF1k3ObZV+04hvd/A8AUGYqVSx7QNAYtTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736216378; a=rsa-sha256; cv=none; b=SD5yVs9v+mnl19EOjOvhbbMS3xHtYSy0OuojJXyxHcmLI0dnKO3sI7Be3wI6JoyYep6Hzc 38hcS3/ra3Pfr0hsodBiihNtAUVFwILGdHe5FlWJ7JoARqK0ltNp9jPj1Z/gwQOHvA9/Ky tCTzfSdYScN6fPfvFcQJsN4y0SGjd0SWrlt1+vmeTlAfzppJkPZBFJ17oSECg6qhpWXrgi NKQa5YWxhCcpWdOdc1YvK/q9CksorbjAwVGU5bBVxVffuWYPbz0FF92WtUzfGMRpmjX1DH lJeal8wxMxjPcNNIeB32vDcFGiqm2lcXCPmAO4C84t9vDLCQptsNGpEByIZgjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRvrV4vqxzqnf; Tue, 07 Jan 2025 02:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072JcEr029142; Tue, 7 Jan 2025 02:19:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072JcH7029139; Tue, 7 Jan 2025 02:19:38 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:19:38 GMT Message-Id: <202501070219.5072JcH7029139@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: 19cb383dc03a - main - vmm.4: Update to mention non-amd64 platforms List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19cb383dc03a80e1651d80e0f0e3d4e9cbd20e04 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=19cb383dc03a80e1651d80e0f0e3d4e9cbd20e04 commit 19cb383dc03a80e1651d80e0f0e3d4e9cbd20e04 Author: Mark Johnston AuthorDate: 2025-01-07 02:15:36 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 02:15:36 +0000 vmm.4: Update to mention non-amd64 platforms Most of the text here relates to PCI passthrough, which is still amd64-only, but we should still document supported platforms. While here, remove the comment that vmm.ko has to be loaded at boot-time for passthrough, as devctl makes it possible to detach host drivers on the fly. I'm not aware of any other reason to require vmm.ko to be loaded at boot. Reviewed by: br, andrew Differential Revision: https://reviews.freebsd.org/D48263 --- share/man/man4/vmm.4 | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/share/man/man4/vmm.4 b/share/man/man4/vmm.4 index 7e4c9050021a..07c40541f404 100644 --- a/share/man/man4/vmm.4 +++ b/share/man/man4/vmm.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 27, 2024 +.Dd December 30, 2024 .Dt VMM 4 .Os .Sh NAME @@ -45,15 +45,22 @@ kldload vmm provides the kernel portion of the .Xr bhyve 4 hypervisor. -.Pp -An Intel CPU with VT-x/EPT or AMD CPU with SVM support is required. +The following platforms are supported: +.Bl -bullet -compat +.It +amd64: An Intel CPU with VT-x/EPT or AMD CPU with SVM support is required. +.It +arm64: The boot CPU must start in EL2 and the system must have a GICv3 interrupt +controller. +VHE support will be used if available. +.It +riscv: The CPUs must implement the H (hypervisor) RISC-V ISA extension. +.El .Pp PCI device passthrough to a virtual machine requires -hardware with VT-d support. +hardware with VT-d support and is available only on amd64. .Sh PCI PASSTHROUGH -When the hardware supports VT-d, and -.Nm -has been loaded at boot time, +On amd64 where the hardware supports VT-d, PCI devices can be reserved for use by the hypervisor. Entries consisting of the PCI .Ar bus Ns / Ns Ar slot Ns / Ns Ar function @@ -143,6 +150,8 @@ back: .Nm vmm.ko first appeared in .Fx 10.0 . +arm64 and riscv support first appeared in +.Fx 15.0 . .Sh AUTHORS .An Neel Natu Aq neel@freebsd.org .An Peter Grehan Aq grehan@freebsd.org From nobody Tue Jan 7 02:19:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRvrX0Pk5z5kd52; Tue, 07 Jan 2025 02:19:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRvrW6LdKz4LVj; Tue, 7 Jan 2025 02:19:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c87MUDN/GD3yhzsoyWR3emXB3POxyYnIgSOGq/jRvpc=; b=ZYAghpoHQmCQNANVbilvaIsdNdwNyEvQjxbC7wek6iip7CvSgb57GUppg4Q9VY5Ygkh1aF CM3C556sJEP3C4P50SWvPWeS9enPJakj1Xcsr+UegLJwkWTXynjZC02w8xgpJ3ci7R+H8y 4fMfDvWhfXeUnqAJN7dqUvFy0sNHRQ79Wns2572q71eQ2HicIEAfSAQSIdCam8OIWb220Y anqMmrFkQylXM0DbX0eaGf6L4cM5Lg08ueYYsAvhEW5zB0DBiR/nEGmhIr31Yvwfir0eDD soh9xkqaItRsQdAUOyco2EXp+QtD9Jv3d58a0S31RvRHq1Udk5cFD/Cvgyk7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c87MUDN/GD3yhzsoyWR3emXB3POxyYnIgSOGq/jRvpc=; b=xzGPcku01ptGlhYdTMkVUUhZsU1tJo50vGNtjDXfO1O95BGpaOz81w1bCJn98TQLutNcR/ EkhUHq3cov2w0OXyh2S49QweLADXZ07/+Eov9fwi7d3cfzh3GlSbAOukF+8/9I9eEN6d2Z m8FXbVPzQXnmcmbbR3qNKnSUJ71UzmqPDrKXjXGMknqxLbG6Mt0AMUevV6VTh42myZ9hbx BiwoYa0Ii7KGFna2ht6+n9Vzng9WGnYeJ0b02koj9UqOTwnuX/HNM05seEK7geNhxhH7a4 OElLpavbe8tnCHxto+908j+PhUPcYeHWn5v0nkTCsR0w3e8XXqU86zhfCBZJpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736216379; a=rsa-sha256; cv=none; b=JxGOSWH5liNpJNt8GSK6HxeATOVyzCRqY5obbpFSoSLf2NkkYD6arU4pTDbazm7Q22QRKS rYMc0aBkfVeOU4PEVbrxAjSLxhV7zu/UPB/Qq/PhU13W51DHU7V1fe5E67jUVZU1hcGskC smhuavAMNv51tOGK/+dim4T5YTJlt7YOwRAzaRQbgcejyXfUE6Ft45fNyL8ZPvjEjSQspr J9cxHFZqKr33ifh2HZIiHymk0Pd9tOoGfwT+RFWEHLdLCMX+Bwa6keV+MYL6OBt79EXact 6cPQq2yZuz5fOFuUf1A1ZifgtlQkz/H6SuU+h1pjFSPms4HJVB98AtQRgSoyOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRvrW5sVDzrKp; Tue, 07 Jan 2025 02:19:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072Jdb9029188; Tue, 7 Jan 2025 02:19:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072JddV029185; Tue, 7 Jan 2025 02:19:39 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:19:39 GMT Message-Id: <202501070219.5072JddV029185@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: b09fe08ede8f - main - amd64/vmm: Remove vmm_mem_init() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b09fe08ede8f90ab40f09eac49700698dd4d02b3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b09fe08ede8f90ab40f09eac49700698dd4d02b3 commit b09fe08ede8f90ab40f09eac49700698dd4d02b3 Author: Mark Johnston AuthorDate: 2025-01-07 02:15:51 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 02:15:51 +0000 amd64/vmm: Remove vmm_mem_init() It is a no-op and doesn't exist on other platforms. As part of some work to deduplicate vmm code, just remove it. No functional change intended. Reviewed by: corvink Differential Revision: https://reviews.freebsd.org/D48267 --- sys/amd64/vmm/vmm.c | 6 ------ sys/amd64/vmm/vmm_mem.c | 7 ------- sys/amd64/vmm/vmm_mem.h | 1 - 3 files changed, 14 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index d1f57a717fdf..0e3ab2845d58 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -427,8 +427,6 @@ vm_exitinfo_cpuset(struct vcpu *vcpu) static int vmm_init(void) { - int error; - if (!vmm_is_hw_supported()) return (ENXIO); @@ -449,10 +447,6 @@ vmm_init(void) if (vmm_ipinum < 0) vmm_ipinum = IPI_AST; - error = vmm_mem_init(); - if (error) - return (error); - vmm_suspend_p = vmmops_modsuspend; vmm_resume_p = vmmops_modresume; diff --git a/sys/amd64/vmm/vmm_mem.c b/sys/amd64/vmm/vmm_mem.c index 0e953b6af534..e96c9e4bdc66 100644 --- a/sys/amd64/vmm/vmm_mem.c +++ b/sys/amd64/vmm/vmm_mem.c @@ -45,13 +45,6 @@ #include "vmm_mem.h" -int -vmm_mem_init(void) -{ - - return (0); -} - vm_object_t vmm_mmio_alloc(struct vmspace *vmspace, vm_paddr_t gpa, size_t len, vm_paddr_t hpa) diff --git a/sys/amd64/vmm/vmm_mem.h b/sys/amd64/vmm/vmm_mem.h index b237e08ccc05..41b9bf07c4fc 100644 --- a/sys/amd64/vmm/vmm_mem.h +++ b/sys/amd64/vmm/vmm_mem.h @@ -32,7 +32,6 @@ struct vmspace; struct vm_object; -int vmm_mem_init(void); struct vm_object *vmm_mmio_alloc(struct vmspace *, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); void vmm_mmio_free(struct vmspace *, vm_paddr_t gpa, size_t size); From nobody Tue Jan 7 02:19:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRvrY0pV5z5kcrB; Tue, 07 Jan 2025 02:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRvrX6pkzz4Lkx; Tue, 7 Jan 2025 02:19:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRMEMxWnJPeKOzKvnso/2Isipt6b27T0IdU7H4NV/2M=; b=DtCk15yXxMuIM5Fcy8P2HBLFT6DXBrKt723e3Ke9KkzU6v0YRF6X/X7C9LoCNYk+3rlLhx InRblJQCPqeCJwBOG4F/EQJAL9P/rprkFsMYzOovqpsAamcTg55tHz2/LBXdv/KTLAS86+ bpZooz5bLJEezwjuwFEkHFoMB3GiXPSCdflSsPlcAcCAcRm1We8RMBdGCyeHb+yeu0p8h9 3qarfQ9ZmWOCAneX+5pkiXc+b58GGdumM/7a8tf4Iez6jA009QcP/yDNEq5Us6oCvoGcA3 hzCnLviRPMfo0vRaCVNztv2tW9xDSS8H/cx/bAxRuKfBp4yic2eOaEXheIGtRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRMEMxWnJPeKOzKvnso/2Isipt6b27T0IdU7H4NV/2M=; b=Xwwp3pU9lE8rTF68gsuibCCSJoncQgmbrUS9wsT+ERGnxlfkEYwNEh/Jsasxriw3gpinZ2 Ylf2X7WDZnimuS4KyQeA35zXfQgNHPrdec6lGZG3eCR75S2JhSHdlO6Qm9yYvRbrWk+s8S eKAjW8/gbTMb38U8qYoMHVjJ4We1mwKP2selCDziV5MPt1cNgvBVO42yQxLZTA1/HNQkkJ /SHsoLoytyCBsyDei3gPbxEOAvu3hFqBHU+HbPdQXRRyqOrB5zk8kCJqtC3i04QhBMJDwS iZ2AAZbAerjZ67V4XBJUl5JH9PR6ChHXDYcinworTAwp2rCfZbJMFvHIPzE8iA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736216381; a=rsa-sha256; cv=none; b=C3p5JLjLOc+B7tueMY6y13jJeFsMjKMaHxYkD5cPRVV0nQSHeHfJsSEHg+ASqUHVgRfhDi BRhi7+yr64nJQjK93S8eQ0ISs0E9czWcmg1YjaRTjAPcd1wTqj1hlVmaDvfBDb2nbkZLs0 V9iLQ8/UGDr/+lVatqyRrZI9nwut3ePignbRk0wub6ZTL2IuaCbbN+bW1MJRngo/D8vJlj yg/f79S2LUt1tyOs8wuLaFlhz18fmxafb7eA642MTF+bNtWIhR8RvGYWAxdvg9X+DX5BZf FmSSWwJz3k04BDSMwuXCvrFBz5Zh04DC04kMOWJwJ1KGWVJjRlT8WgiKjKe0JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRvrX6Clczq7m; Tue, 07 Jan 2025 02:19:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072Je55029231; Tue, 7 Jan 2025 02:19:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072JeLe029228; Tue, 7 Jan 2025 02:19:40 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:19:40 GMT Message-Id: <202501070219.5072JeLe029228@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: c945c9ddca8d - main - amd64/vmm: Rename vm_get_vmspace() to vm_vmspace() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c945c9ddca8d6db162334127a43ef8a0be1d3db1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c945c9ddca8d6db162334127a43ef8a0be1d3db1 commit c945c9ddca8d6db162334127a43ef8a0be1d3db1 Author: Mark Johnston AuthorDate: 2025-01-07 02:16:04 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 02:16:04 +0000 amd64/vmm: Rename vm_get_vmspace() to vm_vmspace() For consistency with other vm accessors. No functional change intended. Reviewed by: corvink Differential Revision: https://reviews.freebsd.org/D48268 --- sys/amd64/include/vmm.h | 2 +- sys/amd64/vmm/vmm.c | 3 +-- sys/amd64/vmm/vmm_dev_machdep.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index dd8e76962caf..6501baa455da 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -401,7 +401,7 @@ vcpu_should_yield(struct vcpu *vcpu) void *vcpu_stats(struct vcpu *vcpu); void vcpu_notify_event(struct vcpu *vcpu, bool lapic_intr); -struct vmspace *vm_get_vmspace(struct vm *vm); +struct vmspace *vm_vmspace(struct vm *vm); struct vatpic *vm_atpic(struct vm *vm); struct vatpit *vm_atpit(struct vm *vm); struct vpmtmr *vm_pmtmr(struct vm *vm); diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 0e3ab2845d58..d05d979a531a 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -2677,9 +2677,8 @@ vcpu_notify_event(struct vcpu *vcpu, bool lapic_intr) } struct vmspace * -vm_get_vmspace(struct vm *vm) +vm_vmspace(struct vm *vm) { - return (vm->vmspace); } diff --git a/sys/amd64/vmm/vmm_dev_machdep.c b/sys/amd64/vmm/vmm_dev_machdep.c index 2d0ceadaedfe..d8d2b460404c 100644 --- a/sys/amd64/vmm/vmm_dev_machdep.c +++ b/sys/amd64/vmm/vmm_dev_machdep.c @@ -441,7 +441,7 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, break; case VM_GET_GPA_PMAP: gpapte = (struct vm_gpa_pte *)data; - pmap_get_mapping(vmspace_pmap(vm_get_vmspace(vm)), + pmap_get_mapping(vmspace_pmap(vm_vmspace(vm)), gpapte->gpa, gpapte->pte, &gpapte->ptenum); error = 0; break; From nobody Tue Jan 7 02:25:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRvz32TqFz5kdb1; Tue, 07 Jan 2025 02:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRvz271Qkz4NDn; Tue, 7 Jan 2025 02:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hIptlHw/qj0ZW/t1SCDoM7p6NX3/DZlmciQ050XVXCY=; b=vJspso0msE354TaQCXM/+wEoVERlwmeJfb815dAhw0JQ8gMUC4rU/qySFiJnydT4SINhb3 +o3Ils6OvxoK2fLveFVNEvFk4dl9Ed/lzV80t0ype31qqWLIFn5c0NDTciKfVfEDdl1RKe fAE96SzpywpZK8w7CSBTowCAbfCjGF/5LLiWoSqNRl0JfVYghcnwIGPiMQK9xKAFiGoxg3 fqdHJieFwpLmZoGX4JTzIyEC6+s3My8lALEJM0l1911oJRleO8M3vvZfQmRnF3lmbWolaX 8G2w0+aHMRsbK45BzW+EGxwcS5e3a/+AhfWNlTw5t37iZ9lvyHK/I7lI3x6aEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736216719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hIptlHw/qj0ZW/t1SCDoM7p6NX3/DZlmciQ050XVXCY=; b=Yk9qZk42cblTxbrYI9TXEAGd94iHYs270nxbbNSfjKKn83k4UkcLC2yB6BtReX1X/Teco9 IQ7pUskLs5MtW04tvZ3eXWjlmDgO7lW1ji5UnfdOsKYWEwd89h+sW1x0lYihJt8vy/rwQm yVsacNhM48wI/hA9ydyOXq0iSn8cLCpjsGVIBGZfKedK7dZWoYgsPuouXPufoxKapUw5XP bRSfsyKQL2RhTiJ6hyeeAXLhjI84W1BDUMghGyR+lqj/VyFFPPQNcCSVizBO/kOkNjQxh6 zjhcCskAX3ZOvNrSYdX4kuwRK8yIDs3HaEcUc8STpUxUg2/Euenh5RjS0HMH4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736216719; a=rsa-sha256; cv=none; b=g2yGHmqihZjm+g1tLtbooPQNJckF9aXCF6Gods3Ivwhi0PKkYNZ27m5RvYBBZVQ7++UF/H TJrbaTXigaZ8F5W4nVtIZ8cN2sVuDsMLOTvVMaPGud0JBCiCBZi+HF9Z2FGFyGDz7+gJyx Q/n2445D3ieeQeLiiD0GElbB8qW/BkxvtgdDbVxkirh4aoBlTVczQT83gLFzXP+xei3XKV IFmlLJCL2IoW8/EqlwUCCJiTfy+NGV0APC51BnPsKPei77kf7RtwHEyM62A2dAy4esPFV5 xeMhz0jI0TGucacyul5nWHlzRWw+IzO3hyM5jUKnrOvAeMRAXFwQGxVi37P1Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRvz26czxzrLc; Tue, 07 Jan 2025 02:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072PIJE046087; Tue, 7 Jan 2025 02:25:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072PIv8046084; Tue, 7 Jan 2025 02:25:18 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:25:18 GMT Message-Id: <202501070225.5072PIv8046084@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: fd94571ccf0c - main - rawip: Take the inpcb lock when appropriate in rip_ctloutput() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd94571ccf0c9c6521063c08a72a760873e87897 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fd94571ccf0c9c6521063c08a72a760873e87897 commit fd94571ccf0c9c6521063c08a72a760873e87897 Author: Mark Johnston AuthorDate: 2025-01-07 02:20:05 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 02:20:05 +0000 rawip: Take the inpcb lock when appropriate in rip_ctloutput() Reviewed by: glebius MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48344 --- sys/netinet/raw_ip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index a6bef1c7e275..3a0b9f632fb4 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -625,8 +625,6 @@ rip_send(struct socket *so, int pruflags, struct mbuf *m, struct sockaddr *nam, * * When adding new socket options here, make sure to add access control * checks here as necessary. - * - * XXX-BZ inp locking? */ int rip_ctloutput(struct socket *so, struct sockopt *sopt) @@ -637,7 +635,9 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt) if (sopt->sopt_level != IPPROTO_IP) { if ((sopt->sopt_level == SOL_SOCKET) && (sopt->sopt_name == SO_SETFIB)) { + INP_WLOCK(inp); inp->inp_inc.inc_fibnum = so->so_fibnum; + INP_WUNLOCK(inp); return (0); } return (EINVAL); @@ -707,10 +707,12 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt) sizeof optval); if (error) break; + INP_WLOCK(inp); if (optval) inp->inp_flags |= INP_HDRINCL; else inp->inp_flags &= ~INP_HDRINCL; + INP_WUNLOCK(inp); break; case IP_FW3: /* generic ipfw v.3 functions */ From nobody Tue Jan 7 02:46:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRwRc5tMzz5kg1N; Tue, 07 Jan 2025 02:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRwRc5Lpdz4QLf; Tue, 7 Jan 2025 02:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OfT1ZseaU246fVZ9dw0n3SFnJXyooHj24QcR5kOM528=; b=RamlpWvgIw25ynAGaSzZtb4MNg5Sy2wWH8GiSUAjeyT3xq/dFDYnUtuxECdOXSO+zSeIiZ 48A86/IZfaUkyNsbtqKxrEklnRLTvWSxEuYjM9qbNx87bpVSWbyfwrdYEo+nK0dHHQA0yd 14UMUhpklEIAiE6T4YgQh/8aE726KyV/RNJWplOfqY6cSl7nnr6Wvu5NpVBXvJ4gWOzUNT 5DBcaYAqfa1p4WuwSGBWolXWtvC7i8jRX3itwDrs5Nl6AOko2yAbfAr9T/6kYp7b7spmTY iYkxgAmd7ib9ijEF8RkzCyRuBYtMimb1866IfjRqHK7CH3FavW+8dX3/qKEPzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OfT1ZseaU246fVZ9dw0n3SFnJXyooHj24QcR5kOM528=; b=OCnAYihnjF0v/H5bPMSjFzu1ONfqlonIw1OfCptktinN2nEodn/fCWy8wtRwe252MfkkH+ GW34wFVu2VV+GPhl9SWduvuQj3aWMFVp7x7zpL4hnG8P8IUdhueUBKo83MTk+rDsIm/bb4 MGT6tEY7yAEviXBMHx8JbA0QHB0zyhPEhZqRZdz4j5YTuBD7yC8m9lkYDt3uaR5Awbug67 bfl0l1Ys8N0HrfQpu8drk1PDtSMj2IYOQ0kZ2JJENULY/gHQ+2UHgbdctrFf6O9zge1qJy +Jt5wrYLuPslvTd9nbCDk4cXKfC9EQ//+kfoDKIrv2IlIMbfGWLfTtS0fdFgQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736217996; a=rsa-sha256; cv=none; b=dx/4KJkqolVr8AEsR3M0s0abTLBmWWYNotI8qtmTGtjdDiaIjpngF4JDJWOYtRfXep966o wDOsbQwCOgRtAGmoL7H1S+d1e+83JuvRI+LSLZkKgdmhd4JTICQwyFm3mTNoCVzgx+hW3f W4R/cBOPwF7m7FPDFes7HQUa5LgjIsGQOYFELC67lVvSbtu2nLOGPSsvCgb1zQOt09EuMw 2IwN9g5k8TwUVu/Lq7uf7UUI2qW+KJEyWJSZgciMM7aMH+m09x/x1eRzvMy3KB1fQjpvvK ihKyP9VBqPCKu74mBfjUzRqHOeWPpG5ytX7dUzfBSPJSi6ATxd2X3LlBufv9lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRwRc4fvgzrYV; Tue, 07 Jan 2025 02:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072kaIf084113; Tue, 7 Jan 2025 02:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072ka1a084110; Tue, 7 Jan 2025 02:46:36 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:46:36 GMT Message-Id: <202501070246.5072ka1a084110@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: cc0d806f63e8 - main - open(2): allow O_PATH | O_CREAT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc0d806f63e833b9e011c0665905b2208b436c8b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cc0d806f63e833b9e011c0665905b2208b436c8b commit cc0d806f63e833b9e011c0665905b2208b436c8b Author: Konstantin Belousov AuthorDate: 2025-01-06 11:01:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-07 02:46:18 +0000 open(2): allow O_PATH | O_CREAT There is no reason to disallow creating the file opened for path. More, it might be a useful feature together with O_EXCL. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48332 --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 7a1677c945e3..bbd67c2b0326 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1185,7 +1185,7 @@ openatfp(struct thread *td, int dirfd, const char *path, * except O_EXEC is ignored. */ if ((flags & O_PATH) != 0) { - flags &= ~(O_CREAT | O_ACCMODE); + flags &= ~O_ACCMODE; } else if ((flags & O_EXEC) != 0) { if (flags & O_ACCMODE) return (EINVAL); From nobody Tue Jan 7 02:46:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRwRd6Cmrz5kfdY; Tue, 07 Jan 2025 02:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRwRd5hpjz4QLg; Tue, 7 Jan 2025 02:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FhQ2Wmu+hfdIDLERfDtgP0V4qWGIF0LOncXxNzJqY6U=; b=Jzg8quGovZLH27923htU4UcurLgkMWiIV5doQAU66eBHfvAqUjzD+IyZ8PlEDKvg7yk/w9 7a60q3/MV7hkz66ueEAAGr8nQiScZnpVjU7tT3H6fSqrOh3ItcUod+nZTzgVbftrUy0vGl gl/yXPjysYCkgcP+Y1knrbSqTU74DRo6kU70pYP+gNsC0qiNtrRhUN/uRNHhFswvYJG0eZ Zu8D8bFumdVCv65z0uMxb19itlU84mx9Q2gtmHgt13jfIrNR59l6oKuz7nZFcoXC5meD+Y Z0hcKFWOv5ya77uKt8gzt0hKVoHz5414UBeEzwN94geAg+LyJ+jO6Ba0ESfUhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736217997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FhQ2Wmu+hfdIDLERfDtgP0V4qWGIF0LOncXxNzJqY6U=; b=uwa6giXsxwG+zrk5kVI8No1tdmoYEgmLCP06aCeGaRF8WIjvbfqFMS+Yez8CIn2CuyxbiW ax2ov0CmNSjrwSH/MUizOLYfxkBH0RcIp3+h0cPi9rpPiW2gyvXfCf1qhYgjP0+sd8TBv2 OxiG/n4SqYsTBSR0FZnXbhYAHGomx0l8MRyi6H/TSbd7pZzoeGj6cjDzrobxoX+6Aba4CQ iqYZKSLmExkNmJcDZ4u4n7D5MEaV9ONUW+oaDlsQoHN4RAX3CJWSFPsCoE3Od7HmIln55/ b0xzTyEbRk33GOGb5IkmRrEWwg0GLIzitoBBEh+wFPwMRFT9cRLKZqV7yh0xTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736217997; a=rsa-sha256; cv=none; b=A1O/BIwOrtThIUYNOPvZSA4IJsqPxovUxrbjrexInExmDJeCz2nhWvqlJUW8gTUlLmkTjV i9Awbcr5kUui5KIeF3WQTgjL1XBgtQ27+dZL2tbxiBWcsOz5yPS7Ok0sbzBGq4nCHcW7fm TPJVUDn/59btS95g/FHswqk7n49cgLUqubb27BAYmS90w8mS0Yr0vPREzXirXdf2vKpDIT GLFJaZ0gk/8IulqS+FT9l5dDqrC+05Ezhc6Z/d6zKPeUUe63gxeNvdWo4ZsFgpbEFngWKy gask7MQ6L7NwrlkkgqDvi7zxLdqM0nIc8FnkaqxHucrc4cx+hUsyIhnBR3myHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRwRd528kzrqH; Tue, 07 Jan 2025 02:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5072kbp6084164; Tue, 7 Jan 2025 02:46:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5072kbhR084159; Tue, 7 Jan 2025 02:46:37 GMT (envelope-from git) Date: Tue, 7 Jan 2025 02:46:37 GMT Message-Id: <202501070246.5072kbhR084159@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: 749b3b2c0629 - main - path_test: adjust test for open(O_PATH | O_CREAT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 749b3b2c0629f44f6b0044992dfb2ce5ac7e562b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=749b3b2c0629f44f6b0044992dfb2ce5ac7e562b commit 749b3b2c0629f44f6b0044992dfb2ce5ac7e562b Author: Konstantin Belousov AuthorDate: 2025-01-06 22:07:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-07 02:46:19 +0000 path_test: adjust test for open(O_PATH | O_CREAT) Instead of failing, it must succeed now. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48332 --- tests/sys/file/path_test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 911c7c7075f0..b3b8b7cebd4d 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -684,10 +684,14 @@ ATF_TC_BODY(path_io, tc) size_t page_size; int error, fd, pathfd, sd[2]; - /* It shouldn't be possible to create new files with O_PATH. */ + /* It is allowed to create new files with O_PATH. */ snprintf(path, sizeof(path), "path_io.XXXXXX"); ATF_REQUIRE_MSG(mktemp(path) == path, FMT_ERR("mktemp")); - ATF_REQUIRE_ERRNO(ENOENT, open(path, O_PATH | O_CREAT, 0600) < 0); + pathfd = open(path, O_PATH | O_CREAT, 0600); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open(O_PATH|O_CREAT)")); + /* Ensure that this is indeed O_PATH fd */ + ATF_REQUIRE_ERRNO(EBADF, write(pathfd, path, strlen(path)) == -1); + CHECKED_CLOSE(pathfd); /* Create a non-empty file for use in the rest of the tests. */ mktfile(path, "path_io.XXXXXX"); From nobody Tue Jan 7 14:29:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD2f5Vhtz5kf0m; Tue, 07 Jan 2025 14:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD2f4kJNz4HFy; Tue, 7 Jan 2025 14:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYSf6nHiUegyr6VMxEf0ahAEP/pxv52uL8ZOXBCLKlw=; b=p6IjOUDKl6a5Syo7Hh0lt9vSF7BEzmzOoCR7JDCPdFhKdKdEMi6QrPXU4/efS6GaSxkeuJ FzrfqdeOTyGcy39xjHG9VAVeCAHJ2LChaOuQdyKgKX2PuU1Z93DUrxpUHCrWVGGuUr//KN ufJ0Qck5LrqjCTKrPDErSOiCzDRYvY0MwIH1pWxAZ7CpFehMBRx+em6v+W/lkQ3Ls7/PRP 0Qe3ii9VW5LcSPH7GVZXALtC9CS0gYaxSi/BGqqwWvU5YdqipSKsQIrFMV0NTnbGt7JqQ+ uC9OPxarUlO1FV04IqBUKzWjP0PN4B9MOuNTeD1SPB+9/cl9C/jjEidA4cGmCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYSf6nHiUegyr6VMxEf0ahAEP/pxv52uL8ZOXBCLKlw=; b=oO/J6Ukdll8+BJE5dwcdAhYjF98yYZPq8z0bL8t1HeUSlirfryweHTEwFwGcs42DOsRZwh 06LwfqX/ezVc3YFIi2yHdewWShMuQqnS0S1grg+k9ENvDvtlLXXjwsbCby6kk34Ga39CMo 3Azg23911tE9EfXKsukNFc3qKmyYfZhAThVTISK4zF5XeS9OrGCnMw8BvM/0MvLu2Zq53Y 8W648LH7bVVH0Eira7k7UUcAo/oDgHwZ6ZwLvPj6Ndt1AFizwhnzZklHrM7nCIbiBv0/2F KJtFZUy2nUJJdc6jSxee/mwUHOVJZvP44thqtx3YWU/zP3Z+HSygo+1R/VQoZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260170; a=rsa-sha256; cv=none; b=iAGEm8VsU2CgQ26CVmuEb/rwR5eKMgTQNv4MIMKSuuguo/Qxcq74v8YVZkUERBwyQztKag 14TClbWud6ZEeYwJ5KpCLOkRI18qaf/R6AVnux8oo2XEhvnZ64NA+GAHHvd46nMCSjwAYp jgNG7gyccmRAgRHDmDHVe+Xxp9vlfYitySNpTlRnt46ysKZAHfRgHSUC4rPoOSyg42apT8 hbjiTGwwpozAJysfQkPOm3rsF33WmqQW6eo4AJ6fyVUJx3Poc9H2umMXDpY5KJuPOGffSi /vJFcFdXW7zGgmzowaSF3kh/FbHdLQrp6NkcZEktIiS8b6IIjspDakvQHxXYrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD2f45xcz1Cgn; Tue, 07 Jan 2025 14:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507ETUtC098690; Tue, 7 Jan 2025 14:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507ETUVD098687; Tue, 7 Jan 2025 14:29:30 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:29:30 GMT Message-Id: <202501071429.507ETUVD098687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2372f8cc640c - main - LinuxKPI 802.11 / rtw88: make packets flow again List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2372f8cc640c2f4ab82831e6ac0e27ab6c18321a commit 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a Author: Bjoern A. Zeeb AuthorDate: 2024-12-20 14:23:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 14:26:17 +0000 LinuxKPI 802.11 / rtw88: make packets flow again In 886653492945f we added checks for packets to only go out if the station is known to the firmware (amongst others) as there are implications in drivers. Unfortunately rtw88 does not support the mac80211 (*sta_state)() KPI but only the fallback (*sta_add/remove)() in which case the station is only added to firmware when going from AUTH to ASSOC. That means we had no chance to get authenticated anymore. The problem has existed since June in main and stable/14 but only now was noticed in December with 14.2-R which makes me wonder. I am still not entirely sure what implications the missing checks have on all the other drivers using (*sta_state)() (or if they were really needed in first place beyond txq_ready) but I have run a few days of iwlwifi with this without extra trouble but I was not always able to reproduce problems in the past. Also people are occasionally still reporting the original "Invalid TXQ" error which indicates there is another lingering case somewhere. For the moment make rtw88 work again and expose the change to a wider audience. PR: 283142, 274382 Fixes: 886653492945f (make sure we can send DISASSOC or DEAUTH frames) Tested by: imb protected-networks.net, oleg.nauman gmail.com Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48161 --- sys/compat/linuxkpi/common/src/linux_80211.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index edc3131286f5..d66bc40f40f6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3704,7 +3704,16 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, lsta = ni->ni_drv_data; LKPI_80211_LSTA_TXQ_LOCK(lsta); +#if 0 if (!lsta->added_to_drv || !lsta->txq_ready) { +#else + /* + * Backout this part of 886653492945f which breaks rtw88 or + * in general drivers without (*sta_state)() but only the + * legacy fallback to (*sta_add)(). + */ + if (!lsta->txq_ready) { +#endif LKPI_80211_LSTA_TXQ_UNLOCK(lsta); /* * Free the mbuf (do NOT release ni ref for the m_pkthdr.rcvif! @@ -3952,7 +3961,16 @@ lkpi_80211_txq_task(void *ctx, int pending) * We also use txq_ready as a semaphore and will drain the txq manually * if needed on our way towards SCAN/INIT in the state machine. */ +#if 0 shall_tx = lsta->added_to_drv && lsta->txq_ready; +#else + /* + * Backout this part of 886653492945f which breaks rtw88 or + * in general drivers without (*sta_state)() but only the + * legacy fallback to (*sta_add)(). + */ + shall_tx = lsta->txq_ready; +#endif if (__predict_true(shall_tx)) mbufq_concat(&mq, &lsta->txq); /* From nobody Tue Jan 7 14:31:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD5L0nz9z5kfVr; Tue, 07 Jan 2025 14:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD5L0Lz4z4J4c; Tue, 7 Jan 2025 14:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TdPnurp7MB+nTdtraXwwwqUx3Co7fall6a/8Eid5Zfc=; b=hVQWCNcIxhjGK/Em6+I5yUv41tbN3hTrf+x/32S/eQEOfVWRChOSSsJJSDOu6KBOrQZUpE 3OiQz7RRYQl2/TZLwNVLiXkr7+LA0pYO228TXGgDOkVQ922cXDlgdygVcm4lI2aZk0Zg0I NWAlzwDLstGqgcKt/s4boAn5YW5L2n5xQo5rhA2YlGlyG5e/eafda48jPQjxBkC0tQNXPL oUYA544+30KDfagy6X2wrDRX5QWFL/xp9UEre5T0um4/abrVxcdSjBUi1gpodDrQpAbrGX cBfhp9F2QtWdvWmLqcTyXsnaeVKta0VxtZnymkOPGIeDcZ7a+OihJgSNqthOcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TdPnurp7MB+nTdtraXwwwqUx3Co7fall6a/8Eid5Zfc=; b=dXSJ2SnQREt7ex8fPGbq1fEjpM4g+vqJFEKq5XWATWqVr9z2/5G54S405YFZO2Gk+JwIPE LZbijU7t4/Wdlvv9sJKHJQK5vHuKIt0wluGQeGrNHh/qRWGZacLqwXvJsqo4ic6uLJPODb QXhNevKdJG8D3bLSaqH9pT5aog3wwQQVdP6BkbsVYxOkpy+ZddBKUrabGCFKS17WUfOE+A H2+VSSHs6ftub/EjlJgggCosZgPntYOqFg8l8gxNyAMcL6cHh2WR8pnY7kJQeznCDo9StK RcmzYy1kzN0hnDKzdg8tCv83vmWPY+NibDhn8IqvE/POqs5kcdbPecNTQihFWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260310; a=rsa-sha256; cv=none; b=b1Oz0pcKHXqqt74dEgN6gyanzQCiz2ModxcdG5zK6Bka04+zA+GhzdbPr8H7AGLhzYqQur dEPUOfyPg0ew/0KwHayQBn0co5S5nID/pzQVauJlHketc+eu8BqnOVPq6tu/9zELLkiBbk fBpjvRT7tDylUwRdC2oEjm1l9rZbgSkovyLel117BYq6hRnfmlPhZQ5LS34crQWSVgzDGA BFxjKZpglN4+gN0NvUQVdYrsw+Nsq/2S9Rna65HYz4d1eIRTr2F8UDo1W4/AVX/ijQpaa6 Rk8xxy4O9/tN5x9PBQvOKepuYl0p1Fmm7qqAeryqSgOhOQUQDNn29UsNnBYHGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD5K6tvhz1Cgx; Tue, 07 Jan 2025 14:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EVn1Y015212; Tue, 7 Jan 2025 14:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EVnQL015209; Tue, 7 Jan 2025 14:31:49 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:31:49 GMT Message-Id: <202501071431.507EVnQL015209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 91a4107d6d30 - main - ifconfig: remove debug printfs from set80211vhtconf() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91a4107d6d3028acd96df96de33b8a7665d3eb03 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=91a4107d6d3028acd96df96de33b8a7665d3eb03 commit 91a4107d6d3028acd96df96de33b8a7665d3eb03 Author: Bjoern A. Zeeb AuthorDate: 2024-12-28 10:00:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 14:30:49 +0000 ifconfig: remove debug printfs from set80211vhtconf() Anyone testing VHT options would wonder about these extra two printfs by now. Remove them from the tree before I have to do so locally again in another branch. Sponsored by: The FreeBSD Foundation Fixes: e9bb7f9aa1b4f MFC after: 1 week Reviewed by: adrian, emaste Differential Revision: https://reviews.freebsd.org/D48319 --- sbin/ifconfig/ifieee80211.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 25de7fb13632..396368798da3 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -1978,13 +1978,11 @@ set80211vhtconf(if_ctx *ctx, const char *val __unused, int d) { if (get80211val(ctx, IEEE80211_IOC_VHTCONF, &vhtconf) < 0) errx(-1, "cannot set VHT setting"); - printf("%s: vhtconf=0x%08x, d=%d\n", __func__, vhtconf, d); if (d < 0) { d = -d; vhtconf &= ~d; } else vhtconf |= d; - printf("%s: vhtconf is now 0x%08x\n", __func__, vhtconf); set80211(ctx, IEEE80211_IOC_VHTCONF, vhtconf, 0, NULL); } From nobody Tue Jan 7 14:32:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD6767VXz5kfSS; Tue, 07 Jan 2025 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD671cnpz4JJ8; Tue, 7 Jan 2025 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLyf8BYKr27rbRn/R5D5lmlNIS+q/tZ+jfB+FNhbazw=; b=fQAXI4mDaFn4ztOxsUdifVTAiA9ekMZbfR1EOgUgkKTqIkVV+4Fjk7Ep4scjYGnDcwD0mM oGv6ChaNCydn4xT1py0/1QSzd7PORRXUM4GUmHEs7TIRbtcLUvuuyr4sWEFV4ogdPjCp8l Ll71vBdhF68ynKizemRp5H5tjEIASSuVVyVkjXsJrqG8unpO1waoatBPDKhIoRvkA7X1na KL+MCLvES8Ahi+xslvzWBqjk9YLjSsNjKjYRr55zbqba9SsDwtoTpSRvAQTiVgmowg4RjS W427fg7Hwa3E931uJCbvtRiNF4xmE/DaRPz8STpSPM7zffJaaa2Mcfqt/V/2cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLyf8BYKr27rbRn/R5D5lmlNIS+q/tZ+jfB+FNhbazw=; b=c25c7KDloopD1P69qeqWH2FNWOLvAm4HIEHyMpfbs1MVC93l0ZxPrm0WX432scJHLdfBKz TbZ2PxNHEhs0Tk9qpj2IYaz/QIW/ELB7iZgA9+oghEA1dW19YkufgD7DJhnQWQBSkIDrcs fjCLvlIyp9MBifJ4o/0atJomM25cnM1TBDGunvtitR6UhoKaylkYur7l+jcwaAX1TLZ//6 LYv/KgNnmF6PyL5v4eAJ7hE+GygS24MUZLiVf2mr2Svf4/t7iKiCMpFxnHqDVhf0A9hnQC Cp8izH5oLsebJvUUq5R0qHFaoCVt0LC0jsWP6WlM/yNZAftwvIoNUPO4RUWeaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260351; a=rsa-sha256; cv=none; b=C5bm++XzmoB3DcBw2crYRDn2QJEkYyTeJZYQl9k+2SJvYPodEoijxaQaUK67vnxd5PMGDp tIG2GWfgKSzltveknMiLp1wXjAfRN3vXiSQTW7JMiPNXF8aEEukMurGxA9oneQefhyELQE wIJ6bxekFWYQe51oRHPEwduJnpGvyYuEbpdoLAT3KQuuZmULT+/lOMXawmApwGO7RgLaCi vuuKdVxh4WZ0qH0TcpxKrjvD8lKz8lMMv6KDRCz2tjxfZdq/iwI7VV++ZkoHF40iumL6Qv l0dJRSoftG2hO/4z5lhZbhBPf0dxIb6HHrjg/D5Kv8xsbhpa5x/IMBs3kxzzdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD6719mwz1CcY; Tue, 07 Jan 2025 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EWV01015585; Tue, 7 Jan 2025 14:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EWVrt015582; Tue, 7 Jan 2025 14:32:31 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:32:31 GMT Message-Id: <202501071432.507EWVrt015582@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: ce878284318e - main - makefs: Handle special file types when creating a zpool List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce878284318e71217d8d8f43f7d590b6c338d3aa Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ce878284318e71217d8d8f43f7d590b6c338d3aa commit ce878284318e71217d8d8f43f7d590b6c338d3aa Author: Mark Johnston AuthorDate: 2025-01-07 14:31:02 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 14:32:20 +0000 makefs: Handle special file types when creating a zpool Previously, anything other than a regular file, directory or symlink would cause makefs to exit with an assertion failure. Make it a bit more resilient to user error: print a warning and skip the file. Add a regression test wherein we create an image from a devfs mount. PR: 283583 MFC after: 2 weeks --- usr.sbin/makefs/tests/makefs_zfs_tests.sh | 22 +++++++++++++++++ usr.sbin/makefs/zfs/fs.c | 39 +++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/usr.sbin/makefs/tests/makefs_zfs_tests.sh b/usr.sbin/makefs/tests/makefs_zfs_tests.sh index aeda889d9a5c..3d5819439a73 100644 --- a/usr.sbin/makefs/tests/makefs_zfs_tests.sh +++ b/usr.sbin/makefs/tests/makefs_zfs_tests.sh @@ -148,6 +148,27 @@ dataset_removal_cleanup() common_cleanup } +# +# Make sure that we can handle some special file types. Anything other than +# regular files, symlinks and directories are ignored. +# +atf_test_case devfs cleanup +devfs_body() +{ + atf_check mkdir dev + atf_check mount -t devfs none ./dev + + atf_check -e match:"skipping unhandled" $MAKEFS -s 1g -o rootpath=/ \ + -o poolname=$ZFS_POOL_NAME $TEST_IMAGE ./dev + + import_image +} +devfs_cleanup() +{ + common_cleanup + umount -f ./dev +} + # # Make sure that we can create and remove an empty directory. # @@ -842,6 +863,7 @@ atf_init_test_cases() atf_add_test_case autoexpand atf_add_test_case basic atf_add_test_case dataset_removal + atf_add_test_case devfs atf_add_test_case empty_dir atf_add_test_case empty_fs atf_add_test_case file_extend diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c index 9413241da0c7..073dce3ce697 100644 --- a/usr.sbin/makefs/zfs/fs.c +++ b/usr.sbin/makefs/zfs/fs.c @@ -177,6 +177,13 @@ fsnode_isroot(const fsnode *cur) return (strcmp(cur->name, ".") == 0); } +static bool +fsnode_valid(const fsnode *cur) +{ + return (cur->type == S_IFREG || cur->type == S_IFDIR || + cur->type == S_IFLNK); +} + /* * Visit each node in a directory hierarchy, in pre-order depth-first order. */ @@ -186,9 +193,11 @@ fsnode_foreach(fsnode *root, int (*cb)(fsnode *, void *), void *arg) assert(root->type == S_IFDIR); for (fsnode *cur = root; cur != NULL; cur = cur->next) { - assert(cur->type == S_IFREG || cur->type == S_IFDIR || - cur->type == S_IFLNK); - + if (!fsnode_valid(cur)) { + warnx("skipping unhandled %s %s/%s", + inode_type(cur->type), cur->path, cur->name); + continue; + } if (cb(cur, arg) == 0) continue; if (cur->type == S_IFDIR && cur->child != NULL) @@ -381,9 +390,15 @@ fs_populate_sattrs(struct fs_populate_arg *arg, const fsnode *cur, */ for (fsnode *c = fsnode_isroot(cur) ? cur->next : cur->child; c != NULL; c = c->next) { - if (c->type == S_IFDIR) + switch (c->type) { + case S_IFDIR: links++; - objsize++; + /* FALLTHROUGH */ + case S_IFREG: + case S_IFLNK: + objsize++; + break; + } } /* The root directory is its own parent. */ @@ -652,6 +667,16 @@ fs_populate_symlink(fsnode *cur, struct fs_populate_arg *arg) fs_populate_sattrs(arg, cur, dnode); } +static fsnode * +fsnode_next(fsnode *cur) +{ + for (cur = cur->next; cur != NULL; cur = cur->next) { + if (fsnode_valid(cur)) + return (cur); + } + return (NULL); +} + static int fs_foreach_populate(fsnode *cur, void *_arg) { @@ -678,7 +703,7 @@ fs_foreach_populate(fsnode *cur, void *_arg) ret = (cur->inode->flags & FI_ROOT) != 0 ? 0 : 1; - if (cur->next == NULL && + if (fsnode_next(cur) == NULL && (cur->child == NULL || (cur->inode->flags & FI_ROOT) != 0)) { /* * We reached a terminal node in a subtree. Walk back up and @@ -694,7 +719,7 @@ fs_foreach_populate(fsnode *cur, void *_arg) eclose(dir->dirfd); free(dir); cur = cur->parent; - } while (cur != NULL && cur->next == NULL && + } while (cur != NULL && fsnode_next(cur) == NULL && (cur->inode->flags & FI_ROOT) == 0); } From nobody Tue Jan 7 14:32:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD664b4Xz5kf90; Tue, 07 Jan 2025 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD661J0xz4JZT; Tue, 7 Jan 2025 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k5vldgnJWRvvyViYTMZsji12LuuTcUN+/cEF9WqMmEQ=; b=wg+PVOgpRjqgr9W0hkOa6karOr1HbArR+Fx+rAokc+52SiGxs4LJxmVn4yPlL/b+Tha5fO iJLYRuuA5TdyxrQ11eJGQoh8/dYxsAFrSmQEpknPhKIgIQo+pY2jkRvaexLZtn+uY/XnvH i105xqS3UaenxayYd/J7mwEwg6K9jw67XEUKYvsM4rC+8Ee4kv9hc7LK4Ba8mEZxGG4drR a7B97FsZTB9lwp4B8fSUwbUW0s9thzAR3OhzYwmDj3plKiC7A9MSFRJIGaEH8ypo1f81Wk dVgzwHOMpFvgU/RRa4pPOdsxXdweJFrL1QvDkZ+P/402cTQ21As+y37iNl/MUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k5vldgnJWRvvyViYTMZsji12LuuTcUN+/cEF9WqMmEQ=; b=f0fv3aWBLwvfB76oeqIVhrYe9od0QyDK0jUCNzdEVWMgGwIxdjVllotV7FAm1MLxkh52aV ropKwxPZR7/tkbZ9/Wf5zw1hCqDXwBZTBUDKHEvbIu4u35WKYyyKoGtcDjv84Mc6X5NRJC lR1dTmfxQjEgd6SWH/0EMmTS6KQGIqCV6mlfX4EKhn9ECRL9MXFw1Q43plnCXofyl7tVby //nj1vZAf2ws9Lck5kgXYMhXaCnwkJ3CjLZA9Lvzf1cHIMcv7fLNjYJDQHWFkWxHgRGrxh yzAce/MS4h/aWLuwEP3neoiryOs6PjTtJkHZ8J51TMUo4++trdg+gM7Kg3Gxiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260350; a=rsa-sha256; cv=none; b=BHOiVYsxnp56ZUu5UpUto/ddfWRgf1mgNFoWgr7GLNvIyvwR/gQ/oDtPHEZYT9jZgvtEgF CtwTA/5McEfKh1y1MHi40YUzocq+Dxu0e9OFsSbLeD5XG2qCQyvXOXlPjjE8prwIWSLzQK lRoC+JCkD2IJE9S0AmA1W6vEdWWTa6q8PQAo4TI9B0WO3GRcLYRtm+kpBo1wkoublxtUTx i8GABPrchJdTqiugaEVavavm65d53De6WurQIzcJXlIthzsJjwooMYDqbhqXIMDpssYkmT guqZE4vMBE9C0VfyMgCds9cLc2WAcnsQcjG0V1+NbnF8aWPQrZEzCcJfXezo0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD660tfxz1Cfx; Tue, 07 Jan 2025 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EWUGf015527; Tue, 7 Jan 2025 14:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EWULc015524; Tue, 7 Jan 2025 14:32:30 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:32:30 GMT Message-Id: <202501071432.507EWULc015524@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: 2be86b6cc168 - main - makefs: Remove dead code in inode_type() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2be86b6cc168615e19350710347b77616c4b7f19 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2be86b6cc168615e19350710347b77616c4b7f19 commit 2be86b6cc168615e19350710347b77616c4b7f19 Author: Mark Johnston AuthorDate: 2025-01-07 14:30:53 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 14:32:20 +0000 makefs: Remove dead code in inode_type() No functional change intended. MFC after: 1 week --- usr.sbin/makefs/walk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/makefs/walk.c b/usr.sbin/makefs/walk.c index 401865229957..fe1fe8df80db 100644 --- a/usr.sbin/makefs/walk.c +++ b/usr.sbin/makefs/walk.c @@ -603,8 +603,6 @@ inode_type(mode_t mode) return ("symlink"); if (S_ISDIR(mode)) return ("dir"); - if (S_ISLNK(mode)) - return ("link"); if (S_ISFIFO(mode)) return ("fifo"); if (S_ISSOCK(mode)) From nobody Tue Jan 7 14:32:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD684fRvz5kf1N; Tue, 07 Jan 2025 14:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD682SDdz4JLH; Tue, 7 Jan 2025 14:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lO7SoIpAYvgvvGTIKFOkMQCw/EtgVs+gzw4oMeTcSUA=; b=gkCUPRoCQuoa7NAStVFFcnWZLL/hDgJA7GpUmk6L1RLZcsnydwxkJbivZJmtfwHI5A5D7Q BthEj3HignvJ/jCUItSLU4rYG5dkMN2kE8kFjBc7ApY6L0EYZkKKeFcHY+bOkaoNDI3jCS N9iPLY+8DyLPTRk9rRo3TxU1Ktkeg/BZ/xeHYOZi0zXIhWurqWbUo79kehSckG4hHVZsy2 bSWmp5NvyxDaa8Hdp+K1LgPo0ZlBBk/ilCQluahiGU/cKCgkt6CQuqI9Zrh5VuqplV+6ig bfgpE3Xd6NwxmjIVzYhkWubM1yM6eZBP7V9gLTJLbNYxorsK7fbgS9YldpKgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lO7SoIpAYvgvvGTIKFOkMQCw/EtgVs+gzw4oMeTcSUA=; b=vSPvc/S3EUf/O1GbnDOlS/hdCVGghVuoEVuCj0H4713M5ZV6GCgLKir2+nTIgtqfMlPBkI SLd8wW6ckybV0fE6A+He3UX6YIC4CYzaB2LoT9hkJAWmrS8fvvDihscKMbXrPpkL9DSNBp TsOzNc3xT59qm59EC2CeKEBC7GYvLvHMIpghBT4Kh0n12K1q5Lqlq4FPgDS9b0HCzEPJvO wXYrN+TSpi2nQeImOii8wEKxSPWfWO3eaDT1ZMlkHEqBOYuFZnby3H0J4XmOIzWZxWUTEw 9sPtHQCDfjaQOMsSTaYMek80aE4xRRGVf9JqWw5ICCkr06OVpPnj44cw2easKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260352; a=rsa-sha256; cv=none; b=hpPvrg6JxrN0o/gh3JhNta0kif+LHju9yIsrqzmljp97azvN8fTiv/xIxO1y1LD40lOsqH E67AdNDOwGdX8ZVtstvTeolxRrlKUHxy73J4oQ+hHB2MxW1EvKX42R2ex/I5gS5ChYJO1e pMapeUips8ztgzgNaSQN67py2xTBTY2sN36VLCdwyJeXsPbYeSsYrtkENGfYxvV5Hk63/g N9DbC15DTusO4nD8syVASmbRHKgmh6UWTtaGJpLRINTpzcG/pPYSyXhJLfYjikL/7tVt6B drBHGpHKaYC+o5rXQ9LarSTYik76y8gpPUWz639Hrx0jE0uuzzzmCvgVYW6abg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD6824gvz1Cg1; Tue, 07 Jan 2025 14:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EWWPW015658; Tue, 7 Jan 2025 14:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EWWfh015655; Tue, 7 Jan 2025 14:32:32 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:32:32 GMT Message-Id: <202501071432.507EWWfh015655@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: 596ee234ef45 - main - ktrace: Make -t t trace struct arrays as well as structs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 596ee234ef4537e71f030e13598ecbe73ee697bb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=596ee234ef4537e71f030e13598ecbe73ee697bb commit 596ee234ef4537e71f030e13598ecbe73ee697bb Author: Mark Johnston AuthorDate: 2025-01-07 14:31:15 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 14:32:20 +0000 ktrace: Make -t t trace struct arrays as well as structs Otherwise there is no specific -t option which captures struct arrays. MFC after: 1 week --- usr.bin/ktrace/ktrace.1 | 2 +- usr.bin/ktrace/subr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index 6542bb88dffd..c2f046dc5287 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -132,7 +132,7 @@ trace capability check failures .It Cm s trace signal processing .It Cm t -trace various structures +trace various structures and arrays of structures .It Cm u userland traces generated by .Xr utrace 2 diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index 6762fe9620cb..1db4c214414b 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -70,7 +70,7 @@ getpoints(char *s) facs |= KTRFAC_PSIG; break; case 't': - facs |= KTRFAC_STRUCT; + facs |= KTRFAC_STRUCT | KTRFAC_STRUCT_ARRAY; break; case 'u': facs |= KTRFAC_USER; From nobody Tue Jan 7 14:34:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD8w3VHCz5kfV1; Tue, 07 Jan 2025 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD8w1ngkz4KjK; Tue, 7 Jan 2025 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BkLOF2oJPt+YmlOOD+7AzMEwshzzG+3ICdM6wZepOgQ=; b=f3wL3atQOMJtKQd/dzfwS3ida8j65i4aUh+SRH7zzuys7IqPl6GHiKyh85rXvyI5pl5/9o pIBMIjxwaxwvrgRXMam0AM9yY7sDeAgHp6AMsmEHa7MCh2hzVKnVTzPS1mQIVUs2Tvh00c 0oGBjVNOkZPQNvdn85tNxqTCGEb5VfmqIW0OkgpekPK0JSWhIcD4eu3aa47ohOY96E7r6x Q0RzMYuGk40DtQSldsJ+yqY//6QHKhDuHN/o9wRdU1iXJeCd8R1/BQ0P5NFc/iSG1dmc1S wCcIU5TMwANuLAhYefSqq5Qx6tqjB4TeUW+qEvq3h4OpZCeUx0ruuZWsFosKbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BkLOF2oJPt+YmlOOD+7AzMEwshzzG+3ICdM6wZepOgQ=; b=SdfaR9kQiZo+mC5s5gozD5IzE9Mbv3UDpiRz/MD75IXRZ8h8xyHzPnVaJIROXH/TmgAf/u pf6CS/RZOpZxlQ0L6kbfJDRIJcpXfqGxZUVL1If6dR7DPhYtQi+e+pIto3yNWB8aMpbA3v p3V+h19OOCfvVUzvxdC7sM6WUPCel+dOyXqhxKDsU7KLgYINshK7vOKq6s8q4PS1xNhmKF qebRHYXIciw4jrU02+FJD5uOHhRKoSObAZC5F236jUVjxsOEjyCEPC3mkPUnZmM9ljcFuf gjuKaRx2IsPdgXs62tIockqMkQY6S/je/VBgKAPr+v+aqqztbMTiKlfNElAz3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260496; a=rsa-sha256; cv=none; b=suPYQ1XvPuCYMBXT4XJwpI+FRPZ2n4pacyVjoxdEfyABFi3u9z/GrNxw23rg03xCL5i3vP 9YQgkNXeTfmi5l1AGbwZJDQPUXk582+U4WKIH/6AY2LPEdDXY1kyDFHFSyb4brLSRqFkUE Kuien5FHOpHzRikmj54/h5JyQMhRoEn6voJnShhw+BG0UBczNOTiTJfRF9BnevUToom2FQ UNkI+HzKPLCQJe5hc6Ld4rNcOAZWDqqY3JxqE8ESlJ5yatFjsGfXeggEpS7HdlrFRGYaHO 8uCQtrxFyhzcB2KbpqfHmfIFdNejeuCMQtVDd1ySKlyVy1eNAWcnxSS1LXn4FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD8w1P5bz1ClL; Tue, 07 Jan 2025 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EYuk9016645; Tue, 7 Jan 2025 14:34:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EYuj5016642; Tue, 7 Jan 2025 14:34:56 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:34:56 GMT Message-Id: <202501071434.507EYuj5016642@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: 20a51e6073f4 - main - bhyve: Implement the libslirp notify callback List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20a51e6073f488440e108c7c628231cd6ae6757e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20a51e6073f488440e108c7c628231cd6ae6757e commit 20a51e6073f488440e108c7c628231cd6ae6757e Author: Mark Johnston AuthorDate: 2025-01-07 14:33:45 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 14:33:45 +0000 bhyve: Implement the libslirp notify callback libslirp can invoke a callback when received data is removed from a socket buffer, generally because the guest ACKed some data. Previously it didn't do anything, but it needs to wake up the poll thread to get reasonable throughput. Suppose one is using scp to copy data into a guest filesystem via the slirp backend. Data is received on libslirp's socket, which we poll for data in slirp_pollfd_td_loop(). That data gets buffered in priv->pipe, and eventually is placed in the device model's RX rings by the backend's mevent handler. When implementing TCP, libslirp holds on to a copy of data until it's ACKed by the guest via slirp_send(), at which point it drops that data and invokes the notify callback. The initial implementation of this backend didn't take into account the fact that slirp_pollfds_fill() will not add libslirp's socket to the pollfd set if more than a threshold amount of data is already buffered. Then poll() needs to time out before the backend sends more data to the guest. With a default timeout of 500ms, this kills throughput. Use a pipe to implement a simple in-band signal to the poll thread so that it reacts quickly when more buffer space becomes available. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48192 --- usr.sbin/bhyve/net_backend_slirp.c | 90 ++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/usr.sbin/bhyve/net_backend_slirp.c b/usr.sbin/bhyve/net_backend_slirp.c index d070d2cdfdb6..171c5b5bdbbd 100644 --- a/usr.sbin/bhyve/net_backend_slirp.c +++ b/usr.sbin/bhyve/net_backend_slirp.c @@ -84,6 +84,18 @@ static slirp_new_p_t slirp_new_p; static slirp_pollfds_fill_p_t slirp_pollfds_fill_p; static slirp_pollfds_poll_p_t slirp_pollfds_poll_p; +static void +checked_close(int *fdp) +{ + int error; + + if (*fdp != -1) { + error = close(*fdp); + assert(error == 0); + *fdp = -1; + } +} + static int slirp_init_once(void) { @@ -134,7 +146,8 @@ struct slirp_priv { #define SLIRP_MTU 2048 struct mevent *mevp; - int pipe[2]; + int pipe[2]; /* used to buffer data sent to the guest */ + int wakeup[2]; /* used to wake up the pollfd thread */ pthread_t pollfd_td; struct pollfd *pollfds; @@ -151,6 +164,7 @@ slirp_priv_init(struct slirp_priv *priv) memset(priv, 0, sizeof(*priv)); priv->pipe[0] = priv->pipe[1] = -1; + priv->wakeup[0] = priv->wakeup[1] = -1; error = pthread_mutex_init(&priv->mtx, NULL); assert(error == 0); } @@ -160,14 +174,10 @@ slirp_priv_cleanup(struct slirp_priv *priv) { int error; - if (priv->pipe[0] != -1) { - error = close(priv->pipe[0]); - assert(error == 0); - } - if (priv->pipe[1] != -1) { - error = close(priv->pipe[1]); - assert(error == 0); - } + checked_close(&priv->pipe[0]); + checked_close(&priv->pipe[1]); + checked_close(&priv->wakeup[0]); + checked_close(&priv->wakeup[1]); if (priv->mevp) mevent_delete(priv->mevp); if (priv->slirp != NULL) @@ -188,8 +198,13 @@ slirp_cb_clock_get_ns(void *param __unused) } static void -slirp_cb_notify(void *param __unused) +slirp_cb_notify(void *param) { + struct slirp_priv *priv; + + /* Wake up the poll thread. We assume that priv->mtx is held here. */ + priv = param; + (void)write(priv->wakeup[1], "M", 1); } static void @@ -310,11 +325,19 @@ slirp_poll_revents(int idx, void *param) { struct slirp_priv *priv; struct pollfd *pollfd; + short revents; priv = param; + assert(idx >= 0); + assert((unsigned int)idx < priv->npollfds); pollfd = &priv->pollfds[idx]; assert(pollfd->fd != -1); - return (pollev2slirpev(pollfd->revents)); + + /* The kernel may report POLLHUP even if we didn't ask for it. */ + revents = pollfd->revents; + if ((pollfd->events & POLLHUP) == 0) + revents &= ~POLLHUP; + return (pollev2slirpev(revents)); } static void * @@ -331,9 +354,14 @@ slirp_pollfd_td_loop(void *param) pthread_mutex_lock(&priv->mtx); for (;;) { + int wakeup; + for (size_t i = 0; i < priv->npollfds; i++) priv->pollfds[i].fd = -1; + /* Register for notifications from slirp_cb_notify(). */ + wakeup = slirp_addpoll_cb(priv->wakeup[0], POLLIN, priv); + timeout = UINT32_MAX; slirp_pollfds_fill_p(priv->slirp, &timeout, slirp_addpoll_cb, priv); @@ -341,20 +369,32 @@ slirp_pollfd_td_loop(void *param) pollfds = priv->pollfds; npollfds = priv->npollfds; pthread_mutex_unlock(&priv->mtx); - for (;;) { - error = poll(pollfds, npollfds, timeout); - if (error == -1) { - if (errno != EINTR) { - EPRINTLN("poll: %s", strerror(errno)); - exit(1); - } - continue; - } - break; + error = poll(pollfds, npollfds, timeout); + if (error == -1 && errno != EINTR) { + EPRINTLN("poll: %s", strerror(errno)); + exit(1); } pthread_mutex_lock(&priv->mtx); slirp_pollfds_poll_p(priv->slirp, error == -1, slirp_poll_revents, priv); + + /* + * If we were woken up by the notify callback, mask the + * interrupt. + */ + if ((pollfds[wakeup].revents & POLLIN) != 0) { + ssize_t n; + + do { + uint8_t b; + + n = read(priv->wakeup[0], &b, 1); + } while (n == 1); + if (n != -1 || errno != EAGAIN) { + EPRINTLN("read(wakeup): %s", strerror(errno)); + exit(1); + } + } } } @@ -510,12 +550,18 @@ _slirp_init(struct net_backend *be, const char *devname __unused, free(tofree); } - error = socketpair(PF_LOCAL, SOCK_DGRAM, 0, priv->pipe); + error = socketpair(PF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0, priv->pipe); if (error != 0) { EPRINTLN("Unable to create pipe: %s", strerror(errno)); goto err; } + error = pipe2(priv->wakeup, O_CLOEXEC | O_NONBLOCK); + if (error != 0) { + EPRINTLN("Unable to create wakeup pipe: %s", strerror(errno)); + goto err; + } + /* * Try to avoid dropping buffered packets in slirp_cb_send_packet(). */ From nobody Tue Jan 7 14:34:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD8v4mV1z5kfd9; Tue, 07 Jan 2025 14:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD8v154sz4KwL; Tue, 7 Jan 2025 14:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r1Qd3bJqF1J06xQEp4+VKEBzrtxPwOP3kWi3UISmrWg=; b=YcTzMJCCZ2IU50pyzMxeQ+w7yMBD1oR8dUB7ICeIst2AX7kHA5YWM4CqvSrjeJjcuS8xs4 JZQQ/8LJnS85nkGNOoNfcyZCSvCPsDIy+0gZ5uHWiq0uRoy0Dc9KH6z+FW161ElG99+Fz9 R18Hg55k0HWlPv5XL9IA5lwQwVbf6l0h+4LnMNkYoJwHfXA5s2ASPQyPSehx+DdOhIrN5z qER8sGLTe1OSmu01pYXAqPbdyjTBxHpQH5J9XrwcXnWnWWgg97cFp6YXex3hiAwxhqGSKM P7z6aFYhUEF5XPkypWSrceesTB2Q8aqoCZ4H4goZOrWLFQ7hSkg/b/IdZ43m4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r1Qd3bJqF1J06xQEp4+VKEBzrtxPwOP3kWi3UISmrWg=; b=VM9M4bnQxKiid1Y5Y5PmPDyD5FQYRiKGBZ2KUqTedpWT2f+6wiDc7DtM2mODyLvqpYUxIQ kn7E35Ri0BAjl8dfWinPS8WYX/wphhxwSaQsy79b5A3GugNIlaGEUOzOQ3TES2Jjju4df8 UyTFg4IlsxXylzm7gqJWBvhnSAS9G5Yyt5M1rKuYk/SrbMcrW2I3VdLDz+z1BfvbXLQW3P GemaR0SINq7/8FlTVrscH2oRPvc/s48j8K+tvhW8Mcjj4CTVlzvvTAz0rgZ5pt1mPw6Wld TlRioGJatCRjuzByX4VL1fBKMmFBDXWING051szAggTxeZa/Z/zNlrhLwoRTsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260495; a=rsa-sha256; cv=none; b=j1MYxQURxXQoP2hpT3LVFlsWvLIljSvQ7l4zgEfDhB61PplCjxrci/wHMPHozi9gXYEmO/ oK2TB3WthE1NCNU/QEvs2h7X+2r+RFfXm4uJUHeWyM6DFczoWUHt1Ky78G3FCUea0tTiH1 1a6a25aHP2iM4W2ip98stYGbMSy43JxCjJ8pjKHO0YSZ2Q02BlHcBJ2MZyYDshsMNq7HO7 iKhU72QhO5aucAMV1md6jJYIWGJRUVpN/PZi6tScjIr944+/TPB1JLGR5DvRLD8/q8lmYA bFfK96N7Gnz9qChE2QQAhsLhbmx8j/4yF3O/Ef7on+knOx42iR1cqQmliq9N8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD8v0X8jz1ClK; Tue, 07 Jan 2025 14:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EYsCZ016587; Tue, 7 Jan 2025 14:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EYsja016584; Tue, 7 Jan 2025 14:34:54 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:34:54 GMT Message-Id: <202501071434.507EYsja016584@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: d3bdfa583044 - main - bhyve: Use a non-blocking read in slirp_recv() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3bdfa583044dbfb76ef777939b86bb68baebee7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d3bdfa583044dbfb76ef777939b86bb68baebee7 commit d3bdfa583044dbfb76ef777939b86bb68baebee7 Author: Mark Johnston AuthorDate: 2025-01-07 14:33:06 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 14:33:06 +0000 bhyve: Use a non-blocking read in slirp_recv() When using the slirp backend with the e1000 frontend, I otherwise get hangs in readv(), caused by the e1000 emulation not checking whether bytes are available before trying to read them. In particular, that device model expects the recv callback to return 0 if no bytes are available, and with slirp it would end up blocking forever. The virtio device model uses the peek_recvlen to check first, so I didn't notice the problem when implementing the slirp backend. Make the slirp backend more flexible to accommodate e1000. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48164 --- usr.sbin/bhyve/net_backend_slirp.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/net_backend_slirp.c b/usr.sbin/bhyve/net_backend_slirp.c index 5ae33801387c..d070d2cdfdb6 100644 --- a/usr.sbin/bhyve/net_backend_slirp.c +++ b/usr.sbin/bhyve/net_backend_slirp.c @@ -609,11 +609,22 @@ static ssize_t slirp_recv(struct net_backend *be, const struct iovec *iov, int iovcnt) { struct slirp_priv *priv = NET_BE_PRIV(be); + struct msghdr hdr; ssize_t n; - n = readv(priv->pipe[0], iov, iovcnt); - if (n < 0) + hdr.msg_name = NULL; + hdr.msg_namelen = 0; + hdr.msg_iov = __DECONST(struct iovec *, iov); + hdr.msg_iovlen = iovcnt; + hdr.msg_control = NULL; + hdr.msg_controllen = 0; + hdr.msg_flags = 0; + n = recvmsg(priv->pipe[0], &hdr, MSG_DONTWAIT); + if (n < 0) { + if (errno == EWOULDBLOCK) + return (0); return (-1); + } assert(n <= SLIRP_MTU); return (n); } From nobody Tue Jan 7 14:51:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSDWx0p68z5kgQV; Tue, 07 Jan 2025 14:51:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSDWw5GhNz4MSG; Tue, 7 Jan 2025 14:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736261484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JKjhiBsSY2kG/VopdbNo4iAIf2T/t7+Uw5hU9nj28r0=; b=Y3oejxnBQOoPHt41NTcr3LIPJ05Q3hTz7MPgxoMcUsZst0psQ5pDCbyYMh5S2qA/VrlX0i Jd2OZ8ejudLGlC0sT0YxnfCQHJUjARGlVtvKmlx507rsN2l5aCfhl+ez7XhADPxvea3Qfn A3zgkKhBDnbXQxo98Bu6LuqkDDD/AgH7nYuxm0hkdrKBplO4t939uBzTlfq5lnZQZx+ThS hei8J9Hn2cE+9+iTTsTGoyrOLbYwP58ws7Oz1Jsw6R2+rcgXcqDYYhSerNdGfyyO/fZZ9/ HWYEqXLi8U8D453urtSdS5Ki2+QY8YH2YWjTcSpoFWzMJ5DMmwNSDTtHybxfsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736261484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JKjhiBsSY2kG/VopdbNo4iAIf2T/t7+Uw5hU9nj28r0=; b=n66aD3ItP83cZ6e6fhZgoE4/POOC/q2rjY1hdB0xK0e50yyd4sp3kUpsuojcqTBBtp/Dtu AULNj6peC3HjRtiztJWMCY1I3DtxKX9z0HyiACqOjblc4+LoK7624iCTu4iUEDhCmp6bEN n8SB42Kyc7UEekksneglKlh8bgbif30jDK+aPhmY7RQWYvwEd/yHST4/sAkYYJkmWl8gwh CkNCF8H/ySv0zo3hEq+tb+B4LJ0G/JAuXW1e4j/ZoheEe9QiE4TIS2oTvkE+WmPv+nIf83 oDCn2pAU1XvlA+hae5IVKrydWQH5g88OJpFkiwJmaT9qwKLgrzYGyoFl9umFYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736261484; a=rsa-sha256; cv=none; b=Q++c9PImHGBDffmtPPvzUbl6AMK74eQd5DUAKLJHBitGw8K8PnHIaIxHfNduyiHnwLorlg hfSzcsm5Zl/AvertE7/N0gopKQ2BAusrDchOUbwh2JlvbAxiKWdPJ5lsThz2vGJ6kqZeMJ ZsiiqkgAT0uaQ6v681yI8gbEW21FTisriqA1lE9e4Xe6IZC7TT0ufkWX/Td4khAQEu67Jh dcgjD2xHNILdSZVBEDnUdNpzbzOZ0KD7qzpxbjLQrbqdeOMK8Rw4xyuDRho592VPeSxVxS 63TLERcYfnWYzGvw9LUIA4NlmyCPOE3Nknl9XKFt+Gy9/EgMDHHZpwUS6kvMsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSDWw48WWzBg; Tue, 07 Jan 2025 14:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507EpOXt046228; Tue, 7 Jan 2025 14:51:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507EpOw2046226; Tue, 7 Jan 2025 14:51:24 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:51:24 GMT Message-Id: <202501071451.507EpOw2046226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f1aeb5d850cf - main - LinuxKPI: 802.11: add a print mask for ieee80211_rx_status_flags bits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1aeb5d850cf26418fb70a16d1304b92c45b5f1d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f1aeb5d850cf26418fb70a16d1304b92c45b5f1d commit f1aeb5d850cf26418fb70a16d1304b92c45b5f1d Author: Bjoern A. Zeeb AuthorDate: 2025-01-07 12:16:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 14:51:03 +0000 LinuxKPI: 802.11: add a print mask for ieee80211_rx_status_flags bits Add a print mask for use with %b to aid debugging. It is a lot easier to read names than numbers. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 11 +++++++++++ sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index dff152caf140..3aa383554e93 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -625,6 +625,17 @@ enum ieee80211_rx_status_flags { RX_FLAG_FAILED_PLCP_CRC = BIT(31), }; +#define IEEE80211_RX_STATUS_FLAGS_BITS \ + "\20\1ALLOW_SAME_PN\2AMPDU_DETAILS\3AMPDU_EOF_BIT\4AMPDU_EOF_BIT_KNOWN" \ + "\5DECRYPTED\6DUP_VALIDATED\7FAILED_FCS_CRC\10ICV_STRIPPED" \ + "\11MACTIME_PLCP_START\12MACTIME_START\13MIC_STRIPPED" \ + "\14MMIC_ERROR\15MMIC_STRIPPED\16NO_PSDU\17PN_VALIDATED" \ + "\20RADIOTAP_HE\21RADIOTAP_HE_MU\22RADIOTAP_LSIG\23RADIOTAP_VENDOR_DATA" \ + "\24NO_SIGNAL_VAL\25IV_STRIPPED\26AMPDU_IS_LAST\27AMPDU_LAST_KNOWN" \ + "\30AMSDU_MORE\31MACTIME_END\32ONLY_MONITOR\33SKIP_MONITOR" \ + "\348023\35RADIOTAP_TLV_AT_END\36MACTIME\37MACTIME_IS_RTAP_TS64" \ + "\40FAILED_PLCP_CRC" + enum mac80211_rx_encoding { RX_ENC_LEGACY = 0, RX_ENC_HT, diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d66bc40f40f6..77e23775ba19 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5333,13 +5333,13 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, /* Implement a dump_rxcb() !!! */ if (linuxkpi_debug_80211 & D80211_TRACE_RX) - printf("TRACE-RX: %s: RXCB: %ju %ju %u, %#0x, %u, %#0x, %#0x, " + printf("TRACE-RX: %s: RXCB: %ju %ju %u, %b, %u, %#0x, %#0x, " "%u band %u, %u { %d %d %d %d }, %d, %#x %#x %#x %#x %u %u %u\n", __func__, (uintmax_t)rx_status->boottime_ns, (uintmax_t)rx_status->mactime, rx_status->device_timestamp, - rx_status->flag, + rx_status->flag, IEEE80211_RX_STATUS_FLAGS_BITS, rx_status->freq, rx_status->bw, rx_status->encoding, From nobody Tue Jan 7 14:56:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSDdQ0CBZz5kh5l; Tue, 07 Jan 2025 14:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSDdP6XNdz4Ms4; Tue, 7 Jan 2025 14:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736261770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7qTk0HwqYzxGfgP6tY7jZXd28sF1OGZMwpKxruFvI8=; b=b6eTCJ807npaTrAPWzjgAytngBo2xuGP7MVJfTfPtfYvjgz3hnRpp/t4IITwCk14i5t6z0 UicVpwxbp8AY94QTynIv0ufDpHMJEe2R+3Cb6oPG3ZzQAy46b82Ge5U75KufMXFp2Sb21T VpK11VJDcpqaUbnvE6DHp9/KKVtKqnJAaXX2DY1tuQbo0IcTH9WNApLwfsdUD/in3vt9wz 0tHYCFUfwj/aSIrHSBAYU++sLmIoK5+Ey7qcZQw46HMzArL9CkJbZlQ/3Ig51mEdP/fc/f AJIVBrA7VbcVsJhk9Tgd4P3s3QAgEo0wsSeGSvz4y/bqJHG/BJbW/POrF3gQOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736261769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7qTk0HwqYzxGfgP6tY7jZXd28sF1OGZMwpKxruFvI8=; b=SxdERQR/QFmi7iMIhc2Xdb2WtmBfhaL0hnMhCBwdzKb47jRYAWBJjgD68RvkAu1Fulw3rK O028KC+QvH9ZIedp/0gsgyNG82G45hDlizAq5k7Qu+CUo8e5NdzGuUADM2d273v/V8OrE6 psvH2+38zeEtYVEHCItnMPI766B/GAERXHzHzUF1ixzFC0VYsWb11HOYjCQAqeliGT+IXT a/zkryNdhgIpFvq68YN0U4NwPcT4q+eQJn+2tbo2+EdLc2lRv9jim5l+qRd4iEWeWWigMx s11BcZi36AaWVI2bFTnrUAC/9EL4MYk43uTK0ugistq2tIrZomU3cdAEQdxDgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736261769; a=rsa-sha256; cv=none; b=qupTDZVTZiTuGn4U3HtzvwUckne4knmx8+X4Zr44DFWzlFvN0CqFawF/p43/CFv4EBLWpC 5z8Q/2rGdmPYa75CnVVyzLSfEptSlZ8492uKNZ2Z4Bhh9KGHnHTRrNMvWcFXKGUgTvfsyD f8cG0PlDooSAFq5kwRokzlpUgH1W/c/DCCjyd6LReIA19SNcge10jXyQRB4fCf6fQrucND Lj0qt7GPOU9WFpgnTqnuL1OCHYxn6Z9Vj2nm9Y/qIvcikaJtPR4ByVcypgx8aeundffnmI aNSaE9PVXvMJdbfPYNqQGEk8nkPOaSnAGPP00neZY+CL3qWaXciUuq63tsaZsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSDdP61mPzVg; Tue, 07 Jan 2025 14:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507Eu98k053522; Tue, 7 Jan 2025 14:56:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507Eu94X053519; Tue, 7 Jan 2025 14:56:09 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:56:09 GMT Message-Id: <202501071456.507Eu94X053519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: cf71349a23f0 - main - ifconfig: 802.11: fix indentation of a line List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf71349a23f02b55bd3bb4973decac87f7a7d2b8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=cf71349a23f02b55bd3bb4973decac87f7a7d2b8 commit cf71349a23f02b55bd3bb4973decac87f7a7d2b8 Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 08:01:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 14:55:07 +0000 ifconfig: 802.11: fix indentation of a line No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sbin/ifconfig/ifieee80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 396368798da3..77f7bdabb0b2 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -2296,7 +2296,7 @@ regdomain_addchans(if_ctx *ctx, struct ieee80211req_chaninfo *ci, memset(c, 0, sizeof(*c)); c->ic_freq = freq; c->ic_flags = flags; - if (c->ic_flags & IEEE80211_CHAN_DFS) + if (c->ic_flags & IEEE80211_CHAN_DFS) c->ic_maxregpower = nb->maxPowerDFS; else c->ic_maxregpower = nb->maxPower; From nobody Tue Jan 7 15:02:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSDmH4VDPz5khLG; Tue, 07 Jan 2025 15:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSDmH3mRhz4NYF; Tue, 7 Jan 2025 15:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736262127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iv7BWyWAJDK6HavRtZvKDSo5U0IHWD7fSNziWb9KFi0=; b=cct06foRK50MTkwtscIjYSh3soQ3Sbs/OzB6dFrLYLEpn5Ni+g3pL7aV3qfv6anOdAWjcs 3ajDuu4TMApEZ5gZod5E308YluFO5808ckHprtgiBuvjt8Svd5B+j/NNCDOwqhnmh6p1l+ gLhTCFzu3e9+ZmCnnvSCQfwbg90X6acC9MluVuM8V5WWhGaQiYqGBY7NGhTW2GK8USxcKJ Wtw7vsyH3hajUPht0w5aaThN70PU3AkImi6+zpjGHgMdIGu1XD/M7sUNXz0Qq3jXMsBXw4 lnm4aenjk0cO8qO+/CNQZHAhPTDzFZpP5bc6/U1a44u6IWazaaIap1rjj0VQFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736262127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iv7BWyWAJDK6HavRtZvKDSo5U0IHWD7fSNziWb9KFi0=; b=CEA75oPIwe7MK7MXTMNU1Q6tREEPkMLODJAMvSHlA8tfdMG7KjgqfP0KO8jugNEnaq3iNM VBr13ShczdaBWkE45H54verQ1XaD3xs6U/B5/7aWtBHTcQ85lgipkGKEGTwNCOW2Sp+2fG +mQS65nP60HkeilhiicrhKxW+e9tS/BZZ7+qvi6yM2MBrORM3pEy5+ygqPVCTVh3ULgfX7 cSh11UBzSzYuhYj00TRF5b/2N9p9B3dFHioeUDNwypBD1YrqyjUxXcSDVR+rpkE/bnvRmD eUy5pmkpFUj2ZTbRHdkYzE0bfegVmN+7EylSWQIZnXX4QDcsG2C0tfugc4SQQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736262127; a=rsa-sha256; cv=none; b=BkfktsWAtUoTp/SxEe+nxWS6yIr7zCw6kiTDMa7vLRPEL2ngQNndyDUi3CRecrak1ZnIYw v/fHFHHwQNjfZZ4myPW6Cth0iwkogHY5mHkwXuPZjnZbtJPJZK3msvnvlUTgNEHzwoE2qB WwHdhAv98Ma2vyWk0VXnRKcNzNuNwCy+avMXadjEWnH7li2oUvYzyfsVykT4IzNC8FtpZ8 N5Pw69O1lO3vZjnMZbNgKP/GVfAfF3b9JNADwsWYdBsLdxwMruXupVoHOOlAW6g066aOfY eYuTMX9lww1N6Gu4WJ4QmQwrPazzJBsnWlhXnpkNExejKu7fGbd+4BIHou4bDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSDmH3FFczm8; Tue, 07 Jan 2025 15:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507F27PM072950; Tue, 7 Jan 2025 15:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507F274g072947; Tue, 7 Jan 2025 15:02:07 GMT (envelope-from git) Date: Tue, 7 Jan 2025 15:02:07 GMT Message-Id: <202501071502.507F274g072947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e6d40f90110a - main - net80211: correct typo s/Insure/Ensure/ List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6d40f90110ad8026f1af3fa68f836463936ea78 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d40f90110ad8026f1af3fa68f836463936ea78 commit e6d40f90110ad8026f1af3fa68f836463936ea78 Author: Bjoern A. Zeeb AuthorDate: 2025-01-07 11:56:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 15:01:07 +0000 net80211: correct typo s/Insure/Ensure/ No functional changes. Sposnored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48358 --- sys/net80211/ieee80211_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index d70b3aa4a24a..e1fac3a624e8 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -741,7 +741,7 @@ ieee80211_crypto_decap(struct ieee80211_node *ni, struct mbuf *m, int hdrlen, k = &ni->ni_ucastkey; /* - * Insure crypto header is contiguous and long enough for all + * Ensure crypto header is contiguous and long enough for all * decap work. */ cip = k->wk_cipher; From nobody Tue Jan 7 15:35:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSFVk2D0yz5kkkl; Tue, 07 Jan 2025 15:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSFVk1RvVz4RbZ; Tue, 7 Jan 2025 15:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736264126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7zBORBgVVN+CjiO0a9cXorC0Fr9ambzcqniVg3wJ9g=; b=GNkApk2AAc/EhLYWv8MkXK21XNiG5OKA/tilvyKvLZDb1+Zz6CQfSdcXK10UIW6BW4ysUs XKAM4T0hxBSNgtA91v0zvQyr/D2Hs7NH3ly2sOHR/ixeJ/cn1ihADEBInSric+f9RRaSoa 9X8SPqbXO7R1F+h9rem72zFLs4oS+7sXbXtwIYVk8AktNdGL/WxblHtUsVqiOlfUCzGv8E dyNRBbA60oWseZYOMSRggVv/qtD23fsQl+c65Y5LgNxZNVvsWbDJzvVir0XZK0khYtAlgj Cv0ylVAO1DtO49uEjMocPDIwRaGywjNkUJPt8xE0BgzNxMwJp2zHJ5hmDQFF7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736264126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7zBORBgVVN+CjiO0a9cXorC0Fr9ambzcqniVg3wJ9g=; b=vm3N41c9Y9ZK1kJPxLcLx7lNg628h3RjSny0m4v1NKEmKtoRn3zWit3bP3IRK1ggAOWBgj mHeQPB3Llw72pY5s9TbNgSqnccZRd0zqWlN+lkSBU1tjVz76w5Lcti2g0uBvQeuJ+KQ1hA HVYZKYxF6iBfd0j06R1ZUiPvfTAMIhe7J324e8tAL+V4Pbl7tPhFW/T8MdvaxM9WcJF5Tz khPatb6k+/tHJdFQW2rAzqbpFale+Q0uEdvSHY0fMM0PvnUSk2nI0nAc8N3qla/n2CxBdo 9G4lse2455uVzzVYKUsq/wlHH6FGLnlVCT4OSg2UBB+ZhrzWV/0GFBoX8qhnIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736264126; a=rsa-sha256; cv=none; b=UgNfb9dp2N0iAvHqjPcCnh7+ZoKvVz/tzzqdaJt82EWnm5N64nBD/eQERvs1GTaGHJsRtB sMEfiln7scpTrp38IU/yvrcwCyoSsxhNthoePS3oAiotWUE19Eybsk8S0oDqS2265PnKjK OKYFdS4KYhoPaYxTDKB7dO0z68bTXE194ro104a1rACfDy54U5G8WrnkZbDe1rvyK9r5hH wH8BaTLfglwUbZ3xXna7VKGEGYkcQTI2UJXs/1FEjFrFcURmanuIBmzkJ6R8wVLuvIYn0E +dPB6jCI8Mzf1Y205SHzxUzjj/jfWHbaxhdTWeevc9cfss1oXip/Tic6Qu/A+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSFVk12KRz1H6; Tue, 07 Jan 2025 15:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507FZP9C029067; Tue, 7 Jan 2025 15:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507FZPJv029064; Tue, 7 Jan 2025 15:35:25 GMT (envelope-from git) Date: Tue, 7 Jan 2025 15:35:25 GMT Message-Id: <202501071535.507FZPJv029064@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: 6ba2c036a011 - main - pci_find_cap_method(): limit number of iterations for finding a capability List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ba2c036a0117ac02f9979b7dc49f15e9c1ea9c9 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6ba2c036a0117ac02f9979b7dc49f15e9c1ea9c9 commit 6ba2c036a0117ac02f9979b7dc49f15e9c1ea9c9 Author: Konstantin Belousov AuthorDate: 2025-01-06 23:29:18 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-07 15:34:59 +0000 pci_find_cap_method(): limit number of iterations for finding a capability Powered down device might return 0xff of extended config registers reads, causing loop. PR: 283815 Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48348 --- sys/dev/pci/pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index cf01115581e1..0b02d873c5a1 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1519,6 +1519,7 @@ pci_find_cap_method(device_t dev, device_t child, int capability, pcicfgregs *cfg = &dinfo->cfg; uint32_t status; uint8_t ptr; + int cnt; /* * Check the CAP_LIST bit of the PCI status register first. @@ -1545,9 +1546,11 @@ pci_find_cap_method(device_t dev, device_t child, int capability, ptr = pci_read_config(child, ptr, 1); /* - * Traverse the capabilities list. + * Traverse the capabilities list. Limit by total theoretical + * maximum number of caps: capability needs at least id and + * next registers, and any type X header cannot contain caps. */ - while (ptr != 0) { + for (cnt = 0; ptr != 0 && cnt < (PCIE_REGMAX - 0x40) / 2; cnt++) { if (pci_read_config(child, ptr + PCICAP_ID, 1) == capability) { if (capreg != NULL) *capreg = ptr; From nobody Tue Jan 7 16:25:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSGbz0BNJz5knRD; Tue, 07 Jan 2025 16:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSGby6h1Nz4YFD; Tue, 7 Jan 2025 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=1736267103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wh45R/wBuVjszt1XOUXYH1/ny8fsnyge3m4aicHvWls=; b=t7CXb/n3jnE00imlQP9m7QNGxr1Q3hH2I1SnGOVBjXIh3YMKIfotkFweTRdkk1p3u5+DIY yISLpyeepbD4X1MokgOX5g2eiUK+xk3g5n84KwF11022KfzLzec7yR/bYNWs4e4RYgiliS cjrC9ifJbUgsVKN87TYh7gfL4z3oZ3NTd0raUymZ5ffr3mAczdZuPSK60vz54KaSlK17FX TdyJ3ySTzEqKnWr7JgYkXvC4ELYtP2+R6aqL5Likagb3z7bmRXtRWuHpb96T2H/Nco5rm2 egv88UiEUpm7l+P5RZoOxg6OrK1jaqzB5Soo8TWWulT35QWHbA87uAs0C78fjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736267103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wh45R/wBuVjszt1XOUXYH1/ny8fsnyge3m4aicHvWls=; b=ga4Lf0XQ/MV4sO6OyN96UXs3RsMbdfVggti/SnoKS5ZhXAKZhO5FwFuQh7PeT89OluuEh1 d32K/eHJpu/fCZJlHNOkEsq2CgNbr4JDHn6GnXc5CXYH56ZoBh5JaMfEjhDsgp9xWlRct9 RVKtNDsaD4A1NPmxX0hZdJEP51ML1q2+zu/Ri4DgWieWtTHNCeUy/+Ky3x3adtG4yCBh4Z /wy3HhzqwfuegxbEMIJPLRBvalDHTYGkBuJzHSvS5nCc5KX49gbuvJSalWPFUDjgLrG3xV PX3xEJNX1fvMNRcd9OGrigYkudi7MQw8A1V89y3gu65a2wDaFbcD3TnjE1aWcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736267103; a=rsa-sha256; cv=none; b=A+W6boAcFt6V24bUM9wTUA3DSScD8XO/bdQ3h4zcOsfhBz007oWKqsUGjRL/1mMEr3qgAS Apou7MyVCuhwxvATnfu0BG42LVLe2O6ailL/1iV4ZEAasF7isc7lOvPJAP7dGiXuWhKkYU IpdsbACln/nn5Yy3pXeDHRBtav2K+skHw9BvmXtrGXxqIgXyc8OCssOERGva8lynjw9v73 cMZVv3c5iVmAwRBU3aT4/9b/v4ztEhE8iFW3RB4N0S/HfYoiBr8rFD7Ou5+L7Jmoy1HmFj XTUMl05R4a3GDKIYVz2rSZikECdBmNq26dfB8PCJSVZymjhPzF6WXA0RYaaSCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSGby5vHlz2Tb; Tue, 07 Jan 2025 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507GP2I6023099; Tue, 7 Jan 2025 16:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507GP2tU023096; Tue, 7 Jan 2025 16:25:02 GMT (envelope-from git) Date: Tue, 7 Jan 2025 16:25:02 GMT Message-Id: <202501071625.507GP2tU023096@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: f73c9b5da190 - main - mi_switch.9: Remove cpu_switch, cpu_throw List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f73c9b5da190954a81e9e70e2caa8e9168623bfd Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f73c9b5da190954a81e9e70e2caa8e9168623bfd commit f73c9b5da190954a81e9e70e2caa8e9168623bfd Author: Ed Maste AuthorDate: 2025-01-07 16:04:00 +0000 Commit: Ed Maste CommitDate: 2025-01-07 16:24:25 +0000 mi_switch.9: Remove cpu_switch, cpu_throw cpu_machdep.9 was added to document cpu_*, but cpu_switch and cpu_throw were already documented in mi_switch.9, and MLINKed. cpu_machdep.9 seems like the correct place for this, so remove them from mi_switch.9. Some of the removed text was stale, although there are few notes that ought to be added to cpu_machdep.9 in a future commit. Reported by: tools/pkgbase/metalog_reader.lua Reviewed by: jhb Sponsored by: The FreeBSD Foundation Fixes: 9c87cbbcaaed ("cpu_machdep.9: New manpage describing the semantics of several cpu_*") Differential Revision: https://reviews.freebsd.org/D48360 --- share/man/man9/Makefile | 2 -- share/man/man9/mi_switch.9 | 68 +++------------------------------------------- 2 files changed, 4 insertions(+), 66 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 91a7bbe294fa..c09d3aa554a1 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1594,8 +1594,6 @@ MLINKS+=microuptime.9 binuptime.9 \ microuptime.9 getsbinuptime.9 \ microuptime.9 nanouptime.9 \ microuptime.9 sbinuptime.9 -MLINKS+=mi_switch.9 cpu_switch.9 \ - mi_switch.9 cpu_throw.9 MLINKS+=mod_cc.9 CCV.9 \ mod_cc.9 DECLARE_CC_MODULE.9 MLINKS+=mtx_pool.9 mtx_pool_alloc.9 \ diff --git a/share/man/man9/mi_switch.9 b/share/man/man9/mi_switch.9 index 549ec497434c..e04c2ee35ace 100644 --- a/share/man/man9/mi_switch.9 +++ b/share/man/man9/mi_switch.9 @@ -31,23 +31,17 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 9, 2023 +.Dd January 7, 2025 .Dt MI_SWITCH 9 .Os .Sh NAME -.Nm mi_switch , -.Nm cpu_switch , -.Nm cpu_throw +.Nm mi_switch .Nd switch to another thread context .Sh SYNOPSIS .In sys/param.h .In sys/proc.h .Ft void .Fn mi_switch "int flags" -.Ft void -.Fn cpu_switch "struct thread *oldtd" "struct thread *newtd" "struct mtx *lock" -.Ft void -.Fn cpu_throw "struct thread *oldtd" "struct thread *newtd" .Sh DESCRIPTION The .Fn mi_switch @@ -168,63 +162,9 @@ running thread .Fa oldtd to the chosen thread .Fa newtd . -First, it saves the context of -.Fa oldtd -to its Process Control Block -.Po -PCB, -.Vt struct pcb -.Pc , -pointed at by -.Va oldtd->td_pcb . -The function then updates important per-CPU state such as the -.Dv curthread -variable, and activates -.Fa newtd\&'s -virtual address space using its associated -.Xr pmap 9 -structure. -Finally, it reads in the saved context from -.Fa newtd\&'s -PCB. -CPU instruction flow continues in the new thread context, on -.Fa newtd\&'s -kernel stack. -The return from -.Fn cpu_switch -can be understood as a completion of the function call initiated by -.Fa newtd -when it was previously switched out, at some point in the distant (relative to -CPU time) past. -.Pp -The -.Fa mtx -argument to -.Fn cpu_switch -is used to pass the mutex which will be stored as -.Fa oldtd\&'s -thread lock at the moment that -.Fa oldtd -is completely switched out. -This is an implementation detail of -.Fn sched_switch . -.Pp -.Fn cpu_throw -is similar to -.Fn cpu_switch -except that it does not save the context of the old thread. -This function is useful when the kernel does not have an old thread -context to save, such as when CPUs other than the boot CPU perform their -first task switch, or when the kernel does not care about the state of the -old thread, such as in -.Xr thread_exit 9 -when the kernel terminates the current thread and switches into a new -thread, -.Fa newtd . -The -.Fa oldtd -argument is unused. .Sh SEE ALSO +.Xr cpu_switch 9 , +.Xr cpu_throw 9 , .Xr critical_exit 9 , .Xr issignal 9 , .Xr kern_yield 9 , From nobody Tue Jan 7 18:07:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSJtR4NpCz5kwLb; Tue, 07 Jan 2025 18:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSJtR3jyRz4hRv; Tue, 7 Jan 2025 18:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lvZQMLQ8LBRnhKKAo42FKlMVTDPIHdaFTbTCx6MK3vg=; b=pJCnGK1acyv4uBEATLYuQZu9CO3/OYUZApFNvRV0w3tfBZLMZYgqPJynx+S3xu8tNSHWsR jI48E/9LjYALfVQGaKn5xDLqRRxxDS/+opHfmEXYov9wxtTufVn5gINCQ9aZQpUR4/onsR oRtoDb8eThYgx8ycfX/ZZ7JPb5Ajhhu+4k7uhWQEq3YJJTf34NT31Lo48DdvhFK11vbBN4 HMs3jO8VzFacxPzFdHpvzRlUU6nO5bGR6O8UXNyUkIJX8MkMxIdUJEAjOI5jH3GHuKIQRx Qc92mfwWjZGw3LQ0quKQcYPQQ50r3/vabFghUns0ENDfsMmClqLJUIuyAbhyaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lvZQMLQ8LBRnhKKAo42FKlMVTDPIHdaFTbTCx6MK3vg=; b=RUBew5BZiEGPWkPQlg5hwmQLOIGR4yrleNB8yVXJf9ZlctPnIu9FT4DUeBgXnBfpWzehz9 0Ux7eWvtE1CWsTVWtEAu0Lko6/VILeOFLNO9yo/varoyBEDsuTndAgAKoVRFSyK2Gx77hU JxyC2lvo4iJ2usB1S2w05TOOoGT9+1Mj8OPilNolJDm45bzZ9dvUBDiM4/4N2UXxvBeRLh xUm2TtnYE71UIQ/R0Fo9OHdnsDuLLAVlH4/Ga126kWfNgTAzVreWXkollKd86yBCR9roIO g+rGObEDmzTQvsC4XFmSMdiDy1dZ2RuoV0keTjgLuo0cSdLxzvbGOSPvjucFYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273263; a=rsa-sha256; cv=none; b=yZuUO0dTWICEq5W+w3RNdljRi7eIQ+lOtuE64C3Sd7bPsRkiK5FlKgmxOv1xDadlYNY41S QtNRPX0et2Mr7MAFPZEFydhdhfIfABrAOMQuslojxq5XUk79+GP8V1147lA0Rq+4wSTAYC mjmCQXjHXEOTgGbDtLCj1mCIVKlfNKi82BmDZ8Da0Fq8dEnduAajTTMx7vtRagD/jSPmum 68Pjloh9JV92nhY5R4gEgC+sstxLMr7LOpwVeOYFMZuLPBtWa1U+qvf7+zS8Z90f/IOgMZ XVLs8ReAkxqgkuogrs65XsLjYVSmPKU3euaNT13tY9T7vJbK6AE7bCh0DqIhSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSJtR34Pxz55W; Tue, 07 Jan 2025 18:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507I7h5j011737; Tue, 7 Jan 2025 18:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507I7hlv011734; Tue, 7 Jan 2025 18:07:43 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:07:43 GMT Message-Id: <202501071807.507I7hlv011734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 07f6575585bf - main - LinuxKPI: 802.11: turn on debugfs for iwlwifi and rtw88 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07f6575585bf69ae48dffe87c4578057ae4782d8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=07f6575585bf69ae48dffe87c4578057ae4782d8 commit 07f6575585bf69ae48dffe87c4578057ae4782d8 Author: Bjoern A. Zeeb AuthorDate: 2024-12-28 09:52:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 18:07:09 +0000 LinuxKPI: 802.11: turn on debugfs for iwlwifi and rtw88 Make iwlwifi compile with debugfs after the last updates and turn it on for both iwlwifi and rtw88 in order to be able to get at least some useful information on driver/firwmare state. Sponsored by: The FreeBSD Foundation MFC after: 10 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 4 ++++ sys/contrib/dev/iwlwifi/mvm/debugfs-vif.c | 2 ++ sys/modules/iwlwifi/Makefile | 2 +- sys/modules/rtw88/Makefile | 5 ++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 3aa383554e93..fe36f1adf28a 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -737,6 +737,7 @@ struct ieee80211_sta_agg { }; struct ieee80211_link_sta { + struct ieee80211_sta *sta; uint8_t addr[ETH_ALEN]; uint8_t link_id; uint32_t supp_rates[NUM_NL80211_BANDS]; @@ -1121,6 +1122,9 @@ struct ieee80211_ops { /* #ifdef CONFIG_MAC80211_DEBUGFS */ /* Do not change depending on compile-time option. */ void (*sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct dentry *); + void (*vif_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *); + void (*link_sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_link_sta *, struct dentry *); + void (*link_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct dentry *); /* #endif */ }; diff --git a/sys/contrib/dev/iwlwifi/mvm/debugfs-vif.c b/sys/contrib/dev/iwlwifi/mvm/debugfs-vif.c index aa5058955323..0b3bc62f39a7 100644 --- a/sys/contrib/dev/iwlwifi/mvm/debugfs-vif.c +++ b/sys/contrib/dev/iwlwifi/mvm/debugfs-vif.c @@ -888,10 +888,12 @@ void iwl_mvm_vif_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif) void iwl_mvm_vif_dbgfs_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { struct dentry *dbgfs_dir = vif->debugfs_dir; +#if defined(__linux__) struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); char buf[3 * 3 + 11 + (NL80211_WIPHY_NAME_MAXLEN + 1) + (7 + IFNAMSIZ + 1) + 6 + 1]; char name[7 + IFNAMSIZ + 1]; +#endif /* this will happen in monitor mode */ if (!dbgfs_dir) diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile index a8176383a13c..c41a1a1757c1 100644 --- a/sys/modules/iwlwifi/Makefile +++ b/sys/modules/iwlwifi/Makefile @@ -3,7 +3,7 @@ DEVIWLWIFIDIR= ${SRCTOP}/sys/contrib/dev/iwlwifi .PATH: ${DEVIWLWIFIDIR} WITH_CONFIG_PM= 0 -WITH_DEBUGFS= 0 +WITH_DEBUGFS= 1 KMOD= if_iwlwifi diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index 19e77b271c37..486197d8c952 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -3,6 +3,7 @@ DEVRTW88DIR= ${SRCTOP}/sys/contrib/dev/rtw88 .PATH: ${DEVRTW88DIR} WITH_CONFIG_PM= 0 +WITH_DEBUGFS= 1 KMOD= if_rtw88 @@ -39,6 +40,8 @@ CFLAGS+= -DLINUXKPI_VERSION=60800 CFLAGS+= -I${DEVRTW88DIR} CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -DCONFIG_RTW88_DEBUG -#CFLAGS+= -DCONFIG_RTW88_DEBUGFS +.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0 +CFLAGS+= -DCONFIG_RTW88_DEBUGFS +.endif .include From nobody Tue Jan 7 18:09:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSJx32dQdz5kw2Q; Tue, 07 Jan 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSJx31VCQz4hqW; Tue, 7 Jan 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37HzmFBV9qu8c9db9/A3RWMB5rlZf/Tj5Zz9Om8lyRI=; b=gH+dBbgE69AeXUNRDDp9yn2ipMR57AsKK512PeodHAeAtU+ZqS6InEUUFgjpHH6DHQK+lm enMTB/TkzpN+qqX3yq8FMmAtwU+vrKAlCmVBxeZ23VSm5H3s2W96JRIHc0i/EB57Ta3Pta dJaJvdFzki8cgBssgdgNApKS1rDGqDsLIEbpFG0Fpkiq+SV+ImniQATnKjRA2lDuGDBCOz qUkQBFvyZRXFl7pr4QdrusbhJpSgyH6GG7cYj4ViCm5IeJHAZLl1wCGcXAygnW4VNqZljx 0rEyD8Fnj4bzpSzLebAh8rlLbRt+VOWZ6eK+rQk5XHRcCp5v722jobiaDQuVQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37HzmFBV9qu8c9db9/A3RWMB5rlZf/Tj5Zz9Om8lyRI=; b=Ma14atu4paosySIhC9Ly3A6EhwSxFSZhqWI6jvxzgbQqNGKvxxwdg51w3c2L5we+duBbBS FYQD11laHOzW08tSRuT1e4zW+br46N26ObQ7eao8CDis4PgAg7+IMwNYbfiZuL5UZztJ6G t6h4pmxmFvMr9ivaOvAG9/G3IlzbWaukMboGDOxAB4zgZlf+EcpdfCTJSik2N/+69alW3Q xLL70j/ajYRNT7DkhViNcI0hUBO0GWRUqtjqp4fwj6xCCR0f7hlfB2EZ/4sv4XkqnbtYFn WsJUmjyvDEPYeSgii86wB7LYMyhrNyhqJDpWEkvccmDUV2NA2RZnQ5J3e+vBNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273399; a=rsa-sha256; cv=none; b=olZ3/BWyqtrZyrQiXB2wcJxrSPzKtSff5s62K0RbIPdL8oXnFJQw2oxWvbyKZr8stLL2xL FNJy8GZni4ne1jLGQUPj959szoKyrccDxV0P4dSsOR9cLg+hA8bZ+tiuHmxLiZSrSkWl1g hvO3UKrlxqJudAnS5g90r5iFRllG6HKaWsVkr+puGEHAi/PNpd8rymyRnlBrVsK4V6FrSN SgyKY6l9MnVn6bRZam1CbE11eCzSAjJa7IiHOsj4AM0GQ4gYni0wb05ZSTtShMhNQVNpY8 Cx2W8zomSDIGAg+r7LNoUUK+GYmNH0jelItuEpUgcOzD9mxcXhFcnJPYD3xD8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSJx30Sywz5QC; Tue, 07 Jan 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507I9wiK012548; Tue, 7 Jan 2025 18:09:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507I9whj012545; Tue, 7 Jan 2025 18:09:58 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:09:58 GMT Message-Id: <202501071809.507I9whj012545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 42410c6d682c - main - ifconfig: make -vht work List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42410c6d682c4e00ce6147f99b51a55f6f3fe075 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=42410c6d682c4e00ce6147f99b51a55f6f3fe075 commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075 Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 16:58:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 18:09:00 +0000 ifconfig: make -vht work Also hide the other vht options on -vht and only show vht40/80/160/80p80 when vht is enabled. While here fix some whitespace and comments. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian, emaste Differential Revision: https://reviews.freebsd.org/D48326 --- sbin/ifconfig/ifieee80211.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 77f7bdabb0b2..d4dcfdf63254 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -198,8 +198,10 @@ static int gottxparams = 0; static struct ieee80211_channel curchan; static int gotcurchan = 0; static struct ifmediareq *global_ifmr; + +/* HT */ static int htconf = 0; -static int gothtconf = 0; +static int gothtconf = 0; static void gethtconf(if_ctx *ctx) @@ -213,7 +215,7 @@ gethtconf(if_ctx *ctx) /* VHT */ static int vhtconf = 0; -static int gotvhtconf = 0; +static int gotvhtconf = 0; static void getvhtconf(if_ctx *ctx) @@ -5416,26 +5418,27 @@ end: if (IEEE80211_IS_CHAN_VHT(c) || verbose) { getvhtconf(ctx); - if (vhtconf & IEEE80211_FVHT_VHT) + if (vhtconf & IEEE80211_FVHT_VHT) { LINE_CHECK("vht"); - else + + if (vhtconf & IEEE80211_FVHT_USEVHT40) + LINE_CHECK("vht40"); + else + LINE_CHECK("-vht40"); + if (vhtconf & IEEE80211_FVHT_USEVHT80) + LINE_CHECK("vht80"); + else + LINE_CHECK("-vht80"); + if (vhtconf & IEEE80211_FVHT_USEVHT160) + LINE_CHECK("vht160"); + else + LINE_CHECK("-vht160"); + if (vhtconf & IEEE80211_FVHT_USEVHT80P80) + LINE_CHECK("vht80p80"); + else + LINE_CHECK("-vht80p80"); + } else if (verbose) LINE_CHECK("-vht"); - if (vhtconf & IEEE80211_FVHT_USEVHT40) - LINE_CHECK("vht40"); - else - LINE_CHECK("-vht40"); - if (vhtconf & IEEE80211_FVHT_USEVHT80) - LINE_CHECK("vht80"); - else - LINE_CHECK("-vht80"); - if (vhtconf & IEEE80211_FVHT_USEVHT160) - LINE_CHECK("vht160"); - else - LINE_CHECK("-vht160"); - if (vhtconf & IEEE80211_FVHT_USEVHT80P80) - LINE_CHECK("vht80p80"); - else - LINE_CHECK("-vht80p80"); } if (get80211val(ctx, IEEE80211_IOC_WME, &wme) != -1) { @@ -6029,7 +6032,7 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */ DEF_CMD("-ht", 0, set80211htconf), DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf), - DEF_CMD("-vht", 0, set80211vhtconf), + DEF_CMD("-vht", -IEEE80211_FVHT_VHT, set80211vhtconf), DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf), DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf), DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf), From nobody Tue Jan 7 18:13:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSK1T5qj1z5kwdY; Tue, 07 Jan 2025 18:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSK1T55Jcz4jRQ; Tue, 7 Jan 2025 18:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1+Tdxc2Lejuo9q2Zh7E9x3Xry9ydkQbKoAjmeU4E58=; b=s4c/NhFgNIdAqJ6uHblzsU2hHjjthsj7G3y8y880dVFUghk6L7ePxiUS4wsPqz0g3IiR1A 1Lb7puy2xhTsliaDP7fY/uD8P3i5Rq4GKcs5F0ORXKXSdVadN2gp0gj1xkCVZL69Nw4VpK j09+c1oZ5OucHQYH6vXQ+zoxl+X7jjRhFRL78lItZW8vPa2lKG0wzEO3GKRPs5dheWY9mH UbnNWQtTQhPO8vasPgPrAF9TYk2nwV0JwbTKeMPEabPnTwr0X8Y/qz4/E6NYqnMSHVdzQ9 11fJqsK7J2vGaJ6Biqkdd5GR0UW9ZB8dylqD1tI2vo/Xc79fQB1g3uE2TlsuxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1+Tdxc2Lejuo9q2Zh7E9x3Xry9ydkQbKoAjmeU4E58=; b=lEOVRhuLmt5Icnv8DtlAp/CyItFueo5HHK1CFQeY1qx7OqxFKueagIKaBrg/zUe9PKjKn0 xonMMwRCV46XJ9bYbudxuxFILWCZ96dQgS9EoKsLDAfA87f8TXFh2cIXWRgo7e6JrQLDHt jUXm5aIWmGq2Zru9NSb77RNFiRkjHgKHxbHcdTgjWy9DKbjVBMAlHR9RKAc0VnC1wWKKB5 5hLFmJGUS974FYE8jB62K2hyN6jydjjA6nBGtxMzc6mBxFGpX/nvkEtW5gDsE/fK5iyjtK 7LTmNb4K7/j0YdQ6SeML4efnGUv4epggo27HU5j8RLgeoFfvOPEo9tlEOEZRbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273629; a=rsa-sha256; cv=none; b=oxyTIoRLLDp4FfhaKaOHyKpDElTF0TKIX4P22Bg/Q9WpC/x6m5gtirWU73loFZNTfAa9Ap TusHbAAcomoYTXoarl6V12YONkVXeT27/yXlFvj/2pn49r047Sth8/q2dmI2WjUj1uoxUl vi1OEWheOANokT4IJ2pfCtFL1MJ+sLSpWm/Q3RmL7PiVT+JVTG4HnFyY60U1EmrgSiWKp6 Ur5EpulXX8CoL7+LJcQjX8sjSy/P5yRH32a6YrzBFQUKOum3kOG4NWohcZ+10k4wJS+Ukg 6HjyhlNhlGeVdcGG/heFO7P9WRD1WBOyiqKl+gOty6upm8V4H5yc0f1CK3LfCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSK1T4Ntcz5lr; Tue, 07 Jan 2025 18:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507IDnD7028865; Tue, 7 Jan 2025 18:13:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507IDnCK028862; Tue, 7 Jan 2025 18:13:49 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:13:49 GMT Message-Id: <202501071813.507IDnCK028862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1832eb102e10 - main - net80211: add missing 80Mhz and 160Mhz channel ranges List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1832eb102e10c7f2891c032ecf7b265b75d3cd50 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1832eb102e10c7f2891c032ecf7b265b75d3cd50 commit 1832eb102e10c7f2891c032ecf7b265b75d3cd50 Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 08:02:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 18:13:00 +0000 net80211: add missing 80Mhz and 160Mhz channel ranges We have two arrays, one for 80Mhz and one for 160Mhz. Both were lacking frequency ranges for more possibly available configurations (the other bits of what is valid are for regdomain to set right). Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: 67f4aa3878efa, 04e7bb08a5750 Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48357 --- sys/net80211/ieee80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index ccb7efaa4df5..49d313e5077d 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1196,12 +1196,14 @@ struct vht_chan_range vht80_chan_ranges[] = { { 5570, 5650 }, { 5650, 5730 }, { 5735, 5815 }, + { 5815, 5895 }, { 0, 0 } }; struct vht_chan_range vht160_chan_ranges[] = { { 5170, 5330 }, { 5490, 5650 }, + { 5735, 5895 }, { 0, 0 } }; From nobody Tue Jan 7 18:14:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSK1v5ltNz5kwph; Tue, 07 Jan 2025 18:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSK1v51hsz4jyP; Tue, 7 Jan 2025 18:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXIrgFTELl5VW9Lu5aB7k+FNP7EEZur3AxDfJdtPOS8=; b=x/auKPthV4zCtZDOk4enxAOWybA39z8gydrBrezSEiEF+0EjAyU+SD+9fUDp+QRrPqjbp5 Dk3xL8hN5V2dUn8JJnDnqF8IEu59ybpW1ZbtvMqqbGKNFMFUfJzcCR3bxqWvEI2uxuT5xE XKtTcd3XY6V9ONHps68J5qLcop1wFoIVnNheImhNgHNi+iqaYCohrVlIhglKHo5YHCwUaT DY000JDhByXHCfFljgh0mkQgrQfq2+t3a00Ob+VVEJs4klCxAaTY6ikGbDlMZtHbdF9Nt1 2SfA5fAUG19ZzAb4qN9uwcA1vYEJMr9zgMNlkNBhHom4eAt8grpVvJTe/9Pqew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXIrgFTELl5VW9Lu5aB7k+FNP7EEZur3AxDfJdtPOS8=; b=G9N7dS0eyiAC3bP8GbQFDHY1h9NSrV9+mIXotJuuFCXwwCLwZmImYg6txcp3Ew6fng/stc kfkBqlSTd39aMbrHOue68agd6xhq/5GtG4eLhps+DMB0OZwhXeq5tR8C+uo9Q5dRbuYwzv dzoCImSP/t8szhKe2X3HNlR68LB762gEZtgBT4LNg2lULiQK/rxx4rw7H0hojQJ4bdMIs8 mAzQTPOgdPTLNEIanKfaHSnMHObTWNO+K7U9t+zGL9TkTv5DI8/+NtUCKmnjGUTBdUsqof MTr4Zk+SB09YYu7e72zLxf7huiCKa4+wHKqH3rws+VWnCAxXZFk14zc+t0NGtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273651; a=rsa-sha256; cv=none; b=iZVsw66q5Otrk+pVGnkEws1UEq6BifDuJVX3cvmp7DR5tG0wWyL4AP+RAy4jeYh/NNIYHo Oxzg/SKn4INU9Gzzwt530+Xq76HRrJzwpJNqfCnkGEY/gPrX5lgHQezc9Z29vG0x9p9xNE 4pR7DnwrGcnQ95bjh7E51umQo7QLITR7Rjy+Ic0VnSRL4sk8TkTceTA8N/bJ/BAB2+kmJx NQvm/tpuDbIshrQkmkwhOaleF0vHzJPhtH22dTu8Ovoz5rGnvP1pSzIndz3WT3JLDdffIa GW14xhWifPJ5UVVFzIUu+n9ED1Q3WI5rLPm0Hp1OjqnZfVDaqv+M0DCuQ2Pfgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSK1v4Mp1z5ls; Tue, 07 Jan 2025 18:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507IEBo2029101; Tue, 7 Jan 2025 18:14:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507IEBi1029098; Tue, 7 Jan 2025 18:14:11 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:14:11 GMT Message-Id: <202501071814.507IEBi1029098@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: 254a2b767f9a - main - x86: Short-circuit ipi_all_but_self() on UP systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 254a2b767f9a39f1541e0a07a70bbe269e86ad70 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=254a2b767f9a39f1541e0a07a70bbe269e86ad70 commit 254a2b767f9a39f1541e0a07a70bbe269e86ad70 Author: Mark Johnston AuthorDate: 2025-01-07 17:58:58 +0000 Commit: Mark Johnston CommitDate: 2025-01-07 18:13:54 +0000 x86: Short-circuit ipi_all_but_self() on UP systems Apparently this is required on old intel hw, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275086#c3 PR: 275086 Reviewed by: mav, kib Fixes: 279cd05b7e4d ("Use APIC_IPI_DEST_OTHERS for bitmapped IPIs too.") MFC after: 1 week Diagnosed by: Ben Wilber Differential Revision: https://reviews.freebsd.org/D48361 --- sys/x86/x86/mp_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 493017e303e3..c0da41a4d222 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1425,6 +1425,9 @@ ipi_all_but_self(u_int ipi) cpuset_t other_cpus; int cpu, c; + if (mp_ncpus == 1) + return; + /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit * of help in order to understand what is the source. From nobody Tue Jan 7 18:16:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSK5212sJz5jj1Q; Tue, 07 Jan 2025 18:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSK5161PJz4l5g; Tue, 7 Jan 2025 18:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VW8unMKv5p5QEoj5ddZJND5R4THHJdeHq5wiILGoJ80=; b=nQ7lvo0Oo9A7RHiVu4f7TMqdaOM2eITWmPxk2tjwQuVL26K1TxJsVUFlz4a1LGv3uagmHp wiuRbHQqxDYtzZigYZHUsG5UgZVD1ctQL+pCae6n/yBZETt1EJMlWJNoGymC2QN3/bTJ7r HWZmgMRZlbuXXi77UsH4WrgNWVe3Vj1jlAZ8LPnCSFSjlhAugUxDC75efQGZYIfTgZYrWn yX1G29XyB38YZVGcOL8J2Rze2+N+vnKiOZVfOyZLtlZzurdLhCtdzOxdRYM+zcK4QgJCmg Cba8jGGAfGdhNMbcnF8t8UL4xtttqOPreCW7k19VD61B+mf152GCzisZh4RV2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VW8unMKv5p5QEoj5ddZJND5R4THHJdeHq5wiILGoJ80=; b=VDuoR+z4JcYckFTplewnmISk293WD3xUbS0dzB4jfKjS6tnjNuNcVH3n8xa+v9kRdYNYoc 7UmIQ5rbrR/JjrON81cwXUrRlXvHMANhjteY10R738DOmu0jxL9BMlGbXDjDnkfxYuocFO ddj45/WJuZzY8/OWbXm2IAUh9K8EVyyzWz+CucoVAEZwbsbMJzqVwRdHDKF0YxxrKc1EAP btfN6WWe496NHevVB1r3P9e9CUXj4Hl+u6cT7wC00smzqJfvzFOtAAF905U7hZOc7SMtR5 LSCyogQ+INUcW/AbndWM1J7Sj2f5SunRz8ZKY2QQP26/08d2O3NAnLh/P0R0BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273813; a=rsa-sha256; cv=none; b=FqKuEfndFkNme8Mbj2QTK40VbEbZDH91noMFmgrOE8js9yn+vXr4aFiEHsLkgBwn4x0+aS t50udNM57pTxWAJrlG+63LdFxCc3F9NKoFxrZErSjt+IdjFJHiKFTb5c5AD144kUOcy6t9 Kd8OY532Eb3DPtgqhUAC8KPWoR1oIHk0h0muN6fiBBB1nNcyaIf/2V+hVPRD0vKrXwp86i npVS56oADl6Q5a5ChZe4zGukomEmzsYEtABQiMowtKd/9os1/xCu1AnM7sMBnCEHjmu7xR eqUVLy8COck2h0N941g/BwcWVB5DtLC0k7WXUIGcYUvGXX7svHS2s9tZeXfE0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSK515RR4z5g3; Tue, 07 Jan 2025 18:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507IGrhd030048; Tue, 7 Jan 2025 18:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507IGrR5030045; Tue, 7 Jan 2025 18:16:53 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:16:53 GMT Message-Id: <202501071816.507IGrR5030045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a3a308f0f29b - main - lib80211: regdomain: add the two other 160MHz bands List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3a308f0f29b14d522c56dd88231e27fdf206104 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a308f0f29b14d522c56dd88231e27fdf206104 commit a3a308f0f29b14d522c56dd88231e27fdf206104 Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 07:58:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 18:16:13 +0000 lib80211: regdomain: add the two other 160MHz bands ETSI had one 160Mhz band in regdomain but the other two were missing. Add them. I am always confused that the bands use the center frequency of the 20Mhz edge channels rather than the actual edges so it seems we are only configuring 140Mhz instead of 160Mhz. We will have to go through the entire regdomain file one day and make sure to verify all the power levels. Sponsored by: The FreeSBD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48356 --- lib/lib80211/regdomain.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/lib80211/regdomain.xml b/lib/lib80211/regdomain.xml index 5a432f39ccf6..557af0349cb0 100644 --- a/lib/lib80211/regdomain.xml +++ b/lib/lib80211/regdomain.xml @@ -572,6 +572,13 @@ IEEE80211_CHAN_VHT80 INDOOR + + + 22 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT160 + IEEE80211_CHAN_DFS + @@ -651,6 +658,13 @@ IEEE80211_CHAN_VHT80 IEEE80211_CHAN_DFS + + + 13 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT160 + IEEE80211_CHAN_DFS + @@ -1905,6 +1919,11 @@ 80 20 IEEE80211_CHAN_A + + 5180 5320 + 160 20 + IEEE80211_CHAN_A + 5260 5340 @@ -1958,6 +1977,11 @@ 80 20 IEEE80211_CHAN_A + + 5745 5885 + 160 20 + IEEE80211_CHAN_A + 5180 5240 40 20 From nobody Tue Jan 7 18:18:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSK6m5lZGz5jj60; Tue, 07 Jan 2025 18:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSK6m50VRz4lbr; Tue, 7 Jan 2025 18:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xVZH8ZUljoZDyb/Pyy23l76yYfiLNzmdcgW47Vzi3BU=; b=UKihHsCqF0/CmsTSP4szCMzEiTvw/YsV2HIRyrI7TAjY28qNz3cUt77KRaFh+f61oi8BAB oSJ/gVcPlz9olgjqDvzKxZQ9PDpoaXDNeyJQfIhj4MjP6kZxVIcvjSmp/mikAEnHuSwag4 0ui94fMHtGdMl7o4rbfySPIYjzmd2+XoQQVmG+11Oayjj7ODQPmCSBeoexkvAAt1BiFt6R 7O4+QH2+XyQ3HTg0DGs8Fmh1UnXaWx3Ie4OEVqLE5KbaYEljcknOOW2RllOtXAIuWbK5+Y oxnrqAFBsetIN7T+ZaTQWiI66zl+55eWoOmtLg/RzGVFlp4PllJFwG038JWAnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xVZH8ZUljoZDyb/Pyy23l76yYfiLNzmdcgW47Vzi3BU=; b=l8jbw9YbJXA7bq8bcgGab/fi2QD030Tf7izggo7BbiICCw+a1x0bmaHKbZoMHZfyEz4ewq eygOQvfONroL8XdcsvcmD5J/mTQPeRyumdY0ex9jDvtMlrZNoV2qzCOND4XhZVN/WnmrJ1 TylDQ44tmrX2eGIf9uDcoCu+FDB4qkCOB8bRJYPRxorL2nn165uHiuDiXxIfFF3wWN5W2V VBVRbnMqXbT4VzbaCuJI06dp21ZHZfNQPtsLYN55jcLP49qXoMvQrXjm92iGYqMjlpP6km 2FZmZlxWXVLacWcwdaW7fduopuL9gFZOMuJsWKWkpes0g8RA5wamOh6yjQUZgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273904; a=rsa-sha256; cv=none; b=OO6LaAFisTDnzBLeXZpcYP3dmDNFw9q/RsfnyKR51n9vV8MPHy41ggaXNl9F1j8mwIogY1 ZXtZEJQm5nm1rnlXOlG9pFAcTVNdHbC9H0Tv+1mjXd42jIhPb/J1t4owxa1hPZC2yMFOW6 HQvMXgJJ8mK+p1lRj6a17gdzXeejaCELhKDleF6z+HpwXXtjSqgOT77MYOkL+YHC300hds s8D/URE4T/h5uVl6tkb5FmMG6CBIGnIBLUldcyJhOQ1tlQ58eOBj2j4dP4z3vQe5IvIl4m jkXZjlNs61WiW8TSWei5n+awdQRXbXjsUxRKGcBXjnwISOc3xN32IkaY3xSchg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSK6m4TPMz5lF; Tue, 07 Jan 2025 18:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507IIO9a030835; Tue, 7 Jan 2025 18:18:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507IIOGA030832; Tue, 7 Jan 2025 18:18:24 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:18:24 GMT Message-Id: <202501071818.507IIOGA030832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5fdc4824a5e2 - main - net80211: (v)ht: use macros at hand List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fdc4824a5e2646a07c0638eca9f5c81b0b85fd5 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5fdc4824a5e2646a07c0638eca9f5c81b0b85fd5 commit 5fdc4824a5e2646a07c0638eca9f5c81b0b85fd5 Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 08:06:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 18:17:35 +0000 net80211: (v)ht: use macros at hand Rather than duplicating the manual logic here and leaving a comment, use the self-explanatory macros we already have. No functional changes intended. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48359 --- sys/net80211/ieee80211_ht.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index e2506c1e0ce0..2ec5ffb1a2af 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -1934,9 +1934,7 @@ ieee80211_vht_get_vhtflags(struct ieee80211_node *ni, uint32_t htflags) vhtflags = 0; if (ni->ni_flags & IEEE80211_NODE_VHT && vap->iv_vht_flags & IEEE80211_FVHT_VHT) { if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_160MHZ) && - /* XXX 2 means "160MHz and 80+80MHz", 1 means "160MHz" */ - (_IEEE80211_MASKSHIFT(vap->iv_vht_cap.vht_cap_info, - IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1) && + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(vap->iv_vht_cap.vht_cap_info) && (vap->iv_vht_flags & IEEE80211_FVHT_USEVHT160)) { vhtflags = IEEE80211_CHAN_VHT160; /* Mirror the HT40 flags */ @@ -1946,9 +1944,7 @@ ieee80211_vht_get_vhtflags(struct ieee80211_node *ni, uint32_t htflags) vhtflags |= IEEE80211_CHAN_HT40D; } } else if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_80P80MHZ) && - /* XXX 2 means "160MHz and 80+80MHz" */ - (_IEEE80211_MASKSHIFT(vap->iv_vht_cap.vht_cap_info, - IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) && + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ(vap->iv_vht_cap.vht_cap_info) && (vap->iv_vht_flags & IEEE80211_FVHT_USEVHT80P80)) { vhtflags = IEEE80211_CHAN_VHT80P80; /* Mirror the HT40 flags */ From nobody Tue Jan 7 19:34:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSLp633Zmz5jqKk; Tue, 07 Jan 2025 19:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSLp62K6jz4vqC; Tue, 7 Jan 2025 19:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736278446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=98oLMjtYB82oTwp0FC+URbTgxyQtCRxg41eqr3eem78=; b=gVgh2hQav1zUHZjQS/Vf9hyuesIcTYCwNATQqboUNeBCW65gd7NMLJTME0MsS2ISY881OQ 0o7ThEpvDko6LDnox3aLHx2e2dxn6xZOFMW1w4OpsjlG4grS0nph995BxCz9/scYb0PRdM GgkreICZC/c3KRLOM6oJbjPDsyYFMSWRMhzTfKrqtkwFgvYvlAPyZ8iAbyJpPgUGVZYBWD 4UOe3tsxCRKh8ISVNls3kz8ND6doWATrukyqG7zTSbFzja6MIUOcIkgVMyboICkeFJHOqB k7++s2UirghjyO8wbzyk4xSB4Fkout1cLaaNQgw9zy/KexK02naDkWeLuakNiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736278446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=98oLMjtYB82oTwp0FC+URbTgxyQtCRxg41eqr3eem78=; b=DD6UTgwv7OziSCYuMLOI72/AgYOjl3FnIJSAzq2M9gGjWcRjBFFY8QR1UdJBQkSydIsMO0 5yu7h0Y/GqfLKLyn11iDAyHzoIuuIF7vKh8aEtPtDXnky4EP84eTq1BJf1EPYSJgWnVoUy Q/rVsluwK7DKO5RcS00rDSvm4AKLz7a0MUFxHp8XNJl17k9sQ1DhM+Lfkj0Y8WkEPdE0kK 516UhRUnHB/KF2lNAXZ+9by0GZF7HuhC7nw8ZfKCP8lORj9XiZrz8V/optCW56Vfg9avve ogY2VJYVbhaIt8Yps+MsaUmV9QqGPdf/s24jz2T5/uxh/JpVBONwPff9Ys6GJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736278446; a=rsa-sha256; cv=none; b=nEBbkQyCUIv6IsRCkbUMSJ2V8wK83gTtsxhhDnPw9SC+9NperL08lKoXdZ8p/oXXG6SqeG s2sTyOW437C7zgigN9dUIjdnY4RKCSC4xSS1cnqn2SX4HAmt+SQYuuxIC80nrcNAV1KcM6 RFup2GkeVNKR3amN+vIs0j5mPQuhwAmlCIsYKZE2XwoP+8RFuiO2KKw3CP2QNycCWLH6dG nrwX6x40EOCzjYvpZgcjQqkQvck92GGWwVZCf0eH+GyAhesSro9EhTdb2fXhXBL5dR8w5g xCP6mRyh9UXAx80muAaPzsAkOqi4ndq90has44fMd9rqyjykpJ0xm3zE7yocTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSLp61kwnz8Fp; Tue, 07 Jan 2025 19:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507JY6Hq079386; Tue, 7 Jan 2025 19:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507JY6js079383; Tue, 7 Jan 2025 19:34:06 GMT (envelope-from git) Date: Tue, 7 Jan 2025 19:34:06 GMT Message-Id: <202501071934.507JY6js079383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2c8b0d6205f6 - main - net80211 / LinuxKPI 802.11: correct enum ieee80211_sta_rx_bw List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c8b0d6205f6f98855773e3a82640b50abb2f2f6 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2c8b0d6205f6f98855773e3a82640b50abb2f2f6 commit 2c8b0d6205f6f98855773e3a82640b50abb2f2f6 Author: Bjoern A. Zeeb AuthorDate: 2024-12-29 08:07:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 19:32:44 +0000 net80211 / LinuxKPI 802.11: correct enum ieee80211_sta_rx_bw When moving the enum from LinuxKPI to net80211 it got adjusted to be used in net80211 style in order to use it with a print_mask (%b). Turns out that change broke assumptions given the minimum value of BW_20 no longer was 0. Adjust it back to a plain enum starting at 0 and use an inline function to convert to value names. Pointy hat to: bz Fixes: ca389486a9599768e0ba69dca13c208020623083 MFC after: 3 days Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48375 --- sys/net80211/ieee80211_ddb.c | 4 ++-- sys/net80211/ieee80211_ht.c | 4 ++-- sys/net80211/ieee80211_node.c | 4 ++-- sys/net80211/ieee80211_node.h | 26 +++++++++++++++++++------- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 0050038457c7..05b370eafa38 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -294,9 +294,9 @@ _db_show_sta(const struct ieee80211_node *ni) db_printf("\thtcap %b htparam 0x%x htctlchan %u ht2ndchan %u\n", ni->ni_htcap, IEEE80211_HTCAP_BITS, ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan); - db_printf("\thtopmode 0x%x htstbc 0x%x chw %b\n", + db_printf("\thtopmode 0x%x htstbc 0x%x chw %d (%s)\n", ni->ni_htopmode, ni->ni_htstbc, - ni->ni_chw, IEEE80211_NI_CHW_BITS); + ni->ni_chw, ieee80211_ni_chw_to_str(ni->ni_chw)); /* XXX ampdu state */ for (i = 0; i < WME_NUM_TID; i++) diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 2ec5ffb1a2af..9e047244cc3b 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -2604,8 +2604,8 @@ ht_recv_action_ht_txchwidth(struct ieee80211_node *ni, IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, - "%s: HT txchwidth, width %b%s", - __func__, chw, IEEE80211_NI_CHW_BITS, ni->ni_chw != chw ? "*" : ""); + "%s: HT txchwidth, width %d%s (%s)", __func__, + chw, ni->ni_chw != chw ? "*" : "", ieee80211_ni_chw_to_str(chw)); if (chw != ni->ni_chw) { /* XXX does this need to change the ht40 station count? */ ni->ni_chw = chw; diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index d2a4558970f9..17ddc8533e41 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2672,9 +2672,9 @@ ieee80211_dump_node(struct ieee80211_node_table *nt __unused, printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", ni->ni_htcap, ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan); - printf("\thtopmode %x htstbc %x htchw %b\n", + printf("\thtopmode %x htstbc %x htchw %d (%s)\n", ni->ni_htopmode, ni->ni_htstbc, - ni->ni_chw, IEEE80211_NI_CHW_BITS); + ni->ni_chw, ieee80211_ni_chw_to_str(ni->ni_chw)); printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n", ni->ni_vhtcap, (int) ni->ni_vht_chan1, (int) ni->ni_vht_chan2, (int) ni->ni_vht_basicmcs); diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 1f36ceb368b9..0039c743544c 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -115,17 +115,29 @@ enum ieee80211_mesh_mlstate { * flags. This allows us to keep the uint8_t slot for ni_chw in * struct ieee80211_node and means we do not have to sync to the value for * LinuxKPI. + * + * NB: BW_20 needs to 0 and values need to be sorted! Cannot make it + * bitfield-alike for use with %b. */ enum ieee80211_sta_rx_bw { - IEEE80211_STA_RX_BW_20 = 0x01, - IEEE80211_STA_RX_BW_40 = 0x02, - IEEE80211_STA_RX_BW_80 = 0x04, - IEEE80211_STA_RX_BW_160 = 0x08, - IEEE80211_STA_RX_BW_320 = 0x10, + IEEE80211_STA_RX_BW_20 = 0x00, + IEEE80211_STA_RX_BW_40, + IEEE80211_STA_RX_BW_80, + IEEE80211_STA_RX_BW_160, + IEEE80211_STA_RX_BW_320, } __packed; -#define IEEE80211_NI_CHW_BITS \ - "\20\1BW_20\2BW_40\3BW_80\4BW_160\5BW_320" +static inline const char * +ieee80211_ni_chw_to_str(enum ieee80211_sta_rx_bw bw) +{ + switch (bw) { + case IEEE80211_STA_RX_BW_20: return ("BW_20"); + case IEEE80211_STA_RX_BW_40: return ("BW_40"); + case IEEE80211_STA_RX_BW_80: return ("BW_80"); + case IEEE80211_STA_RX_BW_160: return ("BW_160"); + case IEEE80211_STA_RX_BW_320: return ("BW_320"); + } +} /* * Node specific information. Note that drivers are expected From nobody Tue Jan 7 19:35:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSLqn4Dqsz5jqM2; Tue, 07 Jan 2025 19:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSLqn3bkrz3whT; Tue, 7 Jan 2025 19:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736278533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M+BjByu/7NRk4jFvMkqLreFpzBIUOpygAMHFdolUy/4=; b=XQ62BtQNoz9Agew6+K289HT6tvVI7lpzR5iftgLHknzc86bdFBqit88vX2qyqSc49LKOHN xXGFc9sJTkXSEqFiH7q/bnCMdfbLYfp/kuRbCum+aUEXjcixQ2j/ALCc2q2Ag2aHfTZpru eh7TX2kVHz4572QMhvnlB2QYDBIKJFNxy7X1I9r7UOgBKv9DTrhOKaYrtRGrQ2lbYb+nkF GY9Wb7CE97UM1yKn1PC8IxgsZ09fR2H4BujQBSGmqbDQaDfBMzXZxZGBFJ7eZZ63jvR0qK V9dNuah7R28rW9vUVOYM3MoJy9qOMGnBro4T2ZOgo6zZjX9ha6OybaPSdsA07g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736278533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M+BjByu/7NRk4jFvMkqLreFpzBIUOpygAMHFdolUy/4=; b=Kg5NtoBnSPz+I2SjpIXYQmrS1hJDGQ+jfVU5Cbg+9jypLWMFZHZK0DHFCmfa9HsqcJaaaJ sPBBKzU4SzdW64hgzY/Ur0DieqZohYWWEZizGTHkAPPIS9nT+RNCgqd36jg/pKAzJKzBdh vPU+VAjup79gjRwOjw/4A2EkNg80PFkGK/8V34q7DI5q3GPST+kUiZtEw5tQVXzrQ/WYyp 9NWNG7HA0uGITUhwsZxDH1FPkXdB9xZ04UODKkw0Qo1c0+qcSDtg19G/yZMKs2dU632UZH Fhfs/aoD5gVRGJJtpm1q6/Ivz7Fm89CZGllHLZSCe26w5z5rc8bEy++IOhamxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736278533; a=rsa-sha256; cv=none; b=GKTiBZi8ubyD2GnxWNMwlz1BXlkMl9vm0h/9hW/KdMwVGZXZjXVmt3QaaRmZcEx06rLbkg YY/uYCqDlmCtR6+ihwqW5jMNlA7ejUzjDf4yQVlncgDCLhJ5QeOkyO2sGf8l8y5/ZcNugp WKzknAWZqcai+fP1WNdnpdACgWG9G3HbxBRvM95DtXcrZ7VhTD/p/xuPi5s7Dmvhff+5rR XjicfsPDOH8DW7hD1fvAdjNk7fFa9nEVRPA2NuSKrWnF4KZM3a8vFpCs1gUHQnfGRt+Dey wr+/iNIDp2XJ7Smln9soCrIP1MDU087RNiNlri0DL5YBwMzqFxlBnRc2THMIJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSLqn31PQz81w; Tue, 07 Jan 2025 19:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507JZXuS079960; Tue, 7 Jan 2025 19:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507JZXpt079957; Tue, 7 Jan 2025 19:35:33 GMT (envelope-from git) Date: Tue, 7 Jan 2025 19:35:33 GMT Message-Id: <202501071935.507JZXpt079957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a4cdb785bbd7 - main - LinuxKPI: 802.11: improve the IMPROVE_HT() macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4cdb785bbd7e26cc3f2ed0bb4e5cf7ea83c400b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a4cdb785bbd7e26cc3f2ed0bb4e5cf7ea83c400b commit a4cdb785bbd7e26cc3f2ed0bb4e5cf7ea83c400b Author: Bjoern A. Zeeb AuthorDate: 2024-12-28 10:13:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 19:34:54 +0000 LinuxKPI: 802.11: improve the IMPROVE_HT() macro Let the macro take a format string and arguments and add __func__, __LINE__ to the output. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 8605ec86ad1b..0c4c615d82e5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -78,9 +78,10 @@ if (linuxkpi_debug_80211 & D80211_IMPROVE_TXQ) \ printf("%s:%d: XXX LKPI80211 IMPROVE_TXQ\n", __func__, __LINE__) -#define IMPROVE_HT(...) \ +#define IMPROVE_HT(fmt, ...) \ if (linuxkpi_debug_80211 & D80211_TRACE_MODE_HT) \ - printf("%s:%d: XXX LKPI80211 IMPROVE_HT\n", __func__, __LINE__) + printf("%s:%d: XXX LKPI80211 IMPROVE_HT " fmt "\n", \ + __func__, __LINE__, ##__VA_ARGS__); #define MTAG_ABI_LKPI80211 1707696513 /* LinuxKPI 802.11 KBI */ From nobody Tue Jan 7 22:47:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSR5k4sZHz5k6ft; Tue, 07 Jan 2025 22:47:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSR5k47n3z4JSf; Tue, 7 Jan 2025 22:47:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736290074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xGbllnePdhxG0OXI8hwJ3Yv61fGUrbkoEhaFszxVH1w=; b=QNB7mmqKA6vleySffZAtgpE4B4DTGpxH0TtqiDUDIh+kVzu4ZbMX0J9RGLZXUl9UAcOmgU 6fE+SHGMLVRXNr5jPTuCPi7VKeF9BIM5c2KLi5sagKt1EkvWZ0rC0hEbfbECJSPjtqJIx4 cxoVQ8w5zoOsilc5QdQeC27hTNbiP8k5Wci+iaDkRLKBQpIz/amekhTQUuHcun5Ah1MAaP d03+CwuehjePOMBUmFtpLgqYrWYfP0R+NkhREgXCBciHVNHNVuDDvHO1An+tez13iSdjiW i8YkFiWEvMlGtrPfok0qNoDzT/+U+Pi2kIja4DDMn6QeXEVgXo7hWyRbD7TzeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736290074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xGbllnePdhxG0OXI8hwJ3Yv61fGUrbkoEhaFszxVH1w=; b=eDji284lwQAAsv7c72oU8O24v/pIiGSihROU1fYiT5bdwNzFdSpNk3Cr7641waB4zt+JJd 6/TVquc8HTX1FQu9F+yyX5sLUnC7xibDJH3Uu0UmAIk7p4PdD6M4x9ntzeM9ynqufTA4qe 6wveS+ohTDI3yMLJRt9AIrphTHSS/J6l2XxAX2xm/fhoC32eUyjeIm9kCwbK+jz2jFWWlL REMe7TMNEDlJqY3J/g+hYb0obh48DrLCRA7I22h2iqe+vXziSv6FQLEaO17a4Ub3cdx/3j OdKANZBzi6+bomLVokrULFaViW8EqkpeJptljGmzUpMMYcoGHctvKu9p+PvAzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736290074; a=rsa-sha256; cv=none; b=TcTKsSRmt5erNUiWABNQO/dfXB8XqL08Cc6NzFwuOfLTQr5np/pylgdPSDGBG1ZKIsUZFR 3TD37G788pUIL0LnG0IcDvq8dIb9pjmzYHO937o4rNNQs9PpQaUgxf0m6TlnyAZaIfETTU axd78pDHzK6qyCAEDB3OPPvz3V/81+AWgWfI1oz0Spr6St0akfPPyD62w3K/XwmX1uMy6L ViSqX6+9PpDutZPPY8j7qdN8KOd+/l1BqdZPaAz9NeciUVXSohMCuf5JhzB4B/2yLeexBb ilfCWxtqSj6bsxrf/vHfUciUiXF6Zi3YtX82ezuxz5Egpsx97TGwYAIDzQkZaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSR5k32bLzD7K; Tue, 07 Jan 2025 22:47:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507MlsU6036335; Tue, 7 Jan 2025 22:47:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507MlsLu036332; Tue, 7 Jan 2025 22:47:54 GMT (envelope-from git) Date: Tue, 7 Jan 2025 22:47:54 GMT Message-Id: <202501072247.507MlsLu036332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fd27f86dd71b - main - LinuxKPI: switch jiffies and timer->expire to unsigned long List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd27f86dd71b7ff1df6981297095b88d1d29652e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fd27f86dd71b7ff1df6981297095b88d1d29652e commit fd27f86dd71b7ff1df6981297095b88d1d29652e Author: Bjoern A. Zeeb AuthorDate: 2024-12-28 09:57:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 20:00:20 +0000 LinuxKPI: switch jiffies and timer->expire to unsigned long It seems these functions work with unsigned long and not int in Linux. Start simply replacing the int where I came across it while debugging a wireless driver timer modification. Also sprinkle in some "const". Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48318 --- sys/compat/linuxkpi/common/include/linux/jiffies.h | 28 +++++++++++----------- sys/compat/linuxkpi/common/include/linux/timer.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_compat.c | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/jiffies.h b/sys/compat/linuxkpi/common/include/linux/jiffies.h index bd05a0db0767..8346e74fb830 100644 --- a/sys/compat/linuxkpi/common/include/linux/jiffies.h +++ b/sys/compat/linuxkpi/common/include/linux/jiffies.h @@ -38,7 +38,7 @@ #define jiffies ticks #define jiffies_64 ticks -#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(int)(x)) * 1000 / hz)) +#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(unsigned long)(x)) * 1000 / hz)) #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) @@ -68,7 +68,7 @@ extern uint64_t lkpi_msec2hz_rem; extern uint64_t lkpi_msec2hz_div; extern uint64_t lkpi_msec2hz_max; -static inline int +static inline unsigned long timespec_to_jiffies(const struct timespec *ts) { u64 result; @@ -78,10 +78,10 @@ timespec_to_jiffies(const struct timespec *ts) if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((int)result); + return ((unsigned long)result); } -static inline int +static inline unsigned long msecs_to_jiffies(uint64_t msec) { uint64_t result; @@ -92,10 +92,10 @@ msecs_to_jiffies(uint64_t msec) if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((int)result); + return ((unsigned long)result); } -static inline int +static inline unsigned long usecs_to_jiffies(uint64_t usec) { uint64_t result; @@ -106,7 +106,7 @@ usecs_to_jiffies(uint64_t usec) if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((int)result); + return ((unsigned long)result); } static inline uint64_t @@ -133,17 +133,17 @@ nsecs_to_jiffies(uint64_t nsec) } static inline uint64_t -jiffies_to_nsecs(int j) +jiffies_to_nsecs(const unsigned long j) { - return ((1000000000ULL / hz) * (uint64_t)(unsigned int)j); + return ((1000000000ULL / hz) * (const uint64_t)j); } static inline uint64_t -jiffies_to_usecs(int j) +jiffies_to_usecs(const unsigned long j) { - return ((1000000ULL / hz) * (uint64_t)(unsigned int)j); + return ((1000000ULL / hz) * (const uint64_t)j); } static inline uint64_t @@ -153,10 +153,10 @@ get_jiffies_64(void) return ((uint64_t)(unsigned int)ticks); } -static inline int -linux_timer_jiffies_until(int expires) +static inline unsigned long +linux_timer_jiffies_until(unsigned long expires) { - int delta = expires - jiffies; + unsigned long delta = expires - jiffies; /* guard against already expired values */ if (delta < 1) delta = 1; diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h index 8bea082c3e6c..f9c76222795c 100644 --- a/sys/compat/linuxkpi/common/include/linux/timer.h +++ b/sys/compat/linuxkpi/common/include/linux/timer.h @@ -42,7 +42,7 @@ struct timer_list { void (*function_415) (struct timer_list *); }; unsigned long data; - int expires; + unsigned long expires; }; extern unsigned long linux_timer_hz_mask; @@ -76,7 +76,7 @@ extern unsigned long linux_timer_hz_mask; callout_init(&(timer)->callout, 1); \ } while (0) -extern int mod_timer(struct timer_list *, int); +extern int mod_timer(struct timer_list *, unsigned long); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); extern int del_timer(struct timer_list *); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index ec3ccb16b47d..35cb2fc2f3d7 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1938,7 +1938,7 @@ linux_timer_callback_wrapper(void *context) } int -mod_timer(struct timer_list *timer, int expires) +mod_timer(struct timer_list *timer, unsigned long expires) { int ret; From nobody Tue Jan 7 23:37:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSSBl3LnXz5k9hG; Tue, 07 Jan 2025 23:37:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSSBl16Lqz4Ltw; Tue, 7 Jan 2025 23:37:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-7b6f7d7e128so28375485a.1; Tue, 07 Jan 2025 15:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736293037; x=1736897837; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=7ihSRgA7/ifvdJJ8avXnMfnFD4sLB6o/6k55ckvtuQM=; b=YpwyE4MCvWQI1p5RXRI98wDoAbJKGNAYSWzU91dapX8YdJ/x0tXejf+XIf0GOtjOTh 4sRoB6KlT9UtIakssBX8ndw/9Gvzs5EjdJIyqVCzDdW/Zk5pH+WDNiz8fjvMSzsK9hKi kfm44PS0agGWab2Pl/1+02ZXWJEIFzOOdKRlt+Vcv4lZhmmQnkT38nw6+osxsvjrkj5m pkNPLpYrk1nkbfXotVTnRAmFCRxKgvsg22I6O+Da4PLrRi06rL4GbS83OAthrJCFmniY kEoZI3SNjfqIeYU7nOanvZVhF2bdC8z+/91DQNkfvJ0mwkhQYARXVg+9of4543b3cHMU ilsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736293037; x=1736897837; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ihSRgA7/ifvdJJ8avXnMfnFD4sLB6o/6k55ckvtuQM=; b=sRv3CybEWWwkhatWdl74A6VbPxv8m2m06eaBLYdteJkg/PUhrCPg25G2OMjjRfhrpK pjTkD7H1Jf9c1a0MQQGMXLFrDYOb7WuwZn6zJguVoXt5Z+VQRpE9Jr/upoZ1KttXMXYv RIxMAE/F8rBYaiOs6w57PMNEbYxf/KCYA8I/e1FZ5rgLB3jdZcRTLJFnZFFwDK1LtvcQ wTgKm+NTseaV4l8e3sUno8XTCcN49cugoL5hLAuAZZSuPqxjS/YsEdLwHK4VZjnY480n h2FEvUw0eBAyjvXB3Z6tswMHfYPTd3fu/YxpjHgguaSaFvw8J89wa2/ls4pf7akRyYPr SlUQ== X-Forwarded-Encrypted: i=1; AJvYcCUiAxHEiXj3NH3H7RU83YQC3CiBjjl0PEMUK63OZ7hiqykNoPUFZpZzBPQEdaWlckKNJojGf3ZpQaHrxGJj/B6Glw/JBXg=@freebsd.org, AJvYcCWJnpMG+fivZpi1mTMdschxIebMUhOZU/kZlRPf/xwpTi+qDxU5GWvwWnYrs/RAoBz61C7M+XKny3BiJ846cnhRdnyz@freebsd.org X-Gm-Message-State: AOJu0YxmUW/UbgS8y1HDxinTnZQGSDjKbjx6Dk9CzuLjizJqXWZuOYk8 VAmB9J5kBnYd7osQ0RxtjtDaC6SarfsXC0o50/uPfgzHI9c+nBHtDk4iWg== X-Gm-Gg: ASbGncuizCtv/PfAqseiPQ688UU6ilzq70EC4UcnFa+AUlWZf6Tj4mrk/vr20nA8KSt VBejXmY9BHffym1Ryn1RNr3QvQCItv0Z0HHNZ+pPaHfBU2Ab0r4OP5z+6XGVqDLGcClJGbltnQv T5z4rRU8Ipu8uXH1qBJ9WVKxuR61mTyDFa5B1HYfLI3WXhwJ8sNHK7zsxlRtlMDc+6Vdsl+fWvA 5tEmrdw5mWdhgAbZRfnBxcMiwdAJBzMDHKHXxw9HiDPb2dFvoiFp+94ThS5w7ZlGjjzHZU= X-Google-Smtp-Source: AGHT+IFwp5iIick905ywLQC0ve3V6TVDZHLlJr8M2Dhi9jAzF3av7c0tvajK7RnWtfOThu+kpodQfw== X-Received: by 2002:ad4:4eec:0:b0:6d8:94f4:d2aa with SMTP id 6a1803df08f44-6df8e822bddmr86311196d6.13.1736293035975; Tue, 07 Jan 2025 15:37:15 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dd181bb525sm185598206d6.97.2025.01.07.15.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 15:37:15 -0800 (PST) Date: Tue, 7 Jan 2025 18:37:12 -0500 From: Mark Johnston To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fd27f86dd71b - main - LinuxKPI: switch jiffies and timer->expire to unsigned long Message-ID: References: <202501072247.507MlsLu036332@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501072247.507MlsLu036332@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4YSSBl16Lqz4Ltw X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jan 07, 2025 at 10:47:54PM +0000, Bjoern A. Zeeb wrote: > The branch main has been updated by bz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=fd27f86dd71b7ff1df6981297095b88d1d29652e > > commit fd27f86dd71b7ff1df6981297095b88d1d29652e > Author: Bjoern A. Zeeb > AuthorDate: 2024-12-28 09:57:56 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2025-01-07 20:00:20 +0000 > > LinuxKPI: switch jiffies and timer->expire to unsigned long > > It seems these functions work with unsigned long and not int in Linux. > Start simply replacing the int where I came across it while debugging > a wireless driver timer modification. Also sprinkle in some "const". > > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D48318 > --- > sys/compat/linuxkpi/common/include/linux/jiffies.h | 28 +++++++++++----------- > sys/compat/linuxkpi/common/include/linux/timer.h | 4 ++-- > sys/compat/linuxkpi/common/src/linux_compat.c | 2 +- > 3 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/jiffies.h b/sys/compat/linuxkpi/common/include/linux/jiffies.h > index bd05a0db0767..8346e74fb830 100644 > --- a/sys/compat/linuxkpi/common/include/linux/jiffies.h > +++ b/sys/compat/linuxkpi/common/include/linux/jiffies.h > @@ -38,7 +38,7 @@ > > #define jiffies ticks There is a fundamental incompatibility here: jiffies is an unsigned long but ticks is an int. Historically that was the source of some very painful-to-find bugs in the IB stack, since the difference mostly arises when one has to deal with ticks rollover, a rare event. It doesn't make a lot of sense to me to partially convert some routines to using unsigned long if we're not going to do it everywhere, especially if there isn't a concrete bug being fixed. With this diff, jiffies is still an int, and various macros like time_after() still cast their result to a 32-bit value, so at a glance it seems incomplete. I also suspect that the delta < 1 check in linux_timer_jiffies_until() is now broken. I'd advise against a change like this unless you're very confident in it: it's easy to introduce rare bugs. The real solution IMO is have a native 64-bit tick counter that we can use directly in the linuxkpi layer. > #define jiffies_64 ticks > -#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(int)(x)) * 1000 / hz)) > +#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(unsigned long)(x)) * 1000 / hz)) > > #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) > > @@ -68,7 +68,7 @@ extern uint64_t lkpi_msec2hz_rem; > extern uint64_t lkpi_msec2hz_div; > extern uint64_t lkpi_msec2hz_max; > > -static inline int > +static inline unsigned long > timespec_to_jiffies(const struct timespec *ts) > { > u64 result; > @@ -78,10 +78,10 @@ timespec_to_jiffies(const struct timespec *ts) > if (result > MAX_JIFFY_OFFSET) > result = MAX_JIFFY_OFFSET; > > - return ((int)result); > + return ((unsigned long)result); > } > > -static inline int > +static inline unsigned long > msecs_to_jiffies(uint64_t msec) > { > uint64_t result; > @@ -92,10 +92,10 @@ msecs_to_jiffies(uint64_t msec) > if (result > MAX_JIFFY_OFFSET) > result = MAX_JIFFY_OFFSET; > > - return ((int)result); > + return ((unsigned long)result); > } > > -static inline int > +static inline unsigned long > usecs_to_jiffies(uint64_t usec) > { > uint64_t result; > @@ -106,7 +106,7 @@ usecs_to_jiffies(uint64_t usec) > if (result > MAX_JIFFY_OFFSET) > result = MAX_JIFFY_OFFSET; > > - return ((int)result); > + return ((unsigned long)result); > } > > static inline uint64_t > @@ -133,17 +133,17 @@ nsecs_to_jiffies(uint64_t nsec) > } > > static inline uint64_t > -jiffies_to_nsecs(int j) > +jiffies_to_nsecs(const unsigned long j) > { > > - return ((1000000000ULL / hz) * (uint64_t)(unsigned int)j); > + return ((1000000000ULL / hz) * (const uint64_t)j); > } > > static inline uint64_t > -jiffies_to_usecs(int j) > +jiffies_to_usecs(const unsigned long j) > { > > - return ((1000000ULL / hz) * (uint64_t)(unsigned int)j); > + return ((1000000ULL / hz) * (const uint64_t)j); > } > > static inline uint64_t > @@ -153,10 +153,10 @@ get_jiffies_64(void) > return ((uint64_t)(unsigned int)ticks); > } > > -static inline int > -linux_timer_jiffies_until(int expires) > +static inline unsigned long > +linux_timer_jiffies_until(unsigned long expires) > { > - int delta = expires - jiffies; > + unsigned long delta = expires - jiffies; > /* guard against already expired values */ > if (delta < 1) > delta = 1; > diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h > index 8bea082c3e6c..f9c76222795c 100644 > --- a/sys/compat/linuxkpi/common/include/linux/timer.h > +++ b/sys/compat/linuxkpi/common/include/linux/timer.h > @@ -42,7 +42,7 @@ struct timer_list { > void (*function_415) (struct timer_list *); > }; > unsigned long data; > - int expires; > + unsigned long expires; > }; > > extern unsigned long linux_timer_hz_mask; > @@ -76,7 +76,7 @@ extern unsigned long linux_timer_hz_mask; > callout_init(&(timer)->callout, 1); \ > } while (0) > > -extern int mod_timer(struct timer_list *, int); > +extern int mod_timer(struct timer_list *, unsigned long); > extern void add_timer(struct timer_list *); > extern void add_timer_on(struct timer_list *, int cpu); > extern int del_timer(struct timer_list *); > diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c > index ec3ccb16b47d..35cb2fc2f3d7 100644 > --- a/sys/compat/linuxkpi/common/src/linux_compat.c > +++ b/sys/compat/linuxkpi/common/src/linux_compat.c > @@ -1938,7 +1938,7 @@ linux_timer_callback_wrapper(void *context) > } > > int > -mod_timer(struct timer_list *timer, int expires) > +mod_timer(struct timer_list *timer, unsigned long expires) > { > int ret; > From nobody Wed Jan 8 02:59:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSXgm51Vdz5kRNG; Wed, 08 Jan 2025 02:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSXgm43j8z4cYb; Wed, 8 Jan 2025 02: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=1736305156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0RPr2SrKg674AtO+AZyIhPvzfK5r9ZohxIMxWDvzf9o=; b=Wo76Ho9sJaXIOs2zS94Iio0r38snXhIUEb8AzkhDXwVIgRT30rBu+MCiIGRzDrCH2Ueht3 +9rCS6U00+WZd+gfYohN0ViNo2tbzGuXXLM95yQb3wmNqd1eUoJ6PJCVWMCBudtD9DsKH9 YmUgYdhMy9EbKOy0dNRLUOqBDaTaQUXj0ba6BcetE13VVA7JcWdC1WnUNE6iBdj+COUGAX /wJP42Rb7fGqboIglvIik6sFZSHy/XSWbtz2/A50MfQ2OPpM0Fl0vw6ApihjJwisjbi4K0 4tmgZhfFPiyMC4zAnbaC2dqixU3z1OBQb+bAYooN8YyZBkOAeTPnlllRDYIWxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736305156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0RPr2SrKg674AtO+AZyIhPvzfK5r9ZohxIMxWDvzf9o=; b=bKBsnPKErf7970AyLWrnCKjrvfcNV6sXlJNs75g4voKdy556itkfy+7j0969EyS+dm2+PP eB1C16i89lp+OT6YNrCSA7P29M0ybKlDKQSuXdmlECjonJG+dBP4oHT5vzBjMw6JeKyKP6 qOp3s31SxMnfUromh32tcTP32R0lhEl9wSI8teKuEO8ZPsZqfUeN2oE+2UcnE1qByxq0Qg vw4Ee6T3/8evOW7rvInMiqTRcR5ZcAJArh7J1x/HB/gQm9ljjVQXeEByTtL6PxvU/CDevh vZkHwnf5sId37SdVQGUtHPkqMrKfsn9AiyxYVQnZPpvli4DWvOUNL41VPyAxEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736305156; a=rsa-sha256; cv=none; b=MIok2KdmmvlNfxqBVQjPFRd55O07Js4DFwUMQjIyRPByGX21K+H6Ppx/btfWUChwmuJCUi OO/epKtyg/lvXGqbcq7WIDbK0lUwXfWpYxnAXGOiuR2wjgbRTJVLAWGUEBeSk56NhdCwxQ e1Hcn+UOTiMq74Q936BD/rx+3zKoTGj/73ZrVHRQ6404mNClBuYruP+kaV4opcr3m0IYCi RqHyVG1JDC+xlG9bQeEGRtGjOdLyyd1bmFNDa4nHpWpLTbDQmwtoiDLa7pDZsrEYNlq+PB ZbAbTx056U5mqUvIVjOkBx1ShNb92dkqohXsH/HLqXMrHdVnlbr+M/ZuUk2TDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSXgm2rD4zfDy; Wed, 08 Jan 2025 02:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5082xG7k002346; Wed, 8 Jan 2025 02:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5082xG6U002343; Wed, 8 Jan 2025 02:59:16 GMT (envelope-from git) Date: Wed, 8 Jan 2025 02:59:16 GMT Message-Id: <202501080259.5082xG6U002343@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: d82bfe73a3f4 - main - rtwn: don't set the RTS/CTS primary channel field for RTL8812AU/RTL8821AU List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d82bfe73a3f4f3f38757c2e064047f09629ec7b7 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=d82bfe73a3f4f3f38757c2e064047f09629ec7b7 commit d82bfe73a3f4f3f38757c2e064047f09629ec7b7 Author: Adrian Chadd AuthorDate: 2024-12-16 20:11:16 +0000 Commit: Adrian Chadd CommitDate: 2025-01-08 02:32:42 +0000 rtwn: don't set the RTS/CTS primary channel field for RTL8812AU/RTL8821AU According to the rtl8812au reference driver, this seems to control the bandwidth used by lower-bandwidth frames when transmitted in a higher bandwidth channel. For example, transmitting a 20MHz frame on an 80MHz channel (eg in hostap mode) is doable, but you may want to at least duplicate the RTS/CTS exchange across all four 20MHz subchannels, AND perhaps duplicate the 20MHz frame. I haven't fired this up with a spectrum analyser to see what the result is. The vendor driver doesn't bother with this and it doesn't change performance. My guess is that for modes like AP mode we MAY wantto be able to control the RTS/CTS bandwidth choices rather than letting the firmare do it, but we're not there yet. The rtl8812au code in hal/rtl8812a_xmit.c:SCMapping_8812() has the gory details, but then the one place it's used just has it commented out and 0 (ie "do not care") is always programmed in. Differential Revision: https://reviews.freebsd.org/D48113 Obtained from: https://github.com/lwfinger/rtl8812au Reviewed by: bz --- sys/dev/rtwn/rtl8812a/r12a_tx.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c index 582e6e0ddaf4..336ad75a0b1f 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -56,14 +56,35 @@ #include #include +/* + * This function actually handles the secondary channel mapping, + * not the primary channel mapping. It hints to the MAC where + * to handle duplicate transmission of the RTS/CTS and payload + * frames when the requested transmit channel width is less than + * the configured channel width. + * + * Note: the vendor driver and linux rtw88 driver both leave this + * field currently set to 0. + * + * See the rtl8812au vendor driver, hal/rtl8812a_xmit.c:SCMapping_8812() + * and where it's used (and ignored.) + */ static int r12a_get_primary_channel(struct rtwn_softc *sc, struct ieee80211_channel *c) { +#if 0 /* XXX VHT80; VHT40 */ if (IEEE80211_IS_CHAN_HT40U(c)) return (R12A_TXDW5_PRIM_CHAN_20_80_2); else return (R12A_TXDW5_PRIM_CHAN_20_80_3); +#endif + + /* + * For now just return the VHT_DATA_SC_DONOT_CARE value + * from the reference driver. + */ + return (0); } static void From nobody Wed Jan 8 02:59:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSXgn65c7z5kRbf; Wed, 08 Jan 2025 02:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSXgn3fHRz4cXD; Wed, 8 Jan 2025 02:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736305157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LOUblnmhwHdtVRrLFnORzChKRoZkMk84D4U7gh2K+2I=; b=wU1EjkK+Lhs1fUnmQDR/WUrsZ9w4hDwyJ3cNnh6xMnmn81yLTPoeWGwXPTP63cRnZVzVlb A+ocIpD6CDIyIWh9InLeihPn1ei7yDwrJeiumtzUUbpcTKwF6tSrJwVON/sZn2FtKXYNlv 6B05EJZl538vcwKcN5rKP5JncdlS9lkVRNoSALieE2GDgAlYvoulg8uqV2yjnADzUVPSx6 wJdnn+tB5CfIKPp50emoFiawm098ImSHGCWyXvSi59anAB0sDpJXUTktY65PNqGCkXmu1J cPnTWgsbK07pofChTh/55YsE9+lZ0ziDKBbNhfA+BUEnogeKQ4DuUQqBzS/E2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736305157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LOUblnmhwHdtVRrLFnORzChKRoZkMk84D4U7gh2K+2I=; b=VHfSKKvjFsV7EZZ9JjN4cdOCvwJhfXJ0pEJM5f2p7Cc8W+XUnUtYl3yWjqjVQ3nfWrJVy1 Tqmp0Uufb9bZ6BrTJY7iBFU5HPrKa3TLrli+w1sm/aXxrz/0EBzJRp4BeWYKPMgzx9t0vq PM7bbvl4jlPsIbyiKruRKuYqWhyiANNNArNjaZFLkHQ9H7jS1Ar188vJ2sh4vMEz61G+B/ r9ozGpWyzbLXCUw5glUDXEKFGL9sW4e3pakAaneszmlvTjl/fNYbv4UcAZZewwZvTxMfb7 Jc5jbMoFf8/YZB6g8QNPUn4pCVL9uLF77fGRHHK5+c1kFP7nSsjEv2H6OpdQnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736305157; a=rsa-sha256; cv=none; b=Ny6+tMW6qnngtESjsN5MQkWmRS0NNiv00Bth8OVo+wXHBVh/f+jXwPiFP3+8aJROYJWGIx ys6JYcofZKF8Y8btMo5UV6J80BdXpYZevCA4NJSjBAjBjr3+T7jVjGqLR+/mMUoYmzK9Iw VO7J02U0uj4aecgYu7CbA14NRUEwBHo0Byv/gL3nFzFRtFrx/6+HmBeA/ckb6OwohpB86S 6zik+Tho1ioRIYOAgGeBSGEo+sSW4monqd5lJa2X0q2HhKZ6zfCnv85gsfdqsIfE+2xfXC 7aqWJH5YCIHnkhX5tcXQOib0uVTxWHJbP0NYDdYA/ey+mg/97afxgBm4H13GGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSXgn38gGzfF0; Wed, 08 Jan 2025 02:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5082xHeX002425; Wed, 8 Jan 2025 02:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5082xH1L002422; Wed, 8 Jan 2025 02:59:17 GMT (envelope-from git) Date: Wed, 8 Jan 2025 02:59:17 GMT Message-Id: <202501080259.5082xH1L002422@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: dd58d03a2a46 - main - rtwn: set the maximum A-MPDU size correctly for RTL8812AU/RTL8821AU List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd58d03a2a46dddf2ce661d623224a947751beff Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=dd58d03a2a46dddf2ce661d623224a947751beff commit dd58d03a2a46dddf2ce661d623224a947751beff Author: Adrian Chadd AuthorDate: 2024-12-17 05:36:02 +0000 Commit: Adrian Chadd CommitDate: 2025-01-08 02:32:56 +0000 rtwn: set the maximum A-MPDU size correctly for RTL8812AU/RTL8821AU The vendor driver sets it to 64k or 128k depending upon chipset, along with bit 31 being set in hal/rtl8812a_hal_init.c:SetHwReg8812A(). Differential Revision: https://reviews.freebsd.org/D48118 Obtained from: https://github.com/lwfinger/rtl8812au Reviewed by: bz --- sys/dev/rtwn/rtl8812a/r12a_var.h | 1 + sys/dev/rtwn/rtl8812a/usb/r12au_attach.c | 1 + sys/dev/rtwn/rtl8812a/usb/r12au_init.c | 12 +++++++++++- sys/dev/rtwn/rtl8821a/usb/r21au_attach.c | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dev/rtwn/rtl8812a/r12a_var.h b/sys/dev/rtwn/rtl8812a/r12a_var.h index 182e6b902758..0a76e013b6a7 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_var.h +++ b/sys/dev/rtwn/rtl8812a/r12a_var.h @@ -99,6 +99,7 @@ struct r12a_softc { int ac_usb_dma_size; int ac_usb_dma_time; int ampdu_max_time; + int ampdu_max_size; }; #define R12A_SOFTC(_sc) ((struct r12a_softc *)((_sc)->sc_priv)) diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c index 84bfcfbda0e8..c87bffb4db19 100644 --- a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c @@ -141,6 +141,7 @@ r12a_attach_private(struct rtwn_softc *sc) rs->rs_iq_calib_sw = r12a_iq_calib_sw; rs->ampdu_max_time = 0x70; + rs->ampdu_max_size = 0x1ffff; /* 128k */ sc->sc_priv = rs; } diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_init.c b/sys/dev/rtwn/rtl8812a/usb/r12au_init.c index ac6a599895ac..1bee2c665657 100644 --- a/sys/dev/rtwn/rtl8812a/usb/r12au_init.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_init.c @@ -142,7 +142,17 @@ r12au_init_ampdu(struct rtwn_softc *sc) /* Setup AMPDU aggregation. */ rtwn_write_1(sc, R12A_AMPDU_MAX_TIME, rs->ampdu_max_time); - rtwn_write_4(sc, R12A_AMPDU_MAX_LENGTH, 0xffffffff); + /* + * Note: The vendor driver (hal/rtl8812a_hal_init.c:SetHwReg8812A()) + * also sets bit 31. + */ + /* + * TODO: this should be limited to the peer in STA mode, + * and perhaps the minimum A-MPDU of all VAPs/peers in + * multi-STA / other operating modes. + */ + rtwn_write_4(sc, R12A_AMPDU_MAX_LENGTH, + rs->ampdu_max_size | (1<<31)); /* 80 MHz clock (again?) */ rtwn_write_1(sc, R92C_USTIME_TSF, 0x50); diff --git a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c index 9f0e2c950a1e..175bac8f6fc9 100644 --- a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c +++ b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c @@ -141,6 +141,7 @@ r21a_attach_private(struct rtwn_softc *sc) rs->rs_iq_calib_sw = r21a_iq_calib_sw; rs->ampdu_max_time = 0x5e; + rs->ampdu_max_size = 0xffff; /* 64k */ rs->ac_usb_dma_size = 0x01; rs->ac_usb_dma_time = 0x10; From nobody Wed Jan 8 04:42:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSZyr0bNQz5kZZ6; Wed, 08 Jan 2025 04:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSZyq74Xgz4p6G; Wed, 8 Jan 2025 04:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736311348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+6wAgckLH+oedt3tuEgxLGLcF/xQesGx/T1zOJgymg=; b=uKAQvLFI7SEy3mqYwjrLWC34aI3E6V5th3cJqbMMZqT5KaXUl1SPqSmhUL2VJ0ymklIcrO 22Mg+Lf6H3nCRNBUR7iafGqABGYjdJ4fLzaINSX6w3QkRTj5Bi1urB7PJPd2j8beP4yH4H zCBjXsnhQuBreE7dd0dSwP7SXAm6ueeFZRgnyYt2Fl6Fx+/90aq4k0QIsZgqdcCsJYybRt KkjGmEv/SzNyt/bq8tHNxhS6NC0W6Qc+tMrPEP3u79OBLaycCHj9OnTneoK5DI+daAvFTR bBRKbCS1crkCqRmy1grQlQnj9xLdhpgaTl66sT7K90UkepWIBqa0Vm95JxgyJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736311348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+6wAgckLH+oedt3tuEgxLGLcF/xQesGx/T1zOJgymg=; b=PAD5Dg5nL/zYBmmG32T5d55tvuxfYk0mZibh9llg9VzXSq2hZTWqOOmZJIEseCDJ7WdJIr tzMomdrK3bqyj+AlZAE6NtHsfyEYlfm4DFPujbpOPe1WbHzpgdOZV9A7Fmju1qyv1VEd20 SjlUbXIQXwWhRmS7ma+IZAEpCvoc6MD0MnwkbVi61ud54cqmu0zY+a9MzrkzXqjXnskp2W xE/m0etgAVCKoWx/fMrhTkJMJMEt9U9TuLSs6cCbD7SwNKg4lMkJYI48vDQW49oP+0e+nG r9FkR78GcQMeAIulcaioNoce2w1/V9pBB3+87kW60TcIDVHXBmwkx0u9YiaMAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736311348; a=rsa-sha256; cv=none; b=QWrC2UrwMAJLo5YFNJR0MR7USZkPfM806ZuhCUv678lBd+CNwp9h1UK1J6ZZyc4YfjYqRU bRUmM6prgQex8j1nyDOEmXvea0JuNtgv4kTS/8FkuBA6s+ue/srO/I8PpCWxohJXGtKVI4 We31YSQ3ieDNMThMCa24Ixw8g5RZRnRmPZeE7EzUwPeQz9fT64QowKBjmCfsLtxmnZ8nq4 7hMAUqcWLzRSwNLWkbc8g/nNw7AuHj6AS6d/j8AFytjjtoWutlM5tcZZgghRnssDUNpzJ/ tEuRPMd4lsF6z1ubRvtAGEFHQn5a3YJUFBtBZ88O06hKC7Oa7dbcu1RfA5gYAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSZyq6hFQzhg5; Wed, 08 Jan 2025 04:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5084gRBh007517; Wed, 8 Jan 2025 04:42:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5084gRup007514; Wed, 8 Jan 2025 04:42:27 GMT (envelope-from git) Date: Wed, 8 Jan 2025 04:42:27 GMT Message-Id: <202501080442.5084gRup007514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 7f8f120439b7 - main - libmagic: Unbreak for older FreeBSD releases. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f8f120439b77e60a1070d87f4dc6cb9a43d0335 Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7f8f120439b77e60a1070d87f4dc6cb9a43d0335 commit 7f8f120439b77e60a1070d87f4dc6cb9a43d0335 Author: Xin LI AuthorDate: 2025-01-08 04:42:16 +0000 Commit: Xin LI CommitDate: 2025-01-08 04:42:16 +0000 libmagic: Unbreak for older FreeBSD releases. byteswap.h is introduced in FreeBSD 13.2 but was not available in earlier versions. In order to support upgrading from an earlier FreeBSD release we would need to tell the build system that fact. PR: bin/273736 Reported by: philip MFC after: 3 days --- lib/libmagic/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index 12cd382ab9bb..d642880d6096 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -1,6 +1,9 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +/* FreeBSD */ +#include + /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ @@ -21,8 +24,10 @@ /* Define to 1 if you have the header file. */ #ifndef __APPLE__ /* Cross building tools on macOS */ +#if __FreeBSD_version >= 1400079 || (__FreeBSD_version < 1400000 && __FreeBSD_version >= 1302500) #define HAVE_BYTESWAP_H 1 #endif +#endif /* Define to 1 if you have the header file. */ /* #undef HAVE_BZLIB_H */ From nobody Wed Jan 8 05:33:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSc5b6NNqz5kdPh; Wed, 08 Jan 2025 05:33:23 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSc5b5M1gz4rXk; Wed, 8 Jan 2025 05:33:23 +0000 (UTC) (envelope-from philip@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736314403; 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=yZp7pIvRRB6gDuzu5+Y6ZkKbZmBysTqY8w6ggInit/Y=; b=RYHMdfgktHCpRO5OvbM+LSHKkl0JMcDaarB9I92pUAoFSRA4sAFwBAVZKtfaHz7AIJU64q Nu9aID0S+ppMpyGTt3ija0aRD8jr7GkUbKy2QeV9+r6AkOUIJmU8I08DMy3y4CiPm142YK GKyOOKcIljRU2koGcNopj0x/wdm5nQmp7yz5ag0pGj93/9wJ7Q7yJs2ANPr+y2CR3lLdLe YZ8Kqm/sG1ZxwwKmw7v1cfETmIMwFQGCM2Rc1GcW5aR3g8URnDU2XoqoCZ6VWg+u+CBdgn WhwuEZ50w2BG2snxDKTVVk9f6zJazry966peiKAwFbX5MI7UPYA1VV40uWe96g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736314403; 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=yZp7pIvRRB6gDuzu5+Y6ZkKbZmBysTqY8w6ggInit/Y=; b=hh73b9V1aGEV4AuBMRN8Gwx0a330Ls2KiwWx4FuAc4QeILkh/Na20T4A7DmVPedF3aC/oG m3r0Kz1G8GtxbRSR7L26msA7dPQvmpMpQ1QmtObQ8LadPsNwDFEwOvHZNg6AfTd6E8k+Yr rctrcQ4PJjH+b0I8r4/+gJ6/rcXf5tbs24rmKL0b7XoULBhkDPF653h1C4YYZizAtG0EwC mFgzktbd5+samQMk2rsjlJNaEMI76pcN+bPbcpf79vMEOo7eAP2kM004b7kvPPTqc2mbOm KLMb8y1GnJM44kXzesOvNlN391wtf/3+DQkYtzh1yhqiVDDvaj6tQbppT3A45A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736314403; a=rsa-sha256; cv=none; b=a6mb/1pSGP/VAjIyxMhJR9jtXyNx1bpR1TGG50N7yCz9py9l+qRx0BTiGtxbPF73lYmost YjHB10CKPKGxDUsVkdQyRm7Kd9ZnCv1qppeRYWAw7Sa6c1CyxuQdr02QsfPct9Qa6T9f17 BKtEWOYfem9AOsqfmlL8gbqS+UQOkfZL9ch0PtXeV3DBPnyBtxfTXxOVtRuXOtDsgtXCJU umgYg9Fh+UL2aEMn3nZPZSS6SLdB9cprggfGpzYpCELgpCsGPygSYSS/TSLfhFYvA0+JYY vU1YzKtmWNPpvRTcHlnx/kEJgtlbwTab+13PM20GFSddmkSG2XnvB5B6J796HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com [103.168.172.201]) (using TLSv1.3 with cipher TLS_AES_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: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YSc5b44phzKf2; Wed, 08 Jan 2025 05:33:23 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfauth.phl.internal (Postfix) with ESMTP id 2791E1200068; Wed, 8 Jan 2025 00:33:23 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Wed, 08 Jan 2025 00:33:23 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegfedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffoffkjghfgggtsehttdhmtdertddtnecuhfhrohhmpefrhhhilhhiphcurfgrvghpshcu oehphhhilhhiphesfhhrvggvsghsugdrohhrgheqnecuggftrfgrthhtvghrnhepgffgfe eigeettdeltdfgvedtffdtgedvheeuieetheetfeeifeevveetvddvkeegnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpodhmvg hsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeiiedviedvgeekqddvfeehudek tddtkedqphhhihhlihhppeepfhhrvggvsghsugdrohhrghesthhrohhusghlvgdrihhspd hnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeguvghl phhhihhjsehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepshhrtgdqtghomhhmihhtth gvrhhssehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepuggvvhdqtghomhhmihhtshdq shhrtgdqrghllhesfhhrvggvsghsugdrohhrghdprhgtphhtthhopeguvghvqdgtohhmmh hithhsqdhsrhgtqdhmrghinhesfhhrvggvsghsugdrohhrgh X-ME-Proxy: Feedback-ID: ia691475d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jan 2025 00:33:21 -0500 (EST) From: Philip Paeps To: Xin LI Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7f8f120439b7 - main - libmagic: Unbreak for older FreeBSD releases. Date: Wed, 08 Jan 2025 13:33:19 +0800 X-Mailer: MailMate (2.0r6204) Message-ID: <49ED220E-FDC4-4CA6-9E42-1FE31D52DBA2@freebsd.org> In-Reply-To: <202501080442.5084gRup007514@gitrepo.freebsd.org> References: <202501080442.5084gRup007514@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain On 2025-01-08 12:42:27 (+0800), Xin LI wrote: > commit 7f8f120439b77e60a1070d87f4dc6cb9a43d0335 > Author: Xin LI > AuthorDate: 2025-01-08 04:42:16 +0000 > Commit: Xin LI > CommitDate: 2025-01-08 04:42:16 +0000 > > libmagic: Unbreak for older FreeBSD releases. > > byteswap.h is introduced in FreeBSD 13.2 but was not available in > earlier versions. In order to support upgrading from an earlier > FreeBSD release we would need to tell the build system that fact. > > PR: bin/273736 > Reported by: philip > MFC after: 3 days Thank you! Philip From nobody Wed Jan 8 07:58:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSgJg3nW1z5jtbp; Wed, 08 Jan 2025 07:58:11 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSgJg1pXnz46l1; Wed, 8 Jan 2025 07:58:11 +0000 (UTC) (envelope-from bz@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736323091; 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=VivsH7xDwoJwveQMRly1xeFYc/9QpDi1za7Fx30NXeg=; b=f+dvBSNxaJ0BUi5Et6jMzZ1Dh9VLoaGiUWIfaGvBUpwHvDPyEpiRgLx0ojOthR2DNC+rAL o1Ev4qTDv1JD7h/E6XfD2pDPaQ1Ic+jJ5t8eJE6eMVN++6xY//H1jG5Xj4nShyNpwHE9jz uUAcRX0p6fLtH2NQKSjTnb+cossf3+XxZbYKkDnEElgf6MLCxk2iiG7hoca63DKiBykfLn cl1ZKvgqEfTo/Q1Sn3Xxj8cOQQZiAgOdPTH2dEkAFvoyUreLR1zCBZoK1hueXnj1TdNipA Pq8iHW7rSjdQOpCpQ+hrYMUckqxOORxewd/Q8Iysp0r+/GyAKDU7mRppBv170g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736323091; 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=VivsH7xDwoJwveQMRly1xeFYc/9QpDi1za7Fx30NXeg=; b=KuX6XiNn3yIRC87wRkMkM4bBUz0e/PTIXohf/iGIRllznAHBItdqbJ84hDRPq0o7J/Phd+ /Mrh1Yvs+EKqdCsXTtx+aY9adGSK4PCJvCQgzhik0aRTXQB1TYJvoNOYa8iM+Oie1UGBUC KqrK9lvc+giz1HTV3/jFrUraKqmEYL87DwNSNKD2z4PV80jawUg2PUKrOGLHfrny7sSnrZ DSs/q1LloUnHWFMi/ma4j2bui1B2Pa623rsUdXYB+O9Dvsg3VPyJZ7J3TdL6bsHn4oMrAr 2+kkerK8SyARdEuP8fwugGySpVzlQoa4dY0NBym5mL4K33RlHn9QIwEU/Cj2dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736323091; a=rsa-sha256; cv=none; b=I8nvjtlm4UuM58A1unwazM0ZOu9F2KFrrDP2gH3Fdyxf/jBnKxX5fpCAt3pWVPX3sFUMJs FJcmsrgLa5rB3Ff2muiRQK6zSQrWobgApgiM9mLCuLmWb1S3R1XmEEm3VQwEwVVALwLY8A xfUasNQdk28ozqbHKsA3aOXyXF+GGlsJo5XAKTPIqVC9uA7OlU9EU/oIMkM/siImS68VLX 9A86vzgheVCoglEqPGea4DDNSxQqbK5GeBSPJ9CYnsFieHTApizOpyHTFlAlblh9rBDaI7 rzrI9Yx9xLF4v4gtkmVFrveI+WUMcYZbxYFuJ/2JvnWlUtCMG2XYD+ESqtXHow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YSgJg0HHnzL9Z; Wed, 08 Jan 2025 07:58:11 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 998DFA64805; Wed, 08 Jan 2025 07:58:02 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id EFC342D029DD; Wed, 8 Jan 2025 07:58:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id rnjTsAIIKWod; Wed, 8 Jan 2025 07:58:08 +0000 (UTC) Received: from strong-aiccu0.sbone.de (strong-aiccu0.sbone.de [IPv6:fde9:577b:c1a9:f491::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 965562D029D8; Wed, 8 Jan 2025 07:58:07 +0000 (UTC) Date: Wed, 8 Jan 2025 07:58:05 +0000 (UTC) From: "Bjoern A. Zeeb" To: Mark Johnston cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fd27f86dd71b - main - LinuxKPI: switch jiffies and timer->expire to unsigned long In-Reply-To: Message-ID: References: <202501072247.507MlsLu036332@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Tue, 7 Jan 2025, Mark Johnston wrote: > On Tue, Jan 07, 2025 at 10:47:54PM +0000, Bjoern A. Zeeb wrote: >> The branch main has been updated by bz: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=fd27f86dd71b7ff1df6981297095b88d1d29652e >> >> commit fd27f86dd71b7ff1df6981297095b88d1d29652e >> Author: Bjoern A. Zeeb >> AuthorDate: 2024-12-28 09:57:56 +0000 >> Commit: Bjoern A. Zeeb >> CommitDate: 2025-01-07 20:00:20 +0000 >> >> LinuxKPI: switch jiffies and timer->expire to unsigned long >> >> It seems these functions work with unsigned long and not int in Linux. >> Start simply replacing the int where I came across it while debugging >> a wireless driver timer modification. Also sprinkle in some "const". >> >> Sponsored by: The FreeBSD Foundation >> MFC after: 2 weeks >> Reviewed by: emaste >> Differential Revision: https://reviews.freebsd.org/D48318 >> --- >> sys/compat/linuxkpi/common/include/linux/jiffies.h | 28 +++++++++++----------- >> sys/compat/linuxkpi/common/include/linux/timer.h | 4 ++-- >> sys/compat/linuxkpi/common/src/linux_compat.c | 2 +- >> 3 files changed, 17 insertions(+), 17 deletions(-) >> >> diff --git a/sys/compat/linuxkpi/common/include/linux/jiffies.h b/sys/compat/linuxkpi/common/include/linux/jiffies.h >> index bd05a0db0767..8346e74fb830 100644 >> --- a/sys/compat/linuxkpi/common/include/linux/jiffies.h >> +++ b/sys/compat/linuxkpi/common/include/linux/jiffies.h >> @@ -38,7 +38,7 @@ >> >> #define jiffies ticks > > There is a fundamental incompatibility here: jiffies is an unsigned long > but ticks is an int. Historically that was the source of some very > painful-to-find bugs in the IB stack, since the difference mostly arises > when one has to deal with ticks rollover, a rare event. > > It doesn't make a lot of sense to me to partially convert some routines > to using unsigned long if we're not going to do it everywhere, > especially if there isn't a concrete bug being fixed. With this diff, > jiffies is still an int, and various macros like time_after() still cast > their result to a 32-bit value, so at a glance it seems incomplete. I > also suspect that the delta < 1 check in linux_timer_jiffies_until() is > now broken. > > I'd advise against a change like this unless you're very confident in > it: it's easy to introduce rare bugs. If I'll back it out (and deal with the conversion elsewhere as needed) would you write a follow-up comment of your knowledge and add it to jiffies.h so we can avoid this in the future? > The real solution IMO is have a > native 64-bit tick counter that we can use directly in the linuxkpi > layer. -- Bjoern A. Zeeb r15:7 From nobody Wed Jan 8 08:33:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSh5T5K9vz5jxg8; Wed, 08 Jan 2025 08:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSh5T4W3Sz4BL7; Wed, 8 Jan 2025 08:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736325213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cohj+Y6D1u3sKkMOoeLZoWIB6XVLKdA8peV/fKzjGmc=; b=jwnhK6rJuQL3SSwaK8OqkJZvPAxDtUp5zsT33Rk4ikqyILl9UWhE73DsHUCi8hhccvoj4R KPOJpMfyKyo1RICJxujnu8pFlgc6ECS3BieIOK79+lSnUbAFQGYAh5xA4xOCrdQ1oq75aK JmkwdAdNCUJ0c9wxqw/a0+KNqFgQKphTUUS/pUt/PBnmmfd+jefnvhxXjyr2p5J5AKUQqE RNDDIcGLawp4/ZUZwc3igDyNeIF/Ohi0zIrj0PFnkZ3r25qr7P4Nv8AoedGhFXttjyI5DO K6YGM1c5ZQQCu/UX1PgPB1+c4z63LGzbopL+W7Tmz4S38/SGiiWTSEmEqKMHUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736325213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cohj+Y6D1u3sKkMOoeLZoWIB6XVLKdA8peV/fKzjGmc=; b=YZHeZ+yjDsxPQmoxzIRh/qtXUUlU65K8JM3gFwHNfH0F6afbFhy/LCQawCYtRSC/BZhLPu Lzg1oC8slpITy1LV+57xYQbHspglCKrRIHML/5mj9jTh5OKrWqr0XVGH0kHYYvnWKqDx8i k3EDlZeKhK+17W0vH7N7PQoyH1IqzFD1n5wL0+s47o5rCm+roBY4wYCPm3LeGP0jOjreQV QKcp783n1sMAHLm2vvjCoFi6Lz3Fgxj7c/1d+Ga+ShSTdYjM9vaICWkSNq4BiymHuA7cLU nXS7GgFEBe7wWD1dm4Fv/3/ZZVpew25EwuZglqn6t0JIiJrhAautQfR0u/im6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736325213; a=rsa-sha256; cv=none; b=CkRvbeuYdAycN1OZ9nfYPfxH1sF8sbxBGupMrblL3/qXWDxx1LcthrbDH/VhJ9DR04/JQp nsPUCGTj+vvoaPsw0YpTFEI2oYsoOxX+6luZIqxEaGmWMC+3KCVCC39wcZQ4wlladyxg56 y41OLMA1MjkqekbH4Si0RD/b0hltxmzUCBBJkxKcAzU6iWG3fE5dGI8+88IadyOASM0Pm8 tJxht6L2MkpEqocW4dZn20Mxhr5w6nOI3aIqTAMSP8eyad+DgATFN3cIK9R/TPLVTfQ5cR IfxDlV8JW4sTBgoTCpt4DfYUjg7h4X4tTCp4wmWCEa8g1oFGtMBbjNGlPzuBSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSh5T3wmgznj7; Wed, 08 Jan 2025 08:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5088XXLu035623; Wed, 8 Jan 2025 08:33:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5088XXUt035620; Wed, 8 Jan 2025 08:33:33 GMT (envelope-from git) Date: Wed, 8 Jan 2025 08:33:33 GMT Message-Id: <202501080833.5088XXUt035620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2bb0efbb7b64 - main - Revert: LinuxKPI: switch jiffies and timer->expire to unsigned long List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bb0efbb7b64fa957d46d4f443b000f375fc03d4 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2bb0efbb7b64fa957d46d4f443b000f375fc03d4 commit 2bb0efbb7b64fa957d46d4f443b000f375fc03d4 Author: Bjoern A. Zeeb AuthorDate: 2025-01-08 08:30:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-08 08:30:14 +0000 Revert: LinuxKPI: switch jiffies and timer->expire to unsigned long There are possible problems when jiffies (ticks) which still are int wrap around. Also given this did not touch every single place some checks may be broken now. Reported by: markj This reverts commit fd27f86dd71b7ff1df6981297095b88d1d29652e. --- sys/compat/linuxkpi/common/include/linux/jiffies.h | 28 +++++++++++----------- sys/compat/linuxkpi/common/include/linux/timer.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_compat.c | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/jiffies.h b/sys/compat/linuxkpi/common/include/linux/jiffies.h index 8346e74fb830..bd05a0db0767 100644 --- a/sys/compat/linuxkpi/common/include/linux/jiffies.h +++ b/sys/compat/linuxkpi/common/include/linux/jiffies.h @@ -38,7 +38,7 @@ #define jiffies ticks #define jiffies_64 ticks -#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(unsigned long)(x)) * 1000 / hz)) +#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(int)(x)) * 1000 / hz)) #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) @@ -68,7 +68,7 @@ extern uint64_t lkpi_msec2hz_rem; extern uint64_t lkpi_msec2hz_div; extern uint64_t lkpi_msec2hz_max; -static inline unsigned long +static inline int timespec_to_jiffies(const struct timespec *ts) { u64 result; @@ -78,10 +78,10 @@ timespec_to_jiffies(const struct timespec *ts) if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((unsigned long)result); + return ((int)result); } -static inline unsigned long +static inline int msecs_to_jiffies(uint64_t msec) { uint64_t result; @@ -92,10 +92,10 @@ msecs_to_jiffies(uint64_t msec) if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((unsigned long)result); + return ((int)result); } -static inline unsigned long +static inline int usecs_to_jiffies(uint64_t usec) { uint64_t result; @@ -106,7 +106,7 @@ usecs_to_jiffies(uint64_t usec) if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((unsigned long)result); + return ((int)result); } static inline uint64_t @@ -133,17 +133,17 @@ nsecs_to_jiffies(uint64_t nsec) } static inline uint64_t -jiffies_to_nsecs(const unsigned long j) +jiffies_to_nsecs(int j) { - return ((1000000000ULL / hz) * (const uint64_t)j); + return ((1000000000ULL / hz) * (uint64_t)(unsigned int)j); } static inline uint64_t -jiffies_to_usecs(const unsigned long j) +jiffies_to_usecs(int j) { - return ((1000000ULL / hz) * (const uint64_t)j); + return ((1000000ULL / hz) * (uint64_t)(unsigned int)j); } static inline uint64_t @@ -153,10 +153,10 @@ get_jiffies_64(void) return ((uint64_t)(unsigned int)ticks); } -static inline unsigned long -linux_timer_jiffies_until(unsigned long expires) +static inline int +linux_timer_jiffies_until(int expires) { - unsigned long delta = expires - jiffies; + int delta = expires - jiffies; /* guard against already expired values */ if (delta < 1) delta = 1; diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h index f9c76222795c..8bea082c3e6c 100644 --- a/sys/compat/linuxkpi/common/include/linux/timer.h +++ b/sys/compat/linuxkpi/common/include/linux/timer.h @@ -42,7 +42,7 @@ struct timer_list { void (*function_415) (struct timer_list *); }; unsigned long data; - unsigned long expires; + int expires; }; extern unsigned long linux_timer_hz_mask; @@ -76,7 +76,7 @@ extern unsigned long linux_timer_hz_mask; callout_init(&(timer)->callout, 1); \ } while (0) -extern int mod_timer(struct timer_list *, unsigned long); +extern int mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); extern int del_timer(struct timer_list *); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 35cb2fc2f3d7..ec3ccb16b47d 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1938,7 +1938,7 @@ linux_timer_callback_wrapper(void *context) } int -mod_timer(struct timer_list *timer, unsigned long expires) +mod_timer(struct timer_list *timer, int expires) { int ret; From nobody Wed Jan 8 09:34:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSjRg3p5Kz5k49H; Wed, 08 Jan 2025 09:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSjRg2yF2z4Hg8; Wed, 8 Jan 2025 09:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736328863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/NUE0WGuhN4tuqocUr+FQWKydC7DO0ZbEcAkpswtoR4=; b=WL1OykJ7ZX3aYOCNEjOWGiXh9yeNKKc8czHV++JhFtSA3XKIQP7rLVmLvy5iYsmJOqW2BZ kMjlzWctUmFm8N7gWkIuEknfwK6j70CERazWFUXsYXO1B1v1ny+xy4IvuT93jANa+FV9Gp 7aJnluBZahLsiQXv0CaWwFQsrdYKBAxGbWpOrB/nnYnP0h/lDVnGjPZmTxQo9ls7/ZP+KP JGEkAq8JuexWXei9kWI9lgExtN2rAL2yVNEPHltX2v3A+8FclP5epL/f4dFAmYFk93nEYH itBIbHVNfpYJqiNWkgotHJhgS6NS+v7myYZ/vyMCHvDvA8sjcPDOSzvfsaB5Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736328863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/NUE0WGuhN4tuqocUr+FQWKydC7DO0ZbEcAkpswtoR4=; b=yVfz2vmaWap0D/XQ8DQWkttFMrT2O56DnilWq9BTwv8OtG9ssNS7CEV+ASYp4NUTvtHpUY 5SCwAGPWWGhxH5r3qTE94x3Xkru1LPhjF9PD8qZqJG8Wud70YU3QFyAhBWcZMGZaGkPjlG DZk1TcpvbSTnUA+EJL7DHLuXNiE7pnLC9KVGnrZriKWXeg5UCYLWcO7AuV6wEm1YHd1rti h6qk2aOl8J0+zj4VUdAEMA4ZjYCDz0FU2jOjCVT+9eOStIMo8ZmrjXhEBbjUSD2GeR682i r55yHCmpBQELdzkNdzQ7FWa7iAPXcQr2V8LbBaNCj+T4PW+iinSdtW/UJrL6TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736328863; a=rsa-sha256; cv=none; b=ER1enArnL9mNmKa+KEJZt0CJGN5Xg02cWWBinHsVHYEIyUl/lVMvUbsZ6wCXl5kwdy999T 9jgXCz6GIOqqEhPCyvcTvXz7tN2KiTfRnPh81mt6ofx/MtXMIZ3jpsuy8HNKqscQK9uzJQ 9SRJlmtziUNOkMqkQ3qom4Tf5wmZ92sxaJqKKjfeMRTXmMtSMPmxD7daOiI1cy55zBoB67 K5YRX4JxycG6YQP6h2CgxfQyNfGRAo2WkFmU9EcUHvenyEgavgNvKz8Hu/WBQQmrMdz4sp JhvuoIU6pEJlY2ap9IDW8Tj3pVrJ5C2/aX7Cql4wYHx/PIPewu4SISh4S6e/Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSjRg2YxjzrDm; Wed, 08 Jan 2025 09:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5089YN3d047904; Wed, 8 Jan 2025 09:34:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5089YNgr047901; Wed, 8 Jan 2025 09:34:23 GMT (envelope-from git) Date: Wed, 8 Jan 2025 09:34:23 GMT Message-Id: <202501080934.5089YNgr047901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cad1d13af789 - main - dts: Bump the freebsd branding version to 6.12 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cad1d13af789b82d829923795cccbf37cdf93b51 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cad1d13af789b82d829923795cccbf37cdf93b51 commit cad1d13af789b82d829923795cccbf37cdf93b51 Author: Emmanuel Vadot AuthorDate: 2025-01-08 09:34:06 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-08 09:34:06 +0000 dts: Bump the freebsd branding version to 6.12 --- sys/dts/freebsd-compatible.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dts/freebsd-compatible.dts b/sys/dts/freebsd-compatible.dts index 7d602f70a83b..ffdc2e542a22 100644 --- a/sys/dts/freebsd-compatible.dts +++ b/sys/dts/freebsd-compatible.dts @@ -1,3 +1,3 @@ / { - freebsd,dts-version = "6.8"; + freebsd,dts-version = "6.12"; }; From nobody Wed Jan 8 18:18:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSx4B25FCz5kv5N; Wed, 08 Jan 2025 18:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSx4B12m2z4Dl1; Wed, 8 Jan 2025 18:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfeE139so1ElQhnTqtHPdvWMMxZtafJdNvkfOihxRG0=; b=JU2clyWRKo6Ds7YqrqEbdmLSUk4Z8ZqOjIxaKA/76uOSTK38Sa282tp8VUeVpUG/mCSfoI wphFidRAxerZlkzE+rFDFvcZOKj0nhrEtTk0Xe3/B55Pl9FqIxi1YQmGnkaGqW9hVPt6PW WHPph8u/HyD321EPNFUyFnGioBFrd24W7pwctUaeV9AQproWrRV4gww8+mL6D1FZpkP1lo 3YHyHHfbWPXVCxLtN4K/abdtEM2XHE6vhB9MYDGzdh98r2mr1dTGRD1jFJ9ZTNHLZpka5+ 22HkZhTwF4y87O7064Ccz0cqDSxU/+r9h3/e+rqqqLwPIrH/QDrbeG++qUmdpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfeE139so1ElQhnTqtHPdvWMMxZtafJdNvkfOihxRG0=; b=wagomXZL3sN1jOEAO4FGs/SGQZciX+e+7asLzUxl5FcLLUQyDgEYnaj4NtqgEYAK2mdrFf Zbtx1+T7UKi2JCJhkJel4oxnYJtQvzFqBRBVY+52TD+bkzShckXQj+ehL6aDagTjGFYh1z 4uwHwTGZYyRGzjrwFEMptMkucB2fzkSvLB/cWTE4nzN/nqCEeUB2/9l4vo0Ff6GJwplK8b jpp10mYGYPwf3IJ8NuEpxgj6tugJFCOleY6zAM2Yr4v6QLZqxr+h+VdGM5xB3f4h3CEpoq fjupbSCL1lHBWzb+ZbQPNC0zsK5DuG/Cgfd0lf7UUMPOwDhQM+gmCHolaYkmmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736360298; a=rsa-sha256; cv=none; b=xGv4NXWkiAjoJt1XwNWdknEZ0/bFKRjMuBkI+rjm76mFb5SuqOBywiX6vbyT/T/fcQP4/S lIQOXlf0/EIpZdaUIb1Hc/RdCGHqbfAJYA4H+/+RokiC8rIRMtSIc9knhp6kOPfVj5zMAi XHA3aTXsT2n8cVhSJK9fZL2xvvP/5j/g4WIOpTtTkFtegOA1Wf91TybJSbG7a8E4LM+Cgf 0lwm0ox8gp+LQClpJlKfnku5RJoUt7Owd2wUzuXfBSdILrJTbk2SMLTJkGFprpvv8+A1w4 4L585LcBQtN1Iih3AihcnM0ssKZjnsYvkr29wKIVNZSxymNTeknK3uW9zX4Suw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSx4B0Sdnz16QH; Wed, 08 Jan 2025 18:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 508IIHlJ025503; Wed, 8 Jan 2025 18:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 508IIHcG025500; Wed, 8 Jan 2025 18:18:17 GMT (envelope-from git) Date: Wed, 8 Jan 2025 18:18:17 GMT Message-Id: <202501081818.508IIHcG025500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 1f7c379c0716 - main - isp: Fix abort issue introduced by previous commit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f7c379c07168029694a9a33bc437b05cdee623e Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7c379c07168029694a9a33bc437b05cdee623e commit 1f7c379c07168029694a9a33bc437b05cdee623e Author: Alexander Motin AuthorDate: 2025-01-08 18:04:34 +0000 Commit: Alexander Motin CommitDate: 2025-01-08 18:04:34 +0000 isp: Fix abort issue introduced by previous commit Aborting ATIO while its CTIOs are in progress makes impossible to handle their completions, making them stuck forever. Detect this case by checking ctcnt counter and if so instead of aborting just mark the ATIO as dead to block any new CTIOs. It is not perfect since the task id can not be reused for some more time, but not as bad as the task stuck forever. MFC after: 1 week --- etc/mtree/BSD.include.dist | 2 ++ include/Makefile | 2 +- sys/conf/files.amd64 | 2 ++ sys/dev/isp/isp_freebsd.c | 19 +++++++++++++++++-- sys/dev/isp/isp_freebsd.h | 3 ++- sys/modules/Makefile | 2 ++ usr.sbin/Makefile | 1 + 7 files changed, 27 insertions(+), 4 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index ad1b8a5f7413..0a2dbea23d5a 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -149,6 +149,8 @@ .. io .. + ixnvdimm + .. mfi .. mlx5 diff --git a/include/Makefile b/include/Makefile index 16d641b42a90..0c71f1518a91 100644 --- a/include/Makefile +++ b/include/Makefile @@ -50,7 +50,7 @@ LDIRS= geom net net80211 netgraph netinet netinet6 \ LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ - dev/ic dev/iicbus dev/io dev/mfi dev/mmc \ + dev/ic dev/iicbus dev/io dev/ixnvdimm dev/mfi dev/mmc \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \ fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \ diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 0584fc29d039..571e61f6b264 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -235,6 +235,8 @@ dev/ixl/i40e_adminq.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/i40e_dcb.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixnvdimm/ixnvdimm.c optional ixnvdimm +dev/ixnvdimm/ixnvdimm_copy.S optional ixnvdimm dev/ncthwm/ncthwm.c optional ncthwm superio dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d5aa7a54142e..b496eae1b466 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -986,6 +986,16 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, enum Start_Ctio_How how) continue; } + /* + * Is this command a dead duck? + */ + if (atp->dead) { + isp_prt(isp, ISP_LOGERR, "%s: [0x%x] not sending a CTIO for a dead command", __func__, cso->tag_id); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + continue; + } + /* * Check to make sure we're still in target mode. */ @@ -2503,14 +2513,19 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } /* - * Target should abort all affected CCBs before ACK-ing INOT, + * Target should abort all affected tasks before ACK-ing INOT, * but if/since it doesn't, add this hack to allow tag reuse. + * We can not do it if some CTIOs are in progress, or we won't + * handle the completions. In such case just block new ones. */ uint32_t rsp = (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0; if (ntp->nt.nt_ncode == NT_ABORT_TASK && (rsp & 0xff) == 0 && (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) { - if (isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) + if (atp->ctcnt == 0 && + isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) isp_put_atpd(isp, XS_CHANNEL(ccb), atp); + else + atp->dead = 1; } if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, rsp)) { diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 5bb3dd43b6de..73390fa14769 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -104,8 +104,9 @@ typedef struct atio_private_data { uint16_t ctcnt; /* number of CTIOs currently active */ uint8_t seqno; /* CTIO sequence number */ uint8_t cdb0; - uint8_t srr_notify_rcvd : 1, + uint16_t srr_notify_rcvd : 1, sendst : 1, + dead : 1, tattr : 3, state : 3; void * ests; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 294cb5a224de..3451928e2e53 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -203,6 +203,7 @@ SUBDIR= \ ${_ix} \ ${_ixv} \ ${_ixl} \ + ${_ixnvdimm} \ jme \ kbdmux \ kgssapi \ @@ -834,6 +835,7 @@ _enic= enic _iavf= iavf _ioat= ioat _ixl= ixl +_ixnvdimm= ixnvdimm _nvdimm= nvdimm _pms= pms _qat= qat diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index e039cea6ee16..2eeff6980836 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -34,6 +34,7 @@ SUBDIR= adduser \ ifmcstat \ iostat \ iovctl \ + ixnvdimm \ kldxref \ mailwrapper \ makefs \ From nobody Wed Jan 8 18:21:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSx7M3XYnz5kv5g; Wed, 08 Jan 2025 18:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSx7M350Dz4FB7; Wed, 8 Jan 2025 18:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WlYBimsJscA0HSyA8zJnl7pmZlls9CS3HYB2ot5iU68=; b=oooNflR9SBV5Qy0zYyzDi0bzqjuRvTPQnZ67ravtgDbB+4tbO27pBohE7ugaGGsXJydURA iuU6MoCSxtSNPf/yJrfLObjXjMbEULtLowxJo5/uY+1rmloYq2gY6+k1Xq/+yrzhz1s1P5 aUsFTzOC0otDv4JEbB6GB1Zy4Hlc/5g7jBPtj/FdgVfBUHQ+c7VE5rPXPXh80hBn5M4Oau Kd3MYs9BFJFk4x8+y4mr14tf77zRrQHdGhrCWgIcf5wHI5+AcDcT1IkLUOoFBY6gUr8niL TA7NNLR/02MP6i0oQNWnFTIdvcQI1hbF7m2UeOb60KtI93/PcGCVSjlwtc+uHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WlYBimsJscA0HSyA8zJnl7pmZlls9CS3HYB2ot5iU68=; b=bFRYLLI2EuDemndi65Q8WlZ1rjhEzJWv3VNjdKeEnlDY9lALP5ed01n1tHhNcoYBhL3cc8 chaKAJzNRXWknQBBvi/OQtmLwy9Pu/afSRZxNrs7TVIrMkGZBGDl55CnUdZ2wVWXv3FiSh HVcpisgkWjR4YfSepFHA8FqsAL0L3ozZ/tTnh3DqxhLZs3DvU4XQA2UT6oNA9RZrpSw8x1 5rwtBfNdFwpLlVFET9tp5fehX2R0s/r8IPYZ+JnL3WphA1GXv1UhBmVxnc4FTI/DgYbgTJ MoUslevtFQdx0dTdXg3tHJpRHKcsjLZK/0C8p2RVZAlH6a4lEujAiMjueyhRHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736360463; a=rsa-sha256; cv=none; b=a1Rps1wFzWkbK7lQhrdeqjafPuAowOm1+wcemhpbatVO4/0jbhCjCCeki3QmfEe9V5UST7 +x0vB7JUGEwkepfk7u5KmTbtUqvcppNrHjxVagZdQ8PHFiejmqRHavOakDKzVvpEc/cqED iieqUC5w4vV4tR5Glbsdp1Ys2fkCv/2S8vIOFVJXtNo++8yUt1cPsUGCZR3YbaFOUTDoDf KYklZOlT4FRmTOwH0qAlOK2p24lMIxLVr7pmedUXkTmXUuYp9re+UKFklxI0T5TpbqjKwD 0Kb3+wyUVatdCmhqQvrZMRkEvhbzdrTJT601to2flauVDfUkN3BkVM7LmkSDBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSx7M2WrRz16QT; Wed, 08 Jan 2025 18:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 508IL34C035952; Wed, 8 Jan 2025 18:21:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 508IL31R035949; Wed, 8 Jan 2025 18:21:03 GMT (envelope-from git) Date: Wed, 8 Jan 2025 18:21:03 GMT Message-Id: <202501081821.508IL31R035949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: e6c96c7af717 - main - Revert "isp: Fix abort issue introduced by previous commit" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6c96c7af717b459aea4126590ba413d29f283bf Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c96c7af717b459aea4126590ba413d29f283bf commit e6c96c7af717b459aea4126590ba413d29f283bf Author: Alexander Motin AuthorDate: 2025-01-08 18:20:09 +0000 Commit: Alexander Motin CommitDate: 2025-01-08 18:20:09 +0000 Revert "isp: Fix abort issue introduced by previous commit" This reverts commit 1f7c379c07168029694a9a33bc437b05cdee623e. Leaked unintended changes. I'm sorry. --- etc/mtree/BSD.include.dist | 2 -- include/Makefile | 2 +- sys/conf/files.amd64 | 2 -- sys/dev/isp/isp_freebsd.c | 19 ++----------------- sys/dev/isp/isp_freebsd.h | 3 +-- sys/modules/Makefile | 2 -- usr.sbin/Makefile | 1 - 7 files changed, 4 insertions(+), 27 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index 0a2dbea23d5a..ad1b8a5f7413 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -149,8 +149,6 @@ .. io .. - ixnvdimm - .. mfi .. mlx5 diff --git a/include/Makefile b/include/Makefile index 0c71f1518a91..16d641b42a90 100644 --- a/include/Makefile +++ b/include/Makefile @@ -50,7 +50,7 @@ LDIRS= geom net net80211 netgraph netinet netinet6 \ LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ - dev/ic dev/iicbus dev/io dev/ixnvdimm dev/mfi dev/mmc \ + dev/ic dev/iicbus dev/io dev/mfi dev/mmc \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \ fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \ diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 571e61f6b264..0584fc29d039 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -235,8 +235,6 @@ dev/ixl/i40e_adminq.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/i40e_dcb.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixnvdimm/ixnvdimm.c optional ixnvdimm -dev/ixnvdimm/ixnvdimm_copy.S optional ixnvdimm dev/ncthwm/ncthwm.c optional ncthwm superio dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index b496eae1b466..d5aa7a54142e 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -986,16 +986,6 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, enum Start_Ctio_How how) continue; } - /* - * Is this command a dead duck? - */ - if (atp->dead) { - isp_prt(isp, ISP_LOGERR, "%s: [0x%x] not sending a CTIO for a dead command", __func__, cso->tag_id); - ccb->ccb_h.status = CAM_REQ_ABORTED; - xpt_done(ccb); - continue; - } - /* * Check to make sure we're still in target mode. */ @@ -2513,19 +2503,14 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } /* - * Target should abort all affected tasks before ACK-ing INOT, + * Target should abort all affected CCBs before ACK-ing INOT, * but if/since it doesn't, add this hack to allow tag reuse. - * We can not do it if some CTIOs are in progress, or we won't - * handle the completions. In such case just block new ones. */ uint32_t rsp = (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0; if (ntp->nt.nt_ncode == NT_ABORT_TASK && (rsp & 0xff) == 0 && (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) { - if (atp->ctcnt == 0 && - isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) + if (isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) isp_put_atpd(isp, XS_CHANNEL(ccb), atp); - else - atp->dead = 1; } if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, rsp)) { diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 73390fa14769..5bb3dd43b6de 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -104,9 +104,8 @@ typedef struct atio_private_data { uint16_t ctcnt; /* number of CTIOs currently active */ uint8_t seqno; /* CTIO sequence number */ uint8_t cdb0; - uint16_t srr_notify_rcvd : 1, + uint8_t srr_notify_rcvd : 1, sendst : 1, - dead : 1, tattr : 3, state : 3; void * ests; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 3451928e2e53..294cb5a224de 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -203,7 +203,6 @@ SUBDIR= \ ${_ix} \ ${_ixv} \ ${_ixl} \ - ${_ixnvdimm} \ jme \ kbdmux \ kgssapi \ @@ -835,7 +834,6 @@ _enic= enic _iavf= iavf _ioat= ioat _ixl= ixl -_ixnvdimm= ixnvdimm _nvdimm= nvdimm _pms= pms _qat= qat diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 2eeff6980836..e039cea6ee16 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -34,7 +34,6 @@ SUBDIR= adduser \ ifmcstat \ iostat \ iovctl \ - ixnvdimm \ kldxref \ mailwrapper \ makefs \ From nobody Wed Jan 8 18:24:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSxCY3wRwz5kvQd; Wed, 08 Jan 2025 18:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSxCY2vpkz4Fkf; Wed, 8 Jan 2025 18: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=1736360681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=laiBCGcapaJ8z3CUYaSa7qFAZqA6P93wRA2+ZVNNzUs=; b=h6Su7JutqX4Q4QQVphdxz8tb3UvipZt1tvA3kXEYHAryimcNPUmPIo1RdutUmb6kHHCG4h 7Wfvs90W3RKmxMM6H/jkBS5cv478kepGIrG5slHSOLQCiFVUbvpaAlq1aPtStThtiGQuaj IZ09+m5evElK6W2rRt6CJYlaE+4yIZIRtfuXBKjzidHS7xFKJlVwWbx0N2jURfTIel98NA /NtaSzyIw8pExC5+xngfAFrP+9JqbgpRB4D5f2+4b1n9Ti2W/3c6Pv+AeMBnVesvtzFM3/ jk3Apf5kKGbfolAQ1/dcYCC+MXK8qUGTK0frpK3Y8CRzPJxS+aNZqetvGihVkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736360681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=laiBCGcapaJ8z3CUYaSa7qFAZqA6P93wRA2+ZVNNzUs=; b=pC7EVuvJdPA3ut6+Tj+4GC7ZduWjbvTKVMVMzt/pdGJB3LBHZCHhUHrIDwjQY3BlI0k3V4 KFar6H/3ukGIbdLcdMaiVMa2Gohr+Y0sQdTq5xYq0WBrhiPaPB5V/40r5SBBc/1S/HLVD6 qjKy3xx9Ka2vQ+a1F81CoSbi/Grhsr4TY6CdVPLPx83qnmKEVbP0DQNCVlXH+S1CeteNdy 5PXzxRLGIJrSmnS2HniPto99cwtYHN/od1JSN/g/71Wg8u43ZUb2YDfJ4PzjMmIgzDjkXs kAbChIkU/OYGas5Uafs06F0xXbwglsA1wrLaJzaiGCT88qWtqTIwF3S1CV8teQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736360681; a=rsa-sha256; cv=none; b=uyADxcbTfgPcZPJeYxwxQisbKJUno0GtAKVUQxZC9cbzEoMlhsGmTnqKU7pYgzRL1QfSDm EaDRJf2OlzmGl7cinNEoagDzBV0VBByUb/+jE5ySWjM0oTKnBZvqWKvDpWS1lzPgDVLjyt B4ymYP0bdw5+IOpiTH0jJzBpkhjh7wxfVJdHnW3sueWlkhsPLglJ5nJh6Y/KtSVHtY8yGO cotTBAJTBI7WrhxeWRxqciiNoVmEzOHNcwO/1s85p8G9pJ4hPp0DfrFoi8VDwKuQPHX+E5 NYlk/umVOagdvmrXUbi2jv7bfboTiCbM8SSBg7d32jdMg6ZFBAUk9JhIRe+9KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSxCY2T17z16pg; Wed, 08 Jan 2025 18:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 508IOfGt042936; Wed, 8 Jan 2025 18:24:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 508IOfns042933; Wed, 8 Jan 2025 18:24:41 GMT (envelope-from git) Date: Wed, 8 Jan 2025 18:24:41 GMT Message-Id: <202501081824.508IOfns042933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 2c48a8f161c9 - main - isp: Fix abort issue introduced by previous commit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c48a8f161c91bf7020122697d064a25287097a3 Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2c48a8f161c91bf7020122697d064a25287097a3 commit 2c48a8f161c91bf7020122697d064a25287097a3 Author: Alexander Motin AuthorDate: 2025-01-08 18:23:26 +0000 Commit: Alexander Motin CommitDate: 2025-01-08 18:23:26 +0000 isp: Fix abort issue introduced by previous commit Aborting ATIO while its CTIOs are in progress makes impossible to handle their completions, making them stuck forever. Detect this case by checking ctcnt counter and if so instead of aborting just mark the ATIO as dead to block any new CTIOs. It is not perfect since the task id can not be reused for some more time, but not as bad as the task stuck forever. MFC after: 1 week --- sys/dev/isp/isp_freebsd.c | 19 +++++++++++++++++-- sys/dev/isp/isp_freebsd.h | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d5aa7a54142e..b496eae1b466 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -986,6 +986,16 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, enum Start_Ctio_How how) continue; } + /* + * Is this command a dead duck? + */ + if (atp->dead) { + isp_prt(isp, ISP_LOGERR, "%s: [0x%x] not sending a CTIO for a dead command", __func__, cso->tag_id); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + continue; + } + /* * Check to make sure we're still in target mode. */ @@ -2503,14 +2513,19 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } /* - * Target should abort all affected CCBs before ACK-ing INOT, + * Target should abort all affected tasks before ACK-ing INOT, * but if/since it doesn't, add this hack to allow tag reuse. + * We can not do it if some CTIOs are in progress, or we won't + * handle the completions. In such case just block new ones. */ uint32_t rsp = (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0; if (ntp->nt.nt_ncode == NT_ABORT_TASK && (rsp & 0xff) == 0 && (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) { - if (isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) + if (atp->ctcnt == 0 && + isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) isp_put_atpd(isp, XS_CHANNEL(ccb), atp); + else + atp->dead = 1; } if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, rsp)) { diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 5bb3dd43b6de..73390fa14769 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -104,8 +104,9 @@ typedef struct atio_private_data { uint16_t ctcnt; /* number of CTIOs currently active */ uint8_t seqno; /* CTIO sequence number */ uint8_t cdb0; - uint8_t srr_notify_rcvd : 1, + uint16_t srr_notify_rcvd : 1, sendst : 1, + dead : 1, tattr : 3, state : 3; void * ests; From nobody Wed Jan 8 22:18:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YT2PX3nZ4z5k5Pn; Wed, 08 Jan 2025 22:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YT2PX3HWzz4fg4; Wed, 8 Jan 2025 22:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736374720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnDtFH3AK7TPv8JG5I45otJP+YX4xqwRyHgeYl/++oY=; b=q7pb7lWa0vVCf11sVjGzL9Wg92l3X32c02mlI+K1rpCy2W72pXgQ+x6awfpdt+0caRWz/q +OBsLqYd641z3ekHKJba7FDiiTgnhNciv8JkeOCgtBVqU51YQ3VFXSL2g5OJ0gIVQBlfur Gsg8W9YSoxbObZGzYOPXr13USX9pKqdZS0CGGoA97a3NqCGrighnajzfIHWwMShOYtcn38 l0zOiI+IVy2N47e1VxGdyi5L6bFpmg1LtB4zC1v5l2MBKU1b4XUEtThvaWCRhKTztmhjlK xHQmx4Mc95UJa0wJPEGWO4rd4+xtGBSlYHLUv2S6epSGLPk8gUvHNRwFanakdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736374720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnDtFH3AK7TPv8JG5I45otJP+YX4xqwRyHgeYl/++oY=; b=UAogbKMmQnK445EWfpUwT4QCJa1izxzNKSYefFSxcHU4DG5FtggNXyOZpBI4HDDI6C3dXl jjPkTyv/PCQyoJDateNqrQu5LN8gyKjK7CyKtrL/XGEUpD67Fv7G1mjvD8LypH5OlI2bv/ LD2BUej0maF+S5V7adtur+0uxXN4qwdjMOedQ1kvxgaAIsuVPo/ezXfUKf1YRZHNyIKbbX v8EDtzf3b8jn0XShyo+bRmOax+cYafvJRvfL1uRG84r9pIjc0eVhm+3kdF6dLW62//TQTl 2Sd/X1V2igx5YRKW2Mz0wDrXUxNHNZ/YHOYJe5BQV4WFVhsKUkCbAhJqghHQoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736374720; a=rsa-sha256; cv=none; b=WrAX+rFO2wBObO9+gyEMJhBvxSwfZgzsmEroeUWuG0m8jB2Dox14XJHwbqWiGNoozjqHqy XIAEWiDQSoBRfNDxzP81DZCQWu5p0SISyRRaAmc8LyF0Zs2tR7B8zYKzhlKrtN6aogtAlL W6pOj2rOcKsJKRlTRBFk8nwWNyRCEne7jfHU44NxR6O81/r8yKWZba03c0GinsVP/mQ94c v+K9/D/sgiLfP8yVI4U7pJcq6/PuYTm21S7xn1BSVSEFPMQDX/pwdPGQFUtdLjnt87lEET FptZqZfSS1J+XW01POYfmovax8vtmDW2LZgpgtFFe1DmG/EnRMw8+7nHd1ZIvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YT2PX2lrmz1DBl; Wed, 08 Jan 2025 22:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 508MIe8a076562; Wed, 8 Jan 2025 22:18:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 508MIe7c076559; Wed, 8 Jan 2025 22:18:40 GMT (envelope-from git) Date: Wed, 8 Jan 2025 22:18:40 GMT Message-Id: <202501082218.508MIe7c076559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 4c89d59e0cda - main - TCP RACK: don't log an uninitialized value List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c89d59e0cdac4d83fb5841aefae9214545b2273 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4c89d59e0cdac4d83fb5841aefae9214545b2273 commit 4c89d59e0cdac4d83fb5841aefae9214545b2273 Author: Michael Tuexen AuthorDate: 2025-01-08 22:15:54 +0000 Commit: Michael Tuexen CommitDate: 2025-01-08 22:15:54 +0000 TCP RACK: don't log an uninitialized value reduce is uninitialized, if the code path for logging is reached via goto old_method;. Reviewed by: rrs, Peter Lei CID: 1557359 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48346 --- sys/netinet/tcp_stacks/rack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index f590edd71d9d..902845ad34f6 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -17474,7 +17474,7 @@ rack_get_pacing_delay(struct tcp_rack *rack, struct tcpcb *tp, uint32_t len, str * the peer to have a gap in data sending. */ uint64_t cwnd, tr_perms = 0; - int32_t reduce = 0; + int32_t reduce; old_method: /* @@ -17511,7 +17511,8 @@ rack_get_pacing_delay(struct tcp_rack *rack, struct tcpcb *tp, uint32_t len, str slot -= reduce; } else slot = 0; - } + } else + reduce = 0; slot *= HPTS_USEC_IN_MSEC; if (rack->rc_pace_to_cwnd) { uint64_t rate_wanted = 0; From nobody Thu Jan 9 00:59:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YT5yl30Qgz5kLy1; Thu, 09 Jan 2025 00:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YT5yl26Htz4ygT; Thu, 9 Jan 2025 00:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OBbGIdZv+PUZh5rQhrEyXJRNBmjbCPhCEHkRKZWw1LE=; b=r0NoJoODaJ4nid+ypKQ/tF4bjvLfRhhKr5Q4mUdBkHcrUyNdIZIhwfy5eunTGltcJu60p8 ds2UxAItVOpO0hP8GKcE71ImXD3zgsMvSh8kLSSSnVbVP0WFOJEA4AbmurdiXtiefnNzml OhzuJOeRTAPn+l5Xo5GO8PZJ7LxqlJphIhtyk2CI6B7p0LO7grZRd7IX3Fo1uQA1jhw7br v3zdkYcQ9tDkDMZNFzZVxMRJmlcSpB8RWQtBz6yftmpH15T5fT4TqjHl6UxLu3aoPCgE1D vzUXhbAA/BDTxEwP0MC106WeKOHmaxKWuqyEgekDo+xd1aCPZNANCiHQGqvHOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OBbGIdZv+PUZh5rQhrEyXJRNBmjbCPhCEHkRKZWw1LE=; b=SS0Uyv3f2Ml9dnM87h4fcmIpgFgv65dzPJ07OwBYDf02VmXIPNIdINMvyusx3ypjc7e3UX tbDlJJ/do53oO4QhpNRr5tWgAFdioAv6WMCbKuMKKNLb7J1DjtvIk/RM8KbamDtb292Tf+ ouYWsRgAd1LketF47CnJIH1zYDllqXxiS+KN7FGonwPdOnQRugHEiYitIsIW6Q7k67X81v cfjFSnSnT0buvFGBHrmYnst99WUBfQfQvWiIKhxviqpGDqlyij4jLV8JhuvRapsL4szCJk 9iSkpfK15MZMwJXgl/txqactmmlE1XGitExe5/devlWIEUkvOHpu4JQCekYGfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736384351; a=rsa-sha256; cv=none; b=FiYotTw8G4mBLjE9sRU2upeuSczlvoVBIuAOh90IETpfupJRlbfm+/CrRhRAXsCwmcm++B z/rI8RWJbtzRm8GsOaEFWLON6RJTfX2WgQcL/ozviATjuV13CVwUC5naStE1Mtc3DhhX7g WbaJsr01g9DLV5Rmk3SaRe8LgE2732VH+XPfd6O1FtcBDO9RRqmhRv0KJRuAokqaacEWOW 92EG2MfsIr7i+B5TgHGMrfGeXNUBX7Xm7jeAVNzHuCs8XgjNfrq3W2osSchQ9dx4yPkFIe mJetmOnUItD0ebQZwBgfBJw+E95g2klktW4mJQMphTlo/flrkRf1U+WRZ0pi0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YT5yl1k2gz1JHt; Thu, 09 Jan 2025 00:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5090xB2I075397; Thu, 9 Jan 2025 00:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5090xBuW075394; Thu, 9 Jan 2025 00:59:11 GMT (envelope-from git) Date: Thu, 9 Jan 2025 00:59:11 GMT Message-Id: <202501090059.5090xBuW075394@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: 912a05670ed9 - main - net80211: add helper functions for VHT transmit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 912a05670ed9545a1d1b010eedafb819e14eb1b8 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=912a05670ed9545a1d1b010eedafb819e14eb1b8 commit 912a05670ed9545a1d1b010eedafb819e14eb1b8 Author: Adrian Chadd AuthorDate: 2024-12-16 02:29:33 +0000 Commit: Adrian Chadd CommitDate: 2025-01-09 00:51:51 +0000 net80211: add helper functions for VHT transmit * Add static helper functions for VHT TX for 20MHz, 40MHz and 80MHz. * Add a public function to check if the given VHT width is available for transmit. Differential Revision: https://reviews.freebsd.org/D48101 --- sys/net80211/ieee80211_vht.c | 137 +++++++++++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_vht.h | 4 ++ 2 files changed, 141 insertions(+) diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index a05beb91216f..82879f90c67b 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -873,3 +873,140 @@ ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, { printf("%s: called; TODO!\n", __func__); } + +/* + * Return true if VHT rates can be used for the given node. + */ +bool +ieee80211_vht_check_tx_vht(const struct ieee80211_node *ni) +{ + const struct ieee80211vap *vap; + const struct ieee80211_channel *bss_chan; + + if (ni == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC || + ni->ni_vap == NULL || ni->ni_vap->iv_bss == NULL) + return (false); + + vap = ni->ni_vap; + bss_chan = vap->iv_bss->ni_chan; + + if (bss_chan == IEEE80211_CHAN_ANYC) + return (false); + + return (IEEE80211_IS_CHAN_VHT(ni->ni_chan)); +} + +/* + * Return true if VHT40 rates can be transmitted to the given node. + * + * This verifies that the BSS is VHT40 capable and the current + * node channel width is 40MHz. + */ +static bool +ieee80211_vht_check_tx_vht40(const struct ieee80211_node *ni) +{ + struct ieee80211vap *vap; + struct ieee80211_channel *bss_chan; + + if (!ieee80211_vht_check_tx_vht(ni)) + return (false); + + vap = ni->ni_vap; + bss_chan = vap->iv_bss->ni_chan; + + return (IEEE80211_IS_CHAN_VHT40(bss_chan) && + IEEE80211_IS_CHAN_VHT40(ni->ni_chan) && + (ni->ni_chw == IEEE80211_STA_RX_BW_40)); +} + +/* + * Return true if VHT80 rates can be transmitted to the given node. + * + * This verifies that the BSS is VHT80 capable and the current + * node channel width is 80MHz. + */ +static bool +ieee80211_vht_check_tx_vht80(const struct ieee80211_node *ni) +{ + struct ieee80211vap *vap; + struct ieee80211_channel *bss_chan; + + if (!ieee80211_vht_check_tx_vht(ni)) + return (false); + + vap = ni->ni_vap; + bss_chan = vap->iv_bss->ni_chan; + + return (IEEE80211_IS_CHAN_VHT80(bss_chan) && + IEEE80211_IS_CHAN_VHT80(ni->ni_chan) && + (ni->ni_chw == IEEE80211_STA_RX_BW_80)); +} + +/* + * Return true if VHT 160 rates can be transmitted to the given node. + * + * This verifies that the BSS is VHT80+80 or VHT160 capable and the current + * node channel width is 80+80MHz or 160MHz. + */ +static bool +ieee80211_vht_check_tx_vht160(const struct ieee80211_node *ni) +{ + struct ieee80211vap *vap; + struct ieee80211_channel *bss_chan; + + if (!ieee80211_vht_check_tx_vht(ni)) + return (false); + + vap = ni->ni_vap; + bss_chan = vap->iv_bss->ni_chan; + + if (ni->ni_chw != IEEE80211_STA_RX_BW_160) + return (false); + + if (IEEE80211_IS_CHAN_VHT160(bss_chan) && + IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + return (true); + + if (IEEE80211_IS_CHAN_VHT80P80(bss_chan) && + IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) + return (true); + + return (false); +} + +/** + * @brief Check if the given transmit bandwidth is available to the given node + * + * This checks that the node and BSS both allow the given bandwidth, + * and that the current node bandwidth (which can dynamically change) + * also allows said bandwidth. + * + * This relies on the channels having the flags for the narrower + * channels as well - eg a VHT160 channel will have the CHAN_VHT80, + * CHAN_VHT40, CHAN_VHT flags also set. + * + * @param ni the ieee80211_node to check + * @param bw the required bandwidth to check + * + * @returns true if it is allowed, false otherwise + */ +bool +ieee80211_vht_check_tx_bw(const struct ieee80211_node *ni, + enum ieee80211_sta_rx_bw bw) +{ + + switch (bw) { + case IEEE80211_STA_RX_BW_20: + return (ieee80211_vht_check_tx_vht(ni)); + case IEEE80211_STA_RX_BW_40: + return (ieee80211_vht_check_tx_vht40(ni)); + case IEEE80211_STA_RX_BW_80: + return (ieee80211_vht_check_tx_vht80(ni)); + case IEEE80211_STA_RX_BW_160: + return (ieee80211_vht_check_tx_vht160(ni)); + case IEEE80211_STA_RX_BW_320: + return (false); + default: + return (false); + } +} diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h index f2d1706ea0f2..bcb61020c5a1 100644 --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -65,4 +65,8 @@ void ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, struct ieee80211_vht_operation *, int); +bool ieee80211_vht_check_tx_vht(const struct ieee80211_node *); +bool ieee80211_vht_check_tx_bw(const struct ieee80211_node *, + enum ieee80211_sta_rx_bw); + #endif /* _NET80211_IEEE80211_VHT_H_ */ From nobody Thu Jan 9 00:59:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YT5ym3p5mz5kLmp; Thu, 09 Jan 2025 00:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YT5ym3Mhdz4yXv; Thu, 9 Jan 2025 00:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqE9iWMEVSp9A/oq7TUL6OHVKlIYYsZKTTYq/Xc7hjk=; b=pdbtAOvcEn/ZuyccgXx4ICb+E/M+6ea7Em7+YqKBo5IKJh7tYzAvSoYUTnCJMtEEksvD9D 5bQ77W0poAUuP3pFtMRKjdv/7V2+MsVXnDSyhcsdn/6FTeE9cXG5Ebn0YQ5R7aJd6X9cSW s3FiUt7MnDwmSXwRHSjw7+8l0XwquwpesbRNMpJhbTGh1uG/7TiRjbUWbAWSID1sI1BrdW pBtCrxiyZTyPHCnMfbP1eFQNThuCHKbu6y60H09ER4lLEuC9vDCDp6mZq5fB8aKBcMRQHQ 8xs8OhDJ5C5V5zcBPiXrwwqysFfq3SURtV80OZWh9ti6xWz3uPjUSptnNkr3bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqE9iWMEVSp9A/oq7TUL6OHVKlIYYsZKTTYq/Xc7hjk=; b=qtT12A76S4tgVgkosOkZ1cTzVJUIywP4iynSRPoRgQiq1aWMGalbun2v4Zugb26zR/B8MG gLu1Ajq0Sbf+qALau7ub0E0AdGFMI+4A6w8OgPe4RVEjhgh4cPPQ0DTZHM/piyD2r3Z4sv 6GLLhCZiv8LJi+Do209SFepTeG97EJ+flAMyj1+TaJamCLuONYYaNQxMDZU49xn94bqOYu LygtdTmtAFjnt65kR+ifKR40GdxG+VIl8t1TV0bcUs/TypS0+pgfYCq3EIzVmTMMC4+jJU j4B8CLyda0oeZOfenwTFtAAyofBPhvOpqI4mnDf6a1lE031CoCmh1n9xMmFzTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736384352; a=rsa-sha256; cv=none; b=pS/u/0VkIlZ58ArnymcFWOrROhPvo5OZoUhRSlOaq9czApUT5VRe/iNy+Y/HPnFSinaxr6 fmJZrnRF92hi2YcLdjqcIG2rB4XigHlz11JZkqFo5Cy6nF7HNPEHa/xxJVP6EyPotJpO1z +wM91H4RotRDvhgj2VzzVSIWWMDzDSfXCmahnwRy1SVet7WTHVwl/NAfDtxOFBWR3zN/az UFR/+ETGSU+DW3X5gbsBXe8FfcM6xG1U7+MkOkUH12TjPgwi4oyPJKCxiKFTaCCtmBJn+o 6b+kAYwTvUWMGNzy382awoQpCSmd352A0uvewtoDT7OaYI0c63aRPuDefrzIrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YT5ym2McBz1JHv; Thu, 09 Jan 2025 00:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5090xCpo075452; Thu, 9 Jan 2025 00:59:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5090xCxD075449; Thu, 9 Jan 2025 00:59:12 GMT (envelope-from git) Date: Thu, 9 Jan 2025 00:59:12 GMT Message-Id: <202501090059.5090xCxD075449@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: 82182587bcc3 - main - rtwn: add VHT20/VHT40/VHT80 bandwidth configuration for transmit. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82182587bcc3adf39d6b3b6347f052865c3a34e2 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=82182587bcc3adf39d6b3b6347f052865c3a34e2 commit 82182587bcc3adf39d6b3b6347f052865c3a34e2 Author: Adrian Chadd AuthorDate: 2024-12-16 02:35:28 +0000 Commit: Adrian Chadd CommitDate: 2025-01-09 00:52:00 +0000 rtwn: add VHT20/VHT40/VHT80 bandwidth configuration for transmit. Add a separate function and path for VHT 20/40/80MHz bandwidth transmission. Differential Revision: https://reviews.freebsd.org/D48102 --- sys/dev/rtwn/rtl8812a/r12a_tx.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c index 336ad75a0b1f..acb238316559 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -47,6 +47,7 @@ #include #include +#include #include #include @@ -87,12 +88,42 @@ r12a_get_primary_channel(struct rtwn_softc *sc, struct ieee80211_channel *c) return (0); } +/* + * Configure VHT20/VHT40/VHT80 as appropriate. + * + * This is only called for VHT, not for HT. + */ +static void +r12a_tx_set_vht_bw(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) +{ + struct r12a_tx_desc *txd = (struct r12a_tx_desc *)buf; + int prim_chan; + + prim_chan = r12a_get_primary_channel(sc, ni->ni_chan); + + if (ieee80211_vht_check_tx_bw(ni, IEEE80211_STA_RX_BW_80)) { + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_BW, + R12A_TXDW5_DATA_BW80)); + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_PRIM_CHAN, + prim_chan)); + } else if (ieee80211_vht_check_tx_bw(ni, IEEE80211_STA_RX_BW_40)) { + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_BW, + R12A_TXDW5_DATA_BW40)); + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_PRIM_CHAN, + prim_chan)); + } +} + +/* + * Configure HT20/HT40 as appropriate. + * + * This is only called for HT, not for VHT. + */ static void r12a_tx_set_ht40(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) { struct r12a_tx_desc *txd = (struct r12a_tx_desc *)buf; - /* XXX VHT80; VHT40; VHT20 */ if (ieee80211_ht_check_tx_ht40(ni)) { int prim_chan; @@ -353,8 +384,12 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); prot = IEEE80211_PROT_NONE; - /* TODO: VHT */ - if (RTWN_RATE_IS_HT(ridx)) { + if (RTWN_RATE_IS_VHT(ridx)) { + r12a_tx_set_vht_bw(sc, txd, ni); + /* XXX TODO: sgi */ + /* XXX TODO: ldpc */ + prot = ic->ic_htprotmode; + } else if (RTWN_RATE_IS_HT(ridx)) { r12a_tx_set_ht40(sc, txd, ni); r12a_tx_set_sgi(sc, txd, ni); r12a_tx_set_ldpc(sc, txd, ni); From nobody Thu Jan 9 00:59:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YT5yn5cp4z5kLq9; Thu, 09 Jan 2025 00:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YT5yn3h2kz4ypc; Thu, 9 Jan 2025 00:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f4auZkwAVUQoVDllIoPv4OW3F2aw8hKYpFmfr9cT58g=; b=J8fOuZkEGnjqIK7E5qnlQrEmsfY+FdPXaG3qGY3JQx1xr1dRaWg3yt/CpGiksI2QvCdfxU Ir6urDaFJ7BLDZKTvWyM8W8UFGpvvBztAYyYt1XizEKPxYab8NoCLyXijeygCfn+q/qHV/ bDTFjaDJhpblkUKYJ2QrjBJcwMbN1VDACxeYM1RIZZiT/+LW2lkz62kAVCudraD31V2EKP u86Eh9TJCcapcEWK9kDnGI80LwRmksilUsTGsfaJ8+5SwgTPfdqgO8Ffq7m+nHDUsjCexW yiZxNj+TzU1zo5INHPp818DZSbszDXg7kxSqP9C2nJjaJqJnwN0KY0+rVk3bEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f4auZkwAVUQoVDllIoPv4OW3F2aw8hKYpFmfr9cT58g=; b=MsM4RDTu3WK0D167IWYo1TCl/3ub7HSZoRZCf2BnH/9pSumvXi2/2qmtkheXqXm7DN2B69 2pNduAN874OiOCLIE7JuCbtUhXO6SLKX/FRFBtfCM4BxFoMjctXcBduOXq8Hc5o+bI66ZW jWVyGpYzOEXfemr8NSfVq2pP6PWIO8qjVX6PKQgpmq+69n9klIrJJtkGHW1BSsHXHCCQm9 H7fHcm/HTiKS0Z/IgZOdj+D9gkHntMNqLEnl5pfvU7Ck+4XS6n41bGHqsX9RP9TJMX0rZR n+6nY4mtwxLXBfzC6GtozFmvqI5/nwacNoEYjNCILNgMJKIaFXvPNbuU1GynGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736384353; a=rsa-sha256; cv=none; b=yKVGViN5nNk0zoW0BJLMQBKKX2HjmaEfWOyn4a/3iK4tck+2C/ih0TxH5b4rFTyWpvV9fm szFFjEabewILS9nf+eJpZPM4REvuiBuDuz8puxBdtpwmrVxQ/OHRtzSqZRUV8QJjrU67wX 6dDdaxDxkIA5C7Kp1iH8pzNMn20e8bkx83BDuGeuOL8RcwAvFc+7RH6WgzDjtoy87A+3LQ EHsgCJw/3ePWQybsqFJExVbuXUgDOFmit4IM/kBC+NX4CHZhkTD1lodbKgUHE9CIi+TJq1 t2toe6UE16nqmFFRaVNgdP4tvZ9XcGnLOFGjJyhgqLz1ng0WsuY3C/Z/qq81+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YT5yn3GMfz1JTP; Thu, 09 Jan 2025 00:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5090xDHW075502; Thu, 9 Jan 2025 00:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5090xDOY075499; Thu, 9 Jan 2025 00:59:13 GMT (envelope-from git) Date: Thu, 9 Jan 2025 00:59:13 GMT Message-Id: <202501090059.5090xDOY075499@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: ec07af2a3d49 - main - rtwn: announce VHT support for RTL8812AU/RTL8821AU. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec07af2a3d494de36a20a541efdd24874c841db5 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=ec07af2a3d494de36a20a541efdd24874c841db5 commit ec07af2a3d494de36a20a541efdd24874c841db5 Author: Adrian Chadd AuthorDate: 2024-12-16 04:15:46 +0000 Commit: Adrian Chadd CommitDate: 2025-01-09 00:52:12 +0000 rtwn: announce VHT support for RTL8812AU/RTL8821AU. Although the transmit path doesn't yet support VHT rates (because the rate control and rate representation in net80211 doesn't yet know about VHT rates) the NIC will receive VHT frames but only transmit HT frames. Locally tested: * RTL8812AU, STA mode Differential Revision: https://reviews.freebsd.org/D48103 --- sys/dev/rtwn/if_rtwn.c | 23 +++++++++++++++++++++++ sys/dev/rtwn/if_rtwnvar.h | 2 ++ sys/dev/rtwn/rtl8812a/usb/r12au_attach.c | 19 ++++++++++++++++--- sys/dev/rtwn/rtl8821a/usb/r21au_attach.c | 17 ++++++++++++++--- 4 files changed, 55 insertions(+), 6 deletions(-) diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index ed84950b1a94..f9950c5acf4d 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -436,6 +436,29 @@ rtwn_resume(struct rtwn_softc *sc) ieee80211_resume_all(ic); } +void +rtwn_attach_vht_cap_info_mcs(struct rtwn_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t rx_mcs = 0, tx_mcs = 0; + + for (int i = 0 ; i < 8; i++) { + if (i < sc->ntxchains) + tx_mcs |= (IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2)); + else + tx_mcs |= (IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2)); + + if (i < sc->nrxchains) + rx_mcs |= (IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2)); + else + rx_mcs |= (IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2)); + } + ic->ic_vht_cap.supp_mcs.rx_mcs_map = rx_mcs; + ic->ic_vht_cap.supp_mcs.rx_highest = 0; + ic->ic_vht_cap.supp_mcs.tx_mcs_map = tx_mcs; + ic->ic_vht_cap.supp_mcs.tx_highest = 0; +} + static void rtwn_vap_decrement_counters(struct rtwn_softc *sc, enum ieee80211_opmode opmode, int id) diff --git a/sys/dev/rtwn/if_rtwnvar.h b/sys/dev/rtwn/if_rtwnvar.h index fa4b6d0a5df7..aa42715b1674 100644 --- a/sys/dev/rtwn/if_rtwnvar.h +++ b/sys/dev/rtwn/if_rtwnvar.h @@ -436,6 +436,8 @@ void rtwn_detach(struct rtwn_softc *); void rtwn_resume(struct rtwn_softc *); void rtwn_suspend(struct rtwn_softc *); +void rtwn_attach_vht_cap_info_mcs(struct rtwn_softc *); + /* Interface-specific. */ #define rtwn_write_1(_sc, _addr, _val) \ (((_sc)->sc_write_1)((_sc), (_addr), (_val))) diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c index c87bffb4db19..b6850eb9fa23 100644 --- a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c @@ -175,11 +175,24 @@ r12au_adj_devcaps(struct rtwn_softc *sc) } ic->ic_htcaps |= - IEEE80211_HTCAP_CHWIDTH40 /* 40 MHz channel width */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ + IEEE80211_HTCAP_CHWIDTH40 | /* 40 MHz channel width */ + IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ ; - /* TODO: STBC, VHT etc */ + /* TODO: STBC */ + + /* VHT config */ + ic->ic_flags_ext |= IEEE80211_FEXT_VHT; + ic->ic_vht_cap.vht_cap_info = + IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 | + IEEE80211_VHTCAP_SHORT_GI_80 | + IEEE80211_VHTCAP_TXSTBC | + IEEE80211_VHTCAP_RXSTBC_1 | + IEEE80211_VHTCAP_HTC_VHT | + _IEEE80211_SHIFTMASK(7, + IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + + rtwn_attach_vht_cap_info_mcs(sc); } void diff --git a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c index 175bac8f6fc9..60cb6d3fc61d 100644 --- a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c +++ b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c @@ -160,11 +160,22 @@ r21au_adj_devcaps(struct rtwn_softc *sc) ic->ic_caps |= IEEE80211_C_DFS; ic->ic_htcaps |= - IEEE80211_HTCAP_CHWIDTH40 /* 40 MHz channel width */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ + IEEE80211_HTCAP_CHWIDTH40 | /* 40 MHz channel width */ + IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ ; - /* TODO: VHT */ + /* VHT config */ + ic->ic_flags_ext |= IEEE80211_FEXT_VHT; + ic->ic_vht_cap.vht_cap_info = + IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 | + IEEE80211_VHTCAP_SHORT_GI_80 | + IEEE80211_VHTCAP_TXSTBC | + IEEE80211_VHTCAP_RXSTBC_1 | + IEEE80211_VHTCAP_HTC_VHT | + _IEEE80211_SHIFTMASK(7, + IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + + rtwn_attach_vht_cap_info_mcs(sc); } void From nobody Thu Jan 9 04:04:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTB532QSkz5kdSL; Thu, 09 Jan 2025 04:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTB526ds5z41tc; Thu, 9 Jan 2025 04:04:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQh6XI1UyUGqplmkn0KcpuT4eUcskEM80jI6xz0jjCU=; b=P49NhzaBUR/1uBIH9XTwtHgNXFVSfDu+4yrtnei2ZuT+qYYhU9xyPoJmYegZeJfBAKWKJW LOy58/ltHBQRa5ePmV2cpUs7ubHpfLXqg4NXFNRclM3H6VdOyXSTLE2Dh0Y93mthiQaQc9 Lhr5ifN2MJZ1JPQd218IyZqh5KIzNll2UXB4DygnId7u+14T777xXGS17mxl6j4hRQMdtK PgIgvX6oZJXk2eigVFJMFhfB4N3SnvYgSIQ6dOEjNERTXwo1p9ebKFmhILdufuS8rKjb+J hUkZ/6kaUxaA1jUxbv4Vy9fqNmocqEHBdqfmhHxYaAu8lDX0Cq/sCdhHZmoEQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lQh6XI1UyUGqplmkn0KcpuT4eUcskEM80jI6xz0jjCU=; b=stwRuvIUujOpAvhimMJP7TDMha8jEagQNbX7vAdiQpakVHKP1ALTKkM7RxtPRg3MPW39R7 6Q1USB11+tkZSb0/WNDKQ1xWZsvwzb3EBwwOiSs+2RfL8btPwCsgvCeDhHUU9rpYUpiU3v on49Nvu3kvUUMtlrSEOCLvKBoM2XErrlmw599PtHaQGufX52n+I8q9Gc4QHjhF/fLuuuCd U7/cHrMRQ9IoOy7EtvrS7GZH4c9MA6lZepl6tXmDd+C3B9/J4eo8lhxOI3QEBT5gXyGdFv jTsRTB9tCnMi1snsW1kDvVTVruxWbvTbM5FOUkXvqJWZ5KCSx3xC8t/uVvxA1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736395494; a=rsa-sha256; cv=none; b=nia7mJXVd5o17lMUUrcGIjqAV7JVvQ9AZYua0SsdJUQ4yAZaj0QeqLv0upirV3yTAaUpSn A1nKa+KJoDCH0PxTVe0R2Z1Ki5sm5opPNK7rDNI6TXj5c0RYp49HCQwgMsLlStHl+iW9P5 bgJa4pCIUQhWqEuOLE2xeHrgNufFrboaLU7jwvlOy0MPCFcrU5XQ+q1H34o6uzBCfPAQ1c +6gm47KR8WGLld3ENGWDPG4GRQoeMdlseySMn8ykzyL4BkkPB/H69HkRlTWjH8p7UOlq3y HH10AJgFvcvKRTH1y2Ah8Dla93qgU86jYCC0odq0qX0k0Txm0FKMqsEnfjufvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTB526309z1Pcb; Thu, 09 Jan 2025 04:04:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50944saM031127; Thu, 9 Jan 2025 04:04:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50944sFM031124; Thu, 9 Jan 2025 04:04:54 GMT (envelope-from git) Date: Thu, 9 Jan 2025 04:04:54 GMT Message-Id: <202501090404.50944sFM031124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 5aac61c5d2bc - main - rpc: delete disabled code from rpcb_clnt.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5aac61c5d2bcbd3358b3d74d46827a8bfdeff86c Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=5aac61c5d2bcbd3358b3d74d46827a8bfdeff86c commit 5aac61c5d2bcbd3358b3d74d46827a8bfdeff86c Author: Gleb Smirnoff AuthorDate: 2025-01-09 04:00:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-09 04:00:12 +0000 rpc: delete disabled code from rpcb_clnt.c The code was disabled since the initial bulk check-in from Isilon in 2008. Its existence poisoned grep(1) results when one would try to learn what are the actual RPC mechanisms that are used by the modern NFC client and server. --- sys/rpc/rpcb_clnt.c | 1142 +-------------------------------------------------- 1 file changed, 1 insertion(+), 1141 deletions(-) diff --git a/sys/rpc/rpcb_clnt.c b/sys/rpc/rpcb_clnt.c index 5f7d13020af0..ee2253596f85 100644 --- a/sys/rpc/rpcb_clnt.c +++ b/sys/rpc/rpcb_clnt.c @@ -62,363 +62,6 @@ static const char nullstring[] = "\000"; static CLIENT *local_rpcb(void); -#if 0 - -static const struct timeval rmttimeout = { 3, 0 }; -static struct timeval rpcbrmttime = { 15, 0 }; - -#define CACHESIZE 6 - -struct address_cache { - char *ac_host; - char *ac_netid; - char *ac_uaddr; - struct netbuf *ac_taddr; - struct address_cache *ac_next; -}; - -static struct address_cache *front; -static int cachesize; - -#define CLCR_GET_RPCB_TIMEOUT 1 -#define CLCR_SET_RPCB_TIMEOUT 2 - - -extern int __rpc_lowvers; - -static struct address_cache *check_cache(const char *, const char *); -static void delete_cache(struct netbuf *); -static void add_cache(const char *, const char *, struct netbuf *, char *); -static CLIENT *getclnthandle(const char *, const struct netconfig *, char **); -static CLIENT *local_rpcb(void); -static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *); - -/* - * This routine adjusts the timeout used for calls to the remote rpcbind. - * Also, this routine can be used to set the use of portmapper version 2 - * only when doing rpc_broadcasts - * These are private routines that may not be provided in future releases. - */ -bool_t -__rpc_control(request, info) - int request; - void *info; -{ - switch (request) { - case CLCR_GET_RPCB_TIMEOUT: - *(struct timeval *)info = tottimeout; - break; - case CLCR_SET_RPCB_TIMEOUT: - tottimeout = *(struct timeval *)info; - break; - case CLCR_SET_LOWVERS: - __rpc_lowvers = *(int *)info; - break; - case CLCR_GET_LOWVERS: - *(int *)info = __rpc_lowvers; - break; - default: - return (FALSE); - } - return (TRUE); -} - -/* - * It might seem that a reader/writer lock would be more reasonable here. - * However because getclnthandle(), the only user of the cache functions, - * may do a delete_cache() operation if a check_cache() fails to return an - * address useful to clnt_tli_create(), we may as well use a mutex. - */ -/* - * As it turns out, if the cache lock is *not* a reader/writer lock, we will - * block all clnt_create's if we are trying to connect to a host that's down, - * since the lock will be held all during that time. - */ - -/* - * The routines check_cache(), add_cache(), delete_cache() manage the - * cache of rpcbind addresses for (host, netid). - */ - -static struct address_cache * -check_cache(host, netid) - const char *host, *netid; -{ - struct address_cache *cptr; - - /* READ LOCK HELD ON ENTRY: rpcbaddr_cache_lock */ - - for (cptr = front; cptr != NULL; cptr = cptr->ac_next) { - if (!strcmp(cptr->ac_host, host) && - !strcmp(cptr->ac_netid, netid)) { -#ifdef ND_DEBUG - fprintf(stderr, "Found cache entry for %s: %s\n", - host, netid); -#endif - return (cptr); - } - } - return ((struct address_cache *) NULL); -} - -static void -delete_cache(addr) - struct netbuf *addr; -{ - struct address_cache *cptr, *prevptr = NULL; - - /* WRITE LOCK HELD ON ENTRY: rpcbaddr_cache_lock */ - for (cptr = front; cptr != NULL; cptr = cptr->ac_next) { - if (!memcmp(cptr->ac_taddr->buf, addr->buf, addr->len)) { - free(cptr->ac_host); - free(cptr->ac_netid); - free(cptr->ac_taddr->buf); - free(cptr->ac_taddr); - if (cptr->ac_uaddr) - free(cptr->ac_uaddr); - if (prevptr) - prevptr->ac_next = cptr->ac_next; - else - front = cptr->ac_next; - free(cptr); - cachesize--; - break; - } - prevptr = cptr; - } -} - -static void -add_cache(host, netid, taddr, uaddr) - const char *host, *netid; - char *uaddr; - struct netbuf *taddr; -{ - struct address_cache *ad_cache, *cptr, *prevptr; - - ad_cache = (struct address_cache *) - malloc(sizeof (struct address_cache)); - if (!ad_cache) { - return; - } - ad_cache->ac_host = strdup(host); - ad_cache->ac_netid = strdup(netid); - ad_cache->ac_uaddr = uaddr ? strdup(uaddr) : NULL; - ad_cache->ac_taddr = (struct netbuf *)malloc(sizeof (struct netbuf)); - if (!ad_cache->ac_host || !ad_cache->ac_netid || !ad_cache->ac_taddr || - (uaddr && !ad_cache->ac_uaddr)) { - goto out; - } - ad_cache->ac_taddr->len = ad_cache->ac_taddr->maxlen = taddr->len; - ad_cache->ac_taddr->buf = (char *) malloc(taddr->len); - if (ad_cache->ac_taddr->buf == NULL) { -out: - if (ad_cache->ac_host) - free(ad_cache->ac_host); - if (ad_cache->ac_netid) - free(ad_cache->ac_netid); - if (ad_cache->ac_uaddr) - free(ad_cache->ac_uaddr); - if (ad_cache->ac_taddr) - free(ad_cache->ac_taddr); - free(ad_cache); - return; - } - memcpy(ad_cache->ac_taddr->buf, taddr->buf, taddr->len); -#ifdef ND_DEBUG - fprintf(stderr, "Added to cache: %s : %s\n", host, netid); -#endif - -/* VARIABLES PROTECTED BY rpcbaddr_cache_lock: cptr */ - - rwlock_wrlock(&rpcbaddr_cache_lock); - if (cachesize < CACHESIZE) { - ad_cache->ac_next = front; - front = ad_cache; - cachesize++; - } else { - /* Free the last entry */ - cptr = front; - prevptr = NULL; - while (cptr->ac_next) { - prevptr = cptr; - cptr = cptr->ac_next; - } - -#ifdef ND_DEBUG - fprintf(stderr, "Deleted from cache: %s : %s\n", - cptr->ac_host, cptr->ac_netid); -#endif - free(cptr->ac_host); - free(cptr->ac_netid); - free(cptr->ac_taddr->buf); - free(cptr->ac_taddr); - if (cptr->ac_uaddr) - free(cptr->ac_uaddr); - - if (prevptr) { - prevptr->ac_next = NULL; - ad_cache->ac_next = front; - front = ad_cache; - } else { - front = ad_cache; - ad_cache->ac_next = NULL; - } - free(cptr); - } - rwlock_unlock(&rpcbaddr_cache_lock); -} - -/* - * This routine will return a client handle that is connected to the - * rpcbind. If targaddr is non-NULL, the "universal address" of the - * host will be stored in *targaddr; the caller is responsible for - * freeing this string. - * On error, returns NULL and free's everything. - */ -static CLIENT * -getclnthandle(host, nconf, targaddr) - const char *host; - const struct netconfig *nconf; - char **targaddr; -{ - CLIENT *client; - struct netbuf *addr, taddr; - struct netbuf addr_to_delete; - struct __rpc_sockinfo si; - struct addrinfo hints, *res, *tres; - struct address_cache *ad_cache; - char *tmpaddr; - -/* VARIABLES PROTECTED BY rpcbaddr_cache_lock: ad_cache */ - - /* Get the address of the rpcbind. Check cache first */ - client = NULL; - addr_to_delete.len = 0; - rwlock_rdlock(&rpcbaddr_cache_lock); - ad_cache = NULL; - if (host != NULL) - ad_cache = check_cache(host, nconf->nc_netid); - if (ad_cache != NULL) { - addr = ad_cache->ac_taddr; - client = clnt_tli_create(RPC_ANYFD, nconf, addr, - (rpcprog_t)RPCBPROG, (rpcvers_t)RPCBVERS4, 0, 0); - if (client != NULL) { - if (targaddr) - *targaddr = strdup(ad_cache->ac_uaddr); - rwlock_unlock(&rpcbaddr_cache_lock); - return (client); - } - addr_to_delete.len = addr->len; - addr_to_delete.buf = (char *)malloc(addr->len); - if (addr_to_delete.buf == NULL) { - addr_to_delete.len = 0; - } else { - memcpy(addr_to_delete.buf, addr->buf, addr->len); - } - } - rwlock_unlock(&rpcbaddr_cache_lock); - if (addr_to_delete.len != 0) { - /* - * Assume this may be due to cache data being - * outdated - */ - rwlock_wrlock(&rpcbaddr_cache_lock); - delete_cache(&addr_to_delete); - rwlock_unlock(&rpcbaddr_cache_lock); - free(addr_to_delete.buf); - } - if (!__rpc_nconf2sockinfo(nconf, &si)) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return NULL; - } - - memset(&hints, 0, sizeof hints); - hints.ai_family = si.si_af; - hints.ai_socktype = si.si_socktype; - hints.ai_protocol = si.si_proto; - -#ifdef CLNT_DEBUG - printf("trying netid %s family %d proto %d socktype %d\n", - nconf->nc_netid, si.si_af, si.si_proto, si.si_socktype); -#endif - - if (nconf->nc_protofmly != NULL && strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) { - client = local_rpcb(); - if (! client) { -#ifdef ND_DEBUG - clnt_pcreateerror("rpcbind clnt interface"); -#endif - return (NULL); - } else { - struct sockaddr_un sun; - if (targaddr) { - *targaddr = malloc(sizeof(sun.sun_path)); - if (*targaddr == NULL) { - CLNT_DESTROY(client); - return (NULL); - } - strncpy(*targaddr, _PATH_RPCBINDSOCK, - sizeof(sun.sun_path)); - } - return (client); - } - } else { - if (getaddrinfo(host, "sunrpc", &hints, &res) != 0) { - rpc_createerr.cf_stat = RPC_UNKNOWNHOST; - return NULL; - } - } - - for (tres = res; tres != NULL; tres = tres->ai_next) { - taddr.buf = tres->ai_addr; - taddr.len = taddr.maxlen = tres->ai_addrlen; - -#ifdef ND_DEBUG - { - char *ua; - - ua = taddr2uaddr(nconf, &taddr); - fprintf(stderr, "Got it [%s]\n", ua); - free(ua); - } -#endif - -#ifdef ND_DEBUG - { - int i; - - fprintf(stderr, "\tnetbuf len = %d, maxlen = %d\n", - taddr.len, taddr.maxlen); - fprintf(stderr, "\tAddress is "); - for (i = 0; i < taddr.len; i++) - fprintf(stderr, "%u.", ((char *)(taddr.buf))[i]); - fprintf(stderr, "\n"); - } -#endif - client = clnt_tli_create(RPC_ANYFD, nconf, &taddr, - (rpcprog_t)RPCBPROG, (rpcvers_t)RPCBVERS4, 0, 0); -#ifdef ND_DEBUG - if (! client) { - clnt_pcreateerror("rpcbind clnt interface"); - } -#endif - - if (client) { - tmpaddr = targaddr ? taddr2uaddr(nconf, &taddr) : NULL; - add_cache(host, nconf->nc_netid, &taddr, tmpaddr); - if (targaddr) - *targaddr = tmpaddr; - break; - } - } - if (res) - freeaddrinfo(res); - return (client); -} - -#endif - /* XXX */ #define IN4_LOCALHOST_STRING "127.0.0.1" #define IN6_LOCALHOST_STRING "::1" @@ -446,7 +89,7 @@ local_rpcb(void) error = socreate(AF_LOCAL, &so, SOCK_STREAM, 0, curthread->td_ucred, curthread); if (error) - goto try_nconf; + return (NULL); sun.sun_family = AF_LOCAL; strcpy(sun.sun_path, _PATH_RPCBINDSOCK); sun.sun_len = SUN_LEN(&sun); @@ -464,65 +107,7 @@ local_rpcb(void) /* Nobody needs this socket anymore; free the descriptor. */ soclose(so); -try_nconf: - -#if 0 - static struct netconfig *loopnconf; - static char *localhostname; - -/* VARIABLES PROTECTED BY loopnconf_lock: loopnconf */ - mutex_lock(&loopnconf_lock); - if (loopnconf == NULL) { - struct netconfig *nconf, *tmpnconf = NULL; - void *nc_handle; - int fd; - - nc_handle = setnetconfig(); - if (nc_handle == NULL) { - /* fails to open netconfig file */ - syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - mutex_unlock(&loopnconf_lock); - return (NULL); - } - while ((nconf = getnetconfig(nc_handle)) != NULL) { - if (( -#ifdef INET6 - strcmp(nconf->nc_protofmly, NC_INET6) == 0 || -#endif - strcmp(nconf->nc_protofmly, NC_INET) == 0) && - (nconf->nc_semantics == NC_TPI_COTS || - nconf->nc_semantics == NC_TPI_COTS_ORD)) { - fd = __rpc_nconf2fd(nconf); - /* - * Can't create a socket, assume that - * this family isn't configured in the kernel. - */ - if (fd < 0) - continue; - _close(fd); - tmpnconf = nconf; - if (!strcmp(nconf->nc_protofmly, NC_INET)) - localhostname = IN4_LOCALHOST_STRING; - else - localhostname = IN6_LOCALHOST_STRING; - } - } - if (tmpnconf == NULL) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - mutex_unlock(&loopnconf_lock); - return (NULL); - } - loopnconf = getnetconfigent(tmpnconf->nc_netid); - /* loopnconf is never freed */ - endnetconfig(nc_handle); - } - mutex_unlock(&loopnconf_lock); - client = getclnthandle(localhostname, loopnconf, NULL); - return (client); -#else return (NULL); -#endif } /* @@ -636,728 +221,3 @@ rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf) CLNT_DESTROY(client); return (rslt); } - -#if 0 - -/* - * From the merged list, find the appropriate entry - */ -static struct netbuf * -got_entry(relp, nconf) - rpcb_entry_list_ptr relp; - const struct netconfig *nconf; -{ - struct netbuf *na = NULL; - rpcb_entry_list_ptr sp; - rpcb_entry *rmap; - - for (sp = relp; sp != NULL; sp = sp->rpcb_entry_next) { - rmap = &sp->rpcb_entry_map; - if ((strcmp(nconf->nc_proto, rmap->r_nc_proto) == 0) && - (strcmp(nconf->nc_protofmly, rmap->r_nc_protofmly) == 0) && - (nconf->nc_semantics == rmap->r_nc_semantics) && - (rmap->r_maddr != NULL) && (rmap->r_maddr[0] != 0)) { - na = uaddr2taddr(nconf, rmap->r_maddr); -#ifdef ND_DEBUG - fprintf(stderr, "\tRemote address is [%s].\n", - rmap->r_maddr); - if (!na) - fprintf(stderr, - "\tCouldn't resolve remote address!\n"); -#endif - break; - } - } - return (na); -} - -/* - * Quick check to see if rpcbind is up. Tries to connect over - * local transport. - */ -static bool_t -__rpcbind_is_up() -{ - struct netconfig *nconf; - struct sockaddr_un sun; - void *localhandle; - int sock; - - nconf = NULL; - localhandle = setnetconfig(); - while ((nconf = getnetconfig(localhandle)) != NULL) { - if (nconf->nc_protofmly != NULL && - strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) - break; - } - if (nconf == NULL) - return (FALSE); - - endnetconfig(localhandle); - - memset(&sun, 0, sizeof sun); - sock = _socket(AF_LOCAL, SOCK_STREAM, 0); - if (sock < 0) - return (FALSE); - sun.sun_family = AF_LOCAL; - strncpy(sun.sun_path, _PATH_RPCBINDSOCK, sizeof(sun.sun_path)); - sun.sun_len = SUN_LEN(&sun); - - if (_connect(sock, (struct sockaddr *)&sun, sun.sun_len) < 0) { - _close(sock); - return (FALSE); - } - - _close(sock); - return (TRUE); -} - -/* - * An internal function which optimizes rpcb_getaddr function. It also - * returns the client handle that it uses to contact the remote rpcbind. - * - * The algorithm used: If the transports is TCP or UDP, it first tries - * version 2 (portmap), 4 and then 3 (svr4). This order should be - * changed in the next OS release to 4, 2 and 3. We are assuming that by - * that time, version 4 would be available on many machines on the network. - * With this algorithm, we get performance as well as a plan for - * obsoleting version 2. - * - * For all other transports, the algorithm remains as 4 and then 3. - * - * XXX: Due to some problems with t_connect(), we do not reuse the same client - * handle for COTS cases and hence in these cases we do not return the - * client handle. This code will change if t_connect() ever - * starts working properly. Also look under clnt_vc.c. - */ -struct netbuf * -__rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; - const char *host; - CLIENT **clpp; - struct timeval *tp; -{ - static bool_t check_rpcbind = TRUE; - CLIENT *client = NULL; - RPCB parms; - enum clnt_stat clnt_st; - char *ua = NULL; - rpcvers_t vers; - struct netbuf *address = NULL; - rpcvers_t start_vers = RPCBVERS4; - struct netbuf servaddr; - - /* parameter checking */ - if (nconf == NULL) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - - parms.r_addr = NULL; - - /* - * Use default total timeout if no timeout is specified. - */ - if (tp == NULL) - tp = &tottimeout; - -#ifdef PORTMAP - /* Try version 2 for TCP or UDP */ - if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - u_short port = 0; - struct netbuf remote; - rpcvers_t pmapvers = 2; - struct pmap pmapparms; - - /* - * Try UDP only - there are some portmappers out - * there that use UDP only. - */ - if (strcmp(nconf->nc_proto, NC_TCP) == 0) { - struct netconfig *newnconf; - - if ((newnconf = getnetconfigent("udp")) == NULL) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - client = getclnthandle(host, newnconf, &parms.r_addr); - freenetconfigent(newnconf); - } else { - client = getclnthandle(host, nconf, &parms.r_addr); - } - if (client == NULL) - return (NULL); - - /* - * Set version and retry timeout. - */ - CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)&rpcbrmttime); - CLNT_CONTROL(client, CLSET_VERS, (char *)&pmapvers); - - pmapparms.pm_prog = program; - pmapparms.pm_vers = version; - pmapparms.pm_prot = strcmp(nconf->nc_proto, NC_TCP) ? - IPPROTO_UDP : IPPROTO_TCP; - pmapparms.pm_port = 0; /* not needed */ - clnt_st = CLNT_CALL(client, (rpcproc_t)PMAPPROC_GETPORT, - (xdrproc_t) xdr_pmap, (caddr_t)(void *)&pmapparms, - (xdrproc_t) xdr_u_short, (caddr_t)(void *)&port, - *tp); - if (clnt_st != RPC_SUCCESS) { - if ((clnt_st == RPC_PROGVERSMISMATCH) || - (clnt_st == RPC_PROGUNAVAIL)) - goto try_rpcbind; /* Try different versions */ - rpc_createerr.cf_stat = RPC_PMAPFAILURE; - clnt_geterr(client, &rpc_createerr.cf_error); - goto error; - } else if (port == 0) { - address = NULL; - rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; - goto error; - } - port = htons(port); - CLNT_CONTROL(client, CLGET_SVC_ADDR, (char *)&remote); - if (((address = (struct netbuf *) - malloc(sizeof (struct netbuf))) == NULL) || - ((address->buf = (char *) - malloc(remote.len)) == NULL)) { - rpc_createerr.cf_stat = RPC_SYSTEMERROR; - clnt_geterr(client, &rpc_createerr.cf_error); - if (address) { - free(address); - address = NULL; - } - goto error; - } - memcpy(address->buf, remote.buf, remote.len); - memcpy(&((char *)address->buf)[sizeof (short)], - (char *)(void *)&port, sizeof (short)); - address->len = address->maxlen = remote.len; - goto done; - } -#endif /* PORTMAP */ - -try_rpcbind: - /* - * Check if rpcbind is up. This prevents needless delays when - * accessing applications such as the keyserver while booting - * disklessly. - */ - if (check_rpcbind && strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) { - if (!__rpcbind_is_up()) { - rpc_createerr.cf_stat = RPC_PMAPFAILURE; - rpc_createerr.cf_error.re_errno = 0; - goto error; - } - check_rpcbind = FALSE; - } - - /* - * Now we try version 4 and then 3. - * We also send the remote system the address we used to - * contact it in case it can help to connect back with us - */ - parms.r_prog = program; - parms.r_vers = version; - /*LINTED const castaway*/ - parms.r_owner = (char *) &nullstring[0]; /* not needed; */ - /* just for xdring */ - parms.r_netid = nconf->nc_netid; /* not really needed */ - - /* - * If a COTS transport is being used, try getting address via CLTS - * transport. This works only with version 4. - */ - if (nconf->nc_semantics == NC_TPI_COTS_ORD || - nconf->nc_semantics == NC_TPI_COTS) { - - void *handle; - struct netconfig *nconf_clts; - rpcb_entry_list_ptr relp = NULL; - - if (client == NULL) { - /* This did not go through the above PORTMAP/TCP code */ - if ((handle = __rpc_setconf("datagram_v")) != NULL) { - while ((nconf_clts = __rpc_getconf(handle)) - != NULL) { - if (strcmp(nconf_clts->nc_protofmly, - nconf->nc_protofmly) != 0) { - continue; - } - client = getclnthandle(host, nconf_clts, - &parms.r_addr); - break; - } - __rpc_endconf(handle); - } - if (client == NULL) - goto regular_rpcbind; /* Go the regular way */ - } else { - /* This is a UDP PORTMAP handle. Change to version 4 */ - vers = RPCBVERS4; - CLNT_CONTROL(client, CLSET_VERS, (char *)(void *)&vers); - } - /* - * We also send the remote system the address we used to - * contact it in case it can help it connect back with us - */ - if (parms.r_addr == NULL) { - /*LINTED const castaway*/ - parms.r_addr = (char *) &nullstring[0]; /* for XDRing */ - } - - CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)&rpcbrmttime); - - clnt_st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_GETADDRLIST, - (xdrproc_t) xdr_rpcb, (char *)(void *)&parms, - (xdrproc_t) xdr_rpcb_entry_list_ptr, - (char *)(void *)&relp, *tp); - if (clnt_st == RPC_SUCCESS) { - if ((address = got_entry(relp, nconf)) != NULL) { - xdr_free((xdrproc_t) xdr_rpcb_entry_list_ptr, - (char *)(void *)&relp); - CLNT_CONTROL(client, CLGET_SVC_ADDR, - (char *)(void *)&servaddr); - __rpc_fixup_addr(address, &servaddr); - goto done; - } - /* Entry not found for this transport */ - xdr_free((xdrproc_t) xdr_rpcb_entry_list_ptr, - (char *)(void *)&relp); - /* - * XXX: should have perhaps returned with error but - * since the remote machine might not always be able - * to send the address on all transports, we try the - * regular way with regular_rpcbind - */ - goto regular_rpcbind; - } else if ((clnt_st == RPC_PROGVERSMISMATCH) || - (clnt_st == RPC_PROGUNAVAIL)) { - start_vers = RPCBVERS; /* Try version 3 now */ - goto regular_rpcbind; /* Try different versions */ - } else { - rpc_createerr.cf_stat = RPC_PMAPFAILURE; - clnt_geterr(client, &rpc_createerr.cf_error); - goto error; - } - } - -regular_rpcbind: - - /* Now the same transport is to be used to get the address */ - if (client && ((nconf->nc_semantics == NC_TPI_COTS_ORD) || - (nconf->nc_semantics == NC_TPI_COTS))) { - /* A CLTS type of client - destroy it */ - CLNT_DESTROY(client); - client = NULL; - } - - if (client == NULL) { - client = getclnthandle(host, nconf, &parms.r_addr); - if (client == NULL) { - goto error; - } - } - if (parms.r_addr == NULL) { - /*LINTED const castaway*/ - parms.r_addr = (char *) &nullstring[0]; - } - - /* First try from start_vers and then version 3 (RPCBVERS) */ - - CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *) &rpcbrmttime); - for (vers = start_vers; vers >= RPCBVERS; vers--) { - /* Set the version */ - CLNT_CONTROL(client, CLSET_VERS, (char *)(void *)&vers); - clnt_st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_GETADDR, - (xdrproc_t) xdr_rpcb, (char *)(void *)&parms, - (xdrproc_t) xdr_wrapstring, (char *)(void *) &ua, *tp); - if (clnt_st == RPC_SUCCESS) { - if ((ua == NULL) || (ua[0] == 0)) { - /* address unknown */ - rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; - goto error; - } - address = uaddr2taddr(nconf, ua); -#ifdef ND_DEBUG - fprintf(stderr, "\tRemote address is [%s]\n", ua); - if (!address) - fprintf(stderr, - "\tCouldn't resolve remote address!\n"); -#endif - xdr_free((xdrproc_t)xdr_wrapstring, - (char *)(void *)&ua); - - if (! address) { - /* We don't know about your universal address */ - rpc_createerr.cf_stat = RPC_N2AXLATEFAILURE; - goto error; - } - CLNT_CONTROL(client, CLGET_SVC_ADDR, - (char *)(void *)&servaddr); - __rpc_fixup_addr(address, &servaddr); - goto done; - } else if (clnt_st == RPC_PROGVERSMISMATCH) { - struct rpc_err rpcerr; - - clnt_geterr(client, &rpcerr); - if (rpcerr.re_vers.low > RPCBVERS4) - goto error; /* a new version, can't handle */ - } else if (clnt_st != RPC_PROGUNAVAIL) { - /* Cant handle this error */ - rpc_createerr.cf_stat = clnt_st; - clnt_geterr(client, &rpc_createerr.cf_error); - goto error; - } - } - -error: - if (client) { - CLNT_DESTROY(client); - client = NULL; - } -done: - if (nconf->nc_semantics != NC_TPI_CLTS) { - /* This client is the connectionless one */ - if (client) { - CLNT_DESTROY(client); - client = NULL; - } - } - if (clpp) { - *clpp = client; - } else if (client) { - CLNT_DESTROY(client); - } - if (parms.r_addr != NULL && parms.r_addr != nullstring) - free(parms.r_addr); - return (address); -} - - -/* - * Find the mapped address for program, version. - * Calls the rpcbind service remotely to do the lookup. - * Uses the transport specified in nconf. - * Returns FALSE (0) if no map exists, else returns 1. - * - * Assuming that the address is all properly allocated - */ -bool_t -rpcb_getaddr(program, version, nconf, address, host) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; - struct netbuf *address; - const char *host; -{ - struct netbuf *na; - - if ((na = __rpcb_findaddr_timed(program, version, - (struct netconfig *) nconf, (char *) host, - (CLIENT **) NULL, (struct timeval *) NULL)) == NULL) - return (FALSE); - - if (na->len > address->maxlen) { - /* Too long address */ - free(na->buf); - free(na); - rpc_createerr.cf_stat = RPC_FAILED; - return (FALSE); - } - memcpy(address->buf, na->buf, (size_t)na->len); - address->len = na->len; - free(na->buf); - free(na); - return (TRUE); -} - -/* - * Get a copy of the current maps. - * Calls the rpcbind service remotely to get the maps. - * - * It returns only a list of the services - * It returns NULL on failure. - */ -rpcblist * -rpcb_getmaps(nconf, host) - const struct netconfig *nconf; - const char *host; -{ - rpcblist_ptr head = NULL; - CLIENT *client; - enum clnt_stat clnt_st; - rpcvers_t vers = 0; - - client = getclnthandle(host, nconf, NULL); - if (client == NULL) { - return (head); - } - clnt_st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_DUMP, - (xdrproc_t) xdr_void, NULL, (xdrproc_t) xdr_rpcblist_ptr, - (char *)(void *)&head, tottimeout); - if (clnt_st == RPC_SUCCESS) - goto done; - - if ((clnt_st != RPC_PROGVERSMISMATCH) && - (clnt_st != RPC_PROGUNAVAIL)) { - rpc_createerr.cf_stat = RPC_RPCBFAILURE; - clnt_geterr(client, &rpc_createerr.cf_error); - goto done; - } - - /* fall back to earlier version */ - CLNT_CONTROL(client, CLGET_VERS, (char *)(void *)&vers); - if (vers == RPCBVERS4) { - vers = RPCBVERS; - CLNT_CONTROL(client, CLSET_VERS, (char *)(void *)&vers); - if (CLNT_CALL(client, (rpcproc_t)RPCBPROC_DUMP, - (xdrproc_t) xdr_void, NULL, (xdrproc_t) xdr_rpcblist_ptr, - (char *)(void *)&head, tottimeout) == RPC_SUCCESS) - goto done; - } - rpc_createerr.cf_stat = RPC_RPCBFAILURE; - clnt_geterr(client, &rpc_createerr.cf_error); - -done: - CLNT_DESTROY(client); - return (head); -} - -/* - * rpcbinder remote-call-service interface. - * This routine is used to call the rpcbind remote call service - * which will look up a service program in the address maps, and then - * remotely call that routine with the given parameters. This allows - * programs to do a lookup and call in one step. -*/ -enum clnt_stat -rpcb_rmtcall(nconf, host, prog, vers, proc, xdrargs, argsp, - xdrres, resp, tout, addr_ptr) - const struct netconfig *nconf; /* Netconfig structure */ - const char *host; /* Remote host name */ - rpcprog_t prog; - rpcvers_t vers; - rpcproc_t proc; /* Remote proc identifiers */ - xdrproc_t xdrargs, xdrres; /* XDR routines */ - caddr_t argsp, resp; /* Argument and Result */ - struct timeval tout; /* Timeout value for this call */ - const struct netbuf *addr_ptr; /* Preallocated netbuf address */ -{ - CLIENT *client; - enum clnt_stat stat; - struct r_rpcb_rmtcallargs a; - struct r_rpcb_rmtcallres r; - rpcvers_t rpcb_vers; - - stat = 0; - client = getclnthandle(host, nconf, NULL); - if (client == NULL) { *** 206 LINES SKIPPED *** From nobody Thu Jan 9 04:04:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTB542KRLz5kdt6; Thu, 09 Jan 2025 04:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTB536k9Jz41rs; Thu, 9 Jan 2025 04:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDMBGyKNK8VWK+Y2tRnJTLXN7QqAaGwFLF3Z2ngAZrM=; b=SQuvSGFQptyDkcktDnGFS+20Z+TeKIIdBw6ffQ4WGEPA5X/FPvShpoqZPSy8PBaXJf92Ol bI61PfJitSAIssbjgyRDhGo9ZY+eG++DNOyqhVEQvEqJXBaNbP19k+vwtIdJi8bkY817bc Jvl5NtqP9pvXYxjc1wPQMkKx6AqRy6XCyubBSrs2jZPTIKpogjsTtCC137NVzMX0SmNSwV j/czRvPC68/1SjygUaAveDgq0FNyebXlH+Gl8DDD4mdkZ7J2CXuIehA42wJYxy++lZ5gJp Jv3x6/MDEZIOvyvMoMPiN0K5EM/6BZSw2e0yiQgXHZQx8nKocGGNEVuNNhQRnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDMBGyKNK8VWK+Y2tRnJTLXN7QqAaGwFLF3Z2ngAZrM=; b=wYA442xJ9ik88ix+IxDMSXn1/CZDn7U3uhYiY6Y+UD+GijVGvsnR2s7KFJf7K9HroS6nsV wacsYCxC5RJMMOWU2tgXcVJDcpvebqqii7eWr1txgWqJa63TGGw1b4L8h3n1belQGNtK6v bdQFtJnKWijbfmKKw73CznyM8moGieoGGEpZ4lTkmWWIWv4Ue1bPUvXSvTFsGLIw4uhnm3 5JKVXMN979hzqBhQqfStwJt+XhtYdXbJfOd5E1w56xgoTX2VZ7SJLQ7V9yYOburnBvEuwq HIlWhua15HiX5FiaHf7uidDCIpbqihAf0zubZxzjerq983I+4jEECFzoR7mjSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736395495; a=rsa-sha256; cv=none; b=w6EoSHGYQIwvwLFXKZztJmnguKSYhG3LyCULBwB7F6Krx7pRVXMREYP4egvo1YqipMevBb kzNZTMr8GnEks2JmHziaFJzWOMehkJzS0NRtTc0oY/DWFQ38MnvyA9B3R6vIDRqOb99gKS hEjQ2JrjxamNjOMTZ/Chn1X/JoyDkRWyDwc2bWuOKV961ypFRV1t4dbif2wNtkNwTpn5YZ h1KYxkFeTY9NbdhnwdglVtIZ1vfcAsb7//x7CA+AfAXP68nWpc5uaR1nUqn3VEFj2o3Czw qp7NKJ8XJsuiTWOryUH11c46RDTO/eftLv/5omyA9zVEpLPCg/z3UujI9jN0JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTB53668gz1Pbp; Thu, 09 Jan 2025 04:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50944tBv031169; Thu, 9 Jan 2025 04:04:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50944tHK031166; Thu, 9 Jan 2025 04:04:55 GMT (envelope-from git) Date: Thu, 9 Jan 2025 04:04:55 GMT Message-Id: <202501090404.50944tHK031166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2834fd2ad58b - main - kgssapi: remove the debug module List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2834fd2ad58b42c45aa02d0cd21fc1c04b3c278a Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2834fd2ad58b42c45aa02d0cd21fc1c04b3c278a commit 2834fd2ad58b42c45aa02d0cd21fc1c04b3c278a Author: Gleb Smirnoff AuthorDate: 2025-01-09 04:00:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-09 04:00:12 +0000 kgssapi: remove the debug module Its build was disabled since original bulk check-in in 2008. Today it fails to compile due to multiple errors. I also tried to build it on stable/10, and that failed, too. I guess it wasn't buildable since initial check-in. --- sys/conf/files | 1 - sys/conf/options | 1 - sys/kgssapi/gsstest.c | 1145 ------------------------------------------------- 3 files changed, 1147 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 428a2805768c..d358737c5613 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4038,7 +4038,6 @@ kgssapi/krb5/krb5_mech.c optional kgssapi kgssapi/krb5/kcrypto.c optional kgssapi kgssapi/krb5/kcrypto_aes.c optional kgssapi kgssapi/kgss_if.m optional kgssapi -kgssapi/gsstest.c optional kgssapi_debug # These files in libkern/ are those needed by all architectures. Some # of the files in libkern/ are only needed on some architectures, e.g., # libkern/divdi3.c is needed by i386 but not alpha. Also, some of these diff --git a/sys/conf/options b/sys/conf/options index 438d0e81889c..c467dc9995c2 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -290,7 +290,6 @@ TARFS_DEBUG opt_tarfs.h # In-kernel GSS-API KGSSAPI opt_kgssapi.h -KGSSAPI_DEBUG opt_kgssapi.h # These static filesystems have one slightly bogus static dependency in # sys/i386/i386/autoconf.c. If any of these filesystems are diff --git a/sys/kgssapi/gsstest.c b/sys/kgssapi/gsstest.c deleted file mode 100644 index e47b25042d1c..000000000000 --- a/sys/kgssapi/gsstest.c +++ /dev/null @@ -1,1145 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ - * Authors: Doug Rabson - * Developed with Red Inc: Alfred Perlstein - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -static void -report_error(gss_OID mech, OM_uint32 maj, OM_uint32 min) -{ - OM_uint32 maj_stat, min_stat; - OM_uint32 message_context; - gss_buffer_desc buf; - - uprintf("major_stat=%d, minor_stat=%d\n", maj, min); - message_context = 0; - do { - maj_stat = gss_display_status(&min_stat, maj, - GSS_C_GSS_CODE, GSS_C_NO_OID, &message_context, &buf); - if (GSS_ERROR(maj_stat)) - break; - uprintf("%.*s\n", (int)buf.length, (char *) buf.value); - gss_release_buffer(&min_stat, &buf); - } while (message_context); - if (mech && min) { - message_context = 0; - do { - maj_stat = gss_display_status(&min_stat, min, - GSS_C_MECH_CODE, mech, &message_context, &buf); - if (GSS_ERROR(maj_stat)) - break; - uprintf("%.*s\n", (int)buf.length, (char *) buf.value); - gss_release_buffer(&min_stat, &buf); - } while (message_context); - } -} - -#if 0 -static void -send_token_to_peer(const gss_buffer_t token) -{ - const uint8_t *p; - size_t i; - - printf("send token:\n"); - printf("%d ", (int) token->length); - p = (const uint8_t *) token->value; - for (i = 0; i < token->length; i++) - printf("%02x", *p++); - printf("\n"); -} - -static void -receive_token_from_peer(gss_buffer_t token) -{ - char line[8192]; - char *p; - uint8_t *q; - int len, val; - - printf("receive token:\n"); - fgets(line, sizeof(line), stdin); - if (line[strlen(line) - 1] != '\n') { - printf("token truncated\n"); - exit(1); - } - p = line; - if (sscanf(line, "%d ", &len) != 1) { - printf("bad token\n"); - exit(1); - } - p = strchr(p, ' ') + 1; - token->length = len; - token->value = malloc(len); - q = (uint8_t *) token->value; - while (len) { - if (sscanf(p, "%02x", &val) != 1) { - printf("bad token\n"); - exit(1); - } - *q++ = val; - p += 2; - len--; - } -} -#endif - -#if 0 -void -server(int argc, char** argv) -{ - OM_uint32 maj_stat, min_stat; - gss_buffer_desc input_token, output_token; - gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT; - gss_name_t client_name; - gss_OID mech_type; - - if (argc != 1) - usage(); - - do { - receive_token_from_peer(&input_token); - maj_stat = gss_accept_sec_context(&min_stat, - &context_hdl, - GSS_C_NO_CREDENTIAL, - &input_token, - GSS_C_NO_CHANNEL_BINDINGS, - &client_name, - &mech_type, - &output_token, - NULL, - NULL, - NULL); - if (GSS_ERROR(maj_stat)) { - report_error(mech_type, maj_stat, min_stat); - } - if (output_token.length != 0) { - send_token_to_peer(&output_token); - gss_release_buffer(&min_stat, &output_token); - } - if (GSS_ERROR(maj_stat)) { - if (context_hdl != GSS_C_NO_CONTEXT) - gss_delete_sec_context(&min_stat, - &context_hdl, - GSS_C_NO_BUFFER); - break; - } - } while (maj_stat & GSS_S_CONTINUE_NEEDED); - - if (client_name) { - gss_buffer_desc name_desc; - char buf[512]; - - gss_display_name(&min_stat, client_name, &name_desc, NULL); - memcpy(buf, name_desc.value, name_desc.length); - buf[name_desc.length] = 0; - gss_release_buffer(&min_stat, &name_desc); - printf("client name is %s\n", buf); - } - - receive_token_from_peer(&input_token); - gss_unwrap(&min_stat, context_hdl, &input_token, &output_token, - NULL, NULL); - printf("%.*s\n", (int)output_token.length, (char *) output_token.value); - gss_release_buffer(&min_stat, &output_token); -} -#endif - -/* 1.2.752.43.13.14 */ -static gss_OID_desc gss_krb5_set_allowable_enctypes_x_desc = -{6, (void *) "\x2a\x85\x70\x2b\x0d\x0e"}; - -gss_OID GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X = &gss_krb5_set_allowable_enctypes_x_desc; -#define ETYPE_DES_CBC_CRC 1 - -/* - * Create an initiator context and acceptor context in the kernel and - * use them to exchange signed and sealed messages. - */ -static int -gsstest_1(struct thread *td) -{ - OM_uint32 maj_stat, min_stat; - OM_uint32 smaj_stat, smin_stat; - int context_established = 0; - gss_ctx_id_t client_context = GSS_C_NO_CONTEXT; - gss_ctx_id_t server_context = GSS_C_NO_CONTEXT; - gss_cred_id_t client_cred = GSS_C_NO_CREDENTIAL; - gss_cred_id_t server_cred = GSS_C_NO_CREDENTIAL; - gss_name_t name = GSS_C_NO_NAME; - gss_name_t received_name = GSS_C_NO_NAME; - gss_buffer_desc name_desc; - gss_buffer_desc client_token, server_token, message_buf; - gss_OID mech, actual_mech, mech_type; - static gss_OID_desc krb5_desc = - {9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"}; -#if 0 - static gss_OID_desc spnego_desc = - {6, (void *)"\x2b\x06\x01\x05\x05\x02"}; - static gss_OID_desc ntlm_desc = - {10, (void *)"\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"}; -#endif - char enctype[sizeof(uint32_t)]; - - mech = GSS_C_NO_OID; - - { - static char sbuf[512]; - memcpy(sbuf, "nfs@", 4); - getcredhostname(td->td_ucred, sbuf + 4, sizeof(sbuf) - 4); - name_desc.value = sbuf; - } - - name_desc.length = strlen((const char *) name_desc.value); - maj_stat = gss_import_name(&min_stat, &name_desc, - GSS_C_NT_HOSTBASED_SERVICE, &name); - if (GSS_ERROR(maj_stat)) { - printf("gss_import_name failed\n"); - report_error(mech, maj_stat, min_stat); - goto out; - } - - maj_stat = gss_acquire_cred(&min_stat, GSS_C_NO_NAME, - 0, GSS_C_NO_OID_SET, GSS_C_INITIATE, &client_cred, - NULL, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_acquire_cred (client) failed\n"); - report_error(mech, maj_stat, min_stat); - goto out; - } - - enctype[0] = (ETYPE_DES_CBC_CRC >> 24) & 0xff; - enctype[1] = (ETYPE_DES_CBC_CRC >> 16) & 0xff; - enctype[2] = (ETYPE_DES_CBC_CRC >> 8) & 0xff; - enctype[3] = ETYPE_DES_CBC_CRC & 0xff; - message_buf.length = sizeof(enctype); - message_buf.value = enctype; - maj_stat = gss_set_cred_option(&min_stat, &client_cred, - GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X, &message_buf); - if (GSS_ERROR(maj_stat)) { - printf("gss_set_cred_option failed\n"); - report_error(mech, maj_stat, min_stat); - goto out; - } - - server_token.length = 0; - server_token.value = NULL; - while (!context_established) { - client_token.length = 0; - client_token.value = NULL; - maj_stat = gss_init_sec_context(&min_stat, - client_cred, - &client_context, - name, - mech, - GSS_C_MUTUAL_FLAG|GSS_C_CONF_FLAG|GSS_C_INTEG_FLAG, - 0, - GSS_C_NO_CHANNEL_BINDINGS, - &server_token, - &actual_mech, - &client_token, - NULL, - NULL); - if (server_token.length) - gss_release_buffer(&smin_stat, &server_token); - if (GSS_ERROR(maj_stat)) { - printf("gss_init_sec_context failed\n"); - report_error(mech, maj_stat, min_stat); - goto out; - } - - if (client_token.length != 0) { - if (!server_cred) { - gss_OID_set_desc oid_set; - oid_set.count = 1; - oid_set.elements = &krb5_desc; - smaj_stat = gss_acquire_cred(&smin_stat, - name, 0, &oid_set, GSS_C_ACCEPT, &server_cred, - NULL, NULL); - if (GSS_ERROR(smaj_stat)) { - printf("gss_acquire_cred (server) failed\n"); - report_error(mech_type, smaj_stat, smin_stat); - goto out; - } - } - smaj_stat = gss_accept_sec_context(&smin_stat, - &server_context, - server_cred, - &client_token, - GSS_C_NO_CHANNEL_BINDINGS, - &received_name, - &mech_type, - &server_token, - NULL, - NULL, - NULL); - if (GSS_ERROR(smaj_stat)) { - printf("gss_accept_sec_context failed\n"); - report_error(mech_type, smaj_stat, smin_stat); - goto out; - } - gss_release_buffer(&min_stat, &client_token); - } - if (GSS_ERROR(maj_stat)) { - if (client_context != GSS_C_NO_CONTEXT) - gss_delete_sec_context(&min_stat, - &client_context, - GSS_C_NO_BUFFER); - break; - } - - if (maj_stat == GSS_S_COMPLETE) { - context_established = 1; - } - } - - message_buf.length = strlen("Hello world"); - message_buf.value = (void *) "Hello world"; - - maj_stat = gss_get_mic(&min_stat, client_context, - GSS_C_QOP_DEFAULT, &message_buf, &client_token); - if (GSS_ERROR(maj_stat)) { - printf("gss_get_mic failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - maj_stat = gss_verify_mic(&min_stat, server_context, - &message_buf, &client_token, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_verify_mic failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - gss_release_buffer(&min_stat, &client_token); - - maj_stat = gss_wrap(&min_stat, client_context, - TRUE, GSS_C_QOP_DEFAULT, &message_buf, NULL, &client_token); - if (GSS_ERROR(maj_stat)) { - printf("gss_wrap failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - maj_stat = gss_unwrap(&min_stat, server_context, - &client_token, &server_token, NULL, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_unwrap failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - - if (message_buf.length != server_token.length - || memcmp(message_buf.value, server_token.value, - message_buf.length)) - printf("unwrap result corrupt\n"); - - gss_release_buffer(&min_stat, &client_token); - gss_release_buffer(&min_stat, &server_token); - -out: - if (client_context) - gss_delete_sec_context(&min_stat, &client_context, - GSS_C_NO_BUFFER); - if (server_context) - gss_delete_sec_context(&min_stat, &server_context, - GSS_C_NO_BUFFER); - if (client_cred) - gss_release_cred(&min_stat, &client_cred); - if (server_cred) - gss_release_cred(&min_stat, &server_cred); - if (name) - gss_release_name(&min_stat, &name); - if (received_name) - gss_release_name(&min_stat, &received_name); - - return (0); -} - -/* - * Interoperability with userland. This takes several steps: - * - * 1. Accept an initiator token from userland, return acceptor - * token. Repeat this step until both userland and kernel return - * GSS_S_COMPLETE. - * - * 2. Receive a signed message from userland and verify the - * signature. Return a signed reply to userland for it to verify. - * - * 3. Receive a wrapped message from userland and unwrap it. Return a - * wrapped reply to userland. - */ -static int -gsstest_2(struct thread *td, int step, const gss_buffer_t input_token, - OM_uint32 *maj_stat_res, OM_uint32 *min_stat_res, gss_buffer_t output_token) -{ - OM_uint32 maj_stat, min_stat; - static int context_established = 0; - static gss_ctx_id_t server_context = GSS_C_NO_CONTEXT; - static gss_cred_id_t server_cred = GSS_C_NO_CREDENTIAL; - static gss_name_t name = GSS_C_NO_NAME; - gss_buffer_desc name_desc; - gss_buffer_desc message_buf; - gss_OID mech_type = GSS_C_NO_OID; - char enctype[sizeof(uint32_t)]; - int error = EINVAL; - - maj_stat = GSS_S_FAILURE; - min_stat = 0; - switch (step) { - case 1: - if (server_context == GSS_C_NO_CONTEXT) { - static char sbuf[512]; - memcpy(sbuf, "nfs@", 4); - getcredhostname(td->td_ucred, sbuf + 4, - sizeof(sbuf) - 4); - name_desc.value = sbuf; - name_desc.length = strlen((const char *) - name_desc.value); - maj_stat = gss_import_name(&min_stat, &name_desc, - GSS_C_NT_HOSTBASED_SERVICE, &name); - if (GSS_ERROR(maj_stat)) { - printf("gss_import_name failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - - maj_stat = gss_acquire_cred(&min_stat, - name, 0, GSS_C_NO_OID_SET, GSS_C_ACCEPT, - &server_cred, NULL, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_acquire_cred (server) failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - - enctype[0] = (ETYPE_DES_CBC_CRC >> 24) & 0xff; - enctype[1] = (ETYPE_DES_CBC_CRC >> 16) & 0xff; - enctype[2] = (ETYPE_DES_CBC_CRC >> 8) & 0xff; - enctype[3] = ETYPE_DES_CBC_CRC & 0xff; - message_buf.length = sizeof(enctype); - message_buf.value = enctype; - maj_stat = gss_set_cred_option(&min_stat, &server_cred, - GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X, &message_buf); - if (GSS_ERROR(maj_stat)) { - printf("gss_set_cred_option failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - } - - maj_stat = gss_accept_sec_context(&min_stat, - &server_context, - server_cred, - input_token, - GSS_C_NO_CHANNEL_BINDINGS, - NULL, - &mech_type, - output_token, - NULL, - NULL, - NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_accept_sec_context failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - - if (maj_stat == GSS_S_COMPLETE) { - context_established = 1; - } - *maj_stat_res = maj_stat; - *min_stat_res = min_stat; - break; - - case 2: - message_buf.length = strlen("Hello world"); - message_buf.value = (void *) "Hello world"; - - maj_stat = gss_verify_mic(&min_stat, server_context, - &message_buf, input_token, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_verify_mic failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - - maj_stat = gss_get_mic(&min_stat, server_context, - GSS_C_QOP_DEFAULT, &message_buf, output_token); - if (GSS_ERROR(maj_stat)) { - printf("gss_get_mic failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - break; - - case 3: - maj_stat = gss_unwrap(&min_stat, server_context, - input_token, &message_buf, NULL, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_unwrap failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - gss_release_buffer(&min_stat, &message_buf); - - message_buf.length = strlen("Hello world"); - message_buf.value = (void *) "Hello world"; - maj_stat = gss_wrap(&min_stat, server_context, - TRUE, GSS_C_QOP_DEFAULT, &message_buf, NULL, output_token); - if (GSS_ERROR(maj_stat)) { - printf("gss_wrap failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - break; - - case 4: - maj_stat = gss_unwrap(&min_stat, server_context, - input_token, &message_buf, NULL, NULL); - if (GSS_ERROR(maj_stat)) { - printf("gss_unwrap failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - gss_release_buffer(&min_stat, &message_buf); - - message_buf.length = strlen("Hello world"); - message_buf.value = (void *) "Hello world"; - maj_stat = gss_wrap(&min_stat, server_context, - FALSE, GSS_C_QOP_DEFAULT, &message_buf, NULL, output_token); - if (GSS_ERROR(maj_stat)) { - printf("gss_wrap failed\n"); - report_error(mech_type, maj_stat, min_stat); - goto out; - } - break; - - case 5: - error = 0; - goto out; - } - *maj_stat_res = maj_stat; - *min_stat_res = min_stat; - return (0); - -out: - *maj_stat_res = maj_stat; - *min_stat_res = min_stat; - if (server_context) - gss_delete_sec_context(&min_stat, &server_context, - GSS_C_NO_BUFFER); - if (server_cred) - gss_release_cred(&min_stat, &server_cred); - if (name) - gss_release_name(&min_stat, &name); - - return (error); -} - -/* - * Create an RPC client handle for the given (address,prog,vers) - * triple using UDP. - */ -static CLIENT * -gsstest_get_rpc(struct sockaddr *sa, rpcprog_t prog, rpcvers_t vers) -{ - struct thread *td = curthread; - const char* protofmly; - struct sockaddr_storage ss; - struct socket *so; - CLIENT *rpcb; - struct timeval timo; - RPCB parms; - char *uaddr; - enum clnt_stat stat = RPC_SUCCESS; - int rpcvers = RPCBVERS4; - bool_t do_tcp = FALSE; - struct portmap mapping; - u_short port = 0; - - /* - * First we need to contact the remote RPCBIND service to find - * the right port. - */ - memcpy(&ss, sa, sa->sa_len); - switch (ss.ss_family) { - case AF_INET: - ((struct sockaddr_in *)&ss)->sin_port = htons(111); - protofmly = "inet"; - socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td); - break; - -#ifdef INET6 - case AF_INET6: - ((struct sockaddr_in6 *)&ss)->sin6_port = htons(111); - protofmly = "inet6"; - socreate(AF_INET6, &so, SOCK_DGRAM, 0, td->td_ucred, td); - break; -#endif - - default: - /* - * Unsupported address family - fail. - */ - return (NULL); - } - - rpcb = clnt_dg_create(so, (struct sockaddr *)&ss, - RPCBPROG, rpcvers, 0, 0); - if (!rpcb) - return (NULL); - -try_tcp: - parms.r_prog = prog; - parms.r_vers = vers; - if (do_tcp) - parms.r_netid = "tcp"; - else - parms.r_netid = "udp"; - parms.r_addr = ""; - parms.r_owner = ""; - - /* - * Use the default timeout. - */ - timo.tv_sec = 25; - timo.tv_usec = 0; -again: - switch (rpcvers) { - case RPCBVERS4: - case RPCBVERS: - /* - * Try RPCBIND 4 then 3. - */ - uaddr = NULL; - stat = CLNT_CALL(rpcb, (rpcprog_t) RPCBPROC_GETADDR, - (xdrproc_t) xdr_rpcb, &parms, - (xdrproc_t) xdr_wrapstring, &uaddr, timo); - if (stat == RPC_PROGVERSMISMATCH) { - if (rpcvers == RPCBVERS4) - rpcvers = RPCBVERS; - else if (rpcvers == RPCBVERS) - rpcvers = PMAPVERS; - CLNT_CONTROL(rpcb, CLSET_VERS, &rpcvers); - goto again; - } else if (stat == RPC_SUCCESS) { - /* - * We have a reply from the remote RPCBIND - turn it - * into an appropriate address and make a new client - * that can talk to the remote service. - * - * XXX fixup IPv6 scope ID. - */ - struct netbuf *a; - a = __rpc_uaddr2taddr_af(ss.ss_family, uaddr); - xdr_free((xdrproc_t) xdr_wrapstring, &uaddr); - if (!a) { - CLNT_DESTROY(rpcb); - return (NULL); - } - memcpy(&ss, a->buf, a->len); - free(a->buf, M_RPC); - free(a, M_RPC); - } - break; - case PMAPVERS: - /* - * Try portmap. - */ - mapping.pm_prog = parms.r_prog; - mapping.pm_vers = parms.r_vers; - mapping.pm_prot = do_tcp ? IPPROTO_TCP : IPPROTO_UDP; - mapping.pm_port = 0; - - stat = CLNT_CALL(rpcb, (rpcprog_t) PMAPPROC_GETPORT, - (xdrproc_t) xdr_portmap, &mapping, - (xdrproc_t) xdr_u_short, &port, timo); - - if (stat == RPC_SUCCESS) { - switch (ss.ss_family) { - case AF_INET: - ((struct sockaddr_in *)&ss)->sin_port = - htons(port); - break; - -#ifdef INET6 - case AF_INET6: - ((struct sockaddr_in6 *)&ss)->sin6_port = - htons(port); - break; -#endif - } - } - break; - default: - panic("invalid rpcvers %d", rpcvers); - } - /* - * We may have a positive response from the portmapper, but - * the requested service was not found. Make sure we received - * a valid port. - */ - switch (ss.ss_family) { - case AF_INET: - port = ((struct sockaddr_in *)&ss)->sin_port; - break; -#ifdef INET6 - case AF_INET6: - port = ((struct sockaddr_in6 *)&ss)->sin6_port; - break; -#endif - } - if (stat != RPC_SUCCESS || !port) { - /* - * If we were able to talk to rpcbind or portmap, but the udp - * variant wasn't available, ask about tcp. - * - * XXX - We could also check for a TCP portmapper, but - * if the host is running a portmapper at all, we should be able - * to hail it over UDP. - */ - if (stat == RPC_SUCCESS && !do_tcp) { - do_tcp = TRUE; - goto try_tcp; - } - - /* Otherwise, bad news. */ - printf("gsstest_get_rpc: failed to contact remote rpcbind, " - "stat = %d, port = %d\n", - (int) stat, port); - CLNT_DESTROY(rpcb); - return (NULL); - } - - if (do_tcp) { - /* - * Destroy the UDP client we used to speak to rpcbind and - * recreate as a TCP client. - */ - struct netconfig *nconf = NULL; - - CLNT_DESTROY(rpcb); - - switch (ss.ss_family) { - case AF_INET: - nconf = getnetconfigent("tcp"); - break; -#ifdef INET6 - case AF_INET6: - nconf = getnetconfigent("tcp6"); - break; -#endif - } - - rpcb = clnt_reconnect_create(nconf, (struct sockaddr *)&ss, - prog, vers, 0, 0); - } else { - /* - * Re-use the client we used to speak to rpcbind. - */ - CLNT_CONTROL(rpcb, CLSET_SVC_ADDR, &ss); - CLNT_CONTROL(rpcb, CLSET_PROG, &prog); - CLNT_CONTROL(rpcb, CLSET_VERS, &vers); - } - - return (rpcb); -} - -/* - * RPCSEC_GSS client - */ -static int -gsstest_3(struct thread *td) -{ - struct sockaddr_in sin; - char service[128]; - CLIENT *client; - AUTH *auth; - rpc_gss_options_ret_t options_ret; - enum clnt_stat stat; - struct timeval tv; - rpc_gss_service_t svc; - int i; - - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - sin.sin_port = 0; - - client = gsstest_get_rpc((struct sockaddr *) &sin, 123456, 1); - if (!client) { - uprintf("Can't connect to service\n"); - return(1); - } - - memcpy(service, "host@", 5); - getcredhostname(td->td_ucred, service + 5, sizeof(service) - 5); - - auth = rpc_gss_seccreate(client, curthread->td_ucred, - service, "kerberosv5", rpc_gss_svc_privacy, - NULL, NULL, &options_ret); - if (!auth) { - gss_OID oid; - uprintf("Can't authorize to service (mech=%s)\n", - options_ret.actual_mechanism); - oid = GSS_C_NO_OID; - rpc_gss_mech_to_oid(options_ret.actual_mechanism, &oid); - report_error(oid, options_ret.major_status, - options_ret.minor_status); - CLNT_DESTROY(client); - return (1); - } - - for (svc = rpc_gss_svc_none; svc <= rpc_gss_svc_privacy; svc++) { - const char *svc_names[] = { - "rpc_gss_svc_default", - "rpc_gss_svc_none", - "rpc_gss_svc_integrity", - "rpc_gss_svc_privacy" - }; - int num; - - rpc_gss_set_defaults(auth, svc, NULL); - - client->cl_auth = auth; - tv.tv_sec = 5; - tv.tv_usec = 0; - for (i = 42; i < 142; i++) { - num = i; - stat = CLNT_CALL(client, 1, - (xdrproc_t) xdr_int, (char *) &num, - (xdrproc_t) xdr_int, (char *) &num, tv); - if (stat == RPC_SUCCESS) { - if (num != i + 100) - uprintf("unexpected reply %d\n", num); - } else { - uprintf("call failed, stat=%d\n", (int) stat); - break; - } - } - if (i == 142) - uprintf("call succeeded with %s\n", svc_names[svc]); - } - - AUTH_DESTROY(auth); - CLNT_RELEASE(client); - - return (0); -} - -/* - * RPCSEC_GSS server - */ -static rpc_gss_principal_t server_acl = NULL; -static bool_t server_new_context(struct svc_req *req, gss_cred_id_t deleg, - gss_ctx_id_t gss_context, rpc_gss_lock_t *lock, void **cookie); -static void server_program_1(struct svc_req *rqstp, register SVCXPRT *transp); - -static int -gsstest_4(struct thread *td) -{ - SVCPOOL *pool; - char principal[128 + 5]; - const char **mechs; - static rpc_gss_callback_t cb; - - memcpy(principal, "host@", 5); - getcredhostname(td->td_ucred, principal + 5, sizeof(principal) - 5); - - mechs = rpc_gss_get_mechanisms(); - while (*mechs) { - if (!rpc_gss_set_svc_name(principal, *mechs, GSS_C_INDEFINITE, - 123456, 1)) { - rpc_gss_error_t e; - - rpc_gss_get_error(&e); - printf("setting name for %s for %s failed: %d, %d\n", - principal, *mechs, - e.rpc_gss_error, e.system_error); - } - mechs++; - } - - cb.program = 123456; - cb.version = 1; - cb.callback = server_new_context; - rpc_gss_set_callback(&cb); - - pool = svcpool_create("gsstest", NULL); - - svc_create(pool, server_program_1, 123456, 1, NULL); - svc_run(pool); - - rpc_gss_clear_svc_name(123456, 1); - rpc_gss_clear_callback(&cb); - - svcpool_destroy(pool); - - return (0); -} - -static void -server_program_1(struct svc_req *rqstp, register SVCXPRT *transp) -{ - rpc_gss_rawcred_t *rcred; - rpc_gss_ucred_t *ucred; - int i, num; - - if (rqstp->rq_cred.oa_flavor != RPCSEC_GSS) { - svcerr_weakauth(rqstp); - return; - } - - if (!rpc_gss_getcred(rqstp, &rcred, &ucred, NULL)) { - svcerr_systemerr(rqstp); *** 210 LINES SKIPPED *** From nobody Thu Jan 9 04:04:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTB5527p7z5kdt7; Thu, 09 Jan 2025 04:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTB550Nlbz41fh; Thu, 9 Jan 2025 04:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXplcG/n4ganXUXf6XjlgyJKKd6NUZmHKj2MtLxgFDw=; b=Q2Z66DLlXvOtYjD2mp4RsBfTmUePgAR06oBsPGraUOhPXMG7vRjPMXU6EJI4kXrXFScRIh o6pgYGRCxf0PxVfue1f7kfJADT6c98RZgC7b0jYQaLna0zhTv2GKx/9yo2rRf6ojoglA3V uq5P1eh0XVMtYeEykeVAe3Af2ebZd3qdJsK1lR/jh8QoTQVpRPo1qNHW+nmLwFOr5Uxhp+ ht0HKjyJ9a2gUAyxb+EXtCKF7T6ipkeaBUjHthWm+oRZTbwlW2c6aSw3HMLZai95mOA+uL zBydzIFfB42eociWhlwJ6uXrEJBow15zl2wnQOXZak9QjjpbVMVRiyeq+MutQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXplcG/n4ganXUXf6XjlgyJKKd6NUZmHKj2MtLxgFDw=; b=YXPojA4T2Ro3655Lyc/mOx6Y75/jW5qntTOcKQP8sQ11wAxerhyDs5+b+dz/53loMrIHEi ujmRn7z7Csr5tn7LSjQcESbYN5jW7BSd1+YODnxaCB00QGhBqzheu+ErGGRIw7gYW9IwjI ijZgYME6Xzedd5GnsJ5F7iYlECGzdogX6SdKu/IfVblBM4fd062SfTwrmXDaKMbNXbGNuL jI4PeIB25RzeT1BU6oAedo5Rr6sd6E7sKmgPry/905wWTm3GpdEQ3WLgNY9RK7vJajLJFs qtxI1XfnCQQQxnwHPVCT1RvJEXfkN9JR1GQps0PeyWkWsQYRDzvD/8dDtI//7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736395497; a=rsa-sha256; cv=none; b=RdeyxbjoCLiH+JG/t0C00jq2jSBW/qaiMql/Awgn6BCQuJyU6SSm6trhq5lrqJoAfPwNmT nrkz50v+Uzmz2jraciw3K6GifmlnxqqacQ6yOYeVKnnlSYh3FRwKI8VOHlYNR743DTZOgU Qepf5BO5ND4RnWurZfDVqsJQlNDi9kBjDT0EoJeMLNsuAA2wxQCfR/7KXFF6klxS7EGv++ JtXkbzxhYepaT7PcTnbA1Kztkt7AC0YIZzJXW+WGSbra6lwsKgK5NycVOuje3BTedxuseg s6HbxdrBE52a7LV4NYaRH4FeJ2wQkRUVNvnaUp+WvVwqgqewVqx5QPcvr3YblQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTB5500J7z1Pcc; Thu, 09 Jan 2025 04:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50944uxY031223; Thu, 9 Jan 2025 04:04:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50944ure031220; Thu, 9 Jan 2025 04:04:56 GMT (envelope-from git) Date: Thu, 9 Jan 2025 04:04:56 GMT Message-Id: <202501090404.50944ure031220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3a0cdb2675e6 - main - rpc: clean kernel RPC internal headers of non-kernel declarations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a0cdb2675e64460be17e640fd871907163342e8 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3a0cdb2675e64460be17e640fd871907163342e8 commit 3a0cdb2675e64460be17e640fd871907163342e8 Author: Gleb Smirnoff AuthorDate: 2025-01-09 04:00:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-09 04:00:12 +0000 rpc: clean kernel RPC internal headers of non-kernel declarations The files svc.h and clnt.h derive from the same files that live in /usr/include, however there is nothing really shared between the kernel and libc RPC implementations. The kernel side files are not installed and there is no reason to pollute them with the old definititions. --- sys/rpc/clnt.h | 285 --------------------------------------------------------- sys/rpc/svc.h | 273 ------------------------------------------------------ 2 files changed, 558 deletions(-) diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h index da02137397f1..d9fc372709cf 100644 --- a/sys/rpc/clnt.h +++ b/sys/rpc/clnt.h @@ -41,12 +41,8 @@ #define _RPC_CLNT_H_ #include #include -#ifdef _KERNEL #include #include -#else -#include -#endif #include /* @@ -90,7 +86,6 @@ struct rpc_err { #define re_lb ru.RE_lb }; -#ifdef _KERNEL /* * Functions of this type may be used to receive notification when RPC * calls have to be re-transmitted etc. @@ -117,7 +112,6 @@ struct rpc_callextra { struct rpc_timers *rc_timers; /* optional RTT timers */ struct rpc_err rc_err; /* detailed call status */ }; -#endif /* * Client rpc handle. @@ -125,7 +119,6 @@ struct rpc_callextra { * Client is responsible for initializing auth, see e.g. auth_none.c. */ typedef struct __rpc_client { -#ifdef _KERNEL volatile u_int cl_refs; /* reference count */ AUTH *cl_auth; /* authenticator */ const struct clnt_ops { @@ -149,28 +142,6 @@ typedef struct __rpc_client { bool_t (*cl_control)(struct __rpc_client *, u_int, void *); } *cl_ops; -#else - AUTH *cl_auth; /* authenticator */ - struct clnt_ops { - /* call remote procedure */ - enum clnt_stat (*cl_call)(struct __rpc_client *, - rpcproc_t, xdrproc_t, void *, xdrproc_t, - void *, struct timeval); - /* abort a call */ - void (*cl_abort)(struct __rpc_client *); - /* get specific error code */ - void (*cl_geterr)(struct __rpc_client *, - struct rpc_err *); - /* frees results */ - bool_t (*cl_freeres)(struct __rpc_client *, - xdrproc_t, void *); - /* destroy this structure */ - void (*cl_destroy)(struct __rpc_client *); - /* the ioctl() of rpc */ - bool_t (*cl_control)(struct __rpc_client *, u_int, - void *); - } *cl_ops; -#endif void *cl_private; /* private stuff */ char *cl_netid; /* network token */ char *cl_tp; /* device name */ @@ -198,7 +169,6 @@ typedef struct __rpc_client { * */ -#ifdef _KERNEL #define CLNT_ACQUIRE(rh) \ refcount_acquire(&(rh)->cl_refs) #define CLNT_RELEASE(rh) \ @@ -246,7 +216,6 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLNT_CALL_EXT(rh, ext, proc, xargs, argsp, xres, resp, secs) \ clnt_call_private(rh, ext, proc, xargs, \ argsp, xres, resp, secs) -#endif /* * enum clnt_stat @@ -259,21 +228,12 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, * void *resp; * struct timeval timeout; */ -#ifdef _KERNEL #define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ clnt_call_private(rh, NULL, proc, xargs, \ argsp, xres, resp, secs) #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ clnt_call_private(rh, NULL, proc, xargs, \ argsp, xres, resp, secs) -#else -#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \ - argsp, xres, resp, secs)) -#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \ - argsp, xres, resp, secs)) -#endif /* * void @@ -339,7 +299,6 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLSET_ASYNC 19 #define CLSET_CONNECT 20 /* Use connect() for UDP. (int) */ -#ifdef _KERNEL /* * Kernel control operations. The default msleep string is "rpcrecv", * and sleeps are non-interruptible by default. @@ -362,8 +321,6 @@ struct rpc_reconupcall { void *arg; }; #define CLSET_RECONUPCALL 33 /* Reconnect upcall */ -#endif - /* * void @@ -402,8 +359,6 @@ struct rpc_reconupcall { * belong to the nettype namespace (/etc/netconfig). */ __BEGIN_DECLS -#ifdef _KERNEL - /* * struct socket *so; -- socket * struct sockaddr *svcaddr; -- servers address @@ -440,156 +395,6 @@ extern CLIENT *clnt_vc_create(struct socket *so, extern CLIENT *clnt_reconnect_create(struct netconfig *nconf, struct sockaddr *svcaddr, rpcprog_t program, rpcvers_t version, size_t sendsz, size_t recvsz); - -#else - -extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t, - const char *); -/* - * - * const char *hostname; -- hostname - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const char *nettype; -- network type - */ - - /* - * Generic client creation routine. Just like clnt_create(), except - * it takes an additional timeout parameter. - */ -extern CLIENT * clnt_create_timed(const char *, const rpcprog_t, - const rpcvers_t, const char *, const struct timeval *); -/* - * - * const char *hostname; -- hostname - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const char *nettype; -- network type - * const struct timeval *tp; -- timeout - */ - -/* - * Generic client creation routine. Supported protocols are which belong - * to the nettype name space. - */ -extern CLIENT *clnt_create_vers(const char *, const rpcprog_t, rpcvers_t *, - const rpcvers_t, const rpcvers_t, - const char *); -/* - * const char *host; -- hostname - * const rpcprog_t prog; -- program number - * rpcvers_t *vers_out; -- servers highest available version - * const rpcvers_t vers_low; -- low version number - * const rpcvers_t vers_high; -- high version number - * const char *nettype; -- network type - */ - -/* - * Generic client creation routine. Supported protocols are which belong - * to the nettype name space. - */ -extern CLIENT * clnt_create_vers_timed(const char *, const rpcprog_t, - rpcvers_t *, const rpcvers_t, const rpcvers_t, const char *, - const struct timeval *); -/* - * const char *host; -- hostname - * const rpcprog_t prog; -- program number - * rpcvers_t *vers_out; -- servers highest available version - * const rpcvers_t vers_low; -- low version number - * const rpcvers_t vers_high; -- high version number - * const char *nettype; -- network type - * const struct timeval *tp -- timeout - */ - -/* - * Generic client creation routine. It takes a netconfig structure - * instead of nettype - */ -extern CLIENT *clnt_tp_create(const char *, const rpcprog_t, - const rpcvers_t, const struct netconfig *); -/* - * const char *hostname; -- hostname - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const struct netconfig *netconf; -- network config structure - */ - -/* - * Generic client creation routine. Just like clnt_tp_create(), except - * it takes an additional timeout parameter. - */ -extern CLIENT * clnt_tp_create_timed(const char *, const rpcprog_t, - const rpcvers_t, const struct netconfig *, const struct timeval *); -/* - * const char *hostname; -- hostname - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const struct netconfig *netconf; -- network config structure - * const struct timeval *tp -- timeout - */ - -/* - * Generic TLI create routine. Only provided for compatibility. - */ - -extern CLIENT *clnt_tli_create(const int, const struct netconfig *, - struct netbuf *, const rpcprog_t, - const rpcvers_t, const u_int, const u_int); -/* - * const int fd; -- fd - * const struct netconfig *nconf; -- netconfig structure - * struct netbuf *svcaddr; -- servers address - * const u_long prog; -- program number - * const u_long vers; -- version number - * const u_int sendsz; -- send size - * const u_int recvsz; -- recv size - */ - -/* - * Low level clnt create routine for connectionful transports, e.g. tcp. - */ -extern CLIENT *clnt_vc_create(const int, const struct netbuf *, - const rpcprog_t, const rpcvers_t, - u_int, u_int); -/* - * Added for compatibility to old rpc 4.0. Obsoleted by clnt_vc_create(). - */ -extern CLIENT *clntunix_create(struct sockaddr_un *, - u_long, u_long, int *, u_int, u_int); -/* - * const int fd; -- open file descriptor - * const struct netbuf *svcaddr; -- servers address - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const u_int sendsz; -- buffer recv size - * const u_int recvsz; -- buffer send size - */ - -/* - * Low level clnt create routine for connectionless transports, e.g. udp. - */ -extern CLIENT *clnt_dg_create(const int, const struct netbuf *, - const rpcprog_t, const rpcvers_t, - const u_int, const u_int); -/* - * const int fd; -- open file descriptor - * const struct netbuf *svcaddr; -- servers address - * const rpcprog_t program; -- program number - * const rpcvers_t version; -- version number - * const u_int sendsz; -- buffer recv size - * const u_int recvsz; -- buffer send size - */ - -/* - * Memory based rpc (for speed check and testing) - * CLIENT * - * clnt_raw_create(prog, vers) - * u_long prog; - * u_long vers; - */ -extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t); -#endif - __END_DECLS @@ -626,96 +431,6 @@ struct rpc_createerr { struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ }; -#ifdef _KERNEL extern struct rpc_createerr rpc_createerr; -#else -__BEGIN_DECLS -extern struct rpc_createerr *__rpc_createerr(void); -__END_DECLS -#define rpc_createerr (*(__rpc_createerr())) -#endif - -#ifndef _KERNEL -/* - * The simplified interface: - * enum clnt_stat - * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) - * const char *host; - * const rpcprog_t prognum; - * const rpcvers_t versnum; - * const rpcproc_t procnum; - * const xdrproc_t inproc, outproc; - * const char *in; - * char *out; - * const char *nettype; - */ -__BEGIN_DECLS -extern enum clnt_stat rpc_call(const char *, const rpcprog_t, - const rpcvers_t, const rpcproc_t, - const xdrproc_t, const char *, - const xdrproc_t, char *, const char *); -__END_DECLS - -/* - * RPC broadcast interface - * The call is broadcasted to all locally connected nets. - * - * extern enum clnt_stat - * rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, - * eachresult, nettype) - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const rpcproc_t proc; -- procedure number - * const xdrproc_t xargs; -- xdr routine for args - * caddr_t argsp; -- pointer to args - * const xdrproc_t xresults; -- xdr routine for results - * caddr_t resultsp; -- pointer to results - * const resultproc_t eachresult; -- call with each result - * const char *nettype; -- Transport type - * - * For each valid response received, the procedure eachresult is called. - * Its form is: - * done = eachresult(resp, raddr, nconf) - * bool_t done; - * caddr_t resp; - * struct netbuf *raddr; - * struct netconfig *nconf; - * where resp points to the results of the call and raddr is the - * address if the responder to the broadcast. nconf is the transport - * on which the response was received. - * - * extern enum clnt_stat - * rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, - * eachresult, inittime, waittime, nettype) - * const rpcprog_t prog; -- program number - * const rpcvers_t vers; -- version number - * const rpcproc_t proc; -- procedure number - * const xdrproc_t xargs; -- xdr routine for args - * caddr_t argsp; -- pointer to args - * const xdrproc_t xresults; -- xdr routine for results - * caddr_t resultsp; -- pointer to results - * const resultproc_t eachresult; -- call with each result - * const int inittime; -- how long to wait initially - * const int waittime; -- maximum time to wait - * const char *nettype; -- Transport type - */ - -typedef bool_t (*resultproc_t)(caddr_t, ...); - -__BEGIN_DECLS -extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t, - const rpcproc_t, const xdrproc_t, - caddr_t, const xdrproc_t, caddr_t, - const resultproc_t, const char *); -extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t, - const rpcproc_t, const xdrproc_t, - caddr_t, const xdrproc_t, caddr_t, - const resultproc_t, const int, - const int, const char *); -__END_DECLS - -/* For backward compatibility */ -#include -#endif #endif /* !_RPC_CLNT_H_ */ diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index 43a388984c00..d8a8d0139cc4 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -40,14 +40,12 @@ #define _RPC_SVC_H #include -#ifdef _KERNEL #include #include #include #include #include #include -#endif /* * This interface must manage two items concerning remote procedure calling: @@ -95,7 +93,6 @@ struct __rpc_svcxprt; struct mbuf; struct xp_ops { -#ifdef _KERNEL /* receive incoming requests */ bool_t (*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *, struct sockaddr **, struct mbuf **); @@ -110,34 +107,11 @@ struct xp_ops { void (*xp_destroy)(struct __rpc_svcxprt *); /* catch-all function */ bool_t (*xp_control)(struct __rpc_svcxprt *, const u_int, void *); -#else - /* receive incoming requests */ - bool_t (*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *); - /* get transport status */ - enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *); - /* get arguments */ - bool_t (*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t, void *); - /* send reply */ - bool_t (*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *); - /* free mem allocated for args */ - bool_t (*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t, void *); - /* destroy this struct */ - void (*xp_destroy)(struct __rpc_svcxprt *); -#endif }; -#ifndef _KERNEL -struct xp_ops2 { - /* catch-all function */ - bool_t (*xp_control)(struct __rpc_svcxprt *, const u_int, void *); -}; -#endif - -#ifdef _KERNEL struct __rpc_svcpool; struct __rpc_svcgroup; struct __rpc_svcthread; -#endif /* * Server side transport handle. In the kernel, transports have a @@ -151,7 +125,6 @@ struct __rpc_svcthread; * end for callbacks). */ typedef struct __rpc_svcxprt { -#ifdef _KERNEL volatile u_int xp_refs; struct sx xp_lock; struct __rpc_svcpool *xp_pool; /* owning pool (see below) */ @@ -186,24 +159,6 @@ typedef struct __rpc_svcxprt { uid_t xp_uid; gid_t *xp_gidp; int xp_doneddp; -#else - int xp_fd; - u_short xp_port; /* associated port number */ - const struct xp_ops *xp_ops; - int xp_addrlen; /* length of remote address */ - struct sockaddr_in xp_raddr; /* remote addr. (backward ABI compat) */ - /* XXX - fvdl stick this here for ABI backward compat reasons */ - const struct xp_ops2 *xp_ops2; - char *xp_tp; /* transport provider device name */ - char *xp_netid; /* network token */ - struct netbuf xp_ltaddr; /* local transport address */ - struct netbuf xp_rtaddr; /* remote transport address */ - struct opaque_auth xp_verf; /* raw response verifier */ - void *xp_p1; /* private: for use by svc ops */ - void *xp_p2; /* private: for use by svc ops */ - void *xp_p3; /* private: for use by svc lib */ - int xp_type; /* transport type */ -#endif } SVCXPRT; /* @@ -211,16 +166,9 @@ typedef struct __rpc_svcxprt { */ typedef struct __rpc_svcauth { const struct svc_auth_ops { -#ifdef _KERNEL int (*svc_ah_wrap)(struct __rpc_svcauth *, struct mbuf **); int (*svc_ah_unwrap)(struct __rpc_svcauth *, struct mbuf **); void (*svc_ah_release)(struct __rpc_svcauth *); -#else - int (*svc_ah_wrap)(struct __rpc_svcauth *, XDR *, - xdrproc_t, caddr_t); - int (*svc_ah_unwrap)(struct __rpc_svcauth *, XDR *, - xdrproc_t, caddr_t); -#endif } *svc_ah_ops; void *svc_ah_private; } SVCAUTH; @@ -233,8 +181,6 @@ typedef struct __rpc_svcxprt_ext { SVCAUTH xp_auth; /* interface to auth methods */ } SVCXPRT_EXT; -#ifdef _KERNEL - /* * The services list * Each entry represents a set of procedures (an rpc program). @@ -399,27 +345,6 @@ typedef struct __rpc_svcpool { SVCGROUP sp_groups[SVC_MAXGROUPS]; /* Thread/port groups. */ } SVCPOOL; -#else - -/* - * Service request - */ -struct svc_req { - uint32_t rq_prog; /* service program number */ - uint32_t rq_vers; /* service protocol version */ - uint32_t rq_proc; /* the desired procedure */ - struct opaque_auth rq_cred; /* raw creds from the wire */ - void *rq_clntcred; /* read only cooked cred */ - SVCXPRT *rq_xprt; /* associated transport */ -}; - -/* - * Approved way of getting address of caller - */ -#define svc_getrpccaller(x) (&(x)->xp_rtaddr) - -#endif - /* * Operations defined on an SVCXPRT handle * @@ -428,8 +353,6 @@ struct svc_req { * xdrproc_t xargs; * void * argsp; */ -#ifdef _KERNEL - #define SVC_ACQUIRE(xprt) \ refcount_acquire(&(xprt)->xp_refs) @@ -456,43 +379,6 @@ struct svc_req { #define SVC_CONTROL(xprt, rq, in) \ (*(xprt)->xp_ops->xp_control)((xprt), (rq), (in)) -#else - -#define SVC_RECV(xprt, msg) \ - (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) -#define svc_recv(xprt, msg) \ - (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) - -#define SVC_STAT(xprt) \ - (*(xprt)->xp_ops->xp_stat)(xprt) -#define svc_stat(xprt) \ - (*(xprt)->xp_ops->xp_stat)(xprt) - -#define SVC_GETARGS(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) -#define svc_getargs(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) - -#define SVC_REPLY(xprt, msg) \ - (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) -#define svc_reply(xprt, msg) \ - (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) - -#define SVC_FREEARGS(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) -#define svc_freeargs(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) - -#define SVC_DESTROY(xprt) \ - (*(xprt)->xp_ops->xp_destroy)(xprt) -#define svc_destroy(xprt) \ - (*(xprt)->xp_ops->xp_destroy)(xprt) - -#define SVC_CONTROL(xprt, rq, in) \ - (*(xprt)->xp_ops2->xp_control)((xprt), (rq), (in)) - -#endif - #define SVC_EXT(xprt) \ ((SVCXPRT_EXT *) xprt->xp_p3) @@ -502,19 +388,12 @@ struct svc_req { /* * Operations defined on an SVCAUTH handle */ -#ifdef _KERNEL #define SVCAUTH_WRAP(auth, mp) \ ((auth)->svc_ah_ops->svc_ah_wrap(auth, mp)) #define SVCAUTH_UNWRAP(auth, mp) \ ((auth)->svc_ah_ops->svc_ah_unwrap(auth, mp)) #define SVCAUTH_RELEASE(auth) \ ((auth)->svc_ah_ops->svc_ah_release(auth)) -#else -#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ - ((auth)->svc_ah_ops->svc_ah_wrap(auth, xdrs, xfunc, xwhere)) -#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ - ((auth)->svc_ah_ops->svc_ah_unwrap(auth, xdrs, xfunc, xwhere)) -#endif /* * Service registration @@ -542,14 +421,9 @@ __END_DECLS */ __BEGIN_DECLS -#ifdef _KERNEL extern void svc_unreg(SVCPOOL *, const rpcprog_t, const rpcvers_t); -#else -extern void svc_unreg(const rpcprog_t, const rpcvers_t); -#endif __END_DECLS -#ifdef _KERNEL /* * Service connection loss registration * @@ -573,7 +447,6 @@ __END_DECLS __BEGIN_DECLS extern void svc_loss_unreg(SVCPOOL *, void (*)(SVCXPRT *)); __END_DECLS -#endif /* * Transport registration. @@ -596,8 +469,6 @@ extern void xprt_unregister(SVCXPRT *); extern void __xprt_unregister_unlocked(SVCXPRT *); __END_DECLS -#ifdef _KERNEL - /* * Called when a transport has pending requests. */ @@ -608,8 +479,6 @@ extern void xprt_inactive_locked(SVCXPRT *); extern void xprt_inactive_self(SVCXPRT *); __END_DECLS -#endif - /* * When the service routine is called, it must first check to see if it * knows about the procedure; if not, it should call svcerr_noproc @@ -637,7 +506,6 @@ __END_DECLS */ __BEGIN_DECLS -#ifdef _KERNEL extern bool_t svc_sendreply(struct svc_req *, xdrproc_t, void *); extern bool_t svc_sendreply_mbuf(struct svc_req *, struct mbuf *); extern void svcerr_decode(struct svc_req *); @@ -647,16 +515,6 @@ extern void svcerr_progvers(struct svc_req *, rpcvers_t, rpcvers_t); extern void svcerr_auth(struct svc_req *, enum auth_stat); extern void svcerr_noprog(struct svc_req *); extern void svcerr_systemerr(struct svc_req *); -#else -extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *); -extern void svcerr_decode(SVCXPRT *); -extern void svcerr_weakauth(SVCXPRT *); -extern void svcerr_noproc(SVCXPRT *); -extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); -extern void svcerr_auth(SVCXPRT *, enum auth_stat); -extern void svcerr_noprog(SVCXPRT *); -extern void svcerr_systemerr(SVCXPRT *); -#endif extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t, char *(*)(char *), xdrproc_t, xdrproc_t, char *); @@ -673,20 +531,6 @@ __END_DECLS * "in-place" results of a select system call (see select, section 2). */ -#ifndef _KERNEL -/* - * Global keeper of rpc service descriptors in use - * dynamic; must be inspected before each call to select - */ -extern int svc_maxfd; -#ifdef FD_SETSIZE -extern fd_set svc_fdset; -#define svc_fds svc_fdset.fds_bits[0] /* compatibility */ -#else -extern int svc_fds; -#endif /* def FD_SETSIZE */ -#endif - /* * a small program implemented by the svc_rpc implementation itself; * also see clnt.h for protocol numbers. @@ -698,22 +542,11 @@ __END_DECLS __BEGIN_DECLS extern SVCXPRT *svc_xprt_alloc(void); extern void svc_xprt_free(SVCXPRT *); -#ifndef _KERNEL -extern void svc_getreq(int); -extern void svc_getreqset(fd_set *); -extern void svc_getreq_common(int); -struct pollfd; -extern void svc_getreq_poll(struct pollfd *, int); -extern void svc_run(void); -extern void svc_exit(void); -#else extern void svc_run(SVCPOOL *); extern void svc_exit(SVCPOOL *); extern bool_t svc_getargs(struct svc_req *, xdrproc_t, void *); extern bool_t svc_freeargs(struct svc_req *, xdrproc_t, void *); extern void svc_freereq(struct svc_req *); - -#endif __END_DECLS /* @@ -728,8 +561,6 @@ __END_DECLS __BEGIN_DECLS -#ifdef _KERNEL - /* * Create a new service pool. */ @@ -812,110 +643,6 @@ extern SVCXPRT *svc_tli_create(SVCPOOL *, const struct netconfig *, * const size_t sendsz; -- max sendsize * const size_t recvsz; -- max recvsize */ - -#else /* !_KERNEL */ - -/* - * Transport independent svc_create routine. - */ -extern int svc_create(void (*)(struct svc_req *, SVCXPRT *), - const rpcprog_t, const rpcvers_t, const char *); -/* - * void (*dispatch)(); -- dispatch routine - * const rpcprog_t prognum; -- program number - * const rpcvers_t versnum; -- version number - * const char *nettype; -- network type - */ - - -/* - * Generic server creation routine. It takes a netconfig structure - * instead of a nettype. - */ - -extern SVCXPRT *svc_tp_create(void (*)(struct svc_req *, SVCXPRT *), - const rpcprog_t, const rpcvers_t, - const struct netconfig *); - /* - * void (*dispatch)(); -- dispatch routine - * const rpcprog_t prognum; -- program number - * const rpcvers_t versnum; -- version number - * const struct netconfig *nconf; -- netconfig structure - */ - -/* - * Generic TLI create routine - */ -extern SVCXPRT *svc_tli_create(const int, const struct netconfig *, - const struct t_bind *, const u_int, - const u_int); -/* - * const int fd; -- connection end point - * const struct netconfig *nconf; -- netconfig structure for network - * const struct t_bind *bindaddr; -- local bind address - * const u_int sendsz; -- max sendsize - * const u_int recvsz; -- max recvsize - */ - -/* - * Connectionless and connectionful create routines - */ - -extern SVCXPRT *svc_vc_create(const int, const u_int, const u_int); -/* - * const int fd; -- open connection end point - * const u_int sendsize; -- max send size - * const u_int recvsize; -- max recv size - */ - -/* - * Added for compatibility to old rpc 4.0. Obsoleted by svc_vc_create(). - */ -extern SVCXPRT *svcunix_create(int, u_int, u_int, char *); - -extern SVCXPRT *svc_dg_create(const int, const u_int, const u_int); - /* - * const int fd; -- open connection - * const u_int sendsize; -- max send size - * const u_int recvsize; -- max recv size - */ - - -/* - * the routine takes any *open* connection - * descriptor as its first input and is used for open connections. - */ -extern SVCXPRT *svc_fd_create(const int, const u_int, const u_int); -/* - * const int fd; -- open connection end point - * const u_int sendsize; -- max send size - * const u_int recvsize; -- max recv size - */ - -/* - * Added for compatibility to old rpc 4.0. Obsoleted by svc_fd_create(). - */ -extern SVCXPRT *svcunixfd_create(int, u_int, u_int); - -/* - * Memory based rpc (for speed check and testing) - */ -extern SVCXPRT *svc_raw_create(void); - -/* - * svc_dg_enable_cache() enables the cache on dg transports. - */ -int svc_dg_enablecache(SVCXPRT *, const u_int); - -int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid); - -#endif /* !_KERNEL */ - __END_DECLS -#ifndef _KERNEL -/* for backward compatibility */ -#include -#endif - #endif /* !_RPC_SVC_H */ From nobody Thu Jan 9 04:04:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTB563BMbz5kdrB; Thu, 09 Jan 2025 04:04:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTB5614skz41ZK; Thu, 9 Jan 2025 04:04:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dBgUUv0FbyhiEawfwFik4OnXVNj2g7TKq4UcsjCKYys=; b=HCEhAo4j94wombGU33lj57GJ51XCVYmJqO6nQ5J3SMpiFa90v/1admfrQIeDX7B9n/A+HD DFc9OX65BE0f8cIV/oafUuKy4k004bbruKjEpPLVnWFBgLO3wLJCIW/91NqhQJCjTK1+Ez CEYWn5Zoc3uQmHTR/6dXjyp3DAKLXb9gMH+eXe7/W0dDWuCncmRUo6dDOxdSO2flLdcPSP 4qUv+vie5zI1kH8jnGZtnhL+hyCTkfv1fSOk6SJ6SA54QOx+sdduNjfrnl7bXHEW8cOqK7 MxvdSepuaN5AiHV+iRVCd2hd7G6qTKVzCsU+VWSLPXuJLZw+zMm2rvFWatPfCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dBgUUv0FbyhiEawfwFik4OnXVNj2g7TKq4UcsjCKYys=; b=rRnA992vSTtGiq6Zwb2v1qqhju56FTVsCRB+qZv1wmz8X9DgRvUOE8qQIfI0DJZMsI+sqP dBZYLH7iGPE6KzTOLf7vsfgY6GdPZkldaj1sd5r9bECNZh2WlzEsFf92MAqLmAtFsJkFN4 dUnHA7xUYe2R9uWpGS+RgOjY+rV2na1MXCZqv8cEIbLNWYUOrFbumaW9rI68/VDmMAprKq ilJu6vRpmqXnuBFao/+TxJvQno42KThQ8e4SbrMhyqyBgpEIxjKMe+U/F2Z+vrM68aYD+u J3OAN2oVjK0uaWAXoXvdn9Kns6fBPzEWNcCfNXueiZ6GPnW9yBowwlSg7/zl2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736395498; a=rsa-sha256; cv=none; b=uBi4jv5dq18DuVTtRgmN0vKmXuARovxf7fH4EF+c4h3cyZJnV4D/AY3OjknOvnRKNWRFDu cFLAEzh+20fSCLF/0mSYXc64zWcqU/mUbjuxa0v80HeN8fWdi5tFrxFuNdPiJH6DrhWMYL cCsTbE2+yTS1Kjd62wAc7Ke96pvLyi4TzZULp5FzZRM2fbB7fD6rfbkMH/NoLgf3oDv3Vi 8ndapxSZlUNP2s/GD3ofjylg6jC+fo6B2QBHprcY5jTvoNKv57C+imDzZzlfOoS3qN+Wt0 FQ4/7lSVuhlSODpAHlE8a1ke6bMsGUfne2IkNou9UcYJKTZuJIcNYLqW/DjNDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTB560hY2z1Pbq; Thu, 09 Jan 2025 04:04:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50944wbI031271; Thu, 9 Jan 2025 04:04:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50944wOs031268; Thu, 9 Jan 2025 04:04:58 GMT (envelope-from git) Date: Thu, 9 Jan 2025 04:04:58 GMT Message-Id: <202501090404.50944wOs031268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: ebb36fcaae4d - main - rpc: remove svc_create(), it is not used List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ebb36fcaae4dfd3720e43f8e6a9613e5d84227e0 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ebb36fcaae4dfd3720e43f8e6a9613e5d84227e0 commit ebb36fcaae4dfd3720e43f8e6a9613e5d84227e0 Author: Gleb Smirnoff AuthorDate: 2025-01-09 04:00:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-09 04:00:12 +0000 rpc: remove svc_create(), it is not used --- sys/rpc/svc.h | 13 ---------- sys/rpc/svc_generic.c | 70 --------------------------------------------------- 2 files changed, 83 deletions(-) diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index d8a8d0139cc4..92755a198488 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -578,19 +578,6 @@ extern void svcpool_destroy(SVCPOOL *pool); */ extern void svcpool_close(SVCPOOL *pool); -/* - * Transport independent svc_create routine. - */ -extern int svc_create(SVCPOOL *, void (*)(struct svc_req *, SVCXPRT *), - const rpcprog_t, const rpcvers_t, const char *); -/* - * void (*dispatch)(); -- dispatch routine - * const rpcprog_t prognum; -- program number - * const rpcvers_t versnum; -- version number - * const char *nettype; -- network type - */ - - /* * Generic server creation routine. It takes a netconfig structure * instead of a nettype. diff --git a/sys/rpc/svc_generic.c b/sys/rpc/svc_generic.c index 6fb43dc5c940..12c96eca27c8 100644 --- a/sys/rpc/svc_generic.c +++ b/sys/rpc/svc_generic.c @@ -64,76 +64,6 @@ extern int __svc_vc_setflag(SVCXPRT *, int); -/* - * The highest level interface for server creation. - * It tries for all the nettokens in that particular class of token - * and returns the number of handles it can create and/or find. - * - * It creates a link list of all the handles it could create. - * If svc_create() is called multiple times, it uses the handle - * created earlier instead of creating a new handle every time. - */ -int -svc_create( - SVCPOOL *pool, - void (*dispatch)(struct svc_req *, SVCXPRT *), - rpcprog_t prognum, /* Program number */ - rpcvers_t versnum, /* Version number */ - const char *nettype) /* Networktype token */ -{ - int g, num = 0; - SVCGROUP *grp; - SVCXPRT *xprt; - struct netconfig *nconf; - void *handle; - - if ((handle = __rpc_setconf(nettype)) == NULL) { - printf("svc_create: unknown protocol"); - return (0); - } - while ((nconf = __rpc_getconf(handle)) != NULL) { - for (g = 0; g < SVC_MAXGROUPS; g++) { - grp = &pool->sp_groups[g]; - mtx_lock(&grp->sg_lock); - TAILQ_FOREACH(xprt, &grp->sg_xlist, xp_link) { - if (strcmp(xprt->xp_netid, nconf->nc_netid)) - continue; - /* Found an old one, use it */ - mtx_unlock(&grp->sg_lock); - (void) rpcb_unset(prognum, versnum, nconf); - if (svc_reg(xprt, prognum, versnum, - dispatch, nconf) == FALSE) { - printf( - "svc_create: could not register prog %u vers %u on %s\n", - (unsigned)prognum, (unsigned)versnum, - nconf->nc_netid); - mtx_lock(&grp->sg_lock); - } else { - num++; - mtx_lock(&grp->sg_lock); - break; - } - } - mtx_unlock(&grp->sg_lock); - } - if (xprt == NULL) { - /* It was not found. Now create a new one */ - xprt = svc_tp_create(pool, dispatch, prognum, versnum, - NULL, nconf); - if (xprt) { - num++; - SVC_RELEASE(xprt); - } - } - } - __rpc_endconf(handle); - /* - * In case of num == 0; the error messages are generated by the - * underlying layers; and hence not needed here. - */ - return (num); -} - /* * The high level interface to svc_tli_create(). * It tries to create a server for "nconf" and registers the service From nobody Thu Jan 9 04:04:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTB575g4yz5kdnM; Thu, 09 Jan 2025 04:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTB572bYRz41fj; Thu, 9 Jan 2025 04:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e4Tz7ChW5HB7sx8XpdQ96U4aXckZ3jiEKhVCiZNVIDo=; b=gF2i9FuSJIyae9Fbg6CEA/ellaJsULSHufZqbVpzt2/9bqI9glX4H9h7dW6hWvV2NZLuXY DqEbIFM9MwTrqi51/mqHKMrFF5NELEG61qxcYdXXMpUGBv+qa24/6KN9jau3tZLxit1aCY Yny0jSED4b/uwe/nnzKWxwDGIuXe3cqNDy9PgWu6YBGFd1ssKSR9cqS/5IrqdimLzkJBnf ivwP4oWSbRR4yZgCOrmcmYswDBK72izbKyYY7/eI9xkyP7qfhn2PNQK9k9NbGAY+gxBK7G HxSJhjMrd6Uhd3XVkeyUiw7/nrhN5sfo9Q43Fxku4X7842mDbNSd8tp8VAHcGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736395499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e4Tz7ChW5HB7sx8XpdQ96U4aXckZ3jiEKhVCiZNVIDo=; b=WQJ2uYRXADchdxIlxGJ9thbU8DQbA3AbJiBWzxl3O2rozFHdmwClgKRdsixyax0bFnd3Wv p6dt5Ex6Nyl2mcnPAj3fiBsWXXMwPfo1pk0NJDyIiKKiGPdQnmlFbWkDopsilc7GxoZU8I ZtViftID4ts2V0kgo3NYE7eR0nQHRDOyVnF7hqvRFvRjQ/6v0Ck8lZkPhAYMO3A79AMGft UzH7xaveXj94bYT5cMt12C7Nx6CXparMfAN2JhgZWWeGMmCBSqzjRMXz8ZRyB4DOv9OFp1 Hhk4In7G/hjjtzMyfHorbN84dBVemiX+gDy2Fi5gL8699npitUWY7UYdTmR+vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736395499; a=rsa-sha256; cv=none; b=ThTUbPPlWxmmmMC1UgpdT6upe0d6xfLMZjVNcvd7JLqXltC8bMm3P5fSlPSBooRyq/MWrN CT69KZ2cddlAlAcJHM/TVKobezourax+sbTD/D+/TsmnwjkK8gy6oQEkCUYrqFXGNoTnq/ c2bk/E6Er463XS42Y0AH/Cs8rKAB8C3h75ntLNyba45mWBRkT5xErlJB9POTqO38Xlm28J FvKP8m/CtUSAs5zj++JAzEXi3RKwqjodgUcEjddIUKlo8xFl3lnQfvasE+Kx/JrBuQwARJ ert9Slg0Py561AiWt5wNlGeSWNwU6S7wWJ27sp7lKBtlVax2xLHbJ/dnd558Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTB57203qz1P9M; Thu, 09 Jan 2025 04:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50944xmw031333; Thu, 9 Jan 2025 04:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50944xSk031330; Thu, 9 Jan 2025 04:04:59 GMT (envelope-from git) Date: Thu, 9 Jan 2025 04:04:59 GMT Message-Id: <202501090404.50944xSk031330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 8e8f8d86e305 - main - rpcbind: remove extraneous check for nconf not being unix(4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e8f8d86e305fe1e90fcfc64c1958e61b359f4f4 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8f8d86e305fe1e90fcfc64c1958e61b359f4f4 commit 8e8f8d86e305fe1e90fcfc64c1958e61b359f4f4 Author: Gleb Smirnoff AuthorDate: 2025-01-09 04:00:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-09 04:00:12 +0000 rpcbind: remove extraneous check for nconf not being unix(4) We are already inside an if block with exactly same predicate. --- usr.sbin/rpcbind/rpcbind.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index 44adae366bed..a836afd24009 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -416,18 +416,14 @@ init_transport(struct netconfig *nconf) */ if (strcmp("*", hosts[nhostsbak]) == 0) hosts[nhostsbak] = NULL; - if ((strcmp(nconf->nc_netid, "local") != 0) && - (strcmp(nconf->nc_netid, "unix") != 0)) { - if ((aicode = getaddrinfo(hosts[nhostsbak], - servname, &hints, &res)) != 0) { - syslog(LOG_ERR, - "cannot get local address for %s: %s", + if ((aicode = getaddrinfo(hosts[nhostsbak], servname, &hints, + &res)) != 0) { + syslog(LOG_ERR, "cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode)); continue; - } - addrlen = res->ai_addrlen; - sa = (struct sockaddr *)res->ai_addr; } + addrlen = res->ai_addrlen; + sa = (struct sockaddr *)res->ai_addr; oldmask = umask(S_IXUSR|S_IXGRP|S_IXOTH); if (bind(fd, sa, addrlen) != 0) { syslog(LOG_ERR, "cannot bind %s on %s: %m", From nobody Thu Jan 9 05:29:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTCyX26Brz5k3FW; Thu, 09 Jan 2025 05:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTCyW5hh9z4FR2; Thu, 9 Jan 2025 05:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736400563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VlFSGuhHrZKhhwkX9OsMIE79vU97eXT1pSuR+6FUskI=; b=uyQ3kXHPHfoBTDiMZ95gSt9lgH9Lzya874dDpvou3GeMKHC07ZDfc3bNR1wpwUST4NqGS/ OU2x02NEH6e7vJ4PktmZ7bl0rFEAzi4UMAQkRm5g0mA5QUl1oskMTYEfczQYVLma6tZUVt IZazumXur1EpHL9FJBkVSff+YAiW6NhpVtmnWpZisbsS5FDK+wDgNJLz3KPzXgVjGxwEUQ Ry9blVw2KKST0u5r17gySzAPI/gQrWfqi+2MhE1vB4lLO5VrdcTOk6sH+COf2cF52YHXs1 /CoDgNsiow2633vGFnkSg+ZBHsq6jRHshfw93euHNTHUn/2UoYofNW/ybNg/hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736400563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VlFSGuhHrZKhhwkX9OsMIE79vU97eXT1pSuR+6FUskI=; b=VNfG9JIoLOGKK2u2+zoULcCP9LAnTiU5TxCKimw8v2e5nhY7yrKwyor9OsGAPKBXpdKV8m o86FEvp6l8moeuR4CpCs7X4XP7w8qWFPZOgNjosdUOrNlhVXuOuzmRW74uooX8rnfzQTdz QHF6odHnRl2M24YO5cCqhNiTnNVUIAEniXW+ndzNlVIPMVLhxfOusqM6i/o5n5XWAHbukD I0TCRtQjGjcXFpTgWoeM+b5oDtA7ZcE1ploCjc4i87/ZTtlN8o+ldyZRZEnRqHpXATEoWx WYWDzE84JX+gi0gkOi+O4rEO0yklx0LGv5z7qo2OZEDOmh1wgR/C+QALzbtLyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736400563; a=rsa-sha256; cv=none; b=vpgU7RNVl1Qj+3+F31fciweBGN0uYd0Qb3MRDzAAAFIThi+2T3S3ILAobHA6ihEWABSu2d FpkyjWJsyaEvF0hyDatZD38QR8T6g3af1SAiGWQOCqv2YAA4VApUBAcg0y6dJh+MLDlgNg XOLAG7swvx6pLbxB0c9lzh8JUAkCHaa38Xaz12Ir8nnf3/FOqRd74KQ5yltGuL63aziyeL EqCAH0aE1HroOFtcw1R2foq3ToBMDLPH6b34dUtSW2xxZKAL3UxnRpkkGy2CwTs+ZS2mTc u2u901BdTCEk6FDWPBaOc4j+i9Y+f8k5DqjgfEtEFVu7xob38QuUSiI4GXuqug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTCyW53Ctz1RYC; Thu, 09 Jan 2025 05:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5095TNw5081668; Thu, 9 Jan 2025 05:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5095TNqB081665; Thu, 9 Jan 2025 05:29:23 GMT (envelope-from git) Date: Thu, 9 Jan 2025 05:29:23 GMT Message-Id: <202501090529.5095TNqB081665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e7fbf52a3e38 - main - TCP BBR: remove dead code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7fbf52a3e38c4bc4249e6541fe7e42ecc119656 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e7fbf52a3e38c4bc4249e6541fe7e42ecc119656 commit e7fbf52a3e38c4bc4249e6541fe7e42ecc119656 Author: Michael Tuexen AuthorDate: 2025-01-09 05:27:05 +0000 Commit: Michael Tuexen CommitDate: 2025-01-09 05:27:05 +0000 TCP BBR: remove dead code No functional change intended. Reviewed by: Peter Lei, rrs (earlier version) CID: 1523802 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48341 --- sys/netinet/tcp_stacks/bbr.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 4600088bd1a1..17a0744961ce 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -6781,8 +6781,6 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, t = cts - rsm->r_tim_lastsent[0]; else t = 1; - if ((int)t <= 0) - t = 1; bbr->r_ctl.rc_last_rtt = t; bbr_update_bbr_info(bbr, rsm, t, cts, to->to_tsecr, 0, BBR_RTT_BY_EXACTMATCH, rsm->r_tim_lastsent[0], ack_type, to); @@ -6823,8 +6821,6 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, t = cts - rsm->r_tim_lastsent[i]; else t = 1; - if ((int)t <= 0) - t = 1; bbr->r_ctl.rc_last_rtt = t; bbr_update_bbr_info(bbr, rsm, t, cts, to->to_tsecr, uts, BBR_RTT_BY_TSMATCHING, rsm->r_tim_lastsent[i], ack_type, to); From nobody Thu Jan 9 07:12:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTGF15hBjz5kDgq; Thu, 09 Jan 2025 07:12:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTGF14HfDz4Nkn; Thu, 9 Jan 2025 07:12:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736406725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Um7q03KNGIiYAOME3INc+0DZMEpIJ9SJBN3mCTAZSbc=; b=IHQhFkcxfH88Se+vc8BBDpuRU7816SLiKvT54xkwC0Vavoqse/KYEGORgHxVYLHhSXpuEO Et7e7sxgsHaa33aieE3P94gJjzYDAc0Jg+Nf7n9G7lkiI5B+P8VSFq954F1oc9po8vo7fT nlhW5zG6Xf04LIhBYHcuBxNpsppY9YLSmVRhSSWfUR0nrL1wS5ShWh/0fOe0OqOCahzOfa RTMWlxp553DL8FjePuNDqqWHduFeWFqBNIAAmsDPtk18hN1tKL1sy9BfjAGBTiouPPX293 oXAn+n+G6bPyP5GfxeybgcRqA6dxfSmMLWxCq4TH9l/ReVoVTiIzTggsRfn5jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736406725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Um7q03KNGIiYAOME3INc+0DZMEpIJ9SJBN3mCTAZSbc=; b=yEXgVYtn/xpAtfXqDMEAr0kTuHV9Orn97YUYS7Wom9KTDxS3i1VFN1+ephi6/9V307KZDn keMHpnZA1TbY+G1AAF16TR3oO+ZzeWTkd2VbexotrdyeFF5yF/QegI4k8CnA0y2w/rXWgt VOzjOl+/inmRbzF4C5HlnIAtU461CAXbF2hYuyvykbHSEYHEbL71HTSYLqTKig/8lwU1lD ZvBd3RM6dQWOOCTzUX/iD199uokgcT6soMCWuVef1Kds0FDMs77HegGs39g58xRh4m1//v VHZ7/bKPUYw9C1+7VsZBce7ETHwNCp3wwDYfX7bjwfErrJ1DuwvLv9pIuUXgMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736406725; a=rsa-sha256; cv=none; b=EjLbDtZ5fbZjtTVXI4NwsMhawIWgX+KhvvHGnIVfI6qWQeVKBqdwZkCQxy3LhJ9gUhUrdb wKf+GAS7hHseA69ln+kYDAs1cTm4/v/FVOML2lUfKiBj7w1ykUpuvbKchzJGVeQgAc0CIW mYPUWEaTeuUgdqy+6HpKKkng/k/x7h+4y2MP+2JsHqey9q4BKPkX6o7rbvH51svn3/z7Vj En6IxKL9AZk/nF+yJ0PC8KqYkN7SJVL81zZ6AThTICuruN8LxqTDlnhAWj8fjQqCNcXSBq nrhE9Tp1UL4HjcIGI6cLn8wLXs20TakX72o4bFF6DhG5ZdqKnfG/FpcLyH7rHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTGF13tz2z1d9; Thu, 09 Jan 2025 07:12:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5097C5xY082951; Thu, 9 Jan 2025 07:12:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5097C5aW082937; Thu, 9 Jan 2025 07:12:05 GMT (envelope-from git) Date: Thu, 9 Jan 2025 07:12:05 GMT Message-Id: <202501090712.5097C5aW082937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ee233742a569 - main - loader: Rework kernel menu section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee233742a5697f64d0f1d722b5e73ff2c5998c62 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ee233742a5697f64d0f1d722b5e73ff2c5998c62 commit ee233742a5697f64d0f1d722b5e73ff2c5998c62 Author: Emmanuel Vadot AuthorDate: 2025-01-07 09:34:35 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-09 07:13:43 +0000 loader: Rework kernel menu section With pkgbase we can have long kernel name, so create a new section for the kernel name. Do not show the "default" text, we already show the "1 of X" part at the end of the line and the default kernel is always number 1 so it's a bit redundant. Differential Revision: https://reviews.freebsd.org/D48354 Reviewed by: imp, tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG --- stand/lua/menu.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 2d92be3b7c6e..7c36b6c8d3c8 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -255,9 +255,16 @@ menu.welcome = { }, { entry_type = core.MENU_SEPARATOR, - name = "Options:", + name = "Kernel:", }, menu_entries.kernel_options, + { + entry_type = core.MENU_SEPARATOR, + }, + { + entry_type = core.MENU_SEPARATOR, + name = "Options:", + }, menu_entries.boot_options, menu_entries.zpool_checkpoints, menu_entries.boot_envs, @@ -332,22 +339,19 @@ menu.welcome = { items = core.kernelList, name = function(idx, choice, all_choices) if #all_choices == 0 then - return "Kernel: " + return "" end - local is_default = (idx == 1) - local kernel_name = "" + local kernel_name local name_color - if is_default then + if idx == 1 then name_color = color.escapefg(color.GREEN) - kernel_name = "default/" else name_color = color.escapefg(color.CYAN) end - kernel_name = kernel_name .. name_color .. - choice .. color.resetfg() - return color.highlight("K") .. "ernel: " .. - kernel_name .. " (" .. idx .. " of " .. + kernel_name = name_color .. choice .. + color.resetfg() + return kernel_name .. " (" .. idx .. " of " .. #all_choices .. ")" end, func = function(_, choice, _) From nobody Thu Jan 9 07:12:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTGF06vy4z5kDjh; Thu, 09 Jan 2025 07:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTGF03sc4z4Nkm; Thu, 9 Jan 2025 07:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736406724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y5uQ8W5DFiYGsQvZAfuGcfzdlYEY2roZ+draCSxjG7o=; b=obywb7TbwCgmaqPASdgBaiqhU4rJz3Dojrp1aha7lu3DwYDK7TsYthuDIaWJrPmddcMS9e mfLR+282JD6OViqwIDs4QYxfUr+yqd0Kg6JfHp6oVzY3KibdE29ECxjHiXJJ/hxx+E3T9u 1sdjY8w9bp3fEo3B4BaVZ2MGCXe5VS3yxbVtyAnzpw+ZZBwVeK9gHadF39Wl3n+dyEM165 SaH4GRUGVaBbImp3TmegqfpvmJlO/W+A6WBJmWLYNuaZ67xY+klRnIYIdOvVN4Avy1GLfO WXBhcJXKPJRAy8nNR7k5DMbFbg4shxGgIQfbKwdcnJ5DZgCNS7BkFl3cftdVcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736406724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y5uQ8W5DFiYGsQvZAfuGcfzdlYEY2roZ+draCSxjG7o=; b=RQwZGHV90DuKS45BmK3gyEpvNsr6Pmyn5CbWgI8vnWV45YryuMInTDzIEKAzVqOxNkhtCj 4auJQKw0CZUp9fSq/ZhYYhlIe79s44suzjrMpny+6xq0xEvpFI1xyoCHnAJaYfbpOdwZJL fp8ROPERpNINypDevq4NkXO36RTSVHoerAyTKWWuDbwWwZVJZrNP2dU4XGdauBBB2Kf0n4 Ahv6OU8mskRmjO/zU8EqfP2XXA6HEoMLVbCY3ABSi6UdafXndRtXHPrqK5KDW2JPLxmZ6C iVwUFh4nGjbfF4Idi/u6+wWPkn8lGUcV1SvlUnm2nVpgdWXODFJIJQPLxDWRkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736406724; a=rsa-sha256; cv=none; b=hovrxc6s8F1fQzDfFdle5PrXpt0w1lC2jjZtCgeXHljTOraaGx8EUQ76PUGmPA2gLav92f po+9eJOwdJoRyz0Tt9SwBIKWgLCoIms7I9FmbDPbA+kiGxXih9GFYeTYQ2M0NfWpX9aGNs 0N25ghKYrfZ1ztJgot7Srfvw8wF4sIssCOYj94MswQUK+rVtlB9l1rNoxsyvexMm4AG6XJ 3EyZ3yoGvtLpUs6GTRttvc+jFGMwOxL9i6utjbTX1EsdRixECT7EOH3FRDLntElDMXtTfg 2FVNK9Dt9lzK7qpo2ZNUx3wpkkQrQIcvn1Sy3Qp7KQOwGHh3YMQR2X1JXxz/bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTGF03NgYzp8; Thu, 09 Jan 2025 07:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5097C4T3082784; Thu, 9 Jan 2025 07:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5097C4Vf082781; Thu, 9 Jan 2025 07:12:04 GMT (envelope-from git) Date: Thu, 9 Jan 2025 07:12:04 GMT Message-Id: <202501090712.5097C4Vf082781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1b4e11713153 - main - loader: Fix orb position List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b4e1171315398decb1ad3fceffcacf29cff218b Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1b4e1171315398decb1ad3fceffcacf29cff218b commit 1b4e1171315398decb1ad3fceffcacf29cff218b Author: Emmanuel Vadot AuthorDate: 2025-01-07 08:57:57 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-09 07:13:05 +0000 loader: Fix orb position Fix the orb position to be aligned with the menu Differential Revision: https://reviews.freebsd.org/D48353 Reviewed by: imp, tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG --- stand/lua/drawer.lua | 4 ++-- stand/lua/gfx-orb.lua | 2 +- stand/lua/gfx-orbbw.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index e55702ffee6c..2d04e29ac462 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -470,9 +470,9 @@ logodefs = { } brand_position = {x = 2, y = 1} -logo_position = {x = 46, y = 4} +logo_position = {x = 40, y = 10} menu_position = {x = 5, y = 10} -frame_size = {w = 42, h = 14} +frame_size = {w = 39, h = 14} default_shift = {x = 0, y = 0} shift = default_shift diff --git a/stand/lua/gfx-orb.lua b/stand/lua/gfx-orb.lua index 00f4aeb3bceb..cd834a2d6b8e 100644 --- a/stand/lua/gfx-orb.lua +++ b/stand/lua/gfx-orb.lua @@ -45,7 +45,7 @@ return { " .---.....----.\027[m", }, requires_color = true, - shift = {x = 2, y = 3}, + shift = {x = 2, y = -1}, image = "/boot/images/freebsd-logo-rev.png", image_rl = 15 } diff --git a/stand/lua/gfx-orbbw.lua b/stand/lua/gfx-orbbw.lua index 93ffd2366196..a97174a6a5a4 100644 --- a/stand/lua/gfx-orbbw.lua +++ b/stand/lua/gfx-orbbw.lua @@ -44,6 +44,6 @@ return { " .-- `--.", " .---.....----.", }, - shift = {x = 2, y = 4}, + shift = {x = 2, y = -1}, } } From nobody Thu Jan 9 09:27:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTKFB5v48z5kRMk; Thu, 09 Jan 2025 09:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTKFB4Bvgz4ZbL; Thu, 9 Jan 2025 09:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736414846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5pZ8aj/mvw3eYKxEEWJSyf1C8JmDgOsfyVIqiWvv2xI=; b=pnH00gUlnlkT8GvwGzpIWyUgaMYZsu8DTkXNoWJ1d5tRTom7sNNxADgtDl+cmyWWZQmQ2/ TskfVd4hDxxa+xxyJKS7eldQ/smk02KBTPMdPJ4AB9qcFRbU7V/HUEIVB4UGn0v0GN6/Ml bmHoXKlZtp/Oe5TlZxNUv21Zi82JSD7JSNvMuy5ckXEopHvNFdE0AEZRwZpRn7ruzmyHY8 aEwp8PraIhX4Ra1VV9S3ipozVnltHHIaqgvEi+XvqWFDLQPfnDFmPIX6+Vn4ZJiFagql+N YoTrOV7+nfmfR4ELkp6ymBolZU9OqX8e6wORi2cBC2MipYH9C43YiINN6n9KqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736414846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5pZ8aj/mvw3eYKxEEWJSyf1C8JmDgOsfyVIqiWvv2xI=; b=ilwH+4R02sNV8oaY2cRO0XVYRcFvWhH8NxyQ1rXksgTGXa2NQRQptXn/wuS2psXcGAv1wS uFgnfXN7nrW3iG3nttkJm8kSRq7t/8P7JMYxabZybMUm8/Mojze48PujaUDf8uppfltrcF FU9WlL/JgNe1cgpqLrVRACu1x4RgiMaFk9i6o/6ASe5HmZxV+j6CUpF3u3eDt0NvPH6ljk ZoccYVyQ0d1MYVfVz1+nZJfbZ1LhXCd0r2xoJibrBiIqaPOszt7MfOJHBczK+1R//soDOu RMrW4b9I/mWQIhIZqJrsjvp7Wpyvs37WbeOPCIW1OSScoel+hwcV0dHLBlHWtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736414846; a=rsa-sha256; cv=none; b=m7RII3U372dlEDOKOrlr02YUasTGCTdzD+drXHVBmrkXt1tZ4kBnRRu6NOM9kewXQP8KvF cmBTTVBAzOKS0BkO0GKlSQTnISDhNZHu7sInKnmpEvjCM6M9uc2/my0vb1ptnumgGcmfh3 hIGTRzQdX692fIl45ZSRb3wLoPMdQhpsTahV9DG5UomuyXi8IXHPh60DnEuGAj0MDChdwQ lfXIp72jsG3lth/3iKfk/Wt2HrNqAFVUqu3c79RoOL1ElFTWmzF1GY9cd/zKqyEjBcDL4J mkPv5v3/KCqD05H4asOlikJ4djopK23f3UA4Uethj2qhfQrWAiwLlYM5/+v2+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTKFB3q7lz5P6; Thu, 09 Jan 2025 09:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5099RQo1028422; Thu, 9 Jan 2025 09:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5099RQYl028419; Thu, 9 Jan 2025 09:27:26 GMT (envelope-from git) Date: Thu, 9 Jan 2025 09:27:26 GMT Message-Id: <202501090927.5099RQYl028419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: a8d9bd3fa585 - main - bintrans(1): qp switch to getopt_long List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8d9bd3fa5855fe7583ed05946296ab6b9937d69 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a8d9bd3fa5855fe7583ed05946296ab6b9937d69 commit a8d9bd3fa5855fe7583ed05946296ab6b9937d69 Author: Baptiste Daroussin AuthorDate: 2025-01-08 11:13:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-09 09:24:34 +0000 bintrans(1): qp switch to getopt_long In preparation for more arguments, switch bintrans qp argument parsing to getopt_long, while here make the decodign argument being -d|--decode for compatibility with base64 encoding/decoding MFC After: 1 week Reviewed by: pstef Differential Revision: https://reviews.freebsd.org/D48380 --- usr.bin/bintrans/bintrans.1 | 4 +-- usr.bin/bintrans/qp.c | 61 +++++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 index 3376ecd332ed..4177a5c6b9eb 100644 --- a/usr.bin/bintrans/bintrans.1 +++ b/usr.bin/bintrans/bintrans.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 23, 2024 +.Dd January 8, 2025 .Dt BINTRANS 1 .Os .Sh NAME @@ -230,7 +230,7 @@ through a dedicated program: is a quoted-printable converter and accepts the following options: .Bl -tag -width indent -.It Fl u +.It Fl d Decode. .It Fl o Ar output_file Output to diff --git a/usr.bin/bintrans/qp.c b/usr.bin/bintrans/qp.c index c2c9dfa7a224..3bff47945acf 100644 --- a/usr.bin/bintrans/qp.c +++ b/usr.bin/bintrans/qp.c @@ -26,6 +26,7 @@ */ #include +#include #include #include #include @@ -151,44 +152,50 @@ static void usage(void) { fprintf(stderr, - "usage: bintrans qp [-u] [-o outputfile] [file name]\n"); + "usage: bintrans qp [-d] [-o outputfile] [file name]\n"); } int main_quotedprintable(int argc, char *argv[]) { - int i; + int ch; bool encode = true; FILE *fp = stdin; FILE *fpo = stdout; - for (i = 1; i < argc; ++i) { - if (argv[i][0] == '-') { - switch (argv[i][1]) { - case 'o': - if (++i >= argc) { - fprintf(stderr, "qp: -o requires a file name.\n"); - exit(EXIT_FAILURE); - } - fpo = fopen(argv[i], "w"); - if (fpo == NULL) { - perror(argv[i]); - exit(EXIT_FAILURE); - } - break; - case 'u': - encode = false; - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } else { - fp = fopen(argv[i], "r"); - if (fp == NULL) { - perror(argv[i]); + static const struct option opts[] = + { + { "decode", no_argument, NULL, 'd'}, + { "output", required_argument, NULL, 'o'}, + {NULL, no_argument, NULL, 0} + }; + + while ((ch = getopt_long(argc, argv, "do:u", opts, NULL)) != -1) { + switch(ch) { + case 'o': + fpo = fopen(optarg, "w"); + if (fpo == NULL) { + perror(optarg); exit(EXIT_FAILURE); } + break; + case 'u': + /* FALLTHROUGH for backward compatibility */ + case 'd': + encode = false; + break; + default: + usage(); + exit(EXIT_FAILURE); + } + }; + argc -= optind; + argv += optind; + if (argc > 0) { + fp = fopen(argv[0], "r"); + if (fp == NULL) { + perror(argv[0]); + exit(EXIT_FAILURE); } } qp(fp, fpo, encode); From nobody Thu Jan 9 09:48:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTKj74qJlz5kSxJ; Thu, 09 Jan 2025 09:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTKj74Kyhz4chH; Thu, 9 Jan 2025 09:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736416091; h=from:from:reply-to:subject:subject: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+aMgoQsfydT4QeDCYnrhA+McHfrmqr0RY594A8emTo=; b=vbqdpDTyPF+KEP3k/FBWXqxB9mT0F/y7EksJls4ilo3YIjQk+aiv3hd8yoqwLul7b6e5J0 fL94z85SwkFLyk4Vl2oMTxxOWX9TIe8wrUciDQJEEjYWfl23Ke4p36VNQ3OTcwaoDaM8Ds E1HaQAyq6njo8d48xe6BCRDYocwEezaPAfcnA6w8y0x2inDRgQFzyUtBu1vELrmFdk5WWo k6H9/tNciWHVa2ItiJNSIKii9wFiHeOTuI3l5xVhflckzJr+0leYbxq8UF9ZgRUn4WO7Cj KYGkZoyJRYiONXkeFYM8C/LZwEqnJSltzIKZv+1QtOnTpgGSjwDp1y7ac1Inyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736416091; h=from:from:reply-to:subject:subject: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+aMgoQsfydT4QeDCYnrhA+McHfrmqr0RY594A8emTo=; b=Zv/jKHOWc8VbTPo811vlBsDaW1GZ9vFvbl3h/Gv7AQbbIEOHQy5279MdV86AyWJekmXJDx 5/9Ypcsu1R1C+wSEH5HFCsgM+SziZaWu19ngglrCDZ7SundyFlE1L5bmrOaMWxGJr7le/+ obijCW4VratngpboOer+lkTWH3s8R7uPqxIiduanaxMbeFixfx9aw+SVZHHHM2tUpOJU6n tu45eMKYBfwfjjIRDfPBXlYgfgWjyUn/7wt699G6+lSSBxm5V2wiG1vrNA72m7d6nTj6me 6Z6lPSuRt35dHmmFUV4moVMJWuKklCJYBcMh3IVl1w55u8owIqsTx1gD+XbyYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736416091; a=rsa-sha256; cv=none; b=oPydTkomsTfq0lbaEVjGUhoEToB2MuwHZ46ehAguSlfei9Pt1C2ZEVL1C3JzQYS4cKHIGO 7P+zgMKFAux1C8IQVcP9cPLUQqDLGqTDD5y9v7LYLhCBPUFmlgS6bW9jUzy4D/UENZCa54 N0QjLc6EUxZetzlpFlZsoBtz6oyhnx1dhNrdOTugZhPhG7PEGCyVON4/2BY0EWwNOW1uqz A8gGS5/nHy1wqqWl6D3cPLrsnsTFsh9EIQMJsuzoIh0EnDZ7Ydwv8NC88537jwZWYuN1xP KPVEnbOQhDIukDpryrX3Yqp/DVP/ZcOCBrrwDH7mRGNGyE2EWqdrtNntNLq7oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTKj73rq6z5jQ; Thu, 09 Jan 2025 09:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5099mBrJ065807; Thu, 9 Jan 2025 09:48:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5099mBTH065804; Thu, 9 Jan 2025 09:48:11 GMT (envelope-from git) Date: Thu, 9 Jan 2025 09:48:11 GMT Message-Id: <202501090948.5099mBTH065804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 4413d9f37751 - main - usb_vendors: update to 2024.12.04 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4413d9f3775118c4d8c082a404dd7eb04fe9636a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4413d9f3775118c4d8c082a404dd7eb04fe9636a commit 4413d9f3775118c4d8c082a404dd7eb04fe9636a Author: Baptiste Daroussin AuthorDate: 2025-01-09 09:47:22 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-09 09:47:22 +0000 usb_vendors: update to 2024.12.04 --- share/misc/usb_vendors | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/misc/usb_vendors b/share/misc/usb_vendors index 41b367d1a0d6..3304de282c18 100644 --- a/share/misc/usb_vendors +++ b/share/misc/usb_vendors @@ -9,8 +9,8 @@ # The latest version can be obtained from # http://www.linux-usb.org/usb.ids # -# Version: 2024.07.04 -# Date: 2024-07-04 20:34:02 +# Version: 2024.12.04 +# Date: 2024-12-04 20:34:02 # # Vendors, devices and interfaces. Please keep sorted. @@ -16876,7 +16876,7 @@ 0256 Schwalm & Tate LLC pISO Raspberry Pi Hat 053a Hackerspace San Salvador HSSV SAMR21-Mote 0cbd Andrzej Szombierski kuku.eu.org keyboard - 0d32 ODrive Robotics ODrive v3 + 0d32 ODrive Robotics ODrive 1001 InterBiometrics Hub 1002 InterBiometrics Relais 1003 InterBiometrics IBSecureCam-P From nobody Thu Jan 9 09:48:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTKj90ZGxz5kT0J; Thu, 09 Jan 2025 09:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTKj85L9Gz4cYq; Thu, 9 Jan 2025 09:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736416092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbv9j8qu4OHUZCh1cKUWC70jHyrN6eoeX/tgw49I+Ig=; b=O/1k3xkpAuqpx/g2MsnvBWgLzN0e52km6wZPn+vqSCAKINT8GKDZ5dlGKylbdgNWSb8SqB 6qNuHTuuBh4GnapafgR9uVKlLYqDl2gbcsAKu16Ra5kxHPiogpRJbyWAvp97OqF3F0Z2+n vgRWfRbq3a5/P+ckkBH84aTb6L7ZlQu7XAnvjPSfYJwDY71KmpHC6CObyw+ftDRe26CxB8 dDuXDCFtGL1foxTtn4h6QQC8s/54n9SC1yvFny4/tyP+LOSwT9Poa15LmMTvTp9TGS55Ra Rl24jf0jhCQeeRM+mEjtRDlKMNH24dHo7JnrRWvP4KIzHSMOn9zOUxo8xb3lNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736416092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbv9j8qu4OHUZCh1cKUWC70jHyrN6eoeX/tgw49I+Ig=; b=WOmOF4fsQu1WVC5U+U/8In1NUg+E0im/E07JXJ6DQm8LJQXTAkutAb18H/c8fS0YjAxaOv Xd0kSU+QXbM5TX2omHzAU0/fFUBJ/Vja435dhjzWMBjHJyvOrl2OBVAz5D7hqV9znFSP7i ib7rIdgZqoI55vBmgQi7jtB9mxNmOOb4EU8ziMrFyRHQBEs/5EUKG+mS7iUY+2UcY33za7 n3Sw90G7l3e395997gbWxJqCFolE3cVhIDd1Xhp2rXDP2iXZAIf5BBWS8pKvXqeUBHWxOT PAKtMStd2q3eDX26Hflp6hWtrksIHMBpqftgz1G4wmM7eE2IcwUh3NpdbyrGGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736416092; a=rsa-sha256; cv=none; b=H7o7W5YSvdblVHgYzSD2AtfvYnI2Zsar9fAMAlO1C1oFUWBgr8suIYX4sTMQAkZVnVjETl mm99qK2NBfGw8/jSvV2K/Knq//+SrtBIHSHnaL7c0UIojc6d3zqXhsizrHHiPnOyxtxRxc zEJ3OSerPG9spYIG6TFzwFURm+PeimBD+KDKQFlO/ytUTgnq4cfAexl77q5kEdn2FJyB/Q 1yTfx4hoI172UUBmWUUheES0Am6G4WMoCzO8uHLEX3tz6U4kouNDDvpuz66rJ/mMEcbTU4 MXLqdjzWmhlLUtGb8dgUWtvTanl59+7Hj1XiA/Au9IEkwPIQ17uzrmTFBG1Uzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTKj84xSpz5jR; Thu, 09 Jan 2025 09:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5099mCVL065863; Thu, 9 Jan 2025 09:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5099mC00065860; Thu, 9 Jan 2025 09:48:12 GMT (envelope-from git) Date: Thu, 9 Jan 2025 09:48:12 GMT Message-Id: <202501090948.5099mC00065860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 2f82bf3521f9 - main - pci_vendors: update to 2024.11.25 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f82bf3521f955c0ef9cc0019b7f86c13020660c Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2f82bf3521f955c0ef9cc0019b7f86c13020660c commit 2f82bf3521f955c0ef9cc0019b7f86c13020660c Author: Baptiste Daroussin AuthorDate: 2025-01-09 09:47:59 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-09 09:47:59 +0000 pci_vendors: update to 2024.11.25 --- share/misc/pci_vendors | 602 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 509 insertions(+), 93 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 968338dd1099..0eebacf92d41 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2024.09.20 -# Date: 2024-09-20 03:15:02 +# Version: 2024.11.25 +# Date: 2024-11-25 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -46,13 +46,20 @@ 7a10 Hyper Transport Bridge Controller 7a14 EHCI USB Controller 7a15 Vivante GPU (Graphics Processing Unit) + 7a18 SATA 3 AHCI Controller 7a19 PCI-to-PCI Bridge + 7a1b SPI Controller 7a24 OHCI USB Controller # Found on 7A2000 PCH 7a25 LG100 GPU 7a29 PCI-to-PCI Bridge + 7a34 xHCI USB Controller # Found on 7A2000 PCH 7a36 Display Controller + 7a39 PCIe x1 Root Port + 7a49 PCIe x4 Root Port + 7a59 PCIe x8 Root Port + 7a69 PCIe x16 Root Port 0018 Fn-Link Technology Limited 6252 6252CPUB 802.11ax PCIe Wireless Network Adapter 001c PEAK-System Technik GmbH @@ -3992,6 +3999,7 @@ # Reference 1002 0e3a Radeon RX 6950 XT 1849 5230 Navi 21 [ASRock OC Forumla Radeon RX 6950XT] + 1849 5238 Navi 21 [ASRock Radeon RX 6950 XT Phantom Gaming OC] 1da2 441d Navi 21 [Sapphire Nitro+ Radeon RX 6950 XT] 1eae 6950 Navi 21 [XFX Speedster MERC319 Radeon RX 6950 XT] 73ab Navi 21 Pro-XLA [Radeon Pro W6800X/Radeon Pro W6800X Duo] @@ -4055,11 +4063,13 @@ 744c Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] 1002 0e3b RX 7900 XTX / RX 7900 GRE [XFX] 1043 0506 TUF Gaming Radeon RX 7900 XTX OC + 148c 2425 HELLHOUND RX 7900 GRE 1849 5304 Radeon RX 7900 XTX 1da2 471e PULSE RX 7900 XTX 1da2 475e PULSE RX 7900 GRE 1da2 e471 NITRO+ RX 7900 XTX Vapor-X 1eae 7901 RX-79XMERCB9 [SPEEDSTER MERC 310 RX 7900 XTX] + 1eae 790a RX-79GMERCBR [XFX RX 7900 GRE] 745e Navi 31 [Radeon Pro W7800] 7460 Navi32 GL-XL [AMD Radeon PRO V710] 7461 Navi 32 [AMD Radeon PRO V710] @@ -4075,7 +4085,11 @@ 7499 Navi 33 [Radeon RX 7400/7300/Pro W7400] 74a0 Aqua Vanjaram [Instinct MI300A] 74a1 Aqua Vanjaram [Instinct MI300X] + 74a2 Aqua Vanjaram [Instinct MI308X] + 74a5 Aqua Vanjaram [Instinct MI325X] + 74a9 Aqua Vanjaram [Instinct MI300X HF] 74b5 Aqua Vanjaram [Instinct MI300X VF] + 74bd Aqua Vanjaram [Instinct MI300X HF] 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -4434,7 +4448,6 @@ 99a2 Trinity 2 [Radeon HD 7420G] 99a4 Trinity 2 [Radeon HD 7400G] aa00 R600 HDMI Audio [Radeon HD 2900 GT/PRO/XT] - aa01 RV635 HDMI Audio [Radeon HD 3650/3730/3750] aa08 RV630 HDMI Audio [Radeon HD 2600 PRO/XT / HD 3610] aa10 RV610 HDMI Audio [Radeon HD 2350 PRO / 2400 PRO/XT / HD 3410] 174b aa10 Radeon HD 2400 PRO @@ -5007,6 +5020,14 @@ 1202 Family 10h Processor DRAM Controller 1203 Family 10h Processor Miscellaneous Control 1204 Family 10h Processor Link Control + 12c0 Turin Data Fabric; Function 0 + 12c1 Turin Data Fabric; Function 1 + 12c2 Turin Data Fabric; Function 2 + 12c3 Turin Data Fabric; Function 3 + 12c4 Turin Data Fabric; Function 4 + 12c5 Turin Data Fabric; Function 5 + 12c6 Turin Data Fabric; Function 6 + 12c7 Turin Data Fabric; Function 7 1300 Family 11h Processor HyperTransport Configuration 1301 Family 11h Processor Address Map 1302 Family 11h Processor DRAM Controller @@ -5130,6 +5151,7 @@ 1480 Starship/Matisse Root Complex 1462 7c37 X570-A PRO motherboard 15d9 1b95 H12SSL-i + 1849 1480 ROME2D32LM3 1481 Starship/Matisse IOMMU 1482 Starship/Matisse PCIe Dummy Host Bridge 1483 Starship/Matisse GPP Bridge @@ -5163,18 +5185,72 @@ 149c Matisse USB 3.0 Host Controller 1462 7c37 X570-A PRO motherboard 149d Vangogh CVIP + 149e Genoa/Bergamo IOMMU + 149f Genoa/Bergamo Dummy Host Bridge + 14a4 Genoa/Bergamo Root Complex + 14a5 Genoa/Bergamo GPP Bridge + 14a6 Genoa/Bergamo RCEC + 14a7 Genoa/Bergamo Internal PCIe GPP Bridge to Bus [D:B] + 14aa Genoa/Bergamo GPP Bridge + 14ab Genoa/Bergamo GPP Bridge + 14ac Genoa/Bergamo Dummy Function + 14ad Genoa/Bergamo Data Fabric; Function 0 + 14ae Genoa/Bergamo Data Fabric; Function 1 + 14af Genoa/Bergamo Data Fabric; Function 2 + 14b0 Genoa/Bergamo Data Fabric; Function 3 + 14b1 Genoa/Bergamo Data Fabric; Function 4 + 14b2 Genoa/Bergamo Data Fabric; Function 5 + 14b3 Genoa/Bergamo Data Fabric; Function 6 + 14b4 Genoa/Bergamo Data Fabric; Function 7 14b5 Family 17h-19h PCIe Root Complex 14b6 Family 17h-19h IOMMU 14b7 Family 17h-19h PCIe Dummy Host Bridge 14b8 Family 17h-19h PCIe GPP Bridge 14b9 Family 17h-19h Internal PCIe GPP Bridge 14ba Family 17h-19h PCIe GPP Bridge + 14c1 Secondary vNTB # Server device 14ca Genoa CCP/PSP 4.0 Device 14cd Family 19h USB4/Thunderbolt PCIe tunnel - 14de Phoenix PCIe Dummy Function + 14d8 Raphael/Granite Ridge Root Complex + 14d9 Raphael/Granite Ridge IOMMU + 14da Raphael/Granite Ridge Dummy Host Bridge + 14db Raphael/Granite Ridge GPP Bridge + 14dc SDXI + 14dd Raphael/Granite Ridge Internal GPP Bridge to Bus [C:A] + 14de Raphael/Granite Ridge PCIe Dummy Function + 14e0 Raphael/Granite Ridge Data Fabric; Function 0 + 14e1 Raphael/Granite Ridge Data Fabric; Function 1 + 14e2 Raphael/Granite Ridge Data Fabric; Function 2 + 14e3 Raphael/Granite Ridge Data Fabric; Function 3 + 14e4 Raphael/Granite Ridge Data Fabric; Function 4 + 14e5 Raphael/Granite Ridge Data Fabric; Function 5 + 14e6 Raphael/Granite Ridge Data Fabric; Function 6 + 14e7 Raphael/Granite Ridge Data Fabric; Function 7 + 14e8 Phoenix Root Complex + 14e9 Phoenix IOMMU + 14ea Phoenix Dummy Host Bridge + 14eb Phoenix Internal GPP Bridge to Bus [C:A] + 14ec Phoenix Dummy Function + 14ed Phoenix GPP Bridge + 14ee Phoenix GPP Bridge 14ef Family 19h USB4/Thunderbolt PCIe tunnel + 14f0 Phoenix Data Fabric; Function 0 + 14f1 Phoenix Data Fabric; Function 1 + 14f2 Phoenix Data Fabric; Function 2 + 14f3 Phoenix Data Fabric; Function 3 + 14f4 Phoenix Data Fabric; Function 4 + 14f5 Phoenix Data Fabric; Function 5 + 14f6 Phoenix Data Fabric; Function 6 + 14f7 Phoenix Data Fabric; Function 7 1502 AMD IPU Device + 1507 Strix Root Complex + 1508 Strix IOMMU + 1509 Strix Dummy Host Bridge + 150a Strix PCIe USB4 Bridge + 150b Strix GPP Bridge + 150c Strix Internal GPP Bridge to Bus [C:A] + 150d Strix PCIe Dummy function 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini 1512 Family 14h Processor Root Port @@ -5194,12 +5270,11 @@ 1537 Kabini/Mullins PSP-Platform Security Processor 1538 Family 16h Processor Function 0 1539 Kabini P2P Bridge for PCIe Ports[4:0] -# AMD EPYC Turin CPU - 153a Family 1Ah (Models 00h-0Fh) Root Complex -# AMD EPYC Turin CPU - 153b Family 1Ah (Models 00h-0Fh) IOMMU -# AMD EPYC Turin CPU - 153d Family 1Ah (Models 00h-0Fh) PCIe Dummy Host Bridge + 153a Turin Root Complex + 153b Turin IOMMU + 153c Turin RCEC + 153d Turin PCIe Dummy Host Bridge + 153e Turin GPP Bridge 1540 Kryptos/Cato/Garfield/Garfield+/Arlene/Pooky HT Configuration 1541 Kryptos/Cato/Garfield/Garfield+/Arlene/Pooky Address Maps 1542 Kryptos/Cato/Garfield/Garfield+/Arlene/Pooky DRAM Configuration @@ -5216,10 +5291,10 @@ 154f Anubis Audio Processor 1550 Garfield+/Arlene/Pooky/Anubis SPLL Configuration 1553 Arlene/Pooky P2P Bridge for PCIE (3:0) -# AMD EPYC Turin CPU - 1555 Family 1Ah (Models 00h-0Fh) Internal PCIe GPP Bridge -# AMD EPYC Turin CPU - 1556 Family 1Ah (Models 00h-0Fh) PCIe Dummy Function + 1554 Turin GPP Bridge + 1555 Turin Internal PCIe GPP Bridge to Bus [D:C] + 1556 Turin PCIe Dummy Function + 1557 Turin USB 3.1 xHCI 155b Anubis Root Complex 155c Anubis IOMMU 155d Anubis UMI PCIe Dummy Bridge @@ -5228,6 +5303,7 @@ 1566 Family 16h (Models 30h-3fh) Processor Root Complex 1567 Mullins IOMMU 156b Family 16h (Models 30h-3fh) Host Bridge + 156e Turin CCP/ASP 1570 Family 15h (Models 60h-6fh) Processor Function 0 1571 Family 15h (Models 60h-6fh) Processor Function 1 1572 Family 15h (Models 60h-6fh) Processor Function 2 @@ -5266,11 +5342,13 @@ 15b3 Stoney Miscellaneous Configuration 15b4 Stoney PM Configuration 15b5 Stoney NB Performance Monitor + 15b6 Raphael/Granite Ridge USB 3.1 xHCI + 15b7 Raphael/Granite Ridge USB 3.1 xHCI 15bc Stoney PCIe [GFX,GPP] Bridge [4:0] 15be Stoney Audio Processor 15c4 Phoenix USB4/Thunderbolt NHI controller #1 15c5 Phoenix USB4/Thunderbolt NHI controller #2 - 15c7 Family 19h (Model 74h) CCP/PSP 3.0 Device + 15c7 Phoenix CCP/PSP 3.0 Device 15d0 Raven/Raven2 Root Complex 103c 8615 Pavilion Laptop 15-cw1xxx 1043 876b PRIME B450M-A Motherboard @@ -5309,7 +5387,7 @@ 15e2 ACP/ACP3X/ACP6x Audio Coprocessor 17aa 5124 ThinkPad E595 ea50 ce19 mCOM10-L1900 - 15e3 Family 17h/19h HD Audio Controller + 15e3 Family 17h/19h/1ah HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx 103c 8b17 ProBook 445 G9/455 G9 1043 86c7 PRIME B450M-A Motherboard @@ -5402,6 +5480,8 @@ 1647 VanGogh PCIe GPP Bridge 1648 VanGogh Internal PCIe GPP Bridge to Bus 1649 Family 19h PSP/CCP + 164a Sensor Fusion Hub + 164b Non-Sensor Fusion Hub 164f Milan IOMMU 1650 Milan Data Fabric; Function 0 1651 Milan Data Fabric; Function 1 @@ -5437,6 +5517,14 @@ 167e Rembrandt Data Fabric: Device 18h; Function 5 167f Rembrandt Data Fabric: Device 18h; Function 6 1680 Rembrandt Data Fabric: Device 18h; Function 7 + 16f8 Strix Data Fabric; Function 0 + 16f9 Strix Data Fabric; Function 1 + 16fa Strix Data Fabric; Function 2 + 16fb Strix Data Fabric; Function 3 + 16fc Strix Data Fabric; Function 4 + 16fd Strix Data Fabric; Function 5 + 16fe Strix Data Fabric; Function 6 + 16ff Strix Data Fabric; Function 7 1700 Family 12h/14h Processor Function 0 1701 Family 12h/14h Processor Function 1 1702 Family 12h/14h Processor Function 2 @@ -5454,6 +5542,8 @@ 1716 Family 12h/14h Processor Function 5 1718 Family 12h/14h Processor Function 6 1719 Family 12h/14h Processor Function 7 + 17e0 Strix CCP/ASP + 17f0 Strix Neural Processing Unit 2000 79C97x [PCnet32 LANCE] 1014 2000 NetFinity 10/100 Fast Ethernet 1022 2000 PCnet - Fast 79C971 @@ -5808,7 +5898,8 @@ 5225 M5225 5229 M5229 5235 M5235 - 5237 M5237 PCI USB Host Controller + 5237 OHCI USB Controller + 5239 EHCI USB Controller 5240 EIDE Controller 5241 PCMCIA Bridge 5242 General Purpose Controller @@ -6731,28 +6822,28 @@ c066 3010S Ultra3 Dual Channel 1045 OPTi Inc. a0f8 82C750 [Vendetta] USB Controller - c101 92C264 + c101 82C264 GUI Accelerator c178 92C178 c556 82X556 [Viper] c557 82C557 [Viper-M] c558 82C558 [Viper-M ISA+IDE] - c567 82C750 [Vendetta], device 0 - c568 82C750 [Vendetta], device 1 + c567 82C750 [Vendetta] Host Bridge + c568 82C750 [Vendetta] ISA Bridge c569 82C579 [Viper XPress+ Chipset] - c621 82C621 [Viper-M/N+] + c621 82C621A PCI IDE Contoller c700 82C700 [FireStar] - c701 82C701 [FireStar Plus] - c814 82C814 [Firebridge 1] + c701 82C700 [FireStar] Host Bridge + c814 82C814 [FireBridge II] Docking Stration Controller c822 82C822 - c824 82C824 - c825 82C825 [Firebridge 2] + c824 82C824 [FireFox] 32-Bit PC Card Controller + c825 82C825 [FireBridge II] Docking Stration Controller c832 82C832 - c861 82C861 OHCI USB Host + c861 82C861/2/3 [FireLink] PCI-USB Host Bridge c881 82C881 [FireLink] 1394 OHCI Link Controller c895 82C895 - c935 EV1935 ECTIVA MachOne PCIAudio - d568 82C825 [Firebridge 2] - d721 IDE [FireStar] + c935 82С935 [MachOne] Integrated PCI Audio Processor + d568 82C700 [FireStar] PCI IDE Controller + d721 82C700 [FireStar] PCI IDE Controller 1046 IPC Corporation, Ltd. 1047 Genoa Systems Corp 1048 Elsa AG @@ -7151,12 +7242,13 @@ 0001 W83769F 0033 W89C33D 802.11 a/b/g BB/MAC 0105 W82C105 + 0628 W83628F/W83629D PCI to ISA Bridge Set 0840 W89C840 1050 0001 W89C840 Ethernet Adapter 1050 0840 W89C840 Ethernet Adapter 0940 W89C940 - 5a5a W89C940F - 6692 W6692 + 5a5a W89C940 Twisted-pair Ether-LAN Controller With PCI Interface [ELANC-PCI] + 6692 W6692 PCI ISDN S/T-Controller 1043 1702 ISDN Adapter (PCI Bus, D, W) 1043 1703 ISDN Adapter (PCI Bus, DV, W) 1043 1707 ISDN Adapter (PCI Bus, DV, W) @@ -7165,6 +7257,7 @@ 144f 1707 ISDN Adapter (PCI Bus, DV, W) 9921 W99200F MPEG-1 Video Encoder 9922 W99200F/W9922PF MPEG-1/2 Video Encoder + 9960 W9960CF Video Codec 9970 W9970CF 1051 Anigma, Inc. 1052 ?Young Micro Systems @@ -9163,13 +9256,13 @@ 5842 2051 ISA bridge 10ab Digicom 10ac Honeywell IAC -10ad Symphony Labs +10ad Winbond Electronics Corp / Symphony Labs 0001 W83769F 0003 SL82C103 0005 SL82C105 0103 SL82c103 - 0105 SL82c105 - 0565 W83C553F/W83C554F + 0105 SL82C105/W83C55xF Bus Master IDE + 0565 W83C553F/554F ISA bridge 10ae Cornerstone Technology 10af Micro Computer Systems Inc 10b0 CardExpert Technology @@ -13009,7 +13102,7 @@ 2182 TU116 [GeForce GTX 1660 Ti] 2183 TU116 2184 TU116 [GeForce GTX 1660] - 2187 TU116 [GeForce GTX 1660 SUPER] + 2187 TU116 [GeForce GTX 1650 SUPER] 2188 TU116 [GeForce GTX 1650] 2189 TU116 [CMP 30HX] 2191 TU116M [GeForce GTX 1660 Ti Mobile] @@ -13047,6 +13140,7 @@ 223f GA102GL 228b GA104 High Definition Audio Controller 228e GA106 High Definition Audio Controller + 2291 GA107 High Definition Audio Controller 2296 Tegra PCIe Endpoint Virtual Network 22a3 GH100 [H100 NVSwitch] 22ba AD102 High Definition Audio Controller @@ -13059,6 +13153,7 @@ 2322 GH100 [H800 PCIe] 2324 GH100 [H800] 2329 GH100 [H20] + 232c GH100 [H20 HBM3e] 2330 GH100 [H100 SXM5 80GB] 2331 GH100 [H100 PCIe] 2335 GH100 [H200 SXM 141GB] @@ -13072,6 +13167,7 @@ 2342 GH100 [GH200 120GB / 480GB] 2343 GH100 2345 GH100 [GH100-88K-A1] + 2348 GH100 [GH200 144G HBM3e] 237f GH100 [Skinny Joe] 23b0 GH100 23f0 GH100 @@ -13150,7 +13246,7 @@ 25a9 GA107M [GeForce RTX 2050] 25aa GA107M [GeForce MX570 A] 25ab GA107M [GeForce RTX 3050 4GB Laptop GPU] - 25ac GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] + 25ac GA107BM / GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] 25ad GA107 [GeForce RTX 2050] 25af GA107 [GeForce RTX 3050 Engineering Sample] 25b0 GA107GL [RTX A1000] @@ -13167,7 +13263,7 @@ 25e0 GA107BM [GeForce RTX 3050 Ti Mobile] 25e2 GA107BM [GeForce RTX 3050 Mobile] 25e5 GA107BM [GeForce RTX 3050 Mobile] - 25ec GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] + 25ec GA107BM / GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] 25ed GA107 [GeForce RTX 2050] 25f9 GA107 [RTX A1000 Embedded GPU ] 25fa GA107 [RTX A2000 Embedded GPU] @@ -13190,9 +13286,9 @@ 2704 AD103 [GeForce RTX 4080] 2705 AD103 [GeForce RTX 4070 Ti SUPER] 2709 AD103 [GeForce RTX 4070] - 2717 GN21-X11 [GeForce RTX 4090 Laptop GPU] + 2717 AD103M / GN21-X11 [GeForce RTX 4090 Laptop GPU] 2730 AD103GLM [RTX 5000 Ada Generation Laptop GPU] - 2757 GN21-X11 [GeForce RTX 4090 Laptop GPU] + 2757 AD103M / GN21-X11 [GeForce RTX 4090 Laptop GPU] 2770 AD103GLM [RTX 5000 Ada Generation Embedded GPU] 2782 AD104 [GeForce RTX 4070 Ti] 2783 AD104 [GeForce RTX 4070 SUPER] @@ -13230,8 +13326,24 @@ 28e0 AD107M [GeForce RTX 4060 Max-Q / Mobile] 28e1 AD107M [GeForce RTX 4050 Max-Q / Mobile] 28f8 AD107GLM [RTX 2000 Ada Generation Embedded GPU] - 2900 GB100 - 2940 GB100 + 2900 GB100 [Reserved Dev ID A] + 2940 GB100 [Reserved Dev ID B] + 2941 GB100 [GB200 SKU] + 2980 GB102 + 29c0 GB102 + 2c18 GB203M / GN22 [GeForce RTX 5090 Max-Q / Mobile] + 2c19 GB203M / GN22 [GeForce RTX 5080 Max-Q / Mobile] + 2c2c GB6-256(N22W-ES-A1) + 2c58 GB203M / GN22-X11 [GeForce RTX 5090 Max-Q / Mobile] + 2c59 GB203M / GN22-X9 [GeForce RTX 5080 Max-Q / Mobile] + 2d18 AD108M [GeForce RTX 5070 Max-Q / Mobile] + 2d19 AD108M [GeForce RTX 5060 Max-Q / Mobile] + 2d58 AD108M [GeForce RTX 5070 Max-Q / Mobile] + 2d59 AD108M [GeForce RTX 5060 Max-Q / Mobile] + 2d98 AD108M [GeForce RTX 5050 Max-Q / Mobile] + 2dd8 AD108M [GeForce RTX 5050 Max-Q / Mobile] + 2f18 AD108M [GeForce RTX 5070 Ti Max-Q / Mobile] + 2f58 AD108M [GeForce RTX 5070 Ti Max-Q / Mobile] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -13333,6 +13445,7 @@ f500 LPe37000/LPe38000 Series 32Gb/64Gb Fibre Channel Adapter 1014 06c1 PCIe4 4-Port 32Gb Fibre Channel Adapter for POWER (FC EN1L/EN1M; CCIN 2CFC) 1014 06c2 PCIe4 2-Port 64Gb Fibre Channel Adapter for POWER (FC EN1N/EN1P; CCIN 2CFD) + f600 LPe37100S/LPe38100S Series 32Gb/64Gb Fibre Channel Adapter f700 LP7000 Fibre Channel Host Adapter f701 LP7000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f800 LP8000 Fibre Channel Host Adapter @@ -13671,6 +13784,7 @@ 8813 RTL8813AE 802.11ac PCIe Wireless Network Adapter 8821 RTL8821AE 802.11ac PCIe Wireless Network Adapter 8852 RTL8852AE 802.11ax PCIe Wireless Network Adapter + 8922 RTL8922AE 802.11be PCIe Wireless Network Adapter a85a RTL8852AE WiFi 6 802.11ax PCIe Adapter b520 RTL8852BE-VT PCIe 802.11ax Wireless Network Controller b723 RTL8723BE PCIe Wireless Network Adapter @@ -14046,6 +14160,7 @@ 0410 VX900 Series Host Bridge: Host Control 0415 VT6415 PATA IDE Host Controller 1043 838f Motherboard + 0419 VN1000 Host Bridge 0501 VT8501 [Apollo MVP4] 0505 VT82C505 # Shares chip with :0576. The VT82C576M has :1571 instead of :0561. @@ -14137,6 +14252,7 @@ 1364 CN896/VN896/P4M900 Host Bridge 1409 VX855/VX875 Error Reporting 1410 VX900 Series Error Reporting + 1419 VN1000 Host Bridge 1571 VT82C576M/VT82C586 1595 VT82C595/97 [Apollo VP2/97] 1732 VT1732 [Envy24 II] PCI Multi-Channel Audio Controller @@ -14162,11 +14278,12 @@ 2364 CN896/VN896/P4M900 Host Bridge 2409 VX855/VX875 Host Bus Control 2410 VX900 Series CPU Bus Controller + 2419 VN1000 Host Bridge 287a VT8251 PCI to PCI Bridge 287b VT8251 Host Bridge 287c VT8251 PCIE Root Port 287d VT8251 PCIE Root Port - 287e VT8237/8251 Ultra VLINK Controller + 287e VT8237/8251/8261 Ultra VLINK Controller 3022 CLE266 3038 VT82xx/62xx/VX700/8x0/900 UHCI USB 1.1 Controller 0925 1234 onboard UHCI USB 1.1 Controller @@ -14331,7 +14448,7 @@ 3116 VT8375 [KM266/KL266] Host Bridge 1297 f641 FX41 motherboard 3118 CN400/PM800/PM880/PN800/PN880 [S3 UniChrome Pro] - 3119 VT6120/VT6121/VT6122 Gigabit Ethernet Adapter + 3119 VT6120/VT6121/VT6122/VT6130 Gigabit Ethernet Adapter 3122 VT8623 [Apollo CLE266] integrated CastleRock graphics 3123 VT8623 [Apollo CLE266] 3128 VT8753 [P4X266 AGP] @@ -14432,12 +14549,14 @@ 3372 VT8237S PCI to ISA Bridge 337a VT8237A PCI to PCI Bridge 337b VT8237A Host Bridge + 3402 VT8261 PCI to ISA Bridge 3403 VT6315 Series Firewire Controller 1043 8374 M5A88-V EVO 1043 8384 P8P67 Deluxe Motherboard 3409 VX855/VX875 DRAM Bus Control 3410 VX900 Series DRAM Bus Control 19da a179 ZBOX nano VD01 + 3419 VN1000 Host Bridge 3432 VL800/801 xHCI USB 3.0 Controller 3456 VX11 Standard Host Bridge 345b VX11 Miscellaneous Bus @@ -14466,6 +14585,7 @@ 4409 VX855/VX875 Power Management Control 4410 VX900 Series Power Management and Chip Testing Control 19da a179 ZBOX nano VD01 + 4419 VN1000 Host Bridge 5030 VT82C596 ACPI [Apollo PRO] 5122 VX855/VX875 Chrome 9 HCM Integrated Graphics 5208 PT890 I/O APIC Interrupt Controller @@ -14483,6 +14603,7 @@ 5372 VT8237/8251 Serial ATA Controller 5409 VX855/VX875 APIC and Central Traffic Control 5410 VX900 Series APIC and Central Traffic Control + 5419 VN1000 I/O APIC Interrupt Controller 6100 VT85C100A [Rhine II] 6122 VN1000 Graphics [Chrome 520 IGP] 6287 SATA RAID Controller @@ -14493,6 +14614,7 @@ 6409 VX855/VX875 Scratch Registers 6410 VX900 Series Scratch Registers 19da a179 ZBOX nano VD01 + 6419 VN1000 Host Bridge 7122 VX900 Graphics [Chrome9 HD] 7204 K8M800 Host Bridge 7205 KM400/KN400/P4M800 [S3 UniChrome] @@ -14519,6 +14641,7 @@ 7409 VX855/VX875 North-South Module Interface Control 7410 VX900 Series North-South Module Interface Control 19da a179 ZBOX nano VD01 + 7419 VN1000 Host Bridge 8231 VT8231 [PCI-to-ISA Bridge] 8235 VT8235 ACPI 8305 VT8363/8365 [KT133/KM133 AGP] @@ -14543,12 +14666,14 @@ 8a26 KL133/KL133A/KM133/KM133A [S3 ProSavage] 8d01 PN133/PN133T [S3 Twister] 8d04 KM266/P4M266/P4M266A/P4N266 [S3 ProSavageDDR] + 9000 VT8261 IDE Controller [StorX IDE Controller - 9000] 9001 VX900 Series Serial-ATA Controller + 9040 VT8261 SATA Controller [StorX RAID Controller - 9040] 9082 Standard AHCI 1.0 SATA Controller 9140 HDMI Audio Device 9201 USB3.0 Controller 9380 Ncore Coprocessor for Centaur CNS - 9530 VX800/820/900 Series Secure Digital Memory Card Controller + 9530 VX800/820/900/VT8261 Series Secure Digital Memory Card Controller 95d0 VX800/820/900 Series SDIO Host Controller a208 PT890 PCI to PCI Bridge Controller a238 K8T890 PCI to PCI Bridge Controller @@ -14557,6 +14682,7 @@ a364 CN896/VN896/P4M900 PCI to PCI Bridge Controller a409 VX855/VX875/VX900 Series USB Device Controller a410 VX900 Series PCI Express Root Port 0 + a419 VN1000 PCI to PCI Bridge b091 VT8633 [Apollo Pro266 AGP] b099 VT8366/A/7 [Apollo KT266/A/333 AGP] b101 VT8653 AGP Bridge @@ -14572,6 +14698,7 @@ b213 VPX/VPX2 I/O APIC Interrupt Controller b353 VX855/VX875/VX900 PCI to PCI Bridge b410 VX900 Series PCI Express Root Port 1 + b419 VN1000 Host Bridge b999 [K8T890 North / VT8237 South] PCI Bridge c208 PT890 PCI to PCI Bridge Controller c238 K8T890 PCI to PCI Bridge Controller @@ -14581,22 +14708,26 @@ c364 CN896/VN896/P4M900 PCI to PCI Bridge Controller c409 VX855/VX875 EIDE Controller c410 VX900 Series PCI Express Root Port 2 + c419 VN1000 PCI to PCI Bridge d104 VT8237R USB UDCI Controller d208 PT890 PCI to PCI Bridge Controller d213 VPX/VPX2 PCI to PCI Bridge Controller d238 K8T890 PCI to PCI Bridge Controller d340 PT900 PCI to PCI Bridge Controller d410 VX900 Series PCI Express Root Port 3 + d419 VN1000 PCI to PCI Bridge e208 PT890 PCI to PCI Bridge Controller e238 K8T890 PCI to PCI Bridge Controller e340 PT900 PCI to PCI Bridge Controller e353 VX800/820-Series PCI-Express Root Port 0 e410 VX900 Series PCI Express Physical Layer Electrical Sub-block + e419 VN1000 PCI to PCI Bridge f208 PT890 PCI to PCI Bridge Controller f238 K8T890 PCI to PCI Bridge Controller f340 PT900 PCI to PCI Bridge Controller f353 VX800/820-Series PCI-Express Root Port 1 f410 VX900 Series PCI UART Port 0-3 + f419 VN1000 PCI to PCI Bridge 1107 Stratus Computers 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!) 1108 Proteon, Inc. @@ -17016,9 +17147,7 @@ 123b Seeq Technology, Inc. 123c Century Systems, Inc. 123d Engineering Design Team, Inc. - 0000 EasyConnect 8/32 - 0002 EasyConnect 8/64 - 0003 EasyIO + 0000 PCI 11W 0047 PCIe4 CDa 004b PCIe4 CDa 16 009d VisionLink F1 @@ -17132,7 +17261,9 @@ 1028 0085 ES1968 Maestro-2 PCI 1033 8051 ES1968 Maestro-2 Audiodrive 1969 ES1938/ES1946/ES1969 Solo-1 Audiodrive + 1014 0162 16 Bit PCI Audio Adapter (37L4457) 1014 0166 ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard + 121f 8800 eDio Hi-Live SC1938 125d 8888 Solo-1 Audio Adapter 125d 8898 ES1938S TTSOLO1-SL [TerraTec 128i PCI] 153b 111b Terratec 128i PCI @@ -18379,6 +18510,8 @@ 0207 GLN180PEX GPS/GLONASS receiver (PCI Express) 0208 GPS180AMC GPS Receiver (PCI Express / MicroTCA / AdvancedMC) 0209 GNS181PEX GPS/Galileo/GLONASS/BEIDOU receiver (PCI Express) + 020a GPS183PEX GPS Receiver (PCI Express) + 020b GNS183PEX GPS/Galileo/GLONASS/BEIDOU receiver (PCI Express) 0301 TCR510PCI IRIG Timecode Reader 0302 TCR167PCI IRIG Timecode Reader 0303 TCR511PCI IRIG Timecode Reader @@ -20018,6 +20151,7 @@ 1028 215a DC NVMe PM9A3 RI U.2 960GB 1028 215b DC NVMe PM9A3 RI U.2 1.92TB 1028 215c DC NVMe PM9A3 RI U.2 3.84TB + 1028 215d Dell DC NVMe PM9A3 RI U.2 7.68TB 1028 2166 DC NVMe PM9A3 RI 110M.2 960GB 1028 2167 DC NVMe PM9A3 RI 110M.2 1.92TB 1028 2168 DC NVMe PM9A3 RI 80M.2 480GB @@ -20154,6 +20288,45 @@ 1028 225e NVMe FIPS PM1745 MU U.2 12.8TB 1028 225f NVMe PM1745 MU U.2 12.8TB a900 NVMe SSD Controller PM9DXa + 1028 230f DC NVMe PM9D3a RI 80M.2 480GB ISE + 1028 2310 DC NVMe PM9D3a RI 80M.2 960GB ISE + 1028 2311 DC NVMe PM9D3a RI 80M.2 1.92TB ISE + 1028 2341 DC NVMe PM9D3a RI U.2 960GB  + 1028 2342 DC NVMe PM9D3a RI U.2 1.92TB + 1028 2343 DC NVMe PM9D3a RI U.2 3.84TB + 1028 2344 DC NVMe PM9D3a RI U.2 7.68GTB + 1028 2345 DC NVMe PM9D3a RI U.2 15.36TB + 1028 2346 DC NVMe FIPS PM9D3a RI U.2 960GB + 1028 2347 DC NVMe FIPS PM9D3a RI U.2 1.92TB + 1028 2348 DC NVMe FIPS PM9D3a RI U.2 3.84TB + 1028 2349 DC NVMe FIPS PM9D3a RI U.2 7.68TB + 1028 234a DC NVMe FIPS PM9D3a RI U.2 15.36TB  + 1028 234d DC NVMe PM9D3a RI E3s 1.92TB + 1028 234e DC NVMe PM9D3a RI E3s 3.84TB  + 1028 234f DC NVMe PM9D3a RI E3s 7.68GTB + 1028 2350 DC NVMe PM9D3a RI E3s 15.36TB + 1028 2351 DC NVMe FIPS PM9D3a RI E3s 1.92TB + 1028 2352 DC NVMe FIPS PM9D3a RI E3s 3.84TB + 1028 2353 DC NVMe FIPS PM9D3a RI E3s 7.68TB + 1028 2354 DC NVMe FIPS PM9D3a RI E3s 15.36TB + 1028 2355 DC NVMe PM9D5a MU U.2 800GB + 1028 2356 DC NVMe PM9D5a MU U.2 1.6TB + 1028 2357 DC NVMe PM9D5a MU U.2 3.2TB + 1028 2358 DC NVMe PM9D5a MU U.2 6.4TB + 1028 2359 DC NVMe PM9D5a MU E3.s 1.6TB + 1028 235a DC NVMe PM9D5a MU E3.s 3.2TB + 1028 235b DC NVMe PM9D5a MU E3.s 6.4TB + aa00 NVMe SSD Controller BM1743 + 1028 2312 NVMe FIPS BM1743 QLC U.2 15.36TB + 1028 2313 NVMe FIPS BM1743 QLC U.2 30.72TB + 1028 2314 NVMe FIPS BM1743 QLC U.2 61.44TB + 1028 2315 NVMe BM1743 QLC U.2 15.36TB + 1028 2316 NVMe BM1743 QLC U.2 30.72TB + 1028 2317 NVMe BM1743 QLC U.2 61.44TB + 1028 2364 NVMe BM1743 QLC U.2 122.88TB + 1028 2366 MZ3MO15THCLCAD3 + 1028 2367 MZ3MO30THCLFAD3 + ac00 NVMe SSD Controller PM175x ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. @@ -20353,6 +20526,7 @@ 14c3 MEDIATEK Corp. 0608 MT7921K (RZ608) Wi-Fi 6E 80MHz 0616 MT7922 802.11ax PCI Express Wireless Network Adapter + 4d75 T700 5G Modem [5G Solution 5000] 7603 MT7603E 802.11bgn PCI Express Wireless Network Adapter 7612 MT7612E 802.11acbgn PCI Express Wireless Network Adapter 7615 MT7615E 802.11ac PCI Express Wireless Network Adapter @@ -20360,12 +20534,16 @@ 7650 MT7650 802.11ac # MT7612E too? 7662 MT7662E 802.11ac PCI Express Wireless Network Adapter + 7663 MT7663 802.11ac PCI Express Wireless Network Adapter 7915 MT7915E 802.11ax PCI Express Wireless Network Adapter 7916 MT7905D/MT7975 # WiFi 6E capable 7922 MT7922 802.11ax PCI Express Wireless Network Adapter 1a3b 5300 ASUS PCE-AXE59BT 7961 MT7921 802.11ax PCI Express Wireless Network Adapter + 7988 MT7988 PCIe Host Bridge [Filogic 880] + 7990 MT7996 802.11be PCI Express Wireless Network Adapter (Port 0) + 7991 MT7996 802.11be PCI Express Wireless Network Adapter (Port 1) 8650 MT7650 Bluetooth 14c4 IWASAKI Information Systems Co Ltd 14c5 Automation Products AB @@ -20992,7 +21170,20 @@ 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE 1590 0420 HPE Ethernet 25/50Gb 2-port 6310C Adapter 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet - 1760 BCM57608 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet + 1760 BCM57608 25Gb/50Gb/100Gb/200Gb/400Gb Ethernet + 14e4 9110 BCM57608 1x400G PCIe Ethernet NIC + 14e4 9120 BCM57608 2x200G PCIe Ethernet NIC + 14e4 9121 BCM57608 2x100G PCIe Ethernet NIC + 14e4 9125 BCM57608 2x200G PCIe Ethernet NIC + 14e4 9126 BCM57608 2x100G PCIe Ethernet NIC + 14e4 9140 BCM57608 1x400G QSFP-DD PCIe Ethernet NIC + 14e4 9310 BCM57608 1x400G QSFP-DD OCP Ethernet NIC + 14e4 9311 BCM57608 1x400G OCP Ethernet NIC + 14e4 9312 BCM57608 1x200G OCP Ethernet NIC + 14e4 9320 BCM57608 2x200G OCP Ethernet NIC + 14e4 9325 BCM57608 2x200G OCP Ethernet NIC + 14e4 9326 BCM57608 2x100G OCP Ethernet NIC + 14e4 9340 BCM57608 4x100G OCP Ethernet NIC 14e4 d125 BCM57608 2x200G PCIe Ethernet NIC 1800 BCM57502 NetXtreme-E Ethernet Partition 1801 BCM57504 NetXtreme-E Ethernet Partition @@ -21010,6 +21201,7 @@ 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet Virtual Function 1809 BCM5750X NetXtreme-E RDMA Virtual Function 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz RDMA Virtual Function + 1819 BCM5760X Ethernet Virtual Function 2711 BCM2711 PCIe Bridge 2712 BCM2712 PCIe Bridge 3352 BCM3352 @@ -21983,6 +22175,7 @@ 6893 3U OpenVPX Multi-function I/O Board [Model 68C3] 15ad VMware 0405 SVGA II Adapter + 0406 SVGA II Adapter (Fusion) 0710 SVGA Adapter 0720 VMXNET Ethernet Controller 0740 Virtual Machine Communication Interface @@ -22061,7 +22254,7 @@ 0271 Spectrum-5 RMA 0274 Spectrum-6 in Flash Recovery Mode 0275 Spectrum-6 RMA - 0277 Spectrum-4TOR RMA + 0277 Spectrum-6 Tile 0278 Quantum-4 in Flash Recovery Mode 0279 Quantum-4 RMA 027a Eros Chiplet @@ -22075,6 +22268,7 @@ # Flash recovery 0288 Arcus2 0289 Arcus2 RMA + 0290 SagittaZ 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -22151,6 +22345,7 @@ 193d 1083 NIC-ETH640F-3S-2P # NIC-ETH540F-3S-2P OCP3.0 2x10G Card 193d 1084 NIC-ETH540F-3S-2P + 1e81 0c10 25GbE dual-port SFP28, PCIe3.0 x8 [3SC10] 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 15b3 0006 ConnectX-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT @@ -22169,9 +22364,14 @@ 101b MT28908 Family [ConnectX-6] 101c MT28908 Family [ConnectX-6 Virtual Function] 101d MT2892 Family [ConnectX-6 Dx] + 193d 1055 NIC-ETH1040F-LP-2P QSFP56 2x100GbE PCIe Network Adapter 101e ConnectX Family mlx5Gen Virtual Function 101f MT2894 Family [ConnectX-6 Lx] 193d 1035 NIC-ETH641F-LP-2P SFP28 2x25GbE PCIe Network Adapter + 1bd4 00ac O252MCX6Lx + 1bd4 00ae S252MCX6Lx + 1ff9 00ad ENFM6251-SP2 + 1ff9 00af ENPM6251-SP2 1020 MT28860 1021 MT2910 Family [ConnectX-7] 1023 CX8 Family [ConnectX-8] @@ -22316,7 +22516,7 @@ 5006 SanDisk Extreme Pro / WD Black SN750 / PC SN730 / Red SN700 NVMe SSD 5007 IX SN530 NVMe SSD (DRAM-less) 5008 PC SN530 NVMe SSD (DRAM-less) - 5009 SanDisk Ultra 3D / WD Blue SN550 NVMe SSD + 5009 SanDisk Ultra 3D / WD PC SN530, IX SN530, Blue SN550 NVMe SSD (DRAM-less) 15b7 5009 WD Blue SN550 NVMe SSD 500b PC SN530 NVMe SSD 1414 500b Xbox Series X @@ -22339,6 +22539,7 @@ 5036 WD PC SN5000S M.2 2280 NVMe SSD (DRAM-less) 5041 WD Blue SN580 NVMe SSD (DRAM-less) 5042 WD Black SN770M NVMe SSD (DRAM-less) + 5046 SanDisk Extreme NVMe SSD (DRAM-less) 15b8 ADDI-DATA GmbH 1001 APCI1516 SP controller (16 digi outputs) 1003 APCI1032 SP controller (32 digi inputs w/ opto coupler) @@ -23436,6 +23637,7 @@ 8084 GL880 USB 2.0 EHCI controller 9750 GL9750 SD Host Controller 9755 GL9755 SD Host Controller + 9767 GL9767 SD Host Controller e763 GL9763E eMMC Controller 17aa Lenovo 0003 LENSE20256GMSP34MEAT2TA @@ -23930,6 +24132,8 @@ # Sitecom HFC-S based ISDN controller card DC-105v2 3069 DC-105v2 ISDN controller 18d4 Celestica +# OCP-TAP + 1007 Time Card 18d8 Dialogue Technology Corp. 18dd Artimi Inc 4c6f Artimi RTMI-100 UWB adapter @@ -24676,6 +24880,7 @@ 1a03 ASPEED Technology, Inc. 1150 AST1150 PCI-to-PCI Bridge 2000 ASPEED Graphics Family + 15d9 0821 X10DRW-i 15d9 0832 X10SRL-F 15d9 1b95 H12SSL-i 1a05 deltaww @@ -24826,6 +25031,7 @@ 1ad7 Spectracom Corporation 8000 TSync-PCIe Time Code Processor 9100 TPRO-PCI-66U Timecode Reader/Generator + a000 OCP-TAP [ARTCard] 1ade Spin Master Ltd. 1501 Swipetech barcode scanner 3038 PCIe Video Bridge @@ -25457,6 +25663,7 @@ 0022 FD788 0023 FD722-M2 0024 FD722 with bypass + 0025 FD922 1c28 Lite-On IT Corp. / Plextor 0122 M6e PCI Express SSD [Marvell 88SS9183] # previously Fiberblaze @@ -25656,6 +25863,12 @@ 1c5f 5437 NVMe SSD PBlaze6 6647 3200G 2.5" U.2(dual port) 1c5f 5441 NVMe SSD PBlaze6 6547 6400G 2.5" U.2 1c5f 5447 NVMe SSD PBlaze6 6647 6400G 2.5" U.2(dual port) + 0027 PBlaze7 7A40/7A46 NVMe SSD + 1c5f 1421 NVMe SSD PBlaze7 7A40 1920G 2.5" U.2 + 1c5f 1431 NVMe SSD PBlaze7 7A40 3840G 2.5" U.2 + 1c5f 1441 NVMe SSD PBlaze7 7A40 7680G 2.5" U.2 + 1c5f 5431 NVMe SSD PBlaze7 7A46 3200G 2.5" U.2 + 1c5f 5441 NVMe SSD PBlaze7 7A46 6400G 2.5" U.2 003d PBlaze5 920/926 1c5f 0a30 NVMe SSD PBlaze5 920 3840G AIC 1c5f 0a31 NVMe SSD PBlaze5 920 3840G 2.5" U.2 @@ -25679,9 +25892,12 @@ 1c5f 4b61 NVMe SSD PBlaze6 6936 25600GB 2.5" U.3 003f PBlaze7 7940/7946 NVMe SSD 1c5f 0431 NVMe SSD PBlaze7 7940 3840G 2.5" U.2 + 1c5f 0441 NVMe SSD PBlaze7 7940 7680G 2.5" U.2 + 1c5f 0451 NVMe SSD PBlaze7 7940 15360G 2.5" U.2 1c5f 0c31 NVMe SSD PBlaze7 7940 3840G 2.5" U.2 1c5f 0c41 NVMe SSD PBlaze7 7940 7680G 2.5" U.2 1c5f 0c51 NVMe SSD PBlaze7 7940 15360G 2.5" U.2 + 1c5f 0c61 NVMe SSD PBlaze7 7940 30720G 2.5" U.2 1c5f 1430 NVMe SSD PBlaze7 7940 3840G AIC 1c5f 1431 NVMe SSD PBlaze7 7940 3840G 2.5" U.2 1c5f 1435 NVMe SSD PBlaze7 7940 3840G E1.S @@ -25690,6 +25906,9 @@ 1c5f 1445 NVMe SSD PBlaze7 7940 7680G E1.S 1c5f 1450 NVMe SSD PBlaze7 7940 15360G AIC 1c5f 1451 NVMe SSD PBlaze7 7940 15360G 2.5" U.2 + 1c5f 4431 NVMe SSD PBlaze7 7946 3200G 2.5" U.2 + 1c5f 4441 NVMe SSD PBlaze7 7946 6400G 2.5" U.2 + 1c5f 4451 NVMe SSD PBlaze7 7946 12800G 2.5" U.2 1c5f 4c31 NVMe SSD PBlaze7 7946 3200G 2.5" U.2 1c5f 4c41 NVMe SSD PBlaze7 7946 6400G 2.5" U.2 1c5f 4c51 NVMe SSD PBlaze7 7946 12800G 2.5" U.2 @@ -25775,6 +25994,7 @@ 627a LEGEND 800 NVMe SSD (DRAM-less) # 500GB 628a LEGEND 800 NVMe SSD (DRAM-less) + 642a XPG GAMMIX S50 CORE NVMe SSD (DRAM-less) 8201 XPG SX8200 Pro PCIe Gen3x4 M.2 2280 Solid State Drive 1cc4 Shenzhen Unionmemory Information System Ltd. 1203 NVMe SSD Controller UHXXXa series @@ -25808,6 +26028,8 @@ 6a03 RPETJ512MKP1QDQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) 6a13 RPJYJ512MKN1QWQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) 6a14 RPEYJ1T24MKN2QWY PCIe 4.0 NVMe SSD 1024GB (DRAM-less) + 6b13 RPJYJ512MLR1QWY PCIe 4.0 NVMe SSD 512GB (DRAM-less) + 6b14 RPJYJ1T24MLR1HWY PCIe 4.0 NVMe SSD 1024GB (DRAM-less) 8030 NVMe SSD Controller UH8X2X/UH7X2X series 1cc4 1122 NVMe SSD UH812a U.2 1.92TB 1cc4 1123 NVMe SSD UH812a U.2 3.84TB @@ -25894,6 +26116,7 @@ efa0 Elastic Fabric Adapter (EFA) efa1 Elastic Fabric Adapter (EFA) efa2 Elastic Fabric Adapter (EFA) + efa3 Elastic Fabric Adapter (EFA) 1d17 Zhaoxin 070f ZX-100 PCI Express Root Port 0710 ZX-100/ZX-200 PCI Express Root Port @@ -26106,6 +26329,8 @@ 1028 AR-P2P-ATR [P2P Actor Function] 1029 AR-P2P-UTL [P2P Utility Function] 102a AR-TK242-FX2 [4x100GbE Gen5 Packet Capture-Replay Device] + 102b AR-ARKV-FX1 [Arkville 128B DPDK Data Mover for Versal/CPM5] + 102c AR-TK242-V80 [Gen5 PCAP Processor] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d72 Xiaomi 1d78 DERA Storage @@ -26255,6 +26480,7 @@ 0010 Networking DOM Engine 0011 IO Bridge 0013 Host Network Interface + 0400 Time Card 1da1 Teko Telecom S.r.l. 1da2 Sapphire Technology Limited 475d Radeon RX 7800 XT [PULSE] @@ -26270,6 +26496,7 @@ 1010 HL-2000 AI Training Accelerator [Gaudi secured] # PCIe accelerator card for Deep Learning training tasks 1020 Gaudi2 AI Training Accelerator + 1060 Gaudi3 AI Training Accelerator 1da8 Corigine, Inc. 3800 Network Flow Processor 3800 3803 Network Flow Processor 3800 Virtual Function @@ -26333,6 +26560,7 @@ 1dbe 5007 Dongting-N3 DC SSD U.2 12800GB 1dbe 5008 Dongting-N3 DC SSD U.2 15360GB 1dbe 5009 Dongting-N3 DC SSD U.2 25600GB + 1dbe 5010 Dongting-N3 DC SSD U.2 30720GB 5669 NVMe SSD Controller IG5669 [Tacoma] 1dbf Guizhou Huaxintong Semiconductor Technology Co., Ltd 0401 StarDragon4800 PCI Express Root Port @@ -26793,6 +27021,7 @@ 1028 223d Ent NVMe CM7 U.2 MU 3.2TB 1028 223e Ent NVMe CM7 U.2 MU 1.6TB 002a Exceria Plus G3 NVMe SSD (DRAM-less) + 002b NVMe SSD Controller CD8P 002c NVMe SSD Controller CD8P EDSFF 1028 22bf DC NVMe CD8P E3.S 15.36TB 1028 22c0 DC NVMe CD8P E3.S 7.68TB @@ -26848,8 +27077,14 @@ 1e3b DapuStor Corporation 0600 NVMe SSD Controller DP600 1e3b 0006 Enterprise NVMe SSD U.2 7.68TB (J5000) + 1e3b 000c Enterprise NVMe SSD U.2 30.72TB (J5060) + 1e3b 000d Enterprise NVMe SSD U.2 61.44TB (J5060) + 1e3b 000e Enterprise NVMe SSD U.2 30.72TB (J5060D) + 1e3b 000f Enterprise NVMe SSD U.2 61.44TB (J5060D) 1e3b 0010 Enterprise NVMe SSD U.2 3.84TB (R5102) *** 705 LINES SKIPPED *** From nobody Thu Jan 9 14:22:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTRnw3DlQz5ktM0; Thu, 09 Jan 2025 14:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTRnw2dbQz44lr; Thu, 9 Jan 2025 14:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736432564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5lt5PZMpdemj5wFSPAcn89sc9S0mn/bCnVP3M+MWe+A=; b=TwX8h4ke2Qs5IcXQg3AcX6Uu5i+8dadZEgrzPZxEMwkVhx5WaOsJOutucDNm71qmiY4UK1 0kGtx66hIHhIsNDA2vkd1ZBwLMwyH7PrvPRYZEphd8a9GNYw0obZ8bdN8jFLWzhqCPDXDD sKeACIk7sU4ear0/fgloO+muepJ8FMAnZUQPEt4puSYz4cjxRDfCW0qNZ066WRT5DC7NcT SVm8gaDsNnaYKG+9OhqRTvCD+14/vFca5N1cevrRz+UTz0eL/me5HmrTfVes6+JX3J9/uT /8qQgJu+zQeTyHcRfIIM+/Mu2D6zUNPTUra/KemS60Ks5ICUF8O3eusz1y8aOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736432564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5lt5PZMpdemj5wFSPAcn89sc9S0mn/bCnVP3M+MWe+A=; b=Bhj7G7BSXN+LOVSYD/JYTHyNae8lHdP5tHdxEbD8NpPc0HCipy1KEY8q03ZD9bcwpFVtZR JMbbI8cbtueJe88ngg2IXLdhIpQBOPPsHfPAYN1OiRByRNXv9cHLyYkdZbRe+ZQolgvbXU aRe8zMeZT5jHDo9IwAuhltA0xNv+sTAj4MHG2WBptnB4CmVOhCCxF66X8mq7PODmX9RMv4 rdndbRPxntb1pR6jLwesWA59r6DJqQFV44iMhMh8mWrygL1xs+M0YX3RrcD0ue4S4r0g2p 05AQCjB0MggrcKmw7Gsw/qXHhssdlSwObs8i95bD27RMSfhfn+IZ8l8Mx0/oMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736432564; a=rsa-sha256; cv=none; b=jD1z94bnu2cC7DOOhNXVyQBG6z8a6bun0yWZEVSh8DMZserf6Xqd9kup+/qkN5k6M4b7Ud b88y3AOTitG/kBpjXmhqcjcY8c7Gr9Kc1eD4v8z2LI/7PCGNyiUWqP+8gTiiMZOV/vl8Gw RB9ywgKv842AgIra0t5JBKzJgpapsd1qrnQ17rpnq4OLtwVgEGMR5T5joAgakzygaNoxRT 7009AnwtrH3RM29ja5/nymvWAytiuQHucPlUWXmnMeCIcGxkM3mdg9m3qKrFlUmp/pdbo5 Lvfj4KZ3geXObiLU89VFIlXD0sEZVjYhDWg96f6B+5FnIR/HWw25FqSISvdBuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTRnw1vDtzVG3; Thu, 09 Jan 2025 14:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509EMi2L090052; Thu, 9 Jan 2025 14:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509EMiam090049; Thu, 9 Jan 2025 14:22:44 GMT (envelope-from git) Date: Thu, 9 Jan 2025 14:22:44 GMT Message-Id: <202501091422.509EMiam090049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Renato Botelho Subject: git: 19a6bc9f51e5 - main - fwget: Silence log() when -q is used List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19a6bc9f51e5c5705a2b396b0da61e6536acb4cb Auto-Submitted: auto-generated The branch main has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=19a6bc9f51e5c5705a2b396b0da61e6536acb4cb commit 19a6bc9f51e5c5705a2b396b0da61e6536acb4cb Author: Renato Botelho AuthorDate: 2025-01-09 12:16:10 +0000 Commit: Renato Botelho CommitDate: 2025-01-09 14:21:11 +0000 fwget: Silence log() when -q is used Summary: Silence log function when -q parameter is used to prevent undesired output PR: 283939 Reviewed By: manu Differential Revision: https://reviews.freebsd.org/D48391 Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/fwget/fwget.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index 3e2181e53b73..d87cd03aa139 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -47,7 +47,9 @@ EOF log() { - echo "$@" + if [ "${QUIET}" != "y" ]; then + echo "$@" + fi } log_verbose() From nobody Thu Jan 9 14:43:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTSFs5ZDLz5kwLw; Thu, 09 Jan 2025 14:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTSFs4TbVz46rW; Thu, 9 Jan 2025 14:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736433809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YnqMm12R2rXtT5LmB3LQ+GIHSglmzAwbpPlZtQjmRwk=; b=YXF4wFNLCfNUD73Pwp4V4IRrxLree9JFH+F6CevgAn8pVYdddj7McpfH3QA5tKk3wMRzMs 4VBdeozlEs29RebCqejxR1ACmRWRZqrnzj5gtgVP4l9Osb8u6okaD80sW/NEWrAZSZFaD8 Gn+0C3Ab3avZv83nzezYZNuBDryHIBvfZ0PFK4AOUcmnhyTPrsYYvF0Eo9otuRQkppQmxY OdDPqpZ2QIrr1hcE+lnbHl5Azu0MYCcV8xqWC9qP5NG7gqCNtGHtfoTNn042jHeBhRIlBl xcTBP1eazfk7l18MoUj1k0TjmoD8Rv2mmiCQOZUVIKOEDOkblusILHflWjM/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736433809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YnqMm12R2rXtT5LmB3LQ+GIHSglmzAwbpPlZtQjmRwk=; b=YvrXrUBpyFyJhOZ2HQD7Px5mqH33qjXPgGcRZIajD/0xylTVDthtRArPEJRqjXpQvCN0Rl nP9etH2ZlsEiVM9TwtyfFdqsLmaYI/Gj+JqapgilfmLrS6XIYjH/Cu5mWO23qzdzNwOSIa f4aHYZz7jeE9kDHEIG3y5SKI5HAvJteR4nvAk5Fcn53hofzV451P2WJwu6Rp+8RlfCeifH wc8dPTNvz2G1w66DSS4pBVcAKO6BVNMOlOC3PHqKImqmj+Y2/SH+p4mExyBoPMheMgu+EM lLM7UoAHl9HYyI0zqyDP4gqhvjYTU0GsCYoeRGwvWQw98n1ruJ6/FrF/vgDdJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736433809; a=rsa-sha256; cv=none; b=uSO+WHC2RKNOaL6VPw67Mznj9m/k49YfOpW8+05JV32p1tl4Jl4tiFT7D32fj0g2uH6Sja fWx200xuzRXqqI7T3yF04tZorpckACxT0XOatDaEPcmYMG5KL2S5hPEAWpYkU3FGx4oeo1 iB8TYaEeUetNDltrA7nzfJn/chAeFa0DID8/qSmcIKLbgecdoaeS0rzzsypbpkI0xpXsi0 8lHpnCYALNvSOzlbm9iW6VD5KObZxB67QXRlTX8P3JRXZU4A+k/f8NztLgxeOm4QXqFcaM If2EmVQcGIyb1xeFS5tHLYveQqjffchd5X+eaYBJ1hqNGH/QLDCykSVrVrbAPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTSFs3qBszVXG; Thu, 09 Jan 2025 14:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509EhTpB027776; Thu, 9 Jan 2025 14:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509EhTBh027773; Thu, 9 Jan 2025 14:43:29 GMT (envelope-from git) Date: Thu, 9 Jan 2025 14:43:29 GMT Message-Id: <202501091443.509EhTBh027773@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: 7c94d515db90 - main - aio_kqueue_test: Fix CID 1558429 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c94d515db900401a339cd26861856c8fefb3086 Auto-Submitted: auto-generated The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=7c94d515db900401a339cd26861856c8fefb3086 commit 7c94d515db900401a339cd26861856c8fefb3086 Author: David Bright AuthorDate: 2025-01-05 17:24:13 +0000 Commit: David Bright CommitDate: 2025-01-09 14:42:36 +0000 aio_kqueue_test: Fix CID 1558429 Fix a Coverity error in the aio_kqueue_test that could theoretically (but probably not realistically) cause overindexing an array. Differential Revision: https://reviews.freebsd.org/D48328 Reviewed by: asomers, vangyzen Sponsored by: Dell Technologies --- tests/sys/aio/aio_kqueue_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/aio/aio_kqueue_test.c b/tests/sys/aio/aio_kqueue_test.c index c2478a9d05b3..5e5cb40d0752 100644 --- a/tests/sys/aio/aio_kqueue_test.c +++ b/tests/sys/aio/aio_kqueue_test.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -192,6 +193,7 @@ main (int argc, char *argv[]) for (j = 0; j < max_queue_per_proc && iocb[j] != kq_iocb; j++) ; + assert(j < max_queue_per_proc); #ifdef DEBUG printf("kq_iocb %p\n", kq_iocb); From nobody Thu Jan 9 14:53:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTST40nWhz5kwYP; Thu, 09 Jan 2025 14:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTST408w0z47Wd; Thu, 9 Jan 2025 14:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736434392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z64Yqk6GcKPKOpTY6cF0h3AOeSp9jrt1nb41mz9L0Ew=; b=aaaYhqx0OYvIiHa5tXZOU+UtNytdgrYSdxcaUNj9s8Jky695pM7auX3hQUJUXJH4flqfMy 9CVTSTrRXPB3iVeP8p0x6Xs8TpZDZRa+SzZTnxUPhe5eYOFwUSHxuYIY9WtaTqoIykwDor 9DV33xs2YYTsj4vZVR8bCnXm7dMr0UDFeqMMnIgCh5z5lcYY1jxUgJuvK0B/b1K/zF3B+3 7+d+Dh0LyXhy5VOucMl9HIp7jR3U3YMeo9vrXpVqYqt0csMyF5GPJ+RiFiQkrnkJXHlZP+ Qi03mf0F/LIjshldJpDLv+LAVJ+9XodEy5JekzIMW6gsob2Y5XTIGOVzwyrEdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736434392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z64Yqk6GcKPKOpTY6cF0h3AOeSp9jrt1nb41mz9L0Ew=; b=byWROXhmPiO1+Oam4Fwf69GHObTJlwE7mwlAqj0baHzGcKlRNj0cFCzX7V7jukWKYtJ1Zg iI5Pp8voNFzbf7d9ZvxBcTPECuemXGOvHsvD0dniFnknPUwVSXE9zFUbuGOl7qqA13VFmM pdmH9jJ6hh6SrgPZNR+vX7nXlqjkXOQf98wXC5O9prQn8s3xXSdha05f1hzekbiM4eg4AG G++4rZ7bAYEMled9yCNP8PPqw5ALvB069qM2LGFStVhA21/q/eWxrs4+tPtkfUH/Xcfeov XX9VB8G9jwepSN7k/oX5zx9HzzcukPG0grc8VSdPOlve94lG8+pa0mUy6iwr8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736434392; a=rsa-sha256; cv=none; b=JtogkRekZUO4hCLnJrpuhPvA7qVdocr9/VrzAtZCXFL5qfOt+9V+s6AInSy/ES9fOTO2xP G79vBA8cr5/1/YBgVBslpSfUr82s0XMw2QYYpoedEOvhbrvBHSRLsnGenDv80TZi4lLvfW 2KzT+B5Xm+5P6rPJsQ0+rAK0wN774gEyfkU75P8NCJKYP7pq8GhbB2JrDfx/KOGJeY+B9P M74qjAIcIl4D9usCArhg1X3AkDbfrJgM6MulIivnlA2lxNdUpgSSkfvkUj1no0P9PF+CmS LcHH13+Q4gpsI6OdqhoJOMimyyeULl0IdsktYiMrhd9IZanFsmqpAzGnIvVS7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTST36thhzVZy; Thu, 09 Jan 2025 14:53:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509ErBhk046105; Thu, 9 Jan 2025 14:53:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509ErB12046101; Thu, 9 Jan 2025 14:53:11 GMT (envelope-from git) Date: Thu, 9 Jan 2025 14:53:11 GMT Message-Id: <202501091453.509ErB12046101@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: 4a46ece6c6a9 - main - vmm: Fix error handling in vmm_handler() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a46ece6c6a90f18effbfae7ddef79b41ef43eec Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4a46ece6c6a90f18effbfae7ddef79b41ef43eec commit 4a46ece6c6a90f18effbfae7ddef79b41ef43eec Author: Mark Johnston AuthorDate: 2025-01-09 14:49:34 +0000 Commit: Mark Johnston CommitDate: 2025-01-09 14:49:34 +0000 vmm: Fix error handling in vmm_handler() In commit a97f683fe3c4 I didn't add code to remove the vmmctl device when vmm.ko is unloaded, so it would persist and prevent vmm.ko from being re-loaded. Extend vmmdev_cleanup() to destroy the vmmctl cdev. Also call vmmdev_cleanup() if vmm_init() fails. Reviewed by: corvink, andrew Fixes: a97f683fe3c4 ("vmm: Add a device file interface for creating and destroying VMs") Differential Revision: https://reviews.freebsd.org/D48269 --- sys/amd64/vmm/vmm.c | 2 ++ sys/arm64/vmm/vmm.c | 11 ++++++++--- sys/dev/vmm/vmm_dev.c | 34 +++++++++++++++++++--------------- sys/riscv/vmm/vmm.c | 11 ++++++++--- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index d05d979a531a..aa13d506ac6a 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -467,6 +467,8 @@ vmm_handler(module_t mod, int what, void *arg) error = vmm_init(); if (error == 0) vmm_initialized = 1; + else + (void)vmmdev_cleanup(); } else { error = ENXIO; } diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 808df5e599ac..77c565e37264 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -361,21 +361,26 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: - /* TODO: if (vmm_is_hw_supported()) { */ error = vmmdev_init(); if (error != 0) break; error = vmm_init(); if (error == 0) vmm_initialized = true; + else + (void)vmmdev_cleanup(); break; case MOD_UNLOAD: - /* TODO: if (vmm_is_hw_supported()) { */ error = vmmdev_cleanup(); if (error == 0 && vmm_initialized) { error = vmmops_modcleanup(); - if (error) + if (error) { + /* + * Something bad happened - prevent new + * VMs from being created + */ vmm_initialized = false; + } } break; default: diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 4ab99f92f72a..27c960c8ef2e 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -979,6 +979,7 @@ vmmctl_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, return (error); } +static struct cdev *vmmctl_cdev; static struct cdevsw vmmctlsw = { .d_name = "vmmctl", .d_version = D_VERSION, @@ -989,31 +990,34 @@ static struct cdevsw vmmctlsw = { int vmmdev_init(void) { - struct cdev *cdev; int error; - error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmctlsw, NULL, + sx_xlock(&vmmdev_mtx); + error = make_dev_p(MAKEDEV_CHECKNAME, &vmmctl_cdev, &vmmctlsw, NULL, UID_ROOT, GID_WHEEL, 0600, "vmmctl"); - if (error) - return (error); - - pr_allow_flag = prison_add_allow(NULL, "vmm", NULL, - "Allow use of vmm in a jail."); + if (error == 0) + pr_allow_flag = prison_add_allow(NULL, "vmm", NULL, + "Allow use of vmm in a jail."); + sx_xunlock(&vmmdev_mtx); - return (0); + return (error); } int vmmdev_cleanup(void) { - int error; - - if (SLIST_EMPTY(&head)) - error = 0; - else - error = EBUSY; + sx_xlock(&vmmdev_mtx); + if (!SLIST_EMPTY(&head)) { + sx_xunlock(&vmmdev_mtx); + return (EBUSY); + } + if (vmmctl_cdev != NULL) { + destroy_dev(vmmctl_cdev); + vmmctl_cdev = NULL; + } + sx_xunlock(&vmmdev_mtx); - return (error); + return (0); } static int diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c index f7cbfc1dfea5..96871fc88453 100644 --- a/sys/riscv/vmm/vmm.c +++ b/sys/riscv/vmm/vmm.c @@ -259,21 +259,26 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: - /* TODO: check if has_hyp here? */ error = vmmdev_init(); if (error != 0) break; error = vmm_init(); if (error == 0) vmm_initialized = true; + else + (void)vmmdev_cleanup(); break; case MOD_UNLOAD: - /* TODO: check if has_hyp here? */ error = vmmdev_cleanup(); if (error == 0 && vmm_initialized) { error = vmmops_modcleanup(); - if (error) + if (error) { + /* + * Something bad happened - prevent new + * VMs from being created + */ vmm_initialized = false; + } } break; default: From nobody Thu Jan 9 14:56:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTSXg72wKz5kwmH; Thu, 09 Jan 2025 14:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTSXg6Yryz48tG; Thu, 9 Jan 2025 14:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736434579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c7YE8OCpXIsUhuLcT4IwIOuXABTNL2WIIB8NAJx0Fco=; b=VdcMyGLTgRsEr4YFxeyB2ujat0tv4vz1IOQVIvJuF9j3Covoo/GjryEEuah8VWfTpbiSkU eIZJcpzYqKeUvHp1sZVxBUVGw3xh7KaMVbz+8JBNfI07IDADCNriVjrEyGLj1O2I5wHkDK z42jekA/HWsWWRS103SNA42Oy6H2C+wUNkDn5jNrO3vTNowHs5JGvQGzE1NDw/qlknoR7T +g8rvYqWvLNnjgjGUgdB9aVZAguX8Vyhu87Je6Rp6bsQA6Lplw0HzXaZ9P43NOXRku8PZ6 5kTHhFAIXcm2N2rDlAHEHatQSM77KidccHM1h01CHngTYNaWpARC/PyySeu7sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736434579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c7YE8OCpXIsUhuLcT4IwIOuXABTNL2WIIB8NAJx0Fco=; b=mF+LQh+rhFg974kmALMAi06+/s5v0SS1beBTPNFpBgnLEOL+dmG9MJb+oBxINlmd68AwqF eW3s1oWNx4pCt2U8eHfC1n7aiFXTRma9+FWDxijDeSXxmTVglSnS+axBV/MUTY3Ghfu8Qf 7rjCjrx/OyOrPclnqtmtm4vvZ7NrG9Bibd24AzNcghmSBLULUbQ6vJtx0mVCXsaRyiykBT AbfwPcJZqtZ/KYtF9A1jCh6dbiW1sf9kCN1EwU2+L7lOwU99IuR7SUeXZmBl1N6O6YV+MJ W00hQoPv2CxjLDs7AutfAtRSvhE7af4LhU70bK6zdNLgsECBXp123wn1c9uIjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736434579; a=rsa-sha256; cv=none; b=UmbHa2r+fXp/NtSqqad8ZfdX2GrRb8JKyBEiZhFEIMhC2ymmIcXNzLRzgM9ezBVLLsDFd/ 78e5iaQCtUiAKSqW4zHdZCFnrPduSpGokCveZEDcW1EF2qUeMMAUCjxjnuXadTVPE/DUpM 5zCFHuPnbc8SSlskdBj9VQLKpNY5EVA1Kk6avtUmTd9U5ro40ffRShZagwn94p8DO6z1rE HuJLOfrJ8UnvTEb3ZDNRSuoc05lhms6yMSGvnfHrmrXbLfAOkXWmfDIWboRllOOjwDCDkF gv5Z94gpLkNH1fE2JMwwjfMJboJd8uAsjl0UyT56hv7qougI37vJlh4ez2R77w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTSXg62WszVZF; Thu, 09 Jan 2025 14:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509EuJfW047163; Thu, 9 Jan 2025 14:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509EuJ4L047160; Thu, 9 Jan 2025 14:56:19 GMT (envelope-from git) Date: Thu, 9 Jan 2025 14:56:19 GMT Message-Id: <202501091456.509EuJ4L047160@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: fe1165df4b77 - main - vm_pageout: Make vmd_oom a bool List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe1165df4b776b14b21a04d2ef3fc4c46740c2f5 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fe1165df4b776b14b21a04d2ef3fc4c46740c2f5 commit fe1165df4b776b14b21a04d2ef3fc4c46740c2f5 Author: Mark Johnston AuthorDate: 2025-01-09 14:53:37 +0000 Commit: Mark Johnston CommitDate: 2025-01-09 14:53:37 +0000 vm_pageout: Make vmd_oom a bool No functional change intended. Reviewed by: dougm, kib MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48376 --- sys/vm/vm_page.c | 2 +- sys/vm/vm_pageout.c | 6 +++--- sys/vm/vm_pagequeue.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f351295c1af5..f042d4767b36 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -460,7 +460,7 @@ vm_page_domain_init(int domain) vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; - vmd->vmd_oom = FALSE; + vmd->vmd_oom = false; for (i = 0; i < PQ_COUNT; i++) { pq = &vmd->vmd_pagequeues[i]; TAILQ_INIT(&pq->pq_pl); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 28a54a83fd49..d26e04f60c00 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1773,7 +1773,7 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, vmd->vmd_oom_seq++; if (vmd->vmd_oom_seq < vm_pageout_oom_seq) { if (vmd->vmd_oom) { - vmd->vmd_oom = FALSE; + vmd->vmd_oom = false; atomic_subtract_int(&vm_pageout_oom_vote, 1); } return; @@ -1788,7 +1788,7 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, if (vmd->vmd_oom) return; - vmd->vmd_oom = TRUE; + vmd->vmd_oom = true; old_vote = atomic_fetchadd_int(&vm_pageout_oom_vote, 1); if (old_vote != vm_ndomains - 1) return; @@ -1806,7 +1806,7 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, * memory condition is still there, due to vmd_oom being * false. */ - vmd->vmd_oom = FALSE; + vmd->vmd_oom = false; atomic_subtract_int(&vm_pageout_oom_vote, 1); } diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index af1183e63e53..23a3ea96d80c 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -257,7 +257,7 @@ struct vm_domain { /* Paging control variables, used within single threaded page daemon. */ struct pidctrl vmd_pid; /* Pageout controller. */ - boolean_t vmd_oom; + bool vmd_oom; u_int vmd_inactive_threads; u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ From nobody Thu Jan 9 14:56:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTSXj1WJ8z5kx8M; Thu, 09 Jan 2025 14:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTSXj0PfKz48cf; Thu, 9 Jan 2025 14:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736434581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5CIb5uxew8TxEcYYekukF7dCTwbtBtGMXHc58Mo/UI=; b=x+xIf6yMFwMPzSBkyxRcKpWJkcrQ+tfpA7zuehQ4P402e2Gg/doSCaMmsTqE83v0epcS6Q yh/dGKr35OUrSUoNlUChTrVyE8Sx3GnwNIINlfAZmYFTTlpuEhUxGzlMMVDX+WDqMwQrKr CWA9ovZdJBrOalte/ikQSI5gsFKWYEg4+2qozLO6bJTeKNW2ZnlJ2zSM/pfMRmZlZq04AF HKU0T5rZmPjtPJPlMhy7W/f2oIPzLSfzrCfcOZDX4r5iLO/9u9CCbJD/kV55/X+8RcuEyC 6Z0vcxD0RI7h4BBBkCWKKUvw6eeY13rx7d9m6+4SnEKC6V0KHNE/QJ/jPTnzQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736434581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5CIb5uxew8TxEcYYekukF7dCTwbtBtGMXHc58Mo/UI=; b=PkOXzUvgvSQXxqXeXxeDxCbiJjSFZdNYSpDwj8pgfiVFECBUPTAoLAqqu4tFuZLZZ7eOpn zq65wpb/aqTOvqTyH/ItlnPGy0Qu17f4ByMATF/GBF4y9oZTpUNgAA0wk1YQznNeE0FnAz aYBlTeWPayVxN1s3WM8xwNXQ+NVtXLC0uP/65sWl9GJD4gAsk0omGfdAxIT0++PbWFLB7h mmUoDoYZEgMBVUHDx/VurAaBHew/PLW3wcpGtp6JU6Z5oq4i5LVhxqOEHRhpc3YNHxGfox fGOTYAzb1x+rj9jDy0yQ0wM719ty02fqB/yyHeFh+2pMunl2MaBuZUYxgXSuyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736434581; a=rsa-sha256; cv=none; b=WQDl7MezmStUyxuv9qLJ6uTVIW7Xnd3kx54EK3zclX0XGmMnkcGe68qpgWP5612zcLeQjD AzVHboLdiAoTv94SqFryhvErtHWc/bt1xJL0wH/U3/3r93A8b9sBcJIBq/hH/rKR6N2Kah WTYtzZsKHlGchncnY/S9BWes4wH8ijqsRIj44rFDAIBzHHNsLL0BYaQdOccR5bDjvigivo HdAhv2T5bmj55H2A3TmwhGMAKWQGm7fBJ1js5lcsUB0L5MEaZZgH6D1kASbZY2UdwIOe6M fpYaytw8VA+q6Yuhr1BiOPYJ+K70WgK8LGshzL4t0X6r67B3I0nBkNawECothw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTSXh74pVzVb0; Thu, 09 Jan 2025 14:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509EuKLd047221; Thu, 9 Jan 2025 14:56:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509EuKPv047218; Thu, 9 Jan 2025 14:56:20 GMT (envelope-from git) Date: Thu, 9 Jan 2025 14:56:20 GMT Message-Id: <202501091456.509EuKPv047218@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: 55b343f4f9bc - main - vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55b343f4f9bc586eba5e26a2524a35f04dd60c65 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=55b343f4f9bc586eba5e26a2524a35f04dd60c65 commit 55b343f4f9bc586eba5e26a2524a35f04dd60c65 Author: Mark Johnston AuthorDate: 2025-01-09 14:54:10 +0000 Commit: Mark Johnston CommitDate: 2025-01-09 14:54:10 +0000 vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning Right now we have the vm.pageout_cpus_per_thread tunable which controls the number of threads to start up per CPU per NUMA domain, but after booting, it's not possible to disable multi-threaded scanning. There is at least one workload where this mechanism doesn't work well; let's make it possible to disable it without a reboot, to simplify troubleshooting. Reviewed by: dougm, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48377 --- sys/vm/vm_page.c | 1 + sys/vm/vm_pageout.c | 9 +++++++-- sys/vm/vm_pagequeue.h | 5 +++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f042d4767b36..ba22c7f97f2f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -461,6 +461,7 @@ vm_page_domain_init(int domain) vmd->vmd_free_count = 0; vmd->vmd_segs = 0; vmd->vmd_oom = false; + vmd->vmd_helper_threads_enabled = true; for (i = 0; i < PQ_COUNT; i++) { pq = &vmd->vmd_pagequeues[i]; TAILQ_INIT(&pq->pq_pl); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index d26e04f60c00..e2efa11842b5 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1644,8 +1644,9 @@ vm_pageout_inactive_dispatch(struct vm_domain *vmd, int shortage) * If we have more work than we can do in a quarter of our interval, we * fire off multiple threads to process it. */ - threads = vmd->vmd_inactive_threads; - if (threads > 1 && vmd->vmd_inactive_pps != 0 && + if ((threads = vmd->vmd_inactive_threads) > 1 && + vmd->vmd_helper_threads_enabled && + vmd->vmd_inactive_pps != 0 && shortage > vmd->vmd_inactive_pps / VM_INACT_SCAN_RATE / 4) { vmd->vmd_inactive_shortage /= threads; slop = shortage % threads; @@ -2269,6 +2270,10 @@ vm_pageout_init_domain(int domain) pidctrl_init_sysctl(&vmd->vmd_pid, SYSCTL_CHILDREN(oid)); vmd->vmd_inactive_threads = get_pageout_threads_per_domain(vmd); + SYSCTL_ADD_BOOL(NULL, SYSCTL_CHILDREN(vmd->vmd_oid), OID_AUTO, + "pageout_helper_threads_enabled", CTLFLAG_RWTUN, + &vmd->vmd_helper_threads_enabled, 0, + "Enable multi-threaded inactive queue scanning"); } static void diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 23a3ea96d80c..72fd1bb47318 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -257,8 +257,9 @@ struct vm_domain { /* Paging control variables, used within single threaded page daemon. */ struct pidctrl vmd_pid; /* Pageout controller. */ - bool vmd_oom; - u_int vmd_inactive_threads; + bool vmd_oom; /* An OOM kill was requested. */ + bool vmd_helper_threads_enabled;/* Use multiple threads to scan. */ + u_int vmd_inactive_threads; /* Number of extra helper threads. */ u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ blockcount_t vmd_inactive_starting; /* Number of threads started. */ From nobody Thu Jan 9 15:47:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTTgg2ZkKz5l1MW; Thu, 09 Jan 2025 15:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTTgg1qPGz4JcY; Thu, 9 Jan 2025 15:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736437647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o/2iDfXYqn6a1yYLfej1hnGUYTNHi7CTC0aS1ZPlo3M=; b=eqotYBrdXtv53kenQ5uP7tv+r0/S/pzNeGshzhPp7gPQ+YL1JsY8RYbz8d2T/xljRlwj1C L68na7Ypbv2OC0ON+5zS0J3xIe8zg5GfTq0nVnEii6G9NYsai3+8WEYSGop3/PwdD3RN11 SO08M3rTFVwJkI9k34bmybpI736+8tsPEn8FJ+i9uManHBPtk/4Bba6BWgDNBmkFvyepiF wLnSYrr8tFE9/iK2QRKR3iUyE97dW3KCeaAMN6DcwIfzbeSvNawZ18RNn9EDLrpghx1jKV FW6p7r7PlkYghuZgMoU+kavXFxNSycO1l6m1w+hCw44fDAyrIiUxN5srSbmKjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736437647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o/2iDfXYqn6a1yYLfej1hnGUYTNHi7CTC0aS1ZPlo3M=; b=AL/TDCo/r/nVzF2jluMwYwhPv2Pt9m9ljXo5c472o6Z2XKFBU4yeO+kCvONbXBLM6p0PQJ xjgFUpNBKh2uDl3cVczo58OXT7lubi9O53DTTsm5E5Wa1wVnd+CC/VUmG4lJf8WF3ecn1i 8xfzykW/YC81eAbOjcWMuBTQMIubotUGMW3Cf4Kqm8vw26mZNPOgTuEZD61Vp5m9c/uFfp H1PRHnyY7qFIr7OXoUbfQ+KylMkG/hu7Ivd5KyfcPS0P/J5epaETNJAgShgN8Z6mgVqBEg LK67HjLye8KsU11+SIOvMlsVHB/GNIMHb5VS19JvbACXnMwhHegAKz99DOs7Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736437647; a=rsa-sha256; cv=none; b=NBcrFVU6qlCNb3r/DqUE/cYOfkltbnKaFJfcP9Om/0x4ERWIdvb5e2SVyNoAvj9Tagy7wt lZ5l6EZw35J9o7RaJoJ3bR3HMoJSM9qyqiGaRvDdP5sXlORC1ZV1z6jtxIBiqrsZuQqU1R Lo+9N+Ha8wqOKiBdrfpKPzGMr3rnUdQH1cYfCcCbDMn+YJ9aULW4oeGxRnVPuP2eGEsWK7 YTIrDI6yuterh2+SlTl3CydNLCFDeFHTRxXJNGXW3waDYGa22EWh/tf8o7j4L5z15F+9zY LAKgRySvamasxcIXDj36xB2+yID102PdYEffsTrmtoUX2SNQDE2PxfXr+03NeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTTgg1PcHzXSH; Thu, 09 Jan 2025 15:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509FlRk3042143; Thu, 9 Jan 2025 15:47:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509FlRui042140; Thu, 9 Jan 2025 15:47:27 GMT (envelope-from git) Date: Thu, 9 Jan 2025 15:47:27 GMT Message-Id: <202501091547.509FlRui042140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Renato Botelho Subject: git: fb98fc4755de - main - fwget: Simplify logic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb98fc4755def2cb8ca145751b0e54485d5e2f4a Auto-Submitted: auto-generated The branch main has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=fb98fc4755def2cb8ca145751b0e54485d5e2f4a commit fb98fc4755def2cb8ca145751b0e54485d5e2f4a Author: Renato Botelho AuthorDate: 2025-01-09 14:24:18 +0000 Commit: Renato Botelho CommitDate: 2025-01-09 15:47:22 +0000 fwget: Simplify logic Summary: Use log() to print messages that should be supressed when -q is in use. No functional changes intended. Differential Revision: https://reviews.freebsd.org/D48393 Reviewed By: manu Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/fwget/fwget.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index d87cd03aa139..138a2a26bfb1 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -120,16 +120,12 @@ done case "${packages}" in ""|^[[:space:]]*$) - if [ "${QUIET}" != "y" ]; then - echo "No firmware packages to install." - fi + log "No firmware packages to install." exit 0 ;; esac -if [ "${QUIET}" != "y" ]; then - echo "Needed firmware packages: '${packages}'" -fi +log "Needed firmware packages: '${packages}'" if [ "${DRY_RUN}" = "y" ]; then if [ "${QUIET}" = "y" ]; then for pkg in ${packages}; do From nobody Thu Jan 9 17:06:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTWQL441mz5l7cn; Thu, 09 Jan 2025 17:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTWQL2QzQz4RsX; Thu, 9 Jan 2025 17:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736442362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcoOA4tDh02SkVqEtCJ+ZKnGNUBMMRK90aQavq86/Wk=; b=hOa77XeAvRmxG/FjfXoGpUGtPot/ijZGufg9iptMHMBhX1MG7K0uD0w99dq3+h3EkczIWL NSPlrggaDt4Yfn281qTf+yg2kmOU4fI1XPhhnPztg9UCMr/Xjnis2JBDiWB30DiyJxCF88 g8gbQyjvbMq1b705X4ocEc07vkeopAg4NH8VXWuRDHe/L9fHdPGxad+jDM1PoQnyF+QnSh 002+LuEQ3EPYScVf4K04rsJjenwXk+HJxA57GdF3NwNsclnVfVqSFGmp7U85gR+7fsyeEB waeyGQYUCjWJT2nagWJQhGLb0CMAXwse/W7um2EhJewS7omteMCUfu5nqHb5fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736442362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcoOA4tDh02SkVqEtCJ+ZKnGNUBMMRK90aQavq86/Wk=; b=Z7raUSqiHtGbHg8aCaImG6PbDRDvR9k2n7KWmghvMs97OZlQcV5zwQYhIilYmlLCGemG/o us7QWteWPeeROsP1+84gPVrrVQF26kowOLiIAcZOuZZDRM5TQi2F0I2tw9e7LG54bMT1or bs0vvmbN8DOU53K02Llin//DeahviVKLr2JTcAgFZ8XuDGC+fy+AWcrpFguxB31NwdHcw7 uLNxOj7GqvozT9qKhOku0mmR8u1Q0EZyUVZG6FWO0+SjOR9zxcmqdsdTgCU4fbIcaA/K51 BLyZrpTnCuTzPi9d6nRZ1kLGt34PecJgD7Mw8Y1P/ymegxQxzla2AmiNg9MHLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736442362; a=rsa-sha256; cv=none; b=dt2DE9QJZNELsp/2UpEqSjv7iCCHpsOAnr40srJRtuUCWqI3yt8PNWMd5ppOm3NWTWYySJ EMxPLDNj/zWZtpAh7IKOptFkD3qFj8S1NE8kZOXWqxi8z+aIRQA3qbZQDx5hKnAeVLBvGK nlpL6pqw3sgOg41Gm3aLLLVorNGE4of1beQL6xykKjpbueyCRh+igRMTS/y5Fwl3Its/cW 1wlmuGO5ZYu10Oe8MlL3FOFOc5p+0llEbApw+RD+fg6/oBleJGZV8YPzh6RwLOr+xIwuU7 E3nD2I+qo6cWEZhRqd/cnsoGNwS6DeDuFdFdpA6ZDJjeTYgX3hxJCr4AuE3WnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTWQL1cgQzbty; Thu, 09 Jan 2025 17:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509H62wJ092935; Thu, 9 Jan 2025 17:06:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509H62Q7092932; Thu, 9 Jan 2025 17:06:02 GMT (envelope-from git) Date: Thu, 9 Jan 2025 17:06:02 GMT Message-Id: <202501091706.509H62Q7092932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Ambrisko Subject: git: 0acab8b3d133 - main - enic(4): fix down/up, MTU changes and more List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ambrisko X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0acab8b3d1336d4db73a9946ef76b4bcd0b0aabe Auto-Submitted: auto-generated The branch main has been updated by ambrisko: URL: https://cgit.FreeBSD.org/src/commit/?id=0acab8b3d1336d4db73a9946ef76b4bcd0b0aabe commit 0acab8b3d1336d4db73a9946ef76b4bcd0b0aabe Author: Doug Ambrisko AuthorDate: 2025-01-09 16:28:37 +0000 Commit: Doug Ambrisko CommitDate: 2025-01-09 16:52:54 +0000 enic(4): fix down/up, MTU changes and more ifconfig down/up cycles was not working. Fix that which is required to support MTU changes. Now doing ifconfig enic0 mtu 3000 for example works. If the MTU is changes in the VIC HW configuration, that is not reflected in and the OS reports the default 1500. I need to look at that but changing it via ifconfig works. So this is different then what Linux does. Change TX interrupt allocation to be in this driver. Change the admin interrupt count to 2. This make multiple queues work but need to be done as pairs so if the VIC has more TX or RX queues setup in the VIC configuration it will use the lesser value. While updating the TX interrupt also add support for devcmd2. Enable checksum offloading. PR: 282095 --- sys/dev/enic/cq_desc.h | 15 --- sys/dev/enic/enic.h | 76 ++++++-------- sys/dev/enic/enic_res.c | 4 +- sys/dev/enic/enic_res.h | 2 - sys/dev/enic/enic_txrx.c | 39 +++++-- sys/dev/enic/if_enic.c | 173 +++++++++++++++++++++++++++---- sys/dev/enic/vnic_cq.h | 5 +- sys/dev/enic/vnic_dev.c | 235 +++++++++++++++++++++++++++++++++++++------ sys/dev/enic/vnic_dev.h | 8 +- sys/dev/enic/vnic_intr.c | 2 +- sys/dev/enic/vnic_intr.h | 2 +- sys/dev/enic/vnic_resource.h | 1 + sys/dev/enic/vnic_rq.c | 5 +- sys/dev/enic/vnic_rq.h | 1 - sys/dev/enic/vnic_rss.h | 5 - sys/dev/enic/vnic_wq.c | 104 ++++++++++++++++++- sys/dev/enic/vnic_wq.h | 18 +++- 17 files changed, 559 insertions(+), 136 deletions(-) diff --git a/sys/dev/enic/cq_desc.h b/sys/dev/enic/cq_desc.h index ae8847c6d9a1..4fb8cce7212e 100644 --- a/sys/dev/enic/cq_desc.h +++ b/sys/dev/enic/cq_desc.h @@ -44,14 +44,6 @@ struct cq_desc { #define CQ_DESC_COMP_NDX_BITS 12 #define CQ_DESC_COMP_NDX_MASK ((1 << CQ_DESC_COMP_NDX_BITS) - 1) -static inline void cq_color_enc(struct cq_desc *desc, const u8 color) -{ - if (color) - desc->type_color |= (1 << CQ_DESC_COLOR_SHIFT); - else - desc->type_color &= ~(1 << CQ_DESC_COLOR_SHIFT); -} - static inline void cq_desc_enc(struct cq_desc *desc, const u8 type, const u8 color, const u16 q_number, const u16 completed_index) @@ -87,11 +79,4 @@ static inline void cq_desc_dec(const struct cq_desc *desc_arg, CQ_DESC_COMP_NDX_MASK; } -static inline void cq_color_dec(const struct cq_desc *desc_arg, u8 *color) -{ - volatile const struct cq_desc *desc = desc_arg; - - *color = (desc->type_color >> CQ_DESC_COLOR_SHIFT) & CQ_DESC_COLOR_MASK; -} - #endif /* _CQ_DESC_H_ */ diff --git a/sys/dev/enic/enic.h b/sys/dev/enic/enic.h index 8c2212726548..eec6de823c9d 100644 --- a/sys/dev/enic/enic.h +++ b/sys/dev/enic/enic.h @@ -108,13 +108,13 @@ struct vnic_res { #define ENIC_DEFAULT_VXLAN_PORT 4789 /* - * Interrupt 0: LSC and errors * Interrupt 1: rx queue 0 * Interrupt 2: rx queue 1 * ... + * Interrupt x: LSC and errors */ #define ENICPMD_LSC_INTR_OFFSET 0 -#define ENICPMD_RXQ_INTR_OFFSET 1 +#define ENICPMD_RXQ_INTR_OFFSET 0 #include "vnic_devcmd.h" @@ -152,6 +152,9 @@ struct vnic_dev { u64 args[VNIC_DEVCMD_NARGS]; int in_reset; struct vnic_intr_coal_timer_info intr_coal_timer_info; + struct devcmd2_controller *devcmd2; + int (*devcmd_rtn)(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, + int wait); void *(*alloc_consistent)(void *priv, size_t size, bus_addr_t *dma_handle, struct iflib_dma_info *res, u8 *name); void (*free_consistent)(void *priv, size_t size, void *vaddr, @@ -175,6 +178,28 @@ struct intr_queue { struct enic_softc *softc; }; +#define ENIC_MAX_LINK_SPEEDS 3 +#define ENIC_LINK_SPEED_10G 10000 +#define ENIC_LINK_SPEED_4G 4000 +#define ENIC_LINK_40G_INDEX 2 +#define ENIC_LINK_10G_INDEX 1 +#define ENIC_LINK_4G_INDEX 0 +#define ENIC_RX_COALESCE_RANGE_END 125 +#define ENIC_AIC_TS_BREAK 100 + +struct enic_rx_coal { + u32 small_pkt_range_start; + u32 large_pkt_range_start; + u32 range_end; + u32 use_adaptive_rx_coalesce; +}; + +/* Store only the lower range. Higher range is given by fw. */ +struct enic_intr_mod_range { + u32 small_pkt_range_start; + u32 large_pkt_range_start; +}; + struct enic { struct enic *next; struct rte_pci_device *pdev; @@ -267,6 +292,9 @@ struct enic { uint64_t tx_offload_mask; /* PKT_TX flags accepted */ struct enic_softc *softc; int port_mtu; + struct enic_rx_coal rx_coalesce_setting; + u32 rx_coalesce_usecs; + u32 tx_coalesce_usecs; }; struct enic_softc { @@ -307,11 +335,6 @@ struct enic_softc { /* Per-instance private data structure */ -static inline unsigned int enic_vnic_rq_count(struct enic *enic) -{ - return enic->rq_count; -} - static inline unsigned int enic_cq_rq(struct enic *enic, unsigned int rq) { return rq; @@ -322,21 +345,6 @@ static inline unsigned int enic_cq_wq(struct enic *enic, unsigned int wq) return enic->rq_count + wq; } -static inline uint32_t -enic_ring_add(uint32_t n_descriptors, uint32_t i0, uint32_t i1) -{ - uint32_t d = i0 + i1; - d -= (d >= n_descriptors) ? n_descriptors : 0; - return d; -} - -static inline uint32_t -enic_ring_sub(uint32_t n_descriptors, uint32_t i0, uint32_t i1) -{ - int32_t d = i1 - i0; - return (uint32_t)((d < 0) ? ((int32_t)n_descriptors + d) : d); -} - static inline uint32_t enic_ring_incr(uint32_t n_descriptors, uint32_t idx) { @@ -346,34 +354,14 @@ enic_ring_incr(uint32_t n_descriptors, uint32_t idx) return idx; } -void enic_free_wq(void *txq); -int enic_alloc_intr_resources(struct enic *enic); int enic_setup_finish(struct enic *enic); -int enic_alloc_wq(struct enic *enic, uint16_t queue_idx, - unsigned int socket_id, uint16_t nb_desc); void enic_start_wq(struct enic *enic, uint16_t queue_idx); int enic_stop_wq(struct enic *enic, uint16_t queue_idx); void enic_start_rq(struct enic *enic, uint16_t queue_idx); -void enic_free_rq(void *rxq); -int enic_set_vnic_res(struct enic *enic); -int enic_init_rss_nic_cfg(struct enic *enic); -int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu); -int enic_set_vlan_strip(struct enic *enic); +int enic_stop_rq(struct enic *enic, uint16_t queue_idx); +void enic_dev_disable(struct enic *enic); int enic_enable(struct enic *enic); int enic_disable(struct enic *enic); -void enic_remove(struct enic *enic); -int enic_get_link_status(struct enic *enic); -void enic_dev_stats_clear(struct enic *enic); -void enic_add_packet_filter(struct enic *enic); -int enic_set_mac_address(struct enic *enic, uint8_t *mac_addr); -int enic_del_mac_address(struct enic *enic, int mac_index); -unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq); - -void enic_post_wq_index(struct vnic_wq *wq); -int enic_probe(struct enic *enic); -int enic_clsf_init(struct enic *enic); -void enic_clsf_destroy(struct enic *enic); -int enic_set_mtu(struct enic *enic, uint16_t new_mtu); int enic_link_update(struct enic *enic); bool enic_use_vector_rx_handler(struct enic *enic); void enic_fdir_info(struct enic *enic); diff --git a/sys/dev/enic/enic_res.c b/sys/dev/enic/enic_res.c index d264874557a0..413873ad0fb4 100644 --- a/sys/dev/enic/enic_res.c +++ b/sys/dev/enic/enic_res.c @@ -95,11 +95,11 @@ int enic_get_vnic_config(struct enic *enic) dev_info(enic_get_dev(enic), "vNIC MAC addr %02x:%02x:%02x:%02x:%02x:%02x " - "wq/rq %d/%d mtu d, max mtu:%d\n", + "wq/rq %d/%d mtu %d, max mtu:%d\n", enic->mac_addr[0], enic->mac_addr[1], enic->mac_addr[2], enic->mac_addr[3], enic->mac_addr[4], enic->mac_addr[5], c->wq_desc_count, c->rq_desc_count, - /* enic->rte_dev->data->mtu, */ enic->max_mtu); + c->mtu, enic->max_mtu); dev_info(enic_get_dev(enic), "vNIC csum tx/rx %s/%s " "rss %s intr mode %s type %s timer %d usec " "loopback tag 0x%04x\n", diff --git a/sys/dev/enic/enic_res.h b/sys/dev/enic/enic_res.h index 1a6f3a3ca98f..82963e61a44f 100644 --- a/sys/dev/enic/enic_res.h +++ b/sys/dev/enic/enic_res.h @@ -67,7 +67,5 @@ int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type, u8 ig_vlan_strip_en); void enic_get_res_counts(struct enic *enic); void enic_init_vnic_resources(struct enic *enic); -int enic_alloc_vnic_resources(struct enic *); -void enic_free_vnic_resources(struct enic *); #endif /* _ENIC_RES_H_ */ diff --git a/sys/dev/enic/enic_txrx.c b/sys/dev/enic/enic_txrx.c index 5a557fc7f94a..169041587d06 100644 --- a/sys/dev/enic/enic_txrx.c +++ b/sys/dev/enic/enic_txrx.c @@ -103,6 +103,7 @@ enic_isc_txd_encap(void *vsc, if_pkt_info_t pi) softc = vsc; enic = &softc->enic; + if_softc_ctx_t scctx = softc->scctx; wq = &enic->wq[pi->ipi_qsidx]; nsegs = pi->ipi_nsegs; @@ -112,6 +113,9 @@ enic_isc_txd_encap(void *vsc, if_pkt_info_t pi) head_idx = wq->head_idx; desc_count = wq->ring.desc_count; + if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0) + offload_mode |= WQ_ENET_OFFLOAD_MODE_CSUM; + for (i = 0; i < nsegs; i++) { eop = 0; cq = 0; @@ -320,7 +324,7 @@ enic_isc_rxd_flush(void *vsc, uint16_t rxqid, uint8_t flid, qidx_t pidx) static int enic_legacy_intr(void *xsc) { - return -1; + return (1); } static inline void @@ -375,7 +379,7 @@ enic_wq_service(struct vnic_dev *vdev, struct cq_desc *cq_desc, u8 type, vnic_wq_service(&enic->wq[q_number], cq_desc, completed_index, NULL, opaque); - return 0; + return (0); } static void @@ -384,7 +388,7 @@ vnic_rq_service(struct vnic_rq *rq, struct cq_desc *cq_desc, void(*buf_service)(struct vnic_rq *rq, struct cq_desc *cq_desc, /* struct vnic_rq_buf * *buf, */ int skipped, void *opaque), void *opaque) { - + if_softc_ctx_t scctx; if_rxd_info_t ri = (if_rxd_info_t) opaque; u8 type, color, eop, sop, ingress_port, vlan_stripped; u8 fcoe, fcoe_sof, fcoe_fc_crc_ok, fcoe_enc_error, fcoe_eof; @@ -396,6 +400,8 @@ vnic_rq_service(struct vnic_rq *rq, struct cq_desc *cq_desc, int cqidx; if_rxd_frag_t frag; + scctx = rq->vdev->softc->scctx; + cq_enet_rq_desc_dec((struct cq_enet_rq_desc *)cq_desc, &type, &color, &q_number, &completed_index, &ingress_port, &fcoe, &eop, &sop, &rss_type, @@ -419,6 +425,11 @@ vnic_rq_service(struct vnic_rq *rq, struct cq_desc *cq_desc, ri->iri_cidx = cqidx; ri->iri_nfrags = 1; ri->iri_len = bytes_written; + + if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0) + if (!csum_not_calc && (tcp_udp_csum_ok || ipv4_csum_ok)) { + ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + } } static int @@ -431,7 +442,7 @@ enic_rq_service(struct vnic_dev *vdev, struct cq_desc *cq_desc, vnic_rq_service(&enic->rq[ri->iri_qsidx], cq_desc, completed_index, VNIC_RQ_RETURN_DESC, NULL, /* enic_rq_indicate_buf, */ opaque); - return 0; + return (0); } void @@ -468,10 +479,8 @@ enic_stop_wq(struct enic *enic, uint16_t queue_idx) int ret; ret = vnic_wq_disable(&enic->wq[queue_idx]); - if (ret) - return ret; - return 0; + return (ret); } void @@ -483,3 +492,19 @@ enic_start_rq(struct enic *enic, uint16_t queue_idx) vnic_rq_enable(rq); enic_initial_post_rx(enic, rq); } + +int +enic_stop_rq(struct enic *enic, uint16_t queue_idx) +{ + int ret; + + ret = vnic_rq_disable(&enic->rq[queue_idx]); + + return (ret); +} + + +void +enic_dev_disable(struct enic *enic) { + vnic_dev_disable(enic->vdev); +} diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c index dc0c0d028e20..26776244778e 100644 --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -201,11 +201,11 @@ static struct if_shared_ctx enic_sctx_init = { * descriptor */ .isc_rx_nsegments = 1, /* One mapping per descriptor */ .isc_rx_maxsegsize = ENIC_DEFAULT_RX_MAX_PKT_SIZE, - .isc_admin_intrcnt = 3, + .isc_admin_intrcnt = 2, .isc_vendor_info = enic_vendor_info_array, .isc_driver_version = "1", .isc_driver = &enic_iflib_driver, - .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ, + .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ | IFLIB_SKIP_MSIX, /* * Number of receive queues per receive queue set, with associated @@ -235,6 +235,99 @@ enic_register(device_t dev) return (&enic_sctx_init); } +static int +enic_allocate_msix(struct enic_softc *softc) { + if_ctx_t ctx; + if_softc_ctx_t scctx; + if_shared_ctx_t sctx; + device_t dev; + cpuset_t cpus; + int queues, vectors, requested; + int err = 0; + + dev = softc->dev; + ctx = softc->ctx; + scctx = softc->scctx; + sctx = iflib_get_sctx(ctx); + + if (bus_get_cpus(dev, INTR_CPUS, sizeof(cpus), &cpus) != 0) { + device_printf(dev, "Unable to fetch CPU list\n"); + CPU_COPY(&all_cpus, &cpus); + } + + + queues = CPU_COUNT(&cpus); + queues = imin(queues, scctx->isc_nrxqsets); + queues = imin(queues, scctx->isc_ntxqsets); + requested = queues * 2 + sctx->isc_admin_intrcnt; + scctx->isc_nrxqsets = queues; + scctx->isc_ntxqsets = queues; + + vectors = requested; + if ((err = pci_alloc_msix(dev, &vectors)) != 0) { + device_printf(dev, + "failed to allocate %d MSI-X vectors, err: %d\n", requested, + err); + err = 1; + goto enic_allocate_msix_out; + } else { + if (vectors != requested) { + device_printf(dev, + "Unable to allocate sufficient MSI-X vectors " + "(got %d, need %d)\n", requested, vectors); + pci_release_msi(dev); + err = 1; + goto enic_allocate_msix_out; + } + } + + device_printf(dev, "Using MSI-X interrupts with %d vectors\n", + vectors); + + scctx->isc_intr = IFLIB_INTR_MSIX; + scctx->isc_vectors = vectors; + +enic_allocate_msix_out: + return (err); + +} + +static struct enic_intr_mod_range mod_range[ENIC_MAX_LINK_SPEEDS] = { + {0, 0}, /* 0 - 4 Gbps */ + {0, 3}, /* 4 - 10 Gbps */ + {3, 6}, /* 10 - 40 Gbps */ +}; + +static void enic_set_rx_coal_setting(struct enic *enic) +{ + unsigned int speed; + int index = -1; + struct enic_rx_coal *rx_coal = &enic->rx_coalesce_setting; + + /* 1. Read the link speed from fw + * 2. Pick the default range for the speed + * 3. Update it in enic->rx_coalesce_setting + */ + speed = vnic_dev_port_speed(enic->vdev); + if (ENIC_LINK_SPEED_10G < speed) + index = ENIC_LINK_40G_INDEX; + else if (ENIC_LINK_SPEED_4G < speed) + index = ENIC_LINK_10G_INDEX; + else + index = ENIC_LINK_4G_INDEX; + + rx_coal->small_pkt_range_start = mod_range[index].small_pkt_range_start; + rx_coal->large_pkt_range_start = mod_range[index].large_pkt_range_start; + rx_coal->range_end = ENIC_RX_COALESCE_RANGE_END; + + /* Start with the value provided by UCSM */ + for (index = 0; index < enic->rq_count; index++) + enic->cq[index].cur_rx_coal_timeval = + enic->config.intr_timer_usec; + + rx_coal->use_adaptive_rx_coalesce = 1; +} + static int enic_attach_pre(if_ctx_t ctx) { @@ -283,6 +376,8 @@ enic_attach_pre(if_ctx_t ctx) ENIC_LOCK(softc); vnic_dev_register(vdev, &softc->mem, 1); enic->vdev = vdev; + vnic_dev_cmd_init(enic->vdev); + vdev->devcmd = vnic_dev_get_res(vdev, RES_TYPE_DEVCMD, 0); vnic_dev_cmd(vdev, CMD_INIT_v1, &a0, &a1, wait); @@ -326,6 +421,7 @@ enic_attach_pre(if_ctx_t ctx) /* Set ingress vlan rewrite mode before vnic initialization */ enic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_UNTAG_DEFAULT_VLAN; + enic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_PRIORITY_TAG_DEFAULT_VLAN; err = vnic_dev_set_ig_vlan_rewrite_mode(enic->vdev, enic->ig_vlan_rewrite_mode); if (err) { @@ -360,8 +456,10 @@ enic_attach_pre(if_ctx_t ctx) softc->scctx = iflib_get_softc_ctx(ctx); scctx = softc->scctx; scctx->isc_txrx = &enic_txrx; - scctx->isc_capabilities = scctx->isc_capenable = 0; + scctx->isc_capabilities = scctx->isc_capenable = \ + IFCAP_HWCSUM; scctx->isc_tx_csum_flags = 0; + if_setmtu(softc->ifp, enic->config.mtu); scctx->isc_max_frame_size = enic->config.mtu + ETHER_HDR_LEN + \ ETHER_CRC_LEN; scctx->isc_nrxqsets_max = enic->conf_rq_count; @@ -389,7 +487,6 @@ enic_attach_pre(if_ctx_t ctx) } scctx->isc_tx_nsegments = 31; - scctx->isc_vectors = enic->conf_cq_count; scctx->isc_msix_bar = -1; ifmedia_add(softc->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -416,12 +513,20 @@ enic_attach_pre(if_ctx_t ctx) err = vnic_dev_alloc_stats_mem(enic->vdev); if (err) { dev_err(enic, "Failed to allocate cmd memory, aborting\n"); + goto err_out_dev_close; + } + + err = enic_allocate_msix(softc); + if (err) { + dev_err(enic, "Failed to allocate MSIX, aborting\n"); + goto err_out_dev_close; } return (rc); err_out_dev_close: vnic_dev_close(enic->vdev); + vnic_dev_deinit_devcmd2(enic->vdev); err_out_unregister: free(softc->vdev.devcmd, M_DEVBUF); free(softc->enic.intr_queues, M_DEVBUF); @@ -482,9 +587,10 @@ enic_msix_intr_assign(if_ctx_t ctx, int msix) snprintf(irq_name, sizeof(irq_name), "etxq%d:%d", i - scctx->isc_nrxqsets, device_get_unit(softc->dev)); - - iflib_softirq_alloc_generic(ctx, &enic->intr_queues[i].intr_irq, IFLIB_INTR_TX, &enic->wq[i - scctx->isc_nrxqsets], i - scctx->isc_nrxqsets, irq_name); - + iflib_softirq_alloc_generic(ctx, + &enic->intr_queues[i].intr_irq, IFLIB_INTR_TX, + &enic->wq[i - scctx->isc_nrxqsets], i - scctx->isc_nrxqsets, + irq_name); enic->intr[i].index = i; enic->intr[i].vdev = enic->vdev; @@ -567,6 +673,7 @@ enic_attach_post(if_ctx_t ctx) enic_setup_sysctl(softc); enic_init_vnic_resources(enic); + enic_set_rx_coal_setting(enic); enic_setup_finish(enic); ifmedia_add(softc->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -589,7 +696,9 @@ enic_detach(if_ctx_t ctx) enic_free_irqs(softc); ENIC_LOCK(softc); + vnic_dev_deinit(enic->vdev); vnic_dev_close(enic->vdev); + vnic_dev_deinit_devcmd2(enic->vdev); free(softc->vdev.devcmd, M_DEVBUF); pci_disable_busmaster(softc->dev); enic_pci_mapping_free(softc); @@ -807,6 +916,11 @@ enic_stop(if_ctx_t ctx) struct enic *enic; if_softc_ctx_t scctx; unsigned int index; + struct vnic_wq *wq; + struct vnic_rq *rq; + struct vnic_cq *cq; + unsigned int cq_wq, cq_rq; + softc = iflib_get_softc(ctx); scctx = softc->scctx; @@ -817,15 +931,36 @@ enic_stop(if_ctx_t ctx) softc->link_active = 0; softc->stopped = 1; + enic_dev_disable(enic); + for (index = 0; index < scctx->isc_ntxqsets; index++) { enic_stop_wq(enic, index); vnic_wq_clean(&enic->wq[index]); vnic_cq_clean(&enic->cq[enic_cq_rq(enic, index)]); + + wq = &softc->enic.wq[index]; + wq->ring.desc_avail = wq->ring.desc_count - 1; + wq->ring.last_count = wq->ring.desc_count; + wq->head_idx = 0; + wq->tail_idx = 0; + + cq_wq = enic_cq_wq(&softc->enic, index); + cq = &softc->enic.cq[cq_wq]; + cq->ring.desc_avail = cq->ring.desc_count - 1; } for (index = 0; index < scctx->isc_nrxqsets; index++) { + enic_stop_rq(enic, index); vnic_rq_clean(&enic->rq[index]); vnic_cq_clean(&enic->cq[enic_cq_wq(enic, index)]); + + rq = &softc->enic.rq[index]; + cq_rq = enic_cq_rq(&softc->enic, index); + cq = &softc->enic.cq[cq_rq]; + + cq->ring.desc_avail = cq->ring.desc_count - 1; + rq->ring.desc_avail = rq->ring.desc_count - 1; + rq->need_initial_post = true; } for (index = 0; index < scctx->isc_vectors; index++) { @@ -845,6 +980,9 @@ enic_init(if_ctx_t ctx) scctx = softc->scctx; enic = &softc->enic; + + enic_init_vnic_resources(enic); + for (index = 0; index < scctx->isc_ntxqsets; index++) enic_prep_wq_for_simple_tx(&softc->enic, index); @@ -862,6 +1000,8 @@ enic_init(if_ctx_t ctx) vnic_dev_enable_wait(enic->vdev); ENIC_UNLOCK(softc); + softc->stopped = 0; + enic_link_status(softc); } @@ -942,12 +1082,14 @@ enic_mtu_set(if_ctx_t ctx, uint32_t mtu) softc = iflib_get_softc(ctx); enic = &softc->enic; + enic_stop(softc->ctx); if (mtu > enic->port_mtu){ return (EINVAL); } enic->config.mtu = mtu; scctx->isc_max_frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + enic_init(softc->ctx); return (0); } @@ -1026,7 +1168,6 @@ static void enic_update_admin_status(if_ctx_t ctx) { struct enic_softc *softc; - softc = iflib_get_softc(ctx); enic_link_status(softc); @@ -1357,7 +1498,7 @@ enic_dev_init(struct enic *enic) if (vnic_dev_overlay_offload_cfg(enic->vdev, OVERLAY_CFG_VXLAN_PORT_UPDATE, ENIC_DEFAULT_VXLAN_PORT)) { dev_err(enic, "failed to update vxlan port\n"); - return -EINVAL; + return (EINVAL); } } return 0; @@ -1441,7 +1582,7 @@ enic_dev_wait(struct vnic_dev *vdev, int (*start) (struct vnic_dev *, int), return 0; usleep(1000); } - return -ETIMEDOUT; + return (ETIMEDOUT); } static int @@ -1452,7 +1593,7 @@ enic_map_bar(struct enic_softc *softc, struct enic_bar_info *bar, int bar_num, if (bar->res != NULL) { device_printf(softc->dev, "Bar %d already mapped\n", bar_num); - return EDOOFUS; + return (EDOOFUS); } bar->rid = PCIR_BAR(bar_num); @@ -1481,20 +1622,18 @@ enic_init_vnic_resources(struct enic *enic) unsigned int rxq_interrupt_enable = 0; unsigned int rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET; unsigned int txq_interrupt_enable = 0; - unsigned int txq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET; + unsigned int txq_interrupt_offset; unsigned int index = 0; unsigned int cq_idx; if_softc_ctx_t scctx; scctx = enic->softc->scctx; - rxq_interrupt_enable = 1; - txq_interrupt_enable = 1; + txq_interrupt_enable = 0; rxq_interrupt_offset = 0; - txq_interrupt_offset = enic->intr_count - 2; - txq_interrupt_offset = 1; + txq_interrupt_offset = scctx->isc_nrxqsets; for (index = 0; index < enic->intr_count; index++) { vnic_intr_alloc(enic->vdev, &enic->intr[index], index); @@ -1568,7 +1707,7 @@ enic_update_packet_filter(struct enic *enic) } static bool -enic_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +enic_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event) { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: diff --git a/sys/dev/enic/vnic_cq.h b/sys/dev/enic/vnic_cq.h index 26f9009612c5..b4549ee58c64 100644 --- a/sys/dev/enic/vnic_cq.h +++ b/sys/dev/enic/vnic_cq.h @@ -63,6 +63,8 @@ struct vnic_cq { unsigned int to_clean; unsigned int last_color; unsigned int interrupt_offset; + unsigned int cur_rx_coal_timeval; + unsigned int tobe_rx_coal_timeval; #ifdef ENIC_AIC struct vnic_rx_bytes_counter pkt_size_counter; unsigned int cur_rx_coal_timeval; @@ -75,15 +77,12 @@ struct vnic_cq { int nrxqsets_start; }; -void vnic_cq_free(struct vnic_cq *cq); void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, unsigned int color_enable, unsigned int cq_head, unsigned int cq_tail, unsigned int cq_tail_color, unsigned int interrupt_enable, unsigned int cq_entry_enable, unsigned int message_enable, unsigned int interrupt_offset, u64 message_addr); void vnic_cq_clean(struct vnic_cq *cq); -int vnic_cq_mem_size(struct vnic_cq *cq, unsigned int desc_count, - unsigned int desc_size); static inline unsigned int vnic_cq_service(struct vnic_cq *cq, unsigned int work_to_do, diff --git a/sys/dev/enic/vnic_dev.c b/sys/dev/enic/vnic_dev.c index 3425d7372e56..2d555cb2b34d 100644 --- a/sys/dev/enic/vnic_dev.c +++ b/sys/dev/enic/vnic_dev.c @@ -44,7 +44,7 @@ static int vnic_dev_discover_res(struct vnic_dev *vdev, u8 type; if (num_bars == 0) - return -EINVAL; + return (EINVAL); rh = malloc(sizeof(*rh), M_DEVBUF, M_NOWAIT | M_ZERO); mrh = malloc(sizeof(*mrh), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -52,7 +52,7 @@ static int vnic_dev_discover_res(struct vnic_dev *vdev, pr_err("vNIC BAR0 res hdr not mem-mapped\n"); free(rh, M_DEVBUF); free(mrh, M_DEVBUF); - return -EINVAL; + return (EINVAL); } /* Check for mgmt vnic in addition to normal vnic */ @@ -69,7 +69,7 @@ static int vnic_dev_discover_res(struct vnic_dev *vdev, rh->magic, rh->version); free(rh, M_DEVBUF); free(mrh, M_DEVBUF); - return -EINVAL; + return (EINVAL); } } @@ -97,6 +97,7 @@ static int vnic_dev_discover_res(struct vnic_dev *vdev, case RES_TYPE_INTR_CTRL: case RES_TYPE_INTR_PBA_LEGACY: case RES_TYPE_DEVCMD: + case RES_TYPE_DEVCMD2: break; default: ENIC_BUS_READ_REGION_4(softc, mem, r_offset, (void *)r, sizeof(*r) / 4); @@ -189,12 +190,12 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, status = ENIC_BUS_READ_4(devcmd, DEVCMD_STATUS); if (status == 0xFFFFFFFF) { /* PCI-e target device is gone */ - return -ENODEV; + return (ENODEV); } if (status & STAT_BUSY) { pr_err("Busy devcmd %d\n", _CMD_N(cmd)); - return -EBUSY; + return (EBUSY); } if (_CMD_DIR(cmd) & _CMD_DIR_WRITE) { @@ -214,7 +215,7 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, status = ENIC_BUS_READ_4(devcmd, DEVCMD_STATUS); if (status == 0xFFFFFFFF) { /* PCI-e target device is gone */ - return -ENODEV; + return (ENODEV); } if (!(status & STAT_BUSY)) { @@ -225,7 +226,7 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, pr_err("Devcmd %d failed " \ "with error code %d\n", _CMD_N(cmd), err); - return err; + return (err); } if (_CMD_DIR(cmd) & _CMD_DIR_READ) { @@ -237,7 +238,82 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, } pr_err("Timedout devcmd %d\n", _CMD_N(cmd)); - return -ETIMEDOUT; + return (ETIMEDOUT); +} + +static int _vnic_dev_cmd2(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, + int wait) +{ + struct devcmd2_controller *dc2c = vdev->devcmd2; + struct devcmd2_result *result; + u8 color; + unsigned int i; + u32 fetch_index, new_posted; + int delay, err; + u32 posted = dc2c->posted; + + fetch_index = ENIC_BUS_READ_4(dc2c->wq_ctrl, TX_FETCH_INDEX); + if (fetch_index == 0xFFFFFFFF) + return (ENODEV); + + new_posted = (posted + 1) % DEVCMD2_RING_SIZE; + + if (new_posted == fetch_index) { + device_printf(dev_from_vnic_dev(vdev), + "devcmd2 %d: wq is full. fetch index: %u, posted index: %u\n", + _CMD_N(cmd), fetch_index, posted); + return (EBUSY); + } + + dc2c->cmd_ring[posted].cmd = cmd; + dc2c->cmd_ring[posted].flags = 0; + + if ((_CMD_FLAGS(cmd) & _CMD_FLAGS_NOWAIT)) + dc2c->cmd_ring[posted].flags |= DEVCMD2_FNORESULT; + if (_CMD_DIR(cmd) & _CMD_DIR_WRITE) + for (i = 0; i < VNIC_DEVCMD_NARGS; i++) + dc2c->cmd_ring[posted].args[i] = vdev->args[i]; + + ENIC_BUS_WRITE_4(dc2c->wq_ctrl, TX_POSTED_INDEX, new_posted); + dc2c->posted = new_posted; + + if (dc2c->cmd_ring[posted].flags & DEVCMD2_FNORESULT) + return (0); + + result = dc2c->result + dc2c->next_result; + color = dc2c->color; + + dc2c->next_result++; + if (dc2c->next_result == dc2c->result_size) { + dc2c->next_result = 0; + dc2c->color = dc2c->color ? 0 : 1; + } + + for (delay = 0; delay < wait; delay++) { + if (result->color == color) { + if (result->error) { + err = result->error; + if (err != ERR_ECMDUNKNOWN || + cmd != CMD_CAPABILITY) + device_printf(dev_from_vnic_dev(vdev), + "Error %d devcmd %d\n", err, + _CMD_N(cmd)); + return (err); + } + if (_CMD_DIR(cmd) & _CMD_DIR_READ) + for (i = 0; i < VNIC_DEVCMD2_NARGS; i++) + vdev->args[i] = result->results[i]; + + return 0; + } + udelay(100); + } + + device_printf(dev_from_vnic_dev(vdev), + "devcmd %d timed out\n", _CMD_N(cmd)); + + + return (ETIMEDOUT); } static int vnic_dev_cmd_proxy(struct vnic_dev *vdev, @@ -253,7 +329,7 @@ static int vnic_dev_cmd_proxy(struct vnic_dev *vdev, */ if (nargs > VNIC_DEVCMD_NARGS - 2) { pr_err("number of args %d exceeds the maximum\n", nargs); - return -EINVAL; + return (EINVAL); } memset(vdev->args, 0, sizeof(vdev->args)); @@ -261,9 +337,9 @@ static int vnic_dev_cmd_proxy(struct vnic_dev *vdev, vdev->args[1] = cmd; memcpy(&vdev->args[2], args, nargs * sizeof(args[0])); - err = _vnic_dev_cmd(vdev, proxy_cmd, wait); + err = vdev->devcmd_rtn(vdev, proxy_cmd, wait); if (err) - return err; + return (err); status = (u32)vdev->args[0]; if (status & STAT_ERROR) { @@ -271,7 +347,7 @@ static int vnic_dev_cmd_proxy(struct vnic_dev *vdev, if (err != ERR_ECMDUNKNOWN || cmd != CMD_CAPABILITY) pr_err("Error %d proxy devcmd %d\n", err, _CMD_N(cmd)); - return err; + return (err); } memcpy(args, &vdev->args[1], nargs * sizeof(args[0])); @@ -286,16 +362,16 @@ static int vnic_dev_cmd_no_proxy(struct vnic_dev *vdev, if (nargs > VNIC_DEVCMD_NARGS) { pr_err("number of args %d exceeds the maximum\n", nargs); - return -EINVAL; + return (EINVAL); } memset(vdev->args, 0, sizeof(vdev->args)); memcpy(vdev->args, args, nargs * sizeof(args[0])); - err = _vnic_dev_cmd(vdev, cmd, wait); + err = vdev->devcmd_rtn(vdev, cmd, wait); memcpy(args, vdev->args, nargs * sizeof(args[0])); - return err; + return (err); } int vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, @@ -328,7 +404,7 @@ int vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, *a1 = args[1]; } - return err; + return (err); } int vnic_dev_cmd_args(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, @@ -400,7 +476,7 @@ int vnic_dev_capable_filter_mode(struct vnic_dev *vdev, u32 *mode, args[1] = 0; err = vnic_dev_cmd_args(vdev, CMD_CAPABILITY, args, 2, 1000); if (err) - return err; + return (err); max_level = args[1]; goto parse_max_level; } else if (args[2] == FILTER_CAP_MODE_V1) { @@ -479,7 +555,7 @@ int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, size_t size, break; } - return err; + return (err); } int vnic_dev_stats_clear(struct vnic_dev *vdev) @@ -497,7 +573,7 @@ int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats) int rc; if (!vdev->stats) *** 521 LINES SKIPPED *** From nobody Thu Jan 9 18:09:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTXr12WfBz5jkVB; Thu, 09 Jan 2025 18:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTXr11nQsz4YmT; Thu, 9 Jan 2025 18:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736446193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8N/iTKV6EMLQelNiJyKRR2tUR1M2LfzuB2lX+pL2jag=; b=hxCoZYetwHRkEkILmi3edpaKQTsZoxlQX3fOS9wXqmsZ9LT6d8xpK5Kibyn7FS+OogCehw dGMZcWFfid00q/Gr2R35zmUs9Lpnq47IigblDiPeZyValUtC0Q1/sB5i+B24VGEPcNmJ4C veLBCNtjE+KPkqlb6ZeJ9yMVaAT5tLBQmrUkGi4vjQCAGevXEOWdi2BXOCttt1wKAbmlva tkHL/UQTr2FqDvoNrnesTmCyv6XaABmkC1BwOmdrbfDAxNb1zOLd7q/n78myiDm6popWAC XlWR3UFYd9ZXYgC6W9ZKFnVoX3YUHAZFnQQ/IFiLDFRlyE58yOVlhcGi6afLVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736446193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8N/iTKV6EMLQelNiJyKRR2tUR1M2LfzuB2lX+pL2jag=; b=VL4aFTGKjvM0A0z9xFtySfuGE+joY2eQLtXoPnluJ/E8C2St7yS+IDCfLSd/aOp1U517qK E2sAIwgtJdJaePd9PPF8oka90LLP/rOKO61xL0+oXmGAm3OMwaEG1V4ojgqfAgok8156H4 GongapSOQosYyczGmQ/Hi/4keJ+36KZ1h1UmLJDb6Af7kpS5oz4Y9RF9i6u3+q6QodtcyA VEbyjxd6WFTgs/kxqpOOUGWL5xS5eTmll9YTpjJKIhNAPy6sOuZ6MGpticSxJ/albi3MSv wIVnSwg76LlVW6QEZrGVypyp8kCOCRcXzBSJ+monw3aAYSI5b8gaJ7G0KDYltQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736446193; a=rsa-sha256; cv=none; b=S3JrbT/7bBCKwkqBdCgC+uKNXmCz2bLeermnsXoAUAKrsL0JqdNP7QU+FhexLDE8DDzEEm rgR1y1M64UDu4iSxVhgJn3M6/LuFyw1Tl5cXZpbDbcCrFlANaq5FtG6HOHANGdXrsCMS9i djHmi1RlzKTvxy1HNG69xBvsx/7nVYaCgi6P4pGq2CKw0joJNpo/Q8tkavS0vUV5bwX6Sz vpPdjYSaBOy3+EWvb5QIMQu+bt7oiPMjUu2ST5mNxjEOTosLJOSLQe6JC39pEJgw2RgP57 3qGD7+nD1bOcwFRtH1lUl+ZQoVVbWJE0KkdAqeLXqk6Ff5yA1V+x71tT+XdhEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTXr10t7CzdVq; Thu, 09 Jan 2025 18:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509I9qXX005439; Thu, 9 Jan 2025 18:09:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509I9qkg005436; Thu, 9 Jan 2025 18:09:52 GMT (envelope-from git) Date: Thu, 9 Jan 2025 18:09:52 GMT Message-Id: <202501091809.509I9qkg005436@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: 2cadbe468a8e - main - tcp_wrappers: Use default C standard version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cadbe468a8e8aef193429565b729d34ec48b266 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2cadbe468a8e8aef193429565b729d34ec48b266 commit 2cadbe468a8e8aef193429565b729d34ec48b266 Author: Minsoo Choo AuthorDate: 2024-04-06 00:30:50 +0000 Commit: John Baldwin CommitDate: 2025-01-09 18:07:51 +0000 tcp_wrappers: Use default C standard version Reviewed by: emaste, arichardson, jhb Differential Revision: https://reviews.freebsd.org/D43236 --- contrib/tcp_wrappers/tcpd.c | 1 + libexec/tcpd/Makefile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/tcp_wrappers/tcpd.c b/contrib/tcp_wrappers/tcpd.c index a0ba42f71f86..164132570a36 100644 --- a/contrib/tcp_wrappers/tcpd.c +++ b/contrib/tcp_wrappers/tcpd.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32"; int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ +int main(int argc, char **argv) { struct request_info request; diff --git a/libexec/tcpd/Makefile b/libexec/tcpd/Makefile index bb8f09ca13ac..4845013f7489 100644 --- a/libexec/tcpd/Makefile +++ b/libexec/tcpd/Makefile @@ -6,7 +6,6 @@ PACKAGE= tcpd PROG= tcpd MAN= tcpd.8 -CSTD?= c89 CFLAGS+=-DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" \ From nobody Thu Jan 9 18:09:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTXr22N39z5jkdS; Thu, 09 Jan 2025 18:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTXr21lKmz4YgP; Thu, 9 Jan 2025 18:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736446194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFKdvpSjij/5ZSuB2Ge2kG1PFg/FzZ7osHvnfS9RW+Q=; b=men6KtRMipXvYuNi+yVGkV5AzgeOmFM0hpVo9Opqe8eSBw21XW28e+htWe/m038DiR5CDx KU75hO3y1tGR1wyGRX8fYDQyd+YFDFDmH1TKqnSvRy6WHwWvQntzUsF1B5Jy3whiGSgHgZ DKdxImae6R1lA8m9DOXZuR9DbcjfQfuxHpIcuIzzv1yfcbEqq6sV8IisBb98LpFuSLFrFZ F2ovJ5pQN5QtEXiO9E36K9oZuWoYxTmI2JH6FneeE+0V6WU/gvnjdUUnfB7pGbxsszYU64 8vgRGVoQ/If6D0sOAeQ4a4YK1n4fJ4bBnJPuL31sAtARzM9mjX92f0vhddAwRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736446194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFKdvpSjij/5ZSuB2Ge2kG1PFg/FzZ7osHvnfS9RW+Q=; b=aDdVv6SMsFs8yizr2xa0BdeT1WS+LXhyZTj9Oo48ki5wJddfyFZmaFa1Evc20nTFlnLa6s zAIv1EP+UsVdUPveI23xPyDd+W7PJuTQiGu2TKBjD9ehnSg6Q33JglyGH4B5h8xt7P/TP1 5XPaZnFy4YmJrNt/HEStJV478AJiQc2sjvogpjDp+7f/CGxydgfZC0h7N4o+doduFF3sJR 74Zt6DaCnrT+wJEKiCo7WnzBMz5uk4Tq8pnNFMF5I28jk+aJPgvpOXptnjU1teOIT4J05F cx0Hx9/2v62d73lMsWJ2Qy4Zi4hxMmUxNNmpTZyRfkXEcIE7NN+xPDxCzQEViA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736446194; a=rsa-sha256; cv=none; b=IQvodC3GLMw3RADw9qiAAXON8+KrOH2TXbNlg/VVlNfFkTg6uoh1DpoB0WQDnrBKfOrSrH u9j0yFUgorwQW9TWIdDTPtDZSo6eAkgspKjXIgfVTtO3dDhrNofq7xEXY0Ho3rCojOAOkJ /b3y6QzKIkEhJTsPvBwiJAp08sySNUkj4qreDTgTYzAoHxWAYBnLQPAlgBF/9LO+zSiA7Z 5koo8ZbcuXR+h0Z3sUpvCzYTgOE4CHwRmlW8Q1wlWHvGUbmjucnC3FpD2jJyi4egefZheC fXLPliklCgBRJQbApiYetdOpsn8O3SSUw9hv59jwc/jHkZVMs3TowtopOF2wTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTXr219Srzd9M; Thu, 09 Jan 2025 18:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509I9sou005493; Thu, 9 Jan 2025 18:09:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509I9sQY005490; Thu, 9 Jan 2025 18:09:54 GMT (envelope-from git) Date: Thu, 9 Jan 2025 18:09:54 GMT Message-Id: <202501091809.509I9sQY005490@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: d0d7fcbae420 - main - dumpon: Move the _Noreturn keyword before the return type List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0d7fcbae4207402b35f37cabe2bb5f30bec7c5d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d0d7fcbae4207402b35f37cabe2bb5f30bec7c5d commit d0d7fcbae4207402b35f37cabe2bb5f30bec7c5d Author: John Baldwin AuthorDate: 2025-01-09 17:52:50 +0000 Commit: John Baldwin CommitDate: 2025-01-09 18:07:51 +0000 dumpon: Move the _Noreturn keyword before the return type This fixes a warning from GCC 14 when compiling with the native C11 _Noreturn rather than the older GNU C function attribute: sbin/dumpon/dumpon.c:73:1: error: '_Noreturn' is not at beginning of declaration [-Werror=old-style-declaration] 73 | static void _Noreturn | ^~~~~~ --- sbin/dumpon/dumpon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index 46652d8471eb..e6c1634ff6fe 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -70,7 +70,7 @@ static int verbose; -static void _Noreturn +static _Noreturn void usage(void) { fprintf(stderr, From nobody Thu Jan 9 19:01:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTYz91vMWz5jq3k; Thu, 09 Jan 2025 19:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTYz91QZNz4gQ0; Thu, 9 Jan 2025 19:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736449269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mll0rYLTELPP7FeDThyHbaEPxOV/cEtRF/V5OpTGXNQ=; b=gxS35yvrRX9kiZC01pVbpOPU8ScMh3+oXmSGNGhZZORCfwNajdwDdGqEKei3qMFfd2NPLD Gt342gcJ1D99YXevBMm299TU1S/vus2EcfIvejoy9ppa272DxLrvKTEMN0tEZQbpM+RCv2 r2Q239LyvxWEwiQcrFGRfCv3R+ge0WOWb9o5QSFtLi0gdGPY+rsua1wE0WHXy2OxxCTAZE P6CJClnk8dPm26ssx5vGqO13fxKvHEYMPKFoYdKUVsvoPDdB0/tY4UNBSDLkaVe7lUnX22 2M1JBDS0EG90Itr5LLRsQcUwGPk4asVcM4I0CDEZeQ/7Dk5jXoZIbDFcsjd8ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736449269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mll0rYLTELPP7FeDThyHbaEPxOV/cEtRF/V5OpTGXNQ=; b=FNbU2t62P5H3hv7h5kQt/FpSuwwvnE147kE7p8HvNzRFM1QSz3QlcJ8StNDdGwRIsXdC9v /2/eRP4Qa5B2P7X3iwk6k9rKEik5lBkD32lSxYG+x/sFQn+3EzUpgcLdEjvX2T46ts91Al WLjutnIg+dP+JIa9TBx/X3GVIP5R1zO47cZEUYaqpMij5da3/wBCljbqwUhEO0Fgz2lOZ3 +TD4fCFwavYajmngQ20ja/NFVei8qQmnfWN5KGOJFZnNHc59jiOjlMdYHwuFV0Inj7w54O oPRcWrx/H1+NbGTzeoluTlYj1aq9ykW/z9+WqedIbP7MmTjsPDb1jyekYUB81w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736449269; a=rsa-sha256; cv=none; b=Wxx1G5avR6vY0K+P7QCcwAKKhDLrGlonGI4pc4LpAY3blJMbZ77Coh5y8+RP+b25KahZVf Py5pSC1uCFxRoTz6O3H0kcytfn0Tx48ZC0pTGA0nNKg/8g/4wXqeqH3bWnmY/GXkeLEdIf 6ZAKe7l+xiXxa2eXTrQhps3LpN3XtX2oMPNUDxrfkXyhxALu2Dce+DmkqAbjmrfVTl9h7n EpH9vI7P98l7SNS/yzRbZk2ujjP2jW8ZE+fFYuGxT1DUI/KXqYCatVxLQTyfV5LVuUwKoT tGHb5WxU9A2zPtrwxOJsaPRxzKO6wakNyF8jNqgRg/ZgTbznZ5CPS1UGdGwVMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTYz90s69zfSV; Thu, 09 Jan 2025 19:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509J18Kj012900; Thu, 9 Jan 2025 19:01:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509J18mN012897; Thu, 9 Jan 2025 19:01:08 GMT (envelope-from git) Date: Thu, 9 Jan 2025 19:01:08 GMT Message-Id: <202501091901.509J18mN012897@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: c6eb7f3fbffd - main - zstd: Add a stub for the kernel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6eb7f3fbffd9065ab75a2ed266f1b069fd97e6e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c6eb7f3fbffd9065ab75a2ed266f1b069fd97e6e commit c6eb7f3fbffd9065ab75a2ed266f1b069fd97e6e Author: Minsoo Choo AuthorDate: 2025-01-09 18:28:12 +0000 Commit: John Baldwin CommitDate: 2025-01-09 19:00:54 +0000 zstd: Add a stub for the kernel The stub header includes . zstd's xx_hash.h #includes for the definition of static_assert() when building with C11 or newer. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D43239 --- sys/contrib/zstd/lib/freebsd/assert.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/zstd/lib/freebsd/assert.h b/sys/contrib/zstd/lib/freebsd/assert.h new file mode 100644 index 000000000000..eb2efe9be6c0 --- /dev/null +++ b/sys/contrib/zstd/lib/freebsd/assert.h @@ -0,0 +1,2 @@ +/* This file is in the public domain */ +#include From nobody Thu Jan 9 20:09:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTbV12Ff4z5jxNy; Thu, 09 Jan 2025 20:09:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTbV11kGSz4p3y; Thu, 9 Jan 2025 20:09:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736453369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PJzylw5pZ29ZzgkyS9Gu0q0rAVZldDplZERHPxBLO6c=; b=eKDE9Lv9b6U8N70cHXZedfvWGNIUnVBbFTDSfY9VJihUTQWibx7c5wzMwti97nx9Ew4cTh /ZXhIqZaId7am8rQo+obpUMFIHIXwF0RC64BooMnmPDyAH6HCksax72+iyz9URhwbBYbzw Hj6EgNjV1MVvWk7L/lYsEKFRLNfM3GvNKkMpkW7wk3i0VDvjf0qcOJWWLT4Jmpxi3jSJM6 czcmVlypwwjWd80YZaHii6K6nyQR1kEnctR1e2bxNm+VpvrI1FDcJbUPxvMwPFGqWZcOOK v19Ou/9vNES8zvkYmLDM4TVd1Y1JoAblovkcKYaPOuMlGPW7v6spmvtfTpy5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736453369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PJzylw5pZ29ZzgkyS9Gu0q0rAVZldDplZERHPxBLO6c=; b=S/0eZ2tudFqH7uz1x1kvtDiLHpKC/V5lt9bHYJfGSHsUYLQo2WqHzdWXnbHHKG8xc0I5Dz hkU/fFIN4C/VYCLutmz/QZcLaKo3FWoLXLUV+ug9LB8OQYJrtDCkceXEtbBnGM4myHaAbd 8lcFCHfQncD6HbDdevZozv0Xt6ps2hEBjedl05ToiKw0ITWgtgJPN8J1WMQ64uwh2Ywts6 llU1dBsmtlbhlbvpbf0mEsq/+bGK+nHOA1QBQRHhWDbRl4+C50D2TySv0rOJbVaYdZ8zQ2 HM0sINCGhvcOWV8PbQ9oqA+6wUiIxJEj86EMzYwd2DIF/mgE6Dvn8UNLnNuNxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736453369; a=rsa-sha256; cv=none; b=wE/NB/KnRMTcN1CkQ/dcWDN0UZ4etAwLUv+XMj4z1UNNrpN/JuqjmKHhtJ+6wZQPMarVuH dbh2LaMIgwV2/2JaqheNdVDzuWFTRlq1TR36i92NNuwKZ5YUkNOn3z8fP4APFJ80ZS+9i+ DoAaI1VAg8bj5jwyNoIaJUd1mzIhX7RySN6d8QYfKbNKqkxRtYq/xAjgr8xB835OILVIvv Jr19RBw/4oqZD5v05O+duTw1Hn5NtpDs00T90SZblS33ul6thXsaoTjO93iD8XR8EncHV5 Edp49WjKuJ5WeEf5jS6RzszlWjv69j+qRkFbAdzQxqesxn3IbPVny/xr1BqImA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTbV11F3szhSB; Thu, 09 Jan 2025 20:09:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509K9TUX030829; Thu, 9 Jan 2025 20:09:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509K9Tr9030826; Thu, 9 Jan 2025 20:09:29 GMT (envelope-from git) Date: Thu, 9 Jan 2025 20:09:29 GMT Message-Id: <202501092009.509K9Tr9030826@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: 6af088c736c2 - main - BUS_CHILD_DETACHED.9: This is also called if DEVICE_ATTACH fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6af088c736c2fd9e64f2ad9449b7df1a109e6241 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6af088c736c2fd9e64f2ad9449b7df1a109e6241 commit 6af088c736c2fd9e64f2ad9449b7df1a109e6241 Author: John Baldwin AuthorDate: 2025-01-09 20:09:21 +0000 Commit: John Baldwin CommitDate: 2025-01-09 20:09:21 +0000 BUS_CHILD_DETACHED.9: This is also called if DEVICE_ATTACH fails Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48363 --- share/man/man9/BUS_CHILD_DETACHED.9 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man9/BUS_CHILD_DETACHED.9 b/share/man/man9/BUS_CHILD_DETACHED.9 index 4cc00a49465b..8b59d1362d3d 100644 --- a/share/man/man9/BUS_CHILD_DETACHED.9 +++ b/share/man/man9/BUS_CHILD_DETACHED.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 21, 2012 +.Dd January 9, 2025 .Dt BUS_CHILD_DETACHED 9 .Os .Sh NAME @@ -39,7 +39,10 @@ .Sh DESCRIPTION The .Fn BUS_CHILD_DETACHED -method is invoked by the new-bus framework after a device is detached. +method is invoked by the new-bus framework after a device is detached +or if a driver's attach routine +.Pq see Xr DEVICE_ATTACH 9 +fails. A bus driver can provide an implementation of this method to reclaim any resources allocated on behalf of the child or to cleanup state not properly released by a From nobody Thu Jan 9 20:20:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTblD1dlKz5jy56; Thu, 09 Jan 2025 20:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTblD0vz0z4qJT; Thu, 9 Jan 2025 20:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736454056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hCHCGjtIi7Cf5yDPFKAGbh7MKMI8WJ05biNEcHTdk+4=; b=hT7VQouuAqsHQJavZ4TEioR1e0/n1MS8lWzd5k8FjR+4DGMir0LEBOBM5Fi2SHgsdr3Vpf p7yHF7bsnXpQmKxfQBPWBNleiVPwdBlIzX/0BzTUw/Duo1dTvqHc3PvPmqbM3Xh/3DwPLd TgAowKsoRuNqtkr5We3Ugq5FaftCdR7hQ8MTEZAoFIB1ULx0W1anZ9T5RszRa8OHBaMNHe crYRhS/fpcmWz1N2MA3uL96xtAgEALlUi1aBp/SPwjyIdkOnPUrCnz+XhV/HqdH+XW4v9s gz9VgpNaHhGesQg549nC1mxtV/eTb8/dXBtbNCSXLfD4fg1uzkT8gmtP0vQzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736454056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hCHCGjtIi7Cf5yDPFKAGbh7MKMI8WJ05biNEcHTdk+4=; b=Phm3KjGUQzBushybqrSnMEtEj/ZH5tUcx+QQ5RvaBf6COXy8kdJTHH3P/My2eQ3G/RN4KT 0FIloxY0qfKH0GSHQWHFB9WNz80YiceoXWA3rRHc+/DWihcMcHm9m6HWMpIZrVZ+BnYlH/ RLab/nRvFgc5cDig8JAs7FiNRA7gGzWHi0EjVgPg9VmqLt8Yc5SlHuGFxisresdcUcl1Xq oxft9MvJ4pdFnYLy+XZbCm+1wcVJTd+67H4Ruc4FEWDBzM2xamIKRDwCw8sV2s5GJjlxYG qN75d7XtaK6HIi3J4iXiojNw4ijbivyMm5PBP/flgM/+u0D8zDdkVVmOo7oJNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736454056; a=rsa-sha256; cv=none; b=rZDVLLVbAurPAfOyD95cOfCXjWlMRldAK0tcOOXhaWoC3ELIh1zMoRas1OxmI6i/HuJKti 6cloeyr3P5MKyKyjiBnqD/gTkRN8Dl+DcmSGFB6gG/hxNmCViR3YThBnLSQKPp6WAC3TeH YOZqLd2ZPe3Xp3Nj5mgxtlHUE+PnC9MrhcDQCVXxjAXCU0bWH4qzbyOlf0KhcuU8LO3RBl xXQQeukPRGfJ/BSv5svzxjWqKfHVD+mALp35HSFWgDi99UEwjrtC+mEcR617CY6l37pI/+ f7eYplXurP21m4Vkf+kgrdK3bebZHuVG+5QUs+lIOAaWr6HdXnixzAe94w250g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTblD0Ndwzhnq; Thu, 09 Jan 2025 20:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 509KKtLU058879; Thu, 9 Jan 2025 20:20:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 509KKt1U058876; Thu, 9 Jan 2025 20:20:55 GMT (envelope-from git) Date: Thu, 9 Jan 2025 20:20:55 GMT Message-Id: <202501092020.509KKt1U058876@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: ccabc7c2e556 - main - DEVICE_IDENTIFY.9: Modernize description and use cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccabc7c2e556ac0b14da9b682b706ccaf251c0fe Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ccabc7c2e556ac0b14da9b682b706ccaf251c0fe commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe Author: John Baldwin AuthorDate: 2025-01-09 20:20:16 +0000 Commit: John Baldwin CommitDate: 2025-01-09 20:20:16 +0000 DEVICE_IDENTIFY.9: Modernize description and use cases Mention adding devices based on firmware tables and software-only pseudo-devices as use cases for identify methods as those are more common than reading random I/O ports to identify a legacy ISA device. Describe how device_find_chid can be used to avoid duplicates. While here, explicitly note that devices added in identify methods typically use a fixed device name. Trim the cross-references a bit. Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D48367 --- share/man/man9/DEVICE_IDENTIFY.9 | 52 +++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/share/man/man9/DEVICE_IDENTIFY.9 b/share/man/man9/DEVICE_IDENTIFY.9 index d75c1a91ce4a..b10d94143050 100644 --- a/share/man/man9/DEVICE_IDENTIFY.9 +++ b/share/man/man9/DEVICE_IDENTIFY.9 @@ -26,44 +26,46 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 15, 2017 +.Dd January 9, 2025 .Dt DEVICE_IDENTIFY 9 .Os .Sh NAME .Nm DEVICE_IDENTIFY -.Nd identify a device, register it +.Nd identify new child devices and register them .Sh SYNOPSIS .In sys/param.h .In sys/bus.h .Ft void .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" .Sh DESCRIPTION -The identify function for a device is only needed for devices on buses -that cannot identify their children independently, e.g.\& the ISA bus. -It is used to recognize the device (usually done by accessing non-ambiguous -registers in the hardware) and to tell the kernel about it and thus -creating a new device instance. +The identify method of a device driver is used to add devices that cannot be +enumerated by the standard method on a bus device. +Devices can be enumerated in various ways including accessing non-ambiguous +device registers and parsing firmware tables. +Software-only pseudo devices are also often enumerated via identify methods. .Pp +For each newly identified device, +a new device instance should be created by invoking the .Xr BUS_ADD_CHILD 9 -is used to register the device as a child of the bus. -The device's resources (such as IRQ and I/O ports) are registered -with the kernel by calling -.Fn bus_set_resource -for each resource (refer to +method. +If the identify method is able to discover other properties about the new +device, those should also be set. +For example, device resources should be added to the device by calling .Xr bus_set_resource 9 -for more information). +for each resource. .Pp -Since the device tree and the device driver tree are disjoint, the -.Fn DEVICE_IDENTIFY -routine needs to take this into account. -If you load and unload your device driver that has the identify -routine, the child node has the potential for adding the same node -multiple times unless specific measure are taken to preclude that -possibility. +An identify method might be invoked multiple times. +If a device driver is unloaded and loaded, +the identify method will be called a second time after being reloaded. +As a result, the identify method should avoid duplicate devices. +Devices added by identify methods typically use a fixed device name +in which case +.Xr device_find_child 9 +can be used to detect existing devices. .Sh EXAMPLES The following pseudo-code shows an example of a function that probes for a piece of hardware and registers it and its resource -(an I/O port) with the kernel. +(an I/O port) with the parent bus device. .Bd -literal void foo_identify(driver_t *driver, device_t parent) @@ -72,7 +74,7 @@ foo_identify(driver_t *driver, device_t parent) retrieve_device_information; if (devices matches one of your supported devices && - not already in device tree) { + device_get_child(parent, "foo", DEVICE_UNIT_ANY) == NULL) { child = BUS_ADD_CHILD(parent, 0, "foo", DEVICE_UNIT_ANY); bus_set_resource(child, SYS_RES_IOPORT, 0, FOO_IOADDR, 1); } @@ -82,11 +84,7 @@ foo_identify(driver_t *driver, device_t parent) .Xr BUS_ADD_CHILD 9 , .Xr bus_set_resource 9 , .Xr device 9 , -.Xr device_add_child 9 , -.Xr DEVICE_ATTACH 9 , -.Xr DEVICE_DETACH 9 , -.Xr DEVICE_PROBE 9 , -.Xr DEVICE_SHUTDOWN 9 +.Xr device_find_child 9 .Sh AUTHORS This manual page was written by .An Alexander Langer Aq Mt alex@FreeBSD.org . From nobody Thu Jan 9 23:01:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTgK0207Bz5kDTp; Thu, 09 Jan 2025 23:01:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTgJz4g5zz450j; Thu, 9 Jan 2025 23:01:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 509N1fJ7095437; Fri, 10 Jan 2025 01:01:44 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 509N1fJ7095437 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 509N1fRK095436; Fri, 10 Jan 2025 01:01:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 10 Jan 2025 01:01:41 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ccabc7c2e556 - main - DEVICE_IDENTIFY.9: Modernize description and use cases Message-ID: References: <202501092020.509KKt1U058876@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501092020.509KKt1U058876@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4YTgJz4g5zz450j X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Thu, Jan 09, 2025 at 08:20:55PM +0000, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ccabc7c2e556ac0b14da9b682b706ccaf251c0fe > > commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe > Author: John Baldwin > AuthorDate: 2025-01-09 20:20:16 +0000 > Commit: John Baldwin > CommitDate: 2025-01-09 20:20:16 +0000 > > DEVICE_IDENTIFY.9: Modernize description and use cases > > Mention adding devices based on firmware tables and software-only > pseudo-devices as use cases for identify methods as those are more > common than reading random I/O ports to identify a legacy ISA device. > > Describe how device_find_chid can be used to avoid duplicates. While > here, explicitly note that devices added in identify methods typically > use a fixed device name. > > Trim the cross-references a bit. > > Reviewed by: ziaee, imp > Differential Revision: https://reviews.freebsd.org/D48367 > --- > share/man/man9/DEVICE_IDENTIFY.9 | 52 +++++++++++++++++++--------------------- > 1 file changed, 25 insertions(+), 27 deletions(-) > > diff --git a/share/man/man9/DEVICE_IDENTIFY.9 b/share/man/man9/DEVICE_IDENTIFY.9 > index d75c1a91ce4a..b10d94143050 100644 > --- a/share/man/man9/DEVICE_IDENTIFY.9 > +++ b/share/man/man9/DEVICE_IDENTIFY.9 > @@ -26,44 +26,46 @@ > .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd January 15, 2017 > +.Dd January 9, 2025 > .Dt DEVICE_IDENTIFY 9 > .Os > .Sh NAME > .Nm DEVICE_IDENTIFY > -.Nd identify a device, register it > +.Nd identify new child devices and register them > .Sh SYNOPSIS > .In sys/param.h > .In sys/bus.h > .Ft void > .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" So what is the 'parent' for driver which creates devices based on the firmware tables? > .Sh DESCRIPTION > -The identify function for a device is only needed for devices on buses > -that cannot identify their children independently, e.g.\& the ISA bus. > -It is used to recognize the device (usually done by accessing non-ambiguous > -registers in the hardware) and to tell the kernel about it and thus > -creating a new device instance. > +The identify method of a device driver is used to add devices that cannot be > +enumerated by the standard method on a bus device. > +Devices can be enumerated in various ways including accessing non-ambiguous > +device registers and parsing firmware tables. > +Software-only pseudo devices are also often enumerated via identify methods. > .Pp > +For each newly identified device, > +a new device instance should be created by invoking the > .Xr BUS_ADD_CHILD 9 > -is used to register the device as a child of the bus. > -The device's resources (such as IRQ and I/O ports) are registered > -with the kernel by calling > -.Fn bus_set_resource > -for each resource (refer to > +method. > +If the identify method is able to discover other properties about the new > +device, those should also be set. > +For example, device resources should be added to the device by calling > .Xr bus_set_resource 9 > -for more information). > +for each resource. > .Pp > -Since the device tree and the device driver tree are disjoint, the > -.Fn DEVICE_IDENTIFY > -routine needs to take this into account. > -If you load and unload your device driver that has the identify > -routine, the child node has the potential for adding the same node > -multiple times unless specific measure are taken to preclude that > -possibility. > +An identify method might be invoked multiple times. > +If a device driver is unloaded and loaded, > +the identify method will be called a second time after being reloaded. > +As a result, the identify method should avoid duplicate devices. > +Devices added by identify methods typically use a fixed device name > +in which case > +.Xr device_find_child 9 > +can be used to detect existing devices. > .Sh EXAMPLES > The following pseudo-code shows an example of a function that > probes for a piece of hardware and registers it and its resource > -(an I/O port) with the kernel. > +(an I/O port) with the parent bus device. > .Bd -literal > void > foo_identify(driver_t *driver, device_t parent) > @@ -72,7 +74,7 @@ foo_identify(driver_t *driver, device_t parent) > > retrieve_device_information; > if (devices matches one of your supported devices && > - not already in device tree) { > + device_get_child(parent, "foo", DEVICE_UNIT_ANY) == NULL) { > child = BUS_ADD_CHILD(parent, 0, "foo", DEVICE_UNIT_ANY); > bus_set_resource(child, SYS_RES_IOPORT, 0, FOO_IOADDR, 1); > } > @@ -82,11 +84,7 @@ foo_identify(driver_t *driver, device_t parent) > .Xr BUS_ADD_CHILD 9 , > .Xr bus_set_resource 9 , > .Xr device 9 , > -.Xr device_add_child 9 , > -.Xr DEVICE_ATTACH 9 , > -.Xr DEVICE_DETACH 9 , > -.Xr DEVICE_PROBE 9 , > -.Xr DEVICE_SHUTDOWN 9 > +.Xr device_find_child 9 > .Sh AUTHORS > This manual page was written by > .An Alexander Langer Aq Mt alex@FreeBSD.org . From nobody Fri Jan 10 02:11:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTlWB3CkKz5kVqM; Fri, 10 Jan 2025 02:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTlWB2T4Xz4M4m; Fri, 10 Jan 2025 02:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736475062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzYOwwuANB4bCN/F8/zjXnvTTubLsnFl8WnO6UjTfX4=; b=XNQcWDO7UUqmallvcadVQXYO90Jci1a8nhXtgt0MH47T+O9qpFvIYhH65SZkDHyP0XEq69 RCaLjnUn8jup9Bo7uQTLEOW+QJGhgfFepssRfZvcdZYAVcJDFT6m/TZhzUKjiRMXAi0IJu 0cNKhTDVqp6MOU5oom+79bX46CoO+wDUcEDdiUVXOFVW0oPYmq4kClbFFZonTG1L0t+slt IY1JYsAbS5yIQy1gFWvomlQOMcdGAecIxdHEr08eQ0hCu603aV22OWgCF5ePXmgxDkmfzk eHkh7FlB2WypxM1e7ZigQk4E/SdMxSDxrAhwZAUw8XCjNfo2sP7ef6XnO5rvPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736475062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzYOwwuANB4bCN/F8/zjXnvTTubLsnFl8WnO6UjTfX4=; b=LmU3W38EYZ3Q2PUYfadVGHZ90IXfZU0bGfvQLLOYy3A0jZtq1J/D5WtyCDneNyCScctAxv WzWp2ZcNBRku+cKCLs6bNzloBKgpN9O5UA/PS11sjsNPcoraYc6WeV4iyhc7FXdT0tt4gq 8dVIXgx4JSP4na070Sy9BCGT8asKsc1dkwWzlE8TybKLdaEYmz6NGONfkcT0ktwIhhBr1L xeWunE6ebg96D7vV3rqWp8LhZf6hTnaenf3Dz+FJ3wpcaKsFW8g1/NnfzLEQxiwwzaD2tQ 2veHXEl/9Kl2R0kZH0z2MCzPjyJYGdyNVibJckNum5OXNGPqJsrSGAdVO1vqqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736475062; a=rsa-sha256; cv=none; b=afRab9cIJTP7X1RB4/3h/0jfuGC19pZlLZlR6eg5akpuAdgbGcfppnu/bRkt/Nd/lK3x8A hzrHsnP4Nu34UEBVkzkCEXtO17hpaMsZMsB7d/3UWUSorJuM5AsrIzsBP+MGsuPggK5ueh QM7+60XfaFxiZf8heWH0471CrQqdyS4G5b5w5w+qDzXofL2mPdTDJue8pcoweoYWW5u+HQ VQZxxCzkL4dmb7gcp0NmsRYqeZ4AO8bFiRRu3RUKLnpqnRh4LwNHUU6sl0rw6RhKga8ctk l617lzJBEewve5nKl5HaBbToabFu07VUESJk5hWW8hL5SHaz9YdxFPdU3IQCvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTlWB23ZHzsWB; Fri, 10 Jan 2025 02:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50A2B2Qd010037; Fri, 10 Jan 2025 02:11:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50A2B2l7010034; Fri, 10 Jan 2025 02:11:02 GMT (envelope-from git) Date: Fri, 10 Jan 2025 02:11:02 GMT Message-Id: <202501100211.50A2B2l7010034@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: ed49d3b31d42 - main - twe.4: Remove manpage for previously-removed driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed49d3b31d425a0add04aff6eb721a474937b7da Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ed49d3b31d425a0add04aff6eb721a474937b7da commit ed49d3b31d425a0add04aff6eb721a474937b7da Author: John Baldwin AuthorDate: 2025-01-10 02:09:52 +0000 Commit: John Baldwin CommitDate: 2025-01-10 02:09:52 +0000 twe.4: Remove manpage for previously-removed driver Reviewed by: ziaee, imp Fixes: 062a7b918fac twe: Remove driver Differential Revision: https://reviews.freebsd.org/D48403 --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 1 - share/man/man4/twe.4 | 278 ------------------------------------------------ 3 files changed, 3 insertions(+), 279 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 473daec4c737..c05a0d37c727 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2236,6 +2236,9 @@ OLD_FILES+=usr/share/certs/trusted/TrustCor_ECA-1.pem OLD_FILES+=usr/share/certs/trusted/TrustCor_RootCert_CA-1.pem OLD_FILES+=usr/share/certs/trusted/TrustCor_RootCert_CA-2.pem +# 20230510: twe(4) driver removed +OLD_FILES+=usr/share/man/man4/twe.4.gz + # 20230505: md5 tests are now self-contained OLD_FILES+=usr/tests/sbin/md5/1.inp OLD_FILES+=usr/tests/sbin/md5/1.sha512-p.chk diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a7dbf6c615d6..c03ba63c349f 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -584,7 +584,6 @@ MAN= aac.4 \ tslog.4 \ tty.4 \ tun.4 \ - twe.4 \ tws.4 \ udp.4 \ udplite.4 \ diff --git a/share/man/man4/twe.4 b/share/man/man4/twe.4 deleted file mode 100644 index 03a51b7b6a50..000000000000 --- a/share/man/man4/twe.4 +++ /dev/null @@ -1,278 +0,0 @@ -.\" -.\" Copyright (c) 2000 Michael Smith -.\" Copyright (c) 2000 BSDi -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd May 7, 2023 -.Dt TWE 4 -.Os -.Sh NAME -.Nm twe -.Nd 3ware 5000/6000/7000/8000 series PATA/SATA RAID adapter driver -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device pci" -.Cd "device twe" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -twe_load="YES" -.Ed -.Sh DEPRECATION NOTICE -The -.Nm -driver is not present in -.Fx 14.0 . -.Sh DESCRIPTION -The -.Nm -driver provides support for AMCC's 3ware 5000/6000/7000/8000 series -PATA/SATA RAID adapters. -These adapters were formerly known as -.Dq 3ware Escalade . -.Pp -These devices support 2, 4, 8, or 12 ATA disk drives -and provide RAID0 (striping) and RAID1 (mirroring) functionality. -.Sh HARDWARE -The -.Nm -driver supports the following PATA/SATA RAID -controllers: -.Pp -.Bl -bullet -compact -.It -AMCC's 3ware 5000 series -.It -AMCC's 3ware 6000 series -.It -AMCC's 3ware 7000-2 -.It -AMCC's 3ware 7006-2 -.It -AMCC's 3ware 7500-4LP -.It -AMCC's 3ware 7500-8 -.It -AMCC's 3ware 7500-12 -.It -AMCC's 3ware 7506-4LP -.It -AMCC's 3ware 7506-8 -.It -AMCC's 3ware 7506-12 -.It -AMCC's 3ware 8006-2LP -.It -AMCC's 3ware 8500-4LP -.It -AMCC's 3ware 8500-8 -.It -AMCC's 3ware 8500-12 -.It -AMCC's 3ware 8506-4LP -.It -AMCC's 3ware 8506-8 -.It -AMCC's 3ware 8506-8MI -.It -AMCC's 3ware 8506-12 -.It -AMCC's 3ware 8506-12MI -.El -.Sh DIAGNOSTICS -.Ss Controller initialisation phase -.Bl -diag -.It twe%d: microcontroller not ready -.Pp -The controller's onboard CPU is not reporting that it is ready; -this may be due to either a board or system failure. -Initialisation has failed. -.It twe%d: no attention interrupt -.It twe%d: can't drain AEN queue -.It twe%d: reset not reported -.It twe%d: controller errors detected -.It twe%d: can't drain response queue -.It twe%d: reset %d failed, trying again -.Pp -The controller is not responding correctly to -the driver's attempts to reset and initialise it. -This process is retried several times. -.It twe%d: can't initialise controller, giving up -.Pp -Several attempts to reset and initialise the controller have failed; -initialisation has failed -and the driver will not attach to this controller. -.El -.Ss Driver initialisation/shutdown phase -.Bl -diag -.It twe%d: register window not available -.It twe%d: can't allocate register window -.It twe%d: can't allocate parent DMA tag -.It twe%d: can't allocate interrupt -.It twe%d: can't set up interrupt -.It twe%d: can't establish configuration hook -.Pp -A resource allocation error occurred while initialising the driver; -initialisation has failed -and the driver will not attach to this controller. -.It twe%d: can't detect attached units -.Pp -Fetching the list of attached units failed; initialisation has failed. -.It twe%d: error fetching capacity for unit %d -.It twe%d: error fetching state for unit %d -.It twe%d: error fetching descriptor size for unit %d -.It twe%d: error fetching descriptor for unit %d -.It twe%d: device_add_child failed -.It twe%d: bus_generic_attach returned %d -.Pp -Creation of the disk devices failed, either due to communication -problems with the adapter or due to resource shortage; -attachment of one or more units may have been aborted. -.El -.Ss Operational phase -.Bl -diag -.It twe%d: command completed - %s -.El -.Pp -A command was reported completed with a warning by the controller. -The warning may be one of: -.Bl -diag -.It redundant/inconsequential request ignored -.It failed to write zeroes to LBA 0 -.It failed to profile TwinStor zones -.El -.Bl -diag -.It twe%d: command failed - %s -.El -.Pp -A command was reported as failed by the controller. -The failure message may be one of: -.Bl -diag -.It aborted due to system command or reconfiguration -.It aborted -.It access error -.It access violation -.It device failure -.It controller error -.It timed out -.It invalid unit number -.It unit not available -.It undefined opcode -.It request incompatible with unit -.It invalid request -.It firmware error, reset requested -.Pp -The command will be returned to the operating system after a -fatal error. -.El -.Bl -diag -.It twe%d: command failed submission - controller wedged -.Pp -A command could not be delivered to the controller because -the controller is unresponsive. -.It twe%d: AEN: <%s> -.El -.Pp -The controller has reported a change in status using an AEN -(Asynchronous Event Notification). -The following AENs may be reported: -.Bl -diag -.It queue empty -.It soft reset -.It degraded mirror -.It controller error -.It rebuild fail -.It rebuild done -.It incomplete unit -.It initialisation done -.It unclean shutdown detected -.It drive timeout -.It drive error -.It rebuild started -.It aen queue full -.Pp -AENs are also queued internally for use by management tools. -.El -.Bl -diag -.It twe%d: error polling for signalled AENs -.Pp -The controller has reported -that one or more status messages are ready for the driver, -but attempting to fetch one of these has returned an error. -.It twe%d: AEN queue overflow, lost AEN <%s> -.Pp -A status message was retrieved from the controller, -but there is no more room to queue it in the driver. -The message is lost (but will be printed to the console). -.It twe%d: missing expected status bits %s -.It twe%d: unexpected status bits %s -.Pp -A check of the controller's status bits -indicates an unexpected condition. -.It twe%d: host interrupt -.Pp -The controller has signalled a host interrupt. -This serves an unknown purpose and is ignored. -.It twe%d: command interrupt -.Pp -The controller has signalled a command interrupt. -This is not used, and will be disabled. -.It twe%d: controller reset in progress... -.Pp -The controller is being reset by the driver. -Typically this is done when the driver has determined that the -controller is in an unrecoverable state. -.It twe%d: can't reset controller, giving up -.Pp -The driver has given up on resetting the controller. -No further I/O will be handled. -.It controller reset done, %d commands restarted -.Pp -The controller was successfully reset, -and outstanding commands were restarted. -.El -.Sh AUTHORS -.An -nosplit -The -.Nm -driver and manual page were written by -.An Michael Smith Aq Mt msmith@FreeBSD.org . -.Pp -Extensive work done on the driver by -.An Vinod Kashyap Aq Mt vkashyap@FreeBSD.org -and -.An Paul Saab Aq Mt ps@FreeBSD.org . -.Sh BUGS -The controller cannot handle I/O transfers -that are not aligned to a 512-byte boundary. -In order to support raw device access from user-space, -the driver will perform alignment fixup on non-aligned data. -This process is inefficient, -and thus in order to obtain best performance -user-space applications accessing the device -should do so with aligned buffers. From nobody Fri Jan 10 03:56:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTnrX3w0Dz5kds1; Fri, 10 Jan 2025 03:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTnrX2tRDz4Tjx; Fri, 10 Jan 2025 03:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736481372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5pktHVLP3+TTchPIRdKmSH46N+d7bDMVLBGmMFhqQo=; b=pSnNWJnHUtBM/Zj23BdGZrnMRZvCixE5Zgbme0SKHZ2YvWM2p0C5vIx7IhZSWdi+fxznNo q/eamwVAi74/WjjtcOHWUIHDtB8VGJKHhYQI0buaK6PZQw3eZSyYj6BqOVm1IxwJel+c2o 2NUb+wRpbVnHkvujwCtw6SNZUcz1LP6K3w8YHzCVsBd6CHPf76ch8DWVU4HzucxaMRcxQJ 4REXR1kGcSzZNYZmt3ScSsoR+UWz3L9lSO5SA5gr/ujUu/Vvy2kIm4oSJ2vZFeuOPObhTF TOQdlbu8dvsuHJOPKBdx56ArWA0H8dcfQxI+uPNReqXB3R93I/7EaylvoURBtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736481372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v5pktHVLP3+TTchPIRdKmSH46N+d7bDMVLBGmMFhqQo=; b=nsNXRQA+cYK7Rl9wQqZwYS4ckmE6VHX6i7ktSr0kADOUi9hr35ZCIIJ0qThm2QTaEn1+Eh a3RkIrX/uIsRBzM/iN/mzHtExig1f3NuXkJv4Bnp0tnixRYLs8dqrRlAJoFw51sqI2O0gL GUIhrMXOIaLI/U1ZlFlKW9TJF89WDRF5f6eSsxacVCYzjzpQubnMaZISLjJLhBvDVpZzg8 /p/RQhs8FH8qiIGdRwEHkKYnbz5L3dw7vwOd4e+efm5qdEV4BibCP1n8RxrSvfOnVr0Fcy ffWo1ggs9QmDbHC9lnxFym21My577Asqr/FH0TqJs6qBXOLLa/xebXrk7Dz56w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736481372; a=rsa-sha256; cv=none; b=kwPHIxD42IxW2L1aukLT/GYHN2Te4rRnGAiuQl4fkVrv6/nNnHxRJX3fLBQ01B9kjUT7lL NaazIkuX+I8io3N5mYPGSeW69fWTfOjgVffwbaQEoQJKwwmDa995hNG5PnTzVP1hYsrUs1 dlSWe6Y6mZGlMj45rShRQvgjRKIVl0KMYxQBrdXrXnIJ8FJ6PD1EVByKF+yPVZHmY7PBpO /6KuAkclgZkx0yYT9CYYYlx8xAc2QbUZO4qSp5P/izyLT3ECO6J7jE4VWczJAX0MbOZvKp DCDSS5dZQ8NlHMw/fxTK2hKgO/2UWbuZQrlkeQMZVg3jFm/UM0NPy9FGl/gSjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTnrX1FHPzwGb; Fri, 10 Jan 2025 03:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50A3uCWJ005303; Fri, 10 Jan 2025 03:56:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50A3uC7w005300; Fri, 10 Jan 2025 03:56:12 GMT (envelope-from git) Date: Fri, 10 Jan 2025 03:56:12 GMT Message-Id: <202501100356.50A3uC7w005300@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f9f0a1d61c7b - main - nfscl: Fix a crash when a readdir entry has nul in it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9f0a1d61c7b97c705246c747baec385e0592966 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f9f0a1d61c7b97c705246c747baec385e0592966 commit f9f0a1d61c7b97c705246c747baec385e0592966 Author: Rick Macklem AuthorDate: 2025-01-10 03:54:41 +0000 Commit: Rick Macklem CommitDate: 2025-01-10 03:54:41 +0000 nfscl: Fix a crash when a readdir entry has nul in it Commit 026cdaa3b3a9 added a check for a nul or "/" in a file name in a readdir reply. Unfortunately, the minimal testing done on it did not detect a bug that can cause the client to crash. This patch fixes the code so that it does not crash. Note that a NFS server will not normally return a file name in a readdir reply that has a nul or "/" in it, so the crash is unlikely. PR: 283965 Reported by: asomers Tested by: asomers MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clrpcops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index e1c02a71939b..c35d0c6295b9 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3397,6 +3397,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, nfsattrbit_t attrbits, dattrbits; u_int32_t rderr, *tl2 = NULL; size_t tresid; + bool validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3622,6 +3623,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); ncookie.lval[0] = *tl++; @@ -3701,6 +3703,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3738,7 +3741,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ncookie.lval[0] = 0; ncookie.lval[1] = *tl++; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; @@ -3875,7 +3878,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, size_t tresid; u_int32_t *tl2 = NULL, rderr; struct timespec dctime, ts; - bool attr_ok; + bool attr_ok, validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -4086,6 +4089,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); if (nd->nd_flag & ND_NFSV4) { ncookie.lval[0] = *tl++; @@ -4161,6 +4165,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -4217,7 +4222,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, goto nfsmout; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; From nobody Fri Jan 10 04:28:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTpYV5zMrz5khsP; Fri, 10 Jan 2025 04:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTpYV5MyQz4bpM; Fri, 10 Jan 2025 04:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736483294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3lraqGNcZ6m5R+7u12Iiyj4jCKh90pKsT7AnW4HqX6c=; b=KF4maAsurHNFj2QrRYueac+HXPdV0JgfD4AagvII/Hc7y6R0q8BuCkFLt6Q9BewCd9BWYv ObMdNjwcvtSCcVkWnc2UCoxkrCVZ5jWCWgmhdZ9P8wqJEt2SYDkMs6OHFx6QP6hMCOW8TP N3cogICFCHBGPKkozR3k3OME2BC53W3mL0wXE0Cfy0uORSjoC4ZTJGmnVEXR5+mj/K/+Kz ZskJUn+OOeTdGlgpRrfGObI3/REEG/AJEUOHFme71LX5Ts9MlaIHcMDqwztGuAgus6lOlS cxR2zGVKCNABHg//NGszPx+WKvlfrup1PeZ+l3uHFUeWKYbi7HLHdcXNgsnIzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736483294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3lraqGNcZ6m5R+7u12Iiyj4jCKh90pKsT7AnW4HqX6c=; b=SRqeWwmJxXYl8DDS5zcxL2wZ9j12dL5+aPkkVb7vyoavu29lMOVUHU84cM+cnbkN3w9Q5c BcjTSS2BJE5YWNcZk0G6QYZ6DTf+DodChEIMfuT/9OMG30lfHMHP2hZulH+GQQ7cAp/5pR 2iLmH8GLxk5m7e67xZvXGqEf7EsFLFf6TsiLNP6uVdMJrGrPgaVW+qbR2yx9GddwAkxQd5 cYGJXsEiLmW7eIzmVH22u1ZN6ppqOUxLgsA68YxdLSOO5+NjFq62g87+Mlhux2+e8iOxHk JEe8er3el6KdFZ+fhBOOoECPxMyYm5mLgXTNOxXPDeqfMD1+mxckzdMHp2qI+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736483294; a=rsa-sha256; cv=none; b=cS7sSwUw74LX8o1G4SpknHJsKa5iULkxLxySh9AoO2eh3ivOdY0eqmbsGKi0GC/obNItMU HhpC6Qk5hsg98US9SlWdD4MDtzKGpJXAfbIMJBJyGjhPLzZOGzpC2erotUDCcY74WZRtpv pdsEgIP4aqRY6AsK8qk+i0Fc6A+9tJ7RAw256ClcZmWO29DBLnv3n34B3CDjRnqQGLrLfo 0GQrP4TORxClsJkLvpIuRPUs2izCphnXl+dB3QY3wsJFOZyk24curjNnwel5X4sTX4xyRP u37oAiGat7DTP502ZfSYq6wo92wp0on9CjpiolkWOouUT+akuRPF0Kssdjw54Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTpYV4ymdzx1F; Fri, 10 Jan 2025 04:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50A4SE76062739; Fri, 10 Jan 2025 04:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50A4SETP062736; Fri, 10 Jan 2025 04:28:14 GMT (envelope-from git) Date: Fri, 10 Jan 2025 04:28:14 GMT Message-Id: <202501100428.50A4SETP062736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 16f0d01f9ca1 - main - arm64: apple: fix aic for !SMP configurations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16f0d01f9ca1e28bede9a493329c5d66e317d88f Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=16f0d01f9ca1e28bede9a493329c5d66e317d88f commit 16f0d01f9ca1e28bede9a493329c5d66e317d88f Author: Kyle Evans AuthorDate: 2025-01-10 04:27:50 +0000 Commit: Kyle Evans CommitDate: 2025-01-10 04:28:05 +0000 arm64: apple: fix aic for !SMP configurations Allocate sc_cpuids anyways, even if it's just a single entry, to minimize functional diff between SMP and !SMP. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D48289 --- sys/arm64/apple/apple_aic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm64/apple/apple_aic.c b/sys/arm64/apple/apple_aic.c index b500099a5430..c9ce3b4d2165 100644 --- a/sys/arm64/apple/apple_aic.c +++ b/sys/arm64/apple/apple_aic.c @@ -137,9 +137,9 @@ struct apple_aic_softc { u_int sc_ndie; #ifdef SMP struct apple_aic_irqsrc sc_ipi_srcs[AIC_NIPIS]; - u_int *sc_cpuids; /* cpu index to AIC CPU ID */ uint32_t *sc_ipimasks; #endif + u_int *sc_cpuids; /* cpu index to AIC CPU ID */ }; static u_int aic_next_cpu; @@ -215,6 +215,7 @@ apple_aic_attach(device_t dev) #ifdef SMP sc->sc_ipimasks = malloc(sizeof(*sc->sc_ipimasks) * mp_maxid + 1, M_DEVBUF, M_WAITOK | M_ZERO); +#endif sc->sc_cpuids = malloc(sizeof(*sc->sc_cpuids) * mp_maxid + 1, M_DEVBUF, M_WAITOK | M_ZERO); @@ -223,8 +224,6 @@ apple_aic_attach(device_t dev) if (bootverbose) device_printf(dev, "BSP CPU %d: whoami %x\n", cpu, sc->sc_cpuids[cpu]); -#endif - name = device_get_nameunit(dev); for (i = 0; i < sc->sc_ndie; i++) { From nobody Fri Jan 10 11:19:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YTzhG6JYkz5k7l2; Fri, 10 Jan 2025 11:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YTzhG5cwYz4PrG; Fri, 10 Jan 2025 11:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736507982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhawIocwzI2n/N99d75u/K0EkVV3zCL9tRwX50cp3eU=; b=BoIzVCNk4kcFcGCTZsBspSmN0vcVNb86bHqg8+MI0CvPbx+8SphOmuJyrfXZ2c8vjzrHfg GBkH5BcgLHy3GTA+9qFg8oVbt0mUe+AQVrNuhBDVk7S9FnVWhyqfGaGOwIWhKuPUZafFXT bH/P9pywYJeT6Ef6bBkv8TJVebfgsVqOUlPBk4CsyekCAuXjyDImrVC/yr0WtjBb7zC9vr N5FFFssU7f1swT5h7PZ1oUZaVcutcpqlM6+8aUGaCyChj69ouwXZGXB0MJWiSAf2RDsS42 ZI9AnuIppEV+XS6owAd1NL97JbUNT4zJjzpxm5TF0gLMhvumayOZCdhWxsGeeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736507982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhawIocwzI2n/N99d75u/K0EkVV3zCL9tRwX50cp3eU=; b=t+Eo5rZptUpm+1vHCIhq5JnFcr8uOchvc7RDHwn6l0Y0w9J6Sc+J4NhCHvJ8HzwAIWXf6b LoqUG/9bXhCVqmAqkBwsX5SJI96CsFt4odpuSxTzA8F/io7XIsqp8zQiWWqUQzLfVeckUl q4Kavudmvr4+lVPBgOSiIbPTAG1R6kYuTrItchntbO6vOKjDQLzHk8+j8552/+wl2r8h39 lkW67tH2tcBPqNaMhwtomv8mjJuPQ8IeZCj35kj1x+m8cXWV/Lx5K/ghimy4qNw5wjzz6+ jPMKW+JmuQVQnpX9bv5xVHqOrjt5ZAMVlyOXzozCf2vPHMxden3OSmLFAJuQtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736507982; a=rsa-sha256; cv=none; b=MwYJufTbdyrOx4yDP92/dNFQCWuyAflQzx3GEscPVqtEXyGrJG7iA9B8FdTAlQ4Y88Sjn3 Q3pRLaefahgx7G4D+q9OTUTjRj/DG/ivAwFm9b6xAqVHX2GzqDKqXS6rntNO0e5s8JeJwP 9Xt2syAxQkOr/g7FH8V2eEYSVcFgHeLV1uLgbrXnjUNWO0CkMrgvZWTNWwB7yfXXkN98tu GeZKlk1DPlU4Io9ND+ikRmsibR1TJBkAg8sG+8woRjaU4L9s4hYqKpHMmWG7cuoHD+Ndb7 aiX8YVd34GymRXPpVurduk6vm4aS7ufcRBVIEZyZHDtVnDRKpBZEoqOsKrMZhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YTzhG4csDz17w8; Fri, 10 Jan 2025 11:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50ABJgRD029287; Fri, 10 Jan 2025 11:19:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ABJgKZ029284; Fri, 10 Jan 2025 11:19:42 GMT (envelope-from git) Date: Fri, 10 Jan 2025 11:19:42 GMT Message-Id: <202501101119.50ABJgKZ029284@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: f3087bef1154 - main - Update the Arm Optimized Routine library to v25.01 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3087bef11543b42e0d69b708f367097a4118d24 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f3087bef11543b42e0d69b708f367097a4118d24 commit f3087bef11543b42e0d69b708f367097a4118d24 Merge: 16f0d01f9ca1 9d1de2593073 Author: Andrew Turner AuthorDate: 2025-01-10 11:14:39 +0000 Commit: Andrew Turner CommitDate: 2025-01-10 11:14:39 +0000 Update the Arm Optimized Routine library to v25.01 Sponsored by: Arm Ltd contrib/arm-optimized-routines/MAINTAINERS | 9 +- contrib/arm-optimized-routines/Makefile | 16 +- contrib/arm-optimized-routines/README | 33 +- contrib/arm-optimized-routines/config.mk.dist | 99 +- contrib/arm-optimized-routines/math/Dir.mk | 253 +++- .../math/README.contributors | 5 +- .../v_acos_2u.c => math/aarch64/advsimd/acos.c} | 30 +- .../v_acosf_1u4.c => math/aarch64/advsimd/acosf.c} | 32 +- .../v_acosh_3u5.c => math/aarch64/advsimd/acosh.c} | 27 +- .../aarch64/advsimd/acoshf.c} | 62 +- .../v_asin_3u.c => math/aarch64/advsimd/asin.c} | 75 +- .../v_asinf_2u5.c => math/aarch64/advsimd/asinf.c} | 30 +- .../math/aarch64/advsimd/asinh.c | 242 +++ .../math/aarch64/advsimd/asinhf.c | 89 ++ .../v_atan_2u5.c => math/aarch64/advsimd/atan.c} | 85 +- .../math/aarch64/advsimd/atan2.c | 171 +++ .../aarch64/advsimd/atan2f.c} | 84 +- .../v_atanf_3u.c => math/aarch64/advsimd/atanf.c} | 26 +- .../v_atanh_3u5.c => math/aarch64/advsimd/atanh.c} | 45 +- .../aarch64/advsimd/atanhf.c} | 49 +- .../v_cbrt_2u.c => math/aarch64/advsimd/cbrt.c} | 43 +- .../v_cbrtf_1u7.c => math/aarch64/advsimd/cbrtf.c} | 19 +- .../v_cexpi_3u5.c => math/aarch64/advsimd/cexpi.c} | 14 +- .../aarch64/advsimd/cexpif.c} | 14 +- .../math/aarch64/{v_cos.c => advsimd/cos.c} | 21 +- .../math/aarch64/{v_cosf.c => advsimd/cosf.c} | 23 +- .../v_cosh_2u.c => math/aarch64/advsimd/cosh.c} | 25 +- .../v_coshf_2u4.c => math/aarch64/advsimd/coshf.c} | 52 +- .../v_cospi_3u1.c => math/aarch64/advsimd/cospi.c} | 25 +- .../aarch64/advsimd/cospif.c} | 29 +- .../v_erf_2u5.c => math/aarch64/advsimd/erf.c} | 48 +- .../v_erfc_1u8.c => math/aarch64/advsimd/erfc.c} | 65 +- .../v_erfcf_1u7.c => math/aarch64/advsimd/erfcf.c} | 54 +- .../v_erff_2u.c => math/aarch64/advsimd/erff.c} | 34 +- .../math/aarch64/{v_exp.c => advsimd/exp.c} | 11 +- .../v_exp10_2u.c => math/aarch64/advsimd/exp10.c} | 23 +- .../aarch64/advsimd/exp10f.c} | 87 +- .../v_exp2_2u.c => math/aarch64/advsimd/exp2.c} | 28 +- .../math/aarch64/{v_exp2f.c => advsimd/exp2f.c} | 69 +- .../math/aarch64/advsimd/exp2f_1u.c | 73 + .../math/aarch64/{v_expf.c => advsimd/expf.c} | 72 +- .../math/aarch64/advsimd/expf_1u.c | 79 + .../math/aarch64/advsimd/expm1.c | 77 + .../math/aarch64/advsimd/expm1f.c | 82 ++ .../{pl/math => math/aarch64/advsimd}/finite_pow.h | 22 +- .../v_hypot_1u5.c => math/aarch64/advsimd/hypot.c} | 30 +- .../aarch64/advsimd/hypotf.c} | 36 +- .../math/aarch64/advsimd/log.c | 118 ++ .../math/aarch64/advsimd/log10.c | 132 ++ .../math/aarch64/advsimd/log10f.c | 106 ++ .../math/aarch64/advsimd/log1p.c | 61 + .../math/aarch64/advsimd/log1pf.c | 92 ++ .../math/aarch64/advsimd/log2.c | 123 ++ .../math/aarch64/advsimd/log2f.c | 102 ++ .../math/aarch64/advsimd/logf.c | 88 ++ .../math/aarch64/advsimd/modf.c | 33 + .../math/aarch64/advsimd/modff.c | 34 + .../v_pow_1u5.c => math/aarch64/advsimd/pow.c} | 195 +-- .../math/aarch64/advsimd/powf.c | 209 +++ .../math/aarch64/{v_sin.c => advsimd/sin.c} | 26 +- .../aarch64/advsimd/sincos.c} | 30 +- .../aarch64/advsimd/sincosf.c} | 30 +- .../math/aarch64/advsimd/sincospi.c | 44 + .../math/aarch64/advsimd/sincospif.c | 43 + .../math/aarch64/{v_sinf.c => advsimd/sinf.c} | 36 +- .../math/aarch64/advsimd/sinh.c | 80 + .../v_sinhf_2u3.c => math/aarch64/advsimd/sinhf.c} | 46 +- .../v_sinpi_3u1.c => math/aarch64/advsimd/sinpi.c} | 25 +- .../aarch64/advsimd/sinpif.c} | 29 +- .../v_tan_3u5.c => math/aarch64/advsimd/tan.c} | 28 +- .../v_tanf_3u5.c => math/aarch64/advsimd/tanf.c} | 35 +- .../math/aarch64/advsimd/tanh.c | 67 + .../v_tanhf_2u6.c => math/aarch64/advsimd/tanhf.c} | 44 +- .../math/aarch64/advsimd/tanpi.c | 88 ++ .../math/aarch64/advsimd/tanpif.c | 70 + .../math/aarch64/advsimd/v_expf_inline.h | 58 + .../math/aarch64/advsimd/v_expm1_inline.h | 86 ++ .../math/aarch64/advsimd/v_expm1f_inline.h | 62 + .../math/aarch64/advsimd/v_log1p_inline.h | 119 ++ .../math/aarch64/advsimd/v_log1pf_inline.h | 94 ++ .../math => math/aarch64/advsimd}/v_log_inline.h | 6 +- .../{pl/math => math/aarch64/advsimd}/v_math.h | 91 +- .../aarch64/advsimd/v_poly_f32.h} | 6 +- .../aarch64/advsimd/v_poly_f64.h} | 6 +- .../aarch64/advsimd}/v_sincos_common.h | 4 +- .../aarch64/advsimd}/v_sincosf_common.h | 2 +- .../math/aarch64/advsimd/v_sincospi_common.h | 64 + .../math/aarch64/advsimd/v_sincospif_common.h | 57 + .../math/cospi_3u1.c => math/aarch64/cospi_3u5.c} | 31 +- .../{pl/math => math/aarch64}/cospif_2u6.c | 31 +- .../aarch64/experimental}/README.contributors | 7 - .../math => math/aarch64/experimental}/acos_2u.c | 44 +- .../math => math/aarch64/experimental}/acosf_1u4.c | 40 +- .../math => math/aarch64/experimental}/acosh_3u.c | 35 +- .../aarch64/experimental}/acoshf_2u8.c | 32 +- .../aarch64/experimental/advsimd/erfinv_25u.c} | 35 +- .../aarch64/experimental/advsimd/erfinvf_5u.c} | 49 +- .../aarch64/experimental/advsimd}/v_logf_inline.h | 2 +- .../math => math/aarch64/experimental}/asin_3u.c | 40 +- .../math => math/aarch64/experimental}/asin_data.c | 2 +- .../math => math/aarch64/experimental}/asinf_2u5.c | 36 +- .../aarch64/experimental}/asinf_data.c | 2 +- .../math => math/aarch64/experimental}/asinh_2u5.c | 33 +- .../aarch64/experimental}/asinh_data.c | 17 +- .../aarch64/experimental}/asinhf_3u5.c | 25 +- .../math/aarch64/experimental/asinhf_data.c | 15 + .../math => math/aarch64/experimental}/atan2_2u5.c | 24 +- .../math => math/aarch64/experimental}/atan2f_3u.c | 24 +- .../math => math/aarch64/experimental}/atan_2u5.c | 22 +- .../aarch64/experimental}/atan_common.h | 2 +- .../math/aarch64/experimental/atan_data.c | 23 + .../math => math/aarch64/experimental}/atanf_2u9.c | 18 +- .../aarch64/experimental}/atanf_common.h | 2 +- .../math/aarch64/experimental/atanf_data.c | 17 + .../math => math/aarch64/experimental}/atanh_3u.c | 18 +- .../aarch64/experimental}/atanhf_3u1.c | 16 +- .../math => math/aarch64/experimental}/cbrt_2u.c | 16 +- .../math => math/aarch64/experimental}/cbrt_data.c | 2 +- .../math => math/aarch64/experimental}/cbrtf_1u5.c | 16 +- .../aarch64/experimental}/cbrtf_data.c | 2 +- .../math => math/aarch64/experimental}/cosh_2u.c | 34 +- .../math => math/aarch64/experimental}/coshf_1u9.c | 29 +- .../math => math/aarch64/experimental}/erf_2u5.c | 21 +- .../math => math/aarch64/experimental}/erfc_1u8.c | 26 +- .../math => math/aarch64/experimental}/erfcf_1u7.c | 24 +- .../math => math/aarch64/experimental}/erff_2u.c | 21 +- .../aarch64/experimental}/erfinv_24u5.c | 20 +- .../aarch64/experimental}/erfinvf_4u7.c | 16 +- .../math => math/aarch64/experimental}/erfinvl.c | 2 +- .../aarch64/experimental/exp_inline.h} | 22 +- .../math => math/aarch64/experimental}/expf_data.c | 4 +- .../math => math/aarch64/experimental}/expm1_2u5.c | 20 +- .../math/aarch64/experimental/expm1_data.c | 21 + .../aarch64/experimental}/expm1f_1u6.c | 24 +- .../aarch64/experimental}/expm1f_data.c | 6 +- .../math => math/aarch64/experimental}/log10_2u.c | 33 +- .../aarch64/experimental}/log10_data.c | 4 +- .../math => math/aarch64/experimental}/log1p_2u.c | 20 +- .../math/aarch64/experimental/log1p_data.c | 20 + .../aarch64/experimental}/log1pf_2u1.c | 18 +- .../aarch64/experimental}/log1pf_data.c | 8 +- .../math => math/aarch64/experimental}/sinh_3u.c | 27 +- .../math => math/aarch64/experimental}/sinhf_2u3.c | 32 +- .../math/aarch64/experimental/sve/erfinv_25u.c | 156 ++ .../math/aarch64/experimental/sve/erfinvf_5u.c | 156 ++ .../aarch64/experimental/sve/powi.c} | 3 +- .../aarch64/experimental/sve/powif.c} | 3 +- .../math/aarch64/experimental/sve/sv_logf_inline.h | 51 + .../math => math/aarch64/experimental}/tanf_3u3.c | 42 +- .../math => math/aarch64/experimental}/tanf_data.c | 2 +- .../math => math/aarch64/experimental}/tanh_3u.c | 22 +- .../math => math/aarch64/experimental}/tanhf_2u6.c | 25 +- .../math/aarch64/sincospi_4u.c | 158 ++ .../math/aarch64/sincospif_3u2.c | 145 ++ .../math/sinpi_3u.c => math/aarch64/sinpi_3u5.c} | 39 +- .../{pl/math => math/aarch64}/sinpif_2u5.c | 35 +- .../math/sv_acos_2u.c => math/aarch64/sve/acos.c} | 24 +- .../sv_acosf_1u4.c => math/aarch64/sve/acosf.c} | 24 +- .../math/aarch64/sve/acosh.c | 51 + .../math/aarch64/sve/acoshf.c | 51 + .../math/sv_asin_3u.c => math/aarch64/sve/asin.c} | 28 +- .../sv_asinf_2u5.c => math/aarch64/sve/asinf.c} | 24 +- .../math/aarch64/sve/asinh.c | 197 +++ .../sv_asinhf_2u5.c => math/aarch64/sve/asinhf.c} | 38 +- .../math/sv_atan_2u5.c => math/aarch64/sve/atan.c} | 22 +- .../sv_atan2_2u5.c => math/aarch64/sve/atan2.c} | 54 +- .../sv_atan2f_3u.c => math/aarch64/sve/atan2f.c} | 55 +- .../sv_atanf_2u9.c => math/aarch64/sve/atanf.c} | 22 +- .../sv_atanh_3u3.c => math/aarch64/sve/atanh.c} | 24 +- .../sv_atanhf_2u8.c => math/aarch64/sve/atanhf.c} | 33 +- .../math/sv_cbrt_2u.c => math/aarch64/sve/cbrt.c} | 35 +- .../sv_cbrtf_1u7.c => math/aarch64/sve/cbrtf.c} | 16 +- .../sv_cexpi_3u5.c => math/aarch64/sve/cexpi.c} | 17 +- .../sv_cexpif_1u8.c => math/aarch64/sve/cexpif.c} | 17 +- .../math/sv_cos_2u5.c => math/aarch64/sve/cos.c} | 16 +- .../math/sv_cosf_2u1.c => math/aarch64/sve/cosf.c} | 16 +- .../math/sv_cosh_2u.c => math/aarch64/sve/cosh.c} | 34 +- .../math/aarch64/sve/coshf.c | 62 + .../sv_cospi_3u2.c => math/aarch64/sve/cospi.c} | 25 +- .../sv_cospif_2u6.c => math/aarch64/sve/cospif.c} | 25 +- .../math/sv_erf_2u5.c => math/aarch64/sve/erf.c} | 28 +- .../math/sv_erfc_1u8.c => math/aarch64/sve/erfc.c} | 24 +- .../sv_erfcf_1u7.c => math/aarch64/sve/erfcf.c} | 36 +- .../math/sv_erff_2u.c => math/aarch64/sve/erff.c} | 33 +- .../math/sv_exp_1u5.c => math/aarch64/sve/exp.c} | 56 +- .../sv_exp10_1u5.c => math/aarch64/sve/exp10.c} | 43 +- .../math/aarch64/sve/exp10f.c | 101 ++ .../math/sv_exp2_2u.c => math/aarch64/sve/exp2.c} | 44 +- .../math/aarch64/sve/exp2f.c | 83 ++ .../arm-optimized-routines/math/aarch64/sve/expf.c | 50 + .../sv_expm1_2u5.c => math/aarch64/sve/expm1.c} | 20 +- .../sv_expm1f_1u6.c => math/aarch64/sve/expm1f.c} | 46 +- .../sv_hypot_1u5.c => math/aarch64/sve/hypot.c} | 20 +- .../sv_hypotf_1u5.c => math/aarch64/sve/hypotf.c} | 20 +- .../arm-optimized-routines/math/aarch64/sve/log.c | 97 ++ .../math/aarch64/sve/log10.c | 101 ++ .../sv_log10f_3u5.c => math/aarch64/sve/log10f.c} | 65 +- .../sv_log1p_2u5.c => math/aarch64/sve/log1p.c} | 24 +- .../math/aarch64/sve/log1pf.c | 43 + .../arm-optimized-routines/math/aarch64/sve/log2.c | 96 ++ .../sv_log2f_2u5.c => math/aarch64/sve/log2f.c} | 62 +- .../math/sv_logf_3u4.c => math/aarch64/sve/logf.c} | 64 +- .../arm-optimized-routines/math/aarch64/sve/modf.c | 36 + .../math/aarch64/sve/modff.c | 36 + .../math/sv_pow_1u5.c => math/aarch64/sve/pow.c} | 295 ++-- .../math/sv_powf_2u6.c => math/aarch64/sve/powf.c} | 157 +- .../math/sv_sin_3u5.c => math/aarch64/sve/sin.c} | 16 +- .../sv_sincos_3u5.c => math/aarch64/sve/sincos.c} | 36 +- .../aarch64/sve/sincosf.c} | 36 +- .../math/aarch64/sve/sincospi.c | 47 + .../math/aarch64/sve/sincospif.c | 46 + .../math/sv_sinf_1u9.c => math/aarch64/sve/sinf.c} | 16 +- .../math/sv_sinh_3u.c => math/aarch64/sve/sinh.c} | 20 +- .../sv_sinhf_2u3.c => math/aarch64/sve/sinhf.c} | 21 +- .../sv_sinpi_3u1.c => math/aarch64/sve/sinpi.c} | 33 +- .../sv_sinpif_2u5.c => math/aarch64/sve/sinpif.c} | 33 +- .../math/aarch64/sve/sv_expf_inline.h | 66 + .../math => math/aarch64/sve}/sv_expm1f_inline.h | 36 +- .../math => math/aarch64/sve}/sv_log1p_inline.h | 14 +- .../math/aarch64/sve/sv_log1pf_inline.h | 83 ++ .../math/aarch64/sve/sv_log_inline.h | 83 ++ .../{pl/math => math/aarch64/sve}/sv_math.h | 32 +- .../aarch64/sve/sv_poly_f32.h} | 8 +- .../aarch64/sve/sv_poly_f64.h} | 8 +- .../aarch64/sve/sv_poly_generic.h} | 32 +- .../math => math/aarch64/sve}/sv_sincos_common.h | 4 +- .../math => math/aarch64/sve}/sv_sincosf_common.h | 2 +- .../math/aarch64/sve/sv_sincospi_common.h | 76 + .../math/aarch64/sve/sv_sincospif_common.h | 82 ++ .../arm-optimized-routines/math/aarch64/sve/tan.c | 131 ++ .../math/sv_tanf_3u5.c => math/aarch64/sve/tanf.c} | 46 +- .../math/sv_tanh_3u.c => math/aarch64/sve/tanh.c} | 20 +- .../math/aarch64/sve/tanhf.c | 68 + .../math/aarch64/sve/tanpi.c | 89 ++ .../math/aarch64/sve/tanpif.c | 68 + .../math/aarch64/tanpi_2u5.c | 158 ++ .../math/aarch64/tanpif_3u1.c | 145 ++ .../math/erf_data.c => math/aarch64/v_erf_data.c} | 10 +- .../erfc_data.c => math/aarch64/v_erfc_data.c} | 10 +- .../erfcf_data.c => math/aarch64/v_erfcf_data.c} | 10 +- .../erff_data.c => math/aarch64/v_erff_data.c} | 10 +- .../math/aarch64/v_exp2f_1u.c | 72 - .../math/aarch64/v_exp_data.c | 99 +- .../{pl/math => math/aarch64}/v_exp_tail_data.c | 4 +- .../math/aarch64/v_expf_1u.c | 77 - .../arm-optimized-routines/math/aarch64/v_log.c | 100 -- .../{pl/math => math/aarch64}/v_log10_data.c | 2 +- .../{pl/math => math/aarch64}/v_log2_data.c | 2 +- .../math/aarch64/v_log_data.c | 25 +- .../arm-optimized-routines/math/aarch64/v_logf.c | 74 - .../arm-optimized-routines/math/aarch64/v_math.h | 135 -- .../arm-optimized-routines/math/aarch64/v_pow.c | 22 - .../{pl/math => math/aarch64}/v_pow_exp_data.c | 2 +- .../{pl/math => math/aarch64}/v_pow_log_data.c | 2 +- .../arm-optimized-routines/math/aarch64/v_powf.c | 148 -- .../{pl/math => math/aarch64}/v_powf_data.c | 2 +- contrib/arm-optimized-routines/math/cosf.c | 10 +- contrib/arm-optimized-routines/math/erf.c | 12 +- contrib/arm-optimized-routines/math/erff.c | 12 +- contrib/arm-optimized-routines/math/exp.c | 25 +- contrib/arm-optimized-routines/math/exp10.c | 22 +- contrib/arm-optimized-routines/math/exp2.c | 11 +- contrib/arm-optimized-routines/math/exp2f.c | 10 +- contrib/arm-optimized-routines/math/expf.c | 10 +- .../arm-optimized-routines/math/include/mathlib.h | 294 +++- .../math/include/test_defs.h | 21 + .../arm-optimized-routines/math/include/test_sig.h | 47 + contrib/arm-optimized-routines/math/log.c | 11 +- .../arm-optimized-routines/{pl => }/math/log10f.c | 24 +- contrib/arm-optimized-routines/math/log2.c | 11 +- contrib/arm-optimized-routines/math/log2f.c | 11 +- contrib/arm-optimized-routines/math/logf.c | 11 +- contrib/arm-optimized-routines/math/logf_data.c | 3 +- contrib/arm-optimized-routines/math/math_config.h | 261 +++- .../{pl => }/math/poly_generic.h | 2 +- .../{pl => }/math/poly_scalar_f32.h | 6 +- .../{pl => }/math/poly_scalar_f64.h | 6 +- contrib/arm-optimized-routines/math/pow.c | 22 +- contrib/arm-optimized-routines/math/powf.c | 12 +- contrib/arm-optimized-routines/math/sincosf.c | 12 +- contrib/arm-optimized-routines/math/sincosf.h | 5 +- contrib/arm-optimized-routines/math/sinf.c | 10 +- .../arm-optimized-routines/math/test/mathbench.c | 229 ++- .../math/test/mathbench_funcs.h | 141 +- .../math/test/mathbench_wrappers.h | 302 +++- .../arm-optimized-routines/math/test/mathtest.c | 12 +- .../math/test/rtest/dotest.c | 45 +- contrib/arm-optimized-routines/math/test/runulp.sh | 311 +--- .../arm-optimized-routines/math/test/test_defs.h | 31 + .../{pl => }/math/test/testcases/directed/acos.tst | 2 +- .../math/test/testcases/directed/acosf.tst | 2 +- .../math/test/testcases/directed/acosh.tst | 2 +- .../math/test/testcases/directed/acoshf.tst | 2 +- .../{pl => }/math/test/testcases/directed/asin.tst | 2 +- .../math/test/testcases/directed/asinf.tst | 2 +- .../math/test/testcases/directed/asinh.tst | 2 +- .../math/test/testcases/directed/asinhf.tst | 2 +- .../{pl => }/math/test/testcases/directed/atan.tst | 2 +- .../math/test/testcases/directed/atan2.tst | 2 +- .../math/test/testcases/directed/atan2f.tst | 2 +- .../math/test/testcases/directed/atanf.tst | 2 +- .../math/test/testcases/directed/atanh.tst | 2 +- .../math/test/testcases/directed/atanhf.tst | 2 +- .../math/test/testcases/directed/cbrtf.tst | 2 +- .../{pl => }/math/test/testcases/directed/cosh.tst | 2 +- .../math/test/testcases/directed/coshf.tst | 2 +- .../{pl => }/math/test/testcases/directed/erfc.tst | 2 +- .../math/test/testcases/directed/erfcf.tst | 2 +- .../math/test/testcases/directed/expm1.tst | 2 +- .../math/test/testcases/directed/expm1f.tst | 2 +- .../math/test/testcases/directed/log10.tst | 2 +- .../math/test/testcases/directed/log10f.tst | 2 +- .../math/test/testcases/directed/log1p.tst | 2 +- .../math/test/testcases/directed/log1pf.tst | 2 +- .../{pl => }/math/test/testcases/directed/sinh.tst | 2 +- .../math/test/testcases/directed/sinhf.tst | 2 +- .../{pl => }/math/test/testcases/directed/tanf.tst | 2 +- .../{pl => }/math/test/testcases/directed/tanh.tst | 2 +- .../math/test/testcases/directed/tanhf.tst | 2 +- .../math/test/trigpi_references.h | 106 ++ contrib/arm-optimized-routines/math/test/ulp.c | 328 +++-- contrib/arm-optimized-routines/math/test/ulp.h | 41 +- .../arm-optimized-routines/math/test/ulp_funcs.h | 119 +- .../math/test/ulp_wrappers.h | 418 +++++- contrib/arm-optimized-routines/math/tgamma128.c | 2 + .../{pl => }/math/tools/asin.sollya | 2 +- .../{pl => }/math/tools/asinf.sollya | 2 +- .../{pl => }/math/tools/asinh.sollya | 2 +- .../{pl => }/math/tools/asinhf.sollya | 2 +- .../{pl => }/math/tools/atan.sollya | 2 +- .../{pl => }/math/tools/atanf.sollya | 2 +- .../{pl => }/math/tools/cbrt.sollya | 2 +- .../{pl => }/math/tools/cbrtf.sollya | 2 +- .../{pl => }/math/tools/erf.sollya | 2 +- .../{pl => }/math/tools/erfc.sollya | 2 +- .../{pl => }/math/tools/erfcf.sollya | 2 +- .../{pl => }/math/tools/erff.sollya | 2 +- .../{pl => }/math/tools/exp10.sollya | 2 +- .../{pl => }/math/tools/expm1.sollya | 2 +- .../{pl => }/math/tools/expm1f.sollya | 2 +- .../{pl => }/math/tools/log10.sollya | 2 +- .../{pl => }/math/tools/log10f.sollya | 2 +- .../{pl => }/math/tools/log1p.sollya | 2 +- .../{pl => }/math/tools/log1pf.sollya | 2 +- .../{pl => }/math/tools/sincos.sollya | 4 +- .../{pl => }/math/tools/sincosf.sollya | 2 +- .../{pl => }/math/tools/sinpi.sollya | 2 +- .../{pl => }/math/tools/tan.sollya | 2 +- .../{pl => }/math/tools/tanf.sollya | 2 +- .../arm-optimized-routines/math/tools/tanpi.sollya | 48 + .../{pl => }/math/tools/v_erf.sollya | 2 +- .../{pl => }/math/tools/v_erfc.sollya | 2 +- .../{pl => }/math/tools/v_log10.sollya | 2 +- .../{pl => }/math/tools/v_log10f.sollya | 2 +- .../{pl => }/math/tools/v_log2f.sollya | 2 +- contrib/arm-optimized-routines/networking/Dir.mk | 6 +- contrib/arm-optimized-routines/pl/Dir.mk | 21 - contrib/arm-optimized-routines/pl/math/Dir.mk | 216 --- .../arm-optimized-routines/pl/math/asinhf_data.c | 15 - contrib/arm-optimized-routines/pl/math/atan_data.c | 20 - .../arm-optimized-routines/pl/math/atanf_data.c | 15 - contrib/arm-optimized-routines/pl/math/exp_data.c | 1120 -------------- contrib/arm-optimized-routines/pl/math/expf.c | 76 - .../arm-optimized-routines/pl/math/expm1_data.c | 21 - .../pl/math/include/mathlib.h | 206 --- .../pl/math/include/pl_test.h | 24 - contrib/arm-optimized-routines/pl/math/log.c | 161 -- .../arm-optimized-routines/pl/math/log1p_data.c | 19 - contrib/arm-optimized-routines/pl/math/log_data.c | 511 ------- contrib/arm-optimized-routines/pl/math/logf.c | 75 - contrib/arm-optimized-routines/pl/math/logf_data.c | 36 - .../arm-optimized-routines/pl/math/math_config.h | 624 -------- contrib/arm-optimized-routines/pl/math/math_err.c | 78 - contrib/arm-optimized-routines/pl/math/math_errf.c | 78 - contrib/arm-optimized-routines/pl/math/pl_sig.h | 59 - .../arm-optimized-routines/pl/math/sv_acosh_3u5.c | 50 - .../arm-optimized-routines/pl/math/sv_acoshf_2u8.c | 47 - .../arm-optimized-routines/pl/math/sv_asinh_3u0.c | 129 -- .../arm-optimized-routines/pl/math/sv_coshf_2u.c | 56 - .../arm-optimized-routines/pl/math/sv_erf_data.c | 1558 -------------------- .../arm-optimized-routines/pl/math/sv_erff_data.c | 1046 ------------- .../arm-optimized-routines/pl/math/sv_exp10f_1u5.c | 87 -- .../arm-optimized-routines/pl/math/sv_exp2f_1u6.c | 80 - .../arm-optimized-routines/pl/math/sv_expf_2u.c | 86 -- .../pl/math/sv_expf_inline.h | 66 - .../arm-optimized-routines/pl/math/sv_log10_2u5.c | 75 - .../arm-optimized-routines/pl/math/sv_log1pf_1u3.c | 97 -- .../pl/math/sv_log1pf_inline.h | 65 - .../arm-optimized-routines/pl/math/sv_log2_3u.c | 73 - .../arm-optimized-routines/pl/math/sv_log_2u5.c | 76 - .../arm-optimized-routines/pl/math/sv_tan_3u5.c | 99 -- .../arm-optimized-routines/pl/math/sv_tanhf_2u6.c | 59 - .../pl/math/test/mathbench_funcs.h | 87 -- .../pl/math/test/mathbench_wrappers.h | 206 --- .../arm-optimized-routines/pl/math/test/pl_test.h | 39 - .../arm-optimized-routines/pl/math/test/runulp.sh | 78 - .../pl/math/test/testcases/directed/erff.tst | 17 - .../pl/math/test/testcases/directed/log2.tst | 21 - .../pl/math/test/testcases/directed/log2f.tst | 27 - .../pl/math/test/testcases/random/double.tst | 6 - .../pl/math/test/testcases/random/float.tst | 8 - .../pl/math/test/ulp_funcs.h | 70 - .../pl/math/test/ulp_wrappers.h | 140 -- .../pl/math/trigpi_references.c | 57 - .../arm-optimized-routines/pl/math/v_asinh_3u5.c | 175 --- .../arm-optimized-routines/pl/math/v_asinhf_2u7.c | 80 - .../arm-optimized-routines/pl/math/v_atan2_3u.c | 121 -- .../arm-optimized-routines/pl/math/v_exp_data.c | 55 - .../arm-optimized-routines/pl/math/v_exp_tail.h | 21 - .../pl/math/v_exp_tail_inline.h | 102 -- .../arm-optimized-routines/pl/math/v_expf_inline.h | 60 - .../arm-optimized-routines/pl/math/v_expm1_2u5.c | 118 -- .../arm-optimized-routines/pl/math/v_expm1f_1u6.c | 117 -- .../pl/math/v_expm1f_inline.h | 63 - .../arm-optimized-routines/pl/math/v_log10_2u5.c | 120 -- .../arm-optimized-routines/pl/math/v_log10f_3u5.c | 82 -- .../arm-optimized-routines/pl/math/v_log1p_2u5.c | 128 -- .../pl/math/v_log1p_inline.h | 91 -- .../arm-optimized-routines/pl/math/v_log1pf_2u1.c | 126 -- .../pl/math/v_log1pf_inline.h | 67 - contrib/arm-optimized-routines/pl/math/v_log2_3u.c | 109 -- .../arm-optimized-routines/pl/math/v_log2f_2u5.c | 77 - .../arm-optimized-routines/pl/math/v_log_data.c | 161 -- contrib/arm-optimized-routines/pl/math/v_sinh_3u.c | 118 -- contrib/arm-optimized-routines/pl/math/v_tanh_3u.c | 106 -- contrib/arm-optimized-routines/string/Dir.mk | 9 +- .../string/aarch64/__mtag_tag_region.S | 3 - .../string/aarch64/__mtag_tag_zero_region.S | 3 - .../string/aarch64/asmdefs.h | 37 - .../string/aarch64/{ => experimental}/memchr-sve.S | 8 +- .../string/aarch64/{ => experimental}/memcmp-sve.S | 9 +- .../string/aarch64/{ => experimental}/stpcpy-sve.S | 0 .../string/aarch64/{ => experimental}/strchr-sve.S | 7 +- .../aarch64/{ => experimental}/strchrnul-sve.S | 0 .../string/aarch64/{ => experimental}/strcmp-sve.S | 8 +- .../string/aarch64/{ => experimental}/strcpy-sve.S | 8 +- .../string/aarch64/{ => experimental}/strlen-sve.S | 7 +- .../aarch64/{ => experimental}/strncmp-sve.S | 9 +- .../aarch64/{ => experimental}/strnlen-sve.S | 8 +- .../aarch64/{ => experimental}/strrchr-sve.S | 7 +- .../string/aarch64/memchr-mte.S | 2 - .../arm-optimized-routines/string/aarch64/memchr.S | 2 - .../arm-optimized-routines/string/aarch64/memcmp.S | 4 - .../string/aarch64/memcpy-advsimd.S | 3 - .../string/aarch64/memcpy-mops.S | 4 - .../string/aarch64/memcpy-sve.S | 8 - .../arm-optimized-routines/string/aarch64/memcpy.S | 3 - .../string/aarch64/memmove-mops.S | 4 - .../string/aarch64/memrchr.S | 1 - .../string/aarch64/memset-mops.S | 3 - .../string/aarch64/memset-sve.S | 114 ++ .../arm-optimized-routines/string/aarch64/memset.S | 104 +- .../string/aarch64/strchr-mte.S | 1 - .../arm-optimized-routines/string/aarch64/strchr.S | 1 - .../string/aarch64/strchrnul-mte.S | 1 - .../string/aarch64/strchrnul.S | 1 - .../arm-optimized-routines/string/aarch64/strcmp.S | 2 - .../arm-optimized-routines/string/aarch64/strcpy.S | 2 - .../string/aarch64/strlen-mte.S | 38 +- .../arm-optimized-routines/string/aarch64/strlen.S | 1 - .../string/aarch64/strncmp.S | 3 - .../string/aarch64/strnlen.S | 2 - .../string/aarch64/strrchr-mte.S | 1 - .../string/aarch64/strrchr.S | 1 - .../arm-optimized-routines/string/bench/memcpy.c | 239 ++- .../arm-optimized-routines/string/bench/memset.c | 141 +- .../arm-optimized-routines/string/bench/strlen.c | 206 +-- .../string/include/benchlib.h | 31 + .../string/include/stringlib.h | 3 +- .../arm-optimized-routines/string/test/memcpy.c | 2 - .../arm-optimized-routines/string/test/memmove.c | 2 - .../arm-optimized-routines/string/test/memset.c | 3 + 472 files changed, 11852 insertions(+), 14525 deletions(-) diff --cc contrib/arm-optimized-routines/MAINTAINERS index 6c5823a8dbce,000000000000..06cceb8f2501 mode 100644,000000..100644 --- a/contrib/arm-optimized-routines/MAINTAINERS +++ b/contrib/arm-optimized-routines/MAINTAINERS @@@ -1,12 -1,0 +1,9 @@@ +/ - Szabolcs Nagy ++ Tamar Christina +math/ - Szabolcs Nagy - networking/ - Szabolcs Nagy - pl/ + Pierre Blanchard + Joe Ramsay ++networking/ ++ Ola Liljedahl +string/ - Szabolcs Nagy + Wilco Dijkstra diff --cc contrib/arm-optimized-routines/Makefile index c487896728c2,000000000000..e7503dbd2f60 mode 100644,000000..100644 --- a/contrib/arm-optimized-routines/Makefile +++ b/contrib/arm-optimized-routines/Makefile @@@ -1,92 -1,0 +1,100 @@@ +# Makefile - requires GNU make +# - # Copyright (c) 2018-2022, Arm Limited. ++# Copyright (c) 2018-2024, Arm Limited. +# SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + +srcdir = . +prefix = /usr +bindir = $(prefix)/bin +libdir = $(prefix)/lib +includedir = $(prefix)/include + +# Configure these in config.mk, do not make changes in this file. +SUBS = math string networking - PLSUBS = math +HOST_CC = cc +HOST_CFLAGS = -std=c99 -O2 +HOST_LDFLAGS = +HOST_LDLIBS = +EMULATOR = +CPPFLAGS = +CFLAGS = -std=c99 -O2 +CFLAGS_SHARED = -fPIC +CFLAGS_ALL = -Ibuild/include $(CPPFLAGS) $(CFLAGS) - CFLAGS_PL = -Ibuild/pl/include $(CPPFLAGS) $(CFLAGS) -DPL +LDFLAGS = +LDLIBS = +AR = $(CROSS_COMPILE)ar +RANLIB = $(CROSS_COMPILE)ranlib +INSTALL = install ++# Detect OS. ++# Assume Unix environment: Linux, Darwin, or Msys. ++OS := $(shell uname -s) ++OS := $(patsubst MSYS%,Msys,$(OS)) ++# Following math dependencies can be adjusted in config file ++# if necessary, e.g. for Msys. ++libm-libs = -lm ++libc-libs = -lc ++mpfr-libs = -lmpfr ++gmp-libs = -lgmp ++mpc-libs = -lmpc + +all: + +-include config.mk + +$(foreach sub,$(SUBS),$(eval include $(srcdir)/$(sub)/Dir.mk)) + +# Required targets of subproject foo: +# all-foo +# check-foo +# clean-foo +# install-foo +# Required make variables of subproject foo: +# foo-files: Built files (all in build/). +# Make variables used by subproject foo: +# foo-...: Variables defined in foo/Dir.mk or by config.mk. + +all: $(SUBS:%=all-%) + +ALL_FILES = $(foreach sub,$(SUBS),$($(sub)-files)) +DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_FILES)))) +$(ALL_FILES): | $(DIRS) +$(DIRS): + mkdir -p $@ + +$(filter %.os,$(ALL_FILES)): CFLAGS_ALL += $(CFLAGS_SHARED) - $(filter %.os,$(ALL_FILES)): CFLAGS_PL += $(CFLAGS_SHARED) + +build/%.o: $(srcdir)/%.S + $(CC) $(CFLAGS_ALL) -c -o $@ $< + +build/%.o: $(srcdir)/%.c + $(CC) $(CFLAGS_ALL) -c -o $@ $< + +build/%.os: $(srcdir)/%.S + $(CC) $(CFLAGS_ALL) -c -o $@ $< + +build/%.os: $(srcdir)/%.c + $(CC) $(CFLAGS_ALL) -c -o $@ $< + +clean: $(SUBS:%=clean-%) + rm -rf build + +distclean: clean + rm -f config.mk + +$(DESTDIR)$(bindir)/%: build/bin/% + $(INSTALL) -D $< $@ + +$(DESTDIR)$(libdir)/%.so: build/lib/%.so + $(INSTALL) -D $< $@ + +$(DESTDIR)$(libdir)/%: build/lib/% + $(INSTALL) -m 644 -D $< $@ + +$(DESTDIR)$(includedir)/%: build/include/% + $(INSTALL) -m 644 -D $< $@ + +install: $(SUBS:%=install-%) + +check: $(SUBS:%=check-%) + +.PHONY: all clean distclean install check diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/asinh.c index 000000000000,550302826bd9..550302826bd9 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/asinh.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/asinh.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/asinhf.c index 000000000000,6a96f6ee9f4b..6a96f6ee9f4b mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/asinhf.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/asinhf.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/atan2.c index 000000000000,18c4b70b92f6..18c4b70b92f6 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/atan2.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/atan2.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/exp2f_1u.c index 000000000000,1f8e89ab658f..1f8e89ab658f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/exp2f_1u.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/exp2f_1u.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/expf_1u.c index 000000000000,4e114d810e08..4e114d810e08 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/expf_1u.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/expf_1u.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/expm1.c index 000000000000,7535a1830427..7535a1830427 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/expm1.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/expm1.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/expm1f.c index 000000000000,6d4431dcd8a5..6d4431dcd8a5 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/expm1f.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/expm1f.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log.c index 000000000000,94e3f4482079..94e3f4482079 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log10.c index 000000000000,c2b8f1c54f0e..c2b8f1c54f0e mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log10.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log10.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log10f.c index 000000000000,907c1051e086..907c1051e086 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log10f.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log10f.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log1p.c index 000000000000,42a0c5793920..42a0c5793920 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log1p.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log1p.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log1pf.c index 000000000000,94b90249128f..94b90249128f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log1pf.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log1pf.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log2.c index 000000000000,7d2e44dad2c9..7d2e44dad2c9 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log2.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log2.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/log2f.c index 000000000000,3053c64bc552..3053c64bc552 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/log2f.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/log2f.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/logf.c index 000000000000,84705fad05ee..84705fad05ee mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/logf.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/logf.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/modf.c index 000000000000,da2fcbff8514..da2fcbff8514 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/modf.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/modf.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/modff.c index 000000000000,0a646b24cb1a..0a646b24cb1a mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/modff.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/modff.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/powf.c index 000000000000,47f74cf38ab0..47f74cf38ab0 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/powf.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/powf.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/sincospi.c index 000000000000,fd425202ce67..fd425202ce67 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/sincospi.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/sincospi.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/sincospif.c index 000000000000,760ea3d4f5e1..760ea3d4f5e1 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/sincospif.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/sincospif.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/sinh.c index 000000000000,f65ccd0c6270..f65ccd0c6270 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/sinh.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/sinh.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/tanh.c index 000000000000,3dc6e5527ffc..3dc6e5527ffc mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/tanh.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/tanh.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/tanpi.c index 000000000000,16de00ad5556..16de00ad5556 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/tanpi.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/tanpi.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/tanpif.c index 000000000000,7bd6d206819f..7bd6d206819f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/tanpif.c +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/tanpif.c diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_expf_inline.h index 000000000000,797d217820c3..797d217820c3 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_expf_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_expf_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_expm1_inline.h index 000000000000,82d2e9415d93..82d2e9415d93 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_expm1_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_expm1_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_expm1f_inline.h index 000000000000,463b07aa7705..463b07aa7705 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_expm1f_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_expm1f_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_log1p_inline.h index 000000000000,ef906ae4b603..ef906ae4b603 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_log1p_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_log1p_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_log1pf_inline.h index 000000000000,e81fa24486ae..e81fa24486ae mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_log1pf_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_log1pf_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_sincospi_common.h index 000000000000,438b141b9174..438b141b9174 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_sincospi_common.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_sincospi_common.h diff --cc contrib/arm-optimized-routines/math/aarch64/advsimd/v_sincospif_common.h index 000000000000,8d4177dd871e..8d4177dd871e mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/advsimd/v_sincospif_common.h +++ b/contrib/arm-optimized-routines/math/aarch64/advsimd/v_sincospif_common.h diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/asinhf_data.c index 000000000000,5ed261ba835b..5ed261ba835b mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/asinhf_data.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/asinhf_data.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/atan_data.c index 000000000000,5d24fa912d02..5d24fa912d02 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/atan_data.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/atan_data.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/atanf_data.c index 000000000000,f4d607c2a12d..f4d607c2a12d mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/atanf_data.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/atanf_data.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/expm1_data.c index 000000000000,955895056924..955895056924 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/expm1_data.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/expm1_data.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/log1p_data.c index 000000000000,91a7196d795f..91a7196d795f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/log1p_data.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/log1p_data.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/sve/erfinv_25u.c index 000000000000,4de6d08ab80f..4de6d08ab80f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/sve/erfinv_25u.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/sve/erfinv_25u.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/sve/erfinvf_5u.c index 000000000000,2c81c4e0b9a2..2c81c4e0b9a2 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/sve/erfinvf_5u.c +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/sve/erfinvf_5u.c diff --cc contrib/arm-optimized-routines/math/aarch64/experimental/sve/sv_logf_inline.h index 000000000000,c317a23f6fc3..c317a23f6fc3 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/experimental/sve/sv_logf_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/experimental/sve/sv_logf_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/sincospi_4u.c index 000000000000,2a944bed23e1..2a944bed23e1 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sincospi_4u.c +++ b/contrib/arm-optimized-routines/math/aarch64/sincospi_4u.c diff --cc contrib/arm-optimized-routines/math/aarch64/sincospif_3u2.c index 000000000000,b79694d2ac65..b79694d2ac65 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sincospif_3u2.c +++ b/contrib/arm-optimized-routines/math/aarch64/sincospif_3u2.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/acosh.c index 000000000000,d54c21922e1b..d54c21922e1b mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/acosh.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/acosh.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/acoshf.c index 000000000000,f48ef724e8eb..f48ef724e8eb mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/acoshf.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/acoshf.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/asinh.c index 000000000000,5574116de1e1..5574116de1e1 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/asinh.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/asinh.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/coshf.c index 000000000000,b79fed2374b5..b79fed2374b5 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/coshf.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/coshf.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/exp10f.c index 000000000000,8679df87702f..8679df87702f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/exp10f.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/exp10f.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/exp2f.c index 000000000000,f4c1d0ae607e..f4c1d0ae607e mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/exp2f.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/exp2f.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/expf.c index 000000000000,11528abdbbaf..11528abdbbaf mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/expf.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/expf.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/log.c index 000000000000,c612df48c1fd..c612df48c1fd mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/log.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/log.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/log10.c index 000000000000,5af142d79f55..5af142d79f55 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/log10.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/log10.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/log1pf.c index 000000000000,77ae6218f931..77ae6218f931 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/log1pf.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/log1pf.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/log2.c index 000000000000,11c65c1b2963..11c65c1b2963 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/log2.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/log2.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/modf.c index 000000000000,5944c7d37c4c..5944c7d37c4c mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/modf.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/modf.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/modff.c index 000000000000,ad7ce4e2c88f..ad7ce4e2c88f mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/modff.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/modff.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sincospi.c index 000000000000,d06ca8cc4165..d06ca8cc4165 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sincospi.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sincospi.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sincospif.c index 000000000000,20476f9346e9..20476f9346e9 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sincospif.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sincospif.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sv_expf_inline.h index 000000000000,6054e65bb202..6054e65bb202 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sv_expf_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sv_expf_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sv_log1pf_inline.h index 000000000000,238079c61a5b..238079c61a5b mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sv_log1pf_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sv_log1pf_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sv_log_inline.h index 000000000000,a1b169a0b727..a1b169a0b727 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sv_log_inline.h +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sv_log_inline.h diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sv_sincospi_common.h index 000000000000,672ebbc8e855..672ebbc8e855 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sv_sincospi_common.h +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sv_sincospi_common.h diff --cc contrib/arm-optimized-routines/math/aarch64/sve/sv_sincospif_common.h index 000000000000,4b9101de74ed..4b9101de74ed mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/sv_sincospif_common.h +++ b/contrib/arm-optimized-routines/math/aarch64/sve/sv_sincospif_common.h diff --cc contrib/arm-optimized-routines/math/aarch64/sve/tan.c index 000000000000,1dfc5c422d5e..1dfc5c422d5e mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/tan.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/tan.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/tanhf.c index 000000000000,9007e7badb0d..9007e7badb0d mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/tanhf.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/tanhf.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/tanpi.c index 000000000000,d9e7d2487d53..d9e7d2487d53 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/tanpi.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/tanpi.c diff --cc contrib/arm-optimized-routines/math/aarch64/sve/tanpif.c index 000000000000,2ba968a799fe..2ba968a799fe mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/sve/tanpif.c +++ b/contrib/arm-optimized-routines/math/aarch64/sve/tanpif.c diff --cc contrib/arm-optimized-routines/math/aarch64/tanpi_2u5.c index 000000000000,154b9faf454d..154b9faf454d mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/tanpi_2u5.c +++ b/contrib/arm-optimized-routines/math/aarch64/tanpi_2u5.c diff --cc contrib/arm-optimized-routines/math/aarch64/tanpif_3u1.c index 000000000000,8cd66594c290..8cd66594c290 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/aarch64/tanpif_3u1.c +++ b/contrib/arm-optimized-routines/math/aarch64/tanpif_3u1.c diff --cc contrib/arm-optimized-routines/math/include/test_defs.h index 000000000000,2fe66fa6f14c..2fe66fa6f14c mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/include/test_defs.h +++ b/contrib/arm-optimized-routines/math/include/test_defs.h diff --cc contrib/arm-optimized-routines/math/include/test_sig.h index 000000000000,a967829098d6..a967829098d6 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/include/test_sig.h +++ b/contrib/arm-optimized-routines/math/include/test_sig.h diff --cc contrib/arm-optimized-routines/math/test/test_defs.h index 000000000000,d0656c9e1d84..d0656c9e1d84 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/test/test_defs.h +++ b/contrib/arm-optimized-routines/math/test/test_defs.h diff --cc contrib/arm-optimized-routines/math/test/trigpi_references.h index 000000000000,3dc5a3173436..3dc5a3173436 mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/test/trigpi_references.h +++ b/contrib/arm-optimized-routines/math/test/trigpi_references.h diff --cc contrib/arm-optimized-routines/math/tools/tanpi.sollya index 000000000000,8edbc359ab8e..8edbc359ab8e mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/math/tools/tanpi.sollya +++ b/contrib/arm-optimized-routines/math/tools/tanpi.sollya diff --cc contrib/arm-optimized-routines/string/aarch64/memset-sve.S index 000000000000,efaeaece284e..efaeaece284e mode 000000,100644..100644 --- a/contrib/arm-optimized-routines/string/aarch64/memset-sve.S +++ b/contrib/arm-optimized-routines/string/aarch64/memset-sve.S From nobody Fri Jan 10 12:45:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV1b41l3Lz5kGQx; Fri, 10 Jan 2025 12:45:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV1b40zR4z4bZ5; Fri, 10 Jan 2025 12:45:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736513120; 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=Z4M20wOl+mY7r9m3GjkaTb3ESXRRogjbovksrAGYKxk=; b=GhBsFBqfnMmcZXVPzTw2buvDw24xIjz9/eVNwaXG83AZx3pKQQUiZIwlI1NghEz1FU7s7F 8a4Re1tVZXT8xzV0WHXVByuaQGNOTgc0COzz97i2kfHeYZ1wZiNABKAnhihbf2RSKR72Ld NJaxQOjpVCkzUkTXeVeHPCHiwpF6PpBJm3IQXcvmhrOvRHCJ0j4GEqA9b2ufE60Vt1I6lT IyjRxmGu4UauSGypaymDtIYwcuoTW5x5s0o29tKARaOHO80lhMPnmfmeKH8wq8eLhDbxC7 n0ewG5qb0xxggXgvibbuQRDdZkxRRPsHv+HiX0X+QWpoT+8hqMppoAvH3y83JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736513120; 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=Z4M20wOl+mY7r9m3GjkaTb3ESXRRogjbovksrAGYKxk=; b=cWPkJz9zlHYsRORDYegvFwr6bm/5i15e76dg1+RcwfEI9Pq75xS5f8dbYcwagF1IUXad3P aLTxhT0ZAQaDiCoc0ESkcjFh3oaOXBl3kQD09sIIrG1yVKhTqNpx88mx9TjEV4+Cuz20yi OvRcGChTKQBni8BjIuw/U3Ff7x0Hz5U2pTp9G29nP13AbGU6xqz9Eq/xoKmG/4c8rObZeS JfyUaNbvpODpiYgCEA2IN4njBw45c6fk45FkFKNYaLCxx/XwuMXN1FCJ9C4S4rYVVzqEAl 1Kmnvn56pPZwItihM6Q8PjTA0JV1HM01dscv5x5qJR22/8TCyqqF+LnQz/MfiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736513120; a=rsa-sha256; cv=none; b=yVbGViG7rER+T4OWo38Monw5az2phci4UdMHqfAoj5bpR9UY6GdDYBFv7LeZd9eHIS3iiR dvki68Kvj8cpGzYDpLA7oOXeWGdW3M3+2mGrYtrH4fn5VQ6lfv+RUl9FbguUoPGc8D4vXk G3E2j4KHO47Db747lqRX/OLW1OeoqiQzDO83Q/k5ITdUgSpYgPGnNDtQLObI8vatRQXiLr uw5V1P55FgnD8bgM/EHS4kn8b8iTfyqxvDdJlJZrd0EoRrivlCxKReKIVrYrsCfj6Tmskj OsZHUhno28CB/27W/Y25s+0h90bquNVfdQ8A/e8+9UvAYv0URzXSPnj//TUpzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4200:b830:14b9:1406:dce5:7e4f] (unknown [IPv6:2601:5c0:4200:b830:14b9:1406:dce5:7e4f]) (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 4YV1b36P5xzpds; Fri, 10 Jan 2025 12:45:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <9acd1878-2ee3-47c8-aab9-29d5be200081@FreeBSD.org> Date: Fri, 10 Jan 2025 07:45:19 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ccabc7c2e556 - main - DEVICE_IDENTIFY.9: Modernize description and use cases Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202501092020.509KKt1U058876@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/9/25 18:01, Konstantin Belousov wrote: > On Thu, Jan 09, 2025 at 08:20:55PM +0000, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=ccabc7c2e556ac0b14da9b682b706ccaf251c0fe >> >> commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe >> Author: John Baldwin >> AuthorDate: 2025-01-09 20:20:16 +0000 >> Commit: John Baldwin >> CommitDate: 2025-01-09 20:20:16 +0000 >> >> DEVICE_IDENTIFY.9: Modernize description and use cases >> >> Mention adding devices based on firmware tables and software-only >> pseudo-devices as use cases for identify methods as those are more >> common than reading random I/O ports to identify a legacy ISA device. >> >> Describe how device_find_chid can be used to avoid duplicates. While >> here, explicitly note that devices added in identify methods typically >> use a fixed device name. >> >> Trim the cross-references a bit. >> >> Reviewed by: ziaee, imp >> Differential Revision: https://reviews.freebsd.org/D48367 >> --- >> share/man/man9/DEVICE_IDENTIFY.9 | 52 +++++++++++++++++++--------------------- >> 1 file changed, 25 insertions(+), 27 deletions(-) >> >> diff --git a/share/man/man9/DEVICE_IDENTIFY.9 b/share/man/man9/DEVICE_IDENTIFY.9 >> index d75c1a91ce4a..b10d94143050 100644 >> --- a/share/man/man9/DEVICE_IDENTIFY.9 >> +++ b/share/man/man9/DEVICE_IDENTIFY.9 >> @@ -26,44 +26,46 @@ >> .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >> .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> .\" >> -.Dd January 15, 2017 >> +.Dd January 9, 2025 >> .Dt DEVICE_IDENTIFY 9 >> .Os >> .Sh NAME >> .Nm DEVICE_IDENTIFY >> -.Nd identify a device, register it >> +.Nd identify new child devices and register them >> .Sh SYNOPSIS >> .In sys/param.h >> .In sys/bus.h >> .Ft void >> .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" > So what is the 'parent' for driver which creates devices based on the > firmware tables? Hmmm, I could maybe try to clarify this further. In new-bus, drivers are associated with a parent bus devclass. All of the drivers associated with a given parent bus are then eligible for use with children of any bus devices for that bus. Thus, for example: DRIVER_MODULE(foo, bar, ....) Associates the "bar" driver with the bus "foo". For any fooX bus devices, the "bar" driver can attach to children of fooX. Most device_if.m methods operate on "child" devices, so device_probe, device_attach, device_detach, etc. all operate on a given barX device that is a child of a fooX. device_identify is different. Instead, each fooX bus device can call bus_identify_children (formerly the somewhat misnamed bus_generic_probe) during the fooX device_attach routine. bus_identify_children looks for the devclass of foo and then walks all of the eligible device drivers for potential children of foo invoking this method with fooX as the parent. The idea being that device_identify will create "barX" children of "fooX" explicitly using BUS_ADD_CHILD. In terms of which parent device, it's really about where a given "barX" device should live. For system-wide "top-level" devices that aren't behind some other bridge on an ACPI system, the pattern we use is to hang those devices as children of acpi0, so you end up with DRIVER_MODULE(acpi, bar, ...) and the parent device at the time of DEVICE_IDENTIFY is acpi0. However, we also use identify in some other places. nexus0 children all tend to either be explicitly added in nexus_attach() or added via identify routines that use nexus as the parent. legacy0 on x86 also uses identify routines to add child devices like pcibX. Another case is the ipmi(4) device. Legacy ISA IPMI devices are described by an entry in the SMBIOS table. The ipmi(4) driver uses an identify routine to add an ipmi0 device as a child of isa0 (since it has I/O ports like a typical ISA device), but the identify routine is table-driven since it depends on parsing the smbios table. cpufreqX is another odd case, and I'm not quite convinced it is correct. Today we enumerate cpuX devices hung off of some nexus-like device (on x86 cpuX are children of either acpi0 or legacy0). Each cpufreqX driver then uses identify routines to add named children (p4tccX, estX, hwpstateX, etc.). Those identify routines all have "cpu" as the parent bus so that cpuX is the parent device (and they are called for each instance of a cpuX device). For cpufreq I feel like we actually want something a bit different on x86 at least. I think we want to create an explicit cpufreqX device in cpu_attach, and that the various cpufreq drivers that manage frequency should all be "cpufreq" drivers that bid to attach to that device node instead of creating duplicate nodes that try to duplicate work. Today the various identify routines try to check for each other instead which is fragile. It may be that we'd need/want two device_t nodes, one for P-states and one for throttling, though it might be that we only want the throttling for certain P-state drivers or some such. For your IOMMU case, you can use an ACPI table "anywhere" in the device tree to enumerate device nodes if necessary (though PCI buses don't currently call bus_identify_children today and don't have a BUS_ADD_CHILD method), but if you want to be "ready" before other generic children like PCI bridges are attached, you probably need to be a child of acpi0. -- John Baldwin From nobody Fri Jan 10 14:05:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV3MV4mLGz5kNrk for ; Fri, 10 Jan 2025 14:05:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV3MV2kt2z4nWY for ; Fri, 10 Jan 2025 14:05:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2f4409fc8fdso3131318a91.1 for ; Fri, 10 Jan 2025 06:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1736517925; x=1737122725; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pdviZZG4ldewhivAz2NpV5j7amTAPOsLvuGcQi+bfSE=; b=pVbeO+zEqEyzX7GJUlzGbJ0ZvrCQOSGS1fgKzB2Rqy8hWygBW/fz3q8sm+/DcuvUs8 YUbih+ghIox+YFP3lPXUvZEpq1keuN7APojCuV2ymRe1uHgIyX6V1yt3DUKfwDxpQhu5 ic+gy0hUfEFyGUn/noZDWzjadlN9NJWDSa0TAigYbs0bu9R2CwOK09OLShb5dc20qJPB ISQNVoV35XXMuupFUeEFjJrU90pvPCnjtvJxLzCvStn4HaVt6C4FW3JFih7BF4Dr9zsN iPoIfqWIWAvkx7KbkgWsI4uL0NhuDrJk/dfVc2IZlEAULajbZSG5XpxR4FCXp1HXOHc3 YUHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736517925; x=1737122725; 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=pdviZZG4ldewhivAz2NpV5j7amTAPOsLvuGcQi+bfSE=; b=E8faKUAlEB4hFGexwwPScheTZYKzWk9SNqzhwulydAPIgDaInuZS+PDcPaoYT9dRuE 47vvRWGAGCtySxWB1dJFvDPXKuq/MZsh4MALtP6+0QvV3K+loDkBk2n8BqYYZd3UxJGL pV05XMpWRoQPvZuP4K5NMbAuzULjguVbjJX0s4sT2qw087VXIBAIO7i6wfrGhYTI8pFH rdFxhyMH6emFt6Z/XHH3WXY4dMEk6IOpoWGwpdvzgtamniscBbRAxtRTztdr07Kv3R+5 +WhUHe6hf2ZGXhDw5p4uyg9nB58bk9Fe7ryivj14+B6foHzVpPKUJcKOC8PIaay6UMT7 Lgqw== X-Forwarded-Encrypted: i=1; AJvYcCVp0MSvcmCuNo72FMuEupKVdffqT6UpqENvGBk9XwUltRARoHtACY7moWHhJjmPzfGoaHS7bIWBdbnXOk/L5p5RkNE7Sg==@freebsd.org X-Gm-Message-State: AOJu0Yx4hIlTnJ9uMw/wZ1SlWprs8Foop18vIe6GzJFcQp3SSOG09N/p Y6JCaRPbVWotUarA5KfjdxOLwCMW4TxxiuLMiVABLIIPoh5Uv6wbFYmcObg6diybgKUmJv4bTvV qGXa974ezkYMhinEsl42oM8mqSn7XOKl65eZY2Q== X-Gm-Gg: ASbGnctPj6lZ3rnN3CclfP2HA3ZNCR6is14t6+KAQmmPVehhanrnJR2YP7UAGkLatER vkgH0rKSsHdPWX5aaT6+QmIaSoz9yvKX8fv+OXw== X-Google-Smtp-Source: AGHT+IHuwlNdx3WMO0zVNI5bkJgQVQgTbHwMaM7qPXM2J7ZkGY/YdjTOwebl2tot4s+Rs9pngGzufffoMo4uXMTPb1A= X-Received: by 2002:a17:90b:2d0d:b0:2f2:e905:d5ff with SMTP id 98e67ed59e1d1-2f55833cee6mr9292547a91.6.1736517924622; Fri, 10 Jan 2025 06:05:24 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202501092020.509KKt1U058876@gitrepo.freebsd.org> <9acd1878-2ee3-47c8-aab9-29d5be200081@FreeBSD.org> In-Reply-To: <9acd1878-2ee3-47c8-aab9-29d5be200081@FreeBSD.org> From: Warner Losh Date: Fri, 10 Jan 2025 07:05:12 -0700 X-Gm-Features: AbW1kvb64MA7KubMMTzIw1lFEjmDWMvoyEnhMOXR7A4Bu7wmJkAbe1f2-bekD1s Message-ID: Subject: Re: git: ccabc7c2e556 - main - DEVICE_IDENTIFY.9: Modernize description and use cases To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000000b282d062b5a967c" X-Rspamd-Queue-Id: 4YV3MV2kt2z4nWY X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --0000000000000b282d062b5a967c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 10, 2025 at 5:45=E2=80=AFAM John Baldwin wrot= e: > On 1/9/25 18:01, Konstantin Belousov wrote: > > On Thu, Jan 09, 2025 at 08:20:55PM +0000, John Baldwin wrote: > >> The branch main has been updated by jhb: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dccabc7c2e556ac0b14da9b682b706cc= af251c0fe > >> > >> commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe > >> Author: John Baldwin > >> AuthorDate: 2025-01-09 20:20:16 +0000 > >> Commit: John Baldwin > >> CommitDate: 2025-01-09 20:20:16 +0000 > >> > >> DEVICE_IDENTIFY.9: Modernize description and use cases > >> > >> Mention adding devices based on firmware tables and software-only > >> pseudo-devices as use cases for identify methods as those are mor= e > >> common than reading random I/O ports to identify a legacy ISA > device. > >> > >> Describe how device_find_chid can be used to avoid duplicates. > While > >> here, explicitly note that devices added in identify methods > typically > >> use a fixed device name. > >> > >> Trim the cross-references a bit. > >> > >> Reviewed by: ziaee, imp > >> Differential Revision: https://reviews.freebsd.org/D48367 > >> --- > >> share/man/man9/DEVICE_IDENTIFY.9 | 52 > +++++++++++++++++++--------------------- > >> 1 file changed, 25 insertions(+), 27 deletions(-) > >> > >> diff --git a/share/man/man9/DEVICE_IDENTIFY.9 > b/share/man/man9/DEVICE_IDENTIFY.9 > >> index d75c1a91ce4a..b10d94143050 100644 > >> --- a/share/man/man9/DEVICE_IDENTIFY.9 > >> +++ b/share/man/man9/DEVICE_IDENTIFY.9 > >> @@ -26,44 +26,46 @@ > >> .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF TH= E > USE OF > >> .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE= . > >> .\" > >> -.Dd January 15, 2017 > >> +.Dd January 9, 2025 > >> .Dt DEVICE_IDENTIFY 9 > >> .Os > >> .Sh NAME > >> .Nm DEVICE_IDENTIFY > >> -.Nd identify a device, register it > >> +.Nd identify new child devices and register them > >> .Sh SYNOPSIS > >> .In sys/param.h > >> .In sys/bus.h > >> .Ft void > >> .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" > > So what is the 'parent' for driver which creates devices based on the > > firmware tables? > > Hmmm, I could maybe try to clarify this further. In new-bus, drivers are > associated with a parent bus devclass. All of the drivers associated wit= h > a given parent bus are then eligible for use with children of any bus > devices for that bus. Thus, for example: > > DRIVER_MODULE(foo, bar, ....) > > Associates the "bar" driver with the bus "foo". For any fooX bus devices= , > the "bar" driver can attach to children of fooX. > > Most device_if.m methods operate on "child" devices, so device_probe, > device_attach, device_detach, etc. all operate on a given barX device > that is a child of a fooX. > > device_identify is different. Instead, each fooX bus device can call > bus_identify_children (formerly the somewhat misnamed bus_generic_probe) > during the fooX device_attach routine. bus_identify_children looks for > the devclass of foo and then walks all of the eligible device drivers > for potential children of foo invoking this method with fooX as the > parent. The idea being that device_identify will create "barX" children > of "fooX" explicitly using BUS_ADD_CHILD. > > In terms of which parent device, it's really about where a given "barX" > device should live. For system-wide "top-level" devices that aren't > behind some other bridge on an ACPI system, the pattern we use is to > hang those devices as children of acpi0, so you end up with > > DRIVER_MODULE(acpi, bar, ...) > > and the parent device at the time of DEVICE_IDENTIFY is acpi0. However, > we also use identify in some other places. nexus0 children all tend to > either be explicitly added in nexus_attach() or added via identify > routines that use nexus as the parent. legacy0 on x86 also uses identify > routines to add child devices like pcibX. > These are likely OK. It's arguably possible to model this as devices known in other places, but it gets super awkward and you'd have to do hand-stands that are worse in other ways. > Another case is the ipmi(4) device. Legacy ISA IPMI devices are describe= d > by an entry in the SMBIOS table. The ipmi(4) driver uses an identify > routine to add an ipmi0 device as a child of isa0 (since it has I/O ports > like a typical ISA device), but the identify routine is table-driven sinc= e > it depends on parsing the smbios table. > This is bogus, imho, but not worth fixing. We should have a isasmbb device that parses the child, creates a isasmb bus and then adds the children it finds from parsing the smbtable and moves on. It would be much cleaner. There's several other devices that kinda live here, but none worth supporting these days, so a rewrite is a waste of time. > cpufreqX is another odd case, and I'm not quite convinced it is correct. > Today we enumerate cpuX devices hung off of some nexus-like device (on > x86 cpuX are children of either acpi0 or legacy0). Each cpufreqX > driver then uses identify routines to add named children (p4tccX, estX, > hwpstateX, etc.). Those identify routines all have "cpu" as the parent > bus so that cpuX is the parent device (and they are called for each > instance of a cpuX device). For cpufreq I feel like we actually want > something a bit different on x86 at least. I think we want to create > an explicit cpufreqX device in cpu_attach, and that the various cpufreq > drivers that manage frequency should all be "cpufreq" drivers that bid > to attach to that device node instead of creating duplicate nodes that > try to duplicate work. Today the various identify routines try to > check for each other instead which is fragile. It may be that we'd > need/want two device_t nodes, one for P-states and one for throttling, > though it might be that we only want the throttling for certain P-state > drivers or some such. > This is definitely wrong in a big way. I have about 80-90% of the conversio= n to be proper children of cpu nodes, as appropriate. Warner > For your IOMMU case, you can use an ACPI table "anywhere" in the device > tree to enumerate device nodes if necessary (though PCI buses don't > currently call bus_identify_children today and don't have a BUS_ADD_CHILD > method), but if you want to be "ready" before other generic children like > PCI bridges are attached, you probably need to be a child of acpi0. > > -- > John Baldwin > > --0000000000000b282d062b5a967c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Jan 10,= 2025 at 5:45=E2=80=AFAM John Baldwin <jhb@freebsd.org> wrote:
On 1/9/25 18:01, Konstantin Belousov wrote:
> On Thu, Jan 09, 2025 at 08:20:55PM +0000, John Baldwin wrote:
>> The branch main has been updated by jhb:
>>
>> URL: http= s://cgit.FreeBSD.org/src/commit/?id=3Dccabc7c2e556ac0b14da9b682b706ccaf251c= 0fe
>>
>> commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe
>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org> >> AuthorDate: 2025-01-09 20:20:16 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org> >> CommitDate: 2025-01-09 20:20:16 +0000
>>
>>=C2=A0 =C2=A0 =C2=A0 DEVICE_IDENTIFY.9: Modernize description and u= se cases
>>=C2=A0 =C2=A0 =C2=A0
>>=C2=A0 =C2=A0 =C2=A0 Mention adding devices based on firmware table= s and software-only
>>=C2=A0 =C2=A0 =C2=A0 pseudo-devices as use cases for identify metho= ds as those are more
>>=C2=A0 =C2=A0 =C2=A0 common than reading random I/O ports to identi= fy a legacy ISA device.
>>=C2=A0 =C2=A0 =C2=A0
>>=C2=A0 =C2=A0 =C2=A0 Describe how device_find_chid can be used to a= void duplicates.=C2=A0 While
>>=C2=A0 =C2=A0 =C2=A0 here, explicitly note that devices added in id= entify methods typically
>>=C2=A0 =C2=A0 =C2=A0 use a fixed device name.
>>=C2=A0 =C2=A0 =C2=A0
>>=C2=A0 =C2=A0 =C2=A0 Trim the cross-references a bit.
>>=C2=A0 =C2=A0 =C2=A0
>>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 ziaee, imp
>>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://= reviews.freebsd.org/D48367
>> ---
>>=C2=A0 =C2=A0share/man/man9/DEVICE_IDENTIFY.9 | 52 ++++++++++++++++= +++---------------------
>>=C2=A0 =C2=A01 file changed, 25 insertions(+), 27 deletions(-)
>>
>> diff --git a/share/man/man9/DEVICE_IDENTIFY.9 b/share/man/man9/DEV= ICE_IDENTIFY.9
>> index d75c1a91ce4a..b10d94143050 100644
>> --- a/share/man/man9/DEVICE_IDENTIFY.9
>> +++ b/share/man/man9/DEVICE_IDENTIFY.9
>> @@ -26,44 +26,46 @@
>>=C2=A0 =C2=A0.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING I= N ANY WAY OUT OF THE USE OF
>>=C2=A0 =C2=A0.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBI= LITY OF SUCH DAMAGE.
>>=C2=A0 =C2=A0.\"
>> -.Dd January 15, 2017
>> +.Dd January 9, 2025
>>=C2=A0 =C2=A0.Dt DEVICE_IDENTIFY 9
>>=C2=A0 =C2=A0.Os
>>=C2=A0 =C2=A0.Sh NAME
>>=C2=A0 =C2=A0.Nm DEVICE_IDENTIFY
>> -.Nd identify a device, register it
>> +.Nd identify new child devices and register them
>>=C2=A0 =C2=A0.Sh SYNOPSIS
>>=C2=A0 =C2=A0.In sys/param.h
>>=C2=A0 =C2=A0.In sys/bus.h
>>=C2=A0 =C2=A0.Ft void
>>=C2=A0 =C2=A0.Fn DEVICE_IDENTIFY "driver_t *driver" "= ;device_t parent"
> So what is the 'parent' for driver which creates devices based= on the
> firmware tables?

Hmmm, I could maybe try to clarify this further.=C2=A0 In new-bus, drivers = are
associated with a parent bus devclass.=C2=A0 All of the drivers associated = with
a given parent bus are then eligible for use with children of any bus
devices for that bus.=C2=A0 Thus, for example:

DRIVER_MODULE(foo, bar, ....)

Associates the "bar" driver with the bus "foo".=C2=A0 F= or any fooX bus devices,
the "bar" driver can attach to children of fooX.

Most device_if.m methods operate on "child" devices, so device_pr= obe,
device_attach, device_detach, etc. all operate on a given barX device
that is a child of a fooX.

device_identify is different.=C2=A0 Instead, each fooX bus device can call<= br> bus_identify_children (formerly the somewhat misnamed bus_generic_probe) during the fooX device_attach routine.=C2=A0 bus_identify_children looks fo= r
the devclass of foo and then walks all of the eligible device drivers
for potential children of foo invoking this method with fooX as the
parent.=C2=A0 The idea being that device_identify will create "barX&qu= ot; children
of "fooX" explicitly using BUS_ADD_CHILD.

In terms of which parent device, it's really about where a given "= barX"
device should live.=C2=A0 For system-wide "top-level" devices tha= t aren't
behind some other bridge on an ACPI system, the pattern we use is to
hang those devices as children of acpi0, so you end up with

DRIVER_MODULE(acpi, bar, ...)

and the parent device at the time of DEVICE_IDENTIFY is acpi0.=C2=A0 Howeve= r,
we also use identify in some other places.=C2=A0 nexus0 children all tend t= o
either be explicitly added in nexus_attach() or added via identify
routines that use nexus as the parent.=C2=A0 legacy0 on x86 also uses ident= ify
routines to add child devices like pcibX.

These are likely OK. It's arguably possible to model this as devices= known
in other places, but it gets super awkward and you'd h= ave to do hand-stands
that are worse in other ways.
=C2= =A0
Another case is the ipmi(4) device.=C2=A0 Legacy ISA IPMI devices are descr= ibed
by an entry in the SMBIOS table.=C2=A0 The ipmi(4) driver uses an identify<= br> routine to add an ipmi0 device as a child of isa0 (since it has I/O ports like a typical ISA device), but the identify routine is table-driven since<= br> it depends on parsing the smbios table.

This is bogus, imho, but not worth fixing. We should have a isasmbb device=
that parses the child, creates=C2=A0a isasmb bus and then adds t= he children it
finds from parsing the smbtable and moves on. It w= ould be much cleaner.
There's several other devices that kind= a live here, but none worth supporting
these days, so a rewrite i= s a waste of time.
=C2=A0
cpufreqX is another odd case, and I'm not quite convinced it is correct= .
Today we enumerate cpuX devices hung off of some nexus-like device (on
x86 cpuX are children of either acpi0 or legacy0).=C2=A0 Each cpufreqX
driver then uses identify routines to add named children (p4tccX, estX,
hwpstateX, etc.).=C2=A0 Those identify routines all have "cpu" as= the parent
bus so that cpuX is the parent device (and they are called for each
instance of a cpuX device).=C2=A0 For cpufreq I feel like we actually want<= br> something a bit different on x86 at least.=C2=A0 I think we want to create<= br> an explicit cpufreqX device in cpu_attach, and that the various cpufreq
drivers that manage frequency should all be "cpufreq" drivers tha= t bid
to attach to that device node instead of creating duplicate nodes that
try to duplicate work.=C2=A0 Today the various identify routines try to
check for each other instead which is fragile.=C2=A0 It may be that we'= d
need/want two device_t nodes, one for P-states and one for throttling,
though it might be that we only want the throttling for certain P-state
drivers or some such.

This is definitel= y wrong in a big way. I have about 80-90% of the conversion
to be= proper children of cpu nodes, as appropriate.

War= ner
=C2=A0
For your IOMMU case, you can use an ACPI table "anywhere" in the = device
tree to enumerate device nodes if necessary (though PCI buses don't
currently call bus_identify_children today and don't have a BUS_ADD_CHI= LD
method), but if you want to be "ready" before other generic child= ren like
PCI bridges are attached, you probably need to be a child of acpi0.


=C2=A0
--
John Baldwin

--0000000000000b282d062b5a967c-- From nobody Fri Jan 10 14:24:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV3nW2gX9z5kQKn; Fri, 10 Jan 2025 14:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV3nW23S0z4r2H; Fri, 10 Jan 2025 14:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736519071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FHoncOpMeMCcpD/yJzi102h8YYsT2bykF7xEn6KKLok=; b=AEaz10v+l2EHi7KO94sonHIWqz+B88dUzsA7LsXlhPhXW4k1LNmXMqQ66UxRBQ24LS8xta EouROHQ+fQgaI2XoI5KyboXKw6OAvkGY7Un1Bhpi4sZw3ifbbLcfJB71Dj3DPUl/Vtyc+H 3p6PvB2wGoXyFueKtX3VhBAds1YU2CCMwqnXXNfDzUhyNGZ9uX5hPzHlbbW/UKNEGhyZXk O4by4MLDg/wrb8/NUFhQRvSm2rA5XVs8QjSRc7LjioJF0Z5YMqPLxrA2oiCo+gQshfMpSc /vkranXxPRBS4pcwz7MUv+2eeHGTgomztbcuZl6t+LEF5CzPdtwB5Gbfh8CDGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736519071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FHoncOpMeMCcpD/yJzi102h8YYsT2bykF7xEn6KKLok=; b=Y5PTNPVrCve04DOOpVc606l/+dxXjCEwrTiMwdaGWtEVEL+hwd7N0QMLFhH1RgCi7F1xUf eK5V87l1hNE/lvBaYEq+RQPQ6AiyTkL+luHkCJhe+9KEXOoCWy49EVhScQYlkyEqWEW1qR niDxSkvNKLFGDA0FD/eTzO5sftMM0mrpIWpYr0xz12nBETwfoB8wEgFwu+wsaMUUQCmMQO B4dEVzKSm7cwOYtZzDEmR+b4pJGxW76SOgQwgIt/vgra6JMChyMgrHrveviOTXgCmErBmf 2TQF7eYM44X4jWbYb3lb0cf3mxKBCexkhaRfBMjURjnb59cxFYtPluRmkp+Fxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736519071; a=rsa-sha256; cv=none; b=DUaGo9NVlWr3sZpTAOKDQhxYyz5206UzMq801F7SrP/cXzWkwND4daRACFw9+S7YYeG9pv ihcZ1hWviwgS/YoBdSPKZFnGp+Eu0iSX9CuxbZEY/kEZzOse4SWSlSIw08GWAAD4j/SX8R eliaQ2En5lQEF27pxfsY+9Zkb38LtiJ177efMzbV7IamNeO6acceh9qkHZOjAh/0ShkW9O Ux7twRq/DeyD9lB867A4zXmWhuefzte6bize66W6XoStZpFMeoO1inh2JX530Ury7kIQnT bd+LnksGLjrF1hBE8X5yHB8z+3h2579J/djc2nEGD0Jvccm/WhN4FhYvdfM6Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV3nW11xyz1Vq; Fri, 10 Jan 2025 14:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AEOVek081948; Fri, 10 Jan 2025 14:24:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AEOVU0081945; Fri, 10 Jan 2025 14:24:31 GMT (envelope-from git) Date: Fri, 10 Jan 2025 14:24:31 GMT Message-Id: <202501101424.50AEOVU0081945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: bc77aa7df733 - main - release: install etc files from the source tree, not the host List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc77aa7df7339b166c0d6394526fe59dea89f4b1 Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=bc77aa7df7339b166c0d6394526fe59dea89f4b1 commit bc77aa7df7339b166c0d6394526fe59dea89f4b1 Author: Doug Rabson AuthorDate: 2024-12-23 10:19:27 +0000 Commit: Doug Rabson CommitDate: 2025-01-10 14:21:10 +0000 release: install etc files from the source tree, not the host Reviewed by: cperciva MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48180 --- release/Makefile.oci | 2 ++ release/tools/oci-image-static.conf | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/release/Makefile.oci b/release/Makefile.oci index 461c95f49636..da35156c5a95 100644 --- a/release/Makefile.oci +++ b/release/Makefile.oci @@ -24,6 +24,8 @@ OCI_DEPS_minimal= container-image-dynamic.txz .for _IMG in ${OCI_IMAGES} OCI_TARGETS+= container-image-${_IMG}.txz container-image-${_IMG}.txz: ${OCI_DEPS_${_IMG}} + # Adjust PATH so that we run pwd_mkdb from the bootstrap tools + env PATH=${OBJTOP}/tmp/legacy/bin:${PATH:Q} \ sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} skopeo copy \ containers-storage:localhost/freebsd${REVISION:R}-${_IMG}:latest \ diff --git a/release/tools/oci-image-static.conf b/release/tools/oci-image-static.conf index 27cfb3c6778c..552328e66f3c 100644 --- a/release/tools/oci-image-static.conf +++ b/release/tools/oci-image-static.conf @@ -7,17 +7,20 @@ OCI_BASE_IMAGE= oci_image_build() { - mtree -deU -p $m/ -f /etc/mtree/BSD.root.dist > /dev/null - mtree -deU -p $m/var -f /etc/mtree/BSD.var.dist > /dev/null - mtree -deU -p $m/usr -f /etc/mtree/BSD.usr.dist > /dev/null - mtree -deU -p $m/usr/include -f /etc/mtree/BSD.include.dist > /dev/null - mtree -deU -p $m/usr/lib -f /etc/mtree/BSD.debug.dist > /dev/null + local srcdir=${curdir}/.. + mtree -deU -p $m/ -f ${srcdir}/etc/mtree/BSD.root.dist > /dev/null + mtree -deU -p $m/var -f ${srcdir}/etc/mtree/BSD.var.dist > /dev/null + mtree -deU -p $m/usr -f ${srcdir}/etc/mtree/BSD.usr.dist > /dev/null + mtree -deU -p $m/usr/include -f ${srcdir}/etc/mtree/BSD.include.dist > /dev/null + mtree -deU -p $m/usr/lib -f ${srcdir}/etc/mtree/BSD.debug.dist > /dev/null install_packages ${abi} ${workdir} $m FreeBSD-caroot FreeBSD-zoneinfo - cp /etc/master.passwd $m/etc + cp ${srcdir}/etc/master.passwd $m/etc pwd_mkdb -p -d $m/etc $m/etc/master.passwd || return $? - cp /etc/group $m/etc || return $? - cp /etc/termcap.small $m/etc/termcap.small || return $? - cp /etc/termcap.small $m/usr/share/misc/termcap || return $? + cp ${srcdir}/etc/group $m/etc || return $? + # termcap.small is generated so we get it from OBJDIR - make sets our + # working directory to OBJDIR/release + cp ../etc/termcap/termcap.small $m/etc/termcap.small || return $? + cp ../etc/termcap/termcap.small $m/usr/share/misc/termcap || return $? env DESTDIR=$m /usr/sbin/certctl rehash # Generate a suitable repo config for pkgbase case ${branch} in From nobody Fri Jan 10 14:50:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4Mn6Jbkz5kSHN; Fri, 10 Jan 2025 14:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4Mn4BsNz4sVw; Fri, 10 Jan 2025 14:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736520645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v/Z8Fx5QjRITUhxaX5Rlg4IkCeb8fBpolcm3+DQFQGQ=; b=p6bWQxDLorMBbtuVPfbAF2AaONikC1RxPnHt61Q7UpT8PfxkA4IlJ2WH/n0dxp4GHeUrae nux5vil8fOfbjUUhoQswXO7i4u3ezo+vHv9yYOSoucIloEns1+1GTpFSHQQXr/HgZ3LwBy EezyPgNjpkjYHnqakOGYJ1tmPiFNkv5863TnOwGqRI3smHslv9BK40daj279FW2V/phwCb DbwJzwBtQOUDpxZtxS8x0zn5gyTtBNNmu4xDOGQFPWS53AV1IMioemWctmKla5KCr60wFX a+hys+4oAFIsg98xf+rIRczw4+dpr3htIADfA4idl/Hfd85Evx1KGbSXGr4TEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736520645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v/Z8Fx5QjRITUhxaX5Rlg4IkCeb8fBpolcm3+DQFQGQ=; b=Hl8P7P6mx+1mBZGmokAs+d2i9kPDsQYMD2Zd346PLTLfhZazCVdPEoCLkLjViCOE49/fOw JQvF3lAKFxOpuDTOdjX08inMMpin5TsEwSWTpGdUkOAj5/9br5aGtanLpnhPgCflCXIFC5 xqBBYiqlyhDJQmG9C0pWgGQykC42OTlsFJJkhjymVaQJiM8GZmFa4hHfZMnhiI1CgYKPkd gaUWrQj+Hp99jq0DkGxps9NQ11MzhUwRRdFzH1/fKNCMZJVijf8KsqizlGUKVl1igT9nEK cFIQEtX+lr2Oq+AnBQmMwW+82ITeuRDwD48Vch6pbTQcNckCH1alBcbfLdHslQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736520645; a=rsa-sha256; cv=none; b=cuC3MeNl3H+ne2NX4RFmmqiXQanvv37GOjHGB7Q1eBZsQL13JDNPi3AmGcIRF7zk+Z2f0k djEfzbBG/WDAYuGWONyxwrSxcChfCEBuGUrw8baqgCGQl5UwOASg48Wslw/Xp7Vs601dwf MCFCYSQbrC6NYlYwP3FwrFqj5yqc8Cgi8Y8b7FEBKYIqmrYVlTuCM5jz4otdDTQscDJBTR Y/GMLcp3MS0PITtEJMCbWHP4J23XvD1E+NlG1gXFRPr+sMB0rHyjWt7DenBOEn+sTgpbdI 16NnR636DGfsRmDSb8Gtpae9y3R0heyAa32B+BVXJFxgycZCyDQJKCaIEvIWbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4Mn3dHNz1PZ; Fri, 10 Jan 2025 14:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AEojZt029473; Fri, 10 Jan 2025 14:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AEojGv029470; Fri, 10 Jan 2025 14:50:45 GMT (envelope-from git) Date: Fri, 10 Jan 2025 14:50:45 GMT Message-Id: <202501101450.50AEojGv029470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 84de8c51d1a0 - main - nfsd: Add vfs.nfsd.testing_disable_grace sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84de8c51d1a0fff1c65cd1ec44dd3c3a0e7904eb Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=84de8c51d1a0fff1c65cd1ec44dd3c3a0e7904eb commit 84de8c51d1a0fff1c65cd1ec44dd3c3a0e7904eb Author: Rick Macklem AuthorDate: 2025-01-10 14:49:45 +0000 Commit: Rick Macklem CommitDate: 2025-01-10 14:49:45 +0000 nfsd: Add vfs.nfsd.testing_disable_grace sysctl The grace time of 2 minutes plus when the nfsd is started is needed for normal operation. It allows client(s) to recovery open/lock state. However, for testing situations where there are no client(s) to recover state, it introduces an unacceptable delay. The new per-vnet jail sysctl can be set non-zero to disable the grace period. It should only be used for testing and can be applied on a per-jail basis. It must be set before the nfsd is started up. Requested by: asomers Tested by: asomers --- sys/fs/nfsserver/nfs_nfsdstate.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 6cd8c1c861ec..d1639f48451c 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -115,6 +115,11 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, flexlinuxhack, CTLFLAG_RW, &nfsrv_flexlinuxhack, 0, "For Linux clients, hack around Flex File Layout bug"); +NFSD_VNET_DEFINE_STATIC(bool, nfsd_disable_grace) = false; +SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, testing_disable_grace, + CTLFLAG_NFSD_VNET | CTLFLAG_RW, &NFSD_VNET_NAME(nfsd_disable_grace), + 0, "Disable grace for testing"); + /* * Hash lists for nfs V4. */ @@ -4381,11 +4386,13 @@ nfsrv_checkgrace(struct nfsrv_descript *nd, struct nfsclient *clp, * ReclaimComplete. If so, grace can end now. */ notreclaimed = 0; - LIST_FOREACH(sp, &NFSD_VNET(nfsrv_stablefirst).nsf_head, - nst_list) { - if ((sp->nst_flag & NFSNST_RECLAIMED) == 0) { - notreclaimed = 1; - break; + if (!NFSD_VNET(nfsd_disable_grace)) { + LIST_FOREACH(sp, &NFSD_VNET(nfsrv_stablefirst).nsf_head, + nst_list) { + if ((sp->nst_flag & NFSNST_RECLAIMED) == 0) { + notreclaimed = 1; + break; + } } } if (notreclaimed == 0) From nobody Fri Jan 10 15:03:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4fr3ZNRz5kTTH; Fri, 10 Jan 2025 15:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4fr2nn4z4wj8; Fri, 10 Jan 2025 15:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wD19OYQmFWrsW7RbV8TGYIOfJLNIiXhBe34ImIPrLzc=; b=iCNY4FQDs0kV8zUTDLHoAvA75/Lfk6btEEsBe4pLYUhnxRh/aL74DWlvwjnLv23VtLMEaX R902aRtYAd8uPCQ5hAgzX2lUGg9A2cA/R0b9blEj7mUm3l6pxHsfJI7vjOabx8F0nnMFiO /XOZLBP9dBinWEitzHfuCJ/3c4t6zs3FNc8n2utBbYRR/M4Q3shWYvwvNT+XO0UNFrb/+Y tZf8lwXwire4vCm6oH+1LkSsOmmniL7kfGpJRrxUIMjY5WsLvgJ0Qo4zDcMrEwCYckI02q avypBxXnNgjQoGbjwcxxS04U8Qag6GoIAGSu2DWHFcVHAYiOH5BkaXvzNOQAJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wD19OYQmFWrsW7RbV8TGYIOfJLNIiXhBe34ImIPrLzc=; b=plNGuip+Mh0GgKXo7PLsRBQMmpO9t2W9H7GP3raW4179cdTUXrDLnIz4CgwiecGJZMAE4A YivMeNxMFTAubwj4w08jY38hUt6EEwEK3Ocg/ys/OKLiPWJb7MBvIREZ3YbI4N6PMFsw7v Do5zg6aaCALCK6fXj76p6b0uAgKQvf5iI5Cs1DLi0/6ixxpcjUpfeEiZWzoHXtFm9VeNYb tDTqN1ntEye5URcUzgCJSMqyY3B7bhsF0vVKD2J6wBFgrtBVjAZmJDjGclG/hR/IQoo6nE YlpysV+5q+2XAfNp4/SWzNesLiHC8DPmzJk3yJi8VYBHetiE+tBGm3cmCBdmpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521428; a=rsa-sha256; cv=none; b=MJxcvgqBCor2xoNAop0V/TFRKjVZgyuWoe/OtVEY1A4TFPRbKz7DRkvT6yV7iAU8uHzddg lbeFohRyoMadzeLei5vPQW9blIkEFPXeUHmyRXqxtnRLV1vZFIaHblj0+QetOdi+ptSKSL uwtHGyXZxLsdKKf6C2J7x1JdbfcAlOzcJPndQ1yXlcReYEtOoq64kNJvarB/Ox5NlhWqs8 3dOCJJDQ3eySjk1NVPdfkZN0a/Np/P3IqlwX1/RWVCQW95km/5XhZ3swz34pI3//LT3cQe SCAw+lT6R57q7REds5xO6Vp+IhvYDeQZBHGDewNymcHxpdPItP5aZknh2j2itQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4fr2N62z1q5; Fri, 10 Jan 2025 15:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3mhI056923; Fri, 10 Jan 2025 15:03:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3mEW056920; Fri, 10 Jan 2025 15:03:48 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:48 GMT Message-Id: <202501101503.50AF3mEW056920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 5e7d93a60440 - main - lib/libc/aarch64/string: add strcmp SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e7d93a604400ca3c9db3be1df82ce963527740c Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=5e7d93a604400ca3c9db3be1df82ce963527740c commit 5e7d93a604400ca3c9db3be1df82ce963527740c Author: Getz Mikalsen AuthorDate: 2024-08-26 18:13:31 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:39 +0000 lib/libc/aarch64/string: add strcmp SIMD implementation This changeset includes a port of the SIMD implementation of strcmp for amd64 to Aarch64. Below is a description of its method as described in D41971. The basic idea is to process the bulk of the string in aligned blocks of 16 bytes such that one string runs ahead and the other runs behind. The string that runs ahead is checked for NUL bytes, the one that runs behind is compared with the corresponding chunk of the string that runs ahead. This trades an extra load per iteration for the very complicated block-reassembly needed in the other implementations (bionic, glibc). On the flip side, we need two code paths depending on the relative alignment of the two buffers. The initial part of the string is compared directly if it is known not to cross a page boundary. Otherwise, a complex slow path to avoid crossing into unmapped memory commences. Performance is better in most cases than the existing implementation from the Arm Optimized Routines repository. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D45839 --- lib/libc/aarch64/string/Makefile.inc | 4 +- lib/libc/aarch64/string/strcmp.S | 350 +++++++++++++++++++++++++++++++++++ 2 files changed, 353 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index cabc79e4f351..ba0947511872 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -13,13 +13,15 @@ AARCH64_STRING_FUNCS= \ stpcpy \ strchr \ strchrnul \ - strcmp \ strcpy \ strlen \ strncmp \ strnlen \ strrchr +# SIMD-enhanced routines not derived from Arm's code +MDSRCS+= \ + strcmp.S # # Add the above functions. Generate an asm file that includes the needed # Arm Optimized Routines file defining the function name to the libc name. diff --git a/lib/libc/aarch64/string/strcmp.S b/lib/libc/aarch64/string/strcmp.S new file mode 100644 index 000000000000..e8418dfc6763 --- /dev/null +++ b/lib/libc/aarch64/string/strcmp.S @@ -0,0 +1,350 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include +#include + + .weak strcmp + .set strcmp, __strcmp + .text + +ENTRY(__strcmp) + + bic x8, x0, #0xf // x0 aligned to the boundary + and x9, x0, #0xf // x9 is the offset + bic x10, x1, #0xf // x1 aligned to the boundary + and x11, x1, #0xf // x11 is the offset + + mov x13, #-1 + + /* + * Check if either string is located at end of page to avoid crossing + * into unmapped page. If so, we load 16 bytes from the nearest + * alignment boundary and shift based on the offset. + */ + + add x3, x0, #16 // end of head + add x4, x1, #16 + eor x3, x3, x0 + eor x4, x4, x1 // bits that changed + orr x3, x3, x4 // in either str1 or str2 + tbz w3, #PAGE_SHIFT, .Lbegin + + ldr q0, [x8] // load aligned head + ldr q2, [x10] + + lsl x14, x9, #2 + lsl x15, x11, #2 + lsl x3, x13, x14 // string head + lsl x4, x13, x15 + + cmeq v5.16b, v0.16b, #0 + cmeq v6.16b, v2.16b, #0 + + shrn v5.8b, v5.8h, #4 + shrn v6.8b, v6.8h, #4 + fmov x5, d5 + fmov x6, d6 + + adrp x2, shift_data + add x2, x2, :lo12:shift_data + + /* heads may cross page boundary, avoid unmapped loads */ + tst x5, x3 + b.eq 0f + + ldr q4, [x2, x9] // load permutation table + tbl v0.16b, {v0.16b}, v4.16b + + b 1f + .p2align 4 +0: + ldr q0, [x0] // load true head +1: + tst x6, x4 + b.eq 0f + + ldr q4, [x2, x11] + tbl v4.16b, {v2.16b}, v4.16b + + b 1f + + .p2align 4 +.Lbegin: + ldr q0, [x0] // load true heads +0: + ldr q4, [x1] +1: + + cmeq v2.16b, v0.16b, #0 // NUL byte present? + cmeq v4.16b, v0.16b, v4.16b // which bytes match? + + orn v2.16b, v2.16b, v4.16b // mismatch or NUL byte? + + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + + cbnz x5, .Lhead_mismatch + + ldr q2, [x8, #16] // load second chunk + ldr q3, [x10, #16] + subs x9, x9, x11 // is a&0xf >= b&0xf + b.lo .Lswapped // if not swap operands + sub x12, x10, x9 + ldr q0, [x12, #16]! + sub x10, x10, x8 + sub x11, x10, x9 + + cmeq v1.16b, v3.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + add x8, x8, #16 + shrn v1.8b, v1.8h, #4 + fmov x6, d1 + shrn v0.8b, v0.8h, #4 + fmov x5, d0 + cbnz x6, .Lnulfound + mvn x5, x5 + cbnz x5, .Lmismatch + add x8, x8, #16 // advance aligned pointers + + /* + * During the main loop, the layout of the two strings is something like: + * + * v ------1------ v ------2------ v + * X0: AAAAAAAAAAAAABBBBBBBBBBBBBBBB... + * X1: AAAAAAAAAAAAABBBBBBBBBBBBBBBBCCC... + * + * where v indicates the alignment boundaries and corresponding chunks + * of the strings have the same letters. Chunk A has been checked in + * the previous iteration. This iteration, we first check that string + * X1 doesn't end within region 2, then we compare chunk B between the + * two strings. As X1 is known not to hold a NUL byte in regions 1 + * and 2 at this point, this also ensures that x0 has not ended yet. + */ + .p2align 4 +0: + ldr q0, [x8, x11] + ldr q1, [x8, x10] + ldr q2, [x8] + + cmeq v1.16b, v1.16b, #0 // end of string? + cmeq v0.16b, v0.16b, v2.16b // do the chunks match? + + shrn v1.8b, v1.8h, #4 + fmov x6, d1 + shrn v0.8b, v0.8h, #4 + fmov x5, d0 + cbnz x6, .Lnulfound + mvn x5, x5 // any mismatches? + cbnz x5, .Lmismatch + + add x8, x8, #16 + + ldr q0, [x8, x11] + ldr q1, [x8, x10] + ldr q2, [x8] + + add x8, x8, #16 + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + fmov x6, d1 + shrn v0.8b, v0.8h, #4 + fmov x5, d0 + cbnz x6, .Lnulfound2 + mvn x5, x5 + cbz x5, 0b + + sub x8, x8, #16 // roll back second increment +.Lmismatch: + rbit x2, x5 + clz x2, x2 // index of mismatch + lsr x2, x2, #2 + add x11, x8, x11 + + ldrb w4, [x8, x2] + ldrb w5, [x11, x2] + sub w0, w4, w5 // byte difference + ret + + .p2align 4 +.Lnulfound2: + sub x8, x8, #16 + +.Lnulfound: + mov x7, x9 + mov x4, x6 + + ubfiz x7, x7, #2, #4 // x7 = (x7 & 0xf) << 2 + lsl x6, x6, x7 // adjust NUL mask to indices + orn x5, x6, x5 + cbnz x5, .Lmismatch + + /* + * (x0) == (x1) and NUL is past the string. + * Compare (x1) with the corresponding part + * of the other string until the NUL byte. + */ + ldr q0, [x8, x9] + ldr q1, [x8, x10] + + cmeq v1.16b, v0.16b, v1.16b + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + orn x5, x4, x5 + + rbit x2, x5 + clz x2, x2 + lsr x5, x2, #2 + + add x10, x10, x8 // restore x10 pointer + add x8, x8, x9 // point to corresponding chunk + + ldrb w4, [x8, x5] + ldrb w5, [x10, x5] + sub w0, w4, w5 + ret + + .p2align 4 +.Lhead_mismatch: + rbit x2, x5 + clz x2, x2 // index of mismatch + lsr x2, x2, #2 + ldrb w4, [x0, x2] + ldrb w5, [x1, x2] + sub w0, w4, w5 + ret + + /* + * If (a&0xf) < (b&0xf), we do the same thing but with swapped + * operands. I found that this performs slightly better than + * using conditional moves to do the swap branchless. + */ + .p2align 4 +.Lswapped: + add x12, x8, x9 + ldr q0, [x12, #16]! + sub x8, x8, x10 + add x11, x8, x9 + neg x9, x9 + + cmeq v1.16b, v2.16b, #0 + cmeq v0.16b, v0.16b, v3.16b + add x10, x10, #16 + shrn v1.8b, v1.8h, #4 + fmov x6, d1 + shrn v0.8b, v0.8h, #4 + fmov x5, d0 + cbnz x6, .Lnulfounds + mvn x5, x5 + cbnz x5, .Lmismatchs + add x10, x10, #16 + + /* + * During the main loop, the layout of the two strings is something like: + * + * v ------1------ v ------2------ v + * X1: AAAAAAAAAAAAABBBBBBBBBBBBBBBB... + * X0: AAAAAAAAAAAAABBBBBBBBBBBBBBBBCCC... + * + * where v indicates the alignment boundaries and corresponding chunks + * of the strings have the same letters. Chunk A has been checked in + * the previous iteration. This iteration, we first check that string + * X0 doesn't end within region 2, then we compare chunk B between the + * two strings. As X0 is known not to hold a NUL byte in regions 1 + * and 2 at this point, this also ensures that X1 has not ended yet. + */ + .p2align 4 +0: + ldr q0, [x10, x11] + ldr q1, [x10, x8] + ldr q2, [x10] + + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + fmov x6, d1 + shrn v0.8b, v0.8h, #4 + fmov x5, d0 + cbnz x6, .Lnulfounds + mvn x5, x5 + cbnz x5, .Lmismatchs + + add x10, x10, #16 + + ldr q0, [x10, x11] + ldr q1, [x10, x8] + ldr q2, [x10] + + add x10, x10, #16 + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + fmov x6, d1 + shrn v0.8b, v0.8h, #4 + fmov x5, d0 + cbnz x6, .Lnulfound2s + mvn x5, x5 + cbz x5, 0b + + sub x10, x10, #16 + +.Lmismatchs: + rbit x2, x5 + clz x2, x2 + lsr x2, x2, #2 + add x11, x10, x11 + + ldrb w4, [x10, x2] + ldrb w5, [x11, x2] + sub w0, w5, w4 + ret + + .p2align 4 +.Lnulfound2s: + sub x10, x10, #16 +.Lnulfounds: + mov x7, x9 + mov x4, x6 + + ubfiz x7, x7, #2, #4 + lsl x6, x6, x7 + orn x5, x6, x5 + cbnz x5, .Lmismatchs + + ldr q0, [x10, x9] + ldr q1, [x10, x8] + + cmeq v1.16b, v0.16b, v1.16b + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + orn x5, x4, x5 + + rbit x2, x5 + clz x2, x2 + lsr x5, x2, #2 + + add x11, x10, x8 + add x10, x10, x9 + + ldrb w4, [x10, x5] + ldrb w5, [x11, x5] + sub w0, w5, w4 + ret + +END(__strcmp) + + .section .rodata + .p2align 4 +shift_data: + .byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + .fill 16, 1, -1 + .size shift_data, .-shift_data From nobody Fri Jan 10 15:03:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4fs4ftkz5kTND; Fri, 10 Jan 2025 15:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4fs3vPqz4wwN; Fri, 10 Jan 2025 15:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Or0vvsglCtaLGw+szmpXwhtC1wvq6G53SdMtkmEvez4=; b=T9SL4Om4zTkL7NF9atkfk8zWkfOM6tsS22Oa+Q3hMntG+NvyCxy0HtvozN1hUDkLT2oSym RhUfgCFQi6Fx28Wwylf1u/GAhisKfzi8MFbZ6R2jLVrYhLqM+Updj0t7X/XncrGwS001Jn HyQcx3UMg/yeJZm7s7pSaT63hwplPqxPZlrYCbtbx7lV9F4ksIQnjyEBy8mgqNniWwVDnM H2QxV3vhCMEGFinrckV7Ia7PL8Tf/brkA2i8WpkjI2dKK9OPjirq0oTpT5howuSA47+nNP reOOTWJznO5BYFrU/is/9puC03wQtmjSBjxKKxQiPwRdI8m3ZwRoB3xWBV6dhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Or0vvsglCtaLGw+szmpXwhtC1wvq6G53SdMtkmEvez4=; b=ipwj/eULDHy1HY0gLJF4DzrE0FnTZf64csVQSQ1qw3TExie/inxIiqf2O619uGmtuIZ0sx txz/NYJRrwosdySceFIT3x+YJh2xAYLtVDo3eg99AI7bFOkh5ypgv1d1qoD90SS5DjlmQD yj6kqTJu4LpnLQGI8TkjQN4ub1qAwreKuSkeDsgs/aacJYZrT9PsCUa+gQjBu8Y85QmQvc SICDQf46+Y4BRDn3wCqPB5VY7v9Z7xYeDqSCzFkbxjdwCXmPb4H+0714BRBiHzTipYcH0s DiRMwPuo/ttLGC8m6GpgzKeIqrjKbQ4IuxCKX2emecS/V/+Tuev16xdPVL5TXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521429; a=rsa-sha256; cv=none; b=MPCM3j4WOoFgYQuZr/EnYqYIP8OiV7McdgTST1TbWvCGG4m7EeeFrBkEFRjoWB2ahY2kLW cE7ywm6t9IZOY+In/gUpvKcmxUIOnEqF/ARtVEM8nUFRnLWyiK2S1V1Kq+adnPMqV4NOjA HLnWFcq9JsKV9hjzt27Jg8Iy31kGe3aZQIscXAoiB3/Jh/YxWVsYiIgMVer8tUjn87xm0s nUSmlfNM8/uAT/uAIcb++Ch/RvVLKnEkyNRKcHGqVj5IB2FWGRAaafFsK5twCdGdmo+Ffl guz8S4vyeKyuU7hQ84/2oaAqaOlw83hGy56ryktxV0XQW9jBdfjl8L/j1OoLkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4fs3MXdz2Jf; Fri, 10 Jan 2025 15:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3nXJ056965; Fri, 10 Jan 2025 15:03:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3nx3056962; Fri, 10 Jan 2025 15:03:49 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:49 GMT Message-Id: <202501101503.50AF3nx3056962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: b91003acffe7 - main - lib/libc/aarch64/string: add strspn optimized implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b91003acffe7b50dd6506be15116c6b42fc512c6 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=b91003acffe7b50dd6506be15116c6b42fc512c6 commit b91003acffe7b50dd6506be15116c6b42fc512c6 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:13:54 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:39 +0000 lib/libc/aarch64/string: add strspn optimized implementation This is a port of the Scalar optimized variant of strspn for amd64 to aarch64. It utilizes a LUT to speed up the function, a SIMD variant is still under development. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46396 --- lib/libc/aarch64/string/Makefile.inc | 4 +- lib/libc/aarch64/string/strspn.S | 111 +++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index ba0947511872..09bfaef963eb 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -21,7 +21,9 @@ AARCH64_STRING_FUNCS= \ # SIMD-enhanced routines not derived from Arm's code MDSRCS+= \ - strcmp.S + strcmp.S \ + strspn.S + # # Add the above functions. Generate an asm file that includes the needed # Arm Optimized Routines file defining the function name to the libc name. diff --git a/lib/libc/aarch64/string/strspn.S b/lib/libc/aarch64/string/strspn.S new file mode 100644 index 000000000000..0ef42c2b737e --- /dev/null +++ b/lib/libc/aarch64/string/strspn.S @@ -0,0 +1,111 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include + + .weak strspn + .set strspn, __strspn + .text + +ENTRY(__strspn) + + /* check for special cases */ + ldrb w4, [x1] // first character in set + cbz w4, .Lzero // empty set always returns 0 + + mov x15, #1 // preload register with 1 for stores + + // set is only one character + ldrb w5, [x1, #1] // second character in the set + cbz w5, .Lsingle + + stp x29, x30, [sp, #-16]! + mov x29, sp + sub sp, sp, #256 // allocate 256 bytes on the stack + + /* no special case matches -- prepare lookup table */ + mov w3, #28 +0: add x9, sp, x3, lsl #3 + stp xzr, xzr, [x9] + stp xzr, xzr, [x9, #16] + subs w3, w3, #4 + b.cs 0b + + strb w15, [sp, x4] // register first character in set + add x1, x1, #2 + + /* process remaining chars in set */ + .p2align 4 + + +0: ldrb w4, [x1] // next char in set + strb w15, [sp, x5] // register previous char + cbz w4, 1f // NUL encountered? + + ldrb w5, [x1, #1] + add x1, x1, #2 + strb w15, [sp, x4] + cbnz w5, 0b + +1: mov x5, x0 // stash a copy of src + + /* find mismatch */ + .p2align 4 +0: ldrb w8, [x0] + ldrb w9, [sp, x8] + cbz w9, 2f + + ldrb w8, [x0, #1] + ldrb w9, [sp, x8] + cbz w9, 3f + + ldrb w8, [x0, #2] + ldrb w9, [sp, x8] + cbz w9, 4f + + ldrb w8, [x0, #3] + add x0, x0, #4 + ldrb w9, [sp, x8] + cbnz w9, 0b + + sub x0, x0, #3 +4: sub x5, x5, #1 +3: add x0, x0, #1 +2: sub x0, x0, x5 + mov sp, x29 + ldp x29, x30, [sp], #16 + ret + +.Lzero: + mov x0, #0 + ret + +.Lsingle: + ldrb w8, [x0, x5] + cmp w4, w8 + b.ne 1f + + add x5, x5, #1 + ldrb w8, [x0, x5] + cmp w4, w8 + b.ne 1f + + add x5, x5, #1 + ldrb w8, [x0, x5] + cmp w4, w8 + b.ne 1f + + add x5, x5, #1 + ldrb w8, [x0, x5] + add x5, x5, #1 + cmp w4, w8 + b.eq .Lsingle + + sub x5, x5, #1 +1: mov x0, x5 + ret + +END(__strspn) From nobody Fri Jan 10 15:03:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4ft6vWyz5kTTM; Fri, 10 Jan 2025 15:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4ft4tDlz4wyw; Fri, 10 Jan 2025 15:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FrdeuTTqn2vqFZXQdJPDM794tFhwvdJu9eNy4v3BQiE=; b=GW9lFSrvY5RL76l37ZKuu25n5vH51wRid712wrYtGrH/oAS9BCj6QlKFZJfAuKdeoXxHaP kof2tz+WlhOiEFFEMp91RuJc8CNF7tjemHOFCbUHq1cDqEGSO4snpDH09Byl7HVxeMdgJ0 wtwefHMDvF7NVnUNz5CEGsk0rSfXKtnJhEcuK3qrk9BYsxRZLUyQZG4EhP0YPPClf2bXpw +Ky84B5Y9MrQ0f6xX/1zA8K+ldsAJHWMHXUMnWacefcHC5Dqdnv8gXyCdaYU1x391utVbk DD08i1uD/ZAXbixFPh/Q7gieaRj7dxJd8WDgxa3oml9lXNjNTSiO6Y1/Ivp/DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FrdeuTTqn2vqFZXQdJPDM794tFhwvdJu9eNy4v3BQiE=; b=sR3xxGotBksUdcPhK9BkclqsHQSX2askddsTdRDs+dIrivzuMosEYa5uNyw/DvF5hRB4c8 Y5/bK/0dKqzXvzOJibIGcmFh4omd+tLrPUhy/z7E+Hdac9zGqEoGADxLV9BiY10x/2WfFy SPt/Oi7OwUN8oW4OFe3rHa2vbRGzzbfJ13NBh3UiqGv3VC1uAe76Vn8dKIC1GrLRLoQk2g 9WJQ7kFuQg4QuipB8eVb6kEAYqQZhkg+X1or7fFxMQEMH4P193dk8ITBVGAiDzEtErKPxw wRgClRDQdBMJarLBzBXbeY+ltOnWzLV9pFSkQhWh1UMk1ccsgdO/PpRmDcS0rQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521430; a=rsa-sha256; cv=none; b=KxZjkqq4khrImGh3Ml5z8PpIpntHdVQvpLGa4wk/fDATgnnDrZUtH1sqlfHgJfpCfTAvdO W85fkYgCG/mIOAdYr/Q6wxVTE+n1dE7btbNtwj398Mh64WVNW/5i5J/6IwgZ5ICzumHX5v x9geakOXJdUnAp0eJdaLt5lN9CgZHtj0FWysa0PKGLJ3FAsxgso8cbDKpFBDEjQj2eKZGu VLKrs/6IhZRN+Mr+3Y0ol6x41+HB87MsrWY+EjYsjumw2nxSyFtes+eOhn7s1Z5qISofYg FTdCAvo5WF7y4u9M193Ah53DTxThXBWkStu+1BH01c8MMMrkM49ppLcqYAFLaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4ft4MBcz2TP; Fri, 10 Jan 2025 15:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3olH057007; Fri, 10 Jan 2025 15:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3o8C057004; Fri, 10 Jan 2025 15:03:50 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:50 GMT Message-Id: <202501101503.50AF3o8C057004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: f2bd390a54f1 - main - lib/libc/aarch64/string: add strcspn optimized implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2bd390a54f183f85dd7faab815740fb3bea9591 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=f2bd390a54f183f85dd7faab815740fb3bea9591 commit f2bd390a54f183f85dd7faab815740fb3bea9591 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:14:01 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:39 +0000 lib/libc/aarch64/string: add strcspn optimized implementation This is a port of the Scalar optimized variant of strcspn for amd64 to aarch64 It utilizes a LUT to speed up the function, a SIMD variant is still under development. Performance benchmarks are as usual generated by strperf. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46398 --- lib/libc/aarch64/string/Makefile.inc | 3 +- lib/libc/aarch64/string/strcspn.S | 109 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 09bfaef963eb..34483532a3dd 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -22,7 +22,8 @@ AARCH64_STRING_FUNCS= \ # SIMD-enhanced routines not derived from Arm's code MDSRCS+= \ strcmp.S \ - strspn.S + strspn.S \ + strcspn.S # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strcspn.S b/lib/libc/aarch64/string/strcspn.S new file mode 100644 index 000000000000..8f2d6d20f0f6 --- /dev/null +++ b/lib/libc/aarch64/string/strcspn.S @@ -0,0 +1,109 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include + + .weak strcspn + .set strcspn, __strcspn + .text + +ENTRY(__strcspn) + stp x29, x30, [sp, #-16]! + mov x29, sp + mov x15, #1 // preload register with 1 for stores + + /* check for special cases */ + ldrb w4, [x1] // first character in the set + cbz w4, .Lstrlen + + movi v0.16b, #0 + + ldrb w5, [x1, #1] // second character in the set + cbz w5, .Lstrchr + + sub sp, sp, #256 // allocate 256 bytes on the stack + + /* no special case matches -- prepare lookup table */ + mov w3, #20 + .p2align 4 +0: add x9, sp, x3, lsl #3 + stp xzr, xzr, [x9] + stp xzr, xzr, [x9, #16] + subs w3, w3, #4 + b.cs 0b + + /* utilize SIMD stores to speed up zeroing the table */ + stp q0, q0, [sp, #6*32] + stp q0, q0, [sp, #7*32] + + add x1, x1, #2 + strb w15, [sp, x4] // register first chars in the set + strb w15, [sp, x5] + + mov x4, x0 // stash a copy of src + + /* process remaining chars in set */ + .p2align 4 +0: ldrb w5, [x1] + strb w15, [sp, x5] + cbz w5, 1f // end of set? + + ldrb w5, [x1, #1] + strb w15, [sp, x5] + cbz w5, 1f + + add x1, x1, #2 + b 0b + + /* find match */ + .p2align 4 +1: ldrb w8, [x0] + ldrb w9, [sp, x8] + cbnz w9, 2f + + ldrb w8, [x0, #1] + ldrb w9, [sp, x8] + cbnz w9, 3f + + ldrb w8, [x0, #2] + ldrb w9, [sp, x8] + cbnz w9, 4f + + ldrb w8, [x0, #3] + ldrb w9, [sp, x8] + add x0, x0, #4 + cbz w9, 1b + + sub x0, x0, #3 // fix up return value +4: sub x4, x4, #1 +3: add x0, x0, #1 +2: sub x0, x0, x4 + mov sp, x29 + ldp x29, x30, [sp], #16 // restore sp and lr + ret + + /* set is empty, degrades to strlen */ + .p2align 4 +.Lstrlen: + mov sp, x29 + ldp x29, x30, [sp], #16 // restore sp and lr + b strlen + + /* just one character in set, degrades to strchrnul */ + .p2align 4 +.Lstrchr: + stp x0, x1, [sp, #-16]! + mov x1, x4 + + bl strchrnul + + ldp x18, x17, [sp], #16 // restore stashed src + sub x0, x0, x18 + + ldp x29, x30, [sp], #16 // Restore sp and lr + ret + +END(__strcspn) From nobody Fri Jan 10 15:03:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4fw1qthz5kTTN; Fri, 10 Jan 2025 15:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4fv5kP5z4wqj; Fri, 10 Jan 2025 15:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBfcOMk6smi28LQjP8xEFc1FsDJCt9p5ospvWbslBpQ=; b=oDvOXputgBR1tN7qfdAcEkp+6PTMzBmgw8WYswpaL5G34zvBcNn2UZUhthpo3B7e5Uzhxc WviEPAx3madC9NnALRVp8ucI+wAePwd0Cw2dllTHw0GuBfwSokVWvCoCuiro8umSYCOYxn tZNZigZ9mvfKf7GkYE4RRnf4FolHFPEBilYOkFvv2ADPZ/bnuWMDpGWOSGIx+kZYK8OAcM Rtwwfov+C2Q2TgvRj4edWVqdCCB5G+4s/p5VEUh2az/MKMoBIFtk+DxB0EclHVnpNSKsye SZI3jI8i5Ks/KpmJ0YNqy20AGCYjj5InOPaam28IKN0r3Wq+hOSBbRZq6ZVWDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBfcOMk6smi28LQjP8xEFc1FsDJCt9p5ospvWbslBpQ=; b=HnOeEFqAginKBbLhkJA2tjKsrFXb/atDpzMFBiOqYLDnxcCHPn2/C/KDDGVj0+JU5uuJun nZRA/i+Y/50ucysoAMpymjjFw6CQ2bJ4Ou55Mj3GiZyguDQirFsWCuPT+dOrpPAhVsFUOr nk27As+bg6nyxxvpfJPMYOpzAmaZtGXZS7skNRMz5GuwqGs7kJqQ1jnXr64IB9OZX9fWYu nS9IxGM1TXEF9c/2jwD+Nh/8ZkoYilzEeffBwQPmk7c44ZHItzIvCSl0EtMcfyPT1ym9cM v+lDvHiFO70g0nKtpUGANm1zfDSlPEBWiVC4WQSDlmzREOdvHLpw/3JXghbY3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521431; a=rsa-sha256; cv=none; b=NEkpFItdfTE/0fHRSoxkczqPrNyl0mRnHjppbbDzqHgvssGYGQbodVGwI+Vl8Fazb+s9OV cUG9oXbi4+Khqg1bWE073ENNr8AhZnp2ISrJH6TXOeSK2TO5CADucjcCafpkxXNWN3zvVT zw8S0m3fls25wgG3yZXQGlJptGPO/nul8vyR93kTCqcy+rj/3DdG+BR+2sf40Fy6TB8mIx OnWkXNX6oQZk57ZBO4tM62gT4xQBpKwsR2ILO53m9uXEamM92mV/J6LWC6Vw+Wi1KTaoV3 vtTz6J5CZeaC7QYDSO+AenC01E/yg797uDNKZCWlBzvjI/c87MWR29JbJzwrNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4fv53bZz1nL; Fri, 10 Jan 2025 15:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3pHK057062; Fri, 10 Jan 2025 15:03:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3pLk057059; Fri, 10 Jan 2025 15:03:51 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:51 GMT Message-Id: <202501101503.50AF3pLk057059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 89b3872376cb - main - lib/libc/aarch64/string: add optimized strpbrk & strsep implementations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89b3872376cbb6e8ab53cb50fa8c4c6d14e2d405 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=89b3872376cbb6e8ab53cb50fa8c4c6d14e2d405 commit 89b3872376cbb6e8ab53cb50fa8c4c6d14e2d405 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:14:08 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:39 +0000 lib/libc/aarch64/string: add optimized strpbrk & strsep implementations These are direct copies from the amd64 string functions using the optimized strcspn from D46398 Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46399 --- lib/libc/aarch64/string/Makefile.inc | 4 ++- lib/libc/aarch64/string/strpbrk.c | 43 +++++++++++++++++++++++++++ lib/libc/aarch64/string/strsep.c | 57 ++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 34483532a3dd..996a2fd45bc0 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -23,7 +23,9 @@ AARCH64_STRING_FUNCS= \ MDSRCS+= \ strcmp.S \ strspn.S \ - strcspn.S + strcspn.S \ + strpbrk.c \ + strsep.c # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strpbrk.c b/lib/libc/aarch64/string/strpbrk.c new file mode 100644 index 000000000000..87f587789991 --- /dev/null +++ b/lib/libc/aarch64/string/strpbrk.c @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ + +#include + +#include + +size_t __strcspn(const char *, const char *); + +char * +strpbrk(const char *s, const char *charset) +{ + size_t loc; + + loc = __strcspn(s, charset); + + return (s[loc] == '\0' ? NULL : (char *)&s[loc]); +} diff --git a/lib/libc/aarch64/string/strsep.c b/lib/libc/aarch64/string/strsep.c new file mode 100644 index 000000000000..7afd47957aa9 --- /dev/null +++ b/lib/libc/aarch64/string/strsep.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ + +#include +#include + +size_t __strcspn(const char *, const char *); + +/* + * We have a fast strcspn() on aarch64. Use it over a direct + * implementation of strsep for better performance. + */ +char * +strsep(char **stringp, const char *delim) +{ + size_t n; + char *s; + + s = *stringp; + if (s == NULL) + return (NULL); + + n = __strcspn(s, delim); + if (s[n] == '\0') + *stringp = NULL; + else { + s[n] = '\0'; + *stringp = s + n + 1; + } + + return (s); +} From nobody Fri Jan 10 15:03:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4fx3wqDz5kTWN; Fri, 10 Jan 2025 15:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4fw6TWLz4wqq; Fri, 10 Jan 2025 15:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gQ+zqNQcQxtOgPlwVoyInds2yvlAqj19yIp0h+/W72c=; b=DYqGa9zyz/gWLqbBVdEKkvR1XDlGtFVcc9tWu2zEp7Sd2SSGKSIP/eL/qeSbrs31WSVCDD zt5uPZdWEGedGhFfFeDM55aSnzwK4L80cb3QTU5uYv1It5YzkHSFm0LJ7i8AmEPcNkVCHu Pmpm6oXoORgD+mHzF93+XOtiwbThRhY5ojpv0GvIG1qt5f5GoulXVj5drTmWDLiu41Xi5K nPdtHJzceKfb/GUJz3kvihxQei1whxxdcOQLEbySIbvNbyFUILJP6fNHERy4LPbmXdZ0Ct xXQB3GPKTd5BbiPLfXpFWoLpNF2ClCmx4Va+D43zOJKLtPLLUfBNXzjg7t6QAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gQ+zqNQcQxtOgPlwVoyInds2yvlAqj19yIp0h+/W72c=; b=BxT/E4BpzOW8EuoRAroSJZUMNVJua2EGz0ChwqNxDeGbYVLQcpShVchQXQ3jtnZoWTvd7e USEfWvN12HfaSIlQID4QalqpY5iPUFU4EtoDNSLJ2Hvl2W4HRvZnjhGHdMk8O8NTyIoLBN vjP7uTc+CIqQipRLqYFcmqORh0iAM/NC/K0zUuf7gKYYN12mxddQWnk0y8DV2pnYTyLY1S w80inf2573pgeqh7l/zVv4tqatiFOA/PS8ZicrXo7gI1k3qZisExwJ2YsioV3DxOCIoDpr K1xSGkeIqfU1TM72bS1zaSzYfPuqlJzANkx0Jd+NxSXh6kSJUhHqklxVc+a7qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521432; a=rsa-sha256; cv=none; b=vSeNVMMUN99Kcq0TzyrKe+dDJvil8nuZZeuDQ5eaAOeiJxAQ6GUuMi3wyg7ZVNVSJhPdDe j7lOhvhAUHKiG7mg/qrbR+RFmfayMfJKt5p6SW1cg2BpQ0q+90jJd0crPoyIi7ufE0T9g0 zhylYm9hjFoHzGQ7VHWTEvj7oEtXNQYZPmJ81kVzsWRYUDDxKaolrDpw+0ozV6SGY2KXrz kUvrQ6TufGVqEd800YR4ZHs10NC+H5sCPtc1QEyAVjgzln5YXMi3d039C356Ms/QE7scv6 0f840r/wpdmV39v0f+wBl2JGv09niiD4hSsQTt2lezURH97QbY0amjBt0yc26A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4fw63MCz1XX; Fri, 10 Jan 2025 15:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3q4f057107; Fri, 10 Jan 2025 15:03:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3qP8057104; Fri, 10 Jan 2025 15:03:52 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:52 GMT Message-Id: <202501101503.50AF3qP8057104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 79287d783c72 - main - lib/libc/aarch64/string: strcat enable use of SIMD List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79287d783c72f95eb47c26dbfdfca279086e16a9 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=79287d783c72f95eb47c26dbfdfca279086e16a9 commit 79287d783c72f95eb47c26dbfdfca279086e16a9 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:14:15 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: strcat enable use of SIMD Call into SIMD strlen and stpcpy for an optimized strcat. Port of D42600 for amd64. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46417 --- lib/libc/aarch64/string/Makefile.inc | 3 ++- lib/libc/aarch64/string/strcat.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 996a2fd45bc0..0b2974947389 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -25,7 +25,8 @@ MDSRCS+= \ strspn.S \ strcspn.S \ strpbrk.c \ - strsep.c + strsep.c \ + strcat.c # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strcat.c b/lib/libc/aarch64/string/strcat.c new file mode 100644 index 000000000000..c70875be1c1a --- /dev/null +++ b/lib/libc/aarch64/string/strcat.c @@ -0,0 +1,20 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include + +#undef strcat /* _FORTIFY_SOURCE */ + +char * +strcat(char * __restrict s, const char * __restrict append) +{ + char *save = s; + + /* call into SIMD optimized functions */ + stpcpy(s + strlen(s), append); + + return(save); +} From nobody Fri Jan 10 15:03:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4fy30QZz5kTRP; Fri, 10 Jan 2025 15:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4fy0dZxz4x0P; Fri, 10 Jan 2025 15:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDu5byAwCeuEvG+C/T0z8zO9Mnx56k59RNpXu5nbBcM=; b=sDlIBExB0da07vPW9pdhLlhIDtP/EuRg9Hf282E64213v6R1wIgoZ+FQVSL2maR5D67fEa o//9FdM3LmUGQBlySZnhxOLhPOvysScgOugIGhQLil7A+ReQSCey4dUe6ohvAjL14iAja5 oLjStl71KjWhnIfVfNRl7Lgde53esbP/E638lZ2iNIPISA5vzshg8bDBF8Gk4O/rGewj2M nroC+V5qM1r/uGFLV5B8RuDHW+DIUPX31Bu3vFSWO5UTzM2M0xW3OBUukKpUyomnA2/1Gr 5bWdeLqERNOZg4yYPM7b/NSH54CRY8j5KUYb/qVTTz3ijQlGEloiDi6w2C0Zzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDu5byAwCeuEvG+C/T0z8zO9Mnx56k59RNpXu5nbBcM=; b=dHf4hKlffNlQEJlvYlFGIMeSq+qZRz7sn1+GwbHIdHnkvNxsrskt/9y7RgySPbhaHiVTBH Yj81nxzK63+AYnyl7/EY8idwulim+zKp0z/grQF6uN/rkTvM0KiMj3PZgIITCLjOchGS3b fK4llFR+qnB77DOVAvGpiEaRNn0Ox6pdGL1rs51WNSogE0pFEjmoqk3zqBrxrW/kn0o/ND aWM+TZTBcvd85yK6CvSxmv4xFxxF8lu9c3q8W6BvL2yriSL9Hr2cD2p5kroSCVCH+28poq +pF/PdRSCRm+PJUf3wcE9fuuyWpzF4v6In4MFRnPK3W23ReZGiruczrnCKyJGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521434; a=rsa-sha256; cv=none; b=FZkqpwM7dHOoFxC8LNFYtllYiYILS5Ps+tO6+CglCRHtEVixYo8YnuyFhGDlbBfaMzzHIY IIAaKP5ZHZhAL7S7Z0BJZJIoQh19BNVjyW4zEC024aJQwLsJqx08Z6epGOgfSRLWvsz7DY SvM7z+WZpEMeWL2cCBtvtAUMrdznwHXQjIwkDKDzaxOpSss3a2v9vehzmkRxd1XWMA7cEs vAoswPrsrt18+QbQufs7HgGUShDQd7tDODKKlZimKhvhj9zdYbtKh/TN1nabHtxDcslnW9 2DFVS1WwKR6bdRen++NDohbeK/nXCdUKN6awI2a8Sn486VUfbl8uqF7Ki2A8HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4fy0DqRz22f; Fri, 10 Jan 2025 15:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3rlg057149; Fri, 10 Jan 2025 15:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3rqI057146; Fri, 10 Jan 2025 15:03:53 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:53 GMT Message-Id: <202501101503.50AF3rqI057146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 756b7fc80837 - main - lib/libc/aarch64/string: add strlcpy SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 756b7fc80837567d114a3c93e9bb987e219a1b23 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=756b7fc80837567d114a3c93e9bb987e219a1b23 commit 756b7fc80837567d114a3c93e9bb987e219a1b23 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:14:31 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add strlcpy SIMD implementation This changeset includes a port of the SIMD implementation of strlcpy for amd64 to Aarch64. It is based on memccpy (D46170) with some minor differences. Performance is significantly better than the scalar implementation. Benchmark results are as usual generated by the strperf utility written by fuz. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46243 --- lib/libc/aarch64/string/Makefile.inc | 3 +- lib/libc/aarch64/string/strlcpy.S | 316 +++++++++++++++++++++++++++++++++++ 2 files changed, 318 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 0b2974947389..34a84bcfe133 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -26,7 +26,8 @@ MDSRCS+= \ strcspn.S \ strpbrk.c \ strsep.c \ - strcat.c + strcat.c \ + strlcpy.S # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strlcpy.S b/lib/libc/aarch64/string/strlcpy.S new file mode 100644 index 000000000000..3859aaca447b --- /dev/null +++ b/lib/libc/aarch64/string/strlcpy.S @@ -0,0 +1,316 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include + + .weak strlcpy + .set strlcpy, __strlcpy + .text + +ENTRY(__strlcpy) + subs x2, x2, #1 + b.lo .L0 + + mov x9, x0 // stash copy of dst pointer + bic x10, x1, #0xf // src aligned + and x11, x1, #0xf // src offset + + ldr q1, [x10] + cmeq v1.16b, v1.16b, #0 // NUL found in head? + + mov x8, #-1 // fill register with 0xfff..fff + lsl x12, x11, #2 + lsl x8, x8, x12 // mask of bytes in the string + + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + ands x5, x5, x8 + b.ne .Lhead_nul + + ldr q3, [x10, #16] // load second string chunk + ldr q2, [x1] // load true head + mov x8, #32 + sub x8, x8, x11 + + cmeq v1.16b, v3.16b, #0 // NUL found in second chunk? + + subs x2, x2, x8 + b.ls .Lhead_buf_end + + /* process second chunk */ + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + cbnz x5, .Lsecond_nul + + /* string didn't end in second chunk and neither did buffer */ + ldr q1, [x10, #32] // load next string chunk + str q2, [x0] // deposit head into buffer + sub x0, x0, x11 // adjust x0 + str q3, [x0, #16] // deposit second chunk + add x10, x10, #32 // advance src + add x0, x0, #32 // advance dst + subs x2, x2, #16 // enough left for another round? + b.ls 1f + + /* main loop unrolled twice */ + .p2align 4 +0: + cmeq v2.16b, v1.16b, #0 // NUL found in second chunk? + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + + cbnz x5, 3f + + str q1, [x0] + ldr q1, [x10, #16] // load next chunk + + cmp x2, #16 // more than a full chunk left? + b.ls 2f + + add x10, x10, #32 // advance pointers + add x0, x0, #32 + + cmeq v2.16b, v1.16b, #0 // NUL found in second chunk? + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + cbnz x5, 4f // process chunk if match + + str q1, [x0, #-16] + ldr q1, [x10] // load next chunk + + subs x2, x2, #32 + b.hi 0b + +1: + sub x10, x10, #16 // undo second advancement + add x2, x2, #16 + sub x0, x0, #16 + + /* 1--16 bytes left in the buffer but string has not ended yet */ +2: + cmeq v2.16b, v1.16b, #0 // NUL found in second chunk? + shrn v2.8b, v2.8h, #4 + fmov x4, d2 + + mov x6, #0xf + mov x7, x4 + + lsl x5, x2, #2 // shift 0xf to the limits position + lsl x5, x6, x5 + cmp x2, #16 // dont induce match if limit >=16 + csel x5, x5, xzr, lo + orr x8, x4, x5 // treat limit as if terminator present + + rbit x8, x8 // simulate x86 tzcnt + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + add x0, x0, x8 + + ldr q1, [x10, x8] // load tail + str q1, [x0] // store tail + strb wzr, [x0, #16] + + /* continue to find the end of the string */ + cbnz x7, 1f + + /* we opt for a simpler strlen than the one in libc as the + * cmeq, shrn approach is faster for shorter strings. + */ + .p2align 4 +0: + ldr q1, [x10, #32] + cmeq v1.16b, v1.16b, #0 // bytewise compare against NUL + shrn v1.8b, v1.8h, #4 + fmov x7, d1 + cbnz x7, 2f + + ldr q1, [x10, #48] + cmeq v1.16b, v1.16b, #0 // bytewise compare against NUL + shrn v1.8b, v1.8h, #4 + fmov x7, d1 + add x10, x10, #32 + cbz x7, 0b + +1: sub x10, x10, #16 +2: rbit x8, x7 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + sub x10, x10, x1 + add x0, x10, #32 + add x0, x0, x8 + + ret + +4: + sub x10, x10, #16 // undo second advancement + sub x0, x0, #16 // undo second advancement + + /* string has ended but buffer has not */ +3: + rbit x8, x5 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + add x0, x0, x8 // restore dst pointer + add x10, x10, x8 + + ldr q1, [x10, #-15] + str q1, [x0, #-15] + add x0, x0, #1 + sub x0, x10, x1 + + ret + +.Lhead_buf_end: + shrn v1.8b, v1.8h, #4 + fmov x8, d1 + + add x2, x2, #32 // restore limit + + mov x7, x8 + mov x6, #0xf + + cmp x2, #16 // should we induce a match or not + b.lo 0f + + rbit x8, x8 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + add x8, x8, #16 + + cmp x8, x2 + csel x8, x8, x2, lo // copy min(buflen, srclen) bytes + b 1f +0: + + rbit x8, x8 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + mov x8, x2 +1: + + sub x8, x8, x11 + strb wzr, [x9, x8] + + /* continue to find the end of the string */ + cbnz x7, 1f + + /* we opt for a simpler strlen than the one in libc as the + * cmeq, shrn approach is faster for shorter strings. + */ + .p2align 4 +0: + ldr q1, [x10, #32] + cmeq v1.16b, v1.16b, #0 // bytewise compare against NUL + shrn v1.8b, v1.8h, #4 + fmov x7, d1 + cbnz x7, 2f + + ldr q1, [x10, #48] + cmeq v1.16b, v1.16b, #0 // bytewise compare against NUL + shrn v1.8b, v1.8h, #4 + fmov x7, d1 + add x10, x10, #32 + cbz x7, 0b + +1: sub x10, x10, #16 +2: rbit x6, x7 + clz x6, x6 // index of mismatch + lsr x6, x6, #2 + + sub x10, x10, x1 + add x0, x10, #32 + add x0, x0, x6 + + add x4, x9, x8 // dst + cnt + add x5, x1, x8 // src + cnt + + b .L1732 + +.Lsecond_nul: + add x2, x2, x8 + + rbit x8, x5 + clz x8, x8 // index of mismatch + lsr x5, x8, #2 + + sub x8, x11, #16 + sub x0, x5, x8 // string length + + cmp x0, x2 // did we match or hit limit first? + csel x8, x2, x0, hi + + add x4, x9, x8 // dst + cnt + add x5, x1, x8 // src + cnt + + strb wzr, [x4] + + /* copy 17-32 bytes */ +.L1732: + cmp x8, #16 + b.lo .L0816 + ldp x16, x17, [x1] + ldp x12, x1, [x5, #-16] + stp x16, x17, [x9] + stp x12, x1, [x4, #-16] + ret + +.Lhead_nul: + rbit x8, x5 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + sub x0, x8, x11 + cmp x0, x2 + csel x8, x2, x0, hi + + add x4, x9, x8 // dst + cnt + add x5, x1, x8 // src + cnt + strb wzr, [x4] + + /* Copy 8-16 bytes */ +.L0816: + tbz x8, #3, .L0407 + ldr x16, [x1] + ldr x17, [x5, #-8] + str x16, [x9] + str x17, [x4, #-8] + ret + + /* Copy 4-7 bytes */ + .p2align 4 +.L0407: + cmp x8, #3 + b.ls .L0203 + ldr w16, [x1] + ldr w18, [x5, #-4] + str w16, [x9] + str w18, [x4, #-4] + ret + +.L0203: + tbz x8, 1, .L0001 + ldrh w16, [x1] + ldrh w17, [x5, #-2] + strh w16, [x9] + strh w17, [x4, #-2] + ret + +.L0001: + ldrb w16, [x1] + strb w16, [x9] + strb wzr, [x4] + ret + +.L0: + mov x0, x1 + b strlen + ret +END(__strlcpy) From nobody Fri Jan 10 15:03:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4fz4g4kz5kTNN; Fri, 10 Jan 2025 15:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4fz1kbQz4wjn; Fri, 10 Jan 2025 15:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eRJvFue5D016lH2n0fxQq2x10Gh2p2YJzl+lFb/TC1M=; b=QtI5NDFiwaJ8csZXWMu5PJLeq+y5QZoDK9efJoPUF2Wop1nM643aft7Vz5FEcTJG96/lfo mNF7aMywDWdNQAyYeC1DjN84+ct+d9WQlL/rNhJa7HA/f25l15C/DXiGK5SwoYcXIPJRh+ uVtCP/wP39HS1JETuCZ+U71400CI9vOTFqimNosUGE1y3WghhRbMK6D8f90EgMN10zN9ES n3Nczqwxdx7PDJa474+0mwyBLfFaXca1Hw6lzs99RzGdmQZTCaAvVKrLodIIcHIwgJ4z/r a2foXlo9wIq9Xy+NoeR3T9x9FilRSgRIlPJxp9zNEgG3Ozrs8YPUFr5Zj+byBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eRJvFue5D016lH2n0fxQq2x10Gh2p2YJzl+lFb/TC1M=; b=OC/Hh5IhpWNlqFQGBMRUKJ5KBvq/eITXSo8YeZYqgH8MNE4Onty31rSPA0OGTrjzqy/1Rp FssOvAf6kJC4FElg76tySAX1RKgl2qdXicC1GXjFqgWrGTJr/9t8AY8Vjeo10AxoJdPeod DJ0yk3CVRIoh0ByRgziZ0R8wya4jzL17TapfIrpM0urWrETF/eU176vBNGE4YU1MIbkn1F wsijXx87F1dq4ai4FpgcpV1MXXkVfQ9j1VJZgm5BAPM0EiPQumGgWTylWf4DjKj60Hugog BULd97/VIwKCGfpdGXxKJVDjdebZrl9Y9goOQFS/tvqYQC8SlX3HcLTKeItthA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521435; a=rsa-sha256; cv=none; b=ccURjfE6yRA3VJc6zhpKFPchcfWO6x6DZ19+zch3Oi5oufnRg4QZ63UngaIKt4voCAq/bP q9L4y2CZJV1L9wyALPWyDskpZCiViy7x50iDsJQLcjHgiz4TLlekRsF433iZIFUJ96NN3J QYS35eiQH3Wea2pZxaXviYvzspeyLyXbzypdFwhQTb/qbmBgsm3G8Czj+AZMTSSN7C/vED K4mKVowh1GraC+u4NyC2dDV810YxnoqLYEVQabuVa029/6/CLzN2GuItto9BVwYJZWWatD Mi0gPdepRKTuwOwYrT1V97/M0VSKkEfR+BTDwRoeUSRgAjzB/A7rNWYTt8CPTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4fz1K3sz1nM; Fri, 10 Jan 2025 15:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3t8q057191; Fri, 10 Jan 2025 15:03:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3t16057188; Fri, 10 Jan 2025 15:03:55 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:55 GMT Message-Id: <202501101503.50AF3t16057188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 25c485e14769 - main - lib/libc/aarch64/string: add strncmp SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25c485e147691f3929b0b5029bab58bf56d3606b Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=25c485e147691f3929b0b5029bab58bf56d3606b commit 25c485e147691f3929b0b5029bab58bf56d3606b Author: Getz Mikalsen AuthorDate: 2024-08-26 18:14:37 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add strncmp SIMD implementation This changeset includes a port of the SIMD implementation of strncmp for amd64 to Aarch64. It is based on D45839 with added handling for the limit. An extended unit test for strncmp is currently being written to make sure the bounds checks for page crossings work as expected. Performance is significantly better than the existing implementation from the Arm Optimized Routines repository. Benchmark results are generated by the strperf utility by fuz. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D45943 --- lib/libc/aarch64/string/Makefile.inc | 4 +- lib/libc/aarch64/string/strncmp.S | 569 +++++++++++++++++++++++++++++++++++ 2 files changed, 571 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 34a84bcfe133..351f3424b6d0 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -15,7 +15,6 @@ AARCH64_STRING_FUNCS= \ strchrnul \ strcpy \ strlen \ - strncmp \ strnlen \ strrchr @@ -27,7 +26,8 @@ MDSRCS+= \ strpbrk.c \ strsep.c \ strcat.c \ - strlcpy.S + strlcpy.S \ + strncmp.S # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strncmp.S b/lib/libc/aarch64/string/strncmp.S new file mode 100644 index 000000000000..a7f4156da9e8 --- /dev/null +++ b/lib/libc/aarch64/string/strncmp.S @@ -0,0 +1,569 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include +#include + + .weak strncmp + .set strncmp, __strncmp + .text + +ENTRY(__strncmp) + + bic x8, x0, #0xf // x0 aligned to the boundary + and x9, x0, #0xf // x9 is the offset + bic x10, x1, #0xf // x1 aligned to the boundary + and x11, x1, #0xf // x11 is the offset + + subs x2, x2, #1 + b.lo .Lempty + + mov x13, #-1 // save constants for later + mov x16, #0xf + + /* + * Check if either string is located at end of page to avoid crossing + * into unmapped page. If so, we load 16 bytes from the nearest + * alignment boundary and shift based on the offset. + */ + + add x3, x0, #16 // end of head + add x4, x1, #16 + eor x3, x3, x0 + eor x4, x4, x1 // bits that changed + orr x3, x3, x4 // in either str1 or str2 + cmp x2,#16 + b.lo .Llt16 + tbz w3, #PAGE_SHIFT, .Lbegin + + ldr q0, [x8] // load aligned head + ldr q1, [x10] + + lsl x14, x9, #2 + lsl x15, x11, #2 + lsl x3, x13, x14 // string head + lsl x4, x13, x15 + + cmeq v5.16b, v0.16b, #0 + cmeq v6.16b, v1.16b, #0 + + shrn v5.8b, v5.8h, #4 + shrn v6.8b, v6.8h, #4 + fmov x5, d5 + fmov x6, d6 + + adrp x14, shift_data + add x14, x14, :lo12:shift_data + + /* heads may cross page boundary, avoid unmapped loads */ + tst x5, x3 + b.eq 0f + + ldr q4, [x14, x9] // load permutation table + tbl v0.16b, {v0.16b}, v4.16b + + b 1f + .p2align 4 +0: + ldr q0, [x0] // load true head +1: + tst x6, x4 + b.eq 0f + + ldr q4, [x14, x11] + tbl v4.16b, {v1.16b}, v4.16b + + b 1f + + .p2align 4 +.Lbegin: + ldr q0, [x0] // load true heads +0: + ldr q4, [x1] +1: + cmeq v2.16b, v0.16b, #0 // NUL byte present? + cmeq v4.16b, v0.16b, v4.16b // which bytes match? + + orn v2.16b, v2.16b, v4.16b // mismatch or NUL byte? + + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + + cbnz x5, .Lhead_mismatch + /* load head and second chunk */ + ldr q2, [x8, #16] // load second chunk + ldr q3, [x10, #16] + + add x2, x2, x11 + sub x2, x2, #16 + + subs x9, x9, x11 // is a&0xf >= b&0xf + b.lo .Lswapped // if not swap operands + b .Lnormal + + .p2align 4 +.Llt16: + /* + * Check if either string is located at end of page to avoid crossing + * into unmapped page. If so, we load 16 bytes from the nearest + * alignment boundary and shift based on the offset. + */ + tbz w3, #PAGE_SHIFT, 2f + + ldr q0, [x8] // load aligned head + ldr q1, [x10] + + lsl x14, x9, #2 + lsl x15, x11, #2 + lsl x3, x13, x14 // string head + lsl x4, x13, x15 + + /* Introduce a null byte match if the limit is within the aligned chunk */ + add x14, x2, x9 + add x15, x2, x11 + lsl x14, x14, #2 + lsl x15, x15, #2 + lsl x14, x16, x14 + lsl x15, x16, x15 + + cmeq v5.16b, v0.16b, #0 + cmeq v6.16b, v1.16b, #0 + + shrn v5.8b, v5.8h, #4 + shrn v6.8b, v6.8h, #4 + fmov x5, d5 + fmov x6, d6 + + orr x5, x5, x14 // insert match at limit + orr x6, x6, x15 + + adrp x14, shift_data + add x14, x14, :lo12:shift_data + + /* heads may cross page boundary, avoid unmapped loads */ + tst x5, x3 + b.eq 0f + + ldr q4, [x14, x9] // load permutation table + tbl v0.16b, {v0.16b}, v4.16b + + b 1f + .p2align 4 +0: + ldr q0, [x0] // load true head +1: + tst x6, x4 + b.eq 0f + + ldr q4, [x14, x11] + tbl v4.16b, {v1.16b}, v4.16b + + b 1f + + .p2align 4 +2: + ldr q0, [x0] // load true heads +0: + ldr q4, [x1] +1: + + cmeq v2.16b, v0.16b, #0 // NUL byte present? + cmeq v4.16b, v0.16b, v4.16b // which bytes match? + + bic v2.16b, v4.16b, v2.16b // match and not NUL byte + + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + lsl x4, x2, #2 + lsl x4, x13, x4 + orn x5, x4, x5 // mismatch or NUL byte? + +.Lhead_mismatch: + rbit x3, x5 + clz x3, x3 // index of mismatch + lsr x3, x3, #2 + ldrb w4, [x0, x3] + ldrb w5, [x1, x3] + sub w0, w4, w5 + ret + + .p2align 4 +.Lnormal: + sub x12, x10, x9 + ldr q0, [x12, #16]! + sub x10, x10, x8 + sub x11, x10, x9 + + cmeq v1.16b, v3.16b, #0 // NUL present? + cmeq v0.16b, v0.16b, v2.16b // Mismatch between chunks? + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + + add x8, x8, #32 // advance to next iteration + + lsl x4, x2, #2 + lsl x4, x13, x4 + orr x3, x6, x4 // introduce a null byte match + cmp x2, #16 // does the buffer end within x2 + csel x6, x3, x6, lo + cbnz x6, .Lnulfound2 // NUL or end of buffer found? + mvn x5, x5 + cbnz x5, .Lmismatch2 + sub x2, x2, #16 + cmp x2, #32 // end of buffer? + b.lo .Ltail + /* + * During the main loop, the layout of the two strings is something like: + * + * v ------1------ v ------2------ v + * X0: AAAAAAAAAAAAABBBBBBBBBBBBBBBB... + * X1: AAAAAAAAAAAAABBBBBBBBBBBBBBBBCCC... + * + * where v indicates the alignment boundaries and corresponding chunks + * of the strings have the same letters. Chunk A has been checked in + * the previous iteration. This iteration, we first check that string + * X1 doesn't end within region 2, then we compare chunk B between the + * two strings. As X1 is known not to hold a NUL byte in regions 1 + * and 2 at this point, this also ensures that x0 has not ended yet. + */ + .p2align 4 +0: + ldr q0, [x8, x11] + ldr q1, [x8, x10] + ldr q2, [x8] + + cmeq v1.16b, v1.16b, #0 // end of string? + cmeq v0.16b, v0.16b, v2.16b // do the chunks match? + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + cbnz x6, .Lnulfound + mvn x5, x5 // any mismatches? + cbnz x5, .Lmismatch + + add x8, x8, #16 + + /* main loop unrolled twice */ + ldr q0, [x8, x11] + ldr q1, [x8, x10] + ldr q2, [x8] + + add x8, x8, #16 + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + cbnz x6, .Lnulfound2 + mvn x5, x5 + cbnz x5, .Lmismatch2 + sub x2, x2, #32 + cmp x2, #32 // end of buffer? + b.hs 0b // if yes, process tail + + /* end of buffer will occur in next 32 bytes */ +.Ltail: + ldr q0, [x8, x11] + ldr q1, [x8, x10] + ldr q2, [x8] + + cmeq v1.16b, v1.16b, #0 // end of string? + cmeq v0.16b, v0.16b, v2.16b // do the chunks match? + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + + /* + * If x2 <= 16 then we introduce a NUL byte in the + * result from CMEQ to avoid comparing further! + */ + + lsl x4, x2, #2 + lsl x4, x13, x4 + orr x3, x6, x4 // introduce a null byte match + cmp x2, #16 // does the buffer end within x2 + csel x6, x3, x6, lo + + cbnz x6, .Lnulfound // NUL or end of string found + mvn x5, x5 + cbnz x5, .Lmismatch + + add x8, x8, #16 + + /* main loop unrolled twice */ + ldr q0, [x8, x11] + ldr q1, [x8, x10] + ldr q2, [x8] + + add x8, x8, #16 + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + + ubfiz x4, x2, #2, #4 // (x2 - 16) << 2 + lsl x4, x13, x4 // take first half into account + orr x6, x6, x4 // introduce a null byte match + +.Lnulfound2: + sub x8, x8, #16 + +.Lnulfound: + mov x4, x6 + + ubfiz x7, x9, #2, #4 + lsl x6, x6, x7 // adjust NUL mask to indices + + orn x5, x6, x5 + cbnz x5, .Lmismatch + + /* + * (x0) == (x1) and NUL is past the string. + * Compare (x1) with the corresponding part + * of the other string until the NUL byte. + */ + ldr q0, [x8, x9] + ldr q1, [x8, x10] + + cmeq v1.16b, v0.16b, v1.16b + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + orn x5, x4, x5 + + rbit x3, x5 + clz x3, x3 + lsr x5, x3, #2 + + add x10, x10, x8 // restore x10 pointer + add x8, x8, x9 // point to corresponding chunk + + ldrb w4, [x8, x5] + ldrb w5, [x10, x5] + sub w0, w4, w5 + ret + + .p2align 4 +.Lmismatch2: + sub x8, x8, #16 // roll back second increment +.Lmismatch: + rbit x3, x5 + clz x3, x3 // index of mismatch + lsr x3, x3, #2 + add x11, x8, x11 + + ldrb w4, [x8, x3] + ldrb w5, [x11, x3] + sub w0, w4, w5 // byte difference + ret + + /* + * If (a&0xf) < (b&0xf), we do the same thing but with swapped + * operands. I found that this performs slightly better than + * using conditional moves to do the swap branchless. + */ + .p2align 4 +.Lswapped: + add x12, x8, x9 + ldr q0, [x12, #16]! + sub x8, x8, x10 + add x11, x8, x9 + add x2,x2,x9 + neg x9, x9 + + cmeq v1.16b, v2.16b, #0 + cmeq v0.16b, v0.16b, v3.16b + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + + add x10, x10, #32 + + lsl x4, x2, #2 + lsl x4, x13, x4 + orr x3,x6,x4 // introduce a null byte match + cmp x2,#16 + csel x6, x3, x6, lo + cbnz x6, .Lnulfound2s + mvn x5, x5 + cbnz x5, .Lmismatch2s + + sub x2, x2, #16 + cmp x2, #32 + b.lo .Ltails + + /* + * During the main loop, the layout of the two strings is something like: + * + * v ------1------ v ------2------ v + * X1: AAAAAAAAAAAAABBBBBBBBBBBBBBBB... + * X0: AAAAAAAAAAAAABBBBBBBBBBBBBBBBCCC... + * + * where v indicates the alignment boundaries and corresponding chunks + * of the strings have the same letters. Chunk A has been checked in + * the previous iteration. This iteration, we first check that string + * X0 doesn't end within region 2, then we compare chunk B between the + * two strings. As X0 is known not to hold a NUL byte in regions 1 + * and 2 at this point, this also ensures that X1 has not ended yet. + */ + .p2align 4 +0: + ldr q0, [x10, x11] + ldr q1, [x10, x8] + ldr q2, [x10] + + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + cbnz x6, .Lnulfounds + mvn x5, x5 + cbnz x5, .Lmismatchs + + add x10, x10, #16 + + /* main loop unrolled twice */ + ldr q0, [x10, x11] + ldr q1, [x10, x8] + ldr q2, [x10] + + add x10, x10, #16 + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + cbnz x6, .Lnulfound2s + mvn x5, x5 + cbnz x5, .Lmismatch2s + sub x2, x2, #32 + cmp x2, #32 + b.hs 0b + +.Ltails: + ldr q0, [x10, x11] + ldr q1, [x10, x8] + ldr q2, [x10] + + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + + /* + * If x2 <= 16 then we introduce a NUL byte in the + * result from CMEQ to avoid comparing further! + */ + + lsl x4, x2, #2 + lsl x4, x13, x4 + orr x3, x6, x4 // introduce a null byte match + cmp x2, #16 + csel x6, x3, x6, lo + + cbnz x6, .Lnulfounds + mvn x5, x5 + cbnz x5, .Lmismatchs + + add x10, x10, #16 + + ldr q0, [x10, x11] + ldr q1, [x10, x8] + ldr q2, [x10] + + add x10, x10, #16 + cmeq v1.16b, v1.16b, #0 + cmeq v0.16b, v0.16b, v2.16b + + shrn v1.8b, v1.8h, #4 + shrn v0.8b, v0.8h, #4 + fmov x6, d1 + fmov x5, d0 + + ubfiz x4, x2, #2, #4 + lsl x4, x13, x4 + orr x6, x6, x4 // introduce a null byte match + +.Lnulfound2s: + sub x10, x10, #16 +.Lnulfounds: + mov x4, x6 + + ubfiz x7, x9, #2, #4 + lsl x6, x6, x7 + + orn x5, x6, x5 + + cbnz x5, .Lmismatchs + + ldr q0, [x10, x9] + ldr q1, [x10, x8] + + cmeq v1.16b, v0.16b, v1.16b + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + orn x5, x4, x5 + + rbit x3, x5 + clz x3, x3 + lsr x5, x3, #2 + + add x11, x10, x8 + add x10, x10, x9 + + ldrb w4, [x10, x5] + ldrb w5, [x11, x5] + sub w0, w5, w4 + ret + + .p2align 4 +.Lmismatch2s: + sub x10, x10, #16 +.Lmismatchs: + rbit x3, x5 + clz x3, x3 + lsr x3, x3, #2 + add x11, x10, x11 + + ldrb w4, [x10, x3] + ldrb w5, [x11, x3] + sub w0, w5, w4 + ret + + .p2align 4 +.Lempty: + eor x0, x0, x0 + ret + +END(__strncmp) + + .section .rodata + .p2align 4 +shift_data: + .byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + .fill 16, 1, -1 + .size shift_data, .-shift_data From nobody Fri Jan 10 15:03:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g21yQbz5kTfF; Fri, 10 Jan 2025 15:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g13fxpz4x2P; Fri, 10 Jan 2025 15:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBkgiTpbEO4nfrYnuSvYnpfM0v7MvGXiaxsKqLhq3rc=; b=Tq04ns4jdbpcH/PXbrxXmG5qsP5eulM7CnHz5s7pezDx3GCD8An0U375YiYiEGFQNVS5mi 2IwqRChdJvMPVyuPFk1Gbn+11gcEXH/ZJ/mjgzBbOiYxIfD7EgZTQv/2/vOPUaZ7DXA0GS hrXKOnW/zsfjvcIq/rsiaTWxBrnv5/ycV8p6uxjLDG74ONJ3u5kXuuYhLdWMX99rXNimIc cdI1ll5gjwlAuBcpHTpKCx5r2hrIAmn6LVQlQoY6Xf/ij+hAing2B8GvJOaSuOsIQKfbMW yNg24ny3GXpmmXdReNkHgjn0RpdtYdfUPNIcco6Xa/TGSn8PEjdZwDrwU6oWTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBkgiTpbEO4nfrYnuSvYnpfM0v7MvGXiaxsKqLhq3rc=; b=CrPm52NlrWkLiGjNXR8iCPadhTpuO8BDvIvADtzQRz0f8PEaYABlgc5bRo1hm+seuplk56 okHMwLPV2k/LctsJEpFLnvHx4BFckLX2mfOQvfQRQS8s+a+pAPmrt3rkvmJ+GUVtqlQQMn 8M/oFyKH8i0UcEg5NO7DIuQD+lTgpITRILgdghCv2mTNMS83bt9QgfHjfGc92KlZ9ASMgJ Zqzg2m+CvbqJKS9F3GKSwMD9NdUYRoz8aK4g3EVLXm0GAFORJ4yYychxc+4AH+CO1jvTd9 LP5G8yB2O7dPdvj5FlG2fHRsQouqGbYzIRq+VdAHWznteAHJvmqHJ0KU6bMBUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521437; a=rsa-sha256; cv=none; b=ua5LFLTGCHm5+we0uL4BVHHO3RibZiC6ukXw3ra+7ux6hvv5TJU4ST3uKDaN7uxhrE+plY QavgG5QV99de9I/V1+60/aNREIToMH3/j4xKebrq80is1FIdR1hLQygWzZ1TCbsjGRhGyD 63ipM5RDutVclfC93K3zI3K+VJBIwviVxZnOQUs0TkwuGxpc7gZX3iswKWBEivHNBuV2jP XZZihxlWv46tVF4TkiNR5JE/G5pEABJOL1KTOW/rGEhPJvjk+w6TqrpuJPXXw4im3jq5FO 9lzdqvkJrdbh1NPrPoo3m2eVnEjU3pFptJluMc3V/WmvcEEwf9HTrU8Ld4xnDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g135l3z2Jg; Fri, 10 Jan 2025 15:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3vph057281; Fri, 10 Jan 2025 15:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3vpD057278; Fri, 10 Jan 2025 15:03:57 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:57 GMT Message-Id: <202501101503.50AF3vpD057278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 3dc5429158cf - main - lib/libc/aarch64/string: add strncat SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dc5429158cf221374cdbd0bbb728962bff4fb76 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc5429158cf221374cdbd0bbb728962bff4fb76 commit 3dc5429158cf221374cdbd0bbb728962bff4fb76 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:15:34 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add strncat SIMD implementation This patch requires D46170 as it depends on strlcpy being labeled __memccpy. It's a direct copy from the amd64 string functions. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46292 --- lib/libc/aarch64/string/Makefile.inc | 3 ++- lib/libc/aarch64/string/strncat.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 78145a17ab85..876ef4257b4c 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -28,7 +28,8 @@ MDSRCS+= \ strcat.c \ strlcpy.S \ strncmp.S \ - memccpy.S + memccpy.S \ + strncat.c # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strncat.c b/lib/libc/aarch64/string/strncat.c new file mode 100644 index 000000000000..33b278ac5e04 --- /dev/null +++ b/lib/libc/aarch64/string/strncat.c @@ -0,0 +1,29 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Robert Clausecker + */ + +#include + +#include + +void *__memccpy(void *restrict, const void *restrict, int, size_t); + +char * +strncat(char *dest, const char *src, size_t n) +{ + size_t len; + char *endptr; + + len = strlen(dest); + endptr = __memccpy(dest + len, src, '\0', n); + + /* avoid an extra branch */ + if (endptr == NULL) + endptr = dest + len + n + 1; + + endptr[-1] = '\0'; + + return (dest); +} From nobody Fri Jan 10 15:03:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g105Zjz5kTfB; Fri, 10 Jan 2025 15:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g02sw6z4wk3; Fri, 10 Jan 2025 15:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4alpVQ+LjifUOAk29sitrinobqYxCTZPSlhD8qnkuR4=; b=g6Hyg1W9E2fpydXJJ8ayLIiPmTjOg0AWT8Vo66F+zwrzAzb/7X5gS6fYNuDy6btDcxct89 zTpxkGXRp093JzStgABMNGvbQMyJozbv+uuQU12ESPyElvzBMipj/SFbBS0A0SiPmzWO7T ufSRZoEeiGUucTVEV1bz0YGp7XcSWDjzG7u1lR2pybxERXIe/QC2mfx8vd1I5PQa3Q+79Y eXNQdh3LfKei747P8kvH5PNE+FNnyZUmKuI6oVwtNgbIIBWiRoMoHYTbsQuN18zHeyoQZm dvsHDbk0G6RgDL7UKuXOEso5eGMOhrXmLWseBZDKd7gTVH1vo5yIFbT8xtPGaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4alpVQ+LjifUOAk29sitrinobqYxCTZPSlhD8qnkuR4=; b=LyrhaFZzOoid0RJU5/Cix03HVSkJ/fYwCAqnsNCZdKELlifG9GeuplI2TZA83ssVFdEEoy 5xUiHHccz02vHzmFLNX2AgqF8p7AdTB0UgUoODrO7j69LboltigB5Ol0FjjKCuZcWW60W4 wIEQPf8yubrpZueLJIWK0e/1eVNank0W8q+Iu66h7flriPMD8ScxBAgYGhwNZD77SU5+y6 PppsBkodgNVpt5TKtpYGvLczCaCLAq7SDLNdhPevn2JZBrzVsDj9a1kNTi58W8hNpqIPyv LUUuT+cx0xjqzfe+JOWh10ELFhQ5JdTcMCm4vaE6AEIR3gDXqxKVD3R/8lhTXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521436; a=rsa-sha256; cv=none; b=TFOGE2VG4MJcPcmsGZe5LhlfZWHL3gUjPn1FmiEQgRQn01jXdJEpPjEMNyOZBD0JKCLjMT 2Pm6elx9F+flmP/IXwZR6w3eJVAptnSf3hwupySuJHuR7hoEUTFay6upJxsIPSO7Rwh4oy dm3U7yPdop8Qjy0GNQuipDrbdl14BfpaYucKVZyZtMeMjP/EwOY4+WKcpiTYupPNzvOzCN XlRjt/TsQj6a73tz/iyfJlq+8JqcPuSbYDVG4i/lTWqDEnUnenzpuVcpFCmbG9GuUaX90i YLEOkfHle/1evl1IC+LU9kB6bclbRFTmcQl4pb0eSdfMbzSpnhF7G7wbAN2N2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g027f7z22g; Fri, 10 Jan 2025 15:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3uxR057233; Fri, 10 Jan 2025 15:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3u56057230; Fri, 10 Jan 2025 15:03:56 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:56 GMT Message-Id: <202501101503.50AF3u56057230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: bad17991c06d - main - lib/libc/aarch64/string: add memccpy SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad17991c06d684e9053938d00a07b962e2fd31c Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=bad17991c06d684e9053938d00a07b962e2fd31c commit bad17991c06d684e9053938d00a07b962e2fd31c Author: Getz Mikalsen AuthorDate: 2024-08-26 18:15:13 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add memccpy SIMD implementation This changeset includes a port of the SIMD implementation of memccpy for amd64 to Aarch64. Performance is significantly better than the scalar implementation except for short strings. Benchmark results are as usual generated by the strperf utility written by fuz. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46170 --- lib/libc/aarch64/string/Makefile.inc | 3 +- lib/libc/aarch64/string/memccpy.S | 271 +++++++++++++++++++++++++++++++++++ 2 files changed, 273 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 351f3424b6d0..78145a17ab85 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -27,7 +27,8 @@ MDSRCS+= \ strsep.c \ strcat.c \ strlcpy.S \ - strncmp.S + strncmp.S \ + memccpy.S # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/memccpy.S b/lib/libc/aarch64/string/memccpy.S new file mode 100644 index 000000000000..7d9fdb14b84b --- /dev/null +++ b/lib/libc/aarch64/string/memccpy.S @@ -0,0 +1,271 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include + + .weak memccpy + .set memccpy, __memccpy + .text + +ENTRY(__memccpy) + subs x3, x3, #1 + b.lo .L0 + + dup v0.16b, w2 + + mov x9, x0 // stash copy of src pointer + bic x10, x1, #0xf // src aligned + and x11, x1, #0xf // src offset + + ldr q1, [x10] + cmeq v1.16b, v1.16b, v0.16b // bytewise compare against src char + + mov x8, #-1 // prepare a 0xfff..fff register + mov x6, #0xf + + lsl x12, x11, #2 + lsl x8, x8, x12 // mask of bytes in the string + + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + sub x12, x11, #32 + adds x12, x12, x3 // distance from alignment boundary - 32 + b.cc .Lrunt // branch if buffer length is 32 or less + + ands x8, x8, x5 + b.eq 0f + + /* match in first chunk */ + rbit x8, x8 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + sub x8, x8, x11 // ... from beginning of the string + + add x0, x0, x8 + add x4, x9, x8 // dst + cnt + add x5, x1, x8 // src + cnt + add x0, x0, #1 + + b .L0816 + +0: + ldr q3, [x10, #16] // load second string chunk + ldr q2, [x1] // load true head + cmeq v1.16b, v3.16b, v0.16b // char found in second chunk? + + /* process second chunk */ + shrn v1.8b, v1.8h, #4 + fmov x5, d1 + + cbz x5, 0f + + /* match in second chunk */ + rbit x8, x5 + clz x8, x8 // index of mismatch + lsr x8, x8, #2 + + sub x11, x11, #16 + sub x8, x8, x11 // adjust for alignment offset + add x0, x0, x8 // return value + add x0, x0, #1 + + add x4, x9, x8 + add x5, x1, x8 + b .L1732 + +0: + /* string didn't end in second chunk and neither did buffer */ + ldr q1, [x10, #32] // load next string chunk + str q2, [x0] // deposit head into buffer + sub x0, x0, x11 // adjust x0 + mov x3, x12 + str q3, [x0, #16] // deposit second chunk + + add x10, x10, #32 // advance src + add x0, x0, #32 // advance dst + subs x3, x3, #16 // enough left for another round? + b.lo 1f + + /* main loop unrolled twice */ + .p2align 4 +0: + cmeq v2.16b, v1.16b, v0.16b // char found in second chunk? + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + + cbnz x5, 3f + + str q1, [x0] + ldr q1, [x10, #16] // load next chunk + + cmp x3, #16 // more than a full chunk left? + b.lo 2f + + add x10, x10, #32 // advance pointers + add x0, x0, #32 + + cmeq v2.16b, v1.16b, v0.16b // char found in second chunk? + shrn v2.8b, v2.8h, #4 + fmov x5, d2 + cbnz x5, 4f // process chunk if match + + str q1, [x0, #-16] + ldr q1, [x10] // load next chunk + + subs x3, x3, #32 + b.hs 0b + +1: + sub x10, x10, #16 // undo second advancement + add x3, x3, #16 + sub x0, x0, #16 + + /* 1--16 bytes left in the buffer but string has not ended yet */ +2: + cmeq v2.16b, v1.16b, v0.16b // char found in second chunk? + shrn v2.8b, v2.8h, #4 + fmov x4, d2 + + lsl x5, x3, #2 // shift 0xf to the limits position + lsl x5, x6, x5 + orr x8, x4, x5 // insert match in mask at limit + + rbit x8, x8 // simulate x86 tzcnt + clz x7, x8 // index of mismatch + lsr x8, x7, #2 + + lsl x5, x6, x7 // simulate x86 bt with shifted 0xf + + add x8, x8, #1 + add x0, x0, x8 + + ldr q1, [x10, x8] // load tail + str q1, [x0] // store tail + + add x0, x0, #16 + + tst x4, x5 // terminator encountered inside buffer? + csel x0, x0, xzr, ne // if yes, return pointer, else NUL + ret + +4: + sub x10, x10, #16 // undo second advancement + sub x0, x0, #16 // undo second advancement + +3: + rbit x8, x5 + clz x8, x8 // index of mismatch + lsr x3, x8, #2 + + add x0, x0, x3 // restore dst pointer + add x10, x10, x3 + ldr q1, [x10, #-15] + str q1, [x0, #-15] + add x0, x0, #1 + ret + +.Lrunt: + add x13, x11, x3 + + mov x7, x5 // keep a copy of original match mask + + lsl x4, x12, #2 // shift 0xf to the limits position + lsl x4, x6, x4 + + cmp x13, #16 // dont induce match if limit >=16 + csel x4, x4, xzr, lo + orr x5, x5, x4 // insert match in mask at limit + + ands x8, x8, x5 // if match always fall through + b.ne 0f + + ldr q4, [x10, #16] // load second string chunk + cmeq v1.16b, v4.16b, v0.16b // char found in second chunk? + + /* process second chunk */ + shrn v1.8b, v1.8h, #4 + fmov x8, d1 + mov x7, x8 + + lsl x4, x12, #2 + lsl x4, x6, x4 + orr x8, x8, x4 // induce match in upper bytes of mask + + rbit x8, x8 + clz x4, x8 // index of mismatch + lsr x8, x4, #2 + add x8, x8, #16 // no match in first chunk + b 1f + +0: + rbit x8, x8 + clz x4, x8 // index of mismatch + lsr x8, x4, #2 +1: + add x0, x0, x8 // return value if terminator not found + sub x0, x0, x11 + add x0, x0, #1 + + /* check if we encountered a match or the limit first */ + lsl x5, x6, x4 + ands x7, x7, x5 // was the terminator present? + csel x0, xzr, x0, eq // return value based on what we matched + + sub x8, x8, x11 + add x4, x9, x8 // dst + cnt + add x5, x1, x8 // src + cnt + + /* copy 17-32 bytes */ +.L1732: + cmp x8, #16 + b.lo .L0816 + add x5, x5, #1 // ldp offsets are powers of 2 + add x4, x4, #1 + ldp x16, x17, [x1] + ldp x12, x13, [x5, #-16] + stp x16, x17, [x9] + stp x12, x13, [x4, #-16] + ret + + /* Copy 8-16 bytes */ +.L0816: + tbz x8, #3, .L0407 + ldr x16, [x1] + ldr x17, [x5, #-7] + str x16, [x9] + str x17, [x4, #-7] + ret + + /* Copy 4-7 bytes */ + .p2align 4 +.L0407: + cmp x8, #3 + b.lo .L0103 + ldr w16, [x1] + ldr w18, [x5, #-3] + str w16, [x9] + str w18, [x4, #-3] + ret + + /* Copy 1-3 bytes */ + .p2align 4 +.L0103: + lsr x14, x8, #1 + ldrb w16, [x1] + ldrb w15, [x5] + ldrb w18, [x1, x14] + strb w16, [x9] + strb w18, [x9, x14] + strb w15, [x4] + ret + +.L0: + eor x0, x0, x0 + ret + +END(__memccpy) From nobody Fri Jan 10 15:03:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g40ZxMz5kTNT; Fri, 10 Jan 2025 15:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g35VXBz4x56; Fri, 10 Jan 2025 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oObzkAwmzs045FD/NwBMsIOV34w3MsCIelyV9AUlgo=; b=r1qzKY3eQYOPIM0tbc5/RSmanstlG0RPxvHTxiHsu+UbzwKt9BsKBzQS5VPc9DoqltNCS+ u9uMT6kylpJ9LtlN9d86h4V4rBeaCaClC+7Sk0819B78ghDa2bREYO5h9nTHpYIRpv7yN/ oG/x5lLpfchS2VX5u6ztL/mxnvbDK260IkJ9r1+ENGgUMhyrYXgNQaDJbj1M/Y9wAadOc4 nLOdGnB9ITmfEhcrkmbpPKF/iNPZN/thC2pFr+wYbN5BXSTN40KNpF4r9v5pUWFlBcAbqV dGpSWnDvWClMNKeUHafSj8a0XyhvHiYPmZPSGRPrWrxS/Pr633YFqW3QDzkHiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oObzkAwmzs045FD/NwBMsIOV34w3MsCIelyV9AUlgo=; b=MazsSym707Je3687pbjLFSu5BJTU1f1lXmTnF/UFrzKoYuaZj3GcYqfJRs0f6mRypAZn2K j32v1EwQ8GVbCfGSBqSytK8du3oFyvYvllHFE2oCbgoHiTvAf0YVQxAT8lTSOXTueHtOCJ Th26v68Cj6dlF+6+B0MQ9HLFzmvsS0L5I6lrO1YK5IK8EcbyJA+COcI16xLUOllob3YeOs JaMWOoSwQ5u+TzBEoHjC+tZ4XCsOif8gLe5wQFeKIyjXurLuAe+lti5XiQI/ysxZ+bvzC2 XDsLZ48d1Tz5RAERAD5QTG0r3ck0rlVIq71xu4dexX1mjEsm2yM39UoED+DHYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521439; a=rsa-sha256; cv=none; b=dN/O3XAK5wjPFd/TOkTAOssnWyAr66Ikfl7GRXQP7F4+CSpdirZZepxrEq/0pATaMmepV0 ufXxbPN/SebrrVHSyjKH9d/cNWzJERfjdOw65pmi2w/Wy1Xnme8KEHQDc7D4tHchXKQ2fP D7y2p8vVGrUY6rLFUaNznAU5942hjOP5xf8IeQ9VVka2PfHxrmihtenparNCV/q2M8BkMz m/IxyiOw08vC3tfTKG3HwRyk11tRpJPXmHqyNX8I0ypeptteDqHEoaSm1HrA3o5SAcE1lC BlCAlcK3Md8G7s2k5llnBCxgGHxn6m0uzbACQxXuHpK3fpPIHOKrixc0e/5hvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g354dwz2Jj; Fri, 10 Jan 2025 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3xHk057366; Fri, 10 Jan 2025 15:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3xt4057363; Fri, 10 Jan 2025 15:03:59 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:59 GMT Message-Id: <202501101503.50AF3xt4057363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 5ebd4d0dd2f4 - main - lib/libc/aarch64/string: add memcpy SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ebd4d0dd2f45040aa5e5b028a4b93163aea6899 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=5ebd4d0dd2f45040aa5e5b028a4b93163aea6899 commit 5ebd4d0dd2f45040aa5e5b028a4b93163aea6899 Author: Getz Mikalsen AuthorDate: 2024-08-26 18:13:44 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add memcpy SIMD implementation I noticed that we have a SIMD optimized memcpy in the arm-optimized-routines in /contrib. This patch ensures we use the SIMD variant as opposed to the Scalar optimized variant. Benchmarks are generated by fuz' strperf utility. See the DR for benchmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46251 --- lib/libc/aarch64/string/memcpy.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/aarch64/string/memcpy.S b/lib/libc/aarch64/string/memcpy.S index f403dd2e42a8..53e860750eb2 100644 --- a/lib/libc/aarch64/string/memcpy.S +++ b/lib/libc/aarch64/string/memcpy.S @@ -1,3 +1,3 @@ -#define __memcpy_aarch64 memcpy -#define __memmove_aarch64 memmove -#include "aarch64/memcpy.S" +#define __memcpy_aarch64_simd memcpy +#define __memmove_aarch64_simd memmove +#include "aarch64/memcpy-advsimd.S" From nobody Fri Jan 10 15:03:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g30TwSz5kTTp; Fri, 10 Jan 2025 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g25HlGz4wq1; Fri, 10 Jan 2025 15:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tH9eyOkvFzpm/32lORMxC+R73z4Ov5W10i/mFYgG44g=; b=sHoEhQxJNxe/yLbCcFdel9wfZ8HAaGmqJ5sn8B/WD2ScVN/T6Ij4Fdg/rwzY3+YIO8xuWl x3ueujfFbXlSIEj6KteP+gHWv50D2EqUnuneP1qUocJ4lnzyPz0s4zKcmvu/s5IFiGG4og jWgjLcjN5ZrVjDEDmePUbNrrZZAExwePh82yCKL8fx+jbblcMuVnurfTfEufpcfO4+5ehB lIQ4mCg9vSx2AHN7/lmG7ZygC8xsQstsOPCQLvA3Np4kI/y/+y3x3JWVUnV034Q4tHMegV kG7hIVLxRkxp1NwhVjJOL8omla//1fg1JFZ3zyLa8KI3L6tDD166ww3BoY1HcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tH9eyOkvFzpm/32lORMxC+R73z4Ov5W10i/mFYgG44g=; b=FUls+PA6NIi02YEMUoEO/kAQpjteELRfreKtLte9SSrJDr9yoc2lQyi/tmLMRz5QocZ+Vu WSL0+5Yvp1MXtvZW7QLsO0AJ7iLwcPFA5qTS1Vvx8V2DU3OW2P8qjXtYvXNMMTfNao+hVt uXT3FnrigJ+vJDpMssm2PMethMkTjHPBeNsDyY3h3UyPJlbjVoAgwU6q7XilnAfywS4rkp YD2xz9cHVLki1TubLbMrMd3gmNFi4+I6xh64osHdROkQFlbGD2BbHTZsTeKPmvF+4xj8Pj ehoL1z+Rv2wx4+rIA4ANAnHlqXFb8YzXakjMoNnSyqQlDF2iGBfRIkfUKfGkBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521438; a=rsa-sha256; cv=none; b=V70qv7LfKmsZp9bB7AFdpnbpIM0DBRel5SAmVgZBFp91hi7L9lmwd+ae6tMgpWC/rpt0Yo anPzZYryatZTQuv3XdX+VO0p1Uuwv5diWbeQ2EHKDIRxc1v1dQ90YEGfqsfZad9GUTMVCQ n64GOicAyNUQIg9DUFnbIguseGEcOQfSqp8uPOOEGF36xYLHcCLnwj+xAS87KESlAPaiIs j2WvDctf9KGGc+T5PJQsAoksBXZaWS9IT0CHk7aqhccARyAmRp8trmydl2NjM7tckkQRem j1/kZheKgj3HK6+V1Lru9dZk4yGzgHU+n+Xjdskd8xq4OrAoIL6AtHFHD4i0Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g24P6Pz2Jh; Fri, 10 Jan 2025 15:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF3wg9057323; Fri, 10 Jan 2025 15:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF3wBt057320; Fri, 10 Jan 2025 15:03:58 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:03:58 GMT Message-Id: <202501101503.50AF3wBt057320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: bea89d038ac5 - main - lib/libc/aarch64/string: add strlcat SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bea89d038ac54048bb7dcb149cabd99067e5a3a9 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=bea89d038ac54048bb7dcb149cabd99067e5a3a9 commit bea89d038ac54048bb7dcb149cabd99067e5a3a9 Author: Getz Mikalsen AuthorDate: 2024-08-26 21:10:16 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add strlcat SIMD implementation This patch requires D46243 as it depends on strlcpy being labeled __strlcpy. It's a direct copy from the amd64 string functions using memchr and strlcpy to implement strlcat. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46272 --- lib/libc/aarch64/string/Makefile.inc | 3 ++- lib/libc/aarch64/string/memchr.S | 4 ++++ lib/libc/aarch64/string/strlcat.c | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 876ef4257b4c..f8c67319fe12 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -29,7 +29,8 @@ MDSRCS+= \ strlcpy.S \ strncmp.S \ memccpy.S \ - strncat.c + strncat.c \ + strlcat.c # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/memchr.S b/lib/libc/aarch64/string/memchr.S new file mode 100644 index 000000000000..6d4330d9115e --- /dev/null +++ b/lib/libc/aarch64/string/memchr.S @@ -0,0 +1,4 @@ + .weak memchr + .set memchr, __memchr_aarch64 + +#include "aarch64/memchr.S" diff --git a/lib/libc/aarch64/string/strlcat.c b/lib/libc/aarch64/string/strlcat.c new file mode 100644 index 000000000000..c3c996163ade --- /dev/null +++ b/lib/libc/aarch64/string/strlcat.c @@ -0,0 +1,25 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Robert Clausecker + */ + +#include + +#include + +void *__memchr_aarch64(const void *, int, size_t); +size_t __strlcpy(char *restrict, const char *restrict, size_t); + +size_t +strlcat(char *restrict dst, const char *restrict src, size_t dstsize) +{ + char *loc = __memchr_aarch64(dst, '\0', dstsize); + + if (loc != NULL) { + size_t dstlen = (size_t)(loc - dst); + + return (dstlen + __strlcpy(loc, src, dstsize - dstlen)); + } else + return (dstsize + strlen(src)); +} From nobody Fri Jan 10 15:04:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g62cSKz5kTTt; Fri, 10 Jan 2025 15:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g60q31z4wy1; Fri, 10 Jan 2025 15:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jaTV/88/eHdxliRuONA3EfyOHL8w+2xPqqVZcKlRWcY=; b=I3B2wFoVnv781/iEMPpgpm/uaeZHbXR0f/UwZV+UR5epG4RS6KN0PJ4cb9fZK8E6iu4VvB UPG6WCU/v5Y054rFM+fu5WQEsYm+AOQbagXCz1RKya0ZbsHqNzPg5YqhZrPzMYc0Hke27M JwsczKTSof2gMjUwUVp6qBQiOrGpvy/NjufxIwTFQq92Qokpb+YLUSvZxDLXhAxt9c2poH 4/+HIM5au4mklVquxkkOgQmVTob+ve+so2cDFhbvJblcJPZ9V76W6NuuOh+But8r233eAg 57VM8tjBHxsQ7+0evaXXpW/SImYRxla0VsMWieMHLSUXhpLriN9xrsmndjq77Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jaTV/88/eHdxliRuONA3EfyOHL8w+2xPqqVZcKlRWcY=; b=mAWt/K6mECEQS5BqMpXw7/oWfrLRQQYYzxNMVBoyE1AlLLEvglAARxh2Fzr27BuHGrh7Ml rLziXT+qzJaaoJxg3TnlvYNo9TgZ7LX4Lv/Uov+0fASnsjec3bMJxaynRAhXwRYtrUezTL Hjp+zyTjWGD1TlNvgLCuM42TJ2hFXXZ6tGsj34D12nDfMSoSu5DtGJsIZCDp+sZ4lQq6su XsW9MUmjWA/2P4IYVYcoOSYiUwyV/NyPZZV+IX3+qHIzl9VzT96zbH8R0fWrG13SGgnNL3 beL/xmeH/ka6gkM2Ry9kLDdnRe0wHW/83pW5ItBbTi+/githL5dpcGS4VoI9zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521442; a=rsa-sha256; cv=none; b=Ue7XKUj2OBnbpYf54W+KOOGXiM4eQ7JXOIrPUNamPRQHToMSS7Pm1qZO4aHwjTDMLR/FBY FX14XZ3fD//9IlAwDbgsrDpH9BBayeAbeozuGzuQ1Pr4ljl0SKqXdTwxHiR2WN2HD3AoL4 YoM4LVsz+VE3+jwLhYHQ6MVpMRKXJ2vrYoDGXp2oc1AgZJkf0TwlZuMk8LTxP6ppXRg0Ap wYCAmA5SdqlAvmM83vdz7PlUahtsCAkSuIE/O5lAcq3W9hlzsJwYJn31QHJYtZfIJPo43r skt6z68j1DgdZb4lHxCA+hqs9RSfHKURM59iX9GZI5L6oxbDNrBl9yQXAxhLFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g60CCCz2TQ; Fri, 10 Jan 2025 15:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF41ie057459; Fri, 10 Jan 2025 15:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF41GA057456; Fri, 10 Jan 2025 15:04:01 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:04:01 GMT Message-Id: <202501101504.50AF41GA057456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 79e01e7e643c - main - lib/libc/aarch64/string: add bcopy & bzero wrapper List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79e01e7e643c9337d8d6046b6db7df674475a099 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=79e01e7e643c9337d8d6046b6db7df674475a099 commit 79e01e7e643c9337d8d6046b6db7df674475a099 Author: Getz Mikalsen AuthorDate: 2024-08-28 13:13:45 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add bcopy & bzero wrapper This patch enabled usage of SIMD enhanced functions to implement bcopy and bzero. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46459 --- lib/libc/aarch64/string/Makefile.inc | 4 +++- lib/libc/aarch64/string/bcopy.c | 14 ++++++++++++++ lib/libc/aarch64/string/bzero.c | 14 ++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 7325b54d9716..752cc6d9900b 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -30,7 +30,9 @@ MDSRCS+= \ memccpy.S \ strncat.c \ strlcat.c \ - strlen.S + strlen.S \ + bcopy.c \ + bzero.c # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/bcopy.c b/lib/libc/aarch64/string/bcopy.c new file mode 100644 index 000000000000..0dee529fb9df --- /dev/null +++ b/lib/libc/aarch64/string/bcopy.c @@ -0,0 +1,14 @@ +/*- + * Public domain. + */ + +#include + +#undef bcopy /* _FORTIFY_SOURCE */ + +void +bcopy(const void *src, void *dst, size_t len) +{ + + memmove(dst, src, len); +} diff --git a/lib/libc/aarch64/string/bzero.c b/lib/libc/aarch64/string/bzero.c new file mode 100644 index 000000000000..d82f3061865b --- /dev/null +++ b/lib/libc/aarch64/string/bzero.c @@ -0,0 +1,14 @@ +/*- + * Public domain. + */ + +#include + +#undef bzero /* _FORTIFY_SOURCE */ + +void +bzero(void *b, size_t len) +{ + + memset(b, 0, len); +} From nobody Fri Jan 10 15:04:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g52k1bz5kTZH; Fri, 10 Jan 2025 15:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g46c2rz4x5R; Fri, 10 Jan 2025 15:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QTI3dnbFcCzfb+Gg2dAJ1cGipInXN/pXN3iEp/mOCE4=; b=ReBNrItrxbM8XMsPps6CUoC6GXtoR2UxJihlXki7W5fAfW4zRiKYzbr0aEuncpSExZ2bky zVpoT94QWY8aMbxNkV0fcaB0/Tq70OMqszpOBPM3YlRH/6FRgcF+Kcp/R5KJFDJYexyPC9 D4a0Q1WDDb97e00WhHtKZ3tsvX1D8jjbbCo/rDYeUJ41pwe1UjBL+GGTbLDyT7qU+KX4Sp d3ZE9o3kC9hvTZJzjp6hSAyB136M/7KU5ugaF8GJGuBUjk6bSQSL/6vwHU67oGDrN3nTMn AOj4Dy9Vu7I4w92wbWtjK4OzZDFNGZmIReNejbZFwGt1nKMEkF0cqon0r/S6lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QTI3dnbFcCzfb+Gg2dAJ1cGipInXN/pXN3iEp/mOCE4=; b=DhBE6KxdoG+IiQJa8xktTrke0cMsteAsAhYWKM0bKuT8TvAFPLilLiJA/5Nxab8eg4sY3t 4O615IiWILxap9b3Gnk8oGaB8UVP7AZaBDc4fXYMeYq45aXQcesOhNTJ4iZkJ9iuMCOuDn Yuc2h/AZf31iUJKnX5oqQptEm0vul/Xck0GmOoqncquDLoDfNics7UyOHlRnCC196YSyvf sp8yKCWwwgP3i84Q7CTKrE5ZJNFrtL/Hyp11mf/ANiqCXujo5AllWKJcIb/EZnmcZwa49N /8IjsVYbq/n+wpvTWPpLf77vG2Utlw4G/6xlnzQKQVoH4g8SzRq41qZi7e9yFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521441; a=rsa-sha256; cv=none; b=HsMoP/w2NpNmsMcOZIdLA76kD/698StgbFOQ+aaXoH2uxHvGM9F05wPzngc/iWcGKF728x C8VOybq5SYL/QvHlWrp2OLVuc7KSFshJAME4B3Gkd19+sqr0PvK/k/xA9JP1F/7dRPiLqP lVHOWZ80gJpVTegebAhnAtObx17etu93N8PwE6hQ8uy44wP34nlr787XHTSWexLMdGgAY1 HkodWy6fsiFMHuDpnnI26TdOcqcPCkeyvZW+igtHZhR+nyGIsaRJL3VfHmZ8wivno042Xi 5lATgoXnuFHEYJvkYvdiK2dFWPfQwkmSyTyv7ZfZ5ST3cTfDa+sZz8LLZTQFSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g467Bwz2Jk; Fri, 10 Jan 2025 15:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF40Mv057414; Fri, 10 Jan 2025 15:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF40mI057411; Fri, 10 Jan 2025 15:04:00 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:04:00 GMT Message-Id: <202501101504.50AF40mI057411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 3863fec1ce2d - main - lib/libc/aarch64/string: add strlen SIMD implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3863fec1ce2dc6033f094a085118605ea89db9e2 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=3863fec1ce2dc6033f094a085118605ea89db9e2 commit 3863fec1ce2dc6033f094a085118605ea89db9e2 Author: Getz Mikalsen AuthorDate: 2024-08-26 19:54:32 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 lib/libc/aarch64/string: add strlen SIMD implementation Adds a SIMD enhanced strlen for Aarch64. It takes inspiration from the amd64 implementation but I struggled getting the performance I had hoped for on cores like the Graviton3 when compared to the existing implementation from Arm Optimized Routines. See the DR for bechmark results. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D45623 --- lib/libc/aarch64/string/Makefile.inc | 4 ++-- lib/libc/aarch64/string/strlen.S | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index f8c67319fe12..7325b54d9716 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -14,7 +14,6 @@ AARCH64_STRING_FUNCS= \ strchr \ strchrnul \ strcpy \ - strlen \ strnlen \ strrchr @@ -30,7 +29,8 @@ MDSRCS+= \ strncmp.S \ memccpy.S \ strncat.c \ - strlcat.c + strlcat.c \ + strlen.S # # Add the above functions. Generate an asm file that includes the needed diff --git a/lib/libc/aarch64/string/strlen.S b/lib/libc/aarch64/string/strlen.S new file mode 100644 index 000000000000..7bfac7f4b1e1 --- /dev/null +++ b/lib/libc/aarch64/string/strlen.S @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Getz Mikalsen +*/ + +#include + + .weak strlen + .set strlen, __strlen + .text + +ENTRY(__strlen) + bic x10, x0, #0xf // aligned src + and x9, x0, #0xf + ldr q0, [x10] + cmeq v0.16b, v0.16b, #0 + shrn v0.8b, v0.8h, #4 + fmov x1, d0 + cbz x9, .Laligned + lsl x2, x0, #2 // get the byte offset + lsr x1, x1, x2 // shift by offset index + cbz x1, .Lloop + rbit x1, x1 + clz x0, x1 + lsr x0, x0, #2 + ret + +.Laligned: + cbnz x1, .Ldone + +.Lloop: + ldr q0, [x10, #16]! + cmeq v0.16b, v0.16b, #0 + shrn v0.8b, v0.8h, #4 // reduce to fit mask in GPR + fcmp d0, #0.0 + b.eq .Lloop + fmov x1, d0 +.Ldone: + sub x0, x10, x0 + rbit x1, x1 // reverse bits as NEON has no ctz + clz x3, x1 + lsr x3, x3, #2 + add x0, x0, x3 + ret +END(__strlen) From nobody Fri Jan 10 15:04:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g85fZlz5kTc5; Fri, 10 Jan 2025 15:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g82B23z4wyB; Fri, 10 Jan 2025 15:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ebtpVg/nZtDqLeEvmolQVaTa4Qcgbec8gjkkd5oZ6mA=; b=mT0ZNCQUMxhqk5+Ug2R9xmYTIEqEg5ZX9MH5RIrKMFnT6UVG9nWE2CgF0wbGcLVQTEiDhE 5C2TT2+tRjlLCtmPDymG+wgfx2no4lMItt4SCKgA+LXrepeenxY1xzOwSNfTkcqQdnflU1 JoTCW/ydyMIt7nSc9rVVZ9q5GJsPNSRED4P46STEuwIrczkS4i/auY23z2EVJ2jQERBHjX DGVM90H0jPOVfxJ/MQcXCl9xdOKjpDwse1R19EV4TP/RsQMWZGLnNUlI8kSNqNR/KKWpns enCsmp6WCilw4bFLtO7kyRLZONRGZWdjx9gaXSlEldlskSxT8lZqnfx0S8QhIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ebtpVg/nZtDqLeEvmolQVaTa4Qcgbec8gjkkd5oZ6mA=; b=jXjmxaUroRKqi83IQeapZOIrPkF1ihw9Q1VOxlNVsWfK6fxx6qvmy6I3A3mXTObIB181dj oSNrLhAVZA314mJI7nF0OsCf2yeZlGHigeZV+TL5R+lU+GLbf+xTnf0+nAtCJ3r98ISuW8 XMZDiL9/i0lWctgam7KP0zPdq0Ww/47+WPWi9Km7v5/cx2IN+UrWR3i8SzYGzvNUDPt2yU IzXTwJfDSwdeuB1/5NXBs0tr0geczdebs266f9NvKvM82acrPkh+Be9QMv/leaTYwkOxLK QgTdkr9HcqFp1zf6yCuj4B+hvzCVbIA+AHiBhgggALbTD2DPrMsWF8ZRY7C8nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521444; a=rsa-sha256; cv=none; b=CHVc1+x1DyA9gHH2edrFqENhxgZcgxhGPX01X56Q29sRapMOqeZGUUD7XtKrrRSOhUjA0z groJDboNysstT4tovM2FBtDJc88g6mEfF7ZdHSC/QTiMVgLsrUtoPY/zYu3F5REHOg88Hk hkJZ4EpD/R2e/EGt/IMGX8PZupZS7Cwb5jmzs1x7B+MOuNiJR0ZnIQ3UG69hkf+by8nRBk HkjDMZAPy3WtUe7BlCLeq0pcJdQdNLM4I0sVeh8HJx2KBxSLGlHXbS+oOPm2os/RcRcoEF j9ONOs6z2YdeHnn2ISXeT9IpzoZgUfVIbuiefGkwl9gKqDNykJXNQxvWLiIPcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g81lzKz1q6; Fri, 10 Jan 2025 15:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF44lB057549; Fri, 10 Jan 2025 15:04:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF441b057546; Fri, 10 Jan 2025 15:04:04 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:04:04 GMT Message-Id: <202501101504.50AF441b057546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: f2c98669fc1b - main - lib/libc/aarch64/string: add ASIMD-enhanced timingsafe_bcmp implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2c98669fc1b3fd2dbc7a7e3eedd098970a10dec Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=f2c98669fc1b3fd2dbc7a7e3eedd098970a10dec commit f2c98669fc1b3fd2dbc7a7e3eedd098970a10dec Author: Robert Clausecker AuthorDate: 2024-12-09 09:49:49 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:41 +0000 lib/libc/aarch64/string: add ASIMD-enhanced timingsafe_bcmp implementation A straightforward port of the amd64 implementation. Approved by: security (cperciva) Reviewed by: getz, cperciva Event: EuroBSDcon 2024 Differential Revision: https://reviews.freebsd.org/D46757 --- lib/libc/aarch64/string/Makefile.inc | 1 + lib/libc/aarch64/string/timingsafe_bcmp.S | 113 ++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 752cc6d9900b..8019ab4adafc 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -31,6 +31,7 @@ MDSRCS+= \ strncat.c \ strlcat.c \ strlen.S \ + timingsafe_bcmp.S \ bcopy.c \ bzero.c diff --git a/lib/libc/aarch64/string/timingsafe_bcmp.S b/lib/libc/aarch64/string/timingsafe_bcmp.S new file mode 100644 index 000000000000..baa5c6f0940c --- /dev/null +++ b/lib/libc/aarch64/string/timingsafe_bcmp.S @@ -0,0 +1,113 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Robert Clausecker + */ + +#include + +ENTRY(timingsafe_bcmp) + cmp x2, #32 // at least 33 bytes to process? + bhi .Lgt32 + + cmp x2, #16 // at least 17 bytes to process? + bhi .L1732 + + cmp x2, #8 // at least 9 bytes to process? + bhi .L0916 + + cmp x2, #4 // at least 5 bytes to process? + bhi .L0508 + + cmp x2, #2 // at least 3 bytes to process? + bhi .L0304 + + cbnz x2, .L0102 // buffer empty? + + mov w0, #0 // empty buffer always matches + ret + +.L0102: ldrb w3, [x0] // load first bytes + ldrb w4, [x1] + sub x2, x2, #1 + ldrb w5, [x0, x2] // load last bytes + ldrb w6, [x1, x2] + eor w3, w3, w4 + eor w5, w5, w6 + orr w0, w3, w5 + ret + +.L0304: ldrh w3, [x0] // load first halfwords + ldrh w4, [x1] + sub x2, x2, #2 + ldrh w5, [x0, x2] // load last halfwords + ldrh w6, [x1, x2] + eor w3, w3, w4 + eor w5, w5, w6 + orr w0, w3, w5 + ret + +.L0508: ldr w3, [x0] // load first words + ldr w4, [x1] + sub x2, x2, #4 + ldr w5, [x0, x2] // load last words + ldr w6, [x1, x2] + eor w3, w3, w4 + eor w5, w5, w6 + orr w0, w3, w5 + ret + +.L0916: ldr x3, [x0] + ldr x4, [x1] + sub x2, x2, #8 + ldr x5, [x0, x2] + ldr x6, [x1, x2] + eor x3, x3, x4 + eor x5, x5, x6 + orr x0, x3, x5 + orr x0, x0, x0, lsr #32 // ensure low 32 bits are nonzero iff mismatch + ret + +.L1732: ldr q0, [x0] + ldr q1, [x1] + sub x2, x2, #16 + ldr q2, [x0, x2] + ldr q3, [x1, x2] + eor v0.16b, v0.16b, v1.16b + eor v2.16b, v2.16b, v3.16b + orr v0.16b, v0.16b, v2.16b + umaxv s0, v0.4s // get a nonzero word if any + mov w0, v0.s[0] + ret + + /* more than 32 bytes: process buffer in a loop */ +.Lgt32: ldp q0, q1, [x0], #32 + ldp q2, q3, [x1], #32 + eor v0.16b, v0.16b, v2.16b + eor v1.16b, v1.16b, v3.16b + orr v4.16b, v0.16b, v1.16b + subs x2, x2, #64 // enough left for another iteration? + bls .Ltail + +0: ldp q0, q1, [x0], #32 + ldp q2, q3, [x1], #32 + eor v0.16b, v0.16b, v2.16b + eor v1.16b, v1.16b, v3.16b + orr v0.16b, v0.16b, v1.16b + orr v4.16b, v4.16b, v0.16b + subs x2, x2, #32 + bhi 0b + + /* process last 32 bytes */ +.Ltail: add x0, x0, x2 // point to the last 32 bytes in the buffer + add x1, x1, x2 + ldp q0, q1, [x0] + ldp q2, q3, [x1] + eor v0.16b, v0.16b, v2.16b + eor v1.16b, v1.16b, v3.16b + orr v0.16b, v0.16b, v1.16b + orr v4.16b, v4.16b, v0.16b + umaxv s0, v4.4s // get a nonzero word if any + mov w0, v0.s[0] + ret +END(timingsafe_bcmp) From nobody Fri Jan 10 15:04:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4g76l99z5kTfR; Fri, 10 Jan 2025 15:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g72L5kz4x5r; Fri, 10 Jan 2025 15:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlzsGYbKd+UF1CdlmNfO220hMDcCWDliTjJSE3iwWpo=; b=C340Cgk3+4PcaWBvXcggAnz3n4KVgbLpIMZs3PfZmSZR58LjE8Pesri3i89RHA+TzGaRjK 8i6b2Wpt0iu/UQCeOQXxvEOWfsnh/PkeCn6waoqZDXyhjT9Eny5wSWgdoJ64on+VkXVUon uTLMYEc3f20sWw510Jmxasf+C2FjS9nGcZ+SPEE28/k+dgPl60ip4tep87x2pMkKxbdnUR zgVlxPMbjEeXcHIej06Xh+RCkxP6AwxnXkqanOA+4mlU7J6fatVxDp4/q6340pDNqsuCtE jtv5qW6J/LN8iJ7weSieEi51mG6vFGjQ9wPyS7+r8i4Cu/gAhOAL2961xEp5sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlzsGYbKd+UF1CdlmNfO220hMDcCWDliTjJSE3iwWpo=; b=JxjRkKyMBS8Lo7/FSanw8t5ckPlc7YMM0fCAGq6nTuCwQfRJ+4CXN22RQbSQ5vpJFjhegV m9iAfG8eTKi3YMcylFmZNPGspspYz6IfITLUcwtxldVZ/wBYIZsIhax5gMBcgIzYK8swtW GC4mpvWD+dIEoLdz5QWyEmtzfOxIOG1l53uNTcJUYlfSG9OiT4UQyJtoGqGhVeYcZo0AQL +kurOmmgk4Q1fZGQpnMY4+MDxkbUXP4dwxUUXn83EuA5S6pL7T6kNSKAI5giIyFxhpzmgx i9O16XBhK/vaovCyQAm1raGGk0R05TlhvNBPLkM/cp5c6Y80OfhOv1NRwFVfrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521443; a=rsa-sha256; cv=none; b=PfndLGn8vMhcFFlF8rq+FEjBpLpEB72xdRGSUsOkLcTcCgbVe4tPHLq17/gXwX/DsAWEFB pgR9qzIXI6DibCJSLFb1pDsBTTjtQpE6k1+0gu0sBul4CcDTXZg7gf5Du5Iyy3TjqEtjra Alw/jV/dy3569sXdtQ/GeeavWuxGoIy1lbh1FMrHdViGDrV4XlQD9qrhtWCOYdiPztnFIx HRYkATllveF8a//Cao9maRnHxUNiMTQfzGI2uvnGwqN8m+LwwuB7XRxNUHyUyb6O+j5rWY FoEHq99IBhvfHkA+WrEM0nyov7pwWEhD5itqFLzto6NTq7w4B6HvLzcbHqoyuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g70pxJz2Jl; Fri, 10 Jan 2025 15:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF43qL057507; Fri, 10 Jan 2025 15:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF43dp057504; Fri, 10 Jan 2025 15:04:03 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:04:03 GMT Message-Id: <202501101504.50AF43dp057504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: ce6af7a49ec7 - main - share/man/man7/simd.7: document SIMD-enhanced aarch64 functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce6af7a49ec7949c70f144f1b461b587ca7efd32 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=ce6af7a49ec7949c70f144f1b461b587ca7efd32 commit ce6af7a49ec7949c70f144f1b461b587ca7efd32 Author: Getz Mikalsen AuthorDate: 2024-08-28 13:13:55 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:40 +0000 share/man/man7/simd.7: document SIMD-enhanced aarch64 functions This documents all the newly ported SIMD-enhanced string functions for the aarch64 platform. Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) Relnotes: yes PR: 281175 Differential Revision: https://reviews.freebsd.org/D46452 --- share/man/man7/simd.7 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index 877bc77adf4b..f60aa8ee794d 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE . -.Dd June 7, 2024 +.Dd August 26, 2024 .Dt SIMD 7 .Os .Sh NAME @@ -51,40 +51,40 @@ can be used to override this mechanism. Enhanced functions are present for the following architectures: .Bl -column FUNCTION_________ aarch64_ arm_ amd64_ i386_ ppc64_ -offset indent .It Em FUNCTION Ta Em AARCH64 Ta Em ARM Ta Em AMD64 Ta Em I386 Ta Em PPC64 -.It bcmp Ta Ta Ta S1 Ta S -.It bcopy Ta Ta S Ta S Ta S Ta SV -.It bzero Ta Ta S Ta S Ta S +.It bcmp Ta A Ta Ta S1 Ta S +.It bcopy Ta A Ta S Ta S Ta S Ta SV +.It bzero Ta A Ta S Ta S Ta S .It div Ta Ta Ta S Ta S .It index Ta A Ta Ta S1 .It ldiv Ta Ta Ta S Ta S .It lldiv Ta Ta Ta S .It memchr Ta A Ta Ta S1 .It memcmp Ta A Ta S Ta S1 Ta S -.It memccpy Ta Ta Ta S1 -.It memcpy Ta S Ta S Ta S Ta S Ta SV -.It memmove Ta S Ta S Ta S Ta S Ta SV +.It memccpy Ta A Ta Ta S1 +.It memcpy Ta A Ta S Ta S Ta S Ta SV +.It memmove Ta A Ta S Ta S Ta S Ta SV .It memrchr Ta A Ta Ta S1 .It memset Ta A Ta S Ta S Ta S .It rindex Ta A Ta Ta S1 Ta S .It stpcpy Ta A Ta Ta S1 .It stpncpy Ta Ta Ta S1 -.It strcat Ta Ta Ta S1 Ta S +.It strcat Ta A Ta Ta S1 Ta S .It strchr Ta A Ta Ta S1 Ta S .It strchrnul Ta A Ta Ta S1 -.It strcmp Ta S Ta S Ta S1 Ta S +.It strcmp Ta A Ta S Ta S1 Ta S .It strcpy Ta A Ta Ta S1 Ta S Ta S2 -.It strcspn Ta Ta Ta S2 -.It strlcat Ta Ta Ta S1 -.It strlcpy Ta Ta Ta S1 +.It strcspn Ta S Ta Ta S2 +.It strlcat Ta A Ta Ta S1 +.It strlcpy Ta A Ta Ta S1 .It strlen Ta A Ta S Ta S1 -.It strncat Ta Ta Ta S1 -.It strncmp Ta S Ta S Ta S1 Ta S +.It strncat Ta A Ta Ta S1 +.It strncmp Ta A Ta S Ta S1 Ta S .It strncpy Ta Ta Ta S1 Ta Ta S2 .It strnlen Ta A Ta Ta S1 .It strrchr Ta A Ta Ta S1 Ta S -.It strpbrk Ta Ta Ta S2 -.It strsep Ta Ta Ta S2 -.It strspn Ta Ta Ta S2 +.It strpbrk Ta S Ta Ta S2 +.It strsep Ta S Ta Ta S2 +.It strspn Ta S Ta Ta S2 .It swab Ta Ta Ta Ta S .It timingsafe_bcmp Ta Ta Ta S1 .It timingsafe_memcmp Ta Ta Ta S From nobody Fri Jan 10 15:04:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4gB0hlKz5kTV6; Fri, 10 Jan 2025 15:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4g93XW8z4x6P; Fri, 10 Jan 2025 15:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxI9tvYv7Q4biPcAWUlCqjapLVvAssO+vlyVrHiRv34=; b=fV67jL6jI5cQKILJ7RMvX5rsI5CRjwM0DfYHUJOOLypGnKjeivoEH/dX7Ptn//dLC1+Eda tNsxnY4TNWZu2gIxrQW4xgpbYz5ZXabzE0gQgL61wa5Xq+hYzuJoFt+EbRZQQSMnqDFXzI N/8uiGgBXuunHWR8eW7hGZYO0p4NC7pybv6DUSpSiSt09oV5XqQtErigxOrcjdyUFSPQsW PyxTVJJ/ZY2VX3f7a09aXe6+xNUKQjtH/JASzsADS9JT20HzDYdk7IvE/fer/rbi6Kzagr 382NOWf2wkwjgI/FvWguyrLcP3ba2q1CcE/k1mi2AlchQlEIs4hP4tI5g227Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxI9tvYv7Q4biPcAWUlCqjapLVvAssO+vlyVrHiRv34=; b=CPHNErF9imrXmXgaIWp08iJmAP6LKCPtkpwOl4a71NQfGSBmgAdEEaLbya/OxC20ojkG68 5y/4sr8DtkxyPdlaputEmsTOu6A7msRbnGWx0degOvYglm3fJ8kUGUJR7mKBLuz3qrOv3b PYg9QpSV1ekwSAsF+hh9YTqCxhhTjhk4YhBJLpSaHSijybizQVSkHE8rQATknWzLlOviyy fq0oOSI87/NfMP6U7lLDUhzfmDt+IwB3HwZTTSj9UB9CeHUGTFYuKief9Mf/kcV/A51O6q ecos3MAYTJaGuMEyF/Vxx3xlhM6ex3c5WCLQzXpExuhtQfD6/HEiTzqvIDZtiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521445; a=rsa-sha256; cv=none; b=dYrWUMTxOZsJ+n05FjLz3TXjZor5pS5rCJUwcdhbjYTNb20+Cy40DV7Y/F9BNJqDF7reH/ vdDIk/7cvl/K58vu4UtnnWvPJtlJCvAUwgm/a/ng7DYPG1oaHYMI6e9KQF14YzuhalNuMK 8ERp2wxOkG7MJMFZRjoE4qgAOMzHsk2aCBg48yLY3eeGDSB5HJsYc4nlZJwcXYkJb39Zw8 n9Fj4hJvEA3FZ62lRDh6KTu3KJ6Ro+OXGSqC7UeFGJQCIYH4vdYTf1FUAjocWLXy56F1j5 EkotQfZ5lODmawF52tN4n3PvUYAaphhT25P9dPAzBs+hOdTAB54H32hvHTE4fA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4g92ppFz1lF; Fri, 10 Jan 2025 15:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF45hr057591; Fri, 10 Jan 2025 15:04:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF45vH057588; Fri, 10 Jan 2025 15:04:05 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:04:05 GMT Message-Id: <202501101504.50AF45vH057588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 3f224333af16 - main - lib/libc/aarch64/string: add timingsafe_memcmp() assembly implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f224333af163d5fcd7547a20993dcf18f19076c Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=3f224333af163d5fcd7547a20993dcf18f19076c commit 3f224333af163d5fcd7547a20993dcf18f19076c Author: Robert Clausecker AuthorDate: 2024-12-09 09:50:00 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:41 +0000 lib/libc/aarch64/string: add timingsafe_memcmp() assembly implementation A port of the amd64 implementation with some slight changes due to differences in instructions provided by aarch64. No ASIMD for the same reason as the amd64 code: it's just not particularly suitable for this application. Event: EuroBSDcon 2024 Approved by: security (cperciva) Reviewed by: getz, cperciva Differential Revision: https://reviews.freebsd.org/D46758 --- lib/libc/aarch64/string/Makefile.inc | 1 + lib/libc/aarch64/string/timingsafe_memcmp.S | 117 ++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 8019ab4adafc..9574aad95933 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -32,6 +32,7 @@ MDSRCS+= \ strlcat.c \ strlen.S \ timingsafe_bcmp.S \ + timingsafe_memcmp.S \ bcopy.c \ bzero.c diff --git a/lib/libc/aarch64/string/timingsafe_memcmp.S b/lib/libc/aarch64/string/timingsafe_memcmp.S new file mode 100644 index 000000000000..28fdd911a387 --- /dev/null +++ b/lib/libc/aarch64/string/timingsafe_memcmp.S @@ -0,0 +1,117 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Robert Clausecker + */ + +#include + +ENTRY(timingsafe_memcmp) + cmp x2, #16 // at least 17 bytes to process? + bhi .Lgt16 + + cmp x2, #8 // at least 9 bytes to process? + bhi .L0916 + + cmp x2, #4 // at least 5 bytes to process? + bhi .L0508 + + cmp x2, #2 // at least 3 bytes to process? + bhi .L0304 + + cbnz x2, .L0102 // buffer empty? + + mov w0, #0 // empty buffer always matches + ret + +.L0102: ldrb w3, [x0] // load first bytes + ldrb w4, [x1] + sub x2, x2, #1 + ldrb w5, [x0, x2] // load last bytes + ldrb w6, [x1, x2] + bfi w5, w3, #8, #8 // join bytes in big endian + bfi w6, w4, #8, #8 + sub w0, w5, w6 + ret + + +.L0304: ldrh w3, [x0] // load first halfwords + ldrh w4, [x1] + sub x2, x2, #2 + ldrh w5, [x0, x2] // load last halfwords + ldrh w6, [x1, x2] + bfi w3, w5, #16, #16 // join halfwords in little endian + bfi w4, w6, #16, #16 + rev w3, w3 // swap word order + rev w4, w4 + cmp w3, w4 + csetm w0, lo // w0 = w3 >= w4 ? 0 : -1 + csinc w0, w0, wzr, ls // w0 = w3 <=> w4 ? 1 : 0 : -1 + ret + +.L0508: ldr w3, [x0] // load first words + ldr w4, [x1] + sub x2, x2, #4 + ldr w5, [x0, x2] // load last words + ldr w6, [x1, x2] + bfi x3, x5, #32, #32 // join words in little endian + bfi x4, x6, #32, #32 + rev x3, x3 // swap word order + rev x4, x4 + cmp x3, x4 + csetm w0, lo // x0 = x3 >= w4 ? 0 : -1 + csinc w0, w0, wzr, ls // x0 = x3 <=> w4 ? 1 : 0 : -1 + ret + +.L0916: ldr x3, [x0] + ldr x4, [x1] + sub x2, x2, #8 + ldr x5, [x0, x2] + ldr x6, [x1, x2] + cmp x3, x4 // mismatch in first pair? + csel x3, x3, x5, ne // use second pair if first pair equal + csel x4, x4, x6, ne + rev x3, x3 + rev x4, x4 + cmp x3, x4 + csetm w0, lo + csinc w0, w0, wzr, ls + ret + + /* more than 16 bytes: process buffer in a loop */ +.Lgt16: ldp x3, x4, [x0], #16 + ldp x5, x6, [x1], #16 + cmp x3, x5 // mismatch in first pair? + csel x3, x3, x4, ne // use second pair if first pair equal + csel x5, x5, x6, ne + subs x2, x2, #32 + bls .Ltail + +0: ldp x4, x7, [x0], #16 + ldp x6, x8, [x1], #16 + cmp x4, x6 // mismatch in first pair? + csel x4, x4, x7, ne // if not, try second pair + csel x6, x6, x8, ne + cmp x3, x5 // was there a mismatch previously? + csel x3, x3, x4, ne // apply new pair if there was not + csel x5, x5, x6, ne + subs x2, x2, #16 + bhi 0b + +.Ltail: add x0, x0, x2 + add x1, x1, x2 + ldp x4, x7, [x0] + ldp x6, x8, [x1] + cmp x4, x6 // mismatch in first pair? + csel x4, x4, x7, ne // if not, try second pair + csel x6, x6, x8, ne + cmp x3, x5 // was there a mismatch previously? + csel x3, x3, x4, ne // apply new pair if there was not + csel x5, x5, x6, ne + rev x3, x3 + rev x5, x5 + cmp x3, x5 + csetm w0, lo + csinc w0, w0, wzr, ls + ret +END(timingsafe_bcmp) From nobody Fri Jan 10 15:04:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV4gC5hXRz5kTZQ; Fri, 10 Jan 2025 15:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV4gB4FJ8z4x3R; Fri, 10 Jan 2025 15:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZijxAGDtNZ2UXdHHINyuNlptRUsruEcxpQ12+JMk45I=; b=sLgtmy29nyBuaElU3aZ3iqF2JLByDXaS7hCU7HSDJj0XRsJNbLaqW00SakYLc+BOrdWd6K lIAvYB2vN82wKVquW+BaFPDy4FtXMd9IQCwvjN40UdLp89k2kohjeaaGYl/3cD26QtG1PX zOrrZnRKLhjatS4l1xquCHgU3OR73ylr6egpBXjGD95vfOFritqCjLHte9xoOtoLyXOO3C vV+bKeB+oZgQUYwCaTaETgRl+y0PGGatm6xjHLhbXFwHSQAAxkpouLFLdmuuk23GsB0bQT q7SWtm5ZcxhMjMswIPT1djkICOYWPI5Ca+K2yRae6BKweIBnwj4UGDNwytdC/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736521446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZijxAGDtNZ2UXdHHINyuNlptRUsruEcxpQ12+JMk45I=; b=AsWCx8YMXL9srR9oW3uIxS05RVYEg/nIwHWIQqFxE1vu59TEli8z1aRFlHNeYu3l2ixUzL epgkPGuiCf+DYcLAi+QaSc8/92UhrX4QZ6uSXl5UHQZ/2Qfm+wHvhdqp54a/hkiCF7Gj/1 vhoWqfviEcaqaTuxz8BrzQFft1ike4t+Rl6i0GqlwOEj380DHHKhwPLgMhbN+DQOkU0n2q /tq9143Ku5E1s9B/EgxJFlZgYIN5mx8eSDBmEBSQViQndJ2gQjTCISD1SqDH3Iu4jhxLHo 3p1A+d6eLdnupqJk5xwlI7FyYzUaK6nU/c4vBAVKalVZL/TkTp2lFZzpWjyt/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736521446; a=rsa-sha256; cv=none; b=CXV4BLF/pBZVCVNY/fWGi+TlP7ykBb9/L5q5iwQmF/xNFSV1eZo0YF0SxCg2s6QFaMMBIU O/I4bKJZcGw1AoPAZAHfaIKI9wiWlHi+U4IWi+CqvybuSFg4pS1kHc9RKOb4kmpQnJu3R9 tylm6BFFjsGwbgiHAa9MAvKCGDC6zGfsDSpILlIjsEqjgUnFtVJRLFT6F1gDCfLWxeSnwt VXmns/iNrkOU4xHtixs9E6xidKYt4U4fQa1gmrPAB5kKHKDvUNVFN7EVTLYlw64ZCC2LtK 4owbRRNgTw6PSSQNyfXkaobnP9jzgLfF10k95ziJ5TdLSVdarY9j3j845E4dnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV4gB3lbSz2Jm; Fri, 10 Jan 2025 15:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AF46fS057630; Fri, 10 Jan 2025 15:04:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AF4659057627; Fri, 10 Jan 2025 15:04:06 GMT (envelope-from git) Date: Fri, 10 Jan 2025 15:04:06 GMT Message-Id: <202501101504.50AF4659057627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: c15b847b183b - main - share/man/man7/simd.7: document SIMD-enhanced timingsafe_{b,mem}cmp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c15b847b183bf836148caa1a1dc10d5d86507d09 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=c15b847b183bf836148caa1a1dc10d5d86507d09 commit c15b847b183bf836148caa1a1dc10d5d86507d09 Author: Robert Clausecker AuthorDate: 2024-11-18 13:44:47 +0000 Commit: Robert Clausecker CommitDate: 2025-01-10 15:02:41 +0000 share/man/man7/simd.7: document SIMD-enhanced timingsafe_{b,mem}cmp See also: D46758, D46757 Event: EuroBSDcon 2024 Relnotes: yes --- share/man/man7/simd.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man7/simd.7 b/share/man/man7/simd.7 index f60aa8ee794d..d5092348d9b3 100644 --- a/share/man/man7/simd.7 +++ b/share/man/man7/simd.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE . -.Dd August 26, 2024 +.Dd November 18, 2024 .Dt SIMD 7 .Os .Sh NAME @@ -86,8 +86,8 @@ Enhanced functions are present for the following architectures: .It strsep Ta S Ta Ta S2 .It strspn Ta S Ta Ta S2 .It swab Ta Ta Ta Ta S -.It timingsafe_bcmp Ta Ta Ta S1 -.It timingsafe_memcmp Ta Ta Ta S +.It timingsafe_bcmp Ta A Ta Ta S1 +.It timingsafe_memcmp Ta S Ta Ta S .It wcschr Ta Ta Ta Ta S .It wcscmp Ta Ta Ta Ta S .It wcslen Ta Ta Ta Ta S From nobody Fri Jan 10 16:00:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV5wY4XSZz5kYl6; Fri, 10 Jan 2025 16:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV5wY43BMz58rb; Fri, 10 Jan 2025 16:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736524845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MShbtqpzzab+ZvCFT+mzBIuEPAc6HYBTrYxOROjBUU=; b=q3lziTN4xm8COR+8RPWZsj2wHdVHOG6OQVgOn0b22h2PJKuNPdSoHvITqcU5qDYvGaeBsN zYE8LQJBH6XVm5kC7EwP+lrrj8GjKpKciDsfN9QvLH3WvMZlZcFLvxzYwPNRZlJBOsPg/6 YBFhHVYzgkCV1S5ytp+94Bay6OwiAnBnkbUWcGx1NlVycEgRiBsJWG+P5XlPxxo0inp42n r0USWBHTom/U9zF9hb0dA5PfZGEASjJpwYPxHfEcProPJ9v03o+7zEmg+BxUWYHWku7PQ6 qsU+mctBVdVS9car0pI8pK43S6oCvYjbryoN5GiLpqXV6z3Nof3VwFNBvpaZVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736524845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MShbtqpzzab+ZvCFT+mzBIuEPAc6HYBTrYxOROjBUU=; b=uEAchUuddM4feTd5sTi2TriZBYLamYSYeA9ZFuslPMwV69WsldtZEW0dlW2OwnFEBsmIBC TWWP+slpyHpZXUgi7GNDxjt7MUkShRdAwuoVKpjdfx6YatiepBl1KeBnm7Vv7NI5YZhCES rv0cY7I9f5gCwidniViMSf1HZrqjjF5TELU2I64TZbRQOEKVYTsVG9fNjYOsKwKIjaro7J SoG2EvpeMksqroUUzIgaSGLOHVwAjV/MyZC1yX26GCvphGQN1oB2r5B3haKLiWUWUNJT6H 4hlxiSx734ye/pUHGR0XPpP+J7UWduakmTwzNWebDt+JbzmZF3FiSW+j44wubQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736524845; a=rsa-sha256; cv=none; b=vMjEbK9WvPMObzKObOEiLLu6PeT8y/++j+AXKomk27WsGd6LouCO6fj4lKnny/YYLVcVIC bOPlMMuISt+EvvStbnnTOYRZH8S1qXQTPbOyc7LG+XbUGaTTYnWye/i2iD00O/QJlWSFvY m01FJpWl6JJlOmO55Lh7i1J08W2pm42gLA68tohxQy2RLqKhPYf66cBxknTzFLNNG/fOIs aWDFmMhmB44Y9NJyCrUNitd3D7fibmTeMNqoWXcb5p/BgmXLCNWrzWCHF/7vhpA6i4cZtW 7xKv9lA+d7K9amw94dBtSGRLx7h468yse+QNrOsqbHq1cOuIrvglK6k5Qcb56Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV5wY3QLJz3CF; Fri, 10 Jan 2025 16:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AG0j5i062311; Fri, 10 Jan 2025 16:00:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AG0jk6062308; Fri, 10 Jan 2025 16:00:45 GMT (envelope-from git) Date: Fri, 10 Jan 2025 16:00:45 GMT Message-Id: <202501101600.50AG0jk6062308@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: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b82130e6c9add4a8892ca897df5a0ec04663ea2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6b82130e6c9add4a8892ca897df5a0ec04663ea2 commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 Author: Mark Johnston AuthorDate: 2025-01-10 15:37:07 +0000 Commit: Mark Johnston CommitDate: 2025-01-10 15:42:59 +0000 clock: Add a long ticks variable, ticksl For compatibility with Linux, it's useful to have a tick counter of width sizeof(long), but our tick counter is an int. Currently the linuxkpi tries paper over this difference, but this cannot really be done reliably, so it's desirable to have a wider tick counter. This change introduces ticksl, keeping the existing ticks variable. Follow a suggestion from kib to avoid having to maintain two separate counters and to avoid converting existing code to use ticksl: change hardclock() to update ticksl instead of ticks, and then use assembler directives to make ticks and ticksl overlap such that loading ticks gives the bottom 32 bits. This makes it possible to use ticksl in the linuxkpi without having to convert any native code, and without making hardclock() more complicated or expensive. Then, the linuxkpi can be modified to use ticksl instead of ticks. Reviewed by: olce, kib, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48383 --- sys/conf/files | 1 + sys/kern/kern_clock.c | 26 ++++++++++++++------------ sys/kern/kern_tc.c | 4 ++-- sys/kern/subr_param.c | 2 +- sys/kern/subr_ticks.s | 44 ++++++++++++++++++++++++++++++++++++++++++++ sys/sys/kernel.h | 9 +++++++++ sys/sys/timetc.h | 2 +- 7 files changed, 72 insertions(+), 16 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index d358737c5613..a630d9dd72bc 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3932,6 +3932,7 @@ kern/subr_stack.c optional ddb | stack | ktr kern/subr_stats.c optional stats kern/subr_taskqueue.c standard kern/subr_terminal.c optional vt +kern/subr_ticks.s standard kern/subr_trap.c standard kern/subr_turnstile.c standard kern/subr_uio.c standard diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 6fa2272ed54a..b11c0d235139 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -323,7 +323,7 @@ read_cpu_time(long *cp_time) #include -static int watchdog_ticks; +static long watchdog_ticks; static int watchdog_enabled; static void watchdog_fire(void); static void watchdog_config(void *, u_int, int *); @@ -369,10 +369,9 @@ watchdog_attach(void) int stathz; int profhz; int profprocs; -volatile int ticks; int psratio; -DPCPU_DEFINE_STATIC(int, pcputicks); /* Per-CPU version of ticks. */ +DPCPU_DEFINE_STATIC(long, pcputicks); /* Per-CPU version of ticks. */ #ifdef DEVICE_POLLING static int devpoll_run = 0; #endif @@ -480,14 +479,14 @@ hardclock(int cnt, int usermode) struct pstats *pstats; struct thread *td = curthread; struct proc *p = td->td_proc; - int *t = DPCPU_PTR(pcputicks); - int global, i, newticks; + long global, newticks, *t; /* * Update per-CPU and possibly global ticks values. */ + t = DPCPU_PTR(pcputicks); *t += cnt; - global = ticks; + global = atomic_load_long(&ticksl); do { newticks = *t - global; if (newticks <= 0) { @@ -496,7 +495,7 @@ hardclock(int cnt, int usermode) newticks = 0; break; } - } while (!atomic_fcmpset_int(&ticks, &global, *t)); + } while (!atomic_fcmpset_long(&ticksl, &global, *t)); /* * Run current process's virtual and profile time, as needed. @@ -525,8 +524,10 @@ hardclock(int cnt, int usermode) } #endif /* DEVICE_POLLING */ if (watchdog_enabled > 0) { - i = atomic_fetchadd_int(&watchdog_ticks, -newticks); - if (i > 0 && i <= newticks) + long left; + + left = atomic_fetchadd_long(&watchdog_ticks, -newticks); + if (left > 0 && left <= newticks) watchdog_fire(); } intr_event_handle(clk_intr_event, NULL); @@ -540,11 +541,12 @@ hardclock(int cnt, int usermode) void hardclock_sync(int cpu) { - int *t; + long *t; + KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu)); - t = DPCPU_ID_PTR(cpu, pcputicks); - *t = ticks; + t = DPCPU_ID_PTR(cpu, pcputicks); + *t = ticksl; } /* diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 26f09cb60260..a797a101bf6f 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1916,9 +1916,9 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, "Approximate number of hardclock ticks in a millisecond"); void -tc_ticktock(int cnt) +tc_ticktock(long cnt) { - static int count; + static long count; if (mtx_trylock_spin(&tc_setclock_mtx)) { count += cnt; diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 19169ba63061..f4359efec466 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -197,7 +197,7 @@ init_param1(void) * Arrange for ticks to wrap 10 minutes after boot to help catch * sign problems sooner. */ - ticks = INT_MAX - (hz * 10 * 60); + ticksl = INT_MAX - (hz * 10 * 60); vn_lock_pair_pause_max = hz / 100; if (vn_lock_pair_pause_max == 0) diff --git a/sys/kern/subr_ticks.s b/sys/kern/subr_ticks.s new file mode 100644 index 000000000000..6565ba424137 --- /dev/null +++ b/sys/kern/subr_ticks.s @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Mark Johnston + */ + +/* + * Define the "ticks" and "ticksl" variables. The former is overlaid onto the + * low bits of the latter. + */ + +#if defined(__aarch64__) +#include +#include + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) +#endif + +#ifdef _ILP32 +#define SIZEOF_TICKSL 4 +#define TICKSL_INIT .long 0 +#else +#define SIZEOF_TICKSL 8 +#define TICKSL_INIT .quad 0 +#endif + +#if defined(_ILP32) || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define TICKS_OFFSET 0 +#else +#define TICKS_OFFSET 4 +#endif + + .data + + .global ticksl + .type ticksl, %object + .align SIZEOF_TICKSL +ticksl: TICKSL_INIT + .size ticksl, SIZEOF_TICKSL + + .global ticks + .type ticks, %object +ticks =ticksl + TICKS_OFFSET + .size ticks, 4 diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 3144b5a50c98..380099092107 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -65,7 +65,16 @@ extern int psratio; /* ratio: prof / stat */ extern int stathz; /* statistics clock's frequency */ extern int profhz; /* profiling clock's frequency */ extern int profprocs; /* number of process's profiling */ + +/* + * The ticks and ticksl symbols overlap, giving a 64-bit tick counter on 64-bit + * platforms while still maintaining compatibility with the legacy 32-bit + * counter. Either value can be used, but rollover must be handled; at 1000Hz, + * ticks (and ticksl on 32-bit platforms) roll over roughly every 25 days. On + * 64-bit platforms, ticksl will not roll over in the foreseeable future. + */ extern volatile int ticks; +extern volatile long ticksl; #endif /* _KERNEL */ diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h index 1d9b18620e96..522770868425 100644 --- a/sys/sys/timetc.h +++ b/sys/sys/timetc.h @@ -87,7 +87,7 @@ extern int tc_min_ticktock_freq; /* u_int64_t tc_getfrequency(void); void tc_init(struct timecounter *tc); void tc_setclock(struct timespec *ts); -void tc_ticktock(int cnt); +void tc_ticktock(long cnt); void cpu_tick_calibration(void); #ifdef SYSCTL_DECL From nobody Fri Jan 10 16:37:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV6kn6k7Kz5kchS for ; Fri, 10 Jan 2025 16:37:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV6kn4w04z42Ql for ; Fri, 10 Jan 2025 16:37:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-38632b8ae71so1582976f8f.0 for ; Fri, 10 Jan 2025 08:37:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736527040; x=1737131840; 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=SegSh1p2WklrEWPOaQjOv7J3RTEVNkgy2UuUWwZ0WBM=; b=NbsKHzjUKHUBmcEpz/pFlVjL6aayrPRA6ekeZMnbL9VgB1SmNbG5FxKrIwgDBN8koj K2tFwymn8OKFR5+PTblSxiIkpjyseqN+DatYLycTbLchDBRHW3Vijr6ICcc0yKnh/0W9 vQDdjlhT3/TP0nIO3HRw7RtE/GOzyPPsDPNKn98wOnQp+gfz7jO11qxm6tFTBHKGzwkU kQuDBzUccNV6PfcSQ3wA2LL6h46YzpnLnE2kL8wuuqu0VmrgCUcJdeG5439K1KcKMj1w FRZTcFkL05GgcStUtpTPBX/PJeMAxFYRvGlfhSb3FrMb6EuBeiUHK7/LC+jvIBqQtcCT uu9A== X-Forwarded-Encrypted: i=1; AJvYcCXC/IMmwKJJh5sON3BWiznyCPyrJ5tHL+FNlPuZmKiEuBR3l7y4gETuMeobHNRIWqTloTM0kvVvC/fU/94fA5PxLxvG/Q==@freebsd.org X-Gm-Message-State: AOJu0Yy9Xe4kJMKzhKCaahSR8bBT4jmXvLKzxhTuuBQdFRoYdApeTyXF qzAXDAuJlUigmi3joLw1gwQ2DcfqAutQcrj3C62Pney7ZOJMki2jMgMo3GvuLeM= X-Gm-Gg: ASbGncuw4G3p0X63yftsp2jmAVHt9qkmliKDTwe1nJ0TUW2uIJCkrTPVlo8aPu/G1xZ Vsta6SnKeyO0vbg8/PBR++Hx45Fn5PrqH4kL6Fy/wAVlHGDZkNTlzSrAbfE4TwRXdHrsoLqVpbO GpiY9T+U3DOZVGG1KzVi/Oqaw0BHjTa91nUuqJA62Es24FD5cKcwcQGCglhCBXlYObC2BoKuR0Z lraBGUN3RMPMuTG3/UsyfIhZeuRZL3iXiNiXI0yPNylDMLKMDp8IsN+MuUeRnO+8PdEoW4= X-Google-Smtp-Source: AGHT+IEKuny5FUkU15R4scJSnIV//vX2MYAt3coN+/lVqOM97UvbRWaGSo1k0V9VOLn960+0ilqPEw== X-Received: by 2002:adf:b1db:0:b0:38a:2658:bbc7 with SMTP id ffacd0b85a97d-38a8730cef4mr6930495f8f.29.1736527039362; Fri, 10 Jan 2025 08:37:19 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e384054sm4955279f8f.36.2025.01.10.08.37.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jan 2025 08:37:18 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl From: Jessica Clarke In-Reply-To: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> Date: Fri, 10 Jan 2025 16:37:08 +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: <9B1B709F-5828-489C-81B5-74ED9E4502FC@freebsd.org> References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4YV6kn4w04z42Ql X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 10 Jan 2025, at 16:00, Mark Johnston wrote: >=20 > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6b82130e6c9add4a8892ca897df5a0ec= 04663ea2 >=20 > commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > Author: Mark Johnston > AuthorDate: 2025-01-10 15:37:07 +0000 > Commit: Mark Johnston > CommitDate: 2025-01-10 15:42:59 +0000 >=20 > clock: Add a long ticks variable, ticksl >=20 > For compatibility with Linux, it's useful to have a tick counter of > width sizeof(long), but our tick counter is an int. Currently the > linuxkpi tries paper over this difference, but this cannot really = be > done reliably, so it's desirable to have a wider tick counter. = This > change introduces ticksl, keeping the existing ticks variable. >=20 > Follow a suggestion from kib to avoid having to maintain two = separate > counters and to avoid converting existing code to use ticksl: = change > hardclock() to update ticksl instead of ticks, and then use = assembler > directives to make ticks and ticksl overlap such that loading ticks > gives the bottom 32 bits. This makes it possible to use ticksl in = the > linuxkpi without having to convert any native code, and without = making > hardclock() more complicated or expensive. Then, the linuxkpi can = be > modified to use ticksl instead of ticks. >=20 > Reviewed by: olce, kib, emaste > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D48383 > --- > sys/conf/files | 1 + > sys/kern/kern_clock.c | 26 ++++++++++++++------------ > sys/kern/kern_tc.c | 4 ++-- > sys/kern/subr_param.c | 2 +- > sys/kern/subr_ticks.s | 44 = ++++++++++++++++++++++++++++++++++++++++++++ > sys/sys/kernel.h | 9 +++++++++ > sys/sys/timetc.h | 2 +- > 7 files changed, 72 insertions(+), 16 deletions(-) >=20 > diff --git a/sys/conf/files b/sys/conf/files > index d358737c5613..a630d9dd72bc 100644 > --- a/sys/conf/files > +++ b/sys/conf/files > @@ -3932,6 +3932,7 @@ kern/subr_stack.c optional ddb | stack | ktr > kern/subr_stats.c optional stats > kern/subr_taskqueue.c standard > kern/subr_terminal.c optional vt > +kern/subr_ticks.s standard > kern/subr_trap.c standard > kern/subr_turnstile.c standard > kern/subr_uio.c standard > diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c > index 6fa2272ed54a..b11c0d235139 100644 > --- a/sys/kern/kern_clock.c > +++ b/sys/kern/kern_clock.c > @@ -323,7 +323,7 @@ read_cpu_time(long *cp_time) >=20 > #include >=20 > -static int watchdog_ticks; > +static long watchdog_ticks; > static int watchdog_enabled; > static void watchdog_fire(void); > static void watchdog_config(void *, u_int, int *); > @@ -369,10 +369,9 @@ watchdog_attach(void) > int stathz; > int profhz; > int profprocs; > -volatile int ticks; > int psratio; >=20 > -DPCPU_DEFINE_STATIC(int, pcputicks); /* Per-CPU version of ticks. */ > +DPCPU_DEFINE_STATIC(long, pcputicks); /* Per-CPU version of ticks. */ > #ifdef DEVICE_POLLING > static int devpoll_run =3D 0; > #endif > @@ -480,14 +479,14 @@ hardclock(int cnt, int usermode) > struct pstats *pstats; > struct thread *td =3D curthread; > struct proc *p =3D td->td_proc; > - int *t =3D DPCPU_PTR(pcputicks); > - int global, i, newticks; > + long global, newticks, *t; >=20 > /* > * Update per-CPU and possibly global ticks values. > */ > + t =3D DPCPU_PTR(pcputicks); > *t +=3D cnt; > - global =3D ticks; > + global =3D atomic_load_long(&ticksl); > do { > newticks =3D *t - global; > if (newticks <=3D 0) { > @@ -496,7 +495,7 @@ hardclock(int cnt, int usermode) > newticks =3D 0; > break; > } > - } while (!atomic_fcmpset_int(&ticks, &global, *t)); > + } while (!atomic_fcmpset_long(&ticksl, &global, *t)); >=20 > /* > * Run current process's virtual and profile time, as needed. > @@ -525,8 +524,10 @@ hardclock(int cnt, int usermode) > } > #endif /* DEVICE_POLLING */ > if (watchdog_enabled > 0) { > - i =3D atomic_fetchadd_int(&watchdog_ticks, -newticks); > - if (i > 0 && i <=3D newticks) > + long left; > + > + left =3D atomic_fetchadd_long(&watchdog_ticks, -newticks); > + if (left > 0 && left <=3D newticks) > watchdog_fire(); > } > intr_event_handle(clk_intr_event, NULL); > @@ -540,11 +541,12 @@ hardclock(int cnt, int usermode) > void > hardclock_sync(int cpu) > { > - int *t; > + long *t; > + > KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu)); > - t =3D DPCPU_ID_PTR(cpu, pcputicks); >=20 > - *t =3D ticks; > + t =3D DPCPU_ID_PTR(cpu, pcputicks); > + *t =3D ticksl; > } >=20 > /* > diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c > index 26f09cb60260..a797a101bf6f 100644 > --- a/sys/kern/kern_tc.c > +++ b/sys/kern/kern_tc.c > @@ -1916,9 +1916,9 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, = CTLFLAG_RD, &tc_tick, 0, > "Approximate number of hardclock ticks in a millisecond"); >=20 > void > -tc_ticktock(int cnt) > +tc_ticktock(long cnt) > { > - static int count; > + static long count; >=20 > if (mtx_trylock_spin(&tc_setclock_mtx)) { > count +=3D cnt; > diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c > index 19169ba63061..f4359efec466 100644 > --- a/sys/kern/subr_param.c > +++ b/sys/kern/subr_param.c > @@ -197,7 +197,7 @@ init_param1(void) > * Arrange for ticks to wrap 10 minutes after boot to help catch > * sign problems sooner. > */ > - ticks =3D INT_MAX - (hz * 10 * 60); > + ticksl =3D INT_MAX - (hz * 10 * 60); >=20 > vn_lock_pair_pause_max =3D hz / 100; > if (vn_lock_pair_pause_max =3D=3D 0) > diff --git a/sys/kern/subr_ticks.s b/sys/kern/subr_ticks.s > new file mode 100644 > index 000000000000..6565ba424137 > --- /dev/null > +++ b/sys/kern/subr_ticks.s > @@ -0,0 +1,44 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2025 Mark Johnston > + */ > + > +/* > + * Define the "ticks" and "ticksl" variables. The former is overlaid = onto the > + * low bits of the latter. > + */ > + > +#if defined(__aarch64__) > +#include > +#include > + > = +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) > +#endif > + > +#ifdef _ILP32 > +#define SIZEOF_TICKSL 4 > +#define TICKSL_INIT .long 0 > +#else > +#define SIZEOF_TICKSL 8 > +#define TICKSL_INIT .quad 0 > +#endif > + > +#if defined(_ILP32) || __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__ > +#define TICKS_OFFSET 0 > +#else > +#define TICKS_OFFSET 4 > +#endif > + > + .data > + > + .global ticksl > + .type ticksl, %object > + .align SIZEOF_TICKSL > +ticksl: TICKSL_INIT > + .size ticksl, SIZEOF_TICKSL > + > + .global ticks > + .type ticks, %object > +ticks =3Dticksl + TICKS_OFFSET > + .size ticks, 4 This can be simplified to: #if __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__ #define TICKS_OFFSET 0 #else #define TICKS_OFFSET (__SIZEOF_LONG__ - __SIZEOF_INT__) #endif .data .global ticksl .type ticksl, %object .align __SIZEOF_LONG__ ticksl: .zero __SIZEOF_LONG__ .size ticksl, __SIZEOF_LONG__ .global ticks .type ticks, %object ticks =3Dticksl + TICKS_OFFSET .size ticks, __SIZEOF_INT__ (excuse my mail client stripping the tabs...) No need to check the ABI beyond endianness. Also, shouldn=E2=80=99t these both be in .bss? Jess From nobody Fri Jan 10 16:47:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV6yp3VQpz5kcvS; Fri, 10 Jan 2025 16:47:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.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 4YV6yp1GjNz42vL; Fri, 10 Jan 2025 16:47:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id WHhot57pSIx4rWIAjtB4QM; Fri, 10 Jan 2025 16:47:45 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id WIAhtX3Q9l5eGWIAit6IC6; Fri, 10 Jan 2025 16:47:45 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=EO6l0EZC c=1 sm=1 tr=0 ts=67814f31 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=VdSt8ZQiCzkA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=JJpr4wqB_PATpTUgcekA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id E602E7CC; Fri, 10 Jan 2025 08:47:42 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B31513AF; Fri, 10 Jan 2025 08:47:42 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mark Johnston cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl In-reply-to: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> Comments: In-reply-to Mark Johnston message dated "Fri, 10 Jan 2025 16:00:45 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 10 Jan 2025 08:47:42 -0800 Message-Id: <20250110164742.B31513AF@slippy.cwsent.com> X-CMAE-Envelope: MS4xfGBq8WCGZi78cmPqUnnGWLtz3EcXlOkift4Ss89uuZNQ5/rScJht4uxDncxwvibGr+SqOLpTeax2a3R+k+fEhAdqAicLREffkegvDlVeu4L4SWX0Gul7 Zl0CH6vFhwRYbsLR2jX0dri9P+WM33TnfgmjfHBbJZL1ZVFOnA3ET+Zgd95hh5KrSWjnfOACSY0KqwjvWbey4OL2K3K8x2ufPuQpCGP1q5OJ4oqwzCXmwlRL 68QwRtQRlxf410TGw5Qx/pYsYLs63Z0JMKtBg0I1O3JCBAZzYFDZTw2Dllrv/++YEttIb1YjtIr+7B2MpZP1YhWidRwb5OzspG9RcoF48io= X-Rspamd-Queue-Id: 4YV6yp1GjNz42vL X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message <202501101600.50AG0jk6062308@gitrepo.freebsd.org>, Mark Johnston wri tes: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6b82130e6c9add4a8892ca897df5a0ec > 04663ea2 > > commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > Author: Mark Johnston > AuthorDate: 2025-01-10 15:37:07 +0000 > Commit: Mark Johnston > CommitDate: 2025-01-10 15:42:59 +0000 > > clock: Add a long ticks variable, ticksl > > For compatibility with Linux, it's useful to have a tick counter of > width sizeof(long), but our tick counter is an int. Currently the > linuxkpi tries paper over this difference, but this cannot really be > done reliably, so it's desirable to have a wider tick counter. This > change introduces ticksl, keeping the existing ticks variable. > > Follow a suggestion from kib to avoid having to maintain two separate > counters and to avoid converting existing code to use ticksl: change > hardclock() to update ticksl instead of ticks, and then use assembler > directives to make ticks and ticksl overlap such that loading ticks > gives the bottom 32 bits. This makes it possible to use ticksl in the > linuxkpi without having to convert any native code, and without making > hardclock() more complicated or expensive. Then, the linuxkpi can be > modified to use ticksl instead of ticks. > > Reviewed by: olce, kib, emaste > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D48383 > --- > sys/conf/files | 1 + > sys/kern/kern_clock.c | 26 ++++++++++++++------------ > sys/kern/kern_tc.c | 4 ++-- > sys/kern/subr_param.c | 2 +- > sys/kern/subr_ticks.s | 44 ++++++++++++++++++++++++++++++++++++++++++++ > sys/sys/kernel.h | 9 +++++++++ > sys/sys/timetc.h | 2 +- > 7 files changed, 72 insertions(+), 16 deletions(-) > See last paragraph. --- kernel.full --- linking kernel.full ld: error: undefined symbol: ticks >>> referenced by cam_iosched.c:1426 (/opt/src/git-src/sys/cam/cam_iosched.c :1426) >>> cam_iosched.o:(cam_iosched_put_back_trim) >>> referenced by cam_iosched.c:1452 (/opt/src/git-src/sys/cam/cam_iosched.c :1452) >>> cam_iosched.o:(cam_iosched_next_trim) >>> referenced by cam_iosched.c:823 (/opt/src/git-src/sys/cam/cam_iosched.c: 823) >>> cam_iosched.o:(cam_iosched_get_trim) >>> referenced 240 more times >>> did you mean: tick >>> defined in: subr_param.o ld: error: undefined symbol: ticksl >>> referenced by subr_param.c:200 (/opt/src/git-src/sys/kern/subr_param.c:2 00) >>> subr_param.o:(init_param1) >>> referenced by kern_clock.c:489 (/opt/src/git-src/sys/kern/kern_clock.c:4 89) >>> kern_clock.o:(hardclock) >>> referenced by atomic.h:184 (/opt/src/git-src/sys/amd64/include/atomic.h: 184) >>> kern_clock.o:(hardclock) >>> referenced 1 more times *** [kernel.full] Error code 1 make[2]: stopped making "all" in /export/obj/opt/src/git-src/amd64.amd64/sys /BREAK make[2]: 1 error make[2]: stopped making "all" in /export/obj/opt/src/git-src/amd64.amd64/sys /BREAK 652.14 real 4727.77 user 227.08 sys make[1]: stopped making "buildkernel" in /opt/src/git-src make: stopped making "buildkernel" in /opt/src/git-src This (failing to link) only occurs with an incremental build; a clean rebuild (of /usr/obj/sys/KERNELNAME) circumvents this error. Should this be noted in UPDATING? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Fri Jan 10 16:55:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV77y6FJGz5kfGG for ; Fri, 10 Jan 2025 16:55:42 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV77x6qbcz43mg for ; Fri, 10 Jan 2025 16:55:41 +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.49 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso17075155e9.1 for ; Fri, 10 Jan 2025 08:55:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736528139; x=1737132939; 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=HS0gN5uM/oadHMSzgk+7umsSNj9vDYR8s8Qjzr1iYd4=; b=Epez8kxDmVazuuwy9sGIm0fcWn9jmMaMZ/M5DF1EE8RsBda7HoCSBt4XPexZidUw+y 43T7bXkHd5Otd2X6WRMzQoo31mSZlFB19pYcHp6JIQgDRXcUY7ZSGdUOdX4CBeeNPsI5 8Q3mhLAu1nLFsQnbUFchzGyw0Z7Idu249Mlqo2zjxaYfm7t8ShDagMMTeo8ffAjkNCqQ qomjxgX52ftOd6jmwqQSNV93wcsd7hExDeLIuAiKh1FTduyUKLwW5i3V0Fi+7v60ZBdf yI4eed1e4T2t5S7UtD7CCrZO9cNK7EBu6FxYNsSdjNU4eMVIT6R/FtzWZqZEoyUVq6Y0 lhbQ== X-Forwarded-Encrypted: i=1; AJvYcCUqehhs9iqT/G4G+S6MFAcTLdyl7PnLBNXRwG3CJqW3l4SVawiHrPnQAVXPgy2hlGHE1XYlXcZIgvFq9zOONQnNkCia7g==@freebsd.org X-Gm-Message-State: AOJu0Yw33HmvyqKAEFK6XZ8+nggybuPKXXnqc/PsLuMyY4ml6SGrBc7O 6e4jXW1MKp0pZ9Ouih+pXpN5ncKMlypxQXn9K64A8LBR6BOpU2eAVP/B5SqeHWmcdVa6tHmQ1iR F X-Gm-Gg: ASbGncv7966KllF4FQb4j9LkdEA+oLy4kZ2Uq8pOax0E0lwcjTcVe2nCJ+T5uTdmCFI Xt5YBoE2/Dlz6Ddg87o7dwHvA3npF0qU7hY4/dRLHCLDg29nUzYTVu6Qe01axL9Qo8F7txE/s0E kLVClbehJjWdz+2FCIX3uLHnEK1kg+/zcfRdvL7cs0jaukLqrUQ0hnsKoGPr6XwCRUwoNWqXkW/ /qMOCSfGQL182MVlJL2eX2bCSbDkbTLnTBz8dxV9y7A8RqEKlOP8LHT0V/trD6b7jJkKvQ= X-Google-Smtp-Source: AGHT+IGCkXxd7WO8j1b2/2wytxmfGzm38cb8FX6UkL6I5FFiTlzDfbvrJtDqgufsPfUg9phh0eaxug== X-Received: by 2002:a05:600c:4449:b0:435:192:63ca with SMTP id 5b1f17b1804b1-436e26f481dmr7775575e9.21.1736528139286; Fri, 10 Jan 2025 08:55:39 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da66e6sm92887815e9.4.2025.01.10.08.55.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jan 2025 08:55:38 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl From: Jessica Clarke In-Reply-To: <9B1B709F-5828-489C-81B5-74ED9E4502FC@freebsd.org> Date: Fri, 10 Jan 2025 16:55:28 +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: <040B6FE0-1C9F-411F-BFA9-D578462C572E@freebsd.org> References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> <9B1B709F-5828-489C-81B5-74ED9E4502FC@freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4YV77x6qbcz43mg X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; 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]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.49:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.49:from] On 10 Jan 2025, at 16:37, Jessica Clarke wrote: > On 10 Jan 2025, at 16:00, Mark Johnston wrote: >>=20 >> The branch main has been updated by markj: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6b82130e6c9add4a8892ca897df5a0ec= 04663ea2 >>=20 >> commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 >> Author: Mark Johnston >> AuthorDate: 2025-01-10 15:37:07 +0000 >> Commit: Mark Johnston >> CommitDate: 2025-01-10 15:42:59 +0000 >>=20 >> clock: Add a long ticks variable, ticksl >>=20 >> For compatibility with Linux, it's useful to have a tick counter of >> width sizeof(long), but our tick counter is an int. Currently the >> linuxkpi tries paper over this difference, but this cannot really = be >> done reliably, so it's desirable to have a wider tick counter. = This >> change introduces ticksl, keeping the existing ticks variable. >>=20 >> Follow a suggestion from kib to avoid having to maintain two = separate >> counters and to avoid converting existing code to use ticksl: = change >> hardclock() to update ticksl instead of ticks, and then use = assembler >> directives to make ticks and ticksl overlap such that loading ticks >> gives the bottom 32 bits. This makes it possible to use ticksl in = the >> linuxkpi without having to convert any native code, and without = making >> hardclock() more complicated or expensive. Then, the linuxkpi can = be >> modified to use ticksl instead of ticks. >>=20 >> Reviewed by: olce, kib, emaste >> MFC after: 1 month >> Differential Revision: https://reviews.freebsd.org/D48383 >> --- >> sys/conf/files | 1 + >> sys/kern/kern_clock.c | 26 ++++++++++++++------------ >> sys/kern/kern_tc.c | 4 ++-- >> sys/kern/subr_param.c | 2 +- >> sys/kern/subr_ticks.s | 44 = ++++++++++++++++++++++++++++++++++++++++++++ >> sys/sys/kernel.h | 9 +++++++++ >> sys/sys/timetc.h | 2 +- >> 7 files changed, 72 insertions(+), 16 deletions(-) >>=20 >> diff --git a/sys/conf/files b/sys/conf/files >> index d358737c5613..a630d9dd72bc 100644 >> --- a/sys/conf/files >> +++ b/sys/conf/files >> @@ -3932,6 +3932,7 @@ kern/subr_stack.c optional ddb | stack | ktr >> kern/subr_stats.c optional stats >> kern/subr_taskqueue.c standard >> kern/subr_terminal.c optional vt >> +kern/subr_ticks.s standard >> kern/subr_trap.c standard >> kern/subr_turnstile.c standard >> kern/subr_uio.c standard >> diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c >> index 6fa2272ed54a..b11c0d235139 100644 >> --- a/sys/kern/kern_clock.c >> +++ b/sys/kern/kern_clock.c >> @@ -323,7 +323,7 @@ read_cpu_time(long *cp_time) >>=20 >> #include >>=20 >> -static int watchdog_ticks; >> +static long watchdog_ticks; >> static int watchdog_enabled; >> static void watchdog_fire(void); >> static void watchdog_config(void *, u_int, int *); >> @@ -369,10 +369,9 @@ watchdog_attach(void) >> int stathz; >> int profhz; >> int profprocs; >> -volatile int ticks; >> int psratio; >>=20 >> -DPCPU_DEFINE_STATIC(int, pcputicks); /* Per-CPU version of ticks. */ >> +DPCPU_DEFINE_STATIC(long, pcputicks); /* Per-CPU version of ticks. = */ >> #ifdef DEVICE_POLLING >> static int devpoll_run =3D 0; >> #endif >> @@ -480,14 +479,14 @@ hardclock(int cnt, int usermode) >> struct pstats *pstats; >> struct thread *td =3D curthread; >> struct proc *p =3D td->td_proc; >> - int *t =3D DPCPU_PTR(pcputicks); >> - int global, i, newticks; >> + long global, newticks, *t; >>=20 >> /* >> * Update per-CPU and possibly global ticks values. >> */ >> + t =3D DPCPU_PTR(pcputicks); >> *t +=3D cnt; >> - global =3D ticks; >> + global =3D atomic_load_long(&ticksl); >> do { >> newticks =3D *t - global; >> if (newticks <=3D 0) { >> @@ -496,7 +495,7 @@ hardclock(int cnt, int usermode) >> newticks =3D 0; >> break; >> } >> - } while (!atomic_fcmpset_int(&ticks, &global, *t)); >> + } while (!atomic_fcmpset_long(&ticksl, &global, *t)); >>=20 >> /* >> * Run current process's virtual and profile time, as needed. >> @@ -525,8 +524,10 @@ hardclock(int cnt, int usermode) >> } >> #endif /* DEVICE_POLLING */ >> if (watchdog_enabled > 0) { >> - i =3D atomic_fetchadd_int(&watchdog_ticks, -newticks); >> - if (i > 0 && i <=3D newticks) >> + long left; >> + >> + left =3D atomic_fetchadd_long(&watchdog_ticks, -newticks); >> + if (left > 0 && left <=3D newticks) >> watchdog_fire(); >> } >> intr_event_handle(clk_intr_event, NULL); >> @@ -540,11 +541,12 @@ hardclock(int cnt, int usermode) >> void >> hardclock_sync(int cpu) >> { >> - int *t; >> + long *t; >> + >> KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu)); >> - t =3D DPCPU_ID_PTR(cpu, pcputicks); >>=20 >> - *t =3D ticks; >> + t =3D DPCPU_ID_PTR(cpu, pcputicks); >> + *t =3D ticksl; >> } >>=20 >> /* >> diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c >> index 26f09cb60260..a797a101bf6f 100644 >> --- a/sys/kern/kern_tc.c >> +++ b/sys/kern/kern_tc.c >> @@ -1916,9 +1916,9 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, = CTLFLAG_RD, &tc_tick, 0, >> "Approximate number of hardclock ticks in a millisecond"); >>=20 >> void >> -tc_ticktock(int cnt) >> +tc_ticktock(long cnt) >> { >> - static int count; >> + static long count; >>=20 >> if (mtx_trylock_spin(&tc_setclock_mtx)) { >> count +=3D cnt; >> diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c >> index 19169ba63061..f4359efec466 100644 >> --- a/sys/kern/subr_param.c >> +++ b/sys/kern/subr_param.c >> @@ -197,7 +197,7 @@ init_param1(void) >> * Arrange for ticks to wrap 10 minutes after boot to help catch >> * sign problems sooner. >> */ >> - ticks =3D INT_MAX - (hz * 10 * 60); >> + ticksl =3D INT_MAX - (hz * 10 * 60); >>=20 >> vn_lock_pair_pause_max =3D hz / 100; >> if (vn_lock_pair_pause_max =3D=3D 0) >> diff --git a/sys/kern/subr_ticks.s b/sys/kern/subr_ticks.s >> new file mode 100644 >> index 000000000000..6565ba424137 >> --- /dev/null >> +++ b/sys/kern/subr_ticks.s >> @@ -0,0 +1,44 @@ >> +/*- >> + * SPDX-License-Identifier: BSD-2-Clause >> + * >> + * Copyright (c) 2025 Mark Johnston >> + */ >> + >> +/* >> + * Define the "ticks" and "ticksl" variables. The former is = overlaid onto the >> + * low bits of the latter. >> + */ >> + >> +#if defined(__aarch64__) >> +#include >> +#include >> + >> = +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) >> +#endif >> + >> +#ifdef _ILP32 >> +#define SIZEOF_TICKSL 4 >> +#define TICKSL_INIT .long 0 >> +#else >> +#define SIZEOF_TICKSL 8 >> +#define TICKSL_INIT .quad 0 >> +#endif >> + >> +#if defined(_ILP32) || __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__ >> +#define TICKS_OFFSET 0 >> +#else >> +#define TICKS_OFFSET 4 >> +#endif >> + >> + .data >> + >> + .global ticksl >> + .type ticksl, %object >> + .align SIZEOF_TICKSL >> +ticksl: TICKSL_INIT >> + .size ticksl, SIZEOF_TICKSL >> + >> + .global ticks >> + .type ticks, %object >> +ticks =3Dticksl + TICKS_OFFSET >> + .size ticks, 4 >=20 > This can be simplified to: >=20 > #if __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__ > #define TICKS_OFFSET 0 > #else > #define TICKS_OFFSET (__SIZEOF_LONG__ - __SIZEOF_INT__) > #endif >=20 > .data >=20 > .global ticksl > .type ticksl, %object > .align __SIZEOF_LONG__ > ticksl: .zero __SIZEOF_LONG__ > .size ticksl, __SIZEOF_LONG__ >=20 > .global ticks > .type ticks, %object > ticks =3Dticksl + TICKS_OFFSET > .size ticks, __SIZEOF_INT__ >=20 > (excuse my mail client stripping the tabs...) >=20 > No need to check the ABI beyond endianness. >=20 > Also, shouldn=E2=80=99t these both be in .bss? And one more thing: the convention is to use .S, not .s, for assembly files, since the former are preprocessed[^1]. I=E2=80=99m surprised this = even builds when given the lower case suffix, as bsd.suffixes.mk passes -x assembler for the .s.o rule. Jess [^1]: Unless you know it doesn=E2=80=99t need preprocessing and never = will... From nobody Fri Jan 10 16:58:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV7CL6Z4Vz5kfD2 for ; Fri, 10 Jan 2025 16:58:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV7CL4jpkz44Sj for ; Fri, 10 Jan 2025 16:58:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2ef6c56032eso2969897a91.2 for ; Fri, 10 Jan 2025 08:58:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1736528317; x=1737133117; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tQwiRvEN4HhLBDItRsPtE9zzSMZnFxatLpv4gFBuQm4=; b=TBgDuCuKPRXNN2KFUn4bv9j+jDvlG62bIKlXxrhfqcCW5Q/Pf5Fsl+DdiBmqJN0JDj Mb4IfqP3hxF4PyEouHGD7kJRwNOplGmQRbpPiafbCQHnHsMwNSHH2xQP9J2qXIYVxV56 Vez0+5Xbd/dkf8sU8fqmY1GjXDmXo/8r860arxRR+F+ifuskHTcQRfct3L1hRyJijvp3 vZuC/raN8UR4F10OqZvLufEhh81DFLB/YX0ERAUMHmufN3Dkl0RjgKmyoZSbiwMXKnRY yhyzWD8WoXoSlk8vpKFTbSzl15383K3xxDTX+ac0/yqmAECwO6Irwc4Guq/fII4L3IDs LVwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736528317; x=1737133117; 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=tQwiRvEN4HhLBDItRsPtE9zzSMZnFxatLpv4gFBuQm4=; b=Z7Q8181iZmxU3LXo+06QdAb1nMNRao7GQWZqAbYPSCoNwNwxQL5CUEew41NM7/dLCr QJiRAW5FlZ4IA45VuGBl3xv/z/K93zDdcK1wJm9AJDY/spDRLUHoSSlYaRcKSSrbFEL6 GdFfKIoJe561CmEM2dyBKuWnGr1mr2v+Sw7V/vgjn+UDeoKTnWIL27CfEnBTwTkRfdFU QWbjSuLm795ti+i9mWx4DHnvJQbhho+03ROIfnUiQk99ZNJs6xmcFXFbiQBx5lTXVO6s 7oJWgv/i0rJqecfPsm0uZjylKA1uLo+ZWoF6ieIsbA8hvBiNjC9wfRA6LgsmbxLhyk1o huTQ== X-Forwarded-Encrypted: i=1; AJvYcCXjQotQwPYMJMZjG+UHBr5F3X75AF0RjhvkkoYbroqGiHGC/7a5yy7zjyESDzFwUQgBJTdVYbb5/Aa4lOMd/bjVeFP8ug==@freebsd.org X-Gm-Message-State: AOJu0YxnI1n/s+yEB1WVZ+IXesoWFvU0aI3V1UBidb6y8O4M3eYT8vPF lpvRkrNQCCxS0akwgkw+q+OrqHBoJLMYOO5GY4Qn+q0fE4V+iHkQUaQuX9KJ7AV3esvhTxXlYYf G5ytxSoA3bg3a7qYtqp8qT77jbTgJnKBWA7TxXq57Wureap112Hg= X-Gm-Gg: ASbGncsq1MkhSr2M61yMioTDjKZ19TkBAyJkrZdx2QYKVxTFQ+VtxeA9f0efhN8Z0GT hzwGPVvXslESifQNV6u23/jRcGxcNDEihmlvlaA== X-Google-Smtp-Source: AGHT+IHxZqVKRegm3PMU1o5t+WQOlBg8fhMbyov5ePGWTH56Om2t76a8BhqdoFsZRdIHMcTck9Cu5cD4boKrc5slG6Y= X-Received: by 2002:a17:90b:4a44:b0:2f4:f7f8:fc8a with SMTP id 98e67ed59e1d1-2f548f7649amr17531126a91.33.1736528317211; Fri, 10 Jan 2025 08:58:37 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> <9B1B709F-5828-489C-81B5-74ED9E4502FC@freebsd.org> <040B6FE0-1C9F-411F-BFA9-D578462C572E@freebsd.org> In-Reply-To: <040B6FE0-1C9F-411F-BFA9-D578462C572E@freebsd.org> From: Warner Losh Date: Fri, 10 Jan 2025 09:58:26 -0700 X-Gm-Features: AbW1kvZUEVBzV2daATWdRzsRS3KcrWe0Kxl3hpGSD17B3Vi00vDPAuap9Xr0mqw Message-ID: Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl To: Jessica Clarke Cc: Mark Johnston , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000007d90f7062b5d015b" X-Rspamd-Queue-Id: 4YV7CL4jpkz44Sj X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --0000000000007d90f7062b5d015b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 10, 2025 at 9:55=E2=80=AFAM Jessica Clarke = wrote: > On 10 Jan 2025, at 16:37, Jessica Clarke wrote: > > On 10 Jan 2025, at 16:00, Mark Johnston wrote: > >> > >> The branch main has been updated by markj: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D6b82130e6c9add4a8892ca897df5a0e= c04663ea2 > >> > >> commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > >> Author: Mark Johnston > >> AuthorDate: 2025-01-10 15:37:07 +0000 > >> Commit: Mark Johnston > >> CommitDate: 2025-01-10 15:42:59 +0000 > >> > >> clock: Add a long ticks variable, ticksl > >> > >> For compatibility with Linux, it's useful to have a tick counter of > >> width sizeof(long), but our tick counter is an int. Currently the > >> linuxkpi tries paper over this difference, but this cannot really be > >> done reliably, so it's desirable to have a wider tick counter. This > >> change introduces ticksl, keeping the existing ticks variable. > >> > >> Follow a suggestion from kib to avoid having to maintain two separat= e > >> counters and to avoid converting existing code to use ticksl: change > >> hardclock() to update ticksl instead of ticks, and then use assemble= r > >> directives to make ticks and ticksl overlap such that loading ticks > >> gives the bottom 32 bits. This makes it possible to use ticksl in t= he > >> linuxkpi without having to convert any native code, and without maki= ng > >> hardclock() more complicated or expensive. Then, the linuxkpi can b= e > >> modified to use ticksl instead of ticks. > >> > >> Reviewed by: olce, kib, emaste > >> MFC after: 1 month > >> Differential Revision: https://reviews.freebsd.org/D48383 > >> --- > >> sys/conf/files | 1 + > >> sys/kern/kern_clock.c | 26 ++++++++++++++------------ > >> sys/kern/kern_tc.c | 4 ++-- > >> sys/kern/subr_param.c | 2 +- > >> sys/kern/subr_ticks.s | 44 +++++++++++++++++++++++++++++++++++++++++++= + > >> sys/sys/kernel.h | 9 +++++++++ > >> sys/sys/timetc.h | 2 +- > >> 7 files changed, 72 insertions(+), 16 deletions(-) > >> > >> diff --git a/sys/conf/files b/sys/conf/files > >> index d358737c5613..a630d9dd72bc 100644 > >> --- a/sys/conf/files > >> +++ b/sys/conf/files > >> @@ -3932,6 +3932,7 @@ kern/subr_stack.c optional ddb | stack | ktr > >> kern/subr_stats.c optional stats > >> kern/subr_taskqueue.c standard > >> kern/subr_terminal.c optional vt > >> +kern/subr_ticks.s standard > >> kern/subr_trap.c standard > >> kern/subr_turnstile.c standard > >> kern/subr_uio.c standard > >> diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c > >> index 6fa2272ed54a..b11c0d235139 100644 > >> --- a/sys/kern/kern_clock.c > >> +++ b/sys/kern/kern_clock.c > >> @@ -323,7 +323,7 @@ read_cpu_time(long *cp_time) > >> > >> #include > >> > >> -static int watchdog_ticks; > >> +static long watchdog_ticks; > >> static int watchdog_enabled; > >> static void watchdog_fire(void); > >> static void watchdog_config(void *, u_int, int *); > >> @@ -369,10 +369,9 @@ watchdog_attach(void) > >> int stathz; > >> int profhz; > >> int profprocs; > >> -volatile int ticks; > >> int psratio; > >> > >> -DPCPU_DEFINE_STATIC(int, pcputicks); /* Per-CPU version of ticks. */ > >> +DPCPU_DEFINE_STATIC(long, pcputicks); /* Per-CPU version of ticks. */ > >> #ifdef DEVICE_POLLING > >> static int devpoll_run =3D 0; > >> #endif > >> @@ -480,14 +479,14 @@ hardclock(int cnt, int usermode) > >> struct pstats *pstats; > >> struct thread *td =3D curthread; > >> struct proc *p =3D td->td_proc; > >> - int *t =3D DPCPU_PTR(pcputicks); > >> - int global, i, newticks; > >> + long global, newticks, *t; > >> > >> /* > >> * Update per-CPU and possibly global ticks values. > >> */ > >> + t =3D DPCPU_PTR(pcputicks); > >> *t +=3D cnt; > >> - global =3D ticks; > >> + global =3D atomic_load_long(&ticksl); > >> do { > >> newticks =3D *t - global; > >> if (newticks <=3D 0) { > >> @@ -496,7 +495,7 @@ hardclock(int cnt, int usermode) > >> newticks =3D 0; > >> break; > >> } > >> - } while (!atomic_fcmpset_int(&ticks, &global, *t)); > >> + } while (!atomic_fcmpset_long(&ticksl, &global, *t)); > >> > >> /* > >> * Run current process's virtual and profile time, as needed. > >> @@ -525,8 +524,10 @@ hardclock(int cnt, int usermode) > >> } > >> #endif /* DEVICE_POLLING */ > >> if (watchdog_enabled > 0) { > >> - i =3D atomic_fetchadd_int(&watchdog_ticks, -newticks); > >> - if (i > 0 && i <=3D newticks) > >> + long left; > >> + > >> + left =3D atomic_fetchadd_long(&watchdog_ticks, -newticks); > >> + if (left > 0 && left <=3D newticks) > >> watchdog_fire(); > >> } > >> intr_event_handle(clk_intr_event, NULL); > >> @@ -540,11 +541,12 @@ hardclock(int cnt, int usermode) > >> void > >> hardclock_sync(int cpu) > >> { > >> - int *t; > >> + long *t; > >> + > >> KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu)); > >> - t =3D DPCPU_ID_PTR(cpu, pcputicks); > >> > >> - *t =3D ticks; > >> + t =3D DPCPU_ID_PTR(cpu, pcputicks); > >> + *t =3D ticksl; > >> } > >> > >> /* > >> diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c > >> index 26f09cb60260..a797a101bf6f 100644 > >> --- a/sys/kern/kern_tc.c > >> +++ b/sys/kern/kern_tc.c > >> @@ -1916,9 +1916,9 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, > CTLFLAG_RD, &tc_tick, 0, > >> "Approximate number of hardclock ticks in a millisecond"); > >> > >> void > >> -tc_ticktock(int cnt) > >> +tc_ticktock(long cnt) > >> { > >> - static int count; > >> + static long count; > >> > >> if (mtx_trylock_spin(&tc_setclock_mtx)) { > >> count +=3D cnt; > >> diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c > >> index 19169ba63061..f4359efec466 100644 > >> --- a/sys/kern/subr_param.c > >> +++ b/sys/kern/subr_param.c > >> @@ -197,7 +197,7 @@ init_param1(void) > >> * Arrange for ticks to wrap 10 minutes after boot to help catch > >> * sign problems sooner. > >> */ > >> - ticks =3D INT_MAX - (hz * 10 * 60); > >> + ticksl =3D INT_MAX - (hz * 10 * 60); > >> > >> vn_lock_pair_pause_max =3D hz / 100; > >> if (vn_lock_pair_pause_max =3D=3D 0) > >> diff --git a/sys/kern/subr_ticks.s b/sys/kern/subr_ticks.s > >> new file mode 100644 > >> index 000000000000..6565ba424137 > >> --- /dev/null > >> +++ b/sys/kern/subr_ticks.s > >> @@ -0,0 +1,44 @@ > >> +/*- > >> + * SPDX-License-Identifier: BSD-2-Clause > >> + * > >> + * Copyright (c) 2025 Mark Johnston > >> + */ > >> + > >> +/* > >> + * Define the "ticks" and "ticksl" variables. The former is overlaid > onto the > >> + * low bits of the latter. > >> + */ > >> + > >> +#if defined(__aarch64__) > >> +#include > >> +#include > >> + > >> +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VA= L) > >> +#endif > >> + > >> +#ifdef _ILP32 > >> +#define SIZEOF_TICKSL 4 > >> +#define TICKSL_INIT .long 0 > >> +#else > >> +#define SIZEOF_TICKSL 8 > >> +#define TICKSL_INIT .quad 0 > >> +#endif > >> + > >> +#if defined(_ILP32) || __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__ > >> +#define TICKS_OFFSET 0 > >> +#else > >> +#define TICKS_OFFSET 4 > >> +#endif > >> + > >> + .data > >> + > >> + .global ticksl > >> + .type ticksl, %object > >> + .align SIZEOF_TICKSL > >> +ticksl: TICKSL_INIT > >> + .size ticksl, SIZEOF_TICKSL > >> + > >> + .global ticks > >> + .type ticks, %object > >> +ticks =3Dticksl + TICKS_OFFSET > >> + .size ticks, 4 > > > > This can be simplified to: > > > > #if __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__ > > #define TICKS_OFFSET 0 > > #else > > #define TICKS_OFFSET (__SIZEOF_LONG__ - __SIZEOF_INT__) > > #endif > > > > .data > > > > .global ticksl > > .type ticksl, %object > > .align __SIZEOF_LONG__ > > ticksl: .zero __SIZEOF_LONG__ > > .size ticksl, __SIZEOF_LONG__ > > > > .global ticks > > .type ticks, %object > > ticks =3Dticksl + TICKS_OFFSET > > .size ticks, __SIZEOF_INT__ > > > > (excuse my mail client stripping the tabs...) > > > > No need to check the ABI beyond endianness. > > > > Also, shouldn=E2=80=99t these both be in .bss? > > And one more thing: the convention is to use .S, not .s, for assembly > files, since the former are preprocessed[^1]. I=E2=80=99m surprised this = even > builds when given the lower case suffix, as bsd.suffixes.mk passes > -x assembler for the .s.o rule. > > Jess > > [^1]: Unless you know it doesn=E2=80=99t need preprocessing and never wil= l... > I had this same comment in a review, but was busy and didn't get to make it= . We *NEVER* have .s except for weird things we might generate, by convention= . We spent a lot of time fixing this a few months ago. Warner --0000000000007d90f7062b5d015b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Jan 10,= 2025 at 9:55=E2=80=AFAM Jessica Clarke <jrtc27@freebsd.org> wrote:
On 10 Jan 2025, at 16:37, Jessica Clarke <jrtc2= 7@FreeBSD.org> wrote:
> On 10 Jan 2025, at 16:00, Mark Johnston <markj@FreeBSD.org> wrot= e:
>>
>> The branch main has been updated by markj:
>>
>> URL: http= s://cgit.FreeBSD.org/src/commit/?id=3D6b82130e6c9add4a8892ca897df5a0ec04663= ea2
>>
>> commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2
>> Author:=C2=A0 =C2=A0 =C2=A0Mark Johnston <markj@FreeBSD.org>=
>> AuthorDate: 2025-01-10 15:37:07 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0Mark Johnston <markj@FreeBSD.org>=
>> CommitDate: 2025-01-10 15:42:59 +0000
>>
>>=C2=A0 =C2=A0clock: Add a long ticks variable, ticksl
>>
>>=C2=A0 =C2=A0For compatibility with Linux, it's useful to have = a tick counter of
>>=C2=A0 =C2=A0width sizeof(long), but our tick counter is an int.=C2= =A0 Currently the
>>=C2=A0 =C2=A0linuxkpi tries paper over this difference, but this ca= nnot really be
>>=C2=A0 =C2=A0done reliably, so it's desirable to have a wider t= ick counter.=C2=A0 This
>>=C2=A0 =C2=A0change introduces ticksl, keeping the existing ticks v= ariable.
>>
>>=C2=A0 =C2=A0Follow a suggestion from kib to avoid having to mainta= in two separate
>>=C2=A0 =C2=A0counters and to avoid converting existing code to use = ticksl: change
>>=C2=A0 =C2=A0hardclock() to update ticksl instead of ticks, and the= n use assembler
>>=C2=A0 =C2=A0directives to make ticks and ticksl overlap such that = loading ticks
>>=C2=A0 =C2=A0gives the bottom 32 bits.=C2=A0 This makes it possible= to use ticksl in the
>>=C2=A0 =C2=A0linuxkpi without having to convert any native code, an= d without making
>>=C2=A0 =C2=A0hardclock() more complicated or expensive.=C2=A0 Then,= the linuxkpi can be
>>=C2=A0 =C2=A0modified to use ticksl instead of ticks.
>>
>>=C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 olce, kib, emaste
>>=C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 1 month
>>=C2=A0 =C2=A0Differential Revision:=C2=A0 https://reviews.= freebsd.org/D48383
>> ---
>> sys/conf/files=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 1 +
>> sys/kern/kern_clock.c | 26 ++++++++++++++------------
>> sys/kern/kern_tc.c=C2=A0 =C2=A0 |=C2=A0 4 ++--
>> sys/kern/subr_param.c |=C2=A0 2 +-
>> sys/kern/subr_ticks.s | 44 +++++++++++++++++++++++++++++++++++++++= +++++
>> sys/sys/kernel.h=C2=A0 =C2=A0 =C2=A0 |=C2=A0 9 +++++++++
>> sys/sys/timetc.h=C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-
>> 7 files changed, 72 insertions(+), 16 deletions(-)
>>
>> diff --git a/sys/conf/files b/sys/conf/files
>> index d358737c5613..a630d9dd72bc 100644
>> --- a/sys/conf/files
>> +++ b/sys/conf/files
>> @@ -3932,6 +3932,7 @@ kern/subr_stack.c optional ddb | stack | ktr=
>> kern/subr_stats.c optional stats
>> kern/subr_taskqueue.c standard
>> kern/subr_terminal.c optional vt
>> +kern/subr_ticks.s standard
>> kern/subr_trap.c standard
>> kern/subr_turnstile.c standard
>> kern/subr_uio.c standard
>> diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
>> index 6fa2272ed54a..b11c0d235139 100644
>> --- a/sys/kern/kern_clock.c
>> +++ b/sys/kern/kern_clock.c
>> @@ -323,7 +323,7 @@ read_cpu_time(long *cp_time)
>>
>> #include <sys/watchdog.h>
>>
>> -static int watchdog_ticks;
>> +static long watchdog_ticks;
>> static int watchdog_enabled;
>> static void watchdog_fire(void);
>> static void watchdog_config(void *, u_int, int *);
>> @@ -369,10 +369,9 @@ watchdog_attach(void)
>> int stathz;
>> int profhz;
>> int profprocs;
>> -volatile int ticks;
>> int psratio;
>>
>> -DPCPU_DEFINE_STATIC(int, pcputicks); /* Per-CPU version of ticks.= */
>> +DPCPU_DEFINE_STATIC(long, pcputicks); /* Per-CPU version of ticks= . */
>> #ifdef DEVICE_POLLING
>> static int devpoll_run =3D 0;
>> #endif
>> @@ -480,14 +479,14 @@ hardclock(int cnt, int usermode)
>> struct pstats *pstats;
>> struct thread *td =3D curthread;
>> struct proc *p =3D td->td_proc;
>> - int *t =3D DPCPU_PTR(pcputicks);
>> - int global, i, newticks;
>> + long global, newticks, *t;
>>
>> /*
>> * Update per-CPU and possibly global ticks values.
>> */
>> + t =3D DPCPU_PTR(pcputicks);
>> *t +=3D cnt;
>> - global =3D ticks;
>> + global =3D atomic_load_long(&ticksl);
>> do {
>> newticks =3D *t - global;
>> if (newticks <=3D 0) {
>> @@ -496,7 +495,7 @@ hardclock(int cnt, int usermode)
>> newticks =3D 0;
>> break;
>> }
>> - } while (!atomic_fcmpset_int(&ticks, &global, *t));
>> + } while (!atomic_fcmpset_long(&ticksl, &global, *t)); >>
>> /*
>> * Run current process's virtual and profile time, as needed. >> @@ -525,8 +524,10 @@ hardclock(int cnt, int usermode)
>> }
>> #endif /* DEVICE_POLLING */
>> if (watchdog_enabled > 0) {
>> - i =3D atomic_fetchadd_int(&watchdog_ticks, -newticks);
>> - if (i > 0 && i <=3D newticks)
>> + long left;
>> +
>> + left =3D atomic_fetchadd_long(&watchdog_ticks, -newticks); >> + if (left > 0 && left <=3D newticks)
>> watchdog_fire();
>> }
>> intr_event_handle(clk_intr_event, NULL);
>> @@ -540,11 +541,12 @@ hardclock(int cnt, int usermode)
>> void
>> hardclock_sync(int cpu)
>> {
>> - int *t;
>> + long *t;
>> +
>> KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu));
>> - t =3D DPCPU_ID_PTR(cpu, pcputicks);
>>
>> - *t =3D ticks;
>> + t =3D DPCPU_ID_PTR(cpu, pcputicks);
>> + *t =3D ticksl;
>> }
>>
>> /*
>> diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
>> index 26f09cb60260..a797a101bf6f 100644
>> --- a/sys/kern/kern_tc.c
>> +++ b/sys/kern/kern_tc.c
>> @@ -1916,9 +1916,9 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, tick= , CTLFLAG_RD, &tc_tick, 0,
>>=C2=A0 =C2=A0 "Approximate number of hardclock ticks in a mill= isecond");
>>
>> void
>> -tc_ticktock(int cnt)
>> +tc_ticktock(long cnt)
>> {
>> - static int count;
>> + static long count;
>>
>> if (mtx_trylock_spin(&tc_setclock_mtx)) {
>> count +=3D cnt;
>> diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
>> index 19169ba63061..f4359efec466 100644
>> --- a/sys/kern/subr_param.c
>> +++ b/sys/kern/subr_param.c
>> @@ -197,7 +197,7 @@ init_param1(void)
>> * Arrange for ticks to wrap 10 minutes after boot to help catch >> * sign problems sooner.
>> */
>> - ticks =3D INT_MAX - (hz * 10 * 60);
>> + ticksl =3D INT_MAX - (hz * 10 * 60);
>>
>> vn_lock_pair_pause_max =3D hz / 100;
>> if (vn_lock_pair_pause_max =3D=3D 0)
>> diff --git a/sys/kern/subr_ticks.s b/sys/kern/subr_ticks.s
>> new file mode 100644
>> index 000000000000..6565ba424137
>> --- /dev/null
>> +++ b/sys/kern/subr_ticks.s
>> @@ -0,0 +1,44 @@
>> +/*-
>> + * SPDX-License-Identifier: BSD-2-Clause
>> + *
>> + * Copyright (c) 2025 Mark Johnston <markj@FreeBSD.org>
>> + */
>> +
>> +/*
>> + * Define the "ticks" and "ticksl" variables.= =C2=A0 The former is overlaid onto the
>> + * low bits of the latter.
>> + */
>> +
>> +#if defined(__aarch64__)
>> +#include <sys/elf_common.h>
>> +#include <machine/asm.h>
>> +
>> +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_= 1_VAL)
>> +#endif
>> +
>> +#ifdef _ILP32
>> +#define SIZEOF_TICKSL 4
>> +#define TICKSL_INIT .long 0
>> +#else
>> +#define SIZEOF_TICKSL 8
>> +#define TICKSL_INIT .quad 0
>> +#endif
>> +
>> +#if defined(_ILP32) || __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIA= N__
>> +#define TICKS_OFFSET 0
>> +#else
>> +#define TICKS_OFFSET 4
>> +#endif
>> +
>> + .data
>> +
>> + .global ticksl
>> + .type ticksl, %object
>> + .align SIZEOF_TICKSL
>> +ticksl: TICKSL_INIT
>> + .size ticksl, SIZEOF_TICKSL
>> +
>> + .global ticks
>> + .type ticks, %object
>> +ticks =3Dticksl + TICKS_OFFSET
>> + .size ticks, 4
>
> This can be simplified to:
>
> #if __BYTE_ORDER__ =3D=3D __ORDER_LITTLE_ENDIAN__
> #define TICKS_OFFSET 0
> #else
> #define TICKS_OFFSET (__SIZEOF_LONG__ - __SIZEOF_INT__)
> #endif
>
> .data
>
> .global ticksl
> .type ticksl, %object
> .align __SIZEOF_LONG__
> ticksl: .zero __SIZEOF_LONG__
> .size ticksl, __SIZEOF_LONG__
>
> .global ticks
> .type ticks, %object
> ticks =3Dticksl + TICKS_OFFSET
> .size ticks, __SIZEOF_INT__
>
> (excuse my mail client stripping the tabs...)
>
> No need to check the ABI beyond endianness.
>
> Also, shouldn=E2=80=99t these both be in .bss?

And one more thing: the convention is to use .S, not .s, for assembly
files, since the former are preprocessed[^1]. I=E2=80=99m surprised this ev= en
builds when given the lower case suffix, as bsd.suffixes.mk passes
-x assembler for the .s.o rule.

Jess

[^1]: Unless you know it doesn=E2=80=99t need preprocessing and never will.= ..

I had this same comment in a review,= but was busy and didn't get to make it.

We *N= EVER* have .s except for weird things we might generate, by convention.
We spent a lot of time fixing this a few months ago.

<= /div>
Warner=C2=A0
--0000000000007d90f7062b5d015b-- From nobody Fri Jan 10 16:59:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV7DS0SZwz5kf6Y for ; Fri, 10 Jan 2025 16:59:36 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV7DR2fMlz44ls for ; Fri, 10 Jan 2025 16:59:35 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso17267005e9.2 for ; Fri, 10 Jan 2025 08:59:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736528374; x=1737133174; 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=KRyl85M9FkfoawdC7yx7Lq1AHvf3pfx/7LI1a3TEM8w=; b=CQhogdiKNvCkSHGM3SrtjC+pbpGu4BV9XbK2o7AwTuIB7HeU55LSDklUKuaZakqNLT aQMPvXj+E6vM1jT+IEBL5IZ4gJYj4dtMVElTembWLNfXhNWvieY6cdRfBeSI5q4UePeU NJgbJ29qojILnE+eQihItyPEnV8xT4gRCsAXfIgNPxXEhJrazHDJ+gTbbHJ/BwfZpSJy egy9tD9Ebc8o+OZsTMNds3AySY0B/J1KgvjUGyTNgGwFADvbjDvUjLUKeBUoaoAwRgpU RdQvElRWeg3T9aklaiKXBkmZiTpetrNds5OqRO6wEx/UflBavY5QZ4880mvnR7HRjK1Y ON/w== X-Forwarded-Encrypted: i=1; AJvYcCW5rcEMWasdPzbivu0paM4ZRWCjKZI5ru5HiQLLlBiBCtzaLvBp7lLx55Wyh20pXUZ9oxN/+mBprqRDZQiWrIvOf0a+JA==@freebsd.org X-Gm-Message-State: AOJu0YwqtrG8214FD4hGYuvMgHqxl8HuMaOqlQ0g+ExWlTpRJrYJpy8V jtW0I1oUobnVrQydnp/C0rO9mCtyBZNgV8WHXLtIYUzgmK9OIRaEjhOfMs6sIDL++gkf8v6bM1M m X-Gm-Gg: ASbGncvdvznSzfpU/HEdhlhFT0MB4s6XVdOlBrJFDZjmo7tIzbBdu3erLUDwU2i400X ZcIKoZR8YdiIUHvX+xfVGJBhAVlvTskvd4Yr2sxvLc9wOvr06puKTlmyEjKziKXc0rJlTltH1nA 19tyut14Wqbto+NIr5uPND9yX+bUte7NR34wL76YFEfO44dBPG01jiMFYH53rPH0AZn8Oveiqqg 2dKW4rvaGz+R/snPyAqTQIqxO0p3nUiTGosy5tZyD1bpXj8MioEou/P1je05wboDGbnWcc= X-Google-Smtp-Source: AGHT+IFK26t0830qlHh9mLyicfpIJ3WWtbzDrhkiMlDm+LyelkihZKXA5Qp2Ry+FJwKkqv6vDZqBVw== X-Received: by 2002:a05:600c:1e0b:b0:431:5044:e388 with SMTP id 5b1f17b1804b1-436e26e4c61mr93628075e9.22.1736528373750; Fri, 10 Jan 2025 08:59:33 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e62133sm57459525e9.33.2025.01.10.08.59.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jan 2025 08:59:32 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl From: Jessica Clarke In-Reply-To: <20250110164742.B31513AF@slippy.cwsent.com> Date: Fri, 10 Jan 2025 16:59:21 +0000 Cc: Mark Johnston , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> <20250110164742.B31513AF@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4YV7DR2fMlz44ls X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 10 Jan 2025, at 16:47, Cy Schubert wrote: >=20 > In message <202501101600.50AG0jk6062308@gitrepo.freebsd.org>, Mark = Johnston=20 > wri > tes: >> The branch main has been updated by markj: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6b82130e6c9add4a8892ca897df5a0ec= >> 04663ea2 >>=20 >> commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 >> Author: Mark Johnston >> AuthorDate: 2025-01-10 15:37:07 +0000 >> Commit: Mark Johnston >> CommitDate: 2025-01-10 15:42:59 +0000 >>=20 >> clock: Add a long ticks variable, ticksl >>=20 >> For compatibility with Linux, it's useful to have a tick counter = of >> width sizeof(long), but our tick counter is an int. Currently the >> linuxkpi tries paper over this difference, but this cannot really = be >> done reliably, so it's desirable to have a wider tick counter. = This >> change introduces ticksl, keeping the existing ticks variable. >>=20 >> Follow a suggestion from kib to avoid having to maintain two = separate >> counters and to avoid converting existing code to use ticksl: = change >> hardclock() to update ticksl instead of ticks, and then use = assembler >> directives to make ticks and ticksl overlap such that loading = ticks >> gives the bottom 32 bits. This makes it possible to use ticksl in = the >> linuxkpi without having to convert any native code, and without = making >> hardclock() more complicated or expensive. Then, the linuxkpi can = be >> modified to use ticksl instead of ticks. >>=20 >> Reviewed by: olce, kib, emaste >> MFC after: 1 month >> Differential Revision: https://reviews.freebsd.org/D48383 >> --- >> sys/conf/files | 1 + >> sys/kern/kern_clock.c | 26 ++++++++++++++------------ >> sys/kern/kern_tc.c | 4 ++-- >> sys/kern/subr_param.c | 2 +- >> sys/kern/subr_ticks.s | 44 = ++++++++++++++++++++++++++++++++++++++++++++ >> sys/sys/kernel.h | 9 +++++++++ >> sys/sys/timetc.h | 2 +- >> 7 files changed, 72 insertions(+), 16 deletions(-) >>=20 >=20 > See last paragraph. >=20 > --- kernel.full --- > linking kernel.full > ld: error: undefined symbol: ticks >>>> referenced by cam_iosched.c:1426 = (/opt/src/git-src/sys/cam/cam_iosched.c > :1426) >>>> cam_iosched.o:(cam_iosched_put_back_trim) >>>> referenced by cam_iosched.c:1452 = (/opt/src/git-src/sys/cam/cam_iosched.c > :1452) >>>> cam_iosched.o:(cam_iosched_next_trim) >>>> referenced by cam_iosched.c:823 = (/opt/src/git-src/sys/cam/cam_iosched.c: > 823) >>>> cam_iosched.o:(cam_iosched_get_trim) >>>> referenced 240 more times >>>> did you mean: tick >>>> defined in: subr_param.o >=20 > ld: error: undefined symbol: ticksl >>>> referenced by subr_param.c:200 = (/opt/src/git-src/sys/kern/subr_param.c:2 > 00) >>>> subr_param.o:(init_param1) >>>> referenced by kern_clock.c:489 = (/opt/src/git-src/sys/kern/kern_clock.c:4 > 89) >>>> kern_clock.o:(hardclock) >>>> referenced by atomic.h:184 = (/opt/src/git-src/sys/amd64/include/atomic.h: > 184) >>>> kern_clock.o:(hardclock) >>>> referenced 1 more times > *** [kernel.full] Error code 1 >=20 > make[2]: stopped making "all" in = /export/obj/opt/src/git-src/amd64.amd64/sys > /BREAK > make[2]: 1 error >=20 > make[2]: stopped making "all" in = /export/obj/opt/src/git-src/amd64.amd64/sys > /BREAK > 652.14 real 4727.77 user 227.08 sys >=20 > make[1]: stopped making "buildkernel" in /opt/src/git-src >=20 > make: stopped making "buildkernel" in /opt/src/git-src >=20 >=20 > This (failing to link) only occurs with an incremental build; a clean=20= > rebuild (of /usr/obj/sys/KERNELNAME) circumvents this error. Should = this be=20 > noted in UPDATING? Are you building with KERNFAST / NO_KERNELCONFIG? If so, yeah, that=E2=80=99= s to be expected any time new files are added that are needed by existing ones. If not, I have no idea how that could possibly happen, this = isn=E2=80=99t the kind of change that depend-cleanup.sh has to care about, and this kind of change happens all the time. Jess From nobody Fri Jan 10 17:13:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV7XV3GL1z5kgGH; Fri, 10 Jan 2025 17:13:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV7XT64RKz466d; Fri, 10 Jan 2025 17:13:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 50AHDMga082024; Fri, 10 Jan 2025 19:13:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 50AHDMga082024 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 50AHDL7U082023; Fri, 10 Jan 2025 19:13:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 10 Jan 2025 19:13:21 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ccabc7c2e556 - main - DEVICE_IDENTIFY.9: Modernize description and use cases Message-ID: References: <202501092020.509KKt1U058876@gitrepo.freebsd.org> <9acd1878-2ee3-47c8-aab9-29d5be200081@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9acd1878-2ee3-47c8-aab9-29d5be200081@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4YV7XT64RKz466d X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Fri, Jan 10, 2025 at 07:45:19AM -0500, John Baldwin wrote: > On 1/9/25 18:01, Konstantin Belousov wrote: > > On Thu, Jan 09, 2025 at 08:20:55PM +0000, John Baldwin wrote: > > > The branch main has been updated by jhb: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ccabc7c2e556ac0b14da9b682b706ccaf251c0fe > > > > > > commit ccabc7c2e556ac0b14da9b682b706ccaf251c0fe > > > Author: John Baldwin > > > AuthorDate: 2025-01-09 20:20:16 +0000 > > > Commit: John Baldwin > > > CommitDate: 2025-01-09 20:20:16 +0000 > > > > > > DEVICE_IDENTIFY.9: Modernize description and use cases > > > Mention adding devices based on firmware tables and software-only > > > pseudo-devices as use cases for identify methods as those are more > > > common than reading random I/O ports to identify a legacy ISA device. > > > Describe how device_find_chid can be used to avoid duplicates. While > > > here, explicitly note that devices added in identify methods typically > > > use a fixed device name. > > > Trim the cross-references a bit. > > > Reviewed by: ziaee, imp > > > Differential Revision: https://reviews.freebsd.org/D48367 > > > --- > > > share/man/man9/DEVICE_IDENTIFY.9 | 52 +++++++++++++++++++--------------------- > > > 1 file changed, 25 insertions(+), 27 deletions(-) > > > > > > diff --git a/share/man/man9/DEVICE_IDENTIFY.9 b/share/man/man9/DEVICE_IDENTIFY.9 > > > index d75c1a91ce4a..b10d94143050 100644 > > > --- a/share/man/man9/DEVICE_IDENTIFY.9 > > > +++ b/share/man/man9/DEVICE_IDENTIFY.9 > > > @@ -26,44 +26,46 @@ > > > .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > > > .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > > .\" > > > -.Dd January 15, 2017 > > > +.Dd January 9, 2025 > > > .Dt DEVICE_IDENTIFY 9 > > > .Os > > > .Sh NAME > > > .Nm DEVICE_IDENTIFY > > > -.Nd identify a device, register it > > > +.Nd identify new child devices and register them > > > .Sh SYNOPSIS > > > .In sys/param.h > > > .In sys/bus.h > > > .Ft void > > > .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" > > So what is the 'parent' for driver which creates devices based on the > > firmware tables? > > Hmmm, I could maybe try to clarify this further. In new-bus, drivers are > associated with a parent bus devclass. All of the drivers associated with > a given parent bus are then eligible for use with children of any bus > devices for that bus. Thus, for example: > > DRIVER_MODULE(foo, bar, ....) > > Associates the "bar" driver with the bus "foo". For any fooX bus devices, > the "bar" driver can attach to children of fooX. It is other way around I suppose, bus "bar" and driver "foo". Thank you for answering, would you consider adding this (adapted) text to the man page? > > Most device_if.m methods operate on "child" devices, so device_probe, > device_attach, device_detach, etc. all operate on a given barX device > that is a child of a fooX. > > device_identify is different. Instead, each fooX bus device can call > bus_identify_children (formerly the somewhat misnamed bus_generic_probe) > during the fooX device_attach routine. bus_identify_children looks for > the devclass of foo and then walks all of the eligible device drivers > for potential children of foo invoking this method with fooX as the > parent. The idea being that device_identify will create "barX" children > of "fooX" explicitly using BUS_ADD_CHILD. > > In terms of which parent device, it's really about where a given "barX" > device should live. For system-wide "top-level" devices that aren't > behind some other bridge on an ACPI system, the pattern we use is to > hang those devices as children of acpi0, so you end up with > > DRIVER_MODULE(acpi, bar, ...) > > and the parent device at the time of DEVICE_IDENTIFY is acpi0. However, > we also use identify in some other places. nexus0 children all tend to > either be explicitly added in nexus_attach() or added via identify > routines that use nexus as the parent. legacy0 on x86 also uses identify > routines to add child devices like pcibX. > > Another case is the ipmi(4) device. Legacy ISA IPMI devices are described > by an entry in the SMBIOS table. The ipmi(4) driver uses an identify > routine to add an ipmi0 device as a child of isa0 (since it has I/O ports > like a typical ISA device), but the identify routine is table-driven since > it depends on parsing the smbios table. > > cpufreqX is another odd case, and I'm not quite convinced it is correct. > Today we enumerate cpuX devices hung off of some nexus-like device (on > x86 cpuX are children of either acpi0 or legacy0). Each cpufreqX > driver then uses identify routines to add named children (p4tccX, estX, > hwpstateX, etc.). Those identify routines all have "cpu" as the parent > bus so that cpuX is the parent device (and they are called for each > instance of a cpuX device). For cpufreq I feel like we actually want > something a bit different on x86 at least. I think we want to create > an explicit cpufreqX device in cpu_attach, and that the various cpufreq > drivers that manage frequency should all be "cpufreq" drivers that bid > to attach to that device node instead of creating duplicate nodes that > try to duplicate work. Today the various identify routines try to > check for each other instead which is fragile. It may be that we'd > need/want two device_t nodes, one for P-states and one for throttling, > though it might be that we only want the throttling for certain P-state > drivers or some such. > > For your IOMMU case, you can use an ACPI table "anywhere" in the device > tree to enumerate device nodes if necessary (though PCI buses don't > currently call bus_identify_children today and don't have a BUS_ADD_CHILD > method), but if you want to be "ready" before other generic children like > PCI bridges are attached, you probably need to be a child of acpi0. For DMAR the current situation with being the child of acpi0 is fine, apparently. But for AMD IOMMU, there is a serious problem there, at least from my current PoV. Issue is, AMD IOMMUs are exposed as the normal PCI functions just having a funny PCIe capability, that points to the MMIO register window (not BAR). And the issue is that IOMMUs are enumerated too late to properly intercept interesting events during other devices' attach. I did set the early pass for the iommu driver EARLY_DRIVER_MODULE(amdiommu, pci, amdiommu_driver, 0, 0, BUS_PASS_SUPPORTDEV); but as I understand, it only regulates the identity pass over the same bus. What the driver needs is being able to create devices before any other devices (like HPET or IOAPICs) which could request interrupts, are enumerated and attached. From nobody Fri Jan 10 17:31:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV7wy714Qz5kCbM; Fri, 10 Jan 2025 17:31:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.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 4YV7wy5rp5z47cM; Fri, 10 Jan 2025 17:31:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id WEhetTCJ7yLQGWIqntIblK; Fri, 10 Jan 2025 17:31:13 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id WIqmt0bWwJhBPWIqntHjvL; Fri, 10 Jan 2025 17:31:13 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=67815961 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=VdSt8ZQiCzkA:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=XiTKz44GfQCsQ7xtRX4A:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9D3B1112; Fri, 10 Jan 2025 09:31:11 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 92776A3; Fri, 10 Jan 2025 09:31:11 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Jessica Clarke cc: Cy Schubert , Mark Johnston , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl In-reply-to: References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> <20250110164742.B31513AF@slippy.cwsent.com> Comments: In-reply-to Jessica Clarke message dated "Fri, 10 Jan 2025 16:59:21 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 10 Jan 2025 09:31:11 -0800 Message-Id: <20250110173111.92776A3@slippy.cwsent.com> X-CMAE-Envelope: MS4xfJad+vKerONU34DRYZMSuS9p6jvqWerc35r9lTqueG/fvWQAqxuyYHIqGOpXcNx1zaAVfpwhOCL4T/SltpRhUCimQQ6Y3OEdqFBkFSKZ5SrqZzixEX0t LFmAAQM2ZvIyp+Sbg9tQiH7tK4KikTlrzo9aCiHT4+tG2jzmWTzHk8n4Kkv7MluhIuJZEgf+wmofvDqs00gHSVnggT9ObDH0fmiTOYLJP9VAD7Hhh0fE/YtB sbOL2gQTLh8LoptEHeSDb4kvwapKN9No5bczuPeJIoPYMlApsFKkE9w2XB6sHtfjBCIOMBd0ROU6lNaTf54cqI6jKKHcqyZzSo81uT7XY1/LeV6M4/Adgwsa qCPefc1+ X-Rspamd-Queue-Id: 4YV7wy5rp5z47cM X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message , Jessica Clarke w rites: > On 10 Jan 2025, at 16:47, Cy Schubert wrote: > >=20 > > In message <202501101600.50AG0jk6062308@gitrepo.freebsd.org>, Mark = > Johnston=20 > > wri > > tes: > >> The branch main has been updated by markj: > >>=20 > >> URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D6b82130e6c9add4a8892ca897df5a0ec= > > >> 04663ea2 > >>=20 > >> commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > >> Author: Mark Johnston > >> AuthorDate: 2025-01-10 15:37:07 +0000 > >> Commit: Mark Johnston > >> CommitDate: 2025-01-10 15:42:59 +0000 > >>=20 > >> clock: Add a long ticks variable, ticksl > >>=20 > >> For compatibility with Linux, it's useful to have a tick counter = > of > >> width sizeof(long), but our tick counter is an int. Currently the > >> linuxkpi tries paper over this difference, but this cannot really = > be > >> done reliably, so it's desirable to have a wider tick counter. = > This > >> change introduces ticksl, keeping the existing ticks variable. > >>=20 > >> Follow a suggestion from kib to avoid having to maintain two = > separate > >> counters and to avoid converting existing code to use ticksl: = > change > >> hardclock() to update ticksl instead of ticks, and then use = > assembler > >> directives to make ticks and ticksl overlap such that loading = > ticks > >> gives the bottom 32 bits. This makes it possible to use ticksl in = > the > >> linuxkpi without having to convert any native code, and without = > making > >> hardclock() more complicated or expensive. Then, the linuxkpi can = > be > >> modified to use ticksl instead of ticks. > >>=20 > >> Reviewed by: olce, kib, emaste > >> MFC after: 1 month > >> Differential Revision: https://reviews.freebsd.org/D48383 > >> --- > >> sys/conf/files | 1 + > >> sys/kern/kern_clock.c | 26 ++++++++++++++------------ > >> sys/kern/kern_tc.c | 4 ++-- > >> sys/kern/subr_param.c | 2 +- > >> sys/kern/subr_ticks.s | 44 = > ++++++++++++++++++++++++++++++++++++++++++++ > >> sys/sys/kernel.h | 9 +++++++++ > >> sys/sys/timetc.h | 2 +- > >> 7 files changed, 72 insertions(+), 16 deletions(-) > >>=20 > >=20 > > See last paragraph. > >=20 > > --- kernel.full --- > > linking kernel.full > > ld: error: undefined symbol: ticks > >>>> referenced by cam_iosched.c:1426 = > (/opt/src/git-src/sys/cam/cam_iosched.c > > :1426) > >>>> cam_iosched.o:(cam_iosched_put_back_trim) > >>>> referenced by cam_iosched.c:1452 = > (/opt/src/git-src/sys/cam/cam_iosched.c > > :1452) > >>>> cam_iosched.o:(cam_iosched_next_trim) > >>>> referenced by cam_iosched.c:823 = > (/opt/src/git-src/sys/cam/cam_iosched.c: > > 823) > >>>> cam_iosched.o:(cam_iosched_get_trim) > >>>> referenced 240 more times > >>>> did you mean: tick > >>>> defined in: subr_param.o > >=20 > > ld: error: undefined symbol: ticksl > >>>> referenced by subr_param.c:200 = > (/opt/src/git-src/sys/kern/subr_param.c:2 > > 00) > >>>> subr_param.o:(init_param1) > >>>> referenced by kern_clock.c:489 = > (/opt/src/git-src/sys/kern/kern_clock.c:4 > > 89) > >>>> kern_clock.o:(hardclock) > >>>> referenced by atomic.h:184 = > (/opt/src/git-src/sys/amd64/include/atomic.h: > > 184) > >>>> kern_clock.o:(hardclock) > >>>> referenced 1 more times > > *** [kernel.full] Error code 1 > >=20 > > make[2]: stopped making "all" in = > /export/obj/opt/src/git-src/amd64.amd64/sys > > /BREAK > > make[2]: 1 error > >=20 > > make[2]: stopped making "all" in = > /export/obj/opt/src/git-src/amd64.amd64/sys > > /BREAK > > 652.14 real 4727.77 user 227.08 sys > >=20 > > make[1]: stopped making "buildkernel" in /opt/src/git-src > >=20 > > make: stopped making "buildkernel" in /opt/src/git-src > >=20 > >=20 > > This (failing to link) only occurs with an incremental build; a clean=20= > > > rebuild (of /usr/obj/sys/KERNELNAME) circumvents this error. Should = > this be=20 > > noted in UPDATING? > > Are you building with KERNFAST / NO_KERNELCONFIG? If so, yeah, that=E2=80=99= > s > to be expected any time new files are added that are needed by existing > ones. If not, I have no idea how that could possibly happen, this = > isn=E2=80=99t > the kind of change that depend-cleanup.sh has to care about, and this > kind of change happens all the time. Yeah, you're right. I didn't notice the new file. My bad. > > Jess -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Fri Jan 10 17:59:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YV8Ys4mlBz5kFpF; Fri, 10 Jan 2025 17:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV8Ys4DM3z4Cbw; Fri, 10 Jan 2025 17:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736531985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EDMsC6tNAUoBThvsEXKV2ajGrnsdlFuBb0nTgks5JZM=; b=s/ewZwZzzbkBUXWFIB1AL1kBNM0ImZ7wVjB+EFvspQ/gh3WtWFQ64MxfmL1GMyjdJoIm2q JtHhm6B34NZubiyErB+w0jjU7mVjTXneSD50qjzlHZ2bfp+wJMbRc7Gf0Z6v9k+qcGNPk5 oIVjSz8Hg8jzx5q+j/Q8symRvE2E5qMncdFq3v/6jRgS5I8OmTY+RICOHQLHBSSV87onV8 7jtzhwOFXMkkxLindK+sJSRwlMiSVeYGAq2IOp07HMO7blCHsvqBlPuNCY2GfUDL9NC9oL yZ5wMKbB4YdvShRL9Db8vQpN8S4IKAQ3xPce67G+C8zCsW3DOgqwxjfqkPX0ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736531985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EDMsC6tNAUoBThvsEXKV2ajGrnsdlFuBb0nTgks5JZM=; b=oes2fqpKhJoaCLnaGSlmLmV+pTK57/9KUrqplhq90WyZReiFxmR+OtK793IyfKq3nnz/bT 8GZmjBelT7L7WU7KRb41McUKkESJV5GPY4Mm6f0SZJxFwSvYYXFPWyV5m12jGVdRftB2+p PbkdYn5Z5pZdymLcMVxguMZayid0nIREFcWH7p7a1E4p0wuu+HR+eMDFLULZ9evTiqrXqo 7H8LENJm0yPYV9TdnGG7Zy4NU/UgEVD/61Z3OUm/YAVjs2DeeSi3VbrUa2D/Flx5rn88zX H06KSAVUbFR6vBU16kGp7b26DQi12B844Hbe/INimylgyZXuKm0twBi+oartaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736531985; a=rsa-sha256; cv=none; b=riXcqXSSKq8knzUC5JoUsjdVV/bkbV4BwUfb34puDosHA/KTqUvGob13C1h8PjjLNPQQ5k d+K+4Biv1S+Ua52dVKsIi5PyEZxAYyR8Oestg8vx6oDDhtBHpeb1i0G7k1izbsUiUvv/Fp g9RZDy5KS8E8ojqK60sdi10Hm1yBKWxMrnjp8j47s7x0cGf/6WUNNhdcJVC6yjW7QZcpMJ /7jaBTn82wmmrM8aaIYw22vO+DMl464U/CtxaiAG0Hunk6ATwNWiyQGzuRPnpTJQWhv+6S /MjKZD6x6wc56i8p6gXzD5eVf05XyGyHq7h0MeeQf6y4p9/N70Zydeml3+Uy5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YV8Ys3R22z6Xx; Fri, 10 Jan 2025 17:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AHxjHI075804; Fri, 10 Jan 2025 17:59:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AHxjnb075801; Fri, 10 Jan 2025 17:59:45 GMT (envelope-from git) Date: Fri, 10 Jan 2025 17:59:45 GMT Message-Id: <202501101759.50AHxjnb075801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 9eb30ef4b7a0 - main - riscv: enable Allwinner D1 USB drivers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9eb30ef4b7a0ca1ef7bcc871b6391d98b00c259f Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9eb30ef4b7a0ca1ef7bcc871b6391d98b00c259f commit 9eb30ef4b7a0ca1ef7bcc871b6391d98b00c259f Author: Mitchell Horne AuthorDate: 2025-01-10 17:57:36 +0000 Commit: Mitchell Horne CommitDate: 2025-01-10 17:57:36 +0000 riscv: enable Allwinner D1 USB drivers Add the generic USB drivers and FDT glue to the build. Make small tweaks to the aw_usbphy and aw_musb drivers for the Allwinner D1. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48126 --- sys/arm/allwinner/aw_usbphy.c | 9 +++++++++ sys/conf/files.riscv | 6 ++++++ sys/dev/usb/controller/musb_otg_allwinner.c | 5 +++-- sys/riscv/allwinner/files.allwinner | 3 +++ sys/riscv/conf/std.allwinner | 3 +++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/sys/arm/allwinner/aw_usbphy.c b/sys/arm/allwinner/aw_usbphy.c index b0ef7d9da0a9..97c3d2207773 100644 --- a/sys/arm/allwinner/aw_usbphy.c +++ b/sys/arm/allwinner/aw_usbphy.c @@ -56,6 +56,7 @@ enum awusbphy_type { AWUSBPHY_TYPE_A64, AWUSBPHY_TYPE_A83T, AWUSBPHY_TYPE_H6, + AWUSBPHY_TYPE_D1, }; struct aw_usbphy_conf { @@ -121,6 +122,13 @@ static const struct aw_usbphy_conf h6_usbphy_conf = { .phy0_route = true, }; +static const struct aw_usbphy_conf d1_usbphy_conf = { + .num_phys = 2, + .phy_type = AWUSBPHY_TYPE_D1, + .pmu_unk1 = true, + .phy0_route = true, +}; + static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-usb-phy", (uintptr_t)&a10_usbphy_conf }, { "allwinner,sun5i-a13-usb-phy", (uintptr_t)&a13_usbphy_conf }, @@ -130,6 +138,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun50i-a64-usb-phy", (uintptr_t)&a64_usbphy_conf }, { "allwinner,sun8i-a83t-usb-phy", (uintptr_t)&a83t_usbphy_conf }, { "allwinner,sun50i-h6-usb-phy", (uintptr_t)&h6_usbphy_conf }, + { "allwinner,sun20i-d1-usb-phy", (uintptr_t)&d1_usbphy_conf }, { NULL, 0 } }; diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 534fe5013c56..514c955181c3 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -12,6 +12,12 @@ dev/pci/pci_host_generic.c optional pci dev/pci/pci_host_generic_fdt.c optional pci fdt dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_lowrisc.c optional uart_lowrisc +dev/usb/controller/generic_ehci.c optional ehci +dev/usb/controller/generic_ehci_fdt.c optional ehci fdt +dev/usb/controller/generic_ohci.c optional ohci fdt +dev/usb/controller/generic_usb_if.m optional ohci fdt +dev/usb/controller/generic_xhci.c optional xhci +dev/usb/controller/generic_xhci_fdt.c optional xhci fdt dev/vmm/vmm_dev.c optional vmm dev/vmm/vmm_stat.c optional vmm dev/xilinx/axi_quad_spi.c optional xilinx_spi diff --git a/sys/dev/usb/controller/musb_otg_allwinner.c b/sys/dev/usb/controller/musb_otg_allwinner.c index 574e8e712713..781b4d7e33fa 100644 --- a/sys/dev/usb/controller/musb_otg_allwinner.c +++ b/sys/dev/usb/controller/musb_otg_allwinner.c @@ -77,7 +77,7 @@ #if defined(__arm__) #define bs_parent_space(bs) ((bs)->bs_parent) typedef bus_space_tag_t awusb_bs_tag; -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(__riscv) #define bs_parent_space(bs) (bs) typedef void * awusb_bs_tag; #endif @@ -89,6 +89,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun6i-a31-musb", AWUSB_OKAY }, { "allwinner,sun8i-a33-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, { "allwinner,sun8i-h3-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, + { "allwinner,sun20i-d1-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, { NULL, 0 } }; @@ -474,7 +475,7 @@ awusbdrd_attach(device_t dev) #if defined(__arm__) sc->bs.bs_parent = rman_get_bustag(sc->res[0]); -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(__riscv) sc->bs.bs_cookie = rman_get_bustag(sc->res[0]); #endif diff --git a/sys/riscv/allwinner/files.allwinner b/sys/riscv/allwinner/files.allwinner index f55d883abf57..a87d79dfda2a 100644 --- a/sys/riscv/allwinner/files.allwinner +++ b/sys/riscv/allwinner/files.allwinner @@ -3,6 +3,7 @@ arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_syscon.c optional syscon arm/allwinner/aw_sid.c optional aw_sid nvmem +arm/allwinner/aw_usbphy.c optional ehci aw_usbphy fdt arm/allwinner/aw_wdog.c optional aw_wdog arm/allwinner/if_awg.c optional awg syscon @@ -18,4 +19,6 @@ dev/clk/allwinner/aw_clk_np.c optional aw_ccu fdt dev/clk/allwinner/aw_clk_prediv_mux.c optional aw_ccu fdt dev/clk/allwinner/ccu_d1.c optional soc_allwinner_d1 aw_ccu fdt +dev/usb/controller/musb_otg_allwinner.c optional musb fdt + riscv/allwinner/d1_padconf.c optional soc_allwinner_d1 aw_gpio fdt diff --git a/sys/riscv/conf/std.allwinner b/sys/riscv/conf/std.allwinner index a888e4d5d370..5e7a6c0e0a52 100644 --- a/sys/riscv/conf/std.allwinner +++ b/sys/riscv/conf/std.allwinner @@ -9,7 +9,10 @@ device aw_ccu # Allwinner clock controller device aw_gpio # Allwinner GPIO controller device aw_rtc # Allwinner Real-time Clock device aw_sid # Allwinner Secure ID EFUSE +device aw_usbphy # Allwinner USB PHY device aw_wdog # Allwinner Watchdog device awg # Allwinner EMAC Gigabit Ethernet +device musb # Mentor Graphics USB OTG controller + files "../allwinner/files.allwinner" From nobody Fri Jan 10 19:18:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVBJk2Snpz5kNWF; Fri, 10 Jan 2025 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVBJk0FJNz4Mx6; Fri, 10 Jan 2025 19: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=1736536710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33YuJnW9yXsjMNmMGE4NjgJVe3v2IiZAq+iCMs0C82w=; b=YvyeGP8Va2OHoO6a4lt8dSwfxYHuzTwnM1Wp3a4SNK9UOY2PJ2fKaqWqZiVO8tXgPpl2Kj a4h3257p71XYmN/POjeQN03tOJzmjgCEZ3IZGeLtKM1BVqqyx4ShRznlxmU3Yxc/lsFljr 0PebGFRtwzW3RpDm/4PSnbGE+xm308d2tQABa9gaLiK2HhTniOElFsydGTYqFo8Qv+3ATb SZAlh7d6rj8ae7P4InLsWa4s24562ZKi7xee3JA7usUwokFYzsq6xjcOTtXJwWlC+Yvm4U IUOP0j70MA05CrRHmu2LBkcL5NQ/ogknMPImT6FawmWL9mCOPxOfeVAFXXnmkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33YuJnW9yXsjMNmMGE4NjgJVe3v2IiZAq+iCMs0C82w=; b=sJMJr/4CvndcSm8yxgfCAGlGJ8vKaCS594RNe1qolZDfHwhKp0cq965HufEZJDwo4Aa1Vw FGRQgrPa34OnizggirS+rhjp8/kUN/H9W1C2q6nQCQ+kGzGCzXVcwUNM9Br7qFPP1G9uWF 0/oVi32KyVk+lbq2aV1rR0vQkcep3MnL8HWcKwACowzcf1sHbQF5hj16tmfgZixrk0IS7d x1vtDsCPEtwoR+VQecYe0lMpklUSDYp3RctFcg+U0XDJ6uZSoEbiEQXoLYt4LF1pyUWOT4 shUDbK1IKeSV4/1Vefo2631oTKbs7TBZBJlkHClDf+RonDiXlGndfgGP6GER+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736536710; a=rsa-sha256; cv=none; b=d6SIp4c8UCG2rT0pyB16M2k9bH+zilMBHkmOuCtwXhbbFBirDSls/GCRYmaKwPV6thU+Jf yeIfqHmxStsxBacYzgW1IhTozlYbysXlyxx7G9oh6NaRO/zZAh2tUJoTwteeousqpG/0oZ dieGUNONOp7dOMHg0SGBCtZsfvv1Yp7NVn653bmhx13BCfCOZVmEJEuJMMDvcSTPukVkaW Qh5NckDyreoGUwXovnYxcmmj8VlvBo+dfMbQjuIBdLmLhA009DdpF6xXRjGHS1qTPmwMvz PIYNET/V/xcpx8v8d3OlioBPT5tKEP/YWZwGBCwiszQHNpVRoko55sRn7O42UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVBJj6fMYz9BS; Fri, 10 Jan 2025 19:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AJITOs026432; Fri, 10 Jan 2025 19:18:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AJITJK026429; Fri, 10 Jan 2025 19:18:29 GMT (envelope-from git) Date: Fri, 10 Jan 2025 19:18:29 GMT Message-Id: <202501101918.50AJITJK026429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: aa766e2a03f0 - main - ofw_cpu: fix __riscv preprocessor check List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa766e2a03f0eb2fb6272828865c83a807b81cf1 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=aa766e2a03f0eb2fb6272828865c83a807b81cf1 commit aa766e2a03f0eb2fb6272828865c83a807b81cf1 Author: Mitchell Horne AuthorDate: 2025-01-10 18:46:01 +0000 Commit: Mitchell Horne CommitDate: 2025-01-10 18:46:01 +0000 ofw_cpu: fix __riscv preprocessor check The canonical name is __riscv, not __riscv__. Newer compilers no longer emit the latter. This re-enables finding the nominal frequency from the CPU's clock. I checked, and there are no remaining mistakes like this in the tree. Reviewed by: jrtc27, imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48122 --- sys/dev/ofw/ofw_cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index ad0fd670421a..cbca8caee186 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -42,7 +42,7 @@ #include #include -#if defined(__arm__) || defined(__arm64__) || defined(__riscv__) +#if defined(__arm__) || defined(__arm64__) || defined(__riscv) #include #endif @@ -206,7 +206,7 @@ ofw_cpu_attach(device_t dev) phandle_t node; pcell_t cell; int rv; -#if defined(__arm__) || defined(__arm64__) || defined(__riscv__) +#if defined(__arm__) || defined(__arm64__) || defined(__riscv) clk_t cpuclk; uint64_t freq; #endif @@ -276,7 +276,7 @@ ofw_cpu_attach(device_t dev) sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev)); if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) { -#if defined(__arm__) || defined(__arm64__) || defined(__riscv__) +#if defined(__arm__) || defined(__arm64__) || defined(__riscv) rv = clk_get_by_ofw_index(dev, 0, 0, &cpuclk); if (rv == 0) { rv = clk_get_freq(cpuclk, &freq); From nobody Fri Jan 10 19:18:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVBJl2LXzz5kNsj; Fri, 10 Jan 2025 19:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVBJl00mkz4Mpy; Fri, 10 Jan 2025 19:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kEUXlwABnOGUVwn/5gUu9AsHtLZ69QPHrvHbF50AkxQ=; b=YDzju5eaBr9GX56ZgAEtb6perql/ImCP8jF+/xHOOIN3P9ZO1vPkF/nU5ql3PpQfhbAEDg Cf0+gCiBlIaiEnsKcqxsGifjMmdIEgFpexNlY6ym7LVJV89TtH74OFWtu+CCvi+Sahg5jN /ln4v6HaOghU3Igy9+6ZeWOTSvDqxGZ/6MP5m2Diox0HTRwSCpzAt27QXmKfPLJqndags9 vmByOpxRQWk/Oto+ddtbj/Ws7mBYMN0CWH0tYksKplzHV619L+jlBDP6WaCn8UrI1HqU0b TgAPOGW2p3Q8en5llp9/zeIiv86on7arF9rhRotmw4Hj8kjHq32NuUEgsQAFww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kEUXlwABnOGUVwn/5gUu9AsHtLZ69QPHrvHbF50AkxQ=; b=ajEwwYBE9ujwspjmO2DZPQ7Tpji+L997UHWO5KZ63Au02ioxGHM26ScVQVOdd+c1dtQFc+ 25LR0iOH3pdPZOd7b5QBaKVrZFufu1WCEmHR3cj/64GjalIf7PtgxMIF8hcJdUSKKQIEeA bcK+k0kLcJZ7/uOtZx9cIKAoq/lqJjum3Y0aDGP4ksVtUFqKOGNxGmmeTH3YxES9gMDR1c DAm7IRORJSzEmKXz+KOa8p9FIOzbROj5ddpVb1aEW+xTWFyYzc9mytlptIK45vDC+/ZzIo Z+wYAGqG695YKle19I4rMEiCrhj/Fy7KGfThx8EwbrlFT6jgOEKcyerVJOct/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736536711; a=rsa-sha256; cv=none; b=FoD+oMvS72MvfgLzF7jKGSMPmNJ1qZ/1RB5xf2hevJdoC4aKbjWgEDfX+h4ZJwtTwKrwBa mwdMRrKPHsKeyFfemoWGGOwRPZYBBR6DzrVkPpaJ8a4cLMKZaw21L2SEf8iliJxfdFZzAt jjUrzH4KG8pFgNhzIsp4lYHvgcJU5lmMUUvWfuuFqfGjQ7s03SBFhIPQlDBZwTVN9EAB5/ +TE3j1lH85MUzcmK4GeR/mw+0m7+3qA99RUXyhVEwsgHaHpPHEkNl6hggbYBSUdA/n4Cq6 m9Pb4zPQ9RjLhKY/4BirdjrbfBkgNVYkQSo64/m+p56AiVarmzECW+sG8hlTbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVBJk6TMDz8mx; Fri, 10 Jan 2025 19:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AJIUi0026475; Fri, 10 Jan 2025 19:18:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AJIU6Y026472; Fri, 10 Jan 2025 19:18:30 GMT (envelope-from git) Date: Fri, 10 Jan 2025 19:18:30 GMT Message-Id: <202501101918.50AJIU6Y026472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 4ea0c3f04f42 - main - ofw_cpu: collapse some #ifdef code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ea0c3f04f42119dff92317c0e4cef52350ed9db Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea0c3f04f42119dff92317c0e4cef52350ed9db commit 4ea0c3f04f42119dff92317c0e4cef52350ed9db Author: Mitchell Horne AuthorDate: 2025-01-10 18:46:43 +0000 Commit: Mitchell Horne CommitDate: 2025-01-10 18:55:03 +0000 ofw_cpu: collapse some #ifdef code Mainly, to avoid repeating the list of architectures, #define HAS_CLK. Further, split the clk code into a helper function, which is a stub in the !HAS_CLK case. This aids in overall legibility. While here, add one separating whitespace, again for legibility. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48149 --- sys/dev/ofw/ofw_cpu.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index cbca8caee186..339716a946ff 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -44,6 +44,7 @@ #if defined(__arm__) || defined(__arm64__) || defined(__riscv) #include +#define HAS_CLK #endif static int ofw_cpulist_probe(device_t); @@ -198,6 +199,30 @@ ofw_cpu_probe(device_t dev) return (0); } +static int +get_freq_from_clk(device_t dev, struct ofw_cpu_softc *sc) +{ +#ifdef HAS_CLK + clk_t cpuclk; + uint64_t freq; + int rv; + + rv = clk_get_by_ofw_index(dev, 0, 0, &cpuclk); + if (rv == 0) { + rv = clk_get_freq(cpuclk, &freq); + if (rv != 0 && bootverbose) + device_printf(dev, + "Cannot get freq of property clocks\n"); + else + sc->sc_nominal_mhz = freq / 1000000; + } + + return (rv); +#else + return (ENODEV); +#endif +} + static int ofw_cpu_attach(device_t dev) { @@ -206,10 +231,6 @@ ofw_cpu_attach(device_t dev) phandle_t node; pcell_t cell; int rv; -#if defined(__arm__) || defined(__arm64__) || defined(__riscv) - clk_t cpuclk; - uint64_t freq; -#endif sc = device_get_softc(dev); psc = device_get_softc(device_get_parent(dev)); @@ -276,18 +297,7 @@ ofw_cpu_attach(device_t dev) sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev)); if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) { -#if defined(__arm__) || defined(__arm64__) || defined(__riscv) - rv = clk_get_by_ofw_index(dev, 0, 0, &cpuclk); - if (rv == 0) { - rv = clk_get_freq(cpuclk, &freq); - if (rv != 0 && bootverbose) - device_printf(dev, - "Cannot get freq of property clocks\n"); - else - sc->sc_nominal_mhz = freq / 1000000; - } else -#endif - { + if (get_freq_from_clk(dev, sc) != 0) { if (bootverbose) device_printf(dev, "missing 'clock-frequency' property\n"); @@ -298,6 +308,7 @@ ofw_cpu_attach(device_t dev) if (sc->sc_nominal_mhz != 0 && bootverbose) device_printf(dev, "Nominal frequency %dMhz\n", sc->sc_nominal_mhz); + bus_identify_children(dev); bus_attach_children(dev); return (0); From nobody Fri Jan 10 19:18:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVBJm2HfZz5kNsl; Fri, 10 Jan 2025 19:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVBJm1KBDz4Mgw; Fri, 10 Jan 2025 19:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kUht3pIm0N6irH6IapjcSfonGFnl5V1dgNcsG1GrXDE=; b=JXBomqYsJb5yY8ErFZaEBHe6CGLdiy0S4k+AcNSNOJJLvMuoxvHVcptEwmzPYHysWvCpIM dkkmDyhQlLIuc3+vLg+Ikr0eHEdXB+kFuxm1z0i7WVtegJ/m5L10C4X1KYX8Q4uP5LxZUZ eBpQ6IljSFrdGjiaFTWz7iARK7K00A+9hC5vEBrlR875tciUSHB3nKZlNps8U+3CLzKFx6 +HzwPo/uhor/wDe8ZPOAAOiVXogsUSsPPQE4Nwz/ngZxOLFmRxb6GTBAFPiLYtkVZnd1hU /ImuoPAbn4k87ngJvIImQtVnJUb0UxiyeCI1XU6xTtdHb1AO/sz67tPU+HtRkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kUht3pIm0N6irH6IapjcSfonGFnl5V1dgNcsG1GrXDE=; b=obM8OCJOxJ1j8VPWBClVfE2WWeCgROQENuIgV51gxM1p70y/QMxUJFsn9BbfNFpfF8Nj1h 5+rtXE9L+U3wGEYu3BiTlUJgQ5URRZzMgw4Pv011M+odHdEGrrBM/qoQ9j6uBIFC2MDhj+ qr1JFavTXPRgpcSNvZadzAaVO8ecQ8pkC4qsdxPqdI+VYG7qzdE4S0iYQ0Tcm2/G6NnmXH pbCaT/3IrI+ILRIBWnFO8cua9jVcLtCTGoHRbxiCxpPCcmCuxIhF13TfHagVkynUbFn7LA h0OYIj4zWjRNmK3hARSHNQ3+jbxhbj3k65iJaJyXF0JbtWYWK1rSbZCELKPYVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736536712; a=rsa-sha256; cv=none; b=FAsG/1Av82ET4iV6tyFS6kcDS+6xMr3iWBpGmKfiR8h4ls3Q9JdYEhlcZWaW6/TDle7OFn aV2ETZKN5QOc431KK6ObWxNSy63Nfq33MbdEa98wFf+0SfoF1re5IlLoubXNz4BCfe2aDG JZmlBtYtFIzInkTuDV3f3xEABPdkk6QdSkQdESHjFysLKMkuWKZPyQbAhN3P+CVB8xqywZ vrZ5kgrMkgp+290FVUL/Bvb+P0YGpW4hpTMWAUBIIP3vCyFYQdCkbuUsa0Ef0C1mnZqLhP A8G5dmyI2otkmbvzMx+8MH37h0k/IGLrp7bt4NvFrr9l7hKO66tWmncLPhe69g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVBJm0fscz90F; Fri, 10 Jan 2025 19:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AJIVb0026528; Fri, 10 Jan 2025 19:18:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AJIVqL026525; Fri, 10 Jan 2025 19:18:31 GMT (envelope-from git) Date: Fri, 10 Jan 2025 19:18:31 GMT Message-Id: <202501101918.50AJIVqL026525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ac9de183f370 - main - ofw_cpu: check for "disabled" status during probe List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac9de183f37006fc2089757779d6d5065a530d5b Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ac9de183f37006fc2089757779d6d5065a530d5b commit ac9de183f37006fc2089757779d6d5065a530d5b Author: Mitchell Horne AuthorDate: 2025-01-10 18:46:56 +0000 Commit: Mitchell Horne CommitDate: 2025-01-10 18:59:08 +0000 ofw_cpu: check for "disabled" status during probe Some RISC-V CPUs contain a "monitor core" with limited functionality (no MMU). These cores appear in some device trees, but we don't run the kernel on them; in early CPU start-up code we skip them, and they have no impact on mp_ncpu. It seems the new trend is to mark these monitor cores with a 'status' property of 'disabled'. However, we still instantiate an ofw_cpu pseudo device for the disabled core. This is generally harmless, but there is an impact when attempting to attach the cpufreq_dt driver. It counts more OFW CPU devices (unit number) than logical CPUs (mp_ncpus), and therefore fails to attach for the last logical CPU. The solution is to check the status property in ofw_cpu_probe(), and fail if the core is marked "disabled". This is subject to the same exception already in ofw_cpu_early_foreach(); that is, if a disabled CPU has an 'enable-method' property, it can be used by the kernel. Reviewed by: andrew, jrtc27 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48123 --- sys/dev/ofw/ofw_cpu.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index 339716a946ff..888af0440746 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -182,6 +182,24 @@ static driver_t ofw_cpu_driver = { DRIVER_MODULE(ofw_cpu, cpulist, ofw_cpu_driver, 0, 0); +static bool +ofw_cpu_is_runnable(phandle_t node) +{ + /* + * Per the DeviceTree Specification, a cpu node (under /cpus) that + * has 'status = disabled' indicates that "the CPU is in a quiescent + * state." + * + * A quiescent CPU that specifies an "enable-method", such as + * "spin-table", can still be used by the kernel. + * + * Lacking this, any CPU marked "disabled" or other non-okay status + * should be excluded from the kernel's view. + */ + return (ofw_bus_node_status_okay(node) || + OF_hasprop(node, "enable-method")); +} + static int ofw_cpu_probe(device_t dev) { @@ -190,6 +208,9 @@ ofw_cpu_probe(device_t dev) if (type == NULL || strcmp(type, "cpu") != 0) return (ENXIO); + if (!ofw_cpu_is_runnable(ofw_bus_get_node(dev))) + return (ENXIO); + device_set_desc(dev, "Open Firmware CPU"); if (!bootverbose && device_get_unit(dev) != 0) { device_quiet(dev); @@ -352,7 +373,6 @@ ofw_cpu_early_foreach(ofw_cpu_foreach_cb callback, bool only_runnable) { phandle_t node, child; pcell_t addr_cells, reg[2]; - char status[16]; char device_type[16]; u_int id, next_id; int count, rv; @@ -389,14 +409,8 @@ ofw_cpu_early_foreach(ofw_cpu_foreach_cb callback, bool only_runnable) * those that have been enabled, or do provide a method * to enable them. */ - if (only_runnable) { - status[0] = '\0'; - OF_getprop(child, "status", status, sizeof(status)); - if (status[0] != '\0' && strcmp(status, "okay") != 0 && - strcmp(status, "ok") != 0 && - !OF_hasprop(child, "enable-method")) - continue; - } + if (only_runnable && !ofw_cpu_is_runnable(child)) + continue; /* * Check we have a register to identify the cpu From nobody Fri Jan 10 19:18:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVBJp0czHz5kNft; Fri, 10 Jan 2025 19:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVBJn2MxTz4Mh1; Fri, 10 Jan 2025 19:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rucQ0uJlwGOe1X5z+FnJOfn/E62jk1aXGt+7PMkYtE4=; b=dyl9/Vxh3HHrRYLb+pDlvxV4FgsSxWiMj1iKXBEcdHpBL+zFstOv9DTLZblLwyDeOCP6Nr wsQ16Rz0U28R8PoJozt5OYFUBgmH4CpikH6H8l66jIXmcXWvNiiG4glRPafOT833xPFSba RoaVh7cKd9u68vp+k2UHr5pVfQOAvbIJgs9H5lEGOkZWIdO0PqCSBiZmoAml86bawTbS3J tWy8MT+sZoCXaOqhtdA6AwIEb5fsI0IWxVYalg5Adka5Yw6hTYgXdd9ElL9GdcV2PbDpRi 9YEcAqNSskceDbGk1d7byMBfHmyRG5BmiW8ceXI0bEWbTWqe0Es86s3jaN1Eiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736536713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rucQ0uJlwGOe1X5z+FnJOfn/E62jk1aXGt+7PMkYtE4=; b=BmZgMuyeqlXmREyeFMlp8K4fuwYfaAH9lR1UvgaSY1v9PZFl85nSYFwq4kva08d1zAtmwq SIJqF6ySvRGbN9PR2iOW3xuVi/dY7C7mIdp1DMl5QTlUV6h+VrCd1nS1PXx6i+vOhayR5k M8wiNZXpV0qUxGXKErGxRrwacuwFVvewDx6ZC6ESExuk1s3nX7XeaSxPVHymZ80f2DtwgG P/5z+POqiU9o5q4CHL2A79H2iFfLG2lnR8Sl3uyHSG7l3yMhajpZGIqZkK9YDdWTnkz4dg TtozDAv5ym1EoeKZGZQcr5eHuH+9Z0T9UuqR+TSDRHdpOGtLz7GdWLzX+8UO5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736536713; a=rsa-sha256; cv=none; b=EgIV+ax9XDpfyuLVEC6TXzGzhh074RepH22OC8R9Xo9TeZW3CQGkOGqfxwYyrukFTKtGyO JHLJjEbOMGnlz8ZlprRS+ecye4hkf/uB3GDG541bp8/QIyfE6HJEYWFnaN8MAo6XOnBHvH AOe1klQqCQv2Jg58e0+9cOJj9QoRAIjiUHY3l2pBaGtWX3x6DZ+h1P7Hp7HMoY7WWHyKWV zTGiv7nEVr552NdIuZ8R+w59JIffw7q7dT6kCJvA4MDsSKLxl88puf60GfhCP+akNx8i/G NT4N5bg2KbVbpmejrfYAFsQZhJmdspoUJRwtZIO79EIRbE8L/21u6wpe7iOPlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVBJn1fKVz8qT; Fri, 10 Jan 2025 19:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AJIXlK026567; Fri, 10 Jan 2025 19:18:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AJIXUD026564; Fri, 10 Jan 2025 19:18:33 GMT (envelope-from git) Date: Fri, 10 Jan 2025 19:18:33 GMT Message-Id: <202501101918.50AJIXUD026564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: def7999c2ccd - main - riscv: enable cpufreq_dt driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: def7999c2ccddc9a303a65c0bea22976e79d8613 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=def7999c2ccddc9a303a65c0bea22976e79d8613 commit def7999c2ccddc9a303a65c0bea22976e79d8613 Author: Mitchell Horne AuthorDate: 2024-10-08 18:49:11 +0000 Commit: Mitchell Horne CommitDate: 2025-01-10 19:16:06 +0000 riscv: enable cpufreq_dt driver Implement the small amount of MD code required; copied from arm/arm64. One tweak is made to cpufreq_dt itself: if the opp-shared property is missing, but there is only one CPU, then we can still attach. This is relevant for the single-core Allwinner D1. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48124 --- sys/conf/files.riscv | 1 + sys/dev/cpufreq/cpufreq_dt.c | 2 +- sys/riscv/conf/GENERIC | 3 +++ sys/riscv/include/pcpu.h | 3 ++- sys/riscv/riscv/machdep.c | 12 +++++++++++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 514c955181c3..36eea03f29a1 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -4,6 +4,7 @@ cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/riscv/instr_size.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" crypto/des/des_enc.c optional netsmb +dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofw_pcib.c optional pci fdt dev/pci/pci_dw.c optional pci fdt diff --git a/sys/dev/cpufreq/cpufreq_dt.c b/sys/dev/cpufreq/cpufreq_dt.c index 929eebfe7dc5..e35a8ec73ef4 100644 --- a/sys/dev/cpufreq/cpufreq_dt.c +++ b/sys/dev/cpufreq/cpufreq_dt.c @@ -401,7 +401,7 @@ cpufreq_dt_oppv2_parse(struct cpufreq_dt_softc *sc, phandle_t node) if (opp_table == opp_xref) return (ENXIO); - if (!OF_hasprop(opp_table, "opp-shared")) { + if (!OF_hasprop(opp_table, "opp-shared") && mp_ncpus > 1) { device_printf(sc->dev, "Only opp-shared is supported\n"); return (ENXIO); } diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 23d8a4e47eee..34426f167963 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -90,6 +90,9 @@ device syscon device syscon_power device riscv_syscon +# CPU frequency control +device cpufreq + # Bus drivers device pci diff --git a/sys/riscv/include/pcpu.h b/sys/riscv/include/pcpu.h index d00226defc2f..f11060496963 100644 --- a/sys/riscv/include/pcpu.h +++ b/sys/riscv/include/pcpu.h @@ -46,7 +46,8 @@ struct pmap *pc_curpmap; /* Currently active pmap */ \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ uint32_t pc_hart; /* Hart ID */ \ - char __pad[56] /* Pad to factor of PAGE_SIZE */ + uint64_t pc_clock; \ + char __pad[48] /* Pad to factor of PAGE_SIZE */ #ifdef _KERNEL diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index c5da4832dd36..c0d4b7cc2726 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -219,8 +219,18 @@ cpu_flush_dcache(void *ptr, size_t len) int cpu_est_clockrate(int cpu_id, uint64_t *rate) { + struct pcpu *pc; - panic("cpu_est_clockrate"); + pc = pcpu_find(cpu_id); + if (pc == NULL || rate == NULL) + return (EINVAL); + + if (pc->pc_clock == 0) + return (EOPNOTSUPP); + + *rate = pc->pc_clock; + + return (0); } void From nobody Fri Jan 10 20:04:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVCKc2ccfz5kSpR; Fri, 10 Jan 2025 20:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVCKc0WY0z4V5g; Fri, 10 Jan 2025 20:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736539460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqjeg4MRqNuaA1p0fXnf+AHMXKT4Jj4hSTwnRAHSI6Q=; b=Jit1BNm4Uk4go8bBF7hqXc7mO3I4ajZNyq6rX0sHZWmanV/up5ENlVKPLNzckK0VPRflnn QlmO8vVvzR4J2AcghQamDRG25iN8xy12PGBJndue3Nzm00vNj6WnsFIwgB0j+vFDtqhnrJ 7yjAUfsap7pLnyxYjH2Vcy0WLWJvsKsX7eQh7HLcZt/Y/eUk1AQMatWnNUfR604hFoad8z Kqa3gPFgOejYcmv6ctAOnrgTBlZYyA5apbAETG0vx+sVN0izyx8zrrS/B1ojUWVK+uTMFm 2MvPOqcO/TKgqHjae6lWa+DfKolW6rzQKHVJUCPTAa7xfOzr8U9DzIAd9dqLiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736539460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqjeg4MRqNuaA1p0fXnf+AHMXKT4Jj4hSTwnRAHSI6Q=; b=W9rzHOG/tlgde8uFbVWogNiODk/vwujyQ9SV00meLzqZecRgFtWFbM/ABhX//mTMAlI6t2 WtI98XWJLG2lfGoVC+i7rEJXO6vcZhBfwKliH1d9FRZX8JgBqyBjBZ7yKBOZy8hHyBL2j0 /d2VXgH/80yGMO6o4Q9EwiRu75/ARx7lsOIhl9sMIMP7QippXtiL8XeO5pgSY9JD3ys5ea 1hm/Fdst44VY4NZEBZLb8G2dvzDvRGMwFVB3TDucGroSKNyPDAEsvruA65+cFeQ6kRTAhP NzJk5hendl2LOpXvwn3zbToEeM8WpfHOIVL+j79NlD5YSPhIC6qNWF++rtP1TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736539460; a=rsa-sha256; cv=none; b=bn54UnYRz7upHoa73g38SnbEcUxN4vwv1Gg1vmQ9KY2tcZPr2MgRrDFGyweYgEPCXfMgcf UxIWWWpuwL7f5zlRsWTkOt7A0KuPrjFkW5r3L6OEM9rXNJd3mXhA81JJcprJYWa+TCIwjM MgjEy+yOiw6LCkpwODxIwOdaofpZK0ZnRVjg5JM6uKKuYSekjS8i7JKWNCV73weyCB3jSi kDseYKlPCcfyFpdE14smqICDA/s2coL+M0Ne4iTZbm8klZGld2OG20cBm4nGNeYMDP/4dY qd5kq0ulSH1tUPl4MQWHhKo/FcPgEOvfeHz8wAEsoIBGUQCaC0Kt3gsnj6bwzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVCKc01sLzBWC; Fri, 10 Jan 2025 20:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AK4Jvb018402; Fri, 10 Jan 2025 20:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AK4Jo0018399; Fri, 10 Jan 2025 20:04:19 GMT (envelope-from git) Date: Fri, 10 Jan 2025 20:04:19 GMT Message-Id: <202501102004.50AK4Jo0018399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9234a50752cd - main - ng_ksocket: add IPv6 support for address parsing and unparsing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9234a50752cd47887849d4665af0f9f4abdefb5d Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9234a50752cd47887849d4665af0f9f4abdefb5d commit 9234a50752cd47887849d4665af0f9f4abdefb5d Author: Seyed Pouria Mousavizadeh Tehrani AuthorDate: 2025-01-10 09:16:18 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-10 20:00:58 +0000 ng_ksocket: add IPv6 support for address parsing and unparsing Differential Revision: https://reviews.freebsd.org/D48204 --- share/man/man4/ng_ksocket.4 | 13 +++++-- sys/netgraph/ng_ksocket.c | 94 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 9 deletions(-) diff --git a/share/man/man4/ng_ksocket.4 b/share/man/man4/ng_ksocket.4 index 1f32d39dc7d0..bb653c3688ad 100644 --- a/share/man/man4/ng_ksocket.4 +++ b/share/man/man4/ng_ksocket.4 @@ -32,7 +32,7 @@ .\" .\" Author: Archie Cobbs .\" -.Dd January 9, 2012 +.Dd January 9, 2025 .Dt NG_KSOCKET 4 .Os .Sh NAME @@ -183,7 +183,8 @@ in the argument field, the normal equivalent of the C structure is an acceptable form. For the -.Dv PF_INET +.Dv PF_INET , +.Dv PF_INET6 and .Dv PF_LOCAL address families, a more convenient form is also used, which is @@ -191,7 +192,11 @@ the protocol family name, followed by a slash, followed by the actual address. For .Dv PF_INET , -the address is an IP address followed by an optional colon and port number. +the address is an IPv4 address followed by an optional colon and port number. +For +.Dv PF_INET6 , +the address is an IPv6 address enclosed in square brackets followed +by an optional colon and port number. For .Dv PF_LOCAL , the address is the pathname as a doubly quoted string. @@ -202,6 +207,8 @@ Examples: local/"/tmp/foo.socket" .It Dv PF_INET inet/192.168.1.1:1234 +.It Dv PF_INET6 +inet6/[2001::1]:1234 .It Other .Dv "\&{ family=16 len=16 data=[0x70 0x00 0x01 0x23] \&}" .El diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 3e4427f9e387..43a2747224f3 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -58,6 +58,9 @@ #include #include +#include +#include + #include #include #include @@ -66,6 +69,8 @@ #include #include +#include + #ifdef NG_SEPARATE_MALLOC static MALLOC_DEFINE(M_NETGRAPH_KSOCKET, "netgraph_ksock", "netgraph ksock node"); @@ -147,6 +152,19 @@ static const struct ng_ksocket_alias ng_ksocket_protos[] = { { "swipe", IPPROTO_SWIPE, PF_INET }, { "encap", IPPROTO_ENCAP, PF_INET }, { "pim", IPPROTO_PIM, PF_INET }, + { "ip6", IPPROTO_IPV6, PF_INET6 }, + { "raw6", IPPROTO_RAW, PF_INET6 }, + { "icmp6", IPPROTO_ICMPV6, PF_INET6 }, + { "igmp6", IPPROTO_IGMP, PF_INET6 }, + { "tcp6", IPPROTO_TCP, PF_INET6 }, + { "udp6", IPPROTO_UDP, PF_INET6 }, + { "gre6", IPPROTO_GRE, PF_INET6 }, + { "esp6", IPPROTO_ESP, PF_INET6 }, + { "ah6", IPPROTO_AH, PF_INET6 }, + { "swipe6", IPPROTO_SWIPE, PF_INET6 }, + { "encap6", IPPROTO_ENCAP, PF_INET6 }, + { "divert6", IPPROTO_DIVERT, PF_INET6 }, + { "pim6", IPPROTO_PIM, PF_INET6 }, { NULL, -1 }, }; @@ -296,9 +314,58 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type, break; } -#if 0 - case PF_INET6: /* XXX implement this someday */ -#endif + case PF_INET6: + { + struct sockaddr_in6 *const sin6 = (struct sockaddr_in6 *)sa; + char *eptr; + char addr[INET6_ADDRSTRLEN]; + char ifname[16]; + u_long port; + bool hasifname = true; + + /* RFC 3986 Section 3.2.2, Validate IP literal within square brackets. */ + if (s[*off] == '[' && (strstr(&s[*off], "]"))) + (*off)++; + else + return (EINVAL); + if ((eptr = strstr(&s[*off], "%")) == NULL) { + hasifname = false; + eptr = strstr(&s[*off], "]"); + } + snprintf(addr, eptr - (s + *off) + 1, "%s", &s[*off]); + *off += (eptr - (s + *off)); + if (!inet_pton(AF_INET6, addr, &sin6->sin6_addr)) + return (EINVAL); + + if (hasifname) { + uint16_t scope; + + eptr = strstr(&s[*off], "]"); + (*off)++; + snprintf(ifname, eptr - (s + *off) + 1, "%s", &s[*off]); + *off += (eptr - (s + *off)); + + if (sin6->sin6_addr.s6_addr16[0] != IPV6_ADDR_INT16_ULL) + return (EINVAL); + scope = in6_getscope(&sin6->sin6_addr); + sin6->sin6_scope_id = + in6_getscopezone(ifunit(ifname), scope); + } + + (*off)++; + if (s[*off] == ':') { + (*off)++; + port = strtoul(s + *off, &eptr, 10); + if (port > 0xffff || eptr == s + *off) + return (EINVAL); + *off += (eptr - (s + *off)); + sin6->sin6_port = htons(port); + } else + sin6->sin6_port = 0; + + sin6->sin6_len = sizeof(*sin6); + break; + } default: return (EINVAL); @@ -358,9 +425,24 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type, return(0); } -#if 0 - case PF_INET6: /* XXX implement this someday */ -#endif + case PF_INET6: + { + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa; + char addr[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &sin6->sin6_addr, addr, INET6_ADDRSTRLEN); + slen += snprintf(cbuf, cbuflen, "inet6/[%s]", addr); + + if (sin6->sin6_port != 0) { + slen += snprintf(cbuf + strlen(cbuf), + cbuflen - strlen(cbuf), ":%d", + (u_int)ntohs(sin6->sin6_port)); + } + if (slen >= cbuflen) + return (ERANGE); + *off += sizeof(*sin6); + return(0); + } default: return (*ng_ksocket_generic_sockaddr_type.supertype->unparse) From nobody Fri Jan 10 20:47:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVDHv6K06z5kXBm; Fri, 10 Jan 2025 20:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVDHv512nz4Yx0; Fri, 10 Jan 2025 20:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736542075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tqYUJjfS0VoY04pw9/C2GHEJ6oUisJVzLNEH1I+RX0=; b=g5+q6d9XISdYgzqWEQqhYUXHrgeOhXUTYiHxlZBnhqQ4W8KXv6hECrPfhCKR4q2xIIVqjX 0J+EEsgkKAshLlBr3JUriSb/VxO0OqtfACbgDaeTkndhrpeNO8EUuKEW/0QLGZml7tvBLk xJ0zlt4Kk65G455CISpzfSWBmCUxAO093k+6FGd8vqOgU6HeBmaIHvt2+FyHBu9W4kQ5sf Ab3wJcvhxu3+IqQ14MHiwqzipGz9CX+SN0RRbdpcxtKFdQmNJKRfG0QkKQLMd+VCVvXw+1 ZWiN3a+AvDMe8aDs177n+GL3OZRDzSd5myc9ZmmPkCmz9W2h75RsteoxoYYKGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736542075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tqYUJjfS0VoY04pw9/C2GHEJ6oUisJVzLNEH1I+RX0=; b=skhZYiU3C5sFYsoTMovwFRCOuzIj+7hQmcC6W8dLV3+fZ729CjUaKk2lCVcXx596w6pLEC JqgYiuCFgDMOlqoywZRoGK0YtUuRddW+o7tAaOtb9M9uLWmddQMny0VSYYV8t1k6lWaTZ3 Lf7bQg7mO+N27mDniuS4TLPPgfoS51tbUclVAjvFcBie9/LuNigcdxrNTr5HW0taYhaCaA AplNmhiSZk7ZfEy5o1VPEnu+AaQOSO4fYtmFCgiievOoPH8ue4AULJx8zRQLUDIvaRRqpp rBzwlMAYMKfFOSFw30gBvAJube4DzjwDFq062ZWXjsfuX8cKA5H+YjsAPW8plw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736542075; a=rsa-sha256; cv=none; b=oP4g4DodhHTForLFo8jUsuciPobcZTe/iRJQxbEX89DyUUM1TjtcolZdVYS8xiw3CX6fV9 wYxgEyx2UzwA5mnQhs//eOg1gUtiKZg3KhiGXDc4pq0a4O13TVmMZp8RnOYUpBaUN1QLzw 5yXSRzNKguqfjiVHjgVrrrWQu0px3QbNLeanAzv/42g0gfIe8W8KQ+6Hiqqfh8C5hHzMSX EVeAEblYGwYgzy0TeHAU+BZhcssHrhZHvQZEt9u5/P+LXZSyu8OOXQ/OQR1XM5QHY/VbBe fdlLnBoqaXYN3bj29qtxC0gi1v25WcggEwWTAP+3DqIEo93YZAukfGbjdGp6yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVDHv4cNQzCTh; Fri, 10 Jan 2025 20:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50AKltvt093291; Fri, 10 Jan 2025 20:47:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AKlt7k093288; Fri, 10 Jan 2025 20:47:55 GMT (envelope-from git) Date: Fri, 10 Jan 2025 20:47:55 GMT Message-Id: <202501102047.50AKlt7k093288@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: f021e3573519 - main - bsnmpwalk: Fix crash on invalid data List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f021e3573519ff192fc708cda9ca4bba264c96f7 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f021e3573519ff192fc708cda9ca4bba264c96f7 commit f021e3573519ff192fc708cda9ca4bba264c96f7 Author: Shteryana Shopova AuthorDate: 2025-01-10 20:30:21 +0000 Commit: Ed Maste CommitDate: 2025-01-10 20:47:06 +0000 bsnmpwalk: Fix crash on invalid data PR: 258570 Reported by: Robert Morris Reviewed by: emaste, markj Differential Revision: https://reviews.freebsd.org/D48422 --- usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c index 81108387d3a4..9d5a693c7c68 100644 --- a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c +++ b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c @@ -502,7 +502,7 @@ snmptool_walk(struct snmp_toolinfo *snmptoolctx) outputs += rc; - if ((u_int)rc < resp.nbindings) { + if ((u_int)rc < resp.nbindings || resp.nbindings == 0) { snmp_pdu_free(&resp); break; } From nobody Sat Jan 11 00:00:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVJZ56LNGz5kq4S; Sat, 11 Jan 2025 00:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVJZ53Pw8z3xW9; Sat, 11 Jan 2025 00:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736553629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pVkVPJJREqen5kwpJmjMz/566w0GG5WB1iZsjQ/X12U=; b=K1ul+KVkZT6XwoJj6MuA1w0YwKIbTuaCNDsKad0WyrsAuSXkXGwdU6RkVqubdFdOmBuxND fOKeotjnWrWXCG/S0Jq725ZYU5Vy+U9rE+zU1728EJ4jjJqzQUFzt5zqf4CAylMnBYTkYE srVbfZ7Enqp+vQjaWIWEp4gf+EqazS32ggg5N6Uct6tQ0RyXKgk1n8/Xub4jiyeXbhaiCx BzUUk2aPsxKxSH9yBtJW+xfwqsJ0DmPwBSv7A69KoEyN/6poREXU49fHNc7vxgQBbl3FhZ ySQsPtZasJTi6wsiv6IdSPCQBMkUt3i9iF9i8CGcnyZgshGFsS9Nri60wCpjhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736553629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pVkVPJJREqen5kwpJmjMz/566w0GG5WB1iZsjQ/X12U=; b=nj9PUbpnjXNuas2TovJkU8niu1cs0ukXxguBd2NP+I955TBrJ8Kn1hgpS50ofAyLuXfk3S hRxbjS6jMKfgqmeKkhOMSNVilRhOEs4+g//Tv0bEM0C8cpgLcKQdMx8QJMVBnAQMHa5GRQ TAqnT/H7ghlusCXJgsxSl1bgD+AryGdIJyneLcpvJPiPbyvyaR0WFMCCArEdEjQFhgGkaD HIB2gsoMNCUmb9/TpynEi/YbtC1tFGMOeIUZfisdTqETIhdgbt23lsGBK1MdINIaMI6jrJ Iv3wA5kqPAMzUykvOiY56N3wCTP06MYEvfKPi5M5Up9wGQHvJccGF7sUcL8L6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736553629; a=rsa-sha256; cv=none; b=asDii+y5eCPok68QdYh7nWyuZNqZJ2+7o+TBmUU8Qw8n2qO3Za/QO3OSp3YkmTD/LCTkSQ uJrDDQwunnrpjjURRZpl57mHUoWuCUQ60Z3A5OpmiG2Gfr3tgB987PLOHmX+rNQJBETo1m VVw+oaLhr3GohlYV36klhuY0Xq1vb6qzOXLUWf204mkDviVn+q0leHFXFI5vYiONYWa2Eo rhHhfjxVLvILA4p3/u1KhjAyYWBBTNz2ts3E6CaD1rNlfGSrChR9HcebBkKP3BMBp9L28v sU4FwwXTqZ9C1Dvgb8JY0dmiyJG317MQEGLjTVLSsTcfzk1GOyY7y6ggYsMhOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVJZ52xxMzb0s; Sat, 11 Jan 2025 00:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B00TDU057149; Sat, 11 Jan 2025 00:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B00T0p057146; Sat, 11 Jan 2025 00:00:29 GMT (envelope-from git) Date: Sat, 11 Jan 2025 00:00:29 GMT Message-Id: <202501110000.50B00T0p057146@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: b2b974f7ef4c - main - clock: Simplify subr_ticks and rename List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2b974f7ef4cddff251d0de69d8da13232b25e4d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b2b974f7ef4cddff251d0de69d8da13232b25e4d commit b2b974f7ef4cddff251d0de69d8da13232b25e4d Author: Mark Johnston AuthorDate: 2025-01-10 23:59:47 +0000 Commit: Mark Johnston CommitDate: 2025-01-10 23:59:47 +0000 clock: Simplify subr_ticks and rename - We can use builtin constants for the size of int and long to simplify definitions. - The file should have a .S prefix since we want to run it through the preprocessor, though apparently this happens anyway with .s... - Move ticks and ticksl from .data to .bss. Reported by: jrtc27 Reviewed by: jrtc27, kib, emaste Fixes: 6b82130e6c9a ("clock: Add a long ticks variable, ticksl") Differential Revision: https://reviews.freebsd.org/D48420 --- sys/conf/files | 2 +- sys/kern/{subr_ticks.s => subr_ticks.S} | 22 +++++++--------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index a630d9dd72bc..fc9108b5e10f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3932,7 +3932,7 @@ kern/subr_stack.c optional ddb | stack | ktr kern/subr_stats.c optional stats kern/subr_taskqueue.c standard kern/subr_terminal.c optional vt -kern/subr_ticks.s standard +kern/subr_ticks.S standard kern/subr_trap.c standard kern/subr_turnstile.c standard kern/subr_uio.c standard diff --git a/sys/kern/subr_ticks.s b/sys/kern/subr_ticks.S similarity index 62% rename from sys/kern/subr_ticks.s rename to sys/kern/subr_ticks.S index 6565ba424137..52435b194c4f 100644 --- a/sys/kern/subr_ticks.s +++ b/sys/kern/subr_ticks.S @@ -16,29 +16,21 @@ GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) #endif -#ifdef _ILP32 -#define SIZEOF_TICKSL 4 -#define TICKSL_INIT .long 0 -#else -#define SIZEOF_TICKSL 8 -#define TICKSL_INIT .quad 0 -#endif - -#if defined(_ILP32) || __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #define TICKS_OFFSET 0 #else -#define TICKS_OFFSET 4 +#define TICKS_OFFSET (__SIZEOF_LONG__ - __SIZEOF_INT__) #endif - .data + .bss .global ticksl .type ticksl, %object - .align SIZEOF_TICKSL -ticksl: TICKSL_INIT - .size ticksl, SIZEOF_TICKSL + .align __SIZEOF_LONG__ +ticksl: .zero __SIZEOF_LONG__ + .size ticksl, __SIZEOF_LONG__ .global ticks .type ticks, %object ticks =ticksl + TICKS_OFFSET - .size ticks, 4 + .size ticks, __SIZEOF_INT__ From nobody Sat Jan 11 03:50:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPgN6zxKz5l8wV; Sat, 11 Jan 2025 03:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPgN6SXSz4S7Q; Sat, 11 Jan 2025 03:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736567424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeVNbOT4MEfTbVNmwVJfJajfvqBxU1ZsSuXCuhbpI2k=; b=tQsMNhVvUuMlSGDncMvtScysQZj2QFoyNFmVrUpm6uy5guPegQE79B02BgRvMUQx+69Ifa kDXyYQQJnOBAqQ6iRHF1ZVUIs8ajax2CNVBFcKU8XbtGsfyvCyTYIotySfGZnO0xt1yEDG 6OfH0/q+M644I7zGQt+SwUyUbBaEkJj6ofjQCSiag80NiF1YRqIWJje0Not73zqUu48GjV 1qQWHC4RiwQs6NyTOoxJmE8hgskI6vkUaPsEbPbB321d4NQb1AK2mZpX1l2v9ioo8Q6HTd FUKKpkiNR1Te1hGP5OwFHOmKpOAhD83AyUhfNdz+8uRhMSNQHkh2Fc+maC+7ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736567424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeVNbOT4MEfTbVNmwVJfJajfvqBxU1ZsSuXCuhbpI2k=; b=vUK8wjgzLWICCJCSkS/SVupMFDl06O0HALG0yae/8Jugf06lUDQ/zsdhSi6YbW8XOSPMQr R5JpWMBv54rVyNIjHu3atqmMxYrZ1Dzjx4eKIh35QhLfXtuwz3W8SluXylGG4LaxF8LegS GtmibqG8t2udugJmHVBmZI0BOBoaSumHuSe4JJuvKU1sJnHmMcGSmXOkXbHufqX5BJNWPd sS2sar5s/1yup2SPDgOQEz79cWOPFnRdylTKzytwwGu6YtV2OCWXyrBxLU9iq1napgAx0O eOsRVMkFShjpUmWsRwhAUm4nK+huR3ea1AJ066p9BDvdTluVMSAxA3Ar1bQd0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736567424; a=rsa-sha256; cv=none; b=snAIsCNNvmCiqA88vqLT9MWEvV10H/FvxhehmRSm3t6Mw0CWkOmo0nRQ13lEoe3Y1aWtlH 0GVtQ3E+NCrJ3ABMu/Gc2ZRRpltcrE3U89tdjRif0z/DwWZWmRpD3VrhVCz5siQZz7Az6l QzEQ2DDDI4tnYo2pWFkMw2/La5ofMaKYhP952uIH0qt7kMBH07bXoMWQ6LLLHjeaSUvIKF Xde98dXxfq+eWP8x/kxQ3ST6qyuzUD+xP7BmYPAOiY3M+UsOe1yB1Dgz83C5mdVa1JVeaA PYYSLpRmm+rJZa/pgp7tIgMmEBiyTMPYXUw0xZrJyNhanar89Dclj01gdMftcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPgN642Kzhvm; Sat, 11 Jan 2025 03:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B3oON4089186; Sat, 11 Jan 2025 03:50:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B3oOoO089183; Sat, 11 Jan 2025 03:50:24 GMT (envelope-from git) Date: Sat, 11 Jan 2025 03:50:24 GMT Message-Id: <202501110350.50B3oOoO089183@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: 550137eab24a - main - universe: Permit requesting a specific version of GCC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 550137eab24ab6bdf05bfbb986927004b9f2f34e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=550137eab24ab6bdf05bfbb986927004b9f2f34e commit 550137eab24ab6bdf05bfbb986927004b9f2f34e Author: John Baldwin AuthorDate: 2025-01-11 03:49:59 +0000 Commit: John Baldwin CommitDate: 2025-01-11 03:49:59 +0000 universe: Permit requesting a specific version of GCC If USE_GCC_TOOLCHAINS is set to a value matching the pattern 'gcc*', use that as the GCC version. For example, USE_GCC_TOOLCHAINS=gcc16 would use amd64-gcc16 for amd64, etc. If the variable is set to a value that doesn't match that pattern, use the default version. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48418 --- Makefile | 16 +++++++++------- share/man/man7/build.7 | 7 ++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5c113d5b83cc..1970cc736829 100644 --- a/Makefile +++ b/Makefile @@ -531,13 +531,15 @@ TARGET_ARCHES_${target}= ${MACHINE_ARCH_LIST_${target}} .endfor .if defined(USE_GCC_TOOLCHAINS) -TOOLCHAINS_amd64= amd64-gcc12 -TOOLCHAINS_arm= armv7-gcc12 -TOOLCHAINS_arm64= aarch64-gcc12 -TOOLCHAINS_i386= i386-gcc12 -TOOLCHAINS_powerpc= powerpc-gcc12 powerpc64-gcc12 -TOOLCHAIN_powerpc64= powerpc64-gcc12 -TOOLCHAINS_riscv= riscv64-gcc12 +_DEFAULT_GCC_VERSION= gcc12 +_GCC_VERSION= ${"${USE_GCC_TOOLCHAINS:Mgcc*}" != "":?${USE_GCC_TOOLCHAINS}:${_DEFAULT_GCC_VERSION}} +TOOLCHAINS_amd64= amd64-${_GCC_VERSION} +TOOLCHAINS_arm= armv7-${_GCC_VERSION} +TOOLCHAINS_arm64= aarch64-${_GCC_VERSION} +TOOLCHAINS_i386= i386-${_GCC_VERSION} +TOOLCHAINS_powerpc= powerpc-${_GCC_VERSION} powerpc64-${_GCC_VERSION} +TOOLCHAIN_powerpc64= powerpc64-${_GCC_VERSION} +TOOLCHAINS_riscv= riscv64-${_GCC_VERSION} .endif # If a target is using an external toolchain, set MAKE_PARAMS to enable use diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 32c33aa3d730..5ca44c51cf56 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 13, 2024 +.Dd January 10, 2025 .Dt BUILD 7 .Os .Sh NAME @@ -879,6 +879,11 @@ This variable implies Use external GCC toolchains to build the requested targets. If the required toolchain package for a supported architecture is not installed, the build for that architecture is skipped. +.Pp +A specific version of GCC can be used by setting the value of this variable +to the desired version +.Pq for example, Dq gcc14 ; +otherwise a default version of GCC is used. .It Va TARGETS Only build the listed targets instead of each supported architecture. .It Va EXTRA_TARGETS From nobody Sat Jan 11 03:58:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPrg45ZPz5l9YQ; Sat, 11 Jan 2025 03:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPrg32sKz4TB1; Sat, 11 Jan 2025 03:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736567907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xgcUWHUwCRCxQM9+CMnTiM+byjv1JpRxL7m0PcOYfNg=; b=Hv4GYToreEsw5bZ8ID0rvZuBh+pfaNKaI5l/2D0vxxKGCGKS4xh6wh/5UXyNEqm23f3Xqt 7REtn95P1OaWRdTKCBqnkxci1kkPiElWnJVPWb0orm62scFEIhwwV9IVwEJqJuuuISODKl 89iWh/S81wMJjC/nwHzTYBoLoi/zE5NMEu75n0eS7l8nBvMAwNynkGT1V4Aj4R+bTgsFRv pcglKRpnOKi2nt5YBWyBRnLdigIg/QHMyYtnV54K/JOYv4NVd+agcljvLHflMBv9UhDYPf VUy5soiH1iYNmM3KxTm5XeYJfnUdjKND27K0y7YNJdG2jri+D7wHEcRtfPyR1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736567907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xgcUWHUwCRCxQM9+CMnTiM+byjv1JpRxL7m0PcOYfNg=; b=K/h4aE3YmZL1Vhr+af0mJTtv3fJkVuGjL4PDKiW2U6h8le7HCMianQNs64kFBTJYMEAEYb tGvyts67hFbNTEN2wd0whv3Jrs/Kl1UOjXu2NLKsOpcQMJIJ0XjPXWib9MX2fNMYfXvM5q WI2JsPwm0lvcIGLvg8GIPkBJUxUbOi3gFdfGaPAMZKBgK9jpvLTxL008hfA+Er1kcDUhBJ 2b2MsQB/zYeyqfKbq4Uu9zFBKmrLR/gEnKY8IU+X8zaIu14qyWEkNJJWEB0Q3UabFjNTC+ dNc90ZYUjf6Qe783atKZ75bTylqO016dF+vfZ2OlshWLFEsNjZuBp309AHvzeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736567907; a=rsa-sha256; cv=none; b=bcVNU6rTsSEuQ84LygN2AuOhrBMk+bWajzK6FfMIJBxE7tcLabTP68Rg3Gmjwf0CrNVrbf mWyuOIenbhIaQ2AALPn9hY1sAmJFSgsla+JHps2lQH0I9tFEe/i4AfiL9N6utNE0nLrJfe zpQlh2midNJ/rFbsu/ImIrTE6aopquyt0WC8z5Tu9pJdldGokVwEDr1ZgucOxCskWEiDa+ +jF2SQ5LvrPowfU8Y9xXO7xl5v+U0hNhvich+XQ78l1Q0WnOxcn3xl3RWFuwoJ0dZ3W1ow W7oqSH4a01/kipUUnXyiPvIQX0jHBGd/2HeZStzv9Yt8DFnwTvUyFd/mtWLW1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPrg2YpXzjDd; Sat, 11 Jan 2025 03:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B3wRfJ098674; Sat, 11 Jan 2025 03:58:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B3wRvx098671; Sat, 11 Jan 2025 03:58:27 GMT (envelope-from git) Date: Sat, 11 Jan 2025 03:58:27 GMT Message-Id: <202501110358.50B3wRvx098671@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: 84a62d974e74 - main - mlx.4: Remove stale diagnostic message List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84a62d974e744fbe00ee542fc5f95e99c528bd0a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=84a62d974e744fbe00ee542fc5f95e99c528bd0a commit 84a62d974e744fbe00ee542fc5f95e99c528bd0a Author: John Baldwin AuthorDate: 2025-01-11 03:58:09 +0000 Commit: John Baldwin CommitDate: 2025-01-11 03:58:09 +0000 mlx.4: Remove stale diagnostic message This message would never have been omitted before since bus_generic_attach never fails. Reviewed by: ziaee, emaste Fixes: 18250ec6c089 Replace calls to bus_generic_attach with bus_attach_children Differential Revision: https://reviews.freebsd.org/D48402 --- share/man/man4/mlx.4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 index f7a0d64e9e73..7cb3e9a98c1d 100644 --- a/share/man/man4/mlx.4 +++ b/share/man/man4/mlx.4 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 15, 2017 +.Dd January 10, 2025 .Dt MLX 4 .Os .Sh NAME @@ -146,7 +146,6 @@ controller. The current status of all system drives could not be fetched; attachment of system drives will be aborted. .It mlx%d: device_add_child failed -.It mlx%d: bus_generic_attach returned %d .Pp Creation of the system drive instances failed; attachment of one or more system drives may have been aborted. From nobody Sat Jan 11 04:03:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPys2ksCz5l9m8; Sat, 11 Jan 2025 04:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPys1gqtz4VBp; Sat, 11 Jan 2025 04:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7K9uLepdKvU6OpzAV0MiIT27Vfn8LixHBlA/+sTPww8=; b=gdmwPdJ5w2LKEPYV7M6NP9E851YhxHFvk/MO69v+QE4YTu+U1yuy+FvWvdVfv+AMoZVOC3 j4tX9xcnCBN8lxqqg9C9fGiht1hoM5hOMnzunU5cug+aQMzQDi2+WIDcxg3PTg7e4fBKFu rP3tvZj82bIGDH+Zz7xO2je3OziOuGYgIpU8tNtnLjwco6+dUwMvU+38DlS/AvSW1qYWSm Ms5UOPaZwkr4fAsu1sFWKYZRuRHJTl8oZEJonqvSR2VSwIZVXEFY1jL5XVK2kodoFzqCIq 8/5g5YaGFLtqxkbDwJ9Tx9oYYL+TzldU1VYcC6oM12feC+cH/0fNE1zqlE52bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7K9uLepdKvU6OpzAV0MiIT27Vfn8LixHBlA/+sTPww8=; b=Gkdaf6sZrjAWYRuojCkoJJLtGSTCoJ7TGagTHyJUdhLk7ZhyH+u/x1nl2V1gWA2er+mmgZ HL69gGucTfq7wfXwMwypEj4W+4Wq4dWeVjV047oKdyt52/DTY3dwIBgYOEQNtUfMsuXKqo anUjXoBJNN3Vr5Q/AI6XL8k8W+wJkF/ZwX2rVJOwCMZUMSV246SYoUXrNQpzcJFNP3Czpw RADHno0yUY/w+VtPRizf56On4LLlh/mB3QFgPLkBYjUhLQJ5dQ+b2+haFsyy3KmaF4FPiG aUjKRK0S2hqtX+EKQOWPkJAwcIkcjv52cnyIvLBfjGWkVrwTgLe3me/dGnLyZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568229; a=rsa-sha256; cv=none; b=BK4we4et0OhoMbBUUSpWZTJZIOHuOelIpe0/OWp1EkOf0WuLFB1eWRTRIfdHoP4hn/lKM4 HKJHH5v5VFQTmLuBIYJJ4GsJteQRUYhvWb3h625WuVGVWcfajsxXV4Rkzn2+Bk4/brEO6q BbDZeojvi7sjolTa92XLkARKopAAG6yvYA0vsqXLkBAL3eiBKMnzJK8gBVxh4vNS0r1IPZ Hocnr3PkO71YuYXhAJgQ/aOtgWUQtCLL3UWT+AtSt+btCibOODugNI2pxaZEKjiaPp5K8x GDJZgpm7dCUTt+6A6JQljRVOzQG2V2L+gytGew6mX6lKDhqj9ZCTKmVjULvoqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPys1F9LzjVH; Sat, 11 Jan 2025 04:03:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43noC017667; Sat, 11 Jan 2025 04:03:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43nc0017664; Sat, 11 Jan 2025 04:03:49 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:49 GMT Message-Id: <202501110403.50B43nc0017664@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: 4378bd382ea0 - main - stand/kshim: Replace bus_generic_attach with bus_attach_children List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4378bd382ea0f5707099273b1fa2393979a22628 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4378bd382ea0f5707099273b1fa2393979a22628 commit 4378bd382ea0f5707099273b1fa2393979a22628 Author: John Baldwin AuthorDate: 2025-01-11 04:01:21 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:28 +0000 stand/kshim: Replace bus_generic_attach with bus_attach_children Fixes: 18250ec6c089 Replace calls to bus_generic_attach with bus_attach_children Differential Revision: https://reviews.freebsd.org/D48404 --- stand/kshim/bsd_kernel.c | 6 ++---- stand/kshim/bsd_kernel.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index ac552d86603f..fb1b4239fd03 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -205,16 +205,14 @@ bus_release_resource(device_t dev, int type, int rid, struct resource *r) return (EINVAL); } -int -bus_generic_attach(device_t dev) +void +bus_attach_children(device_t dev) { device_t child; TAILQ_FOREACH(child, &dev->dev_children, dev_link) { device_probe_and_attach(child); } - - return (0); } bus_space_tag_t diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 0608d32f21ec..0b5d659951a2 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -646,7 +646,7 @@ int bus_release_resource(device_t, int, int, struct resource *); void bus_release_resources(device_t, const struct resource_spec *, struct resource **); struct resource *bus_alloc_resource_any(device_t, int, int *, unsigned int); -int bus_generic_attach(device_t); +void bus_attach_children(device_t); bus_space_tag_t rman_get_bustag(struct resource *); bus_space_handle_t rman_get_bushandle(struct resource *); u_long rman_get_size(struct resource *); From nobody Sat Jan 11 04:03:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPyv5F8lz5l9x8; Sat, 11 Jan 2025 04:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPyv3Y0Xz4VT7; Sat, 11 Jan 2025 04:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rlEmPGB3XLt7kZU8O9hw6MeUY25b3YwFSnLosYaR/6I=; b=Kw2qEbKhKmoZRIJgu3byj7YvA8N7O9dvaqekSqHWUGVLSbWFxMLmX7bGpBdE/VSyFVQvKl X/WJOJH3riMIcAAZ2N2OZpj1t4rZw/RvBhC3YZXicl+1vC9G8GK7rUvSM5mn/yGWisbpjX YZhgtYtI1Pbpox6IYYMZAvrpAtIqNXfd2QPnZva9lrvuaZ18iLflPp5sNe00ZChc25DQpS f//Bs83760lvPc7eo4E+RE3A38R/CgGpreImzsTZTZmtGYxi69AYKWNwxROXCHP/mXy+cw s7U0eyRWKGbOdX0OJ/PhQag7RlagNfNRC2RwxaYlwwjixi2eNK+QbDdLzPuGGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rlEmPGB3XLt7kZU8O9hw6MeUY25b3YwFSnLosYaR/6I=; b=lm+dy+tmeL/p5k31O1OJjZMycL/CuWXs9AI5utxZ0tobADTLS3rQVojHtdIufDZby5QORR 66bbPX+YopbkHoALz/jYhGahMFK3GuFan44dUf31AwjFpGshPdrInRvbHelqQ1WH15NtUV K7pagw6sDeuFdQnEPFDHeuNRXvsqZwyjCGsGM0ciVIq+PwSHXXPnPVj6A4QJOneyvnrHmX hyI4E545WiLklfFFGCwRZVtFtLUE+4qYUQ9W9KQUl2yGWP73tHoP+fOZMe8ZhCnkmDYGTf E0vvgufHJIg3vgcnvPLXctzqBNVCUeDE2dcwVswHlybrONYqs4ymrLt99FW3Bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568231; a=rsa-sha256; cv=none; b=Em+N5aZE9ZKn3//sRxW8AdA4htta8/fa5so2XjjIx8wC0A6bSxekETOsSbxQOS43SJFkRE jB8YYdHa31CXria/deQOgzJsIZV53rGcGv8UHjzHV9OQiBl5NMXDCIAPk11GEv2MqlNhTm +O1hbWNwnku93aOpfFnmY5ySoiv4Yhj7Vt849DOdqe4Kj6b7fq1FRuqEwf+hETVqKj38xC bCSqO1ExqkDja90licTDoq1R1CRRdC9G6N1BUA/6wXh0POjupZ+2/q5tit4j0vqhroI8HC E5CuW7USx4tLjJhCSwoJ34UZuDme4XcbzSa2Vj2Y88FNSYEy4jlrLzQ/IAkQFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPyv2tMXzjVK; Sat, 11 Jan 2025 04:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43pPA017762; Sat, 11 Jan 2025 04:03:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43pw8017759; Sat, 11 Jan 2025 04:03:51 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:51 GMT Message-Id: <202501110403.50B43pw8017759@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: 8e4535ee5870 - main - stand/kshim: Implement bus_detach_children List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e4535ee5870b76f97f6d33a05e9979dcb75c185 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e4535ee5870b76f97f6d33a05e9979dcb75c185 commit 8e4535ee5870b76f97f6d33a05e9979dcb75c185 Author: John Baldwin AuthorDate: 2025-01-11 04:02:27 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:32 +0000 stand/kshim: Implement bus_detach_children While here, update bus_generic_detach to delete devices as in the kernel. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48410 --- stand/kshim/bsd_kernel.c | 13 ++++++++++++- stand/kshim/bsd_kernel.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index 78b6f9e0b4d4..371aaa6e96bf 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -664,7 +664,7 @@ device_get_unit(device_t dev) } int -bus_generic_detach(device_t dev) +bus_detach_children(device_t dev) { device_t child; int error; @@ -679,6 +679,17 @@ bus_generic_detach(device_t dev) return (0); } +int +bus_generic_detach(device_t dev) +{ + int error; + + error = bus_detach_children(dev); + if (error == 0) + error = device_delete_children(dev); + return (error); +} + const char * device_get_nameunit(device_t dev) { diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 8600bd1f31dc..25a779d5ea0c 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -650,6 +650,7 @@ void bus_release_resources(device_t, const struct resource_spec *, struct resource **); struct resource *bus_alloc_resource_any(device_t, int, int *, unsigned int); void bus_attach_children(device_t); +int bus_detach_children(device_t); bus_space_tag_t rman_get_bustag(struct resource *); bus_space_handle_t rman_get_bushandle(struct resource *); u_long rman_get_size(struct resource *); From nobody Sat Jan 11 04:03:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPyt3gc8z5l9gH; Sat, 11 Jan 2025 04:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPyt2bhQz4VHV; Sat, 11 Jan 2025 04:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IMVNqsgYLzx9mXAvNcOhzU2Pxi1uLQZ3UF8AXJtWvSM=; b=pZS00rZiqbwhR5pgkssglo2c70QEYFoIsnAtMO8dFqZyud6jZHVC230IwUKHG7hGVF9/Q/ vtoFAbcsMAD/XztxC8+LfMFvWHyuKg6EHzooMYOtgQPReAq2CFebdjcSarpIgfDTi5N69b ouflNEYeaa/pVRLLUBRnnWO0ikZP5KbK2ZyprFoEudykfgY5aLpccwAwexarY4WIDS4wQq N4FuDElQsHJ5iFL9d+uEtW1IAUuWHITWic3cT0lVnV/x/EoHigXq6Jl/FXpF/vVy74EWIc t9D2q6ttBna65jxMuoEGv0UZROI5LwuuWl6Ei9s0cmdK6cBekmNFmr7fy9UHQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IMVNqsgYLzx9mXAvNcOhzU2Pxi1uLQZ3UF8AXJtWvSM=; b=Yho0rQn+Wsq8aA/S33yOYUsR51EFdxRvboO6oDT/Gb7vavab1oh7v8XrxYUpMf5MllpJy3 Mp43QF0MOp8XesJX7FZoGwsWAzxF2M1jqzi6gG/LaIl2rvkcB1Wv8EtD5XTPnrM3QTzdOU 8+/HbBnUO4HZ0eSZKBqCu/qE1vgfZpoXYofRR4iEJQK9lbDHW5VIQIDUqFmdPaZ1SG5O76 0gz2hQGvE/ddR4VVtV1S7N88UlWAjASCAhGmvO+2zRS/42ftiq0RyyCOoiD1eWV6WAab5f U/CNEomPVDUQg9TrT39s3eCfPapSEqbeZOuy8P70C53HmaZ3FuzZags4yaBJoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568230; a=rsa-sha256; cv=none; b=RRYcW/u9cpLR/WSk9K5jKgmFs+PzIGLOhXjk0AD3F7Kgi0cGzgWLCyb5lVjFtEZKKdrQvI E7TwJR9k6ho/LpStqTwAtme7QfEQT+yo6QxQ4y0JSmyLzDxDp4QCsm6wgG71S+pcciv42c Ljg4zh85XQNVlU8AaZCKgK3nWKO3TQGEI/NC2yvArUaHxk2xZhqAvI/afJao0hl/IqBDvw SMeT1y8Q868jFXcoJNDpNf0myUbIJWqc3Jfwz05JcOSCLQHpSuVRAbM0IDZh0AT3BQi5gI oZXBZiWL1D9Ivm7HWzizbTm11X+0ZO/ZFX/o7fsl249LLvT+DW2w/jwA7Xy0tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPyt25NlzjgF; Sat, 11 Jan 2025 04:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43owH017726; Sat, 11 Jan 2025 04:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43oXQ017723; Sat, 11 Jan 2025 04:03:50 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:50 GMT Message-Id: <202501110403.50B43oXQ017723@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: ee15875c0159 - main - stand/kshim: Update for devclass being removed from DRIVER_MODULE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee15875c01593b287e55147c482b914e3ab01152 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ee15875c01593b287e55147c482b914e3ab01152 commit ee15875c01593b287e55147c482b914e3ab01152 Author: John Baldwin AuthorDate: 2025-01-11 04:01:48 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:32 +0000 stand/kshim: Update for devclass being removed from DRIVER_MODULE The kshim code abused the devclass argument to DRIVER_MODULE in some odd ways. Instead, refactor the devclass handling to more closely mirror what new-bus does in the kernel by having a linked list of devclasses looked up by name and associate devices with a devclass. Devices are now only associated with a module while probing and attaching. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48409 --- stand/kshim/bsd_kernel.c | 140 ++++++++++++++++++--------------------- stand/kshim/bsd_kernel.h | 11 +-- stand/usb/storage/umass_common.c | 4 +- 3 files changed, 71 insertions(+), 84 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index fb1b4239fd03..78b6f9e0b4d4 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -554,6 +554,8 @@ static const char unknown_string[] = { "unknown" }; static TAILQ_HEAD(, module_data) module_head = TAILQ_HEAD_INITIALIZER(module_head); +static TAILQ_HEAD(, devclass) devclasses = + TAILQ_HEAD_INITIALIZER(devclasses); static uint8_t devclass_equal(const char *a, const char *b) @@ -686,58 +688,50 @@ device_get_nameunit(device_t dev) return (unknown_string); } -static uint8_t -devclass_create(devclass_t *dc_pp) +static devclass_t +devclass_create(const char *classname) { - if (dc_pp == NULL) { - return (1); - } - if (dc_pp[0] == NULL) { - dc_pp[0] = malloc(sizeof(**(dc_pp)), - M_DEVBUF, M_WAITOK | M_ZERO); + devclass_t dc; - if (dc_pp[0] == NULL) { - return (1); - } + dc = malloc(sizeof(*dc), M_DEVBUF, M_WAITOK | M_ZERO); + if (dc == NULL) { + return (NULL); } - return (0); + dc->name = classname; + TAILQ_INSERT_TAIL(&devclasses, dc, link); + return (dc); } -static const struct module_data * +static devclass_t devclass_find_create(const char *classname) { - const struct module_data *mod; + devclass_t dc; - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->mod_name, classname)) { - if (devclass_create(mod->devclass_pp)) { - continue; - } - return (mod); - } - } - return (NULL); + dc = devclass_find(classname); + if (dc == NULL) + dc = devclass_create(classname); + return (dc); } static uint8_t -devclass_add_device(const struct module_data *mod, device_t dev) +devclass_add_device(devclass_t dc, device_t dev) { device_t *pp_dev; device_t *end; uint8_t unit; - pp_dev = mod->devclass_pp[0]->dev_list; + pp_dev = dc->dev_list; end = pp_dev + DEVCLASS_MAXUNIT; unit = 0; while (pp_dev != end) { if (*pp_dev == NULL) { *pp_dev = dev; + dev->dev_class = dc; dev->dev_unit = unit; - dev->dev_module = mod; snprintf(dev->dev_nameunit, sizeof(dev->dev_nameunit), - "%s%d", device_get_name(dev), unit); + "%s%d", dc->name, unit); return (0); } pp_dev++; @@ -748,26 +742,26 @@ devclass_add_device(const struct module_data *mod, device_t dev) } static void -devclass_delete_device(const struct module_data *mod, device_t dev) +devclass_delete_device(devclass_t dc, device_t dev) { - if (mod == NULL) { + if (dc == NULL) { return; } - mod->devclass_pp[0]->dev_list[dev->dev_unit] = NULL; - dev->dev_module = NULL; + dc->dev_list[dev->dev_unit] = NULL; + dev->dev_class = NULL; } static device_t make_device(device_t parent, const char *name) { device_t dev = NULL; - const struct module_data *mod = NULL; + devclass_t dc = NULL; if (name) { - mod = devclass_find_create(name); + dc = devclass_find_create(name); - if (!mod) { + if (!dc) { DPRINTF("%s:%d:%s: can't find device " "class %s\n", __FILE__, __LINE__, @@ -787,7 +781,7 @@ make_device(device_t parent, const char *name) if (name) { dev->dev_fixed_class = 1; - if (devclass_add_device(mod, dev)) { + if (devclass_add_device(dc, dev)) { goto error; } } @@ -843,7 +837,8 @@ device_delete_child(device_t dev, device_t child) } } - devclass_delete_device(child->dev_module, child); + if (child->dev_class != NULL) + devclass_delete_device(child->dev_class, child); if (dev != NULL) { /* remove child from parent */ @@ -911,7 +906,7 @@ device_get_method(device_t dev, const char *what) const char * device_get_name(device_t dev) { - if (dev == NULL) + if (dev == NULL || dev->dev_module == NULL) return (unknown_string); return (dev->dev_module->driver->name); @@ -942,16 +937,34 @@ device_probe_and_attach(device_t dev) { const struct module_data *mod; const char *bus_name_parent; - - bus_name_parent = device_get_name(device_get_parent(dev)); + devclass_t dc; if (dev->dev_attached) return (0); /* fail-safe */ - if (dev->dev_fixed_class) { + /* + * Find a module for our device, if any + */ + bus_name_parent = device_get_name(device_get_parent(dev)); + + TAILQ_FOREACH(mod, &module_head, entry) { + if (!devclass_equal(mod->bus_name, bus_name_parent)) + continue; + + dc = devclass_find(mod->mod_name); - mod = dev->dev_module; + /* Does this device need assigning to the new devclass? */ + if (dev->dev_class != dc) { + if (dev->dev_fixed_class) + continue; + if (dev->dev_class != NULL) + devclass_delete_device(dev->dev_class, dev); + if (devclass_add_device(dc, dev)) { + continue; + } + } + dev->dev_module = mod; if (DEVICE_PROBE(dev) <= 0) { if (device_allocate_softc(dev) == 0) { @@ -963,40 +976,11 @@ device_probe_and_attach(device_t dev) } } } - device_detach(dev); + /* else try next driver */ - goto error; - } - /* - * Else find a module for our device, if any - */ - - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->bus_name, bus_name_parent)) { - if (devclass_create(mod->devclass_pp)) { - continue; - } - if (devclass_add_device(mod, dev)) { - continue; - } - if (DEVICE_PROBE(dev) <= 0) { - - if (device_allocate_softc(dev) == 0) { - - if (DEVICE_ATTACH(dev) == 0) { - /* success */ - dev->dev_attached = 1; - return (0); - } - } - } - /* else try next driver */ - - device_detach(dev); - } + device_detach(dev); } -error: return (ENODEV); } @@ -1015,9 +999,10 @@ device_detach(device_t dev) dev->dev_attached = 0; } device_set_softc(dev, NULL); + dev->dev_module = NULL; if (dev->dev_fixed_class == 0) - devclass_delete_device(mod, dev); + devclass_delete_device(dev->dev_class, dev); return (0); } @@ -1093,11 +1078,11 @@ devclass_get_device(devclass_t dc, int unit) devclass_t devclass_find(const char *classname) { - const struct module_data *mod; + devclass_t dc; - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->driver->name, classname)) - return (mod->devclass_pp[0]); + TAILQ_FOREACH(dc, &devclasses, link) { + if (devclass_equal(dc->name, classname)) + return (dc); } return (NULL); } @@ -1108,6 +1093,7 @@ module_register(void *data) struct module_data *mdata = data; TAILQ_INSERT_TAIL(&module_head, mdata, entry); + (void)devclass_find_create(mdata->mod_name); } /*------------------------------------------------------------------------* diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 0b5d659951a2..8600bd1f31dc 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -87,11 +87,11 @@ struct sysctl_req { #define MOD_UNLOAD 2 #define DEVMETHOD(what,func) { #what, (void *)&func } #define DEVMETHOD_END {0,0} -#define EARLY_DRIVER_MODULE(a, b, c, d, e, f, g) DRIVER_MODULE(a, b, c, d, e, f) -#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \ +#define EARLY_DRIVER_MODULE(a, b, c, d, e, f) DRIVER_MODULE(a, b, c, d, e) +#define DRIVER_MODULE(name, busname, driver, evh, arg) \ static struct module_data bsd_##name##_##busname##_driver_mod = { \ evh, arg, #busname, #name, #busname "/" #name, \ - &driver, &devclass, { 0, 0 } }; \ + &driver, { 0, 0 } }; \ SYSINIT(bsd_##name##_##busname##_driver_mod, SI_SUB_DRIVERS, \ SI_ORDER_MIDDLE, module_register, \ &bsd_##name##_##busname##_driver_mod) @@ -135,6 +135,7 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ #define cold 0 #define BUS_PROBE_GENERIC 0 #define BUS_PROBE_DEFAULT (-20) +#define DEVICE_UNIT_ANY -1 #define CALLOUT_RETURNUNLOCKED 0x1 #undef ffs #define ffs(x) __builtin_ffs(x) @@ -406,6 +407,7 @@ struct device { TAILQ_HEAD(device_list, device) dev_children; TAILQ_ENTRY(device) dev_link; + devclass_t dev_class; struct device *dev_parent; const struct module_data *dev_module; void *dev_sc; @@ -429,6 +431,8 @@ struct device { }; struct devclass { + TAILQ_ENTRY(devclass) link; + const char *name; device_t dev_list[DEVCLASS_MAXUNIT]; }; @@ -445,7 +449,6 @@ struct module_data { const char *mod_name; const char *long_name; const struct driver *driver; - struct devclass **devclass_pp; TAILQ_ENTRY(module_data) entry; }; diff --git a/stand/usb/storage/umass_common.c b/stand/usb/storage/umass_common.c index 639d70a7f7e6..b62412b13637 100644 --- a/stand/usb/storage/umass_common.c +++ b/stand/usb/storage/umass_common.c @@ -38,8 +38,6 @@ static device_probe_t umass_probe; static device_attach_t umass_attach; static device_detach_t umass_detach; -static devclass_t umass_devclass; - static device_method_t umass_methods[] = { /* Device interface */ DEVMETHOD(device_probe, umass_probe), @@ -54,7 +52,7 @@ static driver_t umass_driver = { .methods = umass_methods, }; -DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0); +DRIVER_MODULE(umass, uhub, umass_driver, NULL, 0); static int umass_probe(device_t dev) From nobody Sat Jan 11 04:03:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPyw6Ztjz5lB6w; Sat, 11 Jan 2025 04:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPyw4FPVz4VT8; Sat, 11 Jan 2025 04:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kTDDUq5FH+9RjCB+DQoabLFzyqK92cVMYhBHG6aF8hY=; b=VNw+3OvhIApugZcVSROWIMSVHM+kj71MAxhf6w4BrIxvrUqn4qruuFmwfios+3GPjk/zSA pT1JUzZILixe9pLrHdAqUCKQB7DTMXemz3LcWFDee6WGDgpwtC4m3s6e35Ik7SIaQOpP3p j8Vsa+B30lLIFy69a0m832xtKT98eb4TmEJfUz9RdRUBdvLrb7usr+Q/K/UWHJo2YZTaTw 2Ta8AQOyOdGPQYDrY294+Y0EXDyKWUNxk5rJ6CxVKtpECaIXExgpKPEstHc5Js1W/fbd8P 47/E/x5vbSOQu/rCwqF1kmfrqzkz+Vg06La/nMLzMLUO8j5IIIgkOhulx7ersg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kTDDUq5FH+9RjCB+DQoabLFzyqK92cVMYhBHG6aF8hY=; b=EFDA2mhxzOh40/iX88vgbKC4sdKPVDaJY7gTjsIymiYgeeNWefgPyTFUjbpRDVp34GLMpX 9FkxJHPJWTwkst18evAiJVY7QrMZ3Qa8vsddGqoE0AYmVWTWamU0QH1OsIRY2+ynFKH+3l RPRyy9KA1UBnWz0CAe3zSpOc0wlsAxrQFhrwbnuSmXnWuyYwBToKAEh+rL7+dfQn04ByXu MCkqYATTxMIl/JtgLa+zW7mcChYNnljr8mHJbA6MdbI6TQbqEADZiM1LRivphKiE1k+lOU 7EYj6QvyanKr7oVfRlL7fnStN03Nn7dVW8pHPQyRmftwO5bEVsF4HLXC7TKzJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568232; a=rsa-sha256; cv=none; b=wOZmE8/gkHTJNC/+4+A9GKJItykM9cZyDV2WF1n+LuLJwd0dqGwrNOqZHGKHghUoaL2I+X 58z+gknPgjGWX2W9jgrfxM6cHAtAZ4aGalNOxYrVyiTg2hfPpHW44TmWsf/s+uCYhSXzrD Z8r6QqmFO/mS2cIl5Eaz/OBzEIxt+h1bRTr4i3ph3wA0sDoNmlJfafnLjyzHHkD0D0Yh2Y f/sInsqFirVK2qxYLQ0cuh04Xzn8gJlsgxp3lxhOtqShksRgxACOZWeC82x/cylY1M12hT wJG1pkCal0yILM41nzmmgI/JtjjCjfIpZMxcq1BJYL7OfEJdqReK7C1WZRByeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPyw3pkkzj5K; Sat, 11 Jan 2025 04:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43qMB017817; Sat, 11 Jan 2025 04:03:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43q0l017814; Sat, 11 Jan 2025 04:03:52 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:52 GMT Message-Id: <202501110403.50B43q0l017814@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: f6f5aa8a2df5 - main - stand/usb: Quiet warnings so this builds again List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6f5aa8a2df5910b0769ab7cd0e6199c9b2ab624 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f6f5aa8a2df5910b0769ab7cd0e6199c9b2ab624 commit f6f5aa8a2df5910b0769ab7cd0e6199c9b2ab624 Author: John Baldwin AuthorDate: 2025-01-11 04:02:46 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:32 +0000 stand/usb: Quiet warnings so this builds again Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48411 --- stand/usb/Makefile | 2 +- stand/usb/test/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stand/usb/Makefile b/stand/usb/Makefile index 0a1c9e0022ee..a9c20fc340ad 100644 --- a/stand/usb/Makefile +++ b/stand/usb/Makefile @@ -35,7 +35,7 @@ INTERNALLIB= CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -Wformat -Wall +CFLAGS+= -Wformat -Wall -Wno-unused CFLAGS+= -g CFLAGS+= -fno-pic diff --git a/stand/usb/test/Makefile b/stand/usb/test/Makefile index 74e501a39ae7..d92ef6dddecb 100644 --- a/stand/usb/test/Makefile +++ b/stand/usb/test/Makefile @@ -35,6 +35,7 @@ PROG= usbloader SRCS= CFLAGS+= -Wall +CFLAGS+= -Wno-error=missing-prototypes -Wno-error=unused-parameter CFLAGS+= -g .if ${MACHINE_CPUARCH} == "amd64" From nobody Sat Jan 11 04:03:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVPyx6gpxz5l9kB; Sat, 11 Jan 2025 04:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPyx5LRxz4VXW; Sat, 11 Jan 2025 04:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rXyMkXT0C9qVs0EL8Q2cdDPh7rVrgPpduxIqTcqmA1k=; b=a7KDpq8bd0tPYBq50jMq25jmnYHnDCstrUaRgKBWGT1LxWz342FOUYeBI+OicYjFhhS6wT azx+Ik/gZe/9WywVc85ttx499OvQxK5QQrA/A1IVdZAc9HJMJ0iR7y7CTaOQ8vcJIT78eh 1fC3KjPQDyGO91UPZqBe5DwUo6RyNCpzWtHw3DRhmMwNp/7GCR2u7bVFp7lW/ed5RHCxNW dR2X6q5Ir/Gj/odyTf2pEKSQ6n85Yw7uw8JsnVRlTqYt5WVEb6Hbo6AzHkJPxlGYBYWZmb fzClTIHFLIlS8g1ar/+ADPIJqIO9zi+AQsriPoTB8R6nyNcxr2L9Z/mPABq1Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rXyMkXT0C9qVs0EL8Q2cdDPh7rVrgPpduxIqTcqmA1k=; b=uXTWpIqiQQz3Wmx5nl9mmDumUiy9SAgJ/JWLNf3YtfKCBvNxAV61JfJw5qt+yBSbZTztIr j7H5mvdhZG+By/MFp5X4MiPzspmMLEaOw2Djaf/zzq0ppLNgozsnHDFfILSZUanmdNH8wX WBDE4FU4U9rux0+o/oWH6HcpBDcOmd7LNEsrGfOpAQrnOxihMBxOsg0BPRgtUGw4WF2uko V3JBzWt9cdSyrMzV8P8sKHNLZ9Ij2h7lPm8uAAGhNCGb4084r3Fpw4DE4GDvEFRsLvY79W BWTJsvycZumU0UTXDTFH2PLhqvbWPJ9y+OffjWo46EIozaGIob1pid0zD5A/tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568233; a=rsa-sha256; cv=none; b=EP9gl5yxQL1nDJm+n/lkTjmaRdppS5peBdje7yZq1+6AZ6rd2UJtdtwwjufRd0OL/RhceO BQJG62j4i0pIP7qW0JNUb8Vbu3SSFTXftrqyUBEofqm7lPIOu4r8h7427bbeNDJYZ6qaoh zlGdLfZI2EiOQYDRNYZRq4bQhjbz7/huVPxWEwQwPda+bCufpgcBYB5wQvROtKEq35UkxM PNzbnihzQKcfJJruXx4xI9ihv/VCDRxVqPIkCGYvVgB4zM3gkQ/R+YNPX0l9M6z5+GxH3q GRUXu1LCgz3fSAT8VGSJQsWUz81RkdtuQenkpZ2Bll0F+uo4TbLifkdKMq4M0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVPyx4yT1zj5L; Sat, 11 Jan 2025 04:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43rwn017880; Sat, 11 Jan 2025 04:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43rIg017877; Sat, 11 Jan 2025 04:03:53 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:53 GMT Message-Id: <202501110403.50B43rIg017877@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: 40d7ba087737 - main - stand/kshim: Replace devclass_equal with calls to strcmp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40d7ba08773751ff7d0df1a3f112b32d1d04e5ec Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=40d7ba08773751ff7d0df1a3f112b32d1d04e5ec commit 40d7ba08773751ff7d0df1a3f112b32d1d04e5ec Author: John Baldwin AuthorDate: 2025-01-11 04:03:02 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:32 +0000 stand/kshim: Replace devclass_equal with calls to strcmp Reviewed by: imp, markj, emaste Differential Revision: https://reviews.freebsd.org/D48412 --- stand/kshim/bsd_kernel.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index 371aaa6e96bf..91ca46e18d74 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -557,27 +557,6 @@ static TAILQ_HEAD(, module_data) module_head = static TAILQ_HEAD(, devclass) devclasses = TAILQ_HEAD_INITIALIZER(devclasses); -static uint8_t -devclass_equal(const char *a, const char *b) -{ - char ta, tb; - - if (a == b) - return (1); - - while (1) { - ta = *a; - tb = *b; - if (ta != tb) - return (0); - if (ta == 0) - break; - a++; - b++; - } - return (1); -} - int bus_generic_resume(device_t dev) { @@ -906,7 +885,7 @@ device_get_method(device_t dev, const char *what) mtod = dev->dev_module->driver->methods; while (mtod->func != NULL) { - if (devclass_equal(mtod->desc, what)) { + if (strcmp(mtod->desc, what) == 0) { return (mtod->func); } mtod++; @@ -959,7 +938,7 @@ device_probe_and_attach(device_t dev) bus_name_parent = device_get_name(device_get_parent(dev)); TAILQ_FOREACH(mod, &module_head, entry) { - if (!devclass_equal(mod->bus_name, bus_name_parent)) + if (strcmp(mod->bus_name, bus_name_parent) != 0) continue; dc = devclass_find(mod->mod_name); @@ -1092,7 +1071,7 @@ devclass_find(const char *classname) devclass_t dc; TAILQ_FOREACH(dc, &devclasses, link) { - if (devclass_equal(dc->name, classname)) + if (strcmp(dc->name, classname) == 0) return (dc); } return (NULL); From nobody Sat Jan 11 05:00:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRD92HVpz5lFpS; Sat, 11 Jan 2025 05:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRD86PcCz4cMb; Sat, 11 Jan 2025 05:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gp+jD6eQ7dMuUK48ZPqI4+jNHgHzT0Qfo7hMQVQybyI=; b=nnCXtzrEehPV/YuTs9A4sjNNZVv0+3iI+QXUuY3NVJ9tdz+EE4f6lSwAh+VsDKFy/R6X1Q 0W03e8NNmZIq+5/dorhZ7TZSd0izrq4JzFKmqUbnS/B2I6tB2P7xIpt+rTSERsfsHmLN0u qzT2qIfikrjlEFBuxOTIKtSryGz/hJBlMbZ2Au0iTlGKQ0qVCMZ9mPMhDC6gFQk5/DhKtb s9/2WPGczfyY+MXLHJ/9xBnLAGIvJ8O38aWGx1ogYdCOcoA00wfGuPQCNIBfIasZbkFXpy 2rNCo0Hab1TvlpNKVC7DlltfgYVhXypLXKFXB6rtZIppYjwP9NpSuN208GwlBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gp+jD6eQ7dMuUK48ZPqI4+jNHgHzT0Qfo7hMQVQybyI=; b=rF6t6EbCuyEWRePyXIvplQCLuJMpJyULX1blQ3+kl8lBdCutB4a0/qJAj+ckIYHQq+kytv +Md2Dj97gtRUzZ2oE4HnLVVr2XZxRAgrdbxxTutnDaNezU1FU03c+6a0HNcIN8a9+rpibq P51QLDKQKB1+Yg88DtkCVxCYvei8NIX/TrivK/dI5VZbkQT1W73BZHzhEEcWL+tcdlchb6 cFNVF386lANaQCFV8CWnzNN+PlGCu8P+a5UJzDXRIQCnnGQyGm01aNbJibGyJMZjRaEeIw Tz41ZhAyJnjX8/HZl7SUt8OM2wJFZWicyIGXv0CcRF0+7zGhOcsNMlk1tXAw8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736571624; a=rsa-sha256; cv=none; b=siimQ6XfzUfv1f+fXUTXPgrh00Oil9PpAVWyQQ/s9wNujkD7/Z9HLVZ4lLZ6jQ/N0VwSPj GAyeL3jpxbp4L85gJQNnZn/6IR81+B5V+HGlcXx8eLd5qC3zA0ohM96ml598gYa+7fYJum szjbCgmv8YYt5HBo/9wXr82IHfm4l++bQeFM9EqthhtvYjV2kn/ZzqZAEMPbnu0t2uBsIQ +Hi3DsfM58fA3adX8qm+GcxfnFa06O9E/Cupd8+Bnax1I33mhwfwGVFHt5uyg2/w2F2rDj 0uDMfj12qr6HEZD7DlI9o4YEc6QBMn3F0PCifVftAetcdaJeRU/gk3N+H8bnxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRD85vxSzkpB; Sat, 11 Jan 2025 05:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B50OwO022410; Sat, 11 Jan 2025 05:00:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B50Ojf022407; Sat, 11 Jan 2025 05:00:24 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:00:24 GMT Message-Id: <202501110500.50B50Ojf022407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 0fda4ffd6905 - main - netlink: augment group writer with priv(9) argument List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0fda4ffd69054217096dd1a40355d97be9a8ab94 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0fda4ffd69054217096dd1a40355d97be9a8ab94 commit 0fda4ffd69054217096dd1a40355d97be9a8ab94 Author: Gleb Smirnoff AuthorDate: 2025-01-11 04:55:39 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 04:55:39 +0000 netlink: augment group writer with priv(9) argument This will allow to broadcast messages visible only to priveleged subscribers. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48307 --- sys/netlink/netlink_domain.c | 8 +++++--- sys/netlink/netlink_generic.c | 2 +- sys/netlink/netlink_glue.c | 7 ++++--- sys/netlink/netlink_message_writer.c | 3 ++- sys/netlink/netlink_message_writer.h | 10 ++++++---- sys/netlink/netlink_sysevent.c | 2 +- sys/netlink/netlink_var.h | 2 +- sys/netlink/route/iface.c | 5 +++-- sys/netlink/route/neigh.c | 2 +- sys/netlink/route/nexthop.c | 4 ++-- sys/netlink/route/rt.c | 5 +++-- 11 files changed, 29 insertions(+), 21 deletions(-) diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 922da32bfb6d..45d427f43166 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -47,7 +47,7 @@ #include #include #include -#include /* priv_check */ +#include #include #include @@ -225,8 +225,10 @@ nl_send_group(struct nl_writer *nw) NLCTL_RLOCK(ctl); CK_LIST_FOREACH(nlp, &ctl->ctl_pcb_head, nl_next) { - if (nl_isset_group_locked(nlp, nw->group.id) && - nlp->nl_proto == nw->group.proto) { + if ((nw->group.priv == 0 || priv_check_cred( + nlp->nl_socket->so_cred, nw->group.priv) == 0) && + nlp->nl_proto == nw->group.proto && + nl_isset_group_locked(nlp, nw->group.id)) { if (nlp_last != NULL) { struct nl_buf *copy; diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index 0f960d79f477..623531492173 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -259,7 +259,7 @@ nlctrl_notify(void *arg __unused, const struct genl_family *gf, int cmd) struct nl_writer nw; if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_GENERIC, ctrl_group_id, - false)) { + 0, false)) { NL_LOG(LOG_DEBUG, "error allocating group writer"); return; } diff --git a/sys/netlink/netlink_glue.c b/sys/netlink/netlink_glue.c index e550a6013654..0e8fdc0b054c 100644 --- a/sys/netlink/netlink_glue.c +++ b/sys/netlink/netlink_glue.c @@ -118,7 +118,7 @@ nl_writer_unicast_stub(struct nl_writer *nw, size_t size, struct nlpcb *nlp, static bool nl_writer_group_stub(struct nl_writer *nw, size_t size, uint16_t protocol, - uint16_t group_id, bool waitok) + uint16_t group_id, int priv, bool waitok) { return (get_stub_writer(nw)); } @@ -221,9 +221,10 @@ nl_writer_unicast(struct nl_writer *nw, size_t size, struct nlpcb *nlp, bool nl_writer_group(struct nl_writer *nw, size_t size, uint16_t protocol, - uint16_t group_id, bool waitok) + uint16_t group_id, int priv, bool waitok) { - return (_nl->nl_writer_group(nw, size, protocol, group_id, waitok)); + return (_nl->nl_writer_group(nw, size, protocol, group_id, priv, + waitok)); } bool diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 1aebc4690c2d..8c5b3ec14058 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -86,11 +86,12 @@ _nl_writer_unicast(struct nl_writer *nw, size_t size, struct nlpcb *nlp, bool _nl_writer_group(struct nl_writer *nw, size_t size, uint16_t protocol, - uint16_t group_id, bool waitok) + uint16_t group_id, int priv, bool waitok) { *nw = (struct nl_writer){ .group.proto = protocol, .group.id = group_id, + .group.priv = priv, .cb = nl_send_group, }; diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h index 1655acb53fef..83f925e8d93d 100644 --- a/sys/netlink/netlink_message_writer.h +++ b/sys/netlink/netlink_message_writer.h @@ -50,6 +50,7 @@ struct nl_writer { struct { uint16_t proto; uint16_t id; + int priv; } group; }; u_int num_messages; /* Number of messages in the buffer */ @@ -67,7 +68,8 @@ struct nl_writer { /* Provide optimized calls to the functions inside the same linking unit */ bool _nl_writer_unicast(struct nl_writer *, size_t, struct nlpcb *nlp, bool); -bool _nl_writer_group(struct nl_writer *, size_t, uint16_t, uint16_t, bool); +bool _nl_writer_group(struct nl_writer *, size_t, uint16_t, uint16_t, int, + bool); bool _nlmsg_flush(struct nl_writer *nw); void _nlmsg_ignore_limit(struct nl_writer *nw); @@ -89,9 +91,9 @@ nl_writer_unicast(struct nl_writer *nw, size_t size, struct nlpcb *nlp, static inline bool nl_writer_group(struct nl_writer *nw, size_t size, uint16_t proto, - uint16_t group_id, bool waitok) + uint16_t group_id, int priv, bool waitok) { - return (_nl_writer_group(nw, size, proto, group_id, waitok)); + return (_nl_writer_group(nw, size, proto, group_id, priv, waitok)); } static inline bool @@ -141,7 +143,7 @@ nlmsg_end_dump(struct nl_writer *nw, int error, struct nlmsghdr *hdr) /* Provide access to the functions via netlink_glue.c */ bool nl_writer_unicast(struct nl_writer *, size_t, struct nlpcb *, bool waitok); -bool nl_writer_group(struct nl_writer *, size_t, uint16_t, uint16_t, +bool nl_writer_group(struct nl_writer *, size_t, uint16_t, uint16_t, int, bool waitok); bool nlmsg_flush(struct nl_writer *nw); void nlmsg_ignore_limit(struct nl_writer *nw); diff --git a/sys/netlink/netlink_sysevent.c b/sys/netlink/netlink_sysevent.c index 3359c77fa303..c955ce2e8b45 100644 --- a/sys/netlink/netlink_sysevent.c +++ b/sys/netlink/netlink_sysevent.c @@ -82,7 +82,7 @@ sysevent_write(struct sysevent_group *se, const char *subsystem, const char *typ { struct nl_writer nw; - if (!nl_writer_group(&nw, NLMSG_LARGE, NETLINK_GENERIC, se->id, + if (!nl_writer_group(&nw, NLMSG_LARGE, NETLINK_GENERIC, se->id, 0, false)) { NL_LOG(LOG_DEBUG, "error allocating group writer"); return; diff --git a/sys/netlink/netlink_var.h b/sys/netlink/netlink_var.h index 8efe84e935c3..34cba0b28d27 100644 --- a/sys/netlink/netlink_var.h +++ b/sys/netlink/netlink_var.h @@ -187,7 +187,7 @@ struct nl_function_wrapper { bool (*nl_writer_unicast)(struct nl_writer *nw, size_t size, struct nlpcb *nlp, bool waitok); bool (*nl_writer_group)(struct nl_writer *nw, size_t size, - uint16_t protocol, uint16_t group_id, bool waitok); + uint16_t protocol, uint16_t group_id, int priv, bool waitok); bool (*nlmsg_end_dump)(struct nl_writer *nw, int error, struct nlmsghdr *hdr); int (*nl_modify_ifp_generic)(struct ifnet *ifp, struct nl_parsed_link *lattrs, const struct nlattr_bmask *bm, struct nl_pstate *npt); diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 86b1f8f1b1bc..d856498b975f 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -1386,7 +1386,8 @@ rtnl_handle_ifaddr(void *arg __unused, struct ifaddr *ifa, int cmd) if (!nl_has_listeners(NETLINK_ROUTE, group)) return; - if (!nl_writer_group(&nw, NLMSG_LARGE, NETLINK_ROUTE, group, false)) { + if (!nl_writer_group(&nw, NLMSG_LARGE, NETLINK_ROUTE, group, 0, + false)) { NL_LOG(LOG_DEBUG, "error allocating group writer"); return; } @@ -1406,7 +1407,7 @@ rtnl_handle_ifevent(if_t ifp, int nlmsg_type, int if_flags_mask) if (!nl_has_listeners(NETLINK_ROUTE, RTNLGRP_LINK)) return; - if (!nl_writer_group(&nw, NLMSG_LARGE, NETLINK_ROUTE, RTNLGRP_LINK, + if (!nl_writer_group(&nw, NLMSG_LARGE, NETLINK_ROUTE, RTNLGRP_LINK, 0, false)) { NL_LOG(LOG_DEBUG, "error allocating group writer"); return; diff --git a/sys/netlink/route/neigh.c b/sys/netlink/route/neigh.c index ec58c6140db8..9eaaae263254 100644 --- a/sys/netlink/route/neigh.c +++ b/sys/netlink/route/neigh.c @@ -566,7 +566,7 @@ rtnl_lle_event(void *arg __unused, struct llentry *lle, int evt) int nlmsgs_type = evt == LLENTRY_RESOLVED ? NL_RTM_NEWNEIGH : NL_RTM_DELNEIGH; - if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, RTNLGRP_NEIGH, + if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, RTNLGRP_NEIGH, 0, false)) { NL_LOG(LOG_DEBUG, "error allocating group writer"); return; diff --git a/sys/netlink/route/nexthop.c b/sys/netlink/route/nexthop.c index 03f1a57fd1e4..30aa3dd72534 100644 --- a/sys/netlink/route/nexthop.c +++ b/sys/netlink/route/nexthop.c @@ -554,7 +554,7 @@ delete_unhop(struct unhop_ctl *ctl, struct nlmsghdr *hdr, uint32_t uidx) }; if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, RTNLGRP_NEXTHOP, - false)) { + 0, false)) { NL_LOG(LOG_DEBUG, "error allocating message writer"); return (ENOMEM); } @@ -949,7 +949,7 @@ rtnl_handle_newnhop(struct nlmsghdr *hdr, struct nlpcb *nlp, }; if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, RTNLGRP_NEXTHOP, - false)) { + 0, false)) { NL_LOG(LOG_DEBUG, "error allocating message writer"); return (ENOMEM); } diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 14bd73d33411..e90debee46da 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -353,7 +353,8 @@ report_operation(uint32_t fibnum, struct rib_cmd_info *rc, struct nl_writer nw; uint32_t group_id = family_to_group(rt_get_family(rc->rc_rt)); - if (nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, group_id, false)) { + if (nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, group_id, 0, + false)) { struct route_nhop_data rnd = { .rnd_nhop = rc_get_nhop(rc), .rnd_weight = rc->rc_nh_weight, @@ -1082,7 +1083,7 @@ rtnl_handle_route_event(uint32_t fibnum, const struct rib_cmd_info *rc) }; uint32_t group_id = family_to_group(family); - if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, group_id, + if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_ROUTE, group_id, 0, false)) { NL_LOG(LOG_DEBUG, "error allocating event buffer"); return; From nobody Sat Jan 11 05:00:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRDB1tBKz5lG4w; Sat, 11 Jan 2025 05:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRDB0Sgjz4cRc; Sat, 11 Jan 2025 05:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OoSBCvQkkgw62K6TOUp96rhBRI/yKOOxRpBUzMyORmw=; b=Tcp2kSYAj4/15tkKjJ3twQu3XP9uc3sKtSe84IZ5VdaCiL3OKw7vq7zPMUeN/0Vue1byGe dzEPWyVUIQ4L+vqZqhFZqf/5xjMqG84yX5ni5cRZ4tAb7gi3WQ1n7prjwFywfGwH5uQaaa EyojzxsSR/6eK3hgv+6BDlfvShqUzedYUAQgaVNZ6FhbjeRPCpasL8PwWuDbP35CDT/794 dZd8alSLweve6jKpmmThCwhrljoCrV9d8XiR3XshlyS45ssFc4oXSeQ4q0ekoYcyqfBxzV 1a0K5darFAaehuQF6kIQ7iyEI2Qa7KAiHWkf4gwoqmSTI0rSyOpXaF/iuE6Gdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OoSBCvQkkgw62K6TOUp96rhBRI/yKOOxRpBUzMyORmw=; b=hrLl3JnQSHe9LDNj3VzB4s8ldMUhgk7d3Bx4mz4conMOyhNdGFGCapiCT01doHP92OWK4Y Vv2EVcOSsRjJWxinFhaL5Ymo6HtLQdnGsj4LC5uBGnglI1wXAvItrYeGcFOZFH4L5GvNH7 YDvqM/iKOKWLwuac1q/BfIliEg0Ayvc1p1cRcqZPDtySWsh+6DFG86Uo4R9I6M8MREWsxG M/1B/9OD9b4mM54INnEXX3hTSbP//3tLBRVDkB39rLwWDlvHVqgTCfk9gFp9/icSOfE3+I W6H640/miucqeKKr2ekDN3gAey6FiZ2bmtsZCXg2tWOPTSQ2B3J6+FBpLEXPXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736571626; a=rsa-sha256; cv=none; b=OpCnP++10j/ZiYnDTNr2ftLsuKVPJtUEP47RDsNWnA1/HE770RnVQt3zCDK1rBtUaQbIvW LglvIbV+RGeHIujG20oJ4OEjo+PdD0mVG62Em5USNr2J4dGwEjou7ZHQbhMSmg+o+ocbhV jIWIBqeWX7Pl4V2nWj55KVQGDsWySgUXabDTxeryXRhukkZgD5XoArAhM8MGY+BnQmgaFy hs+jbH7I4nUSK8nQoP6qcC63iQfw/0keXD0UHY1RxI9GdWwLP4TcW4CRpWrg0lgk1jPqBO zdYjdkjPY8shx7QeDbcU/skrmIy478u7l6D8wOXvyE8PL2Pd8Xmg4SxfzmgfWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRD96vHWzksT; Sat, 11 Jan 2025 05:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B50PTR022468; Sat, 11 Jan 2025 05:00:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B50PNR022465; Sat, 11 Jan 2025 05:00:25 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:00:25 GMT Message-Id: <202501110500.50B50PNR022465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 8a8d095718cb - main - netlink: add snl(3) primitive to obtain group ID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a8d095718cb4e3ce84bef1cd61c20b518b8d047 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8a8d095718cb4e3ce84bef1cd61c20b518b8d047 commit 8a8d095718cb4e3ce84bef1cd61c20b518b8d047 Author: Gleb Smirnoff AuthorDate: 2025-01-11 04:55:50 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 04:55:50 +0000 netlink: add snl(3) primitive to obtain group ID using the family name and the group name as lookup arguments. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48308 --- sys/netlink/netlink_snl_generic.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h index 0a2913c9155e..32b460c612bd 100644 --- a/sys/netlink/netlink_snl_generic.h +++ b/sys/netlink/netlink_snl_generic.h @@ -127,6 +127,24 @@ snl_get_genl_family(struct snl_state *ss, const char *family_name) return (attrs.family_id); } +static inline uint16_t +snl_get_genl_mcast_group(struct snl_state *ss, const char *family_name, + const char *group_name, uint16_t *family_id) +{ + struct _getfamily_attrs attrs = {}; + + snl_get_genl_family_info(ss, family_name, &attrs); + if (attrs.family_id == 0) + return (0); + if (family_id != NULL) + *family_id = attrs.family_id; + for (u_int i = 0; i < attrs.mcast_groups.num_groups; i++) + if (strcmp(attrs.mcast_groups.groups[i]->mcast_grp_name, + group_name) == 0) + return (attrs.mcast_groups.groups[i]->mcast_grp_id); + return (0); +} + static const struct snl_hdr_parser *snl_all_genl_parsers[] = { &_genl_ctrl_getfam_parser, &_genl_ctrl_mc_parser, }; From nobody Sat Jan 11 05:00:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRDC56Zqz5lFrk; Sat, 11 Jan 2025 05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRDC3G5Wz4cKM; Sat, 11 Jan 2025 05: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=1736571627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ghHi0/rl64uwqTBzOPGTvHUOKjbBjx8vfPCOPuaFvM=; b=vmsOVLSdqVW4gChzJF/dfoNkZUOO/HMCC0Za2WfR4ZA/S60F5azIua5UqU7/PuUmy4ef21 oQDBenz+brpMv8PsIumaYacgR2yVnkBZH6RsPV7sDqtq8yWTEUdEolCH1kZT8V7oMfqQDn N4FGhE0U3+fmfdpioyJSiRQNr3y3MX8rp8ORacVAN32B5Mtn/WpaUuIGVBKHPy2JKI27jW Goem410kpN4cAFeJ31sfdWe3VICEV1vMumN7H/N/qBv3FKBSOmfhO8gofCbdujxZyqpEG2 4LYuLFQcwAMmnUwCejs0JsXGCB0j1Jta29j8MGyG9I1KWp/XvDQZjRuh9T1KCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ghHi0/rl64uwqTBzOPGTvHUOKjbBjx8vfPCOPuaFvM=; b=JnaBzIhBOzPFNCQX92blILY/xFa++WZKfDorlV+s5ZS18pQj9GsHQb0/Xvrz1CS1ri7FRH rdsA7wovJ8SkMH+JIpRW8AI79PMpIxu+re0POkASr30dYSm2k3joKhXHFJsJON/HCJHaAj n9jNa9pV/uHcemLuvySobjouN6VHthhGaEDTvQISDSq8PpE2oJgSiEZyf7yMa6W9Ql7jsC heiGDZJuAzrsx+J5jQP7k+/tF80U1dK/kIfx5pimLp+FWRdEHAHSlUlbDlS9ejsWx5ejIW Ye0tgPJ6yW3GFliejJHAIDiopdPeZR4zY6Y4/efa6gNMmsvxVbtxaA8C5deSIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736571627; a=rsa-sha256; cv=none; b=g1fhaR8WXBBZb+cLWLHO/n/CptSUy0KzEFA7CO1HaG1M93Tkp1NJA7Fi3wVQuAP9xhTL5s +3UX6TLBG1TsEAVcmLEVGAaEn7pOTjMR+gZ3vkvCpbXkAn8eKlQzNx9V92/LFVEUF6Lfej 8C3jNqGGBy3NpQKGz4gJa/qE3aoORmzQbkNg5WQqdBeK6hTl18szWSWGMLO0Ivz6R9cA/E FmdAZc1nsXGMpJ7CiWrvT/5VlENADcDO9+vSa+BOa/I1/89Bolo+3ksLFO+YB161KTyg4m nFrB+bDfhHzGyMvoc2DjCIXhMuk4u9+tagnYc0HlNKjJyqT6fvncwK9TkjLUWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRDC0xj7zksV; Sat, 11 Jan 2025 05:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B50Rsl022508; Sat, 11 Jan 2025 05:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B50R7u022505; Sat, 11 Jan 2025 05:00:27 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:00:27 GMT Message-Id: <202501110500.50B50R7u022505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: bbe6559cf958 - main - netlink: fix size comparison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbe6559cf958a9016cb18ff1833ebd3a884f349f Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=bbe6559cf958a9016cb18ff1833ebd3a884f349f commit bbe6559cf958a9016cb18ff1833ebd3a884f349f Author: Gleb Smirnoff AuthorDate: 2025-01-11 04:57:55 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 04:57:55 +0000 netlink: fix size comparison We want to check the size of the header, not a pointer to it. Reviewed by: melifaro, markj Differential Revision: https://reviews.freebsd.org/D48309 --- sys/netlink/netlink_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index 623531492173..b78ab80ab3c2 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -67,7 +67,8 @@ genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt) return (ENOTSUP); } - if (__predict_false(hdr->nlmsg_len < sizeof(hdr) + GENL_HDRLEN)) { + if (__predict_false(hdr->nlmsg_len < sizeof(struct nlmsghdr) + + GENL_HDRLEN)) { NLP_LOG(LOG_DEBUG, nlp, "invalid message size: %d", hdr->nlmsg_len); return (EINVAL); } From nobody Sat Jan 11 05:00:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRDD5Frkz5lFrn; Sat, 11 Jan 2025 05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRDD27FYz4cMg; Sat, 11 Jan 2025 05: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=1736571628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k4gHc7lBLe+DoHZ3XMj8LyCnWvHqNt+H+ASCk4KQfyg=; b=u7LRBX/3J96Guv3lWGkmt26Fn2AK/1FZ2M443skEOuHJZ+EfCmoSqJr8qXqR05UIF5B7BQ v45iWQERdebWq5eGve0jBG0xD+zi1Zn+6rQdZALr4e0qjyHgt3p/GAfR8ErCQbLCdEkXOL bhNo2Am/uihcvb/y2o/J/XMOJUeYxIYuh0XOjekMCfCxNqFpstOb/rS58TVVS8cmEYyh/U 3AHgwGr22wmFsno8suIrfA5x4nDnTsbYbKYKYWsIg2GZ3h/Ccvwk8aazR028s9gBD6r5dw HGL2dMKZbWrO5wCdVG8Efnn45mOMrZGL3uXWklmd/1yq1MOb3L22dqZvcOL7tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k4gHc7lBLe+DoHZ3XMj8LyCnWvHqNt+H+ASCk4KQfyg=; b=dky7zelC+Rb0MQYlWTYBXkLUOavbQ/MVZGuZV0lm31OyrdKEUsrapsaih0jqA9HM/Avz+M ij/DQWFmuxwdgVIZ1/PcrAjRS66se91NMYmSh0CmJnDmXrhAXo/P+8MPIufDbCXMVqcCIK Bvf3zslskEEgsGzKp49qSFdWfJ1285OSTj2+ViaVBh5xyw9TbDL8WXVbeZwyHn+wUVzdnR CHqIx79fYWbdBAwH7PEDcNFCD2cqSOEjnVcCrNEdz6Rb32O0CNuY37m8DSmyhhoCW6htlT KQGygLcKtzjohzJTQrd62TAvK8HUC8zHHhx9gpi2knHA6tY7z9vAV3WsuYrC9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736571628; a=rsa-sha256; cv=none; b=hsZzzKTquS62qzXErDwsmgSTpLeWtydk/fSdoYu5z0EAjg3RnnDDCmh/nyJrK6pgkzrM+f QDOFnE/dAmnklk5dRPS8ATPNIZl2dOwUMklCRrZeECc7XF+HSi1fn6G3dLdIAe+k0AGv7e N4ehXBGWeAo6rpLDRdEHxjpB3GM7rytNI0MAUiI5MBW5frrhMCdUnKRjkudbe9wwZsEOJf lzyFGOaKIUKQftcEjeWe5OZstQ4TgzmTlYSOGjqa2rIT8DejQ6DkPc1AdJ54zyGUukaHvp a5lutQn3LPy3b7VIdILryi6Np4Nf8rkDfTlD72YsNpvk+fhR4eIrrRKYhSwHRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRDD1gQHzkb4; Sat, 11 Jan 2025 05:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B50SFf022557; Sat, 11 Jan 2025 05:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B50SuK022554; Sat, 11 Jan 2025 05:00:28 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:00:28 GMT Message-Id: <202501110500.50B50SuK022554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 26d1ad5a44e1 - main - netlink: snl_create_genl_msg_request() may fail due to ENOMEM List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26d1ad5a44e17d2d8c48d36755567043349d8b63 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=26d1ad5a44e17d2d8c48d36755567043349d8b63 commit 26d1ad5a44e17d2d8c48d36755567043349d8b63 Author: Gleb Smirnoff AuthorDate: 2025-01-11 04:58:08 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 04:58:08 +0000 netlink: snl_create_genl_msg_request() may fail due to ENOMEM Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48310 --- sys/netlink/netlink_snl_generic.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h index 32b460c612bd..e2dc4d1bfffe 100644 --- a/sys/netlink/netlink_snl_generic.h +++ b/sys/netlink/netlink_snl_generic.h @@ -33,16 +33,24 @@ /* Genetlink helpers */ static inline struct nlmsghdr * -snl_create_genl_msg_request(struct snl_writer *nw, int genl_family, uint8_t genl_cmd) +snl_create_genl_msg_request(struct snl_writer *nw, uint16_t genl_family, + uint8_t genl_cmd) { + struct nlmsghdr *hdr; + struct genlmsghdr *ghdr; + assert(nw->hdr == NULL); - struct nlmsghdr *hdr = snl_reserve_msg_object(nw, struct nlmsghdr); + hdr = snl_reserve_msg_object(nw, struct nlmsghdr); + if (__predict_false(hdr == NULL)) + return (NULL); hdr->nlmsg_type = genl_family; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; - nw->hdr = hdr; - struct genlmsghdr *ghdr = snl_reserve_msg_object(nw, struct genlmsghdr); + ghdr = snl_reserve_msg_object(nw, struct genlmsghdr); + if (__predict_false(ghdr == NULL)) + return (NULL); ghdr->cmd = genl_cmd; + nw->hdr = hdr; return (hdr); } From nobody Sat Jan 11 05:00:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRDF6M50z5lFpX; Sat, 11 Jan 2025 05:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRDF3kn3z4cRv; Sat, 11 Jan 2025 05:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GaaareWv3+XDFqxZPVPoUUtzRvb5byOEWsSR/hNsUZs=; b=cPbUafhPt9Px77Hm8N3Q1YQ+EJvd896UO4lVunVPgg4SWlPx4MZmnXRdtYuPFQTFbuPqq4 GCeCZWoNq5wdIXDKWAzh+wlaxZ7+OL00p3SiSHVrNrdRLJ5N5mQTtpoNg6VuVfWUgxVEp4 3g+FzbRqfrzaYR4Sd4QMrhwRL6sUd5svpn+YHneMbBlImy6jZ7I5dbPHSTRhxsIYud+ipd tGyqMQ5yE2zVB+zUGOvOTMiBHUmw2DpbQbfxWnwiHaVL3fIAyMAMA1Q/W74TZsBLU1loAO lXKt3l6akJV2zYcqWkvI7yRf1WHInrbktZfyeIxyD9GAqT8lxWfWTGrRHhBtvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GaaareWv3+XDFqxZPVPoUUtzRvb5byOEWsSR/hNsUZs=; b=g6wL1tizSqJjRKfNX4j+MgYbFDXS/FNd0ODlHr2YXb1IOwD67zA3kdsev+DirxXNlVkUGy 7WHA5TSUJwgCMhlnnxuib+kTsVP0wG7XAtGSxSzRouwlxQpMI0RruGfizeemx7aVdC/1mG 9SiYYv8OXFSBIZgRIC+/Zat6uo9XdpyhbgzrqU9W3TkmMWNT6Uaw93piRopw8QFOUCz137 F2HiXrqGOWB8FhuQL0vxvH9qGuH664pvYk5UiMMmNla7O2tovn4b5ihhK4reu0+21M71nq 4OJc4ZdBOpgjZ24s6V4EWuCqXj8cN3ANUXyzfrX24vgQF4tHnGfwjuVc3eg2vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736571629; a=rsa-sha256; cv=none; b=PRTelLtOUWv8ZKV2fpnT1hTk7GCdgjyP/2xXZgbeySWP27HNXPIkAzDSCGFZ68T2SPe1Lp 20TChO84n36R/wwJ1V3ozF/4iybY05HDJmyB9wMgDmA5T8k/y/kRL1hg/UGWFVj0YONJZF bwKtABlOhzABN89XcyPhng5DS3hjGFXUChMcKdVzxqWAyKsMKormKrszFUIHlJamggsI40 rMY4mJ3/Iev5EotEXOrDwr8eY08PTJrdl3XQuqnVEwL/9AUY+Wf+xhsfiu+nnH3Bci6e9U 0d2uci0rCMtiPdbtBT/bVOfJYATUQZ8/pR2KD6MxRl09QSKydDuy+aXowVAs9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRDF2nYfzkb5; Sat, 11 Jan 2025 05:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B50Te9022612; Sat, 11 Jan 2025 05:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B50TR3022609; Sat, 11 Jan 2025 05:00:29 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:00:29 GMT Message-Id: <202501110500.50B50TR3022609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 926d2eadcb67 - main - netlink: some refactoring of NETLINK_GENERIC layer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 926d2eadcb671dd26431a1082d4c49c3d5ad7f22 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=926d2eadcb671dd26431a1082d4c49c3d5ad7f22 commit 926d2eadcb671dd26431a1082d4c49c3d5ad7f22 Author: Gleb Smirnoff AuthorDate: 2025-01-11 04:59:29 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 04:59:29 +0000 netlink: some refactoring of NETLINK_GENERIC layer - Statically initialize control family/group. This removes extra startup code and provides a strong guarantee that they reside at the 0 index of the respective arrays. Before a genl_register_family() with a higher SYSINIT order could try to hijack index 0. - Remove the family_id field completely. Now the family ID as well as group ID are array indices and there is basically no place for a mistake. Previous code had a bug where a KPI user could induce an ID mismatch. - Merge netlink_generic_kpi.c to netlink_generic.c. Both files are small and now there is more dependency between the control family and the family allocator. Ok'ed by melifaro@. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48316 --- sys/conf/files | 1 - sys/netlink/netlink_ctl.h | 2 +- sys/netlink/netlink_generic.c | 291 +++++++++++++++++++++++++++++++++++--- sys/netlink/netlink_generic_kpi.c | 276 ------------------------------------ sys/netlink/netlink_var.h | 4 +- 5 files changed, 273 insertions(+), 301 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index fc9108b5e10f..a02174f3d954 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4481,7 +4481,6 @@ netipsec/xform_ipcomp.c optional ipsec inet | ipsec inet6 netipsec/xform_tcp.c optional ipsec inet tcp_signature | \ ipsec inet6 tcp_signature | ipsec_support inet tcp_signature | \ ipsec_support inet6 tcp_signature -netlink/netlink_generic_kpi.c standard netlink/netlink_glue.c standard netlink/netlink_message_parser.c standard netlink/netlink_domain.c optional netlink diff --git a/sys/netlink/netlink_ctl.h b/sys/netlink/netlink_ctl.h index 95b79c763ccd..a23e9a3a948f 100644 --- a/sys/netlink/netlink_ctl.h +++ b/sys/netlink/netlink_ctl.h @@ -92,7 +92,7 @@ struct genl_cmd { uint32_t cmd_num; }; -uint32_t genl_register_family(const char *family_name, size_t hdrsize, +uint16_t genl_register_family(const char *family_name, size_t hdrsize, uint16_t family_version, uint16_t max_attr_idx); bool genl_unregister_family(const char *family_name); bool genl_register_cmds(const char *family_name, const struct genl_cmd *cmds, diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index b78ab80ab3c2..d4c84a34b850 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -119,7 +119,7 @@ dump_family(struct nlmsghdr *hdr, struct genlmsghdr *ghdr, ghdr_new->reserved = 0; nlattr_add_string(nw, CTRL_ATTR_FAMILY_NAME, gf->family_name); - nlattr_add_u16(nw, CTRL_ATTR_FAMILY_ID, gf->family_id); + nlattr_add_u16(nw, CTRL_ATTR_FAMILY_ID, genl_get_family_id(gf)); nlattr_add_u32(nw, CTRL_ATTR_VERSION, gf->family_version); nlattr_add_u32(nw, CTRL_ATTR_HDRSIZE, gf->family_hdrsize); nlattr_add_u32(nw, CTRL_ATTR_MAXATTR, gf->family_attr_max); @@ -173,9 +173,6 @@ enomem: static void nlctrl_notify(void *arg, const struct genl_family *gf, int action); static eventhandler_tag family_event_tag; -static uint32_t ctrl_family_id; -static uint32_t ctrl_group_id; - struct nl_parsed_family { uint32_t family_id; char *family_name; @@ -201,7 +198,7 @@ match_family(const struct genl_family *gf, const struct nl_parsed_family *attrs) { if (gf->family_name == NULL) return (false); - if (attrs->family_id != 0 && attrs->family_id != gf->family_id) + if (attrs->family_id != 0 && attrs->family_id != genl_get_family_id(gf)) return (false); if (attrs->family_name != NULL && strcmp(attrs->family_name, gf->family_name)) return (false); @@ -259,7 +256,7 @@ nlctrl_notify(void *arg __unused, const struct genl_family *gf, int cmd) struct genlmsghdr ghdr = { .cmd = cmd }; struct nl_writer nw; - if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_GENERIC, ctrl_group_id, + if (!nl_writer_group(&nw, NLMSG_SMALL, NETLINK_GENERIC, CTRL_GROUP_ID, 0, false)) { NL_LOG(LOG_DEBUG, "error allocating group writer"); return; @@ -269,27 +266,16 @@ nlctrl_notify(void *arg __unused, const struct genl_family *gf, int cmd) nlmsg_flush(&nw); } -static const struct genl_cmd nlctrl_cmds[] = { - { - .cmd_num = CTRL_CMD_GETFAMILY, - .cmd_name = "GETFAMILY", - .cmd_cb = nlctrl_handle_getfamily, - .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, - }, -}; - static const struct nlhdr_parser *all_parsers[] = { &genl_parser }; static void genl_load_all(void *u __unused) { NL_VERIFY_PARSERS(all_parsers); - ctrl_family_id = genl_register_family(CTRL_FAMILY_NAME, 0, 2, CTRL_ATTR_MAX); - genl_register_cmds(CTRL_FAMILY_NAME, nlctrl_cmds, nitems(nlctrl_cmds)); - ctrl_group_id = genl_register_group(CTRL_FAMILY_NAME, "notify"); - family_event_tag = EVENTHANDLER_REGISTER(genl_family_event, nlctrl_notify, NULL, - EVENTHANDLER_PRI_ANY); - netlink_register_proto(NETLINK_GENERIC, "NETLINK_GENERIC", genl_handle_message); + family_event_tag = EVENTHANDLER_REGISTER(genl_family_event, + nlctrl_notify, NULL, EVENTHANDLER_PRI_ANY); + netlink_register_proto(NETLINK_GENERIC, "NETLINK_GENERIC", + genl_handle_message); } SYSINIT(genl_load_all, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, genl_load_all, NULL); @@ -298,7 +284,268 @@ genl_unload(void *u __unused) { netlink_unregister_proto(NETLINK_GENERIC); EVENTHANDLER_DEREGISTER(genl_family_event, family_event_tag); - genl_unregister_family(CTRL_FAMILY_NAME); NET_EPOCH_WAIT(); } SYSUNINIT(genl_unload, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, genl_unload, NULL); + +/* + * Public KPI for NETLINK_GENERIC families/groups registration logic below. + */ + +static struct sx sx_lock; +SX_SYSINIT(genl_lock, &sx_lock, "genetlink lock"); +#define GENL_LOCK() sx_xlock(&sx_lock) +#define GENL_UNLOCK() sx_xunlock(&sx_lock) +#define GENL_ASSERT_LOCKED() sx_assert(&sx_lock, SA_LOCKED) +#define GENL_ASSERT_XLOCKED() sx_assert(&sx_lock, SA_XLOCKED) + +static struct genl_cmd nlctrl_cmds[] = { + [CTRL_CMD_GETFAMILY] = { + .cmd_num = CTRL_CMD_GETFAMILY, + .cmd_name = "GETFAMILY", + .cmd_cb = nlctrl_handle_getfamily, + .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_DUMP | + GENL_CMD_CAP_HASPOL, + }, +}; + +static struct genl_family families[MAX_FAMILIES] = { + [CTRL_FAMILY_ID] = { + .family_name = CTRL_FAMILY_NAME, + .family_hdrsize = 0, + .family_version = 2, + .family_attr_max = CTRL_ATTR_MAX, + .family_cmd_size = CTRL_CMD_GETFAMILY + 1, + .family_cmds = nlctrl_cmds, + .family_num_groups = 1, + }, +} +; +static struct genl_group groups[MAX_GROUPS] = { + [CTRL_GROUP_ID] = { + .group_family = &families[CTRL_FAMILY_ID], + .group_name = CTRL_GROUP_NAME, + }, +}; + +static struct genl_family * +find_family(const char *family_name) +{ + GENL_ASSERT_LOCKED(); + for (u_int i = 0; i < MAX_FAMILIES; i++) + if (families[i].family_name != NULL && + strcmp(families[i].family_name, family_name) == 0) + return (&families[i]); + + return (NULL); +} + +static struct genl_family * +find_empty_family_id(const char *family_name) +{ + GENL_ASSERT_LOCKED(); + /* Microoptimization: index 0 is reserved for the control family */ + for (u_int i = 1; i < MAX_FAMILIES; i++) + if (families[i].family_name == NULL) + return (&families[i]); + + return (NULL); +} + +uint16_t +genl_register_family(const char *family_name, size_t hdrsize, + uint16_t family_version, uint16_t max_attr_idx) +{ + struct genl_family *gf; + uint16_t family_id; + + GENL_LOCK(); + if (find_family(family_name) != NULL) { + GENL_UNLOCK(); + return (0); + } + + gf = find_empty_family_id(family_name); + KASSERT(gf, ("%s: maximum of %u generic netlink families allocated", + __func__, MAX_FAMILIES)); + + *gf = (struct genl_family) { + .family_name = family_name, + .family_version = family_version, + .family_hdrsize = hdrsize, + .family_attr_max = max_attr_idx, + }; + family_id = genl_get_family_id(gf); + GENL_UNLOCK(); + + NL_LOG(LOG_DEBUG2, "Registered family %s id %d", gf->family_name, + family_id); + EVENTHANDLER_INVOKE(genl_family_event, gf, CTRL_CMD_NEWFAMILY); + + return (family_id); +} + +static void +free_family(struct genl_family *gf) +{ + if (gf->family_cmds != NULL) + free(gf->family_cmds, M_NETLINK); +} + +/* + * unregister groups of a given family + */ +static void +unregister_groups(const struct genl_family *gf) +{ + + for (u_int i = 0; i < MAX_GROUPS; i++) { + struct genl_group *gg = &groups[i]; + if (gg->group_family == gf && gg->group_name != NULL) { + gg->group_family = NULL; + gg->group_name = NULL; + } + } +} + +/* + * Can sleep, I guess + */ +bool +genl_unregister_family(const char *family_name) +{ + bool found = false; + + GENL_LOCK(); + struct genl_family *gf = find_family(family_name); + + if (gf != NULL) { + EVENTHANDLER_INVOKE(genl_family_event, gf, CTRL_CMD_DELFAMILY); + found = true; + unregister_groups(gf); + /* TODO: zero pointer first */ + free_family(gf); + bzero(gf, sizeof(*gf)); + } + GENL_UNLOCK(); + + return (found); +} + +bool +genl_register_cmds(const char *family_name, const struct genl_cmd *cmds, + int count) +{ + struct genl_family *gf; + uint16_t cmd_size; + + GENL_LOCK(); + if ((gf = find_family(family_name)) == NULL) { + GENL_UNLOCK(); + return (false); + } + + cmd_size = gf->family_cmd_size; + + for (u_int i = 0; i < count; i++) { + MPASS(cmds[i].cmd_cb != NULL); + if (cmds[i].cmd_num >= cmd_size) + cmd_size = cmds[i].cmd_num + 1; + } + + if (cmd_size > gf->family_cmd_size) { + void *old_data; + + /* need to realloc */ + size_t sz = cmd_size * sizeof(struct genl_cmd); + void *data = malloc(sz, M_NETLINK, M_WAITOK | M_ZERO); + + memcpy(data, gf->family_cmds, + gf->family_cmd_size * sizeof(struct genl_cmd)); + old_data = gf->family_cmds; + gf->family_cmds = data; + gf->family_cmd_size = cmd_size; + free(old_data, M_NETLINK); + } + + for (u_int i = 0; i < count; i++) { + const struct genl_cmd *cmd = &cmds[i]; + + MPASS(gf->family_cmds[cmd->cmd_num].cmd_cb == NULL); + gf->family_cmds[cmd->cmd_num] = cmds[i]; + NL_LOG(LOG_DEBUG2, "Adding cmd %s(%d) to family %s", + cmd->cmd_name, cmd->cmd_num, gf->family_name); + } + GENL_UNLOCK(); + return (true); +} + +static struct genl_group * +find_group(const struct genl_family *gf, const char *group_name) +{ + for (u_int i = 0; i < MAX_GROUPS; i++) { + struct genl_group *gg = &groups[i]; + if (gg->group_family == gf && + !strcmp(gg->group_name, group_name)) + return (gg); + } + return (NULL); +} + +uint32_t +genl_register_group(const char *family_name, const char *group_name) +{ + struct genl_family *gf; + uint32_t group_id = 0; + + MPASS(family_name != NULL); + MPASS(group_name != NULL); + + GENL_LOCK(); + if ((gf = find_family(family_name)) == NULL || + find_group(gf, group_name) != NULL) { + GENL_UNLOCK(); + return (0); + } + + /* Microoptimization: index 0 is reserved for the control family */ + for (u_int i = 1; i < MAX_GROUPS; i++) { + struct genl_group *gg = &groups[i]; + if (gg->group_family == NULL) { + gf->family_num_groups++; + gg->group_family = gf; + gg->group_name = group_name; + group_id = i + MIN_GROUP_NUM; + break; + } + } + GENL_UNLOCK(); + + return (group_id); +} + +/* accessors */ +struct genl_family * +genl_get_family(uint16_t family_id) +{ + return ((family_id < MAX_FAMILIES) ? &families[family_id] : NULL); +} + +const char * +genl_get_family_name(const struct genl_family *gf) +{ + return (gf->family_name); +} + +uint16_t +genl_get_family_id(const struct genl_family *gf) +{ + MPASS(gf >= &families[0] && gf < &families[MAX_FAMILIES]); + return ((uint16_t)(gf - &families[0]) + GENL_MIN_ID); +} + +struct genl_group * +genl_get_group(uint32_t group_id) +{ + return ((group_id < MAX_GROUPS) ? &groups[group_id] : NULL); +} diff --git a/sys/netlink/netlink_generic_kpi.c b/sys/netlink/netlink_generic_kpi.c deleted file mode 100644 index e6125ab893d8..000000000000 --- a/sys/netlink/netlink_generic_kpi.c +++ /dev/null @@ -1,276 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define DEBUG_MOD_NAME nl_generic_kpi -#define DEBUG_MAX_LEVEL LOG_DEBUG3 -#include -_DECLARE_DEBUG(LOG_INFO); - - -/* - * NETLINK_GENERIC families/groups registration logic - */ - -#define GENL_LOCK() sx_xlock(&sx_lock) -#define GENL_UNLOCK() sx_xunlock(&sx_lock) -static struct sx sx_lock; -SX_SYSINIT(genl_lock, &sx_lock, "genetlink lock"); - -static struct genl_family families[MAX_FAMILIES]; -static struct genl_group groups[MAX_GROUPS]; - -static struct genl_family * -find_family(const char *family_name) -{ - for (int i = 0; i < MAX_FAMILIES; i++) { - struct genl_family *gf = &families[i]; - if (gf->family_name != NULL && !strcmp(gf->family_name, family_name)) - return (gf); - } - - return (NULL); -} - -static struct genl_family * -find_empty_family_id(const char *family_name) -{ - struct genl_family *gf = NULL; - - if (!strcmp(family_name, CTRL_FAMILY_NAME)) { - gf = &families[0]; - gf->family_id = GENL_MIN_ID; - } else { - /* Index 0 is reserved for the control family */ - for (int i = 1; i < MAX_FAMILIES; i++) { - gf = &families[i]; - if (gf->family_name == NULL) { - gf->family_id = GENL_MIN_ID + i; - break; - } - } - } - - return (gf); -} - -uint32_t -genl_register_family(const char *family_name, size_t hdrsize, - uint16_t family_version, uint16_t max_attr_idx) -{ - - MPASS(family_name != NULL); - if (find_family(family_name) != NULL) - return (0); - - GENL_LOCK(); - - struct genl_family *gf = find_empty_family_id(family_name); - MPASS(gf != NULL); - - gf->family_name = family_name; - gf->family_version = family_version; - gf->family_hdrsize = hdrsize; - gf->family_attr_max = max_attr_idx; - NL_LOG(LOG_DEBUG2, "Registered family %s id %d", gf->family_name, - gf->family_id); - EVENTHANDLER_INVOKE(genl_family_event, gf, CTRL_CMD_NEWFAMILY); - - GENL_UNLOCK(); - - return (gf->family_id); -} - -static void -free_family(struct genl_family *gf) -{ - if (gf->family_cmds != NULL) - free(gf->family_cmds, M_NETLINK); -} - -/* - * unregister groups of a given family - */ -static void -unregister_groups(const struct genl_family *gf) -{ - - for (int i = 0; i < MAX_GROUPS; i++) { - struct genl_group *gg = &groups[i]; - if (gg->group_family == gf && gg->group_name != NULL) { - gg->group_family = NULL; - gg->group_name = NULL; - } - } -} - -/* - * Can sleep, I guess - */ -bool -genl_unregister_family(const char *family_name) -{ - bool found = false; - - GENL_LOCK(); - struct genl_family *gf = find_family(family_name); - - if (gf != NULL) { - EVENTHANDLER_INVOKE(genl_family_event, gf, CTRL_CMD_DELFAMILY); - found = true; - unregister_groups(gf); - /* TODO: zero pointer first */ - free_family(gf); - bzero(gf, sizeof(*gf)); - } - GENL_UNLOCK(); - - return (found); -} - -bool -genl_register_cmds(const char *family_name, const struct genl_cmd *cmds, int count) -{ - GENL_LOCK(); - struct genl_family *gf = find_family(family_name); - if (gf == NULL) { - GENL_UNLOCK(); - return (false); - } - - int cmd_size = gf->family_cmd_size; - - for (int i = 0; i < count; i++) { - MPASS(cmds[i].cmd_cb != NULL); - if (cmds[i].cmd_num >= cmd_size) - cmd_size = cmds[i].cmd_num + 1; - } - - if (cmd_size > gf->family_cmd_size) { - /* need to realloc */ - size_t sz = cmd_size * sizeof(struct genl_cmd); - void *data = malloc(sz, M_NETLINK, M_WAITOK | M_ZERO); - - memcpy(data, gf->family_cmds, gf->family_cmd_size * sizeof(struct genl_cmd)); - void *old_data = gf->family_cmds; - gf->family_cmds = data; - gf->family_cmd_size = cmd_size; - free(old_data, M_NETLINK); - } - - for (int i = 0; i < count; i++) { - const struct genl_cmd *cmd = &cmds[i]; - MPASS(gf->family_cmds[cmd->cmd_num].cmd_cb == NULL); - gf->family_cmds[cmd->cmd_num] = cmds[i]; - NL_LOG(LOG_DEBUG2, "Adding cmd %s(%d) to family %s", - cmd->cmd_name, cmd->cmd_num, gf->family_name); - } - GENL_UNLOCK(); - return (true); -} - -static struct genl_group * -find_group(const struct genl_family *gf, const char *group_name) -{ - for (int i = 0; i < MAX_GROUPS; i++) { - struct genl_group *gg = &groups[i]; - if (gg->group_family == gf && !strcmp(gg->group_name, group_name)) - return (gg); - } - return (NULL); -} - -uint32_t -genl_register_group(const char *family_name, const char *group_name) -{ - uint32_t group_id = 0; - - MPASS(family_name != NULL); - MPASS(group_name != NULL); - - GENL_LOCK(); - struct genl_family *gf = find_family(family_name); - - if (gf == NULL || find_group(gf, group_name) != NULL) { - GENL_UNLOCK(); - return (0); - } - - for (int i = 0; i < MAX_GROUPS; i++) { - struct genl_group *gg = &groups[i]; - if (gg->group_family == NULL) { - gf->family_num_groups++; - gg->group_family = gf; - gg->group_name = group_name; - group_id = i + MIN_GROUP_NUM; - break; - } - } - GENL_UNLOCK(); - - return (group_id); -} - -/* accessors */ -struct genl_family * -genl_get_family(uint16_t family_id) -{ - return ((family_id < MAX_FAMILIES) ? &families[family_id] : NULL); -} - -const char * -genl_get_family_name(const struct genl_family *gf) -{ - return (gf->family_name); -} - -uint16_t -genl_get_family_id(const struct genl_family *gf) -{ - return (gf->family_id); -} - -struct genl_group * -genl_get_group(uint32_t group_id) -{ - return ((group_id < MAX_GROUPS) ? &groups[group_id] : NULL); -} - diff --git a/sys/netlink/netlink_var.h b/sys/netlink/netlink_var.h index 34cba0b28d27..87b9f5aaaecd 100644 --- a/sys/netlink/netlink_var.h +++ b/sys/netlink/netlink_var.h @@ -147,7 +147,6 @@ void nl_buf_free(struct nl_buf *nb); struct genl_family { const char *family_name; uint16_t family_hdrsize; - uint16_t family_id; uint16_t family_version; uint16_t family_attr_max; uint16_t family_cmd_size; @@ -168,7 +167,10 @@ struct genl_group *genl_get_group(uint32_t group_id); #define MIN_GROUP_NUM 48 +#define CTRL_FAMILY_ID 0 #define CTRL_FAMILY_NAME "nlctrl" +#define CTRL_GROUP_ID 0 +#define CTRL_GROUP_NAME "notify" struct ifnet; struct nl_parsed_link; From nobody Sat Jan 11 05:33:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRyT630vz5lJJR; Sat, 11 Jan 2025 05:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRyT5MPHz4hxw; Sat, 11 Jan 2025 05:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736573617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F5LWh2N2aeahon+DGuNpeeEojO6g5VcCgyOVhQyX6J4=; b=c8HwlFXYup8mGVxA9yoguPlVrFGYOlABttNBTJkF5OHjiEe7DeYQ0uCbqeSDD4TJTaQj16 6HeRqkBU+MdaEpa6GnGhzQEjrwGUxMS8z07YWIf/aW3uIXGEHgTbiXYYmG+B3UbwiYEWJR WAoxYdxloTU6fE2VFniIT+dbarcol0NaIuNrKcC0fjSw80dbxsC5n7xoGmi+GWi/wbCvRF O1VZU1PC8OoyZ1oal6EknNuGc9HtxJGyry0dvJkAs/eUzfHEr+kzeMsCMRTbV8uzB40VXK IFY6zBFUWIfC/NOKTy5quKAjEPKnJG8i1vl/vuD7JGl9e58sM9f+5EKDUayYNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736573617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F5LWh2N2aeahon+DGuNpeeEojO6g5VcCgyOVhQyX6J4=; b=JujJRhz8iRzbq3Sd5XRmscXZ5+vQOi0iYpCyqW8/56KeBqpzBrw+PJR/wjzwHWkxcHBryS P6J4DWX6MWatlEELTs6Es70YFFTg3gLs5zSgOFFKoZZLafWM1LY8+NXqCk5NqrB3uqy7qz ZpWV+mIF/GwYbfaEjF8of2KtrXiTBOFn7o623jQ/mr3SpZ4RaVliDwqgaZM5yAyZ4U7nZ5 ks6XpvK5k3r/9L1U1NSu1gnmSkRrDBgl8qmsYVGWKxhgate54GJtLzGnsPCxNBd3Osw1wb kGjuD5Qi0YOrdpK7BcPKZFOuP0BA5GL5xdVaQ3uHbkR3rqb/ySD2YPkAzRV26Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736573617; a=rsa-sha256; cv=none; b=C5IWJtqidnC86mPQjxT1gOMMVjeENA9kKZUmbI0sBmPcctfZd3BDQ0quKHW1pjWPDs3FFs Ebd1dpTlFBBImGV24GN5IFoxWvtbeCdP8wfgZc5afC2Vm/mWXLjmIVte7tRwY7BG8EsMh2 /rpGJuKJkfzyaHIbuu2PdjhYbq8xJALvcATo7JeYYq6MlO7yb37U5feNSbNzOa/9VUCiDv kd3oNkaXEhkSSOVbuZMKKnwrI+Ysbku7DXVI6i7HVovM0NM88sXA1bg2oRoOvxoWUuE/sG N6EDuS/ErXFh4cpdgMuxO4V9rM7bcusVXpW8fBXrVo0fLZNFdYVrac2bKMnxEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRyT4mcSzlTd; Sat, 11 Jan 2025 05:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B5Xb2k086442; Sat, 11 Jan 2025 05:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B5Xblu086439; Sat, 11 Jan 2025 05:33:37 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:33:37 GMT Message-Id: <202501110533.50B5Xblu086439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 4dc1820a16b9 - main - libbsnmp: avoid division by zero with empty password List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dc1820a16b9b6108e0ff8a0265c08c67fa34146 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4dc1820a16b9b6108e0ff8a0265c08c67fa34146 commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146 Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 05:08:02 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index ab3ac2d18e64..b312a37ed3ed 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1792,7 +1792,7 @@ snmp_discover_engine(char *passwd) if (snmp_client.user.auth_proto == SNMP_AUTH_NOAUTH) return (0); - if (passwd == NULL || + if (passwd == NULL || strlen(passwd) == 0 || snmp_passwd_to_keys(&snmp_client.user, passwd) != SNMP_CODE_OK || snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK) From nobody Sat Jan 11 05:33:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVRyW14wRz5lHqf; Sat, 11 Jan 2025 05:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRyV5WLlz4hhQ; Sat, 11 Jan 2025 05:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736573618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uNQw+Z2P1dJJklzr9cqqHiNQpiuBRjZi6fGLvEPORis=; b=dmnRUatFAwC6vY2F8wpBnijHvvIC9b94Qjx8edQxLvUMZB7PGIMqDvUt1di65rzh1UDgAy ySPmo+lJowD2JVSfu+hDNLkUlD/+2ZDratD9QlClI8yvXHkfoRN2uElAsSeeTXBZMIFV8X rbvDkLHXcWnGxLhriO/KRhBn60kWvJyjZCy69vNMDOk5UN+6a0PJIMlCS62qP/9+rjVPXl i66thMU5vbhwu4s3Xkfqea5SBlQbFFjgM77WDh3zr6acUxiVKvv+lL/vrmnzpLHDdiQf9K 5OI9ZHyW3pzLG4AuiJMI8TzXtA4z5ZtlTQj/ix4QcBM8l8xLkMpFoXLeXPtlJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736573618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uNQw+Z2P1dJJklzr9cqqHiNQpiuBRjZi6fGLvEPORis=; b=Y0ikGfHv4L2IjucvfILnBeTl+stVO/WzqzQvF6Xl63foUytk/esSEUBnGUxJLMqTFL+5TL qn5tFYuUeCSfLZeJRG7XUmhz/sdSfqTR/wgkQRsl+gelk8Ix/gs1qvoUquokcJnLc7UMJx /5Nr6gbgqVX23PZYWqbgukNBsMesYEfu736BMZSlNnW/Mi5AKQQYFR2+IfsJfC96mpF8Ck JQd3Bwe0xaAUW9U2NWrfIPR/gTw0765YKl4nlHTUgNmJuW4m3LGlrORFqSWOd7hl/Q9VLX txClEfDW/XHJBUNTg8KFq7OY1o6t+1KNDJTd+PJhAXt2pupZ+bb+THsIsBfm4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736573618; a=rsa-sha256; cv=none; b=k6NJt/wwEa/C233Vdwdg5Yw4ers+n86/Dn4fCgVXiF5TilvljVmCmuKD+cN1TkIVXc1bIY 32QbSq+e+0VPA3lvhZyvHDmaF2FxABfrIs/K4k0WuahFNodGOzldDI8RPh7Ec0tZNyIgNJ KYm7/ERZnWcaJLL4I4d+dGo4CE/vgfJXMTpqEjfal8PtKgIiw2yI2NqdISgIWY48dUYmUB /igguzSwKsp2VEjhXuEDHyL6RIBgaqqK8KE6u321q1AIMFNdo7jYJyHAWqSx5GpP0Gl6Pn qYAOrB/qx5wNXZhUb+an3ZTq+VSFv4q147uUhXBUI1eyNTsSxdMUo1I0WYotdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVRyV51chzlg8; Sat, 11 Jan 2025 05:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B5XcFD086490; Sat, 11 Jan 2025 05:33:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B5Xcbx086487; Sat, 11 Jan 2025 05:33:38 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:33:38 GMT Message-Id: <202501110533.50B5Xcbx086487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3999a860d6e8 - main - libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3999a860d6e899de98b1025317d2d0ef1f83255f Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3999a860d6e899de98b1025317d2d0ef1f83255f commit 3999a860d6e899de98b1025317d2d0ef1f83255f Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 05:08:02 +0000 libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password The removed check left snmptoolctx->passwd pointer to uninitialized memory. Always calling strlcpy(3) would guarantee that with empty password it will point to empty string. Submitted by: markj PR: 283909 --- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index a9d44cee4364..fb09e1ac785e 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -178,8 +178,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) warn("malloc() failed"); return (-1); } - if (slen > 0) - strlcpy(snmptoolctx->passwd, str, slen + 1); + strlcpy(snmptoolctx->passwd, str, slen + 1); } return (0); From nobody Sat Jan 11 08:40:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVX5Z57fYz5jqmJ; Sat, 11 Jan 2025 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVX5Z4bdDz40yq; Sat, 11 Jan 2025 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736584802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FTYg8psPUAQCmlHeXWjFS4/Q7HwqPPUmccT37++aQs=; b=egfJsL9nJMF5ZfOyrjMgGgNKAOzNKJkaSfCMxM5y3ET70nRNycmPsL1KYMcgeN7fqXkNZ7 w+n6GNw4mrrhYrXLUJTwrssHHFAqTqgh9RD7Hh1ZolAqk/aeW+neMMRRmyMGeLR9Olu34E C1vUhmyE/9sDhEVatfZGBUrk3zo+UQnBWWTa7bayq5DPO9zLSnq44Bk14vB97R0fix3uT6 Xzs4vzm2YLEVX9b8m4TxvvLnR/zGbvLcMRBpOJNzRHT4hqUfrY0e1RjVNihHaJAbYFSUP0 C3kxJ85dCbGMpHqrkj4sieByCexg5sOfu0hJAXan976wuFabDUHj0+trFtuVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736584802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FTYg8psPUAQCmlHeXWjFS4/Q7HwqPPUmccT37++aQs=; b=v3p/0NHxpw5zNEGUnmINO1jC71556kQ9/awIlNx6GOWoWKIRrmyge8ooxbX6AtKgxm7yKk wtPJkQf+JMv2yrfena/7YLnc52G6Z9Vfs0IpFiXvKNOEgXXF4br1j4G1af0gSNW5ETXQb9 bWxAvJf6n7/1TxlnNnTuTORBPcSPlEEDGlT+Thcl/+G3jNFXs5C9+ImTo7qZpGRQ/vp7oH HuxKOIo5/5P/NvHU0f9JOLmbR/9LHYPJb8CZ4JSCHh3GXV7Ko2pom9EOR0r/+zmWLqSwiP 8N2np0KBWGXyEkEScel0O88Ir2mMwP2q49dBYDu5aDT9vYQtBvY5DBk/Kef1Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736584802; a=rsa-sha256; cv=none; b=F2VZv1F/eMG5B9bV4oYgxnom4UpTQs1qezOuXjah5d+xgoTcUW3JU+8Mg6pkdx9lZQARGB Bj3MRQfM64xn/NRuvcob/+9DDjsYJoiCn3IG8HqrnLrjC/HVoMQO1xw/g2v0oiSOMix2jS GuGmrDX50iN8gPuydfsFjAXp+0wuiRHeX251rpo4iTCRL0YMu3Xom77elYagln6JvqCHLA +fFtgnWVNssuazawwpRbpMwea6gbjUrSjcID8hPrmLtCqe2crSq/C+J/vz9y7KSLXqxLNg epYdKtcIJITxRQa0EHmjtSXD6+ZXjdkpbWVfbIoVoBvquq8CE73Una88g+sAjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVX5Z47xhzrjY; Sat, 11 Jan 2025 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B8e2jL026031; Sat, 11 Jan 2025 08:40:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B8e2f4026026; Sat, 11 Jan 2025 08:40:02 GMT (envelope-from git) Date: Sat, 11 Jan 2025 08:40:02 GMT Message-Id: <202501110840.50B8e2f4026026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 3ce003c8b615 - main - netlink: restore the ability to delete PINNED routes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ce003c8b6151f7764b7934de11c789d6b84ee5c Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=3ce003c8b6151f7764b7934de11c789d6b84ee5c commit 3ce003c8b6151f7764b7934de11c789d6b84ee5c Author: Andrey V. Elsukov AuthorDate: 2025-01-11 08:25:50 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-11 08:25:50 +0000 netlink: restore the ability to delete PINNED routes route(8) had such ability before migration to netlink. To be able to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px() when userland uses RTF_PINNED flag with RTM_DELETE command. This is hackish way for route(8) tool, that third-party software usually doesn't use. PR: 279988 Tested by: franco at opnsense org Discussed with: glebius MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D46301 --- sys/netlink/route/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index e90debee46da..79ecd066aa72 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -1012,7 +1012,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, - attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); + attrs.rtm_dst_len, path_match_func, &attrs, + (attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc); if (error == 0) report_operation(attrs.rta_table, &rc, nlp, hdr); return (error); From nobody Sat Jan 11 09:31:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVYFL3qN6z5jwG8; Sat, 11 Jan 2025 09:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVYFL3Lszz44Zy; Sat, 11 Jan 2025 09:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736587910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XHlWCWNGoEpdfFrvTVht/q8BZsk9l3x3VHz8BQxQs2E=; b=rkltRRo5B3LDs8CGhFpvMmp3abxWgVdE6Z3a+JybSboV1E8lyJnkIN5KBhuX/ZMPTbegxM DEyGz3vnVy8igBN5G8kEJGKaqex4YoEW/Dy0W8zQExf45pKia5NjgIyM/gUSqq87ubkfD4 tLNTacRXDIpXS/nlYW4sEheAM5r5V71Jy8lNxHCrWpr4RIb15OjXpYsBmW5uVyHGfPwzVQ 1sAgSYyP0r3Km/s4oBJ5WovoHTDQCoaBeBsQ/004TfzYs3+SuZTfnaIMDVBBvR3HdZzxWf MzG2GGazDGNhLlwZpcq6K6NRlKp8lwSfgB3ivs4gMmd+gDstREEgH+XtfECl/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736587910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XHlWCWNGoEpdfFrvTVht/q8BZsk9l3x3VHz8BQxQs2E=; b=TsN4vT/bZzYxzu6Da6hen077Y4od9USr3JoPrjRIeIQvZTaetjztDPVxuHRmYOwwKnqNIk QJNOHIl0qwZzxY388PIXVmGEPbAibfhw3yJOykbNMwS/X0LuiDIpdrTMWMQ6dBI7EdEK45 kZApzsS87G/f69/+YekdUlahL9RZUqITA50Dwx44rZFpBLs8SsVv3hlGz0ESt9RPyBOJVp UMYUHURzWO+cSuxG9nVTV/d0GYB6/xNb9T0SP+dvtUKrbfECDdSFXpnF8WJA+YvaThHgfe gIlqGrVr3plIKO20ahve/dRAfO4+FFiYZ+t0/jG8se0ZZOzs6slId8xVahrVDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736587910; a=rsa-sha256; cv=none; b=RRI+Jykll9q/UhHtBM0ULQlk4KYpUS2wj6y3ompP9doHKCBQGccg5YmHevU/18RF21gIMc cj6Qy8rdvzdjKM2BBOMRmexkrgoAPlob4Dvj9+fleZ/OZcvq3PTh8h3SRd+ZrltQzash2m 0WebFD6l2g9kiopnA6NP9NQHTwSB6UggaGS1i6isfAnSjFoYzhD4Nr1Dz8twWH3/fQVeI2 EI3UgO+7WFZCAqvrDwDAph3xaYkBMW4cBrx0D+/k2F1v5hDXKZCVfsJY6rN2DgPeY6lWQz ExWu77XDZSGXVwSOX7W4MhAC7rDgSOowNNsMJhZREfEORVyU4oqMv6+P8Fi91w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVYFL2tcWzs8N; Sat, 11 Jan 2025 09:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B9VoaN030996; Sat, 11 Jan 2025 09:31:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B9VnMc030993; Sat, 11 Jan 2025 09:31:49 GMT (envelope-from git) Date: Sat, 11 Jan 2025 09:31:49 GMT Message-Id: <202501110931.50B9VnMc030993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: dd21556857e8 - main - zfs: merge openzfs/zfs@b8e09c700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd21556857e8d40f66bf5ad54754d9d52669ebf7 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=dd21556857e8d40f66bf5ad54754d9d52669ebf7 commit dd21556857e8d40f66bf5ad54754d9d52669ebf7 Merge: 3ce003c8b615 b8e09c7007a0 Author: Martin Matuska AuthorDate: 2025-01-11 09:00:12 +0000 Commit: Martin Matuska CommitDate: 2025-01-11 09:13:41 +0000 zfs: merge openzfs/zfs@b8e09c700 Notable upstream pull request merges: #16851 19a04e5ad BRT: Check bv_mos_entries in brt_entry_lookup() #16854 6c9b4f18d Fix DR_OVERRIDDEN use-after-free race in dbuf_sync_leaf #16855 fbea92432 flush: don't report flush error when disabling flush support #16862 ecc0970e3 backtrace: fix off-by-one on string output #16864 939e0237c Too many vdev probe errors should suspend pool #16868 ff6266ee9 Fix use-afer-free regression in RAIDZ expansion #16871 acda137d8 simd_stat: fix undefined CONFIG_KERNEL_MODE_NEON error on armel #16877 219a89cbb Skip iterating over snapshots for share properties #16881 ab7cbbe78 zprop: fix value help for ZPOOL_PROP_CAPACITY #16883 f00a57a78 zfs_main: fix alignment on props usage output #16887 -multiple userprops: make clearing pool & vdev userprops work the same #16888 c37a2ddaa microzap: set hard upper limit of 1M #16890 1acd24696 Fix readonly check for vdev user properties #16901 9dd5fe109 zvol: implement platform-independent part of block cloning #16909 54126fdb5 set zfs_arc_shrinker_limit to 0 by default #16912 25238baad Add missing zfs_exit() when snapdir is disabled #16918 478b09577 zfs_vnops_os.c: fallocate is valid but not supported on FreeBSD #16921 c02e1cf05 vdev_open: clear async remove flag after reopen #16923 dc0324bfa fix: make zfs_strerror really thread-safe and portable Obtained from: OpenZFS OpenZFS commit: b8e09c7007a0733a497aebe734cb8ed23a0415ae .../.github/workflows/scripts/qemu-2-start.sh | 27 +- .../.github/workflows/scripts/qemu-3-deps.sh | 2 +- sys/contrib/openzfs/.github/workflows/zfs-qemu.yml | 34 ++- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 32 +-- .../openzfs/config/kernel-pin-user-pages.m4 | 33 +++ sys/contrib/openzfs/config/kernel-vfs-direct_IO.m4 | 57 ----- sys/contrib/openzfs/config/kernel-vfs-iov_iter.m4 | 72 ++---- sys/contrib/openzfs/config/kernel-xattr-handler.m4 | 1 - sys/contrib/openzfs/config/kernel.m4 | 9 +- sys/contrib/openzfs/config/user.m4 | 2 +- sys/contrib/openzfs/config/zfs-build.m4 | 4 +- .../etc/systemd/system/zfs-mount.service.in | 7 + sys/contrib/openzfs/include/libzutil.h | 15 +- sys/contrib/openzfs/include/os/linux/spl/sys/uio.h | 17 +- sys/contrib/openzfs/include/sys/zvol_impl.h | 5 + sys/contrib/openzfs/lib/libspl/backtrace.c | 2 +- sys/contrib/openzfs/lib/libspl/include/sys/uio.h | 3 +- sys/contrib/openzfs/lib/libzfs/libzfs_changelist.c | 16 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 3 +- sys/contrib/openzfs/man/man4/zfs.4 | 4 +- sys/contrib/openzfs/module/Makefile.in | 2 + .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 15 -- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 +- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 4 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 5 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 245 ++++++------------ .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 7 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 52 +--- sys/contrib/openzfs/module/zcommon/simd_stat.c | 2 + sys/contrib/openzfs/module/zcommon/zpool_prop.c | 2 +- sys/contrib/openzfs/module/zfs/brt.c | 3 + sys/contrib/openzfs/module/zfs/dbuf.c | 3 +- sys/contrib/openzfs/module/zfs/spa.c | 39 ++- sys/contrib/openzfs/module/zfs/vdev.c | 3 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 4 +- sys/contrib/openzfs/module/zfs/zap_micro.c | 18 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 2 +- sys/contrib/openzfs/module/zfs/zio.c | 11 +- sys/contrib/openzfs/module/zfs/zvol.c | 284 ++++++++++++++++++++- sys/contrib/openzfs/rpm/generic/zfs-kmod.spec.in | 4 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 4 +- sys/contrib/openzfs/scripts/Makefile.am | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 10 +- sys/contrib/openzfs/tests/runfiles/linux.run | 4 +- .../openzfs/tests/zfs-tests/include/blkdev.shlib | 19 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 3 +- .../cli_root/zfs_mount/zfs_mount_all_fail.ksh | 14 +- .../zpool_add/zpool_add--allow-ashift-mismatch.ksh | 0 .../cli_root/zpool_import/zpool_import_status.ksh | 7 +- .../zpool_set/zpool_set_clear_userprop.ksh | 44 ++++ .../cli_root/zpool_set/zpool_set_common.kshlib | 40 ++- .../functional/fault/suspend_on_probe_errors.ksh | 154 +++++++++++ .../zfs-tests/tests/functional/mount/cleanup.ksh | 4 +- .../zfs-tests/tests/functional/pam/cleanup.ksh | 2 +- .../pool_checkpoint/checkpoint_discard_busy.ksh | 9 +- .../functional/raidz/raidz_expand_001_pos.ksh | 6 +- .../functional/raidz/raidz_expand_002_pos.ksh | 6 +- .../functional/raidz/raidz_expand_003_neg.ksh | 2 +- .../functional/raidz/raidz_expand_003_pos.ksh | 4 +- .../functional/raidz/raidz_expand_004_pos.ksh | 4 +- .../functional/raidz/raidz_expand_005_pos.ksh | 4 +- .../functional/redacted_send/redacted_panic.ksh | 2 +- .../functional/redundancy/redundancy_draid.ksh | 6 +- .../redundancy/redundancy_draid_damaged1.ksh | 6 +- .../redundancy/redundancy_draid_damaged2.ksh | 6 +- .../functional/redundancy/redundancy_raidz.ksh | 6 +- 66 files changed, 920 insertions(+), 500 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-pin-user-pages.m4 index 000000000000,fe7aff375208..fe7aff375208 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-pin-user-pages.m4 +++ b/sys/contrib/openzfs/config/kernel-pin-user-pages.m4 diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_clear_userprop.ksh index 000000000000,d9395ea8a15b..d9395ea8a15b mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_clear_userprop.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_clear_userprop.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh index 000000000000,d9261bb5d274..d9261bb5d274 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/suspend_on_probe_errors.ksh From nobody Sat Jan 11 09:41:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVYSV3FF7z5jwsT; Sat, 11 Jan 2025 09:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVYSV2WkNz461s; Sat, 11 Jan 2025 09:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736588490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mT1bWHmqDhCgxRhqjnTkE2G0wmKLXIwB9xs3lAR3qoU=; b=Pv3HhjCeM2Sd6QBH5KE6dULlBanSj3wKL+92nEKNaSSrKoga8Mtl0MdSNvi2ZhDOuTW/iZ VtY4viiTGJZIcL8rZmtV39Rjfmw7JOUg11LUKH216n2fhm31bK6otuTFJKLicXUxO4nYTv gHZztKWXc2pAZ1HR6NZ4vh1DRWUQeJij25bRWP0ncGNK9zU7pU+kCsdyzTcpcr03hZ68Y0 0J3axyncBWnaUT9EJkSc3itqT0p6LI/aLl6aovOGdLvwERiCyJfdXTGlMdJ0oHUiXp1zCq eUouMDDf32s7ukNzziXwZCSZ7yvp2jVmVzPZrXlMH6t0pn9YIiMYoNkodDq/9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736588490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mT1bWHmqDhCgxRhqjnTkE2G0wmKLXIwB9xs3lAR3qoU=; b=QHmFJqDVYkMR57sqTy5rRTemiM7a8GierRi5T24I4vwiACZEgZBW68B2RZeyTRLIMMvtxm mwrEZ2FG+/cwTUb+PwLReV2PUwox3yN6pilgD2UBrJojf3r1dQuc8KO4cuZBjmSqdAPBDN E2Bc8sRoST9UlMR4xPKdD9QMXZUD6slfA8GgdkjZh0skcBN06VOaAJOnRvmdsCKFYZ+XMy av77nGpLdPy6jNPSOtdlihmI2MdlkIco0FZ75Fp1Zd8clgovHD4QCnfBGsk1KXmcuL7bLT 0Qt4emllakIM22YqbxakuA4t6EsDhy06VgMYVmf0FxSThYDfRIIphflVFItr9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736588490; a=rsa-sha256; cv=none; b=gmR2v0i4bd4zzmKpQ9b1AlV86w9tCRsavJeoMF5kctYSdY+rj/Dx0Hen7ACQUweAWH6aHJ 8UKO1p/9mp9SAQoAnMP0Qmg/OY5eLurFAv4RAJWQeh7JhBWamQObn8U/sD7OPiv/aWLuGd PoqP66xwz4TPOneS5rZkWkWMzlXwVvZq5qqY+NU3YpQ2wHGCgncZC2G9Vu6LWfv27A7slT SA1V6PgPfQR81yBfLpzVJFsXQpSfet0fJyAlTSBJ/KViHZJz5b3cKex+Qj7bzWvao3eMUA qTNkP8K8e1qc46zIzjOECqY4VCdOsdIca1ESVR1oxHXNviRGBOYtlXy7ch3chQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVYSV271pzskD; Sat, 11 Jan 2025 09:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B9fUOs047516; Sat, 11 Jan 2025 09:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B9fULI047513; Sat, 11 Jan 2025 09:41:30 GMT (envelope-from git) Date: Sat, 11 Jan 2025 09:41:30 GMT Message-Id: <202501110941.50B9fULI047513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 6bfe9a1393dd - main - zfs: update configs after merging openzfs/zfs@b8e09c700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6bfe9a1393ddcc4c41c8bf0ef8a5c4ef43eaebd4 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=6bfe9a1393ddcc4c41c8bf0ef8a5c4ef43eaebd4 commit 6bfe9a1393ddcc4c41c8bf0ef8a5c4ef43eaebd4 Author: Martin Matuska AuthorDate: 2025-01-11 09:38:14 +0000 Commit: Martin Matuska CommitDate: 2025-01-11 09:38:14 +0000 zfs: update configs after merging openzfs/zfs@b8e09c700 --- sys/modules/zfs/zfs_config.h | 37 ++++++++++++++++--------------------- sys/modules/zfs/zfs_gitrev.h | 2 +- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index b1f7a1128ca3..3f8def5ce6f8 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -210,7 +210,14 @@ /* Define if revalidate_disk() in block_device_operations */ /* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ -/* check_disk_change() exists */ +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + /* #undef HAVE_CHECK_DISK_CHANGE */ /* copy_splice_read exists */ @@ -394,12 +401,6 @@ /* iops->symlink() takes struct user_namespace* */ /* #undef HAVE_IOPS_SYMLINK_USERNS */ -/* iov_iter_get_pages() is available */ -/* #undef HAVE_IOV_ITER_GET_PAGES */ - -/* iov_iter_get_pages2() is available */ -/* #undef HAVE_IOV_ITER_GET_PAGES2 */ - /* iov_iter_type() is available */ /* #undef HAVE_IOV_ITER_TYPE */ @@ -409,6 +410,9 @@ /* iter_iov() is available */ /* #undef HAVE_ITER_IOV */ +/* iter_is_ubuf() is available */ +/* #undef HAVE_ITER_IS_UBUF */ + /* kernel has kernel_fpu_* functions */ /* #undef HAVE_KERNEL_FPU */ @@ -505,6 +509,9 @@ /* Define if host toolchain supports PCLMULQDQ */ #define HAVE_PCLMULQDQ 1 +/* pin_user_pages_unlocked() is available */ +/* #undef HAVE_PIN_USER_PAGES_UNLOCKED */ + /* proc_handler ctl_table arg is const */ /* #undef HAVE_PROC_HANDLER_CTL_TABLE_CONST */ @@ -600,9 +607,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 -/* Define to 1 if you have the 'strerror_l' function. */ -#define HAVE_STRERROR_L 1 - /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 @@ -672,21 +676,12 @@ /* fops->dedupe_file_range() is available */ /* #undef HAVE_VFS_DEDUPE_FILE_RANGE */ -/* aops->direct_IO() uses iov_iter without rw */ -/* #undef HAVE_VFS_DIRECT_IO_ITER */ - -/* aops->direct_IO() uses iov_iter with offset */ -/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ - /* filemap_dirty_folio exists */ /* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ /* generic_copy_file_range() is available */ /* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */ -/* All required iov_iter interfaces are available */ -/* #undef HAVE_VFS_IOV_ITER */ - /* migrate_folio exists */ /* #undef HAVE_VFS_MIGRATE_FOLIO */ @@ -792,7 +787,7 @@ /* #undef ZFS_DEVICE_MINOR */ /* Define the project alias string. */ -#define ZFS_META_ALIAS "zfs-2.3.99-114-FreeBSD_ge0039c705" +#define ZFS_META_ALIAS "zfs-2.3.99-157-FreeBSD_gb8e09c700" /* Define the project author. */ #define ZFS_META_AUTHOR "OpenZFS" @@ -822,7 +817,7 @@ #define ZFS_META_NAME "zfs" /* Define the project release. */ -#define ZFS_META_RELEASE "114-FreeBSD_ge0039c705" +#define ZFS_META_RELEASE "157-FreeBSD_gb8e09c700" /* Define the project version. */ #define ZFS_META_VERSION "2.3.99" diff --git a/sys/modules/zfs/zfs_gitrev.h b/sys/modules/zfs/zfs_gitrev.h index 5466d277b985..7cfe3689e608 100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/sys/modules/zfs/zfs_gitrev.h @@ -1 +1 @@ -#define ZFS_META_GITREV "zfs-2.3.99-114-ge0039c705" +#define ZFS_META_GITREV "zfs-2.3.99-157-gb8e09c700" From nobody Sat Jan 11 09:51:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVYgY4fLZz5jx2M; Sat, 11 Jan 2025 09:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVYgY4RqYz46mY; Sat, 11 Jan 2025 09:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736589065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZG/akeZUtuRC8BxsbA2nDLW007Xf4CPaNFc8xpq8hY=; b=GoGPCzNbAGiIuyAa8EdrgOEP1Xl0dGtOjgdJiQDQvaby0eErPTBOl9VnSsOBimm6+qIvIM 1tSyoaStZqyPUq75sxMxDYbOJL0TgCKVtucSAk2+BQ5jXkVXghkKSx+0HZ/OnCxAxw8jd4 86LJNzhKEaOTkmRWPMsvFpW7SVjHJmOedaASt7KKh8nQAOjSbOOZV3PYHu3FZzYjIqSD79 3XJXBn8MCRrt64IqN0y1CmJ29O6yWWABVKnRtQdXfMIMqMJT3InKkbcL/+X3+zvBrZ0Erp WD5b8XtMfDC3F8vFMInbJWJPEynFFIqAbwBubVGMXL+ST+6brP0fV4R80sGX9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736589065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZG/akeZUtuRC8BxsbA2nDLW007Xf4CPaNFc8xpq8hY=; b=ClYsXG7zmDfxl8eQLsnz6snfwKRK7zHUJddgkEke8rwt6AV6WwgxzWntzQpL/g7aUSiFED c68FsxKToO2+FG2Lg7zxsmnypyhUTG8IFb0TWSnZJK28NzeTmOknirLnueaX7VWJMDM9DE m3lpFNZRCLeY567IvNeMbW+KMJeHRo0ZJO6RI3NZx6R8IP9+IBAB9SLtC61j2xpgoBnpWJ vLTXYh2fSwwTBzAmXt8jIzITXZ3p6Q/TQJxla2sqrsMdwHut0oC47+8/mnAghXFnqH0phx WAwIlO9ycXY4QQZzF/Ngv8dAVDOsTV+0kjrp+caZc17BLCMnaWUDeulqsO9b8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736589065; a=rsa-sha256; cv=none; b=wL/YuSLG1gVVgttT9pforY+Lgh6xvfieehbYHdVHHlj8mBdgKOPOQiJl3V2VJEhWduhVbf 3vZShxB+SIhK2OJJlgaibfLoDIkad0ud+dMQV0OzwR8drfy0DG5eAEaslkyUW5yNp0Ectt F1XuSIsC9nKJwf+YP8PR3dFOK+9W0YJwmAN4xA2EIOyRoMK2mn9RdjMcV7Nj1whxCzo+jj k79StomEUfWKPU1MCFu3Gsp8WktKQNg18mqdk5ZyYvcBO9Cr2Tp+w8B+iBhF5xthaEUYYF lMIucDPm0G2AEwfveR9YKTcVKug3jPliiASLVOxDd1MvY8BzQPRUU2PBhpyufA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVYgY42qrztFx; Sat, 11 Jan 2025 09:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B9p5nX067870; Sat, 11 Jan 2025 09:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B9p5hF067864; Sat, 11 Jan 2025 09:51:05 GMT (envelope-from git) Date: Sat, 11 Jan 2025 09:51:05 GMT Message-Id: <202501110951.50B9p5hF067864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 9d6043f980a2 - main - zfs: merge openzfs/zfs@fae4c664a List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d6043f980a2ee424976c71c437888c9095f8142 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9d6043f980a2ee424976c71c437888c9095f8142 commit 9d6043f980a2ee424976c71c437888c9095f8142 Merge: 6bfe9a1393dd fae4c664a4a6 Author: Martin Matuska AuthorDate: 2025-01-11 09:42:32 +0000 Commit: Martin Matuska CommitDate: 2025-01-11 09:45:30 +0000 zfs: merge openzfs/zfs@fae4c664a Notable upstream pull request merges: #16942 fae4c664a FreeBSD: Use ashift in vdev_check_boot_reserve() Obtained from: OpenZFS OpenZFS commit: fae4c664a4a67f51d13520ab432d96315d880af8 sys/contrib/openzfs/module/os/freebsd/zfs/vdev_label_os.c | 2 +- sys/modules/zfs/zfs_config.h | 4 ++-- sys/modules/zfs/zfs_gitrev.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --cc sys/modules/zfs/zfs_config.h index 3f8def5ce6f8,000000000000..afd68fc026d4 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,826 -1,0 +1,826 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* __assign_str() has one arg */ +/* #undef HAVE_1ARG_ASSIGN_STR */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* backtrace() is available */ +/* #undef HAVE_BACKTRACE */ + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_file_open_by_path() exists */ +/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_nr_bytes() is available */ +/* #undef HAVE_BDEV_NR_BYTES */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* __blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ + +/* blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() exists */ +/* #undef HAVE_BLKDEV_PUT */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* struct queue_limits has a features field */ +/* #undef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_disk() exists and takes 2 args */ +/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue hardware context is cached in struct request */ +/* #undef HAVE_BLK_MQ_RQ_HCTX */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* backing_dev_info is available through queue gendisk */ +/* #undef HAVE_BLK_QUEUE_DISK_BDI */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* 3-arg dequeue_signal() takes a type argument */ +/* #undef HAVE_DEQUEUE_SIGNAL_3ARG_TYPE */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the 'execvpe' function. */ +#define HAVE_EXECVPE 1 + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* file->f_version exists */ +/* #undef HAVE_FILE_F_VERSION */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* GENHD_FL_EXT_DEVT flag is available */ +/* #undef HAVE_GENHD_FL_EXT_DEVT */ + +/* GENHD_FL_NO_PART flag is available */ +/* #undef HAVE_GENHD_FL_NO_PART */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the 'gettid' function. */ +/* #undef HAVE_GETTID */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* iter_is_ubuf() is available */ +/* #undef HAVE_ITER_IS_UBUF */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel defines intptr_t */ +/* #undef HAVE_KERNEL_INTPTR_T */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* kernel has kmap_local_page */ +/* #undef HAVE_KMAP_LOCAL_PAGE */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [unwind] */ +/* #undef HAVE_LIBUNWIND */ + +/* libunwind has unw_get_elf_filename */ +/* #undef HAVE_LIBUNWIND_ELF */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* building against unsupported kernel version */ +/* #undef HAVE_LINUX_EXPERIMENTAL */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Define to 1 if you have the 'mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* PG_error flag is available */ +/* #undef HAVE_MM_PAGE_FLAG_ERROR */ + +/* page_mapping() is available */ +/* #undef HAVE_MM_PAGE_MAPPING */ + +/* page_size() is available */ +/* #undef HAVE_MM_PAGE_SIZE */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* pin_user_pages_unlocked() is available */ +/* #undef HAVE_PIN_USER_PAGES_UNLOCKED */ + +/* proc_handler ctl_table arg is const */ +/* #undef HAVE_PROC_HANDLER_CTL_TABLE_CONST */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_sz exists */ +/* #undef HAVE_REGISTER_SYSCTL_SZ */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the 'strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the 'strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* have super_block s_shrink */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK */ + +/* have super_block s_shrink pointer */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK_PTR */ + +/* sync_blockdev() is declared in include/blkdev.h */ +/* #undef HAVE_SYNC_BLOCKDEV */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has mnt_idmap */ +/* #undef HAVE_TMPFILE_IDMAP */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the 'udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->setattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_SETATTR */ + +/* fops->clone_file_range() is available */ +/* #undef HAVE_VFS_CLONE_FILE_RANGE */ + +/* fops->dedupe_file_range() is available */ +/* #undef HAVE_VFS_DEDUPE_FILE_RANGE */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* generic_copy_file_range() is available */ +/* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */ + +/* migrate_folio exists */ +/* #undef HAVE_VFS_MIGRATE_FOLIO */ + +/* address_space_operations->readpages exists */ +/* #undef HAVE_VFS_READPAGES */ + +/* read_folio exists */ +/* #undef HAVE_VFS_READ_FOLIO */ + +/* fops->remap_file_range() is available */ +/* #undef HAVE_VFS_REMAP_FILE_RANGE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* splice_copy_file_range() is available */ +/* #undef HAVE_VFS_SPLICE_COPY_FILE_RANGE */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* int (*writepage_t)() takes struct folio* */ +/* #undef HAVE_WRITEPAGE_T_FOLIO */ + +/* xattr_handler->get() wants dentry and inode and flags */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE_FLAGS */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() takes mnt_idmap */ +/* #undef HAVE_XATTR_SET_IDMAP */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if host toolchain supports XSAVE */ +#define HAVE_XSAVE 1 + +/* Define if host toolchain supports XSAVEOPT */ +#define HAVE_XSAVEOPT 1 + +/* Define if host toolchain supports XSAVES */ +#define HAVE_XSAVES 1 + +/* ZERO_PAGE() is GPL-only */ +/* #undef HAVE_ZERO_PAGE_GPL_ONLY */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* using complete_and_exit() instead */ +/* #undef SPL_KTHREAD_COMPLETE_AND_EXIT */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* pde_data() is PDE_DATA() */ +/* #undef SPL_PDE_DATA */ + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* Version number of package */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.3.99-157-FreeBSD_gb8e09c700" ++#define ZFS_META_ALIAS "zfs-2.3.99-158-FreeBSD_gfae4c664a" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "6.12" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "4.18" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "157-FreeBSD_gb8e09c700" ++#define ZFS_META_RELEASE "158-FreeBSD_gfae4c664a" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.3.99" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ diff --cc sys/modules/zfs/zfs_gitrev.h index 7cfe3689e608,000000000000..990e0f51e04f mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/sys/modules/zfs/zfs_gitrev.h @@@ -1,1 -1,0 +1,1 @@@ - #define ZFS_META_GITREV "zfs-2.3.99-157-gb8e09c700" ++#define ZFS_META_GITREV "zfs-2.3.99-158-gfae4c664a" From nobody Sat Jan 11 13:45:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVftT671Vz5kJhD; Sat, 11 Jan 2025 13:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVftT5FzVz4ShG; Sat, 11 Jan 2025 13:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736603153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+vo/oF04IzJITtcs3/Kf/UUNQ+yYXitEI6sRx8M4wbk=; b=nxJMH/zmQU/Gl9u/x4EVnEX50IWhuVhH7C5SkPNH/6o2LEWld7wj21B3WlfYRaJfpSowS7 fNQqJ8L5pUSh1M9JRLQw5d9fiVvjan5a6xt4fMK2ZpRinC/f08602lnTeE7BM7qkkuLxP2 S+QyAqZHcNepmgeT/x7du1KYBUHvVCai5Aawb8Go6pKlwrtA4MHA/62dmlz0xDq7F5W2oR NWzgfUx521ibueU4l2a0ND8Aptu8XnPHi1AUv/ylKhaNcyAZhyrKK1Pf6ocAB4pOLrbGrH /2V/Cg39KT1fiwgbn/Cq4z/oQUCmm8t1Ce0MZzi5c4UKqoykCHH3eve79EovjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736603153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+vo/oF04IzJITtcs3/Kf/UUNQ+yYXitEI6sRx8M4wbk=; b=hP/gr/76NXB+1udqY6gQTCt1j1nohyl1i0tv0ySbODvtqVWupThMmN9TB0jd1/uWo65kU9 0YQI7BWbLZfYXE7Xl1SmvV4cTxDWj3ZOi5x1/Y9KMW7pASVI9Qr6akmglo/r4VKzA4wxhl Ov22FKB912tBq+b+5mY3PRjd2VcdUgBnmnOHvBy0FyZ6r6tEjFVE47Uzx1kJKx35RS7KmV 6g8sCDhpOrjDK4zGgQ6jBvvvg0DSgnOgBTcajXan+/eLdEfty9KMwdQvMU+vZ4TMRqpXG8 lUZm3jPALM80GUKLu2h1/5MHNfYvmGPLmytwqwY09VfHBHeuDN3lVzZ0xRMa0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736603153; a=rsa-sha256; cv=none; b=KxznpO5Zsyn7p0cz94jdNWmIecs0SGGrq9JiNoBq65yVizaDt9oktjEIrzdONaUUl44fX5 z78m8Y1q4Eug8igyuGtL3VWjZxUUfXfv4KIs1WYYpxJe86XTGQ4zXcphP7VayBhFappL3V Dk+oje9CKHSNIM01x5HMh+uCRpWux3vthOJ2KBBS02RhiL0SDlhGelJ81ZElQAqEMjUz0R eO97VR18KbF3TeNAZblq26eGGhPQooxnuuBUmJLUYnkWBagAy5Mb4sGmoRZSx3OwBT83a2 maJIPhNAwnphDKHXJBjDnZmq4oe6nOwZbzMm3N+EBMdXW2mvUnijVdhesy89Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVftT4T2pz11bZ; Sat, 11 Jan 2025 13:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50BDjrVI004809; Sat, 11 Jan 2025 13:45:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50BDjrmu004806; Sat, 11 Jan 2025 13:45:53 GMT (envelope-from git) Date: Sat, 11 Jan 2025 13:45:53 GMT Message-Id: <202501111345.50BDjrmu004806@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: 6eae413a2545 - main - build: Check NO_ROOT and METALOG for more targets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6eae413a25450c99a5d91d443569c3c1a51b4a4d Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6eae413a25450c99a5d91d443569c3c1a51b4a4d commit 6eae413a25450c99a5d91d443569c3c1a51b4a4d Author: Ed Maste AuthorDate: 2024-12-31 14:47:33 +0000 Commit: Ed Maste CommitDate: 2025-01-11 13:44:53 +0000 build: Check NO_ROOT and METALOG for more targets In f6575ed0deb08 I added a check that DISTDIR is set and is not / for `make distributeworld`. Extend the check to `distributekernel` and the two package* targets as the same argument applies. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48339 --- Makefile.inc1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index fe799218ab0a..c8e6e63d2e39 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1000,13 +1000,18 @@ INSTALLFLAGS+= -h sha256 IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" .endif -.if make(distributeworld) + +.if make(distributeworld) || make(packageworld) || make(distributekernel) || \ + make(packagekernel) .if ${DISTDIR:U/} == / -.error DISTDIR must be set for make distributeworld and may not be the root directory. +.error DISTDIR must be set for make distribute* and make package*, and may not be the root directory. .endif .if !defined(NO_ROOT) || !defined(METALOG) -.error NO_ROOT and METALOG must be set for make distributeworld. +.error NO_ROOT and METALOG must be set for make distribute* and make package*. +.endif .endif + +.if make(distributeworld) CERTCTLDESTDIR= ${DESTDIR}/${DISTDIR} CERTCTLFLAGS+= -d /base .else From nobody Sat Jan 11 15:59:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVjrF4h6Hz5kW15; Sat, 11 Jan 2025 15:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVjrF49p8z4j7D; Sat, 11 Jan 2025 15:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736611149; h=from:from:reply-to:subject: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=OkZMwRPHiiuAzjFfeoHAqRRc9d2wZRSu5JMjDvmqLOs=; b=iW3bWPZ6kPMZo581IUHw78Wp4wuMyqRO9CQGkbp33Ye9jGMtAqgYCUTdE91XrKN208GxYn 9376udmKpT6qN2PIUsNE8+8Awtx9Jj/vxrMkr2t6J1aNtWEksYddX+FXfzQUO9rBtWl9x/ yeGC3Mx9x5l548+J+jZT9/TEQQC0POqLg2yDQIWStEC6i4pUN8ElyGv4qZBkLPYpth2HHy FhffbPAhRti8ZcV78lGZrsBaubSClkpmYtf40qz/P91ZwMPiZ6blodoClNyAibxGIw86K7 tAYFboYkcsOFFXmXjXw4l2xldjOk8+EYgW9I04N6jrcbbKCzg14htxxWUf6QrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736611149; h=from:from:reply-to:subject: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=OkZMwRPHiiuAzjFfeoHAqRRc9d2wZRSu5JMjDvmqLOs=; b=tNhPMjEewbvoRnB+bID02XJi+z96VFCYhn/2jZQvELF3RMPGvMrPZL9KHFSsNB2ts1WpwW jZb+koG5GODhl/EDVDZIFn1VO+0498J2DxPgS293mDn50uBB/2AuHQbiDReF7qEBjKzBgB vrTo8Wr0bSKwMNx8FA+7+WVahPUSDtQq5OZL4cLFXni+D7AqYRavdwPVTGHdvgGrCati/K ZxAptVOGyNg7IVygKFypO2UHGBL34UBpwDIxlflNCmjde5LMoys1AabREaJtgqOdhZihKi WxqZzD5NdH0cD/GquKijtiDCI6ecEdLowtKMnFaCuWFJ6qv/+4NbwxtCZ8k+QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736611149; a=rsa-sha256; cv=none; b=dP5pTn/RUfU7UfZDO4X5Zu3puC7twilK3ivLSKQSECTZnx25QYDSWgZfhXjxz8trv8gL0t x5FjFfF6EUvwWGQFYiMc8hZxO8qkQLlPLOX9ki6mKIDQK0D2JTH81SAfD4snANxOKgXx8z yJXKnXF3HA1D0C7A1LqPSd6GcDmt9RX/olvCjzsACKf9DDBzSeDqgt4Xoj2jpK6o8lsRSZ +dHWdeemJRkrM2Jcy+4ScjpPLuUWvzqpyKkeBnFd8LFdk9Zeuy+qeceDsBtVVDOI7qEC/g n57b9Cb83xrY0nSSisafm0pGMe9MRf0RKcIbfKJbY1u/J5lQuLASDO1k3eqCLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4200:b830:1cab:36b6:e060:c22d] (unknown [IPv6:2601:5c0:4200:b830:1cab:36b6:e060:c22d]) (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 4YVjrF2S5yz9Tt; Sat, 11 Jan 2025 15:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Sat, 11 Jan 2025 10:59:08 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl Content-Language: en-US To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/10/25 11:00, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6b82130e6c9add4a8892ca897df5a0ec04663ea2 > > commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > Author: Mark Johnston > AuthorDate: 2025-01-10 15:37:07 +0000 > Commit: Mark Johnston > CommitDate: 2025-01-10 15:42:59 +0000 > > clock: Add a long ticks variable, ticksl > > For compatibility with Linux, it's useful to have a tick counter of > width sizeof(long), but our tick counter is an int. Currently the > linuxkpi tries paper over this difference, but this cannot really be > done reliably, so it's desirable to have a wider tick counter. This > change introduces ticksl, keeping the existing ticks variable. > > Follow a suggestion from kib to avoid having to maintain two separate > counters and to avoid converting existing code to use ticksl: change > hardclock() to update ticksl instead of ticks, and then use assembler > directives to make ticks and ticksl overlap such that loading ticks > gives the bottom 32 bits. This makes it possible to use ticksl in the > linuxkpi without having to convert any native code, and without making > hardclock() more complicated or expensive. Then, the linuxkpi can be > modified to use ticksl instead of ticks. > > Reviewed by: olce, kib, emaste > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D48383 > --- > sys/conf/files | 1 + > sys/kern/kern_clock.c | 26 ++++++++++++++------------ > sys/kern/kern_tc.c | 4 ++-- > sys/kern/subr_param.c | 2 +- > sys/kern/subr_ticks.s | 44 ++++++++++++++++++++++++++++++++++++++++++++ > sys/sys/kernel.h | 9 +++++++++ > sys/sys/timetc.h | 2 +- > 7 files changed, 72 insertions(+), 16 deletions(-) > > diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c > index 19169ba63061..f4359efec466 100644 > --- a/sys/kern/subr_param.c > +++ b/sys/kern/subr_param.c > @@ -197,7 +197,7 @@ init_param1(void) > * Arrange for ticks to wrap 10 minutes after boot to help catch > * sign problems sooner. > */ > - ticks = INT_MAX - (hz * 10 * 60); > + ticksl = INT_MAX - (hz * 10 * 60); > > vn_lock_pair_pause_max = hz / 100; > if (vn_lock_pair_pause_max == 0) Did you consider using LONG_MAX here instead of INT_MAX? That would make both values roll over 10 minutes after boot so that sign problems can be tested for both counters. -- John Baldwin From nobody Sat Jan 11 16:33:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVkbl4GJZz5kYWG; Sat, 11 Jan 2025 16:33:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVkbl254dz4mvC; Sat, 11 Jan 2025 16:33:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-4678cce3d60so28375861cf.2; Sat, 11 Jan 2025 08:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736613202; x=1737218002; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=mujOKdsJHyDEu1K8cgwqTIlLgSUKXKAjedHLPitMd74=; b=OuBHKrQZiBWxdqZD+4l+vRjzeOqTVvPXAecUSQOHGQgtecoYj3g/YfbLPzMz8kJL0Q mT9l7U4oe5jTtifgr5NAxlHyOZDpx5PHL2sRITapGeejkucVPU8rR/vTxIJgu+p+Ndpo /p4Wns0qzZVqwNaHQNLtY5uye3BJkJGoi4JgZehYhfyBkve5Jkz6QB5/i9uOQ2V0Vr1Q sU6VAtDf4jHpIuYcj0Gv/U8UMmx5cQ4/gt8utZ1Rhj9PzGqs1KHokv51lQg/vBEnR3Wp Pnrusgewo6uJxeRGYAV2e45iRcJOT1yBzYYWRC3hqiM2+pAYO3rEEucV/Y4BM05/l/kf wDnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736613202; x=1737218002; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mujOKdsJHyDEu1K8cgwqTIlLgSUKXKAjedHLPitMd74=; b=efzcyKjyA7Cboo+xy/VXiE6qokYwNNh3KbjrTHR0eCTjKq8pL0w+hIJ1fuJ5A4N80l KdSPxoFlL4t22zzJiv8jvRRJp7xHgEteVLFKzlb2jXd39PCWgFmh39YBq8WYHvlQfYzA y4fvl9Thk42sFL6OYQsVALQ/blT8DsAPNavfQ8KV3cQVlAsCPZijq0cwyKyIyNiuXPM4 R5irKljoUQ3xwQ/AC9fDykdebimR1iSW57rb1d49lRi8m/uL4OiV7ooaDzYreVuzpg0/ v95zkvjnB7nfwuYkp1toAjy7pcIHuLnNXopI1+yh2cEIAhDgqsPeuptN8sVTI6YIK1KQ bOXA== X-Forwarded-Encrypted: i=1; AJvYcCVe7UC9EyB3U63ga18y0BHo4hkKLFtkkEy1cD48P6C56oNHX+9iFYPg9ygorb25wujQtplQtTxXylRgyXnoJ8XQ7bmo@freebsd.org, AJvYcCVxGnadM5W7D4keI3AgvSx3P+MJqYwU8OhW899fF60srQNQd+AbgPAXmOzfsqLtIQG/tU53GqIq6IwMracMY6PygrxkV0M=@freebsd.org X-Gm-Message-State: AOJu0YysqskstKryAFtZAC76y5W0YCatS85HWTt80RQLKBtwJUxb6AIT 1Lr6dqYSdD5RxJEyd9ExZ/ekBDZNd4HCOzzxaVhJvnr43e/EOgU6AhwAPA== X-Gm-Gg: ASbGncvHj1PcfkHPOmDRiDK8PKKAmbSeRfR8MmMmsm+UXwqh7yUFAF79SFY7YL7sHZt oRzBURD8SwUkRF7BaQFpNXSUrWht+dIYiC6gixjhBrTzF9CSxpD+jApYZnH2+t6H1L8kZygKBe4 QS8tSzatBGubYWmknTMUgpHbmu3AVk6iuvbh6eZ3eWw6AJOEBuQFZp4qm+rwmm2ERf+LJ3fPy5E dMEAlroD3z11+DZWakNHClp/bfN75tVNWQzaqtI0cDpKahDTD9ccbhy7y4KeTLs2ZwFTxA= X-Google-Smtp-Source: AGHT+IEv7TNgE//S23YGUpe3MDjjkusyup/LNkYPCKtu/pxILlQvZBvwGg8bNxoHMxduToQ+wYYuTw== X-Received: by 2002:a05:6214:449f:b0:6d8:9677:fbe4 with SMTP id 6a1803df08f44-6df9b1f6f51mr269717116d6.9.1736613201779; Sat, 11 Jan 2025 08:33:21 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dfade89e0csm21163626d6.104.2025.01.11.08.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 08:33:20 -0800 (PST) Date: Sat, 11 Jan 2025 11:33:18 -0500 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl Message-ID: References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4YVkbl254dz4mvC X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sat, Jan 11, 2025 at 10:59:08AM -0500, John Baldwin wrote: > On 1/10/25 11:00, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=6b82130e6c9add4a8892ca897df5a0ec04663ea2 > > > > commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > > Author: Mark Johnston > > AuthorDate: 2025-01-10 15:37:07 +0000 > > Commit: Mark Johnston > > CommitDate: 2025-01-10 15:42:59 +0000 > > > > clock: Add a long ticks variable, ticksl > > For compatibility with Linux, it's useful to have a tick counter of > > width sizeof(long), but our tick counter is an int. Currently the > > linuxkpi tries paper over this difference, but this cannot really be > > done reliably, so it's desirable to have a wider tick counter. This > > change introduces ticksl, keeping the existing ticks variable. > > Follow a suggestion from kib to avoid having to maintain two separate > > counters and to avoid converting existing code to use ticksl: change > > hardclock() to update ticksl instead of ticks, and then use assembler > > directives to make ticks and ticksl overlap such that loading ticks > > gives the bottom 32 bits. This makes it possible to use ticksl in the > > linuxkpi without having to convert any native code, and without making > > hardclock() more complicated or expensive. Then, the linuxkpi can be > > modified to use ticksl instead of ticks. > > Reviewed by: olce, kib, emaste > > MFC after: 1 month > > Differential Revision: https://reviews.freebsd.org/D48383 > > --- > > sys/conf/files | 1 + > > sys/kern/kern_clock.c | 26 ++++++++++++++------------ > > sys/kern/kern_tc.c | 4 ++-- > > sys/kern/subr_param.c | 2 +- > > sys/kern/subr_ticks.s | 44 ++++++++++++++++++++++++++++++++++++++++++++ > > sys/sys/kernel.h | 9 +++++++++ > > sys/sys/timetc.h | 2 +- > > 7 files changed, 72 insertions(+), 16 deletions(-) > > > > diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c > > index 19169ba63061..f4359efec466 100644 > > --- a/sys/kern/subr_param.c > > +++ b/sys/kern/subr_param.c > > @@ -197,7 +197,7 @@ init_param1(void) > > * Arrange for ticks to wrap 10 minutes after boot to help catch > > * sign problems sooner. > > */ > > - ticks = INT_MAX - (hz * 10 * 60); > > + ticksl = INT_MAX - (hz * 10 * 60); > > vn_lock_pair_pause_max = hz / 100; > > if (vn_lock_pair_pause_max == 0) > > Did you consider using LONG_MAX here instead of INT_MAX? That would make > both values roll over 10 minutes after boot so that sign problems can be > tested for both counters. Yes, an earlier revision of the diff did that. I changed it because a 64-bit tick counter won't overflow in a reasonable amount of time, and because we still have to worry about overflow of the 32-bit counter since that's what the kernel still uses everywhere. From nobody Sat Jan 11 17:46:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVmD42Z4Fz5kfwZ; Sat, 11 Jan 2025 17:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVmD41d5Xz4vKj; Sat, 11 Jan 2025 17:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736617588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MwoVXGIkJZKzb/vhkscj8Obl5G/PyrF/M28+vPd+BF0=; b=WpUnXmfqt12tqgQARAYAJDchEiYElj/uB9ta4dxJdjXUpIFrBoxsonLdlfi2COEN28qqE+ OxTLo4aygT1kzbcvSh/MSco4H9q3rULoA0PUuCRJlYLYNnuFnKSzfjv9fHQj3SoF7diwen CHvb3fydI0sTXR5kamfJl1bWXyL/kP1QF8/OXqEB/mYHJbO5jB+7Q2TjoOwusfdI+u2F/M JL34jrHpvEDDaOOfmoqSJ0cSrKHhj6Vq2DHM4M7eSMZOR0E6exXS6qBRpVe7MXOvQ8Cmr7 a9Bul6aQ6TrO11KZuNLg3ukovOWZTQYcHa4Welwi2mxrESibWcteYm7cLC7fPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736617588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MwoVXGIkJZKzb/vhkscj8Obl5G/PyrF/M28+vPd+BF0=; b=tafr6IJSos0xsmvG/8mrT2Sk9RcXJd2EMwdsg2wTvdJW1AaeddnGnrYUscjT0fg+yIK0QB J/KdF8igFWCsEVgLT3vOzU50EIi47C9a70qRes6ztjY1DOQqZhwk1WUs5RAqCzNR2sqY6e yYAbZKeI+wGgMOMrixowzwXxs4dUx9qPyWxXKj+RqOd9iNrrZAStj1h1YlbAAOpkRJn1En QljAAyY281b3+/NjWREgNwBmrriG1P+C/VXOvOpFrdycn/tRsDGdBZKRCz1kYRrletc7jj Lg/FdF35zirzLF5WXN0bgWvU1eHRyek3McJYayY4uyehVru0YrVSwl+Q/BtLhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736617588; a=rsa-sha256; cv=none; b=G8xcHLfphiuU72tlAj0VMLw1QlV5fGpTQKuTmr+mf0NxwLl1ekc1cJ+akQbMppLuNNTPBo uozhGrVOudFItOP+0EgMljQJxpF1Feg19V7Ebj0quKfb1uuNEnDUyO7jSOJcEG4T+kGeIR 8WWGgYncIeG4vq5NwUnMHtvrV8MnsKU2cD0UNctaPo4vPMMtOGS7I7mnugc7B4Hgr4iJfO PvoRo4sBqraqKQZwERfrG+1Y58TZSf1/VeqQNvurKbiXasajB5C55EAs9KQy3oNlW3MeB9 ADodJC6s/3bhEvprXOFbasq54I+ZyaS7iBhYkJHXLVYbU7FMT5SOArraxahsVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVmD40vcMz16tj; Sat, 11 Jan 2025 17:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50BHkR5K054430; Sat, 11 Jan 2025 17:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50BHkRTV054427; Sat, 11 Jan 2025 17:46:27 GMT (envelope-from git) Date: Sat, 11 Jan 2025 17:46:27 GMT Message-Id: <202501111746.50BHkRTV054427@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: 159d29d39482 - main - clock: Use .balign to align ticksl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 159d29d3948294cdc9ee4cc3951d004de6797a32 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=159d29d3948294cdc9ee4cc3951d004de6797a32 commit 159d29d3948294cdc9ee4cc3951d004de6797a32 Author: Mark Johnston AuthorDate: 2025-01-11 17:45:57 +0000 Commit: Mark Johnston CommitDate: 2025-01-11 17:45:57 +0000 clock: Use .balign to align ticksl The .align directive has a different behaviour on 32-bit arm than on other platforms. Use .balign instead, which has consistent behaviour on all architectures. Reported by: kib Reviewed by: jrtc27, kib Fixes: 6b82130e6c9a ("clock: Add a long ticks variable, ticksl") Differential Revision: https://reviews.freebsd.org/D48430 --- sys/kern/subr_ticks.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_ticks.S b/sys/kern/subr_ticks.S index 52435b194c4f..ad01d5d67165 100644 --- a/sys/kern/subr_ticks.S +++ b/sys/kern/subr_ticks.S @@ -26,7 +26,7 @@ GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) .global ticksl .type ticksl, %object - .align __SIZEOF_LONG__ + .balign __SIZEOF_LONG__ ticksl: .zero __SIZEOF_LONG__ .size ticksl, __SIZEOF_LONG__ From nobody Sat Jan 11 22:21:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVtKW1nDVz5jtmV; Sat, 11 Jan 2025 22:21:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVtKV5nN7z4RBp; Sat, 11 Jan 2025 22:21:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7b6eeff1fdfso278170285a.2; Sat, 11 Jan 2025 14:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736634092; x=1737238892; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=0h5bZ9lKUABuOTFdJa/9lU1dYLtE7EIgoyNt31GiAwc=; b=E14aBUWaS4f59+/laca2DeuB/Nteoi4HB4dPS9zfzmOJlzwldhOXptTAtkuKao9sfv mclC0F6GtxOAC5F2xMI32SeKjLyUV2eGroD9feoJ1R79K0KNKro8FeUFGeNmsXK7mmWL 788CIbdNpsrlQOFASiACzql2cUHqpsmn+E06mgC36dMfKWd9Bk25ofoZD7p97e2A5cU8 g84RReTAh3lHMNCCD8ChkR5KtbTJrytHW8e0miCJKPthQwT9OmKbnFTb+auZ28UxAOx0 EhfTkt3T2v5awqJnSeL2q6T8rZcc33BwTFiiFu2MPH6TEbdGGf9EB1ASDJvUbosZzcJp 3zYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736634092; x=1737238892; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0h5bZ9lKUABuOTFdJa/9lU1dYLtE7EIgoyNt31GiAwc=; b=pFpLg6UpcaatnSuIDkuBn1eUpCUEupKPwaxXfjU74Kg9qycIuKBWt0m/y0EPbAIklk dSZECrctg0l3L9B9UuBDO+BSOmbDhHna8/aLmt/MppYzmwoYdxr/6jbJKkrGthjUw8g3 /yq1KmAm8eAkpkcjBS3/ZBfJ+TKv/LVVDsiKpgfJPPEDKpcp5cUAbEjhfUcZx1uN4oEh hRj2LVw+dYyCK/97BjVH8OZIXBGyRhRVMvlR4+vGbWuH/kIZMMoU3O3Gw/ofuBlPcHD+ 0/5drBPOIy3xcMd32kOaJwWYWJ387YrGqiYjrX/GhJ8HpXRImCD62z9ieVqi42UEch80 XSMA== X-Forwarded-Encrypted: i=1; AJvYcCUqH30wU2t3Dg/3QfNIFjl4ok8q/IPcLFnw9CZ+sNt0lRxRI+p68+s5THM+PfgvtwcrJnoyYNlyCG/wpziHBkref19p@freebsd.org, AJvYcCWPhleAoEmQG7qRkQA7RHkVTrNvZPFmL/JP9A+9MZGf2P5dl9HSMg+agA9GgFVBZO5JntE4dWvFiWeQicY4FTUiIC5XoX4=@freebsd.org X-Gm-Message-State: AOJu0YyA+JqVjMqL88020mlASe+2Ly8k2SiNqDiknpHHCy8Xw1t70Tsn zrUr3k2zQmpKNeg8MYFEF5kSr1XbbKPNCBv94QowiorY8Ht+J/lwpZaTsw== X-Gm-Gg: ASbGncsluiHjqnN5MXZICBw2bXRB1Dw1lKezIrGeoWG762FE4vgkPa2cZGJRKB+mGY8 E6+89qgoNmDQdkFlkWqzte9ktYK6IX3NoxnEmWPz4XFbgKPL4tWY9wt3MF+mH0Lgdq2ncEwrINd TZaDxwTfhNq0inQgdcQNrd8vEqg+lTanNsRQ+SohdUaPiK80dhQFPgPYlndj3ilgYFXHSmN7fXt zM2F8JSRcfBc6PLiG+1iuDmvrh25FzzgdaneNZpMd9EfEXpoSmeTQBdDOusxduF1RN4Hzg= X-Google-Smtp-Source: AGHT+IEFsNrZqVYLAw8f+QblXaN2DAw006XPus19MXhAa55NjjLgsKfFDuBkX5iVnNCmqr4hQPmp0A== X-Received: by 2002:a05:620a:3913:b0:7b6:7ac5:5def with SMTP id af79cd13be357-7bcd973dc2cmr2380743785a.20.1736634092597; Sat, 11 Jan 2025 14:21:32 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7bce3238003sm325827885a.2.2025.01.11.14.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 14:21:31 -0800 (PST) Date: Sat, 11 Jan 2025 17:21:28 -0500 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 926d2eadcb67 - main - netlink: some refactoring of NETLINK_GENERIC layer Message-ID: References: <202501110500.50B50TR3022609@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501110500.50B50TR3022609@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4YVtKV5nN7z4RBp X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sat, Jan 11, 2025 at 05:00:29AM +0000, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: https://cgit.FreeBSD.org/src/commit/?id=926d2eadcb671dd26431a1082d4c49c3d5ad7f22 > > commit 926d2eadcb671dd26431a1082d4c49c3d5ad7f22 > Author: Gleb Smirnoff > AuthorDate: 2025-01-11 04:59:29 +0000 > Commit: Gleb Smirnoff > CommitDate: 2025-01-11 04:59:29 +0000 > > netlink: some refactoring of NETLINK_GENERIC layer > > - Statically initialize control family/group. This removes extra startup > code and provides a strong guarantee that they reside at the 0 index of > the respective arrays. Before a genl_register_family() with a higher > SYSINIT order could try to hijack index 0. This use of index zero breaks nl_isset_group_locked() and related functions, which subtract one from the index before looking it up in a bitset. The subtraction becomes an underflow, so the bitset operation triggers an OOB memory access. This can be reproduced by running the sys/netlink tests with a KASAN kernel. > - Remove the family_id field completely. Now the family ID as well as > group ID are array indices and there is basically no place for a mistake. > Previous code had a bug where a KPI user could induce an ID mismatch. > > - Merge netlink_generic_kpi.c to netlink_generic.c. Both files are small > and now there is more dependency between the control family and the family > allocator. Ok'ed by melifaro@. > > Reviewed by: melifaro > Differential Revision: https://reviews.freebsd.org/D48316 From nobody Sat Jan 11 22:52:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVv0m25Vpz5jxY6; Sat, 11 Jan 2025 22:52:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVv0m1ZHzz4Xht; Sat, 11 Jan 2025 22:52:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736635928; h=from:from:reply-to:subject: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=upnsuLm6O2HC5qv9G5skywoKrWuzTsAYCBcQWr0GMM0=; b=tLUfRJkoZI/6xdLzoB34NcjUYdzYW9hoWzRjGou97/aFnlhJi3YlY3WVRSf9dIr2DBJAJl VY3Vrc0d2pqE64C/T79EfBh+ekGtDlCSaQl1k0UoekT2Tfkgqco4TdwmfUJCjjCWMwUpfo XAZCJYcYXx7XGSKsb15yoxCxeWu9zbdgPfIzc7dpROk0ebKRvMoQifOx+7qfJKsmT7LJo/ gkNEqQ5+hTxvgOUiPJCxqCe7jv1RgaNs4vdWTQe7ZWqWpMYudoeCqIhP5+MTKTst3ON5zk Xtn6sEFYMCsg3U5zLk3RFHzwgV2AYjUe7y5bMj0qar1wK1XfaB8VpEfbrbTp0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736635928; h=from:from:reply-to:subject: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=upnsuLm6O2HC5qv9G5skywoKrWuzTsAYCBcQWr0GMM0=; b=NYpa5OwTzAStXKOxrzRR3IS1LmDKq2uFYoAqsZbhaiXLEM9YU2re1mpl7M0JMnWg2msFL9 XFQuBpAxna6UYsH0GetKrSdydnmvhEL29lBlCQ10UCNy89V/ecj9W/ZSZH+4r/KLzbkxF1 uQ/hlbmjyH8CGRkBs7x4QB5/H1FFGruuN/vZLjdsb1rHRLyTM/oZPaw3eiT5VcmoWzkXIS CC59C7IHpAMaZFED7CVSuCfnoqIIXrCuXn+or1iuAXrrvk8NpVUbXzkB+6YmtC6jDO/xeS 36mZVKlB2NG6zR0pgJeLUX9zcWGAguRaju7eEy+upDvc0i502aQw9Vu0/rPrVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736635928; a=rsa-sha256; cv=none; b=uPR3ELbsjjWKw0rpoLJT5GcBzWcJU5hY7/gE+Sui3DLxWpPektdhfit9t4hSTTyEr7/m1u aivtTWMOvntV5TZYRsPCIXKeA9EiveorJokxLVreU2l6TFCVo3nocT8PCjKWlN3+z8WNjY lIoYrUaWkUpnm07pMfgElnjRCF43etHsb77djPBqx3LePrtO7vISLtyLJEG+js2hnULvsG 1wHb688Nb0HQ3H+VrRkUIRROb8gFpNeeKEEhleS4Y8k+dSZ37nvZ5u5VKMcoCtUNY7SaY+ UPCxq3DLiYIF5blCIztWqAHke0ZOheLjM2sYJ6I0PI4r7KpVEpmqP7nCt7T2yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [192.168.1.53] (c-73-231-46-254.hsd1.ca.comcast.net [73.231.46.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YVv0l4S0HzJXL; Sat, 11 Jan 2025 22:52:07 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.92.24120731 Date: Sat, 11 Jan 2025 14:52:04 -0800 Subject: Re: 9234a50752cd - main - ng_ksocket: add IPv6 support for address parsing and unparsing From: Ravi Pokala To: Gleb Smirnoff , , , Message-ID: <700C69CF-197C-42A9-A651-F2BCC7EF666F@panasas.com> Thread-Topic: 9234a50752cd - main - ng_ksocket: add IPv6 support for address parsing and unparsing References: <202501102004.50AK4Jo0018399@gitrepo.freebsd.org> In-Reply-To: <202501102004.50AK4Jo0018399@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Hi Gleb, I believe this change breaks LINT-NOINET6 and LINT-NOIP: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> stage 3.1: building everything -------------------------------------------------------------- linking kernel ld: error: undefined symbol: in6_getscope >>> referenced by ng_ksocket.c >>> ng_ksocket.o:(ng_ksocket_sockaddr_parse) ld: error: undefined symbol: in6_getscopezone >>> referenced by ng_ksocket.c >>> ng_ksocket.o:(ng_ksocket_sockaddr_parse) --- kernel --- *** [kernel] Error code 1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Thanks, Ravi (rpokala@0 =EF=BB=BF-----Original Message----- From: > on behalf of Gleb Smirnoff > Date: Friday, January 10, 2025 at 12:04 To: >, >, > Subject: git: 9234a50752cd - main - ng_ksocket: add IPv6 support for addres= s parsing and unparsing The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3D9234a50752cd47887849d4665af0f9= f4abdefb5d commit 9234a50752cd47887849d4665af0f9f4abdefb5d Author: Seyed Pouria Mousavizadeh Tehrani > AuthorDate: 2025-01-10 09:16:18 +0000 Commit: Gleb Smirnoff > CommitDate: 2025-01-10 20:00:58 +0000 ng_ksocket: add IPv6 support for address parsing and unparsing Differential Revision: https://reviews.freebsd.org/D48204 --- share/man/man4/ng_ksocket.4 | 13 +++++-- sys/netgraph/ng_ksocket.c | 94 ++++++++++++++++++++++++++++++++++++++++++--= - 2 files changed, 98 insertions(+), 9 deletions(-) diff --git a/share/man/man4/ng_ksocket.4 b/share/man/man4/ng_ksocket.4 index 1f32d39dc7d0..bb653c3688ad 100644 --- a/share/man/man4/ng_ksocket.4 +++ b/share/man/man4/ng_ksocket.4 @@ -32,7 +32,7 @@ .\" .\" Author: Archie Cobbs > .\" -.Dd January 9, 2012 +.Dd January 9, 2025 .Dt NG_KSOCKET 4 .Os .Sh NAME @@ -183,7 +183,8 @@ in the argument field, the normal equivalent of the C structure is an acceptable form. For the -.Dv PF_INET +.Dv PF_INET , +.Dv PF_INET6 and .Dv PF_LOCAL address families, a more convenient form is also used, which is @@ -191,7 +192,11 @@ the protocol family name, followed by a slash, followe= d by the actual address. For .Dv PF_INET , -the address is an IP address followed by an optional colon and port number= . +the address is an IPv4 address followed by an optional colon and port numb= er. +For +.Dv PF_INET6 , +the address is an IPv6 address enclosed in square brackets followed +by an optional colon and port number. For .Dv PF_LOCAL , the address is the pathname as a doubly quoted string. @@ -202,6 +207,8 @@ Examples: local/"/tmp/foo.socket" .It Dv PF_INET inet/192.168.1.1:1234 +.It Dv PF_INET6 +inet6/[2001::1]:1234 .It Other .Dv "\&{ family=3D16 len=3D16 data=3D[0x70 0x00 0x01 0x23] \&}" .El diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 3e4427f9e387..43a2747224f3 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -58,6 +58,9 @@ #include #include +#include +#include + #include #include #include @@ -66,6 +69,8 @@ #include #include +#include + #ifdef NG_SEPARATE_MALLOC static MALLOC_DEFINE(M_NETGRAPH_KSOCKET, "netgraph_ksock", "netgraph ksock node"); @@ -147,6 +152,19 @@ static const struct ng_ksocket_alias ng_ksocket_protos= [] =3D { { "swipe", IPPROTO_SWIPE, PF_INET }, { "encap", IPPROTO_ENCAP, PF_INET }, { "pim", IPPROTO_PIM, PF_INET }, + { "ip6", IPPROTO_IPV6, PF_INET6 }, + { "raw6", IPPROTO_RAW, PF_INET6 }, + { "icmp6", IPPROTO_ICMPV6, PF_INET6 }, + { "igmp6", IPPROTO_IGMP, PF_INET6 }, + { "tcp6", IPPROTO_TCP, PF_INET6 }, + { "udp6", IPPROTO_UDP, PF_INET6 }, + { "gre6", IPPROTO_GRE, PF_INET6 }, + { "esp6", IPPROTO_ESP, PF_INET6 }, + { "ah6", IPPROTO_AH, PF_INET6 }, + { "swipe6", IPPROTO_SWIPE, PF_INET6 }, + { "encap6", IPPROTO_ENCAP, PF_INET6 }, + { "divert6", IPPROTO_DIVERT, PF_INET6 }, + { "pim6", IPPROTO_PIM, PF_INET6 }, { NULL, -1 }, }; @@ -296,9 +314,58 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *= type, break; } -#if 0 - case PF_INET6: /* XXX implement this someday */ -#endif + case PF_INET6: + { + struct sockaddr_in6 *const sin6 =3D (struct sockaddr_in6 *)sa; + char *eptr; + char addr[INET6_ADDRSTRLEN]; + char ifname[16]; + u_long port; + bool hasifname =3D true; + + /* RFC 3986 Section 3.2.2, Validate IP literal within square brackets. */ + if (s[*off] =3D=3D '[' && (strstr(&s[*off], "]"))) + (*off)++; + else + return (EINVAL); + if ((eptr =3D strstr(&s[*off], "%")) =3D=3D NULL) { + hasifname =3D false; + eptr =3D strstr(&s[*off], "]"); + } + snprintf(addr, eptr - (s + *off) + 1, "%s", &s[*off]); + *off +=3D (eptr - (s + *off)); + if (!inet_pton(AF_INET6, addr, &sin6->sin6_addr)) + return (EINVAL); + + if (hasifname) { + uint16_t scope; + + eptr =3D strstr(&s[*off], "]"); + (*off)++; + snprintf(ifname, eptr - (s + *off) + 1, "%s", &s[*off]); + *off +=3D (eptr - (s + *off)); + + if (sin6->sin6_addr.s6_addr16[0] !=3D IPV6_ADDR_INT16_ULL) + return (EINVAL); + scope =3D in6_getscope(&sin6->sin6_addr); + sin6->sin6_scope_id =3D + in6_getscopezone(ifunit(ifname), scope); + } + + (*off)++; + if (s[*off] =3D=3D ':') { + (*off)++; + port =3D strtoul(s + *off, &eptr, 10); + if (port > 0xffff || eptr =3D=3D s + *off) + return (EINVAL); + *off +=3D (eptr - (s + *off)); + sin6->sin6_port =3D htons(port); + } else + sin6->sin6_port =3D 0; + + sin6->sin6_len =3D sizeof(*sin6); + break; + } default: return (EINVAL); @@ -358,9 +425,24 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type= *type, return(0); } -#if 0 - case PF_INET6: /* XXX implement this someday */ -#endif + case PF_INET6: + { + const struct sockaddr_in6 *sin6 =3D (const struct sockaddr_in6 *)sa; + char addr[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &sin6->sin6_addr, addr, INET6_ADDRSTRLEN); + slen +=3D snprintf(cbuf, cbuflen, "inet6/[%s]", addr); + + if (sin6->sin6_port !=3D 0) { + slen +=3D snprintf(cbuf + strlen(cbuf), + cbuflen - strlen(cbuf), ":%d", + (u_int)ntohs(sin6->sin6_port)); + } + if (slen >=3D cbuflen) + return (ERANGE); + *off +=3D sizeof(*sin6); + return(0); + } default: return (*ng_ksocket_generic_sockaddr_type.supertype->unparse) From nobody Sun Jan 12 11:52:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWDKc3pYtz5kY9R; Sun, 12 Jan 2025 11:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWDKc25Rdz4TyJ; Sun, 12 Jan 2025 11:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736682772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tp1DWxFq7fvM6ysFjtU2baPqSF3TfL8U4IWexVCCBoY=; b=BUaDwhqExqGBzbcFNo0cRQZmJ72SdVOis3oTtrHy0ZGBU02t+bLERAzksMdu8IbycTN6AG 4+2OWhZ2fZynhCMOewDhU1DUGLFj8lkCmPfwA3gNZjyeO5Bu2qZC7LkuqNY9l1girD+iNN XOUF6msrrVQ+ckSk0mLJo0fpwMyJ36byxlD07rI22ePugBpq2Xe3gz8O21kJ2MGfNqzq5N aH0wrkhJr0l95Cq2EEzVVyAV75W0VNZmTOjT/pVyB+c3V11YLhG0f+p4llTg1KUz53WAmS AKR8eMFe1GcM1oQt63wRNHcRnz1Px1JI0UV+FDL6xa5Mre6dosj1d6/TqsB1Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736682772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tp1DWxFq7fvM6ysFjtU2baPqSF3TfL8U4IWexVCCBoY=; b=EnCt145SNDlN4mOZMwkldZEY2TG6S15ckty+6n8Mz5SIgyOqj5fafpNR07xZJ5Gan9MLEY al7iBnG/YO+nVvHYRHnOD5hG7ZzMhfp4hMRVk5Nty+bP35RZXmCfB5b1iqU3o1dqZNA+OU 3fX03I2AcyRNOSvfmzeBpgzEcI5D5kc3AvLvmg0g12bfDJQGvKOSotXqu/Qjl5UN5ga1JF LdyH4eVU3iwR/tHUuwoZ/q/JUvN5r8vo56qbEAUUDss1PLSPnO5nnoGacV+9vbWQRQWzIh O4qb9PeaEIc+0+j4P1GNvF7FrejTlmdDTzfKAy1ho5p/IrGxn2SIUxAW/4a6wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736682772; a=rsa-sha256; cv=none; b=qjU5sHC6XF1XypK4qS7JjJLak9Ej93sxGERV+6zP7Om7DOwFgt2XTp21J0IZovrOHjif7a oldU1JuDBX2ilzU1+xeDa9a0H97kSjU+sKifDmrB2xo3Ci2FRhZMamJooij3nIKO81fl3F moYm0N4bMXCT8tEGQhDwW+ovvF/2yRKN6rXOixm5Avb0dCU9Qv7rBA8YQUQcuANDYoGiJ7 FpnnAZRiBJ1my2e0TMt1AfpqkijPLu7MNQLyMaaEn2+3hPCYwhX6DkSyinuihhHf9AZHby MpMAm+aCCud/goqOtkzc3f7ZxAhTEedY26ocAKiQkf/XufANAP6toKwVlP2UZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWDKc1SNjzkDh; Sun, 12 Jan 2025 11:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CBqqmE087870; Sun, 12 Jan 2025 11:52:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CBqqql087867; Sun, 12 Jan 2025 11:52:52 GMT (envelope-from git) Date: Sun, 12 Jan 2025 11:52:52 GMT Message-Id: <202501121152.50CBqqql087867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bernhard Froehlich Subject: git: d57d6236f9bd - main - fwget: Add needed firmware for Radeon 740M GPU List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: decke X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d57d6236f9bd35ef3106e8d32e3bf9d88e664f3d Auto-Submitted: auto-generated The branch main has been updated by decke: URL: https://cgit.FreeBSD.org/src/commit/?id=d57d6236f9bd35ef3106e8d32e3bf9d88e664f3d commit d57d6236f9bd35ef3106e8d32e3bf9d88e664f3d Author: Bernhard Froehlich AuthorDate: 2025-01-12 11:50:13 +0000 Commit: Bernhard Froehlich CommitDate: 2025-01-12 11:50:13 +0000 fwget: Add needed firmware for Radeon 740M GPU PR: 283750 Approved by: manu MFC after: 4 weeks --- usr.sbin/fwget/pci/pci_video_amd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/fwget/pci/pci_video_amd b/usr.sbin/fwget/pci/pci_video_amd index 7ad41be12d57..98ecd5aaf236 100644 --- a/usr.sbin/fwget/pci/pci_video_amd +++ b/usr.sbin/fwget/pci/pci_video_amd @@ -153,6 +153,13 @@ pci_video_amd() addpkg "gpu-firmware-amd-kmod-sdma-6-0-1" addpkg "gpu-firmware-amd-kmod-vcn-4-0-2" ;; + 0x15c8) + addpkg "gpu-firmware-amd-kmod-dcn-3-1-4" + addpkg "gpu-firmware-amd-kmod-gc-11-0-4" + addpkg "gpu-firmware-amd-kmod-psp-13-0-11" + addpkg "gpu-firmware-amd-kmod-sdma-6-0-1" + addpkg "gpu-firmware-amd-kmod-vcn-4-0-2" + ;; 0x164e) addpkg "gpu-firmware-amd-kmod-gc-10-3-6" addpkg "gpu-firmware-amd-kmod-psp-13-0-5" From nobody Sun Jan 12 12:14:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWDpP6NbQz5kZyH; Sun, 12 Jan 2025 12:14:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWDpP4yNtz4XV6; Sun, 12 Jan 2025 12:14:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736684061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMqwvf+OKBjLuNFyR+6fekqXcTjnqGq5AsozGZFG5dI=; b=YStQLX+qBwK2lCmmTPW7hFSRmUwSfRptjOiLuTYXuBV/EorbnP+hBYln5UFHvbKu2SbgOD 5xOlwMaVZ2r9wTK90B2B0FxQ8JuUkGRxhMeanhUNtbTIVPCWPe6WlJjVD1Tw2/RnjmGPc4 57LPPaxrIjfOXz2xFyF+tq1XmZxi2gdtf2dxu2ANorfgxGVAJsInip0MmzA2AGv0JLdbAS 5IzUZkYJaxxiECUiRoDbXTVI4XxnKSvIfii2o1Cgh+eKLXO7sS/pENOxPbfAQcWhNj++GG OaRHaeVIUiYbuyBMPXpHOr5mHUPnHUuT02FaGT7HingLT0hg8RvaNha+RwGN/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736684061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMqwvf+OKBjLuNFyR+6fekqXcTjnqGq5AsozGZFG5dI=; b=G3Hwwb8YTiXFfEorz4TVXfzgaio1zAn0byQ359z4PM6v49D8rhUxZl8+na4f5gEJhrLCMl a+8PKF3XfnNzAO7Ge7sVejI8LWkLdlHFfi1SNUVZD2fiw02J7OuaULz5/LLDatRritiGmI OVqbZ7uZxQnyNajIRZC0c1jTOAXK5k02mWrh3tCY3GTZY2YwF/SkTO50Aa+vHFkn0w4iu5 k7bdJfRW9V0sV1kzCC1Oan5IpP8Z4YuCPLX36Ve3PmbYzz9ejH5mUbiMuzb2DTjzucPeM1 i9z78sudzEt0z9PBXXOuPeN8tMnTp5p27FHkzQPJHCoTW2Jc3PXB1W+c6OixAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736684061; a=rsa-sha256; cv=none; b=NwfpAxcKsxzTTaY/Ccs53REEU8Q5cfcXGV/b7B9zW0yMmojSLERTRAV4zqZgtgmfbzpAHV adRqseUYsLwSFyWb5fQI8xLR6gBrMnrKtV8hTslY+c6Rl4IZO+56oxyb7R6NOb4xHtiL2b tJPaQjMM/uH5t3NtdCMk4Y4eFOw74otvbMfwZaXIOAwxIaKKZ1cV0gnD3eBDo0EI8nhtbY MXF8/4Di8LhyVPTj7h3TAbbAVZYONr/A2SkS9atPN6yOiW4nAR4gBYg/aMImtL+ko0VemK V5b59FGi1nAM0vaImviWgJ8uzXinDaWOhFXzvRmCSHTy3hPd8AEMNJhyS1P7yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWDpP4SZlzjZN; Sun, 12 Jan 2025 12:14:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CCELAh026710; Sun, 12 Jan 2025 12:14:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CCELGa026707; Sun, 12 Jan 2025 12:14:21 GMT (envelope-from git) Date: Sun, 12 Jan 2025 12:14:21 GMT Message-Id: <202501121214.50CCELGa026707@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: 7aa6eeb220d8 - main - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Cezanne" cpus List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7aa6eeb220d89a3c29eb4f768f258622c3803f46 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7aa6eeb220d89a3c29eb4f768f258622c3803f46 commit 7aa6eeb220d89a3c29eb4f768f258622c3803f46 Author: Simon Wells AuthorDate: 2025-01-12 11:45:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-12 12:14:01 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Cezanne" cpus Tested on AMD 5700G PR: 284009 MFC after: 1 week --- sys/dev/amdsmn/amdsmn.c | 2 +- sys/dev/amdtemp/amdtemp.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 111c3cc8e7c1..9f5c55b1abd6 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -57,7 +57,7 @@ #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 #define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ -#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 +#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 431890dfce20..0c423e0b2502 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -112,7 +112,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 #define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ -#define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 +#define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M40H_ROOT 0x14b5 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 @@ -868,6 +868,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) switch (model) { case 0x00 ... 0x0f: /* Zen3 EPYC "Milan" */ case 0x20 ... 0x2f: /* Zen3 Ryzen "Vermeer" */ + case 0x50 ... 0x5f: /* Zen3 Ryzen "Cezanne" */ maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); break; From nobody Sun Jan 12 12:14:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWDpR0rM1z5kZwY; Sun, 12 Jan 2025 12:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWDpQ60TWz4Xlh; Sun, 12 Jan 2025 12:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736684062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeTKfNsNYngssNtc7kntYN/2QF1eXxrr10Apm7ltuL4=; b=LISWJ+dLKHyqiUTPjmOkK05IwN017rgeE1DT+T+NvAcr/Ud2wgzyoErvmfmwOhpId42we+ fvTtt9hEOTkDUzGM8dTJ6PKrdLXp15aAItdTIzVOLNAmP3KTYAWgy0MX34AgEoy/gfjTwZ ry3MZwkG23ExKaG8DO/AeObWFc6nDvoAqpYM1K4m7h3LmUM1ACbIk/x5G+5oj1sKdmb0W5 iAr6hgS5JWEzXu7UsJSetjIg88426lrH9H9/XjBRjWovcJYHjLKWJb7H4lkbLAirjrDqXV 4llaQyCKbZ4I90o1pJh/etehpTmSFuWuyBQEYLQcE42dIts4ugvEBFMOc8JRrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736684062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YeTKfNsNYngssNtc7kntYN/2QF1eXxrr10Apm7ltuL4=; b=mDApgEqenXL8/4lklsqM/LiSsXwtoZKT4S7b6h2d32JgB2zuaxxdaH04wjWKS9X2GGLYUr ECuL7mwq3xTJEnZephwekllZsyXmjuw1Z+Ex62DLTSQaX6KK7ecR22qTnCre2lxRUoAZeh ntmaQ5e1q7X88y3fsMLbv6x+niib5uY6e9PgsUi9cujHhafARAFO8HM8vYd8HPdF7g+Mv5 HOyJvp8usBYVao/2QOI4GQfeh2uwiOAvNsyjDR/wlijQO+lWYChBJxHspQGW/ABXC0YKej MhrjnuYaaYAIEAw7cSn/r4VV24Z09QG2dEnl0/Y+xZHqA56vl/zP4BRRrl8eRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736684062; a=rsa-sha256; cv=none; b=P85/fhdKs4QETK2XlSvR4+XQ7R7TA/8nIGV0nPTYmRn1ilP8joscbgGLFbLLx1IweohENl Flc7fwjoQAZKhQc86gevYM8WsZ/hOiiELocDGfb0UgbS1wXHO75328iYvLDfoNkrOsXoma 1IPLdmcuvlQ1Np0vp1H6LgdNgR8p8xIBILszIa14th/ICCjG10k+vSG2lDtNEh3wgJsEkq iPEQjk1zow3Oa7rF8v3vHCSSeiRxY+4IIVS97dWnGrZcekdbZCaleECvpDCJUOjFqmjy6/ vtQprh+Z6rDpVg1Deq9MPwxVPUvD8jOXzCdMd8wQXo8liUivjFmg61jTSNkerA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWDpQ5SkFzkvr; Sun, 12 Jan 2025 12:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CCEMJB026758; Sun, 12 Jan 2025 12:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CCEMHl026755; Sun, 12 Jan 2025 12:14:22 GMT (envelope-from git) Date: Sun, 12 Jan 2025 12:14:22 GMT Message-Id: <202501121214.50CCEMHl026755@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: a9a71513ccfc - main - amdsmn(4), amdtemp(4): add support for Zen 5 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9a71513ccfcb38346c84b006b43d45511d1652c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a9a71513ccfcb38346c84b006b43d45511d1652c commit a9a71513ccfcb38346c84b006b43d45511d1652c Author: Simon Wells AuthorDate: 2025-01-12 11:46:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-12 12:14:01 +0000 amdsmn(4), amdtemp(4): add support for Zen 5 Zen 5 support, tested on Ryzen 7 9700X PR: 284010 MFC after: 1 week --- sys/dev/amdsmn/amdsmn.c | 3 ++- sys/dev/amdtemp/amdtemp.c | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 9f5c55b1abd6..1fc93a68fbf3 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -60,7 +60,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5 -#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 /* Also F1AH M40H */ #define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; @@ -211,6 +211,7 @@ amdsmn_probe(device_t dev) case 0x15: case 0x17: case 0x19: + case 0x1a: break; default: return (ENXIO); diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 0c423e0b2502..b609c0944499 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -115,7 +115,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M40H_ROOT 0x14b5 -#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 /* Also F1AH M40H */ #define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { @@ -230,6 +230,7 @@ static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); static void amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model); static void amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model); +static void amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -317,6 +318,7 @@ amdtemp_probe(device_t dev) case 0x16: case 0x17: case 0x19: + case 0x1a: break; default: return (ENXIO); @@ -476,6 +478,7 @@ amdtemp_attach(device_t dev) break; case 0x17: case 0x19: + case 0x1a: sc->sc_ntemps = 1; sc->sc_gettemp = amdtemp_gettemp17h; needsmn = true; @@ -539,6 +542,8 @@ amdtemp_attach(device_t dev) amdtemp_probe_ccd_sensors17h(dev, model); else if (family == 0x19) amdtemp_probe_ccd_sensors19h(dev, model); + else if (family == 0x1a) + amdtemp_probe_ccd_sensors1ah(dev, model); else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), @@ -892,3 +897,24 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) amdtemp_probe_ccd_sensors(dev, maxreg); } + +static void +amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model) +{ + struct amdtemp_softc *sc = device_get_softc(dev); + uint32_t maxreg; + + switch (model) { + case 0x40 ... 0x4f: /* Zen5 Ryzen "Granite Ridge" */ + sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 1ah Model: %02xh\n", model); + return; + } + + amdtemp_probe_ccd_sensors(dev, maxreg); +} From nobody Sun Jan 12 20:11:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWRP81nPsz5jk9g; Sun, 12 Jan 2025 20:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWRP80nmbz4T7P; Sun, 12 Jan 2025 20:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736712700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jeMvpOUtGTPgjdctI+IvF+AUugq4kQAd7zJnT5J9KtQ=; b=dBWn+iYs5bhzFCFAd803okd5UfdOiciVSUPCE/rslzYi/VqZ/ZfvXeYbJSYrdttbR1m2LI H0YWIjkuw4IKjlQA7F0NKfwCsM6K6PE0WyLCXUEK5PciooUoJncG+tGlag4N2Njx+5Jx/I +aG0HZzxBlo9LJ0pSfdlEnM9B562xs+2228BQVOwqYEN2MUvdoK2+Jb6wr7qj8Y390EPyJ ZnRqztqoAxHQFaflz2Vze2lYuyRub973xNFHGCOYdMHmwCbLsRC0ta6Xn8auC6arvWdhxv sw/TovWD0TlaaqTYSfpAPnjKtUsyjvTKrXxLwjhsQU9AVZUcuHYI+Clvu4zJ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736712700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jeMvpOUtGTPgjdctI+IvF+AUugq4kQAd7zJnT5J9KtQ=; b=hXs4GMabAM8Oadj9+XOcW31J+1nzFJ++GP2Mvug14WGsPfR9EAPZBrnvLu0CrD8pHgg4Ae 0Ht/TdtKGK8myQWtPdl7QPyKaaHqfixCQcrMSVxfINOTdPqQ9TOV71wop+BtceckoA+W+n Gj2sdyhGEP2jSh7wH9afEEfvjog7qlrt9Fn9A1G1MMzY8VqiNLLJpYXMStwwgH7MR1FvPp GfhX3A9dnquNqE27eJoQ8maaa7RyltDwRa+SWKsK3Lgjvd6LgD7vcBC3Urad7bq6VeMEOP H/03obKmNKacJC5d+u32zzDTPcx6xAp7l6NbT+genkpfyAzhaery+SlHJPg87A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736712700; a=rsa-sha256; cv=none; b=HMd479KiJ70zcsIvrZpsFmrmzEpmXTVRYXLXTYBCTXKK9BM8kwZld5t3C8//xk9mSyC62z PgUA4hoMYKaImoBt9kdXk4GT01gmKH5REMbFffRxrAlXXomdA2939Ph1QDugtJhjhtME8O sA33L8GL/KqsTbtrrnrU9QLPfsCycgFdYqWGAM+9Y2bxoI0GuMQIT3sY6rwActKB2SH1D6 YXKM3Dk7+TobjJd9lkw7F6cPiIJuUlSZRUt6/nGkFoB/ikGlFpsZWVqRFE7nGiI+bL9IH8 ASjKYr6R5tOlYs+UuJGdZ8jTPo6eHDiaxZ6uE5+1wZJOh0Ksm7szvWdkmKisYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWRP8047xzynD; Sun, 12 Jan 2025 20:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CKBd2p023453; Sun, 12 Jan 2025 20:11:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CKBdXk023450; Sun, 12 Jan 2025 20:11:39 GMT (envelope-from git) Date: Sun, 12 Jan 2025 20:11:39 GMT Message-Id: <202501122011.50CKBdXk023450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b8770ce1dfed - main - pkg: include missing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd commit b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd Author: Kyle Evans AuthorDate: 2025-01-12 20:08:41 +0000 Commit: Kyle Evans CommitDate: 2025-01-12 20:11:22 +0000 pkg: include missing My local environment seems to be seeing some pollution; we need for strlen. PR: 284021 Fixes: 2e065d74a5b0e ("pkg: add a pkgsign_verify_data [...]") MFC after: immediately (trivial build fix) --- usr.sbin/pkg/rsa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/pkg/rsa.c b/usr.sbin/pkg/rsa.c index b28f44ec1953..0056ccb595a9 100644 --- a/usr.sbin/pkg/rsa.c +++ b/usr.sbin/pkg/rsa.c @@ -32,6 +32,7 @@ #include #include +#include #include #include From nobody Sun Jan 12 21:52:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWTdK52qWz5jtQW; Sun, 12 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWTdK4H1Nz4lKd; Sun, 12 Jan 2025 21: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=1736718741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZ6c1WiEFhWA2RTY3ckaBmSlvxSRvz6vOZBE3s0xR14=; b=Cx6/zSsO+YpV/UQAydXkdtfdwiJv2d2alu5cP6tFuvo3r+bYKykkB0MLtNk9Hzoqok64e7 Wx10sym/yg6WXsQnkn00oZzoUVKUrFBVdQHywh0kzEsZ16BUNeHDocpoq2jyc/vseFSJK3 XhzZKHDUh0oKpxB8oPlCmn07oe+tcMBwLgl+/KUpZFmdGEk/PqTaeGuItys4hHzxFDSAWZ 0Hw1frbqhfIM6T74ZQo5HX5BKyGCR153e6Z0VCKnSpIHVkqVDbnL8CgwW8cplyi8Ef/UoR jxNsgrIi06yjkjhdvjOth3L2KB3XpqEO3kafeV7AQV0O7JGZOfwbfQZ3achkwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736718741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZ6c1WiEFhWA2RTY3ckaBmSlvxSRvz6vOZBE3s0xR14=; b=U00wK4AbDpCoDy36XHhOb6GIfn9rfXoIQVque2LFYO4r+ZWtXoBDPIjJHiV3XoJXsJ77vN iI8hxOy1DWjbW92MmvbihnujCXntrfNPON7KlYruBOn3b9u8W9tPHeAzmdIt+Ft72rRUSR b0MSffZAIJi6Ie/tLJCNFf0ymoXT2KyteH5rWtcVn5Kpg9J82vd9V2ywokHnUQfllJwgla vv8krKsF7iS4HOg5om5377NnvSURVs4fUBPx0C+pkrdFmugJetUijdMt1eg5s8AWcqRmsC C1B4Hb8u368NE6NcCfTfvtwSryKxiig4JQKd298lPqP6/4paR3RNDToB4iGRaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736718741; a=rsa-sha256; cv=none; b=Fa8l9E1n09S1A1OIGFoU6FL5T/xwGHcCjUGORAYPViuyUB82tscVwGIOLRf1hoXw7pOfdr YeC1eZ7m/58otBxSKA6KNTk8HM5nxjoVt1GMEpfWzuTgFRoVKE7CHl1j7lq5eTguaiLpcU t9ZC4Elq+I/UweLi/2LdcDwrdAgGDrIFeKoDLVIN1a8IoyNjavafH8DFPIjYxxbqYQRXkx MFOlLvH6RkS3sT7vx6VRXZISmwVIjTj8DKr+/OP/ZTfw2dsrTh9PQGhOzomUtegZjZUYjq NcXHeDjZ2J3GmGGKiOkoJASo/GfrwkzBJ8ki/8ZBXMWNvhNwZZAOtq4J0R1MSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWTdK3sMDz12W0; Sun, 12 Jan 2025 21:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CLqLFG014750; Sun, 12 Jan 2025 21:52:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CLqLvK014747; Sun, 12 Jan 2025 21:52:21 GMT (envelope-from git) Date: Sun, 12 Jan 2025 21:52:21 GMT Message-Id: <202501122152.50CLqLvK014747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: df48361e7792 - main - Eliminate unneeded variables and computations. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df48361e7792f9a9e6371f95c1228d4af2808d2a Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=df48361e7792f9a9e6371f95c1228d4af2808d2a commit df48361e7792f9a9e6371f95c1228d4af2808d2a Author: Kirk McKusick AuthorDate: 2025-01-12 21:51:24 +0000 Commit: Kirk McKusick CommitDate: 2025-01-12 21:52:07 +0000 Eliminate unneeded variables and computations. No functional change. MFC-after: 1 week --- sys/ufs/ffs/ffs_suspend.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index 3afbab82cba5..c35831c4bb96 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -245,16 +245,12 @@ ffs_susp_unsuspend(struct mount *mp) static void ffs_susp_dtor(void *data) { - struct fs *fs; - struct ufsmount *ump; struct mount *mp; int error; sx_xlock(&ffs_susp_lock); mp = (struct mount *)data; - ump = VFSTOUFS(mp); - fs = ump->um_fs; if (ffs_susp_suspended(mp) == 0) { sx_xunlock(&ffs_susp_lock); @@ -266,7 +262,8 @@ ffs_susp_dtor(void *data) error = ffs_reload(mp, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) - panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + panic("failed to unsuspend writes on %s", + VFSTOUFS(mp)->um_fs->fs_fsmnt); ffs_susp_unsuspend(mp); sx_xunlock(&ffs_susp_lock);