From nobody Mon Aug 26 04:53:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsdbg5Qg3z5VCDN; Mon, 26 Aug 2024 04:53: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 4Wsdbg4npBz54XQ; Mon, 26 Aug 2024 04:53:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724647999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lFpepENUAm5HS9itt8K+jfRp2XklO5PIZ4n7c6XXVGA=; b=q1CMb+dzU1dzqOUHPh2+F7zpI7c/XMb6pMLw2LGqe/zSYcbJ/pZviFYgHATU2ZUupTQq9G Luxse5H9sRBM/oHrdT2r3x5dmwNgXV5rNqJoNgMLE2iCiyelzoXpOmZmm5x3RHgOGMZjvS eilt3FcGGR//1BxJBF2ON468nkXv6EZqEXFeXb1CILJhYBHaeietZSh95Q8R6I2j9AP7N3 YsdNZn77yL/tAPhX2tUGgHcIHqmeRJqNvk35YQX4lSvVbZhV+52l4SVnKQg4N96Y7kJvBN pLSH4SbYCnt2WKIu2uGZe9emGjpu+sbiZWWMU/EWZnqcDHsPSqs7AwpdYXRSmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724647999; a=rsa-sha256; cv=none; b=dwb7yME9wSJxPeWVDYofev8Nad5NanLkFSJxOS6zNEMeGegVZpo/ZlPOWjo/HBZd94vXvr IA58hHyrwhQ9V4N+E47QMAToJVbCkbrtRPzU0OM3FO67G32R/fxOkyJOFEJiIV7gJcQVTu WSDM6ftJGDpf6RkCr/1VVFMc495cstVgcgYyW3m4NrAK9ef3+5qd7VHhaj3Rl1WMKji6n9 U8TnefY3CzT7qSlCTQjrLhT5u87ZHOIy531UNPuJHDQPKGxSo9Z0ItgzwMCCflDltDvv0r RRBcIQm7xki/THaNFlJ00M7nsWKGhR+QjwT87oUbJX1nZeXGbx7edtVzp2pfjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724647999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lFpepENUAm5HS9itt8K+jfRp2XklO5PIZ4n7c6XXVGA=; b=moGHUvb1N6ycbSqeHnqECelz4tvDWWoZKpT6YNyzJeOdY3xUu2xY3G3UFSUzv30hqwvKqU AuBVU5wB4ODNmCXfWEWfUtfuZkwk3FJglSvvqNVyM1ANlvNm/Y/ocMd3WBA1YTHMsXjm3I 3oqb50mf8TFdTwjgLmO3uADCSf09k3SGhNuxbNVJDHD0stYekDB3QjBtDkodArvYdnuovk BDGkAvafw8HMQl/B2nY3NOq2hy5q8eGZLglq6KmWPewTaWYv2b16uxzZaX3M8D47+cEO5t SzxLKbFqLfW+d6FNU7BMUoBviAWEelL0eGCBewJsSQKmqErwlFJdTlVw+WNCkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsdbg4NqDzt1B; Mon, 26 Aug 2024 04:53: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 47Q4rJjU099725; Mon, 26 Aug 2024 04:53:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47Q4rJ6J099722; Mon, 26 Aug 2024 04:53:19 GMT (envelope-from git) Date: Mon, 26 Aug 2024 04:53:19 GMT Message-Id: <202408260453.47Q4rJ6J099722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 04262ed78d23 - main - rtld-elf: Add CFI annotation for .rtld_start on RISC-V List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04262ed78d2368a9e1f64755fb92a22872a20cac Auto-Submitted: auto-generated The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=04262ed78d2368a9e1f64755fb92a22872a20cac commit 04262ed78d2368a9e1f64755fb92a22872a20cac Author: Alex Richardson AuthorDate: 2024-08-26 04:51:55 +0000 Commit: Alex Richardson CommitDate: 2024-08-26 04:51:55 +0000 rtld-elf: Add CFI annotation for .rtld_start on RISC-V Without this change, unwinders such as LLVM libunwind will attempt to unwind beyond the start of RTLD and get stuck in an infinite loop or crash (depending on the current values on the stack). This fixes an infinite loop in the LLVM libunwind test suite on RISC-V. See also https://reviews.freebsd.org/D40844 for AArch64 Reviewed By: #riscv, jhb MFC After: 2 weeks Differential Revision: https://reviews.freebsd.org/D46406 --- libexec/rtld-elf/riscv/rtld_start.S | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rtld-elf/riscv/rtld_start.S b/libexec/rtld-elf/riscv/rtld_start.S index 5459089fa1e6..e0b8157c964f 100644 --- a/libexec/rtld-elf/riscv/rtld_start.S +++ b/libexec/rtld-elf/riscv/rtld_start.S @@ -39,6 +39,7 @@ */ ENTRY(.rtld_start) + .cfi_undefined ra /* Do not attempt to unwind any further. */ mv s0, a0 /* Put ps_strings in a callee-saved register */ mv s1, sp /* And the stack pointer */ From nobody Mon Aug 26 05:16:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsf5w0rFjz5VFBN; Mon, 26 Aug 2024 05:16: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 4Wsf5w0J02z56P8; Mon, 26 Aug 2024 05:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3TIDybSH8Qc/pktVSjn2PvLKhyUVQi9L4vojNUqtddg=; b=n90FrkmCY6WMEuRekTb6BoFpUssnHyuHTp9J0Wju+t/PA8t9lmJk2GRJ7Ib/jQYzK2pRlO eK8i2APgUv1IOEHoEPVOf0p2IrUqPc2bSSKaAO0yOApKI8fdPb2kkM34gXo9CIm82812gh iPYhPE5tA+wEf6uBMZ870ywosgQsc1N/xtpWOInFiqUuLG4KmBwI2mvE7uLtShdot0+mWh OpRzmFJfYAztxVML7YnCIRTekGV5fJelWlc4HkjB1vjnf5Ea/jqeckSIjKMK8o1tUGa8VJ wAw33zPT+It7CGJYDS3kSoc+AD4PCCxi/TzdEPdNNK2KI4505XSDTVtiLeEeQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724649364; a=rsa-sha256; cv=none; b=ZOHTpH2mrWxNlOPJ5F8lvjY0d6wszKjEzzpXGp1xD3b2MdHN3P1PQ3N4GzNKTf4BxC9dlf BHX261gmW7+4IhhZxAzFCeS5XlJizSys0dj7AGKnn+v5Px64WmTFuNhHra3c8ToCvVPRUW YcSv80GHERvU7dp5BemrERPOESuNIto6drzUTQCMNDetJ/v7l9S2qKT/IDftDn5UtYB75D 1Kt0NYM9BbQt3Rc9SlZsOxFivA7+xULE8lLODHdHv+I1CoFQBd04kzT8AznzKsXXyg6h3V fftzyOGhB6O/eksJ0WZS/h2MJBmSRS+6wU145jphjf791hd3eUnWa9GpRX1Vbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3TIDybSH8Qc/pktVSjn2PvLKhyUVQi9L4vojNUqtddg=; b=dzvoghCpv45Nauc/PXQoLvtnCKbkGY9jU8GJx5KwQoxWO5ODU0geQbG+QVxG5/IisrCYx1 UwknPCHRpsU5T9CBteg6jMDRCMYbIVdxHP+x7t6P0jIFV0dqgExMkZgZDJXzjAPq0/FrHH 6LIQcYgI4kOxUquReYHxSU9Fw1vZTmyvrPy4JyC1lJy0cBxkCJIuGAql0daw272BBRwdu8 BTZ3aFirMH+n4CryFFTFnHZ6xFC8t55TLtrtU1JcXbq+po2vgQ9yYT9NEWKz/tjqEpO37b 8UXvZkKb6jJtrrSRB7+GncRU2Vk6n+KzLiXkRUR3PrSmGcDpyE0Qew2jmYXU9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsf5v70dpztXw; Mon, 26 Aug 2024 05:16: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 47Q5G37O035346; Mon, 26 Aug 2024 05:16:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47Q5G32f035343; Mon, 26 Aug 2024 05:16:03 GMT (envelope-from git) Date: Mon, 26 Aug 2024 05:16:03 GMT Message-Id: <202408260516.47Q5G32f035343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: c7d5163a1335 - stable/14 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c7d5163a1335a1ff41bee28a6d49c87cdbd36411 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=c7d5163a1335a1ff41bee28a6d49c87cdbd36411 commit c7d5163a1335a1ff41bee28a6d49c87cdbd36411 Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-26 05:15:43 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 5af8d9aca7bd..a0a7b9db60f8 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,6 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -116,6 +117,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 73a4ba86bb84..583ff80cac69 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,6 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -142,6 +143,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -874,6 +876,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Mon Aug 26 05:17:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsf7d2f13z5VFW5; Mon, 26 Aug 2024 05:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsf7d1zJhz56NT; Mon, 26 Aug 2024 05:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jaGIcmLgdmDpJcl+t2ET1RtIecdsHrknE1EeN/LVdg=; b=iiNgi/4U2F/rQLUNQyjnVkBC62ejNKi9tlZk0rquB3KLhxw0jTYabTRSTp51zZ9k3rVH29 YjvqMCZ6jcnFjcdkPH6sFZDBpaMCQISRo2uwm3piGKFEbLYxB+/rCKC5a/NIz7/+iO2G3p pXGdk1B01HDgmFx2HaYifpSBHLyG6y3m5Pw5HNSGPTAeYVTGFcUp6iHIT/Hurmwp1pCxeN C7XOhSqnK4RRcMTFib1Tqsw7rl5Vl2XUQLeonryeeecgoBum8+e7mujdLQtXqR6yRndGqh Zi1R442qjk1lQm+EEjSRKCaVHUf2AmPTELxqP2f9mr3y+T+MC8OqnZr/VWehqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724649453; a=rsa-sha256; cv=none; b=R1a3kq7dweb+fZReTQbs1P2MRn33QpoVb1+UNdo1nZ6RRjZonib+PqZkUtktrA8gKqAGJr QuIA7N+QOOHZ2eq51pyikI0oYgARc1cw83K0RsN9gRoGphPuofFg4qeZr8k0fmES7pKuCm m8pLCGBBQZla+A9WIZIXnfUBRNeYHQe7I+yMIe6j4ttuhFyzn/2DOYZghQUiOahX5v4txM 3g9/HdY02BxSHRnge5GXn9+L5S1PudiosebFxBsNjCaMTCkGAxnchygSHCIRVQf9/A3WPl jn1Hr43uC7iVRXxr/d4pqnn5YQY88XAkd/6vSPO0QZXOG9z7/ECFkcWurb1Mdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724649453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jaGIcmLgdmDpJcl+t2ET1RtIecdsHrknE1EeN/LVdg=; b=WKFjZJ8XRAJgGOBOEs2Q5LH9B73/q/0Tgx+tOnjpoIWBHJXBYOo+4tRZ5TpAOMA9SM5iwC o6rAgbrBrGRpIUrR2EADSu1p2GR2ZkXgTsE2gmXZlAz5P3DriNKarJsHPaOlKzi4zmssPO lAulHeuuML/HF3QkxO4REAJ2IQ6r2XbltT9Vs0tE36ez2VdJepmnUy/g8T+XTj4csKP3Hz wmXOUxmgwvpE651lt6uJ2lsOmi5ukcOnQTUQiKTzxqzTujPvmU/anlNToojajIfUISkwc/ Feu64KCRsXZPK2j/g78C+iZgMz4WeGoWwLdU2RbfOzEGa6CUrt2Lde3nZ30boA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsf7d1YDYztGs; Mon, 26 Aug 2024 05:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47Q5HX9K035707; Mon, 26 Aug 2024 05:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47Q5HXaj035704; Mon, 26 Aug 2024 05:17:33 GMT (envelope-from git) Date: Mon, 26 Aug 2024 05:17:33 GMT Message-Id: <202408260517.47Q5HXaj035704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: cb8f15aeede6 - stable/13 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: cb8f15aeede63627e220c40fe4911df79f35fb69 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=cb8f15aeede63627e220c40fe4911df79f35fb69 commit cb8f15aeede63627e220c40fe4911df79f35fb69 Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-26 05:17:17 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes MFC after: 3 days (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index decb2c1249ed..fbef358f4957 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,6 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -116,6 +117,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index b38f92131c77..0e7f805b40fd 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,6 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -142,6 +143,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -875,6 +877,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Mon Aug 26 13:22:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsrv91C7bz5SvnB; Mon, 26 Aug 2024 13: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 4Wsrv90p10z4Y9g; Mon, 26 Aug 2024 13: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=1724678549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wsl/PkGcruWNJJuXztIXt4qUwe859OyC4m+DRDsCEOg=; b=hK7yJOBoT2VyJhxx79Emd8B/vMb9qKCp4QUS0UqoPZZs0psP6h8ZWK4W0ULii7PvqMJEQV es7ubhrBcEFbXnCfAHJ2AwD2Avpo87kV3pr0hrBR2pFjwk/Wjz6jIyWJcfXkQhP0ytU94y 43QwVdjwURtBfvdEq+NDG9QC/EtEh7R3nKAKs7lZWXhCa9kmKOIIyM5MkKcZb9MY+GS8hc MJqG9P7vSoLV/oJNG7dm5ThWgH+VGKFYWbFBkw82dOKnhwvVwsH7YD7dpju0SH/wc9XoXh PMwxbrLL0eNxhIl8GL3iFcwXDHDRQIHB2ST87ErBnHWFD8GY1as4jk1wL1jQig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678549; a=rsa-sha256; cv=none; b=H4PkL0a9MKswUDNyITrEhcO6d83P2ysheyh5Y/PIJmkSHk+sva7hbCqz5638BYVsUVOruK 9b24im7UuaXokuBlpko98dbN6YrG02uQEMrwgjSgrbOfdAKb9VL1Isj2HZvFEnEaWXXIcX Fs+D0IPYjnDZBUEBK6DmsIhRcBT1ibYkGMmgL8rXZjw/HRScZu3E3xUmg8AAWeuMI2BBNX CEbVM1YOLrLVbq/0O4Jdp07+er+cUy6KrL4OUA1JS6mdOg6xnndfXnMJG+fiAZY1ha6y9N tYjYxa5+0MFD+IvKeckBpkMGuCtSJHzl4A+fpCb9LRbH7AynCtpn4zvqmrUFjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wsl/PkGcruWNJJuXztIXt4qUwe859OyC4m+DRDsCEOg=; b=RJEDLrur+ACwh8VyOSo4sdhLL4V8srwunLcfQOfa5RiexE9AsXrtV/NHIfG8K8ZR5gsQoK 4MTyJX2aGJm2BAdgPG3QawBmYJYQBVqUYOh5N6QxadCVGXDm/PyUb3rCqUJbLDGVIjp76m p8MTE+eYHayQOufe+z1cCw0KRsjwtQ9T01DsEojp38guYNA17Fya2Dncw5XQlM5O39jYBT 6hlkgojPWgLUXI7DHADCXpUKyLq8aQuI93qqlYDAtiMqi8JJUqyiTRk/nx7RCa/Eu9BNej NmHBrg8NvA5n0G6GkDOPCyN+r6d5tjLhDJZwGH9ha31bEPNzDOGIMS2iCld0ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsrv90PX1z17cH; Mon, 26 Aug 2024 13: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 47QDMSPp066026; Mon, 26 Aug 2024 13:22:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDMS3N066023; Mon, 26 Aug 2024 13:22:28 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:22:28 GMT Message-Id: <202408261322.47QDMS3N066023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 226c73373738 - stable/14 - linux.4: clarify path translation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 226c733737383478f3c1d3f8c119207136c05de0 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=226c733737383478f3c1d3f8c119207136c05de0 commit 226c733737383478f3c1d3f8c119207136c05de0 Author: Ed Maste AuthorDate: 2024-08-19 13:43:37 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:22:03 +0000 linux.4: clarify path translation Try to be a little more explicit about the path translation mechanism accessing /compat/linux/ then falling back to /. As suggested by martin@lispworks.com, refer to the compat path explicitly, and correct an existing grammaro. PR: 277804 Reviewed by: fernape Sponsored by: The FreeBSD Foundation (cherry picked from commit f66e71fa78e16164339f7fd4791306fb30165581) (cherry picked from commit d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1) --- share/man/man4/linux.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 0efc469985f9..0659651d6596 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -61,11 +61,13 @@ under .Pa /compat/linux ) before .Pa / . -For example, when Linux process attempts to open +For example, when a Linux process attempts to open .Pa /etc/passwd , -it will really access +it will first access .Pa /compat/linux/etc/passwd , -unless the latter does not exist. +falling back to +.Pa /etc/passwd +if the compat path does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual From nobody Mon Aug 26 13:23:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsrvv0Q0gz5SvGx; Mon, 26 Aug 2024 13:23: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 4Wsrvt71Dfz4Ybk; Mon, 26 Aug 2024 13:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6WJ6pxRMKN4KJvt/XOMG57TMBgGvqJaZFEOKjNqDdJY=; b=JkKZXMG8hOlMoyzMnwm3WtDha3/vMIU9kY1w22AvarL2oinQwpUv/g22JjoOWitF2SiDbD KlS47e054eeIHVvE5HM7383loeapIL+9xIoIwPYMBUpIKRZyk4jCnKpQjUHDzKrdtSH+RU bkLGs8usmY2+/0ceeYB/t+lEWejt1mnI0jvkGkWAgCHbsGYGrWut02xxDXjDkHVbQJTH1w aWq0eM7Y23L7uBcs2mkNzCygUBvAchqUVe5HVsQR8NvK2tLXZSXc4R/9ORaTfYgaVgeMI3 T1051aPnkJ1e4N1wUojHXxZqpmoCVLD2+/GrTxJwQ5QTB6fCbPxhKLmaBVhLeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678587; a=rsa-sha256; cv=none; b=cKlO7VgCe/CxGR0wa8wTgrh5thwZee+WCEgXkazFHOAc658Q8SW3GR0DmNN2zK7qGKR2p/ o1plhKJ7AU1OxcSzximLRSpFhWDyDrKGYsRyrd9PMSldTAfUKCst/nR5w4Fy4gWmZdP89y rVVHTqVQvbiXhZCQQSCK8/gi1uvmF3RHnxHmNYWiENIrDZWyJXpMZFtD79EDJjA9T0Rf1g UX8vsGKwNtnlSKlu5oVLKEDze4jyhEdVKD8+mOm0ZdLX02TfTwjzYP83DJPXw61YkfCVAu Ue6eQWfUxjK0YdRzdZf93fFDtg0BNA10ikwZhE8VH7sr1rzk3uEgQs4LrOHAiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6WJ6pxRMKN4KJvt/XOMG57TMBgGvqJaZFEOKjNqDdJY=; b=xHLaxe8Np0J/vbjLUMRXiAHgLX4k79/HGK86D/Ev4lJ3zlDqL0fb6jeirFRoEfd91K1NwB em+cwLYDpDm4PSYDKDJpEfPx8gLoXSjVXO5kbeehff8+qRfGTEHUKEQJIiPMOXufUVv9SH GZHmrxmEfMQDh6UOOvP/4BJNOIlc1e+kjpcuRKQb/vxGSHSbDMShvEKP62zosB/+hTSNQP Ryj+UiP87ZDfkxNPMu4z8EOopCP1apC4Jk2TnHQVsD9mJQd0+mV/cbGxPqgOsBHkOXmUXB omfxiEBvTMS+BFv6Gb0Dh7ei8iDBYIS/itjfesAfKBhsRxrUlA7ICCjTiz9eFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsrvt6dF3z17cK; Mon, 26 Aug 2024 13:23: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 47QDN6Dt066232; Mon, 26 Aug 2024 13:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDN64r066229; Mon, 26 Aug 2024 13:23:06 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:23:06 GMT Message-Id: <202408261323.47QDN64r066229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6a847b6d1ee8 - stable/13 - linux.4: clarify path translation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a847b6d1ee8ccf7e109d13bece2ad634672e6ff Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6a847b6d1ee8ccf7e109d13bece2ad634672e6ff commit 6a847b6d1ee8ccf7e109d13bece2ad634672e6ff Author: Ed Maste AuthorDate: 2024-08-19 13:43:37 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:22:58 +0000 linux.4: clarify path translation Try to be a little more explicit about the path translation mechanism accessing /compat/linux/ then falling back to /. As suggested by martin@lispworks.com, refer to the compat path explicitly, and correct an existing grammaro. PR: 277804 Reviewed by: fernape Sponsored by: The FreeBSD Foundation (cherry picked from commit f66e71fa78e16164339f7fd4791306fb30165581) (cherry picked from commit d1daec3d358eb5aaa38fa7c95fbfa330c46a69a1) (cherry picked from commit 226c733737383478f3c1d3f8c119207136c05de0) --- share/man/man4/linux.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 0efc469985f9..0659651d6596 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -61,11 +61,13 @@ under .Pa /compat/linux ) before .Pa / . -For example, when Linux process attempts to open +For example, when a Linux process attempts to open .Pa /etc/passwd , -it will really access +it will first access .Pa /compat/linux/etc/passwd , -unless the latter does not exist. +falling back to +.Pa /etc/passwd +if the compat path does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual From nobody Mon Aug 26 13:27:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wss134pDgz5Sw2v; Mon, 26 Aug 2024 13:27: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 4Wss134FGhz4YwK; Mon, 26 Aug 2024 13:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jlNoG4+h0srj+0Hcz/GnISzNWFRybTYMgtq2NkQdH9s=; b=X21cUnkzhwGQAtnka9bCmcRqsCqEuCTjt49vhL5j9ye86nkcEQ6cO4NFtePrv+QgvdT0aa /t3LBYrAlkZ3GFzErsxhoFjvX1Qobn98l4mmKEkqLlp1KJIrXdILtEU90YC9JaAX+3rt3v 1Sbm8K7wYa1PIjybKzNzE6EGQ0hmR0zoD3OHaDDuCNtZzHoKThEbVcvbdzN0mHP/o+zuH4 Xcz4agdjD/iB99rKr7gWGt5NNN4hdKf3Fps0bD+//64ssPEkvHRXm+e1b23dDsEPDNh3Iq y04nevBOpJ6fWQg21Z5yza3i3/hNk1OZfiN5p9O7JQ1tTCilxs0eEcxIr/pz0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678855; a=rsa-sha256; cv=none; b=Dqmy2AWNEGvB14nxrPeuX7Eht1m1WUQepoPQEzcaN9NKb6AY2qBD+utr8y3OAOtgFhc5Hi 36Kx2eupFJp1+tsDl5YnFMNO9Pl4SHuqOudM0sx1AlRNbYIPxLpEqbJwvriFeMhv3aUpwl T2tgmXB5DmD0Neek1QHiqux9WCfMsYdFizt29VvTcXZqpLioeTQslRUr96MucXLcT2+x5F xg0+e1jDJ14hPwVYOjl5r8Tm5GcQlCxXrIn6crDuD1H334J0iYK7+wmLTjLKD6gBJS33A6 i2dU73jbD+IwG4HUtjKsBo03PTYb6ZtfIX86+pnweY5FPpui0lnBw+q3Bx5NcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jlNoG4+h0srj+0Hcz/GnISzNWFRybTYMgtq2NkQdH9s=; b=L3lKcyIZzaRFI6Snpj91+RRkWaZjf3U9vs5WQXWEjEI5G/kdvSXF03AMr52dHilcGTr7mp LK0i9kiyZNn2Nxbm3s1t6jmr4MkbavzE/TCvRjxaX74q7G9Y7paXy6VG8P2U5iMqcvoLNX dOdkknmXH/KGhPRkT56sxrAvr2s8iqnSUR1HyRz/MGfbCzd1Vi/E2xbRTUjo1tnvc0o+2C KwP8Q5mvpijHijvXnlx7htVYmR/o7Q8AFiRuU83VvAcTPRTunPcwTPXlMSz5q+Y++5Qm93 abVYadTON7p4aK4vxOT+sl0iYRoRhs+/+7MPSOZa7pux3wqqA71feancs8HumQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wss133dPgz17fN; Mon, 26 Aug 2024 13:27: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 47QDRZuD066958; Mon, 26 Aug 2024 13:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDRZXH066955; Mon, 26 Aug 2024 13:27:35 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:27:35 GMT Message-Id: <202408261327.47QDRZXH066955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 131b7dcb2fbf - stable/14 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 131b7dcb2fbf8f15815387f60536d9cc16585b0d Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=131b7dcb2fbf8f15815387f60536d9cc16585b0d commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:23:37 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a315c5ef7df3..1d5e13ad4671 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9340,14 +9340,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Mon Aug 26 13:28:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wss2F5GSDz5SvvP; Mon, 26 Aug 2024 13:28: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 4Wss2F4n1Jz4ZLs; Mon, 26 Aug 2024 13:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9ph4z1Ms+IaXWfrAPPa2WJIWtUR2GcUc4VDNy7M0SI=; b=FQSchJK3BKMsN2d1EuEAeJ1zN90uGbaOu6AsTCL267dcHA6cBPBcxhp/rMHiOI08jM6DEW 1CTCRE7jXGM/SNSg1Q64yaGTeza9k/oBTQ+YQM8wFJ1qs07OcuVAX9RKf4yO/bJoMH7i3h 9QpobDNpFHZkSgPXP2SNa6mN3a+iiCMiz1LzDmxD1yoarMTpmJqtgb/7H7tSMLBGjEIgn0 1QmiJVMbjt6q64nvfAvuzuwzZlkI8YqDkWTH6MybzYfMn3Z3Di1/sHQr7LJjFn91M0ZYMa H94dKVYatyMEmNMW+KwneeiyQB/yR71jfH8q2WRNujH8ffOUhCBU0DKdZGqCcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724678917; a=rsa-sha256; cv=none; b=ya6sFZ4nDjLMB7Od8eZE2b30hV21/ERoPmo02M6cow5WhE/SUimE9xETLBzus+Ty0g0xlp EY4vEnbMi4DnKtZK2YhuWbCdiRXXDa7MumvFwnBoLz1lqpnNrfcNpe9A1Bw2BiQleywP2X F3mIOnBQYSrFoQ8k5eKBZYeKtHC/3F5cshLkuMboSWs1TNQb3eW+XV7sOeYLvRDTjzKwTH 12GEx39LEudPODauW/nM+7GD/ikJHLindlAz1vCQ+qlFSVavUo+pS71cbwJx0nWf9hjStz Qr61fh4JhoXsGUlJ1zemJQEvXJGwX4pGjAd67M2D6HFwxlZkmU5gbS557LIUOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724678917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9ph4z1Ms+IaXWfrAPPa2WJIWtUR2GcUc4VDNy7M0SI=; b=kKzM2oqvlsRpL0r1YZYEnWHP01kMbbZLiP7gEzRUlUZRzCiZqgcGxCvMSpZYFCeqV6GyjU O2MqJCNwat2DpYKJgGHApt0ZCCZ9UdHS3eeslHSsR/WO5COSAQ0mXAg6R7KefmI6voDI6k 40aGJ/YVJrsKOowkfhkOs1mLJP9LCF3Wt12gY1kg2OpRwZXzfRLW54PCDiPrfB6mRl8GRM oVBmMKnbThaGoON24xTt6STKO+IO1/8rox+vRvkDWtgDvHWPhjKXhngx6KrTJ2MDScPHC2 428Bg1eUDcMT3dy7HJEixkPlxykIAP0W0uPByaAKUa9CzmfUEGA2XM4QEyYRrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wss2F4L40z17Q9; Mon, 26 Aug 2024 13:28: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 47QDSbZw067216; Mon, 26 Aug 2024 13:28:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDSbvx067213; Mon, 26 Aug 2024 13:28:37 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:28:37 GMT Message-Id: <202408261328.47QDSbvx067213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 51768dc31df6 - stable/13 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51768dc31df6379aa4a1447a15f054508d16b4b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=51768dc31df6379aa4a1447a15f054508d16b4b1 commit 51768dc31df6379aa4a1447a15f054508d16b4b1 Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-26 13:28:17 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a31bbd3c8342..7a04a668e823 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9339,14 +9339,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Mon Aug 26 13:54:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscP25DKz5SxhR; Mon, 26 Aug 2024 13:54: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 4WsscP1QN6z4f9H; Mon, 26 Aug 2024 13:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KV91/PtwZ58S8NZU/hVMe7BIEvl0A2XKw9s7XTzZ7Og=; b=iaK1t3HtbjU83gule8XRbrGQKaXUYOodLRN5edhrxZOMarNdeJF6KZYl+wr2RVg4XZANwS j86lOJUe27a+bE81tT8zvH9bqFq3zY/zXd6WkDFFcgncBWsZwWQiJBQn5pPUXTO2ix4rfi +rS64QLMkGBDoox067qJmjyxrhCr2j695TR3eH4j+rhCXdBjGVPGc+ZCrn0DIEMZfj9Mey XHVilzsJvwXIO3XMpfsw2N0RF7aPsuKFP2aRcFxnw9KjvXLhY6hYv36lSvVzVH36WdvUeJ /Bv+9knwZiggq70pAXYF8Kiomfdm2OpYlHC1jZSq4SHYgquKF1woUga6gnzq3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680485; a=rsa-sha256; cv=none; b=Pe1TRZOM/jqTALr4AEaqX7j2zRbO7TNWwtx6cj/7jzT7woVlhJZA5VBCs1m8v54hJF4Mp9 rZfFb08Jprj3FIWfgJ4SQjx0Bh65DCgT8VS+h5AGE2NO97JfAn51IMW4dw82+5stSPrIcF m+6BgE0RptDkJ+nay7q9LgOijMsfScUtytspXJc2+v7X7LNu0F3oQgZNP4jVVWCVpTjmfQ uMyHKDfVs7V8jZEZLHlno7iWsd1GVR35QoeQNPGSG7UXIL+zh0H0pt4wVvx27yrMDe4GeC ybcEDZaSFeRsOmpXS3T1Wkh0zFEGKsB9cJ1RMi7IKOCbOSRLHrLpCm+VHRdrZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KV91/PtwZ58S8NZU/hVMe7BIEvl0A2XKw9s7XTzZ7Og=; b=fQRXVZ/Zn2iVn9hFG2WqEaMk27E0zDffpSYVyBNRtEQ+sktkv/pzMXaZ8AbBdOiUSUsuVG FHSqDPUAjSPQR1axhucsk1T04mnIdUFY8KDaXSaSQqZaem857ig8u6bpuSl6QrRz6FNdFy JFdIOaWfyI1o/nGn3AVTpQ51JVV+C4OUx6PABqgDiSj46KcwfLFBWRIrhDK0CCbA76yUD6 Nij7/jC6QvG5tqkjFuovdfUdiOSAlX5bh5xPWAuPnX+Ehsf3hpPK5FLIxXA1iuQ35/EOmn 1Eu8oPBVKhKUIr3L7szI/PDq5Uzc+6sBIt12AL9oKdgdrTofIW3hv6rVEeYvuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscP0tLQz188n; Mon, 26 Aug 2024 13:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDsjRT017285; Mon, 26 Aug 2024 13:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsj0c017282; Mon, 26 Aug 2024 13:54:45 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:45 GMT Message-Id: <202408261354.47QDsj0c017282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6ab8b418dc10 - stable/14 - sound tests: Add SNDSTIOC_ADD_USER_DEVS test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ab8b418dc101aaac692c874bbe8d83c071f83de Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6ab8b418dc101aaac692c874bbe8d83c071f83de commit 6ab8b418dc101aaac692c874bbe8d83c071f83de Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:29 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:52:02 +0000 sound tests: Add SNDSTIOC_ADD_USER_DEVS test Test whether the SNDSTIOC_ADD_USER_DEVS IOCTL (registers a userland device to /dev/sndstat) works properly. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46228 (cherry picked from commit 2668e76d6e764c5c361156ffa3d39eb02ce8e5d9) --- tests/sys/sound/sndstat.c | 187 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 183 insertions(+), 4 deletions(-) diff --git a/tests/sys/sound/sndstat.c b/tests/sys/sound/sndstat.c index 7c030dfa8b58..553c745ec950 100644 --- a/tests/sys/sound/sndstat.c +++ b/tests/sys/sound/sndstat.c @@ -30,8 +30,9 @@ #include #include -#include #include +#include +#include #include #include @@ -59,8 +60,7 @@ ATF_TC_BODY(sndstat_nv, tc) const nvlist_t * const *cdi; struct sndstioc_nv_arg arg; size_t nitems, nchans, i, j; - int fd, rc; - int pchan, rchan; + int fd, rc, pchan, rchan; load_dummy(); @@ -135,7 +135,6 @@ ATF_TC_BODY(sndstat_nv, tc) } #undef NV - /* XXX Do we need to skip the TC? userdevs won't have this list */ if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) continue; @@ -206,9 +205,189 @@ ATF_TC_BODY(sndstat_nv, tc) close(fd); } +#define UDEV_PROVIDER "sndstat_udev" +#define UDEV_NAMEUNIT "sndstat_udev" +#define UDEV_DEVNODE "sndstat_udev" +#define UDEV_DESC "Test Device" +#define UDEV_PCHAN 1 +#define UDEV_RCHAN 1 +#define UDEV_MIN_RATE 8000 +#define UDEV_MAX_RATE 96000 +#define UDEV_FORMATS (AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) +#define UDEV_MIN_CHN 1 +#define UDEV_MAX_CHN 2 + +ATF_TC(sndstat_udev); +ATF_TC_HEAD(sndstat_udev, tc) +{ + atf_tc_set_md_var(tc, "descr", "/dev/sndstat userdev interface test"); +} + +ATF_TC_BODY(sndstat_udev, tc) +{ + nvlist_t *nvl, *di, *dichild; + const nvlist_t * const *rdi; + struct sndstioc_nv_arg arg; + const char *str; + size_t nitems, i; + int fd, rc, pchan, rchan, n; + + load_dummy(); + + if ((fd = open("/dev/sndstat", O_RDWR)) < 0) + atf_tc_skip("/dev/sndstat not found, load sound(4)"); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + + di = nvlist_create(0); + ATF_REQUIRE(di != NULL); + + dichild = nvlist_create(0); + ATF_REQUIRE(dichild != NULL); + + nvlist_add_string(di, SNDST_DSPS_PROVIDER, UDEV_PROVIDER); + nvlist_add_string(di, SNDST_DSPS_NAMEUNIT, UDEV_NAMEUNIT); + nvlist_add_string(di, SNDST_DSPS_DESC, UDEV_DESC); + nvlist_add_string(di, SNDST_DSPS_DEVNODE, UDEV_DEVNODE); + nvlist_add_number(di, SNDST_DSPS_PCHAN, UDEV_PCHAN); + nvlist_add_number(di, SNDST_DSPS_RCHAN, UDEV_RCHAN); + + nvlist_add_number(dichild, SNDST_DSPS_INFO_MIN_RATE, UDEV_MIN_RATE); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MAX_RATE, UDEV_MAX_RATE); + nvlist_add_number(dichild, SNDST_DSPS_INFO_FORMATS, UDEV_FORMATS); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MIN_CHN, UDEV_MIN_CHN); + nvlist_add_number(dichild, SNDST_DSPS_INFO_MAX_CHN, UDEV_MAX_CHN); + + nvlist_add_nvlist(di, SNDST_DSPS_INFO_PLAY, dichild); + nvlist_add_nvlist(di, SNDST_DSPS_INFO_REC, dichild); + + nvlist_append_nvlist_array(nvl, SNDST_DSPS, di); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + + arg.buf = nvlist_pack(nvl, &arg.nbytes); + ATF_REQUIRE_MSG(arg.buf != NULL, "failed to pack nvlist"); + + rc = ioctl(fd, SNDSTIOC_ADD_USER_DEVS, &arg); + free(arg.buf); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_ADD_USER_DEVS) failed"); + + nvlist_destroy(di); + nvlist_destroy(dichild); + nvlist_destroy(nvl); + + /* Read back registered values. */ + rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL); + ATF_REQUIRE_EQ(rc, 0); + + arg.nbytes = 0; + arg.buf = NULL; + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#1) failed"); + + arg.buf = malloc(arg.nbytes); + ATF_REQUIRE(arg.buf != NULL); + + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#2) failed"); + + nvl = nvlist_unpack(arg.buf, arg.nbytes, 0); + ATF_REQUIRE(nvl != NULL); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + atf_tc_skip("no soundcards attached"); + + rdi = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item, var) do { \ + ATF_REQUIRE_MSG(nvlist_exists(rdi[i], SNDST_DSPS_ ## item), \ + "SNDST_DSPS_" #item " does not exist"); \ + var = nvlist_get_ ## type (rdi[i], SNDST_DSPS_ ## item); \ +} while (0) + /* Search for our device. */ + NV(string, NAMEUNIT, str); + if (strcmp(str, UDEV_NAMEUNIT) == 0) + break; + } + if (i == nitems) + atf_tc_fail("userland device %s not found", UDEV_NAMEUNIT); + + NV(string, NAMEUNIT, str); + ATF_CHECK(strcmp(str, UDEV_NAMEUNIT) == 0); + + NV(bool, FROM_USER, n); + ATF_CHECK(n); + + NV(string, DEVNODE, str); + ATF_CHECK(strcmp(str, UDEV_DEVNODE) == 0); + + NV(string, DESC, str); + ATF_CHECK(strcmp(str, UDEV_DESC) == 0); + + NV(string, PROVIDER, str); + ATF_CHECK(strcmp(str, UDEV_PROVIDER) == 0); + + NV(number, PCHAN, pchan); + ATF_CHECK(pchan == UDEV_PCHAN); + if (pchan && !nvlist_exists(rdi[i], SNDST_DSPS_INFO_PLAY)) + atf_tc_fail("playback channel list empty"); + + NV(number, RCHAN, rchan); + ATF_CHECK(rchan == UDEV_RCHAN); + if (rchan && !nvlist_exists(rdi[i], SNDST_DSPS_INFO_REC)) + atf_tc_fail("recording channel list empty"); +#undef NV + +#define NV(type, mode, item, var) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(rdi[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item), \ + "SNDST_DSPS_INFO_" #item " does not exist"); \ + var = nvlist_get_ ## type (nvlist_get_nvlist(rdi[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item); \ +} while (0) + if (pchan) { + NV(number, PLAY, MIN_RATE, n); + ATF_CHECK(n == UDEV_MIN_RATE); + + NV(number, PLAY, MAX_RATE, n); + ATF_CHECK(n == UDEV_MAX_RATE); + + NV(number, PLAY, FORMATS, n); + ATF_CHECK(n == UDEV_FORMATS); + + NV(number, PLAY, MIN_CHN, n); + ATF_CHECK(n == UDEV_MIN_CHN); + + NV(number, PLAY, MAX_CHN, n); + ATF_CHECK(n == UDEV_MAX_CHN); + } + if (rchan) { + NV(number, REC, MIN_RATE, n); + ATF_CHECK(n == UDEV_MIN_RATE); + + NV(number, REC, MAX_RATE, n); + ATF_CHECK(n == UDEV_MAX_RATE); + + NV(number, REC, FORMATS, n); + ATF_CHECK(n == UDEV_FORMATS); + + NV(number, REC, MIN_CHN, n); + ATF_CHECK(n == UDEV_MIN_CHN); + + NV(number, REC, MAX_CHN, n); + ATF_CHECK(n == UDEV_MAX_CHN); + } +#undef NV + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, sndstat_nv); + ATF_TP_ADD_TC(tp, sndstat_udev); return (atf_no_error()); } From nobody Mon Aug 26 13:54:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscQ2kSqz5SxwM; Mon, 26 Aug 2024 13:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscQ2D7wz4dvj; Mon, 26 Aug 2024 13:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ddatbgwQXdQm+8Cprut7OB3yRbmncR6uBsF5OMS9eI=; b=R6HUDuRRkmtmDx2OGwwK1pw8JAM+k6bJXGMNvnBjYCjneAGAiax7SHPxbJxpiRvUkg/WRy BC6ZoN5nbqMkW/3mLay8UTVbRcacN1wVMgCt5NsJuL8H7f9lo2ICgg/E+XjXfkd4BAztQy znJqTn+y+GginC9oSYqq9jj/jrLC4gYUuJ21egGMLI3nOq4/oHvADUi5P118pD+sSNndiY h9hLS94IkzUgUcNAht5WZd1J2gOoV14C9op0ozI35IU9w9Ws0l2CfTUuR/SrJyeOnlBzNY wLxD5upFPiyroADprBz/URTEjtodYZEhND0yhN2SQ1V/UlcquWQVjYT4/1iBUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680486; a=rsa-sha256; cv=none; b=MOZOEvCY8k9sVdr+iqZL3aHTUieOK4bu6rfNcgrBQnDtzxieVtrVE6pAeGLnQx8xbWfpWR eHyB21krApE+88Hk9pGdXh07A6h8oO4dqq3Wtp+qD60sRI6JEJ7Lm4JP4aCOpKh67GMPcb JDWQqN7rOBHhvs4yQ7hAIGVNnAOEE4JeOhcE3QNV/XlGAFJ+ttoHLaHCtBV9OROVGSqwUL yrK2azZuYMOK2XSb5MGmv0R9u50U4GWuGfQDw45kiPhtPEL8feWhs9xj6W7Q3g5wpFr2Az wy5KzEZw/KkWr4MkWDYLbF8KxitoTwi6ie67czhY/PNaCG+BbwEOATltmyxuLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ddatbgwQXdQm+8Cprut7OB3yRbmncR6uBsF5OMS9eI=; b=OFY0cWv3SvUvCSD6S51edxTLPo+gIOSKot1ZY5nQGEDDyFMf7egJYgFzcldg1LOdkbrM7v BNsYnCkUz5gcBaXNeEs4SqWWwdL9EM91oB5yX0BQkQFDU1Fnu8DUTC6QOfXZBhmGLuT5KZ uscZPmKNrFYKEjYsX4Szsp0PgQUWCWSra18cREBR3W3kk+COg1fQ0MTrLAXiQfhceycNG9 SNLwCERFn944m5DTUB8N/CQKvACL9pM1Phh8L/llJw6/bs3Waz8ZBc2x1VMbwn3gHbPu7o CLpRfPCYR5TCbeC2O1IfJP4TSBqVCFvTNuJr5Ancm5WSj38UyvJ9IFRLQUKtdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscQ1rPfz17kd; Mon, 26 Aug 2024 13:54: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 47QDskQe017322; Mon, 26 Aug 2024 13:54:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsk8O017319; Mon, 26 Aug 2024 13:54:46 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:46 GMT Message-Id: <202408261354.47QDsk8O017319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: cf9d2fb18433 - stable/14 - mixer(8): Implement hot-swapping List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf9d2fb184338b73c362b98bb8fadd2de9d94634 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cf9d2fb184338b73c362b98bb8fadd2de9d94634 commit cf9d2fb184338b73c362b98bb8fadd2de9d94634 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:35 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:52:02 +0000 mixer(8): Implement hot-swapping Introduce a -V option, which can be used alongside -d (default unit change), in order to hot-swap devices (i.e switch to them on the fly without needing to restart the track), in case virtual_oss(8) exists and is running. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46253 (cherry picked from commit 9aac27599acaffa21ff69c5be8a2d71d29cc3d6b) --- usr.sbin/mixer/mixer.8 | 75 +++++++++++++++++++++++++++++++++++++++++++--- usr.sbin/mixer/mixer.c | 81 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 145 insertions(+), 11 deletions(-) diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8 index 75c6a81e3a55..819d8ae73ab1 100644 --- a/usr.sbin/mixer/mixer.8 +++ b/usr.sbin/mixer/mixer.8 @@ -19,7 +19,7 @@ .\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN .\" THE SOFTWARE. .\" -.Dd February 8, 2024 +.Dd August 14, 2024 .Dt MIXER 8 .Os .Sh NAME @@ -28,7 +28,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar device -.Op Fl d Ar pcmN | N +.Op Fl d Ar pcmN | N Op Fl V Ar voss_device:mode .Op Fl os .Op Ar dev Ns Op Cm \&. Ns Ar control Ns Op Cm \&= Ns Ar value .Ar ... @@ -43,7 +43,7 @@ The utility is used to set and display soundcard mixer device controls. .Pp The options are as follows: -.Bl -tag -width "-d pcmN | N" +.Bl -tag -width "-V voss_device:mode" .It Fl a Print the values for all mixer devices available in the system .Pq see Sx FILES . @@ -54,6 +54,30 @@ where N is the unit number (e.g for pcm0, the unit number is 0). See .Sx EXAMPLES on how to list all available audio devices in the system. +.Pp +There is also the possibility of hot-swapping to the new default device if +.Xr virtual_oss 8 +exists in the system and is running, in which case the +.Fl V +option needs to be specified as well. +.Pp +Hot-swapping generally cannot happen with plain +.Xr sound 4 , +so the user has to restart the track in order to get sound coming out of the +new default device. +This is because applications usually open a device at the start of the track +and do not check for default device changes, in order to open the new device +mid-track. +.Xr virtual_oss 8 , +on the other hand, can do hot-swapping, because it creates a virtual device for +applications to open, and then does all the necessary routing and conversions +to the appropriate device(s). +.Pp +Note that hot-swapping will work only for applications that are using +.Xr virtual_oss 8 +devices, and not plain +.Xr sound 4 +ones. .It Fl f Ar device Open .Ar device @@ -66,6 +90,33 @@ Print mixer values in a format suitable for use inside scripts. The mixer's header (name, audio card name, ...) will not be printed. .It Fl s Print only the recording source(s) of the mixer device. +.It Fl V Ar voss_device:mode +Specify a +.Xr virtual_oss 8 +control device, as well as a mode (see below), in order to hot-swap devices. +This option is meant to only be used in combination with the +.Fl d +option. +.Pp +The available modes are as follows: +.Bl -column play +.It Sy Mode Ta Sy Action +.It all Ta Playback and recording +.It play Ta Playback +.It rec Ta Recording +.El +.Pp +The +.Pa mode +part is needed, so that +.Nm +will not accidentally hot-swap both the recording and playback device in +.Xr virtual_oss 8 , +if only one direction is to be hot-swapped. +.Pp +See +.Sx EXAMPLES +on how to use this option. .El .Pp The list of mixer devices that may be modified are: @@ -273,10 +324,26 @@ $ mixer -f /dev/mixer0 -o > info \&... $ mixer -f /dev/mixer0 `cat info` .Ed +.Pp +Suppose +.Xr virtual_oss 8 +is running with +.Pa /dev/vdsp.ctl +as its control device, and +.Pa pcm0 +as the playback device. +Change the default device to +.Pa pcm1 , +and hot-swap to it for both recording and playback in +.Xr virtual_oss 8 : +.Bd -literal -offset indent +$ mixer -d pcm1 -V /dev/vdsp.ctl:all +.Ed .Sh SEE ALSO .Xr mixer 3 , .Xr sound 4 , -.Xr sysctl 8 +.Xr sysctl 8 , +.Xr virtual_oss 8 .Sh HISTORY The .Nm diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 109d3ad09bc5..468130ddaa88 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -20,6 +20,9 @@ * THE SOFTWARE. */ +#include +#include + #include #include #include @@ -40,7 +43,7 @@ static void printall(struct mixer *, int); static void printminfo(struct mixer *, int); static void printdev(struct mixer *, int); static void printrecsrc(struct mixer *, int); /* XXX: change name */ -static int set_dunit(struct mixer *, int); +static int set_dunit(struct mixer *, int, char *); /* Control handlers */ static int mod_volume(struct mix_dev *, void *); static int mod_mute(struct mix_dev *, void *); @@ -54,13 +57,13 @@ main(int argc, char *argv[]) { struct mixer *m; mix_ctl_t *cp; - char *name = NULL, buf[NAME_MAX]; + char *name = NULL, buf[NAME_MAX], *vctl = NULL; char *p, *q, *devstr, *ctlstr, *valstr = NULL; int dunit, i, n, pall = 1, shorthand; int aflag = 0, dflag = 0, oflag = 0, sflag = 0; int ch; - while ((ch = getopt(argc, argv, "ad:f:hos")) != -1) { + while ((ch = getopt(argc, argv, "ad:f:hosV:")) != -1) { switch (ch) { case 'a': aflag = 1; @@ -83,6 +86,9 @@ main(int argc, char *argv[]) case 's': sflag = 1; break; + case 'V': + vctl = optarg; + break; case 'h': /* FALLTHROUGH */ case '?': default: @@ -119,7 +125,7 @@ main(int argc, char *argv[]) initctls(m); if (dflag) { - if (set_dunit(m, dunit) < 0) + if (set_dunit(m, dunit, vctl) < 0) goto parse; else { /* @@ -209,7 +215,8 @@ next: static void __dead2 usage(void) { - fprintf(stderr, "usage: %1$s [-f device] [-d pcmN | N] [-os] [dev[.control[=value]]] ...\n" + fprintf(stderr, "usage: %1$s [-f device] [-d pcmN | N " + "[-V voss_device:mode]] [-os] [dev[.control[=value]]] ...\n" " %1$s [-os] -a\n" " %1$s -h\n", getprogname()); exit(1); @@ -322,9 +329,32 @@ printrecsrc(struct mixer *m, int oflag) } static int -set_dunit(struct mixer *m, int dunit) +set_dunit(struct mixer *m, int dunit, char *vctl) { - int n; + const char *opt; + char *dev, *mode; + char buf[32]; + size_t size; + int n, rc; + + /* + * Issue warning in case of hw.snd.basename_clone being unset. Omit the + * check and warning if the -V flag is used, since the user is most + * likely to be aware of this, and the warning might be confusing. + */ + if (vctl == NULL) { + size = sizeof(int); + if (sysctlbyname("hw.snd.basename_clone", &n, &size, + NULL, 0) < 0) { + warn("hw.snd.basename_clone failed"); + return (-1); + } + if (n == 0) { + warnx("warning: hw.snd.basename_clone not set. " + "/dev/dsp is managed externally and does not " + "change with the default unit change here."); + } + } if ((n = mixer_get_dunit()) < 0) { warn("cannot get default unit"); @@ -336,6 +366,43 @@ set_dunit(struct mixer *m, int dunit) } printf("default_unit: %d -> %d\n", n, dunit); + /* Hot-swap in case virtual_oss exists and is running. */ + if (vctl != NULL) { + dev = strsep(&vctl, ":"); + mode = vctl; + if (dev == NULL || mode == NULL) { + warnx("voss_device:mode tuple incomplete"); + return (-1); + } + if (strcmp(mode, "all") == 0) + opt = "-f"; + else if (strcmp(mode, "play") == 0) + opt = "-P"; + else if (strcmp(mode, "rec") == 0) + opt = "-R"; + else { + warnx("please use one of the following modes: " + "all, play, rec"); + return (-1); + } + snprintf(buf, sizeof(buf), "/dev/dsp%d", dunit); + switch (fork()) { + case -1: + warn("fork"); + break; + case 0: + rc = execl("/usr/local/sbin/virtual_oss_cmd", + "virtual_oss_cmd", dev, opt, buf, NULL); + if (rc < 0) + warn("virtual_oss_cmd"); + _exit(0); + default: + if (wait(NULL) < 0) + warn("wait"); + break; + } + } + return (0); } From nobody Mon Aug 26 13:54:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscR51Pmz5Sy2p; Mon, 26 Aug 2024 13:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscR3c01z4fMB; Mon, 26 Aug 2024 13:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YK/1o6TpLuAbgxMqWSu22W943yNZb11tvAW99vCn0JM=; b=Tz6pngQ86OD6EcABgM1RfNv8K6oHyN3eJsIiuM/zC1mmiHqIZXl0BxNJHF6rVdVIyrMay5 a4xe9Faks1QIPJA+Vu38MMoiXXspKJ4bHcIKYuqJjQ6DXY0NWnY8/1lg/2/DiWmxDjECbN pWBFKbJIyENcdguEMIy9L8j/pOdweq97Rt4C/2kqs24jF19/5bB099ugJvMFXHvm9HJUXg 0cZlURmOxgLpYPgAi5FI/QVfZckEuB/7OE/LZoeGg0F6EQDaMXl2ijRTE6aHs/6mW0ZhN8 YCviJoiecdbcC5EhXF5di8mU4LHPs37ElPM9o1XqKKzm9oMl4mqwRwYD2YYc9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680487; a=rsa-sha256; cv=none; b=U248Cne8HcjbsEqtGkSN+KJzi93GkobB6mH1movEoSail2nCYrQshQg/WfviexIPD3C7wj pxGI1wi/BnA8nqswrrRnN3IJFKI6Yhblv0jq9da2psk86eX4OXvJiS58CHiu4ZFDWsR048 uK2esalINhuC1lL8xCrzb3LezMTUpqkReR8xtBHyKsMMwY1VvVdv18cFtybJB6n8GFDhq1 5oy4BFLf2aZG5tSt/bWMUO9TpwGTKbK+iQmV8ShQHimFaAab8flQI9psnk0MpIQ/to3+nz N/sHS/CPG8wumgQtvntxGJ7jab98BFf7C2gkeBqm3gS9LGu9VDr2fZZBRKor3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YK/1o6TpLuAbgxMqWSu22W943yNZb11tvAW99vCn0JM=; b=Z6bUeBsAeZHsOC5A8t1DtDv1tCSyCEmpJq7nDzR5VNPFSH1b9AA6waoV9Bn0gsUBQJtY5b oLzK0oIiLATA+2Oyv2EcqNNCyLNGx/3/dX0KJm85cXZCrZSwxzDJe2bkSZxJ/eq2QENFr2 5+fiiWcN/+Aa1ym+dq+sFxH5s6butK2Q0Z9zgyn9AyYK69mXAG+tt0pBt/B9qFxZkKwsYO aQpPbglKi9QBXDnAFoFxDATNIQbIbSH4aT++yETxgLmQcEKpTXnXpDXcgiOhNe4MhXOgLR aMIs2f+c3hd3f9+LQLbTy+ThiXbaxUaYTX71xGbpYwJotkTMLQYxQpJv06sAwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscR2r5Pz17RW; Mon, 26 Aug 2024 13:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDsliT017364; Mon, 26 Aug 2024 13:54:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDslRj017361; Mon, 26 Aug 2024 13:54:47 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:47 GMT Message-Id: <202408261354.47QDslRj017361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 276d76adf984 - stable/14 - sound examples: Simplify MIDI example List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 276d76adf984909876dc72970244ea43049217ce Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=276d76adf984909876dc72970244ea43049217ce commit 276d76adf984909876dc72970244ea43049217ce Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:40 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:52:59 +0000 sound examples: Simplify MIDI example Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D46306 (cherry picked from commit 0ca4d5d8209cf4d2d0bb37d7f20d95ac3457026d) --- share/examples/Makefile | 3 +- share/examples/sound/oss/midi.c | 77 ++++++++++++++++++++++---------------- share/examples/sound/oss/ossmidi.h | 63 ------------------------------- 3 files changed, 46 insertions(+), 97 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 1fbc74f51083..04117719aa95 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -318,8 +318,7 @@ SE_SOUND_OSS= \ README \ basic.c \ midi.c \ - ossinit.h \ - ossmidi.h + ossinit.h SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/midi.c b/share/examples/sound/oss/midi.c index 7149bcb31c82..5b001ba537e5 100644 --- a/share/examples/sound/oss/midi.c +++ b/share/examples/sound/oss/midi.c @@ -2,6 +2,10 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2022 Goran Mekić + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,52 +29,61 @@ * SUCH DAMAGE. */ +#include +#include +#include +#include #include -#include "ossmidi.h" +#define CMD_MASK 0xF0 +#define CHANNEL_MASK 0x0F +#define NOTE_ON 0x90 +#define NOTE_OFF 0x80 +#define CTL_CHANGE 0xB0 int -main() +main(int argc, char *argv[]) { - midi_event_t event; - midi_config_t midi_config; - int l = -1; - unsigned char raw; + int fd; + unsigned char raw, type, channel, b1, b2; - midi_config.device = "/dev/umidi1.0"; - oss_midi_init(&midi_config); + if ((fd = open("/dev/umidi0.0", O_RDWR)) < 0) + err(1, "Error opening MIDI device"); - while ((l = read(midi_config.fd, &raw, sizeof(raw))) != -1) { - if (!(raw & 0x80)) { + for (;;) { + if (read(fd, &raw, sizeof(raw)) < sizeof(raw)) + err(1, "Error reading command byte"); + if (!(raw & 0x80)) continue; - } - event.type = raw & CMD_MASK; - event.channel = raw & CHANNEL_MASK; - switch (event.type) { + + type = raw & CMD_MASK; + channel = raw & CHANNEL_MASK; + + if (read(fd, &b1, sizeof(b1)) < sizeof(b1)) + err(1, "Error reading byte 1"); + if (read(fd, &b2, sizeof(b2)) < sizeof(b2)) + err(1, "Error reading byte 2"); + + switch (type) { case NOTE_ON: - case NOTE_OFF: - case CONTROLER_ON: - if ((l = read(midi_config.fd, &(event.note), sizeof(event.note))) == -1) { - perror("Error reading MIDI note"); - exit(1); - } - if ((l = read(midi_config.fd, &(event.velocity), sizeof(event.velocity))) == -1) { - perror("Error reading MIDI velocity"); - exit(1); - } + printf("Channel %d, note on %d, velocity %d\n", + channel, b1, b2); break; - } - switch (event.type) { - case NOTE_ON: case NOTE_OFF: - printf("Channel %d, note %d, velocity %d\n", event.channel, event.note, event.velocity); + printf("Channel %d, note off %d, velocity %d\n", + channel, b1, b2); break; - case CONTROLER_ON: - printf("Channel %d, controller %d, value %d\n", event.channel, event.controller, event.value); + case CTL_CHANGE: + printf("Channel %d, controller change %d, value %d\n", + channel, b1, b2); break; default: - printf("Unknown event type %d\n", event.type); + printf("Unknown event type %d\n", type); + break; } } - return 0; + + close(fd); + + return (0); } diff --git a/share/examples/sound/oss/ossmidi.h b/share/examples/sound/oss/ossmidi.h deleted file mode 100644 index 60bf5e41173e..000000000000 --- a/share/examples/sound/oss/ossmidi.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include - -#define CMD_MASK 0xF0 -#define NOTE_ON 0x90 -#define NOTE_OFF 0x80 -#define CHANNEL_MASK 0xF -#define CONTROLER_ON 0xB0 - -typedef struct midi_event { - unsigned char type; - unsigned char channel; - union { - unsigned char note; - unsigned controller; - }; - union { - unsigned char velocity; - unsigned char value; - }; -} midi_event_t; - -typedef struct midi_config { - char *device; - int fd; -} midi_config_t; - -void -oss_midi_init(midi_config_t *config) -{ - if ((config->fd = open(config->device, O_RDWR)) == -1) { - perror("Error opening MIDI device"); - exit(1); - } -} From nobody Mon Aug 26 13:54:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscS5NBnz5SxnT; Mon, 26 Aug 2024 13:54: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 4WsscS53pCz4fZ1; Mon, 26 Aug 2024 13:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJrqC9iBeASB6Te6ok4bYah3nll4itZOQgTJdPK0J6w=; b=WkQdBejKsLf7R+R9sZRsqvwJqJGPiydOOZKjPLGPpubmbPR4A74FYwEPuMDxkMwbegfEeL EuL9i66WNRVEvSqCm5TUl1nrWDIeCLm/8ZTpPS4zGjyJnVyBTqPiybU8CPdWdTmdph9hKs VkyE568yKl/XaX5Gyluk/a5rO6GDADpCWfmfvdIUZdvWQYqpbUmzwrft1H9g2LOzTAHgw7 UdTtJ98ZQOO1w8gL5mJ1xOXxk4NA+li2fBGeqHh63DDQjW10rC0jnl81nbt59A4vsCnZlB MDvu9FqZODxKyW+2IAgOLbeYGFyLdixbn/N6w2tN8iNN4QKYB+i2u3YRS1OBxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680488; a=rsa-sha256; cv=none; b=aGJ4iYrZxVDVAyQwA5yCo6Dh8I2Y+HTYL/mG70HHODX9Yd07MdzDtPiXc1V1Sw9E18HVRa t13YskvWdoBp82PGqqCStwvv+8b4d0bV4lUb6aA02/E+Q0oi/6QZU/Zk/NBZt/xvkFeaU+ eXeC6fDliRz4y5sDiy//TEad2YVsoeSjVBnibDkrsXcWPi+bH3o5DxEOh58s5n8H2T8e4r azKJHp5dFhhYaHVnlBbEgt2ZVCYZuaMw3wGIl2tXp1eLFqKdyBK+sQhR7nnqTzyJlw2CTq 5Ynda+SR/9aM2qayqgCuA7sA8e2wLxA7THbKXkZtfuH1gfeDMgZ3Rhs6mlofFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJrqC9iBeASB6Te6ok4bYah3nll4itZOQgTJdPK0J6w=; b=x57zEH9a7LABSV2A6P3oZ0Ce4UUrq5mol3gYrYSh8wCaImxLLXHyiHiC+vJ0npCy8Q+y7B V1sCbpVOkUnRoeQpHMq0R5vSDSkJ3ShBMz0MHwu81PMqOBXiI66DDNHrYgVC754Tnb00zY 8XL7LxFA7Ucmh611zDudnH77Vm1Y+OQYJ7+lui6kiFKbOIO1/juxJlgQf++QJOvZoKRw/z aY7UYvWBnhfIdJ3r8b/AhHkmZL5MHA14RriRaMHml6Mkex71rFwY5DjKQu9aO8DZHXx3Ns QDJKwFA4y9a+fup+4QWV5wgn+G7fe6S9xme/zQTXQu7gBBDwvi9iU84vy0c8AQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscS3tC4z17RX; Mon, 26 Aug 2024 13:54: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 47QDsm0h017413; Mon, 26 Aug 2024 13:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsmjT017410; Mon, 26 Aug 2024 13:54:48 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:48 GMT Message-Id: <202408261354.47QDsmjT017410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a59e4c405572 - stable/14 - sound examples: Simplify audio example List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a59e4c40557203112438d4f6fbfac69346e4d0f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a59e4c40557203112438d4f6fbfac69346e4d0f4 commit a59e4c40557203112438d4f6fbfac69346e4d0f4 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:45 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:00 +0000 sound examples: Simplify audio example - Merge ossinit.h and basic.c. - Rename basic.c to audio.c. - Use err(3) instead of fprintf(3) + exit(3). - Some style(9) improvements. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46307 (cherry picked from commit 3decd659a7887e83c2c8af35053301dc7d6f7be2) --- share/examples/Makefile | 5 +- share/examples/sound/oss/audio.c | 310 +++++++++++++++++++++++++++++++++++++++ share/examples/sound/oss/basic.c | 99 ------------- 3 files changed, 312 insertions(+), 102 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 04117719aa95..8e2d4a6ad2dd 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -316,9 +316,8 @@ SE_SOUND= \ SE_DIRS+= sound/oss SE_SOUND_OSS= \ README \ - basic.c \ - midi.c \ - ossinit.h + audio.c \ + midi.c SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/audio.c b/share/examples/sound/oss/audio.c new file mode 100644 index 000000000000..4dd3c8b82575 --- /dev/null +++ b/share/examples/sound/oss/audio.c @@ -0,0 +1,310 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Goran Mekić + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifndef SAMPLE_SIZE +#define SAMPLE_SIZE 16 +#endif + +/* Format can be unsigned, in which case replace S with U */ +#if SAMPLE_SIZE == 32 +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Signed 32bit native endian format */ +#elif SAMPLE_SIZE == 16 +typedef int16_t sample_t; +int format = AFMT_S16_NE; /* Signed 16bit native endian format */ +#elif SAMPLE_SIZE == 8 +typedef int8_t sample_t; +int format = AFMT_S8_NE; /* Signed 8bit native endian format */ +#else +#error Unsupported sample format! +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Not a real value, just silencing + * compiler errors */ +#endif + +/* + * Minimal configuration for OSS + * For real world applications, this structure will probably contain many + * more fields + */ +typedef struct config { + char *device; + int channels; + int fd; + int format; + int frag; + int sample_count; + int sample_rate; + int sample_size; + int chsamples; + int mmap; + oss_audioinfo audio_info; + audio_buf_info buffer_info; +} config_t; + +/* + * Error state is indicated by value=-1 in which case application exits with + * error + */ +static inline void +check_error(const int value, const char *message) +{ + if (value == -1) + err(1, "OSS error: %s\n", message); +} + + +/* Calculate frag by giving it minimal size of buffer */ +static inline int +size2frag(int x) +{ + int frag = 0; + + while ((1 << frag) < x) + ++frag; + + return (frag); +} + +/* + * Split input buffer into channels. Input buffer is in interleaved format + * which means if we have 2 channels (L and R), this is what the buffer of 8 + * samples would contain: L,R,L,R,L,R,L,R. The result are two channels + * containing: L,L,L,L and R,R,R,R. + */ +static void +oss_split(config_t *config, sample_t *input, sample_t *output) +{ + int channel, index, i; + + for (i = 0; i < config->sample_count; ++i) { + channel = i % config->channels; + index = i / config->channels; + output[channel * index] = input[i]; + } +} + +/* + * Convert channels into interleaved format and place it in output + * buffer + */ +static void +oss_merge(config_t *config, sample_t *input, sample_t *output) +{ + int channel, index; + + for (channel = 0; channel < config->channels; ++channel) { + for (index = 0; index < config->chsamples; ++index) { + output[index * config->channels + channel] = + input[channel * index]; + } + } +} + +static void +oss_init(config_t *config) +{ + int error, tmp, min_frag; + + /* Open the device for read and write */ + config->fd = open(config->device, O_RDWR); + check_error(config->fd, "open"); + + /* Get device information */ + config->audio_info.dev = -1; + error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); + check_error(error, "SNDCTL_ENGINEINFO"); + printf("min_channels: %d\n", config->audio_info.min_channels); + printf("max_channels: %d\n", config->audio_info.max_channels); + printf("latency: %d\n", config->audio_info.latency); + printf("handle: %s\n", config->audio_info.handle); + if (config->audio_info.min_rate > config->sample_rate || + config->sample_rate > config->audio_info.max_rate) { + errx(1, "%s doesn't support chosen samplerate of %dHz!\n", + config->device, config->sample_rate); + } + if (config->channels < 1) + config->channels = config->audio_info.max_channels; + + /* + * If device is going to be used in mmap mode, disable all format + * conversions. Official OSS documentation states error code should not + * be checked. + * http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 + */ + if (config->mmap) { + tmp = 0; + ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); + } + + /* + * Set number of channels. If number of channels is chosen to the value + * near the one wanted, save it in config + */ + tmp = config->channels; + error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); + check_error(error, "SNDCTL_DSP_CHANNELS"); + /* Or check if tmp is close enough? */ + if (tmp != config->channels) { + errx(1, "%s doesn't support chosen channel count of %d set " + "to %d!\n", config->device, config->channels, tmp); + } + config->channels = tmp; + + /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ + tmp = config->format; + error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); + check_error(error, "SNDCTL_DSP_SETFMT"); + if (tmp != config->format) { + errx(1, "%s doesn't support chosen sample format!\n", + config->device); + } + + /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ + tmp = config->sample_rate; + error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); + check_error(error, "SNDCTL_DSP_SPEED"); + + /* Get and check device capabilities */ + error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); + check_error(error, "SNDCTL_DSP_GETCAPS"); + if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) + errx(1, "Device doesn't support full duplex!\n"); + + if (config->mmap) { + if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) + errx(1, "Device doesn't support triggering!\n"); + if (!(config->audio_info.caps & PCM_CAP_MMAP)) + errx(1, "Device doesn't support mmap mode!\n"); + } + + /* + * If desired frag is smaller than minimum, based on number of channels + * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer + * size is 2^frag, but the real size of the buffer will be read when + * the configuration of the device is successful + */ + min_frag = size2frag(config->sample_size * config->channels); + + if (config->frag < min_frag) + config->frag = min_frag; + + /* + * Allocate buffer in fragments. Total buffer will be split in number + * of fragments (2 by default) + */ + if (config->buffer_info.fragments < 0) + config->buffer_info.fragments = 2; + tmp = ((config->buffer_info.fragments) << 16) | config->frag; + error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); + check_error(error, "SNDCTL_DSP_SETFRAGMENT"); + + /* When all is set and ready to go, get the size of buffer */ + error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); + check_error(error, "SNDCTL_DSP_GETOSPACE"); + if (config->buffer_info.bytes < 1) { + errx(1, "OSS buffer error: buffer size can not be %d\n", + config->buffer_info.bytes); + } + config->sample_count = config->buffer_info.bytes / config->sample_size; + config->chsamples = config->sample_count / config->channels; +} + +int +main(int argc, char *argv[]) +{ + int ret, bytes; + int8_t *ibuf, *obuf; + config_t config = { + .device = "/dev/dsp", + .channels = -1, + .format = format, + .frag = -1, + .sample_rate = 48000, + .sample_size = sizeof(sample_t), + .buffer_info.fragments = -1, + .mmap = 0, + }; + + /* Initialize device */ + oss_init(&config); + + /* + * Allocate input and output buffers so that their size match frag_size + */ + bytes = config.buffer_info.bytes; + ibuf = malloc(bytes); + obuf = malloc(bytes); + sample_t *channels = malloc(bytes); + + printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, " + "samples: %d\n", + bytes, config.buffer_info.fragments, + config.buffer_info.fragsize, config.buffer_info.fragstotal, + config.sample_count); + + /* Minimal engine: read input and copy it to the output */ + for (;;) { + ret = read(config.fd, ibuf, bytes); + if (ret < bytes) { + fprintf(stderr, "Requested %d bytes, but read %d!\n", + bytes, ret); + break; + } + oss_split(&config, (sample_t *)ibuf, channels); + /* All processing will happen here */ + oss_merge(&config, channels, (sample_t *)obuf); + ret = write(config.fd, obuf, bytes); + if (ret < bytes) { + fprintf(stderr, "Requested %d bytes, but wrote %d!\n", + bytes, ret); + break; + } + } + + /* Cleanup */ + free(channels); + free(obuf); + free(ibuf); + close(config.fd); + + return (0); +} diff --git a/share/examples/sound/oss/basic.c b/share/examples/sound/oss/basic.c deleted file mode 100644 index 83ecbe6ea9a7..000000000000 --- a/share/examples/sound/oss/basic.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2021 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "ossinit.h" - -int -main() -{ - config_t config = { - .device = "/dev/dsp", - .channels = -1, - .format = format, - .frag = -1, - .sample_rate = 48000, - .sample_size = sizeof(sample_t), - .buffer_info.fragments = -1, - .mmap = 0, - }; - - /* Initialize device */ - oss_init(&config); - - /* - * Allocate input and output buffers so that their size match - * frag_size - */ - int ret; - int bytes = config.buffer_info.bytes; - int8_t *ibuf = malloc(bytes); - int8_t *obuf = malloc(bytes); - sample_t *channels = malloc(bytes); - - printf( - "bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, samples: %d\n", - bytes, - config.buffer_info.fragments, - config.buffer_info.fragsize, - config.buffer_info.fragstotal, - config.sample_count - ); - - /* Minimal engine: read input and copy it to the output */ - for (;;) { - ret = read(config.fd, ibuf, bytes); - if (ret < bytes) { - fprintf( - stderr, - "Requested %d bytes, but read %d!\n", - bytes, - ret - ); - break; - } - oss_split(&config, (sample_t *)ibuf, channels); - /* All processing will happen here */ - oss_merge(&config, channels, (sample_t *)obuf); - ret = write(config.fd, obuf, bytes); - if (ret < bytes) { - fprintf( - stderr, - "Requested %d bytes, but wrote %d!\n", - bytes, - ret - ); - break; - } - } - - /* Cleanup */ - free(channels); - free(obuf); - free(ibuf); - close(config.fd); - return (0); -} From nobody Mon Aug 26 13:54:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscV11z8z5Sy9n; Mon, 26 Aug 2024 13:54: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 4WsscT5nPvz4fRP; Mon, 26 Aug 2024 13:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAxOfEK3BDmTCvzDaMd38R9T3yRqz2qYwRgV+FCovbo=; b=xi1ynirnVKXaHaDQpI3ho52JK8ZzDwWq1f9Ev79mcCzscRhvq65APZOcyyHUYZN4lKp5r9 ObAs+Tdg95nha+nLpC4Rk2XVFmVORrkaV7+u+LDVSmLODNlHK+e0UFxKLmof1eadHuUcuw 9XtxXRZYYKhTM89Q+H8Un2etioReg5wDtQrboF7oH19bv1gzOVEONYlgKC8RtaFy3ZwZ9v 98wDc2tXrnQJf0ytLg2AjcD1pGk3JaehEvvY8B+6UYCHXbm/lX5XZvlLWTRLV+CHqSmsLg h3qzrB6pgjgEuCPZrmIl4qWZSWqOG4x7CRveMs9NBfyG/6pU9aSYLm51wtLf+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680489; a=rsa-sha256; cv=none; b=hS60JNoKvtsMmPr1IxeKfMy7B/lal3NkAf54Iwgh94FVmDvyLnjDhCohabA+V0HfRsVCo/ I0RNM5j2gEJYmxyOm3U23g2vQxJHfGxExdzb1IPnGfLCl4dqS0SJ8ZpqyxDrjol1RWHb+W lYduSx6n9jlS8mvm+CwyTTQP9VACJxHZeQXKw3njvLuFdLXlVQUQqLFyN/26NXluWROSYw DIPV6JN+Ngxmg+9uk/+65j2FjQToWw5JQk71GDoVXwinAfWC12Hp9nzjhzw30vAqtYwpwH hlBW4/md7yRR2NdMuxfRBjlMA19cUG8Y/JwcFkF65whBpUTvpxM0n+E9KbS8TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAxOfEK3BDmTCvzDaMd38R9T3yRqz2qYwRgV+FCovbo=; b=Hbyeq21FnSOKblDzCuMoi8etNFFyAkcWd0rFFFxaflSVbpg6WjnBuBQMwhHYqQ3VhJET7Y f1cRqIh24jDJL3xHq3x72/V55jHbsKf0F4zB/qldP/SZtVOGtUJHPQmNP/jaaCizMjp/w1 oFXr81Yi7tF/XUyefggw5uI4r/X7e91CSjzRxya2V6cyVkmJYfXmpp+8+RdZ8xc04GrAPB bfuXOsUxz9gBnMCTOc1pXajyWi0LE0o5mObhqMsfIB/1of40l7Ax5yo82CazQA2UgQmBMO MdlOfDaM5kfzzlVou693HrjA3swMJBUQJeURM4jvvzpZBF5cyK8BaoVfN1iv9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscT4x29z187G; Mon, 26 Aug 2024 13:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDsn0d017468; Mon, 26 Aug 2024 13:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsnx5017465; Mon, 26 Aug 2024 13:54:49 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:49 GMT Message-Id: <202408261354.47QDsnx5017465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: f060ed39805d - stable/14 - sound examples: Move MIDI example out of OSS directory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f060ed39805ddbe8c2977834967a452ebb2bc858 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f060ed39805ddbe8c2977834967a452ebb2bc858 commit f060ed39805ddbe8c2977834967a452ebb2bc858 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:49 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:00 +0000 sound examples: Move MIDI example out of OSS directory This example is not related to OSS. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, meka_tilda.center Differential Revision: https://reviews.freebsd.org/D46308 (cherry picked from commit 6747b1a8218f229c7593cdb02e4b41e2b1186e26) --- share/examples/Makefile | 6 +++--- share/examples/sound/{oss => }/midi.c | 0 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 8e2d4a6ad2dd..cf0f113cd496 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -311,13 +311,13 @@ SE_SCSI_TARGET= \ SE_DIRS+= sound SE_SOUND= \ - sndstat_nv.c + sndstat_nv.c \ + midi.c SE_DIRS+= sound/oss SE_SOUND_OSS= \ README \ - audio.c \ - midi.c + audio.c SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/oss/midi.c b/share/examples/sound/midi.c similarity index 100% rename from share/examples/sound/oss/midi.c rename to share/examples/sound/midi.c From nobody Mon Aug 26 13:54:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscW1Y99z5SxwP; Mon, 26 Aug 2024 13:54: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 4WsscV6Jdlz4fjR; Mon, 26 Aug 2024 13:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq89ZYbGW+yrlqcrVlz5oGoyDoXd1kblV9qmY8tUo0k=; b=KYgS9+sqR+lLKOP0L81Ho83Lmk445WxME9dd8zMM/XmLJwwCfi7bL/EuZKkl/Ccf6/ylvY m9LJqy3EduUNiVkEXEv8yX/7WPrQBMiat8d0Y0h+vgJZ8DAC6aJIVW3RU5JKZah77tWH76 p/ZOqhPQFB9CF3Rp5CBBV5UYFRcHtzs7k+Ti1JK71bLJGA6iFHJyswCQtk1jFdqbD/ojDD RE3aaOxhsCkOTSCu/SPAxI5LdL4kqNa9uKizaUrJeN+WJZZUxKUeFN/pvSt+MqmCBK8oXs PUGbHpWv7Pv8jvsz0AzfXpMRnZtYI3MwKk1HP0IatBv0akT1zOsF55vDUuuTIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680490; a=rsa-sha256; cv=none; b=jNVMFzJu09PMHr3dC1bEnRTyvukhKxjvglm1QxfYfycvU2NAciOt/SJbkTlXyodsXsUhJZ Mu1E0dTyTs/6rB71H5ZOumtmNlpVVgLMCGhkWFHUGBOvcgL9EcU/x1a80+vDIgvwR/2zej lBKbsdElGjHKn8ktPOEX5Lgd60oKtNi/t70IG/h6R9d3r37RplsnaBTsQijZI5RY3UtVE2 OU1eOziIhUNdjRXglPPNRhBCn6I6XVaTkDYFiDag0LnashzSxvOiOdZrvShxqVGx8hsU/B 5dRhHW5I6hd2zX6aPKGCzzsE57Ld48X0hQONgA9g53eZBo7UHeGhW4FE3xC1tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq89ZYbGW+yrlqcrVlz5oGoyDoXd1kblV9qmY8tUo0k=; b=kDXvolMEO6YYFaEzinl0XseSPuCJbrQ4x7IJ30/lV5B55/DtxJzYrvm4SZ2ckOq1wOzVP9 gNchABlRcBdtXN8wMmG8B5AD5K3/zwgefC0e5LsjtNl+tsPIFgBmUjwZL2K1eAqd2XwnKg 11wCYXo1RSBiM3NZB0zdPKfEDs3dbLISPMJO6nEKMaYzSGiX+EXmczpsZXBZfAhHvyKfw2 1BNLofWag2jVj+OghNydvG8Z1/yvD31dxqxhYVKJMPMcDO98kbT5g/ttcjg0PgqQsQf8VD Pozz1ou+vm8rcLeyMYOxPaOO1fsf1+A7iO/6jE/AWMCgMPdK+IACnWCHe3IxEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscV5gVtz187H; Mon, 26 Aug 2024 13:54: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 47QDso2v017513; Mon, 26 Aug 2024 13:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsoU3017510; Mon, 26 Aug 2024 13:54:50 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:50 GMT Message-Id: <202408261354.47QDsoU3017510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8156d8598f59 - stable/14 - sound: Improve sndstat nvlist feederchain format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8156d8598f5926a8fa996b65b742a295599b131c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8156d8598f5926a8fa996b65b742a295599b131c commit 8156d8598f5926a8fa996b65b742a295599b131c Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:54 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:01 +0000 sound: Improve sndstat nvlist feederchain format - Use snd_afmt2str() to display format conversions in feeder_format, instead of the plain hex value. - Simplify feeder_rate contents. - Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix. - Use snd_afmt2str() instead of a plain hex for the the rest of the feeder classes. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46309 (cherry picked from commit 0864dfe6299b75e424b845c0d0e1a593da905ae3) --- sys/dev/sound/pcm/sndstat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 4fac6a97a3f0..4c5efb72cc0a 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -388,6 +388,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; + char buf[AFMTSTR_LEN]; di = nvlist_create(0); if (di == NULL) { @@ -531,10 +532,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) while (f != NULL) { sbuf_printf(&sb, "%s", f->class->name); if (f->desc->type == FEEDER_FORMAT) { - sbuf_printf(&sb, "(0x%08x -> 0x%08x)", - f->desc->in, f->desc->out); + snd_afmt2str(f->desc->in, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s -> ", buf); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "%s)", buf); } else if (f->desc->type == FEEDER_MATRIX) { - sbuf_printf(&sb, "(%d.%d -> %d.%d)", + sbuf_printf(&sb, "(%d.%dch -> %d.%dch)", AFMT_CHANNEL(f->desc->in) - AFMT_EXTCHANNEL(f->desc->in), AFMT_EXTCHANNEL(f->desc->in), @@ -542,15 +545,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) AFMT_EXTCHANNEL(f->desc->out), AFMT_EXTCHANNEL(f->desc->out)); } else if (f->desc->type == FEEDER_RATE) { - sbuf_printf(&sb, - "(0x%08x q:%d %d -> %d)", - f->desc->out, - FEEDER_GET(f, FEEDRATE_QUALITY), + sbuf_printf(&sb, "(%d -> %d)", FEEDER_GET(f, FEEDRATE_SRC), FEEDER_GET(f, FEEDRATE_DST)); } else { - sbuf_printf(&sb, "(0x%08x)", - f->desc->out); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s)", buf); } sbuf_printf(&sb, " -> "); f = f->parent; From nobody Mon Aug 26 13:54:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscX1Vknz5Sy30; Mon, 26 Aug 2024 13:54:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscW6tVQz4fZv; Mon, 26 Aug 2024 13:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOSLUqt8gKaW/1xyrr/QJsFGl2ZBviltAl0aeclSZlw=; b=ADCGp4gmTHthWKa47XeTERUWo2VMLwIz+e8CkpqZm75/DRDSGOoeCaki6Y+fwo8lmtW7WZ 47d7e+cKpMw8z7k79fCadaVjektyXqBolSvjEAq8WUvaCgHg+nH0R7/MH8IgY0sICJGZgW vMoN6KZXKm8WluHdc77Eun6En/i9S5ZEGXCepxZgsnspgtZbNZ10MXcNQchRGf8k4QBTxT D/piJRC3u9g7/gfuRvQDJJfil6e7KJonG/YfRv0SD0v+pZNqHg40TTa8dP0ZwpOsh56Bxv dQJQAvio5+DTl/YiUyV3xrAqy3K/f6n3h67PaMR5SvzLZzp+SSczQFtPxYBEbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680492; a=rsa-sha256; cv=none; b=DQILmbZejQUReKFsx2BVBS6+blreTk7RCv1r/eI8xhbuf5dz05ruTLhwbtBHbYXSNllnz6 hvE8ejizjQaHVN/L9JBGr5ZI/AvLB9SrUnqnVblhXHU/MqgFL5pIBwPhyvuRC58dA7JriB 1Gqvb+FyED+5jvCpVgvwK2xcV+o069bo4duoV8x3Epe4b1a8AoQ6jTE4zeGjqsucXeDlvW q2OQUP5T/zsgQVOtjHSTfCDrpM6jMjxWP6C/H9OovXbVrQHjKvsEBv/lZa6i/wlnLcU1av w97AyrJ+SxAgPKI19qqyD6EeWcAiTwgC1mBf42AVXa376tOBNXNwPWcGKntNBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOSLUqt8gKaW/1xyrr/QJsFGl2ZBviltAl0aeclSZlw=; b=KvKUJTonI7N4VdPTdBFwfmw3PwxFp71aYr1zxzswc3dJl/D0Q1mV+j2jTbhCso3ae8OIeL UhGrQ4kYPKXgVjFzWFwLIRecKs03yU5JzxABcMlXgzghjVnxOAC6Rb6PBLPlbrMym37x/I NGujp1PBSusy4/O4k/Q1TCAsFOFG2yUdZanSKc8I1gxVMwvJWS1AxVNZaFzwXmOVDNUivE /hAFk08n+NvJYd6WY3Jd+ETky3C2/npA2MpT19WN7YRwBqFj/xOfNLD9ZjShj1SQol4S+H MM7rr+CD/H2GoUd4xgcISKVzTfBNbvAcnpY37FOypG7uCHL1+jwBaP+JIkSEsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscW6TwGz17wd; Mon, 26 Aug 2024 13:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDspU3017555; Mon, 26 Aug 2024 13:54:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsps2017552; Mon, 26 Aug 2024 13:54:51 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:51 GMT Message-Id: <202408261354.47QDsps2017552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: f63d0c39d9d7 - stable/14 - ObsoleteFiles.inc: Update after sound changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f63d0c39d9d748bbb2cecaf4c7799059b2dd5939 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f63d0c39d9d748bbb2cecaf4c7799059b2dd5939 commit f63d0c39d9d748bbb2cecaf4c7799059b2dd5939 Author: Christos Margiolis AuthorDate: 2024-08-24 12:08:15 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:43 +0000 ObsoleteFiles.inc: Update after sound changes Sponsored by: The FreeBSD Foundation (cherry picked from commit c3516c6533a17dbd980b5a2a8f566ada99c4b72d) --- ObsoleteFiles.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4ae15082cdfd..788edc0eac38 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,16 @@ # xargs -n1 | sort | uniq -d; # done +# 20240824: sound examples: midi.c moved out of oss/ +OLD_FILES+=share/examples/sound/oss/midi.c + +# 20240824: sound examples: Remove ossinit.h and rename basic.c to audio.c +OLD_FILES+=share/examples/sound/oss/ossinit.h +OLD_FILES+=share/examples/sound/oss/basic.c + +# 20240824: sound examples: Remove ossmidi.h +OLD_FILES+=share/examples/sound/oss/ossmidi.h + # 20240801: retire ifaddr_byindex OLD_FILES+=usr/share/man/man9/ifaddr_byindex.9.gz From nobody Mon Aug 26 13:54:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscY4wtwz5SyFC; Mon, 26 Aug 2024 13:54: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 4WsscY3ZX8z4fbD; Mon, 26 Aug 2024 13:54:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Od9ExCjs5KW0uJt++jfW/RWazoPsArEuH7PLs4jfwg=; b=rVs0WCUeBH1jH/83RVqS+i+qFTQZy6SpwrGk26VAl4/6TrrdwhEm5VUPJxh8QNZ7rLC1sx gNn5bWC4i4QStOu9VK8HDXXW87/z2pW1YfLQda8WvZa6FD5xI84iQcDQ7W3O3iZkg2rtIH dobwFqKIaVDsPAgKHWUi2aZgdjkwQJaoK/gnLmUH8tPJ/84rsfs1yN+mmy34BOOw2Jarhb 6VUImx+MEqiV7rF+isBo8vb5bYPRYe+gpPpUXZp00xEr3j41DrfE8O0NwxA9hYopMzkpOR HckkwYmCVtqgL46bk6Kb1nYcMfGf/Y1FCjeQZZZV8LnQcvxl9/rPb8+SHVd08w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680493; a=rsa-sha256; cv=none; b=k58GF1UQdTTUhXdJdLbMIFbH+niWxzYDeqTcwH6uLnDosPWjiYCW5Nw0h/xG3K0Fid8sqL 8wIbaVh0YEI9CoY922PxCT2J+q0IjR5i4J+94cspvnaVi8KgyX48BfqW+UOqBnaelU6UNN ZH4a2UDLSk/5Vdj/MWYiBmXjfJCyMPyRFyphPNb/yZMo4mtkgyB7Ie9ym9RblT21u1pJOp P1Wt8gvNOG9KlriOUFPWZwopJ8q8Pj2Hu1dc8bOK6mPQyreTTRBP+lu7ZbvpnWmJ1c+q0i XUK+bwLWMGt00a9KS4Dr3+J3ubV2M9KMCFvDalUwzOnAU7vCy87jC3nUis6nNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Od9ExCjs5KW0uJt++jfW/RWazoPsArEuH7PLs4jfwg=; b=ee8pXR53JacXhXdqyhKmJx0seEtc0UC4YOCmHJK2aAPm0rmtem2mwCChgS+51sOvgzbKJ2 yeXRpaUZNQtqezLxIObRWHrrLoOqHTuzq7KewPcEV+3OyrbUjR1SYfQTdRruOCDOy3yJUc inDCq4q8M5Ko0VEyrfhDk5ZzL24z5BlMoAAB1ZNm1Kix9XGVH4RcnwByr4LFhJ/nPwf2YK AtofYDhAEUjFWKwCqYrNhzZPf1s+RSsgp3p+a5xBwoUIHt1LXah6Yh6B2ZWWLD/ia7q8tC VFJcUahoE+y9nKdC9roS8C1kiOI67Kmv/ls+tR4Iqn8plLpIPph4G6jnAsgpfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscY0ksDz17wf; Mon, 26 Aug 2024 13:54: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 47QDsrfZ017603; Mon, 26 Aug 2024 13:54:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsq3I017600; Mon, 26 Aug 2024 13:54:52 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:52 GMT Message-Id: <202408261354.47QDsq3I017600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 91b1e2a4a84b - stable/14 - sound examples: Delete stale ossinit.h file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 91b1e2a4a84ba90c40eed9378a5be4cfbd623037 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=91b1e2a4a84ba90c40eed9378a5be4cfbd623037 commit 91b1e2a4a84ba90c40eed9378a5be4cfbd623037 Author: Christos Margiolis AuthorDate: 2024-08-24 12:16:21 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:54:00 +0000 sound examples: Delete stale ossinit.h file Fixes: 3decd659a788("sound examples: Simplify audio example") Sponsored by: The FreeBSD Foundation MFC after: 2 days (cherry picked from commit 7ae4868a9a1ad255e03529f5872c78f14f215f25) --- share/examples/sound/oss/ossinit.h | 262 ------------------------------------- 1 file changed, 262 deletions(-) diff --git a/share/examples/sound/oss/ossinit.h b/share/examples/sound/oss/ossinit.h deleted file mode 100644 index 5fd614ecb4fb..000000000000 --- a/share/examples/sound/oss/ossinit.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2021 Goran Mekić - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include - - -#ifndef SAMPLE_SIZE -#define SAMPLE_SIZE 16 -#endif - -/* Format can be unsigned, in which case replace S with U */ -#if SAMPLE_SIZE == 32 -typedef int32_t sample_t; -int format = AFMT_S32_NE; /* Signed 32bit native endian format */ -#elif SAMPLE_SIZE == 16 -typedef int16_t sample_t; -int format = AFMT_S16_NE; /* Signed 16bit native endian format */ -#elif SAMPLE_SIZE == 8 -typedef int8_t sample_t; -int format = AFMT_S8_NE; /* Signed 8bit native endian format */ -#else -#error Unsupported sample format! -typedef int32_t sample_t; -int format = AFMT_S32_NE; /* Not a real value, just silencing - * compiler errors */ -#endif - - - -/* - * Minimal configuration for OSS - * For real world applications, this structure will probably contain many - * more fields - */ -typedef struct config { - char *device; - int channels; - int fd; - int format; - int frag; - int sample_count; - int sample_rate; - int sample_size; - int chsamples; - int mmap; - oss_audioinfo audio_info; - audio_buf_info buffer_info; -} config_t; - - -/* - * Error state is indicated by value=-1 in which case application exits - * with error - */ -static inline void -check_error(const int value, const char *message) -{ - if (value == -1) { - fprintf(stderr, "OSS error: %s %s\n", message, strerror(errno)); - exit(1); - } -} - - - -/* Calculate frag by giving it minimal size of buffer */ -static inline int -size2frag(int x) -{ - int frag = 0; - - while ((1 << frag) < x) { - ++frag; - } - return frag; -} - - -/* - * Split input buffer into channels. Input buffer is in interleaved format - * which means if we have 2 channels (L and R), this is what the buffer of - * 8 samples would contain: L,R,L,R,L,R,L,R. The result are two channels - * containing: L,L,L,L and R,R,R,R. - */ -void -oss_split(config_t *config, sample_t *input, sample_t *output) -{ - int channel; - int index; - - for (int i = 0; i < config->sample_count; ++i) { - channel = i % config->channels; - index = i / config->channels; - output[channel * index] = input[i]; - } -} - - -/* - * Convert channels into interleaved format and place it in output - * buffer - */ -void -oss_merge(config_t *config, sample_t *input, sample_t *output) -{ - for (int channel = 0; channel < config->channels; ++channel) { - for (int index = 0; index < config->chsamples; ++index) { - output[index * config->channels + channel] = input[channel * index]; - } - } -} - -void -oss_init(config_t *config) -{ - int error; - int tmp; - - /* Open the device for read and write */ - config->fd = open(config->device, O_RDWR); - check_error(config->fd, "open"); - - /* Get device information */ - config->audio_info.dev = -1; - error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); - check_error(error, "SNDCTL_ENGINEINFO"); - printf("min_channels: %d\n", config->audio_info.min_channels); - printf("max_channels: %d\n", config->audio_info.max_channels); - printf("latency: %d\n", config->audio_info.latency); - printf("handle: %s\n", config->audio_info.handle); - if (config->audio_info.min_rate > config->sample_rate || config->sample_rate > config->audio_info.max_rate) { - fprintf(stderr, "%s doesn't support chosen ", config->device); - fprintf(stderr, "samplerate of %dHz!\n", config->sample_rate); - exit(1); - } - if (config->channels < 1) { - config->channels = config->audio_info.max_channels; - } - - /* - * If device is going to be used in mmap mode, disable all format - * conversions. Official OSS documentation states error code should not be - * checked. http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 - */ - if (config->mmap) { - tmp = 0; - ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); - } - - /* - * Set number of channels. If number of channels is chosen to the value - * near the one wanted, save it in config - */ - tmp = config->channels; - error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); - check_error(error, "SNDCTL_DSP_CHANNELS"); - if (tmp != config->channels) { /* or check if tmp is close enough? */ - fprintf(stderr, "%s doesn't support chosen ", config->device); - fprintf(stderr, "channel count of %d", config->channels); - fprintf(stderr, ", set to %d!\n", tmp); - } - config->channels = tmp; - - /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ - tmp = config->format; - error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); - check_error(error, "SNDCTL_DSP_SETFMT"); - if (tmp != config->format) { - fprintf(stderr, "%s doesn't support chosen sample format!\n", config->device); - exit(1); - } - - /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ - tmp = config->sample_rate; - error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); - check_error(error, "SNDCTL_DSP_SPEED"); - - /* Get and check device capabilities */ - error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); - check_error(error, "SNDCTL_DSP_GETCAPS"); - if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) { - fprintf(stderr, "Device doesn't support full duplex!\n"); - exit(1); - } - if (config->mmap) { - if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) { - fprintf(stderr, "Device doesn't support triggering!\n"); - exit(1); - } - if (!(config->audio_info.caps & PCM_CAP_MMAP)) { - fprintf(stderr, "Device doesn't support mmap mode!\n"); - exit(1); - } - } - - /* - * If desired frag is smaller than minimum, based on number of channels - * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer size - * is 2^frag, but the real size of the buffer will be read when the - * configuration of the device is successfull - */ - int min_frag = size2frag(config->sample_size * config->channels); - - if (config->frag < min_frag) { - config->frag = min_frag; - } - - /* - * Allocate buffer in fragments. Total buffer will be split in number - * of fragments (2 by default) - */ - if (config->buffer_info.fragments < 0) { - config->buffer_info.fragments = 2; - } - tmp = ((config->buffer_info.fragments) << 16) | config->frag; - error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); - check_error(error, "SNDCTL_DSP_SETFRAGMENT"); - - /* When all is set and ready to go, get the size of buffer */ - error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); - check_error(error, "SNDCTL_DSP_GETOSPACE"); - if (config->buffer_info.bytes < 1) { - fprintf( - stderr, - "OSS buffer error: buffer size can not be %d\n", - config->buffer_info.bytes - ); - exit(1); - } - config->sample_count = config->buffer_info.bytes / config->sample_size; - config->chsamples = config->sample_count / config->channels; -} From nobody Mon Aug 26 14:29:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WstNT383xz5T1fJ; Mon, 26 Aug 2024 14:29: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 4WstNT2X7Yz4kPg; Mon, 26 Aug 2024 14:29:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724682569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+/v6V61DCdThUGbF1mjkKntRR6vdkub3JMTNyeCex7s=; b=TW8kF89athcIWGG4kaQ3+fr+q00uqfxt/pQN1/KbHZYJfYj3hk27EPZSiF7V8yzw1uCUeW YOwVNMNC2ONs/effCeyk/guXfziDXBtFAwy5/WGmlSTaoaxpfV4ZpRe+2vlrpXFDMP99Dx +E/lUWUFKkw1B9UigDnR5pDygs0LEVKbIS7Z3HLpy5uyCPMgzEL2aok/NcF3BcqjB1KBzs pjKcYVilFWJHfYfIXUX0bYjuIZmnt/HIW3zkjDeIeYsNtWK+FPQvxK4bDM4rN1hRYZReBs 4jIotYMh3g+YMvlTvUZxFSy31mQzf24ZAALl9Nni2dm9TGKl2W7nTPz5rZG/mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724682569; a=rsa-sha256; cv=none; b=h0llTvtjtUJnV17H196/RUtJx4bkWkFhZ3aiKwFAsIRIDsbhuEhkSODZ1tvjaAJdSZIIG/ xmGBdzbJDPv//SlEbKctvfNAo2ceoULuNzJrnklRpI3FeODo0w50f1j+ztzpr2Dx2rrQIL mMEvHl96Xqc3SDUF162XlTG7DpjZG9LkcSg03uu5S8UaWBQ6uqYyeQXQNvNCq64al6ISTm dacoS9TQVb2Rz/WEDPrmjiW9MCOc35GfUkRK2jwpSjna/Elijs6ghXBfBpytE8Uj0HElZg K6BFuX6d62gXq2X5dGD5sKemnSNVLqw1iyXDv4EOhDL3eoZSSdjIy9z5Ks6lww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724682569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+/v6V61DCdThUGbF1mjkKntRR6vdkub3JMTNyeCex7s=; b=YDrVzxJc1lECQFXXLAOIGeoNY0bSSBR6fryN5Byf7raKp6qEJNNW3pvYt2pXuZOhlLsj1Y FTaVT0flyDD1WCRyECAvo4T8yHjNc7Qa9qsNqH29YZaniOuCXWH7emQdlhLDNJG9I8rb/z tEX2aVoTXUYt/awMArqEuvsHQGh0VYqgyw9XjJaC1ftUInA//fsQ25G6pgRy9SXL+pf9DF 954c3RKlKmCn99v6HMR0S7QnGnCfVuzYeQBwa9yrcd2PNRS/JIH5RUqDAV708/AKRneM+5 +AvsQDUW42XGp4rpeLoeO4HKOhxogRzhhQcEhuVwM69hTSOnjd0qwRaIPDz1Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WstNT1nlFz18Z1; Mon, 26 Aug 2024 14:29: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 47QETTDA070150; Mon, 26 Aug 2024 14:29:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QETTWx070147; Mon, 26 Aug 2024 14:29:29 GMT (envelope-from git) Date: Mon, 26 Aug 2024 14:29:29 GMT Message-Id: <202408261429.47QETTWx070147@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: 49a5fe1a017f - main - asmc: Add support for MacbookPro11,4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49a5fe1a017fc179c79b74f409440e070511a0ab Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49a5fe1a017fc179c79b74f409440e070511a0ab commit 49a5fe1a017fc179c79b74f409440e070511a0ab Author: Joshua Rogers AuthorDate: 2024-06-11 19:51:51 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 14:27:58 +0000 asmc: Add support for MacbookPro11,4 Signed-off-by: Joshua Rogers MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1366 --- sys/dev/asmc/asmc.c | 6 ++++++ sys/dev/asmc/asmcvar.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index ab0a614aa50f..f321a3cdc5f7 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -278,6 +278,12 @@ static const struct asmc_model asmc_models[] = { ASMC_MBP113_TEMPS, ASMC_MBP113_TEMPNAMES, ASMC_MBP113_TEMPDESCS }, + { + "MacBookPro11,4", "Apple SMC MacBook Pro Retina Core i7 (mid 2015, 15-inch)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP114_TEMPS, ASMC_MBP114_TEMPNAMES, ASMC_MBP114_TEMPDESCS + }, + /* The Mac Mini has no SMS */ { "Macmini1,1", "Apple SMC Mac Mini", diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 42e3120ff4ff..73a8fc449c2c 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -432,6 +432,40 @@ struct asmc_softc { "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ "Ts1S" } + +#define ASMC_MBP114_TEMPS { "IC0C", "ID0R", "IHDC", "IPBR", "IC0R", \ + "IO3R", "IO5R", "IM0C", "IC1C", "IC2C", \ + "IC3C", "ILDC", "IBLC", "IAPC", "IHSC", \ + "ICMC", "TC0P", "TP0P", "TM0P", \ + "Ta0P", "Th2H", "Th1H", "TW0P", "Ts0P", \ + "Ts1P", "TB0T", "TB1T", "TB2T", "TH0A", "TH0B", \ + "TC1C", "TC2C", "TC3C", "TC4C", "TCXC", \ + "TCGC", "TPCD", "TCSA", "VC0C", "VD0R", \ + "VP0R", "ALSL", "F0Ac", "F1Ac", "PCPC", \ + "PCPG", "PCPT", "PSTR", "PDTR", NULL } + +#define ASMC_MBP114_TEMPNAMES { "IC0C", "ID0R", "IHDC", "IPBR", "IC0R", \ + "IO3R", "IO5R", "IM0C", "IC1C", "IC2C", \ + "IC3C", "ILDC", "IBLC", "IAPC", "IHSC", \ + "ICMC", "TC0P", "TP0P", "TM0P", \ + "Ta0P", "Th2H", "Th1H", "TW0P", "Ts0P", \ + "Ts1P", "TB0T", "TB1T", "TB2T", "TH0A", "TH0B", \ + "TC1C", "TC2C", "TC3C", "TC4C", "TCXC", \ + "TCGC", "TPCD", "TCSA", "VC0C", "VD0R", \ + "VP0R", "ALSL", "F0Ac", "F1Ac", "PCPC", \ + "PCPG", "PCPT", "PSTR", "PDTR" } + +#define ASMC_MBP114_TEMPDESCS { "CPU High (CPU, I/O)", "DC In", "SSD", "Charger (BMON)", "CPU", \ + "Other 3.3V", "Other 5V", "Memory", "Platform Controller Hub Core", "CPU Load Current Monitor", \ + "CPU DDR", "LCD Panel", "LCD Backlight", "Airport", "Thunderbolt", \ + "S2", "CPU Proximity", "Platform Controller Hub", "Memory Proximity", "Air Flow Proximity", \ + "Left Fin Stack", "Right Fin Stack", "Airport Proximity", "Palm Rest", "Palm Rest Actuator", \ + "Battery Max", "Battery Sensor 1", "Battery Sensor 2", "SSD A", "SSD B", \ + "CPU Core 1", "CPU Core 2", "CPU Core 3", "CPU Core 4", "CPU PECI Die", \ + "Intel GPU", "Platform Controller Hub PECI", "CPU System Agent Core", "CPU VCore", "DC In", \ + "Pbus", "Ambient Light", "Leftside", "Rightside", "CPU Package Core", \ + "CPU Package GPU", "CPU Package Total", "System Total", "DC In" } + #define ASMC_MM_TEMPS { "TN0P", "TN1P", NULL } #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ From nobody Mon Aug 26 15:21:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsvXx303mz5T5y1; Mon, 26 Aug 2024 15:21: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 4WsvXx2QFZz4nyX; Mon, 26 Aug 2024 15:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724685713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W/WwTFTi7wqhtE63a4F5LwGuuy7D30doaqwtPSs7y6c=; b=oL+4dRorwK9gl5fnpL+AkL0gVUV42KF9FTDk96J3Bw3gddVDP2l1jYqjyrpOi/jdqPp+2o vTke4UdgNrrKT5JV6wmpDwVULFxAVgWH8i+XvPbzogdKiEgJYkAk9H9JjX878AUYx2eps2 JttkU60gRMH4Wa6YhRMEnobNT7yAJXMU5g5M5KRlrduZ9+QwqKsXk0OPiGPa65OjwuRfG/ 8q8nX4L7eZqZR5NJsGtk955L+KBoouQAkGgn1I3f3sJptm2+1leYTr6UtE84iavAUnIoTX Djh8ADqDiA2EJ+MWQ4Tvvm91svbPLdH5UA4lZOwq7fesiuahwUDS6W7GDIDjjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724685713; a=rsa-sha256; cv=none; b=ntv2y+6LEBV8ubVfublUEBjnC8eZA2976WwO23X37O9SwdFej+Q98Dn+BD9EAi9bY/OgjP JCJjRFjXayfdlxAop5RV55O9+uzB4M03lhy+z0vhIaRJaxu9diaTr0iGDsKC7s8B2AkCol Mtet3s+quXPHlTL7EZYfFE5b+8HK1fpwCAj4HlWllWBDPAwwu6hx5/WbPcqnBJXXxQP8FR DwNhuDyHeYHvTFUmaV5qCJI75GtWjsTHBpjWLqhcN/gA1i+dBt/r4hJUpLMPCTD2sZDs5e D18a2GM4uW+vOR2QhSdCuUfLLrgD9/g3JEWi2zSd0ZfgebYLTd8VBWUHNqkugg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724685713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W/WwTFTi7wqhtE63a4F5LwGuuy7D30doaqwtPSs7y6c=; b=yO5cbczfQubILDZJBrAK6yjCRbtH272iY+qgzMXJSt7ojK+6Xw8B63/AyWvYYk6yrQq7ni fl3IGaYFinz3YlFum7+5bSCdwxDZ/Tp9Pnt3bh25tpcj/U4JIpV7OO0vTrZnQlzjqYlPQ8 reKy7zlWirj3LlMTYLC9O2cTezHblZ/mBXLytfYeZ521lpftN8eYGSc8RCXbW6GDLACobL pdUGWk8/RWYYtzhQehZvNAslXrw1BbD+oxOz/06RFv7nzC4P8k+bQZbJHrF9AKZvMwUYTa +h1G6AJrbO5uWEvU99mjR88pjnLHnQ2ncG7Bfm6m4SERHZku6KDviR645Hsuwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsvXx21gGz1BnR; Mon, 26 Aug 2024 15:21: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 47QFLrBh068201; Mon, 26 Aug 2024 15:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QFLrK6068198; Mon, 26 Aug 2024 15:21:53 GMT (envelope-from git) Date: Mon, 26 Aug 2024 15:21:53 GMT Message-Id: <202408261521.47QFLrK6068198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: e3819923655c - releng/13.4 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/13.4 X-Git-Reftype: branch X-Git-Commit: e3819923655c544b5494293d48d19067c67eb832 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=e3819923655c544b5494293d48d19067c67eb832 commit e3819923655c544b5494293d48d19067c67eb832 Author: Oliver Fromme AuthorDate: 2024-08-23 04:46:19 +0000 Commit: Xin LI CommitDate: 2024-08-26 15:21:13 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19, model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This enables temperature readings of these CPUs via sysctl. The sensors function identically to those for the "Raphael" processors (model 0x60-0x6f); only the PCI device ID differs. PR: kern/280942 Relnotes: yes Approved by: re (cperciva) (cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c) (cherry picked from commit cb8f15aeede63627e220c40fe4911df79f35fb69) --- sys/dev/amdsmn/amdsmn.c | 7 +++++++ sys/dev/amdtemp/amdtemp.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index decb2c1249ed..fbef358f4957 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,6 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; struct amdsmn_softc { @@ -116,6 +117,12 @@ static const struct pciid { .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_19H_M70H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, }; /* diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index b38f92131c77..0e7f805b40fd 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,6 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -142,6 +143,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M60H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M10H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M60H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB19H_M70H_ROOT, false }, }; /* @@ -875,6 +877,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) _Static_assert((int)NUM_CCDS >= 12, ""); break; case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */ + case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */ sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); From nobody Mon Aug 26 15:51:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WswCY4YWzz5T7Tj; Mon, 26 Aug 2024 15:51: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 4WswCY464yz4s1D; Mon, 26 Aug 2024 15:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZEYv/unH5+0QmDenqvD9xeQJxOGSmXNfS9qXmlC0X9w=; b=A7KTiclbXQDjdCPYljgI6EJ3PNtR/rklJWh0dL52JVsdQ/CwjAteNqFCyCJD2WJQz22+vn m5b4o00rN8HkbeRST3nAl7Nf4IGjfOA4ns+0z3DbUVDjxaTvGz/RTZ+nBzkliD979EoMWz j0sb+TQ8dDozqQMnIuQsod8IGOhp6csAvcAW6qFSzi+SqMI0j5iBuFM/BaSMulrHBMRhR+ Z3RfqgW6ekyQlI+j086L+kYgtx7sUjCwQgnJS6vKWF+Zstx6qtV0RKXYowSsnLp+yZzuNQ YzECU6mMxzviJeSKGZ52Du09Zem4rbBEBqkNcpNmPg9pGQbQ/8412fQcGAw3Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724687513; a=rsa-sha256; cv=none; b=bnC4jWBwtWqlnotzjWZQxXXGBsVKoVdWFDkOKnmJf1AqIpAbD2vhP0lLa9vakCx3DkgVFP mggZTtqFJvd3U3FxKNqB4XLsB2ZbftwA3WWf9kvBiTD/UcZvdWouSKDJWaGDRohkHAdEFI i4Eqlyfg60J6E3yqU59wjNDeoSy94rPYGrj9ZBFiy+syo2a86tOqgLhSvQdXcxCc3z8aBI lgNmL5lwa7J1zu/9UgE+4cX8Xnh6fCMW/rRaQ4WxomR+imk9CdiOT5W44VwvxKGpBKQJtJ u867idtx1qlzA50UM6OjwOWDpzgjZBTUn9qguY3HeKwzYmWbcX5M+o7nBOeyZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZEYv/unH5+0QmDenqvD9xeQJxOGSmXNfS9qXmlC0X9w=; b=JPy+fQ38PYt3osV4NhsHJ2SclGGjKJwLJBJRot9RTsjnDWZU4sSoao/iVW/w8RT9OZc9rg ljlSUqFOTJpzHyrKJo4Hk9KTAMB4QBB8OYD/Hbj20ofGbNPLcwGquSsnZtwSyVJP2pjbb0 jMVMYt9W2engYdw4/G7YUr+19ril1pTV1QVaZjDo8g44JXogpVrUZlrS0SAhesUdhgfIG9 8+UmSt4e7zxpRo/YNSKq1LK0rN35KlMzCR3cbUfA434TsYsN880gNMVcBDwD52PJQuYSw5 A8zX7p5KBNjw0T+vX2udYRqZuOSrNGo0xiPBohwSS73yOdkhGjRjvU/SUOabzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WswCY3jgFz1CTy; Mon, 26 Aug 2024 15:51: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 47QFpr2a015384; Mon, 26 Aug 2024 15:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QFprrl015381; Mon, 26 Aug 2024 15:51:53 GMT (envelope-from git) Date: Mon, 26 Aug 2024 15:51:53 GMT Message-Id: <202408261551.47QFprrl015381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 31ad232d8565 - stable/14 - Revert "mcast: fix memory leak in imf_purge()" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 31ad232d85656af77726626decce6c2b7fd824f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=31ad232d85656af77726626decce6c2b7fd824f6 commit 31ad232d85656af77726626decce6c2b7fd824f6 Author: Kristof Provost AuthorDate: 2023-12-12 18:20:03 +0000 Commit: Warner Losh CommitDate: 2024-08-26 15:45:58 +0000 Revert "mcast: fix memory leak in imf_purge()" This reverts commit fa03d37432caf17d56a931a9e6f5d9b06f102c5b. This commit caused us to not send IGMP leave messages if the inpcb went away. In other words: we freed pending packets whenever the socket closed rather than when the interface (or address) goes away. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43032 (cherry picked from commit c196e43243b83840cc9f3d1dadc7dacb3b0f556f) --- sys/netinet/in_mcast.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 94fc807ccea7..f93c4b0dac8c 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -915,8 +915,6 @@ imf_purge(struct in_mfilter *imf) imf->imf_st[0] = imf->imf_st[1] = MCAST_UNDEFINED; KASSERT(RB_EMPTY(&imf->imf_sources), ("%s: imf_sources not empty", __func__)); - if (imf->imf_inm != NULL) - mbufq_drain(&imf->imf_inm->inm_scq); } /* From nobody Mon Aug 26 15:51:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WswCZ6g0hz5T8Gg; Mon, 26 Aug 2024 15:51: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 4WswCZ5Mkhz4sFs; Mon, 26 Aug 2024 15:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M9M6Eq3JFMA6qXZpD45gQxgLHXammxIsjqAkDAWRtMo=; b=yjl/cCvQV5CusTwUwUcQnyKuqk/+eI4vgvCOzTaqaLRat5zL1ohXot/XQ1mZk7isvH6a38 3+YSBIdw015jtmUoJYOdKxHSULimAHWIHHiUgbSgEa8blq9/CXi2z/s+71AJSCc/o70Xss A1v5DFdNlknsfu2gR51/2ElnP3OXJMKfOEnqmCM0+zhd8TxbVIwBde1OaCUDm2hvlfOA/6 sJhPdNNAm3FFucFdlsNnpxgt3499NfTQqNwT1fZlecbqK6sTkGABY4KJEKTYBYBY8UyDxM BIYs1ZF9GSZTEwysKvNdEdZBybZqj80mUrExjmBjwOU5d+xcWUgGynZceNQbcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724687514; a=rsa-sha256; cv=none; b=ZdxNO7nBI7GTWObgu/gjec96U3hnxCXz2j9VvkHPfVsdEwSo9qrQTfolzBnNEj7Yglrqmg T4dZH4pMFLRTI65FTl4U7mM8YIn5cuTm2XFnfJmou5x3ImZy6kNgepA3MljAjZTV4Wsd8C dhpAPGlxjsAk5T4VfsBen2Wuz95GFtck00HAYrKMwqCqqqMXPqzg45+qsxJ5rdWdhj0sVE 7IS3cRFuorr0pYDQ/d1wdv6ff7y45vwhah1oK68QvqEr5pI1OpY4RjEsPaq4c+zDdet9zO icHhsCakl9YhTxCJuhPNLsXz0gTmXTywJR4WMYW+w05/xQjWcVgcL5ghWysQ1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724687514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M9M6Eq3JFMA6qXZpD45gQxgLHXammxIsjqAkDAWRtMo=; b=p2GfPSoNE9I/JMPF2EwFFSDFFCPNMWU+6J4SnX/Q+zPXC3dV4PCxtw91VC3C284gD4ZxBO E5lzHuZTpBdrKOcWfnQI5hD3esRbjdVEcG5iXEBkAn3Kw3gKEUwJ4C1VEKcQoCcnPvUKqu MNwPs9RKUUjo6Ps+qX/SKp55OROSKdN4iFCB1vpcuFXZeDwbCK2z82z68pJueZ6F2OnLG/ AGVjQeCn8j4FNqsli8r7qxRTd1p+05MHiFCSbXkw/JQRLQrLuFjaxEhCOWwdmi/SmeiYC5 Af2zgcLfJjue42KwbT8GEfDGOx8xDyXYk0NtQAw5sV9t+5OIVtsWFHtP2k1Hng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WswCZ50Krz1CX4; Mon, 26 Aug 2024 15:51: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 47QFpsJX015437; Mon, 26 Aug 2024 15:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QFpseU015434; Mon, 26 Aug 2024 15:51:54 GMT (envelope-from git) Date: Mon, 26 Aug 2024 15:51:54 GMT Message-Id: <202408261551.47QFpseU015434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 88e1bc06692a - stable/14 - mcast: fix leaked igmp packets on multicast cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88e1bc06692ae4552462945c53b5047e8dad5929 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=88e1bc06692ae4552462945c53b5047e8dad5929 commit 88e1bc06692ae4552462945c53b5047e8dad5929 Author: Kristof Provost AuthorDate: 2023-12-13 12:32:08 +0000 Commit: Warner Losh CommitDate: 2024-08-26 15:46:21 +0000 mcast: fix leaked igmp packets on multicast cleanup When we release a multicast address (e.g. on interface shutdown) we may still have packets queued in inm_scq. We have to free those, or we'll leak memory. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43033 (cherry picked from commit c2e340452c147b551180f2a1600ae76491342b0e) --- sys/netinet/in_mcast.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index f93c4b0dac8c..3dc4fa271683 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1181,6 +1181,7 @@ inm_purge(struct in_multi *inm) free(ims, M_IPMSOURCE); inm->inm_nsrc--; } + mbufq_drain(&inm->inm_scq); } /* From nobody Mon Aug 26 16:28:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsx1T5kD9z5TCbX; Mon, 26 Aug 2024 16:28: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 4Wsx1T5Nspz4vpY; Mon, 26 Aug 2024 16:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724689693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PtLT7ejOlTSPiAF62ZwtqFee9ZXWL0W0lEhY3/0G8o=; b=JY3GFB+5i1Sf/W+LhYpfllJ6VA2QFpdD6LHPlzPmEx8bT+l6TDbtW+oI4h7F6KONnNZYwI aFfyL80HIvix05QK0gEqDmsBxVjj3zIHW+4VfP0l90qdGPCTfQbY5V0AUofkTur7QdWB4c XPKOZL50PInFa15NDfFPBy4abwqqsTZWAQIjnDEIHbJzrhX0nXPjd2TkhW6toR9x9NUsAy 2yYdwCefJNIl35QWPwO7RlyhJUahPlKz1gYas5bjbTEr4G1h6FuTOFxhyFyRrlud4QcuU4 uAUwrt15j/Gr3e17ndJIL852cHetmQAYXeu+nqsndAJUzU4qPbL/zf+d/43Jpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724689693; a=rsa-sha256; cv=none; b=ZARx9ZOkP76V/f/c8zY4MRTGeBEtaWqaMoVlCUOyAgDnKfpFcuEhvOUrzjcrrd4k3T4oiu uK1RI4ugbxNHJfi4Ro/gNUPxw+5GPJpM+rY5Gj9UYC1tifsHI3j447FS4GQrVwCxNMTIpA tC/EC3dUHual9B1osXJ/99xO0wSjUDAvKDuReDMp066TpC+FZRi0VWSThXCKLeCGuObORT qdJDCPMYx/duzME6M0A0ZqdTBoe4LD8k6c0iuAxSnP4ZW9QMYhhCtwfH6lzbZsVbceZHbN izioR751G5J+Kvq6v1X1zv8dUYWNAUEJSqGGJ2rs66DXc9JxEdTZzsJuJToaXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724689693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PtLT7ejOlTSPiAF62ZwtqFee9ZXWL0W0lEhY3/0G8o=; b=JHNl32gJd11rxYUwbE7AeUnuyYUJydADANkk0V32PvDICkTCWlWgl7zIbnsrlyLMEsnf2K u3QDJGJ6bMmRwMJxfDmLjDJXKrwVghe7vhigdYWRU5Ip+6vuviDFBjeY9xmTPwsffnDVbd KpOtxxLCNtuosKkbxplnG4y9EY+QaYL3IS8/sMvqPXGRqbOdt4Wt7RAf5IVadVc60sT/GD XejkyJXWLs63FWxwvdyncx92ntDASOxEyLRNAaQYIGIiOHXXOXWrLthgRtHYCTroFuSXZj GEH7ahAdEtaVWYhOIZ8lLyv3KRJZAR7YACtGWtkX++cu0KFdXBwBpKseT8Kjhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsx1T4hV0zDrd; Mon, 26 Aug 2024 16:28: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 47QGSDfc072641; Mon, 26 Aug 2024 16:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QGSD1E072637; Mon, 26 Aug 2024 16:28:13 GMT (envelope-from git) Date: Mon, 26 Aug 2024 16:28:13 GMT Message-Id: <202408261628.47QGSD1E072637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 12e0d316644a - main - vendor/bc: upgrade to version 7.0.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12e0d316644a4f80f5f1f78cf07bd93def43b1ca Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=12e0d316644a4f80f5f1f78cf07bd93def43b1ca commit 12e0d316644a4f80f5f1f78cf07bd93def43b1ca Author: Stefan Eßer AuthorDate: 2024-08-23 16:45:58 +0000 Commit: Stefan Eßer CommitDate: 2024-08-26 16:27:29 +0000 vendor/bc: upgrade to version 7.0.0 This is a production release to fix three bugs, none of which affects well formed scripts on FreeBSD: The first bug is that bc/dc will exit on macOS when the terminal is resized. The second bug is that an array, which should only be a function parameter, was accepted as part of larger expressions. The third bug is that the value stack for dc was cleared on any error. However, this is not how other dc behave. To bring dc more in line with other implementations, this behavior was changed. This change is why this version is a new major version. (cherry picked from commit 54d20d67e2af28d948ce2df13feb039fa10900fc) MFC after: 3 days --- contrib/bc/Makefile.in | 10 +++- contrib/bc/NEWS.md | 14 +++++ contrib/bc/compile_flags.txt | 1 + contrib/bc/configure.sh | 120 ++++++++++++++++++++++++++++++-------- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/opt.h | 6 +- contrib/bc/include/ossfuzz.h | 79 +++++++++++++++++++++++++ contrib/bc/include/status.h | 25 ++------ contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 2 +- contrib/bc/manuals/dc/A.1 | 7 ++- contrib/bc/manuals/dc/A.1.md | 9 ++- contrib/bc/manuals/dc/E.1 | 7 ++- contrib/bc/manuals/dc/E.1.md | 9 ++- contrib/bc/manuals/dc/EH.1 | 7 ++- contrib/bc/manuals/dc/EH.1.md | 9 ++- contrib/bc/manuals/dc/EHN.1 | 7 ++- contrib/bc/manuals/dc/EHN.1.md | 9 ++- contrib/bc/manuals/dc/EN.1 | 7 ++- contrib/bc/manuals/dc/EN.1.md | 9 ++- contrib/bc/manuals/dc/H.1 | 7 ++- contrib/bc/manuals/dc/H.1.md | 9 ++- contrib/bc/manuals/dc/HN.1 | 7 ++- contrib/bc/manuals/dc/HN.1.md | 9 ++- contrib/bc/manuals/dc/N.1 | 7 ++- contrib/bc/manuals/dc/N.1.md | 9 ++- contrib/bc/scripts/os.c | 59 +++++++++++++++++++ contrib/bc/src/args.c | 4 +- contrib/bc/src/bc.c | 3 +- contrib/bc/src/bc_fuzzer.c | 112 +++++++++++++++++++++++++++++++++++ contrib/bc/src/bc_lex.c | 2 + contrib/bc/src/bc_parse.c | 23 +++++++- contrib/bc/src/data.c | 59 +++++++++++++++++++ contrib/bc/src/dc.c | 3 +- contrib/bc/src/dc_fuzzer.c | 112 +++++++++++++++++++++++++++++++++++ contrib/bc/src/dc_lex.c | 2 + contrib/bc/src/history.c | 2 +- contrib/bc/src/lang.c | 4 +- contrib/bc/src/lex.c | 8 +++ contrib/bc/src/main.c | 21 +++++-- contrib/bc/src/num.c | 4 ++ contrib/bc/src/opt.c | 14 ++--- contrib/bc/src/program.c | 13 +++-- contrib/bc/src/vm.c | 38 ++++++++++-- contrib/bc/tests/bc/errors/37.txt | 37 ++++++++++++ contrib/bc/tests/bc/errors/38.txt | 37 ++++++++++++ contrib/bc/vs/bc.vcxproj | 18 +++--- include/ossfuzz.h | 79 +++++++++++++++++++++++++ 50 files changed, 914 insertions(+), 133 deletions(-) diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 4adb76ddaa17..c63dc242e79a 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -94,6 +94,10 @@ BC = bc DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +BC_FUZZER = $(BIN)/$(BC)_fuzzer_c +BC_FUZZER_C = $(BIN)/$(BC)_fuzzer_C +DC_FUZZER = $(BIN)/$(DC)_fuzzer_c +DC_FUZZER_C = $(BIN)/$(DC)_fuzzer_C BC_TEST_OUTPUTS = tests/bc_outputs BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 @@ -149,8 +153,11 @@ BC_ENABLE_NLS = %%NLS%% BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%% BC_ENABLE_AFL = %%FUZZ%% +BC_ENABLE_OSSFUZZ = %%OSSFUZZ%% BC_ENABLE_MEMCHECK = %%MEMCHECK%% +LIB_FUZZING_ENGINE = %%LIB_FUZZING_ENGINE%% + BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%% BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%% DC_DEFAULT_SIGINT_RESET = %%DC_DEFAULT_SIGINT_RESET%% @@ -210,7 +217,8 @@ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) -CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS9 = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS = $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ) CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 95de7e5182c4..1775fa0b6533 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,19 @@ # News +## 7.0.0 + +This is a production release to fix three bugs. + +The first bug is that `bc`/`dc` will exit on macOS when the terminal is resized. + +The second bug is that an array, which should only be a function parameter, was +accepted as part of larger expressions. + +The third bug is that value stack for `dc` was cleared on any error. However, +this is not how other `dc` behave. To bring `dc` more in line with other +implementations, this behavior was changed. This change is why this version is a +new major version. + ## 6.7.6 This is a production release to fix one bug. diff --git a/contrib/bc/compile_flags.txt b/contrib/bc/compile_flags.txt index 7a08c87f3876..3324798013c6 100644 --- a/contrib/bc/compile_flags.txt +++ b/contrib/bc/compile_flags.txt @@ -13,3 +13,4 @@ -DBC_ENABLE_EXTRA_MATH=1 -DBC_ENABLE_HISTORY=1 -DBC_ENABLE_NLS=1 +-DBC_ENABLE_OSSFUZZ=0 diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index 43bb502ea817..442165d15693 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -68,7 +68,7 @@ usage() { printf ' [--man3dir=MAN3DIR]\n' if [ "$_usage_val" -ne 0 ]; then - exit + exit "$_usage_val" fi printf '\n' @@ -181,6 +181,8 @@ usage() { printf ' Enable a build appropriate for valgrind. For development only.\n' printf ' -z, --enable-fuzz-mode\n' printf ' Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n' + printf ' -Z, --enable-ossfuzz-mode\n' + printf ' Enable fuzzing mode for OSS-Fuzz. THIS IS FOR DEVELOPMENT ONLY.\n' printf ' --prefix PREFIX\n' printf ' The prefix to install to. Overrides "$PREFIX" if it exists.\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' @@ -722,6 +724,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -755,6 +758,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -772,7 +776,8 @@ predefined_build() { dc_default_digit_clamp=0;; GDH) - CFLAGS="-flto -Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories" + CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -789,6 +794,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -806,7 +812,8 @@ predefined_build() { dc_default_digit_clamp=1;; DBG) - CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories" + CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -823,6 +830,7 @@ predefined_build() { all_locales=0 library=0 fuzz=0 + ossfuzz=0 time_tests=0 vg=0 memcheck=1 @@ -888,6 +896,7 @@ strip_bin=1 all_locales=0 library=0 fuzz=0 +ossfuzz=0 time_tests=0 vg=0 memcheck=0 @@ -911,7 +920,7 @@ dc_default_digit_clamp=0 # getopts is a POSIX utility, but it cannot handle long options. Thus, the # handling of long options is done by hand, and that's the reason that short and # long options cannot be mixed. -while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do +while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do case "$opt" in a) library=1 ;; @@ -944,6 +953,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do T) strip_bin=0 ;; v) vg=1 ;; z) fuzz=1 ;; + Z) ossfuzz=1 ;; -) arg="$1" arg="${arg#--}" @@ -1070,6 +1080,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do enable-test-timing) time_tests=1 ;; enable-valgrind) vg=1 ;; enable-fuzz-mode) fuzz=1 ;; + enable-ossfuzz-mode) ossfuzz=1 ;; enable-memcheck) memcheck=1 ;; install-all-locales) all_locales=1 ;; help* | bc-only* | dc-only* | coverage* | debug*) @@ -1320,6 +1331,45 @@ elif [ "$dc_only" -eq 1 ]; then tests="test_dc" +elif [ "$ossfuzz" -eq 1 ]; then + + if [ "$bc_only" -ne 0 ] || [ "$dc_only" -ne 0 ]; then + usage "An OSS-Fuzz build must build both fuzzers." + fi + + bc=1 + dc=1 + + # Expressions *cannot* exit in an OSS-Fuzz build. + bc_default_expr_exit=0 + dc_default_expr_exit=0 + + executables="bc_fuzzer and dc_fuzzer" + + karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" + karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" + + if [ "$library" -eq 0 ]; then + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + else + install_prereqs=" install_library install_bcl_header" + install_man_prereqs=" install_bcl_manpage" + uninstall_prereqs=" uninstall_library uninstall_bcl_header" + uninstall_man_prereqs=" uninstall_bcl_manpage" + tests="test_library" + fi + + second_target_prereqs="src/bc_fuzzer.o $default_target_prereqs" + default_target_prereqs="\$(BC_FUZZER) src/dc_fuzzer.o $default_target_prereqs" + default_target_cmd="\$(CXX) \$(CFLAGS) src/dc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(DC_FUZZER) \&\& ln -sf ./dc_fuzzer_c \$(DC_FUZZER_C)" + second_target_cmd="\$(CXX) \$(CFLAGS) src/bc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(BC_FUZZER) \&\& ln -sf ./bc_fuzzer_c \$(BC_FUZZER_C)" + + default_target="\$(DC_FUZZER) \$(DC_FUZZER_C)" + second_target="\$(BC_FUZZER) \$(BC_FUZZER_C)" + else bc=1 @@ -1349,8 +1399,12 @@ else fi +if [ "$fuzz" -ne 0 ] && [ "$ossfuzz" -ne 0 ]; then + usage "Fuzzing mode and OSS-Fuzz mode are mutually exclusive" +fi + # We need specific stuff for fuzzing. -if [ "$fuzz" -ne 0 ]; then +if [ "$fuzz" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then debug=1 hist=0 nls=0 @@ -1395,7 +1449,6 @@ else COVERAGE_PREREQS="" fi - # Set some defaults. if [ -z "${DESTDIR+set}" ]; then destdir="" @@ -1485,8 +1538,8 @@ if [ "$nls" -ne 0 ]; then flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" flags="$flags -DBC_ENABLE_HISTORY=$hist -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0" - flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0" + flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" ccbase=$(basename "$CC") @@ -1494,14 +1547,14 @@ if [ "$nls" -ne 0 ]; then flags="$flags -Wno-unreachable-code" fi - "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -o "./vm.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -E > /dev/null err="$?" rm -rf "./vm.o" - # If this errors, it is probably because of building on Windows, - # and NLS is not supported on Windows, so disable it. + # If this errors, it is probably because of building on Windows or musl, + # and NLS is not supported on Windows or musl, so disable it. if [ "$err" -ne 0 ]; then printf 'NLS does not work.\n' if [ $force -eq 0 ]; then @@ -1514,7 +1567,7 @@ if [ "$nls" -ne 0 ]; then printf 'NLS works.\n\n' printf 'Testing gencat...\n' - gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null 2>&1 + gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null err="$?" @@ -1587,10 +1640,10 @@ if [ "$hist" -eq 1 ]; then flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0" flags="$flags -DBC_ENABLE_EDITLINE=$editline -DBC_ENABLE_READLINE=$readline" - flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0" + flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -o "./history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -E > /dev/null err="$?" @@ -1660,7 +1713,7 @@ set +e printf 'Testing for FreeBSD...\n' flags="-DBC_TEST_FREEBSD -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1677,7 +1730,7 @@ fi printf 'Testing for macOS...\n' flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1705,7 +1758,7 @@ fi printf 'Testing for OpenBSD...\n' flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0" -"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null err="$?" @@ -1741,7 +1794,7 @@ GEN_DIR="$scriptdir/gen" # These lines set the appropriate targets based on whether `gen/strgen.c` or # `gen/strgen.sh` is used. GEN="strgen" -GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)" +GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -DBC_ENABLE_OSSFUZZ=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)" CLEAN_PREREQS=" clean_gen clean_coverage" if [ -z "${GEN_HOST+set}" ]; then @@ -1754,8 +1807,9 @@ else fi fi +# The fuzzer files are always unneeded because they'll be built separately. manpage_args="" -unneeded="" +unneeded="bc_fuzzer.c dc_fuzzer.c" headers="\$(HEADERS)" # This series of if statements figure out what source files are *not* needed. @@ -1826,6 +1880,14 @@ if [ "$library" -ne 0 ]; then fi +elif [ "$ossfuzz" -ne 0 ]; then + + unneeded="$unneeded library.c main.c" + + PC_PATH="" + pkg_config_install="" + pkg_config_uninstall="" + else unneeded="$unneeded library.c" @@ -1836,9 +1898,10 @@ else fi -# library.c is not needed under normal circumstances. +# library.c, bc_fuzzer.c, and dc_fuzzer.c are not needed under normal +# circumstances. if [ "$unneeded" = "" ]; then - unneeded="library.c" + unneeded="library.c bc_fuzzer.c dc_fuzzer.c" fi # This sets the appropriate manpage for a full build. @@ -1846,7 +1909,7 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi -if [ "$vg" -ne 0 ]; then +if [ "$vg" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then memcheck=1 fi @@ -2011,7 +2074,9 @@ contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") contents=$(replace "$contents" "FUZZ" "$fuzz") +contents=$(replace "$contents" "OSSFUZZ" "$ossfuzz") contents=$(replace "$contents" "MEMCHECK" "$memcheck") +contents=$(replace "$contents" "LIB_FUZZING_ENGINE" "$LIB_FUZZING_ENGINE") contents=$(replace "$contents" "BC_LIB_O" "$bc_lib") contents=$(replace "$contents" "BC_HELP_O" "$bc_help") @@ -2117,6 +2182,15 @@ if [ "$dc" -ne 0 ]; then gen_err_tests dc $dc_test_exec fi +if [ "$ossfuzz" -ne 0 ]; then + + printf 'bc_fuzzer_c: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_c\n' >> Makefile + printf 'bc_fuzzer_C: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_C\n' >> Makefile + printf 'dc_fuzzer_c: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_c\n' >> Makefile + printf 'dc_fuzzer_C: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_C\n' >> Makefile + +fi + # Copy the correct manuals to the expected places. mkdir -p manuals cp -f "$scriptdir/manuals/bc/$manpage_args.1.md" manuals/bc.1.md diff --git a/contrib/bc/include/args.h b/contrib/bc/include/args.h index f1e9f007bddf..8f8f00be4630 100644 --- a/contrib/bc/include/args.h +++ b/contrib/bc/include/args.h @@ -54,7 +54,7 @@ * any. */ void -bc_args(int argc, char* argv[], bool exit_exprs, BcBigDig* scale, +bc_args(int argc, const char* argv[], bool exit_exprs, BcBigDig* scale, BcBigDig* ibase, BcBigDig* obase); #if BC_ENABLED diff --git a/contrib/bc/include/bc.h b/contrib/bc/include/bc.h index b25df09a174e..2213278be1da 100644 --- a/contrib/bc/include/bc.h +++ b/contrib/bc/include/bc.h @@ -51,7 +51,7 @@ * @return A status. */ BcStatus -bc_main(int argc, char* argv[]); +bc_main(int argc, const char* argv[]); // These are references to the help text, the library text, and the "filename" // for the library. diff --git a/contrib/bc/include/dc.h b/contrib/bc/include/dc.h index 1328f1c63b38..63f5ccbd10e3 100644 --- a/contrib/bc/include/dc.h +++ b/contrib/bc/include/dc.h @@ -48,7 +48,7 @@ * @return A status. */ BcStatus -dc_main(int argc, char* argv[]); +dc_main(int argc, const char* argv[]); // A reference to the dc help text. extern const char dc_help[]; diff --git a/contrib/bc/include/opt.h b/contrib/bc/include/opt.h index e60328994d8c..41058cb4e29c 100644 --- a/contrib/bc/include/opt.h +++ b/contrib/bc/include/opt.h @@ -47,7 +47,7 @@ typedef struct BcOpt { /// The array of arguments. - char** argv; + const char** argv; /// The index of the current argument. size_t optind; @@ -59,7 +59,7 @@ typedef struct BcOpt int subopt; /// The option argument. - char* optarg; + const char* optarg; } BcOpt; @@ -103,7 +103,7 @@ typedef struct BcOptLong * @param argv The array of arguments. */ void -bc_opt_init(BcOpt* o, char** argv); +bc_opt_init(BcOpt* o, const char** argv); /** * Parse an option. This returns a value the same way getopt() and getopt_long() diff --git a/contrib/bc/include/ossfuzz.h b/contrib/bc/include/ossfuzz.h new file mode 100644 index 000000000000..5c12a3c9c9fb --- /dev/null +++ b/contrib/bc/include/ossfuzz.h @@ -0,0 +1,79 @@ +/* + * ***************************************************************************** + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018-2024 Gavin D. Howard and contributors. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + * + * ***************************************************************************** + * + * Declarations for the OSS-Fuzz build of bc and dc. + * + */ + +#include +#include + +#ifndef BC_OSSFUZZ_H +#define BC_OSSFUZZ_H + +/// The number of args in fuzzer arguments, including the NULL terminator. +extern const size_t bc_fuzzer_args_len; + +/// The standard arguments for the bc fuzzer with the -c argument. +extern const char* bc_fuzzer_args_c[]; + +/// The standard arguments for the bc fuzzer with the -C argument. +extern const char* bc_fuzzer_args_C[]; + +/// The standard arguments for the dc fuzzer with the -c argument. +extern const char* dc_fuzzer_args_c[]; + +/// The standard arguments for the dc fuzzer with the -C argument. +extern const char* dc_fuzzer_args_C[]; + +/// The data pointer. +extern uint8_t* bc_fuzzer_data; + +/** + * The function that the fuzzer runs. + * @param Data The data. + * @param Size The number of bytes in @a Data. + * @return 0 on success, -1 on error. + * @pre @a Data must not be equal to NULL if @a Size > 0. + */ +int +LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size); + +/** + * The initialization function for the fuzzer. + * @param argc A pointer to the argument count. + * @param argv A pointer to the argument list. + * @return 0 on success, -1 on error. + */ +int +LLVMFuzzerInitialize(int* argc, char*** argv); + +#endif // BC_OSSFUZZ_H diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index f579df8c649b..203f09af628b 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -46,27 +46,6 @@ #include #include -// This is used by configure.sh to test for OpenBSD. -#ifdef BC_TEST_OPENBSD -#ifdef __OpenBSD__ -#error On OpenBSD without _BSD_SOURCE -#endif // __OpenBSD__ -#endif // BC_TEST_OPENBSD - -// This is used by configure.sh to test for FreeBSD. -#ifdef BC_TEST_FREEBSD -#ifdef __FreeBSD__ -#error On FreeBSD with _POSIX_C_SOURCE -#endif // __FreeBSD__ -#endif // BC_TEST_FREEBSD - -// This is used by configure.sh to test for macOS. -#ifdef BC_TEST_APPLE -#ifdef __APPLE__ -#error On macOS without _DARWIN_C_SOURCE -#endif // __APPLE__ -#endif // BC_TEST_APPLE - // Windows has deprecated isatty() and the rest of these. Or doesn't have them. // So these are just fixes for Windows. #ifdef _WIN32 @@ -676,9 +655,13 @@ typedef enum BcMode /// File mode. BC_MODE_FILE, +#if !BC_ENABLE_OSSFUZZ + /// stdin mode. BC_MODE_STDIN, +#endif // !BC_ENABLE_OSSFUZZ + } BcMode; /// Do a longjmp(). This is what to use when activating an "exception", i.e., a diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 586691a6e7ef..897a19530e3f 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.7.6 +#define VERSION 7.0.0 #endif // BC_VERSION_H diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 052c1d14c237..e81206b63871 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -794,7 +794,7 @@ bc_vm_info(const char* const help); * @return A status. */ BcStatus -bc_vm_boot(int argc, char* argv[]); +bc_vm_boot(int argc, const char* argv[]); /** * Initializes some of the BcVm global. This is separate to make things easier diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index 33ecb8e2031e..d59e0fa68a58 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1275,11 +1275,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index 613f98f76814..ad0c59934fd1 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -1130,11 +1130,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/E.1 b/contrib/bc/manuals/dc/E.1 index 91f68dfd7467..a5febe44705f 100644 --- a/contrib/bc/manuals/dc/E.1 +++ b/contrib/bc/manuals/dc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/E.1.md b/contrib/bc/manuals/dc/E.1.md index 3a47f789bd3e..54b877999d0d 100644 --- a/contrib/bc/manuals/dc/E.1.md +++ b/contrib/bc/manuals/dc/E.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EH.1 b/contrib/bc/manuals/dc/EH.1 index e60e6e0d8497..61fbaa4efe92 100644 --- a/contrib/bc/manuals/dc/EH.1 +++ b/contrib/bc/manuals/dc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EH.1.md b/contrib/bc/manuals/dc/EH.1.md index 761b9a89947b..6398477a84dd 100644 --- a/contrib/bc/manuals/dc/EH.1.md +++ b/contrib/bc/manuals/dc/EH.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EHN.1 b/contrib/bc/manuals/dc/EHN.1 index d26d49c5ce3d..974cb3c86791 100644 --- a/contrib/bc/manuals/dc/EHN.1 +++ b/contrib/bc/manuals/dc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EHN.1.md b/contrib/bc/manuals/dc/EHN.1.md index 58ae149bb686..51e30849996e 100644 --- a/contrib/bc/manuals/dc/EHN.1.md +++ b/contrib/bc/manuals/dc/EHN.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/EN.1 b/contrib/bc/manuals/dc/EN.1 index 03cb5743602c..5ce8defc91c7 100644 --- a/contrib/bc/manuals/dc/EN.1 +++ b/contrib/bc/manuals/dc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1061,11 +1061,14 @@ handler for, it resets. This means that several things happen. .PP First, any macros that are executing are stopped and popped off the -stack. +execution stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. .PP +However, the stack of values is \f[I]not\f[R] cleared; in interactive +mode, users can inspect the stack and manipulate it. +.PP Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error diff --git a/contrib/bc/manuals/dc/EN.1.md b/contrib/bc/manuals/dc/EN.1.md index 64c945be8857..ab9647a196be 100644 --- a/contrib/bc/manuals/dc/EN.1.md +++ b/contrib/bc/manuals/dc/EN.1.md @@ -961,11 +961,14 @@ the next non-space characters do not match that regex. When dc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. -First, any macros that are executing are stopped and popped off the stack. -The behavior is not unlike that of exceptions in programming languages. Then -the execution point is set so that any code waiting to execute (after all +First, any macros that are executing are stopped and popped off the execution +stack. The behavior is not unlike that of exceptions in programming languages. +Then the execution point is set so that any code waiting to execute (after all macros returned) is skipped. +However, the stack of values is *not* cleared; in interactive mode, users can +inspect the stack and manipulate it. + Thus, when dc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the **EXIT STATUS** section), it asks for more input; otherwise, it exits with the diff --git a/contrib/bc/manuals/dc/H.1 b/contrib/bc/manuals/dc/H.1 index 36f7458a3316..82c1bbd5c2b9 100644 --- a/contrib/bc/manuals/dc/H.1 +++ b/contrib/bc/manuals/dc/H.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -1275,11 +1275,14 @@ handler for, it resets. This means that several things happen. .PP *** 1272 LINES SKIPPED *** From nobody Mon Aug 26 16:53:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsxb43PXjz5TFLC; Mon, 26 Aug 2024 16:53: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 4Wsxb42pjJz3ymt; Mon, 26 Aug 2024 16:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724691232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jApDlPVEic+UkCyt/S8qv+E64vlB+tE6NjLN8HdBZCE=; b=IRRFkEnY5gGMJUpKzWuJNN5hcda8Od99pnA/kQ3t8wMc/3j9aQQk1MM035OFLAauEni3gk xEXVNT5wTuRPoLQYmzLgzITOgx1F2rD4oL7uQFRRuXLY1NIZtxZ/8lbXiMRwqK7gLi8xPk TneBRVsDuQ6fsnjGuPk8GmQ+BTh1bNjpCbwSipqmLsguhImzci7emIkoc2K1eGRYQf++Di J5xHZOj59sVTmzjLx05oE6Wvk5VYWkGIXKnjTwQp5x9vGhXcKBpy3Eauq7Dq3CZfZV0n+1 nHYtr+Hz82EdyohGuIj9cvTiW8Ia7bfwDJ5CJUoCv3ZqdAG7a5gnfgngUSpXPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724691232; a=rsa-sha256; cv=none; b=Jg9LdpaBumLk57GVt77IEscmPR0n9p3qH2IwpoFgHqRfec3CGj8Nip9VcotAFB9OpVAjvs CTOChIRxqlknwk0CCI5PgHKt+aPUAQooH9dZNIYZzP2wiMj56+vH3MCx40Uq80unG5rYhi uOZTGE6grUWj1VFuXgtXJYHfwY2ZfVQde6aliX3/XUX6RF/mdKHouP7ar+0Wm5vJ1KG0xx XPbmu0A0jewvr9+nog/6cr6Qgr+aXUDFaO5cYmGGrFVpQu5QuWK60iHRFCGmOYvv0Z99eP gO1IUwy2+j/SNX1/Udj3YyARbsH9SPhhjUUsddpcbm37HrtLybAjwQW1KFvwHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724691232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jApDlPVEic+UkCyt/S8qv+E64vlB+tE6NjLN8HdBZCE=; b=lysIlk3KRwN5Bb/TNS4YsV+/PSaGSdpH9GKcjBC1ghZ2Hbg9VBdIX52TPyyVBwN5NXZUdf 9MsZ9d4J4hc5+Ux85VGDdNwdAZ9Bu3ie5vxeLviM7j/7+sn1DEIATBAJxgrgAHR3bBtLe9 LWn5GvDfMdjdyNG0dx6+t7j4Z/R4uPiU9UOVq8Y99wa/4ott6Eqf3TliDrabEuTmBlx22N M9Ihl4Aj02jCRPuQ2lcZDsIjIQAfhunFmGwkVtjelONqMz4LLK0yHuuK9cr+iLfPPCYmIK kJ8ZysR7+v63k01T3HVNV847UwRWQQpgaFt/kjc7vpPSQ/Iowwqul1wmq8aUng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsxb42QHBzFSx; Mon, 26 Aug 2024 16:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QGrqOR022320; Mon, 26 Aug 2024 16:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QGrqIR022317; Mon, 26 Aug 2024 16:53:52 GMT (envelope-from git) Date: Mon, 26 Aug 2024 16:53:52 GMT Message-Id: <202408261653.47QGrqIR022317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: fff621251320 - main - pf tests: ensure that 'quick' on anchor rules works as expected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fff6212513205a4989b38e9debe455343a8d309f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fff6212513205a4989b38e9debe455343a8d309f commit fff6212513205a4989b38e9debe455343a8d309f Author: Kristof Provost AuthorDate: 2024-08-26 15:24:32 +0000 Commit: Kristof Provost CommitDate: 2024-08-26 16:50:02 +0000 pf tests: ensure that 'quick' on anchor rules works as expected Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/anchor.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 311d6485e794..25d9d5b6df03 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -195,6 +195,44 @@ nested_label_cleanup() pft_cleanup } +atf_test_case "quick" "cleanup" +quick_head() +{ + atf_set descr "Test handling of quick on anchors" + atf_set require.user root +} + +quick_body() +{ + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "anchor quick {\n\ + pass\n\ + }" \ + "block" + + # We can still ping because the anchor is 'quick' + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + jexec alcatraz pfctl -sr -v + jexec alcatraz pfctl -ss -v +} + +quick_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -202,4 +240,5 @@ atf_init_test_cases() atf_add_test_case "nested_anchor" atf_add_test_case "wildcard" atf_add_test_case "nested_label" + atf_add_test_case "quick" } From nobody Mon Aug 26 18:03:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz724SQ5z5TLZ6; Mon, 26 Aug 2024 18:03: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 4Wsz723rlcz44l5; Mon, 26 Aug 2024 18:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0dP/uAhp0ol8VL3Pno3Ua2XnbA8R/84dziPKGrpu0V0=; b=OCp97IOq51KGG/rNRS/TW3/m4tvqrUs56h87LXBlbCuJIM1l9nUYhEusXVipnnpPurn3l1 rKOtcncI7EaQCmScbfjEcGmjPEfPe3tOWpsf9zuAz2bOJA5K98ZLkx5ZlgZcDD+KIYHbR2 tjXeI+i9/7bO8/YVqAMLVANzDc3XYCj8RhJWF0q+7lJGd+Ac0fBuesrcFqS/3pFThHr5CI i1pShPilmPOEFKjNz+c+Di3VcBNCCSWJMV6oDrhixVMON3iGTNrhc6oOUaDA+4sw7CQ9mT Cm4RYaovGEyNuyj9+HUEtt3EkMxIi3kpGBwIdfHBgyxjK3p4SRONfnkjaKZQyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695390; a=rsa-sha256; cv=none; b=MT7XtaPptnpwjiVK6x8AARKEKbDhwdVELkC5Jtu7x4znYJjTXLxcUL4yUEnCjaHUVweNVd Ei3Dexa8k/OzfZlswrEVThyxtRuHnAF6/Lo/Wr6zK155CFq/BHJVkvUgZ0xOimjmK06UnM gMe+BIq3CXaEVNbv6JCvrMYhH965bVtiaFDLErJGJu7AFkr1Z2pZ8VgBuYaIyoJnmDQbvq ik0Dwdh9vLwTm+hTq07wvMSlxrkGcfYavLd1onQNZTBZ1LFV74zirGrcJOLQ2w9ozpVaSc ctxGr/hMKR3bDEAm1Gl6tnV3ML5glFdS4ptjzOiwSD4RFY7hJPLDBtIwnEHKcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0dP/uAhp0ol8VL3Pno3Ua2XnbA8R/84dziPKGrpu0V0=; b=Q1MrYl8AUQSLIQBqM24leCNNqJ0efkGj/BQ4bmkuD5TeFnO/pr4om7A1AkXD0Hbk2+nm33 OfWaieWLAJkX9Z09OODpwLmpOrOBLjyITbmmIP8SkfHuGYGUvd34W35b0JsDXDC3WbxcQS /X7dxIEM9uwEQXxEzQiU3DUIyKcDlXjJnFF9sCw3RzfzC+nAQ5a5H1KGV9CMD04G7y11tN uxMmZLxc9N9CDffqNX9ySMYGcGXEsy8svjStLuTHIndtJB0MNqZDq2Cx8R90DPvRS84eCo WiZ6vgQ1z417nEbrG5+uugY0pFV5g4EuiYzp8cx+at7r6DWWCrXwt3eMOSR0nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz723RnBzHKJ; Mon, 26 Aug 2024 18:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QI3AOZ042282; Mon, 26 Aug 2024 18:03:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3AYx042279; Mon, 26 Aug 2024 18:03:10 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:10 GMT Message-Id: <202408261803.47QI3AYx042279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 215c3766945a - stable/14 - nvme: Use the NVMEV macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 215c3766945abf085c580b73bb409fd4afe5ff09 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=215c3766945abf085c580b73bb409fd4afe5ff09 commit 215c3766945abf085c580b73bb409fd4afe5ff09 Author: John Baldwin AuthorDate: 2024-01-29 18:30:54 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:25:49 +0000 nvme: Use the NVMEV macro instead of expanded versions Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43595 (cherry picked from commit 479680f235dd89cdabe0503312b3d23f322f4000) --- sys/dev/nvme/nvme.h | 72 +++++++++++++++++++++++++---------------------- sys/dev/nvme/nvme_ctrlr.c | 11 ++++---- sys/dev/nvme/nvme_ns.c | 16 ++++------- sys/dev/nvme/nvme_qpair.c | 2 +- 4 files changed, 51 insertions(+), 50 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 315dbdd5a3c8..cb5e1a5f1118 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -73,13 +73,13 @@ #define NVME_CAP_LO_REG_TO_SHIFT (24) #define NVME_CAP_LO_REG_TO_MASK (0xFF) #define NVME_CAP_LO_MQES(x) \ - (((x) >> NVME_CAP_LO_REG_MQES_SHIFT) & NVME_CAP_LO_REG_MQES_MASK) + NVMEV(NVME_CAP_LO_REG_MQES, x) #define NVME_CAP_LO_CQR(x) \ - (((x) >> NVME_CAP_LO_REG_CQR_SHIFT) & NVME_CAP_LO_REG_CQR_MASK) + NVMEV(NVME_CAP_LO_REG_CQR, x) #define NVME_CAP_LO_AMS(x) \ - (((x) >> NVME_CAP_LO_REG_AMS_SHIFT) & NVME_CAP_LO_REG_AMS_MASK) + NVMEV(NVME_CAP_LO_REG_AMS, x) #define NVME_CAP_LO_TO(x) \ - (((x) >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) + NVMEV(NVME_CAP_LO_REG_TO, x) #define NVME_CAP_HI_REG_DSTRD_SHIFT (0) #define NVME_CAP_HI_REG_DSTRD_MASK (0xF) @@ -108,31 +108,31 @@ #define NVME_CAP_HI_REG_CRIMS_SHIFT (28) #define NVME_CAP_HI_REG_CRIMS_MASK (0x1) #define NVME_CAP_HI_DSTRD(x) \ - (((x) >> NVME_CAP_HI_REG_DSTRD_SHIFT) & NVME_CAP_HI_REG_DSTRD_MASK) + NVMEV(NVME_CAP_HI_REG_DSTRD, x) #define NVME_CAP_HI_NSSRS(x) \ - (((x) >> NVME_CAP_HI_REG_NSSRS_SHIFT) & NVME_CAP_HI_REG_NSSRS_MASK) + NVMEV(NVME_CAP_HI_REG_NSSRS, x) #define NVME_CAP_HI_CSS(x) \ - (((x) >> NVME_CAP_HI_REG_CSS_SHIFT) & NVME_CAP_HI_REG_CSS_MASK) + NVMEV(NVME_CAP_HI_REG_CSS, x) #define NVME_CAP_HI_CSS_NVM(x) \ - (((x) >> NVME_CAP_HI_REG_CSS_NVM_SHIFT) & NVME_CAP_HI_REG_CSS_NVM_MASK) + NVMEV(NVME_CAP_HI_REG_CSS_NVM, x) #define NVME_CAP_HI_BPS(x) \ - (((x) >> NVME_CAP_HI_REG_BPS_SHIFT) & NVME_CAP_HI_REG_BPS_MASK) + NVMEV(NVME_CAP_HI_REG_BPS, x) #define NVME_CAP_HI_CPS(x) \ - (((x) >> NVME_CAP_HI_REG_CPS_SHIFT) & NVME_CAP_HI_REG_CPS_MASK) + NVMEV(NVME_CAP_HI_REG_CPS, x) #define NVME_CAP_HI_MPSMIN(x) \ - (((x) >> NVME_CAP_HI_REG_MPSMIN_SHIFT) & NVME_CAP_HI_REG_MPSMIN_MASK) + NVMEV(NVME_CAP_HI_REG_MPSMIN, x) #define NVME_CAP_HI_MPSMAX(x) \ - (((x) >> NVME_CAP_HI_REG_MPSMAX_SHIFT) & NVME_CAP_HI_REG_MPSMAX_MASK) + NVMEV(NVME_CAP_HI_REG_MPSMAX, x) #define NVME_CAP_HI_PMRS(x) \ - (((x) >> NVME_CAP_HI_REG_PMRS_SHIFT) & NVME_CAP_HI_REG_PMRS_MASK) + NVMEV(NVME_CAP_HI_REG_PMRS, x) #define NVME_CAP_HI_CMBS(x) \ - (((x) >> NVME_CAP_HI_REG_CMBS_SHIFT) & NVME_CAP_HI_REG_CMBS_MASK) + NVMEV(NVME_CAP_HI_REG_CMBS, x) #define NVME_CAP_HI_NSSS(x) \ - (((x) >> NVME_CAP_HI_REG_NSSS_SHIFT) & NVME_CAP_HI_REG_NSSS_MASK) + NVMEV(NVME_CAP_HI_REG_NSSS, x) #define NVME_CAP_HI_CRWMS(x) \ - (((x) >> NVME_CAP_HI_REG_CRWMS_SHIFT) & NVME_CAP_HI_REG_CRWMS_MASK) + NVMEV(NVME_CAP_HI_REG_CRWMS, x) #define NVME_CAP_HI_CRIMS(x) \ - (((x) >> NVME_CAP_HI_REG_CRIMS_SHIFT) & NVME_CAP_HI_REG_CRIMS_MASK) + NVMEV(NVME_CAP_HI_REG_CRIMS, x) #define NVME_CC_REG_EN_SHIFT (0) #define NVME_CC_REG_EN_MASK (0x1) @@ -164,7 +164,8 @@ #define NVME_CSTS_REG_ST_SHIFT (6) #define NVME_CSTS_REG_ST_MASK (0x1) -#define NVME_CSTS_GET_SHST(csts) (((csts) >> NVME_CSTS_REG_SHST_SHIFT) & NVME_CSTS_REG_SHST_MASK) +#define NVME_CSTS_GET_SHST(csts) \ + NVMEV(NVME_CSTS_REG_SHST, csts) #define NVME_AQA_REG_ASQS_SHIFT (0) #define NVME_AQA_REG_ASQS_MASK (0xFFF) @@ -187,19 +188,19 @@ #define NVME_PMRCAP_REG_CMSS_MASK (0x1) #define NVME_PMRCAP_RDS(x) \ - (((x) >> NVME_PMRCAP_REG_RDS_SHIFT) & NVME_PMRCAP_REG_RDS_MASK) + NVMEV(NVME_PMRCAP_REG_RDS, x) #define NVME_PMRCAP_WDS(x) \ - (((x) >> NVME_PMRCAP_REG_WDS_SHIFT) & NVME_PMRCAP_REG_WDS_MASK) + NVMEV(NVME_PMRCAP_REG_WDS, x) #define NVME_PMRCAP_BIR(x) \ - (((x) >> NVME_PMRCAP_REG_BIR_SHIFT) & NVME_PMRCAP_REG_BIR_MASK) + NVMEV(NVME_PMRCAP_REG_BIR, x) #define NVME_PMRCAP_PMRTU(x) \ - (((x) >> NVME_PMRCAP_REG_PMRTU_SHIFT) & NVME_PMRCAP_REG_PMRTU_MASK) + NVMEV(NVME_PMRCAP_REG_PMRTU, x) #define NVME_PMRCAP_PMRWBM(x) \ - (((x) >> NVME_PMRCAP_REG_PMRWBM_SHIFT) & NVME_PMRCAP_REG_PMRWBM_MASK) + NVMEV(NVME_PMRCAP_REG_PMRWBM, x) #define NVME_PMRCAP_PMRTO(x) \ - (((x) >> NVME_PMRCAP_REG_PMRTO_SHIFT) & NVME_PMRCAP_REG_PMRTO_MASK) + NVMEV(NVME_PMRCAP_REG_PMRTO, x) #define NVME_PMRCAP_CMSS(x) \ - (((x) >> NVME_PMRCAP_REG_CMSS_SHIFT) & NVME_PMRCAP_REG_CMSS_MASK) + NVMEV(NVME_PMRCAP_REG_CMSS, x) /* Command field definitions */ @@ -219,12 +220,18 @@ #define NVME_STATUS_DNR_SHIFT (15) #define NVME_STATUS_DNR_MASK (0x1) -#define NVME_STATUS_GET_P(st) (((st) >> NVME_STATUS_P_SHIFT) & NVME_STATUS_P_MASK) -#define NVME_STATUS_GET_SC(st) (((st) >> NVME_STATUS_SC_SHIFT) & NVME_STATUS_SC_MASK) -#define NVME_STATUS_GET_SCT(st) (((st) >> NVME_STATUS_SCT_SHIFT) & NVME_STATUS_SCT_MASK) -#define NVME_STATUS_GET_CRD(st) (((st) >> NVME_STATUS_CRD_SHIFT) & NVME_STATUS_CRD_MASK) -#define NVME_STATUS_GET_M(st) (((st) >> NVME_STATUS_M_SHIFT) & NVME_STATUS_M_MASK) -#define NVME_STATUS_GET_DNR(st) (((st) >> NVME_STATUS_DNR_SHIFT) & NVME_STATUS_DNR_MASK) +#define NVME_STATUS_GET_P(st) \ + NVMEV(NVME_STATUS_P, st) +#define NVME_STATUS_GET_SC(st) \ + NVMEV(NVME_STATUS_SC, st) +#define NVME_STATUS_GET_SCT(st) \ + NVMEV(NVME_STATUS_SCT, st) +#define NVME_STATUS_GET_CRD(st) \ + NVMEV(NVME_STATUS_CRD, st) +#define NVME_STATUS_GET_M(st) \ + NVMEV(NVME_STATUS_M, st) +#define NVME_STATUS_GET_DNR(st) \ + NVMEV(NVME_STATUS_DNR, st) #define NVME_PWR_ST_MPS_SHIFT (0) #define NVME_PWR_ST_MPS_MASK (0x1) @@ -1752,8 +1759,7 @@ static inline bool nvme_ctrlr_has_dataset_mgmt(const struct nvme_controller_data *cd) { /* Assumes cd was byte swapped by nvme_controller_data_swapbytes() */ - return ((cd->oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & - NVME_CTRLR_DATA_ONCS_DSM_MASK); + return (NVMEV(NVME_CTRLR_DATA_ONCS_DSM, cd->oncs) != 0); } /* Namespace helper functions */ diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index e659a3776957..7096f0443f1d 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -278,8 +278,7 @@ nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) csts = nvme_mmio_read_4(ctrlr, csts); if (csts == NVME_GONE) /* Hot unplug. */ return (ENXIO); - if (((csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK) - == desired_val) + if (NVMEV(NVME_CSTS_REG_RDY, csts) == desired_val) break; if (timeout - ticks < 0) { nvme_printf(ctrlr, "controller ready did not become %d " @@ -305,8 +304,8 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) cc = nvme_mmio_read_4(ctrlr, cc); csts = nvme_mmio_read_4(ctrlr, csts); - en = (cc >> NVME_CC_REG_EN_SHIFT) & NVME_CC_REG_EN_MASK; - rdy = (csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK; + en = NVMEV(NVME_CC_REG_EN, cc); + rdy = NVMEV(NVME_CSTS_REG_RDY, csts); /* * Per 3.1.5 in NVME 1.3 spec, transitioning CC.EN from 0 to 1 @@ -352,8 +351,8 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) cc = nvme_mmio_read_4(ctrlr, cc); csts = nvme_mmio_read_4(ctrlr, csts); - en = (cc >> NVME_CC_REG_EN_SHIFT) & NVME_CC_REG_EN_MASK; - rdy = (csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK; + en = NVMEV(NVME_CC_REG_EN, cc); + rdy = NVMEV(NVME_CSTS_REG_RDY, csts); /* * See note in nvme_ctrlr_disable. Short circuit if we're already enabled. diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 55f607c96e59..329b8d583898 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -181,10 +181,8 @@ nvme_ns_get_sector_size(struct nvme_namespace *ns) { uint8_t flbas_fmt, lbads; - flbas_fmt = (ns->data.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (ns->data.lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, ns->data.flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, ns->data.lbaf[flbas_fmt]); return (1 << lbads); } @@ -231,8 +229,7 @@ nvme_ns_get_stripesize(struct nvme_namespace *ns) { uint32_t ss; - if (((ns->data.nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0) { + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, ns->data.nsfeat) != 0) { ss = nvme_ns_get_sector_size(ns); if (ns->data.npwa != 0) return ((ns->data.npwa + 1) * ss); @@ -552,8 +549,8 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, if (ns->data.nsze == 0) return (ENXIO); - flbas_fmt = (ns->data.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, ns->data.flbas); + /* * Note: format is a 0-based value, so > is appropriate here, * not >=. @@ -585,8 +582,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, if (nvme_ctrlr_has_dataset_mgmt(&ctrlr->cdata)) ns->flags |= NVME_NS_DEALLOCATE_SUPPORTED; - vwc_present = (ctrlr->cdata.vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK; + vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, ctrlr->cdata.vwc); if (vwc_present) ns->flags |= NVME_NS_FLUSH_SUPPORTED; diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 2e9af4310a15..e087abcb2654 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1041,7 +1041,7 @@ nvme_qpair_timeout(void *arg) * usually doesn't). */ csts = nvme_mmio_read_4(ctrlr, csts); - cfs = (csts >> NVME_CSTS_REG_CFS_SHIFT) & NVME_CSTS_REG_CFS_MASK; + cfs = NVMEV(NVME_CSTS_REG_CFS, csts); if (csts == NVME_GONE || cfs == 1) goto do_reset; From nobody Mon Aug 26 18:03:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz735kkhz5TLnS; Mon, 26 Aug 2024 18:03: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 4Wsz734q53z44l6; Mon, 26 Aug 2024 18:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgm+0gLO6b1UaTWLW+JwCCsU8LWSO9ROqyJ79su0oCE=; b=e7KvA0SCeDJ7js0xIJae2CRO2uoksjtq7Tg5Sy9h1udtr7R+zH/OdTMIQC2weUbvD41Plq 7VvI4fMs7Miw44f1eiUsm5xoCbhEVlYkTjxxNz3AxC+bLRN1Hdbl25vg5zYdg2IWfBk1wK bjGlH+S9kAlAOSxtBz8eB1J+Pl2eOiEKIPrTvBkJZrjJNbkR3nqyRMYO1xpaDBoSvdqL2u W4RE6RP2x37qNn0FAWAd9jwtHvl32xWhRZE93BNh82/1zWLUz+inmtaMD7C7Hutp5v4Mo6 NFb79JgakyNg/RLFmNovu01+YvvqJ9DjwZjXhMhE7SdFwAI481D9n7OTGcnzRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695391; a=rsa-sha256; cv=none; b=nq+SzU3P402CXGx0G+kL+F1Y2zq1mh1MCFLxHzOkROUMRM5bJDyJs4gvVXk21pqN9Arv6s r0ARbCLw5B7dJbKoxNTzPouAykjqajaf27Zz9vL5Kx3Vt05jITveTo3Ctf9UDx6hh0uXak PYumeTwe7RxPmF8SPgRdOMv3shJwnvGMIoXSa4/9Tsr/farMnMY2b4oDZqRWNvEuvHvuOh jchLbPAe9dnjYdo4e4XNxwZxSgSJjqx5HaAlrTMNAGS4BZW4Kcwg8hwLYFUUD783QwIclj Tf77Cqp13Bg+VtxBIzwBTFGQAAdYPokfc50+pWJh8u7YHM4cd8QUuAmcCeYedg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgm+0gLO6b1UaTWLW+JwCCsU8LWSO9ROqyJ79su0oCE=; b=xsc5zL+DxgN7zk860k9t2sBI3O2pG30I/CNFnsHXkFAmqZfj6FbhTnGosGxfN+jLXyrobw rdNF007nWIm0Mf8UbOnXZIHmmi8GIE1HsSARtbW0RXGfl6ccGNVMbKD8ElJj5DrFz1P06h +rAxUOXz5VXu8K4pETQ+gvSA/bg77EOrBQzkD08iw61RTkt446h8bIvd0FNIwn2h+R00l7 VLrWq4Z4M4CMFEKMHt5R3sDXLd95r21x2wXLuqvj4Pu23SG1B6SBwMp4zBTPuO+CaRJbtl dwRORyHHi8OjT7qUiQ+kzmZ4Xl3LF4XUsnvZya60MzBseECkzR2jv3xRbS7G9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz734QmmzH6K; Mon, 26 Aug 2024 18:03: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 47QI3B8p042336; Mon, 26 Aug 2024 18:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3BpQ042333; Mon, 26 Aug 2024 18:03:11 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:11 GMT Message-Id: <202408261803.47QI3BpQ042333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e8edea1b4cc5 - stable/14 - nda: Use the NVMEV macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e8edea1b4cc5aae7897439821a611257a32a879c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e8edea1b4cc5aae7897439821a611257a32a879c commit e8edea1b4cc5aae7897439821a611257a32a879c Author: John Baldwin AuthorDate: 2024-01-29 18:33:39 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:00 +0000 nda: Use the NVMEV macro instead of expanded versions Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43596 (cherry picked from commit 2cb78e71503ec9a73054a6f70908c5f20c2ceb73) --- sys/cam/nvme/nvme_da.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 9901ecccf21c..33efbc66773c 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -912,18 +912,15 @@ ndaregister(struct cam_periph *periph, void *arg) else if (maxio > maxphys) maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; - flbas_fmt = (nsd->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsd->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsd->flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsd->lbaf[flbas_fmt]); disk->d_sectorsize = 1 << lbads; disk->d_mediasize = (off_t)(disk->d_sectorsize * nsd->nsze); disk->d_delmaxsize = disk->d_mediasize; disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if (nvme_ctrlr_has_dataset_mgmt(cd)) disk->d_flags |= DISKFLAG_CANDELETE; - vwc_present = (cd->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK; + vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc); if (vwc_present) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { @@ -946,8 +943,8 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_hba_subdevice = cpi.hba_subdevice; snprintf(disk->d_attachment, sizeof(disk->d_attachment), "%s%d", cpi.dev_name, cpi.unit_number); - if (((nsd->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0 && nsd->npwg != 0) + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, nsd->nsfeat) != 0 && + nsd->npwg != 0) disk->d_stripesize = ((nsd->npwg + 1) * disk->d_sectorsize); else disk->d_stripesize = nsd->noiob * disk->d_sectorsize; From nobody Mon Aug 26 18:03:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz750ZLYz5TLnW; Mon, 26 Aug 2024 18:03: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 4Wsz745xGXz44QS; Mon, 26 Aug 2024 18:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8kZ+0viOhSrNF5DAtpFY+2Ebw5LVg2XAHa1EXu026wY=; b=G9MgbcogPT1UvCL3ji0iKQ9GeyuFOQX2MLCyepW4G3BNXnKXhAIV5Sb1zKmk/jp2PxO+NP sll2zbyoZ5BL7GIHKZ0Of4wPwi4MgURMTraDY2l/HGT3Xw8WZ3TQXaxGuU+KVMoL7mrVJy cMSn7HHkM0QtY4wE+RzdfprDg8ba5quSNNO9ueRXdkr99gAX3T3Tcu6sm6uxFhRwi1tYhd yapVn2N0tZ2XwNGo7Lq15YlpKvEokQHPOM6B+K1E2SPh02Eb462sMKU8IFAMkpby2q/+lF vaaO00o0q1DdN/nuk9zpqVIKT50sXw/tWIPaVylCXmce0cPNSCvniy9j8vFuUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695392; a=rsa-sha256; cv=none; b=l0fFLMGydZnDmxBlKZhihenpJ8J/n4M6Q9kEksIdtOIuilCDxLu8g6eK05rqzvE0cUx0jc wPq6uBr405PR23N/vyWPnxgCgTha/Jeab1rHzzaZK28BQCi2udL4NYoM7NPxro5jLWm6U0 oJmJovAT0y3muME7JcLTWyRWbaRDQ4CZd50JlcDOPGxGD4xbGPk1LLXjdrH58zi8CwFzb0 e0BbVSClb/60KAxgocDKLocTrC2Rsxp2aaQpxpvtcEMPzYMDYjoIhTnv8W52kPZkYOZt7u qaLZ7XPYkWinyLAk7BbT7LOt+r68oDliHE7AxylvCzzpSg1HileyFVr1pwHR7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8kZ+0viOhSrNF5DAtpFY+2Ebw5LVg2XAHa1EXu026wY=; b=vyZEukCHMcXrpBFZX8epg2g4iSR4O2p8Pog2OP3RWw6FFT+s4cY2gC6PjiDOEurOOrUDzj Wlytk7fbCjAxL2vwKsOefZhHMsGdlhf37Uk3/knjJ+GBt7gALBHLMmEMC6R+xCZzfq/mwm 52kMFKIUQso4iLzblq6ZeAOtqM/M43cqgol8i852CPw7AiS8rmZnepM9/mZZBaZtMQIi2V aimdaSeqZZ7PJuMgT4rp42Ri94co0Cc0r3XdLW/szNmlR6HnSvzavDfMfegDaRBdTHYr+i DbT4Fjp7wT0OiGgBkWe9Zw0FBdm8GQ3//CXmaVRlit/J/ymgfIqtVv5TY57EWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz745DqlzH9F; Mon, 26 Aug 2024 18:03: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 47QI3CCe042396; Mon, 26 Aug 2024 18:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3CBF042393; Mon, 26 Aug 2024 18:03:12 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:12 GMT Message-Id: <202408261803.47QI3CBF042393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 112d3053486c - stable/14 - nvmecontrol: Use the NVMEV macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 112d3053486c949fff6bc02394c88b2b04018961 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=112d3053486c949fff6bc02394c88b2b04018961 commit 112d3053486c949fff6bc02394c88b2b04018961 Author: John Baldwin AuthorDate: 2024-01-29 18:34:02 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:08 +0000 nvmecontrol: Use the NVMEV macro instead of expanded versions Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43597 (cherry picked from commit fba73a408314d8e32056d4a812c9a2eb5f618b5d) --- sbin/nvmecontrol/devlist.c | 6 +- sbin/nvmecontrol/firmware.c | 9 +-- sbin/nvmecontrol/format.c | 27 +++----- sbin/nvmecontrol/identify.c | 109 +++++++++++++---------------- sbin/nvmecontrol/identify_ext.c | 149 ++++++++++++++++------------------------ sbin/nvmecontrol/logpage.c | 63 ++++++----------- sbin/nvmecontrol/ns.c | 39 ++++------- sbin/nvmecontrol/power.c | 12 ++-- sbin/nvmecontrol/sanitize.c | 12 ++-- sbin/nvmecontrol/selftest.c | 3 +- 10 files changed, 167 insertions(+), 262 deletions(-) diff --git a/sbin/nvmecontrol/devlist.c b/sbin/nvmecontrol/devlist.c index 7e3dfe60fff4..b5e95b38937e 100644 --- a/sbin/nvmecontrol/devlist.c +++ b/sbin/nvmecontrol/devlist.c @@ -83,10 +83,8 @@ ns_get_sector_size(struct nvme_namespace_data *nsdata) { uint8_t flbas_fmt, lbads; - flbas_fmt = (nsdata->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsdata->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsdata->flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsdata->lbaf[flbas_fmt]); return (1 << lbads); } diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 80bbff032cf2..8fcc4ba4f46e 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -278,21 +278,18 @@ firmware(const struct cmd *f, int argc, char *argv[]) if (read_controller_data(fd, &cdata)) errx(EX_IOERR, "Identify request failed"); - oacs_fw = (cdata.oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; + oacs_fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, cdata.oacs); if (oacs_fw == 0) errx(EX_UNAVAILABLE, "controller does not support firmware activate/download"); - fw_slot1_ro = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & - NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; + fw_slot1_ro = NVMEV(NVME_CTRLR_DATA_FRMW_SLOT1_RO, cdata.frmw); if (opt.fw_img && opt.slot == 1 && fw_slot1_ro) errx(EX_UNAVAILABLE, "slot %d is marked as read only", opt.slot); - fw_num_slots = (cdata.frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; + fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata.frmw); if (opt.slot > fw_num_slots) errx(EX_UNAVAILABLE, diff --git a/sbin/nvmecontrol/format.c b/sbin/nvmecontrol/format.c index 541b207b373f..a56027089ff5 100644 --- a/sbin/nvmecontrol/format.c +++ b/sbin/nvmecontrol/format.c @@ -160,38 +160,33 @@ format(const struct cmd *f, int argc, char *argv[]) /* Check that controller can execute this command. */ if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & - NVME_CTRLR_DATA_OACS_FORMAT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support format"); - if (((cd.fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & - NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) == 0 && ses == SES_CRYPTO) + if (NVMEV(NVME_CTRLR_DATA_FNA_CRYPTO_ERASE, cd.fna) == 0 && + ses == SES_CRYPTO) errx(EX_UNAVAILABLE, "controller does not support cryptographic erase"); if (nsid != NVME_GLOBAL_NAMESPACE_TAG) { - if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == SES_NONE) + if (NVMEV(NVME_CTRLR_DATA_FNA_FORMAT_ALL, cd.fna) && + ses == SES_NONE) errx(EX_UNAVAILABLE, "controller does not support per-NS format"); - if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != SES_NONE) + if (NVMEV(NVME_CTRLR_DATA_FNA_ERASE_ALL, cd.fna) && + ses != SES_NONE) errx(EX_UNAVAILABLE, "controller does not support per-NS erase"); /* Try to keep previous namespace parameters. */ if (read_namespace_data(fd, nsid, &nsd)) errx(EX_IOERR, "Identify request failed"); if (lbaf < 0) - lbaf = (nsd.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) - & NVME_NS_DATA_FLBAS_FORMAT_MASK; + lbaf = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsd.flbas); if (lbaf > nsd.nlbaf) errx(EX_USAGE, "LBA format is out of range"); if (ms < 0) - ms = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) - & NVME_NS_DATA_FLBAS_EXTENDED_MASK; + ms = NVMEV(NVME_NS_DATA_FLBAS_EXTENDED, nsd.flbas); if (pi < 0) - pi = (nsd.dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) - & NVME_NS_DATA_DPS_MD_START_MASK; + pi = NVMEV(NVME_NS_DATA_DPS_MD_START, nsd.dps); if (pil < 0) - pil = (nsd.dps >> NVME_NS_DATA_DPS_PIT_SHIFT) - & NVME_NS_DATA_DPS_PIT_MASK; + pil = NVMEV(NVME_NS_DATA_DPS_PIT, nsd.dps); } else { /* We have no previous parameters, so default to zeroes. */ diff --git a/sbin/nvmecontrol/identify.c b/sbin/nvmecontrol/identify.c index 50698e8bfc70..81aebad0e0d6 100644 --- a/sbin/nvmecontrol/identify.c +++ b/sbin/nvmecontrol/identify.c @@ -67,11 +67,9 @@ print_namespace(struct nvme_namespace_data *nsdata) uint8_t thin_prov, ptype; uint8_t flbas_fmt, t; - thin_prov = (nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT) & - NVME_NS_DATA_NSFEAT_THIN_PROV_MASK; + thin_prov = NVMEV(NVME_NS_DATA_NSFEAT_THIN_PROV, nsdata->nsfeat); - flbas_fmt = (nsdata->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsdata->flbas); printf("Size: %lld blocks\n", (long long)nsdata->nsze); @@ -83,83 +81,77 @@ print_namespace(struct nvme_namespace_data *nsdata) thin_prov ? "Supported" : "Not Supported"); printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); printf("Current LBA Format: LBA Format #%02d", flbas_fmt); - if (nsdata->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_MS_SHIFT & NVME_NS_DATA_LBAF_MS_MASK) - printf(" %s metadata\n", nsdata->flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT & - NVME_NS_DATA_FLBAS_EXTENDED_MASK ? "Extended" : "Separate"); + if (NVMEV(NVME_NS_DATA_LBAF_MS, nsdata->lbaf[flbas_fmt]) != 0) + printf(" %s metadata\n", + NVMEV(NVME_NS_DATA_FLBAS_EXTENDED, nsdata->flbas) != 0 ? + "Extended" : "Separate"); else printf("\n"); printf("Metadata Capabilities\n"); printf(" Extended: %s\n", - nsdata->mc >> NVME_NS_DATA_MC_EXTENDED_SHIFT & NVME_NS_DATA_MC_EXTENDED_MASK ? "Supported" : "Not Supported"); + NVMEV(NVME_NS_DATA_MC_EXTENDED, nsdata->mc) != 0 ? "Supported" : + "Not Supported"); printf(" Separate: %s\n", - nsdata->mc >> NVME_NS_DATA_MC_POINTER_SHIFT & NVME_NS_DATA_MC_POINTER_MASK ? "Supported" : "Not Supported"); + NVMEV(NVME_NS_DATA_MC_POINTER, nsdata->mc) != 0 ? "Supported" : + "Not Supported"); printf("Data Protection Caps: %s%s%s%s%s%s\n", (nsdata->dpc == 0) ? "Not Supported" : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) & - NVME_NS_DATA_DPC_MD_END_MASK) ? "Last Bytes, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_START_SHIFT) & - NVME_NS_DATA_DPC_MD_START_MASK) ? "First Bytes, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT3_SHIFT) & - NVME_NS_DATA_DPC_PIT3_MASK) ? "Type 3, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_SHIFT) & - NVME_NS_DATA_DPC_PIT2_MASK) ? "Type 2, " : "", - ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT1_SHIFT) & - NVME_NS_DATA_DPC_PIT1_MASK) ? "Type 1" : ""); + NVMEV(NVME_NS_DATA_DPC_MD_END, nsdata->dpc) != 0 ? "Last Bytes, " : + "", + NVMEV(NVME_NS_DATA_DPC_MD_START, nsdata->dpc) != 0 ? + "First Bytes, " : "", + NVMEV(NVME_NS_DATA_DPC_PIT3, nsdata->dpc) != 0 ? "Type 3, " : "", + NVMEV(NVME_NS_DATA_DPC_PIT2, nsdata->dpc) != 0 ? "Type 2, " : "", + NVMEV(NVME_NS_DATA_DPC_PIT1, nsdata->dpc) != 0 ? "Type 1" : ""); printf("Data Protection Settings: "); - ptype = (nsdata->dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & - NVME_NS_DATA_DPS_PIT_MASK; - if (ptype) { + ptype = NVMEV(NVME_NS_DATA_DPS_PIT, nsdata->dps); + if (ptype != 0) { printf("Type %d, %s Bytes\n", ptype, - ((nsdata->dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) & - NVME_NS_DATA_DPS_MD_START_MASK) ? "First" : "Last"); + NVMEV(NVME_NS_DATA_DPS_MD_START, nsdata->dps) != 0 ? + "First" : "Last"); } else { printf("Not Enabled\n"); } printf("Multi-Path I/O Capabilities: %s%s\n", (nsdata->nmic == 0) ? "Not Supported" : "", - ((nsdata->nmic >> NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) & - NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK) ? "May be shared" : ""); + NVMEV(NVME_NS_DATA_NMIC_MAY_BE_SHARED, nsdata->nmic) != 0 ? + "May be shared" : ""); printf("Reservation Capabilities: %s%s%s%s%s%s%s%s%s\n", (nsdata->rescap == 0) ? "Not Supported" : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_IEKEY13_SHIFT) & - NVME_NS_DATA_RESCAP_IEKEY13_MASK) ? "IEKEY13, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_AR_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_AR_MASK) ? "EX_AC_AR, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_AR_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_AR_MASK) ? "WR_EX_AR, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_RO_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_RO_MASK) ? "EX_AC_RO, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_RO_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_RO_MASK) ? "WR_EX_RO, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_SHIFT) & - NVME_NS_DATA_RESCAP_EX_AC_MASK) ? "EX_AC, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_SHIFT) & - NVME_NS_DATA_RESCAP_WR_EX_MASK) ? "WR_EX, " : "", - ((nsdata->rescap >> NVME_NS_DATA_RESCAP_PTPL_SHIFT) & - NVME_NS_DATA_RESCAP_PTPL_MASK) ? "PTPL" : ""); + NVMEV(NVME_NS_DATA_RESCAP_IEKEY13, nsdata->rescap) != 0 ? + "IEKEY13, " : "", + NVMEV(NVME_NS_DATA_RESCAP_EX_AC_AR, nsdata->rescap) != 0 ? + "EX_AC_AR, " : "", + NVMEV(NVME_NS_DATA_RESCAP_WR_EX_AR, nsdata->rescap) != 0 ? + "WR_EX_AR, " : "", + NVMEV(NVME_NS_DATA_RESCAP_EX_AC_RO, nsdata->rescap) != 0 ? + "EX_AC_RO, " : "", + NVMEV(NVME_NS_DATA_RESCAP_WR_EX_RO, nsdata->rescap) != 0 ? + "WR_EX_RO, " : "", + NVMEV(NVME_NS_DATA_RESCAP_EX_AC, nsdata->rescap) != 0 ? + "EX_AC, " : "", + NVMEV(NVME_NS_DATA_RESCAP_WR_EX, nsdata->rescap) != 0 ? + "WR_EX, " : "", + NVMEV(NVME_NS_DATA_RESCAP_PTPL, nsdata->rescap) != 0 ? "PTPL" : ""); printf("Format Progress Indicator: "); - if ((nsdata->fpi >> NVME_NS_DATA_FPI_SUPP_SHIFT) & - NVME_NS_DATA_FPI_SUPP_MASK) { + if (NVMEV(NVME_NS_DATA_FPI_SUPP, nsdata->fpi) != 0) { printf("%u%% remains\n", - (nsdata->fpi >> NVME_NS_DATA_FPI_PERC_SHIFT) & - NVME_NS_DATA_FPI_PERC_MASK); + NVMEV(NVME_NS_DATA_FPI_PERC, nsdata->fpi)); } else printf("Not Supported\n"); - t = (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_READ_SHIFT) & - NVME_NS_DATA_DLFEAT_READ_MASK; + t = NVMEV(NVME_NS_DATA_DLFEAT_READ, nsdata->dlfeat); printf("Deallocate Logical Block: Read %s%s%s\n", (t == NVME_NS_DATA_DLFEAT_READ_NR) ? "Not Reported" : (t == NVME_NS_DATA_DLFEAT_READ_00) ? "00h" : (t == NVME_NS_DATA_DLFEAT_READ_FF) ? "FFh" : "Unknown", - (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_DWZ_SHIFT) & - NVME_NS_DATA_DLFEAT_DWZ_MASK ? ", Write Zero" : "", - (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_GCRC_SHIFT) & - NVME_NS_DATA_DLFEAT_GCRC_MASK ? ", Guard CRC" : ""); + NVMEV(NVME_NS_DATA_DLFEAT_DWZ, nsdata->dlfeat) != 0 ? + ", Write Zero" : "", + NVMEV(NVME_NS_DATA_DLFEAT_GCRC, nsdata->dlfeat) != 0 ? + ", Guard CRC" : ""); printf("Optimal I/O Boundary: %u blocks\n", nsdata->noiob); printf("NVM Capacity: %s bytes\n", uint128_to_str(to128(nsdata->nvmcap), cbuf, sizeof(cbuf))); - if ((nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) { + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, nsdata->nsfeat) != 0) { printf("Preferred Write Granularity: %u blocks\n", nsdata->npwg + 1); printf("Preferred Write Alignment: %u blocks\n", @@ -181,14 +173,11 @@ print_namespace(struct nvme_namespace_data *nsdata) printf("\n"); for (i = 0; i <= nsdata->nlbaf; i++) { lbaf = nsdata->lbaf[i]; - lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, lbaf); if (lbads == 0) continue; - ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) & - NVME_NS_DATA_LBAF_MS_MASK; - rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) & - NVME_NS_DATA_LBAF_RP_MASK; + ms = NVMEV(NVME_NS_DATA_LBAF_MS, lbaf); + rp = NVMEV(NVME_NS_DATA_LBAF_RP, lbaf); printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d" " Performance: %s\n", i, 1 << lbads, ms, (rp == 0) ? "Best" : diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c index 72b1ff5ccd7b..cc30ba0d6349 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -57,41 +57,27 @@ nvme_print_controller(struct nvme_controller_data *cdata) uint8_t fwug; oncs = cdata->oncs; - compare = (oncs >> NVME_CTRLR_DATA_ONCS_COMPARE_SHIFT) & - NVME_CTRLR_DATA_ONCS_COMPARE_MASK; - write_unc = (oncs >> NVME_CTRLR_DATA_ONCS_WRITE_UNC_SHIFT) & - NVME_CTRLR_DATA_ONCS_WRITE_UNC_MASK; - dsm = (oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & - NVME_CTRLR_DATA_ONCS_DSM_MASK; + compare = NVMEV(NVME_CTRLR_DATA_ONCS_COMPARE, oncs); + write_unc = NVMEV(NVME_CTRLR_DATA_ONCS_WRITE_UNC, oncs); + dsm = NVMEV(NVME_CTRLR_DATA_ONCS_DSM, oncs); oacs = cdata->oacs; - security = (oacs >> NVME_CTRLR_DATA_OACS_SECURITY_SHIFT) & - NVME_CTRLR_DATA_OACS_SECURITY_MASK; - fmt = (oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & - NVME_CTRLR_DATA_OACS_FORMAT_MASK; - fw = (oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; - nsmgmt = (oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK; + security = NVMEV(NVME_CTRLR_DATA_OACS_SECURITY, oacs); + fmt = NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, oacs); + fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, oacs); + nsmgmt = NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, oacs); - fw_num_slots = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; - fw_slot1_ro = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_SLOT1_RO_SHIFT) & - NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK; + fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw); + fw_slot1_ro = NVMEV(NVME_CTRLR_DATA_FRMW_SLOT1_RO, cdata->frmw); fwug = cdata->fwug; - ns_smart = (cdata->lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & - NVME_CTRLR_DATA_LPA_NS_SMART_MASK; + ns_smart = NVMEV(NVME_CTRLR_DATA_LPA_NS_SMART, cdata->lpa); - sqes_min = (cdata->sqes >> NVME_CTRLR_DATA_SQES_MIN_SHIFT) & - NVME_CTRLR_DATA_SQES_MIN_MASK; - sqes_max = (cdata->sqes >> NVME_CTRLR_DATA_SQES_MAX_SHIFT) & - NVME_CTRLR_DATA_SQES_MAX_MASK; + sqes_min = NVMEV(NVME_CTRLR_DATA_SQES_MIN, cdata->sqes); + sqes_max = NVMEV(NVME_CTRLR_DATA_SQES_MAX, cdata->sqes); - cqes_min = (cdata->cqes >> NVME_CTRLR_DATA_CQES_MIN_SHIFT) & - NVME_CTRLR_DATA_CQES_MIN_MASK; - cqes_max = (cdata->cqes >> NVME_CTRLR_DATA_CQES_MAX_SHIFT) & - NVME_CTRLR_DATA_CQES_MAX_MASK; + cqes_min = NVMEV(NVME_CTRLR_DATA_CQES_MIN, cdata->cqes); + cqes_max = NVMEV(NVME_CTRLR_DATA_CQES_MAX, cdata->cqes); printf("Controller Capabilities/Features\n"); printf("================================\n"); @@ -108,14 +94,14 @@ nvme_print_controller(struct nvme_controller_data *cdata) cdata->ieee[2], cdata->ieee[1], cdata->ieee[0]); printf("Multi-Path I/O Capabilities: %s%s%s%s%s\n", (cdata->mic == 0) ? "Not Supported" : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_ANAR_SHIFT) & - NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "Asymmetric, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & - NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & - NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", - ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & - NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); + NVMEV(NVME_CTRLR_DATA_MIC_ANAR, cdata->mic) != 0 ? + "Asymmetric, " : "", + NVMEV(NVME_CTRLR_DATA_MIC_SRIOVVF, cdata->mic) != 0 ? + "SR-IOV VF, " : "", + NVMEV(NVME_CTRLR_DATA_MIC_MCTRLRS, cdata->mic) != 0 ? + "Multiple controllers, " : "", + NVMEV(NVME_CTRLR_DATA_MIC_MPORTS, cdata->mic) != 0 ? + "Multiple ports" : ""); /* TODO: Use CAP.MPSMIN to determine true memory page size. */ printf("Max Data Transfer Size: "); if (cdata->mdts == 0) @@ -123,24 +109,19 @@ nvme_print_controller(struct nvme_controller_data *cdata) else printf("%ld bytes\n", PAGE_SIZE * (1L << cdata->mdts)); printf("Sanitize Crypto Erase: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_CES_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize Block Erase: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_BES_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize Overwrite: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_OWS_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize NDI: %s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_NDI_SHIFT) & - NVME_CTRLR_DATA_SANICAP_NDI_MASK) ? - "Supported" : "Not Supported"); + NVMEV(NVME_CTRLR_DATA_SANICAP_NDI, cdata->sanicap) != 0 ? + "Supported" : "Not Supported"); printf("Sanitize NODMMAS: "); - switch (((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_NODMMAS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_NODMMAS_MASK)) { + switch (NVMEV(NVME_CTRLR_DATA_SANICAP_NODMMAS, cdata->sanicap)) { case NVME_CTRLR_DATA_SANICAP_NODMMAS_UNDEF: printf("Undefined\n"); break; @@ -171,32 +152,26 @@ nvme_print_controller(struct nvme_controller_data *cdata) printf("Namespace Management: %s\n", nsmgmt ? "Supported" : "Not Supported"); printf("Device Self-test: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT) & - NVME_CTRLR_DATA_OACS_SELFTEST_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_SELFTEST, oacs) != 0 ? "" : "Not "); printf("Directives: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT) & - NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_DIRECTIVES, oacs) != 0 ? "" : "Not "); printf("NVMe-MI Send/Receive: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT) & - NVME_CTRLR_DATA_OACS_NVMEMI_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_NVMEMI, oacs) != 0 ? "" : "Not "); printf("Virtualization Management: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_VM_SHIFT) & - NVME_CTRLR_DATA_OACS_VM_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_VM, oacs) != 0 ? "" : "Not "); printf("Doorbell Buffer Config: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT) & - NVME_CTRLR_DATA_OACS_DBBUFFER_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_DBBUFFER, oacs) != 0 ? "" : "Not "); printf("Get LBA Status: %sSupported\n", - ((oacs >> NVME_CTRLR_DATA_OACS_GETLBA_SHIFT) & - NVME_CTRLR_DATA_OACS_GETLBA_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_OACS_GETLBA, oacs) != 0 ? "" : "Not "); printf("Sanitize: "); if (cdata->sanicap != 0) { printf("%s%s%s\n", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_CES_MASK) ? "crypto, " : "", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_BES_MASK) ? "block, " : "", - ((cdata->sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_OWS_MASK) ? "overwrite" : ""); + NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ? + "crypto, " : "", + NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cdata->sanicap) != 0 ? + "block, " : "", + NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cdata->sanicap) != 0 ? + "overwrite" : ""); } else { printf("Not Supported\n"); } @@ -245,36 +220,30 @@ nvme_print_controller(struct nvme_controller_data *cdata) printf("Dataset Management Command: %s\n", dsm ? "Supported" : "Not Supported"); printf("Write Zeroes Command: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_WRZERO_SHIFT) & - NVME_CTRLR_DATA_ONCS_WRZERO_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_WRZERO, oncs) != 0 ? "" : "Not "); printf("Save Features: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_SAVEFEAT_SHIFT) & - NVME_CTRLR_DATA_ONCS_SAVEFEAT_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_SAVEFEAT, oncs) != 0 ? "" : "Not "); printf("Reservations: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_RESERV_SHIFT) & - NVME_CTRLR_DATA_ONCS_RESERV_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_RESERV, oncs) != 0 ? "" : "Not "); printf("Timestamp feature: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT) & - NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_TIMESTAMP, oncs) != 0 ? "" : "Not "); printf("Verify feature: %sSupported\n", - ((oncs >> NVME_CTRLR_DATA_ONCS_VERIFY_SHIFT) & - NVME_CTRLR_DATA_ONCS_VERIFY_MASK) ? "" : "Not "); + NVMEV(NVME_CTRLR_DATA_ONCS_VERIFY, oncs) != 0 ? "" : "Not "); printf("Fused Operation Support: %s%s\n", (cdata->fuses == 0) ? "Not Supported" : "", - ((cdata->fuses >> NVME_CTRLR_DATA_FUSES_CNW_SHIFT) & - NVME_CTRLR_DATA_FUSES_CNW_MASK) ? "Compare and Write" : ""); + NVMEV(NVME_CTRLR_DATA_FUSES_CNW, cdata->fuses) != 0 ? + "Compare and Write" : ""); printf("Format NVM Attributes: %s%s Erase, %s Format\n", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & - NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) ? "Crypto Erase, " : "", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) ? "All-NVM" : "Per-NS", - ((cdata->fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & - NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) ? "All-NVM" : "Per-NS"); - t = (cdata->vwc >> NVME_CTRLR_DATA_VWC_ALL_SHIFT) & - NVME_CTRLR_DATA_VWC_ALL_MASK; + NVMEV(NVME_CTRLR_DATA_FNA_CRYPTO_ERASE, cdata->fna) != 0 ? + "Crypto Erase, " : "", + NVMEV(NVME_CTRLR_DATA_FNA_ERASE_ALL, cdata->fna) != 0 ? + "All-NVM" : "Per-NS", + NVMEV(NVME_CTRLR_DATA_FNA_FORMAT_ALL, cdata->fna) != 0 ? + "All-NVM" : "Per-NS"); + t = NVMEV(NVME_CTRLR_DATA_VWC_ALL, cdata->vwc); printf("Volatile Write Cache: %s%s\n", - ((cdata->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK) ? "Present" : "Not Present", + NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cdata->vwc) != 0 ? + "Present" : "Not Present", (t == NVME_CTRLR_DATA_VWC_ALL_NO) ? ", no flush all" : (t == NVME_CTRLR_DATA_VWC_ALL_YES) ? ", flush all" : ""); diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 31ec3a443716..8c03aa6fb7f4 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -402,13 +402,10 @@ print_log_firmware(const struct nvme_controller_data *cdata, void *buf, uint32_t uint16_t oacs_fw; uint8_t fw_num_slots; - afi_slot = fw->afi >> NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT; - afi_slot &= NVME_FIRMWARE_PAGE_AFI_SLOT_MASK; + afi_slot = NVMEV(NVME_FIRMWARE_PAGE_AFI_SLOT, fw->afi); - oacs_fw = (cdata->oacs >> NVME_CTRLR_DATA_OACS_FIRMWARE_SHIFT) & - NVME_CTRLR_DATA_OACS_FIRMWARE_MASK; - fw_num_slots = (cdata->frmw >> NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT) & - NVME_CTRLR_DATA_FRMW_NUM_SLOTS_MASK; + oacs_fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, cdata->oacs); + fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw); printf("Firmware Slot Log\n"); printf("=================\n"); @@ -463,41 +460,27 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused, for (i = 0; i < 255; i++) { s = ce->acs[i]; - if (((s >> NVME_CE_PAGE_CSUP_SHIFT) & - NVME_CE_PAGE_CSUP_MASK) == 0) + if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("Admin\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, - ((s >> NVME_CE_PAGE_LBCC_SHIFT) & - NVME_CE_PAGE_LBCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NCC_SHIFT) & - NVME_CE_PAGE_NCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NIC_SHIFT) & - NVME_CE_PAGE_NIC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CCC_SHIFT) & - NVME_CE_PAGE_CCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CSE_SHIFT) & - NVME_CE_PAGE_CSE_MASK), - ((s >> NVME_CE_PAGE_UUID_SHIFT) & - NVME_CE_PAGE_UUID_MASK) ? "Yes" : "No"); + NVMEV(NVME_CE_PAGE_LBCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NIC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CSE, s), + NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No"); } for (i = 0; i < 255; i++) { s = ce->iocs[i]; - if (((s >> NVME_CE_PAGE_CSUP_SHIFT) & - NVME_CE_PAGE_CSUP_MASK) == 0) + if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("I/O\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, - ((s >> NVME_CE_PAGE_LBCC_SHIFT) & - NVME_CE_PAGE_LBCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NCC_SHIFT) & - NVME_CE_PAGE_NCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_NIC_SHIFT) & - NVME_CE_PAGE_NIC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CCC_SHIFT) & - NVME_CE_PAGE_CCC_MASK) ? "Yes" : "No", - ((s >> NVME_CE_PAGE_CSE_SHIFT) & - NVME_CE_PAGE_CSE_MASK), - ((s >> NVME_CE_PAGE_UUID_SHIFT) & - NVME_CE_PAGE_UUID_MASK) ? "Yes" : "No"); + NVMEV(NVME_CE_PAGE_LBCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_NIC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CCC, s) != 0 ? "Yes" : "No", + NVMEV(NVME_CE_PAGE_CSE, s), + NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No"); } } @@ -548,8 +531,7 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, printf("Sanitize Progress: %u%% (%u/65535)\n", (ss->sprog * 100 + 32768) / 65536, ss->sprog); printf("Sanitize Status: "); - switch ((ss->sstat >> NVME_SS_PAGE_SSTAT_STATUS_SHIFT) & - NVME_SS_PAGE_SSTAT_STATUS_MASK) { + switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss->sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); break; @@ -569,12 +551,10 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, printf("Unknown"); break; } - p = (ss->sstat >> NVME_SS_PAGE_SSTAT_PASSES_SHIFT) & - NVME_SS_PAGE_SSTAT_PASSES_MASK; + p = NVMEV(NVME_SS_PAGE_SSTAT_PASSES, ss->sstat); if (p > 0) printf(", %d passes", p); - if ((ss->sstat >> NVME_SS_PAGE_SSTAT_GDE_SHIFT) & - NVME_SS_PAGE_SSTAT_GDE_MASK) + if (NVMEV(NVME_SS_PAGE_SSTAT_GDE, ss->sstat) != 0) printf(", Global Data Erased"); printf("\n"); printf("Sanitize Command Dword 10: 0x%x\n", ss->scdw10); @@ -796,8 +776,7 @@ logpage(const struct cmd *f, int argc, char *argv[]) if (read_controller_data(fd, &cdata)) errx(EX_IOERR, "Identify request failed"); - ns_smart = (cdata.lpa >> NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT) & - NVME_CTRLR_DATA_LPA_NS_SMART_MASK; + ns_smart = NVMEV(NVME_CTRLR_DATA_LPA_NS_SMART, cdata.lpa); /* * The log page attributes indicate whether or not the controller diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index dd678568d5ca..a77f37e0f468 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -417,8 +417,7 @@ nsactive(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -463,8 +462,7 @@ nsallocated(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -509,8 +507,7 @@ nscontrollers(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -571,8 +568,7 @@ nscreate(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&nsdata, 0, sizeof(nsdata)); @@ -630,8 +626,7 @@ nscreate(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace creation failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d created\n", pt.cpl.cdw0); exit(0); @@ -667,8 +662,7 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -684,8 +678,7 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace deletion failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d deleted\n", nsid); exit(0); @@ -734,8 +727,7 @@ nsattach(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); if (attach_opt.ctrlrid == NONE) { @@ -771,8 +763,7 @@ nsattach(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace attach failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d attached\n", nsid); exit(0); @@ -806,8 +797,7 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); if (detach_opt.ctrlrid == NONE) { @@ -850,8 +840,7 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) if (nvme_completion_is_error(&pt.cpl)) { errx(EX_IOERR, "namespace detach failed: %s", - get_res_str((pt.cpl.status >> NVME_STATUS_SC_SHIFT) & - NVME_STATUS_SC_MASK)); + get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); } printf("namespace %d detached\n", nsid); exit(0); @@ -885,8 +874,7 @@ nsattached(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); @@ -939,8 +927,7 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) errx(EX_IOERR, "Identify request failed"); /* Check that controller can execute this command. */ - if (((cd.oacs >> NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT) & - NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_NSMGMT, cd.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); memset(&pt, 0, sizeof(pt)); diff --git a/sbin/nvmecontrol/power.c b/sbin/nvmecontrol/power.c index 78de46dbc277..887010feb782 100644 --- a/sbin/nvmecontrol/power.c +++ b/sbin/nvmecontrol/power.c @@ -63,14 +63,10 @@ power_list_one(int i, struct nvme_power_state *nps) int mpower, apower, ipower; uint8_t mps, nops, aps, apw; - mps = (nps->mps_nops >> NVME_PWR_ST_MPS_SHIFT) & - NVME_PWR_ST_MPS_MASK; - nops = (nps->mps_nops >> NVME_PWR_ST_NOPS_SHIFT) & - NVME_PWR_ST_NOPS_MASK; - apw = (nps->apw_aps >> NVME_PWR_ST_APW_SHIFT) & - NVME_PWR_ST_APW_MASK; - aps = (nps->apw_aps >> NVME_PWR_ST_APS_SHIFT) & - NVME_PWR_ST_APS_MASK; + mps = NVMEV(NVME_PWR_ST_MPS, nps->mps_nops); + nops = NVMEV(NVME_PWR_ST_NOPS, nps->mps_nops); + apw = NVMEV(NVME_PWR_ST_APW, nps->apw_aps); + aps = NVMEV(NVME_PWR_ST_APS, nps->apw_aps); mpower = nps->mp; if (mps == 0) diff --git a/sbin/nvmecontrol/sanitize.c b/sbin/nvmecontrol/sanitize.c index d56a74685651..4611a6964a4d 100644 --- a/sbin/nvmecontrol/sanitize.c +++ b/sbin/nvmecontrol/sanitize.c @@ -155,14 +155,11 @@ sanitize(const struct cmd *f, int argc, char *argv[]) /* Check that controller can execute this command. */ if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); - if (((cd.sanicap >> NVME_CTRLR_DATA_SANICAP_BES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_BES_MASK) == 0 && sanact == 2) + if (NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cd.sanicap) == 0 && sanact == 2) errx(EX_UNAVAILABLE, "controller does not support Block Erase"); - if (((cd.sanicap >> NVME_CTRLR_DATA_SANICAP_OWS_SHIFT) & - NVME_CTRLR_DATA_SANICAP_OWS_MASK) == 0 && sanact == 3) + if (NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cd.sanicap) == 0 && sanact == 3) errx(EX_UNAVAILABLE, "controller does not support Overwrite"); - if (((cd.sanicap >> NVME_CTRLR_DATA_SANICAP_CES_SHIFT) & - NVME_CTRLR_DATA_SANICAP_CES_MASK) == 0 && sanact == 4) + if (NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cd.sanicap) == 0 && sanact == 4) errx(EX_UNAVAILABLE, "controller does not support Crypto Erase"); /* @@ -187,8 +184,7 @@ sanitize(const struct cmd *f, int argc, char *argv[]) wait: read_logpage(fd, NVME_LOG_SANITIZE_STATUS, NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &ss, sizeof(ss)); - switch ((ss.sstat >> NVME_SS_PAGE_SSTAT_STATUS_SHIFT) & - NVME_SS_PAGE_SSTAT_STATUS_MASK) { + switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss.sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); break; diff --git a/sbin/nvmecontrol/selftest.c b/sbin/nvmecontrol/selftest.c index 6139a7902234..0fae3a3062ae 100644 --- a/sbin/nvmecontrol/selftest.c +++ b/sbin/nvmecontrol/selftest.c @@ -100,8 +100,7 @@ selftest(const struct cmd *f, int argc, char *argv[]) if (read_controller_data(fd, &cdata)) errx(EX_IOERR, "Identify request failed"); - if (((cdata.oacs >> NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT) & - NVME_CTRLR_DATA_OACS_SELFTEST_MASK) == 0) + if (NVMEV(NVME_CTRLR_DATA_OACS_SELFTEST, cdata.oacs) == 0) errx(EX_UNAVAILABLE, "controller does not support self-test"); selftest_op(fd, nsid, opt.stc); From nobody Mon Aug 26 18:03:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7610y0z5TLm4; Mon, 26 Aug 2024 18:03: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 4Wsz756M47z44HY; Mon, 26 Aug 2024 18:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dw4gzY3PzFgovS0cQsGOx+4Q0IGMZqCjSE4C1Zr15tI=; b=MKLpvaCe2mOJUILS2Ia+++OcWy9ooAe6LYgI7ubU8bWcJDFfCxk+/pQhmwHnuwpKACCI8j lyy054CSaBMLrf4CgY3TN+e1dviTmPg+K8g1Y453das4fdMlI74wRX7cmgau2heyqykmfd v3ZmaKhXSNYinGB2dXxEYGjuUN7zkNwXuh43m3Pd0kjyKJYkd+E+BCE+6/AOGD3OTUsl5W oijcUeFTIf9ZGR4o0tX1xFJAAIeQF2A0kFzicT8vRZqY1xQ0oLrLoo6pYXaAxs8b/l89FJ ZoATBZ+4cz2i0X4wBN+Og5PnV0uBUBBe8kvodsEOkNSuVx2GrQLMdGVz+hOWLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695393; a=rsa-sha256; cv=none; b=i8dtmJ2P8J2rnjpTdk6xc+g91C5GLc2K3BwicXKCIp5PjRw3a8ua6lLrJQUegeqSLIEHBJ afNIUJbJi/DVsu70/cHJ/9lFQDuazX1gCyRb7AvwQckjki9YUllABjCdUseqL4wc2Ure2J T2pvS5D8aVLDy+SdirzK11n4bn5Kb48Vp3BVH+BnAjaZI3dgxlw6h8t699A+YEPkmhEh+e KSqWBuzNZHP0DVU5X2EMfuwkzo2tRpjYXLfQelRmdARRBNZ2CzqvB5WYrVFcd5gHWMfzT6 SRARMZcTXPpeeW3T2jLmFOnfemC6WYZdfdsvfFaht3+mOpIVGuqCYEDVnBp6aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dw4gzY3PzFgovS0cQsGOx+4Q0IGMZqCjSE4C1Zr15tI=; b=bEEVix+0g1diXRrxWiG/1L0CesvH8Ya4ni19uVjm+gp3wFTX1Hl6/zltP9bOKra4FNZxCX owf6c37cOtMLYEHhaO4JrYdwWYYrtQiVetopwz8X/qZjV8Od6IXST0/P2rlNPD/FgO7riQ ICoDzFdofK2yHowDNdm9/GJ7/hYZh7/0fgQu1gD6H9dIRStr+vc+km3VN5xwI7XtfuqLcU EijJV4rhP2UhFhix9RuehHdtm3tOLzluLA2A7De8SUxLSWlFTd7W1WvGp7SmFcl25OW0cW OK2WpwTBvL07AZTKNrIymgM17iakS4ew3vIfd2pjg43gKKMy5E9WklbPsP+BKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz755xw1zGs9; Mon, 26 Aug 2024 18:03: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 47QI3DUd042451; Mon, 26 Aug 2024 18:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3DDr042448; Mon, 26 Aug 2024 18:03:13 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:13 GMT Message-Id: <202408261803.47QI3DDr042448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8ed711ddcd02 - stable/14 - bhyve: Use the NVMEV macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ed711ddcd0277f4b0101e7bb641130ee8d1dfab Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed711ddcd0277f4b0101e7bb641130ee8d1dfab commit 8ed711ddcd0277f4b0101e7bb641130ee8d1dfab Author: John Baldwin AuthorDate: 2024-01-29 18:49:49 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:17 +0000 bhyve: Use the NVMEV macro instead of expanded versions Reviewed by: corvink, chuck (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43598 (cherry picked from commit 94962f5a72ae7a5190f38cbe54a0ad4426329a06) --- usr.sbin/bhyve/pci_nvme.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2fd49a84c768..4084f9b007ba 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -369,15 +369,15 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Configuration utils */ #define NVME_CC_GET_EN(cc) \ - ((cc) >> NVME_CC_REG_EN_SHIFT & NVME_CC_REG_EN_MASK) + NVMEV(NVME_CC_REG_EN, cc) #define NVME_CC_GET_CSS(cc) \ - ((cc) >> NVME_CC_REG_CSS_SHIFT & NVME_CC_REG_CSS_MASK) + NVMEV(NVME_CC_REG_CSS, cc) #define NVME_CC_GET_SHN(cc) \ - ((cc) >> NVME_CC_REG_SHN_SHIFT & NVME_CC_REG_SHN_MASK) + NVMEV(NVME_CC_REG_SHN, cc) #define NVME_CC_GET_IOSQES(cc) \ - ((cc) >> NVME_CC_REG_IOSQES_SHIFT & NVME_CC_REG_IOSQES_MASK) + NVMEV(NVME_CC_REG_IOSQES, cc) #define NVME_CC_GET_IOCQES(cc) \ - ((cc) >> NVME_CC_REG_IOCQES_SHIFT & NVME_CC_REG_IOCQES_MASK) + NVMEV(NVME_CC_REG_IOCQES, cc) #define NVME_CC_WRITE_MASK \ ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ @@ -391,7 +391,7 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Status utils */ #define NVME_CSTS_GET_RDY(sts) \ - ((sts) >> NVME_CSTS_REG_RDY_SHIFT & NVME_CSTS_REG_RDY_MASK) + NVMEV(NVME_CSTS_REG_RDY, sts) #define NVME_CSTS_RDY (1 << NVME_CSTS_REG_RDY_SHIFT) #define NVME_CSTS_CFS (1 << NVME_CSTS_REG_CFS_SHIFT) @@ -1085,8 +1085,7 @@ pci_nvme_init_controller(struct pci_nvme_softc *sc) DPRINTF("%s mapping Admin-SQ guest 0x%lx, host: %p", __func__, sc->regs.asq, sc->submit_queues[0].qbase); - acqs = ONE_BASED((sc->regs.aqa >> NVME_AQA_REG_ACQS_SHIFT) & - NVME_AQA_REG_ACQS_MASK); + acqs = ONE_BASED(NVMEV(NVME_AQA_REG_ACQS, sc->regs.aqa)); if (acqs < 2) { EPRINTLN("%s: illegal ACQS value %#x (aqa=%#x)", __func__, acqs - 1, sc->regs.aqa); @@ -2083,8 +2082,8 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, uint64_t value) break; case NVME_OPC_FORMAT_NVM: DPRINTF("%s command FORMAT_NVM", __func__); - if ((sc->ctrldata.oacs & - (1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT)) == 0) { + if (NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, + sc->ctrldata.oacs) == 0) { pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); break; } From nobody Mon Aug 26 18:03:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz771rq4z5TLZ8; Mon, 26 Aug 2024 18:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7709y4z44cR; Mon, 26 Aug 2024 18:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JbXUaGW4UgbN92vgWHVNS9rMUqNzCXdRJLZVTmlTLx4=; b=iLRhkpATrosQA0zewduQB/3iHrhgOJjmE8ceFhaHVTcX9Y6Eoy9Hrs/vISgUNgqARI9NO4 Yk+otb2J44UzTa9WtAy+HkSbMZ8aZG6W2Sc/pjlPqpRwl9Jtc/S8y1vhcMXY/Okcn+RNNA 1fvNaF/xhhhZmJROV7sZX6YpNWUdPzZYMRfKaVWFePHllI+UPkTO4og2iEEYWkiZFroWUM 286eDvjT6BXrd4FKGRm0op40/cIQTESywcYlk1dkCniCAaOMFgiUJwRwfnKCHOla9P7eIQ RVZzalWuce/9korBz7/tNIwIC/v6rgNLA8SwaUgXDeBI821Hf3FCqMXDdGmHMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695395; a=rsa-sha256; cv=none; b=s0ZrLRnHWGzF8tHkqQEkW4HfWz066Adny2jZzrcbf964qandN9WtUAC8C2aHtJAWMd/zrm R8QoO46PKo2NOyNaIIkCxGvv5e7NHfUP/v8xjZM4YVx9yuiRd2HSYYHQUcpW+Jrd7882e9 o567KjBTZmNium0x9i+8GN5KOWfLZPq7QPr37rtXwCVPICed27n8/V8qxPlbp0PetFgFjx l5THhChxucGIDh8/dWXHS4xZw46vod1Zjjux2wxlac2+GgW+lOW/aB4KriLETmk3dxa3nX cTLgWcD8WMstEzYEkqGyAFa4LImnR+X/G7FetgLDx0u6Vk6uL65/t6F1Tm8GXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JbXUaGW4UgbN92vgWHVNS9rMUqNzCXdRJLZVTmlTLx4=; b=fyWk4eUzIuIQYtcAwph2sVW6Br/xZnCchVyvUn5Wt2/OO5AUXKgGWoxSDNGr7ge3//CZ0O +XzuTmrNmY/kjJMLkW7SPDlDbmwa4XQp7PjFOckDDWT83V0VrWl49GZhuFgInlPPnYEUGn UvgwoecbrC0viGYJ4n3VXfpXq9FprQa7BbWQgii/lsf0BOA3s7Ynlc04XQga9TNsKoDIVf /K/hMnmc2Q7GbocX0w2uZl34HW+Ix/Zkzr+HmtdvGRc4Qi/thP7Zc+TMvDBpzCxCweHpa+ SpBn3cfwvdfF/myLg4/T3Op1nffsWzHdby91QI6xLHLZ6mtIF3/fFA6ScB635w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz766pGszHKK; Mon, 26 Aug 2024 18:03: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 47QI3ExR042505; Mon, 26 Aug 2024 18:03:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3EVj042502; Mon, 26 Aug 2024 18:03:14 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:14 GMT Message-Id: <202408261803.47QI3EVj042502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4846d72432a8 - stable/14 - camdd: Use the NVMEV macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4846d72432a89614d7ceb3522cf7b5ac0185c775 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4846d72432a89614d7ceb3522cf7b5ac0185c775 commit 4846d72432a89614d7ceb3522cf7b5ac0185c775 Author: John Baldwin AuthorDate: 2024-01-29 18:50:41 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:24 +0000 camdd: Use the NVMEV macro instead of expanded versions Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43599 (cherry picked from commit c9d9315b74017b0637bcbcc2e7a5c01d7bc58bf1) --- usr.sbin/camdd/camdd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/camdd/camdd.c b/usr.sbin/camdd/camdd.c index 4f15aa8eedcf..1f067113c562 100644 --- a/usr.sbin/camdd/camdd.c +++ b/usr.sbin/camdd/camdd.c @@ -1430,9 +1430,8 @@ camdd_probe_pass_nvme(struct cam_device *cam_dev, union ccb *ccb, *maxsector = nsdata.nsze; /* The LBA Data Size (LBADS) is reported as a power of 2 */ - format = nsdata.flbas & NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsdata.lbaf[format] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + format = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsdata.flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsdata.lbaf[format]); *block_len = 1 << lbads; retval = 0; From nobody Mon Aug 26 18:03:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz783qNtz5TLnd; Mon, 26 Aug 2024 18:03: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 4Wsz781BNvz44t8; Mon, 26 Aug 2024 18:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lylXJh9hdcV1zeMVQD+IMQE+SenVc5RuYhkZpssTHEo=; b=FplfaWT2KA7LxbW6ndeou/gpOv0D4jZaxW8r7w0oH5H++AfI0hy8tveoM2rv5AT+3XbYBm U4UxaIZ1aw41hsI8wQ32XxO28aokV2C0GopOx9ZexZaVosfo6IZZDmzz3Gmh0lPJjRO1p4 maj2C5luoYmVm9gYM4qV7JFAj/b3/ymiFg5QjdfKXK2XlmFc0NcgM4bE+1+0bVdE/LtiKv NusHEealr9Zv3LRBhYMwhvO5MlAQ8CivoUT4tYl7qHEUVljT7tXegcA5EBymenZaIhSpyS 3w0OsLun1jusdUWdR/yat0cFg5WaZJTEYewRId0M0Y639y6KR6op3SZ1GlPKvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695396; a=rsa-sha256; cv=none; b=V6JmcTM9/w0fkKHcNSOfFteIPZR9s6WUfjHXnF3K17iApcRiVawocTOrCwKw5L4m+ThLcJ t8vAiC+qIc6DbojoQkb/8d84VsNyY7qp6mz3wAfrxOQmvikl5O07hJx2+HPTXZWNFu7z2D PZDGF3IG7eIc6YeiDyzAunpfGTquSeN/RG7gS2V8EnPngDbnhNlkmEFTEh4GUFDDFjQ9Sl B5t5bc9bB+K/gfn3b2YpqqCiZCyS8mGrIJS99WF0QpK3DRDkO7lndlX3HUGWVzqBsiQSp0 kSNML41jGfvZCfmrtxEwHUU1Guw0StQQ+OQGl8m1cZa8s099Zu8D6/aTGbGZHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lylXJh9hdcV1zeMVQD+IMQE+SenVc5RuYhkZpssTHEo=; b=Muqv9jAuoHVHaGfDaXfdwceUMkqpriSmNBQXApn3tzRfknWziyEDbI//iqR2vjZuKYI1Uf FM+xdezkq4B8c3Jebe6c4o6yCw3edlw7ffvZzGDECWN5ZqNbGcBIE/GwvxRkXy4pTKN5Gd T9dsba6BuAYrAnTpvGpiQz1XiWQHlSfKTn78JCT0dwS69m+ToURIYbbvwI8GM2MOSQrUXy iVI3pf5cSMxOV3WDqRSBlD75bKz5i18J7wpgosNeqxlw9hSNeR6L3xNqSu7CLv4Myc+nLm 15hWkJ9HlqNwaitoHvTdusFWJhEnexZBR8gVF9hJCOYPHNVnPrOXnG2mofOlMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz780mSrzHHL; Mon, 26 Aug 2024 18:03: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 47QI3GHl042566; Mon, 26 Aug 2024 18:03:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3Fcv042563; Mon, 26 Aug 2024 18:03:15 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:15 GMT Message-Id: <202408261803.47QI3Fcv042563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a918e5e9f88c - stable/14 - bhyve: Use NVMEV to read the ASQS field of AQA List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a918e5e9f88c82a2e47e4675ff92bf7735e98f77 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a918e5e9f88c82a2e47e4675ff92bf7735e98f77 commit a918e5e9f88c82a2e47e4675ff92bf7735e98f77 Author: John Baldwin AuthorDate: 2024-01-29 18:51:07 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:32 +0000 bhyve: Use NVMEV to read the ASQS field of AQA This is not a functional change, but just being consistent instead of omitting a shift by 0. Reviewed by: corvink, chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43600 (cherry picked from commit c42692360611c8afce6ee7bb937a858d64a133f4) --- usr.sbin/bhyve/pci_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 4084f9b007ba..dd6c9a41d17f 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1065,7 +1065,7 @@ pci_nvme_init_controller(struct pci_nvme_softc *sc) * cleared to 0h produces undefined results" for both ACQS and * ASQS. If zero, set CFS and do not become ready. */ - asqs = ONE_BASED(sc->regs.aqa & NVME_AQA_REG_ASQS_MASK); + asqs = ONE_BASED(NVMEV(NVME_AQA_REG_ASQS, sc->regs.aqa)); if (asqs < 2) { EPRINTLN("%s: illegal ASQS value %#x (aqa=%#x)", __func__, asqs - 1, sc->regs.aqa); From nobody Mon Aug 26 18:03:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz794Bzgz5TM4s; Mon, 26 Aug 2024 18:03: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 4Wsz792DYTz44RH; Mon, 26 Aug 2024 18:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ltXwUkh2TLLC4ady714CCKLExZgz5iNRG2Be8NLrxuI=; b=XZfGMrn7X2iLCQEL48l3xyG2lPUFLrN2WVeS8UTR0eXH0FO8GU8lUZwNbPd4Jdkdqur3Og fXVxQipv+ilWvwFUBHUwy0/SCm8bPBxb2b5xSAhQWdU2oWcGzsvXKJ967QAAK1b/7K44g2 5FB45c47G5gVsQiV4yF3c0jqSyiDR9xn0ZEZWeJ5rV4/2nKAzJYyAwoDmYUXEzEzpncAla PnYBHw+V4vNCVJ/ML/feorvuqq6wGwq8KU1fnhl2s9DX9odN+AD8SvsThrPynnq4AdJsjN Xm1KXOs+j8/pQYuUOpSvbXyCuFb3c+1dLinfE5PEKavZURKyHqTPVakdrDGxng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695397; a=rsa-sha256; cv=none; b=y4kuZLbxRQg5UUYnj+44KApyCID9Vslkt/x9jgUYaHyf5itfCD3VI31AOVoKdFiq3J5KuM fPS8zlD8ol73BjI5vGRj0o27FeYZ02Wasj3LPNItBZ2L5xk6OK56RLxONqJ8CFAARiBjLM PbvFJd3CLNj/2UoZq2QHQzlO/AaHO8TuYP3imly5IVo0GcxPM52P2eXCBEmK09a3qbRVTQ gv1uIPmop/86OA4lPqlVrjPF65QM5gfqTZUDnRDMyyRuJetXA5xcGwdKTq22qzMySkk6V6 2tnhDP2//BA8gCeaPMPXhStMOeSQRU5gVjh1E1tBHz9rC2cJcnXUejrMzbw5OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ltXwUkh2TLLC4ady714CCKLExZgz5iNRG2Be8NLrxuI=; b=H44F7hJHnH3yzGr8vLT8qQewjL6kvJ5bboffE3xrhQnFA/bwg4fe3/pwtjHzixKIKIWnf6 FMRuKNTti/k2agL+3WKpoD6ev/xd6pfdr359OKPYp0gdNDkcZcpV2CTSV7iCvxJF2nlRFR sJKHJrvJ8B9c3V55XLdXOacwFhcSOpXurpe9VUMI2/KBTDG471AIYve5k5BhaS7YhJsGsT rvrsbDEaikTnnGf6xUpAcx0C/wxfQKp0dVPMphUBxpLWruXWOOA4RVOHHITSTqaI4A6b88 XDtCqWYnRYsrHSos46ACy8R9HfGZuKPNZ8rWCt5R5bW1q53cHWXpdtN0LWinJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz791pFFzH9G; Mon, 26 Aug 2024 18:03: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 47QI3Ho3042614; Mon, 26 Aug 2024 18:03:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3HUn042611; Mon, 26 Aug 2024 18:03:17 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:17 GMT Message-Id: <202408261803.47QI3HUn042611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 80a92f1b91ed - stable/14 - nvme: Rename NVMEB helper macro to NVMEM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80a92f1b91ed90a5245651507b1af8c4fb616136 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=80a92f1b91ed90a5245651507b1af8c4fb616136 commit 80a92f1b91ed90a5245651507b1af8c4fb616136 Author: John Baldwin AuthorDate: 2024-01-29 18:58:28 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:38 +0000 nvme: Rename NVMEB helper macro to NVMEM The current macro always builds a full mask for a named field, so use the M suffix for mask. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43601 (cherry picked from commit 1dade1f255ee535ad357211395b46188bece52dc) --- sys/dev/nvme/nvme.h | 2 +- usr.sbin/bhyve/pci_nvme.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index cb5e1a5f1118..7b3cdd89f146 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -605,7 +605,7 @@ enum nvme_critical_warning_state { #define NVME_FEAT_SET_FID_MASK (0xff) /* Helper macro to combine *_MASK and *_SHIFT defines */ -#define NVMEB(name) (name##_MASK << name##_SHIFT) +#define NVMEM(name) (name##_MASK << name##_SHIFT) /* Helper macro to extract value from x */ #define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index dd6c9a41d17f..2d426fb19096 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -538,12 +538,12 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->cntrltype = NVME_CNTRLTYPE_IO; cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; - cd->oaes = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR); + cd->oaes = NVMEM(NVME_CTRLR_DATA_OAES_NS_ATTR); cd->acl = 2; cd->aerl = 4; /* Advertise 1, Read-only firmware slot */ - cd->frmw = NVMEB(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | + cd->frmw = NVMEM(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); cd->lpa = 0; /* TODO: support some simple things like SMART */ cd->elpe = 0; /* max error log page entries */ From nobody Mon Aug 26 18:03:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7B4g6kz5TLZW; Mon, 26 Aug 2024 18:03: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 4Wsz7B3F2yz44mQ; Mon, 26 Aug 2024 18:03:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILtue+TKeRppPhMQCbXQCBlIa7kOPuGe2y5ov4xkZTg=; b=NlZkxUqN6UNV9m+DZoswG0kFnY////0lZYv2a5Gnjw9I1PaA3jit4UpN3L9rY+bdS7GhhC BUzn9SgXyyVZuNg2pfmuwYehRIpruNBvVZCaHms8tg6IG3sQRHJRNoSp6h/VUDeiABysTm kKM+b1iYrsUulQcjBeskrsoOvQOA7nKKTH0WVuyznZUPCJNWqHs3eshXmimBzP+Gz18NXP XYD2cdQd4nyim+Oy0dibrXEqJ1X8HDE8PSyqcUQwIk0iWcRSwQHxKhLc5qQihPTCDbRiAy mgXV+0Q4m++YIQKuacK8IeESLFhIkrPVN5UV9l9yoIW4fi++gow7Jr8OAyD4RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695398; a=rsa-sha256; cv=none; b=R1zOqZsmArspOw0XfxslO4pAEyNyxa2VATcXeIgwxCJcKc03aOVlW2aDzI8DcB+/c7Z3pg qmBXAGJD1f/PiKkr/QO8GcaOChavMwILNopwueIkuKQOtEhfk3FjZ3sxGTYQwYWLhDud+a YCDiqz1fKVVrk5JAGLsy+SR3SaXDPdlE758Jl0H3v8HdJmpz2QfPEpQSnzzibVURD5QtIk vT0j1ZwExtMr8U9Bar8wbsCJt/VYFqBz3KQnBYoALJh0qK93ll6gQcLb5WUfZmfudaGEk9 SwGJs5PHSJyyFVO3XJ0wHlA13X/7ryAv+LHSvzmTZcDMzqACAsawNygBO0GLyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILtue+TKeRppPhMQCbXQCBlIa7kOPuGe2y5ov4xkZTg=; b=oQZAkWI7NC/wN0o82G8bXwI/Ab+qcX5mJWJWO89fWXVCk0dCOTaprANWWPuZ9ANl2G9ORn zAMhcepX8CbiurGmoBN18T5BOMRCUSfVXEHPCmg93FlNB/s231Too3i8QWcruMTiNyqvxe I0Roj159P1IJfyORv8FsWKBiutHHNg8IDPTqJAo2gz0Wpi9KYiEWrUNp7qHOV5JMJhAubG GMvNZ+BzOg2teUQxcdl78cSqEqQICKXB8WH8uAxHsf9jzWQMgoda1JlZnOmWYgLb50vWsY pvPFBFNWru7mfS258+YYKbRCjPVAQmKIj6RtIbwV1FQM2UdDVglbiAha9fMOoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7B2qkBzH4L; Mon, 26 Aug 2024 18:03: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 47QI3IMJ042671; Mon, 26 Aug 2024 18:03:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3IRS042668; Mon, 26 Aug 2024 18:03:18 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:18 GMT Message-Id: <202408261803.47QI3IRS042668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2208f2c15688 - stable/14 - nvme: Use the NVMEM macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2208f2c15688e6b517680535053bfba39b67c0a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2208f2c15688e6b517680535053bfba39b67c0a4 commit 2208f2c15688e6b517680535053bfba39b67c0a4 Author: John Baldwin AuthorDate: 2024-01-29 18:59:37 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:47 +0000 nvme: Use the NVMEM macro instead of expanded versions A few of these omitted a shift of 0, but this is more consistent. Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43602 (cherry picked from commit 8488fc417fc24af37fa6f1e880f09a5023670950) --- sys/dev/nvme/nvme_ctrlr.c | 6 +++--- sys/dev/nvme/nvme_ns.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 7096f0443f1d..3ef5a2b51544 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -326,7 +326,7 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) return (err); } - cc &= ~NVME_CC_REG_EN_MASK; + cc &= ~NVMEM(NVME_CC_REG_EN); nvme_mmio_write_4(ctrlr, cc, cc); /* @@ -1258,7 +1258,7 @@ nvme_pt_done(void *arg, const struct nvme_completion *cpl) pt->cpl.cdw0 = cpl->cdw0; status = cpl->status; - status &= ~NVME_STATUS_P_MASK; + status &= ~NVMEM(NVME_STATUS_P); pt->cpl.status = status; mtx_lock(mtx); @@ -1600,7 +1600,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) int timeout; cc = nvme_mmio_read_4(ctrlr, cc); - cc &= ~(NVME_CC_REG_SHN_MASK << NVME_CC_REG_SHN_SHIFT); + cc &= ~NVMEM(NVME_CC_REG_SHN); cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT; nvme_mmio_write_4(ctrlr, cc, cc); diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 329b8d583898..c172663f75a3 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -286,7 +286,7 @@ nvme_bio_child_inbed(struct bio *parent, int bio_error) if (inbed == children) { bzero(&parent_cpl, sizeof(parent_cpl)); if (parent->bio_flags & BIO_ERROR) { - parent_cpl.status &= ~(NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT); + parent_cpl.status &= ~NVMEM(NVME_STATUS_SC); parent_cpl.status |= (NVME_SC_DATA_TRANSFER_ERROR) << NVME_STATUS_SC_SHIFT; } nvme_ns_bio_done(parent, &parent_cpl); From nobody Mon Aug 26 18:03:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7C6Ndyz5TMDK; Mon, 26 Aug 2024 18:03: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 4Wsz7C40JQz450B; Mon, 26 Aug 2024 18:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tqa53fkhFHOXEsJDVf3d9d2j3nYimfvdF4WbvwAl3yk=; b=OlUfXhtjdz56OB9dSRMdYUMiaE3pBFIs1aP2wGOoBCo1vdzUdF8kme14YYlcft0UJysZlD plzzH8zKBysreV6jTsk38DAEuMRovlTpmD1SXs/3pjBCoeUiVb6zsA/Av1q69PysQV986A LHC1x1dnFEAb5IkpOPA69RLTfVMor8Virvoje5ZYDdpUvsuNNsWSYE4PxCAenbi5fsEBZy UqGtkSWakOWDLCFQQd75Ynwh/VQ/Se6GN0yO/5BAHiG6MmK4DfHR9NwFIQ2FULtp6Qzz7P n0PBqI0t0oQOLc79Z/nb9c8OSoVDgEB7T5qvh43kqAyJxf+X+upvt/yPpkqezw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695399; a=rsa-sha256; cv=none; b=N/jolT0GMJLFtZUD3rsRb+TUByOE9AMVQ3Xou9ysyfxGT61jte5ohWAOEP85Y+jeWRoGTl FRro/5A5Vl18qubSByMyCCYEUAL3xXJVdOEK36l6li74JhImvFNH/c7HWMYeRBdw3XhK6j VweZHNJ0vwG1GVN1FtVR8cQ8JPzGI0XPFuQVcdXSYGIxfdLbXQD4Bbw0p5nrcKqsyxqhrZ eTpAFeqFmmAN2L64lC4/uhNgX2MfhysLqYdM39Ouc10QB1Ojzenibi+2CdwIDt2Pn2PFY9 QUvBKz75l7Y2uKIymFsXSw2E+EdeM66Cg5B+6UKRLmLs64EJ1ogiLW8GF5ggNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tqa53fkhFHOXEsJDVf3d9d2j3nYimfvdF4WbvwAl3yk=; b=UHOxpVZf9LjPI7VE28QLRvrrDtFWL0qSOzdeztsVmycpVDqIKQ/XOdpsLvOFEmJMZH7l1S 0D3qRyXPnqanhGALXM2HhZqJHXV/B/m4r/vG7LNiV/8g9UtSNcAjTEThBoMsYNzmTyMHg+ OpVxhphF7M8YIDAv/DUh3UZXTVOliKk+LjOEkRHu+uFx/uI9Yjxi8ZOlR+00s0CWGc2bAG OyuYy+rwx/LhBlE/gUO5p4lp4qp2lA69Z/4DapBykCFHGq6YWjXJnOX2TVDJuLJflB+ri/ Ihqygd+K5DJYisTfilRTtnFiX25j4zdw//uwWE6JYwg467o1K/FLaMg90zNPLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7C3cR4zGsB; Mon, 26 Aug 2024 18:03: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 47QI3JxP042729; Mon, 26 Aug 2024 18:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3JpU042726; Mon, 26 Aug 2024 18:03:19 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:19 GMT Message-Id: <202408261803.47QI3JpU042726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8029ffc9c0b8 - stable/14 - bhyve: Use the NVMEM macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8029ffc9c0b895b783da8ba366ffdcc9e4862e64 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8029ffc9c0b895b783da8ba366ffdcc9e4862e64 commit 8029ffc9c0b895b783da8ba366ffdcc9e4862e64 Author: John Baldwin AuthorDate: 2024-01-29 19:00:09 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:54 +0000 bhyve: Use the NVMEM macro instead of expanded versions Reviewed by: corvink, chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43603 (cherry picked from commit c85b3903d1b1cf93f1fba10cd1cffed31ce84418) --- usr.sbin/bhyve/pci_nvme.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2d426fb19096..cd81767d950b 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -380,14 +380,14 @@ static void pci_nvme_io_done(struct blockif_req *, int); NVMEV(NVME_CC_REG_IOCQES, cc) #define NVME_CC_WRITE_MASK \ - ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ - (NVME_CC_REG_IOSQES_MASK << NVME_CC_REG_IOSQES_SHIFT) | \ - (NVME_CC_REG_IOCQES_MASK << NVME_CC_REG_IOCQES_SHIFT)) + (NVMEM(NVME_CC_REG_EN) | \ + NVMEM(NVME_CC_REG_IOSQES) | \ + NVMEM(NVME_CC_REG_IOCQES)) #define NVME_CC_NEN_WRITE_MASK \ - ((NVME_CC_REG_CSS_MASK << NVME_CC_REG_CSS_SHIFT) | \ - (NVME_CC_REG_MPS_MASK << NVME_CC_REG_MPS_SHIFT) | \ - (NVME_CC_REG_AMS_MASK << NVME_CC_REG_AMS_SHIFT)) + (NVMEM(NVME_CC_REG_CSS) | \ + NVMEM(NVME_CC_REG_MPS) | \ + NVMEM(NVME_CC_REG_AMS)) /* Controller Status utils */ #define NVME_CSTS_GET_RDY(sts) \ @@ -399,11 +399,10 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Completion Queue status word utils */ #define NVME_STATUS_P (1 << NVME_STATUS_P_SHIFT) #define NVME_STATUS_MASK \ - ((NVME_STATUS_SCT_MASK << NVME_STATUS_SCT_SHIFT) |\ - (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT)) + (NVMEM(NVME_STATUS_SCT) | \ + NVMEM(NVME_STATUS_SC)) -#define NVME_ONCS_DSM (NVME_CTRLR_DATA_ONCS_DSM_MASK << \ - NVME_CTRLR_DATA_ONCS_DSM_SHIFT) +#define NVME_ONCS_DSM NVMEM(NVME_CTRLR_DATA_ONCS_DSM) static void nvme_feature_invalid_cb(struct pci_nvme_softc *, struct nvme_feature_obj *, @@ -580,8 +579,7 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) break; } - cd->fna = NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK << - NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT; + cd->fna = NVMEM(NVME_CTRLR_DATA_FNA_FORMAT_ALL); cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; @@ -2732,8 +2730,7 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint16_t idx) if ((nsid == 0) || (nsid > sc->ctrldata.nn)) { pci_nvme_status_genc(&status, NVME_SC_INVALID_NAMESPACE_OR_FORMAT); - status |= - NVME_STATUS_DNR_MASK << NVME_STATUS_DNR_SHIFT; + status |= NVMEM(NVME_STATUS_DNR); goto complete; } @@ -2957,8 +2954,7 @@ pci_nvme_write_bar_0(struct pci_nvme_softc *sc, uint64_t offset, int size, if (NVME_CC_GET_SHN(ccreg)) { /* perform shutdown - flush out data to backend */ - sc->regs.csts &= ~(NVME_CSTS_REG_SHST_MASK << - NVME_CSTS_REG_SHST_SHIFT); + sc->regs.csts &= ~NVMEM(NVME_CSTS_REG_SHST); sc->regs.csts |= NVME_SHST_COMPLETE << NVME_CSTS_REG_SHST_SHIFT; } From nobody Mon Aug 26 18:03:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7G0r8Lz5TMDn; Mon, 26 Aug 2024 18:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7F5yrqz44tp; Mon, 26 Aug 2024 18:03:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DTUYXGnk/9SRG8Fd5isU8sgIUB377xvxld4dhCCM+o=; b=lTS/7v8SRtqzPhvhI6qVghzHIkIKxkWSZXlpj3H+v2lG9BX/IQgsoDm/zL+dUOHjlsL0zP 4k2RMyRDt2GwZeML2YcVhinKuvN0oqfmqlt1c2CjJm3LEA09T4BWjMlaqWNodHrb+Sqv// 1rVSvVrdIwfWJiID63gHj/h1sLjc9tZvvqq//2a5y6BFTG3D1KF1gSH2gIb0qG3pnjEwUF a7W99CRyEnDtu2UIP0Lqu42QQP7IvODRCChPX1kJQgWnI4nenrZ5aStGbyQEtFJev4YIFE DsvQjTGiIcq4ZzfrZjidLYflcinoB6isr3c5ba5d+wA5FLpHI0Pyvn2xQtXX/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695401; a=rsa-sha256; cv=none; b=EfmmVcyICLxmVAi2uCihjHFUDKAJXF/ldSMTECXvxt404/Dx67O1ppLdbAl9NYcbgXkfZV J2Auv2P7I7b6cl1tO6QeJACrcElmrsnOpZZXirarYF/U7B6y2e+g7aZt6QVj099niO3LBA cG+b/rE5T7nLsTqMTBqbYoK/xNiQMjVpcwF8qcDoPHh/lF/GkhJ2XNqReHdIGgzvtZn5Fm pWeBkjjh8Qu5lOgKwhlDfQIdZ86DFdXVmuwct3IjDab7rURH8cuzx8P2vVFkeYUSgPYwrk tR7r0wyn0rquPYHnQ6EPiAAC9JLVt0UxvfOl1xkujoGgLkwF4K5gymn46uCf8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DTUYXGnk/9SRG8Fd5isU8sgIUB377xvxld4dhCCM+o=; b=rX/w8OWU89ctJ9xL/tJX/E0I5kiOgeNAdmmZPhbMQpxRY/pmENvM+g/BaEVo5fq5Sr1GvY ft1v3JS8kPVVjHsHT0/Kwxwa+R0JhhEeyynrNNfv1Yj9OITgXVGSTlg7bd5lN99fTRLlIW aX3rN++eWVrOfI7DOuJ8hYrfbf3wYOQHOnkjpCHYIbTn/xDQjIbB12HyZcj13/3xnJDqP5 5crryAB9Oxoi1f5pRzBZrVhtxH5JJmPjYMnHVQnbwTyW4EZ50kX6nNVc27DOfBHaB12svV F1yhX9XiNipdw3FoEsG54qlBtkC6BmO4OZtSk4zefhE5WiGk4GOEoX3ZcWeRww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7F5WmMzGCH; Mon, 26 Aug 2024 18:03: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 47QI3L6s042842; Mon, 26 Aug 2024 18:03:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3L6j042839; Mon, 26 Aug 2024 18:03:21 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:21 GMT Message-Id: <202408261803.47QI3L6j042839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4d2e2e1b440e - stable/14 - nvme: Use the NVMEF macro to construct fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d2e2e1b440e339d679f2fa9e146767d98f8aea8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2e2e1b440e339d679f2fa9e146767d98f8aea8 commit 4d2e2e1b440e339d679f2fa9e146767d98f8aea8 Author: John Baldwin AuthorDate: 2024-01-29 19:01:13 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:08 +0000 nvme: Use the NVMEF macro to construct fields Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43605 (cherry picked from commit 5650bd3fe8eff1043ef3df33b5bdd7b24b5f2bc0) --- sys/dev/nvme/nvme_ctrlr.c | 20 ++++++++++---------- sys/dev/nvme/nvme_ns.c | 3 ++- sys/dev/nvme/nvme_qpair.c | 10 +++++----- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 3ef5a2b51544..0004895d6691 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -375,25 +375,25 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) qsize = ctrlr->adminq.num_entries - 1; aqa = 0; - aqa = (qsize & NVME_AQA_REG_ACQS_MASK) << NVME_AQA_REG_ACQS_SHIFT; - aqa |= (qsize & NVME_AQA_REG_ASQS_MASK) << NVME_AQA_REG_ASQS_SHIFT; + aqa |= NVMEF(NVME_AQA_REG_ACQS, qsize); + aqa |= NVMEF(NVME_AQA_REG_ASQS, qsize); nvme_mmio_write_4(ctrlr, aqa, aqa); /* Initialization values for CC */ cc = 0; - cc |= 1 << NVME_CC_REG_EN_SHIFT; - cc |= 0 << NVME_CC_REG_CSS_SHIFT; - cc |= 0 << NVME_CC_REG_AMS_SHIFT; - cc |= 0 << NVME_CC_REG_SHN_SHIFT; - cc |= 6 << NVME_CC_REG_IOSQES_SHIFT; /* SQ entry size == 64 == 2^6 */ - cc |= 4 << NVME_CC_REG_IOCQES_SHIFT; /* CQ entry size == 16 == 2^4 */ + cc |= NVMEF(NVME_CC_REG_EN, 1); + cc |= NVMEF(NVME_CC_REG_CSS, 0); + cc |= NVMEF(NVME_CC_REG_AMS, 0); + cc |= NVMEF(NVME_CC_REG_SHN, 0); + cc |= NVMEF(NVME_CC_REG_IOSQES, 6); /* SQ entry size == 64 == 2^6 */ + cc |= NVMEF(NVME_CC_REG_IOCQES, 4); /* CQ entry size == 16 == 2^4 */ /* * Use the Memory Page Size selected during device initialization. Note * that value stored in mps is suitable to use here without adjusting by * NVME_MPS_SHIFT. */ - cc |= ctrlr->mps << NVME_CC_REG_MPS_SHIFT; + cc |= NVMEF(NVME_CC_REG_MPS, ctrlr->mps); nvme_ctrlr_barrier(ctrlr, BUS_SPACE_BARRIER_WRITE); nvme_mmio_write_4(ctrlr, cc, cc); @@ -1601,7 +1601,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) cc = nvme_mmio_read_4(ctrlr, cc); cc &= ~NVMEM(NVME_CC_REG_SHN); - cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT; + cc |= NVMEF(NVME_CC_REG_SHN, NVME_SHN_NORMAL); nvme_mmio_write_4(ctrlr, cc, cc); timeout = ticks + (ctrlr->cdata.rtd3e == 0 ? 5 * hz : diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index c172663f75a3..9eb808f81a48 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -287,7 +287,8 @@ nvme_bio_child_inbed(struct bio *parent, int bio_error) bzero(&parent_cpl, sizeof(parent_cpl)); if (parent->bio_flags & BIO_ERROR) { parent_cpl.status &= ~NVMEM(NVME_STATUS_SC); - parent_cpl.status |= (NVME_SC_DATA_TRANSFER_ERROR) << NVME_STATUS_SC_SHIFT; + parent_cpl.status |= NVMEF(NVME_STATUS_SC, + NVME_SC_DATA_TRANSFER_ERROR); } nvme_ns_bio_done(parent, &parent_cpl); } diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index e087abcb2654..ce2f30aaa5ba 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -494,9 +494,9 @@ nvme_qpair_manual_complete_tracker( cpl.sqid = qpair->id; cpl.cid = tr->cid; - cpl.status |= (sct & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT; - cpl.status |= (sc & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; - cpl.status |= (dnr & NVME_STATUS_DNR_MASK) << NVME_STATUS_DNR_SHIFT; + cpl.status |= NVMEF(NVME_STATUS_SCT, sct); + cpl.status |= NVMEF(NVME_STATUS_SC, sc); + cpl.status |= NVMEF(NVME_STATUS_DNR, dnr); /* M=0 : this is artificial so no data in error log page */ /* CRD=0 : this is artificial and no delayed retry support anyway */ /* P=0 : phase not checked */ @@ -512,8 +512,8 @@ nvme_qpair_manual_complete_request(struct nvme_qpair *qpair, memset(&cpl, 0, sizeof(cpl)); cpl.sqid = qpair->id; - cpl.status |= (sct & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT; - cpl.status |= (sc & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; + cpl.status |= NVMEF(NVME_STATUS_SCT, sct); + cpl.status |= NVMEF(NVME_STATUS_SC, sc); error = nvme_completion_is_error(&cpl); From nobody Mon Aug 26 18:03:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7F1qWpz5TMGn; Mon, 26 Aug 2024 18:03: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 4Wsz7D4gjsz44b0; Mon, 26 Aug 2024 18:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DEf2brWfOq9fpHWr9Q76WzMsAJPV/rht+bimMtncrg=; b=jllJNugLOCkiL3VzvErxW8oqVKud16HBiF5kxXk3GvR/CdvgEHJYctmGKsaaFYkiP8jdw6 dGWc3Sid8IGk39m2XS/zRDJayxNVv7tBRULDgDX8OA6YsABBR/qyyVyNHqdQ4seRjmoqhz qdM5/kOn9mrOxKE2tHL/PLg7zF4J4z99jp5BNO/czd03mEAxAfmh/fqV0qU6NuivM8H+nJ nk6MGFpJekc9SRihTA8kSxbFi0w2Pvhv3xS3AwY3c4QDaiNuTZBEeauErlOny3Pw4vbyPy xtfbzJ5xxV9nhFuBG3DT4oPUY1q785w+VUtUc+fAHY/90JEqjxkpScuWbMBQHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695400; a=rsa-sha256; cv=none; b=RcKJtY5RkpbtSkhrVlNWi1F3T+UWE2TWY6gwQDIilG/Ebzc4tY+n1HI+yUgDjJgQ0E4L9b f5anyK3+EU5LRsb74La2AicePzUiOexvH3Fvpe9OlzRKM2Krgwyl7fqltfyad6/fDwFXrB KYbsBn/FhBAEDGGg1P7jERARp9yf2C708FBDEuCHbh6bCz74cXB2GFveywjSVkF0ikp2ig rUABPl+WZcydvoob4+C2AuSdKFAPNB+ij+uO1lMc5mj2GHunMLGC6jNPlcUF5qVh2kB5HA joJLGVWn94UY/Qc6zBfeCqX/QJnaRXHS7GwtxS6R1p7eXJHhMsa0oZmxDYWDlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DEf2brWfOq9fpHWr9Q76WzMsAJPV/rht+bimMtncrg=; b=m7qZvXtwUt/gK9+cAdN4h61ZzlsHYGNs8m9JPM1qxAHxZAMIoSbPpCX1xdLkBhwEbRdOKN 1NkFhzZCYy7M+Ipfb6jf0oST8Xjh98AiyKJBIoiOHAkK2/7DRfZvOD+jnPLjtel3ph9vAs XdpsbjtDAwmnZZBz1X3U3DegAdLa3jzK0kztb7bRahLen21P7jfTFcWPBRYD3NQGK4m1Xx wk9swRw6zEynHhiFpvtmMTYBauQ8Z5EzW/tRElqVpGH/jZNuSo/8aHgIPDqgVKJYjHZ5+P DF/LMBMdaBmRsTXm6aVBREeDR3YREDelsp1uZAjgyz0CemvPITaSy1vqH0zvlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7D49SwzHHM; Mon, 26 Aug 2024 18:03: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 47QI3Keo042786; Mon, 26 Aug 2024 18:03:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3KrM042783; Mon, 26 Aug 2024 18:03:20 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:20 GMT Message-Id: <202408261803.47QI3KrM042783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7566b99458a3 - stable/14 - nvme: Add NVMEF helper macro as the inverse of NVMEV List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7566b99458a31ad9ac2ef289c401fa008fd01386 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7566b99458a31ad9ac2ef289c401fa008fd01386 commit 7566b99458a31ad9ac2ef289c401fa008fd01386 Author: John Baldwin AuthorDate: 2024-01-29 19:00:57 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:01 +0000 nvme: Add NVMEF helper macro as the inverse of NVMEV This macro accepts a field name and a value for the field and constructs the shifted field value. Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43604 (cherry picked from commit 3a477a9b70a34dc0686630599c27f022b1e07bd8) --- sys/dev/nvme/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 7b3cdd89f146..137aff792868 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -610,6 +610,9 @@ enum nvme_critical_warning_state { /* Helper macro to extract value from x */ #define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK) +/* Helper macro to construct a field value */ +#define NVMEF(name, x) (((x) & name##_MASK) << name##_SHIFT) + /* CC register SHN field values */ enum shn_value { NVME_SHN_NORMAL = 0x1, From nobody Mon Aug 26 18:03:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7H4cdHz5TM83; Mon, 26 Aug 2024 18:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7H0RHGz457l; Mon, 26 Aug 2024 18:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0F1mUzaXpcP0vXTJL1ubz5W0VbG+Bh00J8cFyl8mdw=; b=gaoU+A7RD9mAjEDgMEiMwxyjdxmuzesZCWMdenOlNB+pso5ITwJWbu7gPiKN+808H2HkIW zbEJ5RusZDk/pfqNjLgMAF722yx/gvxDqR4+jIXgCcPofrFjBWYBbNQ32vZR7uJBMC/X9H BDadZKCL6QOy//ZdJD6Ar2OTQu3G3947q3nr9KXpqJ/mv/PQ0r1MUZQIuQ7eUe4htgDWez nf1gawImT3hexAAM4H83XPk3VjzSe3snEL61UypFhHn0cdx0ohdDGextpp1kMeMQbU9Jqn mT0N/m4vcuV1tAUZt9NRfiCngRIjAePG0kATt0NREcv0aqyn2mvAcbUoYis65g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695403; a=rsa-sha256; cv=none; b=oxQgWt9R2Ipb1S7HIOTdwC8g3I8fQ2AypCpi3yWEMvolhmz3yqDmnKyMDNlfV+L2lyyUO+ o2FKniepRweJm5s9hMGqszJksjnkdJ46tpcKi/MoyTdoG5CZ1O0cSv+mdOxLqlE+HvfzjU mQ2pW33XwyveV/GVPRra3Q/cmfhAVOBYjLAnRr0Qg003ei5RvjFXUFF7UMop2mDld4v5t2 KIo2YUpdPxzuv3A4GDBTmClKO8RxzraOydZRr+6t38Hn09JMabNqBX14v8Ik0aEV8m8Sz8 0r+EWk/AxxVzFep6x82yRlW/gl6qcaHoeveHv2AbFKVk7kCTkIwQmTEMKQyafQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0F1mUzaXpcP0vXTJL1ubz5W0VbG+Bh00J8cFyl8mdw=; b=IBPXjkS3UjmjL1QEletGUwZf8PpRQwi2tQClcWgWJiN+Z3uIosrJ2Y4AVVO+XZml58NkFp Y1a0A/4XCYSnjFfbYqdy+XGgrZbaX31aPfyW79RVUTYXsnwcF9yNjOEDHIzVP3MeJi3Bbe LgpbHJ5FdbTr1TOoVU0S+j2Zk/6dfOID09odKdkiGmRiGzgCeq60B7/J0xY0Hl8tPuSJXu t2mRvKPuDZv5wexV/AD2gC5g9F3vEqmslO+Jxp3f1cU8coG99M/383lEhnD8rHisQcWULy L37nPXmr7Te8aP/uFRDtgPvdLMw+GNR/4wH2HeqdPX29v2C5jtnMlAFeAcfkBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7G6TWBzH6L; Mon, 26 Aug 2024 18:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QI3Mcm042894; Mon, 26 Aug 2024 18:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3MBT042891; Mon, 26 Aug 2024 18:03:22 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:22 GMT Message-Id: <202408261803.47QI3MBT042891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5438d2060676 - stable/14 - nvmecontrol: Use NVMEF macro to construct fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5438d20606769c8db690f1a2d92becb7a6b05426 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5438d20606769c8db690f1a2d92becb7a6b05426 commit 5438d20606769c8db690f1a2d92becb7a6b05426 Author: John Baldwin AuthorDate: 2024-01-29 19:01:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:14 +0000 nvmecontrol: Use NVMEF macro to construct fields Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43606 (cherry picked from commit c68ec278deb23fd90eb5506c9a6a4f7339784ff3) --- sbin/nvmecontrol/ns.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index a77f37e0f468..24f4b6b3d043 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -580,14 +580,12 @@ nscreate(const struct cmd *f, int argc, char *argv[]) /* Default to the first format, whatever it is. */ nsdata.flbas = 0; if (create_opt.lbaf != NONE) { - nsdata.flbas |= (create_opt.lbaf & - NVME_NS_DATA_FLBAS_FORMAT_MASK) - << NVME_NS_DATA_FLBAS_FORMAT_SHIFT; + nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_FORMAT, + create_opt.lbaf); } if (create_opt.mset != NONE) { - nsdata.flbas |= (create_opt.mset & - NVME_NS_DATA_FLBAS_EXTENDED_MASK) - << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT; + nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_EXTENDED, + create_opt.mset); } } if (create_opt.dps != NONE) { @@ -596,22 +594,19 @@ nscreate(const struct cmd *f, int argc, char *argv[]) /* Default to protection disabled. */ nsdata.dps = 0; if (create_opt.pi != NONE) { - nsdata.dps |= (create_opt.pi & - NVME_NS_DATA_DPS_MD_START_MASK) - << NVME_NS_DATA_DPS_MD_START_SHIFT; + nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_MD_START, + create_opt.pi); } if (create_opt.pil != NONE) { - nsdata.dps |= (create_opt.pil & - NVME_NS_DATA_DPS_PIT_MASK) - << NVME_NS_DATA_DPS_PIT_SHIFT; + nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_PIT, + create_opt.pil); } } if (create_opt.nmic != NONE) { nsdata.nmic = create_opt.nmic; } else { /* Allow namespaces sharing if Multi-Path I/O is supported. */ - nsdata.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << - NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; + nsdata.nmic = NVMEF(NVME_NS_DATA_NMIC_MAY_BE_SHARED, !!cd.mic); } nvme_namespace_data_swapbytes(&nsdata); From nobody Mon Aug 26 18:03:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wsz7J5hclz5TM40; Mon, 26 Aug 2024 18:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7J19GWz44xm; Mon, 26 Aug 2024 18:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VxQHz1ECPprZODB7twYzb97FMALRHsfQQtlFmlSLfzQ=; b=o2UTIhnLn+oNUjVdMAhN7cagm6yqvzUOAppCHEIAvYarBNx+nKRF/+MI+HFvoDE6UoPKiO awvRWs5bvQVX4N5klU+rVr29uOhc4LHCr29n78LBD94x1cCA2OZ2/fpFy+qURxUHHUC8ko fn9dUR1fnTJ1ABuYUu26rTv3UR/+gQohcUM6s5RpxwWSrjZA7nodv8FQaGqccI3Ck8sUVB LUs7LMeoeUmq7HfPT/HTjDDoRFb/ZVMEvFYMiMwOotHNICDCqVaqXyCgSHc3LNuPw6xReb LHuf/RM1QXFZIIzMMx9aE5bpLF9ekD89eU60O/GTa+J7eERFy3WMxivvNRpJRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695404; a=rsa-sha256; cv=none; b=xznFxdX8IfkH/nPCQ1+b/MHC3zFKUnfjjKDdeQZIRiGi3WSX3RSU3ljbwQd10TlacigEhJ p57ejZmF/QWk9d6EgaNh1N1Mk/YOQlq9tye+xW9o8KIuhi0MqpVMVD8TKmZf97HRNIA5/m Rqq19smwILll8JPUy+0t++yWZLZhkpjMPNtCX/B2NmP5QvPRMI+Xq2Qd46Ak5HENo6PRNV Vh9BwCzdDZ68pFo6YLFkkHW8khYswc9+mveA6SdkdeiSiag9CC14v/z2Us/ticKU+QXGIM I688OoTURcsiXb5sMfhHt2rQJcnKqReUyQVrgCCx+U/ApzZFEprGNC4mCpzsBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VxQHz1ECPprZODB7twYzb97FMALRHsfQQtlFmlSLfzQ=; b=SVYj1cOuQ8QkhED8q4FwjtHoKEF39fm8crJxlVhQ7StTVXs+2r6lQS2R9aNdMWDt/OI4Bz DxZ7ZRhuQ7goB/gbAcTTnWCNbzqSUwGx1VEtj2ff2MtnVcWR1RU6+SXzCM10MWsxEwuklM EALLX6w/FPnYmDXKQgoNRsopwtt7iqXul6LUipVbzu2RbH54r/hfjNXxft56raH2CVEei5 ChBndG5svTJXvY2Egog5dW0swnn6eHq746PgWYVZRvdG5gM2FHgPYC9jdGJ28HLU2grfm0 BBKZoAvjQL+bR5o9Pv+sP+ZJfgccgljhLlcsbhVb/IgU/ewxM3dGJz/kyyc0Bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsz7J0RbNzHKL; Mon, 26 Aug 2024 18:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QI3Nlj042944; Mon, 26 Aug 2024 18:03:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3NhC042941; Mon, 26 Aug 2024 18:03:23 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:23 GMT Message-Id: <202408261803.47QI3NhC042941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f314e46271f1 - stable/14 - bhyve: Use NVMEF macro to construct fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f314e46271f1100c258a72aa8c0e072f0f3ef2e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f314e46271f1100c258a72aa8c0e072f0f3ef2e6 commit f314e46271f1100c258a72aa8c0e072f0f3ef2e6 Author: John Baldwin AuthorDate: 2024-01-29 19:02:07 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:53 +0000 bhyve: Use NVMEF macro to construct fields Reviewed by: corvink, chuck (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43607 (cherry picked from commit c46860dbcb2037933575a260028325418b3e9789) --- usr.sbin/bhyve/pci_nvme.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index cd81767d950b..45ab1b11fda4 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -393,11 +393,11 @@ static void pci_nvme_io_done(struct blockif_req *, int); #define NVME_CSTS_GET_RDY(sts) \ NVMEV(NVME_CSTS_REG_RDY, sts) -#define NVME_CSTS_RDY (1 << NVME_CSTS_REG_RDY_SHIFT) -#define NVME_CSTS_CFS (1 << NVME_CSTS_REG_CFS_SHIFT) +#define NVME_CSTS_RDY (NVMEF(NVME_CSTS_REG_RDY, 1)) +#define NVME_CSTS_CFS (NVMEF(NVME_CSTS_REG_CFS, 1)) /* Completion Queue status word utils */ -#define NVME_STATUS_P (1 << NVME_STATUS_P_SHIFT) +#define NVME_STATUS_P (NVMEF(NVME_STATUS_P, 1)) #define NVME_STATUS_MASK \ (NVMEM(NVME_STATUS_SCT) | \ NVMEM(NVME_STATUS_SC)) @@ -442,8 +442,7 @@ pci_nvme_status_tc(uint16_t *status, uint16_t type, uint16_t code) { *status &= ~NVME_STATUS_MASK; - *status |= (type & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT | - (code & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; + *status |= NVMEF(NVME_STATUS_SCT, type) | NVMEF(NVME_STATUS_SC, code); } static __inline void @@ -536,14 +535,14 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->ver = NVME_REV(1,4); cd->cntrltype = NVME_CNTRLTYPE_IO; - cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; + cd->oacs = NVMEF(NVME_CTRLR_DATA_OACS_FORMAT, 1); cd->oaes = NVMEM(NVME_CTRLR_DATA_OAES_NS_ATTR); cd->acl = 2; cd->aerl = 4; /* Advertise 1, Read-only firmware slot */ cd->frmw = NVMEM(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | - (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); + NVMEF(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, 1); cd->lpa = 0; /* TODO: support some simple things like SMART */ cd->elpe = 0; /* max error log page entries */ /* @@ -557,13 +556,13 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->cctemp = 0x0157; /* SANICAP must not be 0 for Revision 1.4 and later NVMe Controllers */ - cd->sanicap = (NVME_CTRLR_DATA_SANICAP_NODMMAS_NO << - NVME_CTRLR_DATA_SANICAP_NODMMAS_SHIFT); + cd->sanicap = NVMEF(NVME_CTRLR_DATA_SANICAP_NODMMAS, + NVME_CTRLR_DATA_SANICAP_NODMMAS_NO); - cd->sqes = (6 << NVME_CTRLR_DATA_SQES_MAX_SHIFT) | - (6 << NVME_CTRLR_DATA_SQES_MIN_SHIFT); - cd->cqes = (4 << NVME_CTRLR_DATA_CQES_MAX_SHIFT) | - (4 << NVME_CTRLR_DATA_CQES_MIN_SHIFT); + cd->sqes = NVMEF(NVME_CTRLR_DATA_SQES_MAX, 6) | + NVMEF(NVME_CTRLR_DATA_SQES_MIN, 6); + cd->cqes = NVMEF(NVME_CTRLR_DATA_CQES_MAX, 4) | + NVMEF(NVME_CTRLR_DATA_CQES_MIN, 4); cd->nn = 1; /* number of namespaces */ cd->oncs = 0; @@ -581,7 +580,7 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->fna = NVMEM(NVME_CTRLR_DATA_FNA_FORMAT_ALL); - cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; + cd->vwc = NVMEF(NVME_CTRLR_DATA_VWC_ALL, NVME_CTRLR_DATA_VWC_ALL_NO); ret = snprintf(cd->subnqn, sizeof(cd->subnqn), "nqn.2013-12.org.freebsd:bhyve-%s-%u-%u-%u", @@ -634,7 +633,7 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc, be64enc(nd->eui64, nvstore->eui64); /* LBA data-sz = 2^lbads */ - nd->lbaf[0] = nvstore->sectsz_bits << NVME_NS_DATA_LBAF_LBADS_SHIFT; + nd->lbaf[0] = NVMEF(NVME_NS_DATA_LBAF_LBADS, nvstore->sectsz_bits); } static void @@ -657,7 +656,7 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) sc->health_log.available_spare_threshold = 10; /* Set Active Firmware Info to slot 1 */ - sc->fw_log.afi = (1 << NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT); + sc->fw_log.afi = NVMEF(NVME_FIRMWARE_PAGE_AFI_SLOT, 1); memcpy(&sc->fw_log.revision[0], sc->ctrldata.fr, sizeof(sc->fw_log.revision[0])); @@ -1003,10 +1002,10 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) DPRINTF("%s", __func__); sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | - (1 << NVME_CAP_LO_REG_CQR_SHIFT) | - (60 << NVME_CAP_LO_REG_TO_SHIFT); + NVMEF(NVME_CAP_LO_REG_CQR, 1) | + NVMEF(NVME_CAP_LO_REG_TO, 60); - sc->regs.cap_hi = 1 << NVME_CAP_HI_REG_CSS_NVM_SHIFT; + sc->regs.cap_hi = NVMEF(NVME_CAP_HI_REG_CSS_NVM, 1); sc->regs.vs = NVME_REV(1,4); /* NVMe v1.4 */ @@ -2955,8 +2954,8 @@ pci_nvme_write_bar_0(struct pci_nvme_softc *sc, uint64_t offset, int size, if (NVME_CC_GET_SHN(ccreg)) { /* perform shutdown - flush out data to backend */ sc->regs.csts &= ~NVMEM(NVME_CSTS_REG_SHST); - sc->regs.csts |= NVME_SHST_COMPLETE << - NVME_CSTS_REG_SHST_SHIFT; + sc->regs.csts |= NVMEF(NVME_CSTS_REG_SHST, + NVME_SHST_COMPLETE); } if (NVME_CC_GET_EN(ccreg) != NVME_CC_GET_EN(sc->regs.cc)) { if (NVME_CC_GET_EN(ccreg) == 0) From nobody Mon Aug 26 18:30:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wszk23LqMz5TNwt; Mon, 26 Aug 2024 18:30: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 4Wszk22CS5z4Bb8; Mon, 26 Aug 2024 18:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724697002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdTDgI8HRBu2X4FMBpmORd4nb14S3PFOub1C7kBN1Qc=; b=k9c15mImb/Aixt9J6mtCRag3UUN3yKrAAjhq0HhllQhRB+IZ0QitbnXlYlrbwsCD3qpuSL GxSin60QRP9scOzRUovkNLuy3Hby4hK+QP4yrFal/uaLXw7rb9NVd4yW1LupAlB5DyQIXm QH0Vns2XD6En7pJ4zJuuVaDeZKiAUHzOclSmWTYCfXMcTQ3rJpK+BNJUi2odYn+QeoIkis bXf0jRtTHI85pcLAvfDxNWJ84BfQ2JAP/117b6smmm0+GQ8DkMxUky2u+5f1A6ptzKPAIH ecQVRz4g6Ui8q5rA5IRH270HSl82bnitXvr6K4bksIZgswaphejyYMqNBaRe4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724697002; a=rsa-sha256; cv=none; b=lfgn5D0ohKyqZzKdt5dh4lmEi7jAbIif9GI1oHV4L6quevToJAnIU69zbAMu+Pfi9jr4M9 NJgbOgh+W80h8US050TAzGYeZfWLMMH2TEI4nVimUUgjA86/qk+T691GYRcM+OQu35uVdA YHrKzfDgFxwFSqJp6vPXIDFVV8ex7t9UI7nDXmcD/6ksLiwhrdEF6FAuadJwVcQwHYkauQ d8xtvIPK4XDLh1UaWVunH97FFhupKkIVJztV68y2xPjkPXuRgbS4nKgWaLBr9nn8vb7mNy Tqo9VJ10ILeHK9/cTQTZzBqftDqbLZFU722pn2O/pF9SjedHAYIzPagaUAbTZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724697002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdTDgI8HRBu2X4FMBpmORd4nb14S3PFOub1C7kBN1Qc=; b=sLlFmiFeUtwIMWgC8GOhYNu+220RmP/MM/SI5yCosLloyjkQC+zRiuJwU25dYAJ7b/uJ+n yvLEUHErQ1R+uiUbiC76AQpbI7kMvB7rduCXU0rDg1YC5FfCqXJUS2yvh8JIk3Bl6knFuH wVv671kPQQRw3tPRvR8ytMyXgoMjJ2gatexMJtzn155NwAYJ0znRqlkm6/CTSe4nSyDAxz fAzPcpijgn0i4vpPRat0MQBchrblZ86gp86r/nVSObOWHcQMpgh6kFBALKB6wj41718otB Q2mLahsF4WU770WdiuyAX/3HAegbAz3v9wvA60d7qlpCwxnhc1W/Rvn7QuS0UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wszk21psGzH7L; Mon, 26 Aug 2024 18:30: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 47QIU2RC079090; Mon, 26 Aug 2024 18:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIU2kV079085; Mon, 26 Aug 2024 18:30:02 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:30:02 GMT Message-Id: <202408261830.47QIU2kV079085@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: 62bb18abed25 - main - p9fs: Properly handle paths containing "." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62bb18abed25a831a29e1e5b6e6f7fdddbba6403 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=62bb18abed25a831a29e1e5b6e6f7fdddbba6403 commit 62bb18abed25a831a29e1e5b6e6f7fdddbba6403 Author: Bakul Shah AuthorDate: 2024-08-04 18:19:52 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:24:59 +0000 p9fs: Properly handle paths containing "." Fixes: 56e4622588ed ("p9fs: fix lookup of "." for lib9p-based 9P servers") Pull Request: https://github.com/freebsd/freebsd-src/pull/1361 --- sys/fs/p9fs/p9fs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 6ac0a7c008cc..14951e96b59d 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -238,7 +238,7 @@ p9fs_lookup(struct vop_lookup_args *ap) if (dnp == NULL) return (ENOENT); - if (cnp->cn_nameptr[0] == '.' && strlen(cnp->cn_nameptr) == 1) { + if (cnp->cn_nameptr[0] == '.' && cnp->cn_namelen == 1) { vref(dvp); *vpp = dvp; return (0); From nobody Mon Aug 26 18:30:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WszkG5kN3z5TP81; Mon, 26 Aug 2024 18:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WszkG55qNz4CMy; Mon, 26 Aug 2024 18:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724697014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha4v50D6O81rn96lpE0sMBBm8rX9r6As2V66eRN7WN4=; b=qdRKodHsX2nFd+I8emyRvPWbavSJa/bSHI6Xqq/+1MoV5qnrr3IFyoSoUPZSJotRyFCWH6 hK73rLzECxFV8QQ/1Lw2Rq4tCozuQnyEJjQeZlo4/cHVcQfp2g0xXbcIqa/gifAEO0pmaA mwcpGZtT3QXzkQjhPo9lnUEg82IaJCpIAzm8Zzh8XbXdVka1pP7BXNfAiFedEPVjZeqqdc yEe61RymxbXJMNUY5BhnGHQhtz23VJK9LyMx4Zw5ESdJFr8gTj/hBYciraqMdaUqPylBLT 8elj6a4Sm6x7P7Iis84DK/SdR1hcCjqJy5d5zmznczbWczf6DZkqNMibAmAAvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724697014; a=rsa-sha256; cv=none; b=udTMz4Z7pbi6pcN5jOFgRMicPIImEQyUFb1gZGedXV4YZBcYG/LZYOTfWeu6+hLg8VWeSV +FL98lm4hnBDtORMSvr3zGkSFRtWonQr0fvOu5li4xKbSTanpuevC7H4McmcfzhYElTN52 YLFoKueJRyUmw1XZyNILPEctpbpCOX1KxBYtaTqXkO74uXARvA5Fij0UGToLSuL68YjTzg N6OswpJOixfrvcikf1qIremXRw7V7ClvtvZPMv6BWulBulYLmjF2Hgx1P/+uG9xlX1qXuW ONKdpiWpWRRmcXrRgeBANRv71PXAcK+/wf1dvMCVJF2999sodNoJCFonnv0rcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724697014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha4v50D6O81rn96lpE0sMBBm8rX9r6As2V66eRN7WN4=; b=vxYzlk5grr4BwAYMJt1DMPhLeXAST6McdTfgVcN1X9lXruzOX4s5iVfMzTlntAgupUr+id qjmEJZiX/60l49QYcwJFtPEZVlch5x1mryi/wcY/jrGY9kzgm8frjEgQbqK+3Ce/k+MoV+ o5IxuTF4axAcjLQ10q/TKBmT/l6UhMZueVz4EXXs9F4N4sI0J8NpgtyWB2sG9vBI5dVpEo gcB7PfWXTdFVyPzg8Yu//eb+a+WZ77RS2mQY8+QTodRijwrk7o8r+B4hY3FrjTkdmcaZ0i BH++H0zG6Z0566Z/IqC1PnclZ7G2AKKivd+RwHmHmDurczLcI8cvFlCrm2Po6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WszkG4jJGzHqG; Mon, 26 Aug 2024 18:30: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 47QIUEep084057; Mon, 26 Aug 2024 18:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIUE1e084040; Mon, 26 Aug 2024 18:30:14 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:30:14 GMT Message-Id: <202408261830.47QIUE1e084040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 27777283da79 - releng/13.4 - ctl: avoid heap info leak in ctl_request_sense List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 27777283da79cbfa39ba10b65c748f49884be7fe Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=27777283da79cbfa39ba10b65c748f49884be7fe commit 27777283da79cbfa39ba10b65c748f49884be7fe Author: Ed Maste AuthorDate: 2024-08-20 18:12:47 +0000 Commit: Ed Maste CommitDate: 2024-08-26 18:29:40 +0000 ctl: avoid heap info leak in ctl_request_sense Previously 3 bytes of data from the heap could be leaked to ctl consumers. Reported by: Synacktiv Reviewed by: asomers, mav Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46091 (cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d) (cherry picked from commit 131b7dcb2fbf8f15815387f60536d9cc16585b0d) (cherry picked from commit 51768dc31df6379aa4a1447a15f054508d16b4b1) Approved by: re (cperciva) --- sys/cam/ctl/ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index a31bbd3c8342..7a04a668e823 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -9339,14 +9339,8 @@ ctl_request_sense(struct ctl_scsiio *ctsio) sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - /* - * struct scsi_sense_data, which is currently set to 256 bytes, is - * larger than the largest allowed value for the length field in the - * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. - */ - ctsio->kern_data_len = cdb->length; - ctsio->kern_total_len = cdb->length; + ctsio->kern_data_len = ctsio->kern_total_len = + MIN(cdb->length, sizeof(*sense_ptr)); /* * If we don't have a LUN, we don't have any pending sense. From nobody Mon Aug 26 18:58:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt0Ls3Gysz5TQpM; Mon, 26 Aug 2024 18:58: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 4Wt0Ls1Z7Xz4FDf; Mon, 26 Aug 2024 18:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UMRJGDwf8LZB/dKivjGj5eeH3bViRTyM+GDUy0wYAII=; b=TIN27VnVgateUcSKI55L7zAg1NnUU+MYg6OveSZdijw/i//LF45Qk5qYtfenXNPeRMZUtF nNhRNK1oiLWhf1Bk17lFeXOXc/4zRsV6cag0JqrpVwj0COYTs8eAYDuNnhtWGfP5VG4UKy e8i53u0zOfWL9Eb9dpe/gRReJ/d2JZX60/XmBblD4AKoolg6OvN3OMO9Dg1vCffmYM9fTn V5go9tyb2o0xLcHczYQj19saGXG18ZRpDxm+uCH67nphz0/+R6QFm/w7beS+hI0aTflsYO 0TWlbToX6G4L57GjTg4EEVFyiLmHKFO3FZavfGumjta3NZC19AdNoteld4OPwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724698709; a=rsa-sha256; cv=none; b=P/l0G7NLr0xKQaLi1m5O7+WijYu4y2siH0k2LNLLAz1QhJSjVd5H6QDjDvfiLJh/TWX6FQ W6DOKKBPa+kkbbwm1M4AdtBNhJEZnT4Mo6Mg485sXvLe5i1+90JGm9xmg+arkmE8ssXfFA 596fYJ+7/iH6BnBnbCNWgl8PoKron0x1Mt1DPRV3/fFSBqUKeLKe5w+rBNkR5MjjuaAolR Zb3R5Ea7nBcGFx3JIVfRbGhihQl3zz+u1J0Asmc7w/n2PCMc8wT+9AlmNAdPsvyTIMSD8e Qdim4wp28tiQAfsGv5rWRVOa8FQxxUOQ+67VpTcfNQqVF1lBdiFStNONA0x93w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UMRJGDwf8LZB/dKivjGj5eeH3bViRTyM+GDUy0wYAII=; b=gpLVZ41AtlXU8jIEx5F+2UlfD1Nf/36pOU6KIBpda2xAub05dG115oEhpAY2oBkhrXxdcK uNrtqaqZ+DtD5Sq/IVzj0kA8lyQ8arEjiHcVe7wgGY5RTjuZPbhGLb/jtlWk4I3nzTjOOE gAWQwAWTpcnmimozwRUKxeTbLiDne8sRTyGAnSmj4vu6VFLZNplSbJAW0GfVbGpxooirsL +flNvu7Po9HlOq+PVtL18sh8bgMev8AgxHOy+fW2+zJsMYhBxRQXNmHGOoTtn68ck5yCAI niPNAMm6LvZktad+wKiP32PDZylfT5l0agoFUlvzNvKUa5OSuuuwyHeVeHBm8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt0Ls19RJzHND; Mon, 26 Aug 2024 18:58: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 47QIwTIG027502; Mon, 26 Aug 2024 18:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIwTrx027499; Mon, 26 Aug 2024 18:58:29 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:58:29 GMT Message-Id: <202408261858.47QIwTrx027499@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: 3ccb02334bf5 - main - vmm: Move vmm_ktr.h to a common directory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ccb02334bf5aee49a66dcff4b9229220bd0184b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3ccb02334bf5aee49a66dcff4b9229220bd0184b commit 3ccb02334bf5aee49a66dcff4b9229220bd0184b Author: Mark Johnston AuthorDate: 2024-08-26 18:41:05 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:41:05 +0000 vmm: Move vmm_ktr.h to a common directory No functional change intended. Reviewed by: corvink, jhb, emaste Differential Revision: https://reviews.freebsd.org/D46429 --- sys/amd64/vmm/amd/svm.c | 3 +- sys/amd64/vmm/amd/vmcb.c | 2 +- sys/amd64/vmm/intel/vmx.c | 3 +- sys/amd64/vmm/io/ppt.c | 4 +-- sys/amd64/vmm/io/vatpic.c | 6 ++-- sys/amd64/vmm/io/vatpit.c | 3 +- sys/amd64/vmm/io/vhpet.c | 7 ++-- sys/amd64/vmm/io/vioapic.c | 3 +- sys/amd64/vmm/io/vlapic.c | 4 +-- sys/amd64/vmm/io/vrtc.c | 3 +- sys/amd64/vmm/vmm.c | 3 +- sys/amd64/vmm/vmm_ioport.c | 3 +- sys/amd64/vmm/vmm_lapic.c | 3 +- sys/amd64/vmm/x86.c | 4 +-- sys/arm64/vmm/vmm.c | 2 +- sys/arm64/vmm/vmm_ktr.h | 69 ---------------------------------------- sys/{amd64 => dev}/vmm/vmm_ktr.h | 0 17 files changed, 30 insertions(+), 92 deletions(-) diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index b35cf53be080..1015b04ee161 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -54,9 +54,10 @@ #include #include +#include + #include "vmm_lapic.h" #include "vmm_stat.h" -#include "vmm_ktr.h" #include "vmm_ioport.h" #include "vatpic.h" #include "vlapic.h" diff --git a/sys/amd64/vmm/amd/vmcb.c b/sys/amd64/vmm/amd/vmcb.c index 4bd2fae9f821..9a1008fa495c 100644 --- a/sys/amd64/vmm/amd/vmcb.c +++ b/sys/amd64/vmm/amd/vmcb.c @@ -37,7 +37,7 @@ #include #include -#include "vmm_ktr.h" +#include #include "vlapic.h" #include "vmcb.h" diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index 31ca9256b527..63b0cf3d2ff9 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -58,10 +58,11 @@ #include #include +#include + #include "vmm_lapic.h" #include "vmm_host.h" #include "vmm_ioport.h" -#include "vmm_ktr.h" #include "vmm_stat.h" #include "vatpic.h" #include "vlapic.h" diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c index 9fcfdc7cb441..109707dbcbd5 100644 --- a/sys/amd64/vmm/io/ppt.c +++ b/sys/amd64/vmm/io/ppt.c @@ -41,12 +41,12 @@ #include #include - #include #include +#include + #include "vmm_lapic.h" -#include "vmm_ktr.h" #include "iommu.h" #include "ppt.h" diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c index 788fcec9ceb3..a003cd7e8c07 100644 --- a/sys/amd64/vmm/io/vatpic.c +++ b/sys/amd64/vmm/io/vatpic.c @@ -39,12 +39,12 @@ #include #include -#include - #include #include -#include "vmm_ktr.h" +#include +#include + #include "vmm_lapic.h" #include "vioapic.h" #include "vatpic.h" diff --git a/sys/amd64/vmm/io/vatpit.c b/sys/amd64/vmm/io/vatpit.c index e7bf74dd7e94..31b6c2ad0f89 100644 --- a/sys/amd64/vmm/io/vatpit.c +++ b/sys/amd64/vmm/io/vatpit.c @@ -41,7 +41,8 @@ #include #include -#include "vmm_ktr.h" +#include + #include "vatpic.h" #include "vioapic.h" #include "vatpit.h" diff --git a/sys/amd64/vmm/io/vhpet.c b/sys/amd64/vmm/io/vhpet.c index daa85bccf14f..a1dfc7ba731f 100644 --- a/sys/amd64/vmm/io/vhpet.c +++ b/sys/amd64/vmm/io/vhpet.c @@ -37,19 +37,18 @@ #include #include -#include - #include #include #include +#include +#include + #include "vmm_lapic.h" #include "vatpic.h" #include "vioapic.h" #include "vhpet.h" -#include "vmm_ktr.h" - static MALLOC_DEFINE(M_VHPET, "vhpet", "bhyve virtual hpet"); #define HPET_FREQ 16777216 /* 16.7 (2^24) Mhz */ diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index e1503b6a699b..8869dc1383e6 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -42,7 +42,8 @@ #include #include -#include "vmm_ktr.h" +#include + #include "vmm_lapic.h" #include "vlapic.h" #include "vioapic.h" diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 7c29cca4d907..dce7528ac773 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -43,12 +43,12 @@ #include #include - #include #include +#include + #include "vmm_lapic.h" -#include "vmm_ktr.h" #include "vmm_stat.h" #include "vlapic.h" diff --git a/sys/amd64/vmm/io/vrtc.c b/sys/amd64/vmm/io/vrtc.c index 0840f8e88d5c..7dc651a7b883 100644 --- a/sys/amd64/vmm/io/vrtc.c +++ b/sys/amd64/vmm/io/vrtc.c @@ -44,7 +44,8 @@ #include -#include "vmm_ktr.h" +#include + #include "vatpic.h" #include "vioapic.h" #include "vrtc.h" diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index f399f876717d..b0465ea84fcb 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -71,8 +71,9 @@ #include #include +#include + #include "vmm_ioport.h" -#include "vmm_ktr.h" #include "vmm_host.h" #include "vmm_mem.h" #include "vmm_util.h" diff --git a/sys/amd64/vmm/vmm_ioport.c b/sys/amd64/vmm/vmm_ioport.c index ac14e54dc4a5..f036841f4e10 100644 --- a/sys/amd64/vmm/vmm_ioport.c +++ b/sys/amd64/vmm/vmm_ioport.c @@ -32,12 +32,13 @@ #include #include +#include + #include "vatpic.h" #include "vatpit.h" #include "vpmtmr.h" #include "vrtc.h" #include "vmm_ioport.h" -#include "vmm_ktr.h" #define MAX_IOPORTS 1280 diff --git a/sys/amd64/vmm/vmm_lapic.c b/sys/amd64/vmm/vmm_lapic.c index bafd839afe64..fd511733492e 100644 --- a/sys/amd64/vmm/vmm_lapic.c +++ b/sys/amd64/vmm/vmm_lapic.c @@ -33,8 +33,9 @@ #include #include +#include + #include -#include "vmm_ktr.h" #include "vmm_lapic.h" #include "vlapic.h" diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index 1167652d88ea..a833b61786e7 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -36,11 +36,11 @@ #include #include #include - #include +#include + #include "vmm_host.h" -#include "vmm_ktr.h" #include "vmm_util.h" #include "x86.h" diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index c6a49ebc4b03..f5173c4152bd 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -64,8 +64,8 @@ #include #include +#include -#include "vmm_ktr.h" #include "vmm_stat.h" #include "arm64.h" #include "mmu.h" diff --git a/sys/arm64/vmm/vmm_ktr.h b/sys/arm64/vmm/vmm_ktr.h deleted file mode 100644 index 965f440ae874..000000000000 --- a/sys/arm64/vmm/vmm_ktr.h +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _VMM_KTR_H_ -#define _VMM_KTR_H_ - -#include -#include - -#ifndef KTR_VMM -#define KTR_VMM KTR_GEN -#endif - -#define VCPU_CTR0(vm, vcpuid, format) \ -CTR2(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid)) - -#define VCPU_CTR1(vm, vcpuid, format, p1) \ -CTR3(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1)) - -#define VCPU_CTR2(vm, vcpuid, format, p1, p2) \ -CTR4(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1), (p2)) - -#define VCPU_CTR3(vm, vcpuid, format, p1, p2, p3) \ -CTR5(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1), (p2), (p3)) - -#define VCPU_CTR4(vm, vcpuid, format, p1, p2, p3, p4) \ -CTR6(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), \ - (p1), (p2), (p3), (p4)) - -#define VM_CTR0(vm, format) \ -CTR1(KTR_VMM, "vm %s: " format, vm_name((vm))) - -#define VM_CTR1(vm, format, p1) \ -CTR2(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1)) - -#define VM_CTR2(vm, format, p1, p2) \ -CTR3(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1), (p2)) - -#define VM_CTR3(vm, format, p1, p2, p3) \ -CTR4(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1), (p2), (p3)) - -#define VM_CTR4(vm, format, p1, p2, p3, p4) \ -CTR5(KTR_VMM, "vm %s: " format, vm_name((vm)), (p1), (p2), (p3), (p4)) -#endif diff --git a/sys/amd64/vmm/vmm_ktr.h b/sys/dev/vmm/vmm_ktr.h similarity index 100% rename from sys/amd64/vmm/vmm_ktr.h rename to sys/dev/vmm/vmm_ktr.h From nobody Mon Aug 26 18:58:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt0Lt2w8Rz5TRD4; Mon, 26 Aug 2024 18:58: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 4Wt0Lt2F63z4F8R; Mon, 26 Aug 2024 18:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yv90j1+6tgzRAayosuY8kwKVacRqmnHXKow5NAm+XEM=; b=AwAfypxEnDLM8ypdRs4dxR5ozmu0arBkA5esVJdNSkCBE3zfuRAN/FtauZVG4SNg6YiZLN KtQbc12OsbFbwjTM0z72VRazDf5Gs55TWLAuTEG5qrz93Jo+eBf/GCjJIpDlw8sBYmJB1E 3a4OS3rGbJfeNsp2p2vnMCRGtIwbIU60YxcbUVraAmYAOrvM0QDdmOQ82fX9vp5hW51hVt XLZGJ052NpvvTN868UIPkxl5Ov2ouHBjVw7VD7PAn+gJRsQ2WXXLBsL//xXjYq4+PaIkT0 oJ+AEpthXN/e+LTa5kdyEpsU6bCVBlunTLlDwcnbRzbSJIV6m1dRLXRBwxhYSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724698710; a=rsa-sha256; cv=none; b=HJSkU3pRhZKybiPoAzViy4DAvFcdR+XhIb0Hfa79XvRL+LiLbxbvbL8ClKyB06E1Rm1h6A HfGaonBgNUWrHjo4NJp+k4Udmtjnn5pfTY2Sjv8SIerMeDS159NbTipx73dBNOwxj/TMVo eAdtBTOu+tXYTr/PpYU3sh5qgmKgMHSPPneGYTfrHGHh9stPH8lYat8/j3Q9h9IdzeqL7q yMefS6uNAROqM0MOgmai7IM5pZZbjfM0AB7BcYDF/mW0kMtZuzyFXELun3aqDl/5Xdy/K1 XpQJldmelEjtyB1B5g56RhDp1W1pMQsmIDrJb/fSagXhUS6+O0satKhlC3K7oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yv90j1+6tgzRAayosuY8kwKVacRqmnHXKow5NAm+XEM=; b=WLcyOJqTCcLf+j7pnBH47qp9XdulbAmWhrKgurZ/8NL32rdhuYlVv53YHnBvBymKuIpiEp P+ZuNVrtIyyiPZ5i7RoBw6R+pGcG627Hb+5vOtoLjW8ChxWwV2XU3k9nysQKXptw8IyiW/ /9IfY4wqAhX2YKnQoMia6xwcJupiLfHYkGAfxbeEtndT1xRVVUSKyK3e/zc2Zpso+b3Zmz bufHGsiniFWKjYBpdHWEdS9FOvU/0fNMTYS6YdljE1lNt1rHEoGQ3JRFo9ALXcUbMTkut4 qXCQPNkYMuqRqXq4afxMR9DEuRb2zBOEFvC+HYSJmgN8IrYzRkHKfYC43LnLeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt0Lt1rBFzJZ5; Mon, 26 Aug 2024 18:58: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 47QIwULg027556; Mon, 26 Aug 2024 18:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIwUYJ027553; Mon, 26 Aug 2024 18:58:30 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:58:30 GMT Message-Id: <202408261858.47QIwUYJ027553@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: 93e81baa1c1b - main - vmm: Move duplicated stats code into a generic file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93e81baa1c1baccf4eca9e3dbfe5ac9378e9623a Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=93e81baa1c1baccf4eca9e3dbfe5ac9378e9623a commit 93e81baa1c1baccf4eca9e3dbfe5ac9378e9623a Author: Mark Johnston AuthorDate: 2024-08-26 18:41:14 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:41:14 +0000 vmm: Move duplicated stats code into a generic file There is a small difference between the arm64 and amd64 implementations: the latter makes use of a "scope" to exclude AMD-specific stats on Intel systems and vice-versa. Replace this with a more generic predicate callback which can be used for the same purpose. No functional change intended. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46430 --- sys/amd64/vmm/vmm.c | 23 +++++ sys/amd64/vmm/vmm_stat.c | 177 -------------------------------------- sys/amd64/vmm/vmm_stat.h | 109 ++--------------------- sys/arm64/vmm/vmm.c | 19 +++- sys/arm64/vmm/vmm_stat.h | 98 +-------------------- sys/conf/files.arm64 | 2 +- sys/{arm64 => dev}/vmm/vmm_stat.c | 26 ++---- sys/dev/vmm/vmm_stat.h | 135 +++++++++++++++++++++++++++++ sys/modules/vmm/Makefile | 7 +- 9 files changed, 196 insertions(+), 400 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index b0465ea84fcb..d0259b3b125f 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -297,6 +297,29 @@ static void vm_free_memmap(struct vm *vm, int ident); static bool sysmem_mapping(struct vm *vm, struct mem_map *mm); static void vcpu_notify_event_locked(struct vcpu *vcpu, bool lapic_intr); +/* global statistics */ +VMM_STAT(VCPU_MIGRATIONS, "vcpu migration across host cpus"); +VMM_STAT(VMEXIT_COUNT, "total number of vm exits"); +VMM_STAT(VMEXIT_EXTINT, "vm exits due to external interrupt"); +VMM_STAT(VMEXIT_HLT, "number of times hlt was intercepted"); +VMM_STAT(VMEXIT_CR_ACCESS, "number of times %cr access was intercepted"); +VMM_STAT(VMEXIT_RDMSR, "number of times rdmsr was intercepted"); +VMM_STAT(VMEXIT_WRMSR, "number of times wrmsr was intercepted"); +VMM_STAT(VMEXIT_MTRAP, "number of monitor trap exits"); +VMM_STAT(VMEXIT_PAUSE, "number of times pause was intercepted"); +VMM_STAT(VMEXIT_INTR_WINDOW, "vm exits due to interrupt window opening"); +VMM_STAT(VMEXIT_NMI_WINDOW, "vm exits due to nmi window opening"); +VMM_STAT(VMEXIT_INOUT, "number of times in/out was intercepted"); +VMM_STAT(VMEXIT_CPUID, "number of times cpuid was intercepted"); +VMM_STAT(VMEXIT_NESTED_FAULT, "vm exits due to nested page fault"); +VMM_STAT(VMEXIT_INST_EMUL, "vm exits for instruction emulation"); +VMM_STAT(VMEXIT_UNKNOWN, "number of vm exits for unknown reason"); +VMM_STAT(VMEXIT_ASTPENDING, "number of times astpending at exit"); +VMM_STAT(VMEXIT_REQIDLE, "number of times idle requested at exit"); +VMM_STAT(VMEXIT_USERSPACE, "number of vm exits handled in userspace"); +VMM_STAT(VMEXIT_RENDEZVOUS, "number of times rendezvous pending at exit"); +VMM_STAT(VMEXIT_EXCEPTION, "number of vm exits due to exceptions"); + /* * Upper limit on vm_maxcpu. Limited by use of uint16_t types for CPU * counts as well as range of vpid values for VT-x and by the capacity diff --git a/sys/amd64/vmm/vmm_stat.c b/sys/amd64/vmm/vmm_stat.c deleted file mode 100644 index eb394418b4a9..000000000000 --- a/sys/amd64/vmm/vmm_stat.c +++ /dev/null @@ -1,177 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC 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 "vmm_util.h" -#include "vmm_stat.h" - -/* - * 'vst_num_elems' is the total number of addressable statistic elements - * 'vst_num_types' is the number of unique statistic types - * - * It is always true that 'vst_num_elems' is greater than or equal to - * 'vst_num_types'. This is because a stat type may represent more than - * one element (for e.g. VMM_STAT_ARRAY). - */ -static int vst_num_elems, vst_num_types; -static struct vmm_stat_type *vsttab[MAX_VMM_STAT_ELEMS]; - -static MALLOC_DEFINE(M_VMM_STAT, "vmm stat", "vmm stat"); - -#define vst_size ((size_t)vst_num_elems * sizeof(uint64_t)) - -void -vmm_stat_register(void *arg) -{ - struct vmm_stat_type *vst = arg; - - /* We require all stats to identify themselves with a description */ - if (vst->desc == NULL) - return; - - if (vst->scope == VMM_STAT_SCOPE_INTEL && !vmm_is_intel()) - return; - - if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_svm()) - return; - - if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) { - printf("Cannot accommodate vmm stat type \"%s\"!\n", vst->desc); - return; - } - - vst->index = vst_num_elems; - vst_num_elems += vst->nelems; - - vsttab[vst_num_types++] = vst; -} - -int -vmm_stat_copy(struct vcpu *vcpu, int index, int count, int *num_stats, - uint64_t *buf) -{ - struct vmm_stat_type *vst; - uint64_t *stats; - int i, tocopy; - - if (index < 0 || count < 0) - return (EINVAL); - - if (index > vst_num_elems) - return (ENOENT); - - if (index == vst_num_elems) { - *num_stats = 0; - return (0); - } - - tocopy = min(vst_num_elems - index, count); - - /* Let stats functions update their counters */ - for (i = 0; i < vst_num_types; i++) { - vst = vsttab[i]; - if (vst->func != NULL) - (*vst->func)(vcpu, vst); - } - - /* Copy over the stats */ - stats = vcpu_stats(vcpu); - memcpy(buf, stats + index, tocopy * sizeof(stats[0])); - *num_stats = tocopy; - return (0); -} - -void * -vmm_stat_alloc(void) -{ - - return (malloc(vst_size, M_VMM_STAT, M_WAITOK)); -} - -void -vmm_stat_init(void *vp) -{ - - bzero(vp, vst_size); -} - -void -vmm_stat_free(void *vp) -{ - free(vp, M_VMM_STAT); -} - -int -vmm_stat_desc_copy(int index, char *buf, int bufsize) -{ - int i; - struct vmm_stat_type *vst; - - for (i = 0; i < vst_num_types; i++) { - vst = vsttab[i]; - if (index >= vst->index && index < vst->index + vst->nelems) { - if (vst->nelems > 1) { - snprintf(buf, bufsize, "%s[%d]", - vst->desc, index - vst->index); - } else { - strlcpy(buf, vst->desc, bufsize); - } - return (0); /* found it */ - } - } - - return (EINVAL); -} - -/* global statistics */ -VMM_STAT(VCPU_MIGRATIONS, "vcpu migration across host cpus"); -VMM_STAT(VMEXIT_COUNT, "total number of vm exits"); -VMM_STAT(VMEXIT_EXTINT, "vm exits due to external interrupt"); -VMM_STAT(VMEXIT_HLT, "number of times hlt was intercepted"); -VMM_STAT(VMEXIT_CR_ACCESS, "number of times %cr access was intercepted"); -VMM_STAT(VMEXIT_RDMSR, "number of times rdmsr was intercepted"); -VMM_STAT(VMEXIT_WRMSR, "number of times wrmsr was intercepted"); -VMM_STAT(VMEXIT_MTRAP, "number of monitor trap exits"); -VMM_STAT(VMEXIT_PAUSE, "number of times pause was intercepted"); -VMM_STAT(VMEXIT_INTR_WINDOW, "vm exits due to interrupt window opening"); -VMM_STAT(VMEXIT_NMI_WINDOW, "vm exits due to nmi window opening"); -VMM_STAT(VMEXIT_INOUT, "number of times in/out was intercepted"); -VMM_STAT(VMEXIT_CPUID, "number of times cpuid was intercepted"); -VMM_STAT(VMEXIT_NESTED_FAULT, "vm exits due to nested page fault"); -VMM_STAT(VMEXIT_INST_EMUL, "vm exits for instruction emulation"); -VMM_STAT(VMEXIT_UNKNOWN, "number of vm exits for unknown reason"); -VMM_STAT(VMEXIT_ASTPENDING, "number of times astpending at exit"); -VMM_STAT(VMEXIT_REQIDLE, "number of times idle requested at exit"); -VMM_STAT(VMEXIT_USERSPACE, "number of vm exits handled in userspace"); -VMM_STAT(VMEXIT_RENDEZVOUS, "number of times rendezvous pending at exit"); -VMM_STAT(VMEXIT_EXCEPTION, "number of vm exits due to exceptions"); diff --git a/sys/amd64/vmm/vmm_stat.h b/sys/amd64/vmm/vmm_stat.h index 7d3a4044dcce..cf3895001528 100644 --- a/sys/amd64/vmm/vmm_stat.h +++ b/sys/amd64/vmm/vmm_stat.h @@ -32,108 +32,9 @@ #ifndef _VMM_STAT_H_ #define _VMM_STAT_H_ -struct vm; +#include -#define MAX_VMM_STAT_ELEMS 64 /* arbitrary */ - -enum vmm_stat_scope { - VMM_STAT_SCOPE_ANY, - VMM_STAT_SCOPE_INTEL, /* Intel VMX specific statistic */ - VMM_STAT_SCOPE_AMD, /* AMD SVM specific statistic */ -}; - -struct vmm_stat_type; -typedef void (*vmm_stat_func_t)(struct vcpu *vcpu, - struct vmm_stat_type *stat); - -struct vmm_stat_type { - int index; /* position in the stats buffer */ - int nelems; /* standalone or array */ - const char *desc; /* description of statistic */ - vmm_stat_func_t func; - enum vmm_stat_scope scope; -}; - -void vmm_stat_register(void *arg); - -#define VMM_STAT_FDEFINE(type, nelems, desc, func, scope) \ - struct vmm_stat_type type[1] = { \ - { -1, nelems, desc, func, scope } \ - }; \ - SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_register, type) - -#define VMM_STAT_DEFINE(type, nelems, desc, scope) \ - VMM_STAT_FDEFINE(type, nelems, desc, NULL, scope) - -#define VMM_STAT_DECLARE(type) \ - extern struct vmm_stat_type type[1] - -#define VMM_STAT(type, desc) \ - VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_ANY) -#define VMM_STAT_INTEL(type, desc) \ - VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_INTEL) -#define VMM_STAT_AMD(type, desc) \ - VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_AMD) - -#define VMM_STAT_FUNC(type, desc, func) \ - VMM_STAT_FDEFINE(type, 1, desc, func, VMM_STAT_SCOPE_ANY) - -#define VMM_STAT_ARRAY(type, nelems, desc) \ - VMM_STAT_DEFINE(type, nelems, desc, VMM_STAT_SCOPE_ANY) - -void *vmm_stat_alloc(void); -void vmm_stat_init(void *vp); -void vmm_stat_free(void *vp); - -int vmm_stat_copy(struct vcpu *vcpu, int index, int count, - int *num_stats, uint64_t *buf); -int vmm_stat_desc_copy(int index, char *buf, int buflen); - -static void __inline -vmm_stat_array_incr(struct vcpu *vcpu, struct vmm_stat_type *vst, int statidx, - uint64_t x) -{ -#ifdef VMM_KEEP_STATS - uint64_t *stats; - - stats = vcpu_stats(vcpu); - - if (vst->index >= 0 && statidx < vst->nelems) - stats[vst->index + statidx] += x; -#endif -} - -static void __inline -vmm_stat_array_set(struct vcpu *vcpu, struct vmm_stat_type *vst, int statidx, - uint64_t val) -{ -#ifdef VMM_KEEP_STATS - uint64_t *stats; - - stats = vcpu_stats(vcpu); - - if (vst->index >= 0 && statidx < vst->nelems) - stats[vst->index + statidx] = val; -#endif -} - -static void __inline -vmm_stat_incr(struct vcpu *vcpu, struct vmm_stat_type *vst, uint64_t x) -{ - -#ifdef VMM_KEEP_STATS - vmm_stat_array_incr(vcpu, vst, 0, x); -#endif -} - -static void __inline -vmm_stat_set(struct vcpu *vcpu, struct vmm_stat_type *vst, uint64_t val) -{ - -#ifdef VMM_KEEP_STATS - vmm_stat_array_set(vcpu, vst, 0, val); -#endif -} +#include "vmm_util.h" VMM_STAT_DECLARE(VCPU_MIGRATIONS); VMM_STAT_DECLARE(VMEXIT_COUNT); @@ -156,4 +57,10 @@ VMM_STAT_DECLARE(VMEXIT_USERSPACE); VMM_STAT_DECLARE(VMEXIT_RENDEZVOUS); VMM_STAT_DECLARE(VMEXIT_EXCEPTION); VMM_STAT_DECLARE(VMEXIT_REQIDLE); + +#define VMM_STAT_INTEL(type, desc) \ + VMM_STAT_DEFINE(type, 1, desc, vmm_is_intel) +#define VMM_STAT_AMD(type, desc) \ + VMM_STAT_DEFINE(type, 1, desc, vmm_is_svm) + #endif diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index f5173c4152bd..425e44f81500 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -65,8 +65,8 @@ #include #include +#include -#include "vmm_stat.h" #include "arm64.h" #include "mmu.h" @@ -239,6 +239,23 @@ static void vm_free_memmap(struct vm *vm, int ident); static bool sysmem_mapping(struct vm *vm, struct mem_map *mm); static void vcpu_notify_event_locked(struct vcpu *vcpu); +/* global statistics */ +VMM_STAT(VMEXIT_COUNT, "total number of vm exits"); +VMM_STAT(VMEXIT_UNKNOWN, "number of vmexits for the unknown exception"); +VMM_STAT(VMEXIT_WFI, "number of times wfi was intercepted"); +VMM_STAT(VMEXIT_WFE, "number of times wfe was intercepted"); +VMM_STAT(VMEXIT_HVC, "number of times hvc was intercepted"); +VMM_STAT(VMEXIT_MSR, "number of times msr/mrs was intercepted"); +VMM_STAT(VMEXIT_DATA_ABORT, "number of vmexits for a data abort"); +VMM_STAT(VMEXIT_INSN_ABORT, "number of vmexits for an instruction abort"); +VMM_STAT(VMEXIT_UNHANDLED_SYNC, "number of vmexits for an unhandled synchronous exception"); +VMM_STAT(VMEXIT_IRQ, "number of vmexits for an irq"); +VMM_STAT(VMEXIT_FIQ, "number of vmexits for an interrupt"); +VMM_STAT(VMEXIT_BRK, "number of vmexits for a breakpoint exception"); +VMM_STAT(VMEXIT_SS, "number of vmexits for a single-step exception"); +VMM_STAT(VMEXIT_UNHANDLED_EL2, "number of vmexits for an unhandled EL2 exception"); +VMM_STAT(VMEXIT_UNHANDLED, "number of vmexits for an unhandled exception"); + /* * Upper limit on vm_maxcpu. We could increase this to 28 bits, but this * is a safe value for now. diff --git a/sys/arm64/vmm/vmm_stat.h b/sys/arm64/vmm/vmm_stat.h index 402fa2f1b1e4..0dc3eeced603 100644 --- a/sys/arm64/vmm/vmm_stat.h +++ b/sys/arm64/vmm/vmm_stat.h @@ -32,102 +32,7 @@ #ifndef _VMM_STAT_H_ #define _VMM_STAT_H_ -struct vm; - -#define MAX_VMM_STAT_ELEMS 64 /* arbitrary */ - -enum vmm_stat_scope { - VMM_STAT_SCOPE_ANY, -}; - -struct vmm_stat_type; -typedef void (*vmm_stat_func_t)(struct vcpu *vcpu, - struct vmm_stat_type *stat); - -struct vmm_stat_type { - int index; /* position in the stats buffer */ - int nelems; /* standalone or array */ - const char *desc; /* description of statistic */ - vmm_stat_func_t func; - enum vmm_stat_scope scope; -}; - -void vmm_stat_register(void *arg); - -#define VMM_STAT_FDEFINE(type, nelems, desc, func, scope) \ - struct vmm_stat_type type[1] = { \ - { -1, nelems, desc, func, scope } \ - }; \ - SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_register, type) - -#define VMM_STAT_DEFINE(type, nelems, desc, scope) \ - VMM_STAT_FDEFINE(type, nelems, desc, NULL, scope) - -#define VMM_STAT_DECLARE(type) \ - extern struct vmm_stat_type type[1] - -#define VMM_STAT(type, desc) \ - VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_ANY) - -#define VMM_STAT_FUNC(type, desc, func) \ - VMM_STAT_FDEFINE(type, 1, desc, func, VMM_STAT_SCOPE_ANY) - -#define VMM_STAT_ARRAY(type, nelems, desc) \ - VMM_STAT_DEFINE(type, nelems, desc, VMM_STAT_SCOPE_ANY) - -void *vmm_stat_alloc(void); -void vmm_stat_init(void *vp); -void vmm_stat_free(void *vp); - -int vmm_stat_copy(struct vcpu *vcpu, int index, int count, - int *num_stats, uint64_t *buf); -int vmm_stat_desc_copy(int index, char *buf, int buflen); - -static void __inline -vmm_stat_array_incr(struct vcpu *vcpu, struct vmm_stat_type *vst, int statidx, - uint64_t x) -{ -#ifdef VMM_KEEP_STATS - uint64_t *stats; - - stats = vcpu_stats(vcpu); - - if (vst->index >= 0 && statidx < vst->nelems) - stats[vst->index + statidx] += x; -#endif -} - -static void __inline -vmm_stat_array_set(struct vcpu *vcpu, struct vmm_stat_type *vst, int statidx, - uint64_t val) -{ -#ifdef VMM_KEEP_STATS - uint64_t *stats; - - stats = vcpu_stats(vcpu); - - if (vst->index >= 0 && statidx < vst->nelems) - stats[vst->index + statidx] = val; -#endif -} - -static void __inline -vmm_stat_incr(struct vcpu *vcpu, struct vmm_stat_type *vst, uint64_t x) -{ - -#ifdef VMM_KEEP_STATS - vmm_stat_array_incr(vcpu, vst, 0, x); -#endif -} - -static void __inline -vmm_stat_set(struct vcpu *vcpu, struct vmm_stat_type *vst, uint64_t val) -{ - -#ifdef VMM_KEEP_STATS - vmm_stat_array_set(vcpu, vst, 0, val); -#endif -} +#include VMM_STAT_DECLARE(VMEXIT_COUNT); VMM_STAT_DECLARE(VMEXIT_UNKNOWN); @@ -144,4 +49,5 @@ VMM_STAT_DECLARE(VMEXIT_BRK); VMM_STAT_DECLARE(VMEXIT_SS); VMM_STAT_DECLARE(VMEXIT_UNHANDLED_EL2); VMM_STAT_DECLARE(VMEXIT_UNHANDLED); + #endif diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 1c863ff98998..3a8818340f75 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -119,7 +119,6 @@ dev/iommu/iommu_gas.c optional iommu arm64/vmm/vmm.c optional vmm arm64/vmm/vmm_dev.c optional vmm arm64/vmm/vmm_instruction_emul.c optional vmm -arm64/vmm/vmm_stat.c optional vmm arm64/vmm/vmm_arm64.c optional vmm arm64/vmm/vmm_reset.c optional vmm arm64/vmm/vmm_handlers.c optional vmm @@ -151,6 +150,7 @@ arm64/vmm/io/vgic.c optional vmm arm64/vmm/io/vgic_v3.c optional vmm arm64/vmm/io/vgic_if.m optional vmm arm64/vmm/io/vtimer.c optional vmm +dev/vmm/vmm_stat.c optional vmm crypto/armv8/armv8_crypto.c optional armv8crypto armv8_crypto_wrap.o optional armv8crypto \ diff --git a/sys/arm64/vmm/vmm_stat.c b/sys/dev/vmm/vmm_stat.c similarity index 77% rename from sys/arm64/vmm/vmm_stat.c rename to sys/dev/vmm/vmm_stat.c index 05ece6f30579..44edd6af85dd 100644 --- a/sys/arm64/vmm/vmm_stat.c +++ b/sys/dev/vmm/vmm_stat.c @@ -26,16 +26,14 @@ * SUCH DAMAGE. */ -#include - #include #include #include #include -#include #include -#include "vmm_stat.h" + +#include /* * 'vst_num_elems' is the total number of addressable statistic elements @@ -61,6 +59,9 @@ vmm_stat_register(void *arg) if (vst->desc == NULL) return; + if (vst->pred != NULL && !vst->pred()) + return; + if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) { printf("Cannot accommodate vmm stat type \"%s\"!\n", vst->desc); return; @@ -148,20 +149,3 @@ vmm_stat_desc_copy(int index, char *buf, int bufsize) return (EINVAL); } - -/* global statistics */ -VMM_STAT(VMEXIT_COUNT, "total number of vm exits"); -VMM_STAT(VMEXIT_UNKNOWN, "number of vmexits for the unknown exception"); -VMM_STAT(VMEXIT_WFI, "number of times wfi was intercepted"); -VMM_STAT(VMEXIT_WFE, "number of times wfe was intercepted"); -VMM_STAT(VMEXIT_HVC, "number of times hvc was intercepted"); -VMM_STAT(VMEXIT_MSR, "number of times msr/mrs was intercepted"); -VMM_STAT(VMEXIT_DATA_ABORT, "number of vmexits for a data abort"); -VMM_STAT(VMEXIT_INSN_ABORT, "number of vmexits for an instruction abort"); -VMM_STAT(VMEXIT_UNHANDLED_SYNC, "number of vmexits for an unhandled synchronous exception"); -VMM_STAT(VMEXIT_IRQ, "number of vmexits for an irq"); -VMM_STAT(VMEXIT_FIQ, "number of vmexits for an interrupt"); -VMM_STAT(VMEXIT_BRK, "number of vmexits for a breakpoint exception"); -VMM_STAT(VMEXIT_SS, "number of vmexits for a single-step exception"); -VMM_STAT(VMEXIT_UNHANDLED_EL2, "number of vmexits for an unhandled EL2 exception"); -VMM_STAT(VMEXIT_UNHANDLED, "number of vmexits for an unhandled exception"); diff --git a/sys/dev/vmm/vmm_stat.h b/sys/dev/vmm/vmm_stat.h new file mode 100644 index 000000000000..471afd0dd827 --- /dev/null +++ b/sys/dev/vmm/vmm_stat.h @@ -0,0 +1,135 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _DEV_VMM_STAT_H_ +#define _DEV_VMM_STAT_H_ + +struct vm; + +#define MAX_VMM_STAT_ELEMS 64 /* arbitrary */ + +struct vmm_stat_type; +typedef void (*vmm_stat_func_t)(struct vcpu *vcpu, + struct vmm_stat_type *stat); +typedef bool (*vmm_stat_func_pred_t)(void); + +struct vmm_stat_type { + int index; /* position in the stats buffer */ + int nelems; /* standalone or array */ + const char *desc; /* description of statistic */ + vmm_stat_func_t func; + vmm_stat_func_pred_t pred; /* predicate to check during registration */ +}; + +void vmm_stat_register(void *arg); + +#define VMM_STAT_FDEFINE(type, _nelems, _desc, _func, _pred) \ + struct vmm_stat_type type[1] = { \ + { \ + .index = -1, \ + .nelems = _nelems, \ + .desc = _desc, \ + .func = _func, \ + .pred = _pred, \ + } \ + }; \ + SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_register, type) + +#define VMM_STAT_DEFINE(type, nelems, desc, pred) \ + VMM_STAT_FDEFINE(type, nelems, desc, NULL, pred) + +#define VMM_STAT_DECLARE(type) \ + extern struct vmm_stat_type type[1] + +#define VMM_STAT(type, desc) \ + VMM_STAT_DEFINE(type, 1, desc, NULL) + +#define VMM_STAT_FUNC(type, desc, func) \ + VMM_STAT_FDEFINE(type, 1, desc, func, NULL) + +#define VMM_STAT_ARRAY(type, nelems, desc) \ + VMM_STAT_DEFINE(type, nelems, desc, NULL) + +void *vmm_stat_alloc(void); +void vmm_stat_init(void *vp); +void vmm_stat_free(void *vp); + +int vmm_stat_copy(struct vcpu *vcpu, int index, int count, + int *num_stats, uint64_t *buf); +int vmm_stat_desc_copy(int index, char *buf, int buflen); + +static void __inline +vmm_stat_array_incr(struct vcpu *vcpu, struct vmm_stat_type *vst, int statidx, + uint64_t x) +{ +#ifdef VMM_KEEP_STATS + uint64_t *stats; + + stats = vcpu_stats(vcpu); + + if (vst->index >= 0 && statidx < vst->nelems) + stats[vst->index + statidx] += x; +#endif +} + +static void __inline +vmm_stat_array_set(struct vcpu *vcpu, struct vmm_stat_type *vst, int statidx, + uint64_t val) +{ +#ifdef VMM_KEEP_STATS + uint64_t *stats; + + stats = vcpu_stats(vcpu); + + if (vst->index >= 0 && statidx < vst->nelems) + stats[vst->index + statidx] = val; +#endif +} + +static void __inline +vmm_stat_incr(struct vcpu *vcpu, struct vmm_stat_type *vst, uint64_t x) +{ + +#ifdef VMM_KEEP_STATS + vmm_stat_array_incr(vcpu, vst, 0, x); +#endif +} + +static void __inline +vmm_stat_set(struct vcpu *vcpu, struct vmm_stat_type *vst, uint64_t val) +{ + +#ifdef VMM_KEEP_STATS + vmm_stat_array_set(vcpu, vst, 0, val); +#endif +} + +#endif /* !_DEV_VMM_STAT_H_ */ diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 0604a34690e5..92986a364883 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -15,9 +15,10 @@ CFLAGS+= -I${SRCTOP}/sys/${MACHINE}/vmm CFLAGS+= -I${SRCTOP}/sys/${MACHINE}/vmm/io # generic vmm support -.PATH: ${SRCTOP}/sys/${MACHINE}/vmm -SRCS+= vmm.c \ - vmm_dev.c \ +.PATH: ${SRCTOP}/sys/dev/vmm ${SRCTOP}/sys/${MACHINE}/vmm + +SRCS+= vmm.c \ + vmm_dev.c \ vmm_instruction_emul.c \ vmm_stat.c From nobody Mon Aug 26 18:58:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt0Lv4zzrz5TRJW; Mon, 26 Aug 2024 18:58: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 4Wt0Lv3Kprz4F8f; Mon, 26 Aug 2024 18:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WkwvBdUKWMclIGmUu2VEUK6adWQI13e9tczNsXMxRY=; b=DsT29+my1tnYVD0itLzggiWggQczLHEiJFQGGvs1zeYsXhN/s9snPy9BJPgQ3eWPcih0q7 wq3ybnpnYya0zrfsrg8E82nv2y6mc/VVyxSV/uNY/OyRCLF/hbhMkhtu+35t7/5c8ls8Tn HgW6524LShMD8fN2IqclJVVAlpbJa3gN5Lg7sZRLFTzFW+RvqAfUUxjxbdkuWD2Eaa+ecR OiNydbzNF2VyaYUpz62rnxI1aqxu1eh89RpGZ01MjKoldWqBCVBNrhq97aULw/77ldsC4f WVUgkRDEp9Y4XOf7BKHhpgPiB0hYzbA7t2cg+kfWpZ0rTNa40Rziojn1mubZQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724698711; a=rsa-sha256; cv=none; b=Lrf04VPCtVkaE0BiAIdilnimORa9omyHvqjqA4bHzUOm92JVYxY/N2umxUC/zUzvGlrJI2 HFMXvyNzNj8PwwytHEC6ZEAFwjaT04PeB2nssVo1RxQHVGu7pGNeTf2ciSLHvSh4sc54nT b1KLUCxi5IRTE/6prbfbfFmFUa2IgTmJWeQ+YlJX6nnrTDPdPkYj1+HBwRTqkZp+enOshu JOiYFj9E8kJ9Hoq+CDOhsXPadzqZPF0NH6rI6TT67QHN9o3lqFcnPtsmAsP2jSv42+HaC+ uA8UYGSMH138oq0HW8r5ja4+nk/zgSDjTnujmUWoznSCV3WTjzqZWAZ7ur5tdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WkwvBdUKWMclIGmUu2VEUK6adWQI13e9tczNsXMxRY=; b=aWBe9VWLjhDL3LnKXNyJugqdccKefqloJQC9i8iExWSn9eXRz28uidQajQPkqyql84XbMC p0oEqwbTD0LyRGHn+VQArnNkY/sanyu/vmLzonQ227RrMAP7OnExztDUhDD886AUjkzanS BuldUh9r9XySQbqVuQrSPEdV4XcqeipHngf48dD5909nvLbN7MadrLosxweIedXYbbxvu1 o5RPbrJVtDrD/RK9+1xbEpZ/kSL+WWK/CWYNHR5fSV3d1QUrXyfdTHCTn3Ge8ckdZFok35 RDJttvJOuYUHHLRtlJlDwEZVoF0EjAGHnJOWqnnt7wLaPJka3mThAdz9IM8Zdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt0Lv2qbCzHNF; Mon, 26 Aug 2024 18:58: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 47QIwVPa027599; Mon, 26 Aug 2024 18:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIwVWk027596; Mon, 26 Aug 2024 18:58:31 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:58:31 GMT Message-Id: <202408261858.47QIwVWk027596@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: 3df92c972898 - main - vmm: Enable assertions in vmmdev_lookup() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3df92c972898be7b4b8dafacfd6708f3a39b2af5 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3df92c972898be7b4b8dafacfd6708f3a39b2af5 commit 3df92c972898be7b4b8dafacfd6708f3a39b2af5 Author: Mark Johnston AuthorDate: 2024-08-26 18:41:23 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:41:23 +0000 vmm: Enable assertions in vmmdev_lookup() The comment has been there since the initial import of the vmm code and presumably reflected some kind of problem with standalone builds of vmm.ko. However, I don't see any problems with it, and mtx_assert() is used elsewhere within the vmm code. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46438 --- sys/amd64/vmm/vmm_dev.c | 2 -- sys/arm64/vmm/vmm_dev.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index 46cddce4e4b8..9acbfbb454e0 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -228,9 +228,7 @@ vmmdev_lookup(const char *name) { struct vmmdev_softc *sc; -#ifdef notyet /* XXX kernel is not compiled with invariants */ mtx_assert(&vmmdev_mtx, MA_OWNED); -#endif SLIST_FOREACH(sc, &head, link) { if (strcmp(name, vm_name(sc->vm)) == 0) diff --git a/sys/arm64/vmm/vmm_dev.c b/sys/arm64/vmm/vmm_dev.c index 946c6760f7c1..c3c6dcc87d88 100644 --- a/sys/arm64/vmm/vmm_dev.c +++ b/sys/arm64/vmm/vmm_dev.c @@ -172,9 +172,7 @@ vmmdev_lookup(const char *name) { struct vmmdev_softc *sc; -#ifdef notyet /* XXX kernel is not compiled with invariants */ mtx_assert(&vmmdev_mtx, MA_OWNED); -#endif SLIST_FOREACH(sc, &head, link) { if (strcmp(name, vm_name(sc->vm)) == 0) From nobody Mon Aug 26 18:58:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt0Lw60j9z5TR3m; Mon, 26 Aug 2024 18:58: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 4Wt0Lw4B3Nz4FSt; Mon, 26 Aug 2024 18:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mP/wJ6eKGl+ksztt1bR1B3juQdQ7mna9u0Vf6jd4174=; b=pxVSmExox86yRbeAj+QK7LKf147I3VQqW8/sdX3Pm0alP/wqz/vKPzoVm2TuxrqNOC72Wv mtky8VKo8ynYe99C6nUjjFTw4DfuNFlam+GR1VLurdUBCMq2pr3KrSLZFYtoPVFn1GIby5 may+bKLFkTU6IofKxtLgsc9OO6aj/aD4hVwv1ErA8pC+D6ewZpoYhqt+pIVt0Pw3fJ7g0u snxie1tXRaPl5RHHTr3O58wv3Yok/AaMxAA/pSbikfqVJ+K3ZJ3hsgW6TuioXkvRUlaNd4 WtelfMhEX7UuKRBOv0yG2TZv2ueMgbebJ0oLPfw+C4eHVPPvcOkl0hdYj1/sYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724698712; a=rsa-sha256; cv=none; b=ojuh3hKK/bxzM0eGhDle7yQxrtnLyo6qUUrNDNiaElXFfkVnnIHh53GcIZrMfSwTcxcRMa XiIo+DZlW10LHVKSqHd7nbtPGGmQEQgs4t9EtF7GT9xWKaB/opHl1oXDRTlFBBJq0eidlo oAKfaJGLaNmGUHoyaorm3t+plESc6ZizhiWvMT2i4mwy6SSGsXiqhUFlx0WGXHESPrAu8p eogMbR0/IOsqRtvkJhMGA3D7XxuiEWkkwjrZglTpxlaU9tN2c8upL1cKciWmZXpeyudyxY llMvCYXW9SZhY9ct9pDnqCe8HqahRNgUaiHMb2BmWYIGGCniBMSfQ0qP37pkjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mP/wJ6eKGl+ksztt1bR1B3juQdQ7mna9u0Vf6jd4174=; b=q+DB4oSNalSTGxSdl0gA24hiCe1C94Fwc3pDj+v9nWU4/ONG+yplKyIQQyhfcTHwXneXuc +Ca8ziDivuHtiUItLe7o2IV/Uk+CWa9GEzdiAMLq4d2ucAzQlSDtMsRS3o1zLNLl/SpUrj br6/NvT094NQsCH/S9Zrz2lZyhNent4bj0TmACxLD8n97olVx9eOQfG42jayWdHvhY3PKD eMevCR5W2/d7Kgxig/nykJFiUQehFrSE9f9SC8BRLfuMEQXu9ch8PzcnoEo8ZTQhBYHIof a9mlmWKmbA+ld1f0ChxofdmVC9aM5BKL5SWRnK+Z1qOI3nh3cE1Lgws26TQM+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt0Lw3l4gzJ4T; Mon, 26 Aug 2024 18:58: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 47QIwWd7027650; Mon, 26 Aug 2024 18:58:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIwWqA027647; Mon, 26 Aug 2024 18:58:32 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:58:32 GMT Message-Id: <202408261858.47QIwWqA027647@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: 908a9dc02007 - main - arm64: Add a missing vm_disable_vcpu_creation() call in vmmdev_destroy() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 908a9dc020071947fe727ef11a35e78bf76a6b81 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=908a9dc020071947fe727ef11a35e78bf76a6b81 commit 908a9dc020071947fe727ef11a35e78bf76a6b81 Author: Mark Johnston AuthorDate: 2024-08-26 18:41:34 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:41:34 +0000 arm64: Add a missing vm_disable_vcpu_creation() call in vmmdev_destroy() This brings arm64 in sync with amd64, which had diverged a bit after the arm64 code was forked. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46439 --- sys/arm64/vmm/vmm_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/vmm/vmm_dev.c b/sys/arm64/vmm/vmm_dev.c index c3c6dcc87d88..28877739e2ce 100644 --- a/sys/arm64/vmm/vmm_dev.c +++ b/sys/arm64/vmm/vmm_dev.c @@ -767,6 +767,7 @@ vmmdev_destroy(void *arg) struct devmem_softc *dsc; int error __diagused; + vm_disable_vcpu_creation(sc->vm); error = vcpu_lock_all(sc); KASSERT(error == 0, ("%s: error %d freezing vcpus", __func__, error)); vm_unlock_vcpus(sc->vm); From nobody Mon Aug 26 18:58:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt0Lx6hz2z5TR7m; Mon, 26 Aug 2024 18:58: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 4Wt0Lx4nN2z4FWH; Mon, 26 Aug 2024 18:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXseGtT7NZvzH2k8cOvs4exsNDs316GpQq4+PdCAcTA=; b=MbH2d5D8xyVtjq1uqKIrmy0TgfxeGzy+mjRx4lgzCOfH0NuHJHfhlIG4IAHzwE2V41vsVR J0QLL6I+mz8rwwTWj7NVmLDiYp6/2PAQKbWj52VoxZOuI5ahl0ip15YxXYH7zqjvHOh8Eq DpOZ6VZ87ZhTfT5ofgc4WftVAsMo1zNRJ646GVJMgz1F6ueB3at74z3gwEfYAAUHmNlWB2 /VpjHCJ/twdP2nq1daC3KGEAGL2D0sUarevsgiA6mPgzgn9sJBYhmjEC3vM89um0zdZWBo 5CYiloE7eblsPNQHZUXMfFEE1aCZnWYIxXWLp8yFfd6hBJpWkE5ArTf+4akFug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724698713; a=rsa-sha256; cv=none; b=dgoWnpLqLvWUdhWCz97xrlpmU48VbsuOfwFBbKcRYldzNbQCA+sVbOykIFIGRwzHVpHvW4 8HHctbT/utAIK8ugUG8hxm+0L1o9V88MFa2YmU2dzSz+sBEDor4hindI6BG3sLKqqX9wCL ETnBZMeVhqZr9GLX0ITVfbnZ4uMhicaQEsC1MBJSwYGhH+eb7ZElcR6NmCBfh4jkMWZGPZ y+AWZFKyE0a9b+GrORK1oyDV4P3oKCXFNEvTt+Ini/f2mXM6XutCzGtnFyWSOIBvCbUQYM LlGXdxMQgThPm8g+Uwd+db0hslLlL/d7coqSEFKZRiIci8mFghcSHVLmQn4EFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXseGtT7NZvzH2k8cOvs4exsNDs316GpQq4+PdCAcTA=; b=Pjp1F9KO8A3Qowgo/yunJlWACxCrwM9DP1EEatDpIxkQjFXyROXGsZpP7I65HC4+xki2FI XmsC3WNmFWLgwrLyxWXGNakUe4wbaKki03s1TIwNqyZIpGjusAMz9Emw/ImHeGTtCYJqB7 i3VEKKBrWAc+EwPS/gDmUvev+fZPeoVymzVZ9oGEVQSh7F+mRv89g4lwNqEZwWh7QjEtcU YvxGv+64fV1CkW2LYL6B3AcTNz8P2oEepfNgxYQhdVDeWYtXiYCpcjp0ukpba/5+Cvh7hW NALvTG1nic4FLxeAkvnL8qgXAnlIHms7wbiBEAU5LZN3oOPnE0bN0tDHWJniSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt0Lx4Lf3zJZ6; Mon, 26 Aug 2024 18:58: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 47QIwXeq027693; Mon, 26 Aug 2024 18:58:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIwX6l027690; Mon, 26 Aug 2024 18:58:33 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:58:33 GMT Message-Id: <202408261858.47QIwX6l027690@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: b9ef152bec6c - main - vmm: Merge vmm_dev.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9ef152bec6cff4cd82b68921f631bd6efb24ae6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b9ef152bec6cff4cd82b68921f631bd6efb24ae6 commit b9ef152bec6cff4cd82b68921f631bd6efb24ae6 Author: Mark Johnston AuthorDate: 2024-08-26 18:41:39 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:41:39 +0000 vmm: Merge vmm_dev.c This file contains the vmm device file implementation. Most of this code is not machine-dependent and so shouldn't be duplicated this way. Move most of it into a generic dev/vmm/vmm_dev.c. This will make it easier to introduce a cdev-based interface for VM creation, which in turn makes it possible to implement support for running bhyve as an unprivileged user. Machine-dependent ioctls continue to be handled in machine-dependent code. To make the split a bit easier to handle, introduce a pair of tables which define MI and MD ioctls. Each table entry can set flags which determine which locks need to be held in order to execute the handler. vmmdev_ioctl() now looks up the ioctl in one of the tables, acquires locks and either handles the ioctl directly or calls vmmdev_machdep_ioctl() to handle it. No functional change intended. There is a lot of churn in this change but the underlying logic in the ioctl handlers is the same. For now, vmm_dev.h is still mostly separate, even though some parts could be merged in principle. This would involve changing include paths for userspace, though. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46431 --- sys/amd64/include/vmm_dev.h | 5 - sys/amd64/vmm/vmm.c | 2 +- sys/amd64/vmm/vmm_dev.c | 1452 -------------------------------------- sys/amd64/vmm/vmm_dev_machdep.c | 526 ++++++++++++++ sys/arm64/include/vmm_dev.h | 5 - sys/arm64/vmm/vmm.c | 2 +- sys/arm64/vmm/vmm_dev_machdep.c | 137 ++++ sys/conf/files.arm64 | 1 + sys/{arm64 => dev}/vmm/vmm_dev.c | 443 ++++++------ sys/dev/vmm/vmm_dev.h | 57 ++ sys/modules/vmm/Makefile | 1 + 11 files changed, 924 insertions(+), 1707 deletions(-) diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h index aa265315f15e..a007ce5515a5 100644 --- a/sys/amd64/include/vmm_dev.h +++ b/sys/amd64/include/vmm_dev.h @@ -31,11 +31,6 @@ struct vm_snapshot_meta; -#ifdef _KERNEL -void vmmdev_init(void); -int vmmdev_cleanup(void); -#endif - struct vm_memmap { vm_paddr_t gpa; int segid; /* memory segment */ diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index d0259b3b125f..20006e63cfeb 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -67,10 +67,10 @@ #include #include -#include #include #include +#include #include #include "vmm_ioport.h" diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c deleted file mode 100644 index 9acbfbb454e0..000000000000 --- a/sys/amd64/vmm/vmm_dev.c +++ /dev/null @@ -1,1452 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2011 NetApp, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC 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 "opt_bhyve_snapshot.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "vmm_lapic.h" -#include "vmm_stat.h" -#include "vmm_mem.h" -#include "io/ppt.h" -#include "io/vatpic.h" -#include "io/vioapic.h" -#include "io/vhpet.h" -#include "io/vrtc.h" - -#ifdef COMPAT_FREEBSD13 -struct vm_stats_old { - int cpuid; /* in */ - int num_entries; /* out */ - struct timeval tv; - uint64_t statbuf[MAX_VM_STATS]; -}; - -#define VM_STATS_OLD \ - _IOWR('v', IOCNUM_VM_STATS, struct vm_stats_old) - -struct vm_snapshot_meta_old { - void *ctx; /* unused */ - void *dev_data; - const char *dev_name; /* identify userspace devices */ - enum snapshot_req dev_req; /* identify kernel structs */ - - struct vm_snapshot_buffer buffer; - - enum vm_snapshot_op op; -}; - -#define VM_SNAPSHOT_REQ_OLD \ - _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta_old) - -struct vm_exit_ipi_13 { - uint32_t mode; - uint8_t vector; - __BITSET_DEFINE(, 256) dmask; -}; - -struct vm_exit_13 { - uint32_t exitcode; - int32_t inst_length; - uint64_t rip; - uint64_t u[120 / sizeof(uint64_t)]; -}; - -struct vm_run_13 { - int cpuid; - struct vm_exit_13 vm_exit; -}; - -#define VM_RUN_13 \ - _IOWR('v', IOCNUM_RUN, struct vm_run_13) - -#endif /* COMPAT_FREEBSD13 */ - -struct devmem_softc { - int segid; - char *name; - struct cdev *cdev; - struct vmmdev_softc *sc; - SLIST_ENTRY(devmem_softc) link; -}; - -struct vmmdev_softc { - struct vm *vm; /* vm instance cookie */ - struct cdev *cdev; - struct ucred *ucred; - SLIST_ENTRY(vmmdev_softc) link; - SLIST_HEAD(, devmem_softc) devmem; - int flags; -}; -#define VSC_LINKED 0x01 - -static SLIST_HEAD(, vmmdev_softc) head; - -static unsigned pr_allow_flag; -static struct mtx vmmdev_mtx; -MTX_SYSINIT(vmmdev_mtx, &vmmdev_mtx, "vmm device mutex", MTX_DEF); - -static MALLOC_DEFINE(M_VMMDEV, "vmmdev", "vmmdev"); - -SYSCTL_DECL(_hw_vmm); - -static int vmm_priv_check(struct ucred *ucred); -static int devmem_create_cdev(const char *vmname, int id, char *devmem); -static void devmem_destroy(void *arg); - -static int -vmm_priv_check(struct ucred *ucred) -{ - - if (jailed(ucred) && - !(ucred->cr_prison->pr_allow & pr_allow_flag)) - return (EPERM); - - return (0); -} - -static int -vcpu_lock_one(struct vcpu *vcpu) -{ - return (vcpu_set_state(vcpu, VCPU_FROZEN, true)); -} - -static void -vcpu_unlock_one(struct vcpu *vcpu) -{ - enum vcpu_state state; - - state = vcpu_get_state(vcpu, NULL); - if (state != VCPU_FROZEN) { - panic("vcpu %s(%d) has invalid state %d", - vm_name(vcpu_vm(vcpu)), vcpu_vcpuid(vcpu), state); - } - - vcpu_set_state(vcpu, VCPU_IDLE, false); -} - -static int -vcpu_lock_all(struct vmmdev_softc *sc) -{ - struct vcpu *vcpu; - int error; - uint16_t i, j, maxcpus; - - error = 0; - vm_slock_vcpus(sc->vm); - maxcpus = vm_get_maxcpus(sc->vm); - for (i = 0; i < maxcpus; i++) { - vcpu = vm_vcpu(sc->vm, i); - if (vcpu == NULL) - continue; - error = vcpu_lock_one(vcpu); - if (error) - break; - } - - if (error) { - for (j = 0; j < i; j++) { - vcpu = vm_vcpu(sc->vm, j); - if (vcpu == NULL) - continue; - vcpu_unlock_one(vcpu); - } - vm_unlock_vcpus(sc->vm); - } - - return (error); -} - -static void -vcpu_unlock_all(struct vmmdev_softc *sc) -{ - struct vcpu *vcpu; - uint16_t i, maxcpus; - - maxcpus = vm_get_maxcpus(sc->vm); - for (i = 0; i < maxcpus; i++) { - vcpu = vm_vcpu(sc->vm, i); - if (vcpu == NULL) - continue; - vcpu_unlock_one(vcpu); - } - vm_unlock_vcpus(sc->vm); -} - -static struct vmmdev_softc * -vmmdev_lookup(const char *name) -{ - struct vmmdev_softc *sc; - - mtx_assert(&vmmdev_mtx, MA_OWNED); - - SLIST_FOREACH(sc, &head, link) { - if (strcmp(name, vm_name(sc->vm)) == 0) - break; - } - - if (sc == NULL) - return (NULL); - - if (cr_cansee(curthread->td_ucred, sc->ucred)) - return (NULL); - - return (sc); -} - -static struct vmmdev_softc * -vmmdev_lookup2(struct cdev *cdev) -{ - - return (cdev->si_drv1); -} - -static int -vmmdev_rw(struct cdev *cdev, struct uio *uio, int flags) -{ - int error, off, c, prot; - vm_paddr_t gpa, maxaddr; - void *hpa, *cookie; - struct vmmdev_softc *sc; - - error = vmm_priv_check(curthread->td_ucred); - if (error) - return (error); - - sc = vmmdev_lookup2(cdev); - if (sc == NULL) - return (ENXIO); - - /* - * Get a read lock on the guest memory map. - */ - vm_slock_memsegs(sc->vm); - - prot = (uio->uio_rw == UIO_WRITE ? VM_PROT_WRITE : VM_PROT_READ); - maxaddr = vmm_sysmem_maxaddr(sc->vm); - while (uio->uio_resid > 0 && error == 0) { - gpa = uio->uio_offset; - off = gpa & PAGE_MASK; - c = min(uio->uio_resid, PAGE_SIZE - off); - - /* - * The VM has a hole in its physical memory map. If we want to - * use 'dd' to inspect memory beyond the hole we need to - * provide bogus data for memory that lies in the hole. - * - * Since this device does not support lseek(2), dd(1) will - * read(2) blocks of data to simulate the lseek(2). - */ - hpa = vm_gpa_hold_global(sc->vm, gpa, c, prot, &cookie); - if (hpa == NULL) { - if (uio->uio_rw == UIO_READ && gpa < maxaddr) - error = uiomove(__DECONST(void *, zero_region), - c, uio); - else - error = EFAULT; - } else { - error = uiomove(hpa, c, uio); - vm_gpa_release(cookie); - } - } - vm_unlock_memsegs(sc->vm); - return (error); -} - -CTASSERT(sizeof(((struct vm_memseg *)0)->name) >= VM_MAX_SUFFIXLEN + 1); - -static int -get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) -{ - struct devmem_softc *dsc; - int error; - bool sysmem; - - error = vm_get_memseg(sc->vm, mseg->segid, &mseg->len, &sysmem, NULL); - if (error || mseg->len == 0) - return (error); - - if (!sysmem) { - SLIST_FOREACH(dsc, &sc->devmem, link) { - if (dsc->segid == mseg->segid) - break; - } - KASSERT(dsc != NULL, ("%s: devmem segment %d not found", - __func__, mseg->segid)); - error = copystr(dsc->name, mseg->name, len, NULL); - } else { - bzero(mseg->name, len); - } - - return (error); -} - -static int -alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) -{ - char *name; - int error; - bool sysmem; - - error = 0; - name = NULL; - sysmem = true; - - /* - * The allocation is lengthened by 1 to hold a terminating NUL. It'll - * by stripped off when devfs processes the full string. - */ - if (VM_MEMSEG_NAME(mseg)) { - sysmem = false; - name = malloc(len, M_VMMDEV, M_WAITOK); - error = copystr(mseg->name, name, len, NULL); - if (error) - goto done; - } - - error = vm_alloc_memseg(sc->vm, mseg->segid, mseg->len, sysmem); - if (error) - goto done; - - if (VM_MEMSEG_NAME(mseg)) { - error = devmem_create_cdev(vm_name(sc->vm), mseg->segid, name); - if (error) - vm_free_memseg(sc->vm, mseg->segid); - else - name = NULL; /* freed when 'cdev' is destroyed */ - } -done: - free(name, M_VMMDEV); - return (error); -} - -static int -vm_get_register_set(struct vcpu *vcpu, unsigned int count, int *regnum, - uint64_t *regval) -{ - int error, i; - - error = 0; - for (i = 0; i < count; i++) { - error = vm_get_register(vcpu, regnum[i], ®val[i]); - if (error) - break; - } - return (error); -} - -static int -vm_set_register_set(struct vcpu *vcpu, unsigned int count, int *regnum, - uint64_t *regval) -{ - int error, i; - - error = 0; - for (i = 0; i < count; i++) { - error = vm_set_register(vcpu, regnum[i], regval[i]); - if (error) - break; - } - return (error); -} - -static int -vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, - struct thread *td) -{ - int error, vcpuid, size; - cpuset_t *cpuset; - struct vmmdev_softc *sc; - struct vcpu *vcpu; - struct vm_register *vmreg; - struct vm_seg_desc *vmsegdesc; - struct vm_register_set *vmregset; - struct vm_run *vmrun; -#ifdef COMPAT_FREEBSD13 - struct vm_run_13 *vmrun_13; -#endif - struct vm_exception *vmexc; - struct vm_lapic_irq *vmirq; - struct vm_lapic_msi *vmmsi; - struct vm_ioapic_irq *ioapic_irq; - struct vm_isa_irq *isa_irq; - struct vm_isa_irq_trigger *isa_irq_trigger; - struct vm_capability *vmcap; - struct vm_pptdev *pptdev; - struct vm_pptdev_mmio *pptmmio; - struct vm_pptdev_msi *pptmsi; - struct vm_pptdev_msix *pptmsix; -#ifdef COMPAT_FREEBSD13 - struct vm_stats_old *vmstats_old; -#endif - struct vm_stats *vmstats; - struct vm_stat_desc *statdesc; - struct vm_x2apic *x2apic; - struct vm_gpa_pte *gpapte; - struct vm_suspend *vmsuspend; - struct vm_gla2gpa *gg; - struct vm_cpuset *vm_cpuset; - struct vm_intinfo *vmii; - struct vm_rtc_time *rtctime; - struct vm_rtc_data *rtcdata; - struct vm_memmap *mm; - struct vm_munmap *mu; - struct vm_cpu_topology *topology; - struct vm_readwrite_kernemu_device *kernemu; - uint64_t *regvals; - int *regnums; - enum { NONE, SINGLE, ALL } vcpus_locked; - bool memsegs_locked; -#ifdef BHYVE_SNAPSHOT - struct vm_snapshot_meta *snapshot_meta; -#ifdef COMPAT_FREEBSD13 - struct vm_snapshot_meta_old *snapshot_old; -#endif -#endif - - error = vmm_priv_check(curthread->td_ucred); - if (error) - return (error); - - sc = vmmdev_lookup2(cdev); - if (sc == NULL) - return (ENXIO); - - vcpuid = -1; - vcpu = NULL; - vcpus_locked = NONE; - memsegs_locked = false; - - /* - * For VMM ioctls that operate on a single vCPU, lookup the - * vcpu. For VMM ioctls which require one or more vCPUs to - * not be running, lock necessary vCPUs. - * - * XXX fragile, handle with care - * Most of these assume that the first field of the ioctl data - * is the vcpuid. - */ - switch (cmd) { - case VM_RUN: -#ifdef COMPAT_FREEBSD13 - case VM_RUN_13: -#endif - case VM_GET_REGISTER: - case VM_SET_REGISTER: - case VM_GET_SEGMENT_DESCRIPTOR: - case VM_SET_SEGMENT_DESCRIPTOR: - case VM_GET_REGISTER_SET: - case VM_SET_REGISTER_SET: - case VM_INJECT_EXCEPTION: - case VM_GET_CAPABILITY: - case VM_SET_CAPABILITY: - case VM_SET_X2APIC_STATE: - case VM_GLA2GPA: - case VM_GLA2GPA_NOFAULT: - case VM_ACTIVATE_CPU: - case VM_SET_INTINFO: - case VM_GET_INTINFO: - case VM_RESTART_INSTRUCTION: - case VM_GET_KERNEMU_DEV: - case VM_SET_KERNEMU_DEV: - /* - * ioctls that can operate only on vcpus that are not running. - */ - vcpuid = *(int *)data; - vcpu = vm_alloc_vcpu(sc->vm, vcpuid); - if (vcpu == NULL) { - error = EINVAL; - goto done; - } - error = vcpu_lock_one(vcpu); - if (error) - goto done; - vcpus_locked = SINGLE; - break; - -#ifdef COMPAT_FREEBSD12 - case VM_ALLOC_MEMSEG_FBSD12: -#endif - case VM_ALLOC_MEMSEG: - case VM_BIND_PPTDEV: - case VM_UNBIND_PPTDEV: - case VM_MMAP_MEMSEG: - case VM_MUNMAP_MEMSEG: - case VM_REINIT: - /* - * ioctls that modify the memory map must lock memory - * segments exclusively. - */ - vm_xlock_memsegs(sc->vm); - memsegs_locked = true; - /* FALLTHROUGH */ - case VM_MAP_PPTDEV_MMIO: - case VM_UNMAP_PPTDEV_MMIO: -#ifdef BHYVE_SNAPSHOT - case VM_SNAPSHOT_REQ: -#ifdef COMPAT_FREEBSD13 - case VM_SNAPSHOT_REQ_OLD: -#endif - case VM_RESTORE_TIME: -#endif - /* - * ioctls that operate on the entire virtual machine must - * prevent all vcpus from running. - */ - error = vcpu_lock_all(sc); - if (error) - goto done; - vcpus_locked = ALL; - break; - -#ifdef COMPAT_FREEBSD12 - case VM_GET_MEMSEG_FBSD12: -#endif - case VM_GET_MEMSEG: - case VM_MMAP_GETNEXT: - /* - * Lock the memory map while it is being inspected. - */ - vm_slock_memsegs(sc->vm); - memsegs_locked = true; - break; - -#ifdef COMPAT_FREEBSD13 - case VM_STATS_OLD: -#endif - case VM_STATS: - case VM_INJECT_NMI: - case VM_LAPIC_IRQ: - case VM_GET_X2APIC_STATE: - /* - * These do not need the vCPU locked but do operate on - * a specific vCPU. - */ - vcpuid = *(int *)data; - vcpu = vm_alloc_vcpu(sc->vm, vcpuid); - if (vcpu == NULL) { - error = EINVAL; - goto done; - } - break; - - case VM_LAPIC_LOCAL_IRQ: - case VM_SUSPEND_CPU: - case VM_RESUME_CPU: - /* - * These can either operate on all CPUs via a vcpuid of - * -1 or on a specific vCPU. - */ - vcpuid = *(int *)data; - if (vcpuid == -1) - break; - vcpu = vm_alloc_vcpu(sc->vm, vcpuid); - if (vcpu == NULL) { - error = EINVAL; - goto done; - } - break; - - default: - break; - } - - switch (cmd) { - case VM_RUN: { - struct vm_exit *vme; - - vmrun = (struct vm_run *)data; - vme = vm_exitinfo(vcpu); - - error = vm_run(vcpu); - if (error != 0) - break; - - error = copyout(vme, vmrun->vm_exit, sizeof(*vme)); - if (error != 0) - break; - if (vme->exitcode == VM_EXITCODE_IPI) { - error = copyout(vm_exitinfo_cpuset(vcpu), - vmrun->cpuset, - min(vmrun->cpusetsize, sizeof(cpuset_t))); - if (error != 0) - break; - if (sizeof(cpuset_t) < vmrun->cpusetsize) { - uint8_t *p; - - p = (uint8_t *)vmrun->cpuset + - sizeof(cpuset_t); - while (p < (uint8_t *)vmrun->cpuset + - vmrun->cpusetsize) { - if (subyte(p++, 0) != 0) { - error = EFAULT; - break; - } - } - } - } - break; - } -#ifdef COMPAT_FREEBSD13 - case VM_RUN_13: { - struct vm_exit *vme; - struct vm_exit_13 *vme_13; - - vmrun_13 = (struct vm_run_13 *)data; - vme_13 = &vmrun_13->vm_exit; - vme = vm_exitinfo(vcpu); - - error = vm_run(vcpu); - if (error == 0) { - vme_13->exitcode = vme->exitcode; - vme_13->inst_length = vme->inst_length; - vme_13->rip = vme->rip; - memcpy(vme_13->u, &vme->u, sizeof(vme_13->u)); - if (vme->exitcode == VM_EXITCODE_IPI) { - struct vm_exit_ipi_13 *ipi; - cpuset_t *dmask; - int cpu; - - dmask = vm_exitinfo_cpuset(vcpu); - ipi = (struct vm_exit_ipi_13 *)&vme_13->u[0]; - BIT_ZERO(256, &ipi->dmask); - CPU_FOREACH_ISSET(cpu, dmask) { - if (cpu >= 256) - break; - BIT_SET(256, cpu, &ipi->dmask); - } - } - } - break; - } -#endif - case VM_SUSPEND: - vmsuspend = (struct vm_suspend *)data; - error = vm_suspend(sc->vm, vmsuspend->how); - break; - case VM_REINIT: - error = vm_reinit(sc->vm); - break; - case VM_STAT_DESC: { - statdesc = (struct vm_stat_desc *)data; - error = vmm_stat_desc_copy(statdesc->index, - statdesc->desc, sizeof(statdesc->desc)); - break; - } -#ifdef COMPAT_FREEBSD13 - case VM_STATS_OLD: - vmstats_old = (struct vm_stats_old *)data; - getmicrotime(&vmstats_old->tv); - error = vmm_stat_copy(vcpu, 0, - nitems(vmstats_old->statbuf), - &vmstats_old->num_entries, - vmstats_old->statbuf); - break; -#endif - case VM_STATS: { - vmstats = (struct vm_stats *)data; - getmicrotime(&vmstats->tv); - error = vmm_stat_copy(vcpu, vmstats->index, - nitems(vmstats->statbuf), - &vmstats->num_entries, vmstats->statbuf); - break; - } - case VM_PPTDEV_MSI: - pptmsi = (struct vm_pptdev_msi *)data; - error = ppt_setup_msi(sc->vm, - pptmsi->bus, pptmsi->slot, pptmsi->func, - pptmsi->addr, pptmsi->msg, - pptmsi->numvec); - break; - case VM_PPTDEV_MSIX: - pptmsix = (struct vm_pptdev_msix *)data; - error = ppt_setup_msix(sc->vm, - pptmsix->bus, pptmsix->slot, - pptmsix->func, pptmsix->idx, - pptmsix->addr, pptmsix->msg, - pptmsix->vector_control); - break; - case VM_PPTDEV_DISABLE_MSIX: - pptdev = (struct vm_pptdev *)data; - error = ppt_disable_msix(sc->vm, pptdev->bus, pptdev->slot, - pptdev->func); - break; - case VM_MAP_PPTDEV_MMIO: - pptmmio = (struct vm_pptdev_mmio *)data; - error = ppt_map_mmio(sc->vm, pptmmio->bus, pptmmio->slot, - pptmmio->func, pptmmio->gpa, pptmmio->len, - pptmmio->hpa); - break; - case VM_UNMAP_PPTDEV_MMIO: - pptmmio = (struct vm_pptdev_mmio *)data; - error = ppt_unmap_mmio(sc->vm, pptmmio->bus, pptmmio->slot, - pptmmio->func, pptmmio->gpa, pptmmio->len); - break; - case VM_BIND_PPTDEV: - pptdev = (struct vm_pptdev *)data; - error = vm_assign_pptdev(sc->vm, pptdev->bus, pptdev->slot, - pptdev->func); - break; - case VM_UNBIND_PPTDEV: - pptdev = (struct vm_pptdev *)data; - error = vm_unassign_pptdev(sc->vm, pptdev->bus, pptdev->slot, - pptdev->func); - break; - case VM_INJECT_EXCEPTION: - vmexc = (struct vm_exception *)data; - error = vm_inject_exception(vcpu, - vmexc->vector, vmexc->error_code_valid, vmexc->error_code, - vmexc->restart_instruction); - break; - case VM_INJECT_NMI: - error = vm_inject_nmi(vcpu); - break; - case VM_LAPIC_IRQ: - vmirq = (struct vm_lapic_irq *)data; - error = lapic_intr_edge(vcpu, vmirq->vector); - break; - case VM_LAPIC_LOCAL_IRQ: - vmirq = (struct vm_lapic_irq *)data; - error = lapic_set_local_intr(sc->vm, vcpu, vmirq->vector); - break; - case VM_LAPIC_MSI: - vmmsi = (struct vm_lapic_msi *)data; - error = lapic_intr_msi(sc->vm, vmmsi->addr, vmmsi->msg); - break; - case VM_IOAPIC_ASSERT_IRQ: - ioapic_irq = (struct vm_ioapic_irq *)data; - error = vioapic_assert_irq(sc->vm, ioapic_irq->irq); - break; - case VM_IOAPIC_DEASSERT_IRQ: - ioapic_irq = (struct vm_ioapic_irq *)data; - error = vioapic_deassert_irq(sc->vm, ioapic_irq->irq); - break; - case VM_IOAPIC_PULSE_IRQ: - ioapic_irq = (struct vm_ioapic_irq *)data; - error = vioapic_pulse_irq(sc->vm, ioapic_irq->irq); - break; - case VM_IOAPIC_PINCOUNT: - *(int *)data = vioapic_pincount(sc->vm); - break; - case VM_SET_KERNEMU_DEV: - case VM_GET_KERNEMU_DEV: { - mem_region_write_t mwrite; - mem_region_read_t mread; - bool arg; - - kernemu = (void *)data; - - if (kernemu->access_width > 0) - size = (1u << kernemu->access_width); - else - size = 1; - - if (kernemu->gpa >= DEFAULT_APIC_BASE && kernemu->gpa < DEFAULT_APIC_BASE + PAGE_SIZE) { - mread = lapic_mmio_read; - mwrite = lapic_mmio_write; - } else if (kernemu->gpa >= VIOAPIC_BASE && kernemu->gpa < VIOAPIC_BASE + VIOAPIC_SIZE) { - mread = vioapic_mmio_read; - mwrite = vioapic_mmio_write; - } else if (kernemu->gpa >= VHPET_BASE && kernemu->gpa < VHPET_BASE + VHPET_SIZE) { - mread = vhpet_mmio_read; - mwrite = vhpet_mmio_write; - } else { - error = EINVAL; - break; - } - - if (cmd == VM_SET_KERNEMU_DEV) - error = mwrite(vcpu, kernemu->gpa, - kernemu->value, size, &arg); - else - error = mread(vcpu, kernemu->gpa, - &kernemu->value, size, &arg); - break; - } - case VM_ISA_ASSERT_IRQ: - isa_irq = (struct vm_isa_irq *)data; - error = vatpic_assert_irq(sc->vm, isa_irq->atpic_irq); - if (error == 0 && isa_irq->ioapic_irq != -1) - error = vioapic_assert_irq(sc->vm, - isa_irq->ioapic_irq); - break; - case VM_ISA_DEASSERT_IRQ: - isa_irq = (struct vm_isa_irq *)data; - error = vatpic_deassert_irq(sc->vm, isa_irq->atpic_irq); - if (error == 0 && isa_irq->ioapic_irq != -1) - error = vioapic_deassert_irq(sc->vm, - isa_irq->ioapic_irq); - break; - case VM_ISA_PULSE_IRQ: - isa_irq = (struct vm_isa_irq *)data; - error = vatpic_pulse_irq(sc->vm, isa_irq->atpic_irq); - if (error == 0 && isa_irq->ioapic_irq != -1) - error = vioapic_pulse_irq(sc->vm, isa_irq->ioapic_irq); - break; - case VM_ISA_SET_IRQ_TRIGGER: - isa_irq_trigger = (struct vm_isa_irq_trigger *)data; - error = vatpic_set_irq_trigger(sc->vm, - isa_irq_trigger->atpic_irq, isa_irq_trigger->trigger); - break; - case VM_MMAP_GETNEXT: - mm = (struct vm_memmap *)data; - error = vm_mmap_getnext(sc->vm, &mm->gpa, &mm->segid, - &mm->segoff, &mm->len, &mm->prot, &mm->flags); - break; - case VM_MMAP_MEMSEG: - mm = (struct vm_memmap *)data; - error = vm_mmap_memseg(sc->vm, mm->gpa, mm->segid, mm->segoff, - mm->len, mm->prot, mm->flags); - break; - case VM_MUNMAP_MEMSEG: - mu = (struct vm_munmap *)data; - error = vm_munmap_memseg(sc->vm, mu->gpa, mu->len); - break; -#ifdef COMPAT_FREEBSD12 - case VM_ALLOC_MEMSEG_FBSD12: - error = alloc_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg_fbsd12 *)0)->name)); - break; -#endif - case VM_ALLOC_MEMSEG: - error = alloc_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg *)0)->name)); - break; -#ifdef COMPAT_FREEBSD12 - case VM_GET_MEMSEG_FBSD12: - error = get_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg_fbsd12 *)0)->name)); - break; -#endif - case VM_GET_MEMSEG: - error = get_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg *)0)->name)); - break; - case VM_GET_REGISTER: - vmreg = (struct vm_register *)data; - error = vm_get_register(vcpu, vmreg->regnum, &vmreg->regval); - break; - case VM_SET_REGISTER: - vmreg = (struct vm_register *)data; - error = vm_set_register(vcpu, vmreg->regnum, vmreg->regval); - break; - case VM_SET_SEGMENT_DESCRIPTOR: - vmsegdesc = (struct vm_seg_desc *)data; - error = vm_set_seg_desc(vcpu, - vmsegdesc->regnum, - &vmsegdesc->desc); - break; - case VM_GET_SEGMENT_DESCRIPTOR: - vmsegdesc = (struct vm_seg_desc *)data; - error = vm_get_seg_desc(vcpu, - vmsegdesc->regnum, - &vmsegdesc->desc); - break; - case VM_GET_REGISTER_SET: - vmregset = (struct vm_register_set *)data; - if (vmregset->count > VM_REG_LAST) { - error = EINVAL; - break; - } *** 1979 LINES SKIPPED *** From nobody Mon Aug 26 18:58:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt0Lz0kZ9z5TR9X; Mon, 26 Aug 2024 18:58: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 4Wt0Ly5jTwz4FfY; Mon, 26 Aug 2024 18:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dsnhcOjM6SHp14UvjKdEBQc/MYgq+J7Ihnbcsa6L7jw=; b=AnfAvrGAnR67C3Bmm5Wvkaf5xYs7hkhSHavXb8B6jB2BxzdvkLKOy9TakkSQkGedmQ6OBX v9b0w0kruTFJzSycbPofnw0RBJ0qzcmwKvrV8oMPFiHGHJ36QBPIF3kYGAmA8UtskrxUk0 w82tAxN08J82X1yOgAtfA38ccup50qko10ygQsw8jNtEqfKLQT1DIzPxB7lJoVVv1EucvZ CDLinCswR5BXNW5wdM68mzhHtB7iydftzuCz9sCMxIUOiig/8uYWya9swHB68rUztJgwgu X2mNgmD9ZywLbC0rpIAqxvzbTV+gytAks1Kn2kGGeFwZ26yfv18+ZjNbgq0jNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724698714; a=rsa-sha256; cv=none; b=Te62IJb3eI3xJaFHiTufhsj3BFuEqIByVx/xiHvUbLUipS8n4R9aKtsS89nWxw0/zqCpic hYF7Y9sCImLY8zztI5EdphAEGxfgMqAX3YZ2zyKyN7yJtm169M4keE+pamUuMQRcAOSakG TK19po+7vqEOUR7JJ1Jrr49BOg8KwSETkKi2qXUfkuztovkBJbFIk04qpaN1/RQa99KuIw 1yyKm471CT81K1amk/lC04hN73eIVpkObpNXIwL++vOOVn7PZkFbM61GqA1NJ0lBVmDpqR fKEJnqaRJUufp/fD4EW8gu4odJnvOwI8jiNyMKIyoelsFmdXL58EQZz8XCQ1CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724698714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dsnhcOjM6SHp14UvjKdEBQc/MYgq+J7Ihnbcsa6L7jw=; b=TDfOqi+tWOxI9kGi/2a2kP7u1KYf6M8LD7icLFsxnszz4XIFMLiYQpKOviGMAw5PmAOlbR 0ZXcE25xcZVyzeLMIBsZspDwOM1bHVibtJk7QblaxBvkEtrszpKxkSLzzaN0bBx2S+AFQt JkACCe3prLqAVONi76TuXCPdpnLHFLV4FCIADQnSjWN/dZwb9neoECo6cwPRpLeMF08nca m1BZ2PbIOPxlOidPYKAwN4sCIrRrpoRO7KQn/MP1PpXBO0j8Tg4gz6EwjA9RoahlHmK1We meKNcx/MfzGbJ2Yg8AZ3N25yUlPwPLA6krzoXZN9i4obKvpzDzGwOsWzLPUU6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt0Ly5KlLzJZ7; Mon, 26 Aug 2024 18:58: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 47QIwYWd027741; Mon, 26 Aug 2024 18:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QIwYsq027738; Mon, 26 Aug 2024 18:58:34 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:58:34 GMT Message-Id: <202408261858.47QIwYsq027738@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: e12b6aaf0d51 - main - vmm: Move compat ioctl definitions to vmm_dev.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e12b6aaf0d515dede86001c544024e791a968707 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e12b6aaf0d515dede86001c544024e791a968707 commit e12b6aaf0d515dede86001c544024e791a968707 Author: Mark Johnston AuthorDate: 2024-08-26 18:42:13 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 18:42:13 +0000 vmm: Move compat ioctl definitions to vmm_dev.c There is no reason to keep them in vmm_dev.h. No functional change intended. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46432 --- sys/amd64/include/vmm_dev.h | 11 ----------- sys/dev/vmm/vmm_dev.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h index a007ce5515a5..5f347e46b9c4 100644 --- a/sys/amd64/include/vmm_dev.h +++ b/sys/amd64/include/vmm_dev.h @@ -54,13 +54,6 @@ struct vm_memseg { char name[VM_MAX_SUFFIXLEN + 1]; }; -struct vm_memseg_fbsd12 { - int segid; - size_t len; - char name[64]; -}; -_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); - struct vm_register { int cpuid; int regnum; /* enum vm_reg_name */ @@ -349,12 +342,8 @@ enum { _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #define VM_REINIT \ _IO('v', IOCNUM_REINIT) -#define VM_ALLOC_MEMSEG_FBSD12 \ - _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) #define VM_ALLOC_MEMSEG \ _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg) -#define VM_GET_MEMSEG_FBSD12 \ - _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) #define VM_GET_MEMSEG \ _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg) #define VM_MMAP_MEMSEG \ diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 554583358168..db3e2c992f3b 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -28,6 +28,20 @@ #include #include +#if defined(__amd64__) && defined(COMPAT_FREEBSD12) +struct vm_memseg_fbsd12 { + int segid; + size_t len; + char name[64]; +}; +_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); + +#define VM_ALLOC_MEMSEG_FBSD12 \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) +#define VM_GET_MEMSEG_FBSD12 \ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) +#endif + static int devmem_create_cdev(const char *vmname, int id, char *devmem); struct devmem_softc { From nobody Mon Aug 26 19:58:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt1gY4k6bz5TWTR for ; Mon, 26 Aug 2024 19:58: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 4Wt1gY49Gpz4Lr9; Mon, 26 Aug 2024 19:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724702281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s/87yhH/vVA2RqNMVJrqdkGkWKiK8Xs4VLXl66h8pcs=; b=vl8SFpt2ephb2RliljsZsw6N79bPR4bL8eI1EbKNQw3APcybG4qD2ZuCrz4CzEbfDvWuZd gtCvHsx8FV0hgOSbrUZr1izwlffAyil6hIq+xc5ZondGz8CJlzydGOieyvKGvZwIoYpb7Y OnO8ygCusAj6EUTmY9yszkWvt60FnHCSZitv/5v96VJ6bqYhTod5iDCcmYar7mlg4cQ9sc 5+ZmyV+/g1TXtxtg9b2hdjemMT0H+i2GAXFI6O0QyFM1/YUSQTnSFnEf5/72TcsmhK6ivn o1215EOZQeYtmp9rXdQdWmmq98ljG1UWHMiVNdZnc5aZrCob3+eNNE3FOVd32g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724702281; a=rsa-sha256; cv=none; b=OPzt5jwSq2lzSVPIAiDZi3gXnp1iq4avsyVEv/rCIlW1U3kZNQ1bPys3LuZQuw7WQT0Lly c3x/TggSswG3RZ7BvLWTODzx7r7ztZhfKnxeQeEYQFe5bt1ucddI//QE4f6q0TAEuszRw4 XVJl4RFpdPgD6kgc38Cx+M3iNcG3u3YLcTfh/TBX6isQlHGJa3s7JP5w9lj0WbYs3NWD9o r+p10SVz2htPSuwkiThsRP3tRILkqTJ96HWOERGXMcb1va+N0MW/wH9XNumLxqHFLHVVyr DudNtKfvH9pu2n+lF5QusY/Nk+/kF5JzMxGAwBfjBzfGaYWKQ4w603wGP58ksA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724702281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s/87yhH/vVA2RqNMVJrqdkGkWKiK8Xs4VLXl66h8pcs=; b=vDfnmxwcqarFNEMPF0Ll2FN1cnwQV2pUSjWzWxR5bfMsLA1rHwKSVy9F6JYVd25nd2RwZj PEhJfP3x1zOYB1aXPeKomZ4VX2M1QoMa0+s1t7tg4jNgSneMmH9ZdoG/Ubjm1Oy5znDCJb CtokQOZo0UujQjLFSFsQq8XBFnIEIxKs9rZ0+Y2LVqybAfe8T01svofeJ4CkrnPp8yrAcF liu17CjRc1cci7db/AG5umoGHEX+pNiDdhZ68YE68+Ei7BK1WMS/L2uygy8iRvDxkJp+cb 4v06O1vf3I1QQ2hFjUChr4W3d+3gdD89Qhb8ls+YArielXFQUmiqk8G3knsRag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt1gY3SwxzL3g; Mon, 26 Aug 2024 19:58: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 47QJw1Kr029229; Mon, 26 Aug 2024 19:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QJw1gq029228; Mon, 26 Aug 2024 19:58:01 GMT (envelope-from git) Date: Mon, 26 Aug 2024 19:58:01 GMT Message-Id: <202408261958.47QJw1gq029228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: 259d29fd8c01..657ea345f331 - vendor/sqlite3 - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/vendor/sqlite3 X-Git-Reftype: branch X-Git-Commit: 657ea345f331704c612a35e5a74968bef9ffcfd8 X-Git-Oldrev: 259d29fd8c012d4392fa59ff803b691ead5b304d X-Git-Newrev: 657ea345f331704c612a35e5a74968bef9ffcfd8 Auto-Submitted: auto-generated The branch vendor/sqlite3 has been updated by cy: URL: https://cgit.FreeBSD.org/src/log/?id=259d29fd8c01..657ea345f331 657ea345f331 sqlite3: Vendor import of sqlite3 3.46.1 From nobody Mon Aug 26 19:58:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt1gY52W9z5TWfH for ; Mon, 26 Aug 2024 19:58: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 4Wt1gY4W3qz4LlL; Mon, 26 Aug 2024 19:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724702281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=38esHgkzCleVIF83dDC5HTVxIwyVzMbGVIEfNuGCqm8=; b=r5l8fc657YO0xvfto88BA022O5UBJxL8fxCsx6UHlqyIMpY1OGq5K9OxyvoygRVC5Djye7 GKtj7eudO7ScCHw6otsfHi7S55za7e1DIhDNyhuiJdvRn8fGBIGaWh28DVRS/kI3mb1qgr JiiHoKSChYnSQzg6/eOJ7hLV4jJjxFQy86bSQbtnvVn35QNLAAMY1bbgoCZ2F9TVQJockz 1vgaFmBSDFq8lq20sPZz5rpyvYl5p2PuwikBg0zKYJ5uU87N30VPN6JT8OhBQfsRa7lHs3 oI7ute9nWGfJgRGNn3LYFSBG8wOl+DiQ1FXK9DDCFaWjSOmoxgHAOer8z8fZ3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724702281; a=rsa-sha256; cv=none; b=Aol9Ulmjs8lKay1bPsTEvm3qJNSnYjgP9pxU0Gds4g2amZSley2MS5VLUhh4XYMro1cuFR atvBvy3j2hZFkQp24lelOczV6KOpX3vUuPG3kFyqdnrXdNVG/5ez0Q/4mO7MZ4LWILrgmN OqCGNaUkTbbSShmjmRZQ/RryEmRQW9upZp/7GqdsAE9EQBdV38VYcss5VTisllnFNpzq9p dytA0HM80rj1Gzg4NDitCvKo/6LPnyAhF51hw/kyIBQCGyeQwsoIx6q05QinmN9eQvf9pU 2RFa2CFnHCMqmiDpHR2pLiTLZ0HSS03PdKm0H1jtODkJDHLRwsmI2vIn8P6phA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724702281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=38esHgkzCleVIF83dDC5HTVxIwyVzMbGVIEfNuGCqm8=; b=eofvxQhIO3JQw3EBfXb5YxFoCs1wRRQloJay1jBzsM6pmtKyrPLiujOSKxDR2OT8vzCx/n 9M8XEmryLByG0Ier7eofX5Pz1mQSsu8vDAoDvWcwsiC/cc3BtlZmxZj1Qo3DyUUVvTUpdu Jo/P4LA++iWjiniIALU+fEHSsNM6u7OOUqRX4NAMR+J6AVkQ7ws0gaF8IROzTHItRChvgm CvJg3dSWqmoP6YzHSj0xtA973tl/eezKX9k5dv7HVIDnkhZZyuG3pGYLnKTYzOvJ9ElPA1 Q7zSFXq/C3qeqhDyRkdShLCWRlj3yPvO2WL0d8hAjgebmUJ/OrTHZ1vL+FOvrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt1gY46ZMzKcg; Mon, 26 Aug 2024 19:58: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 47QJw14C029248; Mon, 26 Aug 2024 19:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QJw1kR029247; Mon, 26 Aug 2024 19:58:01 GMT (envelope-from git) Date: Mon, 26 Aug 2024 19:58:01 GMT Message-Id: <202408261958.47QJw1kR029247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: 759262a4d3ee - Create tag vendor/sqlite3/sqlite-3460100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/tags/vendor/sqlite3/sqlite-3460100 X-Git-Reftype: annotated tag X-Git-Commit: 759262a4d3eea4938b5298f8c2a6b73d5a71d523 Auto-Submitted: auto-generated The annotated tag vendor/sqlite3/sqlite-3460100 has been created by cy: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/sqlite3/sqlite-3460100 tag vendor/sqlite3/sqlite-3460100 Tagger: Cy Schubert TaggerDate: 2024-08-26 19:57:35 +0000 sqlite3: Tag 3.46.1 commit 657ea345f331704c612a35e5a74968bef9ffcfd8 Author: Cy Schubert AuthorDate: 2024-08-26 19:55:54 +0000 Commit: Cy Schubert CommitDate: 2024-08-26 19:55:54 +0000 sqlite3: Vendor import of sqlite3 3.46.1 Release notes at https://www.sqlite.org/releaselog/3_46_1.html Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz From nobody Mon Aug 26 20:11:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt1zS5Jx9z5TXVj; Mon, 26 Aug 2024 20:11: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 4Wt1zS4tPZz4NNk; Mon, 26 Aug 2024 20:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724703108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0y4486CdgZbZrSzAuvA1Sp5w071DPkuBXzu1eTFjMiU=; b=GTNjXL7YhMtZoDmLz3140XklSzaL/V2wpfianpIu50pvCMKzF7R/eMXssYVEusNxxnIyZy dImgKTlPo2DiXktm8BM50/i0KNn4ok/YgrDF0+k8OA+GHKF7aTBi3rjJMeeHbPH6svzV1p RlFIftkdnrpoPlUmwag+2RFrpEEwIiT9shpPaAHvA3kjiaGPqmg2kq+gB/dcxIuJluxctH 3JkfsdoKVCkym00MZdg32smbzkFXD+kACTkUPjL/Zs8fsDmr1Zi74YGkBfKzm5I2rmHRaW zrPZx4QluudzTXewVEyvYS9GVKV//1sLk0Nq3asMpOmF0YfOfyEKH5lqH8smLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724703108; a=rsa-sha256; cv=none; b=c1qCK4CipQo6wJWZa0gvEAx6OSdcGy+Ttopky7RamKWR7ZSwWwiJ9J/7qUh/o9Jvg1tzoR u/J+3PrrKlY9PIQiKMsV+q5Otzrqwvvqxv2MncYzwjkAAhCuqQbBF0QMbXIc9Pdok33fFx ewwEMKIoCpnFkPp9Bv7DtClakC7rm0bE/AaXhEyCHLy5Ia6+9c0TjfTngRVv8NoftPCs38 ltfDyPfQZRZIztxvLuzrv8CyttZ2YEhSckaBeQOb/rM2VGZlmvoaoCmlw0p3vH3pibOgwj DN5UCH2/cLfKmeBlzxKQO3VIr3Nd1a89yDynqVaXxstaXLTzoieBvjZKqxP8/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724703108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0y4486CdgZbZrSzAuvA1Sp5w071DPkuBXzu1eTFjMiU=; b=gpPMordsPavu7sgrnNazMGWafybT2Ra8anCAR5hiuMmg9/pRf+WU1A+HFX9sw784R56cEW 8yl5K3VL5hPu+TJzq79eoeXQdP36ln7C8mr+BK5biBXcBa8rROUnI9/Oz4fhc7U4+GcdWg rxTSN3m+3tTGpCTJej7DmbfZNTT6O8ONM2VuwGeP5z7qPCA50Mx36XCcfBFhXnxplr0HBk OKWweN7340T/XkFlZhUJs6qwb/HnHtK21ql3BXCImAtkvmGgnQT2x1wPAvTBSxWy2qL4DK uXsY/rT0kggh0/p27hbzw9Jf4bPJep8CnN6HuyeL8xBZ6W5mn71F3ah/YAMo3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt1zS4V6NzLJY; Mon, 26 Aug 2024 20:11: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 47QKBmJV060717; Mon, 26 Aug 2024 20:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QKBlif060706; Mon, 26 Aug 2024 20:11:47 GMT (envelope-from git) Date: Mon, 26 Aug 2024 20:11:47 GMT Message-Id: <202408262011.47QKBlif060706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: de9468837c92 - main - sqlite3: Vendor import of sqlite3 3.46.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de9468837c92cab304c658480bd32dbe4e022d01 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=de9468837c92cab304c658480bd32dbe4e022d01 commit de9468837c92cab304c658480bd32dbe4e022d01 Merge: e12b6aaf0d51 657ea345f331 Author: Cy Schubert AuthorDate: 2024-08-26 20:00:23 +0000 Commit: Cy Schubert CommitDate: 2024-08-26 20:07:14 +0000 sqlite3: Vendor import of sqlite3 3.46.1 Release notes at https://www.sqlite.org/releaselog/3_46_1.html. Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz MFC after: 1 week Merge commit '657ea345f331704c612a35e5a74968bef9ffcfd8' into sqlite3 contrib/sqlite3/configure | 20 ++--- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 40 +++++----- contrib/sqlite3/sqlite3.c | 154 ++++++++++++++++++++------------------- contrib/sqlite3/sqlite3.h | 6 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 ++--- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 127 insertions(+), 117 deletions(-) From nobody Mon Aug 26 20:25:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt2Gq4wP0z5TYqd; Mon, 26 Aug 2024 20:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt2Gq4R6zz4PNm; Mon, 26 Aug 2024 20:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724703907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+U5n/IvawVB/0wb2hUhn91zxZuS/tq30prxJokcJOeA=; b=szt1f/RsAYcaMqW81S7XXZU/W8sudpGbHFhxw2qhv6UL+Gaj1HnEIiLB2/GFoOwenXYqHT d6yb/8WG8LnbqU7QbZcQEpiv0NeixxqSKCtgC63cN0QasT8zXoqUn6Hl6LhRCKL45QJW8U cFOs2k7c4ojkVeEzAReaRiy8le7PfQId1pCJhkajtkB5XyEeClwRKob5Ry3J8d++Q2WA3z L85wXlTrK3n7gNw2yrlP/2uyEAS+ETZxMRAZZrqX02QhMMPeFReYmO0i/8eHc33wrxNuHx t6E7DyjY7JLH7WKlQdX3+HRBPpIo+pd5nPrcKdNJ8ldqhTUa/1cjshyvEMsgxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724703907; a=rsa-sha256; cv=none; b=H1wJPJuqhPWDzZU3+JAc41GLfDUKGc37Bbc5QXqRiLkO/TUW14eupUVP/k6qN/pdpygeb9 Hy2lOiWBhdUKEhqLBeZNTY8SVTp6p42zLhgDeODGFk9y0bFcnzJ398kifG8NJU5MpI8mBk yAVw309Wlca8zlnEn1BlJSVLtCKT0YOlTK2nf3ybUlIgzLkYCqIa2K745LyyPSmjkIUSBk MebtCl3jlqmcYxQOe5Y1qvjQwaQJ7/WUcO/pilanF1uXYiHvTfik8xSmiE7zuxJcIsnUeH +lAfJModajXo2igr2VCa+YSo9Cp95f12KXbJ8gNJ3WiTHLet6OghEfhYW2ZgKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724703907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+U5n/IvawVB/0wb2hUhn91zxZuS/tq30prxJokcJOeA=; b=SBnGKZPZGAPHPbHoXZwWwb+UKUB0S+vZq+5WWLTGuqVuKGDbxqIvDiBamJhW54iYyo41Yi /7TTGMSwWXmm2aUbo2FZt7t1+WtdRfXjGWN1M3bcSAPRbpMu/2lPC+VZ+gtAFn+5Pw2wsr jvs3f/QzBZco5TlZ5H4Xccuqrev0hDulig6uwdspVi7ASyIV0KId+Llual0LPIvkr65XXg CZP8i3ChA+IpSC+EfJxVjJlasTwTdI2pRMXQU8v21SPhHxhaHV9mqAVh/dBmPN+4B08rtC 3EqKgYRdm2ws9vdlNH8bpNsTdOkhBGlgrkMMtC6CtNM4O3AYMU4y5Qb0ukqyZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt2Gq42fmzL5B; Mon, 26 Aug 2024 20:25: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 47QKP75t080700; Mon, 26 Aug 2024 20:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QKP7VT080697; Mon, 26 Aug 2024 20:25:07 GMT (envelope-from git) Date: Mon, 26 Aug 2024 20:25:07 GMT Message-Id: <202408262025.47QKP7VT080697@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: 85707cfdaddc - main - bhyve: avoid updating fbaddr when vm_mmap_memseg fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85707cfdaddc179af8bd2623091eb1b8c58fed4a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=85707cfdaddc179af8bd2623091eb1b8c58fed4a commit 85707cfdaddc179af8bd2623091eb1b8c58fed4a Author: Pierre Pronchery AuthorDate: 2024-07-24 20:51:20 +0000 Commit: Ed Maste CommitDate: 2024-08-26 20:23:52 +0000 bhyve: avoid updating fbaddr when vm_mmap_memseg fails In the function pci_fbuf_baraddr the field sc->fbaddr was set with a user-controlled value, even though the call to vm_mmap_memseg failed. No security risk as currently sc->fbaddr is not really used in the source code. Reported by: Synacktiv Reviewed by: emaste Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46109 --- usr.sbin/bhyve/pci_fbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c index 798e9b41f0b0..125428e0b772 100644 --- a/usr.sbin/bhyve/pci_fbuf.c +++ b/usr.sbin/bhyve/pci_fbuf.c @@ -231,7 +231,8 @@ pci_fbuf_baraddr(struct pci_devinst *pi, int baridx, int enabled, if (vm_mmap_memseg(pi->pi_vmctx, address, VM_FRAMEBUFFER, 0, FB_SIZE, prot) != 0) EPRINTLN("pci_fbuf: mmap_memseg failed"); - sc->fbaddr = address; + else + sc->fbaddr = address; } } From nobody Mon Aug 26 21:02:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt35X5WHTz5TcP0; Mon, 26 Aug 2024 21:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt35X2zCLz4Rt3; Mon, 26 Aug 2024 21:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724706128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AX0vnQQCeBv3NtQqni7pjOdrN0U2J+OqfuyJR/bjvJU=; b=AMwwQyc48Bb0U81eWLf9SmtGq7wSoTiEHx0gPrlQFs/E5MhhJKYRtqZHTU4YYmz5rNYNik Gah5Qy3jmVV0eADdGVq0Y6GsaJAWrcSuWr3BElStAiUAb0mp4J/A7YJvQX6mwb12QtaxXS 0+jaKYrmc2/R+zegv3whzYDGlMhyTQiajT1tCj2H8jKOVOrseQbeDoQpCHdTgI146rBZHk /+KJxwpW4yCO54gyNXHzIwEy63Gifu7tUfISv2e7B/P2nDBgc0RCPwSpQ3SxZXBM0jAc6l mBygulOObm5z4s/HEfFqyVzbCzwFb5yuipBBrW/g+UJo4jFrV8lf+V1UiZ8pCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724706128; a=rsa-sha256; cv=none; b=wzTO9v/NEsdrCVjpBekVzxCw6eqAWYd2McDyACtriSauA8kOJZsk8vkezk355EF4VjRcm3 MtpcBv0Yr1B3FMX52BfyKTeLJrVEAGK/vFHannivy0xRwYF+/ocoXp/kPWWngba4tmBvii UJ7+23f+hUqttu+rRhuGxFXKoX5IaOkIEfnCOG7X3RUiRvT8Fx6qbbwacQAB253h/iCa/Y O/b9TfdzqYb4sRuW1hBOeJSwJEQe7PxkF+2Si8fVA+HNjPaBAoSlZOGkykyGRw25vrASor 7Qt5uTQaNJGJ3t4ETqevQq9dE+p6yihcPwjcu1KC6U8N3swAg38X1dX92kruMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724706128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AX0vnQQCeBv3NtQqni7pjOdrN0U2J+OqfuyJR/bjvJU=; b=EflH+WI8Q0hN7oImz+V334TVofN9YD6QJasSgLnOR7QoSe4t4iCgpLm7ZSGBDM7SfwsiUD goPUIBCn23ie7HUwNYevAE4PLm+Ao8RlnUaNMyoB3apHX2QoBUbQc7VVxcAZubaoz0fLTT zNk2fHpyUgT0XsLfsL1H7REGDgeqwMrmNxbNSApjB/3/QABZOQQXAks2coEpMHNAu1DBXw 39cMxzgFx+te9kx4iQ9NHGYCCB8kcsKqTaV9rmxex1sBcrZoOpFFRrIKRzLyjWEidDUJIx v58M2YaBI7AqFHF/lrK7rwhK00Za900yH3dxDhzA5ScbPBdkYcjuQu/A3FqyXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt35X2ZXrzMvh; Mon, 26 Aug 2024 21:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QL28gY045051; Mon, 26 Aug 2024 21:02:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QL28YV045048; Mon, 26 Aug 2024 21:02:08 GMT (envelope-from git) Date: Mon, 26 Aug 2024 21:02:08 GMT Message-Id: <202408262102.47QL28YV045048@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: b4dd5ff5f4f1 - main - pkgbase: Avoid hard-coding the package prefix in generate-ucl.sh List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4dd5ff5f4f159a566c64e3348e67c33b80f2bbf Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b4dd5ff5f4f159a566c64e3348e67c33b80f2bbf commit b4dd5ff5f4f159a566c64e3348e67c33b80f2bbf Author: Mark Johnston AuthorDate: 2024-08-26 20:46:53 +0000 Commit: Mark Johnston CommitDate: 2024-08-26 20:49:50 +0000 pkgbase: Avoid hard-coding the package prefix in generate-ucl.sh MFC after: 1 week Sponsored by: Innovate UK --- release/packages/generate-ucl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 27adddad96c0..72db4a3180b8 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -136,7 +136,7 @@ main() { echo 'deps: {' >> ${uclfile} for dep in ${pkgdeps}; do cat <> ${uclfile} - FreeBSD-${dep}: { + ${PKG_NAME_PREFIX}-${dep}: { origin: "base", version: "${PKG_VERSION}" } From nobody Mon Aug 26 23:19:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt68K4LlBz5Tntv; Mon, 26 Aug 2024 23:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt68K3jYzz4b8l; Mon, 26 Aug 2024 23:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724714385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pjh3r2P+/aSVGOXarENhJQLV71tpy7s2sH6jfpw9pEg=; b=DeXDMbpJ5yaKmYy/3ywRvixNp3xzNUkmULOJvFmua8Ve6+CUOX0cxBAQU/tZ/G0NCYQhpH ekzjugJiIiaSnz1HKGYyY7WYvR+0P5MnDaGEw3omMTvulDPYrKFvQZF5HfmQq52Mob9CTi mymNsIDBMeSI0C6n8F5tj91yidWIrqdpKY2DgHzV0CUvae7ivh7cdPipFTTHteKwbaXKT+ L8Rk4CEbC/PsQffOGFK91ojcOOD+j1PDRaTU7XJUMRWoAcS+B27MlAv6G3TBUxuIBh7/Uj xB4ZCMENtcTDZGhZ9dkwudiTdbbbqQ1VfMQIbddetgBMysbmRM6s28dePnjnwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724714385; a=rsa-sha256; cv=none; b=X0mKWLGG0qA69Gm34ILs5ea7Cyh62F/QYCC+ai8Gu/+/GTEQ5On3wSWekJMFD9x/yf3n54 snpXPXmsk0pA9lwmMEJnYq9vGg23dsc1RYxlKHSsgjcOE7su8ZIS5ymT1CHti8qp6kpilV SuSs6uy78+WkM+iABAMOpiFZiBRFBuf30ShnGgjsvtF6oOd8xrmOe5qF43bpuLGBywUg3G V3uIn/Q3e1QDo4fsuQRDr1hiU7qDNO5z4bY6bxP3ZyDlySyL3tQhieIMiNMdkHRcVr/wkc PpXKQVC32ug6xOI9tdsEcQzdW+m6Pdnprluo894JopfskQhMvrvbgcX8q6ZakA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724714385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pjh3r2P+/aSVGOXarENhJQLV71tpy7s2sH6jfpw9pEg=; b=lrNotHZDFWwaxrGq8lsUc9QSHcvUj/kSkPT0uYcMpJjmVUmvyIjdCK7tyGL2OCn449CVhM kGB89Mo3+0MJMBlP/q/9RKHJXAAflO+feUI2+in23vhQPfv8T5CBUg3Legp8c6sBjiaeTS 9Bjd0EVT/9DZXt3XTRGomK5S6M6VX/g9TarnwEjz0VgzVCC7a2lLG6C1czY2IrB5e9teU2 3E5wQ8o92ZpcgaxOsC0RZJWtU7sDcvTp20EnLGZeaXEwOYd6pKNjwB7zPuhSC/em+NWqM9 lUDg+sdl8dBe2T/NsZSb+xfiX3ARuZLNmBT1CY2vb+6y7yzDnVT/TB63WNE2Yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt68K3BKdzQy9; Mon, 26 Aug 2024 23:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QNJjXl068296; Mon, 26 Aug 2024 23:19:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QNJjhq068293; Mon, 26 Aug 2024 23:19:45 GMT (envelope-from git) Date: Mon, 26 Aug 2024 23:19:45 GMT Message-Id: <202408262319.47QNJjhq068293@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: 871911a4ab73 - main - loader.efi(8): beef up the updating the ESP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 871911a4ab738a54a88f3533f553f5eb68c28012 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=871911a4ab738a54a88f3533f553f5eb68c28012 commit 871911a4ab738a54a88f3533f553f5eb68c28012 Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-26 23:19:59 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index cc24b25594f9..a0c0df9a9c35 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 22, 2023 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -355,43 +355,141 @@ The default location for the ESP mount point is documented in The following example shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Tue Aug 27 01:06:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WM4zgJz5Thwf; Tue, 27 Aug 2024 01:06: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 4Wt8WM4F15z4lgn; Tue, 27 Aug 2024 01:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D68kCSJj0nMU4wDA8utXaVuAFB66BrmWDfZ/kpw0rGo=; b=vOkoof4Mx33/ufbqX4+TE2qHWAM4TlB88JvDqrB+FRS0DUN951JXndDz2MstdUb68KR7rk JDHVJN53TMMmfYx1HfXOcDRqF2Q2VhZE+TBvUF5HvrkTIdu3/hu2+HqnBR79Jx3utDG6l/ s2eMrAl1abt4StMTO2BdFY/gxVV56r709fzQwoXWKk5Kc/CzM4du6Kgdv9VC50DfXDQNk4 NSQDe5Vt/qBHvwm4V4DWHUbmHutp6+qo4hK4jQQH2J2RWCoM8sBFiKcoVBM0kZ6DkVZLqM DudgIJf9ZKHu10Ilmk5eCOZrj0PMsZmza6Bjh7ZsxCCcuPdOJRk5A8TbC1jkAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720783; a=rsa-sha256; cv=none; b=oTCmd6RwU84s4sILjQVVCuRIVg8CCqsY7nTmRGY/lMA+ejKpAEL1oQvnYP2/GHvBagIIdP NnOuWQFypSYSn60EHotfK2VHDK+7frhqIjXVPhashUd6pD1C3zpJnYi0h++jXK8Dt+hbjs UWHIcfrpLpZGu4IHQ0aOWjYHSSkqPJqFoIJvsIgO+DEaKuXz1xT7BWEXqDMc9LTOnTmD3y 3MOzW43EM2Uil/tN8EbjTkfWJVubcUIxdkIkIQqeZF4zcG5BZCADm6vlFeKemYkN6EEjxs 6sApQMYXl3Gr6FmmMGYR7qcOseeWr1d40E17uzhSxAUMLxOHujkRaOWdFdsWCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D68kCSJj0nMU4wDA8utXaVuAFB66BrmWDfZ/kpw0rGo=; b=ISB/yJdHQ4VmetlqQ/Z/YrW2Nwreuq/suKJ4YuRDfI28FzWlbYH2MSN1QNHXTU+WvH+/2i yHhFTrQBliIDhMEP4C8IBvTFyJG0DzdVrYi4vxok7kUTZccHGIvcqlqosKHafMbjbkPL2N +YWS0yuHv3b2jLO14m0zs1BC18TmETu1hxvA23BvIcOuSFUPr5PE4LyvVa16SO+esyA9fP jjrowUYevYcuOFs3KRAwv/503KJD0Vo1GVY++tiwzQYMAIEgMGNjztllutXQAgNeppu/ea g+Kir720NeP8eYVwY9N9otVBNML2AaK4EcSUfUKpiYTUxeu/94btyNAG44flDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WM2NPGzTfc; Tue, 27 Aug 2024 01:06: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 47R16N9c056312; Tue, 27 Aug 2024 01:06:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16NAw056309; Tue, 27 Aug 2024 01:06:23 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:23 GMT Message-Id: <202408270106.47R16NAw056309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aaa01ea24d64 - stable/14 - nvmecontrol(8): Fix typo in ns.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaa01ea24d645e096199b4bc4064acf21324631d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aaa01ea24d645e096199b4bc4064acf21324631d commit aaa01ea24d645e096199b4bc4064acf21324631d Author: Yu-Sheng Ma AuthorDate: 2024-01-05 08:11:48 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:17:26 +0000 nvmecontrol(8): Fix typo in ns.c `Insufficient` was spelled wrongly on line 537. Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/997 (cherry picked from commit 69f9c5a51346b1ada4854cb4131e8a63b7dd8b46) --- sbin/nvmecontrol/ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 24f4b6b3d043..27f622162c7d 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -532,7 +532,7 @@ nscontrollers(const struct cmd *f, int argc, char *argv[]) /* * NS MGMT Command specific status values: * 0xa = Invalid Format - * 0x15 = Namespace Insuffience capacity + * 0x15 = Namespace Insufficient capacity * 0x16 = Namespace ID unavailable (number namespaces exceeded) * 0xb = Thin Provisioning Not supported */ From nobody Tue Aug 27 01:06:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WN5fLFz5TjL6; Tue, 27 Aug 2024 01:06: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 4Wt8WN3fQfz4lMy; Tue, 27 Aug 2024 01:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHtnu0K9GXwPyZjeMKDVyMcntGniA1884Jh7Y34JJew=; b=M50SSE8RvmxGo+W2Sr7SoDabCuXIdUj4aUIy56UFbvDkh2V/Ab5DhSr4u29wFwBCWeXoky V/Z0FohRyJpIM0oTSiafaHWsdtoS4IrEmb2nvHklvnPEwUXYQmX4kC9ktRFszlJEy/AAdQ IMG+jkNzsgcDJc7dWVWw4EJcCvjW7uAYad4YV6s7cOFW+Q8tzK/e/YgmnlVSnOevO3NVug IqshpHy7g13tJzfEl1IT7vC5puYaU7m7s82a5HCb0ayeuTuIcZESZLkDJKwwS/5YFdt0+h wTYUuOOfRFqk17M3JyE7y4Ip1B9qInwd7zy6xnWvdQyMvBfGn13WpAtUvkajwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720784; a=rsa-sha256; cv=none; b=tj6mJPDmgReOb1QAygR5J8Ofpo3OM4aMAAgaV0LdF9z0hA3PZbbhGBEDuz2z4NHYA4m1w8 18xRZeQawMpDq8DmZpnYLYsH179WUWOfPZ2d2OfdZ+ZdB3JPwsb+w0+nq5eBbDp0hO909A 0mMy4/fms9oyUwU3YDfs71cMFILsyWooiMCDHQyHwzkVLJzajqCvvr//cRKyChJrishk5z LeFE/jfxerBWlClCqL3zqXHkL52rFx7zZV8TTSx03WqPLcRADEL9wMVjvFZ18rcHKZiAB7 iQqHIaFwvYne3oFBj+FI+UsV0C5x/DiIF/94nFeTSUuDLfpJqVIrCmkf5BupxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHtnu0K9GXwPyZjeMKDVyMcntGniA1884Jh7Y34JJew=; b=NDWbvF4IwQdN6FSV66O+BEf6AYqUP/UHoGWeNrCsQkfdU1XMHrLGjXEwvHnR4RYcnhSqRd 3GvpVu6K+H/5eXmN/h2Q4tB4miOivOUzha6KfoXDPzASc4GfdyjpPtRfFcy8LNn+kzAUJo ZqRthla8floK7AWldQTOVt+4g2AbYnhD56BKBnRyD47OvqTR4VVxd1elu9rzMGTRuSnwYH DbmVrGu8uKm4mTVf9PwdMxxXviu6TyM8TSKf7ahUlq5PykjGT5zU7cuYBPMamzbADYZXlT ngdqmU5qPejGT9U+RB7loBLR8KI8AjueReqHonDuvviyo947YJtymZuv+Q9yjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WN32qYzT9S; Tue, 27 Aug 2024 01:06: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 47R16ORZ056366; Tue, 27 Aug 2024 01:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16OiM056363; Tue, 27 Aug 2024 01:06:24 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:24 GMT Message-Id: <202408270106.47R16OiM056363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 94feb210599a - stable/14 - nvme: Export constants for min and max queue sizes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 94feb210599a358462ad48ccc792ec4d78e03ee3 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=94feb210599a358462ad48ccc792ec4d78e03ee3 commit 94feb210599a358462ad48ccc792ec4d78e03ee3 Author: John Baldwin AuthorDate: 2024-03-23 00:21:20 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:21 +0000 nvme: Export constants for min and max queue sizes These are useful for NVMe over Fabrics. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44441 (cherry picked from commit 1931b75e004f25cf1d2db809bfd9baba40c04521) --- sys/dev/nvme/nvme.h | 7 +++++++ sys/dev/nvme/nvme_private.h | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 137aff792868..ee387d54985e 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -63,6 +63,13 @@ /* Many items are expressed in terms of power of two times MPS */ #define NVME_MPS_SHIFT 12 +/* Limits on queue sizes: See 4.1.3 Queue Size in NVMe 1.4b. */ +#define NVME_MIN_ADMIN_ENTRIES 2 +#define NVME_MAX_ADMIN_ENTRIES 4096 + +#define NVME_MIN_IO_ENTRIES 2 +#define NVME_MAX_IO_ENTRIES 65536 + /* Register field definitions */ #define NVME_CAP_LO_REG_MQES_SHIFT (0) #define NVME_CAP_LO_REG_MQES_MASK (0xFFFF) diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 72797d30a3bf..26dc75ba4141 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -57,9 +57,6 @@ MALLOC_DECLARE(M_NVME); #define NVME_ADMIN_TRACKERS (16) #define NVME_ADMIN_ENTRIES (128) -/* min and max are defined in admin queue attributes section of spec */ -#define NVME_MIN_ADMIN_ENTRIES (2) -#define NVME_MAX_ADMIN_ENTRIES (4096) /* * NVME_IO_ENTRIES defines the size of an I/O qpair's submission and completion @@ -74,11 +71,6 @@ MALLOC_DECLARE(M_NVME); #define NVME_MIN_IO_TRACKERS (4) #define NVME_MAX_IO_TRACKERS (1024) -/* - * NVME_MAX_IO_ENTRIES is not defined, since it is specified in CC.MQES - * for each controller. - */ - #define NVME_INT_COAL_TIME (0) /* disabled */ #define NVME_INT_COAL_THRESHOLD (0) /* 0-based */ From nobody Tue Aug 27 01:06:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WP5kXLz5TjJJ; Tue, 27 Aug 2024 01:06: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 4Wt8WP4vt4z4lN0; Tue, 27 Aug 2024 01:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pQDkyTq+ZxrSOk5og2y69r0zY+JLE+tMegRzzG2Qn+w=; b=JwqiPrtnf2YcM50dR+T8ZSSRPV3O93sdKkAsOQ17MyMV3GlCRNjKD+A7gYckTiGUk5cUZy WO+CsQzow7bgblHW05xwFjG1yD+YBSQe2lE4asNCXfmVwwU/9Vx4EgG9FItq5EcRip9s2C sIg1gZob+SE84brycCKGIa832NqhQcSAcbfaSsHomZDOMyKpMQBqcNFLtu1tm7gwO566P3 iCnsUcASuWsnOzzPLFtawd4afnthrM4BPAd9eknapPou8RRXaeixRKBMLsHQyb3hWB+G0b z1cv3VV23ejOp7kLKLX+81ziwp6sbTYf/+R08urQE8lHUSRx5KaDNS8SdM++ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720785; a=rsa-sha256; cv=none; b=rUOoxfPOAyVt0g253rvJcMeKcJ946jVe5zSZuiJlyg6qijvZfu8Q4Ltii556UxDx0TX8Bq NvxTRl4zj11iRomVvhDblI2Vu/w3LlIRzvj4MU2+3j94YHiYvSoWytDZndn7PVxjJ0uI2Y Kurj4LdqzGEPQHXvK6eItO55DjCZCQoKuWWhBRvxS1V//TLt/sEH442Nqng2ZVYnsbJhfN 8rCe5SRTf8CMgjD6ob0JL0YOiZVHH62cxjOK+ANxEsdMSNZpCh8T0l+0eW8IDN3kgh8nIy OjMuGLTM0V+QG7YTynGF9MZrcj3PTPUxcHolHxwgET6PX9U0yzcRU+nP/rEe6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pQDkyTq+ZxrSOk5og2y69r0zY+JLE+tMegRzzG2Qn+w=; b=U9XMkd6XWsNuLSE9zyUp64KLg/p5Ya7FnLEd/hDLMFSps4xU8OwatF+4d9p5WDmmRSrO5w HLzksPWotinLhGx6nwsL6D8phUosKp/lJfLHyMYO4ilgw8f6WETCWL6hi/SXCFDbK+g7RW DUk0xj1nce7jgl8xaVky+iD7VVcLCqYC/qUkyqcm5k9t7giEH8Ar41Gxo5Wh1wwP0X4G6r SeyWV1TAwhSO8ld6kyQOfQt4+Tbannik14XbCoXDHEK5YUlRUDR4QnAyPJ90skSu8zkneU MYoRMEe0xj/dx6Mqkm7RYL2h2aRRdV8isM/DEdY6QyO7/X5Fe1wZKO4zs1HqoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WP4Q5ZzTjY; Tue, 27 Aug 2024 01:06: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 47R16PIh056428; Tue, 27 Aug 2024 01:06:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16PSA056425; Tue, 27 Aug 2024 01:06:25 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:25 GMT Message-Id: <202408270106.47R16PSA056425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1e066e460403 - stable/14 - nvme: Add SGL structure and constants for use in NVMe commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e066e46040354f244561894911e0938c9ef4df7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e066e46040354f244561894911e0938c9ef4df7 commit 1e066e46040354f244561894911e0938c9ef4df7 Author: John Baldwin AuthorDate: 2024-03-23 00:23:09 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:28 +0000 nvme: Add SGL structure and constants for use in NVMe commands Fabrics capsules use an SGL structure instead of prp1/2 addresses to describe the data buffer used for a command. The SGL structure is added to a union with the existing prp1/2 fields. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44442 (cherry picked from commit f21a54d19080510bce279183f4bf07d5315bd179) --- sys/dev/nvme/nvme.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index ee387d54985e..f00090731dff 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -433,6 +433,25 @@ #define NVME_CTRLR_DATA_VWC_ALL_NO (2) #define NVME_CTRLR_DATA_VWC_ALL_YES (3) +/** SGL Support */ +/* NVM command set SGL support */ +#define NVME_CTRLR_DATA_SGLS_NVM_COMMAND_SET_SHIFT (0) +#define NVME_CTRLR_DATA_SGLS_NVM_COMMAND_SET_MASK (0x3) +#define NVME_CTRLR_DATA_SGLS_KEYED_DATA_BLOCK_SHIFT (2) +#define NVME_CTRLR_DATA_SGLS_KEYED_DATA_BLOCK_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_BIT_BUCKET_SHIFT (16) +#define NVME_CTRLR_DATA_SGLS_BIT_BUCKET_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_CONTIG_MPTR_SHIFT (17) +#define NVME_CTRLR_DATA_SGLS_CONTIG_MPTR_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_OVERSIZED_SHIFT (18) +#define NVME_CTRLR_DATA_SGLS_OVERSIZED_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_MPTR_SGL_SHIFT (19) +#define NVME_CTRLR_DATA_SGLS_MPTR_SGL_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_ADDRESS_AS_OFFSET_SHIFT (20) +#define NVME_CTRLR_DATA_SGLS_ADDRESS_AS_OFFSET_MASK (0x1) +#define NVME_CTRLR_DATA_SGLS_TRANSPORT_DATA_BLOCK_SHIFT (21) +#define NVME_CTRLR_DATA_SGLS_TRANSPORT_DATA_BLOCK_MASK (0x1) + /** namespace features */ /* thin provisioning */ #define NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT (0) @@ -674,6 +693,38 @@ struct nvme_registers { _Static_assert(sizeof(struct nvme_registers) == 0x1008, "bad size for nvme_registers"); +#define NVME_SGL_SUBTYPE_SHIFT (0) +#define NVME_SGL_SUBTYPE_MASK (0xF) +#define NVME_SGL_TYPE_SHIFT (4) +#define NVME_SGL_TYPE_MASK (0xF) + +#define NVME_SGL_TYPE(type, subtype) \ + ((subtype) << NVME_SGL_SUBTYPE_SHIFT | (type) << NVME_SGL_TYPE_SHIFT) + +enum nvme_sgl_type { + NVME_SGL_TYPE_DATA_BLOCK = 0x0, + NVME_SGL_TYPE_BIT_BUCKET = 0x1, + NVME_SGL_TYPE_SEGMENT = 0x2, + NVME_SGL_TYPE_LAST_SEGMENT = 0x3, + NVME_SGL_TYPE_KEYED_DATA_BLOCK = 0x4, + NVME_SGL_TYPE_TRANSPORT_DATA_BLOCK = 0x5, +}; + +enum nvme_sgl_subtype { + NVME_SGL_SUBTYPE_ADDRESS = 0x0, + NVME_SGL_SUBTYPE_OFFSET = 0x1, + NVME_SGL_SUBTYPE_TRANSPORT = 0xa, +}; + +struct nvme_sgl_descriptor { + uint64_t address; + uint32_t length; + uint8_t reserved[3]; + uint8_t type; +}; + +_Static_assert(sizeof(struct nvme_sgl_descriptor) == 16, "bad size for nvme_sgl_descriptor"); + struct nvme_command { /* dword 0 */ uint8_t opc; /* opcode */ @@ -690,11 +741,14 @@ struct nvme_command { /* dword 4-5 */ uint64_t mptr; /* metadata pointer */ - /* dword 6-7 */ - uint64_t prp1; /* prp entry 1 */ - - /* dword 8-9 */ - uint64_t prp2; /* prp entry 2 */ + /* dword 6-9 */ + union { + struct { + uint64_t prp1; /* prp entry 1 */ + uint64_t prp2; /* prp entry 2 */ + }; + struct nvme_sgl_descriptor sgl; + }; /* dword 10-15 */ uint32_t cdw10; /* command-specific */ From nobody Tue Aug 27 01:06:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WR0T6wz5TjNT; Tue, 27 Aug 2024 01:06: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 4Wt8WQ5zZlz4lXq; Tue, 27 Aug 2024 01:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ourddm0P6v8x53oOjZad8j7YceyPjIqS/uHFOlg5Zfk=; b=rUE+tAzUAGNy2iKzUzK0X5m3NFvGBXuhzYSGyqtFLW99+AdUg6+ILs+Y7a5HuKfHlcWOGR JXM3jzvqG04jMBGKVVNQ/yiGw/8nPsfHa7vAXDoZv+cIb27w6YIMTKnB5U8ZsX0Hggp+un Si7F+HbOGwrlcAlIgxtgs6mGZpHAfn+u+V/7FLnEe3L5MjNrYNXLqAL0WPiFN/fSK68Orc JYhmoyaPM+7EEL/v2aXG3+Y3bfZZYD179jqmDkedhBlkPCkA42Pbs3TI1RwgUDwsp/rRRR r+5oN7ItUx4ww6xH6ZucmrvoSEIzfySE2Rieqj8CWIX8vjQ1+kPwanuiQFmJ3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720786; a=rsa-sha256; cv=none; b=YkeOl5bOaDob6H64qE4Gr8DwOB7PYDyHQs3ImouA+xl5CKJ7bBN4f9c7s+thMvw8YKsboF PX4AZx/GwQ4w3ScKmBPCEPVqkjRsRr4Mokov+h5iokGAA2r98Zevjrtr2JD1FGU03UwjMY IcOo9EuScQdNNMGHI9ioeqouk49KVvC/sbhe/Z+EaOWJ2VmDoddvAiJ7lz4DzYPPgUQ+af +q6f+Mk0aPySxLWNGkWeHw9bDMMQp0C/oW680650QekIP+nOJfHxrzEPHN0VfsXLIx9yx2 O4WT+q6X2NxJWWLKgDW2BcA4YN38gLJyjI9Gnn6BHm3xQuqiis1AUg2fbC0Ddw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ourddm0P6v8x53oOjZad8j7YceyPjIqS/uHFOlg5Zfk=; b=tGgpcs68OUP2pMbfoV5SUpHMl/g/nQZ24TpaKjXWKhNt3wR1MPC0Sbru4+JHwtF6v/TrEj dYNPekL1GtvAYBTk8sZYpB+Qi0TuLqK+ps+rMt8aS5hC3u2cu2NNHJU7C9qnPXDuDSUvPE aXkO3nIlZ846xgEPvc0u7B+QZmCKHhH9mXu3/gfbGi7Ymv4m81AdkA1hPEiOImPuHhzCBb CYb3mUkwbNxvKknQUsBMHDaw9JrA0gjdYLX6pn9VCB4S3YIeoMIWiq/VdERYKzNITJtgqf 4wE3r8N9wv9vI6K+H7UUny/ZrLsXZIIhT5qVGG/uNTv7nINxIae+G8AllkTOsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WQ4hBVzTfd; Tue, 27 Aug 2024 01:06: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 47R16Qib056483; Tue, 27 Aug 2024 01:06:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Q1t056480; Tue, 27 Aug 2024 01:06:26 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:26 GMT Message-Id: <202408270106.47R16Q1t056480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: da548abbc35c - stable/14 - nvme: Add constants for the PSDT field in cdw0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: da548abbc35c86d4f504c5392ce79ec1c67bd432 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=da548abbc35c86d4f504c5392ce79ec1c67bd432 commit da548abbc35c86d4f504c5392ce79ec1c67bd432 Author: John Baldwin AuthorDate: 2024-03-23 00:23:24 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:36 +0000 nvme: Add constants for the PSDT field in cdw0 This is not used in nvme(4) but is used in NVMe over Fabrics transports which use SGLs to describe buffers instead of PRPs. While here, adjust the shift value for the FUSE field to be relative to the 'fuse' member of 'struct nvme_command'. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44443 (cherry picked from commit b8cb8dd3625d7396ea98152d89e1e64b16e77bc6) --- sys/dev/nvme/nvme.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index f00090731dff..04eec1ff0917 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -211,9 +211,18 @@ /* Command field definitions */ -#define NVME_CMD_FUSE_SHIFT (8) +#define NVME_CMD_FUSE_SHIFT (0) #define NVME_CMD_FUSE_MASK (0x3) +enum nvme_psdt { + NVME_PSDT_PRP = 0x0, + NVME_PSDT_SGL = 0x1, + NVME_PSDT_SGL_MPTR = 0x2 +}; +#define NVME_CMD_PSDT_SHIFT (6) +#define NVME_CMD_PSDT_MASK (0x3) + + #define NVME_STATUS_P_SHIFT (0) #define NVME_STATUS_P_MASK (0x1) #define NVME_STATUS_SC_SHIFT (1) From nobody Tue Aug 27 01:06:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WS0vxMz5ThsX; Tue, 27 Aug 2024 01:06: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 4Wt8WR6cy4z4lbD; Tue, 27 Aug 2024 01:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVUo2CACrmF+ah+32QCEsRTJHEotcNozZBcZqCZfQh4=; b=YM1AK+ncM8plcfwyAcutLPvEn8XJ99TmU9hTdb6iFAsnm4FTGwrDnJutuKV73JyxUfn/sr xKeLGGzPfKDEAm9fluK7BOtZ//ZuV+RprReOih+LRPINQAZj/l9Gn3yi6TKvr140hS5tV0 loDFmQLk03PEJsmT8iqRfS5NijKGcQMxPE10GvPQvW6XQBZ3tk9PKE+DwB0v4wmpQ/oEnW wXe5YIx8mznjK0H3NzCx7KN1DeJfRoRJyvAobE1SbugRzVflO/ywU9KOHehfLvdfGi4tjE yW7wXb27XE2LUbQa1EYdjZ6N5KuHYbLXlQEM9l9lBMzEI45FWusWt2tZWeDFew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720787; a=rsa-sha256; cv=none; b=sjoNg2nc0Fqi+eZyV6Ja2LVtQAt0DM8utvrOZUKFe19A1zzh2Oi41jsvT+4uLkqCTiCSZB lGPXcJmBrHxZgmKIJPy2bIJRWq0Uc9aDzGY1E2xYGzyAD82gLv37vOaC3Lh9W6i+fwWozQ WmR6ovXCRZaW+yuTdK8hcKl7FWG7YSqLQ01FQicIJd3n01CcnvbsC2iC2iNyoZCDbF6YUg yEOp9jtnGd6HxsPx6c4LOL4837CDHFT+Vbx+dy+wm6yrTQwJgLza07ER1UVA/QyRGv6dMo nwjMSvvTiXlzqsy1D3a3g0EMhRoo2iMtF828/x2jUnqkTxhMiJPL4u8PaKIHyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVUo2CACrmF+ah+32QCEsRTJHEotcNozZBcZqCZfQh4=; b=k9zxbqz+iGmqYqP4/E/AzAO5PPOlBGjnBO4cLaqZIlJrl2TIKuzxK9qtznB/ht4i9Dwu3/ r4KxmiFJoo5hYMSa3raspv6QwHR0zPVB46E4sMuZmDGPItvMg3Al7kNL+hWC2rrg9hBd9v o/BqRadYocZJYsnGbJwGcOgb5UKoy/JUPeQdygevjrYpzkNr2qoe8swc50gNam+QF+igQS IMwcVWOOw+WiJ+mDxQzuAOoP3fSLG1lBubKbDNCXzMuBsTVCv04rcR5ejRFrR4XZpEQBVQ n2jCRyp/jU6j4K8yso7nd0N9oz4xgadX4rmeNeX3r/LrgV+hmm8hfbuRqHo6pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WR5fQJzV3m; Tue, 27 Aug 2024 01:06: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 47R16RTd056550; Tue, 27 Aug 2024 01:06:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16RlT056547; Tue, 27 Aug 2024 01:06:27 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:27 GMT Message-Id: <202408270106.47R16RlT056547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ae2a9307b5ea - stable/14 - nvme: Add constants for the extended data for Get Log Page command flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ae2a9307b5ea306cb4316f35c9c4d1d9105b56f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ae2a9307b5ea306cb4316f35c9c4d1d9105b56f8 commit ae2a9307b5ea306cb4316f35c9c4d1d9105b56f8 Author: John Baldwin AuthorDate: 2024-03-23 00:23:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:42 +0000 nvme: Add constants for the extended data for Get Log Page command flag nvme(4) doesn't check this flag, but Fabrics implementations may need to set this flag in the log page attributes cdata field. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44444 (cherry picked from commit cbda1886ab1cd3ec2847b7da5136d3bb68d56101) --- sys/dev/nvme/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 04eec1ff0917..70d293cf278e 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -358,6 +358,9 @@ enum nvme_psdt { /* per namespace smart/health log page */ #define NVME_CTRLR_DATA_LPA_NS_SMART_SHIFT (0) #define NVME_CTRLR_DATA_LPA_NS_SMART_MASK (0x1) +/* extended data for Get Log Page command */ +#define NVME_CTRLR_DATA_LPA_EXT_DATA_SHIFT (2) +#define NVME_CTRLR_DATA_LPA_EXT_DATA_MASK (0x1) /** AVSCC - admin vendor specific command configuration */ /* admin vendor specific commands use spec format */ From nobody Tue Aug 27 01:06:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WT1tPlz5TjLD; Tue, 27 Aug 2024 01:06: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 4Wt8WT0QPmz4lSb; Tue, 27 Aug 2024 01:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzsEaML/NTkpEDiR/taIqdnPctgtLDK0DMYmruSl1bk=; b=qo1Lf39tn379kR8UW6mKDwo0btUyegLjQy1J6uX3uDta3ogU9yXsxixYKEn45TxEdfeWDH AxJx+wnW4CeFY+RsqIJ1R7CjvyEIJWc4IhdodaR+V8AbEKedyxLnHVDxztfFp3T6tH3Ej5 RzwOWSQlCpBL7Npofo4vHUMhrmlMLQxEfrV4Zx8mja8dCjZIlw0MOOASHgwCmrzDFx4k8D +o9do9y0qfSMGnhs0I0QutZ3iAhu3Gul5Xc+tZItvEvXGE+sn9buckt2eu2lp/2guKRakM 7tO/Ei9GbYIoQuvYoaTJvsRFjmAa7fPRv+Mlqf6KVa2sARs/gnXJNfTsGVjv0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720789; a=rsa-sha256; cv=none; b=BytW5zgRy4fabCOsQriMYpP4sHaEILn+F8Lnzjr6E+K/5iwailLkDuqJt2AUSaN+GXeVXQ BoIL0TuwWH20DNQTs05zdpXnW7gPq+pm4tSFREfY9Ltju/ywT3/suvV+RA9mz+mClDbhmX hzixB9leD++lwE+NqGL1i/CSAABkLl5YQ+/jTMc8IJUgKBTPNHCH5OSqZzeDq+ZwgO3X+x 8HzvKU4kscSl1qV1iEp7cfzMnWJZ1KxfphH2E54Zsi6jzUwdw+/3m45tjsrF2yJbh6heHS P2WWHfEdH9IwW9x5bzOOzyoKVxi5Rihes1O2cBHg2Xh2Dl6w0A19LYPQ35ucOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HzsEaML/NTkpEDiR/taIqdnPctgtLDK0DMYmruSl1bk=; b=P8sUyofEMwixKMwUtQxcnQF52A98voT9CAA9b+/WTA+c4RuF13MPYJxyAIXeMjZJxfmZ0m wfI3nNdhIml4NZ3yAQfN1ClMzPXPNQxvIILKyHvOn2gqBOiUFfGk8cfPBDffzbwj55VRK2 MgnoGU5Jx2TUtvygLNML+DkAFjuJD3bBNXj7zG8oMchzLTpMLRB1HMgyFdmoZVS4rh1GTQ 0sIcDxhRwkg8TxaYt1B2HWxJ8UV7J2y5/PHklnl/L3NCpQsWF4X3mLNk6Ae5V8kTekkDc0 98cw0Cu4ncjLSBp/spMIXN1m9mAvKss4jxwyiNdxQFfCJxSqOd8xUY1uxgV3QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WS6byKzTff; Tue, 27 Aug 2024 01:06: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 47R16SBm056609; Tue, 27 Aug 2024 01:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16SnF056606; Tue, 27 Aug 2024 01:06:28 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:28 GMT Message-Id: <202408270106.47R16SnF056606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 41f61bf23024 - stable/14 - nvme: Add constants for fields in AER completion dword 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 41f61bf230243361b8375ce19d45eb01f139014d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=41f61bf230243361b8375ce19d45eb01f139014d commit 41f61bf230243361b8375ce19d45eb01f139014d Author: John Baldwin AuthorDate: 2024-03-23 00:24:06 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:48 +0000 nvme: Add constants for fields in AER completion dword 0 Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44445 (cherry picked from commit b354bb04cb51f373e997cb8911c32dc93243c1d7) --- sys/dev/nvme/nvme.h | 8 ++++++++ sys/dev/nvme/nvme_ctrlr.c | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 70d293cf278e..b738ab902f89 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -642,6 +642,14 @@ enum nvme_critical_warning_state { #define NVME_FEAT_SET_FID_SHIFT (0) #define NVME_FEAT_SET_FID_MASK (0xff) +/* Async Events */ +#define NVME_ASYNC_EVENT_TYPE_SHIFT (0) +#define NVME_ASYNC_EVENT_TYPE_MASK (0x7) +#define NVME_ASYNC_EVENT_INFO_SHIFT (8) +#define NVME_ASYNC_EVENT_INFO_MASK (0xff) +#define NVME_ASYNC_EVENT_LOG_PAGE_ID_SHIFT (16) +#define NVME_ASYNC_EVENT_LOG_PAGE_ID_MASK (0xff) + /* Helper macro to combine *_MASK and *_SHIFT defines */ #define NVMEM(name) (name##_MASK << name##_SHIFT) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 0004895d6691..52e412c5202a 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -794,10 +794,11 @@ nvme_ctrlr_async_event_cb(void *arg, const struct nvme_completion *cpl) } /* Associated log page is in bits 23:16 of completion entry dw0. */ - aer->log_page_id = (cpl->cdw0 & 0xFF0000) >> 16; + aer->log_page_id = NVMEV(NVME_ASYNC_EVENT_LOG_PAGE_ID, cpl->cdw0); nvme_printf(aer->ctrlr, "async event occurred (type 0x%x, info 0x%02x," - " page 0x%02x)\n", (cpl->cdw0 & 0x07), (cpl->cdw0 & 0xFF00) >> 8, + " page 0x%02x)\n", NVMEV(NVME_ASYNC_EVENT_TYPE, cpl->cdw0), + NVMEV(NVME_ASYNC_EVENT_INFO, cpl->cdw0), aer->log_page_id); if (is_log_page_id_valid(aer->log_page_id)) { From nobody Tue Aug 27 01:06:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WV4WDhz5TjQt; Tue, 27 Aug 2024 01:06: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 4Wt8WV1NfDz4lSq; Tue, 27 Aug 2024 01:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c4CwoUaXihNKWnfBf+hSqNRQ3vAWdwJTxopvDGs5eGA=; b=VzvDuZMbVz4YtCpw9v351k2nLZvUgCwZIe3h2qhDkHFO2bH1HFkImtvejvsUgGee3t1FII c6fmt/BA4lTIvUvUkD6kofv/bphO+7SAWv63Or0LpcX7yU1kytjfxYuS8+JHfX/rzLQjkV k1/1daR/rUh7oa9xDHebv97/ezRCCNnXZJEU8PPbFNoYdRDdDXxCTXTuFu+Hpd6oO+1OYh 9dFjxc0kER8NoftiziapORMkkXBR0Zq8kx4dWXCHlFflqAVD7F2YX9tdHhY5Hi6ri4Nbn0 WhgDGSVA+/clh9rmzb+KbelasSBPLpXgJ4pO9Speh+nYF5UZpSq2Ym9oY+b48A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720790; a=rsa-sha256; cv=none; b=f6LfXG6d+Dh4YkHtZ3+UMu3RU8xW7GITCvJ1qvSqNV3I4AZFmfjRf5hkhrF4DCKGnzKrNO tLAPzahaHTpUvfmptKgWp7qLqaCQkDdjF9YXv+KL4ItdxjMWbQXhqSeBEDE2W3QUECDzY3 kEK6bDMFd8cft72CxQYLvnr97nSu7/iYavXzRRKdGOvK7jdzrfymDp4fZa2vMCLPs96J4H UyevdViFrFchltmLdt6r5OiaGb7S5imPDeXkDwBHl80Ntxg0/2M3HYC8zXTkWdyDxAlinS uu43sdZH/0DhZ34GOpaRj2sd0tb5rEtN0E5qyugNCHF7SDMTTfl5/INxfyVSGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c4CwoUaXihNKWnfBf+hSqNRQ3vAWdwJTxopvDGs5eGA=; b=xcaB1p81hJ5JHGbIBHTHzCBWtjvsthGG+wKmdf/91n1ohx33EEaNCRYB+pEFclUyVFaStN oJRo2KlT97UjjLBbHb60RBcmcfchTiunqWdnAj4y+SM2uAkgFRcMyfRW8CXl4W8vDxQa66 ocQLKa5Oc1PW6ISGWDE7j6a9WCqcDIhKC4528Vq04xzI6kxUOsCg+M8LMBAJVhAU0g1qFP 3d9p5lFWIirjRAkIctr45Y8m67rmqrTf7AvrYiSirkJcg+OmIx3eRmKrkpCUypwNoRCVVe R7vOjknOcRoNXAImJVUwXkI+0yKgz5+HzewBgirGsm12Dxu8Idz+OqaX+qSJcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WV0f3QzTjZ; Tue, 27 Aug 2024 01:06: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 47R16Tht056670; Tue, 27 Aug 2024 01:06:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16T11056667; Tue, 27 Aug 2024 01:06:29 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:29 GMT Message-Id: <202408270106.47R16T11056667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 759864ad7ad6 - stable/14 - nvme: Add constants and types for the discovery log page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 759864ad7ad6f7ee949f496cc46ff906be9afcea Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=759864ad7ad6f7ee949f496cc46ff906be9afcea commit 759864ad7ad6f7ee949f496cc46ff906be9afcea Author: John Baldwin AuthorDate: 2024-03-23 00:24:18 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:53 +0000 nvme: Add constants and types for the discovery log page This is used in NVMe over Fabrics to enumerate a list of available controllers. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44446 (cherry picked from commit 88ecf154c7c5a2e413a81ae1b0511b0295265b99) --- sys/dev/nvme/nvme.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index b738ab902f89..3bbb1c326efd 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1458,6 +1458,7 @@ enum nvme_log_page { NVME_LOG_PERSISTENT_EVENT_LOG = 0x0d, NVME_LOG_LBA_STATUS_INFORMATION = 0x0e, NVME_LOG_ENDURANCE_GROUP_EVENT_AGGREGATE = 0x0f, + NVME_LOG_DISCOVERY = 0x70, /* 0x06-0x7F - reserved */ /* 0x80-0xBF - I/O command set specific */ NVME_LOG_RES_NOTIFICATION = 0x80, @@ -1590,6 +1591,48 @@ struct nvme_device_self_test_page { _Static_assert(sizeof(struct nvme_device_self_test_page) == 564, "bad size for nvme_device_self_test_page"); +struct nvme_discovery_log_entry { + uint8_t trtype; + uint8_t adrfam; + uint8_t subtype; + uint8_t treq; + uint16_t portid; + uint16_t cntlid; + uint16_t aqsz; + uint8_t reserved1[22]; + uint8_t trsvcid[32]; + uint8_t reserved2[192]; + uint8_t subnqn[256]; + uint8_t traddr[256]; + union { + struct { + uint8_t rdma_qptype; + uint8_t rdma_prtype; + uint8_t rdma_cms; + uint8_t reserved[5]; + uint16_t rdma_pkey; + } rdma; + struct { + uint8_t sectype; + } tcp; + uint8_t reserved[256]; + } tsas; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_discovery_log_entry) == 1024, + "bad size for nvme_discovery_log_entry"); + +struct nvme_discovery_log { + uint64_t genctr; + uint64_t numrec; + uint16_t recfmt; + uint8_t reserved[1006]; + struct nvme_discovery_log_entry entries[]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_discovery_log) == 1024, + "bad size for nvme_discovery_log"); + struct nvme_res_notification_page { uint64_t log_page_count; uint8_t log_page_type; @@ -2214,4 +2257,27 @@ nvme_device_self_test_swapbytes(struct nvme_device_self_test_page *s __unused) } #endif } + +static inline void +nvme_discovery_log_entry_swapbytes(struct nvme_discovery_log_entry *s __unused) +{ +#if _BYTE_ORDER != _LITTLE_ENDIAN + s->portid = le16toh(s->portid); + s->cntlid = le16toh(s->cntlid); + s->aqsz = le16toh(s->aqsz); + if (s->trtype == 0x01 /* RDMA */) { + s->tsas.rdma.rdma_pkey = le16toh(s->tsas.rdma.rdma_pkey); + } +#endif +} + +static inline void +nvme_discovery_log_swapbytes(struct nvme_discovery_log *s __unused) +{ +#if _BYTE_ORDER != _LITTLE_ENDIAN + s->genctr = le64toh(s->genctr); + s->numrec = le64toh(s->numrec); + s->recfmt = le16toh(s->recfmt); +#endif +} #endif /* __NVME_H__ */ From nobody Tue Aug 27 01:06:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WW5bWGz5TjDb; Tue, 27 Aug 2024 01:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WW2jJCz4lc4; Tue, 27 Aug 2024 01:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xhwenZKquX5tXzQ9Xj/v6HytizOhea0sZPPFo2cYT7U=; b=vvMb7lP1u8a1kaRUXXm+2/Ds/Kdtom38nj8btwLRfOTcFQsYEnFGTsLQjwqsUFAjw5r/oq 1FEV0+NOaaiI+U8TzmXwji+HqPtHIjeGztlkc11fPhfR4bM+uMgF+qcipw2inKZUp1nT/C oXfiWIhuD/3JBSPBG+X4EMX/NEXOiSITaOw6+hdGen2T5KAW1YDpMuZv+VyzQtUNSNoCzR spAuxXkRVURcpVahsS0db04K66Y0uC8MCv7bR+oUvCPlD3HdnWrsuT4gIPLodn8P4AWi1H Ju00BQ7uXqGMeLsHBZjClXf3znrshw8RhhplVGMXNLfqOkrfPN9RD7ji5hdi3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720791; a=rsa-sha256; cv=none; b=FemmljynCi+K5uxNPCtYcxJJ91gbTj2gU/VJ7IizqV4m4ZjePJ90EYgAEWrcRrWWR90JBL fv2k+mkRAmphKyjc0ax2OvWHA9Mnwf6XRLCtzxuuVGnaqhAzV6gcAJ+zXPGQCXAFdjKtzB CAfpM65yPSh9q6gcib06K7hdDy4c1lW9psp7FyiHNr6Ezpl9Gzs1HZuZCCqA71iau+7DUy LjKtwS/hZL4dcwK/2ltsW5N0ytjZo9CB+oruLkomCCA+VWezABeyF3qw/2QYLysmYrlX2J nptjVcnjHYVHk+LRhtgIpjImxiuXSdvcnFUgPrIhzzCy38WxWVJ7Ze9tMaxXaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xhwenZKquX5tXzQ9Xj/v6HytizOhea0sZPPFo2cYT7U=; b=KgUSZgj9QInL8oGA7Pijmr43GzB4taK6Zs4QrtFBG5NZlLwMSz5QAQej0Dg1u2AUUtccDJ jnmtdJTxiyS2TY7sdKhrTjms/NcbknP7lOCj1bC+woBIUY9w56AJsVexREoCNuJW3dzBsi CvuTB9T9SYYbWTKR0+JzGpmddCuFd4x1hjv0mm7o/FgFMe7IRzn72UyAGGKTcMO/zicd92 7J1RmZzuQoTxAvKAolh9mCSTt70hJ26QflZbRztipsEQ8Rz7/WiXL4ER1GRedUcNaX3WLt 221x7P+a2Xj4bzwI8csx6glwCw7WHirCDP1VxVtpZt8/ZeN2OnVNmPkq18QSAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WW1q14zT9T; Tue, 27 Aug 2024 01:06: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 47R16VHE056727; Tue, 27 Aug 2024 01:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Vd9056724; Tue, 27 Aug 2024 01:06:31 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:31 GMT Message-Id: <202408270106.47R16Vd9056724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9541862de74e - stable/14 - nvme: Add constants for the Controller Attributes field in cdata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9541862de74e437e01a2e0f3b978f6fb5f0568d4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9541862de74e437e01a2e0f3b978f6fb5f0568d4 commit 9541862de74e437e01a2e0f3b978f6fb5f0568d4 Author: John Baldwin AuthorDate: 2024-03-23 00:24:31 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:59 +0000 nvme: Add constants for the Controller Attributes field in cdata Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44447 (cherry picked from commit 7fa8adb8c5cd46979b76770794ac1b6584e8baa7) --- sys/dev/nvme/nvme.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 3bbb1c326efd..6317c65ec9cd 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -311,6 +311,38 @@ enum nvme_psdt { #define NVME_CTRLR_DATA_OAES_LOG_PAGE_CHANGE_SHIFT (31) #define NVME_CTRLR_DATA_OAES_LOG_PAGE_CHANGE_MASK (0x1) +/** CTRATT - Controller Attributes */ +/* supports 128-bit Host Identifier */ +#define NVME_CTRLR_DATA_CTRATT_128BIT_HOSTID_SHIFT (0) +#define NVME_CTRLR_DATA_CTRATT_128BIT_HOSTID_MASK (0x1) +/* supports Non-Operational Power State Permissive Mode */ +#define NVME_CTRLR_DATA_CTRATT_NONOP_POWER_STATE_SHIFT (1) +#define NVME_CTRLR_DATA_CTRATT_NONOP_POWER_STATE_MASK (0x1) +/* supports NVM Sets */ +#define NVME_CTRLR_DATA_CTRATT_NVM_SETS_SHIFT (2) +#define NVME_CTRLR_DATA_CTRATT_NVM_SETS_MASK (0x1) +/* supports Read Recovery Levels */ +#define NVME_CTRLR_DATA_CTRATT_READ_RECOVERY_LVLS_SHIFT (3) +#define NVME_CTRLR_DATA_CTRATT_READ_RECOVERY_LVLS_MASK (0x1) +/* supports Endurance Groups */ +#define NVME_CTRLR_DATA_CTRATT_ENDURANCE_GROUPS_SHIFT (4) +#define NVME_CTRLR_DATA_CTRATT_ENDURANCE_GROUPS_MASK (0x1) +/* supports Predictable Latency Mode */ +#define NVME_CTRLR_DATA_CTRATT_PREDICTABLE_LATENCY_SHIFT (5) +#define NVME_CTRLR_DATA_CTRATT_PREDICTABLE_LATENCY_MASK (0x1) +/* supports Traffic Based Keep Alive Support */ +#define NVME_CTRLR_DATA_CTRATT_TBKAS_SHIFT (6) +#define NVME_CTRLR_DATA_CTRATT_TBKAS_MASK (0x1) +/* supports Namespace Granularity */ +#define NVME_CTRLR_DATA_CTRATT_NAMESPACE_GRANULARITY_SHIFT (7) +#define NVME_CTRLR_DATA_CTRATT_NAMESPACE_GRANULARITY_MASK (0x1) +/* supports SQ Associations */ +#define NVME_CTRLR_DATA_CTRATT_SQ_ASSOCIATIONS_SHIFT (8) +#define NVME_CTRLR_DATA_CTRATT_SQ_ASSOCIATIONS_MASK (0x1) +/* supports UUID List */ +#define NVME_CTRLR_DATA_CTRATT_UUID_LIST_SHIFT (9) +#define NVME_CTRLR_DATA_CTRATT_UUID_LIST_MASK (0x1) + /** OACS - optional admin command support */ /* supports security send/receive commands */ #define NVME_CTRLR_DATA_OACS_SECURITY_SHIFT (0) From nobody Tue Aug 27 01:06:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WX62kWz5TjGv; Tue, 27 Aug 2024 01:06: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 4Wt8WX487lz4lWd; Tue, 27 Aug 2024 01:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Pa08BDywduvMqANJsOShy90z0pfUHGcLNaX+D3CNkU=; b=fpYGoSHGNZ2rFY+/5wNU4hUQw6feSzaqpXtukLVizgtjS5aXvPOovjFs/Z3wkZxuJFNCUB ta8/MR3eT4BIfOuBUdcETy7xCEoisq1N6zrJ1MeqbKvasK3T2fxQF7eiDhKdMjFm1voes2 cNHXTmET4h/uI+Z3DYRDBXZGuz4BAPUX4WSVq0oim3zGKkHXenbJB4AkZX1U9ajEqoVh7K UUbze1dhbxIcwu4x22BXhkAJpuAZ1gJXdvrNPey/6cJH2pP1NAC8wTpw8XwGZkUHA27flr 1uRJpEPDcFhwpi/4MmelNvz5kue4Mxwr10GM+SBSLJsNBvoCVVcEs2q2NLRZdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720792; a=rsa-sha256; cv=none; b=qEzTTfskeht0FPhohaQ7oDUEdJ42iJMcsRkwUXx9Gte5zmACqb/pWFvxbZsSbMV4/QVExn 2ebwU5zjPWDG2O2/EiEFGFyhQAxYWJMpx91hwZnDpGuPt1HQ8HChxFT4oQ/7teyFpOVkfC 9xqwpbX5yg1wgrifmuevKCcZ81YjJ9pCPivnLJzwvhN/Xfpk6n/rPd70UTfHjuaRcZrIHs E9KmV3YWe5JmDyfgtlos+klrReLytKrMH7mZOJPTUkuH3FYWw0hNCnDNyJFdOGaV6a30Ft YmBtPqnlv2KfBGB6PEoOLdsEhR0C2K3j6NL48PYzAMLD79005hq8J1b5Psrgrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Pa08BDywduvMqANJsOShy90z0pfUHGcLNaX+D3CNkU=; b=jpcy5l5qvIjaiULmrXrF5Bkn5P50hQ4ZiBTa1QsZRcrkuMTYLNjUZUUDOd+XBF1YBuNRaP 80pZofrtbsoHBFp78TyA3E3plDx+FlwdTiVIku4JZyhjyZa4nOoREX6CQD1r51YiLPRkda zU/I2iJ6/KrML8haDFI5Xp6bDxEk4JftKUsL/Gnwgc9YnNMEF5yaVRXYfOiJ02WYEBAbkj xHUHmZha9JTAh1/URBiKGptNNVlucWa5I4rIr8YOKE1Pgf3OlZpIujxNlX0HgPQg4CzUm1 XLH0sVM1iOWgw5Qp4vSEEJqlLtfrWn0XAxDS5o6t4OfvNWmFn5ggH9cv10kt2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WX2zS2zT9V; Tue, 27 Aug 2024 01:06: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 47R16Wjs056778; Tue, 27 Aug 2024 01:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16W0G056775; Tue, 27 Aug 2024 01:06:32 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:32 GMT Message-Id: <202408270106.47R16W0G056775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 46c77392cbfc - stable/14 - nvme: Add NVMe over Fabrics fields to nvme_controller_data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 46c77392cbfcccad947f6a7945431956f03acb6a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=46c77392cbfcccad947f6a7945431956f03acb6a commit 46c77392cbfcccad947f6a7945431956f03acb6a Author: John Baldwin AuthorDate: 2024-03-23 00:24:52 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:00 +0000 nvme: Add NVMe over Fabrics fields to nvme_controller_data Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44448 (cherry picked from commit 21d3a84db481e84cf240f6802b1a4110854eaec5) --- sys/dev/nvme/nvme.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 6317c65ec9cd..cceafc743519 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1349,7 +1349,13 @@ struct nvme_controller_data { uint8_t reserved8[768]; /* bytes 1792-2047: NVMe over Fabrics specification */ - uint8_t reserved9[256]; + uint32_t ioccsz; + uint32_t iorcsz; + uint16_t icdoff; + uint8_t fcatt; + uint8_t msdbd; + uint16_t ofcs; + uint8_t reserved9[242]; /* bytes 2048-3071: power state descriptors */ struct nvme_power_state power_state[32]; @@ -2066,6 +2072,10 @@ void nvme_controller_data_swapbytes(struct nvme_controller_data *s __unused) s->acwu = le16toh(s->acwu); s->sgls = le32toh(s->sgls); s->mnan = le32toh(s->mnan); + s->ioccsz = le32toh(s->ioccsz); + s->iorcsz = le32toh(s->iorcsz); + s->icdoff = le16toh(s->icdoff); + s->ofcs = le16toh(s->ofcs); for (i = 0; i < 32; i++) nvme_power_state_swapbytes(&s->power_state[i]); #endif From nobody Tue Aug 27 01:06:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8WZ01csz5TjLL; Tue, 27 Aug 2024 01:06: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 4Wt8WY5TVPz4lQt; Tue, 27 Aug 2024 01:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBLaa2ri6t7JtYr9QFwPVzF91q7R4hFRqh35aKCmnos=; b=RfdkaMlGHPV47VFrIuZrMah4zivPVGU9Zyq1tUAh4weeZVeehEnsq7uPO8Mdlwf5Xzu5B+ qlnNZVwiiTNyE7FRZeuQPP8pZYMEr/vEPLcDJp+p/CyFDy4IFmubRZwVpNYkUaC69PmRgr 1oOuf21uMvcmxw9VRvvpzocb9uvobkN5BB10BSX/etzNHnHeqz6Qz3vlnC1wzogYOVt5t2 Sn+mh3+io4VcDVlXGwrWYLha7RmKigE/gkfJeINA8ndr3UqjL5F7EXaCGBFEjKKuO612+k Vfbt54JudzNIxJdJalKgixt8qxraqAu91hCaPorLmJlVejYk11VCPws/46vzqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720793; a=rsa-sha256; cv=none; b=wZknYmhBbF+maNGouk63liwWzN4K7dDFgHxhT8BAdt06yWKReu4E0xUtvaWTExBQ44c4wC M2j/igtwJRCuYQm/MDRATSqRmYaEKx7Yt+hOPVw0DAdYZCBvGgfmMqHd/tkoYrhAJtIHsX jzhPpCB5BY22UVznahtrZNzuX7U3UR1k3lNOwk2CK0Nz2doAwVaorJQocfWpBaHmr3BbE5 Q34LLnVoPLAQGmnxefBzHZYuC6/qFwH+w3n//PAYqvDBaTPJvy4MBcDgVZeTz9iD3BEYS4 EBzJ4beFqPmrcecR7z33wCDwtHc3J1nr1lP7lPsjKkBP56RFTJT4wNKWWkgm8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBLaa2ri6t7JtYr9QFwPVzF91q7R4hFRqh35aKCmnos=; b=t6YP5+F466+wQ5tVQ+b2WHaESYbqgeXYDao9yH+XajWpsVzOj/2nqezH/JNZrh4gVlCeeb l9ZZAlyuEOZRrV43rBlools0/ewhcy9OdcuFmikQpitPvsty70vfXxOtsbPG9BLLVctRuu vYK/zVp6DM0jcbsicPZzv69SD710IPkF7W2kX2U/wJFKi4rFspGHjHACIpq/l4V+cuDa3V AxBUg+zdePS2yeL/OjfOQqe430Gs2/Cd8KXk9Wk/FkI8j8qPena4yJbh1IG/47yjY6ASgC 5SPd6jB7oluCTul3TShl7QIiRPoVfpGM6mqSpQb5iulTNqBmH3r3k6x8RWaUZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WY3tdKzV3n; Tue, 27 Aug 2024 01:06: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 47R16XPl056826; Tue, 27 Aug 2024 01:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Xkh056823; Tue, 27 Aug 2024 01:06:33 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:33 GMT Message-Id: <202408270106.47R16Xkh056823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7e771c225d9c - stable/14 - nvmecontrol: Display additional Fabrics-related fields for cdata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e771c225d9c34e5d57faad99829c0bba41ee897 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7e771c225d9c34e5d57faad99829c0bba41ee897 commit 7e771c225d9c34e5d57faad99829c0bba41ee897 Author: John Baldwin AuthorDate: 2024-03-23 00:25:07 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Display additional Fabrics-related fields for cdata Some of these fields are specific to Fabrics controllers (such as the size of capsules) while other fields are shared with PCI-e controllers, but are more relevant for Fabrics controllers (such as KeepAlive timer properties). Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44449 (cherry picked from commit acbc176c3dfdfebd047507dc7d843f8cc10984a8) --- sbin/nvmecontrol/identify_ext.c | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c index cc30ba0d6349..1082433d697e 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -139,6 +139,36 @@ nvme_print_controller(struct nvme_controller_data *cdata) printf("Version: %d.%d.%d\n", (cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff, cdata->ver & 0xff); + printf("Traffic Based Keep Alive: %sSupported\n", + NVMEV(NVME_CTRLR_DATA_CTRATT_TBKAS, cdata->ctratt) ? "" : "Not "); + printf("Controller Type: "); + switch (cdata->cntrltype) { + case 0: + printf("Not Reported\n"); + break; + case 1: + printf("I/O Controller\n"); + break; + case 2: + printf("Discovery Controller\n"); + break; + case 3: + printf("Administrative Controller\n"); + break; + default: + printf("%d (Reserved)\n", cdata->cntrltype); + break; + } + printf("Keep Alive Timer "); + if (cdata->kas == 0) + printf("Not Supported\n"); + else + printf("%u ms granularity\n", cdata->kas * 100); + printf("Maximum Outstanding Commands "); + if (cdata->maxcmd == 0) + printf("Not Specified\n"); + else + printf("%u\n", cdata->maxcmd); printf("\n"); printf("Admin Command Set Attributes\n"); @@ -249,4 +279,25 @@ nvme_print_controller(struct nvme_controller_data *cdata) if (cdata->ver >= 0x010201) printf("\nNVM Subsystem Name: %.256s\n", cdata->subnqn); + + if (cdata->ioccsz != 0) { + printf("\n"); + printf("Fabrics Attributes\n"); + printf("==================\n"); + printf("I/O Command Capsule Size: %d bytes\n", + cdata->ioccsz * 16); + printf("I/O Response Capsule Size: %d bytes\n", + cdata->iorcsz * 16); + printf("In Capsule Data Offset: %d bytes\n", + cdata->icdoff * 16); + printf("Controller Model: %s\n", + (cdata->fcatt & 1) == 0 ? "Dynamic" : "Static"); + printf("Max SGL Descriptors: "); + if (cdata->msdbd == 0) + printf("Unlimited\n"); + else + printf("%d\n", cdata->msdbd); + printf("Disconnect of I/O Queues: %sSupported\n", + (cdata->ofcs & 1) == 1 ? "" : "Not "); + } } From nobody Tue Aug 27 01:06:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wb3Fk2z5TjJg; Tue, 27 Aug 2024 01:06: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 4Wt8WZ6FBYz4lw8; Tue, 27 Aug 2024 01:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVR9iMFqrGSUrLk9MdizwsYdeAbqQKaH1U/aNifSW+c=; b=oly5KLK2nQy2sj9Qjy3mCYIG3vQ03/wHsXGEOpXUPdMCduiq+VAOScz2TDfGkBXASsnZxS brMQDt3Hj78y5jNlm2T3tXJ+stgD5hek8yep7auSDb4gr+TXj+iTJoey/yBdHWHja2cApD 9fcr9aYUN/bnRGqAjEJGbB6pmQaqu0GBTmqyW6y6Z6x3aHU5Uxqi5Dv4/+WX8KAtIBzNka 2KqHBVET9Rkw60pBJBpJZBUyw2rWbg3ShugMcXfRUx7Tf4fGb/pK7TjVGOoj91IV7AZfFD FM9sxlwGgBbi/qGeDB+eTcfCoKGhdA1D9m9LkFivCSIK13F9S3VgK1m/QQNt7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720794; a=rsa-sha256; cv=none; b=VCa2TVaT/2GqixC3zr9yHLInLX7LP+ghXs/EmEvDWW8DP46eMkAzjHsNvZeIjPiSENl69+ yk2Vfvd1zW5L5ICnQXKVan2w3UttnBEfEzOlHVb7UuO91h7wl+lE00MX0ZXoa4x+Q77d38 IClD+DOAfpYTxpURmxbB4V9CHnFeu07sASV1QxWsT/1Gwz8nFCJZLchlQbPqqh1POm3JKY 2jzdoduWvwZRz2cIM5gUplEBS9zhhYU8wCt/jvFANUAXpATQ2VzHICm7ROt5bcUDCcmJ9A rEU+JolCW5P978TGZ6fwfpoz5D03notfhrMh+dGlUKjCZmSQSrWCsI6Ay0VVgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WVR9iMFqrGSUrLk9MdizwsYdeAbqQKaH1U/aNifSW+c=; b=S5Q18q+kDA2X9V/BCf7Wph9yXDEGdl1M/XaQm3HhcL5R1k4bpBus298Cwo35ijxtcdW9lb It+FqmBDCxfZ4k0Ju+YtPnAKB7fKkdfZHypVi/JAGEUKuPmhdw/wJUfIZ66HWMnZXVkAz7 r29t72QPdZ/+6UuPX+haMhCMQ3k+3frtJFQbNp30dveAqXI6RWo3yTuUHRePGpriZkm3sI MEtDeNCP1OWWNO4DQDXa8uwH6h4TMGuG9zLwCLvcjDZuiCpr4NddROoe9f73Up8l7IQZqy /m/lO64upoPMmGVM043NDVmnL5XqbQb/V4iZZOjI2xpWg5WrAtqhnxmFCmJt9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8WZ50jtzTjb; Tue, 27 Aug 2024 01:06: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 47R16Yhj056873; Tue, 27 Aug 2024 01:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16YkK056870; Tue, 27 Aug 2024 01:06:34 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:34 GMT Message-Id: <202408270106.47R16YkK056870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4837e07cd2af - stable/14 - nvme: Add my copyright to logpage.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4837e07cd2af5d2698ed1fdb25ab7f3ece566917 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4837e07cd2af5d2698ed1fdb25ab7f3ece566917 commit 4837e07cd2af5d2698ed1fdb25ab7f3ece566917 Author: Warner Losh AuthorDate: 2024-04-03 18:10:08 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvme: Add my copyright to logpage.c Reflect the command line refactoring I did, and other changes. git blame says I'm to blame for ~1/4 of this file. Sponsored by: Netflix (cherry picked from commit fe83abacd4d097342cabef94b3128cd12c5fdccb) --- sbin/nvmecontrol/logpage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 8c03aa6fb7f4..6bdf83abefea 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -6,6 +6,7 @@ * * Copyright (C) 2012-2013 Intel Corporation * All rights reserved. + * Copyright (C) 2016-2023 Warner Losh * Copyright (C) 2018-2019 Alexander Motin * * Redistribution and use in source and binary forms, with or without From nobody Tue Aug 27 01:06:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wc3lYKz5TjHC; Tue, 27 Aug 2024 01:06: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 4Wt8Wb6qv4z4lgT; Tue, 27 Aug 2024 01:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDwXvOgRHPVKjvPw0UVhFXlzdfNFXJE8RuyNc/6WmVE=; b=m3Vu5av7639xD7qiZ0oTOUZB0TyES/+UIZZ0lBuPM/+n1uxiC7TwuoFhUvgYgCkdFDVUqT Q6LIA+PPwWkSWhqyZkfkr9yCkOiMNuGfbLrjdJiSkaRZ/oKvfY0xM+ck2cvBempEQRTzuH 4qv7E9jOgXDyMuuOqsr50yQ0dxJ4ezVIBzf1vdGx4RqcBe/S6rTv8r7mFn/wEc9udQFLYz 5ZuhbgabypYVmdoSrh2NDHeeZASSKXC/sbavmAzJJSO0j7WO7/1PhnTZov09pDwIVQa61w TMwgVy6i0T1G8PXjBojQ+ck/q3ydvXksFYS4It0OBmXy0NkfbtuUhH010+hEnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720796; a=rsa-sha256; cv=none; b=ms5zMP02j6J3zKCNzxgkLiNo3tLlssDYMNffdAxsKI00yCmOfiNhwD1dGAZ7bgup/lSW24 uX2mv1slNX7mVlTtGutmp4XXl2kjsxx2Ya/J6FQaSNTtXvP/B4wS4VldAa8czxVeCEzS6Z JSSxtlHP7DhTnrD6HUMBi3gx/LxD40lRFUBWcfwMtRA1BFJIXJ4utKwGlK/o2BZT2ttpUM DGHnju5gZjLtNCndXK9tlVh/i4odZCTj/FHwHZyMaM5+X8TzxrNLXv21MwtqAFQ91Qz7JR pIkz1Ys/ULIFAgUsZFIZbXQ+ybzYkLmM0zUUOLcfjQftKSE60FpZfhNvueJ35A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDwXvOgRHPVKjvPw0UVhFXlzdfNFXJE8RuyNc/6WmVE=; b=TTOig3pTJmHlHz81BVTBCWgcZ+sfNm9wCEv8igr3eswCYBwHS5M1plssQpvM9RbfQjazYE 2iQAgxMerJXJUnxcV/FsS9KQhSNwmYTZTG2O0A2PrgaVhCNCRE62KKE99dE/b/UPcpGqfF 4OUlAPgf6/jJllVr+o5yLWgUYYa0kZY+8yKFPgm0+mDsgyla8qqX/rjFy6x6A/KRjMmf37 /ifsjUEnbNKAqkrDx1Zu/SV7TxWIokbiS/xMb9rlSsNVu62INi/BAUvWacenjXs18NMZhG 4Qf9LfThKZigA2BnkALDj7p5RDGG3Tcs2uAzJJvtO2vYrJu2CtdrocJP4rvOoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wb6R0mzTdx; Tue, 27 Aug 2024 01:06: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 47R16ZQa056930; Tue, 27 Aug 2024 01:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16Z3P056927; Tue, 27 Aug 2024 01:06:35 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:35 GMT Message-Id: <202408270106.47R16Z3P056927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 05fe0588432a - stable/14 - nvmecontrol: Create letoh to generically convert to host order List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 05fe0588432aaf74077bc23b0db29889b49a3e40 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=05fe0588432aaf74077bc23b0db29889b49a3e40 commit 05fe0588432aaf74077bc23b0db29889b49a3e40 Author: Warner Losh AuthorDate: 2024-04-16 22:35:33 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Create letoh to generically convert to host order Using _Generic, create letoh which will generically convert uintXX_t types from little endian to host, regardless of the size. This name has been floated as a possible addition to endian.h. Sponsored by: Netflix Discussed with: jhb Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44649 (cherry picked from commit 67163bc485a56d960b72fb26f19685682b92dd6b) --- sbin/nvmecontrol/nvmecontrol.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index ce717e5732c3..a098da4c9c45 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -60,6 +60,17 @@ struct kv_name { const char *name; }; +/* + * Generically convert little endian to host endian, based on the type of the thing + * being converted. Use the proposed name for future changes to endian.h. + */ +#define letoh(x) \ + _Generic(x, \ + uint8_t: (x), \ + uint16_t: le16toh(x), \ + uint32_t: le32toh(x), \ + uint64_t: le64toh(x)) + const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); void logpage_register(struct logpage_function *p); From nobody Tue Aug 27 01:06:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wf3WXVz5TjR4; Tue, 27 Aug 2024 01:06: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 4Wt8Wf1sDdz4m4n; Tue, 27 Aug 2024 01:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGBUtphMy2RwXXLc568Og9OdEkk9wNXf9TpWc1cQM8Q=; b=MiK1oPdwW/l6LZS9gT04NTHsTDlx9DrOZZQU7/jD9I/L2FtPhf/frxiW3PKz88x7MWku7l ENzFNpg4WBHJ7e8YAeRDez8McHjOSKpvQRkDfFV5hfiJir6RWkmb+cQ6JKmcpZRKMib2r1 wQOWPicT8fcYpV1lNAQb5rTVVvNF2OCofD3AergJo5RXRMrkjpZLqELqRThmuuK6MPOdf2 /7nRstycyO2PZnb3tT9VGU5caXfS/3MacIFlO4dCi/Id5W4O1JTx+w+PnZgqKQr717OFO7 cHVkPllQzetKMEjKeUDOGb9uZCCD/cvqWbMFR8WIpy0hvAUj6IySIfrTgCTe7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720798; a=rsa-sha256; cv=none; b=Nw5HbZWUUyYyenOIZRYGsKE6rCeJuvqUryGEaEVxWNA2PZA10SDZbbNADS+dLIyU0ifEa2 Bl15cSU8EhC5x/fOaSws1KpwukI6bzLOArKnV0rpNz6/5cRfIYtw4CVjg7P+eM78zsapw/ DqanEu5qz3AoxYn1hWsr5FcLl/vH5MZ5wGhsrTz2us/eE1M3T7tw3rQ0TTvL4xFLf6hUr7 9PVUgQRALyTb4djuV3c1JzIrFZtt1gsgJIq5nvCH9zw1F4LZCG7Lih/wqAqBVNkGfBzGlW 0h3LdFkXuQrax8kVOP8skmgRScp3WsYhMhSvyIpgJEEEsePtaMbpKfrSlaVWow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGBUtphMy2RwXXLc568Og9OdEkk9wNXf9TpWc1cQM8Q=; b=CHVIKV1cef0e4qsYnDpXzPSMfz0puSALWjWPFRSxyBeJhz7dFHGzlNeO7ICiQS9fMoQwjU H8DXsxR4CyKKVMdTKuU8DUQkn2/eq4tHhM3w4MipB3KC8JyDoJUWofsaOAExWgRXHPCgFJ u9r4Q2R3Ih7gynAEqM6x1C6fo6Pu2J8GgmoZZqEV+hJfVZ02j8th/zAPWwXN9umNL/H7au NEPAeRGe5sxmMnMChu7a+g7REJXv7lh1ZYxq2IPkNwFGLacA8zNAW2bNg67w5n2MeDOhHg XSJm4JyjZsFV0yovOvzULRZJJRA2ldgGkUCXfEM4DOoKKau/UpcMccKWXc5cbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wf1NZrzSkJ; Tue, 27 Aug 2024 01:06: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 47R16ciC057046; Tue, 27 Aug 2024 01:06:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16cqr057043; Tue, 27 Aug 2024 01:06:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:38 GMT Message-Id: <202408270106.47R16cqr057043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 78e2c1882b2f - stable/14 - nvmecontrol: Have to truncate on all 32-bit architectures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78e2c1882b2fac00fabe9d362050213b35dd4a78 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=78e2c1882b2fac00fabe9d362050213b35dd4a78 commit 78e2c1882b2fac00fabe9d362050213b35dd4a78 Author: Warner Losh AuthorDate: 2024-04-16 22:35:53 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Have to truncate on all 32-bit architectures armv7, powerpc, powerpcspe and i386 all lack 128-bit integer types. Adjust the comment and #ifdef. I don't think we support nvme on any of these other architectures at the moment, but it won't hurt to be more precise. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44650 (cherry picked from commit e098d24b5290a9f59734587ded783c19d4dc6e31) --- sbin/nvmecontrol/nvmecontrol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index a098da4c9c45..ed331327ae9e 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -92,12 +92,12 @@ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, vo /* Utility Routines */ /* * 128-bit integer augments to standard values. On i386 this - * doesn't exist, so we use 64-bit values. So, on 32-bit i386, + * doesn't exist, so we use 64-bit values. So, on 32-bit systems, * you'll get truncated values until someone implement 128bit * ints in software. */ #define UINT128_DIG 39 -#ifdef __i386__ +#ifdef __ILP32__ typedef uint64_t uint128_t; #else typedef __uint128_t uint128_t; From nobody Tue Aug 27 01:06:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wd3zrhz5Thsj; Tue, 27 Aug 2024 01:06: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 4Wt8Wd1Cv1z4lnG; Tue, 27 Aug 2024 01:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1xfbSZAQI84PkblpNl787qSMuMRDysuuufwPD3tFUc=; b=WyyXAGMTHutr9Aru47jnfkf9h/QhsahYi4Ler0Vni5id9pA+Gi+HaayELoyBrvkiePQM0G wUqX2Wmz0ZyqBIMKgqA4YHZk7HdIY/ORIwpmM/Pmljs9iP7y10JOJ0cx0Z70npdY6pLhwT BSDT5v6seEBiU1FbVAkeHPPieDLX4qZlLbF3pqrfqfLa43pRS8hhu35T9+Jm46mBtRMjf7 yv/d1zlkWcNcguypUZNnz7OkF8BrSpByOPm6y5nXf+xEUnngizJXyn1DRi+xtjMPxTkjLt rggaGefL6SdqOyjNoYhgh9Kzs4ZXx1K+MZfJLhpUNyPMGR/RpfwBKyV+7IHjyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720797; a=rsa-sha256; cv=none; b=S23P7JYQEEYliGqJ1v9C6XXjcs3DvHhTNEh1YuaxNAZ9GDYJSm0pA7fhjVTMzJvIQFobo5 I1qkGZtF1TF1F6/DAKlQqZS5Ppbfo9YKgE/UVocdem1vL9J+sS8COkbdMTurkBABuyNd3I hp/zeDBxb8E6qRB3s9ehglMmpC8ih9DxfCKSBwUO9jqqVeIq57LeUCPXZpbhYiu3gmckn5 KVAS9H1e3ss9+md8rbzwk9EDNb4R3+3JA7HtTjTmJ1iodkI3QyoeTY85vruHGLgidpWV51 1JySFJd8g79q1KMSiz8V9sDMi22+/7WbRjJybeWsAUZzCmuNANlMuSbBvDliwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1xfbSZAQI84PkblpNl787qSMuMRDysuuufwPD3tFUc=; b=RJEsC3XEDLS+k0Yv3j8WzWZcyHmpLbBsyA8ArdNCp7oejzLUmxreyM2DKFe/HMkhKjKTtt ZwlLmeowfZO7F87sP4d5qA5W0PIyx/8kdBBwqtgY9NnbDw04pkWVSC/A38yy345vJPy7mr D9WCEh7uH79n7ShuodjyMOyt8NfawgpN2h4W24BxVR9cgT/lp9bwER+vYuINlmYvYTPX4w OUi9XN2rXvklhZrmN4i0Ee3ZO1fx7begMzcAp4y6h7IZfafUebZZ2NzZe1bQzaEmPzeYKV qGrMhtA1H7GAczowR7cA44pAK0Yst3vwKG0DlftpYEndTV1xR7XAunGe+G8o8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wd0S2fzSkH; Tue, 27 Aug 2024 01:06: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 47R16aFD056987; Tue, 27 Aug 2024 01:06:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16aZP056984; Tue, 27 Aug 2024 01:06:36 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:36 GMT Message-Id: <202408270106.47R16aZP056984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d20b149786cb - stable/14 - nvmecontrol: Make the error log page work on native format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d20b149786cbd2c983eeaffce9c51c0a767cadc7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d20b149786cbd2c983eeaffce9c51c0a767cadc7 commit d20b149786cbd2c983eeaffce9c51c0a767cadc7 Author: Warner Losh AuthorDate: 2024-04-16 22:35:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Make the error log page work on native format As the number of page types proliferates, it becomes untennable to convert them in read_logpage (especailly since new UUID page types will need to be supported). Convert the error page printing code to operate on little endian data. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44680 (cherry picked from commit 85656a9a015339f3d412e5b1888e798bb3e7d4ba) --- sbin/nvmecontrol/logpage.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 6bdf83abefea..a6242bd4a440 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -194,8 +194,7 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, uint16_t lsi, uint8_t rae, void *payload, uint32_t payload_size) { struct nvme_pt_command pt; - struct nvme_error_information_entry *err_entry; - u_int i, err_pages, numd; + u_int numd; numd = payload_size / sizeof(uint32_t) - 1; memset(&pt, 0, sizeof(pt)); @@ -221,12 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_ERROR: - err_entry = (struct nvme_error_information_entry *)payload; - err_pages = payload_size / sizeof(struct nvme_error_information_entry); - for (i = 0; i < err_pages; i++) - nvme_error_information_entry_swapbytes(err_entry++); - break; case NVME_LOG_HEALTH_INFORMATION: nvme_health_information_page_swapbytes( (struct nvme_health_information_page *)payload); @@ -273,17 +266,17 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Error Information Log\n"); printf("=====================\n"); - if (entry->error_count == 0) { + if (LE2H(entry->error_count) == 0) { printf("No error entries found\n"); return; } - nentries = size/sizeof(struct nvme_error_information_entry); + nentries = size / sizeof(struct nvme_error_information_entry); for (i = 0; i < nentries; i++, entry++) { - if (entry->error_count == 0) + if (LE2H(entry->error_count) == 0) break; - status = entry->status; + status = LE2H(entry->status); p = NVME_STATUS_GET_P(status); sc = NVME_STATUS_GET_SC(status); @@ -293,9 +286,9 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Entry %02d\n", i + 1); printf("=========\n"); - printf(" Error count: %ju\n", entry->error_count); - printf(" Submission queue ID: %u\n", entry->sqid); - printf(" Command ID: %u\n", entry->cid); + printf(" Error count: %ju\n", LE2H(entry->error_count)); + printf(" Submission queue ID: %u\n", LE2H(entry->sqid)); + printf(" Command ID: %u\n", LE2H(entry->cid)); /* TODO: Export nvme_status_string structures from kernel? */ printf(" Status:\n"); printf(" Phase tag: %d\n", p); @@ -303,13 +296,13 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf(" Status code type: %d\n", sct); printf(" More: %d\n", m); printf(" DNR: %d\n", dnr); - printf(" Error location: %u\n", entry->error_location); - printf(" LBA: %ju\n", entry->lba); - printf(" Namespace ID: %u\n", entry->nsid); - printf(" Vendor specific info: %u\n", entry->vendor_specific); - printf(" Transport type: %u\n", entry->trtype); - printf(" Command specific info:%ju\n", entry->csi); - printf(" Transport specific: %u\n", entry->ttsi); + printf(" Error location: %u\n", LE2H(entry->error_location)); + printf(" LBA: %ju\n", LE2H(entry->lba)); + printf(" Namespace ID: %u\n", LE2H(entry->nsid)); + printf(" Vendor specific info: %u\n", LE2H(entry->vendor_specific)); + printf(" Transport type: %u\n", LE2H(entry->trtype)); + printf(" Command specific info:%ju\n", LE2H(entry->csi)); + printf(" Transport specific: %u\n", LE2H(entry->ttsi)); } } From nobody Tue Aug 27 01:06:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wg5PXTz5Thsn; Tue, 27 Aug 2024 01:06: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 4Wt8Wg2wlPz4m0Z; Tue, 27 Aug 2024 01:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4/jgTntAC2T/G55ZVE3COTKzl1RhBLxQufTgClb9bs=; b=ULvTBtR+3cPseaZY0V4nIACL+1bh3mLt+6WR2y31QFuK7jREVEL20mVPBbz6mkwLCrzgla ndrJQ+IHdXySz29R0ad0xNWQn5xlGjEIJrzQ6sgeyEbvW1gFLG/8/wE7CFNV+0jt3hLE8t ZQLtn/Xjuvhatd/G7F91lN8TfgEf1ZuOKTYSss+UPPrZqOPpNlenCYixIfQkyN5jzvcnR2 4DAXH49r8tN2KLvbdccQQBeoxYrUEaUTQFcPR7P07XszR7VWnwhonyh22fV+8O9RoAe0k6 qA579P7rnXrMDEgOkk0q5hA/XD3EdtT/eEEccWDr1crZTOQghqu3giaE4XKN/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720799; a=rsa-sha256; cv=none; b=J0155vAbWh5tdo4//QUUdFs5Re4iSd/FEZ0m8nIFJ4P4jShsAJyddxxF20jukH8waeJ/eK Toj2sSyBv/ZeQZT3/sw2JIyRJnWJlL5PT5al/zlm8aJbKdYe6eBtj5CHjNjkmWgnZJdB2Y hlY8OXp3dy0vgoHpHYidmJoS2lcanNrvhnxqSHtTeaEAYqL6si4/LdF7YuzG3qWbw+P1MQ fm61zhn2u6SOmtZ7bVyDQ737NuWxpvIgR97Q3e6XLlmLicErKTae6p7UQecjEG+Ezjqs+N 1WQC3f55v1Q1iV1d9OSIQmPMl3xdCfTj0RGQpx+P4+2eo/b11zsexp85LUe6qA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4/jgTntAC2T/G55ZVE3COTKzl1RhBLxQufTgClb9bs=; b=YmFJe93zyDajhitnkyxB+JIA14TMNkqTzG+jXXEZPbznmW9EzuBz7bgqK1QK1XGA5B2IUq 038dwAmhQVwhwCuDz/uwaDtre1R1iUdoJ5Sx88l22vV9rvNNhcXPAAa7qLeZ1jS6v4x0zX IGiNVVBksws0Ovif5Nwbpu/aLSWopSpdul7f/0S3hc5byshWukSNEylYwiprLydLnGl4Z2 x8NTkWS0Ws9yHXfpQ1qDGfN+A+jMG9LKHZi2Z57+TPD8P4glETI3Of0/lFkOxVrSv2SRpW EClbBiauAnXTfSBXIB5rBlskYaxq5QwIIXNGbyZJPf+KiAWXWZcvveDTF/AJSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wg257czTfg; Tue, 27 Aug 2024 01:06: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 47R16dII057095; Tue, 27 Aug 2024 01:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16dwR057092; Tue, 27 Aug 2024 01:06:39 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:39 GMT Message-Id: <202408270106.47R16dwR057092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 650c012e519f - stable/14 - nvmecontrol: Fix to128 for big endian targets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 650c012e519fe027fdab6561d35380dcd0ac8e4b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=650c012e519fe027fdab6561d35380dcd0ac8e4b commit 650c012e519fe027fdab6561d35380dcd0ac8e4b Author: Warner Losh AuthorDate: 2024-04-16 22:35:59 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Fix to128 for big endian targets The source is always 128-bits in little endian format. For big endian hosts, we have to convert, or we print bogus numbers. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44651 (cherry picked from commit 1c4b7effa7f9df64bf72c6291b4719cffb2ffe22) --- sbin/nvmecontrol/Makefile | 1 - sbin/nvmecontrol/nvmecontrol.h | 27 +++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/sbin/nvmecontrol/Makefile b/sbin/nvmecontrol/Makefile index facb5f09835d..e3d363b123ed 100644 --- a/sbin/nvmecontrol/Makefile +++ b/sbin/nvmecontrol/Makefile @@ -1,4 +1,3 @@ - .include PACKAGE=nvme-tools diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index ed331327ae9e..4187c9bee432 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -91,22 +91,33 @@ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, vo /* Utility Routines */ /* - * 128-bit integer augments to standard values. On i386 this - * doesn't exist, so we use 64-bit values. So, on 32-bit systems, - * you'll get truncated values until someone implement 128bit - * ints in software. + * C23 supports 128-bit integers via _BitInt(128). clang 16 and gcc 13 support + * this. Older compilers will support 128-bit ints on 64-bit + * platforms. Otherwise we truncate this to 64-bit on 32-bit systems with older + * compilers. We also check for > C18 instead of >= C23 because clang 17 was + * released before the the __STDC_VERSION__ was defined. */ #define UINT128_DIG 39 -#ifdef __ILP32__ -typedef uint64_t uint128_t; -#else +#if __STDC_VERSION__ >= 202311L +typedef unsigned _BitInt(128) uint128_t; +#elif defined(__SIZEOF_INT128__) typedef __uint128_t uint128_t; +#else +typedef uint64_t uint128_t; #endif static __inline uint128_t to128(void *p) { - return *(uint128_t *)p; +#if __STDC_VERSION__ >= 202311L || defined(__SIZEOF_INT128__) + uint64_t lo, hi; + + lo = le64dec(p); + hi = le64dec((const char *)p + 8); + return ((uint128_t)hi << 64 | lo); +#else + return (le64dec(p)); +#endif } uint64_t le48dec(const void *pp); From nobody Tue Aug 27 01:06:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wh6W2sz5TjR9; Tue, 27 Aug 2024 01:06: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 4Wt8Wh4Fbgz4ltP; Tue, 27 Aug 2024 01:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZpgxZAWZRKN5eNiep8VR+EvHSqnpZsc1LxSV+rD36sk=; b=Rkul/MD+0oqbZRyW/u5iTfVCYKvzOUqj2scWdAMRfsEY00sC1VtqDmckIfNdsl+Hr1GImn Gles4UdntPOlu4pGJF5qOIKusjqa4VwyVsP7+mmmXsvEohv9z6UUlzjC6msyIpxdwQY9Ks fasLSYEmEM0Apn3NhC0ruEvNs8F8j2BaAXD0B2/lCYxlyjcfHD3mgLPknP6fyp/XkI83K5 GVtQ2jpYlbuu3xEk3cLbM1L3IILh4avqJJeeSvq8bSu3G1YJMp1v51uRErldNfSdZg2Bf4 7QGV4GQGBvrCeOPaTI3N1u79ozgxXRGk7X5zx2kRXroilaJypj+ZMkIueO6FLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720800; a=rsa-sha256; cv=none; b=qnOFP+VGxUkMjJFfCIzA83lfXuQBNqF2g+5Xh5mNTrE3lo1BeZw2NNoE57RyPc32wxraYy LQisg3vw6eicjBgcRFbuvXcD8fsYOJvRLeDXlbjTjM8nbVfZ69bRfWlet4uc6ZKP7l2Wa2 KgiWoBu22KpXJaGeU0ZVC678Uv9HU9Y251u5SWPurUsJjBJx6D7gUxnTAA1886sn40NaMc Fj5p+R36Gt9Y98Ixy9Ry6vJ4k0FDLCsFVURbBNgGxgR0Qfh02e4kkTt6wbmlGrH5RIZAyU 9KZ63J42s+PY5jcpMNpsUOHTtZ5KowVCPsZ3wNfhs7ukpqb6RwG0VkUESc3F5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZpgxZAWZRKN5eNiep8VR+EvHSqnpZsc1LxSV+rD36sk=; b=k0M+DB1m4l5T4KzB+2Neff0WlFjQjwE9Cf/JkJw3vSDX+XpV9e1/pJwEPTdKk9HZrEktmO UhkSv1/Vhq7ayBqQHrF0W8ETSANtD1cOIAUKKnZOR5UEk1Zg7dqwqkrdauE3J3zHm4J/Jx PzQdv3zYrN3pXbmMOFzJ6HuE1BLIwxBo9PS63/xA6cjeQZ6slhRjyrivzxgEHBIT6Ik9DR d6yzHbSoNH8UlhqJvR9F+PgHFSG20HffAS98TNG5qwvDnMnBn6bC64hKavaUkeM19rCwp8 kIDoBa2hjoNC37+Nj0VylJQncr/zgxI0wM/Xof6i3GSrs2Q7SuBE0n1v32bx2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wh36wxzSkK; Tue, 27 Aug 2024 01:06: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 47R16eSu057146; Tue, 27 Aug 2024 01:06:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16e6v057143; Tue, 27 Aug 2024 01:06:40 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:40 GMT Message-Id: <202408270106.47R16e6v057143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4d144d4ceb1c - stable/14 - nvmecontrol: Move smart/health printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d144d4ceb1c7df824ba66929c396faa83638edf Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4d144d4ceb1c7df824ba66929c396faa83638edf commit 4d144d4ceb1c7df824ba66929c396faa83638edf Author: Warner Losh AuthorDate: 2024-04-16 22:36:05 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Move smart/health printing to little endian orderinng Move health printing to little endian ordering... Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44652 (cherry picked from commit 729ee4c88f2af4560adec39fd709ff89bb597e4a) --- sbin/nvmecontrol/logpage.c | 56 +++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index a6242bd4a440..0ed19222ba1a 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_HEALTH_INFORMATION: - nvme_health_information_page_swapbytes( - (struct nvme_health_information_page *)payload); - break; case NVME_LOG_CHANGED_NAMESPACE: nvme_ns_list_swapbytes((struct nvme_ns_list *)payload); break; @@ -266,17 +262,17 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Error Information Log\n"); printf("=====================\n"); - if (LE2H(entry->error_count) == 0) { + if (letoh(entry->error_count) == 0) { printf("No error entries found\n"); return; } nentries = size / sizeof(struct nvme_error_information_entry); for (i = 0; i < nentries; i++, entry++) { - if (LE2H(entry->error_count) == 0) + if (letoh(entry->error_count) == 0) break; - status = LE2H(entry->status); + status = letoh(entry->status); p = NVME_STATUS_GET_P(status); sc = NVME_STATUS_GET_SC(status); @@ -286,9 +282,9 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf("Entry %02d\n", i + 1); printf("=========\n"); - printf(" Error count: %ju\n", LE2H(entry->error_count)); - printf(" Submission queue ID: %u\n", LE2H(entry->sqid)); - printf(" Command ID: %u\n", LE2H(entry->cid)); + printf(" Error count: %ju\n", letoh(entry->error_count)); + printf(" Submission queue ID: %u\n", letoh(entry->sqid)); + printf(" Command ID: %u\n", letoh(entry->cid)); /* TODO: Export nvme_status_string structures from kernel? */ printf(" Status:\n"); printf(" Phase tag: %d\n", p); @@ -296,13 +292,13 @@ print_log_error(const struct nvme_controller_data *cdata __unused, void *buf, ui printf(" Status code type: %d\n", sct); printf(" More: %d\n", m); printf(" DNR: %d\n", dnr); - printf(" Error location: %u\n", LE2H(entry->error_location)); - printf(" LBA: %ju\n", LE2H(entry->lba)); - printf(" Namespace ID: %u\n", LE2H(entry->nsid)); - printf(" Vendor specific info: %u\n", LE2H(entry->vendor_specific)); - printf(" Transport type: %u\n", LE2H(entry->trtype)); - printf(" Command specific info:%ju\n", LE2H(entry->csi)); - printf(" Transport specific: %u\n", LE2H(entry->ttsi)); + printf(" Error location: %u\n", letoh(entry->error_location)); + printf(" LBA: %ju\n", letoh(entry->lba)); + printf(" Namespace ID: %u\n", letoh(entry->nsid)); + printf(" Vendor specific info: %u\n", letoh(entry->vendor_specific)); + printf(" Transport type: %u\n", letoh(entry->trtype)); + printf(" Command specific info:%ju\n", letoh(entry->csi)); + printf(" Transport specific: %u\n", letoh(entry->ttsi)); } } @@ -326,7 +322,7 @@ print_log_health(const struct nvme_controller_data *cdata __unused, void *buf, u uint8_t warning; int i; - warning = health->critical_warning; + warning = letoh(health->critical_warning); printf("SMART/Health Information Log\n"); printf("============================\n"); @@ -343,13 +339,13 @@ print_log_health(const struct nvme_controller_data *cdata __unused, void *buf, u printf(" Volatile memory backup: %d\n", !!(warning & NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP)); printf("Temperature: "); - print_temp_K(health->temperature); + print_temp_K(letoh(health->temperature)); printf("Available spare: %u\n", - health->available_spare); + letoh(health->available_spare)); printf("Available spare threshold: %u\n", - health->available_spare_threshold); + letoh(health->available_spare_threshold)); printf("Percentage used: %u\n", - health->percentage_used); + letoh(health->percentage_used)); printf("Data units (512,000 byte) read: %s\n", uint128_to_str(to128(health->data_units_read), cbuf, sizeof(cbuf))); @@ -372,18 +368,18 @@ print_log_health(const struct nvme_controller_data *cdata __unused, void *buf, u printf("No. error info log entries: %s\n", uint128_to_str(to128(health->num_error_info_log_entries), cbuf, sizeof(cbuf))); - printf("Warning Temp Composite Time: %d\n", health->warning_temp_time); - printf("Error Temp Composite Time: %d\n", health->error_temp_time); + printf("Warning Temp Composite Time: %d\n", letoh(health->warning_temp_time)); + printf("Error Temp Composite Time: %d\n", letoh(health->error_temp_time)); for (i = 0; i < 8; i++) { - if (health->temp_sensor[i] == 0) + if (letoh(health->temp_sensor[i]) == 0) continue; printf("Temperature Sensor %d: ", i + 1); - print_temp_K(health->temp_sensor[i]); + print_temp_K(letoh(health->temp_sensor[i])); } - printf("Temperature 1 Transition Count: %d\n", health->tmt1tc); - printf("Temperature 2 Transition Count: %d\n", health->tmt2tc); - printf("Total Time For Temperature 1: %d\n", health->ttftmt1); - printf("Total Time For Temperature 2: %d\n", health->ttftmt2); + printf("Temperature 1 Transition Count: %d\n", letoh(health->tmt1tc)); + printf("Temperature 2 Transition Count: %d\n", letoh(health->tmt2tc)); + printf("Total Time For Temperature 1: %d\n", letoh(health->ttftmt1)); + printf("Total Time For Temperature 2: %d\n", letoh(health->ttftmt2)); } static void From nobody Tue Aug 27 01:06:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wk07dTz5TjLl; Tue, 27 Aug 2024 01:06: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 4Wt8Wj4pjvz4lxG; Tue, 27 Aug 2024 01:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=raq+C25BAIgh528AmjDfXubl3zeoE5nJCub2ILqtZKA=; b=DlC9yh+qY1gBwvDW5SjUNzFJv12nNjie1ODXRSz9uYDK1I18I6FxIIIreajhYrsHga6sc3 aAgbDFFbkWKs59tUH0/fIxzAoM9QoK6I/zsn/EPM27K1kKduuStNP4XkBtEitv4eLD9Uw9 St5lQo5mW2TvsgT/mRj46xoNifNxIdFneeJbhvHKjUfR6Gm0J84KTUwXRXEzwU5bEDeyJN 9UaoxEKMz8C3LvkDf1Vf9UcPqGt2EDul8LZZEurvHEssBUzOL2gtgl6HUXmEztjWVvXRA8 zixwQdf5wpljZNNO0oCRMmCtYUr5DZ0u5Ah3BDitvw9tKZwtKkjki/DQQ5xxjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720801; a=rsa-sha256; cv=none; b=ljzr6mQZ++gZkEoh9+tSiV/gaiBCXhjW1fWkOyCFgy0r0h4wwHs9IulH3IjqK3v5Bgaxf4 jeXA0g7HUPQzAsF+DZhtde4Rtr57A/oWbt9Qb+Lobr8xHWH6K3F0dImhrODP5nRXonc6oe qX00he9SFCNDU28Lm7tpRdBtTugrY2bpS/YZct9KLIMiyB+RGpwwGHtg4sG4fZsZSyEFjH nFv0RVXCYih6/oI+Mw/YQhPsdgJcK8qJIRMD6Xm9AytibcPYrZZxvTj44e4lrhATcr1hwv /LtCaz18zgLwPr/1z+en07uHZkQbfrXHjdo/Efmtz7PfvcaE+41/hHQw+w/usQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=raq+C25BAIgh528AmjDfXubl3zeoE5nJCub2ILqtZKA=; b=O646Wjc+eINE9ehKpsdBworJ3C+dDTe407J8Ih90+kF6iMkjY+cT5VMRNf7VE7XIttgs6Q cODxdAskGvKY20QAXHXpI7qRWfWFHiAykiSM8gOyaMsVZisdYTieg4HwPJyKqHgIr8KtLd fcJIoGm3I+GvZaChnD1/oKIM3XhR01ScXtXYSaLAm0svKY4h/iLF+OUctowsdRkzHVZDVD WibEW+O5FmqBm4lxAvNdKjnl6ya3zv1LMz5GL657V8IkG3rlVtribG/5u1SC/c+dLf8KZe LQKILDUZKXO3wCKfSCQD7jFu0SQRl4aPJcBs2CchchdA5K1olUCNCpmjwhzinQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wj49TbzTf5; Tue, 27 Aug 2024 01:06: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 47R16f9t057205; Tue, 27 Aug 2024 01:06:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16fFp057202; Tue, 27 Aug 2024 01:06:41 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:41 GMT Message-Id: <202408270106.47R16fFp057202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0c66083c035c - stable/14 - nvmecontrol: Move namespace change page printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0c66083c035c90e6991e18914b1fcdbdc70d8e7d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0c66083c035c90e6991e18914b1fcdbdc70d8e7d commit 0c66083c035c90e6991e18914b1fcdbdc70d8e7d Author: Warner Losh AuthorDate: 2024-04-16 22:36:13 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Move namespace change page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44653 (cherry picked from commit acdf72f7bbe582b8eabf09576dc93eb4fcfbd19b) --- sbin/nvmecontrol/logpage.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 0ed19222ba1a..845dad0cd539 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,9 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_CHANGED_NAMESPACE: - nvme_ns_list_swapbytes((struct nvme_ns_list *)payload); - break; case NVME_LOG_DEVICE_SELF_TEST: nvme_device_self_test_swapbytes( (struct nvme_device_self_test_page *)payload); @@ -430,8 +427,8 @@ print_log_ns(const struct nvme_controller_data *cdata __unused, void *buf, printf("Changed Namespace List\n"); printf("======================\n"); - for (i = 0; i < nitems(nsl->ns) && nsl->ns[i] != 0; i++) { - printf("%08x\n", nsl->ns[i]); + for (i = 0; i < nitems(nsl->ns) && letoh(nsl->ns[i]) != 0; i++) { + printf("%08x\n", letoh(nsl->ns[i])); } } From nobody Tue Aug 27 01:06:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wm1WfGz5TjLt; Tue, 27 Aug 2024 01:06: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 4Wt8Wm0Lwqz4lrd; Tue, 27 Aug 2024 01:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQc3iMd6zy+1GhZH/TrDw8AsbPKbs7oIH3hLpk2DDfc=; b=buzDEzdqxG+yTQ5+cQfWJ1btsU25LtajmjEJpZThNO83kJlb58bO3ZPyw6iykDvvPqccxJ N72tONNeXDt1SLb+PMeu8iuawCUtOTfNe4jRirVjG9SMm7rhZnekxJQkHwGSawfTotFD5P dgDckG3L3+R8J9+SeJOGfJp2/LOAHz8vdW8aYAMWymWhgxHd85S7HnnT7wZ/gQkbQikpXN y0E3KokmBRI6ijfpV9vgZ7mKAn3IQD01YV9CszkKOKicYXbuhXafdavTTzK0Yu5Ktl9cqj Z/DqkYmMNhO9ZEt0Hx+V4I4D2kHKGKh+aQgtsMN6JxXWrTTIyzYmo7ws1WLZPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720804; a=rsa-sha256; cv=none; b=KkHX/LTWrw4KONXFghxy69eLj2T975yrbFJ/Fo6X92kny70b4bFsGS8b0mtCYxXa3XxyeI OhMy5KCx0yud05AJDL2/j3O6xsYm8FUtnABhoqDq+UTbAtNcB+ZiK2Yp4du1skMKbrF67a Z0F6uXdrfOLqPjxzFXlkdIrY/HrURmzJ/EFZKUV3fjLy828TZoAahqvcRjmqpCO9Mm2b3a CbDfVlHrELVjJg0Ar1H8GOSJpzsgWMB0K54G5FnCe3EWH9qY43JXbFNhvn5Qllcxrnk/Ug sYvDXANNmNkIzfj3CTyuyKu/627M7NYec6mxaxSIGyjA2ZKm8P3y2tnK6zAADQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQc3iMd6zy+1GhZH/TrDw8AsbPKbs7oIH3hLpk2DDfc=; b=ymPx4SlxCJZWUuVBL9b4iyEdrslbodzaHmmD7tQE0iolZePd79O3xeitdgfXMMn1bKq+/R b7ikRbO2ST/qtUuHiMtgo0Gzy4FmFgizvd1asCzrr6uCBFDptvrPCcrPbZyrS6TbRvZNE/ 0E7rYkMmuEYemJdn23c3MNimxtxglS1/K5Q87XTr+WDiUU4oIIWMTHxPVDPler44fBVr/h uHyQItOI27OOI/UTJJav9ZfCJdKudBlbjbhQWDM/nnSL6EIsowJQxlJ3BO94X4gICoPP3+ r1CdcgbVEc9Fo+pfd4VMdsm5t4Uq6OZq5xd5K7J2jq3eTHlLswjD4TLVKuFaMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wl5zMjzSkL; Tue, 27 Aug 2024 01:06: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 47R16h85057323; Tue, 27 Aug 2024 01:06:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16hag057320; Tue, 27 Aug 2024 01:06:43 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:43 GMT Message-Id: <202408270106.47R16hag057320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 71484bbbfff3 - stable/14 - nvmecontrol: Move command effeccts page printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 71484bbbfff3cb93be026749cde3af55ab885c2f Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=71484bbbfff3cb93be026749cde3af55ab885c2f commit 71484bbbfff3cb93be026749cde3af55ab885c2f Author: Warner Losh AuthorDate: 2024-04-16 22:36:25 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move command effeccts page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44655 (cherry picked from commit b850caf7b7099636fd4323cb47a82f5201309fed) --- sbin/nvmecontrol/logpage.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 897bb7a59118..67d296df6afb 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_COMMAND_EFFECT: - nvme_command_effects_page_swapbytes( - (struct nvme_command_effects_page *)payload); - break; case NVME_LOG_RES_NOTIFICATION: nvme_res_notification_page_swapbytes( (struct nvme_res_notification_page *)payload); @@ -442,7 +438,7 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused, printf(" Command\tLBCC\tNCC\tNIC\tCCC\tCSE\tUUID\n"); for (i = 0; i < 255; i++) { - s = ce->acs[i]; + s = letoh(ce->acs[i]); if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("Admin\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, @@ -454,7 +450,7 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused, NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No"); } for (i = 0; i < 255; i++) { - s = ce->iocs[i]; + s = letoh(ce->iocs[i]); if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0) continue; printf("I/O\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i, From nobody Tue Aug 27 01:06:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wl1mb5z5TjLs; Tue, 27 Aug 2024 01:06: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 4Wt8Wl063Lz4m7k; Tue, 27 Aug 2024 01:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uIpMSeYUfoAiobLBOZcFfn3712IAiV5jw0KWYT6DNk=; b=vR/eRDM1Khq/YJuRq5CC/RAF8Hpc8Db0Bz7tiVcm42dF8k+2MSofaPnt8Nmi6GJYYdT+0i 3TnwAUitM/vJ5DML65Fb4tKBemYc5b5n6kj2JD7X36aho+i/LiJcTnRdgjeAlmXm8PIO7+ vUQv6FkRQJR3FWmUdOizi6cZiJCUuFH0nOGKf8TPkseKEXVE/nNkS2TjVCn3It2+QXmOyG eubdmJAh99j2eM9BUzD8JFwH8z6RXDilR5SN9lotc3NEXgqKQgzcOM8kgQAVZkDltM9XVV O8THL0VoEgy1rDtPgzZNJwM86dYIyO8b3aPXBjJcLD07zx2Pc+QMdDBCk9czzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720803; a=rsa-sha256; cv=none; b=R/YkDd5wjMrNYI5uNumEY9HEWOo6KQf8fzEtPK5C/oFx3/ji8s0AT3cMGgoq+W1adKYquG OnzkCuKGirE5foXd5W3MFMcGp/tAmRsQtdyR6dppw84+Ql6jqBTzfWMwLO/L+vh12F2qoV YRYz4leFuR3WSeeIWHKIZL4YNq5272xQdYtb6o1e14fz+ApYYj5NOIpdy1bOCzs17RnPLs htl5wi07IqFcf0bA4uh2MtPfK9LsIJ1ooZyAceGF5kt5fVqRkyr0joJjRO+MuFoalHJqSl lIKTQL2NLdTcpRuAR9sFANgh1y+Gi3r+YJwYLwHFAIvus9l09uXoaUpYnw/HiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uIpMSeYUfoAiobLBOZcFfn3712IAiV5jw0KWYT6DNk=; b=t/Qjb3LFNafzTis6MjU6h/Ik0PL3utUIfMl8jM8BI1c/veKZYbzxB7QnyzBAdjTdClVlBI gwP4eg9HKPmSq5ceAphacQwgNVDc9oONgQxY0Ol9lulfpMM8CP39zwJdI6l3ZrRWEx0lpB Ib/UaAO1hr2h3UITud6ymSL1J22wVzER5eo17wxNNHozPYbVdI+rShVQE5V4i5OWCqEZjr YjQLSPycSIqEeNLw5UukF+fIUgqn8v8GXRLHHrQlYY9tv3kJs8XrxqM12vma9P28al2LHD KbljnDdjukyk+Yccj73kE6SCoOySunQbXKI/Hmlc49BD/wY53Kkd5DABNfby+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wk5Gk2zT9W; Tue, 27 Aug 2024 01:06: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 47R16g2U057265; Tue, 27 Aug 2024 01:06:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16guu057262; Tue, 27 Aug 2024 01:06:42 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:42 GMT Message-Id: <202408270106.47R16guu057262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 067abd7d0b06 - stable/14 - nvmecontrol: Move self test status page printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 067abd7d0b0678cba0dede7e1813660e9e269d6e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=067abd7d0b0678cba0dede7e1813660e9e269d6e commit 067abd7d0b0678cba0dede7e1813660e9e269d6e Author: Warner Losh AuthorDate: 2024-04-16 22:36:19 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:02 +0000 nvmecontrol: Move self test status page printing to little endian orderinng Also, add printing vnedor_specific field, which doesn't have a valid bit, so is always valid. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44654 (cherry picked from commit 98f841efd8ce387d9cd060174b9dcc9ff9850648) --- sbin/nvmecontrol/logpage.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 845dad0cd539..897bb7a59118 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_DEVICE_SELF_TEST: - nvme_device_self_test_swapbytes( - (struct nvme_device_self_test_page *)payload); - break; case NVME_LOG_COMMAND_EFFECT: nvme_command_effects_page_swapbytes( (struct nvme_command_effects_page *)payload); @@ -574,13 +570,14 @@ print_log_self_test_status(const struct nvme_controller_data *cdata __unused, { struct nvme_device_self_test_page *dst; uint32_t r; + uint16_t vs; dst = buf; printf("Device Self-test Status\n"); printf("=======================\n"); printf("Current Operation: "); - switch (dst->curr_operation) { + switch (letoh(dst->curr_operation)) { case 0x0: printf("No device self-test operation in progress\n"); break; @@ -594,19 +591,20 @@ print_log_self_test_status(const struct nvme_controller_data *cdata __unused, printf("Vendor specific\n"); break; default: - printf("Reserved (0x%x)\n", dst->curr_operation); + printf("Reserved (0x%x)\n", letoh(dst->curr_operation)); } - if (dst->curr_operation != 0) - printf("Current Completion: %u%%\n", dst->curr_compl & 0x7f); + if (letoh(dst->curr_operation) != 0) + printf("Current Completion: %u%%\n", letoh(dst->curr_compl) & 0x7f); printf("Results\n"); for (r = 0; r < 20; r++) { uint64_t failing_lba; - uint8_t code, res; + uint8_t code, res, status; - code = (dst->result[r].status >> 4) & 0xf; - res = dst->result[r].status & 0xf; + status = letoh(dst->result[r].status); + code = (status >> 4) & 0xf; + res = status & 0xf; if (res == 0xf) continue; @@ -631,21 +629,24 @@ print_log_self_test_status(const struct nvme_controller_data *cdata __unused, printf(" Reserved status 0x%x", res); if (res == 7) - printf(" starting in segment %u", dst->result[r].segment_num); + printf(" starting in segment %u", + letoh(dst->result[r].segment_num)); #define BIT(b) (1 << (b)) - if (dst->result[r].valid_diag_info & BIT(0)) - printf(" NSID=0x%x", dst->result[r].nsid); - if (dst->result[r].valid_diag_info & BIT(1)) { + if (letoh(dst->result[r].valid_diag_info) & BIT(0)) + printf(" NSID=0x%x", letoh(dst->result[r].nsid)); + if (letoh(dst->result[r].valid_diag_info) & BIT(1)) { memcpy(&failing_lba, dst->result[r].failing_lba, sizeof(failing_lba)); - printf(" FLBA=0x%jx", failing_lba); + printf(" FLBA=0x%jx", (uintmax_t)letoh(failing_lba)); } - if (dst->result[r].valid_diag_info & BIT(2)) - printf(" SCT=0x%x", dst->result[r].status_code_type); - if (dst->result[r].valid_diag_info & BIT(3)) - printf(" SC=0x%x", dst->result[r].status_code); + if (letoh(dst->result[r].valid_diag_info) & BIT(2)) + printf(" SCT=0x%x", letoh(dst->result[r].status_code_type)); + if (letoh(dst->result[r].valid_diag_info) & BIT(3)) + printf(" SC=0x%x", letoh(dst->result[r].status_code)); #undef BIT + memcpy(&vs, dst->result[r].vendor_specific, sizeof(vs)); + printf(" VENDOR_SPECIFIC=0x%x", letoh(vs)); printf("\n"); } } From nobody Tue Aug 27 01:06:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wp5HY7z5TjWy; Tue, 27 Aug 2024 01:06: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 4Wt8Wp1cqFz4m8K; Tue, 27 Aug 2024 01:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dEo+Qh0ATv07NqYJeGpqs6Q3lEbHzgQqwxu+Fswq8c=; b=Pw5vtVSmxZoSB94LMOMqBirZm/SsmFwn2zEEKR0iEhVnFbkqECTmXYVE0OCxwplerzkP5J G6Lm0BMdiiMkwW4XkZxvMKaRBdmEXlaJFWiSonCW52F+gwJexLturTQYKvSspkl50ubYT6 sjS0XHJecgmsGWuMv+gruw+sbwGtrZ1wFmZPSqFGSIKDzWdO87ZiRcyc8WHIhdgsu1B2GM Ve/TISzbX9IEY9hzRFvNcVdgm0rgG8i376gWYH0r6ZDQXK0Wd2yBY5PiA0VDaaQtdCuKVR 6fCt3GWEFCwg1yo2TZfyADjgPbV0jwMK6bDcGMXt2O9D6ZdP+XosvLlSXDzE2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720806; a=rsa-sha256; cv=none; b=WH1Iw2TqH6nJge7+Ye4cdwa8UfVnn6eevGI28zpq5mdHnkKQFWNFwSWArLcB3hxlljnT77 cQplRRIYcQeJJ4fA9IchkgOi8gceUS19UL0sBx8TF3KugxUb8RVjtnfV+LIODvnabk7/JM nRZhGWkPXOjl/XIrHhc3gygrgP7Byccjqd0miT+McN/TKbG+LtaaybUz9E8U5nygI7PLxp Cc29f0nuWfqOp+AU6kiWreG/2I/OYdCZuk2GZt6dJvaOCuKdeU0YqtftSCG5ekPq3QI5Ge z9H2fpOXbqd7l4O1doQDQTPgTCW/qTw8ODFrKc63SNYo2iWJn1s3TluIOxzM7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dEo+Qh0ATv07NqYJeGpqs6Q3lEbHzgQqwxu+Fswq8c=; b=Tpf5psigJptDJ1a6UkGB47IeZkhdHppxE55mPM2+oFvSGwCZcpCmc/YVlMulolzIJYJkJC nZcVJiDRjGQ3/xwrKHqaL8dgfmAr8NhMgvKe9HSRg15f+ppgedz1UW+WshsI1OaKpMUcKV ZAgvptSJv/vI/096/P0sRlO4S7urwDK9lhijSj97rAzFKUcXHDNiQvLbJH6sfV45r4pI7r T3CEyu6TpHzbMbq898GJZDyw7bcvHMhiUtnes1P5rY26gac9fu6R6sst8vhkHwD1nEg8xs etqBJoaat/G34BtZiCHZ2OfUyLTVimN0iIIkbYYDnVje+Wxcv4nVpxjbkV3XUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wp18SFzV6h; Tue, 27 Aug 2024 01:06: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 47R16k9V057439; Tue, 27 Aug 2024 01:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16ksL057436; Tue, 27 Aug 2024 01:06:46 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:46 GMT Message-Id: <202408270106.47R16ksL057436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1bc8c6d40dc1 - stable/14 - nvmecontrol: Move sanitize status page printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1bc8c6d40dc19cc9a42abe2e8834e8a5dc3855d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1bc8c6d40dc19cc9a42abe2e8834e8a5dc3855d6 commit 1bc8c6d40dc19cc9a42abe2e8834e8a5dc3855d6 Author: Warner Losh AuthorDate: 2024-04-16 22:36:36 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move sanitize status page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44657 (cherry picked from commit 55a1679ece1f56beda5f68e929a6b2fc553fb501) --- sbin/nvmecontrol/logpage.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index b4f9996b10c2..a01ce8d0f237 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_SANITIZE_STATUS: - nvme_sanitize_status_page_swapbytes( - (struct nvme_sanitize_status_page *)payload); - break; case INTEL_LOG_TEMP_STATS: intel_log_temp_stats_swapbytes( (struct intel_log_temp_stats *)payload); @@ -499,15 +495,18 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, { struct nvme_sanitize_status_page *ss; u_int p; + uint16_t sprog, sstat; ss = (struct nvme_sanitize_status_page *)buf; printf("Sanitize Status\n"); printf("===============\n"); + sprog = letoh(ss->sprog); printf("Sanitize Progress: %u%% (%u/65535)\n", - (ss->sprog * 100 + 32768) / 65536, ss->sprog); + (sprog * 100 + 32768) / 65536, sprog); printf("Sanitize Status: "); - switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss->sstat)) { + sstat = letoh(ss->sstat); + switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); break; @@ -524,22 +523,22 @@ print_log_sanitize_status(const struct nvme_controller_data *cdata __unused, printf("Completed with deallocation"); break; default: - printf("Unknown"); + printf("Unknown 0x%x", sstat); break; } - p = NVMEV(NVME_SS_PAGE_SSTAT_PASSES, ss->sstat); + p = NVMEV(NVME_SS_PAGE_SSTAT_PASSES, sstat); if (p > 0) printf(", %d passes", p); - if (NVMEV(NVME_SS_PAGE_SSTAT_GDE, ss->sstat) != 0) + if (NVMEV(NVME_SS_PAGE_SSTAT_GDE, sstat) != 0) printf(", Global Data Erased"); printf("\n"); - printf("Sanitize Command Dword 10: 0x%x\n", ss->scdw10); - printf("Time For Overwrite: %u sec\n", ss->etfo); - printf("Time For Block Erase: %u sec\n", ss->etfbe); - printf("Time For Crypto Erase: %u sec\n", ss->etfce); - printf("Time For Overwrite No-Deallocate: %u sec\n", ss->etfownd); - printf("Time For Block Erase No-Deallocate: %u sec\n", ss->etfbewnd); - printf("Time For Crypto Erase No-Deallocate: %u sec\n", ss->etfcewnd); + printf("Sanitize Command Dword 10: 0x%x\n", letoh(ss->scdw10)); + printf("Time For Overwrite: %u sec\n", letoh(ss->etfo)); + printf("Time For Block Erase: %u sec\n", letoh(ss->etfbe)); + printf("Time For Crypto Erase: %u sec\n", letoh(ss->etfce)); + printf("Time For Overwrite No-Deallocate: %u sec\n", letoh(ss->etfownd)); + printf("Time For Block Erase No-Deallocate: %u sec\n", letoh(ss->etfbewnd)); + printf("Time For Crypto Erase No-Deallocate: %u sec\n", letoh(ss->etfcewnd)); } static const char * From nobody Tue Aug 27 01:06:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wn3KVpz5TjTT; Tue, 27 Aug 2024 01:06: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 4Wt8Wn139zz4ly7; Tue, 27 Aug 2024 01:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smNXzD78gP1njYMMXZAcqaLdd4Wai832Cz9S76mp8hE=; b=EiW1zf5QI6WOKKYcfUx6tpHkOg6hGyGSNmCzJkTrj+pue9rHerdX2F5UmyKOzeQltmXppL m6XvyxE9pD2lyrY4dOZ2nLHM8EgiFtGJvm/U6SmbUelT3w/x8M09gX5J3ehdvegnPYZu8p f/8H9P/wl8y1ZEb09NeS9nMEykyhr7XRnI2YD7iE33zF8Wet0Cm2nWgpkJ2/WxHcklf/bf eh6K7lDkVJeKyeGHHjMiwa1GcMQjveyNCZDYtkBsrK3oVahIHx4W2aIr2N1btSOMJF4Toz gNMvgVzbvCgQRtOVrDDgNYi+BpfgG1C0ivttP654Wu5Wc5R/aBPdDCa+exrr4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720805; a=rsa-sha256; cv=none; b=YIRBlElDr4vhglh/OIOPRJFlNPnYlrSJcjdgKnYd23F2jN3i1nWJRWltnDfho29TGejRR6 lUylEbhV1jHuZuf7UM06JcQvFr2qCkmkgA3shNc4e4OjFFXYlfhoapmiC/ek4CXFTUoSyY k70mm+XVlzz3YwREQNhw4B/wBz8hkUaiEFkqYos1eWgf0rDmicsGs8uapyVFac3PCLPtUo i4ZRIYJVJqbFXDoDv7AGAgP/HhPA46uvABaTxwZPuWhbZGxdFdCFY1sj7qp1N6I2mBT7ST a2kkn6UXS+nDKQmFwxLWtdKND6AOipkAzawM5C0FNdkJk/ob7HTomE/npivsMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smNXzD78gP1njYMMXZAcqaLdd4Wai832Cz9S76mp8hE=; b=MNZZ2tbcFvjImBzbgDlc8WnV9YBX3PfPqZNEJ2SsPTEGkWSlnicTYsZtrxFM9HkowOU1eL PjJb4vc/p6riEBkEWFR/VHrdO3LRjyRQB6xcMHr8+Lk+108OBv+DwdZzQgPi302YxpgN8C T8iYfE+ObhiCF9+MA2vGCxPJWXux8ynLa+lL1nr4rAz16GxQ0zNJdOhdxaCG7PvWJPF9Jy 6QtOdr3s/9d+74bWOny4wy+fj0SN5iCRdwnXCFQJuL1eR10ZJu2TOrB4twjKTknLD+5PmK 17KWKvxlJp1+JZxT45V7g5JapPgYJGaoBc5TvDpVkagqAP5if4k0LI3KKPQDmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wm6nlpzT9X; Tue, 27 Aug 2024 01:06: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 47R16iMq057380; Tue, 27 Aug 2024 01:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16iJI057377; Tue, 27 Aug 2024 01:06:44 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:44 GMT Message-Id: <202408270106.47R16iJI057377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 36269290fcad - stable/14 - nvmecontrol: Move reservation notifcation page printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 36269290fcadcb617c5f02348bc056b3084d8311 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=36269290fcadcb617c5f02348bc056b3084d8311 commit 36269290fcadcb617c5f02348bc056b3084d8311 Author: Warner Losh AuthorDate: 2024-04-16 22:36:31 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move reservation notifcation page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44656 (cherry picked from commit 3d28a9c608a382af669e22e9e8eda7fd0bc02cad) --- sbin/nvmecontrol/logpage.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 67d296df6afb..b4f9996b10c2 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, /* Convert data to host endian */ switch (log_page) { - case NVME_LOG_RES_NOTIFICATION: - nvme_res_notification_page_swapbytes( - (struct nvme_res_notification_page *)payload); - break; case NVME_LOG_SANITIZE_STATUS: nvme_sanitize_status_page_swapbytes( (struct nvme_sanitize_status_page *)payload); @@ -473,9 +469,10 @@ print_log_res_notification(const struct nvme_controller_data *cdata __unused, printf("Reservation Notification\n"); printf("========================\n"); - printf("Log Page Count: %ju\n", rn->log_page_count); + printf("Log Page Count: %ju\n", + (uintmax_t)letoh(rn->log_page_count)); printf("Log Page Type: "); - switch (rn->log_page_type) { + switch (letoh(rn->log_page_type)) { case 0: printf("Empty Log Page\n"); break; @@ -489,11 +486,11 @@ print_log_res_notification(const struct nvme_controller_data *cdata __unused, printf("Reservation Preempted\n"); break; default: - printf("Unknown %x\n", rn->log_page_type); + printf("Unknown %x\n", letoh(rn->log_page_type)); break; }; - printf("Number of Available Log Pages: %d\n", rn->available_log_pages); - printf("Namespace ID: 0x%x\n", rn->nsid); + printf("Number of Available Log Pages: %d\n", letoh(rn->available_log_pages)); + printf("Namespace ID: 0x%x\n", letoh(rn->nsid)); } static void From nobody Tue Aug 27 01:06:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wr6gYwz5TjP2; Tue, 27 Aug 2024 01:06: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 4Wt8Wr3mtyz4m6c; Tue, 27 Aug 2024 01:06:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awyvXD3ZPz3W6JIsbSzZPq3T3+GNsf+D2KHoRvp5JHc=; b=vieFDVG0O918VurDexQyHEeI9sW50aFHZKzXCLZQDMGhz5xKhFZW1uQ/AqqfzS7cM2Msd9 bgQXuasDd9H/Yc4fIdFvZA/Dr5eIrpGfYIrj0aDy6FQCaU0ABGTBAfoZScIoSTlFN/cXHU zudSP9aMRlYI59UO4+dLXeYLknBJuZ84lVFymdNyEyrXMCvia0CY5doMMmAEjhYkM7TAL2 SigYLKNpiVvjEvF42yOEezMASYAgmzMovrwqSoQ8+IyrZTDIHZc44Vxe/YeB+lzOOU1ayo 7IeH1I4xeYx+8dNxk/QGNRGZladAiTml7n0AvyfxJioB0v0kXtIPCkIe1CZ8zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720808; a=rsa-sha256; cv=none; b=Pphq2yDfEr5eJCxH8STryiTd/B9jxiDw+uqfXIsrFjv6/5pEq6iYikr2eV/sIBj1dDDYpZ 4cfphfVvIMTJssQx6d2TD8OVFfhhcP4YcMJBKb4iUVZ9QdP8DAa809jL9S69lbOmyQXUrx yrfEH0uhjoKdhwK+3kB2M7TwwCACBM/+yyoZw1ESVcvqjD2iC8DxDRs26DyHsSorxFFl8C 0f/HZVd+UI3MTioLdj4aR+a7IGSbPpwL0TG3WaTT3V3mVwnzw6YDZJSAuUO7Zttpa5N9go Z33gdiQlPT2/bs3DVyQ06OeVawYz4LvefweyJ98yRBlsSL23PErgRxNT5bcH+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awyvXD3ZPz3W6JIsbSzZPq3T3+GNsf+D2KHoRvp5JHc=; b=LD1rUSO8IkMftIKL37ev+yKX2zDXQlfjSDSBalN8hjoNLLgcpuXXVdpa7t+5XNdTNpFajT rAeNmTkkgS02C0TVwZnfnFe/Tg38PeAhviZ3951AXyL0BExJUIc4fL2FRMWi5xhhzDwt2C IJT7LqEXLflspNsBXIy0K+e2mwbL92hVfPLUweVFLofoe3R6yBiIf81TajJzCCFuLlt40k sI4BuBB3N75mEbUET+sTJDJUP3HfH/HyxG+y5i7/aShFDESBndV6IAGbWU4ncmyglgMijP N2dzc4NvVtqY0Hv5TzaPeSPfUiJXVFpP8FznkuxflFk4UL61jXd4oc/hsb9+1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wr2v2TzV4R; Tue, 27 Aug 2024 01:06: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 47R16m6n057535; Tue, 27 Aug 2024 01:06:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16mex057532; Tue, 27 Aug 2024 01:06:48 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:48 GMT Message-Id: <202408270106.47R16mex057532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1dac1524786b - stable/14 - nvme: Eliminate intel_log_temp_stats_swapbytes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1dac1524786b6600a2218adcebf4ad8977aa0341 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1dac1524786b6600a2218adcebf4ad8977aa0341 commit 1dac1524786b6600a2218adcebf4ad8977aa0341 Author: Warner Losh AuthorDate: 2024-04-16 22:36:47 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvme: Eliminate intel_log_temp_stats_swapbytes We can't post a AER for this page, so there's no need to be able to swap it to host byte order. It's not one of the standard defined pages that can post via AER, and the vendor's public docs for this temperature page don't suggest it's possible to get over or under event changes. Since nvmecontrol no longer needsd the swap routine, remove it since it's now unused. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44659 (cherry picked from commit 97b77de2d951b4946fb3219a99c98f2dd4c0120f) --- sys/dev/nvme/nvme.h | 17 ----------------- sys/dev/nvme/nvme_ctrlr.c | 4 ---- 2 files changed, 21 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index cceafc743519..45133c7a9b91 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -2225,23 +2225,6 @@ void nvme_sanitize_status_page_swapbytes( #endif } -static inline -void intel_log_temp_stats_swapbytes(struct intel_log_temp_stats *s __unused) -{ -#if _BYTE_ORDER != _LITTLE_ENDIAN - - s->current = le64toh(s->current); - s->overtemp_flag_last = le64toh(s->overtemp_flag_last); - s->overtemp_flag_life = le64toh(s->overtemp_flag_life); - s->max_temp = le64toh(s->max_temp); - s->min_temp = le64toh(s->min_temp); - /* omit _rsvd[] */ - s->max_oper_temp = le64toh(s->max_oper_temp); - s->min_oper_temp = le64toh(s->min_oper_temp); - s->est_offset = le64toh(s->est_offset); -#endif -} - static inline void nvme_resv_status_swapbytes(struct nvme_resv_status *s __unused, size_t size __unused) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 52e412c5202a..5a825c10f584 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -729,10 +729,6 @@ nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) nvme_sanitize_status_page_swapbytes( (struct nvme_sanitize_status_page *)aer->log_page_buffer); break; - case INTEL_LOG_TEMP_STATS: - intel_log_temp_stats_swapbytes( - (struct intel_log_temp_stats *)aer->log_page_buffer); - break; default: break; } From nobody Tue Aug 27 01:06:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Ws5sl6z5TjP3; Tue, 27 Aug 2024 01:06: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 4Wt8Ws4dhLz4mKL; Tue, 27 Aug 2024 01:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCn77Ag3FwovXzwn0AEWGDjyBsHQ4eN6fIbwTOkLosU=; b=sa72z+f5PiHgjOIGxg5imr1Esgp757DcRhmVui/YhiL0/FpYifDoIvJh2Wg+xbd1CT1F2p G4/vx7NOYj832uC8VWS1vo/pMwJJ+Xx3roiWHjyJRZGT+g80PYirhGOasYw2o2pe/Nwdw9 Ht+1ZJPgw+N5OvfMR+kEefGKuA2O84ERlvrd2VJhmZWYdLU9EbI37JC9LYCLALLfhk7lb3 JILIvshKnW1zARyAwvRAj4+PemjBLBWs6hXLjk/Hkl5VvG1qPaV1k8YyIbvi2tKWzjQbGX 6rBsXGnqxin9c6oLzYOi+s7CQC//I/whblprAcT3AOIVO5AOwIznj4J3r9FqKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720809; a=rsa-sha256; cv=none; b=fLW04ejzoY7CN+R6RU8X86eZORk5PH2Lwx0VTS4/3wqi0J8SPwi3gmue8yOfw8/f++miw4 RayoQo4avxR78Nl+4Nqay4dVx7ZiFtNPJkgtSJ8WtIC8V3GGE/Y9bJlPryvCcavwkFf13T mDE7hO5p1xuKvLfG7gz6JpDhcStLq4aD/W8dCkmBpJ5qI4xY9TMharJBQaL0byaMSNuktq WonHBVgFFLJC3t4U2pAOevwtBZMGWYRvJDOBOKx+MZlMsqsfUbRTtblHnPKz3gT+E7M6W1 0L2mySb3MFsXQDj63CS8op2pwCUNyPsf+trWqJJdAxYnH+xgAdS+eedNyectGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCn77Ag3FwovXzwn0AEWGDjyBsHQ4eN6fIbwTOkLosU=; b=W1kFCXkdXm3ATO7UiPe5DzwoUJj55J+9otHY7F18IjIctK/jdvk1L8tVMtH579i3G/4sci yrOndNE02bL7DlQozJ+2JR+fHgnhBnKEApdB3kuwTHcizAmlo5ocXcauYaEhtZ6LxMxIJs hxeyGOwsFGhK86DdiWw0paf0gs0rj/CiLNn4bQwYqczscvnNVPnGoKohOw6MPVjF6mJ3h0 ctY/PVYFIKg3DaQSkKdD1ZyCvcM6D1QlvTkkzAG4HLG6GCh8gYCPbknaUA9UUCxKN1vh6t bfQmDnLxCE4VWuT2FWSb5nXdwEP0Ga0crqRQbbgcUKGALbubFnqjVmRYbyaF+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Ws460HzTf7; Tue, 27 Aug 2024 01:06: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 47R16nSU057591; Tue, 27 Aug 2024 01:06:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16nKQ057588; Tue, 27 Aug 2024 01:06:49 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:49 GMT Message-Id: <202408270106.47R16nKQ057588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 37109ba0ec1f - stable/14 - nvmecontrol: add newlines where needed for ns command printfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37109ba0ec1f5d17f5e006ec8f7a76aca4d7765d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=37109ba0ec1f5d17f5e006ec8f7a76aca4d7765d commit 37109ba0ec1f5d17f5e006ec8f7a76aca4d7765d Author: Warner Losh AuthorDate: 2024-04-16 22:36:54 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: add newlines where needed for ns command printfs Sponsored by: Netflix Reviewed by: chuck, jhb Differential Revision: https://reviews.freebsd.org/D44681 (cherry picked from commit e39873820da7ddfddb59823efc3421125b92c17a) --- sbin/nvmecontrol/ns.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 27f622162c7d..70392af19111 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -647,7 +647,7 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (delete_opt.nsid == NONE - 1) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (delete_opt.nsid != NONE - 1) @@ -713,7 +713,7 @@ nsattach(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (attach_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (attach_opt.nsid != NONE) @@ -783,7 +783,7 @@ nsdetach(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (detach_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (detach_opt.nsid != NONE) @@ -860,7 +860,7 @@ nsattached(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (attached_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (attached_opt.nsid != NONE) @@ -913,7 +913,7 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) open_dev(path, &fd, 1, 1); } else if (identify_opt.nsid == NONE) { close(fd); - fprintf(stderr, "No NSID specified"); + fprintf(stderr, "No NSID specified\n"); arg_help(argc, argv, f); } if (identify_opt.nsid != NONE) From nobody Tue Aug 27 01:06:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wq3w3mz5TjLv; Tue, 27 Aug 2024 01:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8Wq2jtXz4m6T; Tue, 27 Aug 2024 01:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=327REn5C/Io+qb6zi1i1V5e0SilIMf6OIserZp7gWrc=; b=aNgy3xrcLEErsgyZPTxmIsXn37Fth83qiOmL965nbyJ0bm/PW5n4BtPH5qhe5umZaHBHdr bpcEEqjr6x+p8V8WnTqTxmJJ6rp3WEdYBlD1ohzLxdnrXz/ykYOOl1zxfchkTT67oSqqJW bZAOTnm03svEhVXmv9FnhybuK1tsvmakQI484ZHEzyPK2QhVDNuupRRkVmXAGPHkVOwHZV Ren2xWeLJsSpzp5MY8e3Pvwh2kGUxqa6uVaYLoIM+f+Hg8iXSYO2YitH3UhcOrhTuIbwB4 tZo+kaeWU0RcGOWxCXXE9JCDHvfI8gEeJx0hLTF6QLlsTFrpsdNndvaDrG3rEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720807; a=rsa-sha256; cv=none; b=sOvC3gOd15KM7/IzkuebqL5+kL2N5LOXnb2JknpLt+6qU+V3VDRVvXpwWcqSRfJUtZ/fkk 1YsvqKD5lPRjuQfaVxy5IvDRGQH5VfhkDbVNyDpLz8THNCq+blaCZtxhhvdaH9qAv0EFei gVSSrsAmnJPIwJLLHuAdo5UJwvvXrB3hPsT6NsaJg0diCCqrE4lyPY0iVw4Rv/rxRpeVSd Hx3mBUsP0ptpFwhZWw1ZQNUDr9mlBAs40bNsCfId3/8FwtcRBaPkBopRlHzhkPfsWP3r2M KpZMJ7j4e80Bf9pZOpAGsm38q6bwfi8HUowmSvQ9c6LhW2OygpGPC+vYdo1cXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=327REn5C/Io+qb6zi1i1V5e0SilIMf6OIserZp7gWrc=; b=JVnZ6FfAiqQPKgJSnY2llFSJYJ9nitGDwSHmQTvhOJXkqI9vZxgh1PlvcvZ+znO+3KiUXi DQtDD/TA5Re/xfuaucoafwE7Bw4T1fWv9oN02NLXroejHbDeUfXtiCo5kQz7lRd84teIUG XtyvX+QstdJgXYFipMNEpxzVFG+Kj8RF1xWnZlub9SxX0pHKgbLbItZsikHc2Yzj/KAEmQ 7ktCHTYaRHAFRds146jenMAxOHTnpdjgivwv2fqqtG2/nP1aAf33Ks6mfN+X57td3zQ6Vd z/HFP/YV6C1N6sbLXecI+FYtkYwS0Zt5gxL0N1J51As0BUlE9dniA9PSLdWFmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wq1s04zTf6; Tue, 27 Aug 2024 01:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47R16ln9057498; Tue, 27 Aug 2024 01:06:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16lfi057495; Tue, 27 Aug 2024 01:06:47 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:47 GMT Message-Id: <202408270106.47R16lfi057495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4e7cc8f545c2 - stable/14 - nvmecontrol: Move intel temperature page printing to little endian orderinng List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e7cc8f545c2bd3c7a104c9d53a9ca5329121094 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4e7cc8f545c2bd3c7a104c9d53a9ca5329121094 commit 4e7cc8f545c2bd3c7a104c9d53a9ca5329121094 Author: Warner Losh AuthorDate: 2024-04-16 22:36:41 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Move intel temperature page printing to little endian orderinng Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44658 (cherry picked from commit f0f7e9616da052e3d77b6e41301ccd655ae434fa) --- sbin/nvmecontrol/logpage.c | 10 ---------- sbin/nvmecontrol/modules/intel/intel.c | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index a01ce8d0f237..385b7d70c2aa 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -218,16 +218,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) err(EX_IOERR, "get log page request failed"); - /* Convert data to host endian */ - switch (log_page) { - case INTEL_LOG_TEMP_STATS: - intel_log_temp_stats_swapbytes( - (struct intel_log_temp_stats *)payload); - break; - default: - break; - } - if (nvme_completion_is_error(&pt.cpl)) errx(EX_IOERR, "get log page request returned error"); } diff --git a/sbin/nvmecontrol/modules/intel/intel.c b/sbin/nvmecontrol/modules/intel/intel.c index cc5c9c49beb5..5e58727cbfb1 100644 --- a/sbin/nvmecontrol/modules/intel/intel.c +++ b/sbin/nvmecontrol/modules/intel/intel.c @@ -62,18 +62,21 @@ print_intel_temp_stats(const struct nvme_controller_data *cdata __unused, void * printf("=====================\n"); printf("Current: "); - print_temp_C(temp->current); - printf("Overtemp Last Flags %#jx\n", (uintmax_t)temp->overtemp_flag_last); - printf("Overtemp Lifetime Flags %#jx\n", (uintmax_t)temp->overtemp_flag_life); + print_temp_C(letoh(temp->current)); + printf("Overtemp Last Flags %#jx\n", + (uintmax_t)letoh(temp->overtemp_flag_last)); + printf("Overtemp Lifetime Flags %#jx\n", + (uintmax_t)letoh(temp->overtemp_flag_life)); printf("Max Temperature "); - print_temp_C(temp->max_temp); + print_temp_C(letoh(temp->max_temp)); printf("Min Temperature "); - print_temp_C(temp->min_temp); + print_temp_C(letoh(temp->min_temp)); printf("Max Operating Temperature "); - print_temp_C(temp->max_oper_temp); + print_temp_C(letoh(temp->max_oper_temp)); printf("Min Operating Temperature "); - print_temp_C(temp->min_oper_temp); - printf("Estimated Temperature Offset: %ju C/K\n", (uintmax_t)temp->est_offset); + print_temp_C(letoh(temp->min_oper_temp)); + printf("Estimated Temperature Offset: %ju C/K\n", + (uintmax_t)letoh(temp->est_offset)); } /* From nobody Tue Aug 27 01:06:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wx4qXHz5TjZM; Tue, 27 Aug 2024 01:06: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 4Wt8Wx14lGz4mKy; Tue, 27 Aug 2024 01:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlRR2qvRYwPLBUR/0ojssMzT/yg9iONiQnZMDm9F+ZM=; b=UQtChHJs3fRMy4a9Yf5kpTzVwEmBDvEQuntHBm1HbX0egoFvDEoFZmjF6KncbOGfeOzOkk as6z7uTtx7eAT5x+3pTAxqWlL7JnNTn/lgLmXit/zfjNMtc9L3pQVNJGIVstbsnirNoglW Op1P3TgbZz7K/+IKrphnrAboGc74xcKFkfAB/Q5eOM4ejKV4Nxie47icmYJ7jymkjM6O5U A6F3fut4SYJu6dZpGjjnOHXt0Bzn/T2DG0cBaY3TK4UnNavi1CzzsoI562M02lEUvAqA1t UXwFK+1PfndzicVXXrMb7K69z8nNPeJGdeno0t2FFL5L5j5hn76B1S2jEMFZ4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720813; a=rsa-sha256; cv=none; b=XvhTvVJs0VPBp3/TN3BFE6+t3ZGjl12cxGbRnwQVvnHEEHjVBCbMWGg/guISD1gr/CtyMf sEM+77+m0Q4t1yKPzJ5wUaJ1A+O/4gq3Pme0kUNwRUTRZixRiEnfYKXBx8yesTlryum2Y0 dt/X2snbaaI588m2K11etIWurgX0jRayIx2IAtVSXbnXoUNkRsGNNuLJq/y2Bqu9QPE/Vo MqxyxAnIOxDP9U2GTkg24AVA8u8wHNo4nlwZOZYpQ0wT+VJ1CJo+Jxk3DwmQvKGf5Ao8Bj u413tvstWu1X3ow3t9Q8B8hbVbmbgu029JNBKBrUHiJ40NFBGPnjA5qRDXJykw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JlRR2qvRYwPLBUR/0ojssMzT/yg9iONiQnZMDm9F+ZM=; b=yIkjFLxkXOQtMTFkqKQIhGB1dEUibNq7DJOtnS8ZBQkJ/ErCXt7zBmiZxy4H+OhvXtK+0a Dbf5FQhkkq+buhZFnVRfwbI42mu7uGtyGGvIiFWAEceO3E6nIPBwMQrcTn5XXnDuQG6LIV PfVi1TG4QjAQTN8gFHXfYfXyzxKJCQJWhaSIt6WXEos+DszWXCMwaqld4GUeZOyxe2jhJS VYQY19+1qX9Ux1HcaBCsUaHGFDPcwUJXPbxtjBAsGZU6JDB6oN7+cDXA1VGjvKg5kAboSH y6ARSQL+IlBo08BfteuUJjgNfeZslcOdI3JI0Ah5DJrzKNl0KQe8XKtRFaqtBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wx0f94zV3p; Tue, 27 Aug 2024 01:06: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 47R16qip057728; Tue, 27 Aug 2024 01:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16quX057725; Tue, 27 Aug 2024 01:06:52 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:52 GMT Message-Id: <202408270106.47R16quX057725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 37eb64d7d25b - stable/14 - nvmecontrol: One file per line List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 37eb64d7d25b5bcf92e4eb8352874cfb25c96e1c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=37eb64d7d25b5bcf92e4eb8352874cfb25c96e1c commit 37eb64d7d25b5bcf92e4eb8352874cfb25c96e1c Author: Warner Losh AuthorDate: 2024-04-16 22:37:30 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: One file per line Move to a one file per line setup, and sort the files alphabetically. Sponsored by: Netflix Reviewed by: chuck, jhb Differential Revision: https://reviews.freebsd.org/D44684 (cherry picked from commit 49ea0889f2cb5e786e166fa9536c84f4a9994a6b) --- sbin/nvmecontrol/Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sbin/nvmecontrol/Makefile b/sbin/nvmecontrol/Makefile index e3d363b123ed..f534093b1332 100644 --- a/sbin/nvmecontrol/Makefile +++ b/sbin/nvmecontrol/Makefile @@ -2,11 +2,24 @@ PACKAGE=nvme-tools PROG= nvmecontrol -SRCS= comnd.c nvmecontrol.c -SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c nsid.c -SRCS+= perftest.c power.c reset.c resv.c sanitize.c +SRCS+= comnd.c +SRCS+= devlist.c +SRCS+= firmware.c +SRCS+= format.c +SRCS+= identify.c +SRCS+= identify_ext.c +SRCS+= logpage.c +SRCS+= nc_util.c +SRCS+= ns.c +SRCS+= nsid.c +SRCS+= nvme_util.c +SRCS+= nvmecontrol.c SRCS+= passthru.c -SRCS+= identify_ext.c nvme_util.c nc_util.c +SRCS+= perftest.c +SRCS+= power.c +SRCS+= reset.c +SRCS+= resv.c +SRCS+= sanitize.c SRCS+= selftest.c MAN= nvmecontrol.8 LDFLAGS+= -rdynamic From nobody Tue Aug 27 01:06:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wv5wKMz5TjZL; Tue, 27 Aug 2024 01:06: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 4Wt8Wt5fjbz4m9J; Tue, 27 Aug 2024 01:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRWeO6/MfCKWRRWEp5+n74tVlxizUYi2HoOfBnJ+clo=; b=nA2OkyDWHMtwL3JGDqthqswd6leJLLycO8B6FPRVxz8n4dl4e5Yfkn/H7DayGy/nFu2+gR kdQNwsdxGpnJbE9can/VISqNsYI7aFtax/Jy7TvAHrOSpNncxXEPqtjJHP5ZpkS7ukCwkf 5Plyl+FWXxMXToUlrzHH89oDTDEOkbS/w0s3Q9WB0AW+XUM58VmWyqYNxjS+hFPXE3YMmW eGDfnDZuuukehQH6AMr3MY/aSBzNaje1TERclYGh+TAr8lBKWNs79wZ88LsO+0VzNFnhS4 a0l9R4UN2NLV0fwwd3zskUYZnkOy8X2mqVj7BhlS5JkxsSWc367u5UL3G8zcZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720810; a=rsa-sha256; cv=none; b=Qif4XlMO3FQsjSjPUqlPe6cNk3czK1/gkfkAEpa8g1i2Hnqw9TmJNjKltPrLFR7IDolXfr 08/v4kgmo4mn5UfXkkFkAp8FftobFEKBdL2khYdG0MDfRJqy/3z9Ocix+mzFFGNL/7btK9 2vxifvnLfLRAXhIN2y9PmoCIEg1Jb/M4gwAmxyZ/m1Wil9dS0UGFnC58pGFOZWzKjSMMg6 hdDe6NPFicYsAf8ZpymGje9blI9lyDaAJEEPAYLVCC5qrzdDsNGia68hBpNt1QrzjxJets n2TIjWDkRkIu5t5kYRJIlZu/jSYk7CBskkMf21MO/axS7eMUZ5b1lCgMMb1wYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRWeO6/MfCKWRRWEp5+n74tVlxizUYi2HoOfBnJ+clo=; b=vAGfbTea2rGTRJj0P1mI4cvNwaxKa8XszwNWmhOqUeWLabNDuKW/S9Y2/GNCFzKkzEN0kz 2JKcSmpO7gM8ZZ7FezpFoyzf4sge0IqpSfhFTo9zvmf2Zb9iyMQCGzdeG1hM3gybkFOADs 7/s6P7ijrmpY+Te689+1a0zWwWqbQ5vW+vFzsEI6g1gDx5KSFk718zmCyXyngxACTyFNiY vQiajS/5V0rgKZz+e7TJ4VnqkvXwFPS7c/HwBqg9ZxIf9dOXJyIF99svov6fMmCqCYotGm +BQ+WhZM28Dw1Ko7L1/Y7p+tPbxB9BaS7mLvPluzFCM/G8+//7ki1fyVgag8Dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wt5FXWzTf8; Tue, 27 Aug 2024 01:06: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 47R16o4c057636; Tue, 27 Aug 2024 01:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16oTk057633; Tue, 27 Aug 2024 01:06:50 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:50 GMT Message-Id: <202408270106.47R16oTk057633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aaac429c1259 - stable/14 - nvmecontrol: Preliminary namespace documentation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aaac429c1259555fa990c1a97df8de7fda5f60f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aaac429c1259555fa990c1a97df8de7fda5f60f8 commit aaac429c1259555fa990c1a97df8de7fda5f60f8 Author: Warner Losh AuthorDate: 2024-04-16 22:37:02 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Preliminary namespace documentation Provide preliminary namespace subcommand documentation, along with some basic definitions from the NVM standards relating to namespaces. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D44682 (cherry picked from commit 383a44fc0bcb36bf67127856f0c5fabfea522bab) --- sbin/nvmecontrol/nvmecontrol.8 | 43 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index edeeb9afa10f..b812149b5c7d 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -33,7 +33,7 @@ .\" .\" Author: Jim Harris .\" -.Dd February 28, 2022 +.Dd April 17, 2024 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -302,6 +302,47 @@ will set Retain Asynchronous Event. Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces. +Each NVM device consists of one or more NVM subsystems. +Each NVM subsystem has one or more NVM ports. +Each NVM port is attached to one or more NVM controllers (though typically 1). +Each NVM controller is attached to one or more namespaces. +.Pp +After a namespace is created, it is considered +.Dq allocated . +All namespaces that have not been created are unallocated. +An allocated namespace may be active or inactive. +An active namespace is attached to the controller and may be interacted with. +A namespace can move from active to inactive when detached. +An allocated namespace may be deleted to become unallocated. +For more details on the nuances of NVM namespaces, please see section 2 +.Em Theory of Operation +and section 3 +.Em NVM Express Architecture +of the latest NVM standard. +.Ss ns active +Provide a list of active namespace identifiers for the givne NVM controller. +.Ss ns allocated +Provide a list of allocated namespace identifiers for the givne NVM controller. +.Ss ns attach +Attach an nsid to a controller. +The primary controller is used if one is not specified. +.Ss ns attached +Provide a list of controllers attached to a nsid. +If only a nvme controller argument is provided, a nsid must also be specified. +.Ss ns controllers +Provide a list of all controllers in the NVM subsystem. +.Ss ns create +Creates a new namespace. +.Ss ns delete +Delete a namespace. +It must be currently inactive. +.Ss ns detach +Detach a namespace from a controller. +The namespace will become inaccessible, but its contents will remain if it is +.Em activated +again. +.Ss ns identify +Print detailed information about the namespace. .Ss nsid Reports the namespace id and controller device associated with the .Aq Ar namespace-id From nobody Tue Aug 27 01:06:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Ww4txWz5TjK7; Tue, 27 Aug 2024 01:06: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 4Wt8Ww0jz8z4mN0; Tue, 27 Aug 2024 01:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3kVlSuc6/d407iH5kszO5dTB6WfVLOO4CYv6C+bEmc=; b=NvufISk1rbnV64ySCB15VHOwJ+ChxwH4Oncbg/Fy78AvrhMbCEsxSJ8aEec3HIqLpQLLSb xLIcQMlp9hAm70+jNHLx32BIQ1pwpcCeNVUhIQJ1TkdtSTPptf5k2BbZxm1X7ohAE87a1M oy/yUwatdBZluzKEs0PcgzGtb1P5LOhhdAvVlu3E0/WrxTPMU7sP5+q6jytx5zspZ//RIr sH9PqYmjS8zALNshQveWSaOD68T+u/1OMDwTAUj/Pmi+i4wRNJ5V9Fu3scN62sh20PocAc 7Ag2Uc7XAxpzFRpdE7Ln4RjETc55yb+ZRCJk0qG9V9AV/3Yib3fQ8voUfwKYGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720812; a=rsa-sha256; cv=none; b=Z+bnHWmiVjJtcllL6LxNwbl93MPg2zL52uF/m1euyD6bqhbJjecii5Dk90c3qFihp7Rhk5 PpChJajF4ycGP17YHE/QGwf8J5dkQUTpO7/nB2fQN7kVdhkLS6btEYTAss7dm83k2JuSW9 epyrOFpebzkrwYWKg9kx7ZWSXHPN7UqAnz+O8buBukpWjvskJ2mtM8SgnQE+jIX8laLIyX hmhJIpTgdNjCZGUVYQmCJ0nYJAdYsME7Wfh3mrd5XCqhDAxwO007udouI1UEhTjMSm1nkF B1AdnEBD0s0BocGJx7+8ljMOfp8vnjeUJAk4vvw82XeAUt6sQLi+ahWejf+N4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3kVlSuc6/d407iH5kszO5dTB6WfVLOO4CYv6C+bEmc=; b=D+FSQhnuSLdVjBPvM8Yspi9jIKyO6sQPcKACZ8y1AHmjbgG0MudZnp5IaJJy5ZrVeeIIm3 a2Rg28h1dxRySQMOaN+U8NWlPcj4ckH/FAbZnwBAHQecBBpLcqFmrAHPkthC9e+IbiWiYq 42r+foHQ/3QQJX00V+/2vQpqK/l8nibuxERBaPf41JjXA8xkx/fzy3n+1HhAJg4EizmRhw UDSn55hEDhzp/ZOL3ru/KcSuwygkgSQAhye1D9/8nnFBmMWfcr9MFQaODaq8zOD6cY1NMV r1nxhPyw/tHjA7QnWrHEqx+OuofuD+uVl2E5YvWCephF/6RbK8CV0IzeOrkHow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wv6TbhzV6j; Tue, 27 Aug 2024 01:06: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 47R16pSk057686; Tue, 27 Aug 2024 01:06:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16pnU057683; Tue, 27 Aug 2024 01:06:51 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:51 GMT Message-Id: <202408270106.47R16pnU057683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: efb91b313c64 - stable/14 - nvmecontrol: Add nvme 2.0 fields to read_logpage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efb91b313c644c6bd50b24685a16cff83eb41a07 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=efb91b313c644c6bd50b24685a16cff83eb41a07 commit efb91b313c644c6bd50b24685a16cff83eb41a07 Author: Warner Losh AuthorDate: 2024-04-16 22:37:20 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 nvmecontrol: Add nvme 2.0 fields to read_logpage Add the lpo, ot, csi and uuid_index fields to read_logpage. The logpage command has not been updated to allow these to be specified. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44683 (cherry picked from commit 98ab7d0a30f8d0fc9c51e1e97ac29f87750b526c) --- sbin/nvmecontrol/firmware.c | 3 ++- sbin/nvmecontrol/logpage.c | 15 ++++++++++----- sbin/nvmecontrol/nvmecontrol.h | 3 ++- sbin/nvmecontrol/sanitize.c | 3 ++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 8fcc4ba4f46e..74d185313f50 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -103,7 +103,8 @@ slot_has_valid_firmware(int fd, int slot) int has_fw = false; read_logpage(fd, NVME_LOG_FIRMWARE_SLOT, - NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &fw, sizeof(fw)); + NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, 0, 0, 0, 0, + &fw, sizeof(fw)); if (fw.revision[slot-1][0] != '\0') has_fw = true; diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index 385b7d70c2aa..770eed3d7848 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -191,7 +191,8 @@ get_log_buffer(uint32_t size) void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, - uint16_t lsi, uint8_t rae, void *payload, uint32_t payload_size) + uint16_t lsi, uint8_t rae, uint64_t lpo, uint8_t csi, uint8_t ot, + uint16_t uuid_index, void *payload, uint32_t payload_size) { struct nvme_pt_command pt; u_int numd; @@ -208,9 +209,12 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, pt.cmd.cdw11 = htole32( ((uint32_t)lsi << 16) | /* LSI */ (numd >> 16)); /* NUMDU */ - pt.cmd.cdw12 = 0; /* LPOL */ - pt.cmd.cdw13 = 0; /* LPOU */ - pt.cmd.cdw14 = 0; /* UUID Index */ + pt.cmd.cdw12 = htole32(lpo & 0xffffffff); /* LPOL */ + pt.cmd.cdw13 = htole32(lpo >> 32); /* LPOU */ + pt.cmd.cdw14 = htole32( + (csi << 24) | /* CSI */ + (ot << 23) | /* OT */ + uuid_index); /* UUID Index */ pt.buf = payload; pt.len = payload_size; pt.is_read = 1; @@ -795,7 +799,8 @@ logpage(const struct cmd *f, int argc, char *argv[]) /* Read the log page */ buf = get_log_buffer(size); - read_logpage(fd, opt.page, nsid, opt.lsp, opt.lsi, opt.rae, buf, size); + read_logpage(fd, opt.page, nsid, opt.lsp, opt.lsi, opt.rae, + 0, 0, 0, 0, buf, size); print_fn(&cdata, buf, size); close(fd); diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index 4187c9bee432..2ce4ad4c5c2b 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -84,7 +84,8 @@ int read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdat void print_hex(void *data, uint32_t length); void print_namespace(struct nvme_namespace_data *nsdata); void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, - uint16_t lsi, uint8_t rae, void *payload, uint32_t payload_size); + uint16_t lsi, uint8_t rae, uint64_t lpo, uint8_t csi, uint8_t ot, + uint16_t uuid_index, void *payload, uint32_t payload_size); void print_temp_C(uint16_t t); void print_temp_K(uint16_t t); void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, void *buf, uint32_t size __unused); diff --git a/sbin/nvmecontrol/sanitize.c b/sbin/nvmecontrol/sanitize.c index 4611a6964a4d..52e1b0f4dad7 100644 --- a/sbin/nvmecontrol/sanitize.c +++ b/sbin/nvmecontrol/sanitize.c @@ -183,7 +183,8 @@ sanitize(const struct cmd *f, int argc, char *argv[]) wait: read_logpage(fd, NVME_LOG_SANITIZE_STATUS, - NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &ss, sizeof(ss)); + NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, + 0, 0, 0, 0, &ss, sizeof(ss)); switch (NVMEV(NVME_SS_PAGE_SSTAT_STATUS, ss.sstat)) { case NVME_SS_PAGE_SSTAT_STATUS_NEVER: printf("Never sanitized"); From nobody Tue Aug 27 01:06:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8X06Rhvz5TjP9; Tue, 27 Aug 2024 01:06: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 4Wt8X04g1Dz4mNt; Tue, 27 Aug 2024 01:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/DKFYAoKw3IRicfeHGXQoyjaEOStQ6Nd2a/W0NYDA4=; b=eosh9gDe4tcRKi1aQjFUfJkpI554k8J+ns1qgQgAvh94jMDbsE8BLWqC9ctyFAvnwuAU80 vJ+6paeVjTr3vaz02IMyzA3EmjZzPdCnfz/P7LMAt6XmJTeTYS2IoTkAw4Rm4ux6OgzlJC xIES4lX1+1bSYAjxqObUua9ecW8DRLSzERKOT1rOzOs3+l/LTQ/mzA46TsbGTjuxZctdCF hD5urQLkIJ7F1MoqfpgiAnaWNSL3X9IxQ8PRg592vcH3ahjccp6gZR5mzEJkal99Hh2pDH RZJj3pXqLlw0MOYUHHK9cA8tYtLuIqvN2sOOMKtXa8ftgrmluhflBhlopNrO4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720816; a=rsa-sha256; cv=none; b=Lg5hXY6+wZ10E4EEzcV/FDvIASkKNQV+0/fM0Xunu/u8rTtyBy1BodFKbxVqvWPMN192ZA xciEiJRGcLzVCXz/jQlNKhfdmDjRR6M+sQJh9nWIsh+c2Nj0Ku2lLmB3uDPdJq5IEPuEXB 0yZOCXGyFMACsl4ydMW5+Ntx912355S3pJQgReVIGX+IYHcmLSw9KMGOxwUXd3iQLAXivq p8n4Ln5yleZic7Wnzi9TSB2Xi55LcBpqS9VMnT5Gw9Y21LuOGY+e0O17YD+dZU4d+aNjdO Hfx2Hm2Gr8Ju9YfYTUo5PTD2pqbaNXFSfut3Z6hMwfItTK8zfjoLB+pGk97udg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/DKFYAoKw3IRicfeHGXQoyjaEOStQ6Nd2a/W0NYDA4=; b=u+OH+X00fM0Au8PwjtMLPdAuliDVAE+ghcBchDHPSOOdDPDMdfL8s0RMe0QGqpakvY5kTM PpkLtqNNYQacp4i0lmyPSPHPYOpqpIXNhj3EPUc3IFimDObIKndkbZYs3Q0S3RONHgKWnb K0iU4b2kah6Vh2xph2lKLs2IILnwVio35oiWZAIi8xFOAqMmCWcNcNfEibHZYwvcVhe7F1 kJYumNwXiSyr5bx95CiRASprjnJITOKqCsXF5f8koF5HbevsfsS+29OjZRD+873+Hw7VTl PfWZW75/NZRDkFKzrPHMTJYg1yxAcT4/mhBinYGRsCG4wPKRiMKb+Xnn1AijOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8X043nXzV6k; Tue, 27 Aug 2024 01:06: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 47R16uWC057869; Tue, 27 Aug 2024 01:06:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16u8q057866; Tue, 27 Aug 2024 01:06:56 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:56 GMT Message-Id: <202408270106.47R16u8q057866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8d2b36ef6cbd - stable/14 - Fix incremental build with WITH_NVME newly enabled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8d2b36ef6cbdc6b147d5fce93b3e2e7336c5becc Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8d2b36ef6cbdc6b147d5fce93b3e2e7336c5becc commit 8d2b36ef6cbdc6b147d5fce93b3e2e7336c5becc Author: Brooks Davis AuthorDate: 2024-04-18 13:57:38 +0000 Commit: John Baldwin CommitDate: 2024-08-26 23:39:15 +0000 Fix incremental build with WITH_NVME newly enabled rescue.mk doesn't get updated when options change so nvme_util.o is now missing on architectures were NVME was previously marked BROKEN. Reviewed by: imp Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken. Differential Revision: https://reviews.freebsd.org/D44826 (cherry picked from commit 26a09db3add30238b99e3214c56a3aee63fd71d1) --- tools/build/depend-cleanup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 2627b19d4607..a18b9ca75a45 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -159,3 +159,10 @@ if [ -e "$OBJTOP"/tests/sys/fs/fusefs/mockfs.o ] && \ echo "Removing stale fusefs GoogleTest objects" run rm -rf "$OBJTOP"/tests/sys/fs/fusefs fi + +# 20240416 2fda3ab0ac19 WITH_NVME: Remove from broken +if [ -f "$OBJTOP"/rescue/rescue/rescue.mk ] && \ + grep -q -v 'nvme_util.o' "$OBJTOP"/rescue/rescue/rescue.mk; then + echo "removing rescue.mk without nvme_util.o"; then + rm -f "$OBJTOP"/rescue/rescue/rescue.mk +fi From nobody Tue Aug 27 01:06:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8X010Yzz5TjX3; Tue, 27 Aug 2024 01:06: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 4Wt8Wz3j3Wz4mJ6; Tue, 27 Aug 2024 01:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXmX0KRnkYb4fbbNytiYS787zrwdX9qzhTDGTrVqe7o=; b=oOzT2uOSzj8tP14Pc2BrT63aRsqV+uACqMArm485jpt974xpAKQkoS4zFb2DQ8Hoeubnrd 5Wa8zufBr98/r1KwS3L0BHaKLzg5C98Sd6D/fZGWRB7lcML6+ZUbsqra3d+UHH2T8Gg2Pd lwsCEZqECzpQeZDjt0gbqUFIq36cyusPrpUpfB2EjylbqhuvrSHDnpJjxBOTIyMP1aSUJf I4sUnI2YxxIeFytF6/YbgY1Ftc1R1UTLiFKM/UxuEYGC0SzELQMexbf04SuSCyMSffrGrV 6w2Mzq1q0W7Txvh84Jz00zwl08KExyUou8U4ql40mxmrDGgaxUW/etAWlkm4eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720815; a=rsa-sha256; cv=none; b=H1H7iZtk/qpYEicB1jI8V0C4roTnKX+N8WDJ8quHDqq9IXmLIj4Nb9L38BrHlBT9IvNgnK ToOxAgBgGDO3LFMdw3X2gAxuXIGlQxDcLNtMnUkBsil1VuIMJ7OPXNQX50VAIJkJLpal55 iy/t/Rju7aDCohDOW+puzMye/IKM9/HKWAdn01fz1qKmxbm59OGfA7TdzTR4W2IS96Rqt5 p41sBU8uLAb5vgoGXQ1Xel3pZ+PnZpMXvGDPZ38zRb+iRg+K43psoseMLOcNHcAaS8pRod vHv05yDxiS888HWNllxGvCLt5eLw/3B56jbrHQOOMd+8cQLNSz/nGbGo8b8hgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IXmX0KRnkYb4fbbNytiYS787zrwdX9qzhTDGTrVqe7o=; b=rj4LyNessC9VF7phrAGy53XOeVnZBAJm3WxJdDF9TX7izUwDtd/2ejtvHjo/DijGmphfP5 5HKoGKlFq7M7mvEFT5jN+f4AsrUHhtjukixn1ogduTT1zwF5zTr/iIGifheBVlsi5n5CF5 b1NrLLKOpEfeIeCOvUqnZWGz9EjBeA+SH4Hs8CHIV5igPDfJgmUoBwX8JmJyvgXZ6rUb4y 0xMWgSjhHGNGpp+skV2ejT5MHkMoUHffe6sz6yBQkwNeQMSQ/uRVRVTtbEjq4VqgTZ1/kj XdNOhStcj59bSHHHEOUM4+VOdlwP6RPtugYvwujoo9IgNqZi0oFsvkZuoLO+Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wz3JzYzTfh; Tue, 27 Aug 2024 01:06: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 47R16tf5057815; Tue, 27 Aug 2024 01:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16te6057812; Tue, 27 Aug 2024 01:06:55 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:55 GMT Message-Id: <202408270106.47R16te6057812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ec8c44812a50 - stable/14 - ObsoleteFiles.inc: Don't remove recently added mixer(8) tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec8c44812a503b3541297ede11332939a5e85b27 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ec8c44812a503b3541297ede11332939a5e85b27 commit ec8c44812a503b3541297ede11332939a5e85b27 Author: John Baldwin AuthorDate: 2024-07-31 19:09:19 +0000 Commit: John Baldwin CommitDate: 2024-08-26 19:03:57 +0000 ObsoleteFiles.inc: Don't remove recently added mixer(8) tests An earlier set of mixer(8) tests were removed leading to this entry, but now the entry is removing the new tests. Fixes: 94a86f3f6920 mixer(8): Add tests (cherry picked from commit 09ed116dc5b84e6b3478b42e5b1076604e92f676) --- ObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 788edc0eac38..f74ace221420 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -3644,11 +3644,6 @@ OLD_FILES+=usr/share/man/man4/ng_h4.4.gz # 20210923: rename boot(9) to kern_reboot(9) OLD_FILES+=usr/share/man/man9/boot.9.gz -# 20210922: Old mixer(8) tests removed -OLD_FILES+=usr/tests/usr.sbin/mixer/Kyuafile -OLD_FILES+=usr/tests/usr.sbin/mixer/mixer_test -OLD_DIRS+=usr/tests/usr.sbin/mixer - # 20210921: remove cloudabi OLD_FILES+=usr/share/man/man4/cloudabi.4.gz OLD_FILES+=usr/share/man/man4/cloudabi32.4.gz From nobody Tue Aug 27 01:06:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8Wy4ZKsz5TjRZ; Tue, 27 Aug 2024 01:06: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 4Wt8Wy1zfZz4mWN; Tue, 27 Aug 2024 01:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=anyKFEDXQ47y3oM+JLqzLKYgn7SQuCqNCpWYsWrJrAM=; b=Yo07i+QIWYZtd73iu8G2Ylr63+YRB5QQy9HLhvAa2qWVUVy6v1ROg++pc2UCFgpo0x4JJG lH3jOTHWEI7ahhJU3wTJTXPQPudUoHnJEyI5BITWNkGOQcxR+H7SgbrgJ4zJFYKJVspDSa usrqQl+cVTsslqvurrNu+B1BAu+gXJfQqLRj5NZysTRrs8OkosOuITfgorSmXLMJffn2YK T+1W5AC5x/mmShvh+sk5/Tk9T7T745ZyDNba46mC3pGHSxbPZ50xqMKbWDgyisnS8CNUzL LN7ADkt9FYhSoZ0gpq5N0V+7daQwrsXqdiIuEnyhn7k+S1AYeT8toSlAr+S/Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720814; a=rsa-sha256; cv=none; b=W6ERnjIqa+H0MZZ7dRB1QgbBB6nJcyr4CX2CUg57TgJmy4esp/GOLMXB+ovtqpfySJcS6H pwJ985Y4DL1G5V/JPI5xECY7N3rzXAxiO4N0QL9s7EtKMXJE8ewjv38aCLjav5POn1idZ/ hhSxdWpLt38ZyYzA4wJc1agVPgwzogL9OnNys8ZrV0P1Nbu9G/axIuoRbwOWy1+um628e2 tTCThfL3/CifGD1fgfoMizBQGUmIk99ZndAPTM8ElU1RLoPA6ne2uGzUFrEnGFq4PwocvN GQFjKTKvh9/hKvmXLAntq7IDwGKBncivvpZ6cn+P+iqChPf1iTWpXMUmyuN/6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=anyKFEDXQ47y3oM+JLqzLKYgn7SQuCqNCpWYsWrJrAM=; b=PGOI/r8Zfbasx90iJK8a4JhuX1sf3jU8fBs3t6AfeziGfVjHh3tlUzPgt8pz8Rvr5Tik8s sK3D6b6eV7897x19pvG5xmvsiQtVwz5/sktrNN2l/NCUdtR+A+cr/jm2JdeUbKOw4nyb8N uLv63GjNmj8TSp+T2NfiFKq+Cw86cpeGKqzOJX8c0YA3uZxU89/7ohTxI0jInQiuZzYCh4 r69TsBBCSssUDr+H4A5D3tgaYk25Jtf3A+ObpNIMbUOWFxH28OohQWDVg1PIoXKohfAjzH urnAfyvOMLTNKjtt8eylD66UYwa03tx4npezUjK7XWb2QpZq7D1IzIFV5b3/3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8Wy1YbKzTlf; Tue, 27 Aug 2024 01:06: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 47R16s9H057767; Tue, 27 Aug 2024 01:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16sr8057764; Tue, 27 Aug 2024 01:06:54 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:54 GMT Message-Id: <202408270106.47R16sr8057764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aba2d7f89dcf - stable/14 - WITH_NVME: Remove from broken. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aba2d7f89dcf7f17f3f9a13ea0b62a6bd02c0db9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aba2d7f89dcf7f17f3f9a13ea0b62a6bd02c0db9 commit aba2d7f89dcf7f17f3f9a13ea0b62a6bd02c0db9 Author: Warner Losh AuthorDate: 2024-04-16 23:07:49 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:31:03 +0000 WITH_NVME: Remove from broken. NVME works everywhere, so we can eliminate this. We may remove the option altogether. Sponsored by: Netflix Discussed with: ken, jhb (cherry picked from commit 2fda3ab0ac1903a977ef5d39d4dfb2ffe86ff1b7) --- share/mk/src.opts.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 3ff71df3e0da..ea5931ad6c1d 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -347,12 +347,6 @@ BROKEN_OPTIONS+=MLX5TOOL BROKEN_OPTIONS+=HYPERV .endif -# NVME is only aarch64, x86 and powerpc64* -.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ - ${__T:Mpowerpc64*} == "" -BROKEN_OPTIONS+=NVME -.endif - .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != "" __DEFAULT_YES_OPTIONS+=OPENMP From nobody Tue Aug 27 01:06:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wt8X31B67z5TjPB; Tue, 27 Aug 2024 01:06: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 4Wt8X15xzDz4mCW; Tue, 27 Aug 2024 01:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HazOU6R1Hq6BSlw5EXQ7ZNEPflGwr2wPXmgiOb+d5I=; b=NDo5XD+Srha4ucqHgbe3tNS/tnGNjx4gjO8SxgCStbuffHE6KdCGK7XDjUWXd7GdHOS93X u4sGRwLh/2byG7cjPOBL7TANCGiDJdX0m5SSwklaSGAWSVLSrxgpuCu32+GaQIbbJBd5WV F1odm3CJK1nsuVIvd6e27bEoPGqsN0/PfrmYY83SgbMxUVmiuHu66tGh+m6XAsH9qw8vXi IpFypJzOcnutjvj9rr1djI/lD35Mt6aCirb49YOiSnuYtUo/45VIi/eyTL4xYh3wRmjBr6 Kbnp0MfEmV9KOGajD3Ft8DiyYsw/3IJsjvCZqAcNa9XU+pygX+Quej9Wb4fBLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720817; a=rsa-sha256; cv=none; b=Orgefw+cbGJXrwLAPiJQ//QynJp6Sa8NEeraIdGpy21wPzLdqx1Q9pLe2/T2wGPLwbUJOu 67PlFWl57SP1USmXGhF/xgVHorvX1W6opYR3uDR6xBUPcuVXWZEveyJBL0nZx8qN10h218 Y5PtvUWLB1OHAVxOykTnWXbeJVRljOM0cLPdPvQwmqVlw/abUk2hzTyar52TGUquxEdwH0 qb/WSwnuWJzerVPnA56Q5Mqd9UNqeQbSymvQjYCdJPEAZNN591VCi4fM9+hvaUbIbyz+LQ IVoH+hc/bjkURW5pR5yBag7vBTDLj3IpTkCsVGCx2JOXXWgmQ4pSWnsNPNu2sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9HazOU6R1Hq6BSlw5EXQ7ZNEPflGwr2wPXmgiOb+d5I=; b=YfbSNyGD/kUxNFi7wAGbHsemcQHA1jQFo1XyNlO7LXTTZ+3IJKi8y4ezRV0p6CvIutPEVG f6HqLa7fgpvmjYAv1wBtmqePrk3VEtoplWIwpSPIvmSEHOzxK+7rVSK3yCHrxqHnf1s9lG jzqa/KjylZwHee10l9XbZzU4pkq3thptbaMNKuql73Cqo1XFp0/JUcjcQ10IMUcZq+FkTE 6jAdYh3ayQ63xvU4x3uDa+7sdLov2RwVmbRpIo4E5qfKvR2aTACAwHfWQ1w8N81l6wnzdU pCl+nEnp7QX9+hfBHPISVp/G2Sh7y0A3MKBF2O4ajzk71iCVGjoQ6CPE25rl5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wt8X154glzV3q; Tue, 27 Aug 2024 01:06: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 47R16ve5057913; Tue, 27 Aug 2024 01:06:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16vs3057910; Tue, 27 Aug 2024 01:06:57 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:57 GMT Message-Id: <202408270106.47R16vs3057910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 818e3dc03d0c - stable/14 - tools: Remove stray "then" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 818e3dc03d0c2f90c3ddf67eff7bf7080e8027f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=818e3dc03d0c2f90c3ddf67eff7bf7080e8027f7 commit 818e3dc03d0c2f90c3ddf67eff7bf7080e8027f7 Author: Cy Schubert AuthorDate: 2024-04-18 14:31:13 +0000 Commit: John Baldwin CommitDate: 2024-08-26 23:39:32 +0000 tools: Remove stray "then" Fixes: 26a09db3add3 (cherry picked from commit f7f570eb97c70bc7f545d79a96c3192181bb8dd1) --- tools/build/depend-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index a18b9ca75a45..271aac789be3 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -163,6 +163,6 @@ fi # 20240416 2fda3ab0ac19 WITH_NVME: Remove from broken if [ -f "$OBJTOP"/rescue/rescue/rescue.mk ] && \ grep -q -v 'nvme_util.o' "$OBJTOP"/rescue/rescue/rescue.mk; then - echo "removing rescue.mk without nvme_util.o"; then + echo "removing rescue.mk without nvme_util.o" rm -f "$OBJTOP"/rescue/rescue/rescue.mk fi From nobody Tue Aug 27 07:25:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtJx61Jb2z5VFw5; Tue, 27 Aug 2024 07:25: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 4WtJx56fbBz4T8X; Tue, 27 Aug 2024 07:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724743545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IeanAedIsS41P/kBQarn5fRw4t3K1pK7+RNW3qwAcNs=; b=qt3WlAyN3QEfOHjmJ2YCLS63coSwAwCPRS0nzKN44yKBdBvw/rjbzLk9VHss57Vfsn/GL6 /fumDZ+pisXRjBqbyObWQ7JfzcsVP9M22EKQSyyv/j7yzHnqenUaNlbIEcOzCpnjlIqzER 6gqOIuwK499ac2tAgB7ihGCdy+jwIUqpZCmX6RtXBIMOXo8ts/qjkOeKDt/4RjkdmVSQn+ V1lgXlEev4ZnW5+9y3mGftEIINVmBCIL5g0m8WP4E0LcYHXb8+fNqq3+QOqXhrvdfnvlAX V2JUeA4WfKr4dkIpV86geE0qYWluXnG+4yOoJGHmq+rRtsgNjtE3SE0abODf3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724743545; a=rsa-sha256; cv=none; b=pv6t6UpkA8caevDgzFsggeV72brFuZttupsIkTIAWOFT4+8ORCqgdBSop19tnLg3o5kooD yYqce2NjMpttGXqOBGJ4HmYP6oH7Qy86W5aRUTqcIvPAQiJ94swlRsETsttxSjV7A2ke9W SVGbQfG4VeUv9fmRkHjbzczHEWLGQEs3SLms3XkT75+Xu79v+iPASnKRgtgY2x+D0RJI9S 06IoFue0omeGJeh6kbGh8y+fFAd9JmTE3DsiHHWUiCZhAh3eBRuvv1joMRedhS2U4f0H7U W4KdKZHGbfiN+eKm0BJtzVOyiS3cZXomhDp+vySeL/jwFfOyNtcOZ9yeJ9AZWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724743545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IeanAedIsS41P/kBQarn5fRw4t3K1pK7+RNW3qwAcNs=; b=uPYSyCtz5ki3EtqglwyadWH3IKueTCzgXIEHxsPfOBTyIOa1dUhd2pAJo39xneH64E0H7G Yuli3+DjP60kbFMfDVsa/5eDahzbBjKlOkDXnNmqBcJDkFUrraVQgsgfm1y2af/jAYG7wO JZGwKhE2lD2UjRV9BJNPfEFfpmgNKFh87LoPYw9l21rxJflZmxG+phWSMh82/4eJjNDAH/ pgMa2q9Z9Rs2MsHChgVLRcbkWDGm0LP4MCYuGtk+YPt/VLufZnv58EwVZJiAxTwZ+Wqla3 8I0vAkqWoyM0MxXA1BOcI0xAeXgw4UBwbwMXBIlV+HCSXudYNXJPg6AWhvcoNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtJx56FyCzh7N; Tue, 27 Aug 2024 07:25: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 47R7PjqP006433; Tue, 27 Aug 2024 07:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R7PjWH006429; Tue, 27 Aug 2024 07:25:45 GMT (envelope-from git) Date: Tue, 27 Aug 2024 07:25:45 GMT Message-Id: <202408270725.47R7PjWH006429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: ef5752762ba9 - main - contrib/bc: fix build with GCC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef5752762ba9ec54d5c02023167d24bcdbb45fd7 Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=ef5752762ba9ec54d5c02023167d24bcdbb45fd7 commit ef5752762ba9ec54d5c02023167d24bcdbb45fd7 Author: Stefan Eßer AuthorDate: 2024-08-27 07:11:58 +0000 Commit: Stefan Eßer CommitDate: 2024-08-27 07:25:16 +0000 contrib/bc: fix build with GCC Building with GCC failed with the following error message: error: to be safe all intermediate pointers in cast from 'char **' to 'const char **' must be 'const' qualified [-Werror=cast-qual] This was caused by main() being declared with "char *argv[]" as the 3rd parameter, but argv later being passed cast to "const char**": 113 | if (BC_IS_BC) s = bc_main(argc, (const char**) argv); | ^ This is fixed by declaring the 3rd parameter of main() as "const char *argv[]". Reported by: CI MFC after: 3 days --- contrib/bc/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bc/src/main.c b/contrib/bc/src/main.c index e4a1f7399bb4..da4c27156029 100644 --- a/contrib/bc/src/main.c +++ b/contrib/bc/src/main.c @@ -54,7 +54,7 @@ #include int -main(int argc, char* argv[]) +main(int argc, const char* argv[]) { BcStatus s; char* name; From nobody Tue Aug 27 08:09:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtKvw4cxwz5VJv7; Tue, 27 Aug 2024 08:09:48 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (using TLSv1.3 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 (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtKvv4Rp0z4XN3; Tue, 27 Aug 2024 08:09:47 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=iIlULw04; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 2a01:4f8:13b:240c::25 as permitted sender) smtp.mailfrom=herbert@gojira.at Date: Tue, 27 Aug 2024 10:09:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1724746177; bh=l9PJIrhGmu8b3okJby55exTrQiRwD5jPhHET43Io5PQ=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=iIlULw04ItTTLgutshagECob4pfhGNIkBpIon5yWVTEfex2FnWapdA9kqbDYOJkOH yaQH85+csiTlFaDJS1MLgjRseGnsjF6bRoxv4RSyAEvxtahrh/gSMH8TlOwsRlmwRW CLJOMT1ZQw9/7r4Ts9R6R0NeTxQu5ZdVuODq862ixqQQz0jwo9Gv+3bKR6PvXNFjdp IoxCbUlIRvvlTaio6aQ03MCT6CE5MpBieP+7dThBx/npf+/QLCAAPqNbb+NFb/9h+k 75EtTUbIx0apblylhl0o2JUGyAQLF7FW+EOXuWSRClZoJmIT7YxMWGCSlXVCnXeFUG 5aR7D9HU96duQ== Message-ID: <87cylubd5v.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: "Sean C. Farley" Cc: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying In-Reply-To: <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> References: <202408011538.471FcJDS026885@gitrepo.freebsd.org> <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:240c::25]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DMARC_NA(0.00)[gojira.at]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-branches@FreeBSD.org]; DKIM_TRACE(0.00)[gojira.at:+] X-Rspamd-Queue-Id: 4WtKvv4Rp0z4XN3 On Thu, 08 Aug 2024 06:35:38 +0200, "Sean C. Farley" wrote: > > On Thu, 1 Aug 2024, Ed Maste wrote: > > > The branch stable/14 has been updated by emaste: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > > commit fc43a1b6842afa806dfd7ba48de5bece63d04456 > > Author: Ed Maste > > AuthorDate: 2022-10-14 16:44:35 +0000 > > Commit: Ed Maste > > CommitDate: 2024-08-01 15:11:45 +0000 > > > > tzsetup: symlink /etc/localtime instead of copying > > > > Using a symlink means that new timezone data (installed by an errata > > update, say) will be usable without having to be copied again. > > > > Reviewed by: bapt, kevans, philip > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D37005 > > > > (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353) > > I ran across an issue with this when using "etcupdate -D" to update a > jail from the host. "tzsetup -r -C /tmp/chroot", as called by > etcupdate, prepends the path of the chroot to the link which breaks > things inside the jail. I have this issue whenerver I update jails with 'make installworld DESTDIR=$X'. Will this be fixed or reverted (at least) in stable/14? Or works as expected? Thanks. From nobody Tue Aug 27 12:18:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtRR22brbz5VdTQ; Tue, 27 Aug 2024 12:18: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 4WtRR21vbjz4shd; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=da8KHlQHnrSAIAKIvra1F/Yt7o8XtjTq3Ptulvp9H5Q=; b=fcIqvBgqORszj20OPbyaY/FTdoKXarH/+EvkBNHQ3+vc1wABzaFNEbLG8s3MFj+1fWJoHM 2zDVQVPe5u2ct5qz4KYXrdhdny54jXlwODC+0linCnO9ttDblBPWXWXvSYGr1a+bva6qNn DudMKEHN431hKJw60HbTT666j+484JRJ/OLQuh0+6Je/TsvlXGTzreN1qZd2EA7M2tWz7N dIc6s1/E+Hx+S2xbKKjFg7lxobud0rpz5757J4cWfO0h05qFyv2EGrboBD/ltHJBmgWK72 wuiPCxKLcd2aMeUS18DiNPnt8irA/YOrNhq1c2EjIxEtA7JXd4cqQ1VMPSXTag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724761118; a=rsa-sha256; cv=none; b=wHCDVhufqJvMUrJJTN6ZB0JdkcrwGzVqh/7QpG8t4bAuAuwPzN1ugBoZxg1cn8RbxbLE75 Ij2tKnm6202qQcAw12JL2cGbMVciv6gORrOzI7GEg/MmD2qMSuhEmz/QnOXowluh9zk5RG kQZm6yYUAU6z+sg7n3XkF5jlTRuKmuqeMYMK+6NP6/JAc6VXfklKzFDJr2mI14eBelsyqI 0G6TNNQyNgtzfraok4guZxAnw6RGuf2OSa3teECxtXajYd0TC+C9Z2aL47o5LuNg0vK4WJ llMVdghWFRb/5m9nJbG5qkMr/GebN4Oirty47+HIqI6sdFCkUHT6Aj+FEaE2+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=da8KHlQHnrSAIAKIvra1F/Yt7o8XtjTq3Ptulvp9H5Q=; b=c+FUQ16VMY3QPXGZ7wDufSERl05huCPugToIkj1gD5ggg+hQCpSnE2nYaSgggIZlfaDtv3 3fCmizbZTHzHaROSwHXSxbmrt4urB+fA/csgHNHCRtEdB/cdo6BFh3/7qRAVwpNqO3XRDl iJQS7HdcJzsykT3lH3sdQh4bIK304TVQojQio8GxwV2194APy4dl6r8qqkaiJtaDfN4PTu 5JwQlA7qGcRQxvMK4n9bI1jknqeuHQTLQt97qJLaV5D6GIj/DDNvhRnzgRYkL2yK16zkVb I7wnt44w29fXJiKHp1xsrMeZ+tCHCs5Uf/Q10lC5Lale7B1sEtloRADYeHFyYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtRR21NpmzqRZ; Tue, 27 Aug 2024 12:18: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 47RCIcWe099476; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RCIcn3099473; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 12:18:38 GMT Message-Id: <202408271218.47RCIcn3099473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 485bd1630810 - stable/14 - pf: cope with SCTP port re-use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 485bd16308108f84df7b2768011a65f3dc97db9b Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=485bd16308108f84df7b2768011a65f3dc97db9b commit 485bd16308108f84df7b2768011a65f3dc97db9b Author: Kristof Provost AuthorDate: 2024-08-12 16:18:36 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 08:09:10 +0000 pf: cope with SCTP port re-use Some SCTP implementations will abort connections and then later re-use the same port numbers (i.e. both src and dst) for a new connection, before pf has fully purged the old connection. Apply the same hack we already have for similarly misbehaving TCP implementations and forcibly remove the old state so we can create a new one. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 82e021443a76b1f210cfb929a495185179606868) --- sys/netpfil/pf/pf.c | 9 +++++++ tests/sys/netpfil/pf/sctp.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 381d0f8b193e..fe3ae843f68a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6106,6 +6106,15 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, psrc = PF_PEER_DST; } + if ((src->state >= SCTP_SHUTDOWN_SENT || src->state == SCTP_CLOSED) && + (dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) && + pd->sctp_flags & PFDESC_SCTP_INIT) { + pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED); + pf_unlink_state(*state); + *state = NULL; + return (PF_DROP); + } + /* Track state. */ if (pd->sctp_flags & PFDESC_SCTP_INIT) { if (src->state < SCTP_COOKIE_WAIT) { diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index d07d1122048b..95a780747d82 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -181,6 +181,64 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "reuse" "cleanup" +reuse_head() +{ + atf_set descr 'Test handling dumb clients that reuse source ports' + atf_set require.user root +} + +reuse_body() +{ + sctp_init + + j="sctp:reuse" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now do the same thing again, with the same port numbers + jexec ${j}a pfctl -ss -v + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + jexec ${j}a pfctl -ss -v +} + +reuse_cleanup() +{ + pft_cleanup +} + atf_test_case "abort_v4" "cleanup" abort_v4_head() { @@ -691,6 +749,7 @@ atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "reuse" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" From nobody Tue Aug 27 12:18:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtRR256cdz5Vd4j; Tue, 27 Aug 2024 12:18: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 4WtRR23q5Gz4sWj; Tue, 27 Aug 2024 12:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z4RAkcornG5yMOEKvsT/x1YUu1rbUb9+m7uoPnrnYR0=; b=c+7z360/g/oe+Md0XELWTnQsQ6LswNdOzLEhraBTcRhY4BB9sHZGSzTUP0cmcv0TFiv2M5 mlxcMe6Ld1GSCv+6303fLDUNVHhlEAaInjCWzIkis/htmsRhtAi6as43F/0XX9QbPtWize zNe2cziH/Kbz5vzLa+bSunwqji61EuMBHAGMZS2gn84dP8+yFLsqntSW0SHiM8dMsD45xp vkmMV7NehVBFvWRqP7CLnN/a43VdKyQUwR0Kvc83eC9FkNAju1u88cP8gJH0o9emhp2qjO Sw6D48icCd8Htd0HpRoR9B5x94ayHFQPgqTZPce6vFIibt2ev7FLwg3Po4WGMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724761118; a=rsa-sha256; cv=none; b=T8RYumgPEsymlmalO9NCgSmCgBQnEebh3lK4kaxr0ftSwpHNGeZzrKrW807p+LUX5mUu0o Sj+0ZSxRAtBcznRa31tLOIArIDCDk+7Qv8GWWWY53724fok0AwciklDpZ7BoqvnMQRMbZF exS0bZlwIrU+IFUEi1i//sHT7R0pCb4MuYDvumETGQU4QbHC+G5wnt+QmwjYlo192IlUjt Voi2naxPdzlAMmg50bBx54B3+8vjA7keSrclelJjUmXP2o+kTASbWxH+F34U789jj4PYmq ucxslTX+l99yACrR7QBZWUlMyVK7UVEOc8qvQJHL/Wj9BWX8D3iiM4H7dkM7HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724761118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z4RAkcornG5yMOEKvsT/x1YUu1rbUb9+m7uoPnrnYR0=; b=txBlJxX64wMAvqg1Q1K10IDqWZrj+WsPSMrXSOjdgn6SOUu9GdWWfH6CLJ+E+5wW4kcHGo uoFV7to4h3HS5h7Yd75tDjdLQICN6UBWyL016aIHBmhDef3S4BiHCvtokf67Z/wpBKBQLg Zx2KHNDxQL1bpeC6w53+OuiOCzEuDSuobis15nOGxZ+90iXzie97C8NE9nU/TzEnWWHqqU PvR8eAAV8N5QBIIea0LzefZObEaxdcLFuEuTsiSWa4o4MjUBySaPMzCskoqkqBKlWTVYgH iUVX3U0HYLN6JGHkci1kJ3OnY7d7aNapjR8tXXujAnKfTppi2EgHzZrK1UHxvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtRR23QQSzqDD; Tue, 27 Aug 2024 12:18: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 47RCIcse099569; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RCIc54099566; Tue, 27 Aug 2024 12:18:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 12:18:38 GMT Message-Id: <202408271218.47RCIc54099566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6b3bfb16e53d - stable/13 - pf: cope with SCTP port re-use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b3bfb16e53d6cf7afae27e0bf3f6fd09254cfd6 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b3bfb16e53d6cf7afae27e0bf3f6fd09254cfd6 commit 6b3bfb16e53d6cf7afae27e0bf3f6fd09254cfd6 Author: Kristof Provost AuthorDate: 2024-08-12 16:18:36 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 12:17:59 +0000 pf: cope with SCTP port re-use Some SCTP implementations will abort connections and then later re-use the same port numbers (i.e. both src and dst) for a new connection, before pf has fully purged the old connection. Apply the same hack we already have for similarly misbehaving TCP implementations and forcibly remove the old state so we can create a new one. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 82e021443a76b1f210cfb929a495185179606868) --- sys/netpfil/pf/pf.c | 9 +++++++ tests/sys/netpfil/pf/sctp.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index dfef2d132e85..f56037c58572 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5513,6 +5513,15 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, psrc = PF_PEER_DST; } + if ((src->state >= SCTP_SHUTDOWN_SENT || src->state == SCTP_CLOSED) && + (dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) && + pd->sctp_flags & PFDESC_SCTP_INIT) { + pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED); + pf_unlink_state(*state, PF_ENTER_LOCKED); + *state = NULL; + return (PF_DROP); + } + /* Track state. */ if (pd->sctp_flags & PFDESC_SCTP_INIT) { if (src->state < SCTP_COOKIE_WAIT) { diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index d07d1122048b..95a780747d82 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -181,6 +181,64 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "reuse" "cleanup" +reuse_head() +{ + atf_set descr 'Test handling dumb clients that reuse source ports' + atf_set require.user root +} + +reuse_body() +{ + sctp_init + + j="sctp:reuse" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now do the same thing again, with the same port numbers + jexec ${j}a pfctl -ss -v + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + jexec ${j}a pfctl -ss -v +} + +reuse_cleanup() +{ + pft_cleanup +} + atf_test_case "abort_v4" "cleanup" abort_v4_head() { @@ -691,6 +749,7 @@ atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "reuse" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" From nobody Tue Aug 27 13:33:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtT5840msz5VkKP; Tue, 27 Aug 2024 13:33: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 4WtT581h0jz41Nb; Tue, 27 Aug 2024 13:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724765596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wrAD4yWLiZVDpynpjOTYoNY9wxh/zb7LmCJC1pcgPyA=; b=msKIIN7EzBc6jxGhb3+NkKb8jRcTOsSN2Ln+XVgEJpwjcyPH3TKsJNlK6XOvkArWeUSzec xJptC0IQfCrBMdahFYUPvfFWv0lzXrI9NfykSfH3qhMOGYoW7cX9jfrBrBnaOqMwLZbW1Y e5GO0sdWESpoiQ3yf6f3wuK+kKVAJD5nB5GnJ1JM2QzethJlJtVJ4618yojDuhqgoiMVIs LKy2Lm5o066mLzBuNNhvCmGRfhg4zNzGrdwf0TOnW0LJQjaJQZ2yyhyf4IlwhrH+tWCy47 J3uZHCzVnjN2d6B1yluNKCDM6OQvj+ZfpqaEXhpN8ZUFOvyKei0Gosg/3HvzZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724765596; a=rsa-sha256; cv=none; b=LaQxwNQvjqLMD8EoP+AKus/F/9Nu+lu7qPY+n25PKDZJznsaHtr0k5PYTzvyFBtd7PrRmq 3HNe1gcRaMkUFiD2UKdra4jMGPRFunLQtAzbWDmSmiwPvifDSRJUOQqaJA2cNa9Vm/FusY OfEj3FJ+Vx+m7zb2wxTYq/mb0HlpiC5tHuR7L+pz/aSDLtPi+cRZtJdf6L2pL3+gLSatcI RN2ZdJTRMbUhfgfpyPzkaksbT3j0PqQv8DBe2tvbSDp/Ey6XtNSEja9lPaYYQOVQt0dRN9 0ZvAtz8Eh5Xc0/toC/3KdKFHM26Te5dkhhX2a3uR4esIrr3MCUpwFC6JWzgiqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724765596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wrAD4yWLiZVDpynpjOTYoNY9wxh/zb7LmCJC1pcgPyA=; b=Cf/8z8QRzTBPNgtT6fmW0F/VvH5PIJ6RZdHxeF7rmdx8W6qivN8zgLNVt2xxls4pCx/mhq oW+hoQRQYuD5zKYPeHY5/1QI4vKFpaHqPRYPTZEXBr5hGJuG/HbKF62Zcevo1bcLJBTI+n hT6y+LL9ZLSLc3kdsnP8pX5q9z27sLCBePUrUihmHyYFJGC8V7sXMgKhXXTrvKlVH+HsJn uguhi3dKnSo+JsQITUYtOXEvLik8+G9ptXJxxN97unFtUmgn4CNLiftn7ZUe3Njbj7BhEh u9WgNgHgOb3HaHWNA8SBCcz/Q+le+MQm4f8/UhBK1ONUFVw+ZoFCz3ELX5Y1XQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtT581HBdzsGc; Tue, 27 Aug 2024 13:33: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 47RDXGtv034174; Tue, 27 Aug 2024 13:33:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RDXG4f034171; Tue, 27 Aug 2024 13:33:16 GMT (envelope-from git) Date: Tue, 27 Aug 2024 13:33:16 GMT Message-Id: <202408271333.47RDXG4f034171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 033f223666ad - main - committers-src: Add igoro@ with markj@ and kp@ mentors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 033f223666ad8b98d6da6bd4551307fc7ba02763 Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=033f223666ad8b98d6da6bd4551307fc7ba02763 commit 033f223666ad8b98d6da6bd4551307fc7ba02763 Author: Igor Ostapenko AuthorDate: 2024-08-27 00:52:28 +0000 Commit: Igor Ostapenko CommitDate: 2024-08-27 00:52:28 +0000 committers-src: Add igoro@ with markj@ and kp@ mentors Approved by: markj (mentor), kp (mentor) --- share/misc/committers-src.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index da7092c8bb24..52da2f3bcc25 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -204,6 +204,7 @@ hmp [label="Hiten Pandya\nhmp@FreeBSD.org\n2004/03/23"] hselasky [label="Hans Petter Selasky\nhselasky@FreeBSD.org\n"] ian [label="Ian Lepore\nian@FreeBSD.org\n2013/01/07"] iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] +igoro [label="Igor Ostapenko\nigoro@FreeBSD.org\n2024/08/22"] imp [label="Warner Losh\nimp@FreeBSD.org\n1996/09/20"] ivoras [label="Ivan Voras\nivoras@FreeBSD.org\n2008/06/10"] jah [label="Jason A. Harmening\njah@FreeBSD.org\n2015/03/08"] @@ -740,6 +741,7 @@ kib -> zont kmacy -> lstewart kp -> donner +kp -> igoro kp -> nick kp -> rcm kp -> zlei @@ -760,6 +762,7 @@ markj -> bnovkov markj -> cem markj -> christos markj -> dougm +markj -> igoro markj -> jfree markj -> lwhsu markj -> mhorne From nobody Tue Aug 27 13:33:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtT593KJ0z5Vk0l; Tue, 27 Aug 2024 13:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtT592grnz41St; Tue, 27 Aug 2024 13:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724765597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9q6B1URgdI6U5Ow2P8oY8mIc3N3yA3bfndamwR7eiHw=; b=kkDeYyBMV2jVE2pR5FaPcJXiVYquJbotjWNVBy3DXVlBCKfqznwEuuWZtazCunSSZWfENs 9tAorZFXUklxAoxFX9vC8Vpck3C9ctDBoIStkuT7AKWEXva8KyAeBkRxQgUoD9CUsdEfUc 1qirw6HplWo0vnCYXf/ZQrjPZCKhtloauhWui6eee7tNuMOCiZAQ1OB1B7ufXrLZMxXqYu /23hfjnCdCqMGErr2IJ89HSy+5vOGKCjy3qX/VLqQslR76Jze7AKGMvADNwpesgJz3lLxa ib42MSu6SZ8rPCj68Hktls6V3r0YnXgkTK+i4cQ19g6vH0oj5/CZDBICQdsT4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724765597; a=rsa-sha256; cv=none; b=y3IUCpG5EibiW8bKRyFi8mcV2ebCODTyXHpEyIgS3weNuPMFdCR2kWC7Rlpj+dCAyTjiSs oUAPT0srKg69CeUjStOVCQBS2jMIhk23lTafqZ3tr4s7QPxETinwOM9vBDP0hjsLyF7AwO MDr/p5fykXEjrje7jl4fGo7LUrCLPEOradWeh3r59lr7Ai+VyUpcysCfe0Rt8KluW1iZDk QoFmL98XyeS1wmB5CsUNKe6Jjuvvk8jy4SnsVJFMqO3t3eVBvdnTmb18xpEcOMPFjPsIe3 6GdAPu/vJ1Vz7Gk5mBtuupyaIIV7tt9J5GewH8CnBoy2PtSo6F3haiCToAiu0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724765597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9q6B1URgdI6U5Ow2P8oY8mIc3N3yA3bfndamwR7eiHw=; b=cKkjMf7KWdoXDLuJ8IiY23Bd+K5bsRKIXgshZ0tSmvZthpFs3DRwUNR+4cmSADVOfefP6y F2/Z6xduco7Id4cRsh7NC27JDAfxTJi39JGxrIWuTCbdEBi21Oy2bdNQ3I34mUX119kmYX RQfhc0DEjKOgwrXVZmXSFgXrnzUiHCXiC2w11fM4sklmw8jo+UkbUcVvfCr3FHV6xiZaWX Mw5Z+z1X3bAvKjyW9mP/Nlve0B8uRGjvyHraJ2vLaoBELMP1sZwiNipmyh7J14g74yjqhl rXZIOf1mwH0w4iM/wLIus/OYNBKVmuIl+SEdYuJNxjzp+Tgcs7VFJWssKtKy4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtT592HL9zs84; Tue, 27 Aug 2024 13:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RDXHYt034216; Tue, 27 Aug 2024 13:33:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RDXHEJ034213; Tue, 27 Aug 2024 13:33:17 GMT (envelope-from git) Date: Tue, 27 Aug 2024 13:33:17 GMT Message-Id: <202408271333.47RDXHEJ034213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 199544c9900a - main - calendar: Add myself to calendar.freebsd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 199544c9900a640b3a2a35bb6ab858a8f177152e Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=199544c9900a640b3a2a35bb6ab858a8f177152e commit 199544c9900a640b3a2a35bb6ab858a8f177152e Author: Igor Ostapenko AuthorDate: 2024-08-27 02:25:22 +0000 Commit: Igor Ostapenko CommitDate: 2024-08-27 02:25:22 +0000 calendar: Add myself to calendar.freebsd Approved by: markj (mentor), kp (mentor) --- usr.bin/calendar/calendars/calendar.freebsd | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index f799c27e59fd..bc5f0a5d90ba 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -180,6 +180,7 @@ 04/29 Adam Weinberger born in Berkeley, California, United States, 1980 04/29 Eric Anholt born in Portland, Oregon, United States, 1983 05/01 Randall Stewart born in Spokane, Washington, United States, 1959 +05/01 Igor Ostapenko born in Astana, Kazakhstan, 1985 05/02 Kai Knoblich born in Hannover, Niedersachsen, Germany, 1982 05/02 Danilo G. Baio born in Maringa, Parana, Brazil, 1986 05/02 Wojciech A. Koszek born in Czestochowa, Poland, 1987 From nobody Tue Aug 27 13:53:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtTXm0xD0z52BsL; Tue, 27 Aug 2024 13:53:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (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 4WtTXl1rK9z44b0; Tue, 27 Aug 2024 13:53:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=OCxT7UTH; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d35 as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-829e856a173so77361939f.1; Tue, 27 Aug 2024 06:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724766822; x=1725371622; 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=i1KKLkz+HYQF4K6P7MuSBiQTgJvlFxAxJpWJ68S1lQw=; b=OCxT7UTHn9/4kS0mO2LKnSM35GLbVqH1T8dfASP01vp2A4WdWKKmSZx8Exr9dTLVJR ivLbWjfGhIwVkvTZatEJOsBAkyTwMOq54BKRjiu6WF11Lji36GEzDTVirhb6R3IT1hfv 7IJwhHzoh+PSI6AS73AZDKgusyUnNnaeq5RLrcWDSOazoHYIA+HRU6pAhdu1NQl6a8Dz ukrLTtyhHiSZFi5c08VSPIQmFWDjt+ZUGjHILmEVI3+eycu3T+bSxX/TiR6oTzvXo6ih ftfyf0UjptQ+znx0mrnCEVG1LdS90VdXVTRZxp/BF5GA2yv5vKjVerXKuxUX9nF6CsDx gxWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724766822; x=1725371622; 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=i1KKLkz+HYQF4K6P7MuSBiQTgJvlFxAxJpWJ68S1lQw=; b=S4WvDkSZVmEb4rlqrE72SkOsDSlZT4p3/4GdyH3iluGR3cMpMkbPTg4rrSzzoWwTxZ FIL/6WRcBatM8Wg1XXcS8mQjr9UsRnrPo7GiCWLRPc5g8PFB7jY/G2I+1yWQ6hVYGV6W V7ps3wmoMC6mIpRqII3mEIJh2EKcnj7qS4bWCaQCt6kH8zNWFtlXWUCBzzqHEF3Sh8QP viPBCvJhpr7j9posp31li1kan1LrroGfZBQwcfV/0vrTxE/jhs6qtYSibRsvxzYa1B6R q9TIUTnYK7BP0K0ew4ets+98Gj+ZDoS+VeiREABx6IenID1KKTHYrYoYcu9nDOLtQ389 LzfA== X-Forwarded-Encrypted: i=1; AJvYcCUH+Aq7VYV0rmUqAYQrThoDVnZrf1vHHmA1G/eOmW0wuIArK802S6QGrem8z78KsKT8/ZuWNFD44WS7Gk9sMlYW96iyxfg=@freebsd.org, AJvYcCWBV2tE7c+O/4Y4p1CkqSgKg3rp7zSbWERlr1YY/KvQZkW7imy6w/rEguQEX9AJzIosqFFCP1HAV2/KdKvo4GV18TDc@freebsd.org X-Gm-Message-State: AOJu0Yz2FpWMdsQvuVSRZrGsVS/b7JLHKE07RIJePbXByexxsN+K//82 IxZ16oPbz1dAWw1PAmOw4W5ZFSeLRFG+9spKKB8AiCQRZvC+RaewxylHVg== X-Google-Smtp-Source: AGHT+IER4mPIXbpb2kMEYR2fiDd8FpOET6+mORXK85FDwyQtpMuvk9fZNBfduvArCVOFPA6QC6YvJA== X-Received: by 2002:a05:6602:1691:b0:824:d641:9448 with SMTP id ca18e2360f4ac-82788141a1bmr1829953439f.7.1724766822126; Tue, 27 Aug 2024 06:53:42 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ce7106a1a5sm2662775173.102.2024.08.27.06.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 06:53:41 -0700 (PDT) Date: Tue, 27 Aug 2024 09:53:38 -0400 From: Mark Johnston To: Shawn Webb Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 417b35a97b76 - main - netinet: Add a sysctl to allow disabling connections to INADDR_ANY Message-ID: References: <202408202134.47KLYdPH055386@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.45 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.85)[-0.850]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d35:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCPT_COUNT_THREE(0.00)[4]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4WtTXl1rK9z44b0 On Wed, Aug 21, 2024 at 12:59:18AM +0000, Shawn Webb wrote: > Hey Mark, > > When I set the net.inet.ip.connect_inaddr_wild sysctl node to 0 and > try running `nc -vv 0.0.0.0 22` (this VM has sshd enabled), the > below-linked KASSERT fires: > > https://cgit.freebsd.org/src/tree/sys/netinet/in_pcb.c#n2304 > > No KASSERT is tripped on the IPv6 code path--that works fine. Only > IPv4 is impacted. I had tested this when I wrote the patch, and just tried again now. I haven't been able to trigger the panic: root@freebsd:~ # nc -4 -vv 0.0.0.0 22 nc: connect to 0.0.0.0 port 22 (tcp) failed: Network is unreachable I believe the error is coming from in_pcbladdr(). But, I can bypass that by rerunning the test in a classic jail with ip4.saddrsel=0. So, it seems it's best to explicitly catch that case and return an error: https://reviews.freebsd.org/D46454 > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc > > On Tue, Aug 20, 2024 at 09:34:39PM UTC, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=417b35a97b7669eb0bf417b43e97cccbedbce6f9 > > > > commit 417b35a97b7669eb0bf417b43e97cccbedbce6f9 > > Author: Mark Johnston > > AuthorDate: 2024-08-20 21:31:57 +0000 > > Commit: Mark Johnston > > CommitDate: 2024-08-20 21:31:57 +0000 > > > > netinet: Add a sysctl to allow disabling connections to INADDR_ANY > > > > See the discussion in Bugzilla PR 280705 for context. > > > > PR: 280705 > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D46259 > > --- > > sys/netinet/in_pcb.c | 8 +++++++- > > sys/netinet6/in6_pcb.c | 12 +++++++++++- > > 2 files changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c > > index 1a341d421f31..3fc90f1e12c2 100644 > > --- a/sys/netinet/in_pcb.c > > +++ b/sys/netinet/in_pcb.c > > @@ -234,6 +234,12 @@ in_pcbhashseed_init(void) > > VNET_SYSINIT(in_pcbhashseed_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, > > in_pcbhashseed_init, 0); > > > > +VNET_DEFINE_STATIC(int, connect_inaddr_wild) = 1; > > +#define V_connect_inaddr_wild VNET(connect_inaddr_wild) > > +SYSCTL_INT(_net_inet_ip, OID_AUTO, connect_inaddr_wild, > > + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_inaddr_wild), 0, > > + "Allow connecting to INADDR_ANY or INADDR_BROADCAST for connect(2)"); > > + > > static void in_pcbremhash(struct inpcb *); > > > > /* > > @@ -1309,7 +1315,7 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, > > inp->inp_flowtype = hash_type; > > } > > #endif > > - if (!CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { > > + if (V_connect_inaddr_wild && !CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { > > /* > > * If the destination address is INADDR_ANY, > > * use the primary local address. > > diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c > > index e6ec0f24c898..098b4e50483c 100644 > > --- a/sys/netinet6/in6_pcb.c > > +++ b/sys/netinet6/in6_pcb.c > > @@ -83,6 +83,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -97,6 +98,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -112,6 +114,14 @@ > > #include > > #include > > > > +SYSCTL_DECL(_net_inet6); > > +SYSCTL_DECL(_net_inet6_ip6); > > +VNET_DEFINE_STATIC(int, connect_in6addr_wild) = 1; > > +#define V_connect_in6addr_wild VNET(connect_in6addr_wild) > > +SYSCTL_INT(_net_inet6_ip6, OID_AUTO, connect_in6addr_wild, > > + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_in6addr_wild), 0, > > + "Allow connecting to the unspecified address for connect(2)"); > > + > > int > > in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred) > > { > > @@ -351,7 +361,7 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr_in6 *sin6, > > if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0) > > return(error); > > > > - if (!CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { > > + if (V_connect_in6addr_wild && !CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) { > > /* > > * If the destination address is UNSPECIFIED addr, > > * use the loopback addr, e.g ::1. > > From nobody Tue Aug 27 14:46:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtVjH3bwWz52H5J; Tue, 27 Aug 2024 14:46: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 4WtVjH2xFMz49vQ; Tue, 27 Aug 2024 14:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724769971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u4XucBQdI/edCK0upoywZI5rriC4MWFijHj3+TLcHtc=; b=e+kCKWCIib8Wxe0q/0EQISwDI4Rxf2/caXd/9pUjV/BzG2nEqePMojyj+RH+5xB+TTWO0x hj9o0O1fn5MzUZ6FxDoDw8YtWMcoHT+LUugIM9MiqF2538qNrwXtpWbnrMHGFJi65Bf68P o21fj/GWkoGihK4cy8ldO8d+Zpf8sozApeYEb/EMzxBuK8urkQkqxNGjzPanGJ9aL7kL1W JSepwOlGO2H2BkrHR+GUsG8ONI2FVPZHsyPY6uzxoiNI9Pf9EK0E2k36la1ZnxNKV2jcqR QZjUNKHi3q9YVur43OB/D7jGqQ5sdlB5/c1M/Foi8DVEx9EaLWTdcuqlFqYm3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724769971; a=rsa-sha256; cv=none; b=W9EIlrNi3B9e/A9SZ3VNNYWr5OJYLwl/KB63HuY4+sS0Pe6U8QujhC66hU09M0Ujt+GyXa jd0y0lSbTd5Pt4mLst5ClvXKHdekVpJknjR/FqSW5odbzhXcHR0hVoidSVjUnQEP8dUiEy xL52xGy/ONQJlqOJOfd/iu5hgbuNTZSJUMKJboNwpDMmBGBdoUPRQMhUdckXKmaZ3ZdoG8 NpFJU44uWUXB+MfpvQUhG626U9zAVlkafxkIPdoOhCRsnSflwt6NOg76je+0D9pVIiZXYi Z+xtlrNrWBfNyL6d9EFKLIPQFLNIwnqyCdcYaoTq1Aub7BDgwyaNC7yjIZ0pCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724769971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u4XucBQdI/edCK0upoywZI5rriC4MWFijHj3+TLcHtc=; b=EYpALI3qU2rfk0kpgxeUDw9XY8XYbMkJnc+/yN08Jfaa2zV2SnccIsETNMjs/p6a5dfnFm 2tgNeZ3XswhB6YF1q0T06YX1s0Ppco/zWt64MpAM9T8vQER2SoYTbEh493y8NCEwzbNQWS lCLhPRdRNcxzud7iV7saME+HqN2fgI3mbf7P7vI/80E/b1KsCw3ge4OLjPzVfULMaKOKDb 4Nlu6E94Ec5c2wwvptJhqcZztH+6kPr1mDT4wnFfe7iH0Eyb3Vox72VTvvismAFQ2vVASV TVVszTd8KGWH0fvoDK7njYbavyPubrodzNrPTZ5meKhKOgByjqYms6eOzxlmpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtVjH2XbrztxN; Tue, 27 Aug 2024 14:46: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 47REkBY6053384; Tue, 27 Aug 2024 14:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47REkBfW053381; Tue, 27 Aug 2024 14:46:11 GMT (envelope-from git) Date: Tue, 27 Aug 2024 14:46:11 GMT Message-Id: <202408271446.47REkBfW053381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2096ad13524e - main - pf: sprinkle const in pf_pull_hdr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2096ad13524e5bc6ace98877dd62583ba1ec3f82 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2096ad13524e5bc6ace98877dd62583ba1ec3f82 commit 2096ad13524e5bc6ace98877dd62583ba1ec3f82 Author: Kristof Provost AuthorDate: 2024-08-26 17:08:04 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 14:45:46 +0000 pf: sprinkle const in pf_pull_hdr() Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d66e6f799761..10bf527c025d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2329,7 +2329,7 @@ int pf_multihome_scan_asconf(struct mbuf *, int, int, struct pf_pdesc *, struct pfi_kkif *); u_int32_t pf_new_isn(struct pf_kstate *); -void *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *, +void *pf_pull_hdr(const struct mbuf *, int, void *, int, u_short *, u_short *, sa_family_t); void pf_change_a(void *, u_int16_t *, u_int32_t, u_int8_t); void pf_change_proto_a(struct mbuf *, void *, u_int16_t *, u_int32_t, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cb69d06b1fe6..acbaf304995f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7422,13 +7422,13 @@ pf_test_state_other(struct pf_kstate **state, struct pfi_kkif *kif, * h must be at "ipoff" on the mbuf chain. */ void * -pf_pull_hdr(struct mbuf *m, int off, void *p, int len, +pf_pull_hdr(const struct mbuf *m, int off, void *p, int len, u_short *actionp, u_short *reasonp, sa_family_t af) { switch (af) { #ifdef INET case AF_INET: { - struct ip *h = mtod(m, struct ip *); + const struct ip *h = mtod(m, struct ip *); u_int16_t fragoff = (ntohs(h->ip_off) & IP_OFFMASK) << 3; if (fragoff) { @@ -7451,7 +7451,7 @@ pf_pull_hdr(struct mbuf *m, int off, void *p, int len, #endif /* INET */ #ifdef INET6 case AF_INET6: { - struct ip6_hdr *h = mtod(m, struct ip6_hdr *); + const struct ip6_hdr *h = mtod(m, struct ip6_hdr *); if (m->m_pkthdr.len < off + len || (ntohs(h->ip6_plen) + sizeof(struct ip6_hdr)) < From nobody Tue Aug 27 14:46:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtVjJ4mnTz52Gww; Tue, 27 Aug 2024 14:46: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 4WtVjJ3QRYz49vR; Tue, 27 Aug 2024 14:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724769972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rz5olVQ7vsIwByHjviEbm1JvC2R0Kpv39+RP19l5HoQ=; b=dMBPJYxqCrDci0C5CddP1TZsLzhN8cv5IcwLeNp0qbqpCEsFrGRtge8Wm+ciFquohxl+Tq cWG34Ap5VyFx+GfwDAHC+SK/DZ8cZzs3jw6vIYBvB1aHog5Li/6gluncgZn6x0U3WC0FyF YVSe9fVNDxW6+j/+90rJMc05euLwa7tnDfYC77dnueJ6T0Z6NafkbifaWb+SZXfuU4Gdcy p8e7PsxFQo0IEkafSxyTDEfudUzWR1jdIuNcSiTvciVZ42RZIWYqyZf/ghTzhaw3bENULs htSW8peAwvWmXx/xRlX9IKqf3dNGY/Z+6nhqJvXWO3NtFMgtvhiLcmGe2d6WAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724769972; a=rsa-sha256; cv=none; b=u1fcjC2hMW8Nr5YsAYW2Z6Jbk1IdJobJJI590lbpmTISKyjFtwzJ49WGrwyALmsivREmLm GyXLBvxOFkZcuXib6u/4S4noTCsoAt5ZAM8AZs+4vrNpkeK2gbsaX3RpZmuZLxW6fODC+X W1bZcIjxy1mGoKKIuaKiZs061jax6+4CdzY9RoqJIt4tqaunMDbqmpoWg2gEu4ZKOHfooG 4djxJoInEr1wCF+K/Hsrx3CDdw7ONYzzdlj+9mmcsXZa0YjIfiT+9Xss2z52jSyd+BH4zd p4EH5SfLa+HZkzTbsC9PGh2p/e3wdzlOEkDS66K80y+yVKI2j46yHY8wUhuZJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724769972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rz5olVQ7vsIwByHjviEbm1JvC2R0Kpv39+RP19l5HoQ=; b=VLCsfpagH/dDSI7VwbpuXCPrV3IHgFOfhf79CBdkMsbnGm+oxbetuxutCGJ4/cBODG3FkG EZ6k/TowOZ38n0IjHdjGYYVqTcT1dHWs27QZL4HPHyKZ5GHj13j/evvbMzYMye1Fz5cNoo i7KvdVdNglvpEch12d44M243aWuhe5+GaxQezyrjh5W3lnlgjEtVb6MA7il1iky01iwv/x BghYuIR15m5/lBG3sWF4bQtsb/TF1n6mE6lj8RUajthVnt7UXHdaOIZbI33I9McahXLcKW ibVviaVBpIdGqd8HnEP/l0mjp8sDbASFxQsTFtL0fCS53O11KogsJs8Z0vNMgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtVjJ32DnzvBJ; Tue, 27 Aug 2024 14:46: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 47REkChC053426; Tue, 27 Aug 2024 14:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47REkChb053423; Tue, 27 Aug 2024 14:46:12 GMT (envelope-from git) Date: Tue, 27 Aug 2024 14:46:12 GMT Message-Id: <202408271446.47REkChb053423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3b62f3350017 - main - netinet: fix LINT-NOINET build failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b62f3350017ab6722ebe8e4fccd9ba76acbb214 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b62f3350017ab6722ebe8e4fccd9ba76acbb214 commit 3b62f3350017ab6722ebe8e4fccd9ba76acbb214 Author: Kristof Provost AuthorDate: 2024-08-26 20:02:25 +0000 Commit: Kristof Provost CommitDate: 2024-08-27 14:45:46 +0000 netinet: fix LINT-NOINET build failure Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet/in_pcb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 3fc90f1e12c2..70ddd581895f 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -234,11 +234,13 @@ in_pcbhashseed_init(void) VNET_SYSINIT(in_pcbhashseed_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, in_pcbhashseed_init, 0); +#ifdef INET VNET_DEFINE_STATIC(int, connect_inaddr_wild) = 1; #define V_connect_inaddr_wild VNET(connect_inaddr_wild) SYSCTL_INT(_net_inet_ip, OID_AUTO, connect_inaddr_wild, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(connect_inaddr_wild), 0, "Allow connecting to INADDR_ANY or INADDR_BROADCAST for connect(2)"); +#endif static void in_pcbremhash(struct inpcb *); From nobody Tue Aug 27 15:25:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtWZB5PdMz52L9m; Tue, 27 Aug 2024 15:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtWZB4rnMz4FL6; Tue, 27 Aug 2024 15:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724772306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zjluDdZld2UPFb/go8qS83Phup36TK7kI2nraZeIpZQ=; b=nOOPyiYTCZb3pFb4J4UpS4pbSSaT9FudLhk5goLNgLqlR1RJx2ydB4/uhenxWTgXY2V3Qz jOu/t/uLcVcFZeuy3TiS4WChpQmeokXovLKS3Lwp8yjJajui6y4RCBV5trza323z9tVOTp bYu+cdpN4DDfzQTr9SZ9xmfvxVnmy+pMWRt5LFoYnvdeyBV44Bx2moEEbYmLkvh6G32rB8 ywr1/PlsH4kE1kZof0/AY1HqSjxV7egEBYpf0+l+oMN9ephMBfKcXJ4XNX0CP4Svs6yLjD 730jL+p+aTf9nJEri9lOoLZJDSY9x5/ZcVPhD16cetS51bDbDPHnw9dyHs8YeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724772306; a=rsa-sha256; cv=none; b=syXhrEndY5XTRrLSUWcPnkCxxh+mRyqWf1ksu3Si+IEASSb2MXDFZH7vZQsjWPlByvnqss 1ebUb8GXeqH9RU/aSFykSzI7s9+TlA9fyiN/N0E5Vk3YJ0PqXhZTevpD6i8X+yWPSTLzzY GeZZCEtZcjBeQs8h3d75/puEiX5/B7oEMG5p4Ux+kAd/HfgQztWD9lXAOi71WuzPowwg6t XhUCKU77d0/Yp1aLWtaWGLykXKxMVs+qYpmWgr2xvMCDfQtdE2VJcD1u1wUQPU/pU5/2r2 2Q2fqvLu2VoiRn7vlZBMYp7rWDYTYQtFibpt/eRL2IxxZfqUvt1fRU55mAbqVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724772306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zjluDdZld2UPFb/go8qS83Phup36TK7kI2nraZeIpZQ=; b=qZfqz5B0AXxkIhhfC/fiWYLRgK5pmYYdM1/N4qpYsN8vXbg0jQZYJjXqZhdRpe9QXcS90j ZiNd6725yNSlpHQP9SsYEHg5UbKhI3CvdUSIm/QmaA0sFE5ChCqO86NzS/pTwOMvsYVj3s IsvcHg0LCuDY4PM2vKaMWu3LZ8TFsYgIL6bV7+fV9yItKcCcGswbURr04wFfRBw9SlHMlU IxQfJpu3i4ZIW6BiU8cxgrFtFCmAWdRlFHB2Tirp/ajDW/1OMnlkXY80LB+f1kyUZ0dI4a 03SJutfwV34zNkrTUH3mjGJIw8qgcqEjC+yuUNzVt1W1H4Pwex+iD6bKt0DCQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtWZB4RyKzvGD; Tue, 27 Aug 2024 15:25: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 47RFP6MS021272; Tue, 27 Aug 2024 15:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RFP6D8021269; Tue, 27 Aug 2024 15:25:06 GMT (envelope-from git) Date: Tue, 27 Aug 2024 15:25:06 GMT Message-Id: <202408271525.47RFP6D8021269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: d0675399d09f - main - capsicum: allow subset of wait4(2) functionality List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0675399d09f02d347912e23d004329710338450 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=d0675399d09f02d347912e23d004329710338450 commit d0675399d09f02d347912e23d004329710338450 Author: Edward Tomasz Napierala AuthorDate: 2024-08-27 15:19:24 +0000 Commit: Mariusz Zaborski CommitDate: 2024-08-27 15:22:12 +0000 capsicum: allow subset of wait4(2) functionality The usual way of handling process exit exit in capsicum(4) mode is by using process descriptors (pdfork(2)) instead of the traditional fork(2)/wait4(2) API. But most apps hadn't been converted this way, and many cannot because the wait is hidden behind a library APIs that revolve around PID numbers and not descriptors; GLib's g_spawn_check_wait_status(3) is one example. Thus, provide backwards compatibility by allowing the wait(2) family of functions in Capsicum mode, except for child processes created by pdfork(2). Reviewed by: brooks, oshogbo Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D44372 --- contrib/capsicum-test/capmode.cc | 1 - lib/libsys/wait.2 | 10 +++++++--- sys/kern/kern_exit.c | 12 ++++++++++++ sys/kern/syscalls.master | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/contrib/capsicum-test/capmode.cc b/contrib/capsicum-test/capmode.cc index f32d9e038744..5ff025290211 100644 --- a/contrib/capsicum-test/capmode.cc +++ b/contrib/capsicum-test/capmode.cc @@ -594,7 +594,6 @@ FORK_TEST_F(WithFiles, AllowedMiscSyscalls) { AWAIT_INT_MESSAGE(pipefds[0], MSG_CHILD_STARTED); errno = 0; EXPECT_CAPMODE(ptrace_(PTRACE_PEEKDATA_, pid, &pid, NULL)); - EXPECT_CAPMODE(waitpid(pid, NULL, WNOHANG)); SEND_INT_MESSAGE(pipefds[0], MSG_PARENT_REQUEST_CHILD_EXIT); if (verbose) fprintf(stderr, " child finished\n"); } diff --git a/lib/libsys/wait.2 b/lib/libsys/wait.2 index 8b504e070b7a..3c649f3dfa77 100644 --- a/lib/libsys/wait.2 +++ b/lib/libsys/wait.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 24, 2022 +.Dd August 27, 2024 .Dt WAIT 2 .Os .Sh NAME @@ -605,9 +605,13 @@ must be checked against zero to determine if a process reported status. .Pp The .Fn wait -family of functions will not return a child process created with +family of functions will only return a child process created with .Xr pdfork 2 -unless specifically directed to do so by specifying its process ID. +if the calling process is not in +.Xr capsicum 4 +capability mode, and +.Nm +has been explicitly given the child's process ID. .Sh ERRORS The .Fn wait diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index f83f0433f9cd..f6263cd46d06 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1330,6 +1330,18 @@ loop_locked: return (0); } + /* + * When running in capsicum(4) mode, make wait(2) ignore + * processes created with pdfork(2). This is because one can + * disown them - by passing their process descriptor to another + * process - which means it needs to be prevented from touching + * them afterwards. + */ + if (IN_CAPABILITY_MODE(td) && p->p_procdesc != NULL) { + PROC_UNLOCK(p); + continue; + } + nfound++; PROC_LOCK_ASSERT(p, MA_OWNED); diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 9fdd443955c7..fac1c2e1e96f 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -157,7 +157,7 @@ int fd ); } -7 AUE_WAIT4 STD { +7 AUE_WAIT4 STD|CAPENABLED { int wait4( int pid, _Out_opt_ int *status, From nobody Tue Aug 27 15:25:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtWZC6N44z52Kd2; Tue, 27 Aug 2024 15:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtWZC5qGBz4FQJ; Tue, 27 Aug 2024 15:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724772307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BMjjQM5s3U+sNg6heM2fN+2GgO7H3krFDyJWHl0BOb4=; b=xu3+WSxF/gmcqG+C7gqQLtL7k+IUm7W4Ud97LtK0Np2ttVWFdIsPYioW6hYIGHQOfSQzPL GoiyjVlUhKbHXyKD6m8pE39XVmSw3cFmcBzJ/+kQhhdrbvOBOGY0iJnQq5eY3GNWAOQxdE fe8n8cOlPRiApg3SpfQ4fQL5eWsIotGkzoJdieoSIsexv8V/ftZpP2wbi5xcfT++U0WDpv JwSLOWFuJ7yPWbH/mYoIoLFZ2Xgr2SEUMwjDedVECtIqEfr3bIKdedYLqeWGmy00+5UQ5M oSi53kjwkyglIQG2/Eweq3u41oFHO/W/oyyiBsF3l80vNVEm5gGFtuDFKH3UCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724772307; a=rsa-sha256; cv=none; b=EGdJecJyAWNMS893Mu6gq3eUblv+KYLNSNnHJCw7d4vv1l9Ix1wOOiKOCt0mmt9Nxm4saC 9Z4NbADORLJ8hRdZAbQ5Tvu9SLi6QYGy8LUgq1OVnoQAZjqiXwlp52CaYaEiUkPAK0YCGc f5Quca65gk9NnwZkR6ywFHUgugwgCWpuoHWhA+8UJtTKboKf6B345zmBXGMEbDQDSY0l8f pYZdfCifuVUyH5vRLms3Yv078PjpxgFqPEqFRfeyAxUxMxyXNpih+6uuY0OBqWiJ1LxLxd /VdqIK19wF1KBgc5D2uwKOBmZIvW171lZrAUt8aNx09r/GGGv7ksaniWFPbV1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724772307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BMjjQM5s3U+sNg6heM2fN+2GgO7H3krFDyJWHl0BOb4=; b=XgEM1I2RZW57tX1rKpRidzTjaxxNmbTFGgf3HBMuS07coUXpBI5e6r9MAhz3JFGgMuTJqy cpsCT8ncrvW3NNRNwCgPG0MU4FjaQBPM0OyXLc+zTnl3rHIHohNpw+sfDZfjjlUCEKDCAL d6g5cy37AhrACVVPMpC216H/0w9oDf1GgcGOtuqaOUJMS8J9jcqJwXvgfjt9x2jqhWhvG8 hxNUk/hv6jpC+oAGPyCoCpzBb1aEW3yjwmNqKfIsukw51lO6mT2Nxg5qdIUdLzWCAXJoVC /myQZ4U0e3ANB4hzFDdTt26KoH7ORFq3JARFOtgw/tHW5lMl3D9AK9q0q0Y60w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtWZC5P6Rzvhd; Tue, 27 Aug 2024 15:25: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 47RFP7j4021312; Tue, 27 Aug 2024 15:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RFP7OG021309; Tue, 27 Aug 2024 15:25:07 GMT (envelope-from git) Date: Tue, 27 Aug 2024 15:25:07 GMT Message-Id: <202408271525.47RFP7OG021309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 24b1cf7a8a1d - main - sysent: regen after d0675399 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24b1cf7a8a1d2ad9eda9d155c264da092c1351ac Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=24b1cf7a8a1d2ad9eda9d155c264da092c1351ac commit 24b1cf7a8a1d2ad9eda9d155c264da092c1351ac Author: Mariusz Zaborski AuthorDate: 2024-08-27 15:24:54 +0000 Commit: Mariusz Zaborski CommitDate: 2024-08-27 15:24:54 +0000 sysent: regen after d0675399 --- sys/compat/freebsd32/freebsd32_sysent.c | 2 +- sys/kern/init_sysent.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 54b07374bbce..b8df64206611 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -68,7 +68,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(write_args), .sy_call = (sy_call_t *)sys_write, .sy_auevent = AUE_WRITE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 4 = write */ { .sy_narg = AS(open_args), .sy_call = (sy_call_t *)sys_open, .sy_auevent = AUE_OPEN_RWTC, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 5 = open */ { .sy_narg = AS(close_args), .sy_call = (sy_call_t *)sys_close, .sy_auevent = AUE_CLOSE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 6 = close */ - { .sy_narg = AS(freebsd32_wait4_args), .sy_call = (sy_call_t *)freebsd32_wait4, .sy_auevent = AUE_WAIT4, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 7 = freebsd32_wait4 */ + { .sy_narg = AS(freebsd32_wait4_args), .sy_call = (sy_call_t *)freebsd32_wait4, .sy_auevent = AUE_WAIT4, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 7 = freebsd32_wait4 */ { compat(AS(ocreat_args),creat), .sy_auevent = AUE_CREAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 8 = old creat */ { .sy_narg = AS(link_args), .sy_call = (sy_call_t *)sys_link, .sy_auevent = AUE_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 9 = link */ { .sy_narg = AS(unlink_args), .sy_call = (sy_call_t *)sys_unlink, .sy_auevent = AUE_UNLINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 10 = unlink */ diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index 291d38865bd3..e066b04b4f6e 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -67,7 +67,7 @@ struct sysent sysent[] = { { .sy_narg = AS(write_args), .sy_call = (sy_call_t *)sys_write, .sy_auevent = AUE_WRITE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 4 = write */ { .sy_narg = AS(open_args), .sy_call = (sy_call_t *)sys_open, .sy_auevent = AUE_OPEN_RWTC, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 5 = open */ { .sy_narg = AS(close_args), .sy_call = (sy_call_t *)sys_close, .sy_auevent = AUE_CLOSE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 6 = close */ - { .sy_narg = AS(wait4_args), .sy_call = (sy_call_t *)sys_wait4, .sy_auevent = AUE_WAIT4, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 7 = wait4 */ + { .sy_narg = AS(wait4_args), .sy_call = (sy_call_t *)sys_wait4, .sy_auevent = AUE_WAIT4, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 7 = wait4 */ { compat(AS(ocreat_args),creat), .sy_auevent = AUE_CREAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 8 = old creat */ { .sy_narg = AS(link_args), .sy_call = (sy_call_t *)sys_link, .sy_auevent = AUE_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 9 = link */ { .sy_narg = AS(unlink_args), .sy_call = (sy_call_t *)sys_unlink, .sy_auevent = AUE_UNLINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 10 = unlink */ From nobody Tue Aug 27 17:50:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtZpD72SJz52Y9B; Tue, 27 Aug 2024 17:50: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 4WtZpD6WMXz4XVH; Tue, 27 Aug 2024 17:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724781044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NDenC6Iz+pnugF5a5xT0xRLVVIJ5kIWATj6IdM9Qg4I=; b=o4ZjJz2Fp4ek1uuD42Z1wXABGgARxiC0eyeTHSTki8TSyb3Oqj1NLoleBcFeN5UGyuRLMN pFIVwMxpP3OH6mAvCi7j9CtR1Vt78Vib19WtCfc+Js1rsqMbIuifsavr12y4nDBdKt3BP6 qDktPLevFAgMHY1UggQbonhiNeZpbCmPY4GrrKISv5ji7qjY+woEIjvbQugcetTMXvBSbA 4rNJ4sYqKULIQ+YJp0TbKigcwfihdeG65Zsj1dsoEury0tciZkgCylX7o2mlyVJERM2ghM c7td0T0K3iXz9SdLhYB7sL8QzBrmaOlvGZcHvKddzgw7iLmw2wKY3Xcjd7FUNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724781044; a=rsa-sha256; cv=none; b=Q9OqOl3xq6uJW8+Eh73XiEPDkzgyNiwU62hL7uKUVDHMZX0RybIOvCWgXm2+Ee/qtfU0lY PLfeCFsR+ER9cNDeMX3+w4SDMZoZW6gjViscJustEVXzYIjx29QSkCESqeo56kAx4oHazi PQiDBvRPaEXWgEs8odeY575erTQ61qDwvqY7XL6HE9vAkSVSOfErv2xxr4fNKkWKxu+sP3 P7LAbUREweYWQShV7c8olec46sUGPycACbnBOmx3ezbH7iiknNZc14b0HTpenxS21KVBkt Iw/sMDmYvInyIhR2JC/D32kwgR7yk+nIM355yz/HWmwkgoltB8A3VWMGd5E0cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724781044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NDenC6Iz+pnugF5a5xT0xRLVVIJ5kIWATj6IdM9Qg4I=; b=CUaLsJeAM/ne91yZ1Vv+eIvCGFKdFPstTtOb4TMLa3Guhqns46WaDSZz2Awk4IouWjGLAz UClhJyBNfSSVseq1xIcGa7rA8utAIxdnqt1kVJzoumbaAPlae8WWaedhu3PZ/cR3S5RYd9 tKzu+PlNbI20W7JbOz6tsLaXxxkC9jOGaoWgCNB2Adq2HKwR4V5eHF26o6fntADAWTcUiY hQqZujYoOrjM3pPM94AZcgXX/mD07n91ZBEqaf32fkZMVOx1pfSJBEH5bhqs2PnnMMCe93 /F58iKFUAaxTIGnu5R6jgttlWF5fer4/PAcTDp/5PeTbZJ6M59LI9D5+bgR1oQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtZpD66dGz103f; Tue, 27 Aug 2024 17:50: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 47RHoigs067700; Tue, 27 Aug 2024 17:50:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RHoiaK067697; Tue, 27 Aug 2024 17:50:44 GMT (envelope-from git) Date: Tue, 27 Aug 2024 17:50:44 GMT Message-Id: <202408271750.47RHoiaK067697@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: 9c0cce328363 - main - usb: correct the rtw8821cu quirk and add another wireless rtw88 device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c0cce328363bd62f3c9add67bea7422208d9903 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9c0cce328363bd62f3c9add67bea7422208d9903 commit 9c0cce328363bd62f3c9add67bea7422208d9903 Author: Bjoern A. Zeeb AuthorDate: 2024-07-31 08:10:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-27 17:48:43 +0000 usb: correct the rtw8821cu quirk and add another wireless rtw88 device The RTW8821CU_CD entry in quirks has an invalid lo_rev/hi_rev match entry. Use the different USB_QUIRK macro to match on all of these; the value we currently see is 0x0200 on two different wifi sticks. [1] Also add an entry for the DLINK DWA-181 rev A1, rtw88 USB. Submitted by: phk Tested by: phk Fixes: b3b6a959c85af3aabbde3ef2b80dbd4bf5b6f5a7 [1] Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46189 --- sys/dev/usb/quirk/usb_quirk.c | 2 +- sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index d6ddeafd7195..8c49f048ecb3 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -534,7 +534,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { UQ_MSC_NO_INQUIRY, UQ_CFG_INDEX_0), USB_QUIRK(SMART2, G2MEMKEY, UQ_MSC_NO_INQUIRY), USB_QUIRK_REV(RALINK, RT_STOR, 0x0001, 0x0001, UQ_MSC_IGNORE), - USB_QUIRK_REV(REALTEK, RTW8821CU_CD, 0x0001, 0x0001, UQ_MSC_IGNORE), + USB_QUIRK(REALTEK, RTW8821CU_CD, UQ_MSC_IGNORE), /* Non-standard USB MIDI devices */ USB_QUIRK(ROLAND, UM1, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SC8850, UQ_AU_VENDOR_CLASS), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index ea011f54b075..e02289521095 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1729,6 +1729,7 @@ product DLINK DWA180A1 0x3316 DWA-180 rev A1 product DLINK DWA172A1 0x3318 DWA-172 rev A1 product DLINK DWA131E1 0x3319 DWA-131 rev E1 product DLINK DWA182D1 0x331c DWA-182 rev D1 +product DLINK DWA181A1 0x331e DWA-181 rev A1 product DLINK DWL122 0x3700 DWL-122 product DLINK DWLG120 0x3701 DWL-G120 product DLINK DWL120F 0x3702 DWL-120 rev F From nobody Tue Aug 27 18:07:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb92650qz52ZHc; Tue, 27 Aug 2024 18:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb925bFpz4ZCc; Tue, 27 Aug 2024 18:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tvGRoQ9iLKPbzrLZAb/TKNZlv39VmcZeL/GRihlWAyc=; b=PYo9uQJWyAfs7GQDiy7TpkKO5ws6KUaD/0ZlF2elhZX0T9DU0NOkVon5MWXnYKV1lcB35o QDNUmhq38wdW4Jpxw1mINdL2mFyFzFHDEFp6X3Ya6mln5+EKBg+5Xs/3d3T6nqmhkBdAZl pUSgNPHSaLTQsfkD3dPsvXtypa6jNwZMPS8JWo02kNE57/oeBpLD088FuH6YTEYkIdxQeu zprEd+bRm1hUtKCTdGAfSmmQMcd8ki7rAQHpijkAUlg+gRBQRPtm18zinw4Ix1rrqkWlr3 0po9gdwUU8ZT8C2BdVjVfdQB6bi1JKzsrwLS1Exh2nlcEulGcxQeHnjsCkQwSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782022; a=rsa-sha256; cv=none; b=YIuQ3R7QPyaYTULjPTUb/Gj+sITexg16nwYArTs4n/zXhsbqyZ8e4EETxHJkw+v4o5CwPo UGnLc978aLyFHcGuBQI/tVR5RZKC+S495PVwg9056e7esRUZyfYFGPgdn5869y2Zr4AwY3 iGpTta1htwjtCt4JrvKcfA2Tkq8NEzbMDJp4dx4cbIhgmInWTIMuO01/lfl9yCAzjTg5WY Vxn5efFCzlWZqoGz5t7ycGEKsqrEH1/0XTlKLuJKjXmZAydXZXgKSpO6pdXd1t3v+Thtz7 cslSg6a78WgbKyZWhIaBX6KuM4wRJjM+SfcsIS7QCgJazqQGHqYKVR7MjPro6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tvGRoQ9iLKPbzrLZAb/TKNZlv39VmcZeL/GRihlWAyc=; b=WnqSgKheTHUvWV7MYnw3jUeNxwHYeRuMKWWssZ1bNwirPBxrr0Uu4iW7zzezWXAg9Bf8td AGVGyRptaQW9H1NdR+O+QrWEUBNXi1MggFHwTGGyYvoiwD3amk4dNnOn/yyVtYjMnPl4D0 CaWkLA3JSaZFl8lZ5X6BFWLSYazAy0c1LnOOV+rfr1m8haMAMcWDD6qjujCwfgPVekdyo+ zXv1vCfBTVqMryFqCQbHKa9dFEiEcn0ovcDpqBRthrlOZziGBF34am4PYSZgYNeEeTMk7X xhowlw4o7BsNaFYqBu6uIbzfgUNNFYTykrOjhtin5PTodNkeGzJArWMW7OjCdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb925BkQz10pn; Tue, 27 Aug 2024 18:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI72pB093523; Tue, 27 Aug 2024 18:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI72p7093520; Tue, 27 Aug 2024 18:07:02 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:02 GMT Message-Id: <202408271807.47RI72p7093520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 40f573de8adb - stable/14 - src.conf.5: rebuild after WITH_NVME changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40f573de8adbf87be4200300595364128072fee7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=40f573de8adbf87be4200300595364128072fee7 commit 40f573de8adbf87be4200300595364128072fee7 Author: Brooks Davis AuthorDate: 2024-04-22 18:41:44 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 src.conf.5: rebuild after WITH_NVME changes WITH_NVME is no longer marked broken on armv7, riscv64, or powerpc. Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken. Differential Revision: https://reviews.freebsd.org/D44850 (cherry picked from commit e5700dab1e7ad84b9a97025d263f0acd3599a1c2) --- share/man/man5/src.conf.5 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 3a7789a95a07..03675250f9cf 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd April 15, 2024 +.Dd August 27, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1327,14 +1327,6 @@ and related programs. Do not install the limited cloud init support scripts. .It Va WITHOUT_NVME Do not build nvme related tools and kernel modules. -.Pp -This is a default setting on -arm/armv7, powerpc/powerpc and riscv/riscv64. -.It Va WITH_NVME -Build nvme related tools and kernel modules. -.Pp -This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. .It Va WITHOUT_OFED Do not build the .Dq "OpenFabrics Enterprise Distribution" From nobody Tue Aug 27 18:07:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb940LlTz52ZF1; Tue, 27 Aug 2024 18:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb936ZfMz4Z4Q; Tue, 27 Aug 2024 18:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AyRsbFZFSrISsJ6gUCu4Vgx+ujR9xo6WFwJOEpLbgGw=; b=D21r+pb20PV0EPtX4dCtA0WwhZjUQSE/EYVB6/3QmOWJ3VU2epMtnu13iXszuIiH/mGu1m xfOAixEL5dPRdzg3ixKLrBO/WoNx6xWwe6CivEaGPuuNrJLwmc74pAzTW60Un354pYBzRO ZAH0clP45NPEmSwci9gYpO9YNGbFAAb4LCVpMgICXStPKdBBYGnEWXgP3BkSW2yVJF+xWa 9NRFyJ+vYZ8aVjqSsnjs+nOAvus7LI1SPESMEKMqC6KBOvJL5mX322rVj6AuYbdgDp2W/I 5kLxh3kYMWDUqLsXcYb/QuxnjfrG8vY8DYepmtjfGIWBfngUKPL1ZqhWxhPjiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782023; a=rsa-sha256; cv=none; b=oxSGoJB3pV5yxyRemVrwRng+/oiykqc+s93LgKtuKGvT1dy8QU6MItnSonQ/osLDXFXNKJ h4X/RWSVjTZ2FIHyDZ6GAQfXShJp7a1pbwn5UKlwyDEwRT9JllX0GX9w+SNXDd5TZqrQo4 W7nVbPd81W50IVxgoT0Oz0tOOqvGzPx5HTYSXnM+KrqmQ4xvte9K6k7fn6x2f9tjIMa0oD F1JfWQMj7mw3E8/soAAbaDWiHv0NIwkVCjkUDhIrW1uZp1qFyBMEItSY8lVq0U5YZNUijj GNuimI17z1xmEZNGg3rQKPQbfZx1xX9UhSH3B7/Pw803pmylltxWDSuOgsg9nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AyRsbFZFSrISsJ6gUCu4Vgx+ujR9xo6WFwJOEpLbgGw=; b=urKPJWnYwLjJo3H5TfXpqwjQZd4ShvsLHNkHcngZAy9mnJ7ld+b8OWa2h9aRrl4YX/Ntgw 8pDFv6dDa/CTdI9s+jw+inmII96aLiB+ItpcFvUjj9FKyq+AwgYrt1uktV3DlH2Gkwhve3 CaAwfbXhb2PMtw1mB4t1L04YETtILGprwkqFeHN4QfrqTTATnmar/mvSQYBjPG2uKf6RTO eq42TVcvAE4g3exaKzDbTpXNlv0FqY22Ojhg7C6FaJtoHbz0KFu1oE1bes1MFiw27K4/Bh 3ElOwj1wCMdzlvVjqtNpiI7rH4DrT6/2AkoELS9w1reocSXAtFhlWRfXrMgL/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb936B4xz10Tc; Tue, 27 Aug 2024 18:07: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 47RI73Pm093579; Tue, 27 Aug 2024 18:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI73qQ093576; Tue, 27 Aug 2024 18:07:03 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:03 GMT Message-Id: <202408271807.47RI73qQ093576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e13b9fb02ffa - stable/14 - camcontrol: One file per line in Makefile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e13b9fb02ffac7019895ca0aaa1eafbd1b31d705 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e13b9fb02ffac7019895ca0aaa1eafbd1b31d705 commit e13b9fb02ffac7019895ca0aaa1eafbd1b31d705 Author: Warner Losh AuthorDate: 2023-12-01 03:07:53 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 camcontrol: One file per line in Makefile We have enough files now that moving to one file per line makes sense. Sponsored by: Netflix (cherry picked from commit 69ae43a1e6a53a1b8898a31c6b7140bf52b2c3ad) --- sbin/camcontrol/Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile index d47dbdc43bd7..e0407dd20a56 100644 --- a/sbin/camcontrol/Makefile +++ b/sbin/camcontrol/Makefile @@ -3,12 +3,22 @@ PACKAGE=runtime PROG= camcontrol -SRCS= camcontrol.c util.c -SRCS+= attrib.c depop.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c +SRCS= camcontrol.c +SRCS+= attrib.c +SRCS+= depop.c +SRCS+= epc.c +SRCS+= fwdownload.c +SRCS+= modeedit.c +SRCS+= persist.c +SRCS+= progress.c +SRCS+= timestamp.c +SRCS+= util.c +SRCS+= zone.c .if ${MK_NVME} != "no" .PATH: ${SRCTOP}/sbin/nvmecontrol CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME -SRCS+= identify_ext.c nc_util.c +SRCS+= identify_ext.c +SRCS+= nc_util.c .PATH: ${SRCTOP}/sys/dev/nvme SRCS+= nvme_util.c .endif From nobody Tue Aug 27 18:07:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb952MDvz52ZKy; Tue, 27 Aug 2024 18:07: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 4Wtb950T0Jz4YkG; Tue, 27 Aug 2024 18:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iuJtdy8hV/V75rh4Lyn7TV7Yh23/kYxIhl1c98hEw+8=; b=GEJOUZKC+QfSYjyfARdpkGGJDUiIXx1SeB59Puqz0aZ8ZSY0+pkdKj4I9fwgcsVA8frzZP UZrAcayq+cFZ3DwQDofke3E4Ui0gFg1tkeiYYQ3QVt3tyeG63JRYluV+c/49etVOHuQvPv 6Ht3M1puTb9yHLrTj3MTERiW7tz+51z5vJ6xoI6T2p4OpgyXVeEXOhvMKR1u3GK9j9s4cO s1XN90OnuiOXjOJYScI47vkvjtNywov6bct4OduKn0Bha9irVRthAzTBfl/jGdZsEnkVMG 4/AKsMe4+pU5/amF3o3UL/j33SxBbcCO5czYmXJsmJ2Y3x+F76/NYMpEQbq30Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782025; a=rsa-sha256; cv=none; b=pTOr0gjVSaSIkTuZsw+6Fr3OpQSp/PUNHokXulbBquZ0+0tyADGVuDmTixnCmr/e4bhP9W E/ZH0+aTniVAkTT5NxXItI8aYM/TDFV0198K7c6CFW9yy1pPsnwCj7ngxHz9+lGhjDnbNy 97T95mDUM+wXDafq5WS8FegMn2ig0NEnbn6DgOvVHDiy3ZaGcg5t7bHAJk5bh0iOLb4iAs tRUmv7PLv93YKw/+Fy8MTIfat2z7woxb4wu+SLQQXgj1kx7R3XNCFKpo+HuiC1tSMEGntr ZPwslaoaJBJS6pCkeB0PJ6Hap2aO0InzyX1bZ8WL/L6HdzmdjyMEuN5IDRYO5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iuJtdy8hV/V75rh4Lyn7TV7Yh23/kYxIhl1c98hEw+8=; b=CMz8+4ZNoFm6LruhsXA7jbLthe1rVkTmMaAWOgjRfyWFoo53Yb/eA9wlbmK+DER0tYwOPP PmV4CerCjmxCw4nY0UP9qeVthwfOpQdk7YE8s0jvm19bD3AWMU8reOCZvCucbw+RHcoFE4 d4YUAqxJ7XtsaRRopcL6/yGNfHvWpuSl78E1YLbU5DKvN31gbA02R/8JwAgtO3fk9vObEs 6bxn2W8i/dso/QcSs5vy7tEe6vn+lM8hm/zQUCoPoxxxtkj/czMzDo/T2ABruOdZnjp1N/ xBgP7LPszwVRONwuvVyeC9NIiy0Th62uElBwJ3OWJpeLktkw9XJoO/Ich6kH5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9503mHz111X; Tue, 27 Aug 2024 18:07: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 47RI7487093618; Tue, 27 Aug 2024 18:07:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI74F0093615; Tue, 27 Aug 2024 18:07:04 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:04 GMT Message-Id: <202408271807.47RI74F0093615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8f586587daad - stable/14 - camcontrol: Enable WITH_NVME unconditionally List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8f586587daad64cb1d6c1bca0201bf97f0eae4c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8f586587daad64cb1d6c1bca0201bf97f0eae4c1 commit 8f586587daad64cb1d6c1bca0201bf97f0eae4c1 Author: John Baldwin AuthorDate: 2024-04-23 18:46:53 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 camcontrol: Enable WITH_NVME unconditionally MK_NVME is no longer marked broken for any platforms, so just include support for it always as we do for ATA and SCSI. Reviewed by: emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44841 (cherry picked from commit 2b676a66c00af03e4b64d072658d2478dbdf0a97) --- sbin/camcontrol/Makefile | 4 +--- sbin/camcontrol/camcontrol.c | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile index e0407dd20a56..b04eb5614c62 100644 --- a/sbin/camcontrol/Makefile +++ b/sbin/camcontrol/Makefile @@ -14,14 +14,12 @@ SRCS+= progress.c SRCS+= timestamp.c SRCS+= util.c SRCS+= zone.c -.if ${MK_NVME} != "no" .PATH: ${SRCTOP}/sbin/nvmecontrol -CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME +CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol SRCS+= identify_ext.c SRCS+= nc_util.c .PATH: ${SRCTOP}/sys/dev/nvme SRCS+= nvme_util.c -.endif # This is verboten .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 555a67001443..db26b45ac508 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -60,9 +60,7 @@ #include #include #include "camcontrol.h" -#ifdef WITH_NVME #include "nvmecontrol_ext.h" -#endif typedef enum { CAM_CMD_NONE, @@ -278,9 +276,7 @@ static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr); static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); static int print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr); -#ifdef WITH_NVME static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr); -#endif static int requestsense(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); @@ -600,14 +596,12 @@ getdevtree(int argc, char **argv, char *combinedopt) skip_device = 1; break; } -#ifdef WITH_NVME } else if (dev_result->protocol == PROTO_NVME) { if (print_dev_nvme(dev_result, &tmpstr[0]) != 0) { skip_device = 1; break; } -#endif } else { sprintf(tmpstr, "<>"); } @@ -781,7 +775,6 @@ print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr) return (0); } -#ifdef WITH_NVME static int nvme_get_cdata(struct cam_device *dev, struct nvme_controller_data *cdata) { @@ -843,7 +836,6 @@ print_dev_nvme(struct device_match_result *dev_result, char *tmpstr) cam_close_device(dev); return (0); } -#endif static int requestsense(struct cam_device *device, int argc, char **argv, @@ -2489,7 +2481,6 @@ ataidentify(struct cam_device *device, int retry_count, int timeout) return (0); } -#ifdef WITH_NVME static int nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __unused) { @@ -2501,12 +2492,10 @@ nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __ return (0); } -#endif static int identify(struct cam_device *device, int retry_count, int timeout) { -#ifdef WITH_NVME struct ccb_pathinq cpi; if (get_cpi(device, &cpi) != 0) { @@ -2517,7 +2506,6 @@ identify(struct cam_device *device, int retry_count, int timeout) if (cpi.protocol == PROTO_NVME) { return (nvmeidentify(device, retry_count, timeout)); } -#endif return (ataidentify(device, retry_count, timeout)); } @@ -5410,7 +5398,6 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) "enabled" : "disabled"); } } -#ifdef WITH_NVME if (cts->protocol == PROTO_NVME) { struct ccb_trans_settings_nvme *nvmex = &cts->xport_specific.nvme; @@ -5427,7 +5414,6 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) nvmex->speed, nvmex->max_speed); } } -#endif } /* From nobody Tue Aug 27 18:07:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb964MpBz52ZL2; Tue, 27 Aug 2024 18:07: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 4Wtb961Rh1z4Z9R; Tue, 27 Aug 2024 18:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HtPsTX7BCKJ3TFlp27TIIjoC4WUu82ZN6EziEjbjZhA=; b=dBXffpqvb0Kr2l/ixdOq6gWqZFgaGTmuI89TtMNU98i4IoEiKHBN0Wwo/ug4op0OuX+3hV +rnefpaF9/iWUzExrjULoKZEsqMB+i6ZqIH5SpEBz627I+e14ITMGJzGHOcBqSp6X/pbHI m1wZ2HHLwGAXcYkdfxr5YTQA/dJZoeXNCi+lNdOrs6gLtkzD63rNJZuKVA7tbbmQYUtRd8 Z4cQKltWumnKwnGX3phqCyKwoS0pxx+MQeAmsmujxr380A/c1NJjtmQ2cTyZj2MtAjNKYW 7fO2K2k8fog9I2wB9spAfUiTKrsgIz18b5I7b/uvBwLnYKZcBdkcV1DPuU8wnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782026; a=rsa-sha256; cv=none; b=xhdJ2PyBz+hylICu9zO813fr4mI8Xh3yzuEs1ZK4knAg5rVB6+qSKxBq22FVnlwcJJfK64 MRhcyyj1JregatwZLSJNrDDvcGICZl8Qf8tXeJIwj4XFjp8/UivUNw2ra8EXv8dn/1geOn o6L553cNxXtJ+rYaEZrA6Y9v26DX/GowSwSqLnMri0/Pm6zETVFvNoAcP51W7cXHMXpMkI iOrgAchuGxdwx1nYPV+63kZFG6RQB04vMkvOrwadVXbduAh592bI8WDtFvxWW3At+SQJYM a4++ep4AnO5A+JgYWxCHXoIYxKUsheTOHwJyHgqE5pLUGxl7cC/ErUlDYru1cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HtPsTX7BCKJ3TFlp27TIIjoC4WUu82ZN6EziEjbjZhA=; b=MR4JGfYqtQemxJRfRP1dtsgMr1nVjepYUqv9N/HpmgwBy8+apuENgw+zsCgyzy9pS1EYLn WwACWP/qG3nS3HkW3L7EPZTszMgrO42GMQpHMYLPVxxWSAZsjbgR6hel3HL2/n7Pq1bl1x lJ1y0AxzmEo0JQZgqgmwnkX5MqxkA7YmrwlnNKLYUb4F5kxgw6htsfvcLzQUkZZfQ+J/qt FRppJQDoccidb84cXt0Y9GsOOits1Yuc3WAIrocLEMEAidW0BY2rjO2Dj5eylY5kl4zsdl Vq9lhAyfrxR2aSPHoL01cR3pNBPFUaEwyjx6brfjinE7QXooazKN47KNLLw8WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9614Jsz10Td; Tue, 27 Aug 2024 18:07: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 47RI76Vp093672; Tue, 27 Aug 2024 18:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7681093669; Tue, 27 Aug 2024 18:07:06 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:06 GMT Message-Id: <202408271807.47RI7681093669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a3a8eabcdc9c - stable/14 - nvmecontrol: Always build instead of being conditional on WITH_NVME List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a3a8eabcdc9c603cbd57e4eba8b1485e03e7fd12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a8eabcdc9c603cbd57e4eba8b1485e03e7fd12 commit a3a8eabcdc9c603cbd57e4eba8b1485e03e7fd12 Author: John Baldwin AuthorDate: 2024-04-23 18:47:26 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 nvmecontrol: Always build instead of being conditional on WITH_NVME This now builds fine on all platforms so always include it similar to other tools such as camcontrol. Reviewed by: imp, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44842 (cherry picked from commit 2d51a9898e26c87586ba50e71b6b3fdf1591713d) --- sbin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/Makefile b/sbin/Makefile index c125075c6696..cbfff38cc626 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -52,6 +52,7 @@ SUBDIR=adjkerntz \ newfs_msdos \ nfsiod \ nos-tun \ + nvmecontrol \ pfilctl \ rcorder \ reboot \ @@ -78,7 +79,6 @@ SUBDIR.${MK_INET6}+= rtsol SUBDIR.${MK_IPFILTER}+= ipf SUBDIR.${MK_IPFW}+= ipfw SUBDIR.${MK_IPFW}+= natd -SUBDIR.${MK_NVME}+= nvmecontrol SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd From nobody Tue Aug 27 18:07:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb974vx6z52ZHk; Tue, 27 Aug 2024 18:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9728kNz4Ysv; Tue, 27 Aug 2024 18:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TwLyv7pahDvVkPsQcR02/sO4a4A2jSHIrbly4vHTHMM=; b=ee8wYa6NZsZ3uG5H9a9Fe1y0izioFwdBguRYz6FDqrzT2ZxivuPpRKqqYQWAkLQV7Q73y6 ipjCCAEjwRyDpQ7iB9UzyMNNan9aAze6WZ79pNxCIWW5oRzRRuqf2hgY75qFizDZ4X8DwG +H/lck8YpPkJKCJMTm/wYKwueTMcnDEMtQ/8tZfP45FYjIPTzMKBwgmb9XVR1rxbit2ILJ AqknGYHqKaLcQetrb7XIXdb3k/7V28VBVHm4yjPLaiH52FaeKbai+LDOl9LZIOQiAUNu1M sQonvtiR87AGqGGpIiItqIZ/7FdIEiHfAkEhCp+Ur/x03RHtPJ6QZS4VFrSBrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782027; a=rsa-sha256; cv=none; b=eA22mDlWN/OpvbKj9MsZ3hL3szybHv/co9Y0E38JEYDtcVH2DNyzVL7iVxngSufLljYuL5 TVgZwi4mavDiqrtcMOTalG3QSx7VMbxclEmmQ5+D9Rc/HXCkQuXqmFtTyr9iT9+54uI/d/ jVEVm+db3su6/IeXFxV1zzlAuQztr0puw7e79s7EmDNTNy5/4E9QV25U7+Jc1IP6Pt8UUC FST/DuALQz9k84nNs6xZM3CK4L9lQBcYHw+rcpFYfne3c29KNbkUlMEdgCA1JFLxHtvRkF sR9Z1+Wl0As4lvRYyZ87P7i/XUY6LdCf7nbV5fqsIYBXUVRQCa2Hc20pUjveDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TwLyv7pahDvVkPsQcR02/sO4a4A2jSHIrbly4vHTHMM=; b=woQ24jG38+1mAH50sheC0UrIoE1DnnEh+vy2zRR2XbOUMvx9MitIa/cT8FLyP95YpSrjuP kYE9Hiz3hn7f9EsIRXr1IH/a2BwH8dTHz0IYQZtl6ilZzT8cDQqtBkj8Ig2kpCAJsBV1gt ulfZkd93/bNdlTHoeDAYfdQIqZ/g4wBKgne9ZpWdfTgADDLhW+4/em95Abx4c1wE+9lrk3 yVH8R1BmckJQ6ySYZ13rmgvS2egnZ7gxPxcWyTCoa4WUrUii9fiMHG/lU2wk4lGdcGWbcV EzSpUe+Hpm6djY0vrGILVBfvu7RSrKiIL4szQrBahIi/vFAox+95wUJjdNiiSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb971n5Nz10pp; Tue, 27 Aug 2024 18:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI77CA093714; Tue, 27 Aug 2024 18:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI77P3093711; Tue, 27 Aug 2024 18:07:07 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:07 GMT Message-Id: <202408271807.47RI77P3093711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7b182a286d42 - stable/14 - Remove the MK_NVME build option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b182a286d42c0d7d799b5d2e05905dee803297a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b182a286d42c0d7d799b5d2e05905dee803297a commit 7b182a286d42c0d7d799b5d2e05905dee803297a Author: John Baldwin AuthorDate: 2024-04-23 18:47:44 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:45 +0000 Remove the MK_NVME build option The drivers and utilities are now built and installed unconditionally. Reviewed by: imp, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44843 (cherry picked from commit ee3187f6fa7986c6bfaa97528e050b796eaca343) --- share/mk/src.opts.mk | 1 - tools/build/options/WITHOUT_NVME | 1 - tools/build/options/WITH_NVME | 1 - 3 files changed, 3 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index ea5931ad6c1d..a12a748a6055 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -151,7 +151,6 @@ __DEFAULT_YES_OPTIONS = \ NS_CACHING \ NTP \ NUAGEINIT \ - NVME \ OFED \ OPENSSL \ PAM \ diff --git a/tools/build/options/WITHOUT_NVME b/tools/build/options/WITHOUT_NVME deleted file mode 100644 index 9669deb2ed9e..000000000000 --- a/tools/build/options/WITHOUT_NVME +++ /dev/null @@ -1 +0,0 @@ -Do not build nvme related tools and kernel modules. diff --git a/tools/build/options/WITH_NVME b/tools/build/options/WITH_NVME deleted file mode 100644 index 053cfc568b10..000000000000 --- a/tools/build/options/WITH_NVME +++ /dev/null @@ -1 +0,0 @@ -Build nvme related tools and kernel modules. From nobody Tue Aug 27 18:07:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb985LRBz52Ypx; Tue, 27 Aug 2024 18:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb983WJbz4ZFR; Tue, 27 Aug 2024 18:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oixNhjcCsvp+iZC2C4Efb6CdOuO4cIqHYRww+ro5MRc=; b=l1D3dpFWpvtOw4BmRkQHrbpiEpKIoanttMjyaCn93BvIVrhaVmbJWLSHv8Jnt7JhvhdcVK +tiJASSjywXAj/bi9SkfU5IDLD2iooTjmDQNM264jiEuM/TvvTr7E7LSWXvKDDEDPuvrZ3 xR2uXYT4VYDDwu2qMlyVxKfEUIjWz+LlUiF50KjcXlm5qVyrPEjLgYvhbOHUQwTREfZoje Pzp40J7Mok58E8zPdU3ua4TgKD0wKSsICcSvwSWH1/itvf11rlH4m3XPLn3AGE18h5rSth R9P0PJWEERncO5rLDXKfyYLw23qKKrwporAFqDHqsc96GTyNTtiJfNs24se1JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782028; a=rsa-sha256; cv=none; b=Be4Vb9OyeHAwK40tejQy9mpdyTX5smHXvr9X48d5eslVhBgL9QAmaERy4pBR1g5Bcix5QS gnlCNLd0og5zuKU2WTBysRvuwtrfPTfem/djAOnynOi0pjd7IftHTFQbcncqbJ2VGHR5wq 8jp2KSoBg3suBE75xj6XaGaYSbCl5aOHeWF1ejkn/2BKzYdF72vTXGl3Mtbg57UOgq2sz/ ExBPaSmiUs/fFQjAtigIBybdbMcDtbQnMujFLxQYjjaNRZ5CoU5G0Y4Wclyy84R+v30313 YCydVDj4O7Q6BKsJ2Cei4gxqbfs3AD9WX3CeSgsnFZiKvHBLKQswBLbn+hVQTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oixNhjcCsvp+iZC2C4Efb6CdOuO4cIqHYRww+ro5MRc=; b=ynHeDjjM07IH0ICYUbd+x/HiH27xGNoESXZ0A+huizkJBZCQjMZ+OEXoUll89IG74oq9CT atkwlgsNIEwzujK4SjRqblveQ6ylF1jLHmxKg2gKbWWArAd45iXJji/L+CYaZFJlTvpkHj wDWC+4eUp29khPlvPVP6Gi534o5xrd+1q7Ov2VH/8h/5pORnG8bEL/VDcRRqJjFGm2pWRr ebp5a7bw5v/fCCYGzEypQK1hMnLwc62MWDKmY0b2vExfxkYfdi4SuINJgLiYqLV6QlBobm BYQ4QJHq0VD+xaFo3cfZCHq/US2PPqWaa03+5/2rU9rYJdm6e2gT3xJDiznDrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9833crz10pq; Tue, 27 Aug 2024 18:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI78RO093756; Tue, 27 Aug 2024 18:07:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI78jH093753; Tue, 27 Aug 2024 18:07:08 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:08 GMT Message-Id: <202408271807.47RI78jH093753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c7379937a2d4 - stable/14 - src.conf.5: Regen after removing MK_NVME List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7379937a2d41d53731601454637d02d77c5fa99 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c7379937a2d41d53731601454637d02d77c5fa99 commit c7379937a2d41d53731601454637d02d77c5fa99 Author: John Baldwin AuthorDate: 2024-04-23 18:48:50 +0000 Commit: John Baldwin CommitDate: 2024-08-27 15:54:55 +0000 src.conf.5: Regen after removing MK_NVME (cherry picked from commit cbbc5770a30b6769d9d9a3a4504b81a5400a9110) --- share/man/man5/src.conf.5 | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 03675250f9cf..2713ad0c418c 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1325,8 +1325,6 @@ Do not build and related programs. .It Va WITHOUT_NUAGEINIT Do not install the limited cloud init support scripts. -.It Va WITHOUT_NVME -Do not build nvme related tools and kernel modules. .It Va WITHOUT_OFED Do not build the .Dq "OpenFabrics Enterprise Distribution" From nobody Tue Aug 27 18:07:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb996plBz52Z8Q; Tue, 27 Aug 2024 18:07: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 4Wtb994LSGz4ZNQ; Tue, 27 Aug 2024 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2mHjY2jqefD7KRLYYZQyFof2UiXbUgWU+Jye6pePj4=; b=Bp1JMPGAfnng0J6IBqrcTr/pzfR2Wn7XLNiwUcmqvFcb5ln5MmjWA74A817BrF5WAZHMTV jMVIhhuIu8gXWkhhaTe/PYuS8Z1apQiqbtiZ2UcGmmPoEVSF6bmWXcctFfDJWpESRNv+vC 3Aw+FWO+1KBKoMxefxQrv9pcDXgrH+4T9dUkQl0NQ/yMfl7tZEAIBnSGKFkB0IflnHfr1C lUfRDJgtowliI3rnyQkeSTYe4GAhSMr5UHLSUp8KB2p4tvAPqM04xeZTQerYNIv1ru2eOD uX4lCtoIVUn9gZUQE25+m6z3NH75v6JgaieEoV6g5QG/DqRs8ZpGWxyCZUHFkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782029; a=rsa-sha256; cv=none; b=q+7iH7InNyNYp7C9Aueglwutx18GBw0ajY7cNPPVdP6RjYLdbVgbdP4eS5n8WD89nXaEXw xejjwjRWzxybroH02lCo+jdGblH2Rlsj4Y1XwESUOXeybF0ejXaOU7EBS/6hDDypCktclZ HKSVOXqnSxmPtrOpVdXqo9e9CjOweEdrG6NdFC32ROvcGeVFTEbVBUO0/oP7LmJrq2SKis /N3NsNTPk4DPmXsFs9CgjRFeyJMQqHcJxNbvEd6rPhNcuJgRVnBRY0JC4RHcuhmjZwtTIa QPYHBcQ3bg3/9sxF4SXFpd8a8Gcwik/rX2Ryl/8P6TlF/BsTXgNC5P/S+eni6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2mHjY2jqefD7KRLYYZQyFof2UiXbUgWU+Jye6pePj4=; b=QkUDk3LFouWNs5xjfTax+i7LtAOyVzWaCqJ/xb+jZQCVnrQhfELaIhbwXZ9O7CndXSlYTg OHO7AIrhswq1AgjMNTm3LRw15E5dpqjRTXFBzMcm1JfVPFZJcAjG92KjzDGy8omUJHMqkB TPg2gXET/KkVwH3LwA6ScbG8doafg8tGbp0qVDR+PvjZOoljMEu9Lnc7Xj43G3hPIbAAa7 LM77QcQQf6yyw9Epu/+TDMpSiwJGGoaaRXacgF93cKtlznPtMtHrmQeCBwhVpo3SJkNgot Nu0IJRJsC7kh75QTjJtNn623JRzC9VNKtoAxeIS5auq8eOf+dSDaLTjYGqpfCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb993ys0z10S9; Tue, 27 Aug 2024 18:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI7938093819; Tue, 27 Aug 2024 18:07:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI79w2093816; Tue, 27 Aug 2024 18:07:09 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:09 GMT Message-Id: <202408271807.47RI79w2093816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 38b00f73b8dc - stable/14 - options: Make it clearer some x86 / BIOS only things List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38b00f73b8dc453cc976c56021578d01f5fc3f55 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=38b00f73b8dc453cc976c56021578d01f5fc3f55 commit 38b00f73b8dc453cc976c56021578d01f5fc3f55 Author: Warner Losh AuthorDate: 2024-08-06 23:39:10 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:32:54 +0000 options: Make it clearer some x86 / BIOS only things Suggested by: jrtc27 Sponsored by: Netflix (cherry picked from commit bf4f27e85aa62e459fb4cde9ebd51e32bdac7910) --- tools/build/options/WITH_BEARSSL | 2 +- tools/build/options/WITH_LOADER_PXEBOOT | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/options/WITH_BEARSSL b/tools/build/options/WITH_BEARSSL index 9dcebbf1ae30..ff443a20586a 100644 --- a/tools/build/options/WITH_BEARSSL +++ b/tools/build/options/WITH_BEARSSL @@ -9,7 +9,7 @@ signature verification and related operations for Verified Exec and .Xr loader 8 . .Pp -Due to size constraints, one may need to set +Due to size constraints in the BIOS environment on x86, one may need to set .Va LOADERSIZE larger than the default 500000, although often loader is under the 500k limit even with diff --git a/tools/build/options/WITH_LOADER_PXEBOOT b/tools/build/options/WITH_LOADER_PXEBOOT index 01d4a0b86a66..37cf1fa254ec 100644 --- a/tools/build/options/WITH_LOADER_PXEBOOT +++ b/tools/build/options/WITH_LOADER_PXEBOOT @@ -1,4 +1,4 @@ -Build pxeboot on i386/amd64. +Build pxeboot on i386/amd64 for BIOS booting. The PXE Boot loader package needs more space than we may have in the boot loader. If you need to increase .Va LOADERSIZE From nobody Tue Aug 27 18:07:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9C1Cbsz52Yq5; Tue, 27 Aug 2024 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9B61Whz4ZTn; Tue, 27 Aug 2024 18:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGzTjw+VakiOzx0f9/1ac/3pJ9g3tQdF47mGH0HGMnE=; b=yAn5XtNsLIN5K2B57cmYrdmijusfcWWTenqCex64Iu3sjygIZB/x17p//MGuEhnsrc7Cv6 Fmmmrj2RqHqd8WDGWuO7AXXs6HTEumh+qvo96tfU3GdwoBN0+lcIu+tIavL3pVsfzaV+Bv oNd8dI4lRgKrj9ZsY6yNMMEQHa2cEauA0QTX7O1xN14+qs8U9+jagdHSx9P5y5obXwlsQq brvDrV/sBsA8XYcfjujRulP0LuPvbLLkc3YfiivYhtrhHF+mIowfYmeVyqF0Gld9CkaKx5 bEzrCTCVK6BKbFVsW1Y8r5hC2tpS+9vAxPbOyNALS2608gZzI+8hg3cpqJjNhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782030; a=rsa-sha256; cv=none; b=XnYQdFy9uKPLnghGmMsMBQiRI8vd9zXSj3RyjyxJlbBJaw2oo+6vPd6dbHe3RJ9Po7wIIA i0NYi0/BxYkkKBkG5yC2q8ADpGTRYV3bwVBN1Ey6ex1etY1Zi6ue/DAuXU3+3DAe/dCiZq 3kGiY1L4VWksclP2ULFAWC2v+4rgkRLXabPijZWfZWaSOHPHsNNzd8Nfk9Bk4IEyCMwCbv E+okEchws/pvp6eeMkeDbamauc8p8D5iSF86qYX40CaqowMGI9kx7cRpiXa26ffD18jvc4 uAWu5sNuckx89R6abeoo+Szt1n/BFGhTi/FLdGqANWTiMPS5mTNKPI3aYJ3X4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGzTjw+VakiOzx0f9/1ac/3pJ9g3tQdF47mGH0HGMnE=; b=SZC3VUvbc758aclBVvc4rrWSEj/f0FhwPen89nqMdNvyVDLUmxjE+750qT0QUA5OjMCeYj +NotDeAiIq0SnF+S/bVMFCQiL9KBTG8zCyxJwunEN0lNChnQyn92uEq4uyTRBOxAdsVNQl 9kRD6aVSgQ9/6mWYZrhVWdCAyzCh0Tz01n3dkwe+6QM4UHxDea/U+nLA7MipmFumQx6Sk1 eSNPzfJDiKJnOYDAXeJkc4ZeGPyaSauzDdmtNL7VVu8mHqRPPeNZQ7uUASlzU2DNMGH2y9 0XybGlHXkXv5e4uanwTJ1O6YEOgZ9Acsd2LfeGmyT8LIxd+aho4zHj5ZYF9wfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9B52T6z118P; Tue, 27 Aug 2024 18:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI7AWS093858; Tue, 27 Aug 2024 18:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7Arl093855; Tue, 27 Aug 2024 18:07:10 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:10 GMT Message-Id: <202408271807.47RI7Arl093855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3cff088ebdac - stable/14 - src.conf.5: Regen after ddcd3b606c9d List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3cff088ebdacc1e3b2646e035b3e6edc7aa05cac Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3cff088ebdacc1e3b2646e035b3e6edc7aa05cac commit 3cff088ebdacc1e3b2646e035b3e6edc7aa05cac Author: Warner Losh AuthorDate: 2024-08-06 23:42:52 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:33:16 +0000 src.conf.5: Regen after ddcd3b606c9d Sponsored by: Netflix (cherry picked from commit 9ed58aa60fd9cfcc7b6d9f4efa3a0631da393fc9) --- share/man/man5/src.conf.5 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 2713ad0c418c..11801456716c 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -154,6 +154,25 @@ This library is currently only used to perform signature verification and related operations for Verified Exec and .Xr loader 8 . +.Pp +Due to size constraints in the BIOS environment on x86, one may need to set +.Va LOADERSIZE +larger than the +default 500000, although often loader is under the 500k limit even with +this option. +Setting +.Va LOADERSIZE +larger than 500000 may cause +.Xr pxeboot 8 +to be too large to work. +Careful testing of the loader in the target environment when built with a larger +limit to establish safe limits is critical because different BIOS environments +reserve differing amounts of the low 640k space, making a precise limit for +everybody impossible. +.Pp +See also +.Va WITH_LOADER_PXEBOOT +for other considerations. When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1047,6 +1066,17 @@ Build openfirmware bootloader components. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpc64le. +.It Va WITHOUT_LOADER_PXEBOOT +Do not build pxeboot on i386/amd64. +When the pxeboot is too large, or unneeded, it may be disabled with this option. +See +.Va WITH_LOADER_PXEBOOT +for how to adjust the defaults when you need both a larger +.Pa /boot/loader +and +.Pa /boot/pxeboot +.Pp +This option only has an effect on x86. .It Va WITHOUT_LOADER_UBOOT Disable building of ubldr. .Pp @@ -1068,6 +1098,8 @@ with support for verification similar to Verified Exec. .Pp Depends on .Va WITH_BEARSSL . +May require a larger +.Va LOADERSIZE . When set, these options are also in effect: .Pp .Bl -inset -compact From nobody Tue Aug 27 18:07:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9D3XPnz52ZNT; Tue, 27 Aug 2024 18:07: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 4Wtb9C6YFtz4ZVK; Tue, 27 Aug 2024 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CI2YiuB9XzclafVqF8U5czZIc4Zw/XydQDP1VlYJyjg=; b=U9f/sY061GEmgysPZ8HYxT6blueuMlowOOiUzDJ4ZXIWNsdxYscOyEAohbpQnAP1+A4HSi vONLGBcwqNe5Y0zeAB6m8ioTDzJ3Rbu5JNIVurZr41U5gRk/L/lK390pf4hAjqDrHysG9y AtQ7T7ON3nM1xsermmq/FiO/rFsMe7Jx6BNRaupxBFg6E4OCStrL+S+qeTEuJyzegwOhA7 6vfpOtrSUlFG2FlP765dy/nT1r26q/VIHdU/ksPZ+T0bXfYXldwhFRq5leqpWcYJmUEQB4 xwClndyg3PPKos6dsAjvYBs9zmEMzSRGqOd62w0SxB0ZwRylWgIEnMEIZvRjOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782031; a=rsa-sha256; cv=none; b=ngDJajV1Pr3Se5e3vOZzhVUgXe7+B1Ppx9gnVV4Eyfc+Dsm5aFtXQSzENjrUBTQFm2qNpp TVICfl8SXs+Qhl9tBBujRecXiIXrak8WWNG1KHOZegGgVcSor4RZclZs1zbfKkX6peT8Jm +XHKXhEiVWAsz6/0i35itWOUzBiOK3fckdWCXHK7dzlKj/fWpUS4Ugz/I9I5saNyv7r9ue 691WFjLGijbPJfhZz54WtIdflnCiZVEcAF0vNXFIpFe9DY8YAdyFI5MGk6mgKBaHuJxzGX Lp2LUDaexdy9letIrJnvaop+5wuP0f0zUnVOm1HmW/TMY/Av9RXmx8Zo+AaugQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CI2YiuB9XzclafVqF8U5czZIc4Zw/XydQDP1VlYJyjg=; b=QbmWMX0t3e5dsVL2JR+7EXsyE3Mb0hZ6/QrIf1ptTgmJooJBZsEtr8/JHU6V4NWnsxgkV3 uIexrk+n+kRImxE8CeE6y5Ju28PNWWfkGvGLTFVPhRp4NDXZBnIjFmtu8dFDo603VraR96 wgRkEnmzfGJw4efZBTCRA9wJEC2ohkXGu2PIyMvHFts7/poOJxRfIZSNQ33xw0Ei24SxRl TnAdZP7TdyWfZ0HGQwiXPy0gxNDchIPRBOoPvNwWkOaL34IivjP2Se4CVXoWgSOwtYbAzb WpEs0lkjzdZoWUBSCI5MuNDwZibN9/RaTDrPSsapMsh4aUwqDw8AWeb2cuJChA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9C66N1z10SB; Tue, 27 Aug 2024 18:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI7BSw093894; Tue, 27 Aug 2024 18:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7BOg093891; Tue, 27 Aug 2024 18:07:11 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:11 GMT Message-Id: <202408271807.47RI7BOg093891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c4fa138c2a1b - stable/14 - camcontrol(8): Fix typos List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4fa138c2a1bc32e239f17239ef4e1a89422df22 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c4fa138c2a1bc32e239f17239ef4e1a89422df22 commit c4fa138c2a1bc32e239f17239ef4e1a89422df22 Author: Che-Yu Chang AuthorDate: 2023-12-26 16:07:26 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 camcontrol(8): Fix typos On line 748, "bigger than" is mistyped as "bigger then", and on line 765, "more than" is mistyped as "more then". Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/949 (cherry picked from commit f8f3b16b6cb671649345352c16894f59679c096f) --- sbin/camcontrol/camcontrol.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index 9d2eec87e0e0..9ae3debceedc 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -760,7 +760,7 @@ Disable block descriptors for mode sense. Display/edit block descriptors instead of mode page. .It Fl L Use long LBA block descriptors. -Allows number of LBAs bigger then 2^^32. +Allows number of LBAs bigger than 2^^32. .It Fl b Displays mode page data in binary format. .It Fl e @@ -777,7 +777,7 @@ The editor will be invoked if detects that standard input is terminal. .It Fl l Lists all available mode pages. -If specified more then once, also lists subpages. +If specified more than once, also lists subpages. .It Fl m Ar page[,subpage] This specifies the number of the mode page and optionally subpage the user would like to view and/or edit. From nobody Tue Aug 27 18:07:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9F3Bfhz52ZCt; Tue, 27 Aug 2024 18:07: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 4Wtb9F0QNFz4ZZt; Tue, 27 Aug 2024 18:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FB79oHF19fpKu/4hCt2z3ZpUUTIC8ND+gzraZkjx6B8=; b=KEhLN9bfkzG4t/yBgGNolYYi+DNzzCgXOF5+YmEBTcRhYcyhcUyCWzgh8KFHt2EZcbAYRz 8CtcNk8jd+yO0APRNNdyiUU3a0Fevyw+2TpkTkG0OA0LWvhWplZIEFJjLZyeha/EG2MDgZ MNmmtOR1hA/ejFrxZrs92+L9oCB1mtjDbSGJciUcfhSBLmsNbXL2bG3gp+ZzpUCoMy8a2o /94Vgjs8NTUGfvd4u7cRouETWP9gNiJhEFAQcT5DCAEvgJyNBFjYVTNhnBdAQILau6XyqY KgfKmKare79NCvMPqJBa9ZXS5iHoKXQiOWgx7YQ4pa3+3bv/wStzd6fUQEBxNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782033; a=rsa-sha256; cv=none; b=dCI+K9jgkwwgbiuWmnarRry/bq+hDrp7/BwcuO51hNxaMnByitni1r8sV/rSONV+VQRIVe Xwq/ejVnclaDrEvgkhkXO4nu3A3pQfIlt8SX7BUsJ9GwHK/WJx4xr3l7KeDGhlM5Ou6Cv5 FaWLYpChI/HZSbCGIHtvxucykUyoPRtwozN0KvCd3XvkfJ1avErrxEUhTem4O37rGuA5ky 3AX2hkEOByXnfi9hRIc5hgNi/KvvthNaYUP3fYWy/OYLbGwNnIlYrp2j6ScoBcp4HDeVdt cezaKkfcYLJUD73hprc6fW4D3UPiKt9awUyZ1g97aWeK1tDRkNkO3QapIJRSKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FB79oHF19fpKu/4hCt2z3ZpUUTIC8ND+gzraZkjx6B8=; b=L4TVn7/YVish5OUexZSimGOFATZ0vvWcs/bzSdwXPAyo7n5cO6mxhKAoMKZ2dDGg+smLik fpbVIFqq9wbieEK01xpDJaaTIeMPfwvY1S25VU4Z6ZjGUPP3evCk0fKPiMkRSgKnaoSryc 5q1tg6PkAsooP6Z42xM3dwPHKfIKrNUwQf7TCUN2Wa8HG4TtXaigVmlBtMopRY1P+Lu1m/ qr/GU7478EtS4DQibMiGNzWE2YdiXeOmg5SJTFESnkO2mSOkJ880koriRGkhf6HPnGsEB0 o3Qr+9g6CqnHykvRU5dY39fPYDXC4nnRLA4U2HnTT4ak39Ut3TwuDdsxAFT0wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9D73lPz10Tf; Tue, 27 Aug 2024 18:07: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 47RI7C34093945; Tue, 27 Aug 2024 18:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7CsF093942; Tue, 27 Aug 2024 18:07:12 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:12 GMT Message-Id: <202408271807.47RI7CsF093942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 152a9cfe6d45 - stable/14 - camcontrol(8): Fix grammar: a ATA -> an ATA List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 152a9cfe6d45709d41f6323f30dbf0b69a6afe46 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=152a9cfe6d45709d41f6323f30dbf0b69a6afe46 commit 152a9cfe6d45709d41f6323f30dbf0b69a6afe46 Author: Yi-Chen Li AuthorDate: 2024-01-12 06:37:41 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 camcontrol(8): Fix grammar: a ATA -> an ATA Event: Advanced UNIX Programming Course (Fall'23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/1030 (cherry picked from commit 9977fb8042a4b2f2b3386684e137dfb42bf1707f) --- sbin/camcontrol/camcontrol.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index 9ae3debceedc..bdda1828abf5 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -524,7 +524,7 @@ This is to aid in script writing. Print out transfer rate information. .El .It Ic identify -Send a ATA identify command (0xec) to a device. +Send an ATA identify command (0xec) to a device. .It Ic reportluns Send the SCSI REPORT LUNS (0xA0) command to the given device. By default, From nobody Tue Aug 27 18:07:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9G2jBgz52ZNV; Tue, 27 Aug 2024 18:07: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 4Wtb9G1BM4z4ZGs; Tue, 27 Aug 2024 18:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pu3ws5pD2Ey3EEy0IHDI6WpbJMJIDI9xe7x5FkZY0Bs=; b=HExHqyZ9iwNh7BUJ3BKJEgPN0q56EEyEknwSJ28ZGuQaWgE5aBM/5UdFfdqwTQbizqRoxW j7maBrKj1P0cDZQXhgpbkaAsocI/tl49mMEreD/2nh5/GCRGqTmC5u0t9sUBA2KhGr9kek wWo+VDDKselqeazjR76UD+8/OSXTJEor9lyaBl23i/IpJrnCbpdibRs+R33W9HSD6PuwHt MvVMpZtrKLDdenhNhoV5ypab/4WN3TXvimfyr9J0+fq9cGgr1fbvAL0pTJra2XFXQ2GMBJ 4wghqWXQsmaXbzniwNpzxuoBHOfkB9a21N73u/zXvt4F92gwiA4PAtUH8tZodw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782034; a=rsa-sha256; cv=none; b=FtmTqsNUoqTYHKPQAE25jtKkiiB36LhxScWBbguBcTYHa6I70802vJFw8qCWViHKFzSzVL hqkjtJcY88LaIifhco/WBWWTcIGW/HG6sk6hhc5Hg2+F3xhY9fKmpmjzFy0oQskd6JEaPx QMxLt63kPOMapSbNzU2lPM4IeQrIoPs+3hqKQ1InbFY/MG0K71+SklpG3slS8/UR/a96Xu wnNwgJHkyE88RkpovB1AD+WcfvARHDwf+pNYkiNT+MDmBj9PjWzDhXQjy0vYP49SI3dgkm z7quavSq/FFgqgeqqp2VUCOUZMG+E57HndZrir1sHvYVsJy+mn/nCLe7+zATkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pu3ws5pD2Ey3EEy0IHDI6WpbJMJIDI9xe7x5FkZY0Bs=; b=DLnwQjgScfHqQZnI9y86z3+uIXRXAbQoUUcWpxGRoHcIIKqKjZRAmeJhq04CYIYrjh5BxM UWhLRP4b3pmCA82gjmw0WVHBz5tr2HXSV71hnLvdHlIpkRTnBFIOXYp/F6zJIovFlykVej aL2nNHsL30a12Ujd0L1vpXOVhmLuaZ1/aBjQyRR++gFkek44V7qkN34AAvNydY9P/PcvoQ +mxmx7N7++KwYDMFbkcl8hxlSYBKHGXMimlzzpDdrkRHYb2OHiuefjxAW+SU1axUWbLSkz UkebXhyamxgjW6FIqd2HbtCwReq5kfTjhIrUtpqRw+1x5+w3QR2P7SlkO9rE7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9G0lpjz10Tg; Tue, 27 Aug 2024 18:07: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 47RI7EQr093990; Tue, 27 Aug 2024 18:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7E55093987; Tue, 27 Aug 2024 18:07:14 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:14 GMT Message-Id: <202408271807.47RI7E55093987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 169c76b9b65f - stable/14 - camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 169c76b9b65f97043af32058a86ceda8da4375fe Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=169c76b9b65f97043af32058a86ceda8da4375fe commit 169c76b9b65f97043af32058a86ceda8da4375fe Author: Elyes Haouas AuthorDate: 2023-11-07 17:37:33 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas (cherry picked from commit 7028e630d6110789502cfc0f17b36b6f513ec297) --- sbin/camcontrol/attrib.c | 4 ++-- sbin/camcontrol/epc.c | 11 +++++------ sbin/camcontrol/zone.c | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sbin/camcontrol/attrib.c b/sbin/camcontrol/attrib.c index 7e89dbc3d48e..4cf9832756b4 100644 --- a/sbin/camcontrol/attrib.c +++ b/sbin/camcontrol/attrib.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -265,7 +265,7 @@ scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num = 0; status = scsi_get_nv(elem_type_map, - sizeof(elem_type_map) / sizeof(elem_type_map[0]), + nitems(elem_type_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) element_type = elem_type_map[entry_num].value; diff --git a/sbin/camcontrol/epc.c b/sbin/camcontrol/epc.c index 206b34594f4f..4273ad19047c 100644 --- a/sbin/camcontrol/epc.c +++ b/sbin/camcontrol/epc.c @@ -33,10 +33,9 @@ * ATA Extended Power Conditions (EPC) support */ -#include +#include #include #include -#include #include #include #include @@ -151,7 +150,7 @@ epc_print_pcl_desc(struct ata_power_cond_log_desc *desc, const char *prefix) max_chars = 75; num_printed = printf("%sFlags: ", prefix); - for (i = 0; i < (sizeof(epc_flags) / sizeof(epc_flags[0])); i++) { + for (i = 0; i < nitems(epc_flags); i++) { if ((desc->flags & epc_flags[i].value) == 0) continue; if (first == 0) { @@ -466,7 +465,7 @@ check_power_mode: } mode_name = scsi_nv_to_str(epc_power_cond_map, - sizeof(epc_power_cond_map) / sizeof(epc_power_cond_map[0]), count); + nitems(epc_power_cond_map), count); printf("Current power state: "); /* Note: ident can be null in power_only mode */ if ((ident == NULL) @@ -638,7 +637,7 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(epc_cmd_map, - (sizeof(epc_cmd_map) / sizeof(epc_cmd_map[0])), + nitems(epc_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = epc_cmd_map[entry_num].value; @@ -715,7 +714,7 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(epc_ps_map, - (sizeof(epc_ps_map) / sizeof(epc_ps_map[0])), + nitems(epc_ps_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) power_src = epc_ps_map[entry_num].value; diff --git a/sbin/camcontrol/zone.c b/sbin/camcontrol/zone.c index d651ca0e2acf..dc87cd9a9570 100644 --- a/sbin/camcontrol/zone.c +++ b/sbin/camcontrol/zone.c @@ -34,10 +34,9 @@ * This is an implementation of the SCSI ZBC and ATA ZAC specs. */ -#include +#include #include #include -#include #include #include #include @@ -353,7 +352,7 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(zone_cmd_map, - (sizeof(zone_cmd_map) / sizeof(zone_cmd_map[0])), + nitems(zone_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = zone_cmd_map[entry_num].value; @@ -387,7 +386,7 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(zone_rep_opts, - (sizeof(zone_rep_opts) /sizeof(zone_rep_opts[0])), + nitems(zone_rep_opts), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) rep_option = zone_rep_opts[entry_num].value; From nobody Tue Aug 27 18:07:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9H3Y7sz52ZF4; Tue, 27 Aug 2024 18:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9H2jfCz4ZS9; Tue, 27 Aug 2024 18:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IQDvxuyGbScrF/jgNAqNc50anKeasI3aiD2zBFt0fBY=; b=vFXs8LxXJYXPQcZyqkn9sd8Ewe/1AOsM9JkUeXK8GiXoTWyUDfo9MS60oKdyLlpZgBVIsD vX1BpT1X/1uBf3kEtrQBqwlEVUPmAda+6q5xwQs2DuBQLY5hYDV5F/5tjGiNHIECVG0O/s 6ZkabYYlmiyxKn68qW7oo9LS7V63IMlJ0kOTqwqQI/QzcJUguIMz6yd/uFT70dHyxUliBI M4k2Zw/pZQyDzgygpMYV+7T5WlxHTxUl7UiqNEeUQg0VhYYZcoMDsamMHOZ8PABobplEip yaPqiHFkfMXYVQXd96d0F2GNtxiSAzrkOGjN3jIPLn6fvAjdkjlmteNQlD7YTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782035; a=rsa-sha256; cv=none; b=V/9dmE9M5iVaaTtZ3IYUsWytTe8HZ6BQAtF391vYZLo7asM5xGb+JF3wGAuIjD8OcB7Num YspJICdMDQ842/9EYMPKgchbte22iIkmwkdgj/05KsSfQeFw3HR4/wqFO9n5uFU3HRrY1g KjuYkYKp2FHaGOOcT/edVDoQZq0lLVXXP9tN7pHCO6RpAsl+qSLWxNX3UlSjy9oBZQ3Psd a8EybDVCT4b9t6Z8Cdnx0Sh65e8A9ka6KsEs2R8RTuaO5Vyaq0r3sT1aA6rqkFXD33trrQ Wo988b8hFJX1Ii5T+HZUFBx6BUgG83yUlqa72Cu+vYX6/24xaUB67A7V9D4qKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IQDvxuyGbScrF/jgNAqNc50anKeasI3aiD2zBFt0fBY=; b=xTg5IQRUzTCpj4w1rWND9FEiBTbwrumWwTNQzGkGebKaqh4UlFgfHrwVqpSujEaCvoC6jn 1yDzYNjC/4fkF1zaM6rfq84pV7p0EX5dwtd3vxpGKAA44tBvPmfoLgFIVMAXW9r7TibCbX 2azvlDdsOF+gRLTX7Kr41/e0F9IrAiWY00SVi1Y8oIMzS7FQNAb0ysSWD9pFHAa8zGWYOG F9NzEu3xuw5wV3Xk+REwLJghUNKEnozqqFF7tTtcBNMOWArw1jgsapbSJaLKXZWdGUFREI relSVVW2jK3kHmC8ELvNAnIikgRMpBi2evvJZyWxxMi1bG3aGl6fkvtPqQ4e9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9H2L3cz113Y; Tue, 27 Aug 2024 18:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RI7FDj094053; Tue, 27 Aug 2024 18:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7FVu094050; Tue, 27 Aug 2024 18:07:15 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:15 GMT Message-Id: <202408271807.47RI7FVu094050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: af6673e6a5d5 - stable/14 - nvmecontrol(8): Remove a double word in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: af6673e6a5d5959316d02674716d2946a3fcf464 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=af6673e6a5d5959316d02674716d2946a3fcf464 commit af6673e6a5d5959316d02674716d2946a3fcf464 Author: Gordon Bergling AuthorDate: 2024-04-20 09:18:59 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 nvmecontrol(8): Remove a double word in a source code comment - s/the the/the/ MFC after: 3 days (cherry picked from commit 6573ce292fc5ddc6c846860b3fa98473e3f5d1c6) --- sbin/nvmecontrol/nvmecontrol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index 2ce4ad4c5c2b..394a88608692 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -96,7 +96,7 @@ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, vo * this. Older compilers will support 128-bit ints on 64-bit * platforms. Otherwise we truncate this to 64-bit on 32-bit systems with older * compilers. We also check for > C18 instead of >= C23 because clang 17 was - * released before the the __STDC_VERSION__ was defined. + * released before the __STDC_VERSION__ was defined. */ #define UINT128_DIG 39 #if __STDC_VERSION__ >= 202311L From nobody Tue Aug 27 18:07:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9J6CzGz52ZD4; Tue, 27 Aug 2024 18:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wtb9J3zC2z4ZMt; Tue, 27 Aug 2024 18:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDLTx7dM55ttv2J1BNj5W4PXepGzQDjvEXO5kN7rqlk=; b=BBxwKNsF4N6QMNteqCOEf0sS12lYtVtRrYAbxTvZJWSFXTDwXvaau9snTDakpiQ1BZzQhL NTkh8ioDRYuKDykcz1mir8S5S7ixlUJtCoG5Uje+U99Tsdtmf/knclWQqf6R99oz8Ugbal Za81rbR0+eNGiC7UBWcqb5iWYCslX5/3bhCHrZotYl05ywCqpOnO2ZJnz0n+q0aionfIat 6ZqW04d8sUPFWtD7rw6CNBXh+D6AG102I0fpvwF+p+vUID2VhyGkO8WFWHzRlgweTVMLp3 7h+q9YzD4xI35A1CrXBitGi/l+VopqqRsUAN43mLhXHMuMDT5Hft/nmXs9jtyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782036; a=rsa-sha256; cv=none; b=k8s5QkJjsT/qc5IaULYs+Va2TDn+yVViR+5J/NxmlHEw9Bo7iUk3VTWpNSCBEwthLqcigQ wPwUjcFTac31w4kWyimvIAijXZzUmIjEsxpqwhfilzI7zqQDssmVXDcgPBab7nhOzzHbBV RFGR4z13BvJDYlBAqkYT5POt9Lw0V5Tf7mk4tkeZrgUXVDaAcQ8aY1FhbPa9S0gECVrCcE SiSA86DaY4mpkFaBNVzXYFq9NTwRrZI2/T1ymgCCpPsNdwtLlYgHpUwe10XQXLBTueAK3U 4EAjKtejKd5CMrEobc0AYRa4t4KCzaYj6Io/7ungAmQvXF6BXsIqLco+lhjc2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDLTx7dM55ttv2J1BNj5W4PXepGzQDjvEXO5kN7rqlk=; b=mlmLPsvcvDu6Os48JVxKvIB7sWz7XYDXICxuOGQXgCk490xsx8Q/lhda7vA7+Boq9vl58A PcGHRsRyeieN8lljb9WpVQlKZAGDvQiGVm0MIJZZb04r5o2WykoGfMpQ8low5mvqXLlbEV +oiHIAvZtOtTVF1xTHxt+Ug0rTpvmyl7N81D1qAAEGUaY9ulzs5GarDleIIh0F7kkO+IPJ w1vBz8W4+xGprI2Qf82VOy+QotOBR9BfgJjbH1RTnE9wYkzCh2OpyfaCzgkiSubYVyeA4V KAux7ETdjA2CV9R4qTcofVo+k/CDicha5n6fkEpQTGuoXBqFiwjG1qZYv5hRJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9J3Yv9z10Th; Tue, 27 Aug 2024 18:07: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 47RI7GWZ094099; Tue, 27 Aug 2024 18:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7GXg094096; Tue, 27 Aug 2024 18:07:16 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:16 GMT Message-Id: <202408271807.47RI7GXg094096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1d56b7ed637c - stable/14 - nvmecontrol: Flesh out nvmecontrol format information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d56b7ed637cf283c7773c857a86e8a6ab218751 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1d56b7ed637cf283c7773c857a86e8a6ab218751 commit 1d56b7ed637cf283c7773c857a86e8a6ab218751 Author: Warner Losh AuthorDate: 2024-04-25 23:47:18 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 nvmecontrol: Flesh out nvmecontrol format information The format command takes a number of different parameters. Include a brief summary of what the values mean, though since the driver's support for metadata is at best weak, 0's are almost always used for values other than -f format. Add an example that ties it all together. Sponsored by: Netflix Reviewed by: pauamma@gundo.com, chuck Differential Revision: https://reviews.freebsd.org/D44958 (cherry picked from commit ce3b53ffcc3ecc00fa6283542c60ff1fe697d853) --- sbin/nvmecontrol/nvmecontrol.8 | 81 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index b812149b5c7d..b5a85b1ab9f5 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -442,24 +442,62 @@ Use Extended Data Structure. .Ss format Format either specified namespace, or all namespaces of specified controller, using specified parameters: +.Bl -tag -width 8n +.It Fl f Ar fmt +The index .Ar fmt -LBA Format, +of the parameters to use. +LBA Format #, as specified in the identification of the namespace using +.Dq nvmecontrol identify +command with a namespace specified maps this index into these parameters. +.It Fl m Ar mset +Metadata Setting. .Ar mset -Metadata Settings, -.Ar pi -Protection Information, -.Ar pil +.Bl -tag -compact -width 6n +.It Dv 0 +do not transfer metadata with LBA information +.It Dv 1 +Transfer the metadata as part of the extended LBA information. +.El +.It Fl p Ar pi +Protection Information. +.Bl -tag -compact -width 6n +.It Dv 0 +Protection Information not enabled. +.It Dv 1 +Type 1 information protection enabled. +.It Dv 2 +Type 2 information protection enabled. +.It Dv 3 +Type 3 information protection enabled. +.El +.It Fl l Ar pil Protection Information Location. +.Bl -tag -compact -width 6n +.It Dv 0 +Transfer the protection metadata as the last N bytes of the transfer. +.It Dv 1 +Transfer the protection metadata as the first N bytes of the transfer. +.El +.It Fl E +Enables User Data Erase during format. +All users data is erased and subsequent reads are indeterminate. +The drive may implement this as a cryptographic erase or it may +physically erase the underlying media. +.It Fl C +Enables Cryptographic Erase during format. +All user data is erased cryptographically by deleting the encryption key, +rendering it unintelligible. +.El +.Pp When formatting specific namespace, existing values are used as defaults. When formatting all namespaces, all parameters should be specified. Some controllers may not support formatting or erasing specific or all namespaces. -Option -.Fl E -enables User Data Erase during format. -Option -.Fl C -enables Cryptographic Erase during format. +The +.Xr nvme 4 +driver does not currently support metadata and protection information +transfers. .Ss sanitize Sanitize NVM subsystem of specified controller, using specified parameters: @@ -763,6 +801,27 @@ device. The corresponding .Pa nvmeXnsY device is used automatically. +.Pp +.Dl nvmecontrol format -f 2 -m 0 -p 0 -l 0 -C nvme2 +.Pp +Format all the name spaces on nvme2 using parameters from +.Dq LBA Format #2 +with no metadata or protection data using cryptographic erase. +If the +.Dq nvmecontrol identify -n 1 nvme2 +command ended with +.Pp +.Bl -verbatim +LBA Format #00: Data Size: 512 Metadata Size: 0 Performance: Good +LBA Format #01: Data Size: 512 Metadata Size: 8 Performance: Good +LBA Format #02: Data Size: 4096 Metadata Size: 0 Performance: Good +LBA Format #03: Data Size: 4096 Metadata Size: 8 Performance: Good +LBA Format #04: Data Size: 4096 Metadata Size: 64 Performance: Good +.El +.Pp +then this would give a 4k data format for at least namespace 1, with no +metadata. +.Pp .Sh DYNAMIC LOADING The directories .Pa /lib/nvmecontrol From nobody Tue Aug 27 18:07:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9L0Fr3z52ZD5; Tue, 27 Aug 2024 18:07: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 4Wtb9K5DyVz4ZWc; Tue, 27 Aug 2024 18:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jarrI+BieoerOhhczpDUng06r7B1Lgk+tywN+H/j/HI=; b=a0vgXjlAXFuDwkqbf8YD+WFaqN6ifKd/rdomL3MAMwwr7phdMOoCPin3znHPtKj0QnHT3U G1dU+ieojG5VarQivmcrbMZFww7YISpAuwmlyOsFvH6neiOP/jiHFSE4f19vmKSrIsHryw bQnOMkStVk8JtfoIJhY5HZzAZozbSsKhS+VP4mr9owdXFSLhjO1bxwSXZpQ5qHZ3ut/qBO W8Of2morcgpUwS9yw8TRSUU6+ssP3YDSBShBIYVxrVtE9CHUvkHmK8m8IupyFb1W9HEHvB 3+wuy+0kdUzLJktX4RBjRA7C6aaZaCJhumwoN5ath6w9ONpM8POw+9bh9G0GHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782037; a=rsa-sha256; cv=none; b=rj1llPcXpg854NKDtfv+PxlQxvRG8eA0t00JgzlVTs+YKAozhsufCfufjKpyps8lUy9hqx St+TiY49UynUQPoLdRfTd+VlD5Oge/LM8zxvy2rrW4SsuB0g+rA+zDWfMOTpbisSriWUhH PMtScdD8TfRGex3tyvmDHaJKodOhO8TrC7NNCLmhrNQou2VKYieH96QlkzdzZNVN8XzeAj GxaBmD2rbtraXu8SR91REb9JAiINGGxzwFwl0dPMWV3QEPV1DvZEFpq2BCfh2n6vjLJ/vE 4Y0NlPOAY/fcMN+ZPggLciK9NRSnljquSCV3m2CAs0Lx3DtFFsazTJqKZU1rpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jarrI+BieoerOhhczpDUng06r7B1Lgk+tywN+H/j/HI=; b=tt9rIK1dSMx/zyDrTeY7hoYo2RGSzozrmcpyUsGKvciozoXqWQiap1zKUX6S4ygD9hFTm5 AD0EIJT/yWYf+dUBJvLiMd+7eD+SV7Brpr3exRSBd5X4gjGfsyScw/i+Yk173XvtZnuWie aFodhGlhY5yW/Zy0guB0y7p4LUuS7Sv6kbuLP+aepHEJOJDIkjeiFS03nXbLvRPEPok0/1 WkTDjWCaTxoGC50nCaSdh3670MeLu8bVJFm4+z/qcRMlmQRDVCqjxFL/GdVyp1BOPaQySF LgkIBsek7j4ik7TJkKuC9ZeVZMS5wtPI5ph+CIwvbD2G2aQ7qoMrgJxMI4OAcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9K4q46z10SC; Tue, 27 Aug 2024 18:07: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 47RI7HLm094147; Tue, 27 Aug 2024 18:07:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7HLC094144; Tue, 27 Aug 2024 18:07:17 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:17 GMT Message-Id: <202408271807.47RI7HLC094144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 86a8ea7444c8 - stable/14 - nvmecontrol: Allow optional /dev/ for device names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 86a8ea7444c850c287200c47f95ddded6826e943 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=86a8ea7444c850c287200c47f95ddded6826e943 commit 86a8ea7444c850c287200c47f95ddded6826e943 Author: Warner Losh AuthorDate: 2024-04-28 17:01:24 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 nvmecontrol: Allow optional /dev/ for device names nvmecontrol operates on devices. Allow a user to specify the /dev/ if they want. Any device that starts with / will be treated as if it was a full path for maximum flexbility. Sponsored by: Netflix (cherry picked from commit b12cae88cfb6286bc85a47b36ddd84f52b5c38ca) --- sbin/nvmecontrol/nvmecontrol.8 | 4 ++-- sbin/nvmecontrol/nvmecontrol.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index b5a85b1ab9f5..1310184ac309 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -33,7 +33,7 @@ .\" .\" Author: Jim Harris .\" -.Dd April 17, 2024 +.Dd May 3, 2024 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -687,7 +687,7 @@ or .Pa nvdZ . The leading .Pa /dev/ -is omitted. +may be omitted. Where .Aq Ar device-id is required, you can use either the diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c index 92fbf9e25378..3876093451e1 100644 --- a/sbin/nvmecontrol/nvmecontrol.c +++ b/sbin/nvmecontrol/nvmecontrol.c @@ -146,9 +146,12 @@ read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata) int open_dev(const char *str, int *fd, int write, int exit_on_error) { - char full_path[64]; + char full_path[MAXPATHLEN]; - snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); + if (str[0] == '/') /* Full path */ + strlcpy(full_path, str, sizeof(full_path)); + else /* Add /dev/ */ + snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); *fd = open(full_path, write ? O_RDWR : O_RDONLY); if (*fd < 0) { if (exit_on_error) { From nobody Tue Aug 27 18:07:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9M1H3Hz52YqK; Tue, 27 Aug 2024 18:07: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 4Wtb9L5zFBz4Zps; Tue, 27 Aug 2024 18:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uArt6MNtGWi3Qkoazz384YSt+VoDFiq6IQxkbQ5AH0=; b=lAXg9NXFy9eR73dN2OIaUFzJr9CvwSF7m7m6kJ3qeO/xqG6DTpNObioVMMYatW3TdwDd8k stVWtNqSm1C35/3pSL331i+z7W/HuNVsjHkLnKfG+b4D8WXC9clCuSadB2qduKAf3cc4UW 2YBAvikDCozduYtn2u42+bX7CLWSMY4xSZpDrevtjVANU7r+3uU2FU6BCQt7crztqWgpwn nXXf/oZQ2m4D0aFyvgSJwAMx4uEjS4Ne3CpdTMkdsjPNUtDjU+16VdnMuq8/gSpexOfTiH i5SU//hfjwaK6cbCNkUX3eJxmaBSuDJmwvplaQ6D5Ahz4ydVpuoKLhbKqXk8qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782038; a=rsa-sha256; cv=none; b=q2hYIqA4TrM6tZSwkYxkv1XlXECaF6dQtK8T4VBwd8sMpoRMZPvADvBPSzbWJi25b13GMT gHjTP7aoJqIWW5CdlDWCbQpcPhVmj5ltP8n9DeQVuf2GCttfiR3l5C6x2wbTO7/q+Vm4OB NL0WgApmcK2MT9t7Q/stL+6MN7bHVvqw7I61P5EfBW2o/DHQ/nGqXJeRdkdE3z3tKh9Dbg yiT7esmAJWpvFfgph71/HDB1PsWaOfT0CCS7z1we4NpRlwV6BnDCAgdZSsGAgfywRdi6/x WKjIejW4LraYbh65JjiMrqSInrKueKDukdUIFLyM/4x65IvA2JhzWFFChBNQeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uArt6MNtGWi3Qkoazz384YSt+VoDFiq6IQxkbQ5AH0=; b=X415El7jcAtx6Z4iZq4zAgAXGw999Aux9txGBZZCpZRaAUg8tj6cQKjd1lRWEFjPVbEV2r 68W811LlqDSyJZ3seP7fKpaQ5DFqrmxM2i5/XWFEDaShd5pmSgAxEoKnjjYgs+SjfPTa8R 6hgjeirHshQxVLE33U2rXe571lxXz2jCe+cgOF4JmmhOXyp4q2E2WASCcxZX76fKQ2YvsS 9EyVqxHJY5lIedV6byK/tQxowsiNFZstL/LhLvN3tLZ5roLnlV6KVmBZXE+mPb7ghK79ki QMxp/jsh/gvG3Yu9piDx0r+maOhQ9yoMYCzWbk745r7p5XxPXs8zEAcKKB6ETg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9L5Wz6z111Y; Tue, 27 Aug 2024 18:07: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 47RI7Id0094199; Tue, 27 Aug 2024 18:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7IUK094194; Tue, 27 Aug 2024 18:07:18 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:18 GMT Message-Id: <202408271807.47RI7IUK094194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b2a3826e9d59 - stable/14 - ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b2a3826e9d59d5662126986f43b942307b9f52f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b2a3826e9d59d5662126986f43b942307b9f52f5 commit b2a3826e9d59d5662126986f43b942307b9f52f5 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:34 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas (cherry picked from commit 8f65dcd6276bf139a2fe87c1bbeffcc1fed015e4) --- usr.sbin/ctld/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index cbb8e2c25f5d..ec46a9b765a8 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -169,7 +169,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -291,7 +291,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) From nobody Tue Aug 27 18:07:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9N2cBzz52ZLT; Tue, 27 Aug 2024 18:07: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 4Wtb9M6yyDz4ZkC; Tue, 27 Aug 2024 18:07:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xJupswGXPDZMyUo7skMGIvwfYqMz1go5rY7LtMHuWvA=; b=oLEc0wZ6wkRc+w2P1+aKVTMcdxVx7yY0JlqNO1zVUPcceQTF0IcRb2Ftacq3O9Wn2O3Q3Y SA9OkkdiRV44uxYWzG90iSUXyFq3odCObegYmpD/LSiN+vUjwFL/zpG6L6zoms8fE60P2I +IGMQ0HLHlknDcLqwjzRUDzMqCYC/Ql3n4IdoOvgFEGxOmOE742fWnBGadcHm1YKpqaRVQ pwUlArYxZM79UjUj/k5gAja3ObI2WRySAdiUUUXhB5Z09FZlhhu30tdbcx4BTH97Z06dNL piensGnzin/Ll66TBQ0qFpHP40KYwcZouDWpAvbNv5czx/40/e8cvk5A34BdsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782040; a=rsa-sha256; cv=none; b=DNRTzVxUz40+xtSlEh46Ddxdg4ajQe06Lv5EpBgmzz2KEaOziGPJUSFH4fZeY6rtEvBCCH 8pEuOyELm/5OOqBwQDa/5DZCo3msBdCKkjIUgSJOMTjsOebodoKszT8tlxw7mMe3k3lcim JQ8A+BkPgcQzJr5dAeFbBU99eKXKsTJuM0ibh8DR1qfkZx1mAjPDTt0Zb433vo+5Jm8Tm8 DDb1hx/Sg7RYqa6QQ0pc+teMqNlHlqCX0zkGGp9Ns4VjvdPhALJ5vY9DZbWbXVvAFlIJM8 0zzfSfAAiozSLushlGqPYCwmK8ln5wZ5PAoNqtMc/2sxZIPVU6PdtgvL+3ukxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xJupswGXPDZMyUo7skMGIvwfYqMz1go5rY7LtMHuWvA=; b=xoRCYHH30TueAr2owV5PNYrZfNzd8k1WLcsR49rsZZsWWNnxf8n8wBObIUUUlI36whcVdc ah8vyza67UCZElCP/bbphzaxIbdLI8KCNNbnxWK254q9t0gkNzdZN0Um+PKj9ucxNKwgCn qb5FZBoD4514SeUSZlufsAesvtAXVA4TrYcWjNl46JcC+eJXooEO+Vu+26QL0iGHE6F+J/ Glwm/KwpBrrPfZ4Jze7KxIJKqhaG83BSIJ37VpItfUpAt3ZpRpncXUMDfl/TiSKSYob6sq FCNrB2ZL1Aw+h7KKHE9EO/2MYfP8X/jgabwCakwIy35tQGGo0mFsJ4cAdEsmqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9M6YSgz115y; Tue, 27 Aug 2024 18:07: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 47RI7Jj4094268; Tue, 27 Aug 2024 18:07:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7JG3094265; Tue, 27 Aug 2024 18:07:19 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:19 GMT Message-Id: <202408271807.47RI7JG3094265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9f01ac2f7d6b - stable/14 - ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 commit 9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:10 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas (cherry picked from commit 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6) --- usr.sbin/ctladm/ctladm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 228af7bae8c6..f06e70322708 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2810,7 +2810,7 @@ cctl_islist_start_element(void *user_data, const char *name, const char **attr) if ((u_int)islist->level >= (sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0])); + nitems(islist->cur_sb)); islist->cur_sb[islist->level] = sbuf_new_auto(); if (islist->cur_sb[islist->level] == NULL) @@ -3241,7 +3241,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -3505,7 +3505,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0])); + nitems(portlist->cur_sb)); portlist->cur_sb[portlist->level] = sbuf_new_auto(); if (portlist->cur_sb[portlist->level] == NULL) From nobody Tue Aug 27 18:07:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtb9P3jN1z52ZDD; Tue, 27 Aug 2024 18:07: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 4Wtb9P0pszz4ZsS; Tue, 27 Aug 2024 18:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h26UIMmp7l8JKpCGwXnrJq3GVIz0yIMsjdxEi3Ej40k=; b=q2/YkfICDQB8ryk1sVpxaLrrAbBd1Lro74f5Uq1WdUQW4k7rwJqHgWnQQZNLV0w1KGaqtJ sXRzQOaQkirs4fHTW+XGDTBeZzp0xL6/ZiDTr3LNWBaNq2zflVZhSxQpbPpD7YlgYBM8G6 O1n2wuhiMe5YsCgvqPNjKEj9AhmB/T4EqIqcNu38jxckpKIuDHRdrHTmQliRf05YEsW6E9 8DhfMq17DBwVWOIFILP7KMQp7BVF0RQ9j/D/ICRVeB4z4P8FqXHAnjayRjUjtTXEYk4WWH DB8yURPpsOlsQmPm8QcNFEK5+UlsnMG0+LB+n7X/P0HKMsfKskZOSMZBaJTGyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782041; a=rsa-sha256; cv=none; b=a4V26HnX86hgIyh0KnNaZas62O68RAwJklPmtnVkFmNgkKnKKQwuR1qYnepvhTAetXEa/R SjCM0wF2JwC7oFGB00RxWzGLO/fiao02Ags3t29+t6fZPQphtvnSflswYbt5WexwjHsgT3 tHc7ifsjABlLjs2ZaaZc2ftEUSrrUButHOcTbQcdE1KoYoXBXvlWW2xZSDorMopSUy47aL 8r3N/Gs8gb1sCIhcL1atxmsAfIWPHFn/j1tfGr+yXcolzoaXOmzc3VFoUiUrHt8CeyWaWe W4bBhukrfitTi/EcA+c/JPsjNVdJq10aPJ4ZH1s+6Em22TfodJtGQkxycYuKUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h26UIMmp7l8JKpCGwXnrJq3GVIz0yIMsjdxEi3Ej40k=; b=a/NGPccfRlK8FDbXUAR/IWmA3j1zJJU76KAb1S7z/1Oc9jG7PdNnPH7NJu0h6AcxD1gAXR hNGSdA/RRcF3Ezl+s50l+FvZ7XPlWQjyjfFmiMf+wiGrJD6eBs4nTinzqJy+8SYXNqjpJO jZyXFgebsA4eHgjXa35P1xoGWKAI6OsXiuC7P95dN6+AGUcQwu34Ig56QlNb2vrVEGHkYK 4OYm+Mg2Ion6YDSKisoPbwEOI9ht4hX266BidPQ2OD4L6FdijWMC4UJoDG9kpi89Z02a+g usOosDF56fmkZG9gKYq1Kxk0Z4kftloFY5M14l6ys3bgObDMsZeQ72CTTmE5Sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtb9P0R2gz10SD; Tue, 27 Aug 2024 18:07: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 47RI7KT4094326; Tue, 27 Aug 2024 18:07:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7Kbn094323; Tue, 27 Aug 2024 18:07:20 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:20 GMT Message-Id: <202408271807.47RI7Kbn094323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 52bc3fae713d - stable/14 - ctladm: Use nitems() in a few more places List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 52bc3fae713ddbec6310d842de1d8bf2cecec9af Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=52bc3fae713ddbec6310d842de1d8bf2cecec9af commit 52bc3fae713ddbec6310d842de1d8bf2cecec9af Author: John Baldwin AuthorDate: 2024-05-02 16:55:15 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctladm: Use nitems() in a few more places Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45017 (cherry picked from commit afd0c206a6ce9a182c1a26a4d8dbb66a8335f519) --- usr.sbin/ctladm/ctladm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index f06e70322708..4426274fdd44 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2807,8 +2807,7 @@ cctl_islist_start_element(void *user_data, const char *name, const char **attr) islist = (struct cctl_islist_data *)user_data; cur_conn = islist->cur_conn; islist->level++; - if ((u_int)islist->level >= (sizeof(islist->cur_sb) / - sizeof(islist->cur_sb[0]))) + if ((u_int)islist->level >= nitems(islist->cur_sb)) errx(1, "%s: too many nesting levels, %zd max", __func__, nitems(islist->cur_sb)); @@ -3238,8 +3237,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) devlist = (struct cctl_devlist_data *)user_data; cur_lun = devlist->cur_lun; devlist->level++; - if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / - sizeof(devlist->cur_sb[0]))) + if ((u_int)devlist->level >= nitems(devlist->cur_sb)) errx(1, "%s: too many nesting levels, %zd max", __func__, nitems(devlist->cur_sb)); @@ -3502,8 +3500,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) portlist = (struct cctl_portlist_data *)user_data; cur_port = portlist->cur_port; portlist->level++; - if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / - sizeof(portlist->cur_sb[0]))) + if ((u_int)portlist->level >= nitems(portlist->cur_sb)) errx(1, "%s: too many nesting levels, %zd max", __func__, nitems(portlist->cur_sb)); From nobody Tue Aug 27 18:39:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtbsz17YYz52cWc; Tue, 27 Aug 2024 18:39: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 4Wtbsz0V60z4gsS; Tue, 27 Aug 2024 18:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724783943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FpbAtf2uh7vyXNObJA1skAKFNUuRfZC8BtmqbFv3ZCk=; b=eJu22u579A/VEbToQ9msgKX4egJWCZIkfULIBtRSgqdcAs1GkwHxT7v0a8e6jnFZpunHUi knpsrsZBSXhl12GnjEf12LGMhfJHfyhQk8kioUDxH5UpZIyq6OgqupX5ck6qvqZwE1LURH df1jyYUipxhuduYSZmFebCW0Yo7TtQpgR2NSwxumf8oPg8sMKmMJNbopwI10G48TfDuXK8 C7FvNQtQtEJToh5EjiWOq0Mo8NkFZEMD8I7vbyPsvX9ualkiiCMSIS9hD1Uf8LqKCD4f6p iL8nubWmoMJX+WOcr6GxWBc2BskPqEsyL4o3hN6zUWQPS5keoXK7hTRF9tP7lA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724783943; a=rsa-sha256; cv=none; b=P7vrM+Uir/jfcncH711DADRGo83wU4wf5DZfeIsB9r5Gazy3eHQKc8NR3ZH1OqI9BWdHfn QHsvYnnuQFpFFs57hTmbNaEnlXg0p9/L9yjc+bgdENezB8g107lYLb08oSaZWkW0Q4zIyt 0dMXSGHHrcN+9df9D7emvk7yq7jBmGfUiQhGwxMsT52saluFmwSpu81o3JSBjxNp8zAVTc q859OjYa6jl6le5hv9SQlyut4tkbNrp6vXOXMJadD52Sz6ZbldAibOrWUFnyodwzWFeE0c 1JOEp2OtgIV75Yn3AtqgnNqP+AfGwXaDWzv9TK2Zc4/dlKdsxbBLZegV1dqVNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724783943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FpbAtf2uh7vyXNObJA1skAKFNUuRfZC8BtmqbFv3ZCk=; b=YIenJUN6ad6UC8A2dbReh9wx2+FEBwBkbCdUUIVZS0Q0xF0XcEgz/fe917b4mPqTzHdkeH 26E3gnYM3b8+wr21lA3Rtl17M1leXbVy5Yz1CcqXdFh6JxHMECfQNTViV/URQN8aDEYe46 TkfTCbxLwf4JBt0J1T8NDzqaMlksJPYS3RtYFvpUBKMIH9dPX6FIuSviAQ6XHA1vt5QC6R ZQNZJhtsfQGPvqWHwyXQWoAvUc3ve3N2SGxqqXvsVPDJKelRV2/+Td5y2rZl0x5rPLXc32 2aKxl4koZhOkZLzI31U2oPCBUFf/whDHpnsqh1m/uL7pF+7+rY+wzcVKMDiDXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtbsy71pPz11BK; Tue, 27 Aug 2024 18:39: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 47RId2GH044812; Tue, 27 Aug 2024 18:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RId2HG044809; Tue, 27 Aug 2024 18:39:02 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:39:02 GMT Message-Id: <202408271839.47RId2HG044809@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: 499c337781bf - main - tools/sdiodevs2h.awk: fix after removal of $FreeBSD$ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 499c337781bf8df7f97f612b93427b3f53dfd8bb Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=499c337781bf8df7f97f612b93427b3f53dfd8bb commit 499c337781bf8df7f97f612b93427b3f53dfd8bb Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 18:33:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-27 18:33:14 +0000 tools/sdiodevs2h.awk: fix after removal of $FreeBSD$ The input file used to have a $FreeBSD$ tag on the first line and we recorded that in the generated files to know which versions they were based on. With the removal of $FreeBSD$ the logic was not quite correct anymore; fix that to generate proper header files again. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46300 --- sys/tools/sdiodevs2h.awk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/tools/sdiodevs2h.awk b/sys/tools/sdiodevs2h.awk index 1cddd6c1f5d0..818bdef58762 100644 --- a/sys/tools/sdiodevs2h.awk +++ b/sys/tools/sdiodevs2h.awk @@ -44,9 +44,6 @@ function header(file) printf("/*\n") > file printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ > file - printf(" *\n") > file - printf(" * generated from:\n") > file - printf(" *\t%s\n", VERSION) > file printf(" */\n") > file } @@ -233,13 +230,10 @@ line=0; while ((getline < srcfile) > 0) { line++; if (line == 1) { - VERSION = $0 - gsub("\\$", "", VERSION) if (dfile) header(dfile) if (hfile) header(hfile) - continue; } if ($1 == "vendor") { vendor(hfile) From nobody Tue Aug 27 18:39:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtbt02Fn8z52cSv; Tue, 27 Aug 2024 18:39: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 4Wtbt00v44z4gsT; Tue, 27 Aug 2024 18:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724783944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tv4vFF/mU4aaY/rixZlbRk8vy4MF8WXoFcOVa+gKJX8=; b=aqOINMS30fID801HrDn9UqvS5vUm1Y/W2sLSqoVlRY8rvGo7kotSJsmPHONFwyn2pdUTDJ +JJJzh13N/pkibuCk7jzVdShcagJ92/FbHDZsKytzzOBLE77rLNg7hWNL9/WLttfSJ+57I 3L+6NzO1nea2LSyuM7vTFmvKxJ85kylir174PVvLb3n0Fph5WBpz2GRCV1AQ+7tDu+rzxE y8e6tAW56ILjw8R7eszrQ9Tap2CsI6c4G0S3qJC8uooISSek6+59zv9cxLq1ycNG6Ifzo7 n46xbLxGU7K8d3shurrDBH9oI5VOGeWP2IeCD4lJfOc5UBciPTJoxw4vDquu5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724783944; a=rsa-sha256; cv=none; b=KcqJ1LOTUAMywvPJ89/BMISXI9ryARITj8k8vyN4WMgLQbhzCa89MTlevlS2krQTwoHLhE ISfaKnuqjcU0eqMI+u4msh8d9vsinlNQ8XBV+5ebd0H3XoQ1Tltzg855n0yNOofgyuTIGt Fh2WUShzPt/giVhlqtcZ2q5QVtdMLux+E1DPBLLRtpf51LsiXSgaUwlz/Kl09sYhc/kib8 OaaGfd8RSw5NKXX6cYeC5S7HrVdYBWFSc7PFzyIytDwoRcwGK4zwC0xeNLxer/HYVnsrk7 YMOopmsVysrxhsnSItMOrohRuCq+RBxNPpP1rptVig2sDHA8lSy4hJKadGilIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724783944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tv4vFF/mU4aaY/rixZlbRk8vy4MF8WXoFcOVa+gKJX8=; b=fxsd9yh8YuB/+ePKrhYyoWoUnBELJNppDIvt9QjLinGDoC5f8Nm/BXbupCjFQwsU3vJgKD 3HqvX3DGGrqkErgvlgEjpwsdqZezK2/bkUCE32HACEjXM+8wHcEp7q/R4ZnJ7dv59Fhlx5 m2icPfs6kYzE4x9T3vfvHpObc+BtadsHEBdI5SaroQBYANB23YBtgzJwGqJP06Roq/jzww QxNmM9hk+49DUAT3pLd9i69pqiSgYK16C1IzUyXz4qtMTRDt+B1O+qBVHDQOq8pWwwP9RU c6hRNK5NJyAway9zkZ4U2mEMFIx85gaxjLPdBLY19/Th6bPmsZyq6KylP5Tx3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtbt00WdGz11bg; Tue, 27 Aug 2024 18:39: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 47RId3j6044869; Tue, 27 Aug 2024 18:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RId3NV044866; Tue, 27 Aug 2024 18:39:03 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:39:03 GMT Message-Id: <202408271839.47RId3NV044866@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: 51cb6f524457 - main - tools/sdiodevs2h.awk: adjust defined named for vendor and device IDs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51cb6f5244575e1abc008598e90eb35452ffbcac Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=51cb6f5244575e1abc008598e90eb35452ffbcac commit 51cb6f5244575e1abc008598e90eb35452ffbcac Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 18:35:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-27 18:37:55 +0000 tools/sdiodevs2h.awk: adjust defined named for vendor and device IDs Generate defined names which match the ones in the Linux drivers (a lot more); given we are likely to have drivers only based on those one way or another there is absolutely no reason to fight over differently generated names for device and vendor IDs. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46300 --- sys/tools/sdiodevs2h.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/tools/sdiodevs2h.awk b/sys/tools/sdiodevs2h.awk index 818bdef58762..596d09531ab1 100644 --- a/sys/tools/sdiodevs2h.awk +++ b/sys/tools/sdiodevs2h.awk @@ -55,7 +55,7 @@ function vendor(hfile) vendors[nvendors, 1] = $2; # name vendors[nvendors, 2] = $3; # id if (hfile) - printf("#define\tSDIO_VENDOR_%s\t%s\t", vendors[nvendors, 1], + printf("#define\tSDIO_VENDOR_ID_%s\t%s\t", vendors[nvendors, 1], vendors[nvendors, 2]) > hfile i = 3; f = 4; @@ -105,7 +105,7 @@ function product(hfile) products[nproducts, 2] = $3; # product id products[nproducts, 3] = $4; # id if (hfile) - printf("#define\tSDIO_PRODUCT_%s_%s\t%s\t", \ + printf("#define\tSDIO_DEVICE_ID_%s_%s\t%s\t", \ products[nproducts, 1], products[nproducts, 2], \ products[nproducts, 3]) > hfile @@ -155,7 +155,7 @@ function dump_dfile(dfile) printf("const struct sdio_knowndev sdio_knowndevs[] = {\n") > dfile for (i = 1; i <= nproducts; i++) { printf("\t{\n") > dfile - printf("\t SDIO_VENDOR_%s, SDIO_PRODUCT_%s_%s,\n", + printf("\t SDIO_VENDOR_ID_%s, SDIO_DEVICE_ID_%s_%s,\n", products[i, 1], products[i, 1], products[i, 2]) > dfile printf("\t ") > dfile printf("0") > dfile @@ -189,7 +189,7 @@ function dump_dfile(dfile) } for (i = 1; i <= nvendors; i++) { printf("\t{\n") > dfile - printf("\t SDIO_VENDOR_%s, 0,\n", vendors[i, 1]) > dfile + printf("\t SDIO_VENDOR_ID_%s, 0,\n", vendors[i, 1]) > dfile printf("\t SDIO_KNOWNDEV_NOPROD,\n") > dfile printf("\t \"") > dfile j = 3; From nobody Tue Aug 27 20:38:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtfWJ68mcz5JtRg; Tue, 27 Aug 2024 20:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtfWJ5KQ9z4sZc; Tue, 27 Aug 2024 20:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnyS+N+ccfyCdM0v99H3M9NZXAs4L7hsHS0wvQ7iE1o=; b=X4ezXOZm9lIsgfGR023zt9lt9tpHZiMUELsj6sCPLbU7p4YYTweZD4g4J1jCElohOA5JyM Dktyd/Zao+G6gBY7231fWTDSG5BaU4Gn/h3uWhFBRJdV28IpP5SH5oMmg9j8F0L6iKAHgt d4BFtG0KGzz9plsBt12prqgp5nV1WSoqXmst/zFvYfBR/k10xMaoGXacJFBxCNe5Id1O4T z+TNxfTNWe5bIKJqtKCh8I9vZWGIxQdoRFXi79m++A69V/9rovgdV+LPnztk4BdG5JCEtU IbHdaDdfmwBWT6Qwh/NcqkKnhb+vSD/DBa88kVKjY48/lBbX4lOrE0XyNd3tHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724791084; a=rsa-sha256; cv=none; b=XQyWqY7KG/DfmopQV6fGyulaRU9nHdrAhYqy4fH8HhIsJN0ofyU58r+ktHo1umcdbcSIs2 /tUM+MPlwa5WV6uAQ8aGEKllF8+UGob3DKVwtrPHPw25SlPn8DVKsNabv0CtoYjUVgw/Sg ZbIGWGqrWlyYAMCC0OPYu9pkdliPXZSW2skirec1kUk+Cl3Cx76/UmaubzX7Vpep5RDwsM UG4+FXqN5QNBhZ0BqCxREIky++vq7SrzWaGIF/vxH3RNmbl+v+n2TEfNt7rsopuMNgvi7A T/JNxfQhFlv3UHJEvwd/a9ew0ye5k8oX3KviuH2JFvpveoeymesZhCwVy57bVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnyS+N+ccfyCdM0v99H3M9NZXAs4L7hsHS0wvQ7iE1o=; b=eIWJ1C/DCfgHBRmSaKzr0dh0taSJeVXgTMV+Lc0rS3ZYrxKkh9R3ojthHTg6o2qB3YTRC/ V2jAChXqqY8yylD3Ra/fMuEjNsEK3aA2pYDAjplpj2EFNmy35J2WkZ1Rl+gE1xln29zjxF KLW01kXe4jghPAfym4Ebz+xv/2Mosg2y7e8GMmPv/R9T2f8QMpnbqCoWNS4njUt7E2jamO dXEiyGVsQl+rJ5AYp3B1QVv0I7nAT0SnJ0Pok+Td3ZF7fwzRfwWnQPxYIe6G1huJ+afZlF UVNsE+iJeoBF70gRyNjWH8IEkP1cq7qJk3sVBTyC2pLfyw/hOTSbLw/0XpfEcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtfWJ4wk9z14h1; Tue, 27 Aug 2024 20:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RKc4AL048986; Tue, 27 Aug 2024 20:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RKc4cb048983; Tue, 27 Aug 2024 20:38:04 GMT (envelope-from git) Date: Tue, 27 Aug 2024 20:38:04 GMT Message-Id: <202408272038.47RKc4cb048983@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: 705008fbfdbe - main - fusefs: Fix warning formatting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 705008fbfdbeff147fe624ae506f3781b5ba10bf Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=705008fbfdbeff147fe624ae506f3781b5ba10bf commit 705008fbfdbeff147fe624ae506f3781b5ba10bf Author: Mark Johnston AuthorDate: 2024-08-27 20:29:05 +0000 Commit: Mark Johnston CommitDate: 2024-08-27 20:29:05 +0000 fusefs: Fix warning formatting Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46456 --- sys/fs/fuse/fuse_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 29d88fc942f4..11d7b2d3e9bb 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -282,12 +282,12 @@ fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, * dirty writes! That's a server bug. */ if (fuse_libabi_geq(data, 7, 23)) { - msg = "writeback cache incoherent!." + msg = "writeback cache incoherent! " "To prevent data corruption, disable " "the writeback cache according to your " "FUSE server's documentation."; } else { - msg = "writeback cache incoherent!." + msg = "writeback cache incoherent! " "To prevent data corruption, disable " "the writeback cache by setting " "vfs.fusefs.data_cache_mode to 0 or 1."; From nobody Tue Aug 27 20:38:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtfWK6mQRz5Jt9w; Tue, 27 Aug 2024 20:38: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 4WtfWK64v6z4scM; Tue, 27 Aug 2024 20:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ilro21MpfaUjEazGO5v9y7bQ8QA4pAS8j6Gv3jZ9A58=; b=e1lMxTXdCel3zOWyfNFPemXWrQpE8mLNNbQ2mAxqAgb7tz3sk8WktpT24bsJNkEYFdw/tS 7YerrXXzT2kzIRvGNEQQ39oHE0f4ELGiYUnktN4OtyjN87YiCe13FkFsDmq0BCxjNfoOpZ G7aCuE1U+Iw/LL6O//9iDFdscBx91i69fum6WCrlAEU/Q4ehMcKS24/8IRenB1ozG56vFF JxGsLlO+R4fL/IbEWg06oIRl0k9rum/MWLFauKDd6HBchqtbfcSv+efXL65q/Y1RHDu+op FmO3VC97kd59fRu1MwxMJ37OQV1o+ds5nX0ipxT48HlilO8A6vgmpZnu9o+QSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724791085; a=rsa-sha256; cv=none; b=NJiOXWXSeNPabhSVRoS/N/tlE65V4Yg32/8eFuIzW5U+tEpDlDeJk/9toVfLrGrXs7YCc4 xvVPnzEAyfNeT3RpLUQpFHwgF6VBg8da3KjfqESlmqy+aErndszRG1QhMC8FT9ItE0s5jf Yoh4GloXKpmubkVhB95OnwNrOz0nY+waP+MDciuF++MqFFSsWD2YM3q2pda2s8FERqmKOO l/Wut0U9MF2+FdcOD0y+KbX9hUQcO8czPS2i4Zl4L1bthWxs41DPGe6cbfZmQQF9rkdfEG HhIsh/Zg0mdGaLQpYQJWArnPWBFAk7rHQ1k/qenP+gBFKAOytE00ft/PSNZ3Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ilro21MpfaUjEazGO5v9y7bQ8QA4pAS8j6Gv3jZ9A58=; b=YRxLWDAWzoRJE+znXYAGOKJ1iNbPhaWiqSXX48GTenhBoXT5NNn6KPXgMLJ2/JAQiSxs5j uwbeciptBNHlcN9u6P5oQ/+0M+eCgToubNURLk5M8LSn8QBLuTO2fp78p0r/+7acEKSdPl F1mq79uiuR8fF6UTz2iWaWSizL6HjEnT7p1f1nopvwhUe6ncd6whZFY6K8iHm0SCaYR5AD o3xFagXh1jL/NwXJXEungQgsOhgxJhdu1Qa1q+bglgVEuVv6TE6i4HZ9e0bSB/7HF5zc99 gjr35NYgDlguLrk6EXTunUHqEAnieTiCEs6pL0wAo8/fwZDsy+bSAWScsaJzxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtfWK5gygz14Dk; Tue, 27 Aug 2024 20:38: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 47RKc5H4049029; Tue, 27 Aug 2024 20:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RKc5cn049026; Tue, 27 Aug 2024 20:38:05 GMT (envelope-from git) Date: Tue, 27 Aug 2024 20:38:05 GMT Message-Id: <202408272038.47RKc5cn049026@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: e6651546c2dd - main - rangelock: Fix an off-by-one error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6651546c2dd72e028b9422f1695c432dbf47d75 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6651546c2dd72e028b9422f1695c432dbf47d75 commit e6651546c2dd72e028b9422f1695c432dbf47d75 Author: Mark Johnston AuthorDate: 2024-08-27 20:29:18 +0000 Commit: Mark Johnston CommitDate: 2024-08-27 20:35:08 +0000 rangelock: Fix an off-by-one error A rangelock entry covers the range [start, end), so entries e1 and e2 with e1->end == e2->start do not overlap. PR: 281073 Fixes: 5badbeeaf061 ("Re-implement rangelocks part 2") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46458 --- sys/kern/kern_rangelock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index e3bb413ab1bb..14163dd1c782 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -544,7 +544,7 @@ again: cur = rl_q_load(prev); MPASS(!rl_e_is_marked(cur)); /* nobody can unlock e yet */ for (;;) { - if (cur == NULL || cur->rl_q_start > e->rl_q_end) + if (cur == NULL || cur->rl_q_start >= e->rl_q_end) return (RL_LOCK_SUCCESS); next = rl_q_load(&cur->rl_q_next); if (rl_e_is_marked(next)) { From nobody Tue Aug 27 20:38:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtfWM1sT5z5JtM4; Tue, 27 Aug 2024 20:38: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 4WtfWL6Mq9z4sgK; Tue, 27 Aug 2024 20:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uo5YsJ/qQZlLNQyU4W6W1I7oNlIYSuW0FfPKz7zbQk=; b=CkgTndCNcP8XFfb6Tx/eUkzSmzns5czz14/zq/oyK9dXrhU2n8BQxaeYhPBsXuJzXQqkv3 Xovb/QcBDhLSJMK8Zrhz6a3yjSfpfgm8DKOgObLIm8qsGIwDb/4GQxTBNBuJpQ57tlcbgJ rkInHRZztQol5wRER0I27rMn7xh1NpC56/R4Qp6lO/RkPdFxTfTaLS+kU+BVB7FqK5U8rd sN0USMYg+8nIixV+JSHu6ETmL+1WsV+9DU4kT6TU/GsvIkfO+Ps4HvdQ+QpOuQxr99GlJa MFRst++2E6o+MzeuddlIQOvuGKmtbu8oxmZ3sw9rMb5M87v8uy8AZ3HXw9uMPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724791087; a=rsa-sha256; cv=none; b=MR54lxHOCp6pvFvw5ZLZwaVjUMZgpcbUSAqDHwap+k2iUfZ3JH58uuEcrhF4HVYvNcH5WK UQHCr7sZGvFeZuQBKr1FTj1u1AqVo2nt/O2sTkS2Bpv7crg9otJ0CIdZdwzivSaRiR6o1d YwDXnLtvO2FkOZ9kncv4WHrsZQoBvE9E/lv9o/m+yQlDTlSl5ILdDYtdGrJYvtcz+r4XpI uKrpgcyvMGHGaUHANcu96igF/00rbIjtYFtGShjGa+YDocDfZNkIA8sDnjrVCFsNTrpVky A8zpgHEY8Bb1M92Z8YLPGbDvfoVubaYR5+1Wbj6POKrBMMDyXEPnqj/UHIajgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8uo5YsJ/qQZlLNQyU4W6W1I7oNlIYSuW0FfPKz7zbQk=; b=otXmjc23DXBRNdpkfAgad02E00FLkfxptbmuYAmBKl9iL3in+Du5HqDKKJIQzFN+QqGMLI IVXS7vDYVCIT4lUD9EOQxgTDSOWVnzG8IQ3+l8UVPzuvKpkJk1Q0TUpfNMSs4dRkVwYXYW P9CckaM0mAK0BP4117qU4j4riprKqDXsOgcsgihvJ5fXboalf9U4y6k4mNzFj86/fSSiNC +C0Im8wFq920aHYVd+POBzuhWGL6CMvqqbSTcYvX9UMlJu8BKFO/sR91uNKHCuALBShfeq H5wpEA0UtaZ7+ENMf+bVcU+C+jIAnv0ZVufoHm7LJzO1w+jxwEvaXTu04F0rOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtfWL60NBz14ql; Tue, 27 Aug 2024 20:38: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 47RKc6TD049074; Tue, 27 Aug 2024 20:38:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RKc6Ga049071; Tue, 27 Aug 2024 20:38:06 GMT (envelope-from git) Date: Tue, 27 Aug 2024 20:38:06 GMT Message-Id: <202408272038.47RKc6Ga049071@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: fe66e4caf456 - main - rangelock: Disable cheat mode by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe66e4caf4561ee3349ad7a29cc9976108c3b04f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fe66e4caf4561ee3349ad7a29cc9976108c3b04f commit fe66e4caf4561ee3349ad7a29cc9976108c3b04f Author: Mark Johnston AuthorDate: 2024-08-27 20:31:25 +0000 Commit: Mark Johnston CommitDate: 2024-08-27 20:36:31 +0000 rangelock: Disable cheat mode by default Cheat mode is incompatible with code which locks multiple ranges in the same vnode, with at least one range being write-locked. This can arise in kern_copy_file_range(). Until that's handled somehow, avoid the problem to make the fusefs tests stable. PR: 281073 Fixes: 9ef425e560a9 ("rangelocks: add fast cheating mode") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46457 --- sys/kern/kern_rangelock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 14163dd1c782..38449f71a8b7 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -66,7 +66,7 @@ * trylocks are same as normal locks but do not drain. */ -static int rangelock_cheat = 1; +static int rangelock_cheat = 0; SYSCTL_INT(_debug, OID_AUTO, rangelock_cheat, CTLFLAG_RWTUN, &rangelock_cheat, 0, ""); From nobody Tue Aug 27 21:09:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtgCr6FVGz5Jw9g for ; Tue, 27 Aug 2024 21:09:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtgCr4VmCz4w5G for ; Tue, 27 Aug 2024 21:09:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42817bee9e8so50831625e9.3 for ; Tue, 27 Aug 2024 14:09:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724792983; x=1725397783; 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=NX4IbqHfa5327H4urDGdUF5Df6RypuG+A49oO2gSCpA=; b=m3dRTnThDkq/a1QIo7M/hJ2EVbreS4SNgRGqfAcECIR9H1EyqKCDIr6mVTjmNm9SLq iU7tINvFdbqWKIBdqrabe5B6Wg8c60Tb9Pjl0dH4gtNJtJ+Cl9+kddbZNpD5T7Cfcmk5 xERhbxBmRxffwR4Co9mXRHjHQQT0dRm2uDUi3gsjPIQXF0RtG0kC6j03rwWpBoHjlzj1 UJyZ6b2zFGrkIvQPDfNcOQCw5sU2DVIwlcJ6B6WsT8MrlVQqxTKpNmF0ENkRQHcLGvqx /9/fOfaoP6iI247heZLlRUzSvTWW7b8NTi8qmA/fWKJ6cdHItmf2FF/K6IOR5h2mQ+m7 hvzg== X-Forwarded-Encrypted: i=1; AJvYcCVQ8d2UKIbTQEb4rHBmQn4G4Xfh7TCbOWxxkczAlA6oYCCPL/cv1Fzl67Ssn2DQ3dE6Q6lC4X5xk1jdEUEPVQETw8SB@freebsd.org X-Gm-Message-State: AOJu0YxCKPyxOh0CaNO0zf4flfVdBxkX5cLoN8YujRFJM5BHeTwsJwVB w3gGpGw4SUUOszbI2rJOf4hkyVItr8De2WBIme+aDsOaPZg54sSAOOHiMPUJHt97VtY6zuDEUFq H X-Google-Smtp-Source: AGHT+IFOFGcAcKayBRN3Rmt/3D4+0jlq7VbvU3Y47mQM9pQGHeX775vuhvB9DToR/FUSwGuWQwRqKg== X-Received: by 2002:a05:600c:3514:b0:426:51dc:f6cd with SMTP id 5b1f17b1804b1-42acd57a01dmr108122495e9.18.1724792982617; Tue, 27 Aug 2024 14:09:42 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42abed8b86bsm234115435e9.4.2024.08.27.14.09.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Aug 2024 14:09:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: fe66e4caf456 - main - rangelock: Disable cheat mode by default From: Jessica Clarke In-Reply-To: <202408272038.47RKc6Ga049071@gitrepo.freebsd.org> Date: Tue, 27 Aug 2024 22:09:31 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <9CF133C9-42AD-41EE-961E-FBD76DD5F592@freebsd.org> References: <202408272038.47RKc6Ga049071@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3776.700.51) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4WtgCr4VmCz4w5G On 27 Aug 2024, at 21:38, Mark Johnston wrote: >=20 > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dfe66e4caf4561ee3349ad7a29cc99761= 08c3b04f >=20 > commit fe66e4caf4561ee3349ad7a29cc9976108c3b04f > Author: Mark Johnston > AuthorDate: 2024-08-27 20:31:25 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-27 20:36:31 +0000 >=20 > rangelock: Disable cheat mode by default >=20 > Cheat mode is incompatible with code which locks multiple ranges in = the > same vnode, with at least one range being write-locked. This can = arise > in kern_copy_file_range(). Until that's handled somehow, avoid the > problem to make the fusefs tests stable. >=20 > PR: 281073 > Fixes: 9ef425e560a9 ("rangelocks: add fast cheating mode") > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D46457 > --- > sys/kern/kern_rangelock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c > index 14163dd1c782..38449f71a8b7 100644 > --- a/sys/kern/kern_rangelock.c > +++ b/sys/kern/kern_rangelock.c > @@ -66,7 +66,7 @@ > * trylocks are same as normal locks but do not drain. > */ >=20 > -static int rangelock_cheat =3D 1; > +static int rangelock_cheat =3D 0; This probably deserves a comment for why it=E2=80=99s disabled/the risks = of enabling it, and/or some text in the sysctl description? Jess > SYSCTL_INT(_debug, OID_AUTO, rangelock_cheat, CTLFLAG_RWTUN, > &rangelock_cheat, 0, > ""); From nobody Tue Aug 27 21:20:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtgSW1spRz5MQcr; Tue, 27 Aug 2024 21:20: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 4WtgSW1Mnqz4xb2; Tue, 27 Aug 2024 21:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/g11u6OMdWW/u2Q8fs3VO15PwFSys9Rupj+T6n+lOxQ=; b=ZN+rom4WGQ9pFIUgGQvZG//ltddD7S/d3mIppxzB2NrVLW6GY3J7eZFE/N3FOaG+4tmmlb Zdm5Vr23lv4WorlUx/VvgC2R3VW9RsNd7tTX/9VEYnySGHzJaTS+1yXKVwZFPogYk739KH hfC/0KObX7piEvAWS+xWfEp57H9JgorReNjEtKw/Oq3bEo6/KXRYSDwLPg1jziyvI2h+Xq u4IV/Tqxd9sr3oACgLT9bM1acx2j0Mx/gvdaPhq2h7cboFUyk15omhQN6DYkmEiUXBojTg 16qhBaEEQT+HfYdyOUFBD1SSXyVE3IiD0Foid28lB/Y9iiUfbrnMcBYDw9eLMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724793643; a=rsa-sha256; cv=none; b=D7N5jAjHIpuT7N247aAatLrcQizhqPs+gkerGR9vwkft/dzewpQMSjzfiNJBPA7W0E725c bXvwoZQY3v45lxZMXLF+BC10jFWZMuoha/0jhndgEMrtF6sz7ER4RcxqfUqI030LuMu9OE wpsFZE6LmzOlg7IaKuCcoD2QdG1w++++oYkJS8+aScIvjFo8t3600MnK8Je7FL6jfRm2QH tZx7sjP5+fratab/BeObGSx8/HcN8IUmgykQxYJxftI+N4GA2DBSUFbFxnYAtY45xY+/PU lqDHRklvzY67LBdEnxdC4Wt4ef0rKBlJt6133833gzIzQShyx4o8GMw+34Ymug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/g11u6OMdWW/u2Q8fs3VO15PwFSys9Rupj+T6n+lOxQ=; b=ZKxAZYI5qL3Jn7uQ39UiEFDmXFIbvF/prRJv1TSfV3cAJ5DztxXZTAa5Z/LgoJjcOQMGi/ RPpabtFOaeA4Jly1nx1l27pmKKrTKB8j6JCxrCVDLPnm+do2Ic6vTxPURY7cmnRTrCVVE9 rTgSIjoLOU1Iva7jMKMJKOBdYtkRjQ/W4pFz0KgZYBHCkrXvnjTCwP+EshOvPMgPMMSTZk y4J+ON/OjOKB/01dtlCUmswOfwVLQ4q0xLh3d1XItjL8QX9G5bR8EPN9N1n3lgIHud+0af XKnt8hs+pQ6jvV9X8TcnX/cXyNtrCzIsIxG3cK6CPAxAw2J4YtSQOVtlGeMj+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtgSW0zG6z15m4; Tue, 27 Aug 2024 21:20: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 47RLKh0t027363; Tue, 27 Aug 2024 21:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RLKhBV027330; Tue, 27 Aug 2024 21:20:43 GMT (envelope-from git) Date: Tue, 27 Aug 2024 21:20:43 GMT Message-Id: <202408272120.47RLKhBV027330@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: 5037c6398b23 - main - nfsd: Fix handling of NFSv4 setable attributes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 5037c6398b2327366494a0434a894dc17ba8d023 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5037c6398b2327366494a0434a894dc17ba8d023 commit 5037c6398b2327366494a0434a894dc17ba8d023 Author: Rick Macklem AuthorDate: 2024-08-27 21:19:33 +0000 Commit: Rick Macklem CommitDate: 2024-08-27 21:19:33 +0000 nfsd: Fix handling of NFSv4 setable attributes Commit d8a5961 made a change to nfsv4_sattr() that broke parsing of the setable attributes for a NFSv4 SETATTR. (It broke out of the code by setting "error" and returning right away, instead of noting the error in nd_repstat and allowing parsing of the attributes to continue.) By returning prematurely, it was possible for SETATTR to return the error, but with a bogus set of attribute bits set, since "retbits" had not yet been set to all zeros. (I am not sure if any client could be affected by this bug. The patch was done for a failure case detected by a pynfs test suite and not an actual client.) While here, the patch also fixes a few cases where the value of attributes gets set for attributes after an error has been set in nd_repstat. This would not really break the protocol, since a SETATTR is allowed to set some attributes and still return an failure, but should not really be done. MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdport.c | 74 ++++++++++++++++++++++++----------------- sys/fs/nfsserver/nfs_nfsdserv.c | 2 +- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 12592d4c5c59..8a2a39052506 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3026,6 +3026,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, /* * Loop around getting the setable attributes. If an unsupported * one is found, set nd_repstat == NFSERR_ATTRNOTSUPP and return. + * Once nd_repstat != 0, do not set the attribute value, but keep + * parsing the attribute(s). */ if (retnotsup) { nd->nd_repstat = NFSERR_ATTRNOTSUPP; @@ -3043,12 +3045,13 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, switch (bitpos) { case NFSATTRBIT_SIZE: NFSM_DISSECT(tl, u_int32_t *, NFSX_HYPER); - if (vp != NULL && vp->v_type != VREG) { - error = (vp->v_type == VDIR) ? NFSERR_ISDIR : - NFSERR_INVAL; - goto nfsmout; + if (!nd->nd_repstat) { + if (vp != NULL && vp->v_type != VREG) + nd->nd_repstat = (vp->v_type == VDIR) ? + NFSERR_ISDIR : NFSERR_INVAL; + else + nvap->na_size = fxdr_hyper(tl); } - nvap->na_size = fxdr_hyper(tl); attrsum += NFSX_HYPER; break; case NFSATTRBIT_ACL: @@ -3085,7 +3088,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, case NFSATTRBIT_MODE: moderet = NFSERR_INVAL; /* Can't do MODESETMASKED. */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); - nvap->na_mode = nfstov_mode(*tl); + if (!nd->nd_repstat) + nvap->na_mode = nfstov_mode(*tl); attrsum += NFSX_UNSIGNED; break; case NFSATTRBIT_OWNER: @@ -3153,10 +3157,11 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, attrsum += NFSX_UNSIGNED; if (fxdr_unsigned(int, *tl)==NFSV4SATTRTIME_TOCLIENT) { NFSM_DISSECT(tl, u_int32_t *, NFSX_V4TIME); - fxdr_nfsv4time(tl, &nvap->na_atime); + if (!nd->nd_repstat) + fxdr_nfsv4time(tl, &nvap->na_atime); toclient = 1; attrsum += NFSX_V4TIME; - } else { + } else if (!nd->nd_repstat) { vfs_timestamp(&nvap->na_atime); nvap->na_vaflags |= VA_UTIMES_NULL; } @@ -3169,7 +3174,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, break; case NFSATTRBIT_TIMECREATE: NFSM_DISSECT(tl, u_int32_t *, NFSX_V4TIME); - fxdr_nfsv4time(tl, &nvap->na_btime); + if (!nd->nd_repstat) + fxdr_nfsv4time(tl, &nvap->na_btime); attrsum += NFSX_V4TIME; break; case NFSATTRBIT_TIMEMODIFYSET: @@ -3177,10 +3183,11 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, attrsum += NFSX_UNSIGNED; if (fxdr_unsigned(int, *tl)==NFSV4SATTRTIME_TOCLIENT) { NFSM_DISSECT(tl, u_int32_t *, NFSX_V4TIME); - fxdr_nfsv4time(tl, &nvap->na_mtime); + if (!nd->nd_repstat) + fxdr_nfsv4time(tl, &nvap->na_mtime); nvap->na_vaflags &= ~VA_UTIMES_NULL; attrsum += NFSX_V4TIME; - } else { + } else if (!nd->nd_repstat) { vfs_timestamp(&nvap->na_mtime); if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; @@ -3198,18 +3205,21 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, * specified and this attribute cannot be done in the * same Setattr operation. */ - if ((nd->nd_flag & ND_NFSV41) == 0) - nd->nd_repstat = NFSERR_ATTRNOTSUPP; - else if ((mode & ~07777) != 0 || (mask & ~07777) != 0 || - vp == NULL) - nd->nd_repstat = NFSERR_INVAL; - else if (moderet == 0) - moderet = VOP_GETATTR(vp, &va, nd->nd_cred); - if (moderet == 0) - nvap->na_mode = (mode & mask) | - (va.va_mode & ~mask); - else - nd->nd_repstat = moderet; + if (!nd->nd_repstat) { + if ((nd->nd_flag & ND_NFSV41) == 0) + nd->nd_repstat = NFSERR_ATTRNOTSUPP; + else if ((mode & ~07777) != 0 || + (mask & ~07777) != 0 || vp == NULL) + nd->nd_repstat = NFSERR_INVAL; + else if (moderet == 0) + moderet = VOP_GETATTR(vp, &va, + nd->nd_cred); + if (moderet == 0) + nvap->na_mode = (mode & mask) | + (va.va_mode & ~mask); + else + nd->nd_repstat = moderet; + } attrsum += 2 * NFSX_UNSIGNED; break; case NFSATTRBIT_MODEUMASK: @@ -3220,13 +3230,15 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, * If moderet != 0, mode has already been done. * If vp != NULL, this is not a file object creation. */ - if ((nd->nd_flag & ND_NFSV42) == 0) - nd->nd_repstat = NFSERR_ATTRNOTSUPP; - else if ((mask & ~0777) != 0 || vp != NULL || - moderet != 0) - nd->nd_repstat = NFSERR_INVAL; - else - nvap->na_mode = (mode & ~mask); + if (!nd->nd_repstat) { + if ((nd->nd_flag & ND_NFSV42) == 0) + nd->nd_repstat = NFSERR_ATTRNOTSUPP; + else if ((mask & ~0777) != 0 || vp != NULL || + moderet != 0) + nd->nd_repstat = NFSERR_INVAL; + else + nvap->na_mode = (mode & ~mask); + } attrsum += 2 * NFSX_UNSIGNED; break; default: @@ -3241,7 +3253,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, /* * some clients pad the attrlist, so we need to skip over the - * padding. + * padding. This also skips over unparsed non-supported attributes. */ if (attrsum > attrsize) { error = NFSERR_BADXDR; diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 47e3a20390f4..a38ef3d47946 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -375,6 +375,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram, NFSACL_T *aclp = NULL; struct thread *p = curthread; + NFSZERO_ATTRBIT(&retbits); if (nd->nd_repstat) { nfsrv_wcc(nd, preat_ret, &nva2, postat_ret, &nva); goto out; @@ -402,7 +403,6 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram, goto nfsmout; /* For NFSv4, only va_uid is used from nva2. */ - NFSZERO_ATTRBIT(&retbits); NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_OWNER); preat_ret = nfsvno_getattr(vp, &nva2, nd, p, 1, &retbits); if (!nd->nd_repstat) From nobody Tue Aug 27 21:26:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtgbK3r9hz5MR0B; Tue, 27 Aug 2024 21:26: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 4WtgbK2wvDz4y1N; Tue, 27 Aug 2024 21:26:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DdS3BQaBzhuhSF3a42EVj11hy9gn6L8LhexXkXYm1bA=; b=AFeSWdWG1Tn022w7OY2AOZ+XoERr3MVzaPAOOKDy+ZCxhq9b2/nJiCV9z2WBiLpzu2Sizo y9IagINnFCC+AyaH66QuGRi1e+C58K//3d6qgQjsp9w87MjI56Xdo2aOVp7/d/WVvRBryJ r/0KxFkEfUZszGhOmAb/puCpwh9a/fcmWM4sg0ELMg2sFEZ3LnxDbrEvfOCFMaVlrrDLFK uVyJ/TGdo5NlTJPN7WfpD8DZ2DfJ+OhoVeh3pKhrtKKvz8QGrUdMkqW4/MObd3CPbPiV+l zwRgpZ8aK1AGWhusjPtqfct7xQf3wC3n3ljrW/x7XzKZtSsrbsqUokAq1qniKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724793997; a=rsa-sha256; cv=none; b=qf7nl2/bIzuoStlQ5LDCXfXe2r+m6TLky6ZVnPLfcclBwOmwj1MyHoQzihRgBPet882W4F Ghdxx6kL7MXzBF6g2J8/dj8OoVtVoPoY3AEFTdm8BWe933g4M9uZbJQ6otw9WlozG+IcuT Pq5sL86jl+WUKaEYvinEvF9klTfLaAaX2oXO2iBPeOtujn+4PnR6+/u31UfAyPJM9tvv2G 4L3Fd7+HSrjzkWuvo72c8CZ3Magxq9imQwIeofsmiEoUIQip3zOL+3Fy6yHpwSHCO/tf0m FexLZZQosC+q9SvDPQl682xJyFTH6vAEHK2lBqeSZ1bjARFXZTC/QRwrB2r8dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DdS3BQaBzhuhSF3a42EVj11hy9gn6L8LhexXkXYm1bA=; b=bP2nQVm58HFPxq8g89XsBiep/wuLNMsCkODQ7jYpH8+yYI9Nnfrfdyvx+1ahjhyKR8xXL3 jg2+d3UyiGDh0/NnkmtB3DX5TNLOrSAOLabMiOiuD7MUJKOcnQ7DzGdFsBbaxjSTySeA4p xQ5S8Hpk40FaXk4p8KePX6RE6ViRVc5w4FWIJU1BX8vwSr1WGydNesdC6MM8XeQs7Iel88 p+gAVflDiX0n4jmbiT4fKtNoY5z44KSoNYddXVnQc6xZtgez3b2+CiGcrdH18Frz6nWKsz p05wQupzWBVMB+OwBNUTGnuClCgkIUN+obkPPiAwhbDJ0Km1aS4I75G7JEwvVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtgbK29mlz15B0; Tue, 27 Aug 2024 21:26: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 47RLQbui034390; Tue, 27 Aug 2024 21:26:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RLQbYT034387; Tue, 27 Aug 2024 21:26:37 GMT (envelope-from git) Date: Tue, 27 Aug 2024 21:26:37 GMT Message-Id: <202408272126.47RLQbYT034387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ee104259c72c - stable/14 - rc.d/ldconfig: Compute ldconfig paths in a function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ee104259c72c24ca2495f7d7c4aac2672c010478 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ee104259c72c24ca2495f7d7c4aac2672c010478 commit ee104259c72c24ca2495f7d7c4aac2672c010478 Author: Konrad Witaszczyk AuthorDate: 2024-04-12 21:34:59 +0000 Commit: John Baldwin CommitDate: 2024-08-27 18:15:48 +0000 rc.d/ldconfig: Compute ldconfig paths in a function Move logic that computes paths passed to ldconfig(8) to a ldconfig_paths() function that can be called for multiple ABIs. Reviewed by: olce, kib Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D44751 (cherry picked from commit e6e38bc522e29de6299536b547bf11dab11e9679) --- libexec/rc/rc.d/ldconfig | 55 +++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/libexec/rc/rc.d/ldconfig b/libexec/rc/rc.d/ldconfig index 5c404a823dbb..fd54b2d3444e 100755 --- a/libexec/rc/rc.d/ldconfig +++ b/libexec/rc/rc.d/ldconfig @@ -14,6 +14,31 @@ ldconfig_command="/sbin/ldconfig" start_cmd="ldconfig_start" stop_cmd=":" +ldconfig_paths() +{ + local _dirs _files _ii _ldpaths _paths + + _dirs="${1}" + _paths="${2}" + _ldpaths="${3}" + + for _ii in ${_dirs}; do + if [ -d "${_ii}" ]; then + _files=`find ${_ii} -type f` + if [ -n "${_files}" ]; then + _paths="${_paths} `cat ${_files} | sort -u`" + fi + fi + done + for _ii in ${_paths}; do + if [ -r "${_ii}" ]; then + _ldpaths="${_ldpaths} ${_ii}" + fi + done + + echo "${_ldpaths}" +} + ldconfig_start() { local _files _ins @@ -23,31 +48,12 @@ ldconfig_start() checkyesno ldconfig_insecure && _ins="-i" if [ -x "${ldconfig_command}" ]; then _LDC=$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ') - for i in ${ldconfig_local_dirs}; do - if [ -d "${i}" ]; then - _files=`find ${i} -type f` - if [ -n "${_files}" ]; then - ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`" - fi - fi - done - for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do - if [ -r "${i}" ]; then - _LDC="${_LDC} ${i}" - fi - done + _LDC=$(ldconfig_paths "${ldconfig_local_dirs}" \ + "${ldconfig_paths} /etc/ld-elf.so.conf" "$_LDC") startmsg 'ELF ldconfig path:' ${_LDC} ${ldconfig} -elf ${_ins} ${_LDC} if check_kern_features compat_freebsd32; then - for i in ${ldconfig_local32_dirs}; do - if [ -d "${i}" ]; then - _files=`find ${i} -type f` - if [ -n "${_files}" ]; then - ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`" - fi - fi - done _LDC="" if [ -x /libexec/ld-elf32.so.1 ]; then for x in $(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' '); do @@ -56,11 +62,8 @@ ldconfig_start() fi done fi - for i in ${ldconfig32_paths}; do - if [ -r "${i}" ]; then - _LDC="${_LDC} ${i}" - fi - done + _LDC=$(ldconfig_paths "${ldconfig_local32_dirs}" \ + "${ldconfig32_paths}" "$_LDC") startmsg '32-bit compatibility ldconfig path:' ${_LDC} ${ldconfig} -32 ${_ins} ${_LDC} fi From nobody Tue Aug 27 21:26:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WtgbL431hz5MR4N; Tue, 27 Aug 2024 21:26: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 4WtgbL2xCTz4yQB; Tue, 27 Aug 2024 21:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3oBA8cGEg5pOqJd6TlM0ETayoPUh/tYJjsWgqAJQEQ=; b=cH7nQ2cTb1CN8UdSP0EwEA0k7iBme4o4fWd7C5G8BKWe1JPDvOZuB7loal0dWdqOKCaeWI F4CW+BOKwpxN5DOSAhwtzy9PTRMMXuRS4j77OaVYC8vZIXskNDgWUW/vgkdV4R5K1yWJ9t OzRV8wvCqF+nDj4IbjUZTYj9ow3mFwDbBrm1TSVtTpVvPZ3uzRbMjd+RL+ouf5VWR+E4nt 9p/u1N0hYnk5Nf/mlBmlp+l1UrW5dhGI6odFgQ0l5rT38xfMPC6jrxfz9DkgDbFUi0MHuB yeRToYnZk3bt9rlO20zUNAAQEpc+Hnpq44NAqvNlhBjZkaBiy4M5MFOkZyHRTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724793998; a=rsa-sha256; cv=none; b=SNDgT60daATllSg35HrZbAXUjd81CONG8V/GIt99FNvQFvneUpx+qyxC3OuwMXA+D/B8wK 5FZ0jXzp5qMSLJ3ep5CetTwP2gMomD2Xb6rvlj1tQ346U9CkHlxZxsDlAaNSJd0pGXDE/8 /1mvCbyHM22ZvNyadkOzH0EECaO6RM9Olh+8sJDnSjOMbum+Kson5CLpkGiWM0NrQ8RxNv srrSejmhzldKzuAPPBuut604REAqhsTibwbWMVL9lPdQwTcLcy6OcHJdEd4xQ6ENbMGPH3 ojkgnuYA3paaeBT6q4T3sRHwdgC62f4JQFqPa+lzFLPz8G18KypogDdgYVsNAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724793998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3oBA8cGEg5pOqJd6TlM0ETayoPUh/tYJjsWgqAJQEQ=; b=AYmKtU+iBxQe9zMkG9TC6Rxx7eVxr5nkMXpQ1Qzg7gZ35qMGcQ26YIKzY4NyngQxRxomIq oJ+k2wmC84xQBfR9k48txCReSwgDN6tuGNnOxbqEDt5iSvNREVYIniRyER8uTkQwqtZyBv oEUfnBkGzBSxXE1Z05fdwBmQaJ5J41HwmGdFDmHB4t7Nt1bkbY8u/lES9XX7U8OzBNAZcl qcSZsfv2mUAp6x6T6BRlcPThNVnOfyJPMZMKeyoc/DZU7OFu25QenQIxs+JKPM10Umpy0o GBmCCyIxxcy1WpR8CLp6d0Zifz2RjwTJFmQRst+OEaS33ryloiQFOW4NoBK/fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WtgbL2YPbz15c1; Tue, 27 Aug 2024 21:26: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 47RLQc3m034433; Tue, 27 Aug 2024 21:26:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RLQc4H034430; Tue, 27 Aug 2024 21:26:38 GMT (envelope-from git) Date: Tue, 27 Aug 2024 21:26:38 GMT Message-Id: <202408272126.47RLQc4H034430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7b9327d6b2df - stable/14 - defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b9327d6b2df22004d64406e51a9568e4245fb93 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b9327d6b2df22004d64406e51a9568e4245fb93 commit 7b9327d6b2df22004d64406e51a9568e4245fb93 Author: John Baldwin AuthorDate: 2024-04-12 21:35:23 +0000 Commit: John Baldwin CommitDate: 2024-08-27 18:15:55 +0000 defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths Commit 99132daf6f70cb0cc969c555d3612547fa3cf1db prepends /usr/lib32 to the list of paths in ldconfig32_paths since it is a standard library path in ld-elf32.so.1. Remove /usr/lib32 from the value in rc.conf so that it is not listed twice. Reviewed by: olce, kib Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D44752 (cherry picked from commit 4bf5db113f760619bf754c22864b1d7e2acdeabd) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 8b56a490b5ec..eb971a76ecf2 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -675,7 +675,7 @@ clear_tmp_X="YES" # Clear and recreate X11-related directories in /tmp ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks ldconfig_paths="/usr/lib/compat ${_localbase}/lib ${_localbase}/lib/compat/pkg" # shared library search paths -ldconfig32_paths="/usr/lib32 /usr/lib32/compat" +ldconfig32_paths="/usr/lib32/compat" # 32-bit compatibility shared library search paths ldconfig_local_dirs="${_localbase}/libdata/ldconfig" # Local directories with ldconfig configuration files. From nobody Tue Aug 27 22:09:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WthYF5t6Kz5MV6p; Tue, 27 Aug 2024 22: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 4WthYF5Lhrz55b2; Tue, 27 Aug 2024 22: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=1724796593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vUBDg5VrMmL2kgLogBJfqmSqVRItUs/fs6iNMbwjsnw=; b=Q5GFt23NRMq4NryWSWCUWR4SqbDF7CCPWr6+FK372FGwhai4XIX91Dp5Vri4j/xdeECM+a BZPfENsp66GZlyv2H/vnsUIgNRXMEJrelrzxjmxwkZBSv0b5gIkdJWT4Y1UeuOUvIYJtTx Tgrhm3MZhwb4C0RZxEFrAVrYmbDopP7vhUVoswxBfEJPeEJ8ev6BAyiKC9xM4j1YK5JZ6x ERISbf1sdAMC6hpNwO/KClf4qQS6I4cXYpUjYd2W8TcRw4nNQHquFTmjocqPmFM2AoDoUa J5Vi6VE0ZFL/3fXTYLTUojwYydV+0aiercH5gjIhNOIuDMSUBkxuhGozJUSfbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724796593; a=rsa-sha256; cv=none; b=Pyty96PqgQXGFCvsW4aoRFWFgsC94j0stsHRRcAQ7isqvCV23rPTeHWgOWXbhKhwmGi4Ds ooLrGEDpR25A1G5yM/wQ7RBPP5Sh51IFm0w8XAyjF3DGY3hOlgfv/QsGWeeagrfP23Ftzo vkB1MwynGpFUdBsjOomz5MEcE4S1dGTN3zAewYrOA0pUy+rGWW7Sl85fUS3egeIp+/7cQk iqc667IklFu1+AU6iMQ2uGoYXR7h24GaSHRO58jyJv1KY3Q9cdUEgdsrO/lMj6ezEy34dE zfFD6YcoVttEq7KlTgNPZGolBLjF7+qJHksJo6Z2/N47g92wnKreMaUYe5hGfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724796593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vUBDg5VrMmL2kgLogBJfqmSqVRItUs/fs6iNMbwjsnw=; b=ZLpA+Q9EeMJBhvwN6hDO2pNb1sAqGsuYI8eZdHjH97M9ePqG8tnQf6mM2bHgbf85uYdItV BeeLOiohhckh1nnrx0eAiUwJ2S2gmOaK8pBy1YLpR+J12MqRDJRyfH9zedPvE17DjCSUVJ bT4l3O2kc/szMDSiA+7Lj6wvc78jOwxcl0IkllEJt1JgA/SBFe3aJcn51koph7epwrL5PC 1ClMqD75XqNFvntgH9zarLSaC6NWiMbY4Uzk0q3b+UkGLqQFFDD/xAvYARsY3hxTeqJhR+ hNgGvJ4zs9VYC8Sq4IP6kVQy3UW94wETmqxEJhgtjWR8pc4nQeSYRVkAk+PYrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WthYF4y3Qz172P; Tue, 27 Aug 2024 22: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 47RM9r1l002770; Tue, 27 Aug 2024 22:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RM9rVX002767; Tue, 27 Aug 2024 22:09:53 GMT (envelope-from git) Date: Tue, 27 Aug 2024 22:09:53 GMT Message-Id: <202408272209.47RM9rVX002767@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: f5a37f8dd319 - main - open(2): mandoc -T lint List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5a37f8dd319e3007b126b77376e61ad96f44d8b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a37f8dd319e3007b126b77376e61ad96f44d8b commit f5a37f8dd319e3007b126b77376e61ad96f44d8b Author: Jose Luis Duran AuthorDate: 2024-08-27 03:48:09 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-27 22:09:33 +0000 open(2): mandoc -T lint Lint the manual, addressing almost all requests. Differential revision: https://reviews.freebsd.org/D46450 MFC after: 1 week --- lib/libsys/open.2 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index be164aae1834..220561cc5683 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -252,7 +252,7 @@ controlling terminal when it opens a tty device. This is the default on .Fx , but is present for -.Tn POSIX +POSIX compatibility. The .Fn open @@ -265,7 +265,7 @@ initially opening a TTY. This is the default on .Fx , but is present for -.Tn POSIX +POSIX compatibility. The initial call to .Fn open @@ -384,7 +384,7 @@ The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp If a sleeping open of a device node from -.Xr devfs 4 +.Xr devfs 5 is interrupted by a signal, the call always fails with .Er EINTR , even if the @@ -487,7 +487,7 @@ The system file table is full. .It Bq Er EMLINK .Dv O_NOFOLLOW was specified and the target is a symbolic link. -.Tn POSIX +POSIX specifies a different error for this case; see the note in .Sx STANDARDS below. @@ -661,7 +661,7 @@ to .Er EMLINK instead of .Er ELOOP as specified by -.Tn POSIX +POSIX when .Dv O_NOFOLLOW is set in flags and the final component of pathname is a symbolic link @@ -679,7 +679,10 @@ permits searches. The present implementation of the .Fa openat system call is believed to be compatible with -.St -p1003.1-2017 , +.\" .St -p1003.1-2017 , +.\" XXX: This should be replaced in the future when an appropriate argument to +.\" the St macro is available: -p1003.1-2017 +.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) , which specifies that behavior for .Dv O_SEARCH , in the absence of the flag the implementation checks the current From nobody Tue Aug 27 22:09:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WthYH0zs8z5MTtr; Tue, 27 Aug 2024 22:09: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 4WthYG6JD1z55Xt; Tue, 27 Aug 2024 22: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=1724796594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cP7cvvzOjFmWGVn/AHMoGj+GkeHBPVdISuSS69FlU60=; b=fpFBR4tb5CuBacARdqxUF07qCFlIpuY4buykZcZmoCdv888dE5hVvJBy5YM3XmHm2D1uPj J3ITeOrBinD6sGNMWGNEqegFOtqGWaZXBwNa6Ir3jSQsK4BFGd3Eqf5MwxR5xMuR9DxR9T nQ/e+G25L7d8F5VC/enSOkuhp2mX/t3Xb2dGa5HhBdBrVBrh/faX6KZGiPUczJCVD+7gJp WKkFdzbf/sDyE2BWKSreC4UiPLAHMz+2YCfmGS3jrn5CGbrJPI2J2aDBBnKUbdCEevYvvV vKhSSCGOE2JRJlhxdhazojaDWc3zBstNVypJliIGwTcV3egCUD5hcsbikCEoXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724796594; a=rsa-sha256; cv=none; b=MezbnKUDTvdb70KrBw2sKTisNlZxnH6MX0WM8FWu+lCAo0KmgCg/341ozf6pFDhRsxB1fK jgHxqHViUmbxziNTgLi40Era0fcihdL3dlqr1UizqlYuDjBQjC5ODGyKz5QjQKxKY6EuJI TRIYDLIIXkqSbM8vNgYTZ6EB1Hh5egKhpd85ADPerSIytxTQS/F9F/cJ5U5phqDPRRPJ2G U359hqWJiVAigQXehLsdf5k6q/7Q2bfLzvBB2gdYBjiKX2Akv/CckpqLvrN3LmQ54ph+Bw EG71DCKEc0qfmELrh1Tq0JOUeeojEWV2NR7uavL13wbQkdh6qlJUOkCn6JHDDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724796594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cP7cvvzOjFmWGVn/AHMoGj+GkeHBPVdISuSS69FlU60=; b=QrUB/K7qQuwuMLlFZH7FzqBKz8qOwUWbL23Y7t9uLYEamkNqUw/ZJBQH/yPOc7wdED8S8X 4BnMeXOimA/vWlnHIblvUdUYT8FiBnvMWum1MCiIvkjRdIQDXNBjGIRt81MgsnDaw+N+iQ VO5ozQF2sCsKpU0N32DGwgQkaPwRc8MJdU+cvF0UTaR/QXREyguKFOAf+u7sRQVOBOHOOe br3domDRymqPyu9TS+1j+8YrQmBgDVFHzVb8qo4mM5LP3x27IXy++5Ma6PbwVOSJRM/+Hj wJFP6PK5yTVWuHkUMnAM1rukh3XvKVgDJ6LtqhmtiDqlTsIs9Ncm0HKKLYvUZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WthYG5vysz172Q; Tue, 27 Aug 2024 22: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 47RM9stK002809; Tue, 27 Aug 2024 22: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 47RM9sAu002806; Tue, 27 Aug 2024 22:09:54 GMT (envelope-from git) Date: Tue, 27 Aug 2024 22:09:54 GMT Message-Id: <202408272209.47RM9sAu002806@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: 33f58ac0795b - main - rename(2): Extend EINVAL's description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33f58ac0795b2b02593ad0a8bf8a1ea24c1dc5e1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33f58ac0795b2b02593ad0a8bf8a1ea24c1dc5e1 commit 33f58ac0795b2b02593ad0a8bf8a1ea24c1dc5e1 Author: Jose Luis Duran AuthorDate: 2024-08-26 01:32:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-27 22:09:33 +0000 rename(2): Extend EINVAL's description On some file systems, the last component of the destination path can contain invalid characters and return EINVAL. PR: 281033 Differential revision: https://reviews.freebsd.org/D46450 MFC after: 1 week --- lib/libsys/rename.2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libsys/rename.2 b/lib/libsys/rename.2 index f792c8a3dc7b..4faba81ff509 100644 --- a/lib/libsys/rename.2 +++ b/lib/libsys/rename.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 30, 2020 +.Dd August 25, 2024 .Dt RENAME 2 .Os .Sh NAME @@ -255,6 +255,10 @@ or an attempt is made to rename .Ql .\& or .Ql \&.. . +.It Bq Er EINVAL +The last component of the +.Fa to +path is invalid on the target file system. .It Bq Er ENOTEMPTY The .Fa to From nobody Tue Aug 27 22:09:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WthYJ64y1z5MTpB; Tue, 27 Aug 2024 22:09: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 4WthYJ0Lq9z55VT; Tue, 27 Aug 2024 22:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724796596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U4IY0aUQzx6RhDxXJwKgRJvTyKjLgHMSu9egT/us5SU=; b=Ks+rKNqzlfASaXc89f5pzgZyvWct8KvbanPlrN3ZQTpGCUNPgAxOQF+/SVZkTljN2Pw3ip 73PB9nOAPwHHaD0VgMfdLicBIBu8uJK9Knieb8oTv3AMiX3YlbaRlvt78P6ReYtvlrEFHe 5/C59LX1PJWQ8b7mwKrevK5XEChPRGSK5e/sJSzXoFC6a/E8hJTzeH9L/L9PB+P0ir4g8y DmbysLUdlltpMLsz54nKOznOEqfKjOr480XZ6WRwdAuLW2FOK5tbdgr4Eyx2qlqjrz1RhS pSEholqL57QerZ6hA0YBL0s3YA/pLjdIEDxpG1XTWTn0r0BQs8h0tNZBEh3Gxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724796596; a=rsa-sha256; cv=none; b=J3pADerUAH7k7WB6Z57yyu19mh5yZkCBr0Tmrv3NsFskhX/nQ5g6j2VmGMpUZQficDhM+P od+dWkEK5V4aPwoY0zgBu5CPF+2MxJyWQc/+3uH501a/AnjuS2M0cCzuLZkjGZYa0Elf5n B62Fkjlw3cNMjxYxC22gdf3+we03ApV5EF7PMjg60Jj8zwmOTZijDoGwYfzehvqrwTNhCs p8PVXSmpsYRoRF4MCO4zS1D/WsCq2POqOisfcpZWALvc7kqACxrsgUrprT4nYg3Mk+7AJJ tjOgzz4x7hsC8n+MhrEfpaIwmB3s8iArvuQ25lRpyB+IGjz9rLpzrDHNSJdLoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724796596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U4IY0aUQzx6RhDxXJwKgRJvTyKjLgHMSu9egT/us5SU=; b=JK5jK3XwOdb9C0VUI5JFxMbefox8I4Y78+m9FlrmPVbxpFEvUufMRCXJkErYP0ir1UYqgb ifBDNSzlrnAkpdHQiTrJiI7RCEqGr9JOOAYlIFEo5cNEegHYayzLdQ5LinwoOvOt7O0tht sxunppIWeIaGof3rdUKU8BBPRnsRd0ltzU6f214vtw2FUW/R1o7b+Ixm4Q4n3nu0TwB+2T tFvUInRrd2dS9lLNILits6lcg9mWAH2onNDqAVF7hdmLr1QN1M9YnWwRsGs7H5bc+dcCet mPxDvihH/xaOMRHOKjZLgwUjx5UNw6DX9L7IVBWP57s4OLpnhT7pwlU4K9hCEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WthYH6tyVz16qM; Tue, 27 Aug 2024 22:09: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 47RM9tTj002848; Tue, 27 Aug 2024 22:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RM9tJp002845; Tue, 27 Aug 2024 22:09:55 GMT (envelope-from git) Date: Tue, 27 Aug 2024 22:09:55 GMT Message-Id: <202408272209.47RM9tJp002845@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: 02c23c3b5ac9 - main - open(2): Extend EINVAL's description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02c23c3b5ac9c9c1115c8b892034bb5d67b05c06 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02c23c3b5ac9c9c1115c8b892034bb5d67b05c06 commit 02c23c3b5ac9c9c1115c8b892034bb5d67b05c06 Author: Jose Luis Duran AuthorDate: 2024-08-27 02:23:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-27 22:09:33 +0000 open(2): Extend EINVAL's description If O_CREAT is specified, the last component of the path argument can contain invalid characters, and return EINVAL on some file systems. PR: 281033 Differential revision: https://reviews.freebsd.org/D46450 MFC after: 1 week --- lib/libsys/open.2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index 220561cc5683..4cdceb336532 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2024 +.Dd August 25, 2024 .Dt OPEN 2 .Os .Sh NAME @@ -580,6 +580,12 @@ and .Dv O_EXEC or .Dv O_SEARCH . +.It Bq Er EINVAL +.Dv O_CREAT +is specified, +and the last component of the +.Fa path +argument is invalid on the file system on which the file is being created. .It Bq Er EBADF The .Fa path From nobody Tue Aug 27 22:12:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wthct0m15z5MVBk; Tue, 27 Aug 2024 22:13:02 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.3 with cipher TLS_AES_256_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 4Wthcs64pgz56mF; Tue, 27 Aug 2024 22:13:01 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 4A6521151AD5; Tue, 27 Aug 2024 18:12:56 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 27 Aug 2024 18:12:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1724796776; x=1724883176; bh=AduXSrGEkOPWxvHQ6zaxiMvzMd4dYF8k/wQGJ/ztaTQ=; b= LsPQ1teRyjrLbNPBTFzrWjBfxXBY0M+Woi0v6RH0Z0y4Wc9xfcphPEqjO02m4IBL ofPg79jslRyiRjzIWiTbDmoOxN4mM93PslpDzoM4GbWAGPs8p8Z5cu9+cYAnsOV6 J0dw84OrzacFl8+CHwz9RXkrDUlMQX7BRLNcSujIEk8bN5i0wvXTroeigNkxa5ud kDVvXS2o0mNW2Tnq/XLp2tpH8EPWKk7/5cXDpWSKwowzAjj/Ml6J0D1FMeCWBrAN ENUtiAeFAhWtSi82rKJ/KOOPhD0eUrOBnu+dC5PJQWq9GsAnvrTLQuQHSuLou9cf x607rpnWOHzGsRc3KWBg7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1724796776; x= 1724883176; bh=AduXSrGEkOPWxvHQ6zaxiMvzMd4dYF8k/wQGJ/ztaTQ=; b=D UKZpwrwCdfGT3Ht92nLiBYlqHqbSP0Y1Ss6WbBAO1IonPYBwDKfs4qSJ/g5iM+Gz isdbYy9u2KvJSOsHAyBJBj1WUgt4mAAj/9isNYuQNcAVqPlwPWa4NBEtdowHKl01 o4Bh/Si04eL+nkc3REdQf2DepqXLpq0am7+kX0XqDJ46k63J3D3laQzmojeKrvUJ LMJxESBOgiSzQCuZ+/aJB/rLynwJcgAwSWIseOeN9YsAuDjlAGq1FSY9WuNxsteR 5pxPLIVlW5yWFV1PGd79/wwv5nPvX8Em35GzzfjaAGqzEaEr6lOy9tXvp05rq5A+ QhT5EAAwlglGbytZhV9IA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudefuddgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpegjuhhrihcurfgrnhhkohhvuceo hihurhhisegrvghtvghrnhdrohhrgheqnecuggftrfgrthhtvghrnhepuddvvefhkeegte fggfekleelheeuvedvkeeljeekgfevjeevtdeuhefhveffteeknecuffhomhgrihhnpehf rhgvvggsshgurdhorhhgpdduqddvtddujedrgiiggidpuddqvddtudejrdhnohenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihesrggv thgvrhhnrdhorhhgpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehkihgssehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepshhrtgdqtgho mhhmihhtthgvrhhssehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepuggvvhdqtghomh hmihhtshdqshhrtgdqrghllhesfhhrvggvsghsugdrohhrghdprhgtphhtthhopeguvghv qdgtohhmmhhithhsqdhsrhgtqdhmrghinhesfhhrvggvsghsugdrohhrgh X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Aug 2024 18:12:54 -0400 (EDT) Message-ID: <8bb9edf4-e0f4-4cfb-8b76-4c132a9abd5a@aetern.org> Date: Wed, 28 Aug 2024 05:12:48 +0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f5a37f8dd319 - main - open(2): mandoc -T lint To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202408272209.47RM9rVX002767@gitrepo.freebsd.org> Content-Language: en-US From: Yuri Pankov In-Reply-To: <202408272209.47RM9rVX002767@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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:209242, ipnet:103.168.172.0/24, country:US] X-Rspamd-Queue-Id: 4Wthcs64pgz56mF Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f5a37f8dd319e3007b126b77376e61ad96f44d8b > > commit f5a37f8dd319e3007b126b77376e61ad96f44d8b > Author: Jose Luis Duran > AuthorDate: 2024-08-27 03:48:09 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-08-27 22:09:33 +0000 > > open(2): mandoc -T lint > > Lint the manual, addressing almost all requests. > > Differential revision: https://reviews.freebsd.org/D46450 > MFC after: 1 week > --- > lib/libsys/open.2 | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 > index be164aae1834..220561cc5683 100644 > --- a/lib/libsys/open.2 > +++ b/lib/libsys/open.2 > @@ -252,7 +252,7 @@ controlling terminal when it opens a tty device. > This is the default on > .Fx , > but is present for > -.Tn POSIX > +POSIX > compatibility. > The > .Fn open > @@ -265,7 +265,7 @@ initially opening a TTY. > This is the default on > .Fx , > but is present for > -.Tn POSIX > +POSIX > compatibility. > The initial call to > .Fn open > @@ -384,7 +384,7 @@ The file pointer used to mark the current position within the > file is set to the beginning of the file. > .Pp > If a sleeping open of a device node from > -.Xr devfs 4 > +.Xr devfs 5 This looks wrong, we now have fs man pages in section 4. > is interrupted by a signal, the call always fails with > .Er EINTR , > even if the > @@ -487,7 +487,7 @@ The system file table is full. > .It Bq Er EMLINK > .Dv O_NOFOLLOW > was specified and the target is a symbolic link. > -.Tn POSIX > +POSIX > specifies a different error for this case; see the note in > .Sx STANDARDS > below. > @@ -661,7 +661,7 @@ to > .Er EMLINK instead of > .Er ELOOP > as specified by > -.Tn POSIX > +POSIX > when > .Dv O_NOFOLLOW > is set in flags and the final component of pathname is a symbolic link > @@ -679,7 +679,10 @@ permits searches. > The present implementation of the > .Fa openat > system call is believed to be compatible with > -.St -p1003.1-2017 , > +.\" .St -p1003.1-2017 , > +.\" XXX: This should be replaced in the future when an appropriate argument to > +.\" the St macro is available: -p1003.1-2017 > +.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) , > which specifies that behavior for > .Dv O_SEARCH , > in the absence of the flag the implementation checks the current > From nobody Tue Aug 27 22:21:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wthpk4kh2z5MVgt; Tue, 27 Aug 2024 22:21:34 +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 4Wthpk2R30z58Lf; Tue, 27 Aug 2024 22:21:34 +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 47RMLOJn009297; Wed, 28 Aug 2024 01:21:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 47RMLOJn009297 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 47RMLOkK009296; Wed, 28 Aug 2024 01:21:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 Aug 2024 01:21:23 +0300 From: Konstantin Belousov To: Yuri Pankov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f5a37f8dd319 - main - open(2): mandoc -T lint Message-ID: References: <202408272209.47RM9rVX002767@gitrepo.freebsd.org> <8bb9edf4-e0f4-4cfb-8b76-4c132a9abd5a@aetern.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8bb9edf4-e0f4-4cfb-8b76-4c132a9abd5a@aetern.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-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] X-Rspamd-Queue-Id: 4Wthpk2R30z58Lf On Wed, Aug 28, 2024 at 05:12:48AM +0700, Yuri Pankov wrote: > Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=f5a37f8dd319e3007b126b77376e61ad96f44d8b > > > > commit f5a37f8dd319e3007b126b77376e61ad96f44d8b > > Author: Jose Luis Duran > > AuthorDate: 2024-08-27 03:48:09 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-08-27 22:09:33 +0000 > > > > open(2): mandoc -T lint > > > > Lint the manual, addressing almost all requests. > > > > Differential revision: https://reviews.freebsd.org/D46450 > > MFC after: 1 week > > --- > > lib/libsys/open.2 | 15 +++++++++------ > > 1 file changed, 9 insertions(+), 6 deletions(-) > > > > diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 > > index be164aae1834..220561cc5683 100644 > > --- a/lib/libsys/open.2 > > +++ b/lib/libsys/open.2 > > @@ -252,7 +252,7 @@ controlling terminal when it opens a tty device. > > This is the default on > > .Fx , > > but is present for > > -.Tn POSIX > > +POSIX > > compatibility. > > The > > .Fn open > > @@ -265,7 +265,7 @@ initially opening a TTY. > > This is the default on > > .Fx , > > but is present for > > -.Tn POSIX > > +POSIX > > compatibility. > > The initial call to > > .Fn open > > @@ -384,7 +384,7 @@ The file pointer used to mark the current position within the > > file is set to the beginning of the file. > > .Pp > > If a sleeping open of a device node from > > -.Xr devfs 4 > > +.Xr devfs 5 > > This looks wrong, we now have fs man pages in section 4. Thanks. I checked it on my stable/14 w/s. From nobody Tue Aug 27 22:24:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wthsn6gzgz5MW9S; Tue, 27 Aug 2024 22:24: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 4Wthsn66Lkz58lM; Tue, 27 Aug 2024 22:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724797453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXV93188LzC8bXmkeMw4OgV1W7uIEbTtWqmlRn6OSFU=; b=hrU5ahMBt3QnJEti9c6PzxE7XYrdApfIwUX2mXl+hB/nPqUjauUGvKZsuBP+i3tXQixLoO c7tr9AVC5MEpvnuaixjef+u+2uT5vZfzPSrHW6WGN4qDGpwzTv4fc1M+qi8cLZsxF6Uvw6 lV67zivku+mjOLCBd9C6YDOXuMJT9bI8ceT2ORoF2PZyAAEonMT80ovCNJ5bGBnAfV4vww sa6dOUTGdmOpeqi47zkE8qGVSPX9f6h0ql71cZngpX2XhFhBWMI3AnVSIaD6DKT6cBjrIX MGRpLcorHys/13+DAtMsdlAc4LLbBegDoplfnYkd22tz4IOKZv1SngCUzRB7Dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724797453; a=rsa-sha256; cv=none; b=kbbVIhwOFRwmBssv78B2NZEthOz8EznUL1hgRUPzfM/+EYIWsYDT3bRoR8tZ1ovm8FzXI3 3kMrt/n35Put5uD2E8Mt5VUTlRbjd+T1Yc953J+mN0bbnRJUcn8p9r99EFQ4ITA5j394fX QjZ/D9wQY5Ya513QoPG89nCrOHf0GnMfXUcWcbONZv8LyTzLptEk0pLQwfIoKrM/7KTR/j v64CjGBF+axNm001iajOnYjyfFwaAmghaKaRVN6HsBLb8DfEnGFfUpJTugqkya9FK+eUFq npP/hY2DFvgFMUb/crCcDv1hfBuI0eBv0dqRdd97UxCht4zBpbb/mU99bReUGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724797453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXV93188LzC8bXmkeMw4OgV1W7uIEbTtWqmlRn6OSFU=; b=AInyM2voPXrez7hRIlGH/WtDDcyk6ZVxgmOPAXgXLh8eB48bDrupI2XxoeCMadaHQY1cBN Ht5BL1XE6x7FpQMz9AbYIQ1BM4VAOt5T69OPTrgfFSE7eT3anHw8IFHNMah/IHEtC1xVTp nG/somBtYf9xz/bWLC4EpGXY4Od73Bc416VMvMMpA3Hvx5kXTv8R1p6e+BDjV5IWcsb92y c1uMtO/HyTVn1npG/3xgBbFbFngkbuKmfwz0bAb0HhvShvgQA99mAfNq0bohuF7M4Nz9hN 0oHbnw/wy7GBOxbbt0C0z4q57Zq70Dlg+2nPdipZKygAB840zSwHRnPSYCVZwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wthsn5fkRz17Pw; Tue, 27 Aug 2024 22:24: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 47RMODaX035906; Tue, 27 Aug 2024 22:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RMOD9s035903; Tue, 27 Aug 2024 22:24:13 GMT (envelope-from git) Date: Tue, 27 Aug 2024 22:24:13 GMT Message-Id: <202408272224.47RMOD9s035903@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: 37bb98841099 - main - open(2): devfs is in section 4 on HEAD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37bb98841099a4c23c0b8990a988a3324b902c39 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=37bb98841099a4c23c0b8990a988a3324b902c39 commit 37bb98841099a4c23c0b8990a988a3324b902c39 Author: Konstantin Belousov AuthorDate: 2024-08-27 22:23:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-27 22:23:20 +0000 open(2): devfs is in section 4 on HEAD Noted by: yuripv Fixes: f5a37f8dd319e3007b126b77376e61ad96f44d8b --- lib/libsys/open.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index 4cdceb336532..8331362640d6 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -384,7 +384,7 @@ The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp If a sleeping open of a device node from -.Xr devfs 5 +.Xr devfs 4 is interrupted by a signal, the call always fails with .Er EINTR , even if the From nobody Tue Aug 27 23:07:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtjqr2PHXz5MYdG; Tue, 27 Aug 2024 23:07: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 4Wtjqr1gr0z40Wg; Tue, 27 Aug 2024 23:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724800056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYoyHkQhxU8AChNp3iqI2QjxumVWRO/crag03yJS4RA=; b=UD8UpKBMynkkIrFpNcxwGBEkzkmwu35ss7MgSucZHgFUyFtaHG4K0B4Ni0BrvIJziSCh0u J3jHX3nts99UyibFJtzn/0JJFOv/KzQykM008VaS3VTg16MYpJTYd50IrH1A4V6/OztOIE 5FE/kVXOIvo3L2vMsGVb3Myjvd3dESh0PnIZh85XocJsZhHGgHukgZvp8SaC1FI8DvVGqJ 8VGtlLZc7kSlCTgFXjoZ2M/kQ1rIvzVrbLp3FsDJaj/9tnELO4EaSEEDKVvt3QlnRZWpCp 1qS3PiXu8wl+acAgYCzgMcCa6om6XWBG1b1bcLK0CUXS2Cy9fytzqAXTkT/aoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724800056; a=rsa-sha256; cv=none; b=qjZHz2qOTlufnnHiHjtLdRUciwTYLKOytO5RsFUzthIBKWDUmALmztA+fxYXjy2MBDjE4Z w1gNamskOyCe2mojY3+7MwTzR3I7k7CjzBqn/9wVPG6Y5oR3SZoqluUM6UIQqIFMM/kA6s dYCb+oqT/jZjSv9JnugmkAzHM7xSH+KsDGOJqAfWLbf/qsXMe+/Bx2EtlqnnP2YIccjJIN WIEqcvTUs+GCJCbLdIN4zxYSZBpijfxPRM8do1zyZc4kt99mdbnosjN5FoGxviGQruKfFX u/OAinEFqLzeiH0YUlMQHoUDi0RjdzPoLjeC/z7SOWm5NyAZKMdv68iAPzXubA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724800056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYoyHkQhxU8AChNp3iqI2QjxumVWRO/crag03yJS4RA=; b=qVm3/716yVfy/mhmS9jWgWZ9AA02oKyqmtaZjChFwtHeNc0JtKd2paMHXmxPBm3IE2ChdI aSHCJN0S9veOV6kHYnpNJH8S9Wy5VoRnesOYZyta2b0zT9gSOawQ/zy3AXnUI44IJp7ph8 L0mr8o/+MQSNoJWWixOo2C1jRZUwi7cR20uPyz5azE+3GRpH9qLG10Pre+O/oL0aBAH2Sa s/DLdxICtR3LlG8sYUetQNjiJiY5+DQ/AqufKHiiBYoOfo06gSytGTY3YLRu5NneOl3HZ2 vAn145p6ex6RdDzQzavXMs1gOxESUcf+hVmmZhhmKH/+hyKBajZ7eRqWxzv2Hw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtjqr1H3Qz17q3; Tue, 27 Aug 2024 23:07: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 47RN7a6L004450; Tue, 27 Aug 2024 23:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RN7aU4004448; Tue, 27 Aug 2024 23:07:36 GMT (envelope-from git) Date: Tue, 27 Aug 2024 23:07:36 GMT Message-Id: <202408272307.47RN7aU4004448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: fef4249f0728 - main - ixl(4): Use GL_RXERR1 register for correct oversize packet count List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fef4249f07287374b10087f597a62b8e00dedabc Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=fef4249f07287374b10087f597a62b8e00dedabc commit fef4249f07287374b10087f597a62b8e00dedabc Author: Eric Joyner AuthorDate: 2024-08-27 22:59:49 +0000 Commit: Eric Joyner CommitDate: 2024-08-27 22:59:49 +0000 ixl(4): Use GL_RXERR1 register for correct oversize packet count The driver sets the Maximum Transmission Unit (MTU) at the Virtual Station Interface (VSI) level, which leads to a discrepancy in the GLPRT_ROC counter's ability to accurately tally oversized packets, as this counter operates at the physical port level. To rectify this issue, it is necessary to take an additional register (GL_RXERR1) into account to obtain the correct count of oversized packets. Signed-off-by: Yogesh Bhosale Signed-off-by: Eric Joyner Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D45870 --- sys/dev/ixl/i40e_register.h | 12 ++-- sys/dev/ixl/i40e_type.h | 1 + sys/dev/ixl/ixl_pf.h | 4 +- sys/dev/ixl/ixl_pf_main.c | 158 ++++++++++++++++++++++++-------------------- 4 files changed, 100 insertions(+), 75 deletions(-) diff --git a/sys/dev/ixl/i40e_register.h b/sys/dev/ixl/i40e_register.h index 22a0f779db09..c267fef41af3 100644 --- a/sys/dev/ixl/i40e_register.h +++ b/sys/dev/ixl/i40e_register.h @@ -2431,10 +2431,14 @@ #define I40E_GL_FCOERPDC_MAX_INDEX 143 #define I40E_GL_FCOERPDC_FCOERPDC_SHIFT 0 #define I40E_GL_FCOERPDC_FCOERPDC_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_FCOERPDC_FCOERPDC_SHIFT) -#define I40E_GL_RXERR1_L(_i) (0x00318000 + ((_i) * 8)) /* _i=0...143 */ /* Reset: CORER */ -#define I40E_GL_RXERR1_L_MAX_INDEX 143 -#define I40E_GL_RXERR1_L_FCOEDIFRC_SHIFT 0 -#define I40E_GL_RXERR1_L_FCOEDIFRC_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_RXERR1_L_FCOEDIFRC_SHIFT) +#define I40E_GL_RXERR1H(_i) (0x00318004 + ((_i) * 8)) /* _i=0...143 */ /* Reset: CORER */ +#define I40E_GL_RXERR1H_MAX_INDEX 143 +#define I40E_GL_RXERR1H_RXERR1H_SHIFT 0 +#define I40E_GL_RXERR1H_RXERR1H_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_RXERR1H_RXERR1H_SHIFT) +#define I40E_GL_RXERR1L(_i) (0x00318000 + ((_i) * 8)) /* _i=0...143 */ /* Reset: CORER */ +#define I40E_GL_RXERR1L_MAX_INDEX 143 +#define I40E_GL_RXERR1L_RXERR1L_SHIFT 0 +#define I40E_GL_RXERR1L_RXERR1L_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_RXERR1L_RXERR1L_SHIFT) #define I40E_GL_RXERR2_L(_i) (0x0031c000 + ((_i) * 8)) /* _i=0...143 */ /* Reset: CORER */ #define I40E_GL_RXERR2_L_MAX_INDEX 143 #define I40E_GL_RXERR2_L_FCOEDIXAC_SHIFT 0 diff --git a/sys/dev/ixl/i40e_type.h b/sys/dev/ixl/i40e_type.h index 9c2809a3e41a..20e8f09b0813 100644 --- a/sys/dev/ixl/i40e_type.h +++ b/sys/dev/ixl/i40e_type.h @@ -1472,6 +1472,7 @@ struct i40e_hw_port_stats { u64 rx_undersize; /* ruc */ u64 rx_fragments; /* rfc */ u64 rx_oversize; /* roc */ + u64 rx_err1; /* rxerr1 */ u64 rx_jabber; /* rjc */ u64 tx_size_64; /* ptc64 */ u64 tx_size_127; /* ptc127 */ diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 96303c43d4e8..f0d42f18cef0 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -318,7 +318,9 @@ void ixl_disable_queue(struct i40e_hw *, int); void ixl_enable_intr0(struct i40e_hw *); void ixl_disable_intr0(struct i40e_hw *); void ixl_nvm_version_str(struct i40e_hw *hw, struct sbuf *buf); -void ixl_stat_update48(struct i40e_hw *, u32, u32, bool, +void ixl_stat_update64(struct i40e_hw *, u32, bool, + u64 *, u64 *); +void ixl_stat_update48(struct i40e_hw *, u32, bool, u64 *, u64 *); void ixl_stat_update32(struct i40e_hw *, u32, bool, u64 *, u64 *); diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index af253faeac7a..4e1b1001efdc 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -2109,45 +2109,37 @@ ixl_update_stats_counters(struct ixl_pf *pf) ixl_stat_update32(hw, I40E_GLPRT_ILLERRC(hw->port), pf->stat_offsets_loaded, &osd->illegal_bytes, &nsd->illegal_bytes); - ixl_stat_update48(hw, I40E_GLPRT_GORCH(hw->port), - I40E_GLPRT_GORCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_GORCL(hw->port), pf->stat_offsets_loaded, &osd->eth.rx_bytes, &nsd->eth.rx_bytes); - ixl_stat_update48(hw, I40E_GLPRT_GOTCH(hw->port), - I40E_GLPRT_GOTCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_GOTCL(hw->port), pf->stat_offsets_loaded, &osd->eth.tx_bytes, &nsd->eth.tx_bytes); ixl_stat_update32(hw, I40E_GLPRT_RDPC(hw->port), pf->stat_offsets_loaded, &osd->eth.rx_discards, &nsd->eth.rx_discards); - ixl_stat_update48(hw, I40E_GLPRT_UPRCH(hw->port), - I40E_GLPRT_UPRCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_UPRCL(hw->port), pf->stat_offsets_loaded, &osd->eth.rx_unicast, &nsd->eth.rx_unicast); - ixl_stat_update48(hw, I40E_GLPRT_UPTCH(hw->port), - I40E_GLPRT_UPTCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_UPTCL(hw->port), pf->stat_offsets_loaded, &osd->eth.tx_unicast, &nsd->eth.tx_unicast); - ixl_stat_update48(hw, I40E_GLPRT_MPRCH(hw->port), - I40E_GLPRT_MPRCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_MPRCL(hw->port), pf->stat_offsets_loaded, &osd->eth.rx_multicast, &nsd->eth.rx_multicast); - ixl_stat_update48(hw, I40E_GLPRT_MPTCH(hw->port), - I40E_GLPRT_MPTCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_MPTCL(hw->port), pf->stat_offsets_loaded, &osd->eth.tx_multicast, &nsd->eth.tx_multicast); - ixl_stat_update48(hw, I40E_GLPRT_BPRCH(hw->port), - I40E_GLPRT_BPRCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_BPRCL(hw->port), pf->stat_offsets_loaded, &osd->eth.rx_broadcast, &nsd->eth.rx_broadcast); - ixl_stat_update48(hw, I40E_GLPRT_BPTCH(hw->port), - I40E_GLPRT_BPTCL(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_BPTCL(hw->port), pf->stat_offsets_loaded, &osd->eth.tx_broadcast, &nsd->eth.tx_broadcast); @@ -2191,62 +2183,48 @@ ixl_update_stats_counters(struct ixl_pf *pf) vsi->shared->isc_pause_frames = 1; /* Packet size stats rx */ - ixl_stat_update48(hw, I40E_GLPRT_PRC64H(hw->port), - I40E_GLPRT_PRC64L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC64L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_64, &nsd->rx_size_64); - ixl_stat_update48(hw, I40E_GLPRT_PRC127H(hw->port), - I40E_GLPRT_PRC127L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC127L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_127, &nsd->rx_size_127); - ixl_stat_update48(hw, I40E_GLPRT_PRC255H(hw->port), - I40E_GLPRT_PRC255L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC255L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_255, &nsd->rx_size_255); - ixl_stat_update48(hw, I40E_GLPRT_PRC511H(hw->port), - I40E_GLPRT_PRC511L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC511L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_511, &nsd->rx_size_511); - ixl_stat_update48(hw, I40E_GLPRT_PRC1023H(hw->port), - I40E_GLPRT_PRC1023L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC1023L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_1023, &nsd->rx_size_1023); - ixl_stat_update48(hw, I40E_GLPRT_PRC1522H(hw->port), - I40E_GLPRT_PRC1522L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC1522L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_1522, &nsd->rx_size_1522); - ixl_stat_update48(hw, I40E_GLPRT_PRC9522H(hw->port), - I40E_GLPRT_PRC9522L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PRC9522L(hw->port), pf->stat_offsets_loaded, &osd->rx_size_big, &nsd->rx_size_big); /* Packet size stats tx */ - ixl_stat_update48(hw, I40E_GLPRT_PTC64H(hw->port), - I40E_GLPRT_PTC64L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC64L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_64, &nsd->tx_size_64); - ixl_stat_update48(hw, I40E_GLPRT_PTC127H(hw->port), - I40E_GLPRT_PTC127L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC127L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_127, &nsd->tx_size_127); - ixl_stat_update48(hw, I40E_GLPRT_PTC255H(hw->port), - I40E_GLPRT_PTC255L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC255L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_255, &nsd->tx_size_255); - ixl_stat_update48(hw, I40E_GLPRT_PTC511H(hw->port), - I40E_GLPRT_PTC511L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC511L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_511, &nsd->tx_size_511); - ixl_stat_update48(hw, I40E_GLPRT_PTC1023H(hw->port), - I40E_GLPRT_PTC1023L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC1023L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_1023, &nsd->tx_size_1023); - ixl_stat_update48(hw, I40E_GLPRT_PTC1522H(hw->port), - I40E_GLPRT_PTC1522L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC1522L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_1522, &nsd->tx_size_1522); - ixl_stat_update48(hw, I40E_GLPRT_PTC9522H(hw->port), - I40E_GLPRT_PTC9522L(hw->port), + ixl_stat_update48(hw, I40E_GLPRT_PTC9522L(hw->port), pf->stat_offsets_loaded, &osd->tx_size_big, &nsd->tx_size_big); @@ -2256,9 +2234,29 @@ ixl_update_stats_counters(struct ixl_pf *pf) ixl_stat_update32(hw, I40E_GLPRT_RFC(hw->port), pf->stat_offsets_loaded, &osd->rx_fragments, &nsd->rx_fragments); + + u64 rx_roc; ixl_stat_update32(hw, I40E_GLPRT_ROC(hw->port), pf->stat_offsets_loaded, - &osd->rx_oversize, &nsd->rx_oversize); + &osd->rx_oversize, &rx_roc); + + /* + * Read from RXERR1 register to get the count for the packets + * larger than RX MAX and include that in total rx_oversize count. + * + * Also need to add BIT(7) to hw->port value while indexing + * I40E_GL_RXERR1 register as indexes 0..127 are for VFs when + * SR-IOV is enabled. Indexes 128..143 are for PFs. + */ + u64 rx_err1; + ixl_stat_update64(hw, + I40E_GL_RXERR1L(hw->pf_id + BIT(7)), + pf->stat_offsets_loaded, + &osd->rx_err1, + &rx_err1); + + nsd->rx_oversize = rx_roc + rx_err1; + ixl_stat_update32(hw, I40E_GLPRT_RJC(hw->port), pf->stat_offsets_loaded, &osd->rx_jabber, &nsd->rx_jabber); @@ -2305,37 +2303,29 @@ ixl_update_eth_stats(struct ixl_vsi *vsi) vsi->stat_offsets_loaded, &oes->rx_discards, &es->rx_discards); - ixl_stat_update48(hw, I40E_GLV_GORCH(stat_idx), - I40E_GLV_GORCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_GORCL(stat_idx), vsi->stat_offsets_loaded, &oes->rx_bytes, &es->rx_bytes); - ixl_stat_update48(hw, I40E_GLV_UPRCH(stat_idx), - I40E_GLV_UPRCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_UPRCL(stat_idx), vsi->stat_offsets_loaded, &oes->rx_unicast, &es->rx_unicast); - ixl_stat_update48(hw, I40E_GLV_MPRCH(stat_idx), - I40E_GLV_MPRCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_MPRCL(stat_idx), vsi->stat_offsets_loaded, &oes->rx_multicast, &es->rx_multicast); - ixl_stat_update48(hw, I40E_GLV_BPRCH(stat_idx), - I40E_GLV_BPRCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_BPRCL(stat_idx), vsi->stat_offsets_loaded, &oes->rx_broadcast, &es->rx_broadcast); - ixl_stat_update48(hw, I40E_GLV_GOTCH(stat_idx), - I40E_GLV_GOTCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_GOTCL(stat_idx), vsi->stat_offsets_loaded, &oes->tx_bytes, &es->tx_bytes); - ixl_stat_update48(hw, I40E_GLV_UPTCH(stat_idx), - I40E_GLV_UPTCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_UPTCL(stat_idx), vsi->stat_offsets_loaded, &oes->tx_unicast, &es->tx_unicast); - ixl_stat_update48(hw, I40E_GLV_MPTCH(stat_idx), - I40E_GLV_MPTCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_MPTCL(stat_idx), vsi->stat_offsets_loaded, &oes->tx_multicast, &es->tx_multicast); - ixl_stat_update48(hw, I40E_GLV_BPTCH(stat_idx), - I40E_GLV_BPTCL(stat_idx), + ixl_stat_update48(hw, I40E_GLV_BPTCL(stat_idx), vsi->stat_offsets_loaded, &oes->tx_broadcast, &es->tx_broadcast); vsi->stat_offsets_loaded = true; @@ -2409,28 +2399,56 @@ ixl_vsi_reset_stats(struct ixl_vsi *vsi) } /** - * Read and update a 48 bit stat from the hw + * Helper function for reading and updating 48/64 bit stats from the hw * * Since the device stats are not reset at PFReset, they likely will not * be zeroed when the driver starts. We'll save the first values read * and use them as offsets to be subtracted from the raw values in order * to report stats that count from zero. **/ -void -ixl_stat_update48(struct i40e_hw *hw, u32 hireg, u32 loreg, - bool offset_loaded, u64 *offset, u64 *stat) +static void +_ixl_stat_update_helper(struct i40e_hw *hw, u32 reg, + bool offset_loaded, u64 mask, u64 *offset, u64 *stat) { - u64 new_data; - - new_data = rd64(hw, loreg); + u64 new_data = rd64(hw, reg); if (!offset_loaded) *offset = new_data; if (new_data >= *offset) *stat = new_data - *offset; else - *stat = (new_data + ((u64)1 << 48)) - *offset; - *stat &= 0xFFFFFFFFFFFFULL; + *stat = (new_data + mask) - *offset + 1; + *stat &= mask; +} + +/** + * Read and update a 48 bit stat from the hw + **/ +void +ixl_stat_update48(struct i40e_hw *hw, u32 reg, + bool offset_loaded, u64 *offset, u64 *stat) +{ + _ixl_stat_update_helper(hw, + reg, + offset_loaded, + 0xFFFFFFFFFFFFULL, + offset, + stat); +} + +/** + * ixl_stat_update64 - read and update a 64 bit stat from the chip. + **/ +void +ixl_stat_update64(struct i40e_hw *hw, u32 reg, + bool offset_loaded, u64 *offset, u64 *stat) +{ + _ixl_stat_update_helper(hw, + reg, + offset_loaded, + 0xFFFFFFFFFFFFFFFFULL, + offset, + stat); } /** From nobody Tue Aug 27 23:16:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtk1f2TDQz5MZKb; Tue, 27 Aug 2024 23:16: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 4Wtk1b6XT5z41NY; Tue, 27 Aug 2024 23:16:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724800563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MMxEOCf0Lq2YnNNXOhYD5vAwI7wwD50iolcrxXwf5eE=; b=lsSfhwkngMKA8WQiBkZT19tJJJrD+dpODFqgrrtWc4Y4r3orT16Yn8bDLBqk0hF8RvQTMd AbVmepHz1inr1g9xR99t3fx2/tRC8RBB0bFeHv2SFH3EZeKhznxk5ycTssZzICfKXCm4Hz 21gAbuJS8e6hNYJ8LRqPCV61g4K6gL6RLr/tBLd9OqB9/iwCoIJ7GyCcSDZGJHFAcNl6Ro D65rdTireGv+2t5kR/N05S/eQhWWzH5Ivg2fUHXofVNCy+50YGIxXbZYW+upQK1VvFwQK2 LsLTeyPcymVPMZF1iDi+o3dGbCtr7s2gfKrbrChHmlb5eyVBWCGmPaZVI5Cv9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724800563; a=rsa-sha256; cv=none; b=Z6EJjJX2wS4iwzU19GS6Tq3ukkwfuc82bXoxFgvFux2BdJaeGflpz4/cwUKGmXR1osHhr4 afONqjoAOvoz2LgxPBSUDEKZBz7FkT1oYtrEo6dVczVZrKghGidvBhZDkZgxvy1+mZ4Rza 5ytxHCtytxG9cDScSNg2FhRHtIUeX5D5OBZKbvFXdcyXZPqaIiyN06zNRlDG+ZzhP+QFMZ wgKY/Wm/bHJncYXIbF5gsA2CIsKzuDXmuoC/n6CVLpjLNqFZAuSfg9ZS+3mH3Kv8xwSTwR B+mobn/uANZodzwJCL7pVDElrPHxQ6c4UGX8t37pLCpzFANHNMEuft8VMt5qHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724800563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MMxEOCf0Lq2YnNNXOhYD5vAwI7wwD50iolcrxXwf5eE=; b=Ga/W4amh785qJiRiWWt9m/yN8Q5IeeBq44Fl8sUOaLAsBWj6BD2EY73CxW7amWV1Pf82oB 1dL/tkNAqyveQxUPayaTELkdZ7kYG2mwghT5yG7ooRMMCHiL+p1fxaj5x3DhwI56kMj0hA 5VCiu2qWdE4R3bMxzDxy/Jt6ITlP2nRhIcfhfyUliYLU5MXGk9Fpi7IpV3yoiyyHoG7YCF kszKoOH6yCXamFts5JsH3rWngRV+Z5PolCB4ZZXofMSkr4TDoagS9BOKRGIIwmCbxktuJc nk+0MpCj48/unq8Le2J32OLZC1o3JKO8oWCfcpL0Us/SC+jNGAoudSQx40X0MQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtk1b3qskz17qM; Tue, 27 Aug 2024 23:16: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 47RNG3Tr020966; Tue, 27 Aug 2024 23:16:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RNG37E020963; Tue, 27 Aug 2024 23:16:03 GMT (envelope-from git) Date: Tue, 27 Aug 2024 23:16:03 GMT Message-Id: <202408272316.47RNG37E020963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 4fecb7015432 - main - ixl(4): Add more debug information for queues' config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fecb70154322fb8160da10d87c633cefaff7db3 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=4fecb70154322fb8160da10d87c633cefaff7db3 commit 4fecb70154322fb8160da10d87c633cefaff7db3 Author: Krzysztof Galazka AuthorDate: 2024-08-27 23:11:18 +0000 Commit: Eric Joyner CommitDate: 2024-08-27 23:13:19 +0000 ixl(4): Add more debug information for queues' config Include information about interrupt linked lists in queue_interrupt_table sysctl and add new debug sysctl queue_int_ctln allowing to check current interrupt state. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D45403 --- sys/dev/ixl/ixl_pf_main.c | 53 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 4e1b1001efdc..9755136df848 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -91,6 +91,7 @@ static int ixl_sysctl_do_pf_reset(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_do_core_reset(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_do_global_reset(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_queue_interrupt_table(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_debug_queue_int_ctln(SYSCTL_HANDLER_ARGS); #ifdef IXL_DEBUG static int ixl_sysctl_qtx_tail_handler(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_qrx_tail_handler(SYSCTL_HANDLER_ARGS); @@ -2528,6 +2529,12 @@ ixl_add_sysctls_recovery_mode(struct ixl_pf *pf) OID_AUTO, "queue_interrupt_table", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pf, 0, ixl_sysctl_queue_interrupt_table, "A", "View MSI-X indices for TX/RX queues"); + + SYSCTL_ADD_PROC(ctx, debug_list, + OID_AUTO, "queue_int_ctln", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + pf, 0, ixl_sysctl_debug_queue_int_ctln, "A", + "View MSI-X control registers for RX queues"); } void @@ -4899,6 +4906,7 @@ ixl_sysctl_queue_interrupt_table(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; struct ixl_vsi *vsi = &pf->vsi; + struct i40e_hw *hw = vsi->hw; device_t dev = pf->dev; struct sbuf *buf; int error = 0; @@ -4915,11 +4923,52 @@ ixl_sysctl_queue_interrupt_table(SYSCTL_HANDLER_ARGS) sbuf_cat(buf, "\n"); for (int i = 0; i < vsi->num_rx_queues; i++) { rx_que = &vsi->rx_queues[i]; - sbuf_printf(buf, "(rxq %3d): %d\n", i, rx_que->msix); + sbuf_printf(buf, + "(rxq %3d): %d LNKLSTN: %08x QINT_RQCTL: %08x\n", + i, rx_que->msix, + rd32(hw, I40E_PFINT_LNKLSTN(rx_que->msix - 1)), + rd32(hw, I40E_QINT_RQCTL(rx_que->msix - 1))); } for (int i = 0; i < vsi->num_tx_queues; i++) { tx_que = &vsi->tx_queues[i]; - sbuf_printf(buf, "(txq %3d): %d\n", i, tx_que->msix); + sbuf_printf(buf, "(txq %3d): %d QINT_TQCTL: %08x\n", + i, tx_que->msix, + rd32(hw, I40E_QINT_TQCTL(tx_que->msix - 1))); + } + + error = sbuf_finish(buf); + if (error) + device_printf(dev, "Error finishing sbuf: %d\n", error); + sbuf_delete(buf); + + return (error); +} + +static int +ixl_sysctl_debug_queue_int_ctln(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct ixl_vsi *vsi = &pf->vsi; + struct i40e_hw *hw = vsi->hw; + device_t dev = pf->dev; + struct sbuf *buf; + int error = 0; + + struct ixl_rx_queue *rx_que = vsi->rx_queues; + + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for output.\n"); + return (ENOMEM); + } + + sbuf_cat(buf, "\n"); + for (int i = 0; i < vsi->num_rx_queues; i++) { + rx_que = &vsi->rx_queues[i]; + sbuf_printf(buf, + "(rxq %3d): %d PFINT_DYN_CTLN: %08x\n", + i, rx_que->msix, + rd32(hw, I40E_PFINT_DYN_CTLN(rx_que->msix - 1))); } error = sbuf_finish(buf); From nobody Wed Aug 28 00:40:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtltv6Lrwz5MS4C; Wed, 28 Aug 2024 00:40: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 4Wtltv5s0Zz47dQ; Wed, 28 Aug 2024 00:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MKd4RhTe2HfyWAlSa9krHS1nc/FVypUM+j1cOjzxC8=; b=DFqYsJPPm/5NT0nfxGMnWTHMPxjlYVVUOVRuLT3PYSx3MDjS3UVT7WmjDikX/VImdDhUx0 kvZ5ASteskbK/YIVk1BBFnqgSy5MtLkYG42S8+5/D6kTWIXAqrFaN9Hd99tdYr9wH+FgM9 UktsEcoCTkMt5UI3xbk+AB39iN6d2mWgT2tbLd2Fvmoo6eWGxb3hhDK0U3QRoO3kNxfOA3 tiozBEyAEeGsrga6FJ05o1qdvJ6rKo07BMGw/zQch3ReJNxBgqZ/bh6UOKY0l1sCDUdf8N LQuXG2g2ahjGc06CXhAGCemaiKnuo1UKpHxkWtUUj184IW987j8QzUlO9uiibQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805623; a=rsa-sha256; cv=none; b=JZXP70VVoXocNI5TB3J+D85iMNqyvMPGHpgx7/ZPK0EBYPac1JVXTW/NYjoCOLNx0bO0+C T/8NaxyM1nD64BrfG6lzdfKHB6h7v5yUu0YKJ/UBTFDtP7dKFJBTAUx2kHheUDEA9hOFWW 2P09ouHN+Ajffn4xFO8cwZJczP5XeWWM0a2NTyNV7JKfp34Q8lF+f24AUMyHomXse3WsMr D5JKCcmGreKtV0bQbtOF506iNq2629yuAcSgtYJaQrHU1Bij1VY7DLL3WF6usozs5FH4t+ q0Hc2ahIzdws5yCFfP3vQ7Q4rBuBPCj/BZgFnLyy8AgeB2/AkDq94yGCIsDSUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MKd4RhTe2HfyWAlSa9krHS1nc/FVypUM+j1cOjzxC8=; b=EdbYgvlA8DOYf6C2y+k05Dc9TZmIaz8RplAgoVJH8QR5ORZBCSFTU5kENHFn4zIOi8+dAY jV+Z4VWl4Q/Y2su9G/Ca6RhNUGpuEPVeiEHJp/medeblW7t4DFs7j2knhcRWYbQFXjhUw4 0h0p6VF50U5AcA6Ih5BsEkiraMLhKJF7qR1CouSRL/iZM7hE9mWgRVaS78Pvcdl7mjZ2rT uHRRSfPbR/xT/WYv9WIf8nC10rQSkbNSY6/R1ywkJk8XQ8Nke9p0MQW9zQb0xmfVp7W31B WjrCsjVvoPCBCi0XBftgtYGHvVDG8XuRkY2ZPYh64drupligZflat1ohoM/1GA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltv5LMzz1Bhg; Wed, 28 Aug 2024 00:40: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 47S0eN1k064577; Wed, 28 Aug 2024 00:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eNVA064574; Wed, 28 Aug 2024 00:40:23 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:23 GMT Message-Id: <202408280040.47S0eNVA064574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d66c4853b840 - stable/14 - DMAR: clear dmar_devs[unit] if attach failed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d66c4853b84002c064bc314a0824a8667a0089c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d66c4853b84002c064bc314a0824a8667a0089c6 commit d66c4853b84002c064bc314a0824a8667a0089c6 Author: Konstantin Belousov AuthorDate: 2024-08-20 14:41:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:33 +0000 DMAR: clear dmar_devs[unit] if attach failed PR: 280817 (cherry picked from commit 45543d3424d46f84a5399879e190fc359dcefbd4) --- sys/x86/iommu/intel_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 0b25620114cd..636534173715 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -422,6 +422,7 @@ dmar_attach(device_t dev) &unit->reg_rid, RF_ACTIVE); if (unit->regs == NULL) { device_printf(dev, "cannot allocate register window\n"); + dmar_devs[unit->iommu.unit] = NULL; return (ENOMEM); } unit->hw_ver = dmar_read4(unit, DMAR_VER_REG); @@ -449,6 +450,7 @@ dmar_attach(device_t dev) error = dmar_alloc_irq(dev, unit, DMAR_INTR_FAULT); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } if (DMAR_HAS_QI(unit)) { @@ -463,6 +465,7 @@ dmar_attach(device_t dev) error = dmar_alloc_irq(dev, unit, DMAR_INTR_QI); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } } @@ -496,12 +499,14 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_inv_ctx_glob(unit); if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } if ((unit->hw_ecap & DMAR_ECAP_DI) != 0) { @@ -509,6 +514,7 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } } @@ -517,16 +523,19 @@ dmar_attach(device_t dev) error = dmar_init_fault_log(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_init_qi(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } error = dmar_init_irt(unit); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } @@ -542,6 +551,7 @@ dmar_attach(device_t dev) error = iommu_init_busdma(&unit->iommu); if (error != 0) { dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } @@ -551,6 +561,7 @@ dmar_attach(device_t dev) if (error != 0) { DMAR_UNLOCK(unit); dmar_release_resources(dev, unit); + dmar_devs[unit->iommu.unit] = NULL; return (error); } DMAR_UNLOCK(unit); From nobody Wed Aug 28 00:40:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtltx0057z5MS6H; Wed, 28 Aug 2024 00:40: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 4Wtltw6Vqjz47kL; Wed, 28 Aug 2024 00:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzLf1HeWO2m+kWO26CIYQLHLp1oQSKkxD4AuPaj/lKs=; b=AbVYcgNN6veip3+iPRk3kzaIq7rRk3brd6Go6T+UxGR8gEdG77p41N6vOlKDgy9rbZr3Ph UCGrIBs61ZnPnT73JdgRoVeaK3uXT/ilq6tNGLcQ7j/igONLBTpjew6ftAd/XZJJQTMc0k mzz8OknntzChH/D3Dev42IxdMry8WLQ3bNEgLoaGhP271TTLslcC/Aom+uaAmg+zOGUCY4 hmfz2O1/jWx8bMEnAzpisaVnDikx6prPwXVa9EMARuK7AYqLBUfiF+KvrDnmhkg3v1DPnh E6mTQoCBb1Sw7fKIsKqH1jOt/FNsC7/tyYh+euAof4bd/paJOTTfXwPY8uxuWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805624; a=rsa-sha256; cv=none; b=eUnLCQHuuqqiH48eylFYGt0oSwNhMrEUWcac3wRHkJE4oXAQX6Z14BPW1GOJyakIlf6Lh9 p/g3y5/6XdI+EpmSCNW9j+QwYsXCY7ulAZepihXedcCtVH7DrOZcA8efOiMJU+QvOUIjqr b5uE5r2Q6p9fCOCwDYATC9+C/Fat6qSC6jvQdqKZCB6+rgSNMlX3lOEj/ev6YW37Ld5h79 vKeFWND4jnabRFL9WihH9frEq/mi+VTWzh4nuJUzBF8bSkH32epUeqDfXvzyTpxk4mlsiJ gXtIL/cVFcLq+PtLQlLYt8QhDqrD6UxMr1Ep7bJgeE5hOYSX2ktC/pHW89Ki2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzLf1HeWO2m+kWO26CIYQLHLp1oQSKkxD4AuPaj/lKs=; b=GRmn+0NbKXqiS4Vf18aXjPOtSRIxNEnwMPku6iPf/jY+giqiB+mEl00I1POCd+f+x1vEyd GvKzY7lEF3VubHt0wRg6Kg5SywAfOB/ATYDN0HcPKdyqHGLWVWtGZe3tfXKXzdIutRxbmI dKWW8ErG/vLCyM/H0L0E+TRGpklCY9BPnBC5uEgAWBAmLJoXyY6gbBmZlHI4sZE2pfH3G5 KxkJ/h1TDNc2GmblPxE/ThmUWwbJEsDBWW2EKva9QUp6W6afNw+ICyYLn4yspLjmS49FKa MzvpHBdFqsJ1n9wcXnL44aH+ZAnIlraE31xCNyQpLTdXBL52X9sqQXK+h13M9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltw66SGz1Bhh; Wed, 28 Aug 2024 00:40: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 47S0eO14064628; Wed, 28 Aug 2024 00:40:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eO4g064625; Wed, 28 Aug 2024 00:40:24 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:24 GMT Message-Id: <202408280040.47S0eO4g064625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c3cd4db461fd - stable/14 - amd64: add convenience wrappers for INVLPGB and TBLSYNC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3cd4db461fdb686b2aa3a199e7f1c8b89049208 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c3cd4db461fdb686b2aa3a199e7f1c8b89049208 commit c3cd4db461fdb686b2aa3a199e7f1c8b89049208 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:40:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: add convenience wrappers for INVLPGB and TBLSYNC (cherry picked from commit 111c7fc2fe21356a637f89fa58c407958f05ad93) --- sys/amd64/include/cpufunc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 44d93494d830..b9893b8896d8 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -529,6 +529,29 @@ invpcid(struct invpcid_descr *d, int type) : : "r" (d), "r" ((u_long)type) : "memory"); } +#define INVLPGB_VA 0x0001 +#define INVLPGB_PCID 0x0002 +#define INVLPGB_ASID 0x0004 +#define INVLPGB_GLOB 0x0008 +#define INVLPGB_FIN 0x0010 +#define INVLPGB_NEST 0x0020 + +#define INVLPGB_DESCR(asid, pcid) (((pcid) << 16) | (asid)) + +#define INVLPGB_2M_CNT (1u << 31) + +static __inline void +invlpgb(uint64_t rax, uint32_t edx, uint32_t ecx) +{ + __asm __volatile("invlpgb" : : "a" (rax), "d" (edx), "c" (ecx)); +} + +static __inline void +tlbsync(void) +{ + __asm __volatile("tlbsync"); +} + static __inline u_short rfs(void) { From nobody Wed Aug 28 00:40:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtlty2LtCz5MS6L; Wed, 28 Aug 2024 00:40: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 4Wtlty0XYDz47gm; Wed, 28 Aug 2024 00:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WmCASC4QVJEBicC+m409lsDAc9l7zMsTTIMwbRrTCGg=; b=YOzD8Ait3luVsuUX3e0drvlpICKDU7KCzFegJNXzZYeZOrkxggL2feXX8HzjJ5Tvwml7pz oTngdzTULom7zBIp+s6gJSNUdUta0wPLlI8vjxnNfv0QoXIPJHb+Ft7vZngTKqZfJyoUDC TvpfS5jHR0uZ2fRyB9Q0Mcfz9kD0pOyEhP2pO1NukMRFmkkZAKFGQhRlbFnW1UZrG2RCLL aFAChxsGk8aHX/rwo/smsBeQKxWtR8iOXP8g+vCsrS0+umwE9Y+2a3o5nuRoZTOok3JxtS kYuRQKRsnoJbM9hVkewnBn8UJYFeBEHUvcuLJDNH/xLrgGB4wFelLMVhYM+MdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805626; a=rsa-sha256; cv=none; b=LKDXZR7kZmz83d4Nq9WP4/jGYKA5sXdnO8AAPbrvHbyYJ9/iGpgIUWJDPXtL98zWexylKK CQTNIGuSQxGk3ndjDI6aVUJyNcEncE1JzNrsxA9EEp38qbBcnWsAnq4jDeS2bfrHwa2Ein o4dTv030ej64jSO3mvba2LndF9U+Wo4f5N5jwDwS8vbqHPytxU5v0ee0x/dqQa0G7Kdxxn do44k6+CWKPfhDHrLangTvF4MgpwfLDbxSnqoEj3GVEP/Pm6h2Lu9JD3VQ388p2sb/08Zj Rmv/LRb7i1DEjVr1YM9xsi0ypgPPLAtrYJSsvIZEoGlLt4kAvQTevd3UNysUXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WmCASC4QVJEBicC+m409lsDAc9l7zMsTTIMwbRrTCGg=; b=jKAsdtArhVfEomd2fIC04SPqoKe+WK3RCSMa3aP2IoZtz1y8tvU2jfh7IjL/iHv3PqEm6a 8z1SreM2FW4OwoBI3xe06eAW0n6OJA+p1Y9oABDcGfd5Loc1GujEeIcsloNmq+F8IbprmF mjMnCKPU2qV85/UgFF4e+yF5V3A68ZZfFqou0brR4WOPxblOtOMuk1oVdSq+5MSaJ0i1do e0fcBZRm2da6CzZCOJnSzzuX9++1qK/wp6aJjOIgYGwftuxNxe/s/hu6oztGY1UpuEdOOS +8hnz8yXewk0Vz+hfuKcAwHZ1f0Glt8J/Wq5BJbMguZPNMoW25yHlINjDf0JzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltx6sS9z1Bf7; Wed, 28 Aug 2024 00:40: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 47S0ePdv064673; Wed, 28 Aug 2024 00:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0ePwZ064670; Wed, 28 Aug 2024 00:40:25 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:25 GMT Message-Id: <202408280040.47S0ePwZ064670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23117748f297 - stable/14 - amd64: add variables indicating INVLPGB works List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23117748f29793915905d14a2868916e7f06c0b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23117748f29793915905d14a2868916e7f06c0b7 commit 23117748f29793915905d14a2868916e7f06c0b7 Author: Konstantin Belousov AuthorDate: 2024-05-13 22:41:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: add variables indicating INVLPGB works (cherry picked from commit bc4ffcadf2681c954444e1853200dca3f5e65676) --- sys/amd64/amd64/machdep.c | 6 ++++++ sys/amd64/amd64/pmap.c | 4 ++++ sys/amd64/include/pmap.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index f5c49c6ca243..83a57ad3316f 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1488,6 +1488,12 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) finishidentcpu(); /* Final stage of CPU initialization */ + invlpgb_works = (amd_extended_feature_extensions & + AMDFEID_INVLPGB) != 0; + TUNABLE_INT_FETCH("vm.pmap.invlpgb_works", &invlpgb_works); + if (invlpgb_works) + invlpgb_maxcnt = cpu_procinfo3 & AMDID_INVLPGB_MAXCNT; + /* * Initialize the clock before the console so that console * initialization can use DELAY(). diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0d364dec7c82..f23488a2174d 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -552,6 +552,10 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, int invpcid_works = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0, "Is the invpcid instruction available ?"); +int invlpgb_works; +SYSCTL_INT(_vm_pmap, OID_AUTO, invlpgb_works, CTLFLAG_RD, &invlpgb_works, 0, + "Is the invlpgb instruction available?"); +int invlpgb_maxcnt; int pmap_pcid_invlpg_workaround = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_invlpg_workaround, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 506b28562bcc..0e989de558b3 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -427,6 +427,8 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int invlpgb_works; +extern int invlpgb_maxcnt; extern int pmap_pcid_invlpg_workaround; extern int pmap_pcid_invlpg_workaround_uena; From nobody Wed Aug 28 00:40:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtltz2sP3z5MS8l; Wed, 28 Aug 2024 00:40: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 4Wtltz1QzRz47mq; Wed, 28 Aug 2024 00:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TDO5C0ysbjDP8fQBntCvTLc6U4PMoxs7ch2eV8AWjfs=; b=rPrOXsaFpXXIogwc32PmRchxbg/oTQOGlypFk9yAJCI2AqvhrP1LW0rhqZOWKXGnCy2bvG lnwoy4d2EQqfy3GWww9jfIA+XwKfGSE0wtjWxuVqvIV7ZAoCKMmeOPk1Sol8FHnQU7mzgt tdSUEGvJPRYQS5iRTDznnVm8a4zQssVT0XbuRE22r3tV9FPt8YCD4QB0avhMAsBiUo3Z3m Gs/lB5HLVmZNKGUVoHcBpRgYghC+F2vWtKn2oV2SFhvbSH2Enu4D7G4mMJarZci0ygFOCH 9w6DyLkFllRiKY0WFGReN8Z+BQZASrER1mzHh3fUbipuX9hRUUEYrgDILnfWcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724805627; a=rsa-sha256; cv=none; b=C5pW9+GWcFEIXFwfkUcecJkZjRhzTUYXNPQX+K9HihyPnbnoUnT+auZokRr6FaQ3sUeXQv jwILPzWS+Y4sW9/DI2Dm7Um1PZCdYBvUePckyLl+wf5eU3bBgzlioxwjm1/um3zuwxzsUb UQ4S+9jh7KYYtk83sbbDwC/GGHKhjeGjPsRlRq9/aynRUbOxxgGuNtnmEBPC46jvj+9HuE E3rZYYdIZthe7hakQvGNkGgTi1NptkI6BpcjX1O5hbmsvq5I8t3GrKxI4h5GIkr+zUVnhH cvCHB/tMZ/a77Ru+rC7GGpdNT0w38hIpxo3krocqpOmmnrO0ytyerZANGXaecA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724805627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TDO5C0ysbjDP8fQBntCvTLc6U4PMoxs7ch2eV8AWjfs=; b=IAJqa3PhaHCnfRSi7zZer5At01eBq1pe8C/WzF7/wFJ6zC41yoLv6N3aXhzVrBRcOHdE+o Elll4Vxl5wq4DHmrZv3a75cR3bVcEa78/GbpGaVdVpKDkcfhSfoo5UjbzKpIGF67TKl6BF TDszjYQtHcLuZQxe27d0BDX8iVKTKPCjrdEerJAww+FxUWNdG59tmCNdZtuh8HuYQ2hBvc a5lLj60PdLlhXQmgvNFVVffE+a9qehgiY8bbuWHEZnEO9TALyUFo4Vmq5sC0sDuhLD263Z zq+Yxb6Mq2cM8xEal1GPqNl8TAE2lwH5rWu+/g2VgqtPEcqjA5kfafww1tEgxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtltz0lcWz1Bf8; Wed, 28 Aug 2024 00:40: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 47S0eRRi064721; Wed, 28 Aug 2024 00:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S0eRUl064718; Wed, 28 Aug 2024 00:40:27 GMT (envelope-from git) Date: Wed, 28 Aug 2024 00:40:27 GMT Message-Id: <202408280040.47S0eRUl064718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 43605618aafa - stable/14 - amd64: use INVLPGB for kernel pmap invalidations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 43605618aafa834cbd18f91f19f2565584a7fa5f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43605618aafa834cbd18f91f19f2565584a7fa5f commit 43605618aafa834cbd18f91f19f2565584a7fa5f Author: Konstantin Belousov AuthorDate: 2024-05-13 22:42:08 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 00:26:34 +0000 amd64: use INVLPGB for kernel pmap invalidations (cherry picked from commit 47656cc1ef1cac307f24de88a4fe23a1389af44e) --- sys/amd64/amd64/mp_machdep.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 91737637b714..12abb8b6bf8b 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -679,6 +679,20 @@ local_cb: void smp_masked_invltlb(pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + invlpgb(INVLPGB_GLOB, 0, 0); + + /* + * TLBSYNC syncs only against INVLPGB executed on the + * same CPU. Since current thread is pinned by + * caller, we do not need to enter critical section to + * prevent migration. + */ + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, 0, 0, curcpu_cb, invl_op_tlb); #ifdef COUNT_XINVLTLB_HITS ipi_global++; @@ -688,6 +702,13 @@ smp_masked_invltlb(pmap_t pmap, smp_invl_cb_t curcpu_cb) void smp_masked_invlpg(vm_offset_t addr, pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + invlpgb(INVLPGB_GLOB | INVLPGB_VA | trunc_page(addr), 0, 0); + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, addr, 0, curcpu_cb, invl_op_pg); #ifdef COUNT_XINVLTLB_HITS ipi_page++; @@ -698,6 +719,39 @@ void smp_masked_invlpg_range(vm_offset_t addr1, vm_offset_t addr2, pmap_t pmap, smp_invl_cb_t curcpu_cb) { + if (invlpgb_works && pmap == kernel_pmap) { + vm_offset_t va; + uint64_t cnt, total; + + addr1 = trunc_page(addr1); + addr2 = round_page(addr2); + total = atop(addr2 - addr1); + for (va = addr1; total > 0;) { + if ((va & PDRMASK) != 0 || total < NPDEPG) { + cnt = atop(NBPDR - (va & PDRMASK)); + if (cnt > total) + cnt = total; + if (cnt > invlpgb_maxcnt + 1) + cnt = invlpgb_maxcnt + 1; + invlpgb(INVLPGB_GLOB | INVLPGB_VA | va, 0, + cnt - 1); + va += ptoa(cnt); + total -= cnt; + } else { + cnt = total / NPTEPG; + if (cnt > invlpgb_maxcnt + 1) + cnt = invlpgb_maxcnt + 1; + invlpgb(INVLPGB_GLOB | INVLPGB_VA | va, 0, + INVLPGB_2M_CNT | (cnt - 1)); + va += cnt << PDRSHIFT; + total -= cnt * NPTEPG; + } + } + tlbsync(); + sched_unpin(); + return; + } + smp_targeted_tlb_shootdown(pmap, addr1, addr2, curcpu_cb, invl_op_pgrng); #ifdef COUNT_XINVLTLB_HITS From nobody Wed Aug 28 07:31:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wtx0t5k0Wz5PWbV; Wed, 28 Aug 2024 07:31: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 4Wtx0t5D7Kz4gfV; Wed, 28 Aug 2024 07:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724830270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C1Wwz95sQlBROezyh9+sMRdPvCrSHTgdnFLsvcdfV3c=; b=f/h3s4Hcni8PUzO4p4H1ontsqN4gyxqHPNNIPZA0qgkstVzLV1NTLRCY6KT2fLT1i18o1S mO2tck5xsbjeJuESRijgusBHG0U1LG2XJNicOjj+NIWw+4BNly9PboGtEJynqz7pTdT8ro 4rn1g+HGP1ky9J4zkt0QDo+4rEgJnS822XAxFN7KKLBMOOpKHsp2H8AZ1j5T/pLBdjLN0D 6Oo0wwBpx0ZXYJdHSyfdbE7iCIl5gHNMiP6ANr17B3vnpHy7RA+7jG1gTMrPMbQv6cA8p8 vDLZIl7I5jrkMypYBreo9TnQPkuyyiijT0kWjFEwwkf+Xt3Io/6CPWjZdE7LrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724830270; a=rsa-sha256; cv=none; b=DGoLpkmLcOD9qxOCioeXwkRUpBnWx6c16ehl+74Qfd/0HM7ovNmoDHqZf1s3D5PGsDDBI9 So+vFn9ZL6+zOAcotywoBpa3B7hPzuRuRaBtVu0OB0wPtMyJknVwLm2bQX4+3+LdxDf8qw dy8OLI47aOc3JFO3mX0yssx8oplNXDKGeGlmprkD2XZxQv9TeBO/pKO33SYjna3xmd1qNy N9/XOfF/ECaazRSLk1pAW/3b/kHNrQImzqG3m/FCCRupg+WjlHTCxXuRWMHpvnA0SqrppM /ar9RJpcbFmzCCzn9BYjsrQf5Au/vkCDTqTLvPw2IsiQqTYwlPcgPwBMRHUP4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724830270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C1Wwz95sQlBROezyh9+sMRdPvCrSHTgdnFLsvcdfV3c=; b=kX2+ipPqC0oSBLWs0ujmjg5kmRRrXgMNcyOR45wUjcLOHvuiDMCrOSfPeSYLew2uOKTCiE aLiUAHTjm9jxc4pFzWa4Nbb/AAv/OkaPbSxG/tTWB52xThyXTH8Xkt4CdfydNKJm1h5lNH 8Q8wgZiI2KHkUvYy1yYRaBfxtD1YTFijU3QtPmvTG+0FPNxDqny7IzTJjSkBd37qVwsotc fqvut217mUxwGdd2ic1l1PQca7bnHP8lbjr9kSb2isa9wXF/TNxUAuGy5ouoNo+yFCbiB2 GqhB3YFa3Qn/QlneKBq9BgxPLRxXWRM5kWbgh7AD4Pv8I8HsUpJUeOIFEyZ8Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wtx0t4pk1zPRC; Wed, 28 Aug 2024 07:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47S7VA0v062807; Wed, 28 Aug 2024 07:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47S7VAcD062804; Wed, 28 Aug 2024 07:31:10 GMT (envelope-from git) Date: Wed, 28 Aug 2024 07:31:10 GMT Message-Id: <202408280731.47S7VAcD062804@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: 84f46335ab5d - main - linuxkpi: chase spinlock_t in DECLARE_WAIT_QUEUE_HEAD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 84f46335ab5da086c74032579799c0a74aa27447 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=84f46335ab5da086c74032579799c0a74aa27447 commit 84f46335ab5da086c74032579799c0a74aa27447 Author: Evgenii Khramtsov <2khramtsov@gmail.com> AuthorDate: 2024-08-27 11:21:39 +0000 Commit: Emmanuel Vadot CommitDate: 2024-08-28 07:29:40 +0000 linuxkpi: chase spinlock_t in DECLARE_WAIT_QUEUE_HEAD Remove member m to unbreak consumers, e.g. drm-kmod 5.10-lts branch. [...] /tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no member named 'm' in 'struct mtx' 38 | static DECLARE_WAIT_QUEUE_HEAD(exit_q); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/src/sys/compat/linuxkpi/common/include/linux/wait.h:113:33: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD' 113 | MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/src/sys/sys/mutex.h:528:4: note: expanded from macro 'MTX_SYSINIT' 528 | (mtx), \ | ^~~ /tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no member named 'm' in 'struct mtx' 38 | static DECLARE_WAIT_QUEUE_HEAD(exit_q); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/src/sys/compat/linuxkpi/common/include/linux/wait.h:113:33: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD' 113 | MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [...] Fixes: ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code") MFC after: ? --- sys/compat/linuxkpi/common/include/linux/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h index b815050b6faa..309c7816aa7b 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait.h +++ b/sys/compat/linuxkpi/common/include/linux/wait.h @@ -110,7 +110,7 @@ extern wait_queue_func_t default_wake_function; wait_queue_head_t name = { \ .task_list = LINUX_LIST_HEAD_INIT(name.task_list), \ }; \ - MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF) + MTX_SYSINIT(name, &(name).lock, spin_lock_name("wqhead"), MTX_DEF) #define init_waitqueue_head(wqh) do { \ mtx_init(&(wqh)->lock, spin_lock_name("wqhead"), \ From nobody Wed Aug 28 12:34:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv3l73kWSz5T9nW; Wed, 28 Aug 2024 12:34: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 4Wv3l73LlVz46mf; Wed, 28 Aug 2024 12:34:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724848483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yN9jyQOyMN/e/XaIMu1eY9wQZFbuAoEeMsRJMjJBXFw=; b=vuQkODWoCwTbfXtaIlUaZRMCMbKoQzTuyfOXbQXloUbQ5mH6i/kyqP0hoxo7ON5XmBB2TI pafDgyn5MYO+mbleRlsePPqWqjMP3tSq3hSBPWvoIq32Of/KHtQSzzqxqkO1cma0732w1E w6/uu1gqylC9hJtcxNjSM9os2sv7yYLUGd7kmkustLhmBKHURav4Yl6jbGnAUmiT3niLj5 CpjCDeSwx+9QoRc2U5NvNZ7kVi7NTlXtocEnHs2qNrCRdcVJ1ktJZgdQju1phagSn2yX3E kB72yATv/8deHpDCa0f329x6e+eagttLCSqJI8zUhSHGZ0j30B6cbJmXBAIYGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724848483; a=rsa-sha256; cv=none; b=hhAoRxlJIzTD7ib4Kq1HS/3kw6OKy64Ihu1JRkB232oyTbLDrcnbvrAKPWVSlDXeSR8sWV xui5vq0kV6JQn2y7+bz7ZtN+yAPwn/2GXQrs2cqskcBMNBl9eOpKX15OGU6yrOnc+dKmI9 arIhNwXnYexr1saoUDX9d75Hsz0lJNk5Q0z1NRyqt81d6SX71+ETi3V2RbnDG9qHSfJh1X LobopWfPpf/FXS0Kq/ljVj//Cch+94ScrrSPl+QD6tvntxKAMnGRLEITvQmaGBqBfZR4+u 8qoJWZ6dQMlp9jqcOIYx9da+mn8NnsTIRTvYPwiYq5F/Cw7xY1+CQXit0XuMxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724848483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yN9jyQOyMN/e/XaIMu1eY9wQZFbuAoEeMsRJMjJBXFw=; b=E9xi/j9FaRfnUV7OH9K3GAQxIDnCw9Mw26KAiehd39UI3HfdctWEt+HIspMc+tLCTiK/8r lD7fAJ+d/qMZgS8Y5rUiVGNS53bFruAlZ6aCTpaoe0Fle872SbLGl4kjQkjmmuONBT0XVX ywMfYUhGEz7cEtj8Tix4pd5f8ZGpYxltgmR0zq+YddpRrA7qdc6VaCsGENQ1LtkjGCRDp9 +9iys3S9SHQXHk9SsLF6SRMENSHfGBjuyIPUiNUiJyR8st5pJdV+wHPg0emfri2adCC7wk Pzh/LIWyED6oeAtTup1uW3GisaL9sB7cM4jknNCwwXDjLLvNZoC5KxUOPUGuPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv3l72rRszYfJ; Wed, 28 Aug 2024 12:34: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 47SCYhA0078262; Wed, 28 Aug 2024 12:34:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SCYhXn078259; Wed, 28 Aug 2024 12:34:43 GMT (envelope-from git) Date: Wed, 28 Aug 2024 12:34:43 GMT Message-Id: <202408281234.47SCYhXn078259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b1c3a4d75f4f - main - netipsec: add probe points for the ipsec/esp/ah/ipcomp counters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1c3a4d75f4ff74218434a11cdd4e56632e13711 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b1c3a4d75f4ff74218434a11cdd4e56632e13711 commit b1c3a4d75f4ff74218434a11cdd4e56632e13711 Author: Kristof Provost AuthorDate: 2024-08-22 14:41:32 +0000 Commit: Kristof Provost CommitDate: 2024-08-28 10:02:45 +0000 netipsec: add probe points for the ipsec/esp/ah/ipcomp counters Extend what we did for netinet counters in 60d8dbbef075 (netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters, 2024-01-18) to the IPsec code. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46416 --- sys/netinet/in_kdtrace.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ sys/netinet/in_kdtrace.h | 82 +++++++++++++++++++++++++++++++++++++++ sys/netipsec/ah_var.h | 13 ++++++- sys/netipsec/esp_var.h | 14 ++++++- sys/netipsec/ipcomp_var.h | 14 ++++++- sys/netipsec/ipsec.h | 10 ++++- sys/netipsec/xform_ah.c | 4 +- sys/netipsec/xform_esp.c | 8 ++-- sys/netipsec/xform_ipcomp.c | 4 +- 9 files changed, 226 insertions(+), 16 deletions(-) diff --git a/sys/netinet/in_kdtrace.c b/sys/netinet/in_kdtrace.c index 219bc6482910..bfa57bd8bf1e 100644 --- a/sys/netinet/in_kdtrace.c +++ b/sys/netinet/in_kdtrace.c @@ -341,6 +341,99 @@ MIB_PROBE_TCP(tcps_tlpresend_bytes); MIB_PROBE_TCP(tcps_rcvghostack); MIB_PROBE_TCP(tcps_rcvacktooold); + +#define MIB_PROBE_IPSEC(name) SDT_PROBE_DEFINE1(mib, ipsec, count, name, "int") + +MIB_PROBE_IPSEC(ips_in_polvio); +MIB_PROBE_IPSEC(ips_in_nomem); +MIB_PROBE_IPSEC(ips_in_inval); +MIB_PROBE_IPSEC(ips_out_polvio); +MIB_PROBE_IPSEC(ips_out_nosa); +MIB_PROBE_IPSEC(ips_out_nomem); +MIB_PROBE_IPSEC(ips_out_noroute); +MIB_PROBE_IPSEC(ips_out_inval); +MIB_PROBE_IPSEC(ips_out_bundlesa); + +MIB_PROBE_IPSEC(ips_spdcache_hits); +MIB_PROBE_IPSEC(ips_spdcache_misses); + +MIB_PROBE_IPSEC(ips_clcopied); +MIB_PROBE_IPSEC(ips_mbinserted); +MIB_PROBE_IPSEC(ips_input_front); +MIB_PROBE_IPSEC(ips_input_middle); +MIB_PROBE_IPSEC(ips_input_end); + +#define MIB_PROBE_ESP(name) SDT_PROBE_DEFINE1(mib, esp, count, name, "int") +#define MIB_PROBE2_ESP(name) SDT_PROBE_DEFINE2(mib, esp, count, name, "int", "int") + +MIB_PROBE_ESP(esps_hdrops); +MIB_PROBE_ESP(esps_nopf); +MIB_PROBE_ESP(esps_notdb); +MIB_PROBE_ESP(esps_badkcr); +MIB_PROBE_ESP(esps_qfull); +MIB_PROBE_ESP(esps_noxform); +MIB_PROBE_ESP(esps_badilen); +MIB_PROBE_ESP(esps_wrap); +MIB_PROBE_ESP(esps_badenc); +MIB_PROBE_ESP(esps_badauth); +MIB_PROBE_ESP(esps_replay); +MIB_PROBE_ESP(esps_input); +MIB_PROBE_ESP(esps_output); +MIB_PROBE_ESP(esps_invalid); +MIB_PROBE_ESP(esps_ibytes); +MIB_PROBE_ESP(esps_obytes); +MIB_PROBE_ESP(esps_toobig); +MIB_PROBE_ESP(esps_pdrops); +MIB_PROBE_ESP(esps_crypto); +MIB_PROBE_ESP(esps_tunnel); +MIB_PROBE2_ESP(esps_hist); + +#define MIB_PROBE_AH(name) SDT_PROBE_DEFINE1(mib, ah, count, name, "int") +#define MIB_PROBE_AH2(name) SDT_PROBE_DEFINE2(mib, ah, count, name, "int", "int") + +MIB_PROBE_AH(ahs_hdrops); +MIB_PROBE_AH(ahs_nopf); +MIB_PROBE_AH(ahs_notdb); +MIB_PROBE_AH(ahs_badkcr); +MIB_PROBE_AH(ahs_badauth); +MIB_PROBE_AH(ahs_noxform); +MIB_PROBE_AH(ahs_qfull); +MIB_PROBE_AH(ahs_wrap); +MIB_PROBE_AH(ahs_replay); +MIB_PROBE_AH(ahs_badauthl); +MIB_PROBE_AH(ahs_input); +MIB_PROBE_AH(ahs_output); +MIB_PROBE_AH(ahs_invalid); +MIB_PROBE_AH(ahs_ibytes); +MIB_PROBE_AH(ahs_obytes); +MIB_PROBE_AH(ahs_toobig); +MIB_PROBE_AH(ahs_pdrops); +MIB_PROBE_AH(ahs_crypto); +MIB_PROBE_AH(ahs_tunnel); +MIB_PROBE_AH2(ahs_hist); + +#define MIB_PROBE_IPCOMP(name) SDT_PROBE_DEFINE1(mib, ipcomp, count, name, "int") +#define MIB_PROBE_IPCOMP2(name) SDT_PROBE_DEFINE2(mib, ipcomp, count, name, "int", "int") + +MIB_PROBE_IPCOMP(ipcomps_hdrops); +MIB_PROBE_IPCOMP(ipcomps_nopf); +MIB_PROBE_IPCOMP(ipcomps_notdb); +MIB_PROBE_IPCOMP(ipcomps_badkcr); +MIB_PROBE_IPCOMP(ipcomps_qfull); +MIB_PROBE_IPCOMP(ipcomps_noxform); +MIB_PROBE_IPCOMP(ipcomps_wrap); +MIB_PROBE_IPCOMP(ipcomps_input); +MIB_PROBE_IPCOMP(ipcomps_output); +MIB_PROBE_IPCOMP(ipcomps_invalid); +MIB_PROBE_IPCOMP(ipcomps_ibytes); +MIB_PROBE_IPCOMP(ipcomps_obytes); +MIB_PROBE_IPCOMP(ipcomps_toobig); +MIB_PROBE_IPCOMP(ipcomps_pdrops); +MIB_PROBE_IPCOMP(ipcomps_crypto); +MIB_PROBE_IPCOMP2(ipcomps_hist); +MIB_PROBE_IPCOMP(ipcomps_threshold); +MIB_PROBE_IPCOMP(ipcomps_uncompr); + #endif SDT_PROBE_DEFINE6_XLATE(ip, , , receive, diff --git a/sys/netinet/in_kdtrace.h b/sys/netinet/in_kdtrace.h index 22f181974f93..3fb82ad961dd 100644 --- a/sys/netinet/in_kdtrace.h +++ b/sys/netinet/in_kdtrace.h @@ -333,6 +333,88 @@ SDT_PROBE_DECLARE(mib, tcp, count, tcps_tlpresend_bytes); SDT_PROBE_DECLARE(mib, tcp, count, tcps_rcvghostack); SDT_PROBE_DECLARE(mib, tcp, count, tcps_rcvacktooold); + +SDT_PROBE_DECLARE(mib, ipsec, count, ips_in_polvio); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_in_nomem); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_in_inval); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_out_polvio); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_out_nosa); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_out_nomem); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_out_noroute); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_out_inval); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_out_bundlesa); + +SDT_PROBE_DECLARE(mib, ipsec, count, ips_spdcache_hits); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_spdcache_misses); + +SDT_PROBE_DECLARE(mib, ipsec, count, ips_clcopied); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_mbinserted); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_input_front); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_input_middle); +SDT_PROBE_DECLARE(mib, ipsec, count, ips_input_end); + +SDT_PROBE_DECLARE(mib, esp, count, esps_hdrops); +SDT_PROBE_DECLARE(mib, esp, count, esps_nopf); +SDT_PROBE_DECLARE(mib, esp, count, esps_notdb); +SDT_PROBE_DECLARE(mib, esp, count, esps_badkcr); +SDT_PROBE_DECLARE(mib, esp, count, esps_qfull); +SDT_PROBE_DECLARE(mib, esp, count, esps_noxform); +SDT_PROBE_DECLARE(mib, esp, count, esps_badilen); +SDT_PROBE_DECLARE(mib, esp, count, esps_wrap); +SDT_PROBE_DECLARE(mib, esp, count, esps_badenc); +SDT_PROBE_DECLARE(mib, esp, count, esps_badauth); +SDT_PROBE_DECLARE(mib, esp, count, esps_replay); +SDT_PROBE_DECLARE(mib, esp, count, esps_input); +SDT_PROBE_DECLARE(mib, esp, count, esps_output); +SDT_PROBE_DECLARE(mib, esp, count, esps_invalid); +SDT_PROBE_DECLARE(mib, esp, count, esps_ibytes); +SDT_PROBE_DECLARE(mib, esp, count, esps_obytes); +SDT_PROBE_DECLARE(mib, esp, count, esps_toobig); +SDT_PROBE_DECLARE(mib, esp, count, esps_pdrops); +SDT_PROBE_DECLARE(mib, esp, count, esps_crypto); +SDT_PROBE_DECLARE(mib, esp, count, esps_tunnel); +SDT_PROBE_DECLARE(mib, esp, count, esps_hist); + +SDT_PROBE_DECLARE(mib, ah, count, ahs_hdrops); +SDT_PROBE_DECLARE(mib, ah, count, ahs_nopf); +SDT_PROBE_DECLARE(mib, ah, count, ahs_notdb); +SDT_PROBE_DECLARE(mib, ah, count, ahs_badkcr); +SDT_PROBE_DECLARE(mib, ah, count, ahs_badauth); +SDT_PROBE_DECLARE(mib, ah, count, ahs_noxform); +SDT_PROBE_DECLARE(mib, ah, count, ahs_qfull); +SDT_PROBE_DECLARE(mib, ah, count, ahs_wrap); +SDT_PROBE_DECLARE(mib, ah, count, ahs_replay); +SDT_PROBE_DECLARE(mib, ah, count, ahs_badauthl); +SDT_PROBE_DECLARE(mib, ah, count, ahs_input); +SDT_PROBE_DECLARE(mib, ah, count, ahs_output); +SDT_PROBE_DECLARE(mib, ah, count, ahs_invalid); +SDT_PROBE_DECLARE(mib, ah, count, ahs_ibytes); +SDT_PROBE_DECLARE(mib, ah, count, ahs_obytes); +SDT_PROBE_DECLARE(mib, ah, count, ahs_toobig); +SDT_PROBE_DECLARE(mib, ah, count, ahs_pdrops); +SDT_PROBE_DECLARE(mib, ah, count, ahs_crypto); +SDT_PROBE_DECLARE(mib, ah, count, ahs_tunnel); +SDT_PROBE_DECLARE(mib, ah, count, ahs_hist); + +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_hdrops); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_nopf); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_notdb); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_badkcr); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_qfull); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_noxform); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_wrap); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_input); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_output); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_invalid); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_ibytes); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_obytes); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_toobig); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_pdrops); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_crypto); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_hist); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_threshold); +SDT_PROBE_DECLARE(mib, ipcomp, count, ipcomps_uncompr); + #endif SDT_PROBE_DECLARE(ip, , , receive); diff --git a/sys/netipsec/ah_var.h b/sys/netipsec/ah_var.h index 7f784a7ddeb3..c77113cf8258 100644 --- a/sys/netipsec/ah_var.h +++ b/sys/netipsec/ah_var.h @@ -71,13 +71,22 @@ struct ahstat { #ifdef _KERNEL #include +#include VNET_DECLARE(int, ah_enable); VNET_DECLARE(int, ah_cleartos); VNET_PCPUSTAT_DECLARE(struct ahstat, ahstat); -#define AHSTAT_ADD(name, val) \ - VNET_PCPUSTAT_ADD(struct ahstat, ahstat, name , (val)) +#define AHSTAT_ADD(name, val) \ + do { \ + MIB_SDT_PROBE1(ah, count, name, (val)); \ + VNET_PCPUSTAT_ADD(struct ahstat, ahstat, name, (val)); \ + } while (0) +#define AHSTAT_INC2(name, type) \ + do { \ + MIB_SDT_PROBE2(ah, count, name, 1, (type)); \ + VNET_PCPUSTAT_ADD(struct ahstat, ahstat, name[type], 1); \ + } while (0) #define AHSTAT_INC(name) AHSTAT_ADD(name, 1) #define V_ah_enable VNET(ah_enable) #define V_ah_cleartos VNET(ah_cleartos) diff --git a/sys/netipsec/esp_var.h b/sys/netipsec/esp_var.h index c1f492913107..3490bf2e3c40 100644 --- a/sys/netipsec/esp_var.h +++ b/sys/netipsec/esp_var.h @@ -72,15 +72,25 @@ struct espstat { #ifdef _KERNEL #include +#include VNET_DECLARE(int, esp_enable); VNET_DECLARE(int, esp_ctr_compatibility); #define V_esp_ctr_compatibility VNET(esp_ctr_compatibility) VNET_PCPUSTAT_DECLARE(struct espstat, espstat); -#define ESPSTAT_ADD(name, val) \ - VNET_PCPUSTAT_ADD(struct espstat, espstat, name, (val)) +#define ESPSTAT_ADD(name, val) \ + do { \ + MIB_SDT_PROBE1(esp, count, name, (val)); \ + VNET_PCPUSTAT_ADD(struct espstat, espstat, name, (val)); \ + } while (0) #define ESPSTAT_INC(name) ESPSTAT_ADD(name, 1) +#define ESPSTAT_INC2(name, type) \ + do { \ + MIB_SDT_PROBE2(esp, count, name, 1, (type)); \ + VNET_PCPUSTAT_ADD(struct espstat, espstat, name[type], 1); \ + } while (0) + #define V_esp_enable VNET(esp_enable) #endif /* _KERNEL */ #endif /*_NETIPSEC_ESP_VAR_H_*/ diff --git a/sys/netipsec/ipcomp_var.h b/sys/netipsec/ipcomp_var.h index 396af64b57a2..3af4a3c199e4 100644 --- a/sys/netipsec/ipcomp_var.h +++ b/sys/netipsec/ipcomp_var.h @@ -66,12 +66,22 @@ struct ipcompstat { #ifdef _KERNEL #include +#include VNET_DECLARE(int, ipcomp_enable); VNET_PCPUSTAT_DECLARE(struct ipcompstat, ipcompstat); -#define IPCOMPSTAT_ADD(name, val) \ - VNET_PCPUSTAT_ADD(struct ipcompstat, ipcompstat, name, (val)) +#define IPCOMPSTAT_ADD(name, val) \ + do { \ + MIB_SDT_PROBE1(ipcomp, count, name, (val)); \ + VNET_PCPUSTAT_ADD(struct ipcompstat, ipcompstat, name, (val)); \ + } while (0) +#define IPCOMPSTAT_INC2(name, type) \ + do { \ + MIB_SDT_PROBE2(ipcomp, count, name, 1, (type)); \ + VNET_PCPUSTAT_ADD(struct ipcompstat, ipcompstat, name[type], \ + 1); \ + } while (0) #define IPCOMPSTAT_INC(name) IPCOMPSTAT_ADD(name, 1) #define V_ipcomp_enable VNET(ipcomp_enable) #endif /* _KERNEL */ diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h index 749813518092..8f3e8f02d88b 100644 --- a/sys/netipsec/ipsec.h +++ b/sys/netipsec/ipsec.h @@ -48,6 +48,8 @@ #include #include +#include + #define IPSEC_ASSERT(_c,_m) KASSERT(_c, _m) /* @@ -295,8 +297,12 @@ VNET_DECLARE(int, crypto_support); VNET_DECLARE(int, async_crypto); VNET_DECLARE(int, natt_cksum_policy); -#define IPSECSTAT_INC(name) \ - VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1) +#define IPSECSTAT_INC(name) \ + do { \ + MIB_SDT_PROBE1(ipsec, count, name, 1); \ + VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1); \ + } while (0) + #define V_ip4_esp_trans_deflev VNET(ip4_esp_trans_deflev) #define V_ip4_esp_net_deflev VNET(ip4_esp_net_deflev) #define V_ip4_ah_trans_deflev VNET(ip4_ah_trans_deflev) diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c index 4619ecaf8197..8f08872eb38a 100644 --- a/sys/netipsec/xform_ah.c +++ b/sys/netipsec/xform_ah.c @@ -731,7 +731,7 @@ ah_input_cb(struct cryptop *crp) error = crp->crp_etype; goto bad; } else { - AHSTAT_INC(ahs_hist[sav->alg_auth]); + AHSTAT_INC2(ahs_hist, sav->alg_auth); crypto_freereq(crp); /* No longer needed. */ crp = NULL; } @@ -1137,7 +1137,7 @@ ah_output_cb(struct cryptop *crp) free(xd, M_AH); crypto_freereq(crp); - AHSTAT_INC(ahs_hist[sav->alg_auth]); + AHSTAT_INC2(ahs_hist, sav->alg_auth); #ifdef REGRESSION /* Emulate man-in-the-middle attack when ipsec_integrity is TRUE. */ if (V_ipsec_integrity) { diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 599134f056ca..7aec10549e6c 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -548,12 +548,12 @@ esp_input_cb(struct cryptop *crp) error = EINVAL; goto bad; } - ESPSTAT_INC(esps_hist[sav->alg_enc]); + ESPSTAT_INC2(esps_hist, sav->alg_enc); /* If authentication was performed, check now. */ if (esph != NULL) { alen = xform_ah_authsize(esph); - AHSTAT_INC(ahs_hist[sav->alg_auth]); + AHSTAT_INC2(ahs_hist, sav->alg_auth); if (crp->crp_etype == EBADMSG) { DPRINTF(("%s: authentication hash mismatch for " "packet in SA %s/%08lx\n", __func__, @@ -1033,9 +1033,9 @@ esp_output_cb(struct cryptop *crp) free(xd, M_ESP); free(crp->crp_aad, M_ESP); crypto_freereq(crp); - ESPSTAT_INC(esps_hist[sav->alg_enc]); + ESPSTAT_INC2(esps_hist, sav->alg_enc); if (sav->tdb_authalgxform != NULL) - AHSTAT_INC(ahs_hist[sav->alg_auth]); + AHSTAT_INC2(ahs_hist, sav->alg_auth); #ifdef REGRESSION /* Emulate man-in-the-middle attack when ipsec_integrity is TRUE. */ diff --git a/sys/netipsec/xform_ipcomp.c b/sys/netipsec/xform_ipcomp.c index 9a8d132d564d..737d4a50098a 100644 --- a/sys/netipsec/xform_ipcomp.c +++ b/sys/netipsec/xform_ipcomp.c @@ -327,7 +327,7 @@ ipcomp_input_cb(struct cryptop *crp) error = EINVAL; goto bad; } - IPCOMPSTAT_INC(ipcomps_hist[sav->alg_comp]); + IPCOMPSTAT_INC2(ipcomps_hist, sav->alg_comp); clen = crp->crp_olen; /* Length of data after processing */ @@ -571,7 +571,7 @@ ipcomp_output_cb(struct cryptop *crp) error = EINVAL; goto bad; } - IPCOMPSTAT_INC(ipcomps_hist[sav->alg_comp]); + IPCOMPSTAT_INC2(ipcomps_hist, sav->alg_comp); if (crp->crp_payload_length > crp->crp_olen) { struct mbuf *mo; From nobody Wed Aug 28 12:55:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv4C057knz5TCPm; Wed, 28 Aug 2024 12:55:24 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 4Wv4C02PWDz49V9; Wed, 28 Aug 2024 12:55:24 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-81f96ea9ff7so331953239f.3; Wed, 28 Aug 2024 05:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724849722; x=1725454522; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=QotXNe++o8wiKrtjpoafXTKzxz3hjFp2pe1p5Pbjaiw=; b=aaGwJpeIhVVLhEeyQsKgrEUnWL2MqDB+lqyYt1M20GcMzqIZvTZN5BkCPRJ2+3CF8R xi6qbvselrYONuPULlGbXpmlZ+8ymxK5H8DjRNbHB33GOhHGE7VFhYVkPC0ULApHKXaw r6V2VIt5tHcBAe7RQgn70dp8LuUuYxw3qbRiOtIKY+SOTngjI0SL76EPwH6X2AywdyIh pFCidrQ2akHBjkMXyfwLUd15LFV6r3mS0Vhe87Fttq8sH8arIa7zQaY+KdqnkKFxDq2b pJ5kw3JmpiG17j+mk9lBWrX1fGfxMYafh74e5K0nFJNDJq0HhnZ9PZ1mLPq2zKp0QJSa TJvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724849722; x=1725454522; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QotXNe++o8wiKrtjpoafXTKzxz3hjFp2pe1p5Pbjaiw=; b=P5m3Y8QuMurh+N+CcrpzLt24Fv7bVK+wQSld8Tstt3kuScbpZuoNBXlmRnSNAMIBau pltZUUrbXyjAyUxNy1joKKiH4aC4zu7ZUseosqZ6M76QhqmfXQiR+IUF0uB7tmlUvF/I +eJp/+6LPtent+cEfzJJIJR7+8lXs6lhDxwsFfXl/wvV5Qq+3S/nqQIy56XDUnNj0SbI LKBO/0Ya4D7IfMZho3dH8Zwzypq6IcUTH4I+pdfqbLF3vOdC6tVcJmzQZW5MHigPji5j JdV9HeC/ud5e6J5YK3104xqSPCDrfeCtFYXAyDQytHry73VywWvwdePJxDb/gGkba4Up T3fw== X-Forwarded-Encrypted: i=1; AJvYcCU/+qsE48ax1Kr2UeI74UvYj2ddBLjmLw5iJZb6/uWFFClPVqDbuvDtkPF3qstgBhtjW+MGNf1OpxBZ+iSFiEebKlGu@freebsd.org, AJvYcCVk010LHF/bpGCjwaDnggrpYCX4WPyuZxugS+GXAoIGwW+eFjIYCMJ2mlLjP+YnwiEgqaRZ+IH7+frDAyw7E65QhGfDva8=@freebsd.org X-Gm-Message-State: AOJu0YzXTOlMQnYbHoSi4Bh/wtcD5KHOjYMFntYFilizt+5dm6btmLGh XYXQVOFyYb6vd40gzphKx0TLR8H0b11s3ZXpKqk6VW+TnqTzbUsDnZGwqg== X-Google-Smtp-Source: AGHT+IF4vbEaW5KLV7U3NdL30OufcTN4KOpxweFClcgLPUmqDXeRfgNeb4pH75UPJppMzPdSESktNQ== X-Received: by 2002:a05:6602:4c8b:b0:81f:b38c:3537 with SMTP id ca18e2360f4ac-8278732f8a4mr1653199839f.10.1724849722042; Wed, 28 Aug 2024 05:55:22 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ce710698c6sm3018957173.99.2024.08.28.05.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 05:55:21 -0700 (PDT) Date: Wed, 28 Aug 2024 08:55:19 -0400 From: Mark Johnston To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: fe66e4caf456 - main - rangelock: Disable cheat mode by default Message-ID: References: <202408272038.47RKc6Ga049071@gitrepo.freebsd.org> <9CF133C9-42AD-41EE-961E-FBD76DD5F592@freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9CF133C9-42AD-41EE-961E-FBD76DD5F592@freebsd.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Wv4C02PWDz49V9 On Tue, Aug 27, 2024 at 10:09:31PM +0100, Jessica Clarke wrote: > On 27 Aug 2024, at 21:38, Mark Johnston wrote: > > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fe66e4caf4561ee3349ad7a29cc9976108c3b04f > > > > commit fe66e4caf4561ee3349ad7a29cc9976108c3b04f > > Author: Mark Johnston > > AuthorDate: 2024-08-27 20:31:25 +0000 > > Commit: Mark Johnston > > CommitDate: 2024-08-27 20:36:31 +0000 > > > > rangelock: Disable cheat mode by default > > > > Cheat mode is incompatible with code which locks multiple ranges in the > > same vnode, with at least one range being write-locked. This can arise > > in kern_copy_file_range(). Until that's handled somehow, avoid the > > problem to make the fusefs tests stable. > > > > PR: 281073 > > Fixes: 9ef425e560a9 ("rangelocks: add fast cheating mode") > > Reviewed by: kib > > Differential Revision: https://reviews.freebsd.org/D46457 > > --- > > sys/kern/kern_rangelock.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c > > index 14163dd1c782..38449f71a8b7 100644 > > --- a/sys/kern/kern_rangelock.c > > +++ b/sys/kern/kern_rangelock.c > > @@ -66,7 +66,7 @@ > > * trylocks are same as normal locks but do not drain. > > */ > > > > -static int rangelock_cheat = 1; > > +static int rangelock_cheat = 0; > > This probably deserves a comment for why it’s disabled/the risks of > enabling it, and/or some text in the sysctl description? There's already a patch which aims to fix the underlying problem, https://reviews.freebsd.org/D46465, so I will hold off on making further changes here. > Jess > > > SYSCTL_INT(_debug, OID_AUTO, rangelock_cheat, CTLFLAG_RWTUN, > > &rangelock_cheat, 0, > > ""); > From nobody Wed Aug 28 14:49:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv6l93H00z52PgW; Wed, 28 Aug 2024 14:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wv6l90Mtvz4N9m; Wed, 28 Aug 2024 14:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gCEjEgrVuoaUiZEMykZ3+T9Vb0ujTEzIpBll+YnTZGE=; b=YthkF+eubMXD8Uhn+7ne5KXWQkMiaJzLwDs7Q7lLpxi6/rj4V1CctpnR7utgHnrcAw390Y PNUDQFuxFfwjTjWjbhkcxZi1q04Hl506CzKrSjndyCa/wq09+zs09uTd9mjv1NTyUd54et j+rKC0muL027RO6JWPo2QP3yG8sd0PGILmscVC+7xrhoEWWuGBVC4AZkXzo5fvbj51Hkce Ovif1NXoQnUKC0xqdL/ivnV4rkwt3e3SOPVlwzjZJuadbK7qhwiMrMjHLpwV4pDy21zVHA TI1pqkOSeaDJi8Ah40WUE0HQjAeJNLZNHP+lswfMtgdLi53O0758zLMJkOWZnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724856597; a=rsa-sha256; cv=none; b=YC+nYZvTwbLdDHviZCezkzIUHqlLhksNaRjua6Gy0/J3u+ykbhZzi7m6wtlaIhX+PEG7qH qNhq98K+os6KG5FiChSZT/bZTmIWqMRG3PA+1HNRDGJZBhz3m8zTlFUPL0HaOM0uERgTG1 R5pRj7sTnn6OeKMFy2V7CmIwJ7fKYDsBXCkZOIA5fhtP012I40NF/AIoWY74xrmjSuJUs/ gTgViKkVfPvhRFW1Xg0QXdXHBcnWtKsUnCqkQgGi7OOGr6y6Wv66vFECdP/5LqlF/MzCB5 XzuR0i7VaegZS0dp3twMgy4FdMHBWM9GbCQaXCjAx/ywlk5fPCLCW51eKYE0vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gCEjEgrVuoaUiZEMykZ3+T9Vb0ujTEzIpBll+YnTZGE=; b=vkIONiDmTbzjJis5Y3U+6Qd0tEv1TwpnwLYHlfmIOPursEOT+JuZJZI9ftxKZZPkqbiSZ5 xx9CaPfy5WsOIf5BSUY9348rzxIzEM1IPNcJTNVTAkVabo0v/389Lm6dKgzHlHcpxn0o9E a4KMLrc1QFvS0Sdlo2Gbpz0VFn/7aqyYBTy/Fqe45wF30ZZxBAwHc93EzShXynUri5qYz6 Za5ao6CmZerCGTOyq29X/5bFK97ZcCrEGClqjVOjyn0dVgxhkm8aMx2OiMuD5h5Jt2r6eS HeShqFxvo8LXPgjm3+nlKk5KhU7ClOb8GXSyguC44UJwVQIZ7kn7H4BKC/vGsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv6l86j7tzdc8; Wed, 28 Aug 2024 14:49: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 47SEnud7000038; Wed, 28 Aug 2024 14:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SEnu78000035; Wed, 28 Aug 2024 14:49:56 GMT (envelope-from git) Date: Wed, 28 Aug 2024 14:49:56 GMT Message-Id: <202408281449.47SEnu78000035@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: 75447afca868 - main - rangelocks: extract the cheat mode drain code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75447afca868f82f1c53c5be32dccd777813ec1a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=75447afca868f82f1c53c5be32dccd777813ec1a commit 75447afca868f82f1c53c5be32dccd777813ec1a Author: Konstantin Belousov AuthorDate: 2024-08-27 21:32:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 14:33:46 +0000 rangelocks: extract the cheat mode drain code Reviewed by: markj Tested by: lwhsu Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46465 --- sys/kern/kern_rangelock.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 38449f71a8b7..0e62b91b4ee7 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -82,6 +82,24 @@ SYSCTL_INT(_debug, OID_AUTO, rangelock_cheat, CTLFLAG_RWTUN, #define RL_RET_CHEAT_RLOCKED 0x1100 #define RL_RET_CHEAT_WLOCKED 0x2200 +static void +rangelock_cheat_drain(struct rangelock *lock) +{ + uintptr_t v; + + DROP_GIANT(); + for (;;) { + v = (uintptr_t)atomic_load_ptr(&lock->head); + if ((v & RL_CHEAT_DRAINING) == 0) + break; + sleepq_add(&lock->head, NULL, "ranged1", 0, 0); + sleepq_wait(&lock->head, PRI_USER); + sleepq_lock(&lock->head); + } + sleepq_release(&lock->head); + PICKUP_GIANT(); +} + static bool rangelock_cheat_lock(struct rangelock *lock, int locktype, bool trylock, void **cookie) @@ -99,17 +117,7 @@ drain: } sleepq_lock(&lock->head); drain1: - DROP_GIANT(); - for (;;) { - v = (uintptr_t)atomic_load_ptr(&lock->head); - if ((v & RL_CHEAT_DRAINING) == 0) - break; - sleepq_add(&lock->head, NULL, "ranged1", 0, 0); - sleepq_wait(&lock->head, PRI_USER); - sleepq_lock(&lock->head); - } - sleepq_release(&lock->head); - PICKUP_GIANT(); + rangelock_cheat_drain(lock); return (false); } From nobody Wed Aug 28 14:49:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv6lB2SQ2z52Ppb; Wed, 28 Aug 2024 14:49: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 4Wv6lB0r43z4NHL; Wed, 28 Aug 2024 14:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQ05eBOA197Ve+Wb/r+6omAuu0zH9oXizzN/mxeDcx0=; b=F8OSSE99E9h77OHIsat9c44KneAwqXMHqzZ0/8+vtnPKFLIBJel/0/Uua8CqCrAALIpjQR e7F3my6fP9PmbDUu+cu3YWgQ8zAsomERcaO0kt0OXi6z+a7j133hesOsX58Gf/iF32JqdR Z9Y7/dKTFLgq2aDCi+Twqbeuc1AJN7uKjPh7Z6kpGINgk2Bx4SebJkUaiYJXGu79ffAQ1L r3wti51JfWUNBubrNH10jdwzn5WgeUyEQEf8zXc8xBXJaR3eQQpS/LYca7Er7Xp+rqmr2m cdpoTFn12giKB7kOE3h7U465IFCmdLOgRw+RcS8pYk/wmJpku2UHbfAC385VFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724856598; a=rsa-sha256; cv=none; b=c5t0VovcCp6zXqP3e7w7rmYEADIszMwBfSwOocckNFZQn/0y7PvmzdQcsu8h10jT2mD8IB iehc9TGQYiy7JjtPKK9IUDCusIvqho6Q1BR3kRPw+m0X8mPE7pLTSKwaM7/8gNjef99Epj Kb/XeQessXOLGQuDa8u3aXIJtWhzdKWyfTIMj657kvLyJvav8Bvg1VVK6n0c+dyoPFKjoD t/YjaWAACyNl0gYr1jB4dAQ7bheGAb+n/FgtpfRfgyCA+m8qNzUBt4/y91EUr/ki4Dieek i09qtZKkWPHjSk4KXqIROoT+R39SD14GMqowvNZ/YHw+Y/FfX/XDgIDq1WLAWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQ05eBOA197Ve+Wb/r+6omAuu0zH9oXizzN/mxeDcx0=; b=SoIZhgbXSP1r5syjEHnOfHxT3MFrAK5UbG4Sf1ILvD06o0l4yJE9MH7+DkpgFZgsAuRq41 7RpqVPqICusrtL9RZxAqQVIMpzHZuy9uDcyFUzHrSA3o03zBQ98hh+eh2ag3z0CIXyG5Xy hZiJIw6LRTUOAGG36O/ToM7XrSjWTwKclQ4EhpCh49u70uBGb5E+kan+aGIZNrbaLIFIYf bWwvzhVx95lITavAoCMgUCX5gSqB8vxcFGM3QKA8/sigoMidUtNWjsj9gqTtYB9/hzztvt DdL7QZv/iSZtUxxwbPrwPaFVQPcGAyZc59FU1stZKIcunATlSVb+EO3VWWtkwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv6lB06ftzdtY; Wed, 28 Aug 2024 14:49: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 47SEnvJD000120; Wed, 28 Aug 2024 14:49:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SEnvLx000116; Wed, 28 Aug 2024 14:49:57 GMT (envelope-from git) Date: Wed, 28 Aug 2024 14:49:57 GMT Message-Id: <202408281449.47SEnvLx000116@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: 0b6b1c285920 - main - Add rangelock_may_recurse(9) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b6b1c285920563ba0c119d3190ac25af4731d02 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b6b1c285920563ba0c119d3190ac25af4731d02 commit 0b6b1c285920563ba0c119d3190ac25af4731d02 Author: Konstantin Belousov AuthorDate: 2024-08-27 21:33:38 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 14:33:58 +0000 Add rangelock_may_recurse(9) Reviewed by: markj Tested by: lwhsu Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46465 --- sys/kern/kern_rangelock.c | 41 +++++++++++++++++++++++++++++++++++++++++ sys/sys/rangelock.h | 1 + 2 files changed, 42 insertions(+) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 0e62b91b4ee7..4d74c02302e7 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -752,6 +752,47 @@ rangelock_trywlock(struct rangelock *lock, vm_ooffset_t start, vm_ooffset_t end) return (rangelock_lock_int(lock, true, start, end, RL_LOCK_WRITE)); } +/* + * If the caller asserts that it can obtain the range locks on the + * same lock simultaneously, switch to the non-cheat mode. Cheat mode + * cannot handle it, hanging in drain or trylock retries. + */ +void +rangelock_may_recurse(struct rangelock *lock) +{ + uintptr_t v, x; + + v = atomic_load_ptr(&lock->head); + if ((v & RL_CHEAT_CHEATING) == 0) + return; + + sleepq_lock(&lock->head); + for (;;) { + if ((v & RL_CHEAT_CHEATING) == 0) { + sleepq_release(&lock->head); + return; + } + + /* Cheating and locked, drain. */ + if ((v & RL_CHEAT_WLOCKED) != 0 || + (v & ~RL_CHEAT_MASK) >= RL_CHEAT_READER) { + x = v | RL_CHEAT_DRAINING; + if (atomic_fcmpset_ptr(&lock->head, &v, x) != 0) { + rangelock_cheat_drain(lock); + return; + } + continue; + } + + /* Cheating and unlocked, clear RL_CHEAT_CHEATING. */ + x = 0; + if (atomic_fcmpset_ptr(&lock->head, &v, x) != 0) { + sleepq_release(&lock->head); + return; + } + } +} + #ifdef INVARIANT_SUPPORT void _rangelock_cookie_assert(void *cookie, int what, const char *file, int line) diff --git a/sys/sys/rangelock.h b/sys/sys/rangelock.h index 127f101ddc2e..accf33d7296b 100644 --- a/sys/sys/rangelock.h +++ b/sys/sys/rangelock.h @@ -66,6 +66,7 @@ void *rangelock_wlock(struct rangelock *lock, vm_ooffset_t start, void *rangelock_trywlock(struct rangelock *lock, vm_ooffset_t start, vm_ooffset_t end); void rangelock_entry_free(struct rl_q_entry *e); +void rangelock_may_recurse(struct rangelock *lock); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _rangelock_cookie_assert(void *cookie, int what, const char *file, int line); From nobody Wed Aug 28 14:50:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv6lD3V4kz52PkK; Wed, 28 Aug 2024 14:50: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 4Wv6lD1xd2z4NXG; Wed, 28 Aug 2024 14:50:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dnWKhuP8AJCOb4uPXUj6zgHLnK+MIoHa6raSNluAOZM=; b=C/uXgfBFzzvBJEQRJOFgTcBBbDYbtfyg+w0u+Y+diYvX52APtwC69+7RAZRBjsermAbKhF n6QBHtP59SVat3jojNI8HxoFOHVOeyaox2lG50c/+QRYjdJvYLBq6UnUOS1nbuwWp/z/9c fnWW2+YgD8m9Pxu59SBXrlTSH/H1ZyFctYR8XLqREZ7WMiDaIUsuNNf2QqdmTWjpsGw1yj Q64Gcwnsjznim03EtgfpXWGRKrCdHZizGkEaO9tgJqkHk4j6V00ldjtnGxtlsd6PSyiOIP BZSljZB8vvAD03Tpahfy787igbQCo1SLWc2y6Q/3nxH6Bkem3kkHNI/nfxz+Gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724856600; a=rsa-sha256; cv=none; b=Fxp0YLyJtWxAA28By+VimA9nMp24r8gUqn0t/M94Aq2DMtZkocGT3pCmktvbkPoSqWlq29 o6eprRhJApJ9Lbow2qaPGdFn6RTxWa/UiybtUbMo9Q0Z66sVL4MAzgZvKgxTwuYLpAfrr4 ni7B5YeYeyhE+fW2pmEixs0CQ1+Npjnzo/RWlZ5jJIVgFt3WaanaZ4mf32aQ+0X4HOSUNL 26QZRpPR9KcEZeB0ixL546DwCD8IKWRcaeM3XngHkbaXExeUZVuC8E0yU/d7rv2/pZzad8 fqQM+Ek49Ej3OGhpRsJnTvvwOn4FtndemJtQFWXoaU/c971PFC2V7rJUPnCe4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dnWKhuP8AJCOb4uPXUj6zgHLnK+MIoHa6raSNluAOZM=; b=opj2og4ZYHc8Au9/rsdhTGCsyZWGajFoCgsxZqRghViApGLaH7XGkgpWStpVm5JNc2MAo1 biZcY8t8yQYD+BomTgn5XpZeGv+lmcowtH+NvyB3hluT+o4rkZrtHAE/yb+OQSN7Z+n9h0 8tVS4VxghZFo1FeRs9spmZjwnMBSLWw8mN06xRsB68H2Zo5gzny/0GpQmMsqIdHStWOjVm DH0pZTfvL5oOwNgipMxamMdkQRiIIRmzJDHeIaOYfhp7Rh4TvKwRCBqPkauIa+Mcs/fMEa ZDRAbuUmxtTI3YFWk75nIscJOaQgThDdlsmKQ36Q69ubmui7T95dCmdWtKR0mA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv6lD1XZyzdfZ; Wed, 28 Aug 2024 14:50: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 47SEo0OL000248; Wed, 28 Aug 2024 14:50:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SEo0CM000245; Wed, 28 Aug 2024 14:50:00 GMT (envelope-from git) Date: Wed, 28 Aug 2024 14:50:00 GMT Message-Id: <202408281450.47SEo0CM000245@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: 5378962154e0 - main - rangelocks: re-enable cheat mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5378962154e08e9af43a9e8e832d0dc81a4f4517 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5378962154e08e9af43a9e8e832d0dc81a4f4517 commit 5378962154e08e9af43a9e8e832d0dc81a4f4517 Author: Konstantin Belousov AuthorDate: 2024-08-27 21:38:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 14:34:54 +0000 rangelocks: re-enable cheat mode Tested by: lwhsu Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46465 --- sys/kern/kern_rangelock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 4d74c02302e7..580910597c08 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -66,7 +66,7 @@ * trylocks are same as normal locks but do not drain. */ -static int rangelock_cheat = 0; +static int rangelock_cheat = 1; SYSCTL_INT(_debug, OID_AUTO, rangelock_cheat, CTLFLAG_RWTUN, &rangelock_cheat, 0, ""); From nobody Wed Aug 28 14:49:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv6lC3Wnlz52PgY; Wed, 28 Aug 2024 14:49: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 4Wv6lC1KQpz4N0F; Wed, 28 Aug 2024 14:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+qVAncLdqvTsT6tYyi8FExSCz1sAw/o1IxxdGHwOpw=; b=yxRXEmeVPj3ZlqzJDEn2Pd46as58ElWI6ud12Pp+IGM4ilniEs6i3im1hf6+nhLL6s00U4 9mB33GFewsdCyjaOOnZAUBmiI03jXw1sYQCFSzruIRJUbTENUGhXqeQFz7KzrAaIf+/Rjn 3kgeRn5qvbpw7PjySZYjPPsUWWgNOdvJH0/Ks06AMPxvWL2r/i1tpxxRgvQoAWkeJo0K54 OWeyJYUQJa5Kn4P9F7NURZoTNP5DkbnT6BPz+1JTTY9af8+4k0Y3mrTye8pu34unESB78W fjB8vJAt01bugL8qtmuNh50GBOY0G54a4m0YUspDcuRlyv2OgjCsiywHFSt/vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724856599; a=rsa-sha256; cv=none; b=O/WsqCsvOP6ZmBgZUu3l4BBD2z4Vwt47oE2/kniK1uz7PPaMRgWceRxWZ9kC3B7sZQdUmo Mda0NmwjPA0rwZFH+p6E+GpMxG6qZPl3YXnf7kskULM1cA34DATXxnGaVgsaudq2oqr2ws htfuLqV97nHsTy2sC91UK7v/b1PukrntCNWHzbm83qwB1PYeS8hFGF6ffMzNiLwjEMd5Pj i27vK1ypxtVIkwIoMZDZc+tf7hB36N48UThFP+Reu47rfRdlJRQvmfztT5iMJmtIQK7fyt olosCj9TSx9zNQP5/JCHmSjQmBCMrmQbA7L4HsVsqdqlN4/SaWjr5RUp69haeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+qVAncLdqvTsT6tYyi8FExSCz1sAw/o1IxxdGHwOpw=; b=jX1w3+aJRE5+3FH4X+kNzVcHVDP5COn2UNbs+9CEyzI+l8wVsQHhQbhkiOoC8tK30nUXHg a1kSKE4bStIUSwn7eBoJcZkVOxKhaSGRbBLV3+CfkaUueVPcU649s2qMFIIdJATwhhxtHI lmMpJJulbh7pFEOwavq9+5lNdYU128fikc7ml626h3abvAHN2XJFmB2/9w3ztz5YjjpuRx /HgupUBqZYsCViRNMYapuoz/sH00fRdmVLqzEtI37eao12Vm+AtqRx7/ZZvq1MKY43R8fw K+1UqKZgvty5s9VSDMLh3uVf7Su8y90UqKFhX5s62cunMjQc5fphNtL2OcuwNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv6lC0x0yzdB6; Wed, 28 Aug 2024 14:49: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 47SEnxdT000170; Wed, 28 Aug 2024 14:49:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SEnxbG000165; Wed, 28 Aug 2024 14:49:59 GMT (envelope-from git) Date: Wed, 28 Aug 2024 14:49:59 GMT Message-Id: <202408281449.47SEnxbG000165@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: 4e1f29b92dc5 - main - kern_copy_file_range(): handle rangelock recursion List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e1f29b92dc5fdc84d646eb3c16a4155b6ec688d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4e1f29b92dc5fdc84d646eb3c16a4155b6ec688d commit 4e1f29b92dc5fdc84d646eb3c16a4155b6ec688d Author: Konstantin Belousov AuthorDate: 2024-08-27 21:34:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 14:34:40 +0000 kern_copy_file_range(): handle rangelock recursion PR: 281073 Reviewed by: markj Tested by: lwhsu Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46465 --- sys/kern/vfs_syscalls.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 28ab3080c075..ab0e562e73aa 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4978,11 +4978,13 @@ kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, int outfd, * If infp and outfp refer to the same file, the byte ranges cannot * overlap. */ - if (invp == outvp && ((savinoff <= savoutoff && savinoff + len > - savoutoff) || (savinoff > savoutoff && savoutoff + len > - savinoff))) { - error = EINVAL; - goto out; + if (invp == outvp) { + if ((savinoff <= savoutoff && savinoff + len > savoutoff) || + (savinoff > savoutoff && savoutoff + len > savinoff)) { + error = EINVAL; + goto out; + } + rangelock_may_recurse(&invp->v_rl); } /* Range lock the byte ranges for both invp and outvp. */ From nobody Wed Aug 28 14:50:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv6lF5lssz52PmV; Wed, 28 Aug 2024 14:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wv6lF2WlJz4NXc; Wed, 28 Aug 2024 14:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWRyixoKzttHFSzJoE8eHwpXjarjRce7ydfs4sYVm+U=; b=MtsIiFTj6J0ZbMi4R5GTbzro9JvdSaiEBF51cVNYr8PEoVkWPGLlzeU25H56xG/E5DrS9a xIpY29HNtmmbXwOiV+KcNNpdTQDJbmMKuMaDPrQVlvXrBupZKzR1jakWJrC6n0tJ1SMWMo qNRRz3VQ+RTBhN5O4rYaXb/J9bOTgIngcXQYKdbN7MHX1K4BAeOiXg9Rj8oa4sLWNZWMuD BdOBDYtm6yiIHvTIVnebvk62j20uOx3+GLmxeqT8rmI4IpHXryROuQ0tmpP2jy/KqsOuzk Np369oMPikDW6+9drkKxGSQmeDERhszQpSLfYmJMPuy1xfMtl6tkkrzwTw/KqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724856601; a=rsa-sha256; cv=none; b=Z2wf222RpR2AuxXJAjoCVZSNeDqDRiYywmMFYEzVTd5FNcRz7auwbxC5D2K7r+54puryZu EPvglVkLnR9tozMQeVP72QLmvku2L4Z9H43c9XtEs2CS0AMmPtlGhk+uoFsI3IXRqexqjI cvecLmnvCDwWallD3ahJT9sAPJ6Y4hHJwDdOTuAn8xfl07uD3NsZvEhclNSVQnFB6s28v/ uQse+eI0ED+ySLfzHLb08jUZaREc/HcbNqwf3bcI1I2ZGI/WNUAq5RAzDvEVR7PJAeU7Iw CMy4oCp/a5wIJrznORNOWPb8wFPXghMRxnLIr+Vg80+9Cxi9KzmHLdTL17aeJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724856601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XWRyixoKzttHFSzJoE8eHwpXjarjRce7ydfs4sYVm+U=; b=gvKe/wUziBtps7qZx53Vu2lwenryaEzYsum9+keCGY63XITfJhikZs5E/O6AVCfZg3yhU8 6DfhLJfrp7dtRNk6mKTb7SNxuxllBJjy7bPNMoURSWYfk47mBv0YiT5MP1af3PXZ696fdQ IADqPtQNjbtBRoq3saQB5JPxIt6/ypiYJLPaJWj+6UzcY6aHbhrY72fk6tC/eGiJzXfoqG xzzR0ITFxooLQSBJ8jqjM/Y6HvIQ7ZblU7g4rGEPqvOrnhaHzp9aGst0/69tF2PRdYYWzL v+wHaVVWM8ni+m3BlHAQn2UGxT6nIvHDxI1ZHkDt4LoBndTQzfdebsw5phd7Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv6lF24GbzdhQ; Wed, 28 Aug 2024 14:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47SEo1Vg002009; Wed, 28 Aug 2024 14:50:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SEo1SK001989; Wed, 28 Aug 2024 14:50:01 GMT (envelope-from git) Date: Wed, 28 Aug 2024 14:50:01 GMT Message-Id: <202408281450.47SEo1SK001989@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: e1f4d623779d - main - rangelocks: remove unneeded cast of the atomic_load_ptr() result List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1f4d623779df3b05b58ca06aaa8ae0b0a1c9ef7 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e1f4d623779df3b05b58ca06aaa8ae0b0a1c9ef7 commit e1f4d623779df3b05b58ca06aaa8ae0b0a1c9ef7 Author: Konstantin Belousov AuthorDate: 2024-08-28 13:30:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-28 14:35:06 +0000 rangelocks: remove unneeded cast of the atomic_load_ptr() result Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46465 --- sys/kern/kern_rangelock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 580910597c08..3a11059a7f64 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -89,7 +89,7 @@ rangelock_cheat_drain(struct rangelock *lock) DROP_GIANT(); for (;;) { - v = (uintptr_t)atomic_load_ptr(&lock->head); + v = atomic_load_ptr(&lock->head); if ((v & RL_CHEAT_DRAINING) == 0) break; sleepq_add(&lock->head, NULL, "ranged1", 0, 0); @@ -106,7 +106,7 @@ rangelock_cheat_lock(struct rangelock *lock, int locktype, bool trylock, { uintptr_t v, x; - v = (uintptr_t)atomic_load_ptr(&lock->head); + v = atomic_load_ptr(&lock->head); if ((v & RL_CHEAT_CHEATING) == 0) return (false); if ((v & RL_CHEAT_DRAINING) != 0) { @@ -190,7 +190,7 @@ rangelock_cheat_unlock(struct rangelock *lock, void *cookie) { uintptr_t v, x; - v = (uintptr_t)atomic_load_ptr(&lock->head); + v = atomic_load_ptr(&lock->head); if ((v & RL_CHEAT_CHEATING) == 0) return (false); @@ -259,7 +259,7 @@ rangelock_cheat_destroy(struct rangelock *lock) { uintptr_t v; - v = (uintptr_t)atomic_load_ptr(&lock->head); + v = atomic_load_ptr(&lock->head); if ((v & RL_CHEAT_CHEATING) == 0) return (false); MPASS(v == RL_CHEAT_CHEATING); From nobody Wed Aug 28 16:52:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv9SV62F5z52Zmr for ; Wed, 28 Aug 2024 16:52: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 4Wv9SV1sDDz4cBt; Wed, 28 Aug 2024 16:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724863946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51NK2PRMU9UbkG7nGdnycIwdkMm4sXxfKDCrqcV9as4=; b=Qh6kegVbE1xTi7U+ZJxPwHgzi3vAfS0F424jUKmN6Sm3rS7aHcTlPhyG20rHxO/LZS8G/R Oe3b40ELz/tEA5yYSlmThPku2KOA6+udWbt6vJjxxXo4Aol4Gmpu8KJ5YulRDB5JIrhGPo bNkhXrTd10LoP5MPBLBQERT6zJNfhVmIwkvd3WVQSXGmcRriKoaxqKizfsu+UmAsnd7M4J sNel0n/ph/DMrv3uhekchWx/CS693zTbrTtS8ifjwrsPUXoQkbd3vkLkQYkDlMsQbFCgbR Ir5KPWB/dzA6iEbTtSpGGG5PWDIi9E0gThr9JiSpdDxGmWytb9eKoMNhDNPHzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724863946; a=rsa-sha256; cv=none; b=JSpioqFFoj+d+toy5nA/HwSmYUWktZrJQ+ewCkUPAb/Q0ah0ksJ5QRX5IclarrGwmLZUID O9XienaOIwmIGyMk8DOpqOBDlnN7uPGxDPh39JOO3RQ5VOjnCJXoKRdetvCSMs2qaXe5c6 9nPheoGaMKpfNdLEjQJ9JBKrFaTjkqvTCuxqFJoIRSsq1b3zzugmSUdlvQ1KUQVtjV9s9r fwwyEQMVrvRMvey0xdGgA4CzdoVW34521QzfGvb0nDMZwLmijzsUKagxhBkkkauOk4cyKn 3rvFZ8a3Z8jNqpMAOzHkzBx4AU9gt3mJL6nq0WjZmlzZnpQTptiFZYeBuqNyEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724863946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51NK2PRMU9UbkG7nGdnycIwdkMm4sXxfKDCrqcV9as4=; b=qdHbt/zJavw95X8/U2tgrEPv4iuUY3iz+A718N0hBOUTB0TyccwEqEliKfviWp5rN4YtTL vXJBi7wbzZ6rm1G14cIuCgrknYIzA+FW8Xej6nmph1UOZhvlRoHvxUtJuXKTpLgaIU+DsF 5sh3ti47IFpyGp8Csx3A8YHBorN+PLZyYnAHHs3BF5B6JfC2Uwfgfd0S/PCkeGJUe65JmX 3nG+7ynXdmVZQ8HHseoo/A+p5Gav8ckwNKVPD2c/lo1I6eNVpswworClDk+Q8gkbdLfKcK A9nSKo/wa4dj/1XIwLjgkV4urRQvWqm1YiQZtzxx+9a006shc5dWI4vlbriecw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv9SV18sYzhjK; Wed, 28 Aug 2024 16:52: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 47SGqQcA019606; Wed, 28 Aug 2024 16:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SGqQKo019605; Wed, 28 Aug 2024 16:52:26 GMT (envelope-from git) Date: Wed, 28 Aug 2024 16:52:26 GMT Message-Id: <202408281652.47SGqQKo019605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 54d20d67e2af..1e19146fc769 - vendor/bc - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bc X-Git-Reftype: branch X-Git-Commit: 1e19146fc7692f59e8dfc5da7957e938cd0b81b8 X-Git-Oldrev: 54d20d67e2af28d948ce2df13feb039fa10900fc X-Git-Newrev: 1e19146fc7692f59e8dfc5da7957e938cd0b81b8 Auto-Submitted: auto-generated The branch vendor/bc has been updated by se: URL: https://cgit.FreeBSD.org/src/log/?id=54d20d67e2af..1e19146fc769 1e19146fc769 vendor/bc: upgrade to version 7.0.1 From nobody Wed Aug 28 16:58:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wv9bd6dxbz52bPv; Wed, 28 Aug 2024 16:58: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 4Wv9bd69Rcz4cj4; Wed, 28 Aug 2024 16:58:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724864317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=92Q2ETsWBQ1uAfOHlg9mjSARrcE+9lUPn4MSpzoUGcQ=; b=KFphumuO4x5iqwjm8g1xoYYvnPkXuY+Te2R95cAgFVJXwv3GIDA1lzMJHe17bTJw/5MH1W YC6BLVnJAEd77syrsm2EeCsIJHBacmkYFdPRgKwX69QE43QGndJSqPaCiIBgOQEUvzzTWZ BnT4e7rwqg5cN0oSI1jCzS/wttIzRVk1MrGOIqIfRJQnmvVw/dG2FCF0ZvbdWyGVhUDZ8P kMU/GfqbF5eWk4kSaAYseBBlK2u5ftCSeqh4jMhHEXo2ZbjCRmEICJkToMbsgqnXpwijJ+ iAqTQ2xxs7FIpBuVER+3t4XmCIMp5SUmZ8HkWsrSm9I9b1d8pbL4bLCFo3Lz0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724864317; a=rsa-sha256; cv=none; b=UekKgfpJMMTgDanSOwJXND+RTp925qWe8AOTjndngqpGHDTN93HD7uZXoCvI7hthkRY3vv tP8XAqIwbgILI8wn7RzY1k+H+G616GlRZs5khO3su5GWB6EKUq1FbqQ7J0rF7D1YDLU0f7 ewvSA6nD8d/Xln4ciVCH5OY000KLeNsZkx4g/MV8VRy4sR1AP90LcvdHl98H/BMPSVHKdn RPcojee9OrwxweNGtrI0qRk4oZpVOiVo2gqiVT+5d8JYVDEbxpLQ8k9kWmFHCnmeus4FVY oSEeLesQdZos8Z4xGJeDM6/cPZimGkRQ9lcrzzPNW/3w93kM5XFQA5pAT5nZBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724864317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=92Q2ETsWBQ1uAfOHlg9mjSARrcE+9lUPn4MSpzoUGcQ=; b=pl08Qnul1AcWm9dw0/4M6T3ZDFZRLqM1GzwiyKQm1V6D2dbR0aH9qdaQR+QrhnKWyyLg8o rxzrD7CzyZuIZX+HlIb1YrVPFrggjLMomEQ5docihzZGxldbIKMwiQGfuqVZB8ttDtj/di xy4S9KgbOIWTxgrFscHvesMazd+ctFsOyJvR5VchdXE6Op4+e9TXmWpCq3rYwXNLBjxQy8 7Z1g1MsnLWrRyOlrbeJhD8Uyjoou++eB6Phm9WrPL4j0d6ktAyGVVfhB4Mp3DBo/FPMy2b cf5+DrEG1tBxqN4kJOy457TjW28ke7UjuQb2RQnAn7RrMLKcjPGdBUIENt3ytw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wv9bd5fVVzhjP; Wed, 28 Aug 2024 16:58: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 47SGwbnK020600; Wed, 28 Aug 2024 16:58:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SGwbb4020596; Wed, 28 Aug 2024 16:58:37 GMT (envelope-from git) Date: Wed, 28 Aug 2024 16:58:37 GMT Message-Id: <202408281658.47SGwbb4020596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 5b0dc991093c - main - vendor/bc: upgrade to version 7.0.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b0dc991093c82824f6fe566af947f64f5072264 Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=5b0dc991093c82824f6fe566af947f64f5072264 commit 5b0dc991093c82824f6fe566af947f64f5072264 Author: Stefan Eßer AuthorDate: 2024-08-28 16:46:05 +0000 Commit: Stefan Eßer CommitDate: 2024-08-28 16:52:54 +0000 vendor/bc: upgrade to version 7.0.1 This update fixes building bc on FreeBSD with non-default compilers (GCC-12, GCC-13). GCC warned about casting argv from non-const to const and since warnings are treated as errors, the build failed. (cherry picked from commit 1e19146fc7692f59e8dfc5da7957e938cd0b81b8) --- contrib/bc/NEWS.md | 6 ++++++ contrib/bc/include/version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 1775fa0b6533..8156b673ce04 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,11 @@ # News +## 7.0.1 + +This is a production release that fixes a warning using GCC on FreeBSD. + +Other users do ***NOT*** need to upgrade. + ## 7.0.0 This is a production release to fix three bugs. diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 897a19530e3f..4d2f6acfb433 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 7.0.0 +#define VERSION 7.0.1 #endif // BC_VERSION_H From nobody Wed Aug 28 18:35:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvClH56hLz5MWqY; Wed, 28 Aug 2024 18:35: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 4WvClH4bvgz4kyv; Wed, 28 Aug 2024 18:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724870123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MCHFtwQWgw1KTM/sk+nGNy1ev6c2VMVRWg6/drIh34=; b=qY0KpgUrVg+rQAwFqcQOLUb1eGmjPTJBCv9VQpdAcX9aO1ifITdsjIcE+B3fjgnHdze45c WU6spVTQ2gIUB3Lu+5tLxqt9FCM0zf05kiMECidjZTEe3GeU+0QctR77ErXaxAd1+UaBdZ WOOl5gkUVLGMXyUGQIeTVmLdhWwtsfNscHLXQIrRBIEPQBgF/QSYEtWu4qUr55Z/jDfzn3 POFQ4peluLRaRkQ0G/HkkQ+KydlB3RvfGZlHBRnLwGjv2WjjOGeiI2UTMgmWFSg05xP1lb qp1ol0qJ7JPlvpfIHWZmFbg+w/hJkL524dvnhoWGbD1TG9Xb6EfqthXKW3Ip+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724870123; a=rsa-sha256; cv=none; b=kmYi2B5ZlahPU+RxEkhDxAchVsOn8g6LTwvqCGl8qnT4tNGEqjWf/BMZtR7/8IzlcH+GdR +bEglzH+SrCT485lrriVFoOuxSMxgObV2fBRDz23724RXbl0rUyPKHnCiLk7h5b/LdsYF5 aSipohQAXU+Ey9pACnjQYIewNCpdyUyXBi2SFG4uasnFGGxeHq0GKNv+wV8zjRLdHmnDx3 9oGrIPED8OtHiANOMVLPFKj5ZKgPoUT+IsqXmWZFVB737TFAn0J2QD5LTJQg24h+DZ6o/p Eq/MHiQdz90gJvB7RKqKIa5UL1b2zlgtpEG6Ys9MJC3cecVd3r46AqxfChnZWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724870123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MCHFtwQWgw1KTM/sk+nGNy1ev6c2VMVRWg6/drIh34=; b=ykNN+0xd47VIcuyyXfdfOPcvQVyyqZ5pFJaLI18tDhyTVn/4yDkmLMGrIr11ttfyu1kg3X aZcquPgpsZcH17YibJR1BKMBRxQ9ISwJWTXcpa4Gj5uwTJhweNRc6ERIN6bqGWk8T+k4gr mlV6G1Yr1E4nIyJdxstgF52J1Y6AhYp4NlfQT3jW3FEc+IhFSRStkDZt6v44Iyd30/df+R /7cYT87iWkEVtQImRjR4slpU4xnpi1EOHb20i/17Hh1lIN46voN9oeRrhTuKGwAxpV0KIG zHmH/r2WO5KXS/bcEKrsYefFj2q7EburyWfD/rsuKWn77VrRaG7CQ9HyyPOeyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvClH4C9Lzkt2; Wed, 28 Aug 2024 18:35: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 47SIZNen090764; Wed, 28 Aug 2024 18:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SIZNiN090761; Wed, 28 Aug 2024 18:35:23 GMT (envelope-from git) Date: Wed, 28 Aug 2024 18:35:23 GMT Message-Id: <202408281835.47SIZNiN090761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 1e584ca30e3a - main - cxgbe(4): Export the core suspend/resume functionality to other modules. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e584ca30e3a97eedf37368e7ad75c31f08be039 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1e584ca30e3a97eedf37368e7ad75c31f08be039 commit 1e584ca30e3a97eedf37368e7ad75c31f08be039 Author: Navdeep Parhar AuthorDate: 2024-08-28 17:18:03 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-28 18:20:26 +0000 cxgbe(4): Export the core suspend/resume functionality to other modules. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 2 ++ sys/dev/cxgbe/t4_main.c | 54 ++++++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 3922bd3909fe..2769277e8411 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1392,6 +1392,8 @@ void release_tid(struct adapter *, int, struct sge_wrq *); int cxgbe_media_change(if_t); void cxgbe_media_status(if_t, struct ifmediareq *); void t4_os_cim_err(struct adapter *); +int suspend_adapter(struct adapter *); +int resume_adapter(struct adapter *); #ifdef KERN_TLS /* t6_kern_tls.c */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 5fedf10869d2..0606f383b879 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2110,23 +2110,32 @@ stop_lld(struct adapter *sc) return (rc); } -static int -t4_suspend(device_t dev) +int +suspend_adapter(struct adapter *sc) { - struct adapter *sc = device_get_softc(dev); - - CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); stop_adapter(sc); stop_lld(sc); #ifdef TCP_OFFLOAD stop_all_uld(sc); #endif set_adapter_hwstatus(sc, false); - CH_ALERT(sc, "%s end (thread %p).\n", __func__, curthread); return (0); } +static int +t4_suspend(device_t dev) +{ + struct adapter *sc = device_get_softc(dev); + int rc; + + CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); + rc = suspend_adapter(sc); + CH_ALERT(sc, "%s end (thread %p).\n", __func__, curthread); + + return (rc); +} + struct adapter_pre_reset_state { u_int flags; uint16_t nbmcaps; @@ -2464,20 +2473,28 @@ done: return (rc); } -static int -t4_resume(device_t dev) +int +resume_adapter(struct adapter *sc) { - struct adapter *sc = device_get_softc(dev); - - CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); restart_adapter(sc); restart_lld(sc); #ifdef TCP_OFFLOAD restart_all_uld(sc); #endif + return (0); +} + +static int +t4_resume(device_t dev) +{ + struct adapter *sc = device_get_softc(dev); + int rc; + + CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); + rc = resume_adapter(sc); CH_ALERT(sc, "%s end (thread %p).\n", __func__, curthread); - return (0); + return (rc); } static int @@ -2512,12 +2529,7 @@ reset_adapter_with_pci_bus_reset(struct adapter *sc) static int reset_adapter_with_pl_rst(struct adapter *sc) { - stop_adapter(sc); - stop_lld(sc); -#ifdef TCP_OFFLOAD - stop_all_uld(sc); -#endif - set_adapter_hwstatus(sc, false); + suspend_adapter(sc); /* This is a t4_write_reg without the hw_off_limits check. */ MPASS(sc->error_flags & HW_OFF_LIMITS); @@ -2525,11 +2537,7 @@ reset_adapter_with_pl_rst(struct adapter *sc) F_PIORSTMODE | F_PIORST | F_AUTOPCIEPAUSE); pause("pl_rst", 1 * hz); /* Wait 1s for reset */ - restart_adapter(sc); - restart_lld(sc); -#ifdef TCP_OFFLOAD - restart_all_uld(sc); -#endif + resume_adapter(sc); return (0); } From nobody Wed Aug 28 18:55:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDBr3qQFz5MXyT; Wed, 28 Aug 2024 18:55: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 4WvDBr2kb4z4mVD; Wed, 28 Aug 2024 18:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724871348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fSbNWF35y1yjHhhqxwH8i7B9v6lUJhOPcewJDPCg2RI=; b=in80SNGh6IuRle2mPNROxDJbRBOP/ottlx8wQiDHUSFjk6IYkjewA+pQrsa4fVZQ3ELChp pnrYnSxVlDeeUb769wEnfTmBSry1fYuTz5CFhsGglrYVH7ACoVQqaouCgCfN9h41KPKQIx wWYHS6y8b99nmbatrtyoilFlJxhsu5ptOJfIyNQtJk8QhD8U9ILc4XtssCm7N2/LqhkwIO 0qY75nKXFyOpzz/oFkpKmzpZxnkvMI+tWfe1g2buPyvA7pp/y2bJvrIDrqe+/vIO0Oi5GR lctMs/9L3DaKua3TZ8zPrqhLs1USKRWBWJ9bmuVHm7awIAAbs+OzG5mwF98Vqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724871348; a=rsa-sha256; cv=none; b=a+pbEHtzh+Z41+OX2Lt0wPxe08tuBo3Ji2iiA00rvhoF2dp24a3whV0TM/I7eXGqKcM1yr 045sR+NxsjqRcalxmGfm8l0QR8wqCs5bWxKKvsMtRY0ttLQUWintPpJPsDYNQ9tUMwFcJ1 Tax554V5JCTnMxjB2oE5xzbfL6zJhcTZdMWVZaW01xZB6CRhp1m/osZOAZ2ezu5KFrHe+X Q5cJs8imPCSID8BCA8UsbzhIDpuTJKA3586uyW9AB6N3kCLouphA/zc40xy/UzN3f5PRaC /I8dCqR0Ywm5GPJ4VPWylSpwKYSkwuZGbHeGQSm77qcaGMgsMuDMCUWYjjlCbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724871348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fSbNWF35y1yjHhhqxwH8i7B9v6lUJhOPcewJDPCg2RI=; b=rzpY/C/QtbMcDd8V9woIp929k8oCoXYoNsjZqAyP7QMFEph2EtRnLHVWzIp7H3VcBqkZq8 Ob15m+z3pYeNoLfai0S9rQqdhmYKQGcgqzlyypnW/HYG7/ylMynUBqeYV0K5GfZ1hq6qvs 2gzavn+RN7jW5V+2rvN36j4KtZ2E+MtLyrOa0mnEkj8yhxOyPa6uLtbksf8TL2wczZAM6T oc+nnJW2w5EirFevk61dpT0d7/QUhsYaXkqsaDX0ofvHNm80gO9lKHL7+7mlgGGnRvjCv9 PUyAc1ejr0dadWR5DgVOJBKFV+q9YnyTR6ZDYwcsP5Y3oVWtLtIfVXlE1GA8dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDBr2Kk2zm0b; Wed, 28 Aug 2024 18:55: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 47SItmxU024357; Wed, 28 Aug 2024 18:55:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SItml1024354; Wed, 28 Aug 2024 18:55:48 GMT (envelope-from git) Date: Wed, 28 Aug 2024 18:55:48 GMT Message-Id: <202408281855.47SItml1024354@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: c7a7e997d25d - main - atomic: Avoid casting the return value of atomic_load_ptr to void HEAD branches config description git-daemon-export-ok gl-conf hooks info objects packed-refs refs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7a7e997d25d0b33769252d002b16839c864c83d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c7a7e997d25d0b33769252d002b16839c864c83d commit c7a7e997d25d0b33769252d002b16839c864c83d Author: Mark Johnston AuthorDate: 2024-08-28 18:51:06 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 18:55:39 +0000 atomic: Avoid casting the return value of atomic_load_ptr to void * Otherwise a cast is needed to load a uintptr_t value. Fixes: e1f4d623779d ("rangelocks: remove unneeded cast of the atomic_load_ptr() result") MFC after: 1 week --- sys/sys/atomic_san.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index eb6913296a45..ef81b4b7c51e 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -266,7 +266,8 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); #define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr) #define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr) #define atomic_load_ptr(x) \ - ((void *)ATOMIC_SAN(load_ptr)(__DECONST(volatile uintptr_t *, (x)))) + ((__typeof(*x))ATOMIC_SAN(load_ptr)( \ + __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) From nobody Wed Aug 28 19:12:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDZL444Tz5MZRJ; Wed, 28 Aug 2024 19:12: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 4WvDZL36YZz4ppv; Wed, 28 Aug 2024 19:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rXzwUJ3B073p+5XdpZL7rBXbR3gV3vMdQ2n+lfhRooY=; b=Vi2rCi9BUbmC7pa2NMNVpGgohnkDY3wnIaA1wXwONoluBUzfZPCjezBS1lhcjztYJq+v+e 16oHX3MhBeqk5NyA6OeQHEAdcucU5ozQEd6aXipFCo0Gy9hR0pdvNbuxm28QsI91r60lBL VXmlaIm7x7+WxySt8wlv4UygXCq+6oCOdEWCA9Vsfg1dg/oKLXZaGS7x5YdprFmtzVZulr NJk6HZrM798MMoacJem2n2teiFqfeYMjYrHKNCf3Or1zvXwbcBMUVQ3GtguvGVqCtmtpp8 9WPC4xdXNwNgTb0EyElHNU5ajksNM//m9GwzYscTPv9JQr9ey0UlsAx/OHmleA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872362; a=rsa-sha256; cv=none; b=vsYeijW5pBf1XcrRvldJsSJVho0y3Hw0clg3w0+8Ts39hhxuyDtaNUJuPz07joQii79xBq L0mCdEVtpde/u9/dfw7rYO0nhDv2yBdwndzbaDY3lTGVgBXgbRW91OkdFnviiQ2IsYBbsp JUDr7ABJDcyOaEV6dWjiuN0NL14q1LNJ3D+p5jsAk3/k4ReXboqyBZMvKdCdQogFJ3xNae MHBtEEahd7IHG944ni3WU7BLsT3YPwIQoHj9+oOIjdl9I0qCSm0toGboG/tlwJ7tM5IL35 6k6Y0nKAouMmsjpXBdZdjiBnAOxIi0MtVTkNdq0Y12oIL81/i7A9QtljVeyWXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rXzwUJ3B073p+5XdpZL7rBXbR3gV3vMdQ2n+lfhRooY=; b=SRuj7bIZ18mmojE/q9yBliCHvCmJ2cJYsTxV8HeAXuhIsDUDOFnzf2LFbXwfREjwBuL8f5 WHt3sU3LrNx0dd0/Azz8YYtGpD8rd4tDfobpq1Vj6RKeaR67JjuI1QmKQCjFdnBqsfz0I+ Kd4ZH9FiPzLRS/GMzHVnD/Se/9bHFYTwLtXm2h3ILP7WJGTbY6QF8qfazkAr3gsYaPOrxV ht7bFgP950IJ4rqOtoCznLWmM7HkRyBUwXMc7vHNN6/Ua15kGj/Zd/g5ynbr48OWHLMOUP BDVuGqGq9sA/XVJsL/3o/H2OJP5b1JrTCwj/AGO8Q4YdS0R62yJYwTx5gz71jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDZL2jM6zldM; Wed, 28 Aug 2024 19:12: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 47SJCgDw058950; Wed, 28 Aug 2024 19:12:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJCgfx058947; Wed, 28 Aug 2024 19:12:42 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:42 GMT Message-Id: <202408281912.47SJCgfx058947@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: d58197097610 - main - vmm: Factor most of sysctl_vmm_create() out into a separate function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d581970976101e1bcbfc23823b97696b172f118c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d581970976101e1bcbfc23823b97696b172f118c commit d581970976101e1bcbfc23823b97696b172f118c Author: Mark Johnston AuthorDate: 2024-08-28 18:57:03 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 18:57:03 +0000 vmm: Factor most of sysctl_vmm_create() out into a separate function This will make it easy to share code with an ioctl handler which creates VMs. No functional change intended. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46444 --- sys/dev/vmm/vmm_dev.c | 86 ++++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index db3e2c992f3b..94546efd03c9 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -838,66 +838,58 @@ static struct cdevsw vmmdevsw = { .d_write = vmmdev_rw, }; +static struct vmmdev_softc * +vmmdev_alloc(struct vm *vm, struct ucred *cred) +{ + struct vmmdev_softc *sc; + + sc = malloc(sizeof(*sc), M_VMMDEV, M_WAITOK | M_ZERO); + SLIST_INIT(&sc->devmem); + sc->vm = vm; + sc->ucred = crhold(cred); + return (sc); +} + static int -sysctl_vmm_create(SYSCTL_HANDLER_ARGS) +vmmdev_create(const char *name, struct ucred *cred) { - struct vm *vm; struct cdev *cdev; struct vmmdev_softc *sc, *sc2; - char *buf; - int error, buflen; - - error = vmm_priv_check(req->td->td_ucred); - if (error) - return (error); - - buflen = VM_MAX_NAMELEN + 1; - buf = malloc(buflen, M_VMMDEV, M_WAITOK | M_ZERO); - strlcpy(buf, "beavis", buflen); - error = sysctl_handle_string(oidp, buf, buflen, req); - if (error != 0 || req->newptr == NULL) - goto out; + struct vm *vm; + int error; mtx_lock(&vmmdev_mtx); - sc = vmmdev_lookup(buf); + sc = vmmdev_lookup(name); mtx_unlock(&vmmdev_mtx); - if (sc != NULL) { - error = EEXIST; - goto out; - } + if (sc != NULL) + return (EEXIST); - error = vm_create(buf, &vm); + error = vm_create(name, &vm); if (error != 0) - goto out; + return (error); - sc = malloc(sizeof(struct vmmdev_softc), M_VMMDEV, M_WAITOK | M_ZERO); - sc->ucred = crhold(curthread->td_ucred); - sc->vm = vm; - SLIST_INIT(&sc->devmem); + sc = vmmdev_alloc(vm, cred); /* * Lookup the name again just in case somebody sneaked in when we * dropped the lock. */ mtx_lock(&vmmdev_mtx); - sc2 = vmmdev_lookup(buf); - if (sc2 == NULL) { - SLIST_INSERT_HEAD(&head, sc, link); - sc->flags |= VSC_LINKED; - } - mtx_unlock(&vmmdev_mtx); - + sc2 = vmmdev_lookup(name); if (sc2 != NULL) { + mtx_unlock(&vmmdev_mtx); vmmdev_destroy(sc); - error = EEXIST; - goto out; + return (EEXIST); } + sc->flags |= VSC_LINKED; + SLIST_INSERT_HEAD(&head, sc, link); + mtx_unlock(&vmmdev_mtx); error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmdevsw, sc->ucred, - UID_ROOT, GID_WHEEL, 0600, "vmm/%s", buf); + UID_ROOT, GID_WHEEL, 0600, "vmm/%s", name); if (error != 0) { vmmdev_destroy(sc); - goto out; + return (error); } mtx_lock(&vmmdev_mtx); @@ -905,7 +897,25 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS) sc->cdev->si_drv1 = sc; mtx_unlock(&vmmdev_mtx); -out: + return (0); +} + +static int +sysctl_vmm_create(SYSCTL_HANDLER_ARGS) +{ + char *buf; + int error, buflen; + + error = vmm_priv_check(req->td->td_ucred); + if (error != 0) + return (error); + + buflen = VM_MAX_NAMELEN + 1; + buf = malloc(buflen, M_VMMDEV, M_WAITOK | M_ZERO); + strlcpy(buf, "beavis", buflen); + error = sysctl_handle_string(oidp, buf, buflen, req); + if (error == 0 && req->newptr != NULL) + error = vmmdev_create(buf, req->td->td_ucred); free(buf, M_VMMDEV); return (error); } From nobody Wed Aug 28 19:12:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDZM5S7tz5MZVv; Wed, 28 Aug 2024 19:12: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 4WvDZM3lbbz4pbY; Wed, 28 Aug 2024 19:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sgj/UhkRUu4ZWnLOoi11yvogSw5YyLHeDqM9knZjjAc=; b=HM6PSHRQU0mJtMqTVsat10V2hyKTsS0juhr59AZtyKYfBIc3LOb5IUNZYOgm7MSg7Ipp97 TyvlxnwzDDYcKCQ35PMebDxVoz2Bvk1RsVSLnGOrTDQ5xLEXSSJPmqE2f8mvuXdagKhFn/ LvUMGZdFuEdrXSvB5UgMDS0zYwil4dxL/0L1bIqDNuOBBT2w3CHzVNeBUAeFAZ4sORpfI8 bdYJCMMmdpitOE3rXomeTZi1OsPbbPWHUq1TYwlB3kNbLqQJthx9lFwzkXPjRIUM05XBja VhRuyj2XpM8B+kvOOq6Gnhuh6rAawnHSS1L6G8u8e2mbG8ljY43Y5qIpwEartA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872363; a=rsa-sha256; cv=none; b=HhNyAMvrbXFbrdjHGEtlYYGu7zPyrNm/v7eBsNZAhfGC4jz9Yj2ZGHPEoM6rzy8dpOYgFM AnuN+OR+RY1qA2V3NCwnt9j11W627Vp6UoTK3Wdw0npW4DJoVV6IMqjUN1CvesKQaEv7S1 HRxATWXfw7HAUTvMpxzMuFR3PiTAWFaFvkBvFiA/ylSauQnVlE2OEsoPzHpwPpPtXIotN5 DKtHsO1Oz8oV2P+dXNuKfErAQp6LdUx1DJgMBI5Cp44A3woTu+SE7aTmtUbtHg4C5rGtmn DVaKoAe8LO07z9sE8kiUr8+Glz3lKBoY3U+GfjO8Ovkvguva/npJQ2PUyaaYoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sgj/UhkRUu4ZWnLOoi11yvogSw5YyLHeDqM9knZjjAc=; b=i8ITYCFzptePj3dAb23xN+o9vaBb9e+8ny6MEB9eKq+3yUZw2Hak1ZycEAI+XAQ/OiMf0t zSZur6kIYbSWowit6VfqHbMYSHucdyh8CdRoBIKtLKfKqvbGKbu6rbHS2fGk3RnSrP1kns TYUgXP1HK9MrFbaVOO5az7iUHZLluQogmFLo/4+CGSdnt17PDrNH9TQQa6ceTvZGYUvoIC bZu3obkHhuLRBD5PM0q8jvy+/8uaJowP0Cccdr69J9lTpFelH7CW11B81HmmXusurtOAFk ajcBgHIFLEMLFD0DUSsB4pcD/xPdRxWHLX9D8Q7jC2AmK7+M2pxhZ0uX/oYTCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDZM3MGZzmLn; Wed, 28 Aug 2024 19:12: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 47SJChVw059011; Wed, 28 Aug 2024 19:12:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJChCA059008; Wed, 28 Aug 2024 19:12:43 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:43 GMT Message-Id: <202408281912.47SJChCA059008@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: 063a8bd908dd - main - vmm: Factor most of sysctl_vmm_destroy() into a separate function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 063a8bd908ddaae9f0ba8c7711dfe837a14f21e7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=063a8bd908ddaae9f0ba8c7711dfe837a14f21e7 commit 063a8bd908ddaae9f0ba8c7711dfe837a14f21e7 Author: Mark Johnston AuthorDate: 2024-08-28 18:57:12 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 18:57:12 +0000 vmm: Factor most of sysctl_vmm_destroy() into a separate function This will make it easy to share code with an ioctl handler which creates VMs. No functional change intended. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46445 --- sys/dev/vmm/vmm_dev.c | 72 ++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 94546efd03c9..6bdcb51777d4 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -732,12 +732,24 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, vm_size_t mapsize, } static void -vmmdev_destroy(void *arg) +vmmdev_destroy(struct vmmdev_softc *sc) { - struct vmmdev_softc *sc = arg; struct devmem_softc *dsc; int error __diagused; + /* + * Destroy all cdevs: + * + * - any new operations on the 'cdev' will return an error (ENXIO). + * + * - the 'devmem' cdevs are destroyed before the virtual machine 'cdev' + */ + SLIST_FOREACH(dsc, &sc->devmem, link) { + KASSERT(dsc->cdev != NULL, ("devmem cdev already destroyed")); + destroy_dev(dsc->cdev); + devmem_destroy(dsc); + } + vm_disable_vcpu_creation(sc->vm); error = vcpu_lock_all(sc); KASSERT(error == 0, ("%s: error %d freezing vcpus", __func__, error)); @@ -769,31 +781,16 @@ vmmdev_destroy(void *arg) } static int -sysctl_vmm_destroy(SYSCTL_HANDLER_ARGS) +vmmdev_lookup_and_destroy(const char *name, struct ucred *cred) { - struct devmem_softc *dsc; - struct vmmdev_softc *sc; struct cdev *cdev; - char *buf; - int error, buflen; - - error = vmm_priv_check(req->td->td_ucred); - if (error) - return (error); - - buflen = VM_MAX_NAMELEN + 1; - buf = malloc(buflen, M_VMMDEV, M_WAITOK | M_ZERO); - strlcpy(buf, "beavis", buflen); - error = sysctl_handle_string(oidp, buf, buflen, req); - if (error != 0 || req->newptr == NULL) - goto out; + struct vmmdev_softc *sc; mtx_lock(&vmmdev_mtx); - sc = vmmdev_lookup(buf); + sc = vmmdev_lookup(name); if (sc == NULL || sc->cdev == NULL) { mtx_unlock(&vmmdev_mtx); - error = EINVAL; - goto out; + return (EINVAL); } /* @@ -804,23 +801,28 @@ sysctl_vmm_destroy(SYSCTL_HANDLER_ARGS) sc->cdev = NULL; mtx_unlock(&vmmdev_mtx); - /* - * Destroy all cdevs: - * - * - any new operations on the 'cdev' will return an error (ENXIO). - * - * - the 'devmem' cdevs are destroyed before the virtual machine 'cdev' - */ - SLIST_FOREACH(dsc, &sc->devmem, link) { - KASSERT(dsc->cdev != NULL, ("devmem cdev already destroyed")); - destroy_dev(dsc->cdev); - devmem_destroy(dsc); - } destroy_dev(cdev); vmmdev_destroy(sc); - error = 0; -out: + return (0); +} + +static int +sysctl_vmm_destroy(SYSCTL_HANDLER_ARGS) +{ + char *buf; + int error, buflen; + + error = vmm_priv_check(req->td->td_ucred); + if (error) + return (error); + + buflen = VM_MAX_NAMELEN + 1; + buf = malloc(buflen, M_VMMDEV, M_WAITOK | M_ZERO); + strlcpy(buf, "beavis", buflen); + error = sysctl_handle_string(oidp, buf, buflen, req); + if (error == 0 && req->newptr != NULL) + error = vmmdev_lookup_and_destroy(buf, req->td->td_ucred); free(buf, M_VMMDEV); return (error); } From nobody Wed Aug 28 19:12:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDZP12gYz5MZRL; Wed, 28 Aug 2024 19:12: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 4WvDZN4VJfz4pbc; Wed, 28 Aug 2024 19:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A9E43Cr2nfgxnDATDCHpNXgXdqidOW0FMyEinjmOB/s=; b=cqx8sW+M5NZBNVar0JXEmJ65oB8qP6K5pVU0loiJpV0YuRadFVNsmIqzzwQpDH8YYwxCA+ IFtLx0MJnVhbHxsTbvEK2E41QNAemUdgWt+4nVrctC+jHHcaTV3M0ESUY0aST5orBFyUIo sHFWighbB8LXRZA2HrC4DhFKXXymtsWHElSV53seyzO+R5PAraHphpqQtdJMEFYjiwv2wE PTPJVPp/0hj86aZo9UEwj/VH1yGRqSRwT4Hz1yn5zkJbDQOuIh5HjN/E7sCoDTHIowxGSE vem41DyagnNWD2zr3a6O5DIRpVno/ad9OC3PprTnWuh1WPilTrTxEHSRPvRvUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872364; a=rsa-sha256; cv=none; b=WqSbQXMIjErl5OQtqcNDT5ylrmtSzgl2QVWMmDTCG5U+IiuAWRS06tRhTpZSQYhpy3S/bp lDjArEL4KU3+AVnIbKhSs4AJ/w4gbs40yt/HdHFP+gYRdSnYgWW8MhBkZWjy458E4uBfVc HaYnLd8G7v1ZHI++0pfDm9ZJTnDpJk0r7r+lot+tFB4TzbjU/EekCSpTS/Tw3QYjsQJkMe OYQ481qWZvFlgmZQWquTwVyc4W+j2IHh7uHTiS4XG6W5eUZ5g3kDEojK98zQ3qPvuH2nLd e8OPe6z20bwmeNDfZIDpoMQJIfWh8C9UNoLbC++oudD1u7NuedwdBlzFPvRtOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A9E43Cr2nfgxnDATDCHpNXgXdqidOW0FMyEinjmOB/s=; b=MS/FxdTtfoujVxHcomn1JsrHCmFtWC99YYKnktchLzJbiN8n8b5Lvqx+yO6GjdW4sOuGHP Yzdfw8p5dbBuBI47nZACzDBiZdGLkaXzGv6rkyVmzwqwFIxwkX5n9J8bbrTYyWjNdHUeqz Cv3q4cwdsMKqNboo7kCxOSy4QR5OtB2t+7SAQPmU9n8FLUYJNI/aY8U1w8MGD4BH1acLAh Llubu9CHbeiVL3EIT6neRxGx+goaNMIJjU23XkLCqxSy3kDdU2rjQ8vJcBj4Wd+nYv8FLi dY4v4hWNJfjL1qF4/7d+hxQoQexm2VhF/2xx5cMPBIe3s051nihCKi6LH06Ilw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDZN3r1vzm1d; Wed, 28 Aug 2024 19:12: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 47SJCi2E059071; Wed, 28 Aug 2024 19:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJCiAj059068; Wed, 28 Aug 2024 19:12:44 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:44 GMT Message-Id: <202408281912.47SJCiAj059068@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: f4002135a2be - main - vmm: Remove an unneeded lookup in devmem_create_cdev() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4002135a2be59272f39f886fb270f5a4736ac08 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f4002135a2be59272f39f886fb270f5a4736ac08 commit f4002135a2be59272f39f886fb270f5a4736ac08 Author: Mark Johnston AuthorDate: 2024-08-28 18:57:21 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 18:57:21 +0000 vmm: Remove an unneeded lookup in devmem_create_cdev() The sole caller of this function already holds a pointer to the VM's softc, so rather than passing the VM name and looking it up again, just pass the softc pointer directly. This function is only called from an ioctl context, so the softc structure will remain live. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46446 --- sys/dev/vmm/vmm_dev.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 6bdcb51777d4..c42b2aaee5ed 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -42,8 +42,6 @@ _Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) #endif -static int devmem_create_cdev(const char *vmname, int id, char *devmem); - struct devmem_softc { int segid; char *name; @@ -73,6 +71,7 @@ static MALLOC_DEFINE(M_VMMDEV, "vmmdev", "vmmdev"); SYSCTL_DECL(_hw_vmm); static void devmem_destroy(void *arg); +static int devmem_create_cdev(struct vmmdev_softc *sc, int id, char *devmem); static int vmm_priv_check(struct ucred *ucred) @@ -287,7 +286,7 @@ alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) goto done; if (VM_MEMSEG_NAME(mseg)) { - error = devmem_create_cdev(vm_name(sc->vm), mseg->segid, name); + error = devmem_create_cdev(sc, mseg->segid, name); if (error) vm_free_memseg(sc->vm, mseg->segid); else @@ -989,13 +988,15 @@ static struct cdevsw devmemsw = { }; static int -devmem_create_cdev(const char *vmname, int segid, char *devname) +devmem_create_cdev(struct vmmdev_softc *sc, int segid, char *devname) { struct devmem_softc *dsc; - struct vmmdev_softc *sc; struct cdev *cdev; + const char *vmname; int error; + vmname = vm_name(sc->vm); + error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &devmemsw, NULL, UID_ROOT, GID_WHEEL, 0600, "vmm.io/%s.%s", vmname, devname); if (error) @@ -1004,8 +1005,6 @@ devmem_create_cdev(const char *vmname, int segid, char *devname) dsc = malloc(sizeof(struct devmem_softc), M_VMMDEV, M_WAITOK | M_ZERO); mtx_lock(&vmmdev_mtx); - sc = vmmdev_lookup(vmname); - KASSERT(sc != NULL, ("%s: vm %s softc not found", __func__, vmname)); if (sc->cdev == NULL) { /* virtual machine is being created or destroyed */ mtx_unlock(&vmmdev_mtx); From nobody Wed Aug 28 19:12:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDZQ1j3zz5MZW7; Wed, 28 Aug 2024 19:12: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 4WvDZP5ZMGz4pql; Wed, 28 Aug 2024 19:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=afjc736OpC4MDxUXdy9mhKBlDHgIv3SuwoHHtdiZgfA=; b=i9jIUi4cfB1pVbqn0iFwvZCmCRUBCVv1HyouS/iJsgtS9V6FmXs02tFc+TxbG9KGyttoQK FMPxfZWWrewfD1ZMWk0C1ho2A8BPzllU94A30J4dDPYu5bUnUeLf7hJYZnAToyf/aiBgNB 6fW7VvDAo/d9ovjgkzzXHrJjwwGms/jn3GAVF0MQ2v4SjSyW8VVDqxg8T2PZsI3aqyw3Xe chdoEWbjawlE6QS8+xgB6ezHFiVdyCxCTBr3iyEwSjFmlH+IXrpbLRrEs6/fU3uJ9O8iOY ZSfpDX9kAZ79vvGrXLriOjMcjaom28+vO4DLxB0VbrLmIC1X2QS9tNpDU/WRIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872365; a=rsa-sha256; cv=none; b=Nkz7JBZsBTVx7ll+zDu4OFiG7b/8hr3bXOuA6kzd5S4O7DgXrSDwC7uLh8Hf1ZK8whL3GK b/tgq77782H56EHvf9+ao/MqmygR6MzKXqUOPYBHTjzeDbQQ3qJzSS6LNCVcUgIyHeUseO CCRNyT4id2qpQGcuxMkM/qtkIDnuF7eaHrWdBeqc0KUbuseUYyghNTWn5+L1WUgMSZUF6E fwCFInyVtq0NRAGK0sCxh307Rn4rNEbfOCYr7r4vex6IUJkto1XRfsNEFSvXBDxLI5nny4 JtOqlqauAyzO88xei1k6EnutijM5uO6XTGcTz/M/9ZjFlFZ8RI/HSYlXhAsWEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=afjc736OpC4MDxUXdy9mhKBlDHgIv3SuwoHHtdiZgfA=; b=isw+MpBRow9exqa2cGnmokSsvQRCTpBUPTR/dvsO+KypZEUURycDHRmGt1VTbe1Zebo9Ne HDzBZhj+WbS+3zZseYsYDDmNBc9OCQmAHaifohbhkSPCxjk/Hy3NM0MXH8WBP/4U4s1eJF rCkZf3uD3bhdH/uD6syxIJAJ5yYi6IHLidXnQ4ZjYD2lSqVEAFDe9FewdA9Tds7B8eEfDj HSpbO/yHvXJTVaTo29LVvBozHhCWB2ZiZxRpAlopelXB73zKmIdizc0EBQT9ChsJjwinMm GubtDNZ0U67oJERbBjWrXTSv1JwXAG5U+HYNdWZsJmMhwhF4g/v+WUem3EqUwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDZP5BMCzmGb; Wed, 28 Aug 2024 19:12: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 47SJCji6059131; Wed, 28 Aug 2024 19:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJCjrx059128; Wed, 28 Aug 2024 19:12:45 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:45 GMT Message-Id: <202408281912.47SJCjrx059128@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: c23da668fa8e - main - vmm: Be more consistent with the credential used for VM lookup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c23da668fa8e341c6f51d70ec632de617b693215 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c23da668fa8e341c6f51d70ec632de617b693215 commit c23da668fa8e341c6f51d70ec632de617b693215 Author: Mark Johnston AuthorDate: 2024-08-28 18:57:33 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 18:57:33 +0000 vmm: Be more consistent with the credential used for VM lookup vmmdev_lookup() is used from sysctl context to find a VM by name. There, a reference credential is already passed, so use that instead of assuming that it's the same as curthread->td_ucred, even though that's true today. No functional change intended. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46447 --- sys/dev/vmm/vmm_dev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index c42b2aaee5ed..53b4dc8cda91 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -152,7 +152,7 @@ vcpu_unlock_all(struct vmmdev_softc *sc) } static struct vmmdev_softc * -vmmdev_lookup(const char *name) +vmmdev_lookup(const char *name, struct ucred *cred) { struct vmmdev_softc *sc; @@ -166,7 +166,7 @@ vmmdev_lookup(const char *name) if (sc == NULL) return (NULL); - if (cr_cansee(curthread->td_ucred, sc->ucred)) + if (cr_cansee(cred, sc->ucred)) return (NULL); return (sc); @@ -786,7 +786,7 @@ vmmdev_lookup_and_destroy(const char *name, struct ucred *cred) struct vmmdev_softc *sc; mtx_lock(&vmmdev_mtx); - sc = vmmdev_lookup(name); + sc = vmmdev_lookup(name, cred); if (sc == NULL || sc->cdev == NULL) { mtx_unlock(&vmmdev_mtx); return (EINVAL); @@ -860,7 +860,7 @@ vmmdev_create(const char *name, struct ucred *cred) int error; mtx_lock(&vmmdev_mtx); - sc = vmmdev_lookup(name); + sc = vmmdev_lookup(name, cred); mtx_unlock(&vmmdev_mtx); if (sc != NULL) return (EEXIST); @@ -876,7 +876,7 @@ vmmdev_create(const char *name, struct ucred *cred) * dropped the lock. */ mtx_lock(&vmmdev_mtx); - sc2 = vmmdev_lookup(name); + sc2 = vmmdev_lookup(name, cred); if (sc2 != NULL) { mtx_unlock(&vmmdev_mtx); vmmdev_destroy(sc); From nobody Wed Aug 28 19:12:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDZR1fpmz5MZdh; Wed, 28 Aug 2024 19:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvDZQ6dN9z4pwd; Wed, 28 Aug 2024 19:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5PG3mkA45TK8AF9Teu6YsZv/7yFMRu/CqN8RJ2ZDRBM=; b=Wl7290APk5yWwdgKTVPuJTi8sAyQzbxZlk1+FAFji8uiJy6ernp4b3WYsO76dvj7Fkld2Y KTWuHbpe14xKp4X+KcyEUM2vF3mnRXdHdvDd+RARUuf1Dv8oREMx1vIxuFQe7ZEmbIsY7U U6cLwsUha2NzBqibfkhGPgncX9o1Lj/eJk0VhUER56DK7zvf1Vw/kvBjIGutqrlq05reuj LvuOMGKWVhC4PzUumgPGognjSCIh1y9Lotd1d5/80jRGVCBYe4Ok0cvDxISi5QiM00WrEr SQmWlmxJbkIGGCMXRvCpQg1RTHxGw9WpoVx+F/2w+bipZ7flb1ka92E1UfNXeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872367; a=rsa-sha256; cv=none; b=J1feLC+1kAoiZveElgaxQzyd44pTU/imxZM0mirXz4tp7PQwAr3XWllGhtv7vHtHVCPBth ddXBgrtbmYcoIyy9dzoOtO5gmN6OLHodiq5e6dRBATGmBPgf9ZPxj8zk1ndK5eU55MM2q3 HmKrvbKajJlUoBsNBYNVjpkblqiUvhDBAb7HCHFm2dHoFBxDRN17sF/r4eVSs8dh6Mmjga WAvfNtd27v6iFrNeseaM57a3SsOforF/8TWkDXPtdElSptuNC0ON1nDSgm+C2I4T+Glcdz XzIxuw0uwwnnHYD8vZNOwMrsKHPLcFEXPYyvyOp7T1zGRC0+5P5ukXXhtGZ6tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5PG3mkA45TK8AF9Teu6YsZv/7yFMRu/CqN8RJ2ZDRBM=; b=A5yHBdVjqoCTYqvdaIrAlo0XlLL/oSU763B+mQAeGXkj0nnZalVu6IoXfGz9rD7emMZTcX +3y0/uN+drTrr4QS+lGNH24c8xyuwbUf2BNeEfgVEtZjOUoP0f7btr1a5zRHMb270ZKpcp RexBVPayplz5bNQWSWpf6rCXhh/XpUQ/MRPvI0Kl4FGCFGzbkyuKHW4IjJ+9wYH/dbJLLg vnpXmdmMfJw++dl/30CWSlB8deJ8IxcGVGl58QIYSfLkwv+Hj3gdczAL0j9DQJp13ej/0r zbR8p8vCyWNEKWsXw6UZrRXt+w5tMOKNXrj71Uz3ZaEf6eg4IKoTMQQm3ltt9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDZQ6CgRzm1f; Wed, 28 Aug 2024 19:12: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 47SJCku0059186; Wed, 28 Aug 2024 19:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJCkSK059183; Wed, 28 Aug 2024 19:12:46 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:46 GMT Message-Id: <202408281912.47SJCkSK059183@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: 72ea8f41e19d - main - vmm: Let devmem devices reference the VM credential List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72ea8f41e19d3e028dd4ab3f9102240e215dbc6d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=72ea8f41e19d3e028dd4ab3f9102240e215dbc6d commit 72ea8f41e19d3e028dd4ab3f9102240e215dbc6d Author: Mark Johnston AuthorDate: 2024-08-28 18:57:38 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 19:12:16 +0000 vmm: Let devmem devices reference the VM credential Otherwise they are globally visible (in jails with allow.vmm set), instead of being restricted to the jail to which the VM belongs. Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46448 --- sys/dev/vmm/vmm_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 53b4dc8cda91..fa9357b3b566 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -997,7 +997,7 @@ devmem_create_cdev(struct vmmdev_softc *sc, int segid, char *devname) vmname = vm_name(sc->vm); - error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &devmemsw, NULL, + error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &devmemsw, sc->ucred, UID_ROOT, GID_WHEEL, 0600, "vmm.io/%s.%s", vmname, devname); if (error) return (error); From nobody Wed Aug 28 19:12:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDZS2208z5MZW8; Wed, 28 Aug 2024 19:12: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 4WvDZS0g4nz4pc9; Wed, 28 Aug 2024 19:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xCaCC1lyWx/mGAwnSwLqinjhhvQy/0Qj00VfVklbALA=; b=BQNhinNjVpr/2v6FizPa2gNtorvU07VP5ibb8jBMaYNsPe1xy3UQL2rH8lpdX8pOYkanxX Ki0V6MNgJWl/omvplh/34IphX7yE5kB0F5eSvkPhxQ08Bc9SOsGI0IIlPHbQ611a5Tj446 zF/vLptnYNjVV5waubLX6rDyv9I7BM8YjA8Uk/PyQfwLEk2YWUW9jqEJ+/RQofu61AmBS1 FnlLiISd2iPwJoCS3GTpVGISrmxDbyvtt2VT1uf5M/gtrLOZZVET5Jk+Zk2KZw37w70jDN bQykUT023enQlgFMLlG74ogRxf9aInYFOHC3KBW6i4qiuQDKT/b5+p8hnMP23w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724872368; a=rsa-sha256; cv=none; b=sEhTFGq9nbPqeZKrHarsKi4qsXwYUSB0xOVU67LSjjBJcna4YUhueHWsTuQOo6/VW//OLH tWLoeoz6QUVQNwW9GDQ1vft7NeIpRcx2KjR1zxw1JI1qCI3Qw2rw+TjROxqGLXdlPy//cy tOUOOwNOMqCJ8UJw6dAhuGTSo67otRsCKKh52atbPAAdvt0tbjvAdG2R4Ue8WVkdgwElmR qKklxre51tvVdbzkmHEbRSIjSJscH99HJZ9pNmnklwoyDrwlJ6UI1bp1bSXSpwaRdJaFsn Oe/4KcEjRdCELIHli2xAyWmJnMW4u1BjD1A5TWSGsknIX/OS7y1/fVbLQmXmfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724872368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xCaCC1lyWx/mGAwnSwLqinjhhvQy/0Qj00VfVklbALA=; b=DPyEwbG+jXf5KSFH9d2t/ThtbCUzZFw/hCG/qkPq8S5/N4vQFoX0NzNyRaSfsyaz5YqLfn 6H32UzNvRsdhPVZNYWp91DtaIsi63mujbcubFBNkSmhbC4iNxFS9uNANuMuziHriQTup+v IEl7uzSi7LTwW9Hauwp1pW9g7RJtVDaikVZxcaVagve9IWjTD3uBCmiLg2KWmqAEMAPi/M iCraJYcC90l7SahNAEEfG8ahfw+OFv+4krj536LrIi5F3nn7syo5ELAxQrKVLehyq/EzsT gA403iTby5yjXkClU027MpkgM8dypRpd4mM0xgA8SP+4mqafogpVmLKsnIJKiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDZS06LVzmXB; Wed, 28 Aug 2024 19:12: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 47SJClwX059235; Wed, 28 Aug 2024 19:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJCl4M059232; Wed, 28 Aug 2024 19:12:47 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:12:47 GMT Message-Id: <202408281912.47SJCl4M059232@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: a852dc580c1c - main - vmm: Harmonize compat ioctl definitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a852dc580c1c261bc50fd9788b52abca0004661b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a852dc580c1c261bc50fd9788b52abca0004661b commit a852dc580c1c261bc50fd9788b52abca0004661b Author: Mark Johnston AuthorDate: 2024-08-28 18:57:43 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 19:12:32 +0000 vmm: Harmonize compat ioctl definitions For compat ioctls and structures, we use a mix of suffixes: _old, _fbsd, _. Standardize on _ to make things more consistent. No functional change intended. Reported by: jhb Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D46449 --- sys/amd64/vmm/vmm_dev_machdep.c | 34 +++++++++++++++++----------------- sys/dev/vmm/vmm_dev.c | 24 ++++++++++++------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/amd64/vmm/vmm_dev_machdep.c b/sys/amd64/vmm/vmm_dev_machdep.c index 792807568212..2d0ceadaedfe 100644 --- a/sys/amd64/vmm/vmm_dev_machdep.c +++ b/sys/amd64/vmm/vmm_dev_machdep.c @@ -59,16 +59,16 @@ #include "io/vrtc.h" #ifdef COMPAT_FREEBSD13 -struct vm_stats_old { +struct vm_stats_13 { int cpuid; /* in */ int num_entries; /* out */ struct timeval tv; uint64_t statbuf[MAX_VM_STATS]; }; -#define VM_STATS_OLD _IOWR('v', IOCNUM_VM_STATS, struct vm_stats_old) +#define VM_STATS_13 _IOWR('v', IOCNUM_VM_STATS, struct vm_stats_13) -struct vm_snapshot_meta_old { +struct vm_snapshot_meta_13 { void *ctx; /* unused */ void *dev_data; const char *dev_name; /* identify userspace devices */ @@ -79,8 +79,8 @@ struct vm_snapshot_meta_old { enum vm_snapshot_op op; }; -#define VM_SNAPSHOT_REQ_OLD \ - _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta_old) +#define VM_SNAPSHOT_REQ_13 \ + _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta_13) struct vm_exit_ipi_13 { uint32_t mode; @@ -131,14 +131,14 @@ const struct vmmdev_ioctl vmmdev_machdep_ioctls[] = { VMMDEV_IOCTL(VM_UNMAP_PPTDEV_MMIO, VMMDEV_IOCTL_LOCK_ALL_VCPUS), #ifdef BHYVE_SNAPSHOT #ifdef COMPAT_FREEBSD13 - VMMDEV_IOCTL(VM_SNAPSHOT_REQ_OLD, VMMDEV_IOCTL_LOCK_ALL_VCPUS), + VMMDEV_IOCTL(VM_SNAPSHOT_REQ_13, VMMDEV_IOCTL_LOCK_ALL_VCPUS), #endif VMMDEV_IOCTL(VM_SNAPSHOT_REQ, VMMDEV_IOCTL_LOCK_ALL_VCPUS), VMMDEV_IOCTL(VM_RESTORE_TIME, VMMDEV_IOCTL_LOCK_ALL_VCPUS), #endif #ifdef COMPAT_FREEBSD13 - VMMDEV_IOCTL(VM_STATS_OLD, VMMDEV_IOCTL_LOCK_ONE_VCPU), + VMMDEV_IOCTL(VM_STATS_13, VMMDEV_IOCTL_LOCK_ONE_VCPU), #endif VMMDEV_IOCTL(VM_INJECT_NMI, VMMDEV_IOCTL_LOCK_ONE_VCPU), VMMDEV_IOCTL(VM_LAPIC_IRQ, VMMDEV_IOCTL_LOCK_ONE_VCPU), @@ -196,7 +196,7 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, #ifdef BHYVE_SNAPSHOT struct vm_snapshot_meta *snapshot_meta; #ifdef COMPAT_FREEBSD13 - struct vm_snapshot_meta_old *snapshot_old; + struct vm_snapshot_meta_13 *snapshot_13; #endif #endif int error; @@ -270,13 +270,13 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, } break; } - case VM_STATS_OLD: { - struct vm_stats_old *vmstats_old; + case VM_STATS_13: { + struct vm_stats_13 *vmstats_13; - vmstats_old = (struct vm_stats_old *)data; - getmicrotime(&vmstats_old->tv); - error = vmm_stat_copy(vcpu, 0, nitems(vmstats_old->statbuf), - &vmstats_old->num_entries, vmstats_old->statbuf); + vmstats_13 = (struct vm_stats_13 *)data; + getmicrotime(&vmstats_13->tv); + error = vmm_stat_copy(vcpu, 0, nitems(vmstats_13->statbuf), + &vmstats_13->num_entries, vmstats_13->statbuf); break; } #endif @@ -502,14 +502,14 @@ vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, error = vm_snapshot_req(vm, snapshot_meta); break; #ifdef COMPAT_FREEBSD13 - case VM_SNAPSHOT_REQ_OLD: + case VM_SNAPSHOT_REQ_13: /* * The old structure just has an additional pointer at * the start that is ignored. */ - snapshot_old = (struct vm_snapshot_meta_old *)data; + snapshot_13 = (struct vm_snapshot_meta_13 *)data; snapshot_meta = - (struct vm_snapshot_meta *)&snapshot_old->dev_data; + (struct vm_snapshot_meta *)&snapshot_13->dev_data; error = vm_snapshot_req(vm, snapshot_meta); break; #endif diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index fa9357b3b566..f43429de4d4c 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -29,17 +29,17 @@ #include #if defined(__amd64__) && defined(COMPAT_FREEBSD12) -struct vm_memseg_fbsd12 { +struct vm_memseg_12 { int segid; size_t len; char name[64]; }; -_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); +_Static_assert(sizeof(struct vm_memseg_12) == 80, "COMPAT_FREEBSD12 ABI"); -#define VM_ALLOC_MEMSEG_FBSD12 \ - _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) -#define VM_GET_MEMSEG_FBSD12 \ - _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) +#define VM_ALLOC_MEMSEG_12 \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_12) +#define VM_GET_MEMSEG_12 \ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_12) #endif struct devmem_softc { @@ -339,7 +339,7 @@ static const struct vmmdev_ioctl vmmdev_ioctls[] = { VMMDEV_IOCTL(VM_STATS, VMMDEV_IOCTL_LOCK_ONE_VCPU), #if defined(__amd64__) && defined(COMPAT_FREEBSD12) - VMMDEV_IOCTL(VM_ALLOC_MEMSEG_FBSD12, + VMMDEV_IOCTL(VM_ALLOC_MEMSEG_12, VMMDEV_IOCTL_XLOCK_MEMSEGS | VMMDEV_IOCTL_LOCK_ALL_VCPUS), #endif VMMDEV_IOCTL(VM_ALLOC_MEMSEG, @@ -352,7 +352,7 @@ static const struct vmmdev_ioctl vmmdev_ioctls[] = { VMMDEV_IOCTL_XLOCK_MEMSEGS | VMMDEV_IOCTL_LOCK_ALL_VCPUS), #if defined(__amd64__) && defined(COMPAT_FREEBSD12) - VMMDEV_IOCTL(VM_GET_MEMSEG_FBSD12, VMMDEV_IOCTL_SLOCK_MEMSEGS), + VMMDEV_IOCTL(VM_GET_MEMSEG_12, VMMDEV_IOCTL_SLOCK_MEMSEGS), #endif VMMDEV_IOCTL(VM_GET_MEMSEG, VMMDEV_IOCTL_SLOCK_MEMSEGS), VMMDEV_IOCTL(VM_MMAP_GETNEXT, VMMDEV_IOCTL_SLOCK_MEMSEGS), @@ -489,13 +489,13 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, break; } #if defined(__amd64__) && defined(COMPAT_FREEBSD12) - case VM_ALLOC_MEMSEG_FBSD12: + case VM_ALLOC_MEMSEG_12: error = alloc_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + sizeof(((struct vm_memseg_12 *)0)->name)); break; - case VM_GET_MEMSEG_FBSD12: + case VM_GET_MEMSEG_12: error = get_memseg(sc, (struct vm_memseg *)data, - sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + sizeof(((struct vm_memseg_12 *)0)->name)); break; #endif case VM_ALLOC_MEMSEG: From nobody Wed Aug 28 19:15:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDf02K6lz5MZcL for ; Wed, 28 Aug 2024 19:15:52 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 4WvDdz4xzjz4rmH for ; Wed, 28 Aug 2024 19:15:51 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42ab880b73eso64439435e9.0 for ; Wed, 28 Aug 2024 12:15:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724872550; x=1725477350; 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=bhL8HMcqBBOP5lcukNoi8NinRQMDW3+MOUL1ZxkhuWg=; b=jI6LbF1/uX6ZxQcYT/zhq0hrrp4MDEtQZgztn+keVy3J04INgLAYOkurQTVp49bAao l6rLSgcmRE0mwCnqPJqzB9gOZtUHwbX9uj3oXUTzxIxHcOP3dISzDNaSNkJjkcjrFUUT STE9VnH1YQ6U/BiwwRO8uTPy3UCkKcbtaAlWAEwo2bz2lXZVDASvb1sN7O27ciwZ1YxW 79uuTqXDNg+SvdgH4QSAcXT+XaIy5Dq5M9p6mfbVpCjX/xI59wpKdulp7lTGvU5lIFM4 yjLXEajSNbvqPGEuJqx3M3fCVvTKV0sm9YEnPMnOQdwFBSSFYF6hA4NUZu3bJTL1jzUk M1hw== X-Forwarded-Encrypted: i=1; AJvYcCVMpr0ezISCcUIdWK8N1TmkUP5h6sYoxZUF2aRvP2+2aVwfueIgBMl4w70t9WPDv4lc0uGSUFB+Zfy/i5FcmdpYnelO@freebsd.org X-Gm-Message-State: AOJu0YwGpCGks3vgpXkHcpif0F4MBOze+TSFEVf8Jb4/HEOZl3RDTri4 Zeau66Rs+MCno2VMUIcZ0e4tK1N4klSAG9jJIeYNEF8YH2VriR4eH8gMykBe2GQ= X-Google-Smtp-Source: AGHT+IERJKsPce3xQ4HYGwyIZof7o+TPOG4sTmsctinGFHt13h75/7vhDb0LowvB8NGZ2MDflYBt4w== X-Received: by 2002:a05:600c:3ca4:b0:426:5fbc:f319 with SMTP id 5b1f17b1804b1-42bb01f45b7mr4584995e9.33.1724872549693; Wed, 28 Aug 2024 12:15:49 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749b2429absm455618f8f.65.2024.08.28.12.15.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Aug 2024 12:15:49 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: c7a7e997d25d - main - atomic: Avoid casting the return value of atomic_load_ptr to void HEAD branches config description git-daemon-export-ok gl-conf hooks info objects packed-refs refs From: Jessica Clarke In-Reply-To: <202408281855.47SItml1024354@gitrepo.freebsd.org> Date: Wed, 28 Aug 2024 20:15:38 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <9559E6F1-0FB5-48E9-9827-50D6BD8E5446@freebsd.org> References: <202408281855.47SItml1024354@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3776.700.51) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4WvDdz4xzjz4rmH On 28 Aug 2024, at 19:55, Mark Johnston wrote: >=20 > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc7a7e997d25d0b33769252d002b16839= c864c83d >=20 > commit c7a7e997d25d0b33769252d002b16839c864c83d > Author: Mark Johnston > AuthorDate: 2024-08-28 18:51:06 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-28 18:55:39 +0000 >=20 > atomic: Avoid casting the return value of atomic_load_ptr to void * >=20 > Otherwise a cast is needed to load a uintptr_t value. >=20 > Fixes: e1f4d623779d ("rangelocks: remove unneeded cast of the = atomic_load_ptr() result") > MFC after: 1 week > --- > sys/sys/atomic_san.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h > index eb6913296a45..ef81b4b7c51e 100644 > --- a/sys/sys/atomic_san.h > +++ b/sys/sys/atomic_san.h > @@ -266,7 +266,8 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); > #define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr) > #define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr) > #define atomic_load_ptr(x) \ > - ((void *)ATOMIC_SAN(load_ptr)(__DECONST(volatile uintptr_t *, (x)))) > + ((__typeof(*x))ATOMIC_SAN(load_ptr)( \ > + __DECONST(volatile uintptr_t *, (x)))) > #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) > #define atomic_load_consume_ptr(x) \ > ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) This variant is similarly wrong. Jess From nobody Wed Aug 28 19:30:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDzC0VxCz5MbmR; Wed, 28 Aug 2024 19:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvDzB6vZjz4ssm; Wed, 28 Aug 2024 19:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724873447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Tgd7dlx9vKtxjxjHHiEKl+pzZHy9KrklmKGa9VjSDY=; b=A/8I2nmezuJkg94jMTMvk4VhxzDifqkrGnH+SdLvrVis6MTN84CaiKmHFz+/vrffuHWdYT m5Fbq9bOKWI1afZHVWHpbPLe8FIYIXp0GOGdFjZDSxQn/KZP1NjCXfnI45zbEBT35gYMXT sXZVHkRIGYpiK/u8pnA55gvQU7z0TIFTvpC4CcDlt3wuNhogjcmJaQxsewrmNf83nKktGA 1qe401TX8sCPjeDqhtOReMi03Kf3NXtP5KC2FC/IRJFvf39B215lwezMuj5Q9T0DpVb0tz fG5lbsa2PxWR71ua8JTb7wUyLhTPpYg7noMo0FWUkE6hKEpNgdjEyKH7C+U0bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724873447; a=rsa-sha256; cv=none; b=okFIbrriAXbdlDl/OVMj4viAzTz3oXYeVDwZvawtGzr6vLUmEY+TJ8yJ4uUDncm1I/CZ1G qbqh5tnxldk2w7Uq/zqURDFDiWd7xaDC9wjfdydkuL16vHqkD+LNqnsLifq6KfWiMpUoir hZrnh856T6Oj3Z6NITyzqaFBO0uHn/vjDCVozyc7D6ijc6UlQVGL3FHkOq4oa0FPPp4qNo s48VHi5cr8gadoNmOWCrrc9e61lfgGjfycQk8h3PeqDW3pBLqssiy7Rl2ZRMmsM961OgoC CHOv6oSATbq1exNbZf/Knh2sDDluzbBUAOApQu9onpTXb+ZNHfJTBmbdEJ8ONg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724873447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Tgd7dlx9vKtxjxjHHiEKl+pzZHy9KrklmKGa9VjSDY=; b=vpc3wKVOLZHKkNsvBrQT+TpDzMUYpgJrW/2heYePQ8rLQVSPcBFOXPkZSKInB77FlYBSK7 HDsQDQ8plyf6FS3URPsVDaYiyESq+T482Xtn9pIlV3DZflmuuvaZ+qCLGuICt7Lyj5QLwI LqZ9aUIiQi9evFUWiRM4TTlFqyXRIo1rcpm9ToCYtgtp4bZOAavYd/crX8tloOEw35QvUf oVQCipLZKj8R6Gzwnr8p0oqfN3OvCs2T4vxwzI2b2xRCeSe1JQkY+4l0241E+3WTn3MAjw jVlkdzwZj0POpiuIiq0Koj2kGQnV3fHQ3MHH4oAfM9M2GkfX3avDcOKG4N7bYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDzB6VhmzmMR; Wed, 28 Aug 2024 19:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47SJUkC5085657; Wed, 28 Aug 2024 19:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJUkGH085654; Wed, 28 Aug 2024 19:30:46 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:30:46 GMT Message-Id: <202408281930.47SJUkGH085654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 8254a276ad89 - main - cxgbe/iw_cxgbe: Replace the fatal error flag with a stopped flag. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8254a276ad893ae2a1b35fcbbad255f06e29b8c6 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=8254a276ad893ae2a1b35fcbbad255f06e29b8c6 commit 8254a276ad893ae2a1b35fcbbad255f06e29b8c6 Author: Navdeep Parhar AuthorDate: 2024-08-28 18:41:10 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-28 19:19:23 +0000 cxgbe/iw_cxgbe: Replace the fatal error flag with a stopped flag. Now that suspend/resume is supported by the base driver, a fatal error isn't the only reason that the RNIC can stop abruptly. Also, this state is no longer permanent as it's possible to resume operations after a stop. Rename the flag and associated routines to match the new state of affairs. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/iw_cxgbe/cm.c | 10 +++++----- sys/dev/cxgbe/iw_cxgbe/device.c | 11 ++++++++--- sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h | 10 +++++----- sys/dev/cxgbe/iw_cxgbe/mem.c | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index e0e48fdff9ba..257dec81f384 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -1080,7 +1080,7 @@ c4iw_so_upcall(struct socket *so, void *arg, int waitflag) * Wake up any threads waiting in rdma_init()/rdma_fini(), * with locks held. */ - if (so->so_error || (ep->com.dev->rdev.flags & T4_FATAL_ERROR)) + if (so->so_error || c4iw_stopped(&ep->com.dev->rdev)) c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET); add_ep_to_req_list(ep, C4IW_EVENT_SOCKET); @@ -2708,8 +2708,8 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog) CTR3(KTR_IW_CXGBE, "%s: cm_id %p, backlog %s", __func__, cm_id, backlog); - if (c4iw_fatal_error(&dev->rdev)) { - CTR2(KTR_IW_CXGBE, "%s: cm_id %p, fatal error", __func__, + if (c4iw_stopped(&dev->rdev)) { + CTR2(KTR_IW_CXGBE, "%s: cm_id %p, stopped", __func__, cm_id); return -EIO; } @@ -2821,8 +2821,8 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp) rdev = &ep->com.dev->rdev; - if (c4iw_fatal_error(rdev)) { - CTR3(KTR_IW_CXGBE, "%s:ced1 fatal error %p %s", __func__, ep, + if (c4iw_stopped(rdev)) { + CTR3(KTR_IW_CXGBE, "%s:ced1 stopped %p %s", __func__, ep, states[ep->com.state]); if (ep->com.state != DEAD) { send_abort(ep); diff --git a/sys/dev/cxgbe/iw_cxgbe/device.c b/sys/dev/cxgbe/iw_cxgbe/device.c index 209d12767a1c..3c4d269f6c69 100644 --- a/sys/dev/cxgbe/iw_cxgbe/device.c +++ b/sys/dev/cxgbe/iw_cxgbe/device.c @@ -335,9 +335,8 @@ c4iw_stop(struct adapter *sc) if (iwsc) { struct ib_event event = {0}; - device_printf(sc->dev, - "iWARP driver received FATAL ERROR event.\n"); - iwsc->rdev.flags |= T4_FATAL_ERROR; + device_printf(sc->dev, "iWARP driver stopped.\n"); + iwsc->rdev.flags |= T4_IW_STOPPED; event.event = IB_EVENT_DEVICE_FATAL; event.device = &iwsc->ibdev; ib_dispatch_event(&event); @@ -349,6 +348,12 @@ c4iw_stop(struct adapter *sc) static int c4iw_restart(struct adapter *sc) { + struct c4iw_dev *iwsc = sc->iwarp_softc; + + if (iwsc) { + device_printf(sc->dev, "iWARP driver restarted.\n"); + iwsc->rdev.flags &= ~T4_IW_STOPPED; + } return (0); } diff --git a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h index 5715b7e53863..ca2595b65b02 100644 --- a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h +++ b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h @@ -116,7 +116,7 @@ struct c4iw_dev_ucontext { }; enum c4iw_rdev_flags { - T4_FATAL_ERROR = (1<<0), + T4_IW_STOPPED = (1<<0), T4_STATUS_PAGE_DISABLED = (1<<1), }; @@ -167,9 +167,9 @@ struct c4iw_rdev { struct workqueue_struct *free_workq; }; -static inline int c4iw_fatal_error(struct c4iw_rdev *rdev) +static inline int c4iw_stopped(struct c4iw_rdev *rdev) { - return rdev->flags & T4_FATAL_ERROR; + return rdev->flags & T4_IW_STOPPED; } static inline int c4iw_num_stags(struct c4iw_rdev *rdev) @@ -214,7 +214,7 @@ c4iw_wait_for_reply(struct c4iw_rdev *rdev, struct c4iw_wr_wait *wr_waitp, int timedout = 0; struct timeval t1, t2; - if (c4iw_fatal_error(rdev)) { + if (c4iw_stopped(rdev)) { wr_waitp->ret = -EIO; goto out; } @@ -240,7 +240,7 @@ c4iw_wait_for_reply(struct c4iw_rdev *rdev, struct c4iw_wr_wait *wr_waitp, "seconds - tid %u qpid %u\n", func, device_get_nameunit(sc->dev), t2.tv_sec, t2.tv_usec, hwtid, qpid); - if (c4iw_fatal_error(rdev)) { + if (c4iw_stopped(rdev)) { wr_waitp->ret = -EIO; break; } diff --git a/sys/dev/cxgbe/iw_cxgbe/mem.c b/sys/dev/cxgbe/iw_cxgbe/mem.c index 5b8c7391514f..348cd3985e87 100644 --- a/sys/dev/cxgbe/iw_cxgbe/mem.c +++ b/sys/dev/cxgbe/iw_cxgbe/mem.c @@ -256,7 +256,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, u32 stag_idx; static atomic_t key; - if (c4iw_fatal_error(rdev)) + if (c4iw_stopped(rdev)) return -EIO; stag_state = stag_state > 0; From nobody Wed Aug 28 19:31:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvDzl5vmqz5Mbm3; Wed, 28 Aug 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvDzl3w1hz4tKj; Wed, 28 Aug 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724873475; h=from:from:reply-to:subject:subject: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/YwTAx+dy7zuySDqcRaNF/xVawkV8uGUp71FSQCm4=; b=jskaX4kqY3B7TUR+Gio20ddxIZDTaskicjr9ZuK9lUUkAgpYkXb11yWc31jbaZV9UNEoeJ 09HhnuAW8tEbzBFvwpE6SzCbtic1KdUBnkwaAcUemG43Wil8/lphLO7ICgyj3C2c18TpEr ThwkFiDokgGyQR1d2IMh5d5qi5DmQkWfxcNX6yaAWqnZbdky0qrjv+BM3RAFhhGT/mlAGd /b88hhd6ujEYjUJoe+lao5aU56OeBt04GoP4jzHGaLiNl/65MnJXh6wXCLOsamO5Slh8rl vvR6/8jDza5h6WTHvcbpvsXkEDnGkIIWvSK2eWbbx3oRkWmvYtnowidJBuF1rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724873475; a=rsa-sha256; cv=none; b=RuI7gvytMraQsPcE/K0gvj4yJzVnoH4qkd32gYS54Y5gQGiNVT8t3iG5/SGY//sg3hkZg3 AMT52bAB2u520uaWjIQeVxHL6hVvMMpHuc9iLXEpWe6Y3bSSwYQNy0ZrCXmKeIxjKygMEQ foMwNNi02T5M4Llqsfbckr4cXKaA4jdRyqKJ4tvILmayO0MSC3LbnDRPiP8O1FTtLAb0+u 4Fn3CWANvUegIe4SvfsbaMkqUVz22OY3bwDY5P6W8PSvyQxhgpW3WbAcCBCGXKHZN9GMs/ FmiTS9prdc6uXR803Q6mDpxJV0SswRM5V7GDWp2GyEVGpQM+KXP1LoG+U2W2JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724873475; h=from:from:reply-to:subject:subject: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/YwTAx+dy7zuySDqcRaNF/xVawkV8uGUp71FSQCm4=; b=J6SgKTuvEMjJzYmo1tiFW6l/v/f8qiGNSjnFIYtkvZHeXsU7MTsMxdFLLypzPb04euG0J/ c6ixdSXhXKSIqsOdBSt955zS+x8xJjTov4BFfoFL6ybUyXaftmXhmWAOiSaeL1HaxAiaCL F1Tb0SnwMQfMcZaL6F1YSdQd6Td7+TN3YMWk/7VC9IAo8gELprEJAW7e9rlFbxROf2Xq2B KtEwDQNogIaoXJ6H+4SUkn/jB92VcWV8iA2EGyd0rruoRp+LZLa2AgP1+LyHnzV7O/M89a QMOUvlTXLEovtPJg6yhcDm3/eboSU9/3J0+5qoYVQXUqi6+BkpKmBjiWoyGXpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvDzl3WHYzmK0; Wed, 28 Aug 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47SJVFbf089368; Wed, 28 Aug 2024 19:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SJVF6p089365; Wed, 28 Aug 2024 19:31:15 GMT (envelope-from git) Date: Wed, 28 Aug 2024 19:31:15 GMT Message-Id: <202408281931.47SJVF6p089365@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: cb91dc50950f - main - atomic: Fix the cast in the atomic_load_consume() interceptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb91dc50950ffdfd49337e844e231b69b8b5c634 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cb91dc50950ffdfd49337e844e231b69b8b5c634 commit cb91dc50950ffdfd49337e844e231b69b8b5c634 Author: Mark Johnston AuthorDate: 2024-08-28 19:25:11 +0000 Commit: Mark Johnston CommitDate: 2024-08-28 19:31:03 +0000 atomic: Fix the cast in the atomic_load_consume() interceptor As in commit c7a7e997d25d0, we should permit loading from a pointer to uintptr_t. Note that the other atomic_*_ptr() interfaces currently require casting regardless, only those defined in atomic_common.h try to be generic. Reported by: jrtc27 MFC after: 1 week --- sys/sys/atomic_san.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index ef81b4b7c51e..e22324b87623 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -270,7 +270,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ - ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) + ((__typeof(*x))atomic_load_acq_ptr((volatile uintptr_t *)(x))) #define atomic_readandclear_ptr ATOMIC_SAN(readandclear_ptr) #define atomic_set_ptr ATOMIC_SAN(set_ptr) #define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr) From nobody Wed Aug 28 19:31:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvF0S4vZdz5Mc6x; Wed, 28 Aug 2024 19:31:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 4WvF0S38F9z4tSr; Wed, 28 Aug 2024 19:31:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-39d22965434so2955605ab.0; Wed, 28 Aug 2024 12:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724873510; x=1725478310; 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=DRVfuPAtJTI3+7iyGAS+cdBRCnzRb50IpG5TWlfhVCg=; b=ApLXvx0Fa5ZypPlXEmgjl1j6wdNh99WUb7TTojHedLqM0NueIykyBv4xkcTvFZQVEb kpl+2huLVUKeYpcqbg5KZk59kYS+XWeRtRIhHdLzOs+ANX9qA8thLTblXzVj8jk5fmh1 y7vIeAmH1BDU5gooKo2jM3ZDRX5YZCV+TvP1i5HOI2aSEXcQLwsUaDMRV0sB/F7NZJkn DVyaiA5MgOtslpChl7fPEQ+1fEcKXqd24w4QZBtWJFbstG8a8i2SzfgQV7b3n910pjGT H0Ko0HjtAKcIs4/XR3W1bk8Z/tL2piocIwUzQEOdAmzWVWAahg+LSVS/ldGmfqVUNSXM q7fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724873510; x=1725478310; 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=DRVfuPAtJTI3+7iyGAS+cdBRCnzRb50IpG5TWlfhVCg=; b=X6q/SE/25xvAL79GoZW2f6iKoM31be8qcws4up4a+3bI7jzC5UTKFaZs7qKXFjh3EP DonaFlVD53EMFQAGmzcfW/NhBNMPftXyKnlldx9uT9CBsJ133o+LP6CdkTqig0HydE72 oKEleJ0K+9WE6HABvRF5xOvWK4K38fdzizFPVnLdqZXZpr05QdLLMCbgkIlWFfZfPn3y VNEu1VlsWVBTt9Aqxh3DNeQEF85BUtuaSA223jDF0OPu4W/rvkf9GiP1BadAO/CGYyOb q5OX8LDxeg/mxbfaZp84uYM7hRkdeiYwS2NRrHXs+3fAHrxEilidSCkTf3FnduvXGcrS v8ag== X-Forwarded-Encrypted: i=1; AJvYcCUN2lmaPIwlxvRPj4pHB7jyJxxI4O1OOFk/A3gAibxKIFmmoHWcJgjv1Bx4Yacnx5JQ9CP5RqjM4JbiGNiQv96bmNvn@freebsd.org, AJvYcCVddpBFtAfwBekzpV/NYvSF0ee89s1zdRGMPdRpay+Sa3CJzf2OjqIao8cNOz8L7Ew13qdAd7R+4rtL1jRkl3O7BFNpc4E=@freebsd.org X-Gm-Message-State: AOJu0YwzrUh9Sb1lADhi1Na2dM32diZzNfUjh0KxxP0ljsEajH6wT+mB F7A1EOn9R4V81uifWZ6fQ5friNCA+RPBHrJGbv7puXu1/iDfXAO3kq6UuQ== X-Google-Smtp-Source: AGHT+IG0HIe5/wbBbpyH5ygT/mno+Sze7E7rJ3NY7W1Wlgsc8ILQJcUNuTFjFJWrj4S4MSbOXAlOlQ== X-Received: by 2002:a05:6e02:1e0e:b0:39d:4dab:a533 with SMTP id e9e14a558f8ab-39f389db2b8mr2073455ab.0.1724873510371; Wed, 28 Aug 2024 12:31:50 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced0da0e38sm12068173.105.2024.08.28.12.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 12:31:49 -0700 (PDT) Date: Wed, 28 Aug 2024 15:31:47 -0400 From: Mark Johnston To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7a7e997d25d - main - atomic: Avoid casting the return value of atomic_load_ptr to void HEAD branches config description git-daemon-export-ok gl-conf hooks info objects packed-refs refs Message-ID: References: <202408281855.47SItml1024354@gitrepo.freebsd.org> <9559E6F1-0FB5-48E9-9827-50D6BD8E5446@freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9559E6F1-0FB5-48E9-9827-50D6BD8E5446@freebsd.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WvF0S38F9z4tSr On Wed, Aug 28, 2024 at 08:15:38PM +0100, Jessica Clarke wrote: > On 28 Aug 2024, at 19:55, Mark Johnston wrote: > > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c7a7e997d25d0b33769252d002b16839c864c83d > > > > commit c7a7e997d25d0b33769252d002b16839c864c83d > > Author: Mark Johnston > > AuthorDate: 2024-08-28 18:51:06 +0000 > > Commit: Mark Johnston > > CommitDate: 2024-08-28 18:55:39 +0000 > > > > atomic: Avoid casting the return value of atomic_load_ptr to void * > > > > Otherwise a cast is needed to load a uintptr_t value. > > > > Fixes: e1f4d623779d ("rangelocks: remove unneeded cast of the atomic_load_ptr() result") > > MFC after: 1 week > > --- > > sys/sys/atomic_san.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h > > index eb6913296a45..ef81b4b7c51e 100644 > > --- a/sys/sys/atomic_san.h > > +++ b/sys/sys/atomic_san.h > > @@ -266,7 +266,8 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); > > #define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr) > > #define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr) > > #define atomic_load_ptr(x) \ > > - ((void *)ATOMIC_SAN(load_ptr)(__DECONST(volatile uintptr_t *, (x)))) > > + ((__typeof(*x))ATOMIC_SAN(load_ptr)( \ > > + __DECONST(volatile uintptr_t *, (x)))) > > #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) > > #define atomic_load_consume_ptr(x) \ > > ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) > > This variant is similarly wrong. Thank you, fixed in cb91dc50950f. From nobody Wed Aug 28 20:39:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvGVf3TKDz5Mj1W; Wed, 28 Aug 2024 20:39: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 4WvGVf30Qkz41Qq; Wed, 28 Aug 2024 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724877578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmVvy4SCeRxKdldD0uO8fQmVPmjHfLNfbNiUq4Y1aVw=; b=fFC3PrPPxRgYu7N7bWzXyFi6pGN747ePJVNeAw16C3fqu+RfoU26jkSLjUeP680XYe/7md jty+V2VHCDv8sBkUZ5cedpOgFgnnZVfQX6pzLkB1DVvmPYJa37xUL0FF/rgA1qUbO6shWj qCFTmodZi/0crmUzVnjRR6O2a+1B/hoobi/AU8r5axKzlAzuja98jiyraSPuBNE5Ztfdxh 5QXN9I3b4NeS0m71i8zMkVTIJDJBaAyXsgpeu+Ctem7FWdaaQRH3+eFvCUaU8/1oAnofTL J2GWa/Q/C1X0Ncdb15GxpLgb5JAgEPE+u/JHOZ8ME9eKMyVBFjzmjchA14gv6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724877578; a=rsa-sha256; cv=none; b=SJff5UjHDGcv3TWni07XXEoy4k2TfKhcf1kTouNzwhPv+fDe1N8LlabzrI9xTHnqitIYUT 8lnyrFjribJWKJZIsvpfm2P+b2m54Hd5cMEVzJMlB+ogaGIBOziKP7Ww07FqjApfIc+OfH /gfhx51hjIdUEqk013/EUpocLIWW7nqXqQ/a1lWPuExdWQnrmvEI2D3sTtbZhMVkIP2lN5 2uRKsMtvaKHh3NfK2rONCUBtBx9gP0GrhPOcbyMiBU1Ijlor62ds8TG+WCtaU91uEnxRGr a9Q8zmghW/T5oTy20FwVOa/RFv6zJ4HanpVN/Fy510ESxOCsOaiolPSITDlArQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724877578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmVvy4SCeRxKdldD0uO8fQmVPmjHfLNfbNiUq4Y1aVw=; b=h1kjrqxNiqoUizjxyTom8an87NvQjjcu2tkdUq8RFXnSL9KmMQ29yM3upPhcAUAvmBkPtS Zk3nUFPk28VZMuNyiVlEJ5DHNNSg0Z+MfEKqtTm/LqqKEeuyHP+YnNnqJAxTzQN6wzuwGc AEH7nqc+WcqHuam37sTyLWUWVjS1PbMUisj+16fGv7UUI/qBAJ7l6BvSWe/6RPy/gAoxTp JGSQZDGs9/ZyD5g+2gL0c+qRLVcMDFfIcIf0ozjR7BdzIrlVYDKr0Efw0Li9nntM9s4dOb CTieAO4DUuKc2dMEvhWa5YsRycnC0RMy385z4I3aiUon3F2LfRSqWKMncBM8pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvGVf2c8WzpY4; Wed, 28 Aug 2024 20:39: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 47SKdcmx095719; Wed, 28 Aug 2024 20:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SKdcjS095716; Wed, 28 Aug 2024 20:39:38 GMT (envelope-from git) Date: Wed, 28 Aug 2024 20:39:38 GMT Message-Id: <202408282039.47SKdcjS095716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f622dc5daecc - main - x86: Detect NVMM hypervisor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f622dc5daecc5c05504cfc605b6f2d66a3bd90e8 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f622dc5daecc5c05504cfc605b6f2d66a3bd90e8 commit f622dc5daecc5c05504cfc605b6f2d66a3bd90e8 Author: Kevin Bowling AuthorDate: 2024-08-28 09:31:35 +0000 Commit: Kevin Bowling CommitDate: 2024-08-28 20:39:07 +0000 x86: Detect NVMM hypervisor MFC after: 1 week --- sys/kern/subr_param.c | 1 + sys/sys/systm.h | 2 +- sys/x86/x86/identcpu.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index ea5e8d02be2b..7d58208a461f 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -157,6 +157,7 @@ static const char *const vm_guest_sysctl_names[] = { [VM_GUEST_BHYVE] = "bhyve", [VM_GUEST_VBOX] = "vbox", [VM_GUEST_PARALLELS] = "parallels", + [VM_GUEST_NVMM] = "nvmm", }; _Static_assert(nitems(vm_guest_sysctl_names) == VM_GUEST_LAST, "new vm guest type not added to vm_guest_sysctl_names"); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 6c2b466c4cfe..61874a05e0b9 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -79,7 +79,7 @@ extern u_long maxphys; /* max raw I/O transfer size */ */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_GUEST_VBOX, - VM_GUEST_PARALLELS, VM_GUEST_LAST }; + VM_GUEST_PARALLELS, VM_GUEST_NVMM, VM_GUEST_LAST }; #endif /* KERNEL */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 4da250c535a0..f24fdc1647e6 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1370,6 +1370,7 @@ static struct { { "KVMKVMKVM", VM_GUEST_KVM }, /* KVM */ { "bhyve bhyve ", VM_GUEST_BHYVE }, /* bhyve */ { "VBoxVBoxVBox", VM_GUEST_VBOX }, /* VirtualBox */ + { "___ NVMM ___", VM_GUEST_NVMM }, /* NVMM */ }; static void From nobody Wed Aug 28 22:43:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvKFd0vjtz5Mt8D; Wed, 28 Aug 2024 22:43: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 4WvKFd0Pv1z49WS; Wed, 28 Aug 2024 22:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724885013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ezRUbp/hDCWkmMyWqpepEARf/gW3PZmAHjG2PXMko7c=; b=bV6GQVkBDQAC6xsS49Ens//tW3aQ7SwmjAxJjlOjNNoLdSBah7LnpJ4Owp59mgKpm3kdCR ksGCBWxxBEDP9iZC9axD07G+96wXK25x67ZodF70MBZCfNbKXiLbcrvUWDTmW10UeOyGiN ysUwRVHfdVDZBLpNiiZmE/G8owWpUZdQow/7erdJWb3fkt7B1B0hQ9mX/a14ZabUJ8DKkh 9ZS1TuXrMEowMfeAX+uV1uRSIWpPPeZDXEcdgekDnvjWEfXomS8OQYxQ8MxaZgDBZNqOO4 UuFgFkOMJjpB5G1zYYQVorN7rvRtj75/ZZgb66za0fkVFA5bvFqnKLym2uutww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724885013; a=rsa-sha256; cv=none; b=kdv3RZpmjiSJ1XIdadIdq4f1I91WZQK4OzO1YaAVGoSPja12PhmdrlQQYnFodnYOoYm7Bg 01hfoeKhUG5Du2iCFmFm7XpHHvqyu8IZnsBOMtGr5nlR/58Kf7Imr5c/GbeeQdy77sfDEw 2+9BpJT9PqL4hBQLPPTDwkjkbSrFebrdC3k7jpl42iF021YeUJf9sZCPhXOsf4WulxuxXX /eQPn1Pxfs9BJwGY6b1kqLWY5snjuVu3QTi6PLTU6o+JmHAPjZtFgJk0+DgvJYQYjYhNSu XG3VxobleFd88b/XVIZan6xVTGbQq+ZBGqqmgaXjP2BInLA7g77jTtL+X7oaZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724885013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ezRUbp/hDCWkmMyWqpepEARf/gW3PZmAHjG2PXMko7c=; b=d71meSWpNbwuCWNZuEwC157TjF4TzPJEfszioy9UbT9DVl/FoBfAjn+/e7Up5+ggPnhwMS qxdzvMhEM4JCUhXfMkTPuM346UoHfFQSNrll1rPQAhw2DLh3CCfHYKYoHERaEzJVoPIBkL yBd7hfKUjUGS0Q27EGMewHibqL8j4YdzMx4qaD/ig2wjD173BuSDu/GYt1YR4DrN70uqCf peRVmWDzVzTQKFsVD6kfv3wtbvOAPTRsU2/PEeA+IvkCs3fbtIUBMmlxQU1gxgQenSUup4 HvJ1hWFGc1vytMA/nPXsv5PqdMtzPREYUQg4fdn5ZnyFOmblU150nfWE+bocgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvKFd00cmzsTv; Wed, 28 Aug 2024 22:43: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 47SMhWnQ014484; Wed, 28 Aug 2024 22:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47SMhWfP014481; Wed, 28 Aug 2024 22:43:32 GMT (envelope-from git) Date: Wed, 28 Aug 2024 22:43:32 GMT Message-Id: <202408282243.47SMhWfP014481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 18aef07cfac4 - main - beinstall: Pass -B to etcupdate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18aef07cfac41fde763e1328366cc6e334bb9254 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=18aef07cfac41fde763e1328366cc6e334bb9254 commit 18aef07cfac41fde763e1328366cc6e334bb9254 Author: Jessica Clarke AuthorDate: 2024-08-28 22:36:56 +0000 Commit: Jessica Clarke CommitDate: 2024-08-28 22:36:56 +0000 beinstall: Pass -B to etcupdate Since commit 246364454fc1 ("etcupdate: Use new buildetc and installetc targets when available"), beinstall has been much slower for the etcupdate step, as it's been doing a kernel-toolchain (admittedly without LLVM itself being built). Given beinstall requires an object tree to already have been built and just installs it, we can pass -B to beinstall to reuse that tree rather than build kernel-toolchain in another one. Reported by: olivier Tested by: olivier MFC after: 1 week --- tools/build/beinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/beinstall.sh b/tools/build/beinstall.sh index 7f7481b671f5..dcafd1030c91 100755 --- a/tools/build/beinstall.sh +++ b/tools/build/beinstall.sh @@ -48,7 +48,7 @@ NO_PKG_UPGRADE="${NO_PKG_UPGRADE:-""}" # Config updater - 'etcupdate' is supported. Set to an empty string to skip. CONFIG_UPDATER="${CONFIG_UPDATER:-"etcupdate"}" # Flags for etcupdate if used. -ETCUPDATE_FLAGS="${ETCUPDATE_FLAGS:-"-F"}" +ETCUPDATE_FLAGS="${ETCUPDATE_FLAGS:-"-BF"}" ######################################################################## From nobody Thu Aug 29 01:37:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvP6J3NbPz5PcbF; Thu, 29 Aug 2024 01:37: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 4WvP6J0VBPz4SbB; Thu, 29 Aug 2024 01:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724895448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x+LJ2N9Q/SvZBXDKhxCWo+JEORGYoBMdLu5O8my5LKI=; b=oJPPEXTNCz4qeeGr3v4UmSokrUNT+LwcqxuUqSAZkxSiPY3oHjwqJhLD+2m74ekXHpchgW BP8VqWuxw02pElN8y3J5ofubwVUd8drsM50tWRvCK+xm4uLdZUCjRonvElDOhTTwx25SD/ BAFeXGw5FwBsPTeVx06kiz+7kDsUEWaBF3EqejFHfV57/baWb+GD1Pli/nE3/1vqDUHBRQ QTwmXz6SgKJ3jKzL9dX9r1Bau+hc1OmcuR+FYCsQ2/fl7h3FAH0ZndgYvrPkNuJl2gD4IS H6MzjsKha23vH4Md00T0sChW/zowHkVPsoMQneMVjY6Pmgk6DUwRF+lmQAyhCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724895448; a=rsa-sha256; cv=none; b=eyx/B8tC4uprei9yGZbOlDA1Wp054eRnigbye0/bDIveiZOcELRgVEUmgHgVrJVIyvPOpy UGtF4nykvcEOChqMGGl+p4uZSaCfAgLjxkcuUFaOuLtrTfuM0L6ElnD6Qq/iHnlWkv61HO E3NO9NB7ZZo/J0cszEaaqr+zbi8rQfpfTGvdemZRd/lfpBt3wljYX1/YAp8uh2C9q9uA/g pmHR+gITg/SvFcla+SQr2QqYh/OaNpvR9b3mO/HT6rSMFUB5eJv+AeuJON9zzUuILuNr8y McvUx+I5054hNcRB/WKkEeF2thasatXhpvmIcu2IMfpdL/b0MohKkEIzTM/HNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724895448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x+LJ2N9Q/SvZBXDKhxCWo+JEORGYoBMdLu5O8my5LKI=; b=V+vTO1+InUksQWncuxy4y7xVLO9UKeP7+pwRD45UxpAEmxyUJJ78f0n9gst4/a897J2HMk DEmXPEUNSl8t75UyaClLimhp0wEQw4p7b5xmxPqcL//LVRIWrIY3CddsxV7SZ6i7C9imV0 SU5nq7gsgaBWogR0qx4BIbkCTZrkiDUH76l1yWZhBPKxQZBRMo8yctKm8ydhC0nieqKirh gVXvaKl/M8DashMBVIXXJJDCCExxH78LnQD1fNJUDd3YgdDorI61ro3QQPApnRlJm6WnL4 5A9pjbY3uO3jBhGRpQzZgNKuXAW6lSpFZBLfthOi/KANjRGJ68i/But0qJpHVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvP6J05R7zxhv; Thu, 29 Aug 2024 01:37: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 47T1bRfK003294; Thu, 29 Aug 2024 01:37:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47T1bRnw003291; Thu, 29 Aug 2024 01:37:27 GMT (envelope-from git) Date: Thu, 29 Aug 2024 01:37:27 GMT Message-Id: <202408290137.47T1bRnw003291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 62775aebf725 - main - rc.d/devmatch: Silence sysctl hw.bus.devctl_nomatch_enabled=1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62775aebf725a79703592f3276118245a74afdac Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=62775aebf725a79703592f3276118245a74afdac commit 62775aebf725a79703592f3276118245a74afdac Author: Jessica Clarke AuthorDate: 2024-08-28 23:26:26 +0000 Commit: Jessica Clarke CommitDate: 2024-08-28 23:26:26 +0000 rc.d/devmatch: Silence sysctl hw.bus.devctl_nomatch_enabled=1 As with various other rc scripts, we don't want the output from this being visible in the boot log. Fixes: 6437872c1d66 ("New sysctl to disable NOMATCH until devmatch runs") MFC after: 1 week --- libexec/rc/rc.d/devmatch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/devmatch b/libexec/rc/rc.d/devmatch index 21846355fcfe..0999159bb332 100755 --- a/libexec/rc/rc.d/devmatch +++ b/libexec/rc/rc.d/devmatch @@ -46,7 +46,7 @@ devmatch_start() if [ -n "$one_nomatch" ]; then list=$(devmatch -p "${one_nomatch}" | sort -u) else - sysctl hw.bus.devctl_nomatch_enabled=1 + sysctl hw.bus.devctl_nomatch_enabled=1 > /dev/null list=$(devmatch | sort -u) fi From nobody Thu Aug 29 03:39:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvRqP1SbMz5T2Dj; Thu, 29 Aug 2024 03:39: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 4WvRqP0hdRz4g4m; Thu, 29 Aug 2024 03:39:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724902785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t4xB94cajMt/FZMSQlqLwLbaI+12/HIjK3P6qStC15w=; b=DNsVPSYefxCUbSVIwU/EOipnRjg3oBXN1WAOrNzXH+kdukuQMP5skEebAg2j7BiBfKAilg LMeCUXPX2ss78xz6dmo6w2TU7N6Uu3CbSs+SZ63kOhmEl/H3HYckopRZ5XvGabijyuY+3q TJP1oHNH9fsEb6QejbqvYsJB6zio3t1SDSvj1/Xe4svUlhMZ78gyL+8HRwobDyIS8YqQo1 Wh6IijBn2tnBLWohjP4Lw17okFkHL9C9AyiRDqLDPqbZBTmUQUnzqDMK/MvJJN8VVfbkGZ In5bL0O0nJWffDIji6IzE7M5zpQD/QpKrUUF9x20GeyGFR61Kiu8uCWfiCIKPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724902785; a=rsa-sha256; cv=none; b=FORRYhLcG8AdTFpxhKJHxBi9DJsyOlrd3UNXNSZU4KqHnqY3jEddrCPB99or0naRW5aE9r MmqkiOm1aXUHi957Rhx6SAHAK/icyPNN7f06+kFFfuxB5MMvs5im9OcPDFubVEapj8oefO Hot24h/DYXG/tEHCS2DvWnYvSTFuvRxhe+2hkhRjlWqN/+0dCfRYk2NKbh0/brtg/SbK0r cKVj129UmhQV6zphYDMjT4jd5++qGMeROXnIZtU0FK/njn3Dk6j3UD3Lcxd/MBfkKU7KOb 6aOPrAUw12/pWWXAjJZ5wVZCy6T5gZL4pXu+V6flUWaFCVdnDQlf16KsHrwGoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724902785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t4xB94cajMt/FZMSQlqLwLbaI+12/HIjK3P6qStC15w=; b=D5OyVBfLPPrI7cLZbidYQqibF6r0tChiGJnURkeMgi+dX8T+rxHOvcSBv7oi0UPHvLWOmp o3x39ynQNgs0hKC7uLLxPDaRlsLXdO1bYN5JD0VkAUq3rKOTQeeDXf0x6x67/lEgtuNrqw XG3XFV78k2TP/8d1EYcJ1Nm1Fjabs5sYMvcFv8zhCUs6rsgYnH0k+SdfA9NLuz2C/fjw3i Pd8e7H2gw0GJ46au3cWeHhH2iX2Zl6CRGYLTYzUj09GwUZljDg9QnCy2P30zYs+fY0E6XH JBsqSih3f4QlFDzaF0iOd3MTrR9U/Ecxm9fMQP2Qjd2Y9CT/PAuaeUc/ehVthw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvRqP0GQWz1207; Thu, 29 Aug 2024 03:39: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 47T3diGH008555; Thu, 29 Aug 2024 03:39:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47T3diHQ008552; Thu, 29 Aug 2024 03:39:44 GMT (envelope-from git) Date: Thu, 29 Aug 2024 03:39:44 GMT Message-Id: <202408290339.47T3diHQ008552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 3f250bb6f05b - main - cxgbe/iw_cxgbe: Tidy up a couple of CTRs in c4iw_create_listen. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f250bb6f05b57890215398767bbb8aa00c888f3 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3f250bb6f05b57890215398767bbb8aa00c888f3 commit 3f250bb6f05b57890215398767bbb8aa00c888f3 Author: Navdeep Parhar AuthorDate: 2024-08-29 02:33:09 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-29 02:40:04 +0000 cxgbe/iw_cxgbe: Tidy up a couple of CTRs in c4iw_create_listen. backlog is an int and not a string. While here, fix an adjacent CTR that was spread over two lines even though it fits in one. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/iw_cxgbe/cm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index 257dec81f384..c3d334aa0f62 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -2706,11 +2706,10 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog) struct listen_port_info *port_info = NULL; int rc = 0; - CTR3(KTR_IW_CXGBE, "%s: cm_id %p, backlog %s", __func__, cm_id, + CTR3(KTR_IW_CXGBE, "%s: cm_id %p, backlog %d", __func__, cm_id, backlog); if (c4iw_stopped(&dev->rdev)) { - CTR2(KTR_IW_CXGBE, "%s: cm_id %p, stopped", __func__, - cm_id); + CTR2(KTR_IW_CXGBE, "%s: cm_id %p, stopped", __func__, cm_id); return -EIO; } lep = alloc_ep(sizeof(*lep), GFP_KERNEL); From nobody Thu Aug 29 08:01:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvYdC0BSmz5MVc3; Thu, 29 Aug 2024 08:01: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 4WvYdB6s6gz45XM; Thu, 29 Aug 2024 08:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724918479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dt+r1nqgjs4/1PBbTWN2z8g+jM6fNG18ZQx4ujCBpqo=; b=KP5MmwIQpWze10hLYMNp2mgmTwUtCw0P8iUQmQB538iR2wjbCIGFDiD08GOtLdd/x1nz/j 8bjgsSAu7LqVDGZY9Hw0tUH5pQPF9spuwL8DcMywCtQNc23F07O2nWP12ouZ/3J7r0VnTo Lkn33UP0R0U6SIXZ2oCNLHpT0ZMRTT/kQqx2Cm3+SsC1lYIAq5ul+JmIK8d0CAV1DGjiWq cEZXYD6BqsCvJqIT0FWqqgeeo4wE0REoYxrD8mt6n7tXzAyCwtYWdU1AnmZUejBk07+5Ad 14WVgWWGpG6prBExoHNIiTGK8YCkx8OtVrIdxWzmPkE6fUaTdWeiz1v2vOekYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724918479; a=rsa-sha256; cv=none; b=pfXsqw2dudTl4MLyOlrC9vbHosItjLzULjhEZWELg5QlYW+P4TyHLtJ1nOmZ1yqbtSLwWn N4TlyqKNgA0KT5tqjP/tvZ2AYY1vxHb9bIeXB8AFCQBpaUp1rDAZHZMRjBYy/Q57PUn+P/ aB6sphizNzt7UsyRVmradAuE3gvdLswn2CadA/khtsz7LSd4hPNx5SI9jYiv9dSOjrAEHt X92Pq1PhihLwiqdWMtfEbbG44z54q+nbEdjJlgyoIgP1L1hv5Y3VgF5oGrjThBcamV7Y5C N/KU5EC5w3LQE6ikvluz027Bh/p8YKKLC4vogO/aC14aInRbB7Qk//5hvDfgwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724918479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dt+r1nqgjs4/1PBbTWN2z8g+jM6fNG18ZQx4ujCBpqo=; b=bC8CCzxxTV8tkkniZclrVimKOVdcTzQeczFwtsxmoKZ5dzNdcZqx+y2I0HMr7ZNzPivL1i aWS4XF2Ysy8z8pPVaXd0h7MFtS3wN7dDk0eKijPrt9Jzv3gurZuEElTnvhtsSBlG9nXMSf grpPdSIauk3xH/55Z6qMhxPDgNL+7T/cfOkaMY/dZZSwyx4meNVEOqz+lhMy5icY8kU0Bo NTPT7Su812qtKGeVs2irfCpc5cvxkEbj5RbrHTt/NkcAyL+saLxtgG+HBt+yaA3QF4h9EE K51XA+4UxXx63hI047z90DJQXtNvOEpd/V4X5LS0ElcOXLU3gkHJ2lrL/rTJTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvYdB6PV0z18X5; Thu, 29 Aug 2024 08:01: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 47T81I7U064427; Thu, 29 Aug 2024 08:01:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47T81IP4064423; Thu, 29 Aug 2024 08:01:18 GMT (envelope-from git) Date: Thu, 29 Aug 2024 08:01:18 GMT Message-Id: <202408290801.47T81IP4064423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: c7c3f6351e96 - main - stress2: Update comments and remove one test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7c3f6351e969d9659376ed24286d2638fc4d794 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=c7c3f6351e969d9659376ed24286d2638fc4d794 commit c7c3f6351e969d9659376ed24286d2638fc4d794 Author: Peter Holm AuthorDate: 2024-08-29 07:59:16 +0000 Commit: Peter Holm CommitDate: 2024-08-29 07:59:16 +0000 stress2: Update comments and remove one test --- tools/test/stress2/misc/all.exclude | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index 91fb68afabfc..f8a5ea4a91f1 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -14,9 +14,8 @@ fsck10.sh Waiting for fix 20230319 fsck11.sh Waiting for fix 20230319 fsck12.sh Waiting for fix 20230319 fsync.sh panic: Journal overflow 20190208 -fuse.sh Memory corruption seen in log file kostik734.txt 20141114 -fuse2.sh Deadlock seen 20121129 -fuse3.sh Deadlock seen 20141120 +fuse.sh https://people.freebsd.org/~pho/stress/log/log0546.txt 20240828 +fuse2.sh https://people.freebsd.org/~pho/stress/log/log0547.txt 20240828 getrandom.sh Known DoS issue 20201107 getrandom2.sh Known DoS issue 20200302 gjournal.sh panic: Journal overflow 20190626 @@ -39,7 +38,7 @@ mlockall2.sh Unrecoverable OOM killing seen 20190203 mlockall6.sh https://people.freebsd.org/~pho/stress/log/log0430.txt 20230403 mlockall7.sh Needs further investigation 20210123 msetdomain.sh May change policy for random threads to domainset_fixed 20210104 -newfs4.sh watchdog fired. newbuf 20190225 +newfs4.sh watchdog fired. newbuf (still seen 20240729) 20190225 nfs10.sh Double fault 20151013 nfs13.sh mount_nfs hangs in mntref 20191007 nfs15lockd.sh panic: Assertion td->td_realucred == td->td_ucred failed ... 20210211 From nobody Thu Aug 29 10:43:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvdCx4ywSz5MkPW; Thu, 29 Aug 2024 10:43: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 4WvdCx499Bz4P42; Thu, 29 Aug 2024 10:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724928189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kPvWH55tekctlZi5w4S+uPwik24tWywspdC45q71czQ=; b=ZSsTEGum6FhXMHqC3r5Q7F5ZDAkL3/KavFCAWavyidi89AK6pLW/3sByuw6Q5gHz3PqZ5o Zaz5uCkl3kfxlc2EJ1+Eo1Y6DLyfeKlSQGIaWJE++MuQAIIf8b1THzvUm4d3xDkiXFsvSx sRr1poYNTB6Px+GLkEH6xYiCoXdKWuNiHo0Yf8zFB8tIVn4///FZ5vmw41GubWT6JuaD31 iDLJPMFsIb9cZHnj24cUo7wYTyH++vsIySNgsieHfAj0LfF6K4XSZ+rXElWIPcuelgxtZJ +h+KMyqiJcT8QJ5gQ1RJOhzWuUfy+XtVITU4vy+dk7AVI9bHFWvgWiYCjfXbCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724928189; a=rsa-sha256; cv=none; b=oT9jc+121jqDzR4spsLgAN71O4XYvbIxCBenyxFLLBrwzZ1QsLzv4IbY9SAdvdyqn2ap2g RLRyNPYmNHtKxDyiKK4Vbjy4K9o5r60jg6B50lMEXzrmBFeZB1O2kT1sNvlkXfxZU8OH4z bFDlCF6N+zia5N/uMpZhaf834ehVdQNYCwjXdtgNcgIhUfhUhGKVvtE0ltDoH2uEk9mfwq y0oPABOUi9bLHEr/pX/JGaKidlFgsq184QOfpPd609yzWf7tTMi8KgchXyVwGFFo9WDL2l wYI0Xkt7v2uXCYMuzyrxWS54r8vQbmFNLTX9vDCNVdPCRDyB3wi3Q3aqab33cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724928189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kPvWH55tekctlZi5w4S+uPwik24tWywspdC45q71czQ=; b=mSuewP99/ZjUHuYuuxJZaHKt2/YroM24ecCbWFJXHiC86aD5GUTE3G8KOyFPNNGN96Lapw 88M1+Eaz2gahMLGBoh4z9ZtZEDh54mkTG2JTEb4zJx2jjoSFxPcbGfIoC7c/WQTl/MY90z RiQ7mo2O09/m0frPuwQpdO/5R0s+sKTU7QG/J3XBrvckHEOqZDwEVO2mqew4D0ajxj/b71 SRHyIWS1caqO87wZ98ZHVhb54WvrYfMHdejaM7lKIyXrl8qKfKqYJfwaRy6D8Vbw44wnyH 6vIr9j4BTOYr7stL2DvVzWqtu8KeRJGFbnpB2VETM6/UakDSzqXO5JWWsxd/Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvdCx3gnqzFMk; Thu, 29 Aug 2024 10:43: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 47TAh9ED037176; Thu, 29 Aug 2024 10:43:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TAh98F037173; Thu, 29 Aug 2024 10:43:09 GMT (envelope-from git) Date: Thu, 29 Aug 2024 10:43:09 GMT Message-Id: <202408291043.47TAh98F037173@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: 8b017284319c - main - arm64: Fix the ESR_EL1_op2 value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b017284319c46d349abee5573d4656bb377b0fd Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8b017284319c46d349abee5573d4656bb377b0fd commit 8b017284319c46d349abee5573d4656bb377b0fd Author: Andrew Turner AuthorDate: 2024-08-29 08:51:30 +0000 Commit: Andrew Turner CommitDate: 2024-08-29 10:42:34 +0000 arm64: Fix the ESR_EL1_op2 value This leads to an unallocated register. Fix the value to point to ESR_EL1. Sponsored by: Arm Ltd --- sys/arm64/include/armreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index ce21bf4de0a9..a04afd57585c 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -676,7 +676,7 @@ #define ESR_EL1_op1 0 #define ESR_EL1_CRn 5 #define ESR_EL1_CRm 2 -#define ESR_EL1_op2 1 +#define ESR_EL1_op2 0 /* ESR_EL12 */ #define ESR_EL12_REG MRS_REG_ALT_NAME(ESR_EL12) From nobody Thu Aug 29 13:51:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvjNs6ff9z5PTf8; Thu, 29 Aug 2024 13:51: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 4WvjNs647Yz4ftS; Thu, 29 Aug 2024 13:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724939469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smfGShyH+mGQnhM/S0HzA9p4rOENWIvfXJWjZkTGUN0=; b=ak9ADn+czsIu0uNSEVCoCJq7oxQJXdmLyAr21475Dw5bT7GV+DIlz0tyrBUYzGWMa4Yfls lG7Sl9BUJ55ltIaZY1T80JUkPoQOxvNfI3rThBrQ9+a0hQZxEfiSFsmKyzNgTWQBWGaaf/ AJBXXofP8+h86rkZtZoVJm7UheB4YuKrSjjUF/oFV9bRn6tZdY7nTPXLoXqr4ERWWHHxdB uPDN1mb64OxkCFvRCGC8MP6gMimD73XuXJPntq1wWC+6QRSa96v2izKuRIdr2QOkfPV8m+ 2f561qJacOWVFDG4P/6M6UZsq1+YVSnnTArHgIRnyx6mP3CBd6idK0Q3fao2Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724939469; a=rsa-sha256; cv=none; b=FOufqgi/5WjChXV9JWCs8/SRXxslW3invDB5DmXu7g1tCRrls0D02wgbWNLuMUfamNTXR2 7wFwWj64n/H865GbmMoyINebWrguVbx75P5vgo8RkGvcZTeAlL/SpPsRbCKObiUiHu4uqn uM6Zej+dizxMGq7fC0D5rP3qjJwtlTQENZJ+/bd0R7Bc8EqXzjqIpQSw8Wqj+ek/JhlufI afHMyIBEIbEc7lOnlPwq/FOlmDQkRblfuEep9QRaHkg6kfzSqVo0vSZlaSLWacOlk/OPqt pv9550SNVkgfZtOknqCBkqbzO2jMdyQGCRzw5OxACa+m4ATrRsKVeqTvmLjS0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724939469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smfGShyH+mGQnhM/S0HzA9p4rOENWIvfXJWjZkTGUN0=; b=KVC5QpQD9XsN3Y3Q7wk5y4bzxt8ZxIdX1V9hiDi4ztdJ+e4SFjnafDp+HkpvMSUhd7wz2M c6w1Xrm7WieGspEyQcifAhpyH4+e9WA5RyQZkgo/Kntuj2tXJa7ahqyf0IG2gM5tqP4IRT oz7QfVqCUzYe1WTuJfz7P3WwK9aLYtoAKCs9TiCoKV+MYhK6rNF8GVbQTUJNK93MNouC8k WCKMEDAn22ij/hh8eb2KDkf7Z0dEYd9PsWkxmF7PpAZ9aeo+P35ePm+nljzuBzdR+Hj26X /XCpN3lpSt9N2Ioj1zJTDK5Y6wiKX/qr4sB8XDcojobJxJbr/Of416q3t6wJDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvjNs5hGKzKL4; Thu, 29 Aug 2024 13:51: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 47TDp9EH052303; Thu, 29 Aug 2024 13:51:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TDp9fZ052300; Thu, 29 Aug 2024 13:51:09 GMT (envelope-from git) Date: Thu, 29 Aug 2024 13:51:09 GMT Message-Id: <202408291351.47TDp9fZ052300@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: 0c605af3f9d9 - main - netinet: Explicitly disallow connections to the unspecified address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c605af3f9d9e66be6af0a3bbc36dbedc5dfe516 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0c605af3f9d9e66be6af0a3bbc36dbedc5dfe516 commit 0c605af3f9d9e66be6af0a3bbc36dbedc5dfe516 Author: Mark Johnston AuthorDate: 2024-08-29 13:11:15 +0000 Commit: Mark Johnston CommitDate: 2024-08-29 13:11:15 +0000 netinet: Explicitly disallow connections to the unspecified address If the V_connect_ifaddr_wild sysctl says that we shouldn't infer a destination address, return an error. Otherwise it's possible for use of an unspecified foreign address to trigger a subsequent assertion failure, for example in in_pcblookup_hash_locked(). Similarly, if no interface addresses are assigned, fail quickly upon an attempt to connect to the unspecified address. Reported by: Shawn Webb MFC after: 2 weeks Reviewed by: zlei, allanjude, emaste Differential Revision: https://reviews.freebsd.org/D46454 --- sys/netinet/in_pcb.c | 2 ++ sys/netinet6/in6_pcb.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 70ddd581895f..6ea197cf68d8 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1336,6 +1336,8 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, faddr = satosin(&CK_STAILQ_FIRST( &V_in_ifaddrhead)->ia_broadaddr)->sin_addr; } + } else if (faddr.s_addr == INADDR_ANY) { + return (ENETUNREACH); } if (laddr.s_addr == INADDR_ANY) { error = in_pcbladdr(inp, &faddr, &laddr, cred); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 098b4e50483c..501434f2fac6 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -368,7 +368,10 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr_in6 *sin6, */ if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) sin6->sin6_addr = in6addr_loopback; + } else if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + return (ENETUNREACH); } + if ((error = prison_remote_ip6(inp->inp_cred, &sin6->sin6_addr)) != 0) return (error); From nobody Thu Aug 29 13:51:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvjNv0C2qz5PThj; Thu, 29 Aug 2024 13:51: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 4WvjNt6jplz4ffV; Thu, 29 Aug 2024 13:51:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724939470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xh66Z2S306AMs42ymgNji/UHzZlWL48lJ9Xp23CF3PM=; b=h/q31D4uALRzbgIMLisqvh6m9OVylLeWulJz5cgbBbrei+KGBqMV42fIz3ZZeCLlNKGW2b 4SpnRAL41oMACM4phD3KZGKveTs75FMSS2sCmJHs1thYBAs8kwq0FQee3rI1bzWkmmZy4b pu8yQubmprthBkmsI+e+JWJg5Zc5731ucaQOyuJv2uWWB0yq8jIoDtjVHQteQhxn/0+Cz7 r9vfmQ3PHUE5zeA1sVDKcLBvKGU4oTxjjFcw9sZqsEfJBLgOhh94EPpVDVrZ3VYGKgdiPF vRhzN2m3oEnd2/n+IFVwRhxR+Tg5p36AW7UaGh5njpX100CfczKJJRxysSo0Jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724939470; a=rsa-sha256; cv=none; b=ZLPjKTL9dycDIxZLOp4wKNtRMum6QlYYZry0w1Od39cNbkH8iLf2iizAzof5FVonUM/DOi 8sgRCc9UmgePMsD7i7O9WDuHV5LCga+jcK14sWrT0EoJNJRzk8C8HLgRP6/KalCMWVVljU Ed3XbHKpWkBryFgDL+IrNvBFMgFAfoUC4bHgFALB9ed4ChwfJpRNYvrMcv8rkfmufa2Za+ Gd3jUD8GOHWI8sCyI4TPvi/f1Ckm9yc35t346blFhhlf05S8zBNzhsYmi5tOFcY+DaBn5x 0vvRUYAEkPvjyx2FOQE6ylh6lLDmIFralGZQAbjUwqxX6R+FeYciysQNzA6GSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724939470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xh66Z2S306AMs42ymgNji/UHzZlWL48lJ9Xp23CF3PM=; b=GdmMXMlb8VQfB9Q5fG9swMF6BNxgjv3l1bmzvwxmeiaXx+/TorrzkQ/KnAT+tjBc5WWPk0 TwpjgDHf7qkWN7Edj5rPVF/OrhRc0hEMiuENEKq1ypCdZUy3FuXc7nYP42z4gCkREuZrkE GiCeOAUjqwWFi4sv3WVuWQQ53TWicLxlaK3my+XuoM/vQbyFYP6l8ihefsJ9XsnzbMXRMb 5q+Vbgs8YkQ0Fwi5R075x6KnytiC5xd0JxrDl8Grs68LYpDS793cwWaWzqBk5NFalDJ8HG 5ONhxyVG7CtJA9QHf6YLtKAdAC98GS1qpGs0JyJUutwRB8jk9BmpjAB7FclOQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvjNt6KS2zKWl; Thu, 29 Aug 2024 13:51:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47TDpAi3052350; Thu, 29 Aug 2024 13:51:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TDpAQp052347; Thu, 29 Aug 2024 13:51:10 GMT (envelope-from git) Date: Thu, 29 Aug 2024 13:51:10 GMT Message-Id: <202408291351.47TDpAQp052347@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: 12500c14281d - main - agp: Set the driver-specific field correctly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12500c14281dc62ddeac4c5e1e6eabd1e380f11c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=12500c14281dc62ddeac4c5e1e6eabd1e380f11c commit 12500c14281dc62ddeac4c5e1e6eabd1e380f11c Author: Mark Johnston AuthorDate: 2024-08-29 13:12:19 +0000 Commit: Mark Johnston CommitDate: 2024-08-29 13:12:19 +0000 agp: Set the driver-specific field correctly PR: 281035 Reviewed by: mhorne MFC after: 1 week Fixes: 437ea82ce7fc ("agp: Handle multiple devices more gracefully") --- sys/dev/agp/agp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index f7eb906fc57c..8db1e13f08de 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -254,7 +254,7 @@ agp_generic_attach(device_t dev) mdargs.mda_uid = UID_ROOT; mdargs.mda_gid = GID_WHEEL; mdargs.mda_mode = 0600; - mdargs.mda_si_drv1 = sc; + mdargs.mda_si_drv1 = dev; mdargs.mda_si_drv2 = NULL; unit = device_get_unit(dev); From nobody Thu Aug 29 15:06:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvl3h4zLTz5PbHV; Thu, 29 Aug 2024 15:06: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 4Wvl3h4VVNz4nyB; Thu, 29 Aug 2024 15:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724943984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/b0oZ7rOspwOwoU7ywgFTzueHh7zYJIxVyefSDFz5hk=; b=dCDE+K/MGzAMnZYNh3oW/E7zRcZUbhQIepCMzE4olBYJt0//UV7+bKXC2uE5SUysQnJ5db cCc9EAnhjHsNjBMPBAoT4dKUL9lr8Cp31vsJomkMNq1vTgv4RhkDdPpExW+HyKdfHi1R2z NOsLou031zlevNC2FK1K2XRMHJjEfkfnPErr+t9HCYpeGcqD4cwXg7uoPmM28K0LJB5F9e m6bdQh7KzKFLj9J5rDojGWNXJTi845cfaXxttRnvZBILcjJx89gqJJRIA4EdRtAuCrDv76 EGaqdMxa3Db4vMVGhmKmrhBBhteM2T5NbhdRu86lzJB6CvXTMPY8zgbUY1EpSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724943984; a=rsa-sha256; cv=none; b=X6sU55+4N5PVnqPPU87Ssl5pJWfxhNp5RPviswOABQ/ZARF1Igdu3JxIkXvx+qkXSF9FpH njXq/5owJk9Nikta/Njwj/hTccORlQXbjAPveb8XAH8tQi9CeYm74M/pCOLuvdz+BBwysN UP6qUdVzQSocVna8hd4cMpGc5dIN0x/+LfgYwIQdAQ0+2MPVmZX7c2xea2zXPoARYgPix2 FU2iBkXmTWPwP/SVXq+qYlaxCynXAca6lCEnbPJ0XYjyuj7iwF5B0iSRQKu9LlEbGihxvR WUtXFPmZfccaCEVd5sEfwN8hkpdolKsMDRuDQwcUrS117zKHldsME3Q9f1wDSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724943984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/b0oZ7rOspwOwoU7ywgFTzueHh7zYJIxVyefSDFz5hk=; b=BhHrILkaobRsgqX/F4959nv4SBkqPL5E9tSCRIPpiz7pRHEMRb3ez1dQ7PAl3gmsN7Enns 8YCiWCoyJNLMwluAx/ouKwPxdXcNi1u18ZZcRa+ZAudJuUBWLTw4kPjlYbbQBMe66x5m+c V5bPuXbbeQXuEsmxqm/ss9y3Z8b8mFBBDPBAIzGp3RuZdHH0ETlPQsZx4jIDeJcCAr9zSJ GDCg8OY2RPy30ZQs4hfEh+DEgrumZ74HPDWbGUnDmoiRXvI5gxC8gkLUSItUKrHWflIl+X dSCh5TZM9W0WtzZn+1XBQcLhki68hOlZOpXuUveijVZZWTWTeoaMQYCTxsRqiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wvl3h45r0zM9g; Thu, 29 Aug 2024 15:06: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 47TF6ONQ079043; Thu, 29 Aug 2024 15:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TF6ODx079040; Thu, 29 Aug 2024 15:06:24 GMT (envelope-from git) Date: Thu, 29 Aug 2024 15:06:24 GMT Message-Id: <202408291506.47TF6ODx079040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f62c1f3f8e91 - main - locate.updatedb: Explicitly exit from trap code. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f62c1f3f8e91c78d402e1db4e518e4899a4ba2b9 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f62c1f3f8e91c78d402e1db4e518e4899a4ba2b9 commit f62c1f3f8e91c78d402e1db4e518e4899a4ba2b9 Author: Dag-Erling Smørgrav AuthorDate: 2024-08-29 15:05:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-29 15:05:47 +0000 locate.updatedb: Explicitly exit from trap code. When a signal is trapped, the script continues after the trap code has run, unless the trap code explicitly exits. In the particular case of locate.updatedb, this is mostly harmless, except that the trap code is executed twice (once for the signal and once when we reach the end of the script), but it's still worth fixing. Furthermore, install the trap as soon as we've created the temporary directory, to minimize the window during which we can fail to clean up after ourselves if interrupted. While here, simplify the empty check at the end and make some minor style tweaks. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D46475 --- usr.bin/locate/locate/updatedb.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index ff7ec7f6c18e..ca1a79116a91 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -42,13 +42,14 @@ fi # The directory containing locate subprograms : ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR : ${TMPDIR:=/tmp}; export TMPDIR -if ! TMPDIR=`mktemp -d $TMPDIR/locateXXXXXXXXXX`; then +if ! TMPDIR=$(mktemp -d $TMPDIR/locateXXXXXXXXXX); then exit 1 fi +tmp=$TMPDIR/_updatedb$$ +trap 'rc=$?; rm -f $tmp; rmdir $TMPDIR; trap - 0; exit $rc' 0 1 2 3 5 10 15 PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH - : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS="/"} # directories to be put in the database @@ -87,17 +88,13 @@ if [ -n "$PRUNEDIRS" ]; then done fi -tmp=$TMPDIR/_updatedb$$ -trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 - # search locally if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null | $mklocatedb -presort > $tmp then - if [ -n "$($find $tmp -size -257c -print)" ]; then + if ! grep -aq / $tmp; then echo "updatedb: locate database $tmp is empty" >&2 exit 1 - else - cat $tmp > $FCODES # should be cp? fi + install $tmp $FCODES fi From nobody Thu Aug 29 15:21:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvlPW5n3Zz5PcGs; Thu, 29 Aug 2024 15:21: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 4WvlPW51dyz4qXN; Thu, 29 Aug 2024 15:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f88pjODd1rzyfoK9x+pNaTeoP6Ki6ALh5XargyMK18U=; b=qQMcxqWn6kMwbbQ8lz5j6saxQub1hfi5YRDo9obPPN5z31NOfF9YLq+c0Ub1dAbrnMP+6F ikKlX6gtcl0ZoF9AHbbX0t4SzX2XlaWLeb2bVchakYLlCwiqgBcHO9I5npCY4WydLzHDi+ 8QlQFzyBBAgF7z8ijSy7exyG48QdKMERcT8lRCVxdk9kH0Hlj0inJZJNMVY+whoSz6T3zN mawZw2HZPHICA5ic27+tWc/IBnw9K5hl8pmJhbdAdFThr+WZY0oJVvSVlvLQkGsth+zuCY Eay+3GUo/JbP8ErCOgJEULFdB3BmWpDZB0QSub9dcC77nL6ZwE5eUHVGmVLGRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724944911; a=rsa-sha256; cv=none; b=S1XrJC8t21ksgYVbQBPIcxMkNP2t1scvh7fMxon18ltzr08y5EDxY4vGRNpXMt94k5rkm2 HqnuWjw7a/CGErluXvJhiuyOxo68AAdFdMGgeeddIa1C1bLAkMNHBiob//3ciYuSxArRMF 3M29jMwj6oBJpljDai1LnXrDAGafOXMLrloKmhnYNF4fQsdistcrRZAxdP9Kn8LoylBAN2 xDShHhiqREcd0JoWYYQ0Yp8L0UzIeo5WzbKhRgrcWJhHyxWws+5bU6bqZVipNuoxMqdL5/ V8klKpzpvluq+7eez0l/C8o+suQ78muV9llzbu2+DYyUlCwRK9Ixi/mgbL0DJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f88pjODd1rzyfoK9x+pNaTeoP6Ki6ALh5XargyMK18U=; b=fizu2N2NXxh70TalRZz7WIV1VdLpe54+U1GXvg37/ZWnA7Ekt0JD2uup1NTL0IuRRHy5Gm KXgwyjNO3WrqaGqCQlMdpcrXaOQ4/vS7ObwNZHmnS92H9SiQfLXPUMkvcUU4tNtcuWKDEe ubnDLxi2ZC3lGKiGWJmlJwwTxibkpS6v/pKvQAoLy/6Th1Xzu+C6TudViZJg3VGvr0s0hG Ct5936d34ZQoTxEqJ199xz9IR0tn8AIp2nJltqTiUr2akHfUEorPZyYQpEF+amyR30OLR2 1pxeye0n8gjqZFjGgIVxakGPQiuDln9ez8YLQZlyxvWQc+Us390rH+88eiOkqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvlPW4cfjzN9G; Thu, 29 Aug 2024 15:21: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 47TFLpXu008906; Thu, 29 Aug 2024 15:21:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TFLpul008903; Thu, 29 Aug 2024 15:21:51 GMT (envelope-from git) Date: Thu, 29 Aug 2024 15:21:51 GMT Message-Id: <202408291521.47TFLpul008903@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: 05cf677bb8d8 - main - riscv: remove a redundant MPASS test in _pmap_unwire_ptp() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05cf677bb8d8b2528fd5bf472c908eabe4e76125 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=05cf677bb8d8b2528fd5bf472c908eabe4e76125 commit 05cf677bb8d8b2528fd5bf472c908eabe4e76125 Author: Wuyang Chung AuthorDate: 2024-08-02 06:28:46 +0000 Commit: Mitchell Horne CommitDate: 2024-08-29 15:20:28 +0000 riscv: remove a redundant MPASS test in _pmap_unwire_ptp() It is guaranteed by the else if condition. Reviewed by: mhorne Pull Request: https://github.com/freebsd/freebsd-src/pull/1355 --- sys/riscv/riscv/pmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 7058eb03cf44..c372e6f7362b 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1464,7 +1464,6 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) pd_entry_t *l0; vm_page_t pdpg; - MPASS(pmap_mode != PMAP_MODE_SV39); l0 = pmap_l0(pmap, va); pdpg = PTE_TO_VM_PAGE(pmap_load(l0)); pmap_unwire_ptp(pmap, va, pdpg, free); From nobody Thu Aug 29 15:21:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvlPY1Qptz5PcGw; Thu, 29 Aug 2024 15:21: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 4WvlPX65Mzz4q76; Thu, 29 Aug 2024 15:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1B0VgsHNi007aVdoAhRbBoGFrXvF0MW9IFn1P5ybniU=; b=cg37kyVTq3qHjO7NMBffxNkcDS1OvILeXTCd4JAAcdRFacKxUZ9RE/p72yO+JJioDSGfWI TZemvrbp38Zm/cKyAYuXiqIciIGYewgBJ7zMPgxh2Ob2Uo24zlN8mrt6cgzVQonPxD3GCI 8gHaj3Mn6Wlu/1r74pUvRgJ0Jd1RVWSPY7MFzQQqQfV4kdhOuFjIAcBsK8ot+zaRDULUah lMbRDm+j7WwLavD2CL1raS+SZ8hW5lO4Z/uUw4fNtH88SoeumYxQmo8tNeEhr6d8jXJ7fg pIrOGk5lKrGu9dSzzj97pjJMOppKr//soJELB59cuopQ/lZehh87AHJaXdxoTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724944912; a=rsa-sha256; cv=none; b=GheNDvu2ZWcPSNTLJP8c5quitSbFM/Asbs2HeYLHiO+sP9Njjyc5zrs6Ejnhm+MzndYDdb kw7MXlOph/1euHHIU42cNDv8YAc/Mg655QDFS6UQ8tDb2ipFuSK95a/6Lw+K6iqYeI1HJc fvBW6ZLxN8BHHnN7l/27pXJusNcnhE6F6Y7WfRwo8b/6jN/qEFtVsWZtZtlY3MRy/Lcyug posfEYv9Pdfn3xDi+DydpIY+Qutv8lxBhiRSfDi8nkyJGlwL1ZQ3TcwaXlV3d5jDhGL5Op oSc3vfoRAcZvYrMu90gsVpSuqMF0gkeyv8uS0jG1Ujfods4e3eqEwLmvc+iSTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1B0VgsHNi007aVdoAhRbBoGFrXvF0MW9IFn1P5ybniU=; b=dzuZgPyOsFpJdHqLCC0VuKT8ZNGg2ZP8HxZtKFiHBQLstXgbkjxy9GKkPlisW+s2wF81S/ b7lPtwqTMErkk0QkB/78hitWTAAtfJXl18MjQis/3k/w1rtH64BnjLoXuS+VtafjFMOyMB zdlJfo+mfQWZG9bf3kQvzQe/BtHFWBiOhBXAj9MRsyTd9zc+Hfepp74n2aa15U9mGjNpvD nhadZ/ef/9+7CzVws63Ujcgk3YOX0a0cDKS0FIR4EM1B2XfDlxSHdj4/MI+izdbD2iyYZR LdzopAiYvE8Dbscw9X6552Y7mEmR/VAXd9G7iurmDvuClIB83TVfGC7hdxK5kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvlPX5jFXzMt4; Thu, 29 Aug 2024 15:21: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 47TFLqx8008966; Thu, 29 Aug 2024 15:21:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TFLqr6008963; Thu, 29 Aug 2024 15:21:52 GMT (envelope-from git) Date: Thu, 29 Aug 2024 15:21:52 GMT Message-Id: <202408291521.47TFLqr6008963@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: 2e33abc35460 - main - riscv: fix a bug in calculating the pindex for L1 page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e33abc35460b9e2c2eeb1e43a0614db7bebbdb3 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2e33abc35460b9e2c2eeb1e43a0614db7bebbdb3 commit 2e33abc35460b9e2c2eeb1e43a0614db7bebbdb3 Author: Wuyang Chung AuthorDate: 2024-08-04 14:04:12 +0000 Commit: Mitchell Horne CommitDate: 2024-08-29 15:20:28 +0000 riscv: fix a bug in calculating the pindex for L1 page pmap_l1_pindex(va) expands to: ((va >> L1_SHIFT) + NUL2E) Reviewed by: mhorne MFC after: 1 week Fixes: a4667e09e652 ("Convert vm_page_alloc() callers to...") Pull Request: https://github.com/freebsd/freebsd-src/pull/1360 --- sys/riscv/riscv/pmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index c372e6f7362b..4baa4948e442 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1887,8 +1887,8 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); - nkpg->pindex = kernel_vm_end >> L1_SHIFT; + panic("%s: no memory to grow kernel", __func__); + nkpg->pindex = pmap_l1_pindex(kernel_vm_end); paddr = VM_PAGE_TO_PHYS(nkpg); pn = (paddr / PAGE_SIZE); @@ -1913,8 +1913,8 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); - nkpg->pindex = kernel_vm_end >> L2_SHIFT; + panic("%s: no memory to grow kernel", __func__); + nkpg->pindex = pmap_l2_pindex(kernel_vm_end); paddr = VM_PAGE_TO_PHYS(nkpg); pn = (paddr / PAGE_SIZE); From nobody Thu Aug 29 15:21:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvlPZ2Qmwz5PcK1; Thu, 29 Aug 2024 15:21: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 4WvlPZ06Xfz4qdW; Thu, 29 Aug 2024 15:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEcxx4hKnUbzMfV7mjYu+qS8KKS9/JTOiJi0jxwM9x8=; b=XH1bj9nH8nq77qMoTcGFli9sd9L4I7waGdYqD/SPmS4arnEIXip2+RwonBDwW3a6kWR329 WZSuieYqRhfkO7D1j5Ozk/2VARuI95mpNKiF58s9Zcho4d3d+cBRT9P9iD+tco09ttc8iu 7zcKkXmJjsh9MEavHiiq4iWGXrwid44wnKJ6dizOFHCkb1GMdMZZZGmsqULBkXrDxybB5M jAlO5ZHfCViZHtO9s0ZJuKMQx5WCh/J8k7jwKDM5ZUPdxnylaCKgsHzNbdZyMBtBREJwSj I2Is+nOZdDKYHmeRSWz3Bv1kLeEiw6keJwUIKdiExkFWWYgyH1ij9fk3hr3m9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724944914; a=rsa-sha256; cv=none; b=iFO0O08ma+svpPnejNoFRY1DiMtqYvC+P/38r1UE1jSGqvG0pEOb2B+secSXgZ47WLQELe TeHFocQcQs2TOlFf2pMmD5rn9ID8uGZGa93uUUuOFxx1x8EO/k5+qkCf3gw2ClaB/7Smuy +QF9Yi6bsB0EQZKiZ0UCgCsJlcSFtEYCQzjLOIylIkswIuf0fBQFIDUdqjYJXlPu2eFtLY KQghg51vIKDJMfMJ2XOwJ2nR0y3Gxihp/V7zoY7nkWEy3QVatvubQla+sGqmvNTaqPKcdM fRN002OJvcpdmtAZMucfsnBvBslCe0+aJdXp87NcMh8Mq0zcT1INkQL3JDOD/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEcxx4hKnUbzMfV7mjYu+qS8KKS9/JTOiJi0jxwM9x8=; b=MicGRcuSuOo5bR/5nA8MPPNLhid0cIZ/1GB1AWnyT18AYbNX0CZ56HSBiELrQ96Mdfzghc WJrDj4bVLrkuUd7PCxkqgsmtCZgJprhqwNT3j9c6YrckSW+fr5ozZMcmgD2aLFpobYRpf9 9McWuyAx7LMz66mSC40J48JEvmdhY4vLA+98Gd7U1toWxHdn5JQs5ULHvRTIpWTZ5NCANH 2HhcMwi+c87yuK0sdtmeOEFE8UoDRjLYfK06lN3Xn/3JQWZWLvloaOgJC9iJOZ0Uq3mCsP zdlQ44kEiRceeFmaNYtcWuF4p0fIqKakReQGRVl4qo+x/oE/LETUsR6MKbbf1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvlPY6n3gzN9J; Thu, 29 Aug 2024 15:21: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 47TFLr5P009033; Thu, 29 Aug 2024 15:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TFLrBV009030; Thu, 29 Aug 2024 15:21:53 GMT (envelope-from git) Date: Thu, 29 Aug 2024 15:21:53 GMT Message-Id: <202408291521.47TFLrBV009030@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: 835cd17f87e1 - main - riscv: use pmap_l1_pindex to calculate the pindex of the l2 page table page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 835cd17f87e1b38c05e4a9a392181bebb9b8dc6d Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=835cd17f87e1b38c05e4a9a392181bebb9b8dc6d commit 835cd17f87e1b38c05e4a9a392181bebb9b8dc6d Author: Wuyang Chung AuthorDate: 2024-08-05 05:22:56 +0000 Commit: Mitchell Horne CommitDate: 2024-08-29 15:20:29 +0000 riscv: use pmap_l1_pindex to calculate the pindex of the l2 page table page Reviewed by: mhorne MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1360 --- sys/riscv/riscv/pmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 4baa4948e442..69eb36c2cd4c 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1743,7 +1743,7 @@ pmap_alloc_l2(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { pd_entry_t *l1; vm_page_t l2pg; - vm_pindex_t l2pindex; + vm_pindex_t pindex; retry: l1 = pmap_l1(pmap, va); @@ -1756,8 +1756,8 @@ retry: l2pg->ref_count++; } else { /* Allocate a L2 page. */ - l2pindex = pmap_l2_pindex(va) >> Ln_ENTRIES_SHIFT; - l2pg = _pmap_alloc_l3(pmap, NUL2E + l2pindex, lockp); + pindex = pmap_l1_pindex(va); + l2pg = _pmap_alloc_l3(pmap, pindex, lockp); if (l2pg == NULL && lockp != NULL) goto retry; } From nobody Thu Aug 29 16:02:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvmJK5WC3z5T830 for ; Thu, 29 Aug 2024 16:02:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvmJK0TkSz516Y for ; Thu, 29 Aug 2024 16:02:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-428e0d18666so7406435e9.3 for ; Thu, 29 Aug 2024 09:02:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724947343; x=1725552143; 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=fzBIPBzUtwVCCLTFfP14lfaNf86Vp1wysB1CZ58lgxA=; b=iW+AoA1OXbagA6jSDcmEKoFYFrd6Idz/b3xpREJZceVJMdzkJj0suSQxgpBL7hBpXk dbYiPGQQVdvfQYmiAbCwzKw0zO4Dlcvql5NFVfWMRZNZ6ipyWkP8uyw/CSRfh8j8hHnw dYk9oXEjCwXwY4tS9R+Z2U8sTL0+OtvapZzU0JGoUYK7aaUj3oJFVAb2F2dUoLpx/3lt f2U5Dlx3UAjIfBg8odkSoAfb1y1Vtm3Yl+uNnkg9060iFODIcrhRbR9iYUVK8guklD1m zpxF9X53xaQ5/1jwpMv9QbbyQcJDufktn3vbaurSvWbjbnYFcW/+/fv6WcWPfukOyKt1 opeQ== X-Forwarded-Encrypted: i=1; AJvYcCUcGQjRrq2tL12DJP6EzAJA6vij6OHLny83hVdjb5iQAxetHiKJOPEGcrRCE4HOV1/17CEkJ+LG+9gUpY7hxcGvlReC@freebsd.org X-Gm-Message-State: AOJu0YzZ83PXlVST6dycTtj7N1ImaEYmWm9sxiKLDXBwiVtVYJuD4PLn b4/+IPrWHGiJ+0LQbfcN0hpKwp7+1AI8r2aShAIw2SQxPVyN376WsE+A5zwzSSmAL8TeEP00NxZ r X-Google-Smtp-Source: AGHT+IEA0Mkf+93ft1gZ5i+nkCa0A8VnJ2tKI19AUt9BeWsIhaSPy6onK9Nqi++wtk2dVt18cyXa5g== X-Received: by 2002:a05:600c:4693:b0:429:d43e:dbb9 with SMTP id 5b1f17b1804b1-42bb01e58b8mr28805275e9.23.1724947340955; Thu, 29 Aug 2024 09:02:20 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ee49fccsm1773412f8f.4.2024.08.29.09.02.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2024 09:02:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: 43e8849bc294 - main - conf: Enable BTI checking in the arm64 kernel From: Jessica Clarke In-Reply-To: <77cbcd47-1778-4e71-b824-4e75e0e4b2d6@FreeBSD.org> Date: Thu, 29 Aug 2024 17:02:09 +0100 Cc: Andrew Turner , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <19DBDC11-EB0F-48C0-9AAE-9EED087F0AB6@freebsd.org> References: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> <77cbcd47-1778-4e71-b824-4e75e0e4b2d6@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3776.700.51) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.90 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[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]; RCVD_TLS_LAST(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.52: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_IN_DNSWL_NONE(0.00)[209.85.128.52:from]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4WvmJK0TkSz516Y On 21 Aug 2024, at 15:28, John Baldwin wrote: >=20 > On 8/20/24 05:02, Andrew Turner wrote: >> The branch main has been updated by andrew: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D43e8849bc29414036ccaef7788de95a0= 7ad32ab5 >> commit 43e8849bc29414036ccaef7788de95a07ad32ab5 >> Author: Andrew Turner >> AuthorDate: 2024-08-19 12:59:49 +0000 >> Commit: Andrew Turner >> CommitDate: 2024-08-20 08:49:15 +0000 >> conf: Enable BTI checking in the arm64 kernel >> To ensure new code has BTI support make it an error to not = have the >> BTI ELF note when linking the kernel and kernel modules. >> Reviewed by: kib, emaste >> Sponsored by: Arm Ltd >> Differential Revision: https://reviews.freebsd.org/D45469 >=20 > This has broken two of the GitHub CI actions using clang 12 and clang = 13. > Please fix this to be conditional on a supported linker version (or = perhaps > add a new linker feature to bsd.linker.mk). This is still broken. If it=E2=80=99s not fixed promptly I will just = revert this change; we can=E2=80=99t leave CI broken, especially when it gets = used to test GitHub PRs. Please stop breaking building with older toolchains, this isn=E2=80=99t the first time it=E2=80=99s happened. Jess From nobody Thu Aug 29 16:48:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvnKQ2q7Yz5TCVd; Thu, 29 Aug 2024 16:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvnKQ2LCrz55lT; Thu, 29 Aug 2024 16:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724950106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RRnZfCazhs3Rw/iCof2qD1rtYONWsoWb0PA5+2k5ssA=; b=us1ifkdKtVWjag0jCZpmKwCuYt1fwaUKtairbC8EsjCN46ob0a70jmHJ1Zj/wDCPqfMX4i jxc833QNDdYn/Mb2g2CN1qCaGnecHmqS0xE9in6N9BX08qCw642e6Q5/szsHx+Nldo9aEi MatjXcYc0JiEGK3tvIYfzTeQBthrmS0qs1egbKUPWiMM0Yeg8OWGNKHz7aMi4jUFmqaqFc mcy25LuJnsYmQELn/1QDW9Qi9G/bOD8wWszDq6v9Q7XhegUXkEZ4ICj+fKje26eMSyc/py QJwusgFYCsPGb6xubc3/dyHva2/i1M5eoYDF/a+Tb+Kt6Sz33OfkxHMrl8Uy0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724950106; a=rsa-sha256; cv=none; b=Prx2spSoIvaJlYxPXWo+AtkGIhdotvW6Txv9aa+RyeZBojbxsW+dioRgF6k50wcc5aoLW5 SzenORD9rvBrXovRllak9QL/rZ5UETMqgqWEypqdxkVr2Cq/6xdPOMG7vw1W5GgFARB0FY XPQ+8fFGR2mv8ABEgQ+oX3cGRJywFeajy1gQ+VEdgkmL6tgV8mJQ9qh1G3oqU/BfqZK5CA 3duz2FFO3a84bg2ne12lrBdF4HM7Y4kn0IjYhJMG2BYV9KvWVVcEKO55tkrf0Rw/S6KAqP KD6iBXwlpA7wpnGWkk3nTolfmDAozBciCOTFJXv20jOAMkK0aafZuDxp5Bxd5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724950106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RRnZfCazhs3Rw/iCof2qD1rtYONWsoWb0PA5+2k5ssA=; b=L4jv5Cy3oeQY8XvomBJZF/AFkj2L5MfTHQwE/S0TKvML39Mzp+MbnGqEm48hVd7sn+E1mn aZw/HuYUA6LqTa+rkTiQ073noqLOA+vqS/5Aks4llWK2yld6pkXNIOaePGVR4EDw/xTzAx jCueqzaRZ7sfTdlj75zwEqzYDWLdNud94+JIXPpEWV2aAeowtq4jVC+zbuxZmi/xcI6qSM dlUfJWrn2Tyx/Bf6weeNW3iPCEhrIRQ/EQxZ5bm3K/Q/neX7hoNEgLCRB84NhJPP6DgJpo Z33BJ4TMrPIH7kkm46G6ctX9FcZ3jw1siQ/+uDc3a+BFLptWmHWDbu3Z7ZDq2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvnKQ1wZ6zPvT; Thu, 29 Aug 2024 16:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47TGmQQl048149; Thu, 29 Aug 2024 16:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TGmQpd048146; Thu, 29 Aug 2024 16:48:26 GMT (envelope-from git) Date: Thu, 29 Aug 2024 16:48:26 GMT Message-Id: <202408291648.47TGmQpd048146@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: 460464b2e031 - main - netbsd-tests: Remove an xfail annotation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 460464b2e031881d03ffb24ec4ca5b7cbeadb5b7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=460464b2e031881d03ffb24ec4ca5b7cbeadb5b7 commit 460464b2e031881d03ffb24ec4ca5b7cbeadb5b7 Author: Mark Johnston AuthorDate: 2024-08-29 16:45:09 +0000 Commit: Mark Johnston CommitDate: 2024-08-29 16:48:18 +0000 netbsd-tests: Remove an xfail annotation The test passes after commit 5ab6ed93cd36 ("faccessat(2): Honor AT_SYMLINK_NOFOLLOW"). Reported by: Jenkins --- contrib/netbsd-tests/lib/libc/c063/t_faccessat.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c index 7de4f61637a4..5e6829f7ea45 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c @@ -166,9 +166,6 @@ ATF_TC_BODY(faccessat_fdlink, tc) ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, 0) == -1); ATF_REQUIRE(errno == ENOENT); -#ifdef __FreeBSD__ - atf_tc_expect_fail("Depends on non-standard behavior not mentioned in POSIX.1-2008"); -#endif ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, AT_SYMLINK_NOFOLLOW) == 0); ATF_REQUIRE(close(dfd) == 0); From nobody Thu Aug 29 17:45:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvpbD1z1Pz5THqV; Thu, 29 Aug 2024 17:45: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 4WvpbD1Wr3z3wlY; Thu, 29 Aug 2024 17:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724953528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5HJTup70t+8kYkt9vKSoq3PegChYHTOTdU2opgf+dok=; b=o/Va8MV0qv3PGrBnqjgfJrcyiI6ZekFJ4mYUlVckNHx0RrC3LMARDMmRH9OgNXakDhHQq2 gRNjdSDeJ39YAepza/pqfAGvnj97dNszurkJ8zXcuvQ9LVDf6CDXvvwmEUeU3N8s5Bj+o5 l0KcOaK6B8TbboK039c4bZuOSOHhNpTt7QG/FcDASn5qa3QAke0LUSF7721la6RzzQfWR2 9B3l+nT5+LfJcvHjQH7VLwLCLEOL6fs8Bda0uGe+TXwDoIJXjW+PpbqzrFMLE36jIMgWCe 2oPn1+WGfbn0OsXv7wzxJnuglia6WjWQAuYaAw9qI9Y6YWzRvK+c9a27jMeJWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724953528; a=rsa-sha256; cv=none; b=Vu1TzThUpWbikHEld58YVmbNqlneabPPs0Gyx4ILzLrUOR2CaW8vzqxm/4kkoj4fBWCS1O dufxvxbxrMELrmI8B9DfcULVOCyRjX/eCXSs+L7KLQSiCgMVhv9oGp8KpYgWPVQJ8ptyMl CKacGVJehPzV2RvLHCVjYMFdkOYXcPrsLjtA/ZsdnAvLgTdHvK6GvGf4+CLxn3jnpVVaTJ F9+DIVoJdX9yfOVQf607PHzOznaSQ/h8B0avhSEVatObgATw4GdBR5z3j6Ls29lXi1w9SP 6jnsTaB1bFtnb0P/3p1I7UsMvX0R4nxN0RSG5sS4GZL2rbgyx88LvqPyrUsyDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724953528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5HJTup70t+8kYkt9vKSoq3PegChYHTOTdU2opgf+dok=; b=P6m4JolVIgaVrDmrJZFQeaHNA/7DJ7oEZbGMzf8DUIporKV95r8mDvGTxnmB6yrlaYyQVN 4Q27zZkcZE0Bl5gNqJSrGRWj4CeRSGY7zW1NHeA4JSKiE4Ep97X8WcYzrwQUqVYfc2vCjU /QNLUWhZoijYlIdmQY1bDB7b+D7V5oBXpA3/TuFA9ciCuj+cMFR2z7FCkphNCNQdHiqm/T TgCn8ESt3yqsIlJKs0PEYCYxCTpASmRKV8F41W1n3EvqpYssZiRLpmSBSCZsJu1YWMbGEb gwINbPJaqtgSG5LzbIC7rDYR+YlbcW0OfukyKkyu9d0+hXETI1jWrSxEuc30mA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvpbD11q2zRr8; Thu, 29 Aug 2024 17:45: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 47THjSSS049072; Thu, 29 Aug 2024 17:45:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47THjSOe049069; Thu, 29 Aug 2024 17:45:28 GMT (envelope-from git) Date: Thu, 29 Aug 2024 17:45:28 GMT Message-Id: <202408291745.47THjSOe049069@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: a58ece87303f - main - zfsd tests: Update the mock zpool_handle List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a58ece87303f882367105c92a27268ed6befa655 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a58ece87303f882367105c92a27268ed6befa655 commit a58ece87303f882367105c92a27268ed6befa655 Author: Mark Johnston AuthorDate: 2024-08-29 17:37:57 +0000 Commit: Mark Johnston CommitDate: 2024-08-29 17:40:44 +0000 zfsd tests: Update the mock zpool_handle The zfsd tests rely on this having the same layout as the real zpool_handle, which changed in the last OpenZFS import. Fixes: 62e7d3c89ebd ("ddt: add support for prefetching tables into the ARC") Reported by: Jenkins --- cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc index f1e925b0b4ef..6c9a49a8ebbf 100644 --- a/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc +++ b/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc @@ -82,6 +82,9 @@ struct zpool_handle zpool_handle_t *zpool_next; char zpool_name[ZFS_MAX_DATASET_NAME_LEN]; int zpool_state; + unsigned int zpool_n_propnames; +#define ZHP_MAX_PROPNAMES 4 + const char *zpool_propnames[ZHP_MAX_PROPNAMES]; size_t zpool_config_size; nvlist_t *zpool_config; nvlist_t *zpool_old_config; From nobody Thu Aug 29 17:53:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvpmR6WdFz5TJmf; Thu, 29 Aug 2024 17:53:27 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) (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 4WvpmR4XSTz3xWh; Thu, 29 Aug 2024 17:53:27 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vk1-f169.google.com with SMTP id 71dfb90a1353d-4fcefbd6bc4so351060e0c.1; Thu, 29 Aug 2024 10:53:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724954006; x=1725558806; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NRZMoFFgXD0BQcaOJOaLGsmBsPlwU2Q6n5oThrE2W48=; b=fM6pJRIynKpXqIWqTt9VNMEK1mXjISGVnNgA+2qbar1luM/4OpG6tJyGlubAKq7OrP 6t7aqBGdwwNwRiqmvR9pbe0ud17uO4SFvnQB1rfC+Y+n+1/x+EGx6/uAffo2SEHk5fux tSbqvp+LFlpQcz8N1SxoEa3GERqP00XICIf4rsfNzhdNM3lanl89+pSPkIlpntkpR8YZ 5jzFrRen1pV0VytWJOqN4tznec0Gwgarv1CkAK3rgMsgdHvGs5CZjX0m9pkvcj+JBZ8C 6sE77NcrAOQWE8OzbKkUIUL6SPBLiR8pXXFmgCJhl2lg7QMRB50S28DA+e5betZsFnbK MvwQ== X-Forwarded-Encrypted: i=1; AJvYcCX8OFRFOyFgWYZwEyXo9W6YPEcB4simLudmG6DUnsSD9hZ13LCiiO3lrMXQJDyzM8MW3lTvkJbpKE3jS4u4lYoW08toO7w=@freebsd.org, AJvYcCXXF2bNNV/nA2bB4JO2SZoOkAUaqs38GK6VltnXQdYAriUF1EBkU6BqMK7zwtAQZxi14HynM8Xuw4c+1/2+d9zhN7vh@freebsd.org X-Gm-Message-State: AOJu0Ywo1xHunC5dNPbhoF7oy2iLeHiW+Dqbth45EtQo2wqGq7MPmnd6 m1t0dLNwdWoYjY0st83ynOBnjDcrwxexvzlY5ck73HsYKZgDayYOcgl/a/n0ATttzrsXjxJDGdJ jZJOo99NRPazKHbPoLS44gdG6m6XoCNZ2 X-Google-Smtp-Source: AGHT+IE0SMtZCZa3hGFxRfy5zlN1Og8xmYve0h1XYIw+p8y2ypLM+nFMH6waaMfEl4i9omuB6dEIVajc6jcTVEDAvgE= X-Received: by 2002:a05:6122:250e:b0:4f5:2276:136d with SMTP id 71dfb90a1353d-4ffe4a5c710mr3699985e0c.1.1724954006169; Thu, 29 Aug 2024 10:53:26 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202408291745.47THjSOe049069@gitrepo.freebsd.org> In-Reply-To: <202408291745.47THjSOe049069@gitrepo.freebsd.org> From: Alan Somers Date: Thu, 29 Aug 2024 11:53:14 -0600 Message-ID: Subject: Re: git: a58ece87303f - main - zfsd tests: Update the mock zpool_handle To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4WvpmR4XSTz3xWh On Thu, Aug 29, 2024 at 11:45=E2=80=AFAM Mark Johnston = wrote: > > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Da58ece87303f882367105c92a2= 7268ed6befa655 > > commit a58ece87303f882367105c92a27268ed6befa655 > Author: Mark Johnston > AuthorDate: 2024-08-29 17:37:57 +0000 > Commit: Mark Johnston > CommitDate: 2024-08-29 17:40:44 +0000 > > zfsd tests: Update the mock zpool_handle > > The zfsd tests rely on this having the same layout as the real > zpool_handle, which changed in the last OpenZFS import. > > Fixes: 62e7d3c89ebd ("ddt: add support for prefetching tables into t= he ARC") > Reported by: Jenkins Oh, I already had https://reviews.freebsd.org/D46479 open for this, but you beat me to it ;) From nobody Thu Aug 29 18:12:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvqB90Tb0z5TKkW; Thu, 29 Aug 2024 18:12: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 4WvqB8702rz41bk; Thu, 29 Aug 2024 18:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724955137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qWZa4eMH/KqeLGASSJmoC6GjeZNk6gfkW8C1LKFIQo=; b=ZnqmskT/aSutCaYXwWeCt1TMdKSs5K0mPy9n3O1kvY9vvALqQ+C4nK9sGUakc6Og8pGf6k 8qwLvbWJ3TYRJcO6G6Lr0NphUQJHZzuKRFpT3YBPJFL3ckmUem5E75rl/w17EdlG2ZwxG1 kk8nurAmQvt4GF0ioK5KUBryK5XrX+PyIyExhaRySxhIsfhQ8engdhJxSgJj0GZSKs4Nh1 DYaxXbj+G+cnyZtoktoNIeR6RX14q1gTmSscd4AkvDzCdrdfaA9GNCiIe3I4+wtgKGmpOp 5SkDfxkdMS/PCFSofDFTXMsL/9zQb45ndiSzKxjzu751eh/Z4HtESq/3yLqp3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724955137; a=rsa-sha256; cv=none; b=eAP8BO8Boc37jhLtGPKoTNehL4/bcpNEAlhLtGjXUny+aqeakfPX6SHYp6/dvUf0JGTjtE EEYS5zKJZiHLoV2dme68G6MhgXWA/4oFv13Rz1evtX7EFs1rlrnUQyYaybAm8V72WPPFG2 r/h+Vzqa0jPKSzKAi8HimV2itONUO6YVn1L4bxYz/2I5cCtUqtjsPoz3nm4wTWPX0aHshW wIFLWxtoKTUZuew6/bBzYXPL2d9D8MsJlRHqKGR7ZBru6G0jgapHIqkVESwTPtL5EF0jtt QnAE+2RSeLpCjSfcHKNeDKiVJckmZTsybA5TSdgsdg0ynRSM+3EeJj8yJuXr/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724955137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qWZa4eMH/KqeLGASSJmoC6GjeZNk6gfkW8C1LKFIQo=; b=P4KTjjMveEZDYtaTHHr8XyCYF0wdDFw7AuUH+AIaWoPJfNBSqSsgmD/xGPb4uSyh3XB+kT /aPfKveRBiYKvVV7fKvKQFFWvX+MEJCe3oq7K7tJpMRyeQZEzAh98qhgxGWHlwiDtjyCF3 f+jlGUtuAu7llTVmHtdfAsPUop4s1HmNnvJVEFXM6rhZNo9x3f4jGAiy0Mn28+l3Ch6PYk u9H8Ry+GEow8AC7WduZgtEuThvpE7F64HuuRVn/pyFDjEE1a5zi6UoRQg5/XhZmVAgEBLt 3JQrQmaIada+zD9Ab4EVaXVz/Qnb+PgEsJhDiA+tdPxQO1IfYLyhrpKkUjhSbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvqB86bHwzSD1; Thu, 29 Aug 2024 18:12: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 47TICGPK000733; Thu, 29 Aug 2024 18:12:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TICGnL000730; Thu, 29 Aug 2024 18:12:16 GMT (envelope-from git) Date: Thu, 29 Aug 2024 18:12:16 GMT Message-Id: <202408291812.47TICGnL000730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 455dc6ffa843 - stable/14 - loader.efi(8): beef up the updating the ESP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 455dc6ffa843b20e2555f1884d1a07d47de78123 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=455dc6ffa843b20e2555f1884d1a07d47de78123 commit 455dc6ffa843b20e2555f1884d1a07d47de78123 Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-29 18:12:27 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 871911a4ab738a54a88f3533f553f5eb68c28012) --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index cc24b25594f9..a0c0df9a9c35 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 22, 2023 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -355,43 +355,141 @@ The default location for the ESP mount point is documented in The following example shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Thu Aug 29 18:13:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvqD602p2z5TLLy; Thu, 29 Aug 2024 18:13: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 4WvqD56czWz41sv; Thu, 29 Aug 2024 18:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724955237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRRxzCGyNo8CrRpMpzkXQ0rOKIo43Qp4rs4wvZ0RyDs=; b=nnCpmkVN+tE0HjLVvNCoPf7uMLotHxSAZx5AyACevO6TCAjrc5wXKzdcx6s6VM9aGctDF+ gnIPsEFsVv1qjjGu/pI2xE43GTcZWOpgjo2aOA3ZbynVHpmc+HJehhYyM5PfEc27XDkp3Y OXG9xUbrklG4wEtukWrYZsr8V6QJIb5Z/d5bdRfbCQNi5go/diZKqd8MStBK/OOS4rom3U NaYYUZBeZzbXET+Y18ucgcDPtNiazFRQQEQEXuH5oIMXtaqNmZKRTRi2zH4HhCf8KdEtYd 16w/XKLkaGQCJSmOgkQBFt4AZmOMaIlAELRhtc/FwakVgfeidNWBw4QWGaS8zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724955237; a=rsa-sha256; cv=none; b=ZN3NLDl1BiJ0Wx/FYfZtTQU1dBJCdpqLRHpxDlzhM9RdmwPFAhfAI3xwgmv2o86cXr0Nnu aoRRd/JULSOWH27ZLysGvL4hmRJNM8/9wTTCclOorSApR0KcGXGfimBb1ytQzVYr2oZgg8 naf+Ags2oj9V8yr7ouyjF3+It0nWCunbOEAmgJFIEiK8bmeGN1ZEenQrx3ZprsEtDGRqDJ fjvBTCI/RpzeCPVDRswfb7X+0sG+F27XM+2UU7kTBq/IBlqXPhD+1pvtRIwjCBijOSrzfM 4otsApDi/vK1CPTtBf84L50Yry/cNaZ/1qW1y9bPglsfpdTY/C6oAeu/1iG0SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724955237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRRxzCGyNo8CrRpMpzkXQ0rOKIo43Qp4rs4wvZ0RyDs=; b=BxnpuoAUiv2scPEMFPEGLnt/AjkfrKL49iqhOuHkU2AqHAXLj/14Dq0UpGQYzOiFjeku6I 7BbH9QMpPn6XoEQmFXDi2tk9zHpO3NwA6po3Kx8CRjTsd7WUQrAMS9cUdI3u3/xZ/ksUDr k+3AitLHHYAk4FtI55PBgLIPSecd4y/qswZ8299AFb1CNXfdZBxmP5G3nSoMgSZBR05WFD zWN0zTtYJLooneYYH5PZyTzO0y2wscm94VTwhjQeeKu3VZIXp5SXnuZtJeI/bNmaNfLrFk p8lmeD/On21ZRS8P+YvthT9SAxovosU9q9nIzjca5zryeWQ/PpEz3xe04fWGGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvqD56Cq8zSVS; Thu, 29 Aug 2024 18:13: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 47TIDvbd001082; Thu, 29 Aug 2024 18:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TIDv7q001079; Thu, 29 Aug 2024 18:13:57 GMT (envelope-from git) Date: Thu, 29 Aug 2024 18:13:57 GMT Message-Id: <202408291813.47TIDv7q001079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e95ffda78ac0 - stable/13 - loader.efi(8): beef up the updating the ESP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e95ffda78ac0d61b8c17100e2061fd7542323f0d Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e95ffda78ac0d61b8c17100e2061fd7542323f0d commit e95ffda78ac0d61b8c17100e2061fd7542323f0d Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-29 18:14:09 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 871911a4ab738a54a88f3533f553f5eb68c28012) --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 37f56cf7be3f..4dd9f66790f8 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 4, 2022 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -345,43 +345,141 @@ The default location for the ESP mount point is documented in The following examples shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Thu Aug 29 18:50:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvr2N4Ndlz52Q0g; Thu, 29 Aug 2024 18:50: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 4Wvr2N3YHVz44Dq; Thu, 29 Aug 2024 18:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724957436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=abGNh4VyEnFys/1PaAczgtzBZl/snInrTmvJfqHAJgk=; b=sPlEqtYMmQN6vvsqh4hPprU+I4he+uenghoAoTRr8VD3o4HY7lQ8YrSEGLljGiAWdYULld nv+DRKtfd5BojYf5YxdN8Sp6aGFT5CzRzDKWY1EAbdZisBkLudo+lp2S4kUu1wWDBipA88 kfKB0Qe4cw9RHsKbP7wf9g+AHtn+03RAnxEsW1nwM/TCqCVeuaYKMAR6BS09yFGvsR7ed+ Q76bhgpo2azMcy4n93w4QjSXi8WevFm4dv4hb/6MnWKuV8YJhqsaCaTq4npHZLb5qMzXFg V2KXaOkn7hguGeLw1TLzLB6fCD3nBG5lU84wtMbQaeOGJ2F/Eg4dFLApwtlfGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724957436; a=rsa-sha256; cv=none; b=XjeUUhEFD4AIfrcmFyemBmB+KNWtDlBZfIfdBPAdySTily2G8TMB6w7a9zTkC02ZVMRl1x 65zXhScjzP0MVgA3JTcGAiUYETA5Xf1tYA4JnF1/fdNP9sRfshQs11Ar24OZtO3vFc0b7k urGjVp4j/0eoNJfRd0f+CFVMnzTZylIdIuMYjmnw0yKa6mWEZUVRLscDsbmck2cdNQREmi 9XQYYuk9iD+KuZ9O5Pp2sqvyboQ+YUJNg0giTtSQQxtTYNGDp2mKcLddwgKZ6O+IdzCmzt +JkIl3qTy3Tv0wL41rDTa4hH/5b3aLbRj1pziIJ7HnFYT1QlKMfnXS6LhEtrkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724957436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=abGNh4VyEnFys/1PaAczgtzBZl/snInrTmvJfqHAJgk=; b=NZzibFJazGzEVgnC6suMWqaHrVDEm/dDsUG2DMT3ACqWnTl5tx9Y76GBQa8Qv2BCvCPK9L sLzh0o1Wv/0kd2DSyaoIZ1jfCNm54AO7Q5CeIDIGqOdXvkTva+iRTEoi+hivSkN6cyuuDt GWC27+4fn6uRSTy+omcl75Ytg7OIKFGM9Yaur0/280uUhLxGtItaAK2Fj+HV+rnDtFGxsV gpQB3TinubOtsn12Lc9Pir2/7RePiBxpsb4OT02trwpjGrJMVws5xmgxj5TXJnvcaJptJP fEZa5qeLZ/FCHCyCkQ7ubIx/+IdHCkfmJyXDSVqLwB0vPdwxFIIaVlJ3K1szLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wvr2N38cTzT8M; Thu, 29 Aug 2024 18:50: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 47TIoatt062311; Thu, 29 Aug 2024 18:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TIoaNi062308; Thu, 29 Aug 2024 18:50:36 GMT (envelope-from git) Date: Thu, 29 Aug 2024 18:50:36 GMT Message-Id: <202408291850.47TIoaNi062308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: faf94e22a3da - releng/13.4 - loader.efi(8): beef up the updating the ESP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: faf94e22a3da99dc35abe21b2d8e79f5eefd31f2 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=faf94e22a3da99dc35abe21b2d8e79f5eefd31f2 commit faf94e22a3da99dc35abe21b2d8e79f5eefd31f2 Author: Warner Losh AuthorDate: 2024-08-20 15:44:38 +0000 Commit: Warner Losh CommitDate: 2024-08-29 18:50:49 +0000 loader.efi(8): beef up the updating the ESP There's a huge variety of situations when booting with UEFI. Document more of them, hopefully better. Feedback from: jrtc27 MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 871911a4ab738a54a88f3533f553f5eb68c28012) (cherry picked from commit e95ffda78ac0d61b8c17100e2061fd7542323f0d) Approved-by: re (cperciva) --- stand/man/loader.efi.8 | 142 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 22 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 37f56cf7be3f..4dd9f66790f8 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 4, 2022 +.Dd August 20, 2024 .Dt LOADER.EFI 8 .Os .Sh NAME @@ -345,43 +345,141 @@ The default location for the ESP mount point is documented in The following examples shows how to install a new .Nm on the ESP. +The exact placement is complicated due to the diversity of +installations, setups and situations. +In this section, paths that are all lower case are Unix paths. +Paths that are all upper case are relative to the ESP mount point, +though they may appear as lower case on your system because the +FAT filesystem of the ESP is case insensitive. .Pp -First, find the partition of type +Locate the ESP, which has its own partition type of .Dq efi : .Bd -literal -offset indent -# gpart list | grep -Ew '(Name|efi)' -1. Name: nvd0p1 - type: efi -2. Name: nvd0p2 -3. Name: nvd0p3 -4. Name: nvd0p4 -1. Name: nvd0 +# gpart show nda0 +=> 40 7501476448 nda0 GPT (3.5T) + 40 614400 1 efi (300M) + 614440 7500862048 2 freebsd-zfs (3.5T) .Ed .Pp The name of the ESP on this system is -.Pa nvd0p1 . +.Pa nda0p1 . +By default, this will be mounted on +.Pa /boot/efi . +To check: +.Bd -literal -offset indent +# mount | grep nda0p1 +/dev/nda0p1 on /boot/efi (msdosfs, local) +.Ed +If it's not mounted, you will need to mount it: +.Bd -literal -offset indent +# mount -t msdosfs /dev/nda0p1 /boot/efi +.Ed .Pp -Second, let's mount the ESP, copy -.Nm -to the special location reserved for -.Fx -EFI loaders, and unmount once finished: +.Xr efibootmgr 8 +reports what we booted from. +.Bd -literal -offset indent +# efibootmgr -v +Boot to FW : false +BootCurrent: 0001 +Timeout : 2 seconds +BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 +... ++Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) + nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI +... +.Ed +Often there are several options, depending on the BIOS. +The entry that we booted with is marked with a +.Sq + +at the start of the line, as shown above. +So in this case, this firmware is using +.Pa /EFI/FREEBSD/LOADER.EFI +from the ESP. +Often times it will be the UEFI +.Dq default +loader, which varies by architecture. +.Bl -column -offset indent "Architecture" "Default Path" +.It Sy Architecture Ta Sy Default Path +.It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI +.It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI +.It i386 Ta Pa /EFI/BOOT/BOOTIA32.EFI +.It riscv Ta Pa /EFI/BOOT/BOOTRISCV64.EFI +.El +However, care must be taken: some multiple-boot environments rely on a special +.Pa bootXXX.efi +to function. +Before updating a +.Pa bootXXX.efi +file, make sure it is the FreeBSD boot loader before updating it: +.Bd -literal -offset indent +# strings /boot/efi/EFI/BOOT/BOOTX64.EFI | grep FreeBSD | grep EFI +FreeBSD/amd64 EFI loader, Revision 3.0 +.Ed +.Pp +.Xr bsdinstall 8 +copies +.Pa loader.efi +to the default name if there wasn't one there before. +Check to see if they are copies before updating (with X64 substituted using the +above table): +.Bd -literal -offset indent +# cmp /boot/efi/EFI/FREEBSD/LOADER.EFI /boot/efi/EFI/BOOT/BOOOTX64.EFI +.Ed +Copy the loader: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/FREEBSD/LOADER.EFI +.Ed +replacing the all caps part of the example with the proper path. +.Pp +If ESP path was +.Pa /FREEBSD/LOADER.EFI +and LOADER.EFI and BOOTX64.EFI were identical in the cmp step, +copy the loader to the default location: +.Bd -literal -offset indent +# cp /boot/loader.efi /boot/efi/EFI/BOOT/BOOTX64.EFI +.Ed +.Pp +.Bd -literal -offset indent +# umount /boot/efi +.Ed +Finally, if you mounted the ESP, you may wish to unmount it. .Bd -literal -offset indent -# mount_msdosfs /dev/nvd0p1 /boot/efi -# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi # umount /boot/efi .Ed .Sh SEE ALSO .Xr loader 8 , .Xr uefi 8 .Sh BUGS -Systems that do not have a -.Dv ConOut -variable set are not conformant with the standard, and likely have unexpected -results. -.Pp Non-x86 serial console handling is even more confusing and less well documented. .Pp Sometimes when the serial port speed isn't set, 9600 is used. Other times the result is typically 115200 since the speed remains unchanged from the default. +.Pp +U-Boot implements a subset of the UEFI standard. +Some versions do not support fetching loader variables, so +.Pa efibootmgr +may not work. +In addition, +.Pa efibootmgr +is not supported on armv7 or riscv. +In these instances, the user has to understand what was booted to update +it properly (and in most cases, it will be the FreeBSD path and the UEFI default +so just copy loader.efi there if there are loaders there). +Typically in these embedded situations, there is only one .efi file (loader.efi +or a copy of loader.efi). +The path to this file is typically the default removable path above. +.Pp +Managing booting multiple OSes on UEFI varies greatly, so extra caution when +updating the UEFI default loader. +.Pp +The old, now obsolete, boot1.efi was installed as bootx64.efi in +.Fx 10 +and earlier. +Since it was quite limited in functionality, we created very small +ESPs by default. +A modern loader.efi will not fit. +However, if the old boot1.efi still works, there's no need to update +it since it will chain boot /boot/loader.efi from a copy that +make installworld updates. From nobody Thu Aug 29 19:46:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvsGm5Yr3z52W36; Thu, 29 Aug 2024 19:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvsGm3mDbz4BHR; Thu, 29 Aug 2024 19:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724960784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRfjbLgdt0QKPPSST6T9r4j5hDziCwQWCMTTt7J+JFI=; b=d1vD83MdmQAxwrIBx32NQNabh1Z9U03o/VUfgMECUFDm7SB/GlHGaAjXk/C+pNPLyT3GRX 0XgvQzc6lTTTYhdC0ZOANHUT2RRzjTGgonD3YqWPIHFtcqTUDSNjKhFZz46WPr5wY6Ak7W JAuBnORmyYYBnc2K+lpQBW4djLnnK0xbLZYMpI3lL6hTBCSX1QbLZXUbKPCcp/sx8vTQ36 oyJdWdU3pMuR1oesjUBpMGYSSuV1I8PoDDeK1KwopjFjQtB/ls+0RjzCH1+2fouWBOJ7tG Sv0YC8JlMqyH6Clftg3Bk6bif02EsK2mmJgwtH/RZG70Gq6wSev2u6HvyCQLaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724960784; a=rsa-sha256; cv=none; b=MCFedGu77g5v3fTz7TJ/P8wAtHTqWPSaa9txuwefePQbHn6BmZ0pzHBGpnjoDWFCOjNopO PAz2SXLL+YhD+8zKJlvA2Pwkepb7ahp84VKBHXDp7+Hx36jxE3gL0grl5lDLzmSFVCe2SO DZ3iMolksupx3o1Gn7XEXvuEmnW3PAhrQAhzw4eu4xsK24BXkr2Wc62fm1OVv1aisoF9q1 v7wmj6oyJBODq04tHkW6qBpK8xGFe+YwfykgQgI9H7s71tLxx1C4t4/sWqugnUgZaKk781 jpnwYkO1tmA/U9UXeIPIiddlHxkMg2ZpsKGMZm5PFDu8sAxTUbLLMaLJQRAdIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724960784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRfjbLgdt0QKPPSST6T9r4j5hDziCwQWCMTTt7J+JFI=; b=Lob0UthOtYZNF1JuvFKbCGA693W6Kz1Bkg7tpVb30sOQqooFD9u+RQok4mBh2kCDsTfuKs x6teHmWx3O58Vg9+mzBUrPjp2vblZzaPQlMOA2ICn63quIdfwcG+WpZzvvbdbksxzkuFDZ 5zsTE0WPJ5BuAQjb2o45RbnU18yxv2ap/cAaR2/dbe1qEulHwpRHqbgrvER5NF3TZC+dzx 2W8QpD5VmGdqGNbHGZfSgA5c8mpof1Vwz5xgWFWk/89nk7+DP2aVzSHg+vbMRcljF28ONe wOiuLiwt8xnUJzM+jRYOtL8b7OwOkKE8XiPSSnXBcEHjibtAjyuwDYG4GHD7VQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WvsGm3DvLzX0D; Thu, 29 Aug 2024 19:46: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 47TJkOea053590; Thu, 29 Aug 2024 19:46:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TJkO0d053587; Thu, 29 Aug 2024 19:46:24 GMT (envelope-from git) Date: Thu, 29 Aug 2024 19:46:24 GMT Message-Id: <202408291946.47TJkO0d053587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 41e016289f77 - main - Improve accuracy of asinf(3) and acosf(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41e016289f77deb88b0ef1ec3f7b2ab3515ac7c8 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=41e016289f77deb88b0ef1ec3f7b2ab3515ac7c8 commit 41e016289f77deb88b0ef1ec3f7b2ab3515ac7c8 Author: Steve Kargl AuthorDate: 2024-08-29 19:44:48 +0000 Commit: Dimitry Andric CommitDate: 2024-08-29 19:44:48 +0000 Improve accuracy of asinf(3) and acosf(3) This uses a better rational approximation to improve the accuracy of both functions. For exhaustive testing of asinf(3) in the interval, the current libm gives: % ./tlibm asin -fPED -x 0x1p-12f -X 1 Interval tested for asinf: [0.000244141,1] ulp <= 0.5: 97.916% 98564994 | 97.916% 98564994 0.5 < ulp < 0.6: 2.038% 2051023 | 99.953% 100616017 0.6 < ulp < 0.7: 0.047% 47254 | 100.000% 100663271 0.7 < ulp < 0.8: 0.000% 25 | 100.000% 100663296 Max ulp: 0.729891 at 5.00732839e-01 which isn't too bad given that much of the computation is actually done in double floating point. With the new rational approximation, exhaustive testing yields: % ./tlibm asin -fPED -x 0x1p-12f -X 1 Interval tested for asinf: [0.000244141,1] ulp <= 0.5: 99.711% 100372643 | 99.711% 100372643 0.5 < ulp < 0.6: 0.288% 290357 | 100.000% 100663000 0.6 < ulp < 0.7: 0.000% 296 | 100.000% 100663296 Max ulp: 0.636344 at 5.09706438e-01 Similarly, for exhaustive testing of asinf(3) in the interval, the current libm gives: % ./tlibm acos -fPED -x -1 -X -0x1p-12f Interval tested for acosf: [-1,-0.000244141] ulp <= 0.5: 97.008% 97651921 | 97.008% 97651921 0.5 < ulp < 0.6: 2.441% 2457242 | 99.450% 100109163 0.6 < ulp < 0.7: 0.472% 475503 | 99.922% 100584666 0.7 < ulp < 0.8: 0.071% 71309 | 99.993% 100655975 0.8 < ulp < 0.9: 0.007% 7319 | 100.000% 100663294 0.9 < ulp < 1.0: 0.000% 2 | 100.000% 100663296 Max ulp: 0.914007 at -5.01484931e-01 % ./tlibm acos -fPED -x 0x1p-12f -X 1 Interval tested for acosf: [0.000244141,1] ulp <= 0.5: 97.317% 97962530 | 97.317% 97962530 0.5 < ulp < 0.6: 2.340% 2355182 | 99.657% 100317712 0.6 < ulp < 0.7: 0.314% 316134 | 99.971% 100633846 0.7 < ulp < 0.8: 0.029% 29450 | 100.000% 100663296 Max ulp: 0.796035 at 4.99814630e-01 With the new rational approximation, exhaustive testing yields: % ./tlibm acos -fPED -x -1 -X -0x1p-12f Interval tested for acosf: [-1,-0.000244141] ulp <= 0.5: 97.010% 97653245 | 97.010% 97653245 0.5 < ulp < 0.6: 2.442% 2458373 | 99.452% 100111618 0.6 < ulp < 0.7: 0.473% 476012 | 99.925% 100587630 0.7 < ulp < 0.8: 0.068% 68603 | 99.993% 100656233 0.8 < ulp < 0.9: 0.007% 7063 | 100.000% 100663296 Max ulp: 0.896189 at -5.04511118e-01 % ./tlibm acos -fPED -x 0x1p-12f -X 1 Interval tested for acosf: [0.000244141,1] ulp <= 0.5: 97.650% 98298175 | 97.650% 98298175 0.5 < ulp < 0.6: 2.028% 2041709 | 99.679% 100339884 0.6 < ulp < 0.7: 0.292% 293555 | 99.970% 100633439 0.7 < ulp < 0.8: 0.030% 29857 | 100.000% 100663296 Max ulp: 0.775875 at 4.91849005e-01 PR: 281001 MFC after: 1 week --- lib/msun/src/e_acosf.c | 20 +++++++++++++------- lib/msun/src/e_asinf.c | 22 ++++++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/lib/msun/src/e_acosf.c b/lib/msun/src/e_acosf.c index 42ba126d1baa..ede552e7055a 100644 --- a/lib/msun/src/e_acosf.c +++ b/lib/msun/src/e_acosf.c @@ -22,11 +22,17 @@ pi = 3.1415925026e+00, /* 0x40490fda */ pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */ static volatile float pio2_lo = 7.5497894159e-08; /* 0x33a22168 */ + +/* + * The coefficients for the rational approximation were generated over + * 0x1p-12f <= x <= 0.5f. The maximum error satisfies log2(e) < -30.084. + */ static const float -pS0 = 1.6666586697e-01, -pS1 = -4.2743422091e-02, -pS2 = -8.6563630030e-03, -qS1 = -7.0662963390e-01; +pS0 = 1.66666672e-01f, /* 0x3e2aaaab */ +pS1 = -1.19510300e-01f, /* 0xbdf4c1d1 */ +pS2 = 5.47002675e-03f, /* 0x3bb33de9 */ +qS1 = -1.16706085e+00f, /* 0xbf956240 */ +qS2 = 2.90115148e-01f; /* 0x3e9489f9 */ float acosf(float x) @@ -46,13 +52,13 @@ acosf(float x) if(ix<=0x32800000) return pio2_hi+pio2_lo;/*if|x|<2**-26*/ z = x*x; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); r = p/q; return pio2_hi - (x - (pio2_lo-x*r)); } else if (hx<0) { /* x < -0.5 */ z = (one+x)*(float)0.5; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); s = sqrtf(z); r = p/q; w = r*s-pio2_lo; @@ -66,7 +72,7 @@ acosf(float x) SET_FLOAT_WORD(df,idf&0xfffff000); c = (z-df*df)/(s+df); p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = one+z*(qS1+z*qS2); r = p/q; w = r*s+c; return (float)2.0*(df+w); diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c index a2ee1a166f03..8d1aca27df83 100644 --- a/lib/msun/src/e_asinf.c +++ b/lib/msun/src/e_asinf.c @@ -18,12 +18,18 @@ static const float one = 1.0000000000e+00, /* 0x3F800000 */ -huge = 1.000e+30, - /* coefficient for R(x^2) */ -pS0 = 1.6666586697e-01, -pS1 = -4.2743422091e-02, -pS2 = -8.6563630030e-03, -qS1 = -7.0662963390e-01; +huge = 1.000e+30; + +/* + * The coefficients for the rational approximation were generated over + * 0x1p-12f <= x <= 0.5f. The maximum error satisfies log2(e) < -30.084. + */ +static const float +pS0 = 1.66666672e-01f, /* 0x3e2aaaab */ +pS1 = -1.19510300e-01f, /* 0xbdf4c1d1 */ +pS2 = 5.47002675e-03f, /* 0x3bb33de9 */ +qS1 = -1.16706085e+00f, /* 0xbf956240 */ +qS2 = 2.90115148e-01f; /* 0x3e9489f9 */ static const double pio2 = 1.570796326794896558e+00; @@ -46,7 +52,7 @@ asinf(float x) } t = x*x; p = t*(pS0+t*(pS1+t*pS2)); - q = one+t*qS1; + q = one+t*(qS1+t*qS2); w = p/q; return x+x*w; } @@ -54,7 +60,7 @@ asinf(float x) w = one-fabsf(x); t = w*(float)0.5; p = t*(pS0+t*(pS1+t*pS2)); - q = one+t*qS1; + q = one+t*(qS1+t*qS2); s = sqrt(t); w = p/q; t = pio2-2.0*(s+s*w); From nobody Thu Aug 29 19:58:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvsXP1QCtz52WFs; Thu, 29 Aug 2024 19:58:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) (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 4WvsXN4QF0z4F3P; Thu, 29 Aug 2024 19:58:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-498d053f116so221837137.3; Thu, 29 Aug 2024 12:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724961490; x=1725566290; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=XnxT51WBflOuVFdft36vRZkqjXC1vm6ONkCQR+8Pg4Y=; b=JrtkaTV8WK9Z3DYJpqtxhrqf1/KrK5zhV+CIUc4cqjD8qVt42c+CH4XNyqBvg3tMuq X3eeRBOpuyMd55aDSpVnI4uftyQH1opn7xKh4cI7yuPfYaYSjUv//3g7EAN88ONz0kka 1Oee4PctBHqNWrqZ3m74nSv9bH3NqqlYAbOZXLSDvMPliUscSm9gCHnYe6vyMOCy6AbM EmFaIIgR5Gw/VL3bFg+ZkGU0km3Rro4Gcl7kgp0U2SKA+LyTxO56R0w0nN9Kj3rnOIvx zUS9zGUHau7CdZ+EDLkyJDXQGlF7V59ca2/sMB/0iuL6oJPCj3j8iDQZdanagv8zZVvk 4oxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724961490; x=1725566290; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XnxT51WBflOuVFdft36vRZkqjXC1vm6ONkCQR+8Pg4Y=; b=dy2XKohv4O3oSjAx7sNrA3qvzS/mLF5MQ16suJ0UhoYHgi7Bf2bPcuSG3Rd0cYHyoe +jdtFrfvBvTvj808IHHkLjqTxb3kxK0WilKyTARy7Z5lXR5X9GP49tg7ANFNHmJW2FRM 5Uli3RUSIMrnuS38UFZduQWemlk3DkBa7u+tUOQiOyc0wTKg7tkVaQghMQLJDzAskV1b FgV5adG5IjUMVI1AAe8Eqr4/TCCCzgp/rCFoVCiAwz/lLWAVBuENoQhRglKrANXAzPtH elSlTwhlf9PdWdh93xLAB4FXTLRWE/+zt+Ux3Ue0+o6suHB2IfkUdLYr2x7xQVkKuRKJ XaRw== X-Forwarded-Encrypted: i=1; AJvYcCUc4rXSVeyvt4mN3pA/6zKJXSfpm6mgeYD4fESEa15kjgWliF5os45c1ieitItVMmtHv+Kr3B8yn4533Tzl/09Gdm7b@freebsd.org, AJvYcCUm6d8Nc7nNFjXWkWttmhOTIi0I9Y972My2+s/EJ8c8BYf3DlYEujwbtoXF8hs01MY0QUd6b0w5l41SyxZd52WE34a4dBY=@freebsd.org X-Gm-Message-State: AOJu0Yxbpr7GwBSXMUm+z/Uavix5nN9slfLE5r51XxTSZJsh+8smHhzP JX1YDNdLSzNL9I6DEjDUx6xDrN0S22gN1mPFBYu+jtu1Yxlt8HJmBqd+YA== X-Google-Smtp-Source: AGHT+IEnjj0Ux1afFKZLNfhFJeBeOVT7zKs2R6axzDPWIVJBhWMq6g3a7EgsPztug66E07ti+F8OXg== X-Received: by 2002:a05:6102:41ac:b0:48f:42c8:e0a9 with SMTP id ada2fe7eead31-49a5b1cc3b2mr4688034137.26.1724961490425; Thu, 29 Aug 2024 12:58:10 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a806c24165sm81183385a.43.2024.08.29.12.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 12:58:09 -0700 (PDT) Date: Thu, 29 Aug 2024 15:58:07 -0400 From: Mark Johnston To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a58ece87303f - main - zfsd tests: Update the mock zpool_handle Message-ID: References: <202408291745.47THjSOe049069@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WvsXN4QF0z4F3P On Thu, Aug 29, 2024 at 11:53:14AM -0600, Alan Somers wrote: > On Thu, Aug 29, 2024 at 11:45 AM Mark Johnston wrote: > > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=a58ece87303f882367105c92a27268ed6befa655 > > > > commit a58ece87303f882367105c92a27268ed6befa655 > > Author: Mark Johnston > > AuthorDate: 2024-08-29 17:37:57 +0000 > > Commit: Mark Johnston > > CommitDate: 2024-08-29 17:40:44 +0000 > > > > zfsd tests: Update the mock zpool_handle > > > > The zfsd tests rely on this having the same layout as the real > > zpool_handle, which changed in the last OpenZFS import. > > > > Fixes: 62e7d3c89ebd ("ddt: add support for prefetching tables into the ARC") > > Reported by: Jenkins > > Oh, I already had https://reviews.freebsd.org/D46479 open for this, > but you beat me to it ;) Ah, sorry. I was going through some test failures and just pushed patches for a couple of "obvious" ones. From nobody Thu Aug 29 20:04:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WvsgP0Tg5z52XdR; Thu, 29 Aug 2024 20:04:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (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 4WvsgN0mtBz4GHB; Thu, 29 Aug 2024 20:04:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=WZHsMJGF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f2e as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-6bf9ddfc2dcso5396336d6.1; Thu, 29 Aug 2024 13:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724961854; x=1725566654; 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=O22jxAxMputcOsSSojMXvHXFGA+GsVvAJKFIxAfBnp8=; b=WZHsMJGFCAYF1aYxPZw4CmdlWeEDrFQobRhlCnA6+ErpXnTaj5aXZw6TTSL/5/UGfL w7Qn++U3lSNHYW2S88WlUlG9aCZIlglq2fS226F0uqTtbf31BrkfC6xp+aTjQc560l3j fslk6KKWSiNoNPY89eWIGlQBpIdDVK7vhvXfkgHWaHQjmKtbCs0eGwMOM7iGh8oTGT1T IIrJkKyUpBjX6r4giJIJPeniILsmSprGtKXJ1FmFENQLjRV7hQzoFY5GnBJKAc7K/yFT A3KGnusuGkKHF3ogjEfDGFpPk1uji8tyjTPueXpksX33WPMCXaAXLYWy64PfGjVxgXH2 DZBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724961854; x=1725566654; 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=O22jxAxMputcOsSSojMXvHXFGA+GsVvAJKFIxAfBnp8=; b=pM9Tf1i/i2KCltwtMjOG030C7RDIoCXkxyviRxeUwUhUmfIScI2M4PtgeTajhkhv8S Yuv61RbnE+MV3E5Nr0vCuZzQrtef5x33pjJgpxSkUk3E4VY/LWqqsVXI5MuLNv20idz5 sZ+ygC7UTVuOWajvildZ+7nwfrJe1KWN5tRjoj9Kt2BULPp2lKBoodAvy8NxzYBd1QRe geq/xIevGaN5k14pS6MzCKHwrQj5b8l4lv1IDwSlKF6UcLzf+M7cQH6QCVsJasZN+Bjg U6Et9xZhCgMAnFwSmLc+RlNTNL7IGJEZgRmza+Eoh2KetBppUtkeP7AjJwr5s3LR74M8 KhuA== X-Forwarded-Encrypted: i=1; AJvYcCU5Bpa17iGDI2NCoEKoH1gms376exdj4UB2lLqfaezMqZ258u1s6teUSe6tLKXfQcapRI9A9M/G+Z4neHyC7tq7BUfb@freebsd.org, AJvYcCWsGtiR6MR6KN9k5ui3maOCeSgDnWeFTEP6nbnZTzFO7au38uNbtztOn4OGLXgih1fEdZNCCJC6sR0OCrg0mXRes+vKKyg=@freebsd.org X-Gm-Message-State: AOJu0YzyetvrhGTQeTvhrTcovwgbAf4BnWJP0R3hQpwXeMDlwkKDbtdc tbJq3idu3PrI3M/4PR3tTNPXDd7gzleVoDFSwzv9mNpn3dbzcg+FNYDIOQ== X-Google-Smtp-Source: AGHT+IG30aVeDAlKY9G66SK4lL+APhoEJz8Y1O/4fHD3pqPIUaPwWV2WCxOWkurddxyvNPsFMe/wLg== X-Received: by 2002:a05:6214:428e:b0:6bf:4fc4:cdd2 with SMTP id 6a1803df08f44-6c33e62a56fmr45830226d6.30.1724961853878; Thu, 29 Aug 2024 13:04:13 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c340c1e65esm8350996d6.46.2024.08.29.13.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 13:04:13 -0700 (PDT) Date: Thu, 29 Aug 2024 16:04:10 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ff1ae3b3639d - main - rangelocks: restore caching of the single rl entry in the struct thread Message-ID: References: <202408060406.47646dvJ004709@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202408060406.47646dvJ004709@gitrepo.freebsd.org> X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.59 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.989]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2e:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4WvsgN0mtBz4GHB On Tue, Aug 06, 2024 at 04:06:39AM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ff1ae3b3639d39a6485cfc655bf565cd04b9caa6 > > commit ff1ae3b3639d39a6485cfc655bf565cd04b9caa6 > Author: Konstantin Belousov > AuthorDate: 2023-08-23 23:29:50 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-08-06 04:05:58 +0000 > > rangelocks: restore caching of the single rl entry in the struct thread > > Reviewed by: markj, Olivier Certner > Tested by: pho > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D41787 > --- > sys/kern/kern_rangelock.c | 33 +++++++++++++++++++++++++++------ > sys/kern/kern_thread.c | 1 + > sys/sys/rangelock.h | 1 + > 3 files changed, 29 insertions(+), 6 deletions(-) > > diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c > index 355b2125dd9b..2f16569b19aa 100644 > --- a/sys/kern/kern_rangelock.c > +++ b/sys/kern/kern_rangelock.c > @@ -82,8 +82,15 @@ static struct rl_q_entry * > rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) > { > struct rl_q_entry *e; > - > - e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); > + struct thread *td; > + > + td = curthread; > + if (td->td_rlqe != NULL) { > + e = td->td_rlqe; > + td->td_rlqe = NULL; > + } else { > + e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); > + } > e->rl_q_next = NULL; > e->rl_q_free = NULL; > e->rl_q_start = start; > @@ -95,6 +102,12 @@ rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) > return (e); > } > > +void > +rangelock_entry_free(struct rl_q_entry *e) > +{ > + uma_zfree_smr(rl_entry_zone, e); > +} > + > void > rangelock_init(struct rangelock *lock) > { > @@ -106,6 +119,7 @@ void > rangelock_destroy(struct rangelock *lock) > { > struct rl_q_entry *e, *ep; > + struct thread *td; > > MPASS(!lock->sleepers); > for (e = (struct rl_q_entry *)atomic_load_ptr(&lock->head); > @@ -386,8 +400,10 @@ rangelock_lock_int(struct rangelock *lock, bool trylock, vm_ooffset_t start, > vm_ooffset_t end, int locktype) > { > struct rl_q_entry *e, *free, *x, *xp; > + struct thread *td; > enum RL_INSERT_RES res; > > + td = curthread; > for (res = RL_LOCK_RETRY; res == RL_LOCK_RETRY;) { > free = NULL; > e = rlqentry_alloc(start, end, locktype); > @@ -401,10 +417,15 @@ rangelock_lock_int(struct rangelock *lock, bool trylock, vm_ooffset_t start, > e = NULL; > } > for (x = free; x != NULL; x = xp) { > - MPASS(!rl_e_is_marked(x)); > - xp = x->rl_q_free; > - MPASS(!rl_e_is_marked(xp)); > - uma_zfree_smr(rl_entry_zone, x); > + MPASS(!rl_e_is_marked(x)); > + xp = x->rl_q_free; > + MPASS(!rl_e_is_marked(xp)); > + if (td->td_rlqe == NULL) { > + smr_synchronize(rl_smr); I think I had the impression that this was a rare case, but empirically it is not. As far as I can see, this smr_synchronize() call happens every time an entry is freed, which could be very frequent. smr_synchronize() bumps the global sequence counter and blocks until all CPUs have had a chance to observe the new value, so is quite expensive. I didn't try benchmarking yet, but pwrite3 from will-it-scale should be a good candidate. Why do we maintain this per-thread cache at all? IMO it would make more sense to unconditionally free the entry here. Or perhaps I'm missing something here. > + td->td_rlqe = x; > + } else { > + uma_zfree_smr(rl_entry_zone, x); > + } > } > } > return (e); > diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c > index c951e7297c89..9c3694feb945 100644 > --- a/sys/kern/kern_thread.c > +++ b/sys/kern/kern_thread.c > @@ -480,6 +480,7 @@ thread_fini(void *mem, int size) > EVENTHANDLER_DIRECT_INVOKE(thread_fini, td); > turnstile_free(td->td_turnstile); > sleepq_free(td->td_sleepqueue); > + rangelock_entry_free(td->td_rlqe); > umtx_thread_fini(td); > MPASS(td->td_sel == NULL); > } > diff --git a/sys/sys/rangelock.h b/sys/sys/rangelock.h > index 310371bef879..60f394b67677 100644 > --- a/sys/sys/rangelock.h > +++ b/sys/sys/rangelock.h > @@ -65,6 +65,7 @@ void *rangelock_wlock(struct rangelock *lock, vm_ooffset_t start, > vm_ooffset_t end); > void *rangelock_trywlock(struct rangelock *lock, vm_ooffset_t start, > vm_ooffset_t end); > +void rangelock_entry_free(struct rl_q_entry *e); > #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) > void _rangelock_cookie_assert(void *cookie, int what, const char *file, > int line); From nobody Thu Aug 29 20:22:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvt572c5lz52Z5M; Thu, 29 Aug 2024 20:23:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wvt560mnyz4Km9; Thu, 29 Aug 2024 20:23:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 47TKMp86094278; Thu, 29 Aug 2024 23:22:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 47TKMp86094278 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 47TKMpID094277; Thu, 29 Aug 2024 23:22:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Aug 2024 23:22:51 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ff1ae3b3639d - main - rangelocks: restore caching of the single rl entry in the struct thread Message-ID: References: <202408060406.47646dvJ004709@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-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] X-Rspamd-Queue-Id: 4Wvt560mnyz4Km9 On Thu, Aug 29, 2024 at 04:04:10PM -0400, Mark Johnston wrote: > On Tue, Aug 06, 2024 at 04:06:39AM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ff1ae3b3639d39a6485cfc655bf565cd04b9caa6 > > > > commit ff1ae3b3639d39a6485cfc655bf565cd04b9caa6 > > Author: Konstantin Belousov > > AuthorDate: 2023-08-23 23:29:50 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-08-06 04:05:58 +0000 > > > > rangelocks: restore caching of the single rl entry in the struct thread > > > > Reviewed by: markj, Olivier Certner > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D41787 > > --- > > sys/kern/kern_rangelock.c | 33 +++++++++++++++++++++++++++------ > > sys/kern/kern_thread.c | 1 + > > sys/sys/rangelock.h | 1 + > > 3 files changed, 29 insertions(+), 6 deletions(-) > > > > diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c > > index 355b2125dd9b..2f16569b19aa 100644 > > --- a/sys/kern/kern_rangelock.c > > +++ b/sys/kern/kern_rangelock.c > > @@ -82,8 +82,15 @@ static struct rl_q_entry * > > rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) > > { > > struct rl_q_entry *e; > > - > > - e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); > > + struct thread *td; > > + > > + td = curthread; > > + if (td->td_rlqe != NULL) { > > + e = td->td_rlqe; > > + td->td_rlqe = NULL; > > + } else { > > + e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); > > + } > > e->rl_q_next = NULL; > > e->rl_q_free = NULL; > > e->rl_q_start = start; > > @@ -95,6 +102,12 @@ rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) > > return (e); > > } > > > > +void > > +rangelock_entry_free(struct rl_q_entry *e) > > +{ > > + uma_zfree_smr(rl_entry_zone, e); > > +} > > + > > void > > rangelock_init(struct rangelock *lock) > > { > > @@ -106,6 +119,7 @@ void > > rangelock_destroy(struct rangelock *lock) > > { > > struct rl_q_entry *e, *ep; > > + struct thread *td; > > > > MPASS(!lock->sleepers); > > for (e = (struct rl_q_entry *)atomic_load_ptr(&lock->head); > > @@ -386,8 +400,10 @@ rangelock_lock_int(struct rangelock *lock, bool trylock, vm_ooffset_t start, > > vm_ooffset_t end, int locktype) > > { > > struct rl_q_entry *e, *free, *x, *xp; > > + struct thread *td; > > enum RL_INSERT_RES res; > > > > + td = curthread; > > for (res = RL_LOCK_RETRY; res == RL_LOCK_RETRY;) { > > free = NULL; > > e = rlqentry_alloc(start, end, locktype); > > @@ -401,10 +417,15 @@ rangelock_lock_int(struct rangelock *lock, bool trylock, vm_ooffset_t start, > > e = NULL; > > } > > for (x = free; x != NULL; x = xp) { > > - MPASS(!rl_e_is_marked(x)); > > - xp = x->rl_q_free; > > - MPASS(!rl_e_is_marked(xp)); > > - uma_zfree_smr(rl_entry_zone, x); > > + MPASS(!rl_e_is_marked(x)); > > + xp = x->rl_q_free; > > + MPASS(!rl_e_is_marked(xp)); > > + if (td->td_rlqe == NULL) { > > + smr_synchronize(rl_smr); > > I think I had the impression that this was a rare case, but empirically > it is not. As far as I can see, this smr_synchronize() call happens > every time an entry is freed, which could be very frequent. > smr_synchronize() bumps the global sequence counter and blocks until all > CPUs have had a chance to observe the new value, so is quite expensive. > > I didn't try benchmarking yet, but pwrite3 from will-it-scale should be > a good candidate. > > Why do we maintain this per-thread cache at all? IMO it would make more > sense to unconditionally free the entry here. Or perhaps I'm missing > something here. Normally threads perform i/o syscalls, and for these syscalls, they need to perform just one rangelock op. In absence of the races with conflicting locks, the rangelock acquisition does not need another rl_q_entry item. In previous rangelock implementation, this was a significant improvement esp. on microbenchmarks where rangelock overhead could be reached, like repeated write or read of same single byte. Remembering that, I decided to keep the caching. From nobody Thu Aug 29 21:32:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvvdk2PQxz5MSrD; Thu, 29 Aug 2024 21:32: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 4Wvvdk1sjSz4VFf; Thu, 29 Aug 2024 21:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724967178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MTNUxmtowQVoJdoXk/Gx3+XUUTHkC+S25LWAjo8XaaE=; b=chnFq0yqBnq3TTLQfyronVxbLXzDeHWdAz5IB4FxESm4uDwIr1uhf9QYC3HksIp3FMK2fp ra+x4BMld9X6leTaphbLxK5CyBdTssJVtcnhuS+R3Wa53zbQw2KijdrCjipDi/WgU22k/A xYo29bwj3MSCMBJcIfGanhThvTFJV54iz6RkvIqBhBO+0Uw8KX5v4SrQZlywy8O48R+hpc EMMf96CWTa8l3woDMo3YkPqLJBmOj0EpUxslFD4gh3LoTIjUiJHTWbjgskRCU++TQMGGhF FgnLWX9mJ4meHt32tuGpHe1La6oxAyfvHTzAGXZ0xoXjY0fuDpGwQczqUeKT4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724967178; a=rsa-sha256; cv=none; b=bU28Y6Thb/V6jBc1bJ0tEYiuud1GAIt1hanylGsP7Vbu3xGE9uBc1DkoK/GsJt26mycSLX d4MHQg6xqZJQKd+7wZjDKkHtH2pVghIfEXVDtJy+ZKp0D4t28ncHMbYD+5BzS99c9lyCb+ YdxwRX18HTL6lNivpNZ9EW6LuVsMw7tw3HUw1maQvyehz1zBE0LTnO4OSrKPPenCWIqa09 KtlLydiCtrmYInw6/V4VSGCeKWVq2TXSmh5MRJ58cgoARGHqpXpSzcWmT89yoB3IIJWalF Oe5sZQdXfybUlbtpqGatCjBL45pPN+m8NIGIqyPQWUuNeeEspQQLwrwfNgu2aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724967178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MTNUxmtowQVoJdoXk/Gx3+XUUTHkC+S25LWAjo8XaaE=; b=PpXXuRprPBkjqqKEPM2g0cGIMMGN3kXrgvTcA1ewtL64IqtRXDaa7slxOOrcTIViOhy6yv sH58r/g9NGwAvNOXVQdErHTewzjHfY5ezxpnEBfpoyqc47hROgr3/bj20YzUH2UbYPO7ZN jy+CCJy1wAALcBqUFHHm8+UuouBrNK49uikaClzuboJmE74xnFSLdpFafYv39b1+pNTZN9 9qC0/CELLR+1zmWEPH7GdaZeuXkjdZzziwo65xcrXiURLbb1puyvovHJTodOODRf+ZSAMV fh2dlk9HJbjKvNJh1pbFvXOBjlTl5kRNOxUvT5u8ODAqZ56j5qxbzTwa9HJntg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wvvdk1ShfzZbT; Thu, 29 Aug 2024 21:32: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 47TLWwl6038914; Thu, 29 Aug 2024 21:32:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TLWwjB038911; Thu, 29 Aug 2024 21:32:58 GMT (envelope-from git) Date: Thu, 29 Aug 2024 21:32:58 GMT Message-Id: <202408292132.47TLWwjB038911@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: 7e49f04c8839 - main - rangelocks: stop caching per-thread rl_q_entry List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e49f04c88390c4c07f90c733c0d35ad6ff00f1c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7e49f04c88390c4c07f90c733c0d35ad6ff00f1c commit 7e49f04c88390c4c07f90c733c0d35ad6ff00f1c Author: Konstantin Belousov AuthorDate: 2024-08-29 20:45:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-29 21:32:48 +0000 rangelocks: stop caching per-thread rl_q_entry This should reduce the frequency of smr_synchronize() calls, that otherwise occur on almost each rangelock unlock. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46482 --- sys/kern/kern_rangelock.c | 26 +++----------------------- sys/kern/kern_thread.c | 2 -- sys/sys/proc.h | 2 +- sys/sys/rangelock.h | 1 - 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index 3a11059a7f64..3437e3da77ba 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -313,15 +313,8 @@ static struct rl_q_entry * rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) { struct rl_q_entry *e; - struct thread *td; - - td = curthread; - if (td->td_rlqe != NULL) { - e = td->td_rlqe; - td->td_rlqe = NULL; - } else { - e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); - } + + e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); e->rl_q_next = NULL; e->rl_q_free = NULL; e->rl_q_start = start; @@ -333,12 +326,6 @@ rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) return (e); } -void -rangelock_entry_free(struct rl_q_entry *e) -{ - uma_zfree_smr(rl_entry_zone, e); -} - void rangelock_init(struct rangelock *lock) { @@ -401,19 +388,12 @@ static void rangelock_free_free(struct rl_q_entry *free) { struct rl_q_entry *x, *xp; - struct thread *td; - td = curthread; for (x = free; x != NULL; x = xp) { MPASS(!rl_e_is_marked(x)); xp = x->rl_q_free; MPASS(!rl_e_is_marked(xp)); - if (td->td_rlqe == NULL) { - smr_synchronize(rl_smr); - td->td_rlqe = x; - } else { - uma_zfree_smr(rl_entry_zone, x); - } + uma_zfree_smr(rl_entry_zone, x); } } diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 9c3694feb945..4ccd6b26528e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -460,7 +460,6 @@ thread_init(void *mem, int size, int flags) td->td_allocdomain = vm_phys_domain(vtophys(td)); td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); - td->td_rlqe = NULL; EVENTHANDLER_DIRECT_INVOKE(thread_init, td); umtx_thread_init(td); td->td_kstack = 0; @@ -480,7 +479,6 @@ thread_fini(void *mem, int size) EVENTHANDLER_DIRECT_INVOKE(thread_fini, td); turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); - rangelock_entry_free(td->td_rlqe); umtx_thread_fini(td); MPASS(td->td_sel == NULL); } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 57c910d8fce0..1e98cc84a60a 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -247,7 +247,7 @@ struct thread { struct seltd *td_sel; /* Select queue/channel. */ struct sleepqueue *td_sleepqueue; /* (k) Associated sleep queue. */ struct turnstile *td_turnstile; /* (k) Associated turnstile. */ - struct rl_q_entry *td_rlqe; /* (k) Associated range lock entry. */ + void *td_pad1; /* Available */ struct umtx_q *td_umtxq; /* (c?) Link for when we're blocked. */ lwpid_t td_tid; /* (b) Thread ID. */ sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */ diff --git a/sys/sys/rangelock.h b/sys/sys/rangelock.h index accf33d7296b..32ccf3427b49 100644 --- a/sys/sys/rangelock.h +++ b/sys/sys/rangelock.h @@ -65,7 +65,6 @@ void *rangelock_wlock(struct rangelock *lock, vm_ooffset_t start, vm_ooffset_t end); void *rangelock_trywlock(struct rangelock *lock, vm_ooffset_t start, vm_ooffset_t end); -void rangelock_entry_free(struct rl_q_entry *e); void rangelock_may_recurse(struct rangelock *lock); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _rangelock_cookie_assert(void *cookie, int what, const char *file, From nobody Fri Aug 30 00:45:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wvzvr4wSYz5MkR3; Fri, 30 Aug 2024 00:45: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 4Wvzvr2lnkz4l4t; Fri, 30 Aug 2024 00:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724978728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMpIUAMXprScJQKmXveRjechz5Kda/zNmCnwj/Axw0U=; b=y0laINRk2z67RXqzp+JTna7+dpKCxIKPu7+8MQcVu/gLvnJlsHHrvex8M012mKmgP3TBIE HyHF4t45ZnM+LS8aOpG9t1jyFecWjzF3tFwzAzeDccZdRwdQrMh4bkY4mDsZRgHmBXARto nKoMwsejohHeAxnGp1ByjCJKER0fkkVVf+0HX1fLb44TtuT90aWxbcRz2LPZBRnXm3IdFP rGwtKh9cUSAGKqtFVBU9vICQJ03bYP3CyypyTfi9i2BWSkEncJ4c6VXwVSkClvJWflTFPN hhzVT9ADC3aMcmcudnAbjKRTpK9L8qaCFTAuA03Qr3gQpPr3xsPIu3YjaEaJTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724978728; a=rsa-sha256; cv=none; b=b7ks8zGpryEbmhjwPf4w6rOlsng+SuILPDRWvneVw/Vx9nUMQeX0MCT3NwDZ8OMh8cH49u tT7/gNVLg+Csv2RtQ7nPhaoVZ8Ei1jlYqWQQTMimxp1yE9gKmcGz8gc4Jg4IKNZugLa0m3 JTRjKomWyiKe9lcvcRVm3TC5OFO6AiJtljao2fmK5S3gP2RFbIMd/toK9OwpTKf4VQmjE9 KpOn8bhhBnXKgS1RGnjLy+HVHfJX382R435Jowvc0xGomiPk9HP0oN1NgL1wCKaCgitXVN +4RGtJKtQBpGXb9FfjLr0M6BWALHn8eY37Y7a9VdL4kF1KjaxuWXWjM86L1QuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724978728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMpIUAMXprScJQKmXveRjechz5Kda/zNmCnwj/Axw0U=; b=skNzC9So5tzR8/whjzYHS5MXaj3vOi1EDO4M1LAWj/UGXHhZm8ctj+b4pTUg0suUHiZS8x Nzlyx61yk1i5Fiz8xrXEnkVSLfLyav0KEVqdJVAoQPbhfIw8JmLcUGDA/WKxzkPe5weBXi gFgNWv7KsV18zD6LadpGNS1cFcUHfraVnCJlp5/AS9qnkcroSZpPNtr1S9QmzRmT2gy19c FiNVU5x0Sa99/D5ueci9BNRtcCZhTAeIUdoy4tr99XQ5ixOh1T8KoGNpQxvtaZ0VA2B5tM P60cxVeoi6aKpjHD/vqtSRRUrOEGbyC0jddCKKgqo0BGBxFxdrgs/6CF1PB8Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wvzvr1vzlzg3X; Fri, 30 Aug 2024 00:45: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 47U0jSHU060910; Fri, 30 Aug 2024 00:45:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U0jSZ4060907; Fri, 30 Aug 2024 00:45:28 GMT (envelope-from git) Date: Fri, 30 Aug 2024 00:45:28 GMT Message-Id: <202408300045.47U0jSZ4060907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 73da0e55aa90 - releng/13.4 - 13.4: Update to RC2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 73da0e55aa906c86aaade60d0bd8e71a84c6dca2 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=73da0e55aa906c86aaade60d0bd8e71a84c6dca2 commit 73da0e55aa906c86aaade60d0bd8e71a84c6dca2 Author: Colin Percival AuthorDate: 2024-08-30 00:45:01 +0000 Commit: Colin Percival CommitDate: 2024-08-30 00:45:01 +0000 13.4: Update to RC2 Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 4323fb23657c..4bb01ad3de32 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="RC1" +BRANCH="RC2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Aug 30 01:05:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww0LQ4lphz5MmNW; Fri, 30 Aug 2024 01:05: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 4Ww0LQ44hQz4n1X; Fri, 30 Aug 2024 01:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724979902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aE8LjichO5nhXSVbdEZ6juXjyW/rP/2w7UYZw6tiPsw=; b=sRtIYY/6WihPWt7PbUAbcO0kJIyd4x8V738oJUXzbWAuPySMms0keeHM1TS67iaxBxJkK7 mS2ZHuh1s//hHNRc9yG8Wkltl9bZGnZMnHh8l3w5BlRoI6dBoWsVGPxrbyZPbVknWsFQGV /u8SHB1eqJeFkoiTnlhUFKk9OUIMHH+gWdjpeHgfIWc2/eVr7+UQkvV5O4hB4Yhl5O9T7q YdyiXBvIGZ4Nof4fUTHKOLSMbShBUoatQoVkkXxD2Yf3UEvipzoY9DgjVJYcHtPjj1oYSE vG8qxHGUGzvKuYRyPUDFUJEGqmuBW76s5jIolifRkjyCSjYV//Hs4wM19OGcJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724979902; a=rsa-sha256; cv=none; b=H5NRDhlVJOgJDdfaCk+R6IKNLQ1eKJsUGg1lDMH9rs3skFL4Mkf1dyLS0Ir5PSu4eRz9gl Ro9ojqIPj0wAgJER5ki+skKss+FtjCWdvcoR6xqQ+3wYf8b1s3oRw+INl45dtn37Jm+dSV PPBO2netcSajv8JpBFdcf2eCLZWGpDYLHI2qDNS9HOjYGgKeRUyzgGJlttfrBgxv3HfdGc OKsr6LRvEO/cPnb2doEEuBK1sJu5RPLkbagni/euEsuqcRFbygH3ACfd07By9r+VmHXvU8 G3p0j+V+03Oo36z19EtfcCyxikoDWor22oG1vnoy295vVU2rj5mLrOYK0x17XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724979902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aE8LjichO5nhXSVbdEZ6juXjyW/rP/2w7UYZw6tiPsw=; b=HUNtNhBD5HwsrdZX9yBV1t66AQYK9PYWxeJ3QL1fXR37LFvi7ysU28PMi/asbrHRE36IKZ 7uFtt4UA3nPfhITYO07jMJiwR2h8OCt++GhOuaF1QoIUMVVoRDiKLuGyGNoEC761e4bku4 WhLjY6+NWS23KZROc1znvSAqzz83T4qkXbnFmUzo7/AasNgUk8nSsWXV9cQpMrwpo13WRJ VQ1s7MZz5rOW98ePOLT7pqUal6z4c0EbvUtBqK8E390qB4J/lBI8l1RdrLZUdTbqSKlxXk 0yrQGYu+WEEPHguVUNEqRJoOevue75mfvI9I9Xn3LOlNIuAfamgEvVDn0jAdkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww0LQ3Yyjzgxw; Fri, 30 Aug 2024 01:05: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 47U152qe095211; Fri, 30 Aug 2024 01:05:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U152s5095208; Fri, 30 Aug 2024 01:05:02 GMT (envelope-from git) Date: Fri, 30 Aug 2024 01:05:02 GMT Message-Id: <202408300105.47U152s5095208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 3b4dcc0feb41 - main - cxgbe/iw_cxgbe: c4iw_connect should return a negative errno. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b4dcc0feb41120017381681d612d3cc21beb1d7 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3b4dcc0feb41120017381681d612d3cc21beb1d7 commit 3b4dcc0feb41120017381681d612d3cc21beb1d7 Author: Navdeep Parhar AuthorDate: 2024-08-30 00:43:43 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-30 00:58:36 +0000 cxgbe/iw_cxgbe: c4iw_connect should return a negative errno. Avoid a pointless assignment while here. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/iw_cxgbe/cm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index c3d334aa0f62..d8def446d6f0 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -2655,8 +2655,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep); printk(KERN_ERR MOD "%s - cannot find route.\n", __func__); - err = EHOSTUNREACH; - return err; + return -EHOSTUNREACH; } if (!(if_getcapenable(nh_ifp) & IFCAP_TOE) || From nobody Fri Aug 30 06:29:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7Xy6QbFz5T9Y5; Fri, 30 Aug 2024 06:29: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 4Ww7Xy5jMKz4F4w; Fri, 30 Aug 2024 06:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LmUKg7iog7gIXfGuAQEgL/Da/cvpYn/XxmgFFR3HTM=; b=yAz48Q7Y9gOIx7YWOtwXhxFTfM6blTV9ZV1RyiHRWLGTQoocOT+XCOqJB4T4+2zNxTBD55 K7fAv6wBo+XAHRltgtrSfbiD4xP0PcZ5MxlsG1pUc57AM0JMmTurwYpMbdW7G2bDFdShLH NmCLfhNZpakHJGeCm7DZVJ3mptA1jvkGsrPRfLdZ/LuSw36epgQMca69pRoUDWPe10Ov0g kd83oQ0PWp6KZNlVdVJL34kNAa91MHhtFLdTAJUimPXAAr8P1rNINTvjQjizXNVZavypsf 4jlK/X81qHfO4E5/9LsADRY59SM/9sBzGnRNKXcxtUaWD269ox1HAldU/x0Wmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999378; a=rsa-sha256; cv=none; b=Qa4gbE1sxSaLvsb/RIBSMrTT/67qYQAhhHC2wIIuNAm+YxGgRKMrIkMt3Jdjh9YCmidK+h 9BAuiSDuOtGjVGOOEfcvc8aJUrQGeBXJOHcSYyCs9ZyiXFLMgjVgaf0yxzeR5g0DjIwKtd DN0dAOAVwc5FpU7l4lyqPdfdxMLaABFffp9Tv9Ev+zBZO1FZ0avEzPg7Ugkgqfuo1sdnCb G63TVbJdBdLfDozG2vC046Zvr+tQRYPfbmL3zDYIfI3TBWcaW7x3rqp6FAkfxQE416vEBj XpAy6R2BAI+muVzs/AJ5LeV/+dRRHIzU2LELdX2MJtony8s4Lns5dQ7GLuOaWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LmUKg7iog7gIXfGuAQEgL/Da/cvpYn/XxmgFFR3HTM=; b=mUaXRX16fpfIyZ9NGGW4b1KiGCTdmCW2828aoVWDMzSweRYcpbuDhJEahyqT9jmAZ3EL6J F6FgL0e0MmS0Pjx3cf+HNcGf1Anx/01x2g8HK92DAL8uwGeuXl4PzWM7lGhHX2blQZambO p3R/An2St4ZRgQgshfDcr6pW/AumVb4Zf1x31VjLWJIj+vlcxa5vlHc9Fg1RLHNFvHqmfn CNEKJ9FwCoxl/z7Vj8KOIPiA0zcLaEEq+u49YRLdd/OcIEYjvJNY324W11swtdybDvS23k jeaHWOjYkLybjmIVfW2FOtrBg2HkRRYcDsT6yHyIU2KoE+DZb2833cVwaOxp3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7Xy5JRhzpwZ; Fri, 30 Aug 2024 06:29: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 47U6Tcj0041683; Fri, 30 Aug 2024 06:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6TcZd041680; Fri, 30 Aug 2024 06:29:38 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:29:38 GMT Message-Id: <202408300629.47U6TcZd041680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 118ab70d5789 - stable/14 - tcp: fix list iteration in tcp_lro_flush_active() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 118ab70d578934236251368c894973a4159ac514 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=118ab70d578934236251368c894973a4159ac514 commit 118ab70d578934236251368c894973a4159ac514 Author: Michael Tuexen AuthorDate: 2024-08-20 22:07:37 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:29:03 +0000 tcp: fix list iteration in tcp_lro_flush_active() Use LIST_FOREACH_SAFE(), since the list element is removed from the list in the loop body, zero out and inserted in the free list. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46383 (cherry picked from commit 64443828bbe7c571db8d8731758ec8c4b8364c86) --- sys/netinet/tcp_lro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 921d28f82517..2811cf25a052 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -599,7 +599,7 @@ tcp_lro_rx_done(struct lro_ctrl *lc) static void tcp_lro_flush_active(struct lro_ctrl *lc) { - struct lro_entry *le; + struct lro_entry *le, *le_tmp; /* * Walk through the list of le entries, and @@ -611,7 +611,7 @@ tcp_lro_flush_active(struct lro_ctrl *lc) * is being freed. This is ok it will just get * reallocated again like it was new. */ - LIST_FOREACH(le, &lc->lro_active, next) { + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { if (le->m_head != NULL) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le); From nobody Fri Aug 30 06:30:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7Yj2hKGz5T9cs; Fri, 30 Aug 2024 06:30: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 4Ww7Yj26ypz4FFS; Fri, 30 Aug 2024 06:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8bC6TWBdOA13lnPX+r/4Yq10q9CVFKu4CaBnwn/3FNY=; b=fLocUuB3+44vxzy1wUJ6eMTSsetsLgF46olTmHCHeG/YCws6o65OOVk5NfYAdaA1FT6suf LsW1QY/MJRMTcuvlUI0gjOVN2iZhgLom8IfsGp3GD16v8Vvkae85GHmL2s0ZkDKkgLq9Xi COMlSeBuMY8kFLsNwD7ORGApe73AxFWUgPXTU4JfhdtfGZn+Q7sg0TzPwKJ2m2UPZOJHzV fkBtTCzzJGrocYXcBFslPiTDPryjeS/ccJjrmmQfFTjUpOaMtkKc34J3Zv0V3w6LJ4I8uS +Bb2YS1rWWDa2i0fFn4xseRYv2TrpKRiBSDffvJwzi5GMoCGIT4wJgdDdCMfzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999417; a=rsa-sha256; cv=none; b=GoHigOInrkNfGsMNbOFqvCN9tclirIhMf69KMTrQtEEZcNyqHNCT3yV1y3MASooXTgMET+ ZjZBjB18mTNZMk7Z/zbXYwTu6wfkfNfKI5/s4g1f3invGfkMystBk5Y1DJwvlDJb/VZcWr DXxF/zX9HdqFNfEaEuxo1wGd90agW3q6IZ1b8FOy+7rMjg7MWas+cqz4MWRnBbauWIPjli +zxCXvfKcYgBGK9Bu7sf0hdHTZ/rPHG4am3YLwgFoMOYQzgDItxab7qjLyhQv1DBhfE4oB tZK7cxU0Yx4Qx7F+dN5SCZxNXiUkkA9QRdBriFYTckbLnu/f6qe2FRYUm9d6WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8bC6TWBdOA13lnPX+r/4Yq10q9CVFKu4CaBnwn/3FNY=; b=BeGr++FqK6JMAhAwcXfjroEidaw4sEQq+bUGotBK5SkZmsPwMmhHHvT08UcHt9EdkLK3wR +x6ulPqCtmMHwwYIwKe94LllkXehBnOSnspc+y7besTgnnqE+NCLpZKYgsXvlWpELffLIX agbN4NYV0u6wliYz1ZiXnvurk89NXaCgFuSX9xIz6MR7mscYzQJMygeG2V4aHCrSl7kONT aLg72iDvfOckm13FpUCMdJ2eHlFsoxGoxJy6AcDkgGtmMofqGssuIrSyiwz+ejV6iq2fzb eqefxMu455FylrCBMJU7x88ueBeYUN4SIRXGsUPLdv2pBFYz537axwJX6QzbTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7Yj1kLRzpwc; Fri, 30 Aug 2024 06:30: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 47U6UHu8050118; Fri, 30 Aug 2024 06:30:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6UHEf050113; Fri, 30 Aug 2024 06:30:17 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:30:17 GMT Message-Id: <202408300630.47U6UHEf050113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e0bcb3aa4f07 - stable/14 - tcp: initialize the LRO hash table with correct size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 commit e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:29:50 +0000 tcp: initialize the LRO hash table with correct size There will at most lro_entries entries in the LRO hash table. So no need to take lro_mbufs into account, which only results in the LRO hash table being too large and therefore wasting memory. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 (cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa) --- sys/netinet/tcp_lro.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 2811cf25a052..906e01257a04 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -175,7 +175,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, { struct lro_entry *le; size_t size; - unsigned i, elements; + unsigned i; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -190,11 +190,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, LIST_INIT(&lc->lro_active); /* create hash table to accelerate entry lookup */ - if (lro_entries > lro_mbufs) - elements = lro_entries; - else - elements = lro_mbufs; - lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + lc->lro_hash = phashinit_flags(lro_entries, M_LRO, &lc->lro_hashsz, HASH_NOWAIT); if (lc->lro_hash == NULL) { memset(lc, 0, sizeof(*lc)); From nobody Fri Aug 30 06:31:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7Zv5wYGz5TB5B; Fri, 30 Aug 2024 06:31: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 4Ww7Zv5SqRz4Fg7; Fri, 30 Aug 2024 06:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pgigmzog4p1mrN7H8JAQN2OHGARaOXqPgAj2pDT0zSQ=; b=OkAKJvEwhJUUMUkppjhEU8PVPLc5pc4TfRR9rEGSR7mAEPI088Qepz4m/m/ET9O+FdHmYk pGuejPNxc69Q5HEwMPppgoshJje6EefUrYsHe9zdZIkz+/59xbTZsA+wizPk3xAd/aP9zG rmyD02iue1KDYV6tOToGJQnimuwGybeLEGMuSuw3saZRG2MqiDoriQN3FXhjHu7dNGybvJ V5nE4jXbw59tYnetARK3M/eFV0nmHePnI+w8h32/FpMuonaVfq3SUTh59cmfVUnJLCCN3j SkNV2W9zhhbvUW18YbzDGYvdWWeYDQPwOmxnk5lLRC3xRGH9Ca+WdXypaT/sxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999479; a=rsa-sha256; cv=none; b=Ml2lBHr10LV8hxVXMgZl8C5wHeyynesn9J1nLIOg1yaAqkO+Zr/zLYYQDCh8EGpC0Y94z0 IxYca1pt38OmKPA1pINp8WbcW4pbvDFUv9bBse9Cr9F633mR6p10yYAeIBd2gxvOVrxpIv PsHNqIXOAPEJUoxN1QVsJ/QeYRjrjUx1JirLGyjNGUJsY6o8c22iZODgTW+VhIS0T9wx2l bTeLH587Mizsl/jM7tPeIq/KAIG+rxghEMYMmUozJIsFhHw+JsBr5vFlmpUuNLqhdX5AMO Q7lDTuclplHpPVp8ZBqpCBopAGbN6Fwkazyn7cZQVBrrUhEyvX2cm+PaV4/h5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pgigmzog4p1mrN7H8JAQN2OHGARaOXqPgAj2pDT0zSQ=; b=V+POCERlURibvZBW0ha9Gr5/8cBhilJAscVPe2Cs54Yc6mffg9Nv6voyCXXw8Ty5ruCdS6 F8uI53e7R1aAgthzKdWrJVPOr8m/qXcq+L1+WRuk27EvQjRCbVwLvsL6TRxbHHF+0zdhjT HxfcIgDndoPqL2RdASGZ10Kpv2ALx708h5fX8VZ9FkWjC7zfKcOonGYiqZedPGs6LYfug1 MSl3xr8WCPmhD7loAvMPzGX8DMZ0sUJg1EVE3UTveH0f0rZREWuCcjpcZr10+l3TCg4A0q 3ITAPyi+teI0uEdDN3213HI8N+jrZIHLOvmqIPvnQ1IOxq1ZYFJJ6HRuWHoZ5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7Zv54Hyzr4j; Fri, 30 Aug 2024 06:31: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 47U6VJvp051623; Fri, 30 Aug 2024 06:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6VJir051620; Fri, 30 Aug 2024 06:31:19 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:31:19 GMT Message-Id: <202408300631.47U6VJir051620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6c0fb6c5ac7b - stable/14 - tcp: improve consistency of SYN-cache handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6c0fb6c5ac7b3319ac823ef279b12a21604cf84a Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6c0fb6c5ac7b3319ac823ef279b12a21604cf84a commit 6c0fb6c5ac7b3319ac823ef279b12a21604cf84a Author: Michael Tuexen AuthorDate: 2024-08-22 20:17:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:30:54 +0000 tcp: improve consistency of SYN-cache handling Originally, a SYN-cache entry was always allocated and later freed, when not needed anymore. Then the allocation was avoided, when no SYN-cache entry was needed, and a copy on the stack was used. But the logic regarding freeing was not updated. This patch doesn't re-check conditions (which may have changed) when deciding to insert or free the entry, but uses the result of the earlier check. This simplifies the code and improves also consistency. Reviewed by: glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46410 (cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d) --- sys/netinet/tcp_syncache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 052e257a3cb5..287728fe9162 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1730,9 +1730,7 @@ skip_alloc: * Do a standard 3-way handshake. */ if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { - if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) - syncache_free(sc); - else if (sc != &scs) + if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); From nobody Fri Aug 30 06:31:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7bd4FtYz5T9YQ; Fri, 30 Aug 2024 06:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7bd3nNbz4Fvt; Fri, 30 Aug 2024 06:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np2l5ScjqtrBnBs9CMLPfrisS2zunfdmexIvGczmq14=; b=gHjmm7Im9CS4CDPcc4BgqEnJHFZejS/yuMh04ZG+IhQXfv83zB5vTZcOjhoyoHVfbkHs6n gDYG7FLqk7PoAnE6MChInQN89XgaMyClNyyeRog7L1BD2ipkSw4fLRjlPsfIUs5nz4KFx7 MzZtNHtqE2P/aHSM76oFcgilFizD40Iki5LGFo5DzsQ8Ub7QbFIuTWuxm0NIMsCvxyx7vx NDkTPXj0G7FNyslNJYre1He/k4mN+zuieani95w0a26Gn+7BXyczOnF/Zsnm+7Zg/NOlMi flaoNx440mwpXYgDvQiG08CRd6sqsjd1hzIcN4KInzLfrKHFDrmg05IWpNnpJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999517; a=rsa-sha256; cv=none; b=RHFRtZdPaNQnyFs0HZunrwmCM/+MNBDyW76gyJP7Cb1oaI+k/4eNOYqmcr61L8GEjAgtT3 xEtGhjA2iW8QTvMxIsKIwMEyopMihL5acgMGB8O+hpCoOr5f6CU01ASIsZc39kfiVRWMMn zvan428NFQgVO3deyoJ88qzzwQ6LURnTI4hG6yx1XR7FJze50Bq20/B67ub9z5afWiv+sv M83ZGMuKUXPNzGiWNac0FuqVrg4hEvqf9ckTiNTkdlTy5p79gqnWrxy70yUU84De2Qjj33 eH9fcGLpPN1o5UEmIdK1VWGk+T/81i88OiZJPSlLUYzaMtcS1jFe8aH/0api4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np2l5ScjqtrBnBs9CMLPfrisS2zunfdmexIvGczmq14=; b=Z61kP2iGD73ekPzxYirMDEIPs0eM9xBbKF5t5EnXl3vfQ5bslY0n3g4OZrzuQLISeAiIuh 0AA0exXYudncb/2GfUl66SH+iR5QAY45UUmTxMsK2tDzklPj7sSjiCSeYwiSB8D/gE9dfm OpFifTmDnbyonECLEk7QWg1sUO2qL4e/r02gfFmsi8dWhpLD4dTGvwhQh0AFnbi0mWKXbb klJ7CC/5HwvsoYE/NYfIoXTHtT9npbXV9ROi/qzNXBUhDLLlBhyTw+Qzlk2gHyVL28srBb zFiRgx1zYHLn6y/3VcFMsnflzCkK2lZC5yX4LsnefDCc7IciMLq3Qclky8IylQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7bd3P4dzqSG; Fri, 30 Aug 2024 06:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47U6VvmM051850; Fri, 30 Aug 2024 06:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6VvOJ051847; Fri, 30 Aug 2024 06:31:57 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:31:57 GMT Message-Id: <202408300631.47U6VvOJ051847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: bb31f15d179e - stable/14 - sctp: fix format of sysctl variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb31f15d179e3269bd6d16f77437342bdca37e82 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bb31f15d179e3269bd6d16f77437342bdca37e82 commit bb31f15d179e3269bd6d16f77437342bdca37e82 Author: Michael Tuexen AuthorDate: 2024-08-22 07:07:27 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:31:35 +0000 sctp: fix format of sysctl variables (cherry picked from commit a1d9ce19b13f220c5738e6aa58cf0c3750a05526) --- sys/netinet/sctp_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index a4be3471e2fd..a39429ec046e 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -894,7 +894,7 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) return (error); \ } \ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ - sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + sctp_sysctl_handle_##mib_name, "IU", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ From nobody Fri Aug 30 06:32:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7cR4FQWz5T9qT; Fri, 30 Aug 2024 06:32: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 4Ww7cR3RP5z4GHK; Fri, 30 Aug 2024 06:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zHAYN8Yqjn7Iw2Hy1QYFEOcfVyi6HlwRXLdBMVPDLgk=; b=xg/EO8yHSiJW/gUqFJAmQKWTxUUyaiWhUJFDs1HbsJsF8RPMyCbLL7kiX5cIIHhzPCrntx LdnT8n8Qpn7AlyjZUBnQxETJXgKUhV5uZUuOVWVshg18PQ7hh5/G2UBwgdFU8nQE3ZznYP OPLnkQpB0QHGYqTrDbKDt1Ai+NPGscHGkMu1XpY0yrfuqBWUmfLx7lQ1qEelIC9dwt7Q4s AcGnaaDljJCY98NqFlSfJ9LYTab2xUQR2HXahAOOgXnNC2V3X25ET9jgvHFxbCLQAWIKTN RoyGo8JLOsaglx8r6THuaqgwliUXhWltJnVqtx7uKz/LecF7H/SJ5qCqWBrRdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999559; a=rsa-sha256; cv=none; b=FPFQp1NV0LpfQGoPucz3A2U9hFqN0xNplrILWw7eeOv3PuwaMpg4THHCRnCm3iL2TFsPQc ezk0uNUknYXstjnJn73ABZDsQR6sat9chuwi/CDmp/QRQXVPfSePaQiV6QtVyw5GDjyUz6 sCAe3/hh462PpxqcbEHW2toOPo0dP6rad5aGf9wwmuZSc1zCgYTir6Yyif1Po5uq6Ljlar Hn395Sgw/5TXV4GHeW3R46IzyeACF5WkuuCTnLKrd2iJ1O9NJRZqWbubSyde4vHi8PxtVf oTlZGbfdxFxD67su5PzUDCPmYv/UQuWwftqy7Nfq2AZH1VQS71O52l5Js0/iPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zHAYN8Yqjn7Iw2Hy1QYFEOcfVyi6HlwRXLdBMVPDLgk=; b=ncLsR9wt2KTcE7y3KxMJwa+wLD2PWbNxLCePTW6hz9bGQT2HGV58nGCQA51OeZCnen3whe 2WMjY/fHt06dK0pOUnBY0cu7f6QM396piie90Jut7iwgaYuNbPYvESC3pQAGLoOuwb4vqj WJ3ASpP5qAALAVp8NrsLdudmYNzN67M38FfqZKjxgw0XNN+0CZbGNiSqs2vtZI1RfSYFA0 zxEl7SvL8FNpGJhi3OmgYdeKpFi6aoRT0M1RvbpSUg3E70gi3YsQKvhXVRjRoS5OKglG9k jyLom89ff3vm9vL7sE261epsK2ymSSeT1sQ+wEMi1wnuq3qV80FLUWONZkCFGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7cR3191zrDP; Fri, 30 Aug 2024 06:32: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 47U6WdhS057557; Fri, 30 Aug 2024 06:32:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6Wdi7057554; Fri, 30 Aug 2024 06:32:39 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:32:39 GMT Message-Id: <202408300632.47U6Wdi7057554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2dcd21ddab9a - stable/14 - tcp: fix format of sysctl variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2dcd21ddab9aa72da3bc2de746318f518ff779f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2dcd21ddab9aa72da3bc2de746318f518ff779f8 commit 2dcd21ddab9aa72da3bc2de746318f518ff779f8 Author: Michael Tuexen AuthorDate: 2024-08-22 12:44:47 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:32:11 +0000 tcp: fix format of sysctl variable The format for CTLTYPE_UINT is "IU" instead of "UI" as specified in sysctl.9. Reviewed by: cc, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46408 (cherry picked from commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18) --- sys/netinet/tcp_syncache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 287728fe9162..e24249048fd6 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -215,7 +215,7 @@ sysctl_net_inet_tcp_syncache_rexmtlimit_check(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_syncache.rexmt_limit), 0, - sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", + sysctl_net_inet_tcp_syncache_rexmtlimit_check, "IU", "Limit on SYN/ACK retransmissions"); VNET_DEFINE(int, tcp_sc_rst_sock_fail) = 1; From nobody Fri Aug 30 06:45:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7tk4WmNz5TBTG; Fri, 30 Aug 2024 06:45: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 4Ww7tk3s7Pz4HQj; Fri, 30 Aug 2024 06:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pIDK99A/Kd9SEAAAmd2xrukYMJvFhNzLfaEDpXrq/38=; b=o6T9U7eY9HoGGrRaWFR0G8QhuiEob3NHDMhXDCieOVQQrga446EBaeelA6mvxSVh97d0UZ J+lhI2xsw8kZ5gpUMVV0CaQ/wpUSwAJARmCtS3Z6S9JI+d5TFgMFBBLf9SPd88eqXbXVZe z1xgyZb3CN9zzWOC64cULGhaVFF/r4bnjkookqPrdu0c1TfWzvovB+/8dP5yhW0arEIFjU 8bIk9pjDqXHFH08DbnKgjOmhrA7QhdGcGazOcJFjWqGk+xILaJZzbuog3vJFtRa4ijTF5X Xqh+156Mbb4NsYWkciehySvPeSpGOHriiyXZevsXUwirCwbGSnzwLCzOTWQznQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000302; a=rsa-sha256; cv=none; b=KuIVAAIce9cTx+/iceQ/gz3tWse9aVj6+5YQf+DBmuJ4JTdb/bgixG5mXeoZVrZ9UIVV5b DaCfzSfPQh9x1t398Ei+g0FaMlQ+CuOYaFeyNXddchV/5vh2MmXLQZ3IlkZ5b402lGD66+ 3sFxLElwQHSKYAxfmXZ/VPT463TYDQrSVTKc9w3AUUVvK3s1NzsCcvuxz/Y82ag3ir4iXR y/21cKnlqEHnAqOAiZ39Zqw+f8Y0B5bRuh2V+VUnRo1n2OTz17NAXVwblzwrm9bHn/WiEH P1pHKPWSEb95gOjSYqGmt4jA9eCS45m/0TipOiFgYOdZSDC24iwmbTvA+11cgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pIDK99A/Kd9SEAAAmd2xrukYMJvFhNzLfaEDpXrq/38=; b=aFfBKRPiQBpaieKiAprMaOTz7yC3pM5rbVZteIDaLRNrnbYqneU81etqAUZMIWFf1oTJSl gyMx4duGYpndSMJ/XcBWXxhmfUptFmaElvSHuxYFIB4kRhIwLV8dNuIiL47cPtMKZVaGE0 QEW//YIjk24ENfJu6aSyA+VbdtCvdWUQdt/3yHo62vAgvlSWU7i/VJCpWA5WglTNqxjsck RKzJcqFS15up2oD7VALCJGXjMr5aL5NcJ+nWfwbRVv6G6yPEtVLdP4A77u4xt5SjxraSqi t2eEyO4KLENYsZOmMXVOGKT+W8hJhCc7KbO58IgisvzrtibbzmXpcBfFKVjVew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7tk3L6BzrMt; Fri, 30 Aug 2024 06:45: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 47U6j2c4074707; Fri, 30 Aug 2024 06:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6j2Nb074704; Fri, 30 Aug 2024 06:45:02 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:45:02 GMT Message-Id: <202408300645.47U6j2Nb074704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 5420e4f56389 - stable/13 - tcp: initialize the LRO hash table with correct size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5420e4f56389c841322f1bf4aad1cf288a9a6482 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5420e4f56389c841322f1bf4aad1cf288a9a6482 commit 5420e4f56389c841322f1bf4aad1cf288a9a6482 Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:44:35 +0000 tcp: initialize the LRO hash table with correct size There will at most lro_entries entries in the LRO hash table. So no need to take lro_mbufs into account, which only results in the LRO hash table being too large and therefore wasting memory. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 (cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa) --- sys/netinet/tcp_lro.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 83b730b15558..7f54da48c5f6 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -168,7 +168,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, { struct lro_entry *le; size_t size; - unsigned i, elements; + unsigned i; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -183,11 +183,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, LIST_INIT(&lc->lro_active); /* create hash table to accelerate entry lookup */ - if (lro_entries > lro_mbufs) - elements = lro_entries; - else - elements = lro_mbufs; - lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + lc->lro_hash = phashinit_flags(lro_entries, M_LRO, &lc->lro_hashsz, HASH_NOWAIT); if (lc->lro_hash == NULL) { memset(lc, 0, sizeof(*lc)); From nobody Fri Aug 30 06:46:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7wp61jgz5TBps; Fri, 30 Aug 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7wp5Cgyz4HXs; Fri, 30 Aug 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bSSN6jxfe2hyOxnXa++XWUKpqm+U1br6K6jYhjWsNo=; b=KvMnQPG2shyW02vMa6LAL9HdgqhW3GG+1RfzGQAivOAfn5f5b2u5Ml2DHrYGCthLRyXXhw heTi/ocfcEukH+0MUWR9qFfFs86nZAb8I7wOHt6FuiVUIgCox9q80JphPrVPUAS4VgZAOC /vJAOIgAyfgtf2PbWMF/rY8fJfmcxRF8mJ+Mucw43EpMuN/zRYoQXet4vmyu/gatfM5CBa HbFrvFu0n7/ju98MD9gwzUVyXte7oQRnThhVusKJWE1iExmP//D3naDcoxxhQfCipnmehe 8J+404nIdWxzwAuvZi+HF+W/iezLJE3/JGz+LKeIldCs5/xNtvwbnw0AvUV4og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000410; a=rsa-sha256; cv=none; b=ThhXTWA4zEwTLuiREZ6kTWR8SoYlJnn3rthGhc5a3FVw2nSR1ju9B7HLq/+WcToseGsKOz /Evma0UMtG8qpyy3/Xx+UqK6JTnnqEd8U2yN3j5air7Y3Ky4eNvGNnvX1KK0HSfzsbt0Qo sBg7SwNzK5GQHy0ZzKkeWxBFOPlzNxgbRgdvgva7u7mSOyj1pK7evP5yqV+kj0wEFZMxue Y/ZQdkwhJXNtfz/4qp5o/qEbXJDOyTVqOLnE38PBzJPNgfemBpTW1coyORK2RGigWnv5MM JKAaQCm52SCkyL96nQmsZxZWeBWF7W8qPyKKlf5GxCzTFqm8UWkwlEOjs7SOmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bSSN6jxfe2hyOxnXa++XWUKpqm+U1br6K6jYhjWsNo=; b=ZiekmUQBxNDsW6HOzA9B1P+fPadrvX+fAXfFU2Qnag/9o8LVXkH6Krz7Z7QtxlIloH0xqm Iz08S28nf5MylRFdY3dnGNqLm3r81m0htd3V6hd/9mJw7X5uvxQoqY02eTdMhJEQCNOWZg KQUeIX/Sw/QjESf/PPwJEUvEDflgjIUbWqpAFbl2k3V9gT1Tmb9ebJ3wgTyM070PNiMQKA l2wCB7G07Aw/3vozkwKjk79xIZ0nXdPwdu9mB0nJ1TMowuRqJXwgpflJz44jS1JbfE6BFE wnnUohtvK8d9gOexMiMdLT1RPvUtLfYh4OhSOvfMp+p6KtnGvd6XlnFXQUxRmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7wp4hlHzqSy; Fri, 30 Aug 2024 06:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47U6ko6t075132; Fri, 30 Aug 2024 06:46:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6kog3075129; Fri, 30 Aug 2024 06:46:50 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:46:50 GMT Message-Id: <202408300646.47U6kog3075129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c467031b6143 - stable/13 - tcp: improve consistency of SYN-cache handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c467031b6143cffae3260812eed4951352567297 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c467031b6143cffae3260812eed4951352567297 commit c467031b6143cffae3260812eed4951352567297 Author: Michael Tuexen AuthorDate: 2024-08-22 20:17:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:45:44 +0000 tcp: improve consistency of SYN-cache handling Originally, a SYN-cache entry was always allocated and later freed, when not needed anymore. Then the allocation was avoided, when no SYN-cache entry was needed, and a copy on the stack was used. But the logic regarding freeing was not updated. This patch doesn't re-check conditions (which may have changed) when deciding to insert or free the entry, but uses the result of the earlier check. This simplifies the code and improves also consistency. Reviewed by: glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46410 (cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d) --- sys/netinet/tcp_syncache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index ea5ee033f6e0..54f7f4784490 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1761,9 +1761,7 @@ skip_alloc: * Do a standard 3-way handshake. */ if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { - if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) - syncache_free(sc); - else if (sc != &scs) + if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); From nobody Fri Aug 30 06:46:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7wq6Lxdz5TBVL; Fri, 30 Aug 2024 06:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7wq5nySz4HVW; Fri, 30 Aug 2024 06:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QfQcxk4ZeIMTdwlFFxqYfg2rPT7bacm+bfT71Xp62T0=; b=MIWIgrJf0lsKX4ovsUrXgPyilclo8/lS6ENSBaSxkJ5YOZhAstTFv59S2Up/+s0WTXBQt2 UzC1zTTu7D4ETKfLpbGzlf/kpPyHgyJKsAVhqSlIgLQvTvNULpGpspXDW1rGlok7PL/J7I dOOyn2FLt/HpORJGY5aVg4tLiVm/cRDTZMUyvnI5/bz9hV45QS+p5gt7hvSYHHpkjoklsB 8DYlehLMBoIQI1h7tTZPW8gGqr4Nq8muW37tDAizLilJXDm/if2Zyv4pG33Iy65RfSs/48 wiiFdoA+zuYU43lG5LAojwm0R5ELT+Lrs3RA5XJ7eatlgYIv/aIGEIhuXx8/1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000411; a=rsa-sha256; cv=none; b=A+F1nHxuA4//lk7gkfRxLtGT9aHkZ/YNpXb9Tm2Dyl9Q+9yQUoP6RXglOAFrGjmMG06xOP 6diLeYJ297KHY7UZbS5IVSa9gt4SxmDwBefSE5wtVcajd/4qjTT7Lp3HyMGO5kPLATkovy 3e4Tli1T5kDH16rbpZ2SPjRZFsXGAi05PCH5hKWs1uWR9bK9TxViAI7/JEDZaQbg8j+GXH Z9zzxn0oWmO0NguOq+kEh9Q5J4sDWMKlcQx9Kc5Ca4yU7xR7N2X51D1lwwzoTb96NDgm+Q Ob1cMBRNcmKTYx0Dde5l7T4n8yrDc0VpOBQUpcYd6M7R/rNmUPkpHapAZ1EafQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QfQcxk4ZeIMTdwlFFxqYfg2rPT7bacm+bfT71Xp62T0=; b=uopC/kIMdOR+GdGKYSEGaA2Zk4XMXb0Opm5COTjC+CkYPifdpX0WzaqXdhhR6AvS4Egjbh 5C4BWdDQDU7LujmfKsILslY1B/KIcz9crz7nj1qRbxjUmROWJwCAvI0BmOdgORQH+LtZZ2 5sfjBiXHUSRxgxFY1JXBvb4neWddsD5NgCv2VoMFmtTHiwZ1JlDnKzp1ucd+B+PqtWTyFP 42yIygku4mYL/owZ3wwD4ffQlcN+XDMuILpwH+byQMOlHzELTHAsGnycW6ZEsXPNdBwIt5 OkdWEKZXlXkM/r84AXXyF9Ue1DTr4m3QwXJl8Fj1/mUuBICPyBpml4GaknQORA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7wq5PS8zr5Q; Fri, 30 Aug 2024 06:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47U6kpmR075178; Fri, 30 Aug 2024 06:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6kpEE075175; Fri, 30 Aug 2024 06:46:51 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:46:51 GMT Message-Id: <202408300646.47U6kpEE075175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0e6dbb673276 - stable/13 - sctp: fix format of sysctl variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e6dbb673276f2a08c4216ca92da3577bc0a1d46 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0e6dbb673276f2a08c4216ca92da3577bc0a1d46 commit 0e6dbb673276f2a08c4216ca92da3577bc0a1d46 Author: Michael Tuexen AuthorDate: 2024-08-22 07:07:27 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:46:24 +0000 sctp: fix format of sysctl variables (cherry picked from commit a1d9ce19b13f220c5738e6aa58cf0c3750a05526) --- sys/netinet/sctp_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 60c4a506ddae..326e981dde05 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -890,7 +890,7 @@ sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) return (error); \ } \ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mib_name, flags, NULL, 0, \ - sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC) + sctp_sysctl_handle_##mib_name, "IU", prefix##_DESC) #define SCTP_UINT_SYSCTL_RDTUN(mib_name, var_name, prefix) \ SYSCTL_UINT(_net_inet_sctp, OID_AUTO, mib_name, \ From nobody Fri Aug 30 06:47:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww7xc3Mqdz5TBRj; Fri, 30 Aug 2024 06:47: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 4Ww7xc2tQsz4HvH; Fri, 30 Aug 2024 06:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyncIpGZgDEiDOEhhVbN+UVIt3Y712DK0L7ZKXuUUag=; b=nnwj0uCZg0Bkkr5/4NmRSUMmjBHPVjA1vAmoUbcSV2xc6vLOMuIvt5+fCa1iTV/Y/71azU GFe10N80EHkSBKkGly0/X9X1Hlc0tvMqr/rTOupBcVMuUOuruOZRPAdKC1V+vt/r/D7v+C c14f0STlJ0yZw3KTCaeaFZoLv8MBvlLIm42sLhipya2clIxjdkd+grQRMECYLEdgs4XB0s apF0cT2VhchJ4A6WtP0K+CiXDJYrCtTJRNv3d1u1dPNrNwtPrHi+3f09HcGPc1+X02liSl vtec+6sDOxeT9Ol74VnC8yHObWjddy1s4J46UCtFUELQrdv3wbLZ8AzlAQL52w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000452; a=rsa-sha256; cv=none; b=ll9AdnHTVuMQyij1Uc0R7RP/RA8LY7MYiynnTuiOKmX2VS0XcMKGDYEro+h7/TKzrdWOaM Cefp/SnCKBkF2J796EkOytEc/MLgQF4kKd0hFeg68Jyq/lsuAO4wBdUHvdBR9xHvPVpbh6 ixpMuyMqXjJdQqeNDtJc2xzvEAc2iNPHb65XPJGOHMlvME7m5XUWptXkqsMibAhGo9oujl fVRJP7JOBmhZMkI+T+dtREKGhp06OFlyn7tV9dvzl6K+VOctZbwi5rgb/BthPJWkWtqvi1 RFBFv/0iLHsGlT2LgsQBOSXFey4IyY/xdvZ5aP78Nt07RuW4wdLv429NTJPqjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jyncIpGZgDEiDOEhhVbN+UVIt3Y712DK0L7ZKXuUUag=; b=FqzGx+7yWKg9l4iV2flzsAXUVZ2LOjOJ5L1deOA2TxsObxFY4nE7SWbLU1IUaxkrBe+BqH IAYvaRPsaPD3SVUK9CGGSSkqWLSVa0YZTubXo/Fo9gx2NkV0gxfSHcvwSdGFYYJzbA2QTz Upi2gjjbEWiyukHHgjxoqC40pn9wPwrsEFvPx7aDv+rY9mTY175aRwNduJbnUD9L9RqXmz gzQJbZN1SyA3hvohkat51wgJf7HyTVSmwSmQOjn6iSa7Vns6EQVzuGk3ovvnKc7BTBqAED /wOCqWS8y8SN4aBmVa8MkVRkcXq/YPC9m2qOqJir2fHxgW8tC6Y/Tzi1g+nbMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww7xc2Gk5zqtx; Fri, 30 Aug 2024 06:47: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 47U6lWWV075388; Fri, 30 Aug 2024 06:47:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6lWAV075385; Fri, 30 Aug 2024 06:47:32 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:47:32 GMT Message-Id: <202408300647.47U6lWAV075385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a1b4e5731736 - stable/13 - tcp: fix format of sysctl variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a1b4e5731736425c715a51c91c6f9e26e757aaae Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a1b4e5731736425c715a51c91c6f9e26e757aaae commit a1b4e5731736425c715a51c91c6f9e26e757aaae Author: Michael Tuexen AuthorDate: 2024-08-22 12:44:47 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:47:03 +0000 tcp: fix format of sysctl variable The format for CTLTYPE_UINT is "IU" instead of "UI" as specified in sysctl.9. Reviewed by: cc, zlei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46408 (cherry picked from commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18) --- sys/netinet/tcp_syncache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 54f7f4784490..86df6c747ea4 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -211,7 +211,7 @@ sysctl_net_inet_tcp_syncache_rexmtlimit_check(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_syncache.rexmt_limit), 0, - sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", + sysctl_net_inet_tcp_syncache_rexmtlimit_check, "IU", "Limit on SYN/ACK retransmissions"); VNET_DEFINE(int, tcp_sc_rst_sock_fail) = 1; From nobody Fri Aug 30 07:04:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww8KR128Wz5TD6X; Fri, 30 Aug 2024 07:04:43 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 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 (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww8KP4gggz4Jqb; Fri, 30 Aug 2024 07:04:41 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=db81LrCG; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 94.130.200.20 as permitted sender) smtp.mailfrom=herbert@gojira.at Date: Fri, 30 Aug 2024 09:04:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1725001473; bh=9hmkor3SXzUp8azu8bb5G63YrGgIsEvJYO56LTg+W84=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=db81LrCGtHPUKFwBQmD6xgJ0gya9xl9lLppw1Hf/gNQJDDnl/4MO8XobphICc4gZV 8E5UM6nC9yMpD10eLWqta6pfBAg1nHHa0+pq+WGCCYDezot0PkDQBU3VWWIubnsYK7 2XF6yDFtUZ2UPQmXArrK7qxjQVhq9JS7X0/SVWWm3ipCXUBK+x8cZuyoLqkIrAa2hx zG39DWqUbVWGpcqAnTSGlSaMYi4uQCqmn+OfX737Q9h8gPjhkWvK3jup8pMJBOsxTK uPHN9GoRZzkvGgMgZEApvJ2xmefR9auzhuxa8LYULGfPfOQWLXuZnBvHW1l8mnYr+E 2zQR+/6cogE5g== Message-ID: <87zfoujxuj.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: "Sean C. Farley" Cc: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying In-Reply-To: <87cylubd5v.wl-herbert@gojira.at> References: <202408011538.471FcJDS026885@gitrepo.freebsd.org> <784ce21d-a604-bb91-c52e-29c78e2bb6e4@FreeBSD.org> <87cylubd5v.wl-herbert@gojira.at> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip4:94.130.200.20]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DMARC_NA(0.00)[gojira.at]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-branches@FreeBSD.org]; DKIM_TRACE(0.00)[gojira.at:+] X-Rspamd-Queue-Id: 4Ww8KP4gggz4Jqb On Tue, 27 Aug 2024 10:09:00 +0200, "Herbert J. Skuhra" wrote: > > On Thu, 08 Aug 2024 06:35:38 +0200, "Sean C. Farley" wrote: > > > > On Thu, 1 Aug 2024, Ed Maste wrote: > > > > > The branch stable/14 has been updated by emaste: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > > > > commit fc43a1b6842afa806dfd7ba48de5bece63d04456 > > > Author: Ed Maste > > > AuthorDate: 2022-10-14 16:44:35 +0000 > > > Commit: Ed Maste > > > CommitDate: 2024-08-01 15:11:45 +0000 > > > > > > tzsetup: symlink /etc/localtime instead of copying > > > > > > Using a symlink means that new timezone data (installed by an errata > > > update, say) will be usable without having to be copied again. > > > > > > Reviewed by: bapt, kevans, philip > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D37005 > > > > > > (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353) > > > > I ran across an issue with this when using "etcupdate -D" to update a > > jail from the host. "tzsetup -r -C /tmp/chroot", as called by > > etcupdate, prepends the path of the chroot to the link which breaks > > things inside the jail. > > I have this issue whenerver I update jails with 'make installworld > DESTDIR=$X'. Will this be fixed or reverted (at least) in stable/14? > Or works as expected? Maybe: diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 617de4efb765..38d7ccf5e00c 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -884,7 +884,7 @@ main(int argc, char **argv) } else { sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB); sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166); - sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO); + sprintf(path_zoneinfo, "%s", _PATH_ZONEINFO); sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME); sprintf(path_db, "%s/%s", chrootenv, _PATH_DB); sprintf(path_wall_cmos_clock, "%s/%s", chrootenv, -- Herbert From nobody Fri Aug 30 07:06:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww8M75JDgz5TDPr; Fri, 30 Aug 2024 07:06: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 4Ww8M74lSZz4KHN; Fri, 30 Aug 2024 07:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725001571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FGeU+3Mmf5iKdWA8aM80PKrc424wI97/GMr8TqLJN7Y=; b=M2JQoVW/fofcf6sN6tUbfy4pzVNkEttSIEBXDeKiVryfbZPY8OKjmMW1ojRocXtNsg9zCt 6LRN1RV6sH8pzoWRYJN5TeIYOceyqf0hvnOqaTGKd69p7JJt+g1qWC5UZVTKEfCoNmiZIy uK9fW/dMGdPgdA+KUtRLfpUQvgn4r1HeI0LuUYivLFRHgjEdEHomQgcExb/ejwvfZ8nN3o TJCYefWSoOUoet9aJUlFTKQqQZlScJnjMIfXSE5ESOYVXFP+lm4e/8G0pR2mR8J48L4vDY W1EOaF1Xo/IzHt6JQiSLkU4ofv3kgpDGcmiWttjxnT0Fl8OjUFtJjTnlE4e7SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725001571; a=rsa-sha256; cv=none; b=sQ4WJAHZEU8DLprVhJn/K8IObHHsMpOUGa7CC7PrW7CMQOdfeCtOd8IYImdtKL7vvwmy5d jirYrSzW2Fdo7T76iIkD+aTrM4IntJTrfLlJSCoRTPu9TdCruZ1YcbyVCNO4LFX/rbGEKX 4Hltv7yF4Ku8AIZvtmbgXq3xSR/F93DO/uMKgnhqSYU9OKoBg6356JOGmVpczhHcLAUu91 ilxI77sqG0w6tyv/jAgwezW6u10bE0r+QX+sPFWDhRoC/3XxTYaURS03ipr7jxX3jqmBZD 2OEhFFc56FFDDW2cOz279lOTJ5EDzZz21lf18h3GddE0XECXXEZM+HC8TbVOQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725001571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FGeU+3Mmf5iKdWA8aM80PKrc424wI97/GMr8TqLJN7Y=; b=bOSJP4rP4rxn3oG2XQnKa8Av+IZbQ7SgLYVoFbzO6FoNSux0qvfiseoWp2zpekk0HlkUWq ls+nnmdGQeA8Lr4PZeKnBYxqq5L9v5UdtuziSTcfEbRGwm4WnVjBoO7WqzbgkF//BT/yho IYiuxSYyWdpdbpl2xZPuKnZW07eIvyHDx7g+kPlW+IRLbe+0eMWGa+drezsVUpUdwOGAxf ArJ+ZKLBXKCc3tvJDSGwHzlEWNf3ngY3PZw3cXoluh2wVC6wCHP3rmMUfpyzb04X3AJsiC OaxR9yqk8IiorIlHgynGYfQ5+YdmSZoLqUtBZxDQ1GftgxGJtRVCgCvWSVQMxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww8M74H3gzrPH; Fri, 30 Aug 2024 07:06: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 47U76BVG010906; Fri, 30 Aug 2024 07:06:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U76BDc010903; Fri, 30 Aug 2024 07:06:11 GMT (envelope-from git) Date: Fri, 30 Aug 2024 07:06:11 GMT Message-Id: <202408300706.47U76BDc010903@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: 4b6e76eff8b6 - main - u3g: add SIERRA AC340U List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 4b6e76eff8b63d691c05772520849b6c94d535e8 Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=4b6e76eff8b63d691c05772520849b6c94d535e8 commit 4b6e76eff8b63d691c05772520849b6c94d535e8 Author: Franco Fichtner AuthorDate: 2024-08-23 11:26:38 +0000 Commit: Xin LI CommitDate: 2024-08-30 07:05:30 +0000 u3g: add SIERRA AC340U Pull request: https://github.com/freebsd/freebsd-src/pull/1397 MFC after: 3 days --- sys/dev/usb/serial/u3g.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 88f94ddaecc6..28a403a846bd 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -568,6 +568,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(SIERRA, MC5728, 0), U3G_DEV(SIERRA, MC7354, 0), U3G_DEV(SIERRA, MC7355, 0), + U3G_DEV(SIERRA, AC340U, 0), U3G_DEV(SIERRA, MC7430, 0), U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index e02289521095..27126b52e243 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4357,6 +4357,7 @@ product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 product SIERRA MC7354 0x68C0 MC7354 product SIERRA MC7355 0x9041 MC7355 +product SIERRA AC340U 0x9051 Sierra Wireless AirCard 340U product SIERRA MC7430 0x9071 Sierra Wireless MC7430 Qualcomm Snapdragon X7 LTE-A product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer From nobody Fri Aug 30 07:30:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww8vT5mwDz5TG2s; Fri, 30 Aug 2024 07:30:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww8vT5Hj5z4Lwr; Fri, 30 Aug 2024 07:30:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725003045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/q1dC5AweX4CWbp5MYOKaG/GQ28fSh4/nnknoKHVFzg=; b=IWBSqdY8hibYe94Jm7Nw5IW7UtPosP5tND06+fSzP0pi0+mOKr5Xd0cJOJiHCY3nCnOWYd I9Ls3k5yERgXHmL6O0+iMouApHzGYSa4qnAaKnlEwFZ0XUGU+Mvo9yKstndgobuQdfWjIL +g8s1zvKcWAun2wgX3DlhsiFRWdXT0bYxjvXo3v20LkZ86filUL/fAnorgaOEUCYp/FRtr 8u1qcFWWfDCVA9ps6z3JWSUXzu38b2sf2VQj0cJCPxmIEUf/5fpZrhfIF/sbAUVOV4UFp9 oHV+ClE/nlXDYEvJrNkQwih3WwpQQTOWdGzZwGxbw5HFeCz2rZACB0Ha3JpLUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725003045; a=rsa-sha256; cv=none; b=fBpALQJEz/MksIQsJ5g5iIadkDINPGH00uMiTN9iPNfZVkCuGMNprp85Xy8OxCLNr7BRWA 4+nQMlXRuQcOVuAMatnlXhX+WMAnc+PORks3ZpM9ioRJY7YNrK/CvMJM6RxNRf5WqwFTb9 yIQkPc/JjNRkrQrh0K8bsznQqKtkVFc6DPI9O5YUW0xBl2/6Ny4nKv0n+Or89/mpmLU5/k pk67lVC/Tu0SyQnFuF9S/olEXT3BflbeBqVNhtCpwFaeVRP/BM7LwXmXtP0/zBuGTpe9H/ VMgR6fXY0n9rSE2SteSWRSFccrjbwKiJ0FjWyDu5JquQXNqfx/COpRk6ecg+pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725003045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/q1dC5AweX4CWbp5MYOKaG/GQ28fSh4/nnknoKHVFzg=; b=BP+W0TR5i7P2jHWPXz4SCUizugV8YCUIRRpgERUxa5RhdJoH8rYZLuR+TqRsOWjHM0ab9C ORV3LUvzPWECvcPxFI3+nkpcKIYGJsB2uPQc2FN+r7Yk90Kv9Q+qOKPn8DKu2fptitZdz/ vv0iFjSeJxaRK5U9KUqPmSb/hr0px81FYsgCbCn8sYUvf0m2sfUzmBsdqr4y2kGKIXwErv Vuv6J0/ZfXBftQEr59d7do1CSZ8AWHaeCELW4jBpCa1M2Q6TI52+ihO/bLVTME6t47RGOd j0S+Be0kb9dwK9o+CdNFwPDSuHhgyBCmqHVyc+DRnapI4Djb1NSZw7kGq8NYEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww8vT4rTbzrbw; Fri, 30 Aug 2024 07:30:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47U7UjT9054271; Fri, 30 Aug 2024 07:30:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U7UjtS054268; Fri, 30 Aug 2024 07:30:45 GMT (envelope-from git) Date: Fri, 30 Aug 2024 07:30:45 GMT Message-Id: <202408300730.47U7UjtS054268@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: b2044c455744 - main - tcp rack, bbr: improve handling of soft errors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2044c4557443bbce974101f04e2b465d1bbe769 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b2044c4557443bbce974101f04e2b465d1bbe769 commit b2044c4557443bbce974101f04e2b465d1bbe769 Author: Michael Tuexen AuthorDate: 2024-08-30 07:26:41 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 07:26:41 +0000 tcp rack, bbr: improve handling of soft errors Do not report an error, if it is stored as a soft error. This avoids, for example, the dropping of TCP connections using an interface, while enabling or disabling LRO on that interface. Reviewed by: cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46427 --- sys/netinet/tcp_stacks/bbr.c | 1 + sys/netinet/tcp_stacks/rack.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index cf64451f0c87..3f8c749583b4 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -13867,6 +13867,7 @@ nomore: case ENETUNREACH: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; + error = 0; } /* FALLTHROUGH */ default: diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index da28fd25d195..e77604820b63 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -22450,6 +22450,7 @@ nomore: case ENETDOWN: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; + error = 0; } /* FALLTHROUGH */ default: From nobody Fri Aug 30 07:37:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww92z3q08z5TGnb; Fri, 30 Aug 2024 07:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww92z1Rj7z4N8d; Fri, 30 Aug 2024 07:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725003435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HVPeKlPuOYUw0ebY0xtpWevjzBmYBAoXFPsQp0udOyU=; b=qf7jPCbCr/lufzpE4LFZjYzWOluZxe3mhMde3BelOb4HENblM0QRqt0gvq6oMunl1A5EAZ 2XGWnAifQCspzFxnfRj7tLhstQqNqISifOm8d2YJ6yEzBNhu/WvTcz1x1VJlPxlEWGsTz9 mFy9t2cUeazUsHGVqlXHaU7P9XUd66M7WgjVYFX1FlpZEQWdZgOsnKhKrDo32dSbRQfpKP 0n0CODsPJ3/bgGGCgROY0lh6rRl9syxlRD7iuBMGT2/pGJZQKbrn5Ikffam2FnfueJaPMl g+vU8IoQjTYfLc+MBv72a95J5xT0pNYzCEFmd23vLM60RhVlx1nA/RPYR2LoBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725003435; a=rsa-sha256; cv=none; b=QrX/oZ2GowejYxYoVjPEbKDiZdIR6AZTysLMmo6j/cQ/ao/ZtLjOsPCoU4pXL3AMgyiq0q kqhXQZhaCI08GPLKXV/GFv6/EHTddHAQ9MiKjs8geIhJykQem2CH839yooVJNxWoK2TflL mOHqgoZSawV0x9BtK0nwr1G26GhyDme8eB71MizwbZzYdkpAgqCkViZmqAeGgl2l6HUXNe Wmui465pRACtzEwAmvPhh5tEN9v+yWY5VCCkbwdL6jLMmIesF4GYE+z4rStCEznqN9TA0W KJZLRJw7VVTqhLucC+1p5QJ7F974ZpMJBZndPd9hr2ZrAz2brep8LWJWm19Ivg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725003435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HVPeKlPuOYUw0ebY0xtpWevjzBmYBAoXFPsQp0udOyU=; b=DeFqjf4jNy7ZCkzN2P1Tn9LLAyiHTKNJtE9gGNMMF5UrNMh3gZKtibE2+KMuldAaN0FiRc w6BHXGrbBGiqDwiU5e+zNif+4jHYi0QiAU5dddQ+LiYGCFZteRCDS/iPPhZz9x3otLvnhB w4G3VvBPoOYE7bd/aCHctlSzvhrmNHP03MbvT/QbkgONVGvvdlDlwq5smsbzGwhR+0WAEK RhhGagAHSycedYK4K+T+1CttBg6vurpugoB/1eQNHITN6/5CQBrqT5mmHsv8Dx4FLDAyy7 YxjExEFlQZa4ohpFeYCJsZt2g7S7uuI+FyGn62hPvZlIg06kdA1JRAX8r9B7cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww92z13JJzs88; Fri, 30 Aug 2024 07:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47U7bF2b061879; Fri, 30 Aug 2024 07:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U7bFBr061875; Fri, 30 Aug 2024 07:37:15 GMT (envelope-from git) Date: Fri, 30 Aug 2024 07:37:15 GMT Message-Id: <202408300737.47U7bFBr061875@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: 6e25bccb989c - main - tcpsso: remove support for some IPPROTO_TCP-level socket option names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e25bccb989c3fdea550833484f262d47910a249 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6e25bccb989c3fdea550833484f262d47910a249 commit 6e25bccb989c3fdea550833484f262d47910a249 Author: Michael Tuexen AuthorDate: 2024-08-30 07:32:50 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 07:32:50 +0000 tcpsso: remove support for some IPPROTO_TCP-level socket option names Remove support for IPPROTO_TCP-level socket option names, because these names will be removed from the source tree soon. The corresponding socket options are not implemented by the TCP stack at all. This change was suggested by Peter Lei. Reviewed by: cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46437 --- usr.sbin/tcpsso/tcpsso.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/usr.sbin/tcpsso/tcpsso.c b/usr.sbin/tcpsso/tcpsso.c index 7d34f5559d2d..95773fe5a4d7 100644 --- a/usr.sbin/tcpsso/tcpsso.c +++ b/usr.sbin/tcpsso/tcpsso.c @@ -207,7 +207,6 @@ static struct so_name so_names[] = { tcp_entry(TCP_PACING_RATE_CAP), /* uint64_t */ #endif tcp_entry(TCP_HDWR_UP_ONLY), /* int */ - tcp_entry(TCP_FAST_RSM_HACK), /* int */ tcp_entry(TCP_DELACK), /* int */ tcp_entry(TCP_REC_ABC_VAL), /* int */ tcp_entry(TCP_USE_CMP_ACKS), /* int */ @@ -215,7 +214,6 @@ static struct so_name so_names[] = { tcp_entry(TCP_SHARED_CWND_ENABLE), /* int */ tcp_entry(TCP_DATA_AFTER_CLOSE), /* int */ tcp_entry(TCP_DEFER_OPTIONS), /* int */ - tcp_entry(TCP_MAXPEAKRATE), /* int */ tcp_entry(TCP_TIMELY_DYN_ADJ), /* int */ tcp_entry(TCP_RACK_TLP_REDUCE), /* int */ tcp_entry(TCP_RACK_PACE_ALWAYS), /* int */ @@ -256,10 +254,8 @@ static struct so_name so_names[] = { tcp_entry(TCP_BBR_IWINTSO), /* int */ tcp_entry(TCP_BBR_ALGORITHM), /* int */ tcp_entry(TCP_BBR_TSLIMITS), /* int */ - tcp_entry(TCP_BBR_RECFORCE), /* int */ tcp_entry(TCP_BBR_STARTUP_PG), /* int */ tcp_entry(TCP_BBR_DRAIN_PG), /* int */ - tcp_entry(TCP_BBR_RWND_IS_APP), /* int */ tcp_entry(TCP_BBR_PROBE_RTT_INT), /* int */ tcp_entry(TCP_BBR_PROBE_RTT_GAIN), /* int */ tcp_entry(TCP_BBR_PROBE_RTT_LEN), /* int */ From nobody Fri Aug 30 08:05:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ww9gh0CLRz5TJcr; Fri, 30 Aug 2024 08:05: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 4Ww9gg6Yvwz4Ppk; Fri, 30 Aug 2024 08:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725005135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mTiUuKFw+/EZPwIXg2/xgpzZrkyeUiXj9GM+DbzCfOc=; b=FtI+w38CByN4IgWqdWjGS81TgPPUGdQMXF3xZDzbDc2YXo+jgyZRvU+cElrmu4sMFFCSO8 7ipBBtQfY1YonNUatDJKGgmesJu0tJXIE2dirQZ/a5XiOOVVeFzg/uoTbsNfRzcCmuS0RF BgI/7DJ/wync7YCReNIYuymp8kCuQVgdSNmdNla8IaUyAb59n20bcKYWByuCWkClqIlLCw WSawOUIHPhH6+FQVu8wiLnbs46Xb5pc8qGv6e7cU4dzRaJe/CdRcK61Z9hJus9P82qWLMX beaYEXBxV/ZJVA/cCwtCwkJGVUfD18Z0QB03zP+ck0MLgL1LFhyRFEXjmXeuHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725005135; a=rsa-sha256; cv=none; b=xdjZBM56dzFo3Kk3cmmRynOm03Pscjub0+7vfW/TRUH9XYQU+PBMBryRyVAnBn/teI487q NjeNd/Y3+mm84t6wSWwqkTfO4f46cW05g1qH2hH45YmrRPTJ5fZOadC0DZoBPaQAgQfbR8 5Vr/gs25e+6qIeKyljJK/rFTUJgV0JLmjtzxfRjD+DDldbVEwvBqIt+c18A5HwBTcnPop5 uybXCiguPqraYpdCnxZaocRFS0a867P+OioLdixJm8ArqtFyr85oUh2qnCHa9IF4K0rDPY pubSedY8855QrMo7ZetnEJCj9eOl2bADMXcG1TPxrtqm1caQAP20n76PrHdG5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725005135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mTiUuKFw+/EZPwIXg2/xgpzZrkyeUiXj9GM+DbzCfOc=; b=dETm/N+sdhSTVDybLwilcQEJHRyJQwhjpSGj/ig85o9whAzb7F40/O8NstLcyklxUEEt3x tCZOWt0QCKVDvgMUd4m118pWhm5WqUXNJsOEKE9m8ctxkaywh/uFrFmlWIXSWQaS9RRJJV wrM90HpbOaIxYLL3xZ2z6gpo8tmkPjXrFOH8sh5mUEc2SFjCGgc5Mb2qeyW8wMtxvxynIO RRlrkbal9GcpNzEX4lrikZaID/lSWDnQhyoPxAwHZ5H2eE4UNrVZ/hD6sUiHIjGkE8CJ/t i3yNZMkF+oTZar+64F5zTAa8Ic5yQvQE+X4qxhfQb3ZnuindUaT8XhLG40TJEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ww9gg69Cqzsqx; Fri, 30 Aug 2024 08:05: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 47U85ZMt012880; Fri, 30 Aug 2024 08:05:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U85Ziq012877; Fri, 30 Aug 2024 08:05:35 GMT (envelope-from git) Date: Fri, 30 Aug 2024 08:05:35 GMT Message-Id: <202408300805.47U85Ziq012877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: f6fd5af80a37 - main - stress2: Do not wait forever for swap usage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6fd5af80a37ef0560959bd55c2c86d17ee2033f Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=f6fd5af80a37ef0560959bd55c2c86d17ee2033f commit f6fd5af80a37ef0560959bd55c2c86d17ee2033f Author: Peter Holm AuthorDate: 2024-08-30 08:04:46 +0000 Commit: Peter Holm CommitDate: 2024-08-30 08:04:46 +0000 stress2: Do not wait forever for swap usage --- tools/test/stress2/misc/mmap40.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/test/stress2/misc/mmap40.sh b/tools/test/stress2/misc/mmap40.sh index 7f4d07885e05..2314596e2f5d 100755 --- a/tools/test/stress2/misc/mmap40.sh +++ b/tools/test/stress2/misc/mmap40.sh @@ -53,13 +53,14 @@ mount /dev/md$mdstart $mntpoint set +e u1=`swapinfo | tail -1 | awk '{print $3}'` -(nice $odir/../testcases/swap/swap -t 10m -i 30 -h -l 100) & -while [ $((`swapinfo | tail -1 | awk '{print $3}'` - $u1)) -le 100 ]; do +(nice $odir/../testcases/swap/swap -t 10m -i 30 -h -l 100) > /dev/null & +for i in `jot 120`; do + u2=`swapinfo | tail -1 | awk '{print $3}'` + [ $u2 -lt $u1 ] && u1=$u2 + [ $((u2 - $u1)) -gt 100 ] && break sleep 1 done - -$dir/mmap40 -s=0 +/usr/bin/timeout 10m $dir/mmap40; s=$? while pkill swap; do :; done wait [ -f mmap40.core -a $s -eq 0 ] && From nobody Fri Aug 30 08:55:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwBp35tSzz52QCb for ; Fri, 30 Aug 2024 08:56:11 +0000 (UTC) (envelope-from bT.q3cjs3rfm13v9b3=5ujqx5w4kbmj=bljtsjbup8kux1@em790814.fubar.geek.nz) Received: from e2i270.smtp2go.com (e2i270.smtp2go.com [103.2.141.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WwBp341RVz4VCc for ; Fri, 30 Aug 2024 08:56:10 +0000 (UTC) (envelope-from bT.q3cjs3rfm13v9b3=5ujqx5w4kbmj=bljtsjbup8kux1@em790814.fubar.geek.nz) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=a1-4; h=X-Smtpcorp-Track:Feedback-ID:To:Message-Id:Date: From:Subject:Reply-To:Sender:List-Unsubscribe:List-Unsubscribe-Post; bh=XADESgTWy5H3SSRm8j8xOAXrrAn/50YBQg+LJKu/dJE=; b=xPhUs5zMJ+hKCx66JfHfUHP1o2 NyfAE6yYdAPEJuPao0kxii5c+Vp+sMC0v6QzcHeikCm7iHafU7Pi/1/IVauLXMhN9E+2DN7FZfkyN Z378+ZtcRGBkquis0G291B7zgBWWFJ4r/dQ/s3RsEINJKruJ0Q0DqwjWDoVFLtSaGygXIXQqdJtQG fu1hMQhELc/SyAnj476di3NBAS8WEjPm/OZAjA/rNN6swiJtNH2bu570bS7ZXB7xO8eqG76gCcyBD h7sxoAVixQvbJfhizZ/FamiQuBCBonHkX9sF0KagX1GfKRD6evv37alC39zce6yg7ooglYQWHz460 btFHQnMg==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; i=@fubar.geek.nz; q=dns/txt; s=s790814; t=1725008170; h=from : subject : to : message-id : date; bh=XADESgTWy5H3SSRm8j8xOAXrrAn/50YBQg+LJKu/dJE=; b=nHUq0/BSCWHZ9WUNzPVHeDBD9xZz240UIFNk+TEzwIk8aFbfzDn2NWxJmbKqOEp6JLFdy hAITJW/mKi/mZf2cEgjyTOE6aIrDZM6NK6BNcNm1FYwJvwscyi++YjHBuJXdD9uhvEGXRGM hDv+CH19KQ857BPKQPz5ssnFcfYRxxzWPAXHduT0unS3MTuh0z8u/dzMyshjZrLXel42tE3 2kW0sIRyilVKzV5djx5jNecz+JVM9HDUJw0kfg+CX7PvSXxoW0yuXHH+Axpg4z2p7bNsluO 7u92L6IL5S8xkIt66ixQ+MD+E5Zc8Hs63pVwo3nmHXvSVm7GD2QpOF9cAAUw== Received: from [10.176.58.103] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2-S2G) (envelope-from ) id 1sjxQN-TRjxvw-Hf; Fri, 30 Aug 2024 08:56:07 +0000 Received: from [10.99.243.232] (helo=morbo.fubar.geek.nz) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97.1-S2G) (envelope-from ) id 1sjxQM-4o5NDgrplYW-s7Po; Fri, 30 Aug 2024 08:56:07 +0000 Received: from smtpclient.apple (92.40.184.78.threembb.co.uk [92.40.184.78]) by morbo.fubar.geek.nz (Postfix) with ESMTPSA id 9341C16931; Fri, 30 Aug 2024 08:56:05 +0000 (UTC) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: git: 43e8849bc294 - main - conf: Enable BTI checking in the arm64 kernel From: Andrew Turner In-Reply-To: <19DBDC11-EB0F-48C0-9AAE-9EED087F0AB6@freebsd.org> Date: Fri, 30 Aug 2024 09:55:54 +0100 Cc: John Baldwin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> <77cbcd47-1778-4e71-b824-4e75e0e4b2d6@FreeBSD.org> <19DBDC11-EB0F-48C0-9AAE-9EED087F0AB6@freebsd.org> To: Jessica Clarke X-Mailer: Apple Mail (2.3774.600.62) X-Smtpcorp-Track: N1hkBpzpkBvJ.DdxwnGi1bqK8.JoHAhAzzxOp Feedback-ID: 790814m:790814amQcrys:790814sU1FG6a83q X-Report-Abuse: Please forward a copy of this message, including all headers, to X-Smtpcorp-Track: N1hkBpzpkBvJ.DdxwnGi1bqK8.JoHAhAzzxOp 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:23352, ipnet:103.2.140.0/22, country:US] X-Rspamd-Queue-Id: 4WwBp341RVz4VCc > On 29 Aug 2024, at 17:02, Jessica Clarke wrote: >=20 > On 21 Aug 2024, at 15:28, John Baldwin wrote: >>=20 >> On 8/20/24 05:02, Andrew Turner wrote: >>> The branch main has been updated by andrew: >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D43e8849bc29414036ccaef7788de95a0= 7ad32ab5 >>> commit 43e8849bc29414036ccaef7788de95a07ad32ab5 >>> Author: Andrew Turner >>> AuthorDate: 2024-08-19 12:59:49 +0000 >>> Commit: Andrew Turner >>> CommitDate: 2024-08-20 08:49:15 +0000 >>> conf: Enable BTI checking in the arm64 kernel >>> To ensure new code has BTI support make it an error to not = have the >>> BTI ELF note when linking the kernel and kernel modules. >>> Reviewed by: kib, emaste >>> Sponsored by: Arm Ltd >>> Differential Revision: https://reviews.freebsd.org/D45469 >>=20 >> This has broken two of the GitHub CI actions using clang 12 and clang = 13. >> Please fix this to be conditional on a supported linker version (or = perhaps >> add a new linker feature to bsd.linker.mk). >=20 > This is still broken. If it=E2=80=99s not fixed promptly I will just = revert > this change; we can=E2=80=99t leave CI broken, especially when it gets = used to > test GitHub PRs. Please stop breaking building with older toolchains, > this isn=E2=80=99t the first time it=E2=80=99s happened. See https://github.com/freebsd/freebsd-src/pull/1393 and = https://github.com/freebsd/freebsd-src/pull/1399 Andrew From nobody Fri Aug 30 10:27:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwDqq4tcGz52XsG; Fri, 30 Aug 2024 10:27: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 4WwDqq419yz4cf7; Fri, 30 Aug 2024 10:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725013671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHL2x/PDENiwftZxOPI1fzscO6oFCfJRiVlAXOL6beg=; b=hZcYqzC10x8U+bhdwhaAsKlEDirnWEJGKr6Nl039odWvVfmodRkbDM3m1SPuvX66izHbE1 CWBEnETNmmf1rs3ghRTiBNyzICSDPG1DeoiJGIWeygTFNPobh8O6QJLsI9kpdW1fAy481E 7YnPZDq0pm8dPCYXrTsycK3SM0IlRkrlXOdhS236Q1NxmzdBQTX642ZbVM4un1YUszngRY dHCXQJAtVqESymBGoKmyguv4HvZELHt4GNNedIklWM7rlbTbEz0ZFN0qL0ojrqIlYZGOP8 6RfCTVfikuNlHxis4QxIuA4eA7izVa72XbiFw1pTicc38ifmraIddZ5Yw/cSIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725013671; a=rsa-sha256; cv=none; b=LbJ1mwFumebrMV9Z23V5JuETMP7h4On+6Gs1Um/FRbHYPE6KVOmlL3w7mtBe2HFqYO9/6t 2RFyaa7dhwPoAj7DlLPFVFWxhW/mLV0d7XYqLT6rTrDp9+UQ1rAtg3Fu7h09TR0H4T6vNK ujWlddhkY5z9dvtOaBS/sP6pBNhOIYdT1YJXDrjRNO777eJDQ0/MaFfGNYZFSScvp7URM2 yuu28/G/E92VWWGXi6pACoHISU3Y7XWWSI3L9ylLNOi2rYf2ZNiBu9eyXYf8bqI1l3kkJ7 t1DmuU5Ytua40tKko6rn5NZTEVWGzEJaXwaLoxrpAzFxi5aND27EHp7o62UHdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725013671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHL2x/PDENiwftZxOPI1fzscO6oFCfJRiVlAXOL6beg=; b=m1qBRwQ8bKPGQydoF3GmKU8vU7Wb2TK3ngl34O4lyAlBGI3IwHQNZ05BSZj7qjlIGk/oQE wrk5BH/iHgMT0dPH6lauA8m8w5zqXd/bX2A47q+P1bJal5ekr1dQ7GANQcpkxDEnLYnBTb 2YK10oHXWs6TY2WyDaynUgbx2umQjLX7zSrLajoRIc8bhTh9i1aZ6n2feoHmyIN1JvR06J RHGg4G6A9yg0+fezkvolmy7RfGAkGdQaOK0bDHMdDOrdSYM0JrxkUJrozduwPGVNI0Yf5m nDuFa5cYCb4S6hAVMGAYBYpHKdKg1cQH94aCAgLv0tVyW76nE4vKBgZwCR+vmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwDqq3d5QzxPs; Fri, 30 Aug 2024 10:27: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 47UARpsA051321; Fri, 30 Aug 2024 10:27:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UARpEn051318; Fri, 30 Aug 2024 10:27:51 GMT (envelope-from git) Date: Fri, 30 Aug 2024 10:27:51 GMT Message-Id: <202408301027.47UARpEn051318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 356be1348dac - main - kernel: Make some compile time constant variables const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a commit 356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a Author: Zhenlei Huang AuthorDate: 2024-08-30 10:26:30 +0000 Commit: Zhenlei Huang CommitDate: 2024-08-30 10:26:30 +0000 kernel: Make some compile time constant variables const Those variables are not going to be changed at runtime. Make them const to avoid potential overwriting. This will also help spotting accidental global variables shadowing, since the variable's name such as `version` is short and commonly used. This change was inspired by reviewing khng's work D44760. No functional change intended. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45227 --- sys/arm/arm/identcpu-v6.c | 6 +++--- sys/arm64/arm64/identcpu.c | 2 +- sys/conf/newvers.sh | 14 +++++++------- sys/kern/init_main.c | 24 ++++++++++++------------ sys/kern/kern_mib.c | 16 ++++++++-------- sys/powerpc/powerpc/machdep.c | 5 +++-- sys/riscv/riscv/identcpu.c | 6 +++--- sys/sys/copyright.h | 4 ++-- sys/sys/sysctl.h | 8 ++++---- sys/sys/systm.h | 8 ++++---- sys/x86/x86/identcpu.c | 6 +++--- 11 files changed, 50 insertions(+), 49 deletions(-) diff --git a/sys/arm/arm/identcpu-v6.c b/sys/arm/arm/identcpu-v6.c index 34663dfa51e6..3dd218696a19 100644 --- a/sys/arm/arm/identcpu-v6.c +++ b/sys/arm/arm/identcpu-v6.c @@ -49,10 +49,10 @@ #include #include -char machine[] = "arm"; +const char machine[] = "arm"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); static char cpu_model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_CAPRD, diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 5fec7cba385f..eead0051d315 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -59,7 +59,7 @@ static void print_cpu_caches(struct sbuf *sb, struct cpu_desc *desc); static u_long parse_cpu_features_hwcap32(void); #endif -char machine[] = "arm64"; +const char machine[] = "arm64"; #ifdef SCTL_MASK32 extern int adaptive_machine_arch; diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 908e3bfa660a..481af5480399 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -312,13 +312,13 @@ $COPYRIGHT #define VERSTR "${VERSTR}" #define RELSTR "${RELEASE}" -char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; -char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; -char compiler_version[] = "${compiler_v}"; -char ostype[] = "${TYPE}"; -char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; -int osreldate = ${RELDATE}; -char kern_ident[] = "${i}"; +const char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; +const char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; +const char compiler_version[] = "${compiler_v}"; +const char ostype[] = "${TYPE}"; +const char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; +const int osreldate = ${RELDATE}; +const char kern_ident[] = "${i}"; EOF ) vers_content_old=$(cat vers.c 2>/dev/null || true) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 9d2663015027..fed5340695cf 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -365,36 +365,36 @@ print_version(const void *data __unused) printf("%s\n", compiler_version); } -SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, +C_SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright); -SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, +C_SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t, trademark); -SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL); +C_SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL); #ifdef WITNESS -static char wit_warn[] = +static const char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; -SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, +C_SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_FOURTH, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, +C_SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_FOURTH, print_caddr_t, wit_warn); #endif #ifdef DIAGNOSTIC -static char diag_warn[] = +static const char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; -SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, +C_SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, +C_SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, diag_warn); #endif #if __SIZEOF_LONG__ == 4 -static char ilp32_warn[] = +static const char ilp32_warn[] = "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n"; -SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, +C_SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); -SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, +C_SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH, print_caddr_t, ilp32_warn); #endif diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 0132478aa68a..f8f90fce87cf 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -94,20 +94,20 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Regression test MIB"); #endif -SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, - kern_ident, 0, "Kernel identifier"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD, + kern_ident, "Kernel identifier"); SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, BSD, "Operating system revision"); -SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, - version, 0, "Kernel version"); +SYSCTL_CONST_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD, + version, "Kernel version"); -SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, - compiler_version, 0, "Version of compiler used to compile kernel"); +SYSCTL_CONST_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD, + compiler_version, "Version of compiler used to compile kernel"); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, - ostype, 0, "Operating system type"); +SYSCTL_CONST_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD | CTLFLAG_CAPRD, + ostype, "Operating system type"); SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxproc, 0, "Maximum number of processes"); diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 638153ba49bc..899fb430e5d9 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -152,8 +152,9 @@ static char init_kenv[2048]; static struct trapframe frame0; -char machine[] = "powerpc"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, ""); +const char machine[] = "powerpc"; +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 203edb3689bc..54eb302982f1 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -59,10 +59,10 @@ #include #endif -char machine[] = "riscv"; +const char machine[] = "riscv"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, machine, 0, - "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); /* Hardware implementation info. These values may be empty. */ register_t mvendorid; /* The CPU's JEDEC vendor ID */ diff --git a/sys/sys/copyright.h b/sys/sys/copyright.h index 0da33cec4eb8..4b74075c6712 100644 --- a/sys/sys/copyright.h +++ b/sys/sys/copyright.h @@ -45,5 +45,5 @@ #define COPYRIGHT_UCB \ "Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994\n\tThe Regents of the University of California. All rights reserved.\n" -char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_UCB; -char trademark[] = TRADEMARK_Foundation; +const char copyright[] = COPYRIGHT_Vendor COPYRIGHT_FreeBSD COPYRIGHT_UCB; +const char trademark[] = TRADEMARK_Foundation; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 7b27cb307e0c..66c6ff1640b7 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1153,10 +1153,10 @@ SYSCTL_DECL(_regression); SYSCTL_DECL(_security); SYSCTL_DECL(_security_bsd); -extern char machine[]; -extern char osrelease[]; -extern char ostype[]; -extern char kern_ident[]; +extern const char machine[]; +extern const char osrelease[]; +extern const char ostype[]; +extern const char kern_ident[]; /* Dynamic oid handling */ struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 61874a05e0b9..f542a9a86018 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -51,9 +51,9 @@ __NULLABILITY_PRAGMA_PUSH extern int cold; /* nonzero if we are doing a cold boot */ extern int suspend_blocked; /* block suspend due to pending shutdown */ extern int rebooting; /* kern_reboot() has been called. */ -extern char version[]; /* system version */ -extern char compiler_version[]; /* compiler version */ -extern char copyright[]; /* system copyright */ +extern const char version[]; /* system version */ +extern const char compiler_version[]; /* compiler version */ +extern const char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ extern u_long pagesizes[]; /* supported page sizes */ @@ -109,7 +109,7 @@ extern bool scheduler_stopped; */ #define SCHEDULER_STOPPED() __predict_false(scheduler_stopped) -extern int osreldate; +extern const int osreldate; extern const void *zero_region; /* address space maps to a zeroed page */ diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index f24fdc1647e6..d3aec5b5e0c6 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -124,7 +124,7 @@ u_int cpu_power_eax; /* 06H: Power management leaf, %eax */ u_int cpu_power_ebx; /* 06H: Power management leaf, %ebx */ u_int cpu_power_ecx; /* 06H: Power management leaf, %ecx */ u_int cpu_power_edx; /* 06H: Power management leaf, %edx */ -char machine[] = MACHINE; +const char machine[] = MACHINE; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, @@ -158,8 +158,8 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, - machine, 0, "Machine class"); +SYSCTL_CONST_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD | CTLFLAG_CAPRD, + machine, "Machine class"); #endif char cpu_model[128]; From nobody Fri Aug 30 13:08:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwJPD50hLz5MYvS; Fri, 30 Aug 2024 13:08: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 4WwJPD4ZL3z4r4V; Fri, 30 Aug 2024 13:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725023312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0O1t5C2f0/BQPtCIrE80YtFx5hi4XEHjqY9LOeOvPJc=; b=KaWzVAsZY6judFuDgVOEhHV0RqwyUIptUCRKqoEiUXU43z7cfSjdfEAWOWkasv/SzGt8YF sqkcq4rdJg0kOHJ8U3iP5b1YgRAzSsjKHU3Kz9jH3YDEmN71N1Iu2xT/E9swC7bfP+BZgt fz+/KoNYffEmO6ceiwaHJNr+YYCAq/x8sTwyQkGzqDeXR9Lmw9PvYU8vlc8Q3E7sjGnfNI aeZuIWLMUXkz+lxakttOjCrKq7IpcGSP1V+DN2qfeMYsZ+iCmndSws87ytzvYoQbiELBvW QwDgU4lCekoJtm4mso0zxAEkYZ1jA3Wgah8l8S0i6Ap2HHEVSR0E+q9jjvfiAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725023312; a=rsa-sha256; cv=none; b=ByjWzPgITuXeE+d6gGlvpGZWJZ1iM+OB+FbJ9WgCIszU2CObu7tHHLF4biAAEHuKTzRSdV CGWkjcBFPdAGsJLbG75AAK8SLdLpQKg9EPOYFRT4dREllLcVNdkZJjCZq/6OxHR2CAZgHv 2qEOpKp1Q05sgG15OWODUs1B+W1UeuvZIxJ2ENXX2O44hOHKNexjruUduNmFmg6b+Wpcha yiqZMFn3JqPXBXrTFYmebL6n0p3hiqhmlXe4dM7RBvtayRZOI0JkhNszhDq1PBerfLM6nl jshaMS+3j+bkT6yCoV1ShBlPDw95iGhPPsgRM5HE8ipcf+I159Af/WHFdPBdNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725023312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0O1t5C2f0/BQPtCIrE80YtFx5hi4XEHjqY9LOeOvPJc=; b=mLZdVFsPsIRgzOAQ1c/5eBOVaaMCMoqOqRVYslN7zKnTmEnBoylIal1p39EGJuvbmAk4Ou dvTWhAakpBtrysCv6agCYt+diJ4CKXeXPRo/10T7qnR5/mQV6K84ILRbAl60mmWQtIvWYR 8Cu2Ko3/uzFLK2zeLB9DBiRXt5UaqGpfgAOVVSbZOoGFwCNkCLh6vSC7Qy2PTrGWVKa88k EKAa4n+0gpxPTxtChnfYrghTmrR7QT5gs1V8bWQ1HV4F/qDHILxyc/XMVYrpCxCyTAQ4At qleaHkEt2DgZNFpRGwsQWBLmRjZ1uEKo3JMUcN17ohIRRKCQVjLP7JsbwTTGxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwJPD49Smz12k8; Fri, 30 Aug 2024 13:08: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 47UD8WPO022765; Fri, 30 Aug 2024 13:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UD8WmU022762; Fri, 30 Aug 2024 13:08:32 GMT (envelope-from git) Date: Fri, 30 Aug 2024 13:08:32 GMT Message-Id: <202408301308.47UD8WmU022762@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: e196b12f4d4d - main - ipsec: Drain async ipsec_offload work when destroying a vnet List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e196b12f4d4d13982d42cf7841b77dca1405effa Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e196b12f4d4d13982d42cf7841b77dca1405effa commit e196b12f4d4d13982d42cf7841b77dca1405effa Author: Mark Johnston AuthorDate: 2024-08-30 00:44:45 +0000 Commit: Mark Johnston CommitDate: 2024-08-30 13:08:20 +0000 ipsec: Drain async ipsec_offload work when destroying a vnet The ipsec_offload code in some cases releases object references in an asynchronous context where it needs to set the current VNET. Make sure that all such work completes before the VNET is actually destroyed, otherwise a use-after-free is possible. Reported by: KASAN Reviewed by: kib Fixes: ef2a572bf6bd ("ipsec_offload: kernel infrastructure") Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46483 --- sys/netipsec/ipsec_offload.c | 2 +- sys/netipsec/key.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index bbf98ac7a676..1ff91ec585c2 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -386,7 +386,7 @@ ipsec_accel_sa_newkey_impl(struct secasvar *sav) TASK_INIT(&tq->install_task, 0, ipsec_accel_sa_newkey_act, tq); tq->sav = sav; - tq->install_vnet = curthread->td_vnet; /* XXXKIB liveness */ + tq->install_vnet = curthread->td_vnet; taskqueue_enqueue(taskqueue_thread, &tq->install_task); } diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 5a3e5727bc2e..ad1d6164f158 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -8713,6 +8713,9 @@ key_vnet_destroy(void *arg __unused) } SAHTREE_WUNLOCK(); + /* Wait for async work referencing this VNET to finish. */ + ipsec_accel_sync(); + key_freesah_flushed(&sahdrainq); hashdestroy(V_sphashtbl, M_IPSEC_SP, V_sphash_mask); hashdestroy(V_savhashtbl, M_IPSEC_SA, V_savhash_mask); From nobody Fri Aug 30 14:08:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwKkt1fKnz5Mf9T; Fri, 30 Aug 2024 14:08: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 4WwKkt10vvz3wrF; Fri, 30 Aug 2024 14:08:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725026934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UZ6vd1shil5mM6hPBA4+p9jxE+tMBiHIYm59VDj2nKE=; b=ujNnc6mMQNWp1WgvS2BQt8/hfYYqVQDStaGiYk9cmLZPIjGaBXzofOcoQIVbHoTBfuFZyp ak1YxfulZqEejC3d5puRy/J/+p70LN4l10g/FATU5tbJP1rkJFf7QEXpi9+aHhrQEB5tZm 8sMYQPXkmXV4AHGk4iTWstCaLoEtIUtb9fYbFdO2sDO/bmgDFXrpgXk1Z1uxOMx22md2s+ yEqdWq4r0Z/Nnymh/6Hvc6KEDNtD6yKiUJxZEf3bP/RplgYoOJBI8yHf0bMNKmggLGlQbW XXeyg3ehly8p0dkojLKwZsLIuAw1A8WSLiGwpDabsarfYkNpu6PeVxCSGBDByg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725026934; a=rsa-sha256; cv=none; b=MSnbZv7H3IS4zzxaz9NgZFPMXir2CIghVtlWWN16ZF5o+safbuQ5n5mooA8ceFPuIruxAK KZNCYkuRTlqSHhCUeM4kPSvYZTdN2DXQf6R6IVVhN/XCaASrTB17HrtYQpetZVl+KMbxSa 06fJd8FVgcsYPOUXa2NAL0d2+89V0mSRpKWHgeUwmJY372oHlb2WZHrm66CWIjdHpFWpF5 dm1fNYP3xdRwcalfhVDscs56Gbd7t6R1wg6B8jHVEic/ClUKAN0Y+bn+bF1Qun6FFCuca+ lhyb2XqAx/CICMQZnbuP0gvmgufGy9ePjhTj8fnf4zzquEKMdCPfBye7LrY+Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725026934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UZ6vd1shil5mM6hPBA4+p9jxE+tMBiHIYm59VDj2nKE=; b=VKYzTgwREDvNtiCMAgBj/5zJfs0bFpjWd3fk9Xp2hcuaaPmvQATYd5l40bSYU3heTleXJm mykt1qYGF1CspKBRj9co8J0FDa0qQBsNRcGDZwlEWT8mXLNHacY6Ew9lKLTaSxbSSZ1tAX imA5nszP8fTFvsIgISL110aBA8bKj0xBT2xF+XPcelsOWpRfH+Xb7RPWjwcvApB24CDmaz 9iYSGp+mucWWWIYuJ8uww5aNwGTcpfpjvaWCi4f63wIypdRFSSpDcIoSy1EXoQCtDVGZDf uUdT0TygolDN+e6ZIwcrq4CtvQpcMKqoBP1Ew+HgxdrUwX4vQNvXns1KcuUeLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwKkt0YpGz144b; Fri, 30 Aug 2024 14:08: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 47UE8r16023494; Fri, 30 Aug 2024 14:08:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UE8rgh023491; Fri, 30 Aug 2024 14:08:53 GMT (envelope-from git) Date: Fri, 30 Aug 2024 14:08:53 GMT Message-Id: <202408301408.47UE8rgh023491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 06986e899972 - main - pam_xdg: Fix user xdg runtime directory's descriptor leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06986e899972ac3a127ab2ab46196672d0e1e5b2 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=06986e899972ac3a127ab2ab46196672d0e1e5b2 commit 06986e899972ac3a127ab2ab46196672d0e1e5b2 Author: Olivier Certner AuthorDate: 2024-08-13 21:04:09 +0000 Commit: Olivier Certner CommitDate: 2024-08-30 14:08:14 +0000 pam_xdg: Fix user xdg runtime directory's descriptor leak Fixes: 6e69612d5df1 ("pam: Add pam_xdg module") MFC after: 3 days Sponsored by: The FreeBSD Foundation --- lib/libpam/modules/pam_xdg/pam_xdg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 2c80f0a0332f..10c6467776a3 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -108,6 +108,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, goto out; } } else { + close(rt_dir); /* Check that the already create dir is correctly owned */ rv = fstatat(rt_dir_prefix, user, &sb, 0); if (rv == -1) { From nobody Fri Aug 30 15:01:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwLvC0mXrz5MjnC; Fri, 30 Aug 2024 15:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WwLvC0GZQz42Ml; Fri, 30 Aug 2024 15: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=1725030071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6tTmhTCn/oVmmmhpT4t5UbB+1HyOT52BmP8Xi9D6is=; b=MtuY5gbfzzJWW2WDy/MwPo6aUaDvEImKOAFL5LzQFa+6SvgC5nn/nfogkyLK3GkfdrIsjW 9fg5sPrIAfD3D3BznuKc6wt5UdDkEl1fFju1xm9sh4Wwp0qhjaiRkLajwg6drEGtHJ3Tiz aD8YMQ84yS8OE0hy3be81Ws3IOmCuLMMFuIBSe1cW8euzcEoRyT3yMUMWjhnwNJgfuEUBp Iz0XQA8DrzsMb1Y6Bdv42Txh2ECVTcs5Ubp0S0cSqmXqvTu4EwTXolKNdiRGUR8P3OgR2q G7dwbSk6KB98mzDcYMFg/WG28H1dCGHlNj+Pe9teEYlBa5uBPiu5E7mZ5tgEHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725030071; a=rsa-sha256; cv=none; b=FhAdxzC+sruIXJfZ0tKmglRwv+gYBRaWzwSQgFzCunyQq078LKeYX7YkghulGN6W3I2q8/ u50N6HTu8ERpocX8k0ynkt/epskfDYxbxfrL/UxXaEBoJWZNCnS6cmpqMsbfBX9V3yTb5t gsqPbQgMGo18v7NLWRUkQ+I2Jg3ya+z3gggeBfWZyZPEwkkhebqB8hP6pJny8ktGGIq+bA 0ShX5VAmQgM3hwWc5MPQTtp8wj52uWR3dgNAk5ya/05JjcgAwpcm+AT0DHxxI/xNhFs9wW B6h+xg2dm26BpwuG7DaUXfj7Vf7laqsGKV8jS5cmMS5i1wyTmkoQJ4lci7GEeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725030071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6tTmhTCn/oVmmmhpT4t5UbB+1HyOT52BmP8Xi9D6is=; b=o0cBfDbHF95x9YoluiR5EdyygE3AThBJoe/UNS/66tf6+M+xJQniLxQhH/JbPW95IJslUi 55dbpDC0L9Q3uPfsTBCwzPAi6abG4y0zqTtkz4Zle7ypK8HJtbUCb/R0rAavEi0N3AyK0+ eU2zSuO4BME3Y2C9lw+VX2MvMxUwNQDI6XpteoBcwR7oT+WoYo8409bsjcYdD5oNPYbPuu jMZc2JDMzeMklxctjGIUpRa28njHevGmlOQwfMHm4o1W9hJiO//PlOmuig/MsobuY4V903 kCthlWCwlmVKmB1RtU3xI8O6NgnQMqZ3DLxBFp6gFHPCFszCRqG8sj0XtBvniQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwLvB6zvTz14xq; Fri, 30 Aug 2024 15:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47UF1Ar8018859; Fri, 30 Aug 2024 15:01:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UF1Arg018856; Fri, 30 Aug 2024 15:01:10 GMT (envelope-from git) Date: Fri, 30 Aug 2024 15:01:10 GMT Message-Id: <202408301501.47UF1Arg018856@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: 28294dc92476 - main - Revert "ipsec: Drain async ipsec_offload work when destroying a vnet" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28294dc92476031a3ce5228501f1429192cb3c8f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=28294dc92476031a3ce5228501f1429192cb3c8f commit 28294dc92476031a3ce5228501f1429192cb3c8f Author: Mark Johnston AuthorDate: 2024-08-30 15:00:16 +0000 Commit: Mark Johnston CommitDate: 2024-08-30 15:00:16 +0000 Revert "ipsec: Drain async ipsec_offload work when destroying a vnet" This change can cause a deadlock in some cases, since it's possible for VNET teardown to happen in the context of taskqueue_thread, and ipsec_accel_sync() drains taskqueue_thread's work queue. This reverts commit e196b12f4d4d13982d42cf7841b77dca1405effa. --- sys/netipsec/ipsec_offload.c | 2 +- sys/netipsec/key.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c index 1ff91ec585c2..bbf98ac7a676 100644 --- a/sys/netipsec/ipsec_offload.c +++ b/sys/netipsec/ipsec_offload.c @@ -386,7 +386,7 @@ ipsec_accel_sa_newkey_impl(struct secasvar *sav) TASK_INIT(&tq->install_task, 0, ipsec_accel_sa_newkey_act, tq); tq->sav = sav; - tq->install_vnet = curthread->td_vnet; + tq->install_vnet = curthread->td_vnet; /* XXXKIB liveness */ taskqueue_enqueue(taskqueue_thread, &tq->install_task); } diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index ad1d6164f158..5a3e5727bc2e 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -8713,9 +8713,6 @@ key_vnet_destroy(void *arg __unused) } SAHTREE_WUNLOCK(); - /* Wait for async work referencing this VNET to finish. */ - ipsec_accel_sync(); - key_freesah_flushed(&sahdrainq); hashdestroy(V_sphashtbl, M_IPSEC_SP, V_sphash_mask); hashdestroy(V_savhashtbl, M_IPSEC_SA, V_savhash_mask); From nobody Fri Aug 30 15:33:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwMc252bJz5Mlx5; Fri, 30 Aug 2024 15:33: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 4WwMc23Kjbz4648; Fri, 30 Aug 2024 15:33:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725031986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X4ZX6GBGOnXRS6DhqlVmi+LUG1v7+tXeJceeyJPfnKE=; b=OFIkuFkauc7lQvJlSZz8vZxvy6pP6khTJekCmLm6HEwM5Mu6E6GbhEZuR2a9MkMlynxx/5 UkimctMSrJRpzfLX97H50YYrKSRq2lVKwWhlaqLhgTH6ppEMAlzgNs/FkKmVDRKZ+y4sg9 9LOJ8I540nGa/iuvi4Abp5br1ODFsFA4EN58AhvWYyAq+b6LRMu+CtFZkkY58JJFEPsbYT 2h1RavfE53Wuj/Z4wSG6qScsVrmNG6kis/2prYi1UNSsNryW6cuWRft5oQtHvS+DKLjn/V rxIFK1gu5DYgsTeNEphhPg/f9lVAU9MuvexeZKSJm/1LVBq+yaGkurzkkGPkhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725031986; a=rsa-sha256; cv=none; b=B2WQU3h7GkdyRnPfWYQhZ/Jw9lolt3CcWgqdUnpPptyyUPQNUDZCtrIQTom/ViVDfy190E FcRugO+r8Rq8siKHPMQSI+SW/KFuRpWQum8Dq2+daHbuzlIHaAppOfd4I/cVWDXv7laJLf VX4Qu96mPg5UVpSD1WuKBPqgYxQV8oTD1jD2+o6b03U8KxomJ4E6OTdHbyYBPVtTeQHJIW 38ZNapY4nwtE7eJp0ez91horfR3xxei+HEGa82JMZtC8Uu8Wi2va3ppcjuK7b0yYFcfIVz nfcIRY8w6zoOHobNomimJ8boB6abUMvQiII8ps1EovFY8KY1qRokkTUloAfl3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725031986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X4ZX6GBGOnXRS6DhqlVmi+LUG1v7+tXeJceeyJPfnKE=; b=EFYN6bUvpMqVxrihHiEfT0yxVtT/+AoQq7AnRwnh0DJv98KAQRAy4MgXegti9tuTTxTAs1 PfBRUCWF1oXFdLCC0EPXARL0AEyegVsS2cfCYK/0Rg/IOhU3pKGJVzavTcG4Sfy+4Dk5ge lwPtqaRFzb1CGPWhlwIKCkR+bI8EkiTG3c02ckuQlZs7HEsxTGSbUmPr9I+Nt+DvLeYuix BBaTGfADqEq4U6gksQ2xtzDP6Ag+4dQkF6X6qZgUCHFgtU3WYSFj/F6RsplNjvZgUb0fYF ZbfJ5/OPxp8I3gyL8JqLS+lF5drWcqhfurx/TwQeQIlISztuP/2h+qhhVpUP1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwMc22cdcz15vZ; Fri, 30 Aug 2024 15:33: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 47UFX65n074879; Fri, 30 Aug 2024 15:33:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UFX640074876; Fri, 30 Aug 2024 15:33:06 GMT (envelope-from git) Date: Fri, 30 Aug 2024 15:33:06 GMT Message-Id: <202408301533.47UFX640074876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 9fdb683d92b3 - main - cxgbe/iw_cxgbe: Fail early in some callbacks when the RNIC is stopped. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fdb683d92b36cbd20bbd8d61f0c1138f8348dd4 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=9fdb683d92b36cbd20bbd8d61f0c1138f8348dd4 commit 9fdb683d92b36cbd20bbd8d61f0c1138f8348dd4 Author: Navdeep Parhar AuthorDate: 2024-08-30 00:23:16 +0000 Commit: Navdeep Parhar CommitDate: 2024-08-30 15:31:45 +0000 cxgbe/iw_cxgbe: Fail early in some callbacks when the RNIC is stopped. Stop allocating new resources when the RNIC is stopped but continue to allow previously allocated resources to be freed. Note that t4_tom's uld_stop tears down all TOE connections, including those being used for iWARP, and that triggers the cleanup of iWARP resources. Fail post_send/post_recv early too to avoid the SQ doorbell. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/iw_cxgbe/cm.c | 2 ++ sys/dev/cxgbe/iw_cxgbe/cq.c | 4 ++++ sys/dev/cxgbe/iw_cxgbe/mem.c | 3 +++ sys/dev/cxgbe/iw_cxgbe/provider.c | 2 ++ sys/dev/cxgbe/iw_cxgbe/qp.c | 7 +++++++ 5 files changed, 18 insertions(+) diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index d8def446d6f0..d291eeeb4f40 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -2602,6 +2602,8 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) CTR2(KTR_IW_CXGBE, "%s:ccB %p", __func__, cm_id); + if (__predict_false(c4iw_stopped(&dev->rdev))) + return -EIO; if ((conn_param->ord > c4iw_max_read_depth) || (conn_param->ird > c4iw_max_read_depth)) { diff --git a/sys/dev/cxgbe/iw_cxgbe/cq.c b/sys/dev/cxgbe/iw_cxgbe/cq.c index 9339d083cae3..197f2bcf8af0 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cq.c +++ b/sys/dev/cxgbe/iw_cxgbe/cq.c @@ -106,6 +106,8 @@ create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, struct wrqe *wr; u64 cq_bar2_qoffset = 0; + if (__predict_false(c4iw_stopped(rdev))) + return -EIO; cq->cqid = c4iw_get_cqid(rdev, uctx); if (!cq->cqid) { ret = -ENOMEM; @@ -1037,6 +1039,8 @@ int c4iw_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags) unsigned long flag; chp = to_c4iw_cq(ibcq); + if (__predict_false(c4iw_stopped(chp->cq.rdev))) + return -EIO; spin_lock_irqsave(&chp->lock, flag); t4_arm_cq(&chp->cq, (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED); diff --git a/sys/dev/cxgbe/iw_cxgbe/mem.c b/sys/dev/cxgbe/iw_cxgbe/mem.c index 348cd3985e87..4a1adc118b7c 100644 --- a/sys/dev/cxgbe/iw_cxgbe/mem.c +++ b/sys/dev/cxgbe/iw_cxgbe/mem.c @@ -621,6 +621,9 @@ struct ib_mr *c4iw_alloc_mr(struct ib_pd *pd, php = to_c4iw_pd(pd); rhp = php->rhp; + if (__predict_false(c4iw_stopped(&rhp->rdev))) + return ERR_PTR(-EIO); + if (mr_type != IB_MR_TYPE_MEM_REG || max_num_sg > t4_max_fr_depth(&rhp->rdev, use_dsgl)) return ERR_PTR(-EINVAL); diff --git a/sys/dev/cxgbe/iw_cxgbe/provider.c b/sys/dev/cxgbe/iw_cxgbe/provider.c index 729733a040d5..511caa436969 100644 --- a/sys/dev/cxgbe/iw_cxgbe/provider.c +++ b/sys/dev/cxgbe/iw_cxgbe/provider.c @@ -231,6 +231,8 @@ c4iw_allocate_pd(struct ib_pd *pd, struct ib_udata *udata) CTR4(KTR_IW_CXGBE, "%s: ibdev %p, pd %p, data %p", __func__, ibdev, pd, udata); rhp = (struct c4iw_dev *) ibdev; + if (__predict_false(c4iw_stopped(&rhp->rdev))) + return -EIO; pdid = c4iw_get_resource(&rhp->rdev.resource.pdid_table); if (!pdid) return -EINVAL; diff --git a/sys/dev/cxgbe/iw_cxgbe/qp.c b/sys/dev/cxgbe/iw_cxgbe/qp.c index 3aab07755101..0e374bc961c4 100644 --- a/sys/dev/cxgbe/iw_cxgbe/qp.c +++ b/sys/dev/cxgbe/iw_cxgbe/qp.c @@ -138,6 +138,9 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, struct wrqe *wr; u64 sq_bar2_qoffset = 0, rq_bar2_qoffset = 0; + if (__predict_false(c4iw_stopped(rdev))) + return -EIO; + wq->sq.qid = c4iw_get_qpid(rdev, uctx); if (!wq->sq.qid) return -ENOMEM; @@ -785,6 +788,8 @@ int c4iw_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr, qhp = to_c4iw_qp(ibqp); rdev = &qhp->rhp->rdev; + if (__predict_false(c4iw_stopped(rdev))) + return -EIO; spin_lock_irqsave(&qhp->lock, flag); if (t4_wq_in_error(&qhp->wq)) { spin_unlock_irqrestore(&qhp->lock, flag); @@ -920,6 +925,8 @@ int c4iw_post_receive(struct ib_qp *ibqp, const struct ib_recv_wr *wr, u16 idx = 0; qhp = to_c4iw_qp(ibqp); + if (__predict_false(c4iw_stopped(&qhp->rhp->rdev))) + return -EIO; spin_lock_irqsave(&qhp->lock, flag); if (t4_wq_in_error(&qhp->wq)) { spin_unlock_irqrestore(&qhp->lock, flag); From nobody Fri Aug 30 15:35:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwMfK2z9Qz5MlxB; Fri, 30 Aug 2024 15:35:05 +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 4WwMfK2RfRz46bR; Fri, 30 Aug 2024 15:35:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725032105; 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=3scL+nuvotNO5Lj1CmPp2XYw8cHT5+XEFOjt7WAaoH8=; b=RY6yhvYt1HrvLYgDYLRoXHI1AY+dlBh3YbBesbRWG4inAyLQYnIOjf2zu3Ppr6tCw3jN+i XaJibfHb5OUyGZ4Ng3is9RIH3w5AunE3MWcYWzF0kBDXT17JeLyS1TzvBmKmhUd0E/Ja2F O61LaZThwAoTg189Y692uswToqLpyNFNCSFQQDvFHMRsUwmP352VtBRD1UlzFM4jsBNznI 8hEs38M8RNKW+j9gabliWds4bSeMMKHFyuaw9uQ9kZ8j5em8qdLARCCC3exz/mp2X2nh+1 fSR2dUjJv9DsTfCH0+IcFCg6KMnnPBC90NOImrJCT295ySb1oX62qqKsnr5Mpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725032105; a=rsa-sha256; cv=none; b=dIr3xmZawFXVfhC7LrriIN4jllBXQIahf3aS0fcv7InY6TCIzbQboPThqLUfVoagZNxu+6 kgkgbPCVQ4IAdxmJ4cwoioJTGNdnrFpiDkLBAW5VNNvSeP+Ugzgx4HOotm53LOukfEQUzn /Ty2Ve85Z39WfwxN7jrpDnn30rhU93nGp9BzkDGlKZ1q2MsmRZ/uuJumORAfPFXj2xnqdH oJG3p+YyDPN/HmAwYrnM0kOkJVs6V+eFYoVT3F2Szr89roSFWywE/tl0niArHVjhMVVEn1 Eyg5xsZ/vOr2PmkZ49PvcXvw0MNUQb1r019lYWcS9JzKlZ+OGa7nyYfvTkHm+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725032105; 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=3scL+nuvotNO5Lj1CmPp2XYw8cHT5+XEFOjt7WAaoH8=; b=sIrSaCmvWYQgSHFu2dULJyIaC8TXuJwxuXmaiWBkKSVd2MrsaJlEE6glC5z41HhOmEO6t6 RQ6dadiJ5oew2ZfqHtt4LuKPHxeDj1RrXVu4ypibWN2T7v86qVdJ9TyTmZMCA9VaWh+1Hb Kqwr8SUVLTUchT2XkWOBk8AfsioFAHNtbCiHvDsGkmf9raN+ninVBrr3JlShXLUW6XupHL s0hAPGZFLsdR3ht59goerbshx1WGJ/SPQioMI+dXYEgCr8Aw+kl7A4bcCaKOzBZg2gqamG +ZsjIh37Jo3A0CSEO8SW4C11ShIuONb06HoMs5BBNzJ9j1X9J4nnDIQyymh6qA== Received: from [IPV6:2601:5c0:4200:b830:d8b0:c858:39e:16a2] (unknown [IPv6:2601:5c0:4200:b830:d8b0:c858:39e:16a2]) (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 4WwMfK0MJxz18jw; Fri, 30 Aug 2024 15:35:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <8a9faa7c-1f81-4aa8-adac-a6f07d7d73ff@FreeBSD.org> Date: Fri, 30 Aug 2024 11:35:03 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 43e8849bc294 - main - conf: Enable BTI checking in the arm64 kernel Content-Language: en-US To: Andrew Turner , Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> <77cbcd47-1778-4e71-b824-4e75e0e4b2d6@FreeBSD.org> <19DBDC11-EB0F-48C0-9AAE-9EED087F0AB6@freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8/30/24 04:55, Andrew Turner wrote: > > >> On 29 Aug 2024, at 17:02, Jessica Clarke wrote: >> >> On 21 Aug 2024, at 15:28, John Baldwin wrote: >>> >>> On 8/20/24 05:02, Andrew Turner wrote: >>>> The branch main has been updated by andrew: >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=43e8849bc29414036ccaef7788de95a07ad32ab5 >>>> commit 43e8849bc29414036ccaef7788de95a07ad32ab5 >>>> Author: Andrew Turner >>>> AuthorDate: 2024-08-19 12:59:49 +0000 >>>> Commit: Andrew Turner >>>> CommitDate: 2024-08-20 08:49:15 +0000 >>>> conf: Enable BTI checking in the arm64 kernel >>>> To ensure new code has BTI support make it an error to not have the >>>> BTI ELF note when linking the kernel and kernel modules. >>>> Reviewed by: kib, emaste >>>> Sponsored by: Arm Ltd >>>> Differential Revision: https://reviews.freebsd.org/D45469 >>> >>> This has broken two of the GitHub CI actions using clang 12 and clang 13. >>> Please fix this to be conditional on a supported linker version (or perhaps >>> add a new linker feature to bsd.linker.mk). >> >> This is still broken. If it’s not fixed promptly I will just revert >> this change; we can’t leave CI broken, especially when it gets used to >> test GitHub PRs. Please stop breaking building with older toolchains, >> this isn’t the first time it’s happened. > > See https://github.com/freebsd/freebsd-src/pull/1393 and https://github.com/freebsd/freebsd-src/pull/1399 I do think we probably want to flesh out a bit more what kind of policy we want for the range of compiler versions to support. E.g. in the GDB project the policy is something like "will not use a version of C++ newer than a compiler from 10 years ago" (IIRC). There they will also look back to whatever LTS distros are active and what is the newest compiler that can be installed on those LTS via the equivalent of ports. Traditionally we used to only support compiling FreeBSD N on FreeBSD N-1 (though we have often supported older versions of FreeBSD). However, we now also support cross-compiling from Linux and macOS, so we probably want to widen the support base a bit. I would say a first stab perhaps is that main and any supported stable and release branches should be buildable on a host running any of those versions. That is, FreeBSD 13 is still supported so we should keep main building on it directly without requiring a jump to FreeBSD 14 first. Once 13 EOLs then we can stop supporting 13, and that would gives folks on 13 a way to step up to the supported version of 14 at the time of the EOL. That said, presuambly fairly recent versions of LLVM (and GCC for that matter) will be available in ports for supported versions, so that doesn't necessarily require a very wide range of supported compiler versions. Supporting the "native" compiler on those releases would be a nice goal that I think is probably achievable with minimal effort. Today our oldest supported release is 14.0 which shipped with clang 16, and 13.3 shipped with clang 17. Both of those are quite a bit newer than clang 12 that is current oldest version in CI. I have no idea what version range might be sensible for Linux and macOS. Presumably we'd want to settle on some range of ubuntu LTS versions and whatever is the newest version you can install on the oldest LTS as the minimum. clang 12 might have been used in 13.1 (not mentioned in the release notes, 13.0 used clang 11, 13.2 used clang 14) and 12.3 (12.4 used clang 13, 12.2 used clang 10, 12.3 didn't mention it). I know CHERI LLVM is still on LLVM 15 (though moving to LLVM 16 soon, but Morello LLVM is 14 still I think). libc++ is also making this more complicated as they are providing very little compatability at all. They've already ripped out support for GCC 14 I believe, so you can't build current libc++ with a released version of GCC or something crazy. -- John Baldwin From nobody Fri Aug 30 16:03:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwNHY1j7Zz5Mp9R; Fri, 30 Aug 2024 16: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 4WwNHY14Pwz4BLK; Fri, 30 Aug 2024 16: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=1725033833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6jT3QAZEeMl1IepwmQIffB0hmH/3vSTPuHVwGZfDKQ=; b=g6kSslvMbzszh3g1uxOy9d4WCSMHH1WrRZBuPFtYPtolFrhM+de/tVPEB4bz51l0AWqyVb 48Ogty5+LkJnw0m5Uy5YVQk0QOcILtqcdfg4lGhI+JiNr+K6T9asDUcdEpPD7Lf+kdUnp7 IL0cT2Ym98dyP6dAqx8p4vhIJyFFXAIzj4SyTA23xkQTjAAhrl8B54AixQvFuTYbMSipB6 6Rz5obcUb9YtwFVSkaJ3Rk0hN71SFpVoB9mw+FgVb2eJoIpiC5sum6BHZRQwfpPegAmvTB bf2jcGhCeWHDHtSNMdTdmlEIepyHKa7PqYXiPBlOm6T9zyxTI5UPs9jlTaZoYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725033833; a=rsa-sha256; cv=none; b=xn/JDtMpszLPr2+vzuLWyrGMqVIZCVv11RYt03kaPS1Phya4wDdXLb3L4yuiUwmP9VJDos PK/qVtV97IduHoR8ipxxWWgZ9lFCfqsUVxoIcfgtPBfsEQtmogTuERT0qnOH/lH/0ppA/r Pqw2T6/6jES9AOyZYchgKlKbvC8sEmZ1AUzMpYJGyt7fuhB9Pd5PF9ccUmHop6WBDpZ2jn Ho1pwfKBBN+d/uvMiv6bqiYl8ZRqmu9DN4yUubc8FontAiBtKrUCdsFGOt6ZXdm0/yet4S aE8RRq6gEsIc+Hgmd64unNEIf8eBjarNaSUgCAV2H8//94/8ayN/HdZnphZvMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725033833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6jT3QAZEeMl1IepwmQIffB0hmH/3vSTPuHVwGZfDKQ=; b=c3ArKXxfJLYeaWSSWV01mRPgzVcbmIMZsqHJQW2poxG/zAYm9wQz4zhKidHSK0wbZC7/YZ D4whpEF56nAy0+mzOn0Le2P5KJain4AOjuBxmfoMH8ZX8t1y2hTWwzStyrHj/YMbn80pEO F6Vj7d3io1oBUP3jI6dBaA2T0v/DX1bFj631K/J4GFXOAfseUfZw1ctFxZvKh825FX04i3 NvB/2aOFmQfmRYNQ1YmB9DLm15VVHDoqD6Nt5lUUAdOHXtV0R2PukXobyvsmad2j/f8OZm tgV2SEbgVAuZbZNiXcRfnkjicWXfgOrsIeUih+0gd7T4jgCGO4wJsC9zxPkhAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwNHY0gRrz16PY; Fri, 30 Aug 2024 16: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 47UG3qc0026499; Fri, 30 Aug 2024 16: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 47UG3quf026496; Fri, 30 Aug 2024 16:03:52 GMT (envelope-from git) Date: Fri, 30 Aug 2024 16:03:52 GMT Message-Id: <202408301603.47UG3quf026496@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: 973bbdab4703 - main - mk: Add a BTI-report linker feature List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 973bbdab47035ebd16200c63d095904924dc44d9 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=973bbdab47035ebd16200c63d095904924dc44d9 commit 973bbdab47035ebd16200c63d095904924dc44d9 Author: Jose Luis Duran AuthorDate: 2024-08-22 03:23:59 +0000 Commit: Andrew Turner CommitDate: 2024-08-30 16:03:17 +0000 mk: Add a BTI-report linker feature Add support for specifying how to report the missing Branch Target Identification (BTI) linker feature on AArch64. For: Kernel: bti-report on when the linker supports it Userspace: bti-report on when the linker supports it and BTI_REPORT_ERROR is defined Fixes: 43e8849bc294 ("conf: Enable BTI checking in the arm64 kernel") Pull Request: https://github.com/freebsd/freebsd-src/pull/1393 --- share/mk/bsd.lib.mk | 2 +- share/mk/bsd.linker.mk | 11 ++++++++--- share/mk/bsd.prog.mk | 2 +- sys/conf/kern.mk | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 575b521bea55..6e288b9cd4ce 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -99,7 +99,7 @@ LDFLAGS+= -Wl,-zretpolineplt LDFLAGS.bfd+= -Wl,-znoexecstack .if ${MK_BRANCH_PROTECTION} != "no" CFLAGS+= -mbranch-protection=standard -.if ${MACHINE_ARCH} == "aarch64" && defined(BTI_REPORT_ERROR) +.if ${LINKER_FEATURES:Mbti-report} && defined(BTI_REPORT_ERROR) LDFLAGS+= -Wl,-zbti-report=error .endif .endif diff --git a/share/mk/bsd.linker.mk b/share/mk/bsd.linker.mk index 0e9477284ea3..cceeadd05b94 100644 --- a/share/mk/bsd.linker.mk +++ b/share/mk/bsd.linker.mk @@ -11,9 +11,11 @@ # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # -# - build-id: support for generating a Build-ID note -# - retpoline: support for generating PLT with retpoline speculative -# execution vulnerability mitigation +# - build-id: support for generating a Build-ID note +# - retpoline: support for generating PLT with retpoline speculative +# execution vulnerability mitigation +# - bti-report: support for specifying how to report the missing +# Branch Target Identification (BTI) property (AArch64) # # LINKER_FREEBSD_VERSION is the linker's internal source version. # @@ -112,6 +114,9 @@ ${X_}LINKER_FEATURES+= retpoline .if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 90000 ${X_}LINKER_FEATURES+= ifunc-noplt .endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 140000 +${X_}LINKER_FEATURES+= bti-report +.endif .endif .else # Use LD's values diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 74a653057bda..89534b21d0e7 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -71,7 +71,7 @@ LDFLAGS+= -Wl,-zretpolineplt LDFLAGS.bfd+= -Wl,-znoexecstack .if ${MK_BRANCH_PROTECTION} != "no" CFLAGS+= -mbranch-protection=standard -.if ${MACHINE_ARCH} == "aarch64" && defined(BTI_REPORT_ERROR) +.if ${LINKER_FEATURES:Mbti-report} && defined(BTI_REPORT_ERROR) LDFLAGS+= -Wl,-zbti-report=error .endif .endif diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 079bd1173fad..00492584921b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -143,7 +143,7 @@ CFLAGS += -mgeneral-regs-only CFLAGS += -ffixed-x18 # Build with BTI+PAC CFLAGS += -mbranch-protection=standard -.if ${LINKER_TYPE} == "lld" +.if ${LINKER_FEATURES:Mbti-report} LDFLAGS += -Wl,-zbti-report=error .endif # TODO: support outline atomics From nobody Fri Aug 30 17:24:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwQ4g1sYtz5MvHP; Fri, 30 Aug 2024 17:24: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 4WwQ4g1Cg6z4JDh; Fri, 30 Aug 2024 17:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725038675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SZ7fzrdLUJHCsMc0v2tICdzq8amavTk4dojuX9rRCvk=; b=nTy98ebQEcKyUB+S6JhChrU/6Tq3ovT0YfFAXowFlsr7Ua3ZITi50gyMIlt0Vu4Q1KnGlg tKBtBG+q8PDLAurur92DjDXQlwqrY3VOUwWrRlAVLjfksjiR32NGOMw1BeuJYUZhvvMt4j 0eN/GIpUvH0+dbcDYqKmieGaEciV2jQpBf6WhIRyy2gm/TaQN25HjATQEjLABqbKKNYd4l 9fWCh50bhLbrmcvkHH2qUdbPt1GwF+vNCFwR6k2YpR92WJEX4uhluxuK2OtKZDJvvWrSn2 ztpmkrtUQnABfLRKfL4QqGaoEXy9oX1XL4pUZx1HtD6ptncRcSaJ2eFTkJgMDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725038675; a=rsa-sha256; cv=none; b=ZvnKDHR/foDb2MHtY4q8MUvSiQu0xV19RVLedeuBAo43zC/AaKtoG8mvXOTpsckjAxFxKw 4VVKIWbN3ZVSxZ4YmyOfy6odp3NpZyzkhcozeuD3ELYKLIOR9K8OBcKGgwVFZ3rI69xhRc lyG09x/UmFMVPeONP2q4tlvnpbO3Q45E/XkDbTFOVOSfeJMjK3l7ISdRdLXDMkLu3+ltUS d8s9EMstrfSfpBn2pbFJPA/L0PDuuzMXbNgOKRtH3p5YcGhokUs0ydNR1sGNboOMthf9Al ZGqGzgy/rZCXgnGtIJ9IInhIKEFWL9xtw/R+dHv8lf5Wxl3opTUB38UdKFmTfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725038675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SZ7fzrdLUJHCsMc0v2tICdzq8amavTk4dojuX9rRCvk=; b=O0/WIK6nj9aw6GOBMZMnDisGxIYxcyJSej6GxWRzb/P9+WXE61Yy5IPvaK2VWvuCaPHyS5 J3FrJz/WObOAbzCmaSbT57Z/MspUSR1QDywVr/WN4bhggZsrqcuFF8NXF0yW8cfvWpo+Jn uUNia9bmZHtPLv+8sQ5Nvlr2nAlABYtBY46KPf3HiUcxI6ilSwIQXAEZxSbD2u+ok1vf7u zutj8aY+55XU1oJmNPbVVDifirMRujCfbQdLU9fxsbSBkhR0aU9vUwtaY+nIdhJxkIfIFM Li/XLsZ0ZaplHZRnRiEihqsEk+t4YsWtkXKkxM4ZA42S8o/yYw+DnIE7US5Qvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwQ4g0h8Jz1801; Fri, 30 Aug 2024 17:24: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 47UHOYRU061542; Fri, 30 Aug 2024 17:24:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UHOYKR061539; Fri, 30 Aug 2024 17:24:34 GMT (envelope-from git) Date: Fri, 30 Aug 2024 17:24:34 GMT Message-Id: <202408301724.47UHOYKR061539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 080c85127e3f - main - mixer(8) tests: Fix cleanup routine List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 080c85127e3fba2c8cfb78cb75f7b306aee4028d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=080c85127e3fba2c8cfb78cb75f7b306aee4028d commit 080c85127e3fba2c8cfb78cb75f7b306aee4028d Author: Olivier Cochard-Labbé AuthorDate: 2024-08-30 17:23:29 +0000 Commit: Christos Margiolis CommitDate: 2024-08-30 17:23:29 +0000 mixer(8) tests: Fix cleanup routine The tests correctly skip if no snd_dummy neither mixer is found, but the cleanup is still called with the skip condition, which fails if there is no mixer. MFC after: 2 days Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D46491 --- usr.sbin/mixer/tests/mixer_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/mixer/tests/mixer_test.sh b/usr.sbin/mixer/tests/mixer_test.sh index e1321ad9ee13..45003251c460 100755 --- a/usr.sbin/mixer/tests/mixer_test.sh +++ b/usr.sbin/mixer/tests/mixer_test.sh @@ -66,7 +66,8 @@ set_default() restore_default() { - test -r "test_mixer_deflt_unit" && mixer -d $(cat test_mixer_deflt_unit) + test -r "test_mixer_deflt_unit" && + mixer -d $(cat test_mixer_deflt_unit) || true } atf_test_case o_flag cleanup From nobody Fri Aug 30 19:40:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwT5V16W1z5PZbJ; Fri, 30 Aug 2024 19:40: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 4WwT5V0XrFz4YFw; Fri, 30 Aug 2024 19:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725046830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A12QntbDCs1nzzW6fBHNK0GseuHEJ7c+6vkTk3sawyI=; b=G8Msk2x0HoHr5h4IE3ua2DpXzluLG2aSXjRbISlot/fCfo8QPuzOysD8Lg9EbVbRVg+qIG kGphVxndVl8J6Y0NqMmOyJtELdWwbZF+rpegFHVS0qm/S0YZagOyizEduLJiv8Y6m2Qyz4 wDh8AfVQcLrBvjyJLyOuLUUk/XG++/Kk6AD1E9SBVxKHZ4vp28fqC5xQ4ItA/EFc2gyz7n FE22oPqIol1b3qBNkqVnTVKz9VxCG8Ou+IsnuEcyJS2cootNJXIGkb4UDEmRMVQ33CWeTs MpzfaDUiwlmDBy1R1O33F4Qn+sdGFpv/jmoaPPqsAGsNw08J9/id49DjFhc2Dg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725046830; a=rsa-sha256; cv=none; b=Ov9Htqnh6Uqi8Y/+Uxcpdkxib0JERV6Qg5Cb7mF3HJDucCqS9zKlqO05dJ9kTfR7Y3qexU 95zKaRvOR+qMPFmCA8m+nrH7dnhJ66Fe5H9vj2FBGypj89qv8mKo1qdLkosmxVD7V+Y8ZA tphxVLb3VPfAGe4dShHH28KFgSJ0gTGs5F5uURWF0aTSlJHuaieTS8vhlYE7GRWjTrkTX/ Wxruyh1wDTkOjbCsBF3ZYprov+241Xvwsw//djeU9tF6xUKwbV3qMnii0ICwHiUf/7Sefu u7Yci0nuuVO9ZvTHpsv72CXBzWsmrLokbtTfmfqoxedHPrjAnXDjGr3wtpXNLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725046830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A12QntbDCs1nzzW6fBHNK0GseuHEJ7c+6vkTk3sawyI=; b=kvN1ibND7wLIqbd1vZqP8QxeqysinfbkcFiIsxJ9D7thUK8R8a3Bur51F98cRzLXBWnWSv maSqexkBIfGP91UGXFEWmIDfkqmhziDSkThxcTvqKUO4CVUoaWhRHZRp6SPqGei2zW1cLl sQTcOq/w4BngjrmjYsenu9b+/xSQfbM0sGiT1wzv1SXy+hM6+mvPkBGNPveW62jGHotnYi ZeARled2UG0yyJOm3H9OJeNOOh4lP8utRBFxPRJJryV25cpgwkYolQZs8bX99QB3QbTNX5 pKDVKcyeeC41vp6uqwAsJ0lRQtmi7JUuvNruMwoWDoWLJ0h9Nj6c3TjzidB5Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwT5V02T0z1CQW; Fri, 30 Aug 2024 19:40: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 47UJeTl8090246; Fri, 30 Aug 2024 19:40:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UJeTkg090243; Fri, 30 Aug 2024 19:40:29 GMT (envelope-from git) Date: Fri, 30 Aug 2024 19:40:29 GMT Message-Id: <202408301940.47UJeTkg090243@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: 38a08e45f194 - main - arm64: fix L1 pindex calculation in pmap_growkernel() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38a08e45f19447717726de4d41bd161f966d29da Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=38a08e45f19447717726de4d41bd161f966d29da commit 38a08e45f19447717726de4d41bd161f966d29da Author: Mitchell Horne AuthorDate: 2024-08-29 15:25:52 +0000 Commit: Mitchell Horne CommitDate: 2024-08-30 19:39:56 +0000 arm64: fix L1 pindex calculation in pmap_growkernel() Use the pmap_l1_pindex() macro which accounts for the NUL2E offset. While here, use pmap_l2_pindex() macro further down (no change). Prompted by pull request and commit 2e33abc35460, making the change for the riscv pmap. --- sys/arm64/arm64/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 58795e25c82e..224ecbdc4577 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -2962,7 +2962,7 @@ pmap_growkernel(vm_offset_t addr) VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - nkpg->pindex = kernel_vm_end >> L1_SHIFT; + nkpg->pindex = pmap_l1_pindex(kernel_vm_end); /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); pmap_store(l1, VM_PAGE_TO_PTE(nkpg) | L1_TABLE); @@ -2982,7 +2982,7 @@ pmap_growkernel(vm_offset_t addr) VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - nkpg->pindex = kernel_vm_end >> L2_SHIFT; + nkpg->pindex = pmap_l2_pindex(kernel_vm_end); /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); pmap_store(l2, VM_PAGE_TO_PTE(nkpg) | L2_TABLE); From nobody Fri Aug 30 19:40:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwT5W211wz5PZdw; Fri, 30 Aug 2024 19:40: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 4WwT5W15kvz4Xnb; Fri, 30 Aug 2024 19:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725046831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4EU3CaLsbXgNkum42fTKoO+ZaDTlY2t3mlMwCSP/aDs=; b=g0GVpD65rPxrcj/f/CNhzEqEmbsHDT3+0XYJDOHm+qeSUnh1wzvwesGZdTnROJR3NMOy6c EzqP8LKntHFpGx8x5MNiE9ddQHSb9E+Agx5KZZ7DweXfDfeFw1zg7aWYxrfQ8Wq0e9z8+A GPwFYxNv2PhKcO3EIMEIMsfeW5rWntNlb0kTYNkSDh4EFk3xkQ531MdiIhuifY4W0vSHoI d00aObL95f2O+9FhzgenAl661xbbZxjnTeRBVDRAlUev3L+zksnhyRutYNFtkrosb5xQlE e9v+R2+rfThhYbCgOJsefIgNZhRFNGaZO+Y4yHz2mXxRAsSFK9h+lF6xe8lMcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725046831; a=rsa-sha256; cv=none; b=wJECZWSjIMl9xLrDLGHN0Kr9zvNr92DAg6jwx6/tNll4sBFpy6vijLxvCiHjeDggCI8t8+ N1UprXyeM+PL1FO8FQ/IxwySG6jp3HeJ7J2iSkADM0Gq7Qtua23UexwFHTMHgEZOGbjeYs 0ZKMVMcKxkpgv2e+hCYQ3o028rjEGmGCqKF8+R5ZLrRoJ77cVlDMmxkt5MoFq/Z9PkzqAO 5amkO96H2ZWzA2weulDMCVSMgnCDfi1L3jMpo9xmCXHrsmtzOUtxOP7wzB+P4pnbnbnv+6 VnT5Kq25gdOVWUMd/exBAQId37uyewU112QThHnai7bamPybSyQ6bW4qkG5JgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725046831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4EU3CaLsbXgNkum42fTKoO+ZaDTlY2t3mlMwCSP/aDs=; b=bnonAWHO72hVd5XYMnDU2DOWvea2aLLwH3zlti+fbL/TpZh8uEPcSsiDD15S767e1Z9MEh 3oVe3dbIlcc2sRxuF0eSj5JpmJ96FxcyQag+2EgdUVEV3MPOFB3d9fzMACuXUVQHu6AIFZ 2elooq1dM2Q3CYcCP4JjIO02wDNx+vtOKLyulHfrwnUYcsw6bPSa98GehuhQo4OfmB3d4a X+tRZmjGsR3bbdAVKHF3xJIqibda4DWKSqEIbcRQ5aHpl6woslOLXq4Pqs3Cy2jyUtaPQ9 MKupNEwDGspGJGUvHzMx0iOUPiviu6dqZ3mOtuwhDx7tA/Iqqh7Et584EwmZvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwT5W0jMYzDr1; Fri, 30 Aug 2024 19:40: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 47UJeUt2090294; Fri, 30 Aug 2024 19:40:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UJeULZ090291; Fri, 30 Aug 2024 19:40:30 GMT (envelope-from git) Date: Fri, 30 Aug 2024 19:40:30 GMT Message-Id: <202408301940.47UJeULZ090291@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: 9a3fa77585e5 - main - vale(4): refer to the valectl(8) management tool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a3fa77585e55e78004cdc9467b986968a77e8de Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9a3fa77585e55e78004cdc9467b986968a77e8de commit 9a3fa77585e55e78004cdc9467b986968a77e8de Author: Tom Hukins AuthorDate: 2024-08-06 16:43:03 +0000 Commit: Mitchell Horne CommitDate: 2024-08-30 19:39:56 +0000 vale(4): refer to the valectl(8) management tool Signed-off-by: Tom Hukins Reviewed by: imp, mhorne MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1369 --- share/man/man4/vale.4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man4/vale.4 b/share/man/man4/vale.4 index 77e4433d2742..a9f172e11fba 100644 --- a/share/man/man4/vale.4 +++ b/share/man/man4/vale.4 @@ -26,7 +26,7 @@ .\" distributed with 4.3BSD Unix. .\" $Id: $ .\" -.Dd March 6, 2022 +.Dd August 30, 2024 .Dt VALE 4 .Os .Sh NAME @@ -100,7 +100,8 @@ qemu -net nic -net netmap,ifname=vale2:c ... & qemu -net nic -net netmap,ifname=vale2:d ... & .Ed .Sh SEE ALSO -.Xr netmap 4 +.Xr netmap 4 , +.Xr valectl 8 .Pp Luigi Rizzo, Giuseppe Lettieri: VALE, a switched ethernet for virtual machines, June 2012, http://info.iet.unipi.it/~luigi/vale/ From nobody Fri Aug 30 19:40:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwT5X4r4Pz5PZpr; Fri, 30 Aug 2024 19:40: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 4WwT5X2VRLz4Y5t; Fri, 30 Aug 2024 19:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725046832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qTLrnzbPN4/G4ffGEFQSUkBOvfVm3fjTgtJc3TkV+Mo=; b=nIgIEDXTru8YXuHiokDFU/TanVESA7dUMQNFxPw25za8LKO3QzZSOKrUFzpTTJGt182He0 KpACPOB/aeOreThC9YFyY5WEE+aRNONxrdOSw5TbDIGMpRilywj7n1jJQsph2gNBYdljAB VGkW4/ga/LTXDYqrsPECFsRULGOaepGX27jCWfKzOlo5IsN1v5E9rMOalfpTqF1M/lXnkX OUWf2ceOzamVa++QO/vjLYJdpCVqH4smEAWjjd9DetP46W1+kaOaP99t3XoyiNGX8zv+Fo l2XyQ/xjNxhTyIDpojllwnkg2+VU5pg8q4nRbOO3hkAawM4w4D6n90Gv+9wDhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725046832; a=rsa-sha256; cv=none; b=Hv66o0+azuB1IufufPmOEUDKg4HzsmNoG6Q87Z+VOEr5fqcycilABOkl6B3KkiVFeZwf+2 AdsHeBZLQdTSZoI6GwM+N61RoCAw5LIxQVTl0/nXeQBTNAn0jMC/dFsN6r7cbXSSfrp1zJ gsXe1gewU15GpU+Xu8U0tkJkAwbPMM7JPn5fGKnfLubHRxwJMvPVIU5+OLlF89HFIdmkGt 9GZI06Bfw5lmPqqlSGT5Ehk/EWKWPkpb9JQFCUCROduKQgZjsQXnGbto526VtKs9JDwUaQ azqZjIBb4bMy0F6OWTmdzHsEBXo4tAxhqks07b0xN29qellW+r/JCeeLIvZRLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725046832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qTLrnzbPN4/G4ffGEFQSUkBOvfVm3fjTgtJc3TkV+Mo=; b=AJIrH6FTHomyeM5aaMtR+5DzEu+3vMz7DWkqFT5F4Ff25yDlj4sgbDx2rnEhkUY+2nLCcd SVranZDfuvKptcxS/KwoNuAT+dYA6yURqtbfkxS2U4ZSkYAZvhPpXvkVNbXpAaxp5wwiRO Dl9F2G9Wn5o/yfYqd525Qp+LScR+EXYVTEjqOqPysWdy1PUpeUEy385p0X81YIgAPcV5rp EsX5vHCIZYRrEvrsF0G+hWnL0rhIu0x00Vb1MMNlxWwFEVrWIRWTd2XGjd94tX28CrKMe3 I+yPk1MfAek2GpXo5Ea9SnBZOP4GJp/20eBpDCx81dYbM34HiC+lyIzJwN0UWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwT5X1jXkz1CKg; Fri, 30 Aug 2024 19:40: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 47UJeWlx090336; Fri, 30 Aug 2024 19:40:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47UJeWlV090333; Fri, 30 Aug 2024 19:40:32 GMT (envelope-from git) Date: Fri, 30 Aug 2024 19:40:32 GMT Message-Id: <202408301940.47UJeWlV090333@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: a2f53837f0a8 - main - valectl(8): explicitly mention network switches List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2f53837f0a8934cfcf7ba3c1fdfc93f217d3703 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a2f53837f0a8934cfcf7ba3c1fdfc93f217d3703 commit a2f53837f0a8934cfcf7ba3c1fdfc93f217d3703 Author: Tom Hukins AuthorDate: 2024-08-06 16:44:00 +0000 Commit: Mitchell Horne CommitDate: 2024-08-30 19:39:56 +0000 valectl(8): explicitly mention network switches Use the term "network switch" instead of the ambiguous term "switch". Signed-off-by: Tom Hukins Reviewed by: imp, mhorne MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1369 --- usr.sbin/valectl/valectl.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/valectl/valectl.8 b/usr.sbin/valectl/valectl.8 index deb660bb0e4a..805d785f52cf 100644 --- a/usr.sbin/valectl/valectl.8 +++ b/usr.sbin/valectl/valectl.8 @@ -22,12 +22,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 2, 2021 +.Dd August 30, 2024 .Dt VALECTL 8 .Os .Sh NAME .Nm valectl -.Nd manage VALE switches provided by netmap +.Nd manage VALE network switches provided by netmap .Sh SYNOPSIS .Bk -words .Bl -tag -width "valectl" @@ -50,7 +50,7 @@ .Nm manages and inspects .Xr vale 4 -switches, for instance attaching and detaching interfaces, creating +network switches, for instance attaching and detaching interfaces, creating and deleting persistent VALE ports, or listing the existing switches and their ports. In the following, From nobody Fri Aug 30 19:45:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwTC62KS6z5PbKD; Fri, 30 Aug 2024 19:45:22 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WwTC61pM0z4ZD8; Fri, 30 Aug 2024 19:45:22 +0000 (UTC) (envelope-from mhorne@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725047122; h=from:from:reply-to:subject: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:autocrypt:autocrypt; bh=zPyCZX3Dg1ohRlsjGRYWKLUhFnjGSE6ldLM+/L0bSb4=; b=uYd/hC/GTFFkbCK9hdnv/kNljCzMQ1ptteLAjDJszfEVR+HCR1U4FqnhLaOsqBJ/GyMj07 x0JQEdbogACelf/wLES9xDWpDFDwhdATT8vDubbVxQ1sqsS1b3leV/Q0spf0uKwQL9UlDP kR7IZb4AIow92IRnO+dfeawYXp2VG1CS8wmF7nIx2Q2Q5TnZnJLXMI8OedP1w8XzCkQSdP MgdGWjjdT3NcTU52HU8LtOzEPjSO5dv5q4X+pC8dQ8dj31xkOKlEIm37jqhSBDdJRgUwAI Ha2iZMC79zY9ZxnLM4VfPd1jD1i6CVOhS4GrAkvFJuXnIR3gDlmgkGsh5rWu4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725047122; a=rsa-sha256; cv=none; b=fks3nKdxTuh6WANSMZ+I9yT2cWL9OeWCYiLi4Lnf7cTLOcD5OA77+y79O83IUcOcvIbyLw 9kuMd8haP8tO6vWB2oWXut/Rfd8W9FoRNGusCD5h79AOsKV6wptoE/QP0KxMjgIttEJX9G 5nv4t3ssSKNkWX37ZmYYGMlrgk0Za1yirGMm5HkMapxgyBH9Grd0RQ/EPAe5KsfOVQ1HIZ lWKG7qv/nhOXKpDmDHzkC86fQRb1M7JvD1A9U/mPvJygLiblN5bzQW5GDDvAWRndAi6pwt 8+RiIhrjJEeRLN/C0fn8q6jTLU//SspZxEAu7okO15T8cFrqXOK7OdD9hpYOtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725047122; h=from:from:reply-to:subject: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:autocrypt:autocrypt; bh=zPyCZX3Dg1ohRlsjGRYWKLUhFnjGSE6ldLM+/L0bSb4=; b=IQDegX5IPBCECOPyggBKEjMuOoALy0VfSBK5Cv99CVDma1n/37nR1NNEzEJbj0qNuteGLE u6MQ9/60Lt0BhOIVOccAZDUYtwM+1JN3G699McaRycQ7RBdS3fwAtLrzCtBqrs2CMjpbyM /ycNfG9SKvDyG2Ih2mdddmHL7P2Wfnf3dzDKnKQlpYqQHmUIcM2kCs0OBJ4wbChdMStrXC ykRZQ9p4FN1c36s+CVKNhU54ueGukYXW8y/7YrjQHZ1RpD0HzF4CHfkAXyMp/WK9FLc6tO nRG1J2+48rky0R2EGKp90c3FCZb9NiCc6KmnHCCDFS42RHK08zv0UC9E2nRzrg== Received: from [192.168.2.217] (hlfxns018gw-134-41-188-50.dhcp-dynamic.fibreop.ns.bellaliant.net [134.41.188.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WwTC60LFtz1DC5; Fri, 30 Aug 2024 19:45:21 +0000 (UTC) (envelope-from mhorne@freebsd.org) Message-ID: <0edd6b5b-1a21-4101-9046-10e4955cf433@freebsd.org> Date: Fri, 30 Aug 2024 16:45:14 -0300 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 38a08e45f194 - main - arm64: fix L1 pindex calculation in pmap_growkernel() From: Mitchell Horne To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202408301940.47UJeTkg090243@gitrepo.freebsd.org> Content-Language: en-CA Autocrypt: addr=mhorne@freebsd.org; keydata= xsBNBFyS2dQBCADdiXBG8hBVLmYbxu7aSzbwLwUf3HkGFz3rooS1kwyy+SfmjZ4UKNnl9WMx WKrJ7OAZpiNH6bLQ5nsqfx09OnpWL8c/QuPbhNdUywQoqqYpRI0K8GEn//nS9Gs0KTYwVpWb XlrzP+jf3Uh/9L5mcQmStLIH4zaaqMYHW+pMuPrvBmLIHTvLj2QjOkxslrcUdord9uvxe5Ht LU8RuTpQpHOKz705Z9/v7twFdi2HtKzpLwO6SzVyu351di1J+GihsVpcT5josQV5cHbIP3Un x+kmtKBEEc/jl/zBglF7ruWUtwgbryID+2ZPEaO1Mj+RResX4LFVMusq3uUpWRb5WJXxABEB AAHNI01pdGNoZWxsIEhvcm5lIDxtaG9ybmVARnJlZUJTRC5vcmc+wsCUBBMBCgA+AhsDBQsJ CAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEkp/cYPcfabAiQvACi/gnTOdUid8FAmIyDpUFCQtC z0EACgkQi/gnTOdUid8IsQf+N8IptrrCgifT5Z0/WUVFfnHThFOKf4zBjaGswsIM8+VKsKnF 15jCWHODUHP6s+dcQ4nQi81PHPsnMfBSkGPvN/X3ess2/1KUVkH+6tAJbqXDjXhD8HT+i0NM QEFIXlLnotpgIKW3yOHjKv3ZvKw9LCvUjyNY9vOJmLk/6AbbkFh+INo65nXtQWb/hM5FVEHW S+zUoU8AqZRJoVAQfj9wmIfg/HdsxeDGKL0zkv5AwKpccvb8VJNGJbCVMgoy5uQYcUeXxcie cg0VlbFLshNQTfyhVQ85vyuHahARrUWs/k8KiYODoBnW1ChtyF8yM6VZTzSYx7pINqPq2YZy i/Htd87ATQRcktnUAQgA3zt4M4ecoQqfxpjliNLujt9klDqvmkJvWmzMuMXdzlPgGRJ0doio 9YIeEdkOt6xN0pPTK/ReCZ8WqFQ8zo23u1pwGuo0CnR58XF19wyxyUuKu/PHbt+56mC8tNHm AXsMyXQmlDqWvn/WzLY7euNRtNS4QQIwtxfM5EC4GGa5KQwxn0kM7dkUSOE/cxr+/kNbHHzb gagZR4cnNUqtPPr3dYXcibCTzgz96Lyt3/qMLXX9RTBRzu+O6E+byxWOe8ar/ZlwY2b4wTQG mhgNttkSxKtxMpZnd8+DGV/bI1P5Ct/K2GeCwNyupQGON5ymn6o7jTch+qmFX0ItkBWO4zn4 9QARAQABwsB8BBgBCgAmAhsMFiEEkp/cYPcfabAiQvACi/gnTOdUid8FAmIyDtwFCQtCz4gA CgkQi/gnTOdUid/i5gf/aQ75pJR4TJFM2vVVr6PDIwTdl0b5EchB4w4s4g/zE84XNbMOQanb BginLYEhAacLQVAvM3XdvUEhwrhaMQdjdSEB1krResL3/mbxrtKwdHSMbHA3IS3XdvxFWTB7 P5JjUSPsW6hqgoidbn4w3OxaNHhs45H2b0Nx5QiKcSyepmCZuB52gCEHnEnrdaz8TFQMXOLq 94WbTmZeIjChW3FB61m1gTf0UEFjoZAfTAUB+pbwoCa4AykIeZnDC19vjsruVU9Gy5rLglwd bjsZNfXIJGOZNEvdF8FOBwM7DlXx7SYvTJcUNoNJjOKtQ0bYGVgGqYOB/y2mTjVuKeU0eOkN Uw== In-Reply-To: <202408301940.47UJeTkg090243@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/30/24 16:40, Mitchell Horne wrote: > The branch main has been updated by mhorne: > > URL: https://cgit.FreeBSD.org/src/commit/?id=38a08e45f19447717726de4d41bd161f966d29da > > commit 38a08e45f19447717726de4d41bd161f966d29da > Author: Mitchell Horne > AuthorDate: 2024-08-29 15:25:52 +0000 > Commit: Mitchell Horne > CommitDate: 2024-08-30 19:39:56 +0000 > > arm64: fix L1 pindex calculation in pmap_growkernel() > > Use the pmap_l1_pindex() macro which accounts for the NUL2E offset. > While here, use pmap_l2_pindex() macro further down (no change). > > Prompted by pull request and commit 2e33abc35460, making the change for > the riscv pmap. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46477 I pushed it slightly early by mistake, but the change is ready and so a revert seems silly. From nobody Sat Aug 31 01:55:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwdPc4fRQz5TKq7; Sat, 31 Aug 2024 01:55: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 4WwdPc46wFz4FDp; Sat, 31 Aug 2024 01:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PPNHY+V45BjC8WEOf1kSyXQfsYivTwHTUbVRpv9UJo=; b=pCqpkw1xeijRsiX/XEkKROLRnWPsfbPaZZTcwkBJhuFBO4YKpdX03dt1jZz6mvhKI9K51t /7va0ZhTNuO2BKRYDDRJ/bqnT96fQ6ciApG4ZCM5l3+iHIhc/z00po97lXQrLH/47w+Td2 gWRZEu2UROSM6fOl58ZMuVavbrS84S45kRkJyMwY3Aq/xU1cW6Ma6krZOuxsadbMo8PGTQ nb1j4y+gj62MilwDbXPrrQXSbhMKgODRElUcumGzkizIy6hbLhbxPHbSMDAmJ83LaGhxSW H348LKnw5kyMXgIun3T6rUM/A+Z+DEB3i/klEp8mu028+GIuIkRWMM9zZA+g1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725069300; a=rsa-sha256; cv=none; b=TXLaNzjTRyqaTB4JTGbnNrL6BJL9f/f57iPCmJNr3/Mwjl0J92LEG3yLCiHPBUm9XztMna XL7b9MAHFHp8FTlB8p2m+K1pwkHFW8vWQcJvtzj4Ue9vMZJfdIwFyV+4s4SCwdYtyQfPBa QkpiOpUVXrS+HqH7mmld8zTvyJ+Ai7+bbjsiBcozC4KOgTnsq3RkWM6hAnOofPRjBlB4H3 4v/MLMBrOZbIcg5mskaDsRex7NCH7HIpV4vzGreogv0wBHug4aagVQjTnotsrkFekqrvXp 7t0GqC7diSzG1rpbHNOpxbNtOyBmzZdK6eY01+kVUye8sTWTAoRxhTs2W5C0kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PPNHY+V45BjC8WEOf1kSyXQfsYivTwHTUbVRpv9UJo=; b=EMRyIYu34Vy1Bzip1YcmciPVyQ57T9Pq8fM64g/XVKxGwldMICLMfE1KS4FqqHUOvig5ei cSSz4qnCRqmudIZZRGaSvzurL5UmZDMQ5IeinYw/WR1zONbFmCKI782H3ddng9PoKZX9km Yd65HHa6bJHBOE1aTIRqvkt8x6J7gZgjdxrJxxTKwXeSErXeC0K2DNjFFLRBdyrFviA3/b Tb69B6gO2dS2oRlBLvWYcQa+hiVGacnK53PRdgBeJIU8VYEYNVt2sLAStRjSIQ0yI1fhlN smQQOEl1pO9se+jAI38KnNSHipWJyilv0Z5jtRVIYhNC9vVyiDMloUqncVwWWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwdPc3kLgzQZ8; Sat, 31 Aug 2024 01:55: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 47V1t0rE023731; Sat, 31 Aug 2024 01:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47V1t0db023728; Sat, 31 Aug 2024 01:55:00 GMT (envelope-from git) Date: Sat, 31 Aug 2024 01:55:00 GMT Message-Id: <202408310155.47V1t0db023728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: cfcf0db9097a - stable/14 - nfsproto.h: Define the new mode_umask attribute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cfcf0db9097aba82450bd79c40c08eb8251d4df7 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=cfcf0db9097aba82450bd79c40c08eb8251d4df7 commit cfcf0db9097aba82450bd79c40c08eb8251d4df7 Author: Rick Macklem AuthorDate: 2024-08-17 00:40:52 +0000 Commit: Rick Macklem CommitDate: 2024-08-31 01:53:55 +0000 nfsproto.h: Define the new mode_umask attribute RFC8275 defines a new attribute as an extension to NFSv4.2 called MODE_UMASK. This patch adds the attribute number to nfsproto.h. Future patches will add optional support for the attribute. This patch does not cause any semantics change. (cherry picked from commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d) --- sys/fs/nfs/nfsproto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index ca9c732b6a43..0268940fd8a6 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1004,7 +1004,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_SPACEFREED 78 #define NFSATTRBIT_CHANGEATTRTYPE 79 #define NFSATTRBIT_SECLABEL 80 -/* Not sure what attribute bit #81 is? */ +#define NFSATTRBIT_MODEUMASK 81 #define NFSATTRBIT_XATTRSUPPORT 82 #define NFSATTRBM_SUPPORTEDATTRS 0x00000001 @@ -1088,7 +1088,7 @@ struct nfsv3_sattr { #define NFSATTRBM_SPACEFREED 0x00004000 #define NFSATTRBM_CHANGEATTRTYPE 0x00008000 #define NFSATTRBM_SECLABEL 0x00010000 -/* Not sure what attribute bit#81/0x00020000 is? */ +#define NFSATTRBM_MODEUMASK 0x00020000 #define NFSATTRBM_XATTRSUPPORT 0x00040000 #define NFSATTRBIT_MAX 83 From nobody Sat Aug 31 02:03:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wwdbb0pjRz5TLZ5; Sat, 31 Aug 2024 02:03: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 4WwdbZ6z56z4G48; Sat, 31 Aug 2024 02:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfOm6DH1pVRwwJA7YoAvpyu2bEeKXxfuqkYZvzjmGoQ=; b=hplFi55V0xwMIgupLHmY/Bh1f2EMs1jdu6Pkx2QD7ux5tj5pF79B46yWHr+P7MusHbjdiF VqNLipRgweLPwOeAgX0XQ3YjbFq+6mR2zh2Y9ES16NiHpi4ZE8RpZpd0Nxi0ZYombE2QXX +4N0/imDmWtPp7NDBvpEoXfT7XxozOtRF85MnO4gHZITBbLGIWAnhrpcWQLKR/WykKDSls D/vIwosrMIj6MQBKZHl3BFaLGBoYSTcd3gZH9yJoJPraJIDMj7iwEPfIjojxbGB+/fZNga 0tzxpDo2K8262hNSb0mKObILmd8zaR4LBhV7tct2SM2kDSoxVaS4eRe0WSPn/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725069819; a=rsa-sha256; cv=none; b=Q8YJWmOO2jA9W3OWLeHzO0WZCZrBIl7HSf0goZTyyHbiumSu0SuN+l2z+f4oNsGqfIxw2T NAcmTnljs0VvXI9AD03jg5qwsxGroN4IJDwhIqFcYWkfYearK6xukfnUGO/Jmy2/HV+pSv u+z2Om+omrYHTWJt6qLM/u+BsF2CLdrKL6LnQep85BxhX4GqQJGWzpq/U61RHvVvEmIrk9 GSojt0p2x/I6vzSW9EKC99H3fP44Vl0b6XuTTlfBPO/iCLwaJDVHmxn8vwpI3ToEsBJpI5 n2FxzPDMnguStpnlmpwH0jfHM+H+DNdOHqKj3YSsi0j8Jr1y5G7wooB4wyVVlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725069819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfOm6DH1pVRwwJA7YoAvpyu2bEeKXxfuqkYZvzjmGoQ=; b=mWyjulFPkas1v8yxw7+YBre90hoEF3nFi8DUomkZkKxd+eGC580uIxuDBxFSzwFzlh8ljs B+b133NQLFMP6V3xBJikElsvMYnyI9UgXQ55vF/k+Y8XYEs9vVQyk4U20Uz9wvrHKwi9aj t9cy1f0+ADccP4O5+Wf8sGS3bKFmcrNh4QkFn8BTOw6EN2lJcCRTTh/aNhnz8Slj5I5I0g MPdSrVhX7FJyGqZDw2sTBAepRGMFa/hR8/Gg9Yn7pMhmmr1dvMN1i5dEJa22aaWzNa/vWz XFTEdM7SLrU9qnXB4ij7fVHfVjIFgEMKe/AgaqGInPCTFSmXTDZptLmvTRTnOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WwdbZ6TNrzQd6; Sat, 31 Aug 2024 02:03: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 47V23cTm041068; Sat, 31 Aug 2024 02:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47V23cxu041065; Sat, 31 Aug 2024 02:03:38 GMT (envelope-from git) Date: Sat, 31 Aug 2024 02:03:38 GMT Message-Id: <202408310203.47V23cxu041065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6bde10b638d1 - stable/13 - nfsproto.h: Define the new mode_umask attribute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6bde10b638d103f18b2ba08ea743f7999b0a9abe Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6bde10b638d103f18b2ba08ea743f7999b0a9abe commit 6bde10b638d103f18b2ba08ea743f7999b0a9abe Author: Rick Macklem AuthorDate: 2024-08-17 00:40:52 +0000 Commit: Rick Macklem CommitDate: 2024-08-31 02:02:57 +0000 nfsproto.h: Define the new mode_umask attribute RFC8275 defines a new attribute as an extension to NFSv4.2 called MODE_UMASK. This patch adds the attribute number to nfsproto.h. Future patches will add optional support for the attribute. This patch does not cause any semantics change. (cherry picked from commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d) --- sys/fs/nfs/nfsproto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index cf162dbf24e8..9c0569d97215 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1002,7 +1002,7 @@ struct nfsv3_sattr { #define NFSATTRBIT_SPACEFREED 78 #define NFSATTRBIT_CHANGEATTRTYPE 79 #define NFSATTRBIT_SECLABEL 80 -/* Not sure what attribute bit #81 is? */ +#define NFSATTRBIT_MODEUMASK 81 #define NFSATTRBIT_XATTRSUPPORT 82 #define NFSATTRBM_SUPPORTEDATTRS 0x00000001 @@ -1086,7 +1086,7 @@ struct nfsv3_sattr { #define NFSATTRBM_SPACEFREED 0x00004000 #define NFSATTRBM_CHANGEATTRTYPE 0x00008000 #define NFSATTRBM_SECLABEL 0x00010000 -/* Not sure what attribute bit#81/0x00020000 is? */ +#define NFSATTRBM_MODEUMASK 0x00020000 #define NFSATTRBM_XATTRSUPPORT 0x00040000 #define NFSATTRBIT_MAX 83 From nobody Sat Aug 31 15:56:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx04P216Rz5MbRC for ; Sat, 31 Aug 2024 15:56:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (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 4Wx04N4kzJz4Hms for ; Sat, 31 Aug 2024 15:56:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=BDHFiJf4; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::32b) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-70f5cd2fa39so1960705a34.0 for ; Sat, 31 Aug 2024 08:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1725119779; x=1725724579; 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=75fxV43JOTZiFhd8EWNGWULZ7A1AQ7/H3XkK710mKb8=; b=BDHFiJf4cG8oSqeqCoKLEax5gg1/KW21SjRhRF6ftIrMydhV3nKqAmVI+6lODMqFLk R/XkcJsGeQS/TdNX0fe7lZzxD5w8dY+/2oo+l+pvK9ozScffWHGXzC1seJ8SElV9abZc +6R65cdS9C4Nv9H39Cex/Kst14So+qHobgolkLpDpVqDag9ymJ2nNhoeAfHTEO/BO/DL xvmeNIdz9a3eUJwTVqlBu8/1iWz5xkFXzJDBjw8v+4Ht3so11gFIDrTD5OcHoUm3zdA3 iwLvBT2NTQfFaDTAX23cTVk7C8/w4tBYMjyHZM/XKh8EERwjUHYEPcyZmEkCbc0M40Rb Iujw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725119779; x=1725724579; 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=75fxV43JOTZiFhd8EWNGWULZ7A1AQ7/H3XkK710mKb8=; b=OofaZk6d734QfOLzH2KgZG6FANg51avj3AzTIM2zdHgZaZMujMFGLmZ4NvUuDb7IHh AFjTiS3VJZDDtTL+2wlB7YGJdcifXGqToJ4hzrsKjTQc+IWku8R3JnQxZT+khifL8ale 1Sl0CZA64lTp/38NuLuCEXhwn2Y6W7Tr6SgF/F7N+YOHzHsvpSGkjB5LtpuukR/KCoVV 0mn26Cox65pVfmD+uGffBs0uLPLCW7vfKp2cBDTIKiO7UCQsr00O6r3kpS3uT6oBi6w9 yFZ5HnNMoSJETUYKD1NgsBYDTMJ1d/BOoHgcXbWbjtVIPEzCHPcvRpOxVg/exnrfJkMa mBhw== X-Forwarded-Encrypted: i=1; AJvYcCUq87BY1VKHpjZjP314xdYaEp52UDvn75cfLQytE+z0HLWd/VOAfDKVkNRZ43DjxvMdonxpyCGq/GAz/vtIdaFfMHX+@freebsd.org X-Gm-Message-State: AOJu0YxzQVYm5UTKxZfPT9MJV76uPIq+k/FKV+AZqaSlBCC2XmOL5zTC gQ6dspGgw0QyrGnljV6m3C1Jt+aWBu+dj/NGIk0ZVMB7BWvc8aPVPW0kU8dvjTuQRvWAIealrot IP7wJ14Mocqhp4X0y9M2oViq7TTW/cAgOnVOYxQ== X-Google-Smtp-Source: AGHT+IGhwpuJ1BwH4balOklYTP5kKDDeCBu4LeVwT6EGB9UCvLKDtwpJJu6JtKdeJtLQ1H1LBsZjXsZnIARVpoLhjgk= X-Received: by 2002:a05:6358:7183:b0:1b5:fb78:fb9b with SMTP id e5c5f4694b2df-1b7ef691e7bmr334408155d.14.1725119778631; Sat, 31 Aug 2024 08:56:18 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202408200902.47K92BsJ078096@gitrepo.freebsd.org> <77cbcd47-1778-4e71-b824-4e75e0e4b2d6@FreeBSD.org> <19DBDC11-EB0F-48C0-9AAE-9EED087F0AB6@freebsd.org> <8a9faa7c-1f81-4aa8-adac-a6f07d7d73ff@FreeBSD.org> In-Reply-To: <8a9faa7c-1f81-4aa8-adac-a6f07d7d73ff@FreeBSD.org> From: Warner Losh Date: Sat, 31 Aug 2024 09:56:07 -0600 Message-ID: Subject: Re: git: 43e8849bc294 - main - conf: Enable BTI checking in the arm64 kernel To: John Baldwin Cc: Andrew Turner , Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000099ca480620fcbf30" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_SOME(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32b:from]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; R_SPF_NA(0.00)[no SPF record]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4Wx04N4kzJz4Hms --00000000000099ca480620fcbf30 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 30, 2024 at 9:35=E2=80=AFAM John Baldwin wrot= e: > On 8/30/24 04:55, Andrew Turner wrote: > > > > > >> On 29 Aug 2024, at 17:02, Jessica Clarke wrote: > >> > >> On 21 Aug 2024, at 15:28, John Baldwin wrote: > >>> > >>> On 8/20/24 05:02, Andrew Turner wrote: > >>>> The branch main has been updated by andrew: > >>>> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D43e8849bc29414036ccaef7788de95a= 07ad32ab5 > >>>> commit 43e8849bc29414036ccaef7788de95a07ad32ab5 > >>>> Author: Andrew Turner > >>>> AuthorDate: 2024-08-19 12:59:49 +0000 > >>>> Commit: Andrew Turner > >>>> CommitDate: 2024-08-20 08:49:15 +0000 > >>>> conf: Enable BTI checking in the arm64 kernel > >>>> To ensure new code has BTI support make it an error to not > have the > >>>> BTI ELF note when linking the kernel and kernel modules. > >>>> Reviewed by: kib, emaste > >>>> Sponsored by: Arm Ltd > >>>> Differential Revision: https://reviews.freebsd.org/D45469 > >>> > >>> This has broken two of the GitHub CI actions using clang 12 and clang > 13. > >>> Please fix this to be conditional on a supported linker version (or > perhaps > >>> add a new linker feature to bsd.linker.mk). > >> > >> This is still broken. If it=E2=80=99s not fixed promptly I will just r= evert > >> this change; we can=E2=80=99t leave CI broken, especially when it gets= used to > >> test GitHub PRs. Please stop breaking building with older toolchains, > >> this isn=E2=80=99t the first time it=E2=80=99s happened. > > > > See https://github.com/freebsd/freebsd-src/pull/1393 and > https://github.com/freebsd/freebsd-src/pull/1399 > > I do think we probably want to flesh out a bit more what kind of policy > we want for the range of compiler versions to support. E.g. in the GDB > project the policy is something like "will not use a version of C++ newer > than a compiler from 10 years ago" (IIRC). There they will also look bac= k > to whatever LTS distros are active and what is the newest compiler that > can be installed on those LTS via the equivalent of ports. > QEMU does similar things. > Traditionally we used to only support compiling FreeBSD N on FreeBSD N-1 > (though we have often supported older versions of FreeBSD). However, we > now also support cross-compiling from Linux and macOS, so we probably wan= t > to widen the support base a bit. I would say a first stab perhaps is tha= t > main and any supported stable and release branches should be buildable on > a host running any of those versions. That is, FreeBSD 13 is still > supported so we should keep main building on it directly without requirin= g > a jump to FreeBSD 14 first. Once 13 EOLs then we can stop supporting 13, > and that would gives folks on 13 a way to step up to the supported versio= n > of 14 at the time of the EOL. That said, presuambly fairly recent versio= ns > of LLVM (and GCC for that matter) will be available in ports for supporte= d > versions, so that doesn't necessarily require a very wide range of > supported > compiler versions. Supporting the "native" compiler on those releases > would be a nice goal that I think is probably achievable with minimal > effort. > Recent history has been such that all supported branches can jump to head. It's been more like N-2 or N-3 (12 -> head still works last I tried it, but it's likely to break at any random llvm import and we've had once since I (accidentally) tried it). In general, it's good policy if we can do it. In the earlier days of the project, there was considerably more API churn that required more compatibility shim= s than we need these days. It's usually just a matter of having a new enough C++ compiler for the latest language features used by llvm. I think the last breakage I looked into was like that (11 didn't have a new enough llvm for 14-current). As you note, we have ports/pkgs that can do that, but only if we keep the older recently not supported branches final packages around... Also to clarify one point: It's only the last supported release on the stable branch or newer that can jump to -current, not any point since the branch (though it often works, we dropped that effort some time ago when its main champion moved on from contributing to the FreeBSD project). I think stable-11 got a 'final' llvm update late in the branche's life because we hadn't had a release in too long, but I may be misremembering. But having said all that, I agree: this isn't going to widen things all that much. Today our oldest supported release is 14.0 which shipped with clang 16, and > 13.3 shipped with clang 17. Both of those are quite a bit newer than > clang 12 > that is current oldest version in CI. I have no idea what version range > might be sensible for Linux and macOS. Presumably we'd want to settle on > some range of ubuntu LTS versions and whatever is the newest version you > can > install on the oldest LTS as the minimum. > > clang 12 might have been used in 13.1 (not mentioned in the release notes= , > 13.0 used clang 11, 13.2 used clang 14) and 12.3 (12.4 used clang 13, > 12.2 used clang 10, 12.3 didn't mention it). > That gets back to the question of 'tip of the branch' or 'from the branch point'. I think that we should require only tip of branch (so we don't gate using new compiler features in head for something we shipped in 13.0), but encourage people to put the API compat shims into the build library for a wider range (since they will likely also be needed for Linux/MacOS too, independent of compiler version). > I know CHERI LLVM is still on LLVM 15 (though moving to LLVM 16 soon, but > Morello LLVM is 14 still I think). libc++ is also making this more > complicated as they are providing very little compatability at all. > They've > already ripped out support for GCC 14 I believe, so you can't build curre= nt > libc++ with a released version of GCC or something crazy. > Upstream will, perhaps sadly, drive a lot of our policy in this area. When upstream de-orbits support for something, it's hard for us to keep maintaining it and keep updating to upstream without some kind of compelling need. Though I recently spend a fair amount of time coming up with a fairly minimal tweak to our cdefs.h that makes it more compatible with the crazy things that libc++ does to still support compiling older C++ standards. Which brings up another possible issue. We don't support building FreeBSD, itself, with anything but a fairly up-to-date wrt standards compiler. However, we support building binaries from sources that compile with C89 and newer, and C++98 and newer (though really this is likely C++11 for most things, given the upstream de-orbiting of support for older standard binaries). We may need to carefully call this out as well... The older C++ standards don't matter too much (most of the C++ plorts actually want the newer C++), but there's still a lot of packages that compile with a strict C89 feature set that break in subtle ways when we break support for that... Warner --00000000000099ca480620fcbf30 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Aug 30, 2024 at 9:35=E2=80=AF= AM John Baldwin <jhb@freebsd.org&= gt; wrote:
On 8/= 30/24 04:55, Andrew Turner wrote:
>
>
>> On 29 Aug 2024, at 17:02, Jessica Clarke <jrtc27@freebsd.org> wrote:
>>
>> On 21 Aug 2024, at 15:28, John Baldwin <jhb@FreeBSD.org> wro= te:
>>>
>>> On 8/20/24 05:02, Andrew Turner wrote:
>>>> The branch main has been updated by andrew:
>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D43e8849bc29414036ccaef7788de9= 5a07ad32ab5
>>>> commit 43e8849bc29414036ccaef7788de95a07ad32ab5
>>>> Author:=C2=A0 =C2=A0 =C2=A0Andrew Turner <andrew@FreeBS= D.org>
>>>> AuthorDate: 2024-08-19 12:59:49 +0000
>>>> Commit:=C2=A0 =C2=A0 =C2=A0Andrew Turner <andrew@FreeBS= D.org>
>>>> CommitDate: 2024-08-20 08:49:15 +0000
>>>>=C2=A0 =C2=A0 =C2=A0conf: Enable BTI checking in the arm64 = kernel
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 To ensure new code has B= TI support make it an error to not have the
>>>>=C2=A0 =C2=A0 =C2=A0BTI ELF note when linking the kernel an= d kernel modules.
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2= =A0 kib, emaste
>>>>=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Arm Ltd
>>>>=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 h= ttps://reviews.freebsd.org/D45469
>>>
>>> This has broken two of the GitHub CI actions using clang 12 an= d clang 13.
>>> Please fix this to be conditional on a supported linker versio= n (or perhaps
>>> add a new linker feature to bsd.linker.mk).
>>
>> This is still broken. If it=E2=80=99s not fixed promptly I will ju= st revert
>> this change; we can=E2=80=99t leave CI broken, especially when it = gets used to
>> test GitHub PRs. Please stop breaking building with older toolchai= ns,
>> this isn=E2=80=99t the first time it=E2=80=99s happened.
>
> See https://github.com/freebsd/freebsd-src/pu= ll/1393 and https://github.com/freebsd/freebsd-s= rc/pull/1399

I do think we probably want to flesh out a bit more what kind of policy
we want for the range of compiler versions to support.=C2=A0 E.g. in the GD= B
project the policy is something like "will not use a version of C++ ne= wer
than a compiler from 10 years ago" (IIRC).=C2=A0 There they will also = look back
to whatever LTS distros are active and what is the newest compiler that
can be installed on those LTS via the equivalent of ports.
=

QEMU does similar things.
=C2=A0
Traditionally we used to only support compiling FreeBSD N on FreeBSD N-1 (though we have often supported older versions of FreeBSD).=C2=A0 However, = we
now also support cross-compiling from Linux and macOS, so we probably want<= br> to widen the support base a bit.=C2=A0 I would say a first stab perhaps is = that
main and any supported stable and release branches should be buildable on a host running any of those versions.=C2=A0 That is, FreeBSD 13 is still supported so we should keep main building on it directly without requiring<= br> a jump to FreeBSD 14 first.=C2=A0 Once 13 EOLs then we can stop supporting = 13,
and that would gives folks on 13 a way to step up to the supported version<= br> of 14 at the time of the EOL.=C2=A0 That said, presuambly fairly recent ver= sions
of LLVM (and GCC for that matter) will be available in ports for supported<= br> versions, so that doesn't necessarily require a very wide range of supp= orted
compiler versions.=C2=A0 Supporting the "native" compiler on thos= e releases
would be a nice goal that I think is probably achievable with minimal
effort.

Recent history has been such th= at all supported branches can jump to head. It's
been more li= ke N-2 or N-3 (12 -> head still works last I tried it, but it's like= ly to
break at any random llvm import and we've had once sinc= e I (accidentally) tried
it). In general, it's good policy if= we can do it. In the earlier days of the project,
there was cons= iderably more API churn that required more compatibility shims
th= an we need these days. It's usually just a matter of having a new enoug= h C++
compiler for the latest language features used by llvm. I t= hink the last breakage
I looked into was like that (11 didn't= have a new enough llvm for 14-current). As
you note, we have por= ts/pkgs that can do that, but only if we keep the older recently
= not supported branches final packages around...=C2=A0=C2=A0

<= /div>
Also to clarify one point: It's only the last supported relea= se on the stable branch or newer
that can jump to -current, not a= ny point since the branch (though it often works, we
dropped that= effort some time ago when its main champion moved on from contributing
to the FreeBSD project). I think stable-11 got a 'final' llv= m update late in the branche's
life because we hadn't had= a release in too long, but I may be misremembering.

But having said all that, I agree: this isn't going to widen things = all that much.

Today our oldest supported release is 14.0 which shipped with cl= ang 16, and
13.3 shipped with clang 17.=C2=A0 Both of those are quite a bit newer than = clang 12
that is current oldest version in CI.=C2=A0 I have no idea what version ran= ge
might be sensible for Linux and macOS.=C2=A0 Presumably we'd want to se= ttle on
some range of ubuntu LTS versions and whatever is the newest version you ca= n
install on the oldest LTS as the minimum.

clang 12 might have been used in 13.1 (not mentioned in the release notes,<= br> 13.0 used clang 11, 13.2 used clang 14) and 12.3 (12.4 used clang 13,
12.2 used clang 10, 12.3 didn't mention it).

<= /div>
That gets back to the question of 'tip of the branch' or = 'from the branch point'. I think
that we should require o= nly tip of branch (so we don't gate using new compiler features
in head for something we shipped in 13.0), but encourage people to put t= he API compat
shims into the build library for a wider range (sin= ce they will likely also be needed for
Linux/MacOS too, independe= nt of compiler version).
=C2=A0
I know CHERI LLVM is still on LLVM 15 (though moving to LLVM 16 soon, but Morello LLVM is 14 still I think).=C2=A0 libc++ is also making this more complicated as they are providing very little compatability at all.=C2=A0 T= hey've
already ripped out support for GCC 14 I believe, so you can't build cur= rent
libc++ with a released version of GCC or something crazy.
<= div>
Upstream will, perhaps sadly, drive a lot of our policy = in this area. When upstream de-orbits
support for something, it&#= 39;s hard for us to keep maintaining it and keep updating to upstream
=
without some kind of compelling need. Though I recently spend a fair a= mount of time coming
up with a fairly minimal tweak to our cdefs.= h that makes it more compatible with the crazy things
that libc++= does to still support compiling older C++ standards.

<= div>Which brings up another possible issue. We don't support building F= reeBSD, itself, with anything
but a fairly up-to-date wrt standar= ds compiler. However, we support building binaries from sources
t= hat compile with C89 and newer, and C++98 and newer (though really this is = likely C++11 for most
things, given the upstream de-orbiting of s= upport for older standard binaries). We may need to carefully
cal= l this out as well... The older C++ standards don't matter too much (mo= st of the C++ plorts actually
want the newer C++), but there'= s still a lot of packages that compile with a strict C89 feature set
<= div>that break in subtle ways when we break support for that...
<= br>
Warner=C2=A0
--00000000000099ca480620fcbf30-- From nobody Sat Aug 31 16:19:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx0Zj3PpTz5Mcyw; Sat, 31 Aug 2024 16:19: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 4Wx0Zj2v4Fz4LFk; Sat, 31 Aug 2024 16:19:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iifHXfU6bPhSNdm/J2q11KPKMckK8gDiI56Yp0Aa8eQ=; b=SEl7dwX2X4H4WRlLWJ0jvq76W3/S3+CCszLZ86s3d47t1S11LtUu/on6L0Qvv7KOQl+Xy2 kuJog0K3l9T4vum/YKeKvLDsgOzciKG7VGB1iSTGDk2UQloYQr0xFsSwQQeU6ZyVuyt+2z R0trRhqsES+Ip5uVtdVOiEyjvDdRHaGBt7X4p2WwfHLW27kN/NMmnNCKA+fxII1nH5GDNh j36TJhRM6jQXOXI29DUo0cE/6GyVVyFu/mH50Mhza/gu3X5Qmm0v/KLNKb4Hk8cvCQbx9m xuohJheMkiv8WH1YdoSd+/DvJIuwGflZytELmyqvoyKI3k8AG2etR+phJ4Nicw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725121149; a=rsa-sha256; cv=none; b=YzCbd+PvEbeGTHbz/An0o42QP1DFX3weCCwOv2C+yQMhC7LreqJ83dbXte5ELVSjeN4d8e bUn0Ucl9lV+jUipfoHGzMkrSwUWzjm5wjZn4p8QPzPhekKCB1vY8HSMgiFpU1gT4gHkn3W edqsM/HO/gWToyqZHSQEtRiw69gLPrEmqKoDGHt08p9BdS/pc/1aGNhl9hFIBPUjjsqK9r KX1rjMlHeyyg6H3jljcAWDNzwW7Y6pniYbX5oznYu97fCWVZvtfY/jQwxnfaytbz8y4Sop evboNWz88sD8GTb1hNWRKOHOAnlxEuwLSlilQ90GbVqxG0YC1gjiqpERLB2nww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iifHXfU6bPhSNdm/J2q11KPKMckK8gDiI56Yp0Aa8eQ=; b=qmoaGYQSJn4DOidAxRjwV30AeM1umi4u6KhEzLu43/e73mVMdyNSy9b+I/f2xH2nfXdoV7 gy71Js/7uEnJGl8l/p3N20pT+bupxMrzxwX3Ko1SnvcWxiaQISbASeO6pwWSh2LYI/sEHW FtXSKE036FJ33/T037zVwxqXxBlipHdSaMWH+dySQv2PkzA+a/+8E1r+BKp73kYZpxTH/Z tDsh4Y5UbQLTOGWls2gRdQBTEZfwVLs8JlWcIS22RQ314OhvFJe5UaNHt7RGGNfR6D8bTk 9PjeuTKK9DCO5z69q5sZc+cG+IiWNHn4awxhoFkNMLlQxiSmtZN15CROTwfsaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx0Zj2LmRzs5d; Sat, 31 Aug 2024 16:19: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 47VGJ9ZA081107; Sat, 31 Aug 2024 16:19:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VGJ9Ve081104; Sat, 31 Aug 2024 16:19:09 GMT (envelope-from git) Date: Sat, 31 Aug 2024 16:19:09 GMT Message-Id: <202408311619.47VGJ9Ve081104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 5a542a605537 - stable/14 - release: Redirect etcupdate logfile to /dev/null. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5a542a60553780b51fdd822af1d9aba53707fc29 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=5a542a60553780b51fdd822af1d9aba53707fc29 commit 5a542a60553780b51fdd822af1d9aba53707fc29 Author: Gordon Tetlow AuthorDate: 2024-08-24 05:35:07 +0000 Commit: Gordon Tetlow CommitDate: 2024-08-31 16:17:55 +0000 release: Redirect etcupdate logfile to /dev/null. Stop shipping a log file for etcupdate. This is a source of non-reproducability as it uses mktemp thereby guaranteeing the output is different each run. Differential Revision: https://reviews.freebsd.org/D46317 (cherry picked from commit e972e408d19a58c4f2855eface487d06ef73b799) --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index 32e59a1a5c90..9ca32e168fe7 100644 --- a/release/Makefile +++ b/release/Makefile @@ -129,7 +129,7 @@ base.txz: sh ${WORLDDIR}/usr.sbin/etcupdate/etcupdate.sh extract -B \ -m "${MAKE}" -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" \ - ${NO_ROOT:D-N} + -L /dev/null ${NO_ROOT:D-N} .if defined(NO_ROOT) echo "./var/db/etcupdate type=dir uname=root gname=wheel mode=0755" >> ${.OBJDIR}/${DISTDIR}/base.meta sed -n 's,^\.,./var/db/etcupdate/current,p' ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG \ From nobody Sat Aug 31 16:19:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx0Zv1sk1z5McwV; Sat, 31 Aug 2024 16:19: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 4Wx0Zv1L2nz4LXl; Sat, 31 Aug 2024 16:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmGCUcFk4wPeY8KayP1/Ti8BXPUpTZ3RhnbiYj7s61g=; b=POLg61x6cUhFTTDw1T1YH+NYLEcpjyd46Lth7XaA2mZd5R8g2J6tAljNoNhRifbbLz4HK/ 8VOP4/e0Ku6HJgJgqM82I3KdZFX/a/pSKPZ7J7B+9Sfn/rIZrg8KZ+c+Nph+8SC54sIHuh EG3n9mmd7sElNuggy1QVNHsi7xlqRI7SvdrKPbSqdPLKtQ/9w25RitVY5eYkFuHQSQ8KrI U6WaH5nk9onIRCwcxNsc8xJmDN1lCcoaOrtZqlfHeELyE3QZMXYeJfPHTPolOO952UDtc6 OzEkxA9yRJOaqSwwea1a58hD72Vdu0Nux+qLCtCHjb0jUUmosvfXXU83SjKQbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725121159; a=rsa-sha256; cv=none; b=hC2+trvm2hXqT4k9D38J4Z4SOn90fhbZ9Do/SBlfuVBvGlO9kgr3Pfn7NGM54uSZ2QI7d5 RZ0vP7Evw6sIJcOj/6fnXargogRNcI/tDMP36SJH07UYdqEI7hSgaJ0Ci4M2U8mEeL6OM6 kLKi/CF0NsHaY4Wy5ShNIBq+qZBxF+5ARbDXfUIcZpbDDiJ8WEA2KR8ilGqkDHTzPYKsb0 RfSFCjMpt0T4NWP+4G0ukNd67/YpiMQb8UYpaEIMhYmNTy55nxnuDJjkWmiEFgUVrWeNlp XQbjy2JsOjXvhl1yGR+MrDRoOq24hlsLc/Al1QnB2FXvJiYQL3mOVvvrvfg0cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmGCUcFk4wPeY8KayP1/Ti8BXPUpTZ3RhnbiYj7s61g=; b=Jo8aEI8VL4bSKnTKCTWY0qfrc3jZvH86Ku+N0939XtgaVR9OjokcwfsYa1fuodH+rAwl+N BBJASGG5iKxsT98PX4jm32prOCMSo06j5v+Wwhq4h1L0kaYOXjY2xSti3Sdn2wqih2oXWu lB2EYJXVSJEDXgLo8+G7r+1HlFgmRnPslSiTdcf2XYljceIaw+t+l7AG5PRKWZZZQmV4LY fwFnCk05clr6B3+UJRPSTRYe7Ot+ZXgPP1Zo3FTZNgIMZzm4Pcd5u3E3+lqqc5WAywP4J5 KqIBrpo9+lHqH5p7DswCM3ETlyqodbsy49sqQDNxkX6orYuvGmBnNz6PAh2jiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx0Zv0NR4zrW3; Sat, 31 Aug 2024 16:19: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 47VGJIOO081265; Sat, 31 Aug 2024 16:19:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VGJInb081262; Sat, 31 Aug 2024 16:19:18 GMT (envelope-from git) Date: Sat, 31 Aug 2024 16:19:18 GMT Message-Id: <202408311619.47VGJInb081262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: b8abafb4de41 - stable/13 - release: Redirect etcupdate logfile to /dev/null. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b8abafb4de419dd063d4da1e049b87652c847af6 Auto-Submitted: auto-generated The branch stable/13 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=b8abafb4de419dd063d4da1e049b87652c847af6 commit b8abafb4de419dd063d4da1e049b87652c847af6 Author: Gordon Tetlow AuthorDate: 2024-08-24 05:35:07 +0000 Commit: Gordon Tetlow CommitDate: 2024-08-31 16:18:49 +0000 release: Redirect etcupdate logfile to /dev/null. Stop shipping a log file for etcupdate. This is a source of non-reproducability as it uses mktemp thereby guaranteeing the output is different each run. Differential Revision: https://reviews.freebsd.org/D46317 (cherry picked from commit e972e408d19a58c4f2855eface487d06ef73b799) --- release/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index 55d82a0d0f5e..9feb4d170a41 100644 --- a/release/Makefile +++ b/release/Makefile @@ -122,7 +122,7 @@ base.txz: "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} ${.MAKE.JOBS:D-j${.MAKE.JOBS}}" \ -D "${.OBJDIR}/${DISTDIR}/base" etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ - -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" + -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" -L /dev/null # Package all components cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} mv ${DISTDIR}/*.txz . From nobody Sat Aug 31 16:28:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx0mx5CFPz5MdRS; Sat, 31 Aug 2024 16:28: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 4Wx0mx4l0Vz4MPp; Sat, 31 Aug 2024 16:28:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AqUHjULbNLLZCaGh0LBx1zTk+RRtcxPQaHppajR7lRY=; b=wAWXVj88vrDlJa+CHHX3bJg3Ta6/8nyw5hla368j43OOGXZWflLBMzD6mBCNqT22Do6+Ok 5aSfIO6nxAHaA6t6lgNSX1IMg3nuAvMxh2PFfBSDLzysMYhY3CDZU2E8BSQc3mxzsv5bpw yiYcXHkxAmo+VwE6ngfwAxnGVTUvlQ4QPFCz+UwtTCqlwxxypqXCNs9iomd2DEz+4g9eJu UpK/LhG2CREhh+WwD5qpInn1bTHccvoimWUniQF2mPoDkLgEOkoYHijqsUH20GALaOEeAu yDzGKFMkHOTvxnYi+c3GPRi0JyQi0g1v1R2x8s3JV488h9bVHk9+qLhpNGY0yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725121681; a=rsa-sha256; cv=none; b=MES0MlS68maaJWBkBH9xrbBY+8Ie3a/gANuP1as3Vr4rTsyEUY3q4PE3Ykde4nE3ylf+sK THR7IZMyClAwmxJhC97KfTuAyQ0iZCpWQ9Kg4Mva90gyLzW0uq1iZX+fvn6/ZZo9CH19PC VmFBuyJcorquf1UqRq9hFngxx/3cVJa4ePUF9ji1axGJw8g6kLRyyW1YztwPDSgc8HPTYZ 7r3iQusfQlVctEAXUvRCqOKYR2ehBpi+8Ln9VXhnWOl5V7rc+zS9LHdKf07d4RFa0cZ5Xd guCX4/BepaH9KRP/EWVu+K/82CyIxnrD1UuDc0WNeDfE0W0Ywst/OOx+WuDMLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725121681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AqUHjULbNLLZCaGh0LBx1zTk+RRtcxPQaHppajR7lRY=; b=g+MqELDm63rs6bhk0pm4rMfBEYYpECWFHAx3cM9fuJundPshJ8QREgtuFuAnsqIIyGhg7W 8g4dgdmrXLPScxdXyr7C/RoD3sYFonq4Rh/jAOxTh4hlIui6YBUu9VblzVZ+1ukPqpzfUK p19fl5ZoWRkQucJqUfCqb8O3KIOKACYCVAe9prcJl9/mJ4WYjRkEovSBqR1E/YwNc9HTwg nnz8zjjcLSckwnh9KTTNW5guaBmzG4+rVIvHGWD03fR8gpKsHwgRbrnM7PiFGri4sXb1cl UZAECN7PEtzrtZDHUMtNIoqebfkePO5vDJS4lKbRiNg5dyWhoOXW0xylGM5WWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx0mx4LKkzrSP; Sat, 31 Aug 2024 16:28: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 47VGS1nV098075; Sat, 31 Aug 2024 16:28:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VGS1UW098072; Sat, 31 Aug 2024 16:28:01 GMT (envelope-from git) Date: Sat, 31 Aug 2024 16:28:01 GMT Message-Id: <202408311628.47VGS1UW098072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: 86dd740dd73a - main - openssl: Remove fips module from base system. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86dd740dd73aa88477ff450b2359abda1ad68534 Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=86dd740dd73aa88477ff450b2359abda1ad68534 commit 86dd740dd73aa88477ff450b2359abda1ad68534 Author: Gordon Tetlow AuthorDate: 2024-08-04 21:10:46 +0000 Commit: Gordon Tetlow CommitDate: 2024-08-31 16:24:30 +0000 openssl: Remove fips module from base system. To comply with FIPS 140 guidance, you must be using a specifically validated and approved version of the fips module. Currently, only OpenSSL 3.0.8 and 3.0.9 have been approved by NIST for FIPS 140 validation. As such, we need to stop shipping later versions of the module in the base system. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46223 --- ObsoleteFiles.inc | 3 + secure/lib/libcrypto/modules/Makefile | 2 +- secure/lib/libcrypto/modules/fips/Makefile | 340 ----------------------------- 3 files changed, 4 insertions(+), 341 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 5ce960fdca82..fe1eb89f1c9c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240827: retire fips.so +OLD_LIBS+=usr/lib/ossl-modules/fips.so + # 20240824: sound examples: midi.c moved out of oss/ OLD_FILES+=share/examples/sound/oss/midi.c diff --git a/secure/lib/libcrypto/modules/Makefile b/secure/lib/libcrypto/modules/Makefile index 0e01eb3b8ef2..69a8470ff20b 100644 --- a/secure/lib/libcrypto/modules/Makefile +++ b/secure/lib/libcrypto/modules/Makefile @@ -1,4 +1,4 @@ -SUBDIR= fips legacy +SUBDIR= legacy SUBDIR_PARALLEL= .include diff --git a/secure/lib/libcrypto/modules/fips/Makefile b/secure/lib/libcrypto/modules/fips/Makefile deleted file mode 100644 index 0f4889f3ff81..000000000000 --- a/secure/lib/libcrypto/modules/fips/Makefile +++ /dev/null @@ -1,340 +0,0 @@ -SHLIB_NAME?= fips.so - -CFLAGS+= -DFIPS_MODULE - -SRCS+= fips_entry.c fipsprov.c self_test.c self_test_kats.c - -.include "../../Makefile.common" - -# crypto -SRCS+= provider_core.c provider_predefined.c \ - core_fetch.c core_algorithm.c core_namemap.c self_test_core.c - -SRCS+= cpuid.c ctype.c -.if defined(ASM_aarch64) -SRCS+= arm64cpuid.S armcap.c -ACFLAGS.arm64cpuid.S= -march=armv8-a+crypto -.elif defined(ASM_amd64) -SRCS+= x86_64cpuid.S -.elif defined(ASM_arm) -SRCS+= armv4cpuid.S armcap.c -.elif defined(ASM_i386) -SRCS+= x86cpuid.S -.elif defined(ASM_powerpc) -SRCS+= ppccpuid.S ppccap.c -.elif defined(ASM_powerpc64) -SRCS+= ppccpuid.S ppccap.c -.elif defined(ASM_powerpc64le) -SRCS+= ppccpuid.S ppccap.c -.else -SRCS+= mem_clr.c -.endif - -# crypto/aes -SRCS+= aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c -.if defined(ASM_aarch64) -SRCS+= aes_cbc.c aes_core.c aesv8-armx.S vpaes-armv8.S -ACFLAGS.aesv8-armx.S= -march=armv8-a+crypto -.elif defined(ASM_amd64) -SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S -SRCS+= aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S -.elif defined(ASM_arm) -SRCS+= aes_cbc.c aes-armv4.S aesv8-armx.S bsaes-armv7.S -.elif defined(ASM_i386) -SRCS+= aes-586.S aesni-x86.S vpaes-x86.S -.elif defined(ASM_powerpc) -SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S -.elif defined(ASM_powerpc64) -SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S -.elif defined(ASM_powerpc64le) -SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S -.else -SRCS+= aes_cbc.c aes_core.c -.endif - -# crypto/bn -SRCS+= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \ - bn_mod.c bn_conv.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ - bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_sqr.c \ - bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ - bn_intern.c bn_dh.c bn_rsa_fips186_4.c bn_const.c -.if defined(ASM_aarch64) -SRCS+= armv8-mont.S bn_asm.c -.elif defined(ASM_amd64) -SRCS+= rsaz-avx2.S rsaz-avx512.S rsaz-x86_64.S rsaz_exp.c rsaz_exp_x2.c -SRCS+= x86_64-gcc.c x86_64-gf2m.S x86_64-mont.S x86_64-mont5.S -.elif defined(ASM_arm) -SRCS+= armv4-gf2m.S armv4-mont.S bn_asm.c -.elif defined(ASM_i386) -SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S -.elif defined(ASM_powerpc) -SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S -.elif defined(ASM_powerpc64) -SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S -.elif defined(ASM_powerpc64le) -SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S -.else -SRCS+= bn_asm.c -.endif - -# crypto/buffer -SRCS+= buffer.c - -# crypto/cmac -SRCS+= cmac.c - -# crypto/des -SRCS+= set_key.c ecb3_enc.c -.if defined(ASM_i386) -SRCS+= crypt586.S des-586.S -.else -SRCS+= des_enc.c fcrypt_b.c -.endif - -# crypto/dh -SRCS+= dh_lib.c dh_key.c dh_group_params.c dh_check.c dh_backend.c dh_gen.c \ - dh_kdf.c - -# crypto/dsa -SRCS+= dsa_sign.c dsa_vrf.c dsa_lib.c dsa_ossl.c dsa_check.c \ - dsa_key.c dsa_backend.c dsa_gen.c - -# crypto/ec -SRCS+= ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c \ - ec_curve.c ec_check.c ec_key.c ec_kmeth.c ecx_key.c ec_asn1.c \ - ec2_smpl.c \ - ecp_oct.c ec2_oct.c ec_oct.c ecdh_ossl.c \ - ecdsa_ossl.c ecdsa_sign.c ecdsa_vrf.c curve25519.c \ - curve448/f_generic.c curve448/scalar.c \ - curve448/curve448_tables.c curve448/eddsa.c curve448/curve448.c \ - ec_backend.c ecx_backend.c ecdh_kdf.c curve448/arch_64/f_impl64.c \ - curve448/arch_32/f_impl32.c -SRCS+= cryptlib.c params.c params_from_text.c bsearch.c ex_data.c o_str.c \ - threads_pthread.c threads_none.c initthread.c \ - context.c sparse_array.c asn1_dsa.c packet.c param_build.c \ - param_build_set.c der_writer.c threads_lib.c params_dup.c - -.include -.if ${MACHINE_ABI:Mlittle-endian} && ${MACHINE_ABI:Mlong64} -SRCS+= ecp_nistp224.c ecp_nistp256.c ecp_nistp521.c ecp_nistputil.c -.endif -.if defined(ASM_aarch64) -SRCS+= ecp_nistz256-armv8.S ecp_nistz256.c -.elif defined(ASM_amd64) -SRCS+= ecp_nistz256-x86_64.S ecp_nistz256.c x25519-x86_64.S -.elif defined(ASM_arm) -SRCS+= ecp_nistz256-armv4.S ecp_nistz256.c -.elif defined(ASM_i386) -SRCS+= ecp_nistz256-x86.S ecp_nistz256.c -.elif defined(ASM_powerpc64) -SRCS+= ecp_nistp521-ppc64.S ecp_nistz256-ppc64.S ecp_nistz256.c ecp_ppc.c x25519-ppc64.S -.elif defined(ASM_powerpc64le) -SRCS+= ecp_nistp521-ppc64.S ecp_nistz256-ppc64.S ecp_nistz256.c ecp_ppc.c x25519-ppc64.S -.endif - -# crypto/evp -SRCS+= digest.c evp_enc.c evp_lib.c evp_fetch.c evp_utils.c \ - mac_lib.c mac_meth.c keymgmt_meth.c keymgmt_lib.c kdf_lib.c kdf_meth.c \ - m_sigver.c pmeth_lib.c signature.c p_lib.c pmeth_gn.c exchange.c \ - evp_rand.c asymcipher.c kem.c dh_support.c ec_support.c pmeth_check.c - -# crypto/ffc -SRCS+= ffc_params.c ffc_params_generate.c ffc_key_generate.c \ - ffc_params_validate.c ffc_key_validate.c ffc_backend.c \ - ffc_dh.c - -# crypto/hmac -SRCS+= hmac.c - -# crypto/lhash -SRCS+= lhash.c - -# crypto/modes -SRCS+= cbc128.c ctr128.c cfb128.c ofb128.c gcm128.c ccm128.c xts128.c -SRCS+= wrap128.c -.if defined(ASM_aarch64) -SRCS+= ghashv8-armx.S aes-gcm-armv8_64.S -ACFLAGS.ghashv8-armx.S= -march=armv8-a+crypto -.elif defined(ASM_amd64) -SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S -.elif defined(ASM_arm) -SRCS+= ghash-armv4.S ghashv8-armx.S -.elif defined(ASM_i386) -SRCS+= ghash-x86.S -.elif defined(ASM_powerpc) -SRCS+= ghashp8-ppc.S -.elif defined(ASM_powerpc64) -SRCS+= ghashp8-ppc.S -.elif defined(ASM_powerpc64le) -SRCS+= ghashp8-ppc.S -.endif - -# crypto/property -SRCS+= property_string.c property_parse.c property_query.c property.c defn_cache.c - -# crypto/rand -SRCS+= rand_lib.c - -# crypto/rsa -SRCS+= rsa_ossl.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_pk1.c \ - rsa_none.c rsa_oaep.c rsa_chk.c rsa_pss.c rsa_x931.c rsa_crpt.c \ - rsa_sp800_56b_gen.c rsa_sp800_56b_check.c rsa_backend.c \ - rsa_mp_names.c rsa_schemes.c -SRCS+= rsa_acvp_test_params.c - -# crypto/sha -SRCS+= sha1dgst.c sha256.c sha512.c sha3.c -.if defined(ASM_aarch64) -SRCS+= keccak1600-armv8.S sha1-armv8.S sha256-armv8.S sha512-armv8.S -.elif defined(ASM_amd64) -SRCS+= keccak1600-x86_64.S sha1-mb-x86_64.S sha1-x86_64.S -SRCS+= sha256-mb-x86_64.S sha256-x86_64.S sha512-x86_64.S -.elif defined(ASM_arm) -SRCS+= keccak1600-armv4.S sha1-armv4-large.S sha256-armv4.S sha512-armv4.S -.elif defined(ASM_i386) -SRCS+= keccak1600.c sha1-586.S sha256-586.S sha512-586.S -.elif defined(ASM_powerpc) -SRCS+= keccak1600.c sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S -.elif defined(ASM_powerpc64) -SRCS+= keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S -.elif defined(ASM_powerpc64le) -SRCS+= keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S -.else -SRCS+= keccak1600.c -.endif - -# crypto/stack -SRCS+= stack.c - -# common -SRCS+= capabilities.c bio_prov.c digest_to_nid.c \ - securitycheck.c provider_seeding.c -SRCS+= securitycheck_fips.c - -# common/der -SRCS+= der_rsa_gen.c der_rsa_key.c -SRCS+= der_rsa_sig.c - -SRCS+= der_dsa_gen.c der_dsa_key.c -SRCS+= der_dsa_sig.c - -SRCS+= der_ec_gen.c der_ec_key.c -SRCS+= der_ec_sig.c - -SRCS+= der_ecx_gen.c der_ecx_key.c - -SRCS+= der_wrap_gen.c - -# asymciphers -SRCS+= rsa_enc.c - -# ciphers -SRCS+= ciphercommon.c ciphercommon_hw.c ciphercommon_block.c \ - ciphercommon_gcm.c ciphercommon_gcm_hw.c \ - ciphercommon_ccm.c ciphercommon_ccm_hw.c -SRCS+= cipher_aes.c cipher_aes_hw.c \ - cipher_aes_xts.c cipher_aes_xts_hw.c \ - cipher_aes_gcm.c cipher_aes_gcm_hw.c \ - cipher_aes_ccm.c cipher_aes_ccm_hw.c \ - cipher_aes_wrp.c \ - cipher_aes_cbc_hmac_sha.c \ - cipher_aes_cbc_hmac_sha256_hw.c cipher_aes_cbc_hmac_sha1_hw.c \ - cipher_cts.c -SRCS+= cipher_aes_xts_fips.c -SRCS+= cipher_tdes.c cipher_tdes_common.c cipher_tdes_hw.c - -# digests -SRCS+= digestcommon.c -SRCS+= sha2_prov.c -SRCS+= sha3_prov.c - -# exchange -SRCS+= dh_exch.c -SRCS+= ecx_exch.c -SRCS+= ecdh_exch.c -SRCS+= kdf_exch.c - -# kdfs -SRCS+= tls1_prf.c -SRCS+= hkdf.c -SRCS+= kbkdf.c -SRCS+= pbkdf2.c -SRCS+= pbkdf2_fips.c -SRCS+= sskdf.c -SRCS+= sshkdf.c -SRCS+= x942kdf.c - -# kem -SRCS+= rsa_kem.c - -# keymgmt -SRCS+= dh_kmgmt.c -SRCS+= dsa_kmgmt.c -SRCS+= ec_kmgmt.c -SRCS+= ecx_kmgmt.c -SRCS+= kdf_legacy_kmgmt.c -SRCS+= mac_legacy_kmgmt.c -SRCS+= rsa_kmgmt.c - -# macs -SRCS+= gmac_prov.c -SRCS+= hmac_prov.c -SRCS+= kmac_prov.c -SRCS+= cmac_prov.c - -# rands -SRCS+= drbg.c test_rng.c drbg_ctr.c drbg_hash.c drbg_hmac.c crngt.c - -# signature -SRCS+= dsa_sig.c -SRCS+= eddsa_sig.c ecdsa_sig.c -SRCS+= mac_legacy_sig.c -SRCS+= rsa_sig.c - -# ssl -SRCS+= record/tls_pad.c s3_cbc.c - -.include - -.if defined(ASM_${MACHINE_CPUARCH}) -.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} -.if defined(ASM_amd64) -.PATH: ${LCRYPTO_SRC}/crypto/bn/asm -.endif -.elif defined(ASM_${MACHINE_ARCH}) -.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_ARCH} -.endif - -.PATH: ${LCRYPTO_SRC}/crypto \ - ${LCRYPTO_SRC}/crypto/aes \ - ${LCRYPTO_SRC}/crypto/bio \ - ${LCRYPTO_SRC}/crypto/bn \ - ${LCRYPTO_SRC}/crypto/buffer \ - ${LCRYPTO_SRC}/crypto/cmac \ - ${LCRYPTO_SRC}/crypto/des \ - ${LCRYPTO_SRC}/crypto/dh \ - ${LCRYPTO_SRC}/crypto/dsa \ - ${LCRYPTO_SRC}/crypto/ec \ - ${LCRYPTO_SRC}/crypto/evp \ - ${LCRYPTO_SRC}/crypto/ffc \ - ${LCRYPTO_SRC}/crypto/hmac \ - ${LCRYPTO_SRC}/crypto/lhash \ - ${LCRYPTO_SRC}/crypto/modes \ - ${LCRYPTO_SRC}/crypto/property \ - ${LCRYPTO_SRC}/crypto/rand \ - ${LCRYPTO_SRC}/crypto/rsa \ - ${LCRYPTO_SRC}/crypto/sha \ - ${LCRYPTO_SRC}/crypto/stack \ - ${LCRYPTO_SRC}/providers/fips \ - ${LCRYPTO_SRC}/providers/common/der \ - ${LCRYPTO_SRC}/providers/implementations/asymciphers \ - ${LCRYPTO_SRC}/providers/implementations/ciphers \ - ${LCRYPTO_SRC}/providers/implementations/digests \ - ${LCRYPTO_SRC}/providers/implementations/exchange \ - ${LCRYPTO_SRC}/providers/implementations/kdfs \ - ${LCRYPTO_SRC}/providers/implementations/kem \ - ${LCRYPTO_SRC}/providers/implementations/keymgmt \ - ${LCRYPTO_SRC}/providers/implementations/macs \ - ${LCRYPTO_SRC}/providers/implementations/rands \ - ${LCRYPTO_SRC}/providers/implementations/signature \ - ${LCRYPTO_SRC}/ssl From nobody Sat Aug 31 16:37:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx0zS3NnDz5Mfmt; Sat, 31 Aug 2024 16:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wx0zS2rgzz4NRV; Sat, 31 Aug 2024 16:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725122228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HhxxyuA2mJ/R1AME8EH/STGrj9sXMtuYcRSdho3GcD8=; b=gF73m8OZJkJiw+NB7PS1/BUYUVu0o8Z1UWWoG4GXNzVu5PWZXZb5rRVakiAdbG2CQ2OUUL 3ISxD2BIWxV++MqIE8oZg9ouHSh1cidtJ/wDnVH1XO5vqQnUZmEFl96MJoz3Wd5f41uKOo OKdQsjCUJWQh1oWQ85tvdeMCBz4u8xlM01gXaEnGKRRaxyXjxJdX5BC2iR8H3Z4DDKYDAd ANYZU+yJXL++dDXc2FnDj4oma/JPddwSCG+zkKX3bEqIxifINjJcb4USwVAapyNzS61H2x 665hqAWX+1ML5SzCJmxkSAYCC3LPWBAkdXYegCkCdGkSyHt4YRi5uerWrWcbig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725122228; a=rsa-sha256; cv=none; b=KLPUO+P7uz1ZGHLU4lTfR44YjBoaIIV/XqR79pHV875F3uWzgzIvuel9ViuByEVn7H67Io ROv1NHy980VtKTcXnfbLjmpTVciryCRMX15ChANyKS3ZDUp3ucCwCZDRqA4MB2GW1JQ5HC A1okX/TkL+Cns7kYQgSo1kKhck0j+VEB2p+IvvAHHyUNc5WIVskBiJ309wQn05JVQqcBkB rjJeK4wxiZRgMbSALjD73dN7QnqP56YK02Jjjs1a+QzZhh0w0lPdSi9DA1eOyZorPttgF/ wzWNOhR0O1F+UHt/OwsniNycqWtPUq/6/oJxVzjVo/fzAf3lnZC3SR2XkT+uQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725122228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HhxxyuA2mJ/R1AME8EH/STGrj9sXMtuYcRSdho3GcD8=; b=KzSUTaf2Wc0TRHeOcG2z5BHctvSUnua0VyKd88YXRrOgo4cwgqs722VW+Zy+pGivzbPu/k Ub787OlOhnOg3RmO4n5sfRGMxruAmcDtQDQDov20lkAalyDr2oNfa6jKfVjUu4cn61KKmz hAoNJh4Dqtbl+v6hGOYp8JH8IXp/nss9ZYpRWsDrYIrd2NpnIjHS5zCpk7MXLMQSRdpZBY 7atYEK88EVrKFcIBZbUVJyHCYWC/r3pDCZbt9VU4iEepsICUNIUOOtzyGTu3gjgiPSJ6Xs qogi9gNMXOlAcMYTgt6KoShZlMSFuC27IKoWS7gM/F7CzWXJytv4CTSB+Z5KiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx0zS2HHVzslL; Sat, 31 Aug 2024 16:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47VGb8HM015319; Sat, 31 Aug 2024 16:37:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VGb8J9015316; Sat, 31 Aug 2024 16:37:08 GMT (envelope-from git) Date: Sat, 31 Aug 2024 16:37:08 GMT Message-Id: <202408311637.47VGb8J9015316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e9a30c90d31e - main - ObsoleteFiles.inc: Fix examples path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9a30c90d31ea86e30d06abcd91fdbd8065cf7f6 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e9a30c90d31ea86e30d06abcd91fdbd8065cf7f6 commit e9a30c90d31ea86e30d06abcd91fdbd8065cf7f6 Author: Christos Margiolis AuthorDate: 2024-08-31 16:35:07 +0000 Commit: Christos Margiolis CommitDate: 2024-08-31 16:35:07 +0000 ObsoleteFiles.inc: Fix examples path Fixes: c3516c6533a1 ("ObsoleteFiles.inc: Update after sound changes") Sponsored by: The FreeBSD Foundation --- ObsoleteFiles.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index fe1eb89f1c9c..29cfdc05a3d3 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -55,14 +55,14 @@ OLD_LIBS+=usr/lib/ossl-modules/fips.so # 20240824: sound examples: midi.c moved out of oss/ -OLD_FILES+=share/examples/sound/oss/midi.c +OLD_FILES+=usr/share/examples/sound/oss/midi.c # 20240824: sound examples: Remove ossinit.h and rename basic.c to audio.c -OLD_FILES+=share/examples/sound/oss/ossinit.h -OLD_FILES+=share/examples/sound/oss/basic.c +OLD_FILES+=usr/share/examples/sound/oss/ossinit.h +OLD_FILES+=usr/share/examples/sound/oss/basic.c # 20240824: sound examples: Remove ossmidi.h -OLD_FILES+=share/examples/sound/oss/ossmidi.h +OLD_FILES+=usr/share/examples/sound/oss/ossmidi.h # 20240729: rename quick_exit_test to libc_exit_test OLD_FILES+=usr/tests/lib/libc/stdlib/quick_exit_test From nobody Sat Aug 31 17:54:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wx2jB42mFz5MmtX; Sat, 31 Aug 2024 17:54: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 4Wx2jB3SF2z4Tl6; Sat, 31 Aug 2024 17:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725126894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CebOoF3PTOEhy2ZETWGjgbSJ9k+YdfebdaASSjKYa48=; b=mVTtbASTMSuBYLHHovpirwKzSTP+YERXQ5aoqZJ30qYySKBsXaMLJQvMCane/7IsCInsaz hTduea3c+Zk9LfV5+Akhn5Y5MdDBfV1AssFeKDAmOjM8u+oIg5y8bOI7dIZnIkLDoHs4P1 PqPymy/lWIF1dWUE03TOesEn57ZV0QU1wxxny0dvDYaApfhiweJgAqjqqKdA0jqh1BXe2M rLpDPBTY0SWAMU+tk9ubKxu9M4a+VMadCeut5V5YjgLp+MLdVr/r8VGyIHxynDFVi4Bzk/ z+myq0aKGkDyI2dULkjY/u4FDKuBP4xcmREiBuBlCTWiZliu8ab/eDiJIv+RFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725126894; a=rsa-sha256; cv=none; b=rLM+lLLMnxFkXNjK4g2aAxdlUTIu7cJ7h5wi/nTQVGk+zUlsuBXa249lGQrocPkYJ/5y+2 0JR8gcgK5eluzy1AhpqsSZDUbwgAPovpOMmGgQpcBj0chKf8z57+hiY81s8KM2jGlA3px3 llfRH949HQH6bt0jRt+WKbk7mF3oxodzR1EoheD49m4SkpswvdmoMQKGMfNN09bT3FCKVy JRgm7/FmAZUiabqNZfGzNhcfyeZsd9QC8xEgXsCF9MgKFZ/ovBhwJkXWz1gVJO4NdWmfwP E/Vfy+CGSs0zI2/6DNRAygdQxm0vDbfiNyw+DZbuH0c44PapOrHzaDb/ZWDKyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725126894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CebOoF3PTOEhy2ZETWGjgbSJ9k+YdfebdaASSjKYa48=; b=eri+2UfRvVGdArCQ1Gh7fObrL+hn6BI7PJFmoyfziI5Va3zJzXDZ0VgedkdLE4CGOIqfjZ FWJKcG2gk4/K9+WVrLXOEVDWHcBnvFLpHt0hNEXe5wFFKNDoMLBRrquUmco4jYvPE4Fyk9 KKHdprEoY1PBqC/6ogBh+WmLDSZrb3z2oJ4Rq8QI/j8DXo+lRr972hkrvu1yYYS9uDoEJz ayskyI0B3CgI8ty7UECA2aC1YaYtVw3thSWtpLEPhmZUkIodVOrz/2DqYaweo254Ufo2Xh uZviAfldE631o8u/LyGbgLWDVHIr0GnQipQguIGTinnpYCD4VBYVJtfsWD1KPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wx2jB33NczvLM; Sat, 31 Aug 2024 17:54: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 47VHss3A049802; Sat, 31 Aug 2024 17:54:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47VHssg0049799; Sat, 31 Aug 2024 17:54:54 GMT (envelope-from git) Date: Sat, 31 Aug 2024 17:54:54 GMT Message-Id: <202408311754.47VHssg0049799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: d7c87526b1c3 - main - tpm: Register TPM as entropy source List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7c87526b1c3d32d3ac3fee8c59d92405b7621b9 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=d7c87526b1c3d32d3ac3fee8c59d92405b7621b9 commit d7c87526b1c3d32d3ac3fee8c59d92405b7621b9 Author: Jean-François Hren AuthorDate: 2024-08-31 17:53:02 +0000 Commit: Kevin Bowling CommitDate: 2024-08-31 17:53:02 +0000 tpm: Register TPM as entropy source TPM is defined as an entropy and is called every 10 seconds. However it was not registered and calls were discarded. Signed-off-by: Jean-François Hren MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1398 --- sys/dev/tpm/tpm20.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c index 80f7d9e105a6..876dd0bcc40d 100644 --- a/sys/dev/tpm/tpm20.c +++ b/sys/dev/tpm/tpm20.c @@ -206,6 +206,7 @@ tpm20_init(struct tpm_sc *sc) tpm20_release(sc); #ifdef TPM_HARVEST + random_harvest_register_source(RANDOM_PURE_TPM); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->harvest_task, 0, tpm20_harvest, sc); taskqueue_enqueue_timeout(taskqueue_thread, &sc->harvest_task, 0); @@ -222,6 +223,7 @@ tpm20_release(struct tpm_sc *sc) #ifdef TPM_HARVEST if (device_is_attached(sc->dev)) taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task); + random_harvest_deregister_source(RANDOM_PURE_TPM); #endif if (sc->buf != NULL) From nobody Sun Sep 1 00:55:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD2145dyz5MQsg; Sun, 01 Sep 2024 00:55: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 4WxD213fXPz49hL; Sun, 1 Sep 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S7GN5bMPB/mN51SQMxFngxvsVeGqAcn6uxI4C+ofqp4=; b=jPA2okdMCh+yIeKj5M2W5TTvwZQ34sZH1hbsGAUZYv9uIUixliA/ynvmdAMnr7yQrrKZ6Z pf1U7pnNjc/5wMVMXGqmiBwIINw2OL7kuNFdThMiQprGbks66FBOL4aZ+xBwWA+j4YSCck 5fYqEZrqyuIheQINpM1MeWbCJPAoHI+ramFusOl/7SYMhCl4YkH42OKlVtHoftRY7znbpe rSOicCfP/rBC7YvC5kSPJoqcp+kvSZn6ChphtOtq48fj94MznGpu2vrYVL+ADsuu9Q0aZ3 fHp94kDS8dYwWMWo0EpdabaolzG4Uo1ANmvOkym2UTKtpUrhqqU/N7+w9OuNWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152105; a=rsa-sha256; cv=none; b=yNXSKcQr9lc4v7pYbLyLx98xCxbiKL6DCAHOw2gbr/PKIjUeTeR7Thda1obowLeNQZ6eYR QEVKOPP7XU+ijQ0xkNBJij0j1c4Sbuze6ChexAuXNWlCHp4A639Jx1t3wUoIwP8lwwZOM8 VVRchbzai3n0pXxuhl6BKxcZOR8L2ZMlNmHiIhjoApwxgpAL9o7BzY85pcwGnmjP//i7co j4afVXWUUdF5jl3LdiQhogrDU46vR/pnhKaU/cchP5ZUJTidLHiBvuV7g2p2r4pbk/NT3x kk+Vul0MLO4G+WKkCD6H22RNENFimHlkK76E0DhdMw5Bn8UbRfqOfEf5Gr6ESA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S7GN5bMPB/mN51SQMxFngxvsVeGqAcn6uxI4C+ofqp4=; b=fP+A6cg4GQCyflKIIQ6WICAHdiiqBAR/KksXGJRBwNY2rMIUprwP3ogF/ddszKO8j/cKPP fNuUDYyBg1CL3aG3AV1rqZuU46/Y/Xu54U3J+ecQWLAcVhF3KPXK3hsfrmFNZ8dR4XAP+u N8eFWF7rkOu23MOcdyKaSzybBSPS/2FAr9gsYJSxCdZq3QnfO1PxlfYXBLVEmQ9DY+2qLr 9KA/vGTLrrHJFlGMVirnTTjzP9rfs2xuSXB6PYAOPHrYUMaipXe3xNKC+AyVzqLKqsLm4l VBSDJ1dkvwzh9Kx9qhE2BnZJgYgei8hFHiL/JTEByaGlOpsb9l/VMOU2V3Ymkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD2137d7z16PX; Sun, 1 Sep 2024 00:55: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 4810t55i059286; Sun, 1 Sep 2024 00:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t5au059283; Sun, 1 Sep 2024 00:55:05 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:05 GMT Message-Id: <202409010055.4810t5au059283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 65ae1d493e31 - stable/14 - msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 65ae1d493e314f5270cc92315cea0bb2e1afa3b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=65ae1d493e314f5270cc92315cea0bb2e1afa3b0 commit 65ae1d493e314f5270cc92315cea0bb2e1afa3b0 Author: Jose Luis Duran AuthorDate: 2024-08-25 14:50:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE PR: 281033 (cherry picked from commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880) --- sys/fs/msdosfs/msdosfs_lookup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 2a90339d0878..e799a5ce05f6 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -198,7 +198,9 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname switch (unix2dosfn((const u_char *)cnp->cn_nameptr, dosfilename, cnp->cn_namelen, 0, pmp)) { case 0: - return (EINVAL); + if (nameiop == CREATE || nameiop == RENAME) + return (EINVAL); + return (ENOENT); case 1: break; case 2: From nobody Sun Sep 1 00:55:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD2251R4z5TbZ2; Sun, 01 Sep 2024 00:55: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 4WxD223z1wz49kp; Sun, 1 Sep 2024 00:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PFAJso0qInRbkCXRc/x0VjZoIlh7+amwVQgXCEPN4Ms=; b=VnK+zFZiqVZ/7Ba+qbZCARRpTeWVx0HgJm69WsB+mLLKwjOC89mcArEhmWjipTbtUESVOj YbOc+sNU4UaPe72MFTvP6OxCabawvfUBiSg6+ZhfYUnB/q+oHR70RrrcY+FIUT3Qb6tekk VWZ4Yr61prextYtGQGjg1kEmOrVtUuZbJB1hFt/A7gnb7OKm7RDfyhTr4HQE963SyfdhWa PjL/xdG45T83P5uFpDAtoSYPxcBqflik48vkcqNqRp5zfjTuiW24lfw4mrPBf34QruDgCf 5g9hp6lsLDC7bbHAMEP9TKX1+VTKRsf+LLx71UPllKc1+5jqWs5m6JPNQcAZag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152106; a=rsa-sha256; cv=none; b=kf+zly2JW352jEkrH0nvkYoyb5JH981NeQ42iEZ9rjC/UJzlbvbJWFYJZQfPW7wnhATcmT 1JkqA6D9kRCBeMksQaug2Ap1TB7pmTPR5sy9hGJifjgV/WEKoHpmSA/Ei/pDHn9w33H6+B Wxla7Ai+44diXNvlDQupCuj+qly5Q50vLLaGH2imYR2Z3JDmH+V9v7GLwZagxQgJ/F4/iB YJzYrN3620baa9gbp+NdFrJDfB0Y9xhEgvhIRc6Alvr6wXT2uwxpreijDnEpJpLg8wqmqU sYZyhqMeOOxMYYaOSlMsNRXsrA096TupqCsF69Ulg1HaS1Dt8TI1Ws/HxiBypg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PFAJso0qInRbkCXRc/x0VjZoIlh7+amwVQgXCEPN4Ms=; b=ZrFa6i3ne9KQhlF4LqkgzJL+AfNJlserCkpzLlXZIntRiwXnYKMI3eoQIWyb6wqVYhSTnu Xr0dFsrRkUz7JzsCwQWH24ePPhvSOfL00vHgcxqkz0/V0zGgkkO6LfNreR7OCEENYkbmTj IQO7E5j2AuKD47Yi8uxK17gOJXEFiaEdxHq4mzovuyp5SZsetIIo6EdLNDhyy9a1g59E/+ soOg+aA5EkaDB3gPC4QxpRp8Aeng6jhX9KGVsWCZqhuLMFeRpsqptyvIWJZyoao/aGVwvi w0oHrglSjzwoavoirWQXx/Riri3HFnXYKJe7vZfXFfVFUSXQooy3/jrynLHVIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD223b2nz16h4; Sun, 1 Sep 2024 00:55: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 4810t657059326; Sun, 1 Sep 2024 00:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t6lD059323; Sun, 1 Sep 2024 00:55:06 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:06 GMT Message-Id: <202409010055.4810t6lD059323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f968e0819ddc - stable/14 - open(2): mandoc -T lint List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f968e0819ddc3b26537d046304472877ff4849c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f968e0819ddc3b26537d046304472877ff4849c1 commit f968e0819ddc3b26537d046304472877ff4849c1 Author: Jose Luis Duran AuthorDate: 2024-08-27 03:48:09 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 open(2): mandoc -T lint (cherry picked from commit f5a37f8dd319e3007b126b77376e61ad96f44d8b) --- lib/libc/sys/open.2 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index aac3ef1318f8..220561cc5683 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -252,7 +252,7 @@ controlling terminal when it opens a tty device. This is the default on .Fx , but is present for -.Tn POSIX +POSIX compatibility. The .Fn open @@ -265,7 +265,7 @@ initially opening a TTY. This is the default on .Fx , but is present for -.Tn POSIX +POSIX compatibility. The initial call to .Fn open @@ -487,7 +487,7 @@ The system file table is full. .It Bq Er EMLINK .Dv O_NOFOLLOW was specified and the target is a symbolic link. -.Tn POSIX +POSIX specifies a different error for this case; see the note in .Sx STANDARDS below. @@ -661,7 +661,7 @@ to .Er EMLINK instead of .Er ELOOP as specified by -.Tn POSIX +POSIX when .Dv O_NOFOLLOW is set in flags and the final component of pathname is a symbolic link @@ -679,7 +679,10 @@ permits searches. The present implementation of the .Fa openat system call is believed to be compatible with -.St -p1003.1-2017 , +.\" .St -p1003.1-2017 , +.\" XXX: This should be replaced in the future when an appropriate argument to +.\" the St macro is available: -p1003.1-2017 +.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) , which specifies that behavior for .Dv O_SEARCH , in the absence of the flag the implementation checks the current From nobody Sun Sep 1 00:55:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD236gjtz5MQwC; Sun, 01 Sep 2024 00:55: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 4WxD234twtz49ks; Sun, 1 Sep 2024 00:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Re/44g5+k3PS9OM3d1tDN64A4umzzdKLKOZo/PH0GCA=; b=oWSY02wOxI/jT7beqcG64t11sWwkqO1gxK4akIc/cLn25KVMJHfJ6iyCiBQDhLorgYJocy eG15nnUD++xSDphnGFIwO4NDLuytvxWxIIf83H7YxVLQoFu0i+t3LgTNGD0nibia0/jR3t hBGqBGhNdO5FVgrm7EaaYuNQPOtm63EzF3snlbNvBtEkmTCprJb81f1nHhJnLFRxzBkE5o /Gi3jPqiTs8KsaBNBbktMmhINCKkGAvz9sxruGnHBJ+ReoVInAE5/SKUtlGDLB59F9PFIB dbirqi+xjeiPJE5fH3v+Dop1ZaW9Id8JGCLLejmbbpI4lrTaGQjLPTxYnTn3yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152107; a=rsa-sha256; cv=none; b=ubcIzsZMgzlXxfYnQcpqrw/P85mgdKLZZVoxf3y56zKWfuKnGOIwZHCnsjQsgD6K1iTrgX OgH1W0DQnJ9zDytJpT4T62KnzR4emNCjzxxloIA6aVKDDmrdyaoS9CKL3buxY+AvwujnW2 K29DJoBm7it3StAoCwvclBIOjGJtPUSHeTfn8+4+AgSNOSjfxol4+tbYQJMKKh1MNR3OFV bRBQEeqrhL01TlkLSOsW1ym7RUjAXgkiLHYrjBvDwaFlNPLUiZ3wMxt0NO+FFQpw8lB5q2 YaZ4fX9boZ4L2pTVrnSW7Wmpl+Bs/cGCiPq4apUXn/zeozh594xzUt9C0ReGdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Re/44g5+k3PS9OM3d1tDN64A4umzzdKLKOZo/PH0GCA=; b=KsM9qNIoVuSrUrqmpMfzNdDEGfmHfiCO+ioYc1yV1GU49uqCUe7plwTbdT3JcsJCryfuGY NywwFZy+rF0FNXtIy8Wu6cN8JPPctfgtlMAXgWd2WjDJ1jHN7GZDqZYEbtf4dae+MwOt9d /+CiLySegcr1VmG94Hajikey47zKMQVldsqP0pr0AVrb7MmLT3miVsHFZ9Gfb0QKJFr+M/ +BOVKYw7yQF4AhtujOlGNLY+Mj0BeQDNmmYhqVrItrIiJ0hQkf08190VJJY1iK0b6OdaGO mQ/X/Y8doPt2o5PeN1dW2JJNRoKGH/4IGXBVzK9cCrrztcoqV111sFiwKbCziA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD234WHgz16v0; Sun, 1 Sep 2024 00:55: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 4810t71X059374; Sun, 1 Sep 2024 00:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t7n4059371; Sun, 1 Sep 2024 00:55:07 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:07 GMT Message-Id: <202409010055.4810t7n4059371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 97ccb41979bf - stable/14 - rename(2): Extend EINVAL's description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 97ccb41979bfee6d5bf35886b310e6c9bc7e8eed Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=97ccb41979bfee6d5bf35886b310e6c9bc7e8eed commit 97ccb41979bfee6d5bf35886b310e6c9bc7e8eed Author: Jose Luis Duran AuthorDate: 2024-08-26 01:32:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 rename(2): Extend EINVAL's description PR: 281033 (cherry picked from commit 33f58ac0795b2b02593ad0a8bf8a1ea24c1dc5e1) --- lib/libc/sys/rename.2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/rename.2 b/lib/libc/sys/rename.2 index 2b68274e4a8e..4faba81ff509 100644 --- a/lib/libc/sys/rename.2 +++ b/lib/libc/sys/rename.2 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)rename.2 8.1 (Berkeley) 6/4/93 -.\" -.Dd March 30, 2020 +.Dd August 25, 2024 .Dt RENAME 2 .Os .Sh NAME @@ -257,6 +255,10 @@ or an attempt is made to rename .Ql .\& or .Ql \&.. . +.It Bq Er EINVAL +The last component of the +.Fa to +path is invalid on the target file system. .It Bq Er ENOTEMPTY The .Fa to From nobody Sun Sep 1 00:55:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxD250D7Vz5MQt5; Sun, 01 Sep 2024 00:55: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 4WxD245xG9z49nG; Sun, 1 Sep 2024 00:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6QZti04r7UlX/LmBD4Bn07rSNZDbbR7gVmL2xJiiio=; b=crC+xfFPEsybZon3c7bmJYQK+p8nGw++L2gyjDlwuOX3MCrJOG+nZFlV6ZHkxWd3mkREEz YKXFNqlvrDmi/SJefR6x2pBFLiS9YC6FaInR8yYn/Je2at2X3RoNejROBmQW38DCWRExet +k3C/msdFqR/27HjyZ/wroJICMtGRD7KfFRjTzX0aVXMg4/okYmqAj+qtGAwR0G4kKr8Z7 YFM0vSGsE/yIb3+cqxfjIprvieAeoWguOPG4XMrt/swwIq7aLJ7DAteeh18Jz79PhuofCc +buVaqutJOGK7GHgBICp9nCSvYwy76EmyRn7QeGLyTgLpFtrRWXWOz/9EPY+Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725152108; a=rsa-sha256; cv=none; b=qaAaRcMhzRRABTB7TKegjImx3Qgbhu8ZKQzDlHFDgRqro5nsIoLgPsXiNBoxW0EggB4JOr SHB03kDurSKOMFz7AOloQPIaOGUolKZ9FzqBOldKcvExL4sliIBwD20VBDxnY2trtzOrgR VdIYt6jancyzu9A11sepou2dqfzv21zt2RzjINf4c8/j9vPsMzyhbE0zHt2eCJDjkcPX/3 zeBB4kpSlv5tvEBx0M6/dRa6Bd3U+mTbsQRSy0jh2nyxDrbBuAl900nV3KpAKsdbJSQv6j sL8ggr132s6UNPp8PBMrkahFJgu1Rxp4gsrnNQ//FjMrxYn6HNE9N9j4JgYNLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725152108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6QZti04r7UlX/LmBD4Bn07rSNZDbbR7gVmL2xJiiio=; b=OJH0AlclnIigFR94X8Fzr4Zn4CxmIGwNTQeYSvRCbgcq3byoEkggqtIrMZ3ibIze+e776J pf4S5jTn3qES8BkuvTqFWVYf7Sr5YgBF1SJTCvcqYsbQMYkz3kb9dGhuYK92TG3iBbE5N0 OYAvoxYhAL2D27znXBHnAbGNEo0MxBlfrFv5CsuB/jHXVMmUHv+TrhhYhgJzclTN1VTNbq veX2rD+ZRKAOVPDCqKiWJSZtKhy+f/cu9FbWwxKcsDyVQ0j1+y34Cgjl3581GLpPi5OiMD nsrBhKe+gFNYU7YfoD6IQsxGnRAqPrBuUnaEGTSdio0Jap+G4wgy6qKQK79OrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxD245X0hz16v1; Sun, 1 Sep 2024 00:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4810t8um059414; Sun, 1 Sep 2024 00:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4810t8f4059411; Sun, 1 Sep 2024 00:55:08 GMT (envelope-from git) Date: Sun, 1 Sep 2024 00:55:08 GMT Message-Id: <202409010055.4810t8f4059411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f7eb6b134db8 - stable/14 - open(2): Extend EINVAL's description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f7eb6b134db8fed6a6851b6a3d00a2ea0e11eadd Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f7eb6b134db8fed6a6851b6a3d00a2ea0e11eadd commit f7eb6b134db8fed6a6851b6a3d00a2ea0e11eadd Author: Jose Luis Duran AuthorDate: 2024-08-27 02:23:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-01 00:53:36 +0000 open(2): Extend EINVAL's description PR: 281033 (cherry picked from commit 02c23c3b5ac9c9c1115c8b892034bb5d67b05c06) --- lib/libc/sys/open.2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 220561cc5683..4cdceb336532 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2024 +.Dd August 25, 2024 .Dt OPEN 2 .Os .Sh NAME @@ -580,6 +580,12 @@ and .Dv O_EXEC or .Dv O_SEARCH . +.It Bq Er EINVAL +.Dv O_CREAT +is specified, +and the last component of the +.Fa path +argument is invalid on the file system on which the file is being created. .It Bq Er EBADF The .Fa path From nobody Sun Sep 1 06:29:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxMRy5xzmz5Tcq2; Sun, 01 Sep 2024 06:29: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 4WxMRy550nz4gGr; Sun, 1 Sep 2024 06:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725172174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xg0G7/2objscSRqXNkyf4Mio1lcKcMldUkK9Pa7XuUc=; b=LWifh13xiWdFSe9cYA72JC7xVizsXD8Jd9My88ZXOOZ7dzRFBC/c/GIn2Pw+V8tf3s6B7v jDFJ3/fNglQCoXO8MCxozPiijKNRhWJ+Wt7lnZR+bAZJYrGWDsu2q5vSlDuJ6XCa55U6b/ QRgR+/w66QJkOB6VcPIHMp51k1atF+tZJyJVPKPxukxWwUdqQWU9DW72quKfcmgLvmze1C wdMNhPubY4lBsyCIoHxhEkZzB/O5NTgMOxw+HYoVLxpxesT0R6Iu/MBru80tVQ/meI3fk2 3FtoqSTluBIpZCGQY93hESwx2Fz7ZZlGnmg8nzu88H2v2qEAoFzfU1LxIRHXtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725172174; a=rsa-sha256; cv=none; b=xHhtC+u7bTva2T7dT9CPu/EYSCgSTTbKqvQLECP6n/omc4bvhCuHKYycmM6DiO/7ZPj89N 8gQCb/qemqZHgtxshy/HBQXu3OKQ62L9arUDE2csjzcEkE6Z7EZ16K63gFx6+Fes2tN//3 zQJ+Rzef1iDFxe1XGh8pK8opneIRXU3Labh2zJDXge96w9QoyqeR8biCG0KexEdPs6b9cV TAPQpll/q/ESUfENjOwyDj1qQ/HFOVRrqmL6eNu8iWOJRBIv8Ypm9da0TX3VY+ZXCRcliM R/bwkJq5Qu1L4uOMVyM1MqnFRgdr3NXRABkLa9Q+EaYqv1qKi2DMzjNcN08Vpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725172174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xg0G7/2objscSRqXNkyf4Mio1lcKcMldUkK9Pa7XuUc=; b=DtpCtEKXTl+YrT5nVloPChR2V6Z0kx01V349IqVz7dFmPoEcux8n563W9YqEeLoPmFbo/I sy0v0RTReI31lo/rNrqijg2/Vu1DRzYd1AHMJsnSn6y9jbPYa0BYoyg9qEGVNcHIg+IEVq Kchpr/1GsT94axbbCh+GxTLclx7uVRiGw4I/9T6ybItJILg+p2DnPjS7Y8WDxC/njs5HXi pwbDHftbdrbeXC5yfS9cNzOVrcrcElHbYS0USypxdY8IsPku7nW5TBZQCKz5TayrEhrDKi lObiWcSwlRec7DAXzHPxW2sZ9OZbgwsuFuS3yKkT7mRYOYENrFWvHBne/qgtAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxMRy4hvlzHwV; Sun, 1 Sep 2024 06:29: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 4816TY77021308; Sun, 1 Sep 2024 06:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4816TYHE021305; Sun, 1 Sep 2024 06:29:34 GMT (envelope-from git) Date: Sun, 1 Sep 2024 06:29:34 GMT Message-Id: <202409010629.4816TYHE021305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 2d203f534bae - stable/13 - bmake/unit-tests/Makefile use _shell List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d203f534baef0568989555ebd26278134ef4c6b Auto-Submitted: auto-generated The branch stable/13 has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2d203f534baef0568989555ebd26278134ef4c6b commit 2d203f534baef0568989555ebd26278134ef4c6b Author: Simon J. Gerraty AuthorDate: 2024-09-01 06:29:19 +0000 Commit: Simon J. Gerraty CommitDate: 2024-09-01 06:29:19 +0000 bmake/unit-tests/Makefile use _shell Set _shell like later versions of bmake so that .SHELL does not appear in conditionals. This avoids errors when an older version of bmake parses this makefile such as when doing src upgrade from stable/12 or older. Direct commit to stable/13 since this is the only branch where this issue arrises. PR: 281151 --- usr.bin/bmake/unit-tests/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.bin/bmake/unit-tests/Makefile b/usr.bin/bmake/unit-tests/Makefile index 96bde713ba38..2b20de2498eb 100644 --- a/usr.bin/bmake/unit-tests/Makefile +++ b/usr.bin/bmake/unit-tests/Makefile @@ -441,14 +441,15 @@ TESTS+= varparse-mod TESTS+= varparse-undef-partial TESTS+= varquote -# for now at least -.if ${.SHELL:T} == "ksh" +# some shells have quirks +_shell := ${.SHELL:U/bin/sh:tA:T} +.if ${_shell} == "ksh" BROKEN_TESTS+= sh-flags .endif .if ${.MAKE.OS:NDarwin} == "" BROKEN_TESTS+= shell-ksh .endif -.if ${.MAKE.OS} == "Linux" && ${.SHELL:tA:T} != "bash" +.if ${.MAKE.OS} == "Linux" && ${_shell} != "bash" .if exists(/etc/os-release) distro!= . /etc/os-release && echo $$NAME .endif @@ -465,7 +466,7 @@ BROKEN_TESTS+= \ varmod-localtime \ varmod-to-separator \ -.if ${.SHELL:T} == "bash" +.if ${_shell} == "bash" BROKEN_TESTS+= job-output-null .else BROKEN_TESTS+= \ @@ -771,7 +772,7 @@ _SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g' .if ${.MAKE.OS:N*BSD} != "" _SED_CMDS+= -e 's,\(Error code\) 255,\1 1,' .endif -.if ${.SHELL:T} == "ksh" +.if ${_shell} == "ksh" _SED_CMDS+= -e '/^set [+-]v/d' .endif From nobody Sun Sep 1 13:28:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXkm71Trz5VD4W; Sun, 01 Sep 2024 13:28: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 4WxXkm6LRhz4Kbq; Sun, 1 Sep 2024 13:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lO2HsRT02a38qbss9Hn2BfR0krBU/ZviwCfS8s6ZJIA=; b=hxf6MFMvQRiNUFTzvPu6qa6WVR5fpXx8BItTdyrOlO54h2mSRQh/vaK+hOxXlqbpEI4epG PB4F+EEkDleJlryTnCBUpO8CLRr+e2xCFH3r6GZAmPrGnrJ/5Flr+BkDeK2hSJB6sToREQ 152Z7wts5/sIIx96lt4q7XCph2V9YIfCBiWjFSWO/xgethIL9xD2ysDHT4cF0LUctzX2XS BuNzs/b6blva8rE7NP4mqFCtTRV7Wxjwxx2LRonlZjkqWYwQfHfXSflZQlpjoUPIppXHN4 2vZmzpWrUEKTc6WQzfYQKxBfhPnqLIZW5lfuhAvLxWk2YNy2k2b9806dT0HFnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197280; a=rsa-sha256; cv=none; b=hf89goTcZ/+IU59xtriJK0cKZVcn4RHR2HTqmY30De6Hd4hSwAONeQm9gvTvCgujNEabhf GaSDI0O9gnM+tQKJ3cTkdrZSQDXElad5VkVeDfMXVnTLh910Nz9vNpSg7YbnAIYA7EShMz kO8iPU5C0MNShstBW/qQ2DMUwHWHIC99YZ+I0DjxZ9L9yJichlZzoMiVPtfLtVU2Y6RfbT OsMOGe7p1NR3Zs3zLtrq70eahCBAeXIiov4XFAgDG/P7tj2Dzm4Gon+6z1Yn96ankRamL6 DFkKEBuKcACsQyeuP8Sx6GhiH0zUNC6w+JCsXfGSg69UFx8lrxdyHAoc3m3goQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lO2HsRT02a38qbss9Hn2BfR0krBU/ZviwCfS8s6ZJIA=; b=EWj0LTl8pPOnxlNYYKLZMWW+bDX0UTzLMW40Op37ZAYYR5qqRNJjfh84JAQE4VgHW5rEYt CxHxfBCpU6RujPJifU2yy+Rzt45aa76UowIha6BxCu4xy7y596n/YJRubremHiCay6diuu w54JPL/KCDFgZp721lkXgHxSzHwHPAvRPc1NrcLsPUU9REXHTFLxx9Rhj/Jn8EE8X8DL6i lSQXxx/nxWAj1vpSUV6DPTg/zFroDPQBpooMpcmZ+aW3kU/+LkNkHW6hyqFdfLTPTHmsuw 37xILxVBkmZrPFE++xih0hYBlFwDTYkm7moaH0YB3U+ung/qer2eMFTkeAWu4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXkm5ybxzW4f; Sun, 1 Sep 2024 13:28: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 481DS0S4030705; Sun, 1 Sep 2024 13:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS0Ji030702; Sun, 1 Sep 2024 13:28:00 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:00 GMT Message-Id: <202409011328.481DS0Ji030702@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: f29e915bc0d2 - main - LinuxKPI: add get_random_u8() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f29e915bc0d216a87f222a208caeb2172c93e4ea Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f29e915bc0d216a87f222a208caeb2172c93e4ea commit f29e915bc0d216a87f222a208caeb2172c93e4ea Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 21:20:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:32:11 +0000 LinuxKPI: add get_random_u8() Add a get_random_u8() implementation following the u36 and u64 versions. We'll likely want to macro-ify them in the future and add all the types which makes sense just to be done. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46464 --- sys/compat/linuxkpi/common/include/linux/random.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/random.h b/sys/compat/linuxkpi/common/include/linux/random.h index 808c5bc55974..893ee2b7b728 100644 --- a/sys/compat/linuxkpi/common/include/linux/random.h +++ b/sys/compat/linuxkpi/common/include/linux/random.h @@ -54,6 +54,15 @@ get_random_int(void) return (val); } +static inline uint8_t +get_random_u8(void) +{ + uint8_t val; + + get_random_bytes(&val, sizeof(val)); + return (val); +} + #define get_random_u32() get_random_int() /* From nobody Sun Sep 1 13:28:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXkp0qC6z5VCrL; Sun, 01 Sep 2024 13:28: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 4WxXkp0D38z4KT8; Sun, 1 Sep 2024 13:28:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ai6vc/GXmvT3s0b34aad9GV/JM6nP5J5o6OdydxXnLw=; b=TmCKwFXx9EKx7uDO1tmQUP2XCGajo9WR6PuWT6ytpCYMTci8YNpG6oLEYTppMgby1qpj+l peIJNVrNS2Q8VYT54EkrM2OdYqzHc/YYAEI1ejIe3N/2EQEQOVwKpzVuHFscbj4/0TZ114 PTmjuxUucsEyD4bdMZzLYjuUvjOC2z0G8XWhEfiXw/BRo0QB3S8De1njC+WbxKYjsyeVaH UZpGAyiSqo1Uw4wmTfMUTmfSxmrJMPYVb2LGeJNgwyfisqCx/5uOucCqT5rcQNUjHzsXs4 MXjc5jXS0Krgv7H2AohCnzWyOnd9wQzqP+fWBrEO4rKjOMAzm7vLxCMpFyLwVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197282; a=rsa-sha256; cv=none; b=YdP1UInhxBQ7+PtKf7vBYdoYYhf/6L38znxenRrcVlUjvt9P1HJv5Y9QmZupnKHuBEzXic VEECjf2Nq64P2/ODODzfM83oZg14C+6JjDJJDF1oeOUsThpERMp3f6iBfKcoXJUWF61G1+ qwa83n9n2z9U7LjB1jPGfjTvWS5wnmTPfDO5IfqoCAlzRLmy0UaAphTTE0KPFKy68dvRSF vnBtXM2tKRxmgYTnnBudeFNyqCTcz7azvxGG3JS/P1UOx347LgaG2S/49ABHu94Xz7MPn3 f2s18ITnTNuL+w0F2W6intzB8EalYv2JLhQbevfrDmQmR9nKKpXew24EUaDcSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ai6vc/GXmvT3s0b34aad9GV/JM6nP5J5o6OdydxXnLw=; b=CsuetpSshVaykrkO7XRLaf4gp350ModPhzXZeZkkWeTYMmojhYvTXSaEC49uqh4sWBXGAy TcSffM6XQLJd1k491bpAB6zbZSatcpgeuy2ueGuTU2RXus3OZk3MvOGXqJ3j+1fy0M8rNs 3uEENPQ/y+OyGWBTJGL5cEYco1QfEr37dbfxydTg8/1hJVvK5pegyEcaugKB/JtdHNaqH9 SSKS2z2Ao5C3wAzVqGOpWPsAUc83Hsg2qtEr9+0gntCBY+NmAV1eB2jdZ9V/WoJsIBPUa9 c4d/c98jQ2poMXlrju2LOSTU5bsptlNvwMACVMFkRKJaSuyQvBI8Y2zLJ3X+4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXkn6xjszW4h; Sun, 1 Sep 2024 13:28: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 481DS1ut030750; Sun, 1 Sep 2024 13:28:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS1vx030747; Sun, 1 Sep 2024 13:28:01 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:01 GMT Message-Id: <202409011328.481DS1vx030747@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: 8adb745dc971 - main - LinuxKPI: add ENAVAIL error code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8adb745dc9716e769ef0f7e993cea8a07735d5d8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8adb745dc9716e769ef0f7e993cea8a07735d5d8 commit 8adb745dc9716e769ef0f7e993cea8a07735d5d8 Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 21:05:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:34:01 +0000 LinuxKPI: add ENAVAIL error code Used by an updated wireless driver. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46461 --- sys/compat/linuxkpi/common/include/linux/errno.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/errno.h b/sys/compat/linuxkpi/common/include/linux/errno.h index ea258587c6f7..d634675d43d0 100644 --- a/sys/compat/linuxkpi/common/include/linux/errno.h +++ b/sys/compat/linuxkpi/common/include/linux/errno.h @@ -68,5 +68,6 @@ #define ENOMEDIUM 532 #define ENOSR 533 #define ELNRNG 534 +#define ENAVAIL 535 #endif /* _LINUXKPI_LINUX_ERRNO_H_ */ From nobody Sun Sep 1 13:28:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXkq47FGz5VCrN; Sun, 01 Sep 2024 13:28: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 4WxXkq13Lkz4Kc7; Sun, 1 Sep 2024 13:28:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3BYlo+siynmO72SyI4HQVkLcx/RCxox/TahQIPa2SDY=; b=tMmfHiM9shKgWzSg+RgoVmndZh4KTu+gbBRBvn/pHerHdXUKz1WjNYKomUJ5VUnsJTRnrT Ks4JMYKbci8RmMY614u0wQZvz6L1k4z/2waOgvv51g/qRxImjyHbFAT8gGqGzdzRTQg6tc fxehs741aatR0zipcobSU5WD1/NKb4SB32tPiHoprCowqACHr7ltUcMdjfJcS6+VQe0MG+ Bpjjq/6iQfuPDFuAttLOR261rLO1OmO7YF3e5N2aGEJ9zNbKvdS11mxkrANN5tfliN2VtB 96akNr8oglNI/ZibcxZ7EApiCkjgrYWUS08B9yyhV/8IQ+uAtODjU89CNMH/7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197283; a=rsa-sha256; cv=none; b=m4ya36CkIMBQdWDksnFK2q38Jd0V9QBDHU3RPPvSMWj3XGM3WMy+2EKJi7X1qI9xUmx2d2 6pvCQDu9e7fD6CywA74Sb4k+n59b8G8Jun2WdP4HbxsI8+164lI4Zmy3zTMmmEdg+LK645 qkn1DJY9EFbaXZCoe0NmxdT6WFb3GEPvjHXgEGA/Ov+SaeEItnXp62AzB3m7vRcFWeBtIH TTmQHS2pQQCgFOUdmgxMVIOnB+4sFyJ+zYqJj+0XULGTwkbk1bgsX2btCBHVru/EfeCMb5 y+h2Od5nZZgSXMegQSDn9fnmGOoiN01cei5Jh+Xnj+tf6GYBtIuQPLzN7jws7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3BYlo+siynmO72SyI4HQVkLcx/RCxox/TahQIPa2SDY=; b=uJ2QtJaB2Ab4rMJXFugvZY0SphqRdM0M0corCL/hT7Bc5L1KqhhwZBRX1CpvLmIG6yY9Lr W/TrRbJeOA3BNGB2+trBQs3bL6eA68UV9eWHgV77GMKT/SNUODcaoeO4gpjVWUVzIdmI+N Fj5KKk5WRZ5RYK/Rd+dOecQcTv48/LGGnd+OoPimUQWoGJIpTOwCJHuDD9MLzhCyn1XBrC rtAayp34TQaUbcaN4SaOgEsUwEIuAPd/Ec/IJmOdNW60pQBvj+9hKOYYyUXT5RLD6JQd9/ QgjfPVmC4NIkWMWeDkr1r/x8eAfManN3k4kpWlPs2/Etzg6WZLk+mPCl4fQeGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXkq0W7ZzW4j; Sun, 1 Sep 2024 13:28: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 481DS3gp030789; Sun, 1 Sep 2024 13:28:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS3CR030786; Sun, 1 Sep 2024 13:28:03 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:03 GMT Message-Id: <202409011328.481DS3CR030786@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: 273cf7d36336 - main - LinuxKPI: add eth_hdr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 273cf7d36336eeed5fc2ad42e5e12a36e36650a0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=273cf7d36336eeed5fc2ad42e5e12a36e36650a0 commit 273cf7d36336eeed5fc2ad42e5e12a36e36650a0 Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 21:07:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:35:02 +0000 LinuxKPI: add eth_hdr() Add an implementation of eth_hdr() needed by a wireless driver. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46462 --- sys/compat/linuxkpi/common/include/linux/if_ether.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/if_ether.h b/sys/compat/linuxkpi/common/include/linux/if_ether.h index 3735ad2f5527..6676e8fc142f 100644 --- a/sys/compat/linuxkpi/common/include/linux/if_ether.h +++ b/sys/compat/linuxkpi/common/include/linux/if_ether.h @@ -34,6 +34,7 @@ #define _LINUXKPI_LINUX_IF_ETHER_H_ #include +#include #include @@ -69,4 +70,13 @@ struct ethhdr { uint16_t h_proto; } __packed; +static inline struct ethhdr * +eth_hdr(const struct sk_buff *skb) +{ + struct ethhdr *hdr; + + hdr = (struct ethhdr *)skb_mac_header(skb); + return (hdr); +} + #endif /* _LINUXKPI_LINUX_IF_ETHER_H_ */ From nobody Sun Sep 1 13:28:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXkr31blz5VCtr; Sun, 01 Sep 2024 13:28: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 4WxXkr1xr1z4KfK; Sun, 1 Sep 2024 13:28:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRDkzKruvAECBq+K31zetDerIjtjHDcUSn6FBxcg8aQ=; b=qHsOMMV/r6sGPprBzojIjk0pVV2ZIEFvOzgomyPmZLyeOWwQdeZDh0Vhf4uJm8XnNUxwxe pm73ln5PrAojwg+nweiVUZZBnpQwOdYQBjf6Yge9xzy71wdri0cNzI/pDsNeclBEgwZhzY bh2ORQuKW/BQI5XoeK1D75UB7ahpYJ9t78HTJW9qKLzZVG3be0fHWZxUSoF7+VOO42vxu3 PXiuMocbGmi+cQOS15kf6LBg3iD1Tee7c9Trp/1cPo22BmRE6IRQL5g1xpDou48SOoD0TJ xqx8s6u4NUHhoMUVU5IQrs8ZaQ7Iai34K3rME7Qc4X3r7WZEkHV+sxKCrT45jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197284; a=rsa-sha256; cv=none; b=qUpRFKKoUKwcLWf4fV1UUEzecCX6wnlgeQxarox59v3IoNoto6HhNclxK4FG3BTuDmYJLu pft8rg+A/UmYe+cMxJr1xcGN8rn5CRusPHncs6qc/ZdiedhT8M+GZvLAGRO4hIj4sWNuiF 36/lQ4G0LfRcOTtETb3BIrcuo9kdOLQXMuarV9UHeSHAJK7BOg50A7VOO1CK2YtMB5ZbYR 8b3TWIXBoHSCjTJxtD3QmPoCGjPyA+i4CxqZ4bBYCGbpbDSH6rPKWo002W6MhzcrbflPFH Yh0VKxbXI/Iue0GljOGXxxQh1d/eIaYUe0vb0j+xPjqbIbSdgUwabZTzodbcQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRDkzKruvAECBq+K31zetDerIjtjHDcUSn6FBxcg8aQ=; b=GShgHKdH/9lb3yzbkbFXx4Uc8Nx3sEq64HdrzbdC2t1+/AR4OBmO5Nx6A/iNIkslHD9698 dwMZYX26oRrYon+QUFhsuI+qByBqebeU7B2VZJMcqD4G+ZPfPc09Mc7onZi4AhdOSvl5Lr ywtr5StSnj2ADY0bOMUIuhN5iDodR+FwnmHMjeAuDlHX87X1QPknceLOebWQUbB3yyjyOY y5V76FnLFVR8UuaLUbiWSoIY5UvaE8sccvD3+ujNgx9zYUYPhCgiWO21wuGLaUS8fJwFnm G+nWYuBBOYABT056GQwlHW3qEpASe7XIKFSFi9Rn+EziUt2HIY9bLwpajyHouQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXkr1XdDzVwJ; Sun, 1 Sep 2024 13:28: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 481DS4rS030828; Sun, 1 Sep 2024 13:28:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS4RW030825; Sun, 1 Sep 2024 13:28:04 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:04 GMT Message-Id: <202409011328.481DS4RW030825@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: 1847e63d63f4 - main - LinuxKPI: add no_printk List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1847e63d63f440cfcb2f4ee2c2ee8990f0272d88 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1847e63d63f440cfcb2f4ee2c2ee8990f0272d88 commit 1847e63d63f440cfcb2f4ee2c2ee8990f0272d88 Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 21:12:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:36:01 +0000 LinuxKPI: add no_printk Add a version of no_printk(), which seems to be there to have format string checking while never calling the printk. It seems a very weird thing and it needs a return code and for some reason my initial while (0) { } version hadn't worked while porting over new code but could have been further downstream format string problems. if (0) seems to do the job though I would have expected that to more likely simply get optimised out without any futher format checking. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46463 --- sys/compat/linuxkpi/common/include/linux/printk.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/printk.h b/sys/compat/linuxkpi/common/include/linux/printk.h index 933d5aa6f94a..3840a6e5fb8a 100644 --- a/sys/compat/linuxkpi/common/include/linux/printk.h +++ b/sys/compat/linuxkpi/common/include/linux/printk.h @@ -125,4 +125,11 @@ print_hex_dump_bytes(const char *prefix_str, const int prefix_type, #define pr_info_ratelimited(fmt, ...) \ printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define no_printk(fmt, ...) \ +({ \ + if (0) \ + printk(pr_fmt(fmt), ##__VA_ARGS__); \ + 0; \ +}) + #endif /* _LINUXKPI_LINUX_PRINTK_H_ */ From nobody Sun Sep 1 13:28:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXkt2Xtjz5VD09; Sun, 01 Sep 2024 13:28: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 4WxXks39Fqz4KYv; Sun, 1 Sep 2024 13:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2GNzfFP3B5DWbPT5QiPfO83RqTmmMXG1uZmz90U9YQE=; b=UtULhVPoVou683wxLj8FgX5WA22MBnPpDFpDJWRo9sszFgzZQ1TdpOLujX5dFjb1ZwX31x rATgprTViTqdORnsUtAWsV7YUuXE/2ZsgCw/0FcedvI2G35I1HLAiCjkzfp6F2eVic3sfF njML+Fn7X4q5y5sO1358qluZzkHpnrgOd9+8EFgggfTtYTcfyODfF3HIfDnrJK8ffWDjj4 NoJS68+i0cvSUgqfgLAFR96nsgu696Vn0CKW5SEltSUjjM5g5EkJYbNJNC8LVJk9VkepIh 8IZ0Aq/q4NL7x5bylrJ0YF25LmeP8H6hcL330iqKdkbBvVbra0IMJd83Gu8mHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197285; a=rsa-sha256; cv=none; b=VYu3/CR3HflprCE5Ub7cSbi5W+XyNqS6Yctfp32gqxG4qB0Qo5i8yjdxPJfapC0+i2UswR q35GtQxtIGJikeyEeg90UACwmTR/n83g59LM4ClucaOYGsSdLKXMCeqEtK7rTLm/OiUXe7 czgaFHn0m/bO+woDYY7Y5xQFcDBmaLKg2us9UV9J3CK6Tb83HTl/2jUYYyBRKj3PdE9WUK gzSy/KbI0UwdqOt43ohZRo8IQKxc65VVbDs+1SA7Vj+QXRP3irJ5koPXSNzVmwvi7gzX4/ OWrlNYKLrbx55MmlWTfI7HqKwDfAKsc4VjfpW12sVRexA6IInu6XPykhObHerQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2GNzfFP3B5DWbPT5QiPfO83RqTmmMXG1uZmz90U9YQE=; b=m9UkvZrESn3R1p4GwzvoTRzdjhi9ZFXGe5CorIZ9uYnLQD1eeEoFNz5sTKE4Dk+w+yJMuC NB6CIMYVQXlmEGwg1aIxLHTXYl+g6qf+cVg5vVBCYyJh/5BRJRJiDMFayCzHyLSom4Ae9p SwWHWrHAGkgtcjOtNPZZfHTXIfY5NBWQbsHeBKmkYTA71cmLyPlmBnyEcFJWuFFV6pDWtv +wXVES0B8Q7Vn1F+5mdh0DpMpbgomMpNR4f486rmPtQn97GKyfWIeytXhRU34uYJoDEgpJ uvxgvta49XyuJpa+Cfi9+xcy47LVv1GoI+CZPGf6kiH8SjEDvCuyAOlErurDaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXks2k0fzV89; Sun, 1 Sep 2024 13:28: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 481DS54I030874; Sun, 1 Sep 2024 13:28:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS54q030871; Sun, 1 Sep 2024 13:28:05 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:05 GMT Message-Id: <202409011328.481DS54q030871@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: b4ef1b1be753 - main - tools/sdiodevs2h.awk: introduce palias List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4ef1b1be753952a4aafa505817164624f712c37 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b4ef1b1be753952a4aafa505817164624f712c37 commit b4ef1b1be753952a4aafa505817164624f712c37 Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 18:41:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:37:53 +0000 tools/sdiodevs2h.awk: introduce palias Some of the defined names are not the direct 1:1 mapping with vendor and device names used by Linux device drivers. Introduce a p(roduct)alias so we can map the one device entry I came across without much extra hassle and generate a name device drivers know about: palias BROADCOM_CYPRESS_43439 CYPRESS_43439 Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46455 --- sys/tools/sdiodevs2h.awk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/tools/sdiodevs2h.awk b/sys/tools/sdiodevs2h.awk index 596d09531ab1..99735dc09a62 100644 --- a/sys/tools/sdiodevs2h.awk +++ b/sys/tools/sdiodevs2h.awk @@ -149,6 +149,18 @@ function product(hfile) printf("\n") > hfile } +function palias(hfile) +{ + nproducts++ + + products[nproducts, 1] = $2; # vendor name + products[nproducts, 2] = $3; # product id + products[nproducts, 3] = $4; # id + if (hfile) + printf("#define\tSDIO_DEVICE_ID_%s\tSDIO_DEVICE_ID_%s\n", \ + $2, $3) > hfile +} + function dump_dfile(dfile) { printf("\n") > dfile @@ -243,6 +255,10 @@ while ((getline < srcfile) > 0) { product(hfile) continue } + if ($1 == "palias") { + palias(hfile) + continue + } if ($0 == "") blanklines++ if (hfile) From nobody Sun Sep 1 13:28:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXkt6nTBz5VD4c; Sun, 01 Sep 2024 13:28: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 4WxXkt496Rz4Khq; Sun, 1 Sep 2024 13:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WkuV+ac0sUo2HM2anfNknT9byuwU8l/lChmo9xRsnNM=; b=yzyngnZorScRKowOBtXtz1OC2VsThVa/GBGjSKWxtRJOX4VcBmBnaM0l9VQRUotVGoU8WA 2IAqW6d3kCCI6EVKQpjEqWBM7/IRv77X+WNTCvLpau5a3MgF+5qU8gb6f8UYq3BHjaDtCZ QUZXPNounk7RDPW+xZqwcjU2V4C20vGYn4uMgMRk9MiwkvH1vdVuMAoasp48usr2xphxyA GgAgOCG12Thyj6eDuXZGudor4ymn42azSfzRTsqXHTC+OWPUTScBpsu5P/7nBmfXzdF1/w 6kG46PGUjig5hjzSPZRhHvsLxBAIur/uuAMpDZJkpqW8939LnKJOLmnis8uQWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197286; a=rsa-sha256; cv=none; b=eF65WPu2WTlWvv8G/P83t/NS18XwD7uylb9sCxWuI87I9Ayd+NMtRZ6HhZiMdJEcEUDsHX 69WPicebESb5ALhP7/6WjXkOzxUTx9irLiBFv8MJjZPYZ4qE2l4KD9OBhZedgj75R48S57 ODxuKnaWm09scMY2zZsOxoC/rRZ7BzFWsoHzF+vd86YUSXQdU9iKB8IWnBCuStmY1SldZO At8Opd+AqoFwBO+dxpux8hksXwtvo0wozEuWswDeat+bbr0pb9CLhPD9aGI3QxXMy421Lg pE0HVaSed0ubvGjJiKGWKbB1IdYLJXWv9mIiUPMJVyaxk6GVi/nND7ZoGd1jOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WkuV+ac0sUo2HM2anfNknT9byuwU8l/lChmo9xRsnNM=; b=nUqt7W4UVk16HXAybEf0J2yGgrciE/NEWWntZPuJC1RuIPm9dBq/j103IsoWXK08l1GW0K 2pesjWacQJxs6HHV1ULKUblyyi0/o98TcjHOn5rRmcDG4uM5CAbEQwY8nuymbOZGZloi76 nDDc2tgmi1+xemjqb5OOya1WgmYgMOytA2h4PzbjpXcXnxgXqaMXY1o+zX5eeKF5tEsuSC zi/b9F4VsBe4oM4Ku1o9L1pfAGyZjfgrDzf2w1zYvHMoDrD5obzOZW5wI4oWAv144jy20C yOK/vh3tWbrbUU8M4aPoQab0sjmzgwJxwgKza2Yl4EHKHsZ8e508+/bBf2Bb1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXkt3lMszV3P; Sun, 1 Sep 2024 13:28: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 481DS6vl030922; Sun, 1 Sep 2024 13:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS6L3030919; Sun, 1 Sep 2024 13:28:06 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:06 GMT Message-Id: <202409011328.481DS6L3030919@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: a800b5bcd1b6 - main - sdiodevs: add more vendors and devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a800b5bcd1b6638530d3a0759b17cd8d93b7e7ca Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a800b5bcd1b6638530d3a0759b17cd8d93b7e7ca commit a800b5bcd1b6638530d3a0759b17cd8d93b7e7ca Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 20:12:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:38:57 +0000 sdiodevs: add more vendors and devices Add IDs for Realtek, Atheros (QCA), and Mediatek. While I am not sure we'll ever support the ath10k and possibly mt76 SDIO devices, rtw88 ones can be found with SoCs (e.g. r2s-plus) and are actively being worked on. Update Broadcom/Cypress entries. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46460 --- sys/dev/sdio/sdiodevs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/dev/sdio/sdiodevs b/sys/dev/sdio/sdiodevs index 194ef8e5d901..8c341e77d9f9 100644 --- a/sys/dev/sdio/sdiodevs +++ b/sys/dev/sdio/sdiodevs @@ -42,8 +42,11 @@ * List of TPLMID_MANF "vendor ID"s. * Please sort by vendor ID ascending. */ +vendor REALTEK 0x024c Realtek +vendor ATHEROS 0x0271 Atheros vendor BROADCOM 0x02d0 Broadcom vendor CYPRESS 0x02d0 Cypress/Broadcom +vendor MEDIATEK 0x037a MediaTek /* * -------------------------------------------------------------------------- @@ -51,6 +54,21 @@ vendor CYPRESS 0x02d0 Cypress/Broadcom * Please group by vendor in same order as above. */ +/* Realtek products */ +/* PR 251063 */ +product REALTEK RTW8723BS 0xb723 802.11bgn SDIO WLAN with Bluetooth 4.0 Single-Chip Controller +/* rtw88 */ +product REALTEK RTW8821BS 0xb821 +product REALTEK RTW8822BS 0xb822 802.11ac/abgn SDIO WLAN with Bluetooth 4.1 Single-Chip Controller +product REALTEK RTW8821CS 0xc821 802.11ac/abgn SDIO WLAN with Bluetooth 4.2 Single-Chip Controller +product REALTEK RTW8822CS 0xc822 802.11ac/abgn SDIO WLAN with Bluetooth x.x Single-Chip Controller +product REALTEK RTW8723DS_1ANT 0xd724 802.11bgn SDIO WLAN with Bluetooth 4.2 Single-Chip Controller +product REALTEK RTW8723DS_2ANT 0xd723 802.11bgn SDIO WLAN with Bluetooth 4.2 Single-Chip Controller + +/* Atheros/QCA products */ +product ATHEROS AR6005 0x050a Qualcomm Atheros 802.11ac WLAN SDIO +product ATHEROS QCA9377 0x0701 Qualcomm Atheros 802.11ac WLAN SDIO + /* Broadcom products */ product BROADCOM 43241 0x4324 BCM43241 fullmac SDIO WiFi product BROADCOM 4329 0x4329 BCM4329 fullmac SDIO WiFi @@ -61,13 +79,25 @@ product BROADCOM 4339 0x4339 BCM4339 fullmac SDIO WiFi product BROADCOM 4345 0x4345 BCM4345 fullmac SDIO WiFi product BROADCOM 4354 0x4354 BCM4354 fullmac SDIO WiFi product BROADCOM 4356 0x4356 BCM4356 fullmac SDIO WiFi +product BROADCOM 4359 0x4359 BCM4359 fullmac SDIO WiFi product BROADCOM 43143 0xa887 BCM43143 fullmac SDIO WiFi product BROADCOM 43340 0xa94c BCM43340 fullmac SDIO WiFi product BROADCOM 43341 0xa94d BCM43341 fullmac SDIO WiFi product BROADCOM 43362 0xa962 BCM43362 fullmac SDIO WiFi product BROADCOM 43364 0xa9a4 BCM43364 fullmac SDIO WiFi product BROADCOM 43430 0xa9a6 BCM43430 fullmac SDIO WiFi +product BROADCOM 43439 0xa9af BCM43439 fullmac SDIO WiFi product BROADCOM 43455 0xa9bf BCM43455 fullmac SDIO WiFi -product CYPRESS 4373 0x4373 CY4373 fullmac SDIO WiFi +product BROADCOM CYPRESS_4373 0x4373 BCMCY4373 fullmac SDIO WiFi +product BROADCOM CYPRESS_43012 0xa804 BCMCY43012 fullmac SDIO WiFi +product BROADCOM CYPRESS_43752 0xaae8 BCMCY43752 fullmac SDIO WiFi +product BROADCOM CYPRESS_89359 0x4355 BCMCY89359 fullmac SDIO WiFi + +product CYPRESS 43439 0xbd3d CY43439 fullmac SDIO WiFi +palias BROADCOM_CYPRESS_43439 CYPRESS_43439 + +/* MediaTek products */ +product MEDIATEK MT7663S 0x7603 MediaTek MT7663S SDIO WiFi +product MEDIATEK MT7921S 0x7901 MediaTek MT7921S SDIO WiFi /* end */ From nobody Sun Sep 1 13:29:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxXmw2fLZz5VD45; Sun, 01 Sep 2024 13:29: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 4WxXmw24j8z4MLW; Sun, 1 Sep 2024 13:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KFtL5DH0/cZu6egOqt7sdpgP41o+FZUClsa43uGjECM=; b=jGjjxMo1VyheZ+6+5cLhCIadK+tg0fMjN71Foe+vS2g6iyKgL03V38qSHXe5vP2kYPOzEz LSNzzi9If2iGLenE3mqIv15cyfGHfTAjkKy+MAxoSPIzSvGO/SfscwQnUN/3IavOsIyQSM psec3soMThzVqVeALVPK+Q6XqT16/ZpYSEBkA3onvvfGTQaQ2jK9Mbe3A7gsOs1rRA1/5O Y3+1Ocw6wcnZBQhkLIoR9PJeGpx6SBhcay8+fH5S87rZlWFF3KSSgBiAzHcESA1QIPxZdv VibJkcZHWhQwim6n8X784ZdIFt8h/qh/XdJcyqE/vdx2p5fQbQbj8Bgfq9Ae4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197392; a=rsa-sha256; cv=none; b=ww1rMsyeyMkKpMI7ASVD8RVpmky4Kgm/f8xz1iA9/GYCi7rzRGwGv5rpyOdSjsZ7c/wYUz fwgIRXC07FZEOJAB+6McFazqRCMjhGB05cDcmRhtmFcPkp6eTHajPn/kZjL8p+WgJcNviN Mu+m/Hp2KI3HT7/3hRkC1wW4GcyI8UyGNxdGvtk9F1gbl5j7vk05zb6kPRhk3XJQN0Qg7x wzDJjmZMPxIZ9xGhOEobWROtxKax9+UmODgBaSPS1sbSgoMlGFh+BF9iIMBxKxkfFr6GU/ Ex8Hqp/Mwf5D4+TQXIcjsl114b6CyQUuavawqq6FLJm1UVBHryTYm1q88zNDsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KFtL5DH0/cZu6egOqt7sdpgP41o+FZUClsa43uGjECM=; b=itdf3Gcl0FwAFuFl7w1rB09WI71l9YSrWo94PgWkpPQMS9xknIhi/jplxgr6k0uhxvx2aC x4CYSA3HDYUiE31YJdykzqemsQIJDJRCyksnF+8NTcxX5cNNlB/No9gLb3hI9AG+7XJ6Ij TtP6aUz/83wSTkhW/p/s2Vh4YIsP6lo+r4wGAYbRXaUpf8T80MJQ8pvY7DptXilbfGzTWr sKeWUqn4k489bJHls7Kmo/Tq5M2o1KB6AofPt4bdiHQ+w3fmv1ChpSXjUigKYUD5keahCf WfDnSiwTncwPAfgWDHwasWK8hWfX+ZuzrkxXzqv3Y3PIqwkFf/9K/EqqPGpLTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxXmw1Z9jzW4k; Sun, 1 Sep 2024 13:29: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 481DTq9w031291; Sun, 1 Sep 2024 13:29:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DTqTr031288; Sun, 1 Sep 2024 13:29:52 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:29:52 GMT Message-Id: <202409011329.481DTqTr031288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: b8aeb7101724 - stable/14 - mixer(8) tests: Fix cleanup routine List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b8aeb7101724a0489509b3385571759014268e71 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b8aeb7101724a0489509b3385571759014268e71 commit b8aeb7101724a0489509b3385571759014268e71 Author: Olivier Cochard-Labbé AuthorDate: 2024-08-30 17:23:29 +0000 Commit: Christos Margiolis CommitDate: 2024-09-01 13:29:40 +0000 mixer(8) tests: Fix cleanup routine The tests correctly skip if no snd_dummy neither mixer is found, but the cleanup is still called with the skip condition, which fails if there is no mixer. MFC after: 2 days Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D46491 (cherry picked from commit 080c85127e3fba2c8cfb78cb75f7b306aee4028d) --- usr.sbin/mixer/tests/mixer_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/mixer/tests/mixer_test.sh b/usr.sbin/mixer/tests/mixer_test.sh index e1321ad9ee13..45003251c460 100755 --- a/usr.sbin/mixer/tests/mixer_test.sh +++ b/usr.sbin/mixer/tests/mixer_test.sh @@ -66,7 +66,8 @@ set_default() restore_default() { - test -r "test_mixer_deflt_unit" && mixer -d $(cat test_mixer_deflt_unit) + test -r "test_mixer_deflt_unit" && + mixer -d $(cat test_mixer_deflt_unit) || true } atf_test_case o_flag cleanup From nobody Sun Sep 1 14:09:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYfs0WKxz5VGcM; Sun, 01 Sep 2024 14:09: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 4WxYfr5R73z4Qfx; Sun, 1 Sep 2024 14:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5FsGTa4BPyawrhgoaPnxrh54ccANbd6G7NDH8uYlQOE=; b=f3Fh0Ivke5gqdOKMZFshZZ/Xpv6jzxZYs5pPfBnXgDf/Bq7uV1Mn18Ax0gPbVB9kBdvlOn uF/+Mabvjv41862SKFtT31KDqJRM7AeFZsePjMux5pkrAfTriEDayyWOJiV3FO5G1ElcRg J9h0Cnd3p8mgWsgHBcTsb1C5FtHuBKwOoUItUhgB783D+SDafnSbqM4+HQSq3klL+7SJtB UB1afdo/QdnM2fXoS91/gPdEdZis2X3q7nlANZtgxh7Ez5qy6vlIVsE/Y/4Ib5GcUbcdaK xPpwgwI0Q23fkQPN6DCYn4adpo2CoU87ZX3tHXAvQxkfn4sM1BMZeR/ijfDQuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199780; a=rsa-sha256; cv=none; b=Iy+fS0nKbcdzB+CKl9B0LEmVSdILZ10xoKOIYfzEbUcW3udJkUiQkUIAnADTU0awfJE66l wsU+K9bVsFZgMSttuj6kthERWQRNJGsbFq4iDyQ0ZXi9g0Pk1Y9oej54Jg+D/kOPQsmllj yqaSl0zxxWHXkd83BNtcEoNw96w/Hj25TyN8qoymt8PJlof5HJEzT5lQU9HULmAXZz28h8 BJ2v3iEq6Qk0JWExRdi1iDUhdZ/CG7LBFPJeEpliX1J5dE/LEMWJvVR8w626Tz33syNaHc BIJieb1kb/dl7ut9wwd6BA9S5L9fiLSWHktwwh7iVi4oRe4/XLuSWkg4xzO9Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5FsGTa4BPyawrhgoaPnxrh54ccANbd6G7NDH8uYlQOE=; b=Wtgd7PJ4Yze/GQL6WcMhy+AI6eKzPP+7mQ3w1pjrzaCMdw5MZaY7xRvv6DIvYYsloArGE9 pk4756pBJ/4kfZ50DOzz25IHGtdZ0WwPykHqStrTfGtAG5VDW6WelByELYbqOSGtxyDj7p h7snS9NBzpCqqdl1NIC9I97dwGQJDAu2IZi4xgJeFtjesuypB2m/MY7PM/S9/31sD40Uxu W81JzpD+qiPvXuV2hEyNR9twy0E8uXelcc70qeeC9PzHUQ4d0l+CME3h6rWJNkobepWniX XqbidGT//1de8TM8Dx3+hhMBFwaVe6ehxKipDyvBrSsjVzMwaRMzQAZvG7zndw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYfr52R7zXcw; Sun, 1 Sep 2024 14:09: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 481E9eFp099555; Sun, 1 Sep 2024 14:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481E9e3w099552; Sun, 1 Sep 2024 14:09:40 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:09:40 GMT Message-Id: <202409011409.481E9e3w099552@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: 780675e1bed9 - main - arm64: Fix the VM_MAX_NAMELEN definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 780675e1bed9fa8e328327e3b6416642a16b2a98 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=780675e1bed9fa8e328327e3b6416642a16b2a98 commit 780675e1bed9fa8e328327e3b6416642a16b2a98 Author: Mark Johnston AuthorDate: 2024-09-01 14:00:20 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:03:15 +0000 arm64: Fix the VM_MAX_NAMELEN definition The maximum VM name length has changed since the arm64 vmm code was forked. For now, just sync with the amd64 definitions, since they permit longer VM names. As arm64/vmm is implemented only in main, I won't bother dealing with backward compat. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46484 --- sys/arm64/include/vmm.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/arm64/include/vmm.h b/sys/arm64/include/vmm.h index 05b013557c06..acbd8f5cbcb9 100644 --- a/sys/arm64/include/vmm.h +++ b/sys/arm64/include/vmm.h @@ -102,14 +102,30 @@ enum vm_reg_name { #define VM_INTINFO_HWEXCEPTION (3 << 8) #define VM_INTINFO_SWINTR (4 << 8) -#define VM_MAX_SUFFIXLEN 15 - #define VM_GUEST_BASE_IPA 0x80000000UL /* Guest kernel start ipa */ -#ifdef _KERNEL - -#define VM_MAX_NAMELEN 32 +/* + * The VM name has to fit into the pathname length constraints of devfs, + * governed primarily by SPECNAMELEN. The length is the total number of + * characters in the full path, relative to the mount point and not + * including any leading '/' characters. + * A prefix and a suffix are added to the name specified by the user. + * The prefix is usually "vmm/" or "vmm.io/", but can be a few characters + * longer for future use. + * The suffix is a string that identifies a bootrom image or some similar + * image that is attached to the VM. A separator character gets added to + * the suffix automatically when generating the full path, so it must be + * accounted for, reducing the effective length by 1. + * The effective length of a VM name is 229 bytes for FreeBSD 13 and 37 + * bytes for FreeBSD 12. A minimum length is set for safety and supports + * a SPECNAMELEN as small as 32 on old systems. + */ +#define VM_MAX_PREFIXLEN 10 +#define VM_MAX_SUFFIXLEN 15 +#define VM_MAX_NAMELEN \ + (SPECNAMELEN - VM_MAX_PREFIXLEN - VM_MAX_SUFFIXLEN - 1) +#ifdef _KERNEL struct vm; struct vm_exception; struct vm_exit; From nobody Sun Sep 1 14:09:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYft01bfz5VGqZ; Sun, 01 Sep 2024 14:09: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 4WxYfs6RPNz4Qfy; Sun, 1 Sep 2024 14:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWxAv0QwF4LvPi3vVaUr0gnACOrMIItv83G5z0SAWpA=; b=u+dIAJZiHP9UP8To4UjVWeR2d4JN2rF66iZE8hQpW1WmnWTBycZLOcPC8B0U8N8yPMnp9b /t3FCRxVsxZR41q8TehK7einDuJZVYL1hI+G/YikD22BSsyrqWapjKZ4exOntNLolrJf14 JjUzb3BsnvZ3xgMfrL/S29gRkDoNCvCt5Vvu0TY6D82zWMuJgiKpB4e2oTYnLiG3HvTRGL QCcPZ5AE0QN91tdgOr5w6iiTa+ef8PXQ+6s0u3Jc3ujD6CiWV+yXzb3utN1bj/JCT4bk6Q tj9D8N/3uRt4HSuU2VGVchjdF0z8o7dREf9jjFOzQrrK3K3GmbzAI0H44R8Hkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199781; a=rsa-sha256; cv=none; b=M3L/wCJgerPJ81SOq6HxtFVGaeApoP1/9El2JScKNRk1H7HhGKQ66g+e6lqBEqbaQ/mSpF Zmqyy6ZusdHTHPj13kgznVjnZCE77X01qkFeb8EFE8t+9Lrl/IhcDHc9NK7t119nLqjA52 bVvcvPeEv7o9llKUaReWfEly9GEkta1g1yiGK4LcqPDen/92kP2m/omhGVJTZf+ykDOR1g Jtl+3xdQ0GS0IuQFFs8E5bsWRxaiYFJPOK8IYOPqTKv+W2EQHklIUp0QZE4Qxz9EjVkXJf yGvYHk8P8Adtkm/oHpuAKIwWZqQ8ecrNP6T/kgRcwLpQeAVarT49KFpbRFGEHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWxAv0QwF4LvPi3vVaUr0gnACOrMIItv83G5z0SAWpA=; b=SBEZbLRPNJ0+HkqJ0pmBlJLcH7hwSg56cR4HTLCcPoqoGSEuqw6ijYU22qudDqFmuEHsiV y8/IM9LtXJfZvhGTf+YmUce763Ku2M/tadshlbXlJ/JunnWWc1VtXznhsD7MEUZGCVmCtd 0NM2r09mHtrpH4xBzcdOZ9Upac0yRHBP3aAcHx+a/SZz0ohluSXJskt+uQtO/JokMLjtzI vGIDObhRitZrB+fsk4/D+AOH1FHtiJdGkPWyiRpvmXrHo0c/Mw++eWeTdB95QKXTrVRR6y rhHxeDQw3mL4Np/QuKJKMy+lh2trwTqL2CwrQRNHNkpaT7wx0BjWOp7x32oCUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYfs62pszXbK; Sun, 1 Sep 2024 14:09: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 481E9fNx099597; Sun, 1 Sep 2024 14:09:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481E9fhZ099594; Sun, 1 Sep 2024 14:09:41 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:09:41 GMT Message-Id: <202409011409.481E9fhZ099594@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: 133a513ddc9a - main - vmm: Make vmm_dev.h more self-contained List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 133a513ddc9aedf83489373f4af9971347bc6201 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=133a513ddc9aedf83489373f4af9971347bc6201 commit 133a513ddc9aedf83489373f4af9971347bc6201 Author: Mark Johnston AuthorDate: 2024-09-01 14:00:26 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:03:15 +0000 vmm: Make vmm_dev.h more self-contained vmm.h is required for VM_MAX_SUFFIXLEN. vmm_snapshot.h is required for struct vm_snapshot_meta. This is a prerequisite for including vmm_dev.h in the headers parsed by libsysdecode. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46485 --- sys/amd64/include/vmm_dev.h | 3 ++- sys/arm64/include/vmm_dev.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h index 5f347e46b9c4..b77b0ef5d996 100644 --- a/sys/amd64/include/vmm_dev.h +++ b/sys/amd64/include/vmm_dev.h @@ -29,7 +29,8 @@ #ifndef _VMM_DEV_H_ #define _VMM_DEV_H_ -struct vm_snapshot_meta; +#include +#include struct vm_memmap { vm_paddr_t gpa; diff --git a/sys/arm64/include/vmm_dev.h b/sys/arm64/include/vmm_dev.h index 08c237d31046..938bea47c7f8 100644 --- a/sys/arm64/include/vmm_dev.h +++ b/sys/arm64/include/vmm_dev.h @@ -27,6 +27,8 @@ #ifndef _VMM_DEV_H_ #define _VMM_DEV_H_ +#include + struct vm_memmap { vm_paddr_t gpa; int segid; /* memory segment */ From nobody Sun Sep 1 14:09:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYfv23SXz5VGjL; Sun, 01 Sep 2024 14:09: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 4WxYfv0K8Tz4Qd0; Sun, 1 Sep 2024 14:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tPN2cOMthTEcSylOs06U7IoekojfwgGOMbFasV/hjro=; b=Dg9y2VI1Qp09nLzRN0R90uqweKUU2yLrTqqXN4qJ1LuO/3vvyYTjKb8EuNAR7srTYUIcDD w/6OHDoUhcmCCsISg3AM6Ikfl5dyYwcsakYCQpD/C4rnRnAV0gLFYMT0S+k7tvfjsppJBi PP5m7eSNW4eeUatZP9bc/Qv/4mPzEODvME1m7skCMIPkjOXjEe1KP/1SsEOxJwpIyYXPLX 4fDy0yajrjiJ843ElmJRJbl9Qon026wxlyEqSwgF6eTx60bawGH1cdYskusDxjbLFuEkED 8jqXY5SBDQMQZurcbDy8A65q1hAwKngBVatVO94itJeZ2i3wDQSxnbIYX76DcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199783; a=rsa-sha256; cv=none; b=RLXpQiekPlLzCTXuAWJ6n5GKL5KVrxZiZxMS20B2r2jGICtUgi/GDzhojTA4WD/UQLl25x pZdaeENki5MGBOZZ1HutAWCTX29ETVdT9sAVQ+vwMsI5m9n+2Jgbif4bP90ldZWnO/nWEK fLL1GLt97nvyMIDTVcvdLcp+oUj8c7LfPLyTQDaXS6M1RJ59bxrNCYCTwcrqlcfh51L1IZ WSmtKIjhx/x5ViJp0zX0d+rnL8SJDLLVg/EtqQY2UyG4Lu2+L/6xlNmKJA5N3bgHXVXP7f KPMttppGfdzAroF8Upl+I+fFNKJ+nErMXiCz9lUprT3eTVUsqDVvqWGbs8vlMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tPN2cOMthTEcSylOs06U7IoekojfwgGOMbFasV/hjro=; b=c8jnm11Xwqlm2Y3GgJiCsJ5Ull/DpY2st23DMETDPhl9EwaMCQB347uNtaZA8joLNE6bN+ APxYmOPnMPqmiUTLkuBsH2zTJ4pK6QCJAm+NDyCfaamUc1MoNTeOZhb8aK9Jy0LD3avCI2 mYjh9HcYBlrPhNUcFVjWOBrcKYaAizyhCWa1saKgKNae8xwoKzhrPPxogjT6V4uHzZCUbJ pHpeXySX6UWkgoHP6Ch3IknX/kciP9sNebLr/O3kaBGAwc9uZDjSLSmIuZdf2z/unnJ/I4 AFa5OcdgPpo0Nl9IxsGnbE8ZegeX5b/3OFWhL0Ki/lVjO4uVmpRTbLzuVfBJ4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYft731DzX4l; Sun, 1 Sep 2024 14:09: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 481E9gGm099648; Sun, 1 Sep 2024 14:09:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481E9ghn099645; Sun, 1 Sep 2024 14:09:42 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:09:42 GMT Message-Id: <202409011409.481E9ghn099645@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: 4008758105a6 - main - vmm: Validate credentials when opening a vmmdev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4008758105a6da9eaa0b96b81dfb3042a33259be Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4008758105a6da9eaa0b96b81dfb3042a33259be commit 4008758105a6da9eaa0b96b81dfb3042a33259be Author: Mark Johnston AuthorDate: 2024-09-01 14:00:32 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:03:16 +0000 vmm: Validate credentials when opening a vmmdev Rather than performing privilege checks after a specific VM's device file is opened, do it once at the time the device file is opened. This means that one can continue to access a VM via its device fd after attaching to a jail which does not have vmm enabled, but this seems like a reasonable semantic to have anyway. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46486 --- sys/dev/vmm/vmm_dev.c | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index f43429de4d4c..b4ae2997006f 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -186,10 +186,6 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flags) void *hpa, *cookie; struct vmmdev_softc *sc; - error = vmm_priv_check(curthread->td_ucred); - if (error) - return (error); - sc = vmmdev_lookup2(cdev); if (sc == NULL) return (ENXIO); @@ -327,6 +323,32 @@ vm_set_register_set(struct vcpu *vcpu, unsigned int count, int *regnum, return (error); } +static int +vmmdev_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct vmmdev_softc *sc; + int error; + + sc = vmmdev_lookup2(dev); + KASSERT(sc != NULL, ("%s: device not found", __func__)); + + /* + * A user can only access VMs that they themselves have created. + */ + if (td->td_ucred != sc->ucred) + return (EPERM); + + /* + * A jail without vmm access shouldn't be able to access vmm device + * files at all, but check here just to be thorough. + */ + error = vmm_priv_check(td->td_ucred); + if (error != 0) + return (error); + + return (0); +} + static const struct vmmdev_ioctl vmmdev_ioctls[] = { VMMDEV_IOCTL(VM_GET_REGISTER, VMMDEV_IOCTL_LOCK_ONE_VCPU), VMMDEV_IOCTL(VM_SET_REGISTER, VMMDEV_IOCTL_LOCK_ONE_VCPU), @@ -375,10 +397,6 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, const struct vmmdev_ioctl *ioctl; int error, vcpuid; - error = vmm_priv_check(td->td_ucred); - if (error) - return (error); - sc = vmmdev_lookup2(cdev); if (sc == NULL) return (ENXIO); @@ -681,10 +699,6 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, vm_size_t mapsize, int error, found, segid; bool sysmem; - error = vmm_priv_check(curthread->td_ucred); - if (error) - return (error); - first = *offset; last = first + mapsize; if ((nprot & PROT_EXEC) || first < 0 || first >= last) @@ -833,6 +847,7 @@ SYSCTL_PROC(_hw_vmm, OID_AUTO, destroy, static struct cdevsw vmmdevsw = { .d_name = "vmmdev", .d_version = D_VERSION, + .d_open = vmmdev_open, .d_ioctl = vmmdev_ioctl, .d_mmap_single = vmmdev_mmap_single, .d_read = vmmdev_rw, From nobody Sun Sep 1 14:09:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYfw3xq9z5VGnN; Sun, 01 Sep 2024 14:09: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 4WxYfw1PTPz4Qd5; Sun, 1 Sep 2024 14:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWcGKZsDMXGZ8ju+UCTOZlIicu/oKFKVKWTqN7tPIrk=; b=SJ4UErBF9jDGqGBBuTa6j+NfCpbRaSypObgx4WkR9ZWJWh87vFx9vr/+WqNQyAdNZcSx6K HQoedNjQ+UdfvUQ6GvwcM0Rphtx/De6QFnyXZou9omH84KiVeYwcpSxlKg8efvJCSVUpmH NXPGXlp5qEoC4SwXe6hue94Tc9kglx3c07uITZFged70MU4qJJcbZ1+EwMlck3IBDp3hZN KZvtJlqDD6zOviQnQWJeMY7C3wVSjrfI1k4z4cTsxa7KXb/imClsiOUU/rZ+znwnYYOX4L sBMn7T4SlqAbpUTfTcIdw5LBUspLjPjF9Gw6c1maup9f8xNwGeKZitYmhKu5Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199784; a=rsa-sha256; cv=none; b=C8oXWfUtNULB0jasvKZyOF4zHgQFKALGmORs7fzPWAWR85sdtOdULQZl2CuqAc2qs4nxYL 4c4UNlXwTztUmeJfLVVRR7GidkJicNi4IGh8fD9VTzvqdBGfnGjxMoUix7gBiaBmh+OHVS CqY2eQ+0dIg9zGFP6UPRX+Wi0y4Xy4YZuGN3RZ3vBmodOpo5ou+mYZ64KIETVTSicYD3ip 2EN53gokA47w3JsKxqD2Fqm5O3ISZuR9T+xu9RbxfbszJZSe8mEWMh92+eMaLuXPOtBaFR USVxEIWLeDGEzhIy7r5TUQW59nSs7RmLUoGJIAeaYaWTnTiX4bdgetAbQUntwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWcGKZsDMXGZ8ju+UCTOZlIicu/oKFKVKWTqN7tPIrk=; b=e7ZIWspJDtSJ6j1oShc0z93wRB9Jv1oVlQcGGVNuwqnQ5feSNiC+D3UCy9hMeWBNz28UG2 HzZDVa/J65dR856gPRXUsSphFYOyg2NkPlUE2s1TFisj62dYJLqYq+syS2c8ft175q6Hbm Ohx0cT3VJaDUEtPRBA3eDk7/VDW9vjN4qmsq46c5BLsJf193o34JvEwmbnb3KXCzymqoGQ 9Oh1/aoWhnrazWDqC/yFB0B8IGo+9OatS4OgUVQzlB9bgd0PDrFkJ6lTKs5ZYvOH0NW3aW 0gKHAa9Z8GFZnrut+fOUEG/P0Xb+lweldSygZIjQ8J/Qth8F1FiAaWozbkhDrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYfw0zBQzX4m; Sun, 1 Sep 2024 14:09: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 481E9ifg099704; Sun, 1 Sep 2024 14:09:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481E9ixt099701; Sun, 1 Sep 2024 14:09:44 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:09:44 GMT Message-Id: <202409011409.481E9ixt099701@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: 887c0877a642 - main - vmm: Use an sx lock for vmmdev_mtx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 887c0877a642c7427aff0cfd0d844b2711e71e1e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=887c0877a642c7427aff0cfd0d844b2711e71e1e commit 887c0877a642c7427aff0cfd0d844b2711e71e1e Author: Mark Johnston AuthorDate: 2024-09-01 14:00:36 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:03:16 +0000 vmm: Use an sx lock for vmmdev_mtx This will make it easier to atomically create the device file and set its si_drv1 member. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D46487 --- sys/dev/vmm/vmm_dev.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index b4ae2997006f..91d33ccba261 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -13,9 +13,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -63,8 +63,8 @@ struct vmmdev_softc { static SLIST_HEAD(, vmmdev_softc) head; static unsigned pr_allow_flag; -static struct mtx vmmdev_mtx; -MTX_SYSINIT(vmmdev_mtx, &vmmdev_mtx, "vmm device mutex", MTX_DEF); +static struct sx vmmdev_mtx; +SX_SYSINIT(vmmdev_mtx, &vmmdev_mtx, "vmm device mutex"); static MALLOC_DEFINE(M_VMMDEV, "vmmdev", "vmmdev"); @@ -156,7 +156,7 @@ vmmdev_lookup(const char *name, struct ucred *cred) { struct vmmdev_softc *sc; - mtx_assert(&vmmdev_mtx, MA_OWNED); + sx_assert(&vmmdev_mtx, SA_XLOCKED); SLIST_FOREACH(sc, &head, link) { if (strcmp(name, vm_name(sc->vm)) == 0) @@ -785,9 +785,9 @@ vmmdev_destroy(struct vmmdev_softc *sc) crfree(sc->ucred); if ((sc->flags & VSC_LINKED) != 0) { - mtx_lock(&vmmdev_mtx); + sx_xlock(&vmmdev_mtx); SLIST_REMOVE(&head, sc, vmmdev_softc, link); - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); } free(sc, M_VMMDEV); @@ -799,10 +799,10 @@ vmmdev_lookup_and_destroy(const char *name, struct ucred *cred) struct cdev *cdev; struct vmmdev_softc *sc; - mtx_lock(&vmmdev_mtx); + sx_xlock(&vmmdev_mtx); sc = vmmdev_lookup(name, cred); if (sc == NULL || sc->cdev == NULL) { - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); return (EINVAL); } @@ -812,7 +812,7 @@ vmmdev_lookup_and_destroy(const char *name, struct ucred *cred) */ cdev = sc->cdev; sc->cdev = NULL; - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); destroy_dev(cdev); vmmdev_destroy(sc); @@ -874,9 +874,9 @@ vmmdev_create(const char *name, struct ucred *cred) struct vm *vm; int error; - mtx_lock(&vmmdev_mtx); + sx_xlock(&vmmdev_mtx); sc = vmmdev_lookup(name, cred); - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); if (sc != NULL) return (EEXIST); @@ -890,16 +890,16 @@ vmmdev_create(const char *name, struct ucred *cred) * Lookup the name again just in case somebody sneaked in when we * dropped the lock. */ - mtx_lock(&vmmdev_mtx); + sx_xlock(&vmmdev_mtx); sc2 = vmmdev_lookup(name, cred); if (sc2 != NULL) { - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); vmmdev_destroy(sc); return (EEXIST); } sc->flags |= VSC_LINKED; SLIST_INSERT_HEAD(&head, sc, link); - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmdevsw, sc->ucred, UID_ROOT, GID_WHEEL, 0600, "vmm/%s", name); @@ -908,10 +908,10 @@ vmmdev_create(const char *name, struct ucred *cred) return (error); } - mtx_lock(&vmmdev_mtx); + sx_xlock(&vmmdev_mtx); sc->cdev = cdev; sc->cdev->si_drv1 = sc; - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); return (0); } @@ -1019,10 +1019,10 @@ devmem_create_cdev(struct vmmdev_softc *sc, int segid, char *devname) dsc = malloc(sizeof(struct devmem_softc), M_VMMDEV, M_WAITOK | M_ZERO); - mtx_lock(&vmmdev_mtx); + sx_xlock(&vmmdev_mtx); if (sc->cdev == NULL) { /* virtual machine is being created or destroyed */ - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); free(dsc, M_VMMDEV); destroy_dev_sched_cb(cdev, NULL, 0); return (ENODEV); @@ -1033,7 +1033,7 @@ devmem_create_cdev(struct vmmdev_softc *sc, int segid, char *devname) dsc->cdev = cdev; dsc->sc = sc; SLIST_INSERT_HEAD(&sc->devmem, dsc, link); - mtx_unlock(&vmmdev_mtx); + sx_xunlock(&vmmdev_mtx); /* The 'cdev' is ready for use after 'si_drv1' is initialized */ cdev->si_drv1 = dsc; From nobody Sun Sep 1 14:09:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYfx5bDbz5VGjM; Sun, 01 Sep 2024 14:09: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 4WxYfx27ygz4Qrh; Sun, 1 Sep 2024 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=grDxcspXMaSnbwBUgqBkUbLCWmyKwlELf1fblCPrMs4=; b=Uv8gZ1Mt+qHKt2g+VLIYY6rAgwqYWBYzpX0BTnx6CJE+BpILNn/a9acIEV1qhom5K5a3xh qeW/EEqbzeByN177SuRoojCNpnG/CDb9THan16UGuanPKD5/d/ZOHI0jSJiAlhIM36SDms BlbOzE3eqp9LJ65xFABGwV0Y9WSbQKymbH4KBJXI/HGPJr/RApdOx4BK30HK8wHf0wWy6v qy2rmkL2v82RC7DfM8AnCAqZo/ewfjMLOTdQ62tP5QypXKyj26EYWjhrrNUzbhd5MNNkCB TwXNx/7KvEEegNEdRe3+SPjjS7Wnl97CBUjuJy9Dum7feciVerO6ZXJdW4pa3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199785; a=rsa-sha256; cv=none; b=Vx7lQguB9OajRpRYAJa6L3Kh4jD4fRJOE2WDK9pWdGcHbTxri5xPCheYRdBnILxB+RTqJX xBi5dnAwaxuR+9qwT9AaBteK0Es7Nch2U5boctdgMjOwLbNaUkhZIzc91sEX+3jhjxnXeY 28LrdP/oNcKMLIQ+FgVPjcZWWgMKrEIguX6ev10YLUuJPAGrdx2pIXD14NjmWNdBvSjeAy V0QXIaclhGTcbVqtKHnIXYC43LSVtwcU+HuxhiN9mPw20/Xn1MaF9Z1Qh+As+rrZ+Hx4lL 5vCp2ubq09y6Rmgy47BjtJdWjj5R3pko/kmVnN2f1ZXDgB7NT+W2ObyuJQCOfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=grDxcspXMaSnbwBUgqBkUbLCWmyKwlELf1fblCPrMs4=; b=OGBcl0uHmbDGXkwH+lmkpa9hZmMRNVw4CpYWHIRjpmBbHdvW3uR/om2tFeWWdbqJjK7sGb dXbieF87eJwoa5OI/u8/tn6HxkXf/2CCoKZh6W13lQiWSDqhQZXJ28jTFDeg5z4tX5GfI1 I0/eV7tDAMJ40qqStISWv7uy+erxQ8mAey5OCkJRaCa1PWHGT0fhZGirRCOeDbpbZc0LJ/ J7zujsTIFwbUrMugwZBAThvFLCh5JDDIWihmQkxXBWTVNBslfQHtvGRqVkS8U9Y83dnHIG YnVl3gb016SZX1xcqNS+v1yOEFxFgDjX9FGAFIshYCLJKqT8thCvr79AAMrdJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYfx1lV2zX1s; Sun, 1 Sep 2024 14:09: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 481E9jqK099752; Sun, 1 Sep 2024 14:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481E9jQx099749; Sun, 1 Sep 2024 14:09:45 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:09:45 GMT Message-Id: <202409011409.481E9jQx099749@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: cef5f43f819c - main - vmm: Use make_dev_s() to create vmm devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cef5f43f819cecdbd16f9686e8186d055b19479e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cef5f43f819cecdbd16f9686e8186d055b19479e commit cef5f43f819cecdbd16f9686e8186d055b19479e Author: Mark Johnston AuthorDate: 2024-09-01 14:00:39 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:09:17 +0000 vmm: Use make_dev_s() to create vmm devices This avoids creating windows where a device file is accessible but the device-specific field is not set. Now that vmmdev_mtx is a sleepable lock, avoid dropping it while creating devices files. This makes it easier to handle races and simplifies some code; for example, the VSC_LINKED flag is no longer needed. Suggested by: jhb Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D46488 --- sys/dev/vmm/vmm_dev.c | 103 +++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 59 deletions(-) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 91d33ccba261..ea2aaace832c 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -58,7 +58,6 @@ struct vmmdev_softc { SLIST_HEAD(, devmem_softc) devmem; int flags; }; -#define VSC_LINKED 0x01 static SLIST_HEAD(, vmmdev_softc) head; @@ -750,6 +749,8 @@ vmmdev_destroy(struct vmmdev_softc *sc) struct devmem_softc *dsc; int error __diagused; + KASSERT(sc->cdev == NULL, ("%s: cdev not free", __func__)); + /* * Destroy all cdevs: * @@ -759,7 +760,6 @@ vmmdev_destroy(struct vmmdev_softc *sc) */ SLIST_FOREACH(dsc, &sc->devmem, link) { KASSERT(dsc->cdev != NULL, ("devmem cdev already destroyed")); - destroy_dev(dsc->cdev); devmem_destroy(dsc); } @@ -775,21 +775,15 @@ vmmdev_destroy(struct vmmdev_softc *sc) free(dsc, M_VMMDEV); } - if (sc->cdev != NULL) - destroy_dev(sc->cdev); - if (sc->vm != NULL) vm_destroy(sc->vm); if (sc->ucred != NULL) crfree(sc->ucred); - if ((sc->flags & VSC_LINKED) != 0) { - sx_xlock(&vmmdev_mtx); - SLIST_REMOVE(&head, sc, vmmdev_softc, link); - sx_xunlock(&vmmdev_mtx); - } - + sx_xlock(&vmmdev_mtx); + SLIST_REMOVE(&head, sc, vmmdev_softc, link); + sx_xunlock(&vmmdev_mtx); free(sc, M_VMMDEV); } @@ -869,50 +863,43 @@ vmmdev_alloc(struct vm *vm, struct ucred *cred) static int vmmdev_create(const char *name, struct ucred *cred) { + struct make_dev_args mda; struct cdev *cdev; - struct vmmdev_softc *sc, *sc2; + struct vmmdev_softc *sc; struct vm *vm; int error; sx_xlock(&vmmdev_mtx); sc = vmmdev_lookup(name, cred); - sx_xunlock(&vmmdev_mtx); - if (sc != NULL) + if (sc != NULL) { + sx_xunlock(&vmmdev_mtx); return (EEXIST); + } error = vm_create(name, &vm); - if (error != 0) - return (error); - - sc = vmmdev_alloc(vm, cred); - - /* - * Lookup the name again just in case somebody sneaked in when we - * dropped the lock. - */ - sx_xlock(&vmmdev_mtx); - sc2 = vmmdev_lookup(name, cred); - if (sc2 != NULL) { + if (error != 0) { sx_xunlock(&vmmdev_mtx); - vmmdev_destroy(sc); - return (EEXIST); + return (error); } - sc->flags |= VSC_LINKED; + sc = vmmdev_alloc(vm, cred); SLIST_INSERT_HEAD(&head, sc, link); - sx_xunlock(&vmmdev_mtx); - error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmdevsw, sc->ucred, - UID_ROOT, GID_WHEEL, 0600, "vmm/%s", name); + make_dev_args_init(&mda); + mda.mda_devsw = &vmmdevsw; + mda.mda_cr = sc->ucred; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = sc; + mda.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; + error = make_dev_s(&mda, &cdev, "vmm/%s", name); if (error != 0) { + sx_xunlock(&vmmdev_mtx); vmmdev_destroy(sc); return (error); } - - sx_xlock(&vmmdev_mtx); sc->cdev = cdev; - sc->cdev->si_drv1 = sc; sx_xunlock(&vmmdev_mtx); - return (0); } @@ -1005,39 +992,37 @@ static struct cdevsw devmemsw = { static int devmem_create_cdev(struct vmmdev_softc *sc, int segid, char *devname) { + struct make_dev_args mda; struct devmem_softc *dsc; - struct cdev *cdev; - const char *vmname; int error; - vmname = vm_name(sc->vm); - - error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &devmemsw, sc->ucred, - UID_ROOT, GID_WHEEL, 0600, "vmm.io/%s.%s", vmname, devname); - if (error) - return (error); - - dsc = malloc(sizeof(struct devmem_softc), M_VMMDEV, M_WAITOK | M_ZERO); - sx_xlock(&vmmdev_mtx); - if (sc->cdev == NULL) { - /* virtual machine is being created or destroyed */ - sx_xunlock(&vmmdev_mtx); - free(dsc, M_VMMDEV); - destroy_dev_sched_cb(cdev, NULL, 0); - return (ENODEV); - } + dsc = malloc(sizeof(struct devmem_softc), M_VMMDEV, M_WAITOK | M_ZERO); dsc->segid = segid; dsc->name = devname; - dsc->cdev = cdev; dsc->sc = sc; SLIST_INSERT_HEAD(&sc->devmem, dsc, link); + + make_dev_args_init(&mda); + mda.mda_devsw = &devmemsw; + mda.mda_cr = sc->ucred; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = dsc; + mda.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; + error = make_dev_s(&mda, &dsc->cdev, "vmm.io/%s.%s", vm_name(sc->vm), + devname); + if (error != 0) { + SLIST_REMOVE(&sc->devmem, dsc, devmem_softc, link); + free(dsc->name, M_VMMDEV); + free(dsc, M_VMMDEV); + } + sx_xunlock(&vmmdev_mtx); - /* The 'cdev' is ready for use after 'si_drv1' is initialized */ - cdev->si_drv1 = dsc; - return (0); + return (error); } static void @@ -1045,7 +1030,7 @@ devmem_destroy(void *arg) { struct devmem_softc *dsc = arg; - KASSERT(dsc->cdev, ("%s: devmem cdev already destroyed", __func__)); + destroy_dev(dsc->cdev); dsc->cdev = NULL; dsc->sc = NULL; } From nobody Sun Sep 1 14:10:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYgF5YTBz5VGg9; Sun, 01 Sep 2024 14:10: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 4WxYgF3zR8z4RbD; Sun, 1 Sep 2024 14:10:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vIGZ1e1vUwxFps+6s6V5AgSSBY4Yn0XtP+RI8rYuUvc=; b=BUxkEQZcfMrUjGEnDxmxFrJ2Rk2fNKnyjUmgXuocxEFe1KjpLJ0zHQmIOzB20n4UFamvds 4TBxWUB4Jicy1EEofSDud9M/X3Eg5Pa99HO5yLbXkHw4Mz2UoVHzXjqA2cTPg74RM42dKF 6B2UjmMt4eeF/rpTWh85rFSdCZDt21Rt/tN0PNBtMJWhStMQK12NmQNqbwLPetR+nNkuIG kvRo2iIJ7vv1CWiAucK7FkSnH3H/J4nkSJtXdTMoMaDCK1MDHIRuhO0YLmZS/SpfTAntBX qrcs+MvfGhhBUV44xizk0XFCFff1B8mge3K8qDMO/U9tbXCikbJ3OmtY2i7Bvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199801; a=rsa-sha256; cv=none; b=sH7hsOqp3/SUPCKPzNNH6dVvFAFAdPDslmZ7iRw2d0YrwElV4qthXKX3M9r5Amx0llI/l7 NEEiDyK4T3HAOBO0PWe11L8NlvPUGDBXLOXLwR/eEkd4PSskupeqWo5IZhI5ggVfntL3Xy dax1wBS4thSTREkisAk1Kw33DAAM/0NEHN1Di0Do/F2Gy+CtgA77iSpsrX6waH/4sVCboK z60xy2+WBURk0O0kv0kPhtXy4ZgvOYZHZe09UcXleO79LSpsTnBcvPuoed6VJMUn46H7ec vSJLOyKUGTseiiNUbrqgBDcx6OEUG3mQI2jN7hS6a7IZF0hk73/Qcoga2blCrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vIGZ1e1vUwxFps+6s6V5AgSSBY4Yn0XtP+RI8rYuUvc=; b=EXAligQlVS0hJuonjWlTh2JTLdL+ge4GzrPtbAm4HVtsqdUK+soM6kG54GVOkaW7zHuBbS cxWlYdm1VxjT4gUG+ew9saGa9F1oup+McKCOl+L02vg9UJf56m6zKolT2tJomMmHpDLb5y JvLmFFM5916efGSTWcgMf+ckPAnUmSWI4qkfN+NNPeqYiiRh2sOgzxHLN5wqb8rgawY4nw 7rR3Lqhdf/tLf3CQuNxv0DvtrtZrCA6Mqz7fsXqnKrNSYVz33pyxXL1120t9+0ZK8tg+Y1 t4ypy1RwSHMHkVbcmYu1Fnue7Vmk00IjkJt1wOUgY++zLXoBtTirz4P2Yg9WkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYgF3Wh1zXM5; Sun, 1 Sep 2024 14:10: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 481EA1mb001752; Sun, 1 Sep 2024 14:10:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481EA1Er001747; Sun, 1 Sep 2024 14:10:01 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:10:01 GMT Message-Id: <202409011410.481EA1Er001747@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: 7d508464f56c - main - carp: Fix pullup checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d508464f56cf262465fd23ab96e357d8e42c927 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d508464f56cf262465fd23ab96e357d8e42c927 commit 7d508464f56cf262465fd23ab96e357d8e42c927 Author: Mark Johnston AuthorDate: 2024-08-31 01:18:23 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:09:53 +0000 carp: Fix pullup checks The conditions used to test whether a pullup is needed were inverted. While here: - Fix a bogus assignment to "iplen": it's already initialized to *offp. - Use in_cksum_skip() instead of manually adjusting the data pointer. Otherwise the mbuf is temporarily in an invalid state, since m_len isn't updated to match. Reported by: KMSAN Reviewed by: kp Sponsored by: Klara, Inc. Fixes: 37115154672f ("carp: support VRRPv3") Differential Revision: https://reviews.freebsd.org/D46492 --- sys/netinet/ip_carp.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 9f163c1097ba..ab001d346313 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -516,7 +516,7 @@ static int carp_input(struct mbuf **mp, int *offp, int proto) { struct mbuf *m = *mp; - struct ip *ip = mtod(m, struct ip *); + struct ip *ip; struct vrrpv3_header *vh; int iplen; int minlen; @@ -532,9 +532,6 @@ carp_input(struct mbuf **mp, int *offp, int proto) return (IPPROTO_DONE); } - iplen = ip->ip_hl << 2; - totlen = ntohs(ip->ip_len); - /* Ensure we have enough header to figure out the version. */ if (m->m_pkthdr.len < iplen + sizeof(*vh)) { CARPSTATS_INC(carps_badlen); @@ -545,14 +542,15 @@ carp_input(struct mbuf **mp, int *offp, int proto) return (IPPROTO_DONE); } - if (iplen + sizeof(*vh) < m->m_len) { + if (m->m_len < iplen + sizeof(*vh)) { if ((m = m_pullup(m, iplen + sizeof(*vh))) == NULL) { CARPSTATS_INC(carps_hdrops); CARP_DEBUG("%s():%d: pullup failed\n", __func__, __LINE__); return (IPPROTO_DONE); } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); + totlen = ntohs(ip->ip_len); vh = (struct vrrpv3_header *)((char *)ip + iplen); switch (vh->vrrp_version) { @@ -581,7 +579,7 @@ carp_input(struct mbuf **mp, int *offp, int proto) return (IPPROTO_DONE); } - if (iplen + minlen < m->m_len) { + if (m->m_len < iplen + minlen) { if ((m = m_pullup(m, iplen + minlen)) == NULL) { CARPSTATS_INC(carps_hdrops); CARP_DEBUG("%s():%d: pullup failed\n", __func__, __LINE__); @@ -596,15 +594,13 @@ carp_input(struct mbuf **mp, int *offp, int proto) struct carp_header *ch; /* verify the CARP checksum */ - m->m_data += iplen; - if (in_cksum(m, totlen - iplen)) { + if (in_cksum_skip(m, totlen, iplen)) { CARPSTATS_INC(carps_badsum); CARP_DEBUG("%s: checksum failed on %s\n", __func__, if_name(m->m_pkthdr.rcvif)); m_freem(m); break; } - m->m_data -= iplen; ch = (struct carp_header *)((char *)ip + iplen); carp_input_c(m, ch, AF_INET, ip->ip_ttl); break; @@ -689,7 +685,7 @@ carp6_input(struct mbuf **mp, int *offp, int proto) return (IPPROTO_DONE); } - if (sizeof (*ip6) + minlen < m->m_len) { + if (m->m_len < sizeof(*ip6) + minlen) { if ((m = m_pullup(m, sizeof(*ip6) + minlen)) == NULL) { CARPSTATS_INC(carps_hdrops); CARP_DEBUG("%s():%d: pullup failed\n", __func__, __LINE__); @@ -704,15 +700,14 @@ carp6_input(struct mbuf **mp, int *offp, int proto) struct carp_header *ch; /* verify the CARP checksum */ - m->m_data += *offp; - if (in_cksum(m, sizeof(struct carp_header))) { + if (in_cksum_skip(m, *offp + sizeof(struct carp_header), + *offp)) { CARPSTATS_INC(carps_badsum); CARP_DEBUG("%s: checksum failed, on %s\n", __func__, if_name(m->m_pkthdr.rcvif)); m_freem(m); break; } - m->m_data -= *offp; ch = (struct carp_header *)((char *)ip6 + sizeof(*ip6)); carp_input_c(m, ch, AF_INET6, ip6->ip6_hlim); break; From nobody Sun Sep 1 14:10:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxYgG5zMMz5VGjV; Sun, 01 Sep 2024 14:10: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 4WxYgG4Vf0z4RQH; Sun, 1 Sep 2024 14:10:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iYBkoL/YIQeEB6oiTRUpvqcCu4jI3aa5/lLChaENyME=; b=JhP95OO96WOjD5/eXdcYgZMrUvzcSFsXjcTS6T4H0AJwSzRosECIyR9kebXzdVmDt6euhK e1RF9zbFX3lcQqFznEDj6hQsQUKvL97KwGkdQMQMRNR9J1pyLh35THAa0nxcKMeTfiZwW8 e5Ta1rdbpIIY4d0gOs/ar1oJW+w+7E+b7kmgwi8QYXAhboX+RthJvTN8jjC4UC9cf65IZC WV4Fetn4ITogLFZnBMFAHPGIbpiXX+SZs6hY0aDZt6ZjGEnFE+Py7qAd+oB9Otlk/tQduh PfhPKShVyqcIJvPG4MwVMg1A0MdP7MZ6JzZPCfdfyqloiK+l44nMNhSAxNtMKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725199802; a=rsa-sha256; cv=none; b=uRSerYAaghp7/t+R108uWvzBihCzDhqddyPQF6h94V31WusLbp8l0PKPe9r8EeDOANdg4K 7qg+WkmexmbXA3MMj31gsyQuwFFe0At6mJRQmwHyj2Ar/76QetQcI0loM0yWclxf0VCn0h THjTlwfqaMDXzWjDQgFRGvBNR5X348GRqnq7A/Bde0OiEMG8dY5XOPBAvpIBubP3S3gK1x n747SVBRUc+8YbFmngHybUvnGSXHRo1ZUjikA4+q/h+YKmopwuTcPIQD2S90rbh/VqMo6x IzHvzmow7f5mTj1+/WwEzLyLwYmdMIgYOBH+p1KsijSbJLH1wAmpITIUysYb0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725199802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iYBkoL/YIQeEB6oiTRUpvqcCu4jI3aa5/lLChaENyME=; b=mRs9/qEr1Nw5STffrpkAb8RrLcJpNk5mueI+E4uvq/AeXS7FjtEc0e8MSPJgBGc6cr67S9 xnvhxG5MzZ1jRujGUTSdPJVqMnW5SY0TJOuMxcH0TbKr6J+Du9qsfiXf020pnLJVHuCaxM tpZOlBFMC0Y9fQEuQK4/Mqd4tbO1Eec5n5lCb7JR4VmbJecOgURoFCEFPVO7Qos/hdS8NS dspGSGAAZdOGIPE5vBbV7W+EVaB5lEl0zt+NSs7IosYf3anN3sn8iJiWRCxSYWJ3GARewO f+mFlkL1mokbYfVPex5eoKBRGXLp7EwUVe1ZV8zcmPiMhA0D0F3XbSLGbUQQCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxYgG46xWzXM6; Sun, 1 Sep 2024 14:10: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 481EA2at002066; Sun, 1 Sep 2024 14:10:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481EA2H5002061; Sun, 1 Sep 2024 14:10:02 GMT (envelope-from git) Date: Sun, 1 Sep 2024 14:10:02 GMT Message-Id: <202409011410.481EA2H5002061@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: 61295e098599 - main - dummymbuf: Avoid copyout of uninitialized memory from the sysctl handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61295e09859953cce5140daf9c2ff85b3feb0e74 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=61295e09859953cce5140daf9c2ff85b3feb0e74 commit 61295e09859953cce5140daf9c2ff85b3feb0e74 Author: Mark Johnston AuthorDate: 2024-08-31 01:19:09 +0000 Commit: Mark Johnston CommitDate: 2024-09-01 14:09:53 +0000 dummymbuf: Avoid copyout of uninitialized memory from the sysctl handler If *rulesp was initially unset, we'll allocate a new buffer and pass it to sysctl_handle_string(), which copies the existing string out and then copies in the new string. We need to make sure the buffer containing the existing rules is initialized, otherwise we leak kernel memory to userspace. Fix some nearby style nits while here. Reported by: KMSAN Reviewed by: igoro, kp Fixes: 8aaffd78c0f5 ("Add dummymbuf module for testing purposes") Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46493 --- sys/net/dummymbuf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/net/dummymbuf.c b/sys/net/dummymbuf.c index 8c46421888ed..d4ba00b13235 100644 --- a/sys/net/dummymbuf.c +++ b/sys/net/dummymbuf.c @@ -74,7 +74,7 @@ dmb_sysctl_handle_rules(SYSCTL_HANDLER_ARGS) char **rulesp = (char **)arg1; if (req->newptr == NULL) { - // read only + /* read only */ DMB_RULES_SLOCK(); arg1 = *rulesp; if (arg1 == NULL) { @@ -84,10 +84,12 @@ dmb_sysctl_handle_rules(SYSCTL_HANDLER_ARGS) error = sysctl_handle_string(oidp, arg1, arg2, req); DMB_RULES_SUNLOCK(); } else { - // read and write + /* read and write */ DMB_RULES_XLOCK(); - if (*rulesp == NULL) - *rulesp = malloc(arg2, M_DUMMYMBUF_RULES, M_WAITOK); + if (*rulesp == NULL) { + *rulesp = malloc(arg2, M_DUMMYMBUF_RULES, + M_WAITOK | M_ZERO); + } arg1 = *rulesp; error = sysctl_handle_string(oidp, arg1, arg2, req); DMB_RULES_XUNLOCK(); @@ -99,8 +101,7 @@ dmb_sysctl_handle_rules(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_dummymbuf, OID_AUTO, rules, CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(dmb_rules), RULES_MAXLEN, dmb_sysctl_handle_rules, "A", - "{inet | inet6 | ethernet} {in | out} [ ];" - " ...;"); + "{inet | inet6 | ethernet} {in | out} []; ...;"); /* * Statistics From nobody Sun Sep 1 15:06:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxZw04TXkz5MQsd; Sun, 01 Sep 2024 15:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxZw03xFtz4Y9v; Sun, 1 Sep 2024 15:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMFCas+9Wa5psixLpE2pgL9Xc7SZLDStyQbF8f7W1pA=; b=vI+B0F06xfv3cZD/HcoOz/29TDmrdFsONlowlFUYgaFQpTGDr+CsKfgnlMG6qWrsj9ZRMD fOApmNmcsL2CKQFKBtgiEScoj626zYxXggJB1dmIkHoXT6KJbZEdYVHbuyIBTSfgoAaZMU bP+bEUsxu/UYePCVLzL39byWQL6yb1O/eslX4H8DRKUDdTFzo4h+HXU8CjL3beSA6cG1bS fptaRZssr5VL1DEX0+pmFvlR+VmQpann5oAjSZklLxazOGYodjvjFVkjIb763mRUxNdYaW nDG7XDQmgVyEet7+wj8q8QpTjAbRcoRNjzadgwXyF88T5jSxDJpFnk+7AUlktg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725203168; a=rsa-sha256; cv=none; b=pNy9YoOBWStBkwttIC6DZDEJ6OwhaMw84zKe65eXBtEQkjrglEpzLGHyeNdxCK/9S3luPe MFiaN7oRoLWH2i7yTV2Ycr3Xsv2DXSK6g7tqPW9geAQBNx4n9CDxVobbu7IIzBjxziIJDf N2V/hThJbeq5UNj7jOEF6UNNwe3VLCqAM9V720Ppb2CDhMUiWMe+eON1vmNSeqBciV+4xB q9LUBsj4nXkZwXrDBbPBTr0qEJyBgogG3f6tdp/UpVMJqfhHWOg+lWLqZPGM0oFYWFCKae lehDWEl4hUiIscKXtTnJf5ghioCkZnFCOQzLcL5DgDJWgvLrrZnqHZXtAlX7pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMFCas+9Wa5psixLpE2pgL9Xc7SZLDStyQbF8f7W1pA=; b=MoIJZ8T3zvVtGjKR7pihCd/+HT9wBXZ825Nr9mkV47jNaaNTY4anXm2WpJJxlROH1sMQhP z8JFXga0LFVDhlcgPFTI5KG1oTKUxRMsYm49SO4WhHdytuI6nwWnEWL6NfJ3p12TQ3dORh FXE/+2dxrkwZ7vYKmpEx4BQwIgh6Z2Yvqi30CDXfxJrApuqBg/+m+cjl5FQ7PuMiRmaxQV AadZJXx3EFbHXRLLe1w5ztCrjUbAp1dT5qBeaWf12yNQcbAKs9DnSIIQZprIMRW6M7TVhu f/vXokQNxkAIHduyJq749/fFiXRtAhh0QhNZAg2VrohUoFESpcVsBGENRkaoYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxZw03DPyzZ58; Sun, 1 Sep 2024 15:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 481F68mS002478; Sun, 1 Sep 2024 15:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481F68IY002475; Sun, 1 Sep 2024 15:06:08 GMT (envelope-from git) Date: Sun, 1 Sep 2024 15:06:08 GMT Message-Id: <202409011506.481F68IY002475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5ab1e5f7e558 - main - pf: improve the ICMPv6 direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ab1e5f7e5585558a73b723f07528977a82cee82 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5ab1e5f7e5585558a73b723f07528977a82cee82 commit 5ab1e5f7e5585558a73b723f07528977a82cee82 Author: Kristof Provost AuthorDate: 2024-08-26 12:59:38 +0000 Commit: Kristof Provost CommitDate: 2024-09-01 15:05:28 +0000 pf: improve the ICMPv6 direction check Following bluhm's advice this changes the way we setup state keys and perform state lookups for ICMPv6 Neighbor Discovery packets: - replace the NS-dst with ND target address; - replace the NA-src with ND target address; - replace the NA-dst with unspecified address if it is a multicast. This allows pf to match Address Resolution, Neighbor Unreachability Detection and Duplicate Address Detection packets to the corresponding states without the need to create new ones or match unrelated ones. As a side effect we're doing now one state table lookup for ND packets instead of two. Fixes a bug uncovered by one of the previous commits that virtually breaks IPv6 connectivity after few minutes of use. ok stsp henning, with and ok bluhm PR: 280701 MFC after: 1 week Obtained from: OpenBSD, mikeb , 2633ae8c4c8a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 4 +- sys/netpfil/pf/pf.c | 116 ++++++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 10bf527c025d..43d4b908a407 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2576,8 +2576,8 @@ u_short pf_get_translation(struct pf_pdesc *, struct mbuf *, uint16_t, uint16_t, struct pf_kanchor_stackframe *, struct pf_krule **); -struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, - struct pf_addr *, u_int16_t, u_int16_t); +struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct mbuf *, int, + struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); struct pf_state_key *pf_state_key_clone(const struct pf_state_key *); void pf_rule_to_actions(struct pf_krule *, struct pf_rule_actions *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index acbaf304995f..b4f8bdeeff24 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -331,6 +331,9 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, u_int16_t, u_int16_t, int *, struct pfi_kkif *, struct pf_kstate **, int, u_int16_t, u_int16_t, int, struct pf_krule_slist *); +static int pf_state_key_addr_setup(struct pf_pdesc *, struct mbuf *, + int, struct pf_state_key_cmp *, int, struct pf_addr *, + int, struct pf_addr *, int); static int pf_test_fragment(struct pf_krule **, struct pfi_kkif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_krule **, struct pf_kruleset **); @@ -347,7 +350,7 @@ static int pf_test_state_udp(struct pf_kstate **, void *, struct pf_pdesc *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, struct mbuf *, - int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int, struct pfi_kkif *, u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, @@ -401,7 +404,7 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s) \ do { \ @@ -1495,9 +1498,66 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) return (0); } +static int +pf_state_key_addr_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, + int didx, struct pf_addr *daddr, int multi) +{ +#ifdef INET6 + struct nd_neighbor_solicit nd; + struct pf_addr *target; + u_short action, reason; + + if (pd->af == AF_INET || pd->proto != IPPROTO_ICMPV6) + goto copy; + + switch (pd->hdr.icmp6.icmp6_type) { + case ND_NEIGHBOR_SOLICIT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + daddr = target; + break; + case ND_NEIGHBOR_ADVERT: + if (multi) + return (-1); + if (!pf_pull_hdr(m, off, &nd, sizeof(nd), &action, &reason, pd->af)) + return (-1); + target = (struct pf_addr *)&nd.nd_ns_target; + saddr = target; + if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { + key->addr[didx].addr32[0] = 0; + key->addr[didx].addr32[1] = 0; + key->addr[didx].addr32[2] = 0; + key->addr[didx].addr32[3] = 0; + daddr = NULL; /* overwritten */ + } + break; + default: + if (multi == PF_ICMP_MULTI_LINK) { + key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[sidx].addr32[1] = 0; + key->addr[sidx].addr32[2] = 0; + key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + saddr = NULL; /* overwritten */ + } + } +copy: +#endif + if (saddr) + PF_ACPY(&key->addr[sidx], saddr, pd->af); + if (daddr) + PF_ACPY(&key->addr[didx], daddr, pd->af); + + return (0); +} + struct pf_state_key * -pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, - struct pf_addr *daddr, u_int16_t sport, u_int16_t dport) +pf_state_key_setup(struct pf_pdesc *pd, struct mbuf *m, int off, + struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t sport, + u_int16_t dport) { struct pf_state_key *sk; @@ -1505,8 +1565,12 @@ pf_state_key_setup(struct pf_pdesc *pd, struct pf_addr *saddr, if (sk == NULL) return (NULL); - PF_ACPY(&sk->addr[pd->sidx], saddr, pd->af); - PF_ACPY(&sk->addr[pd->didx], daddr, pd->af); + if (pf_state_key_addr_setup(pd, m, off, (struct pf_state_key_cmp *)sk, + pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + uma_zfree(V_pf_state_key_z, sk); + return (NULL); + } + sk->port[pd->sidx] = sport; sk->port[pd->didx] = dport; sk->proto = pd->proto; @@ -5210,7 +5274,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, if (nr == NULL) { KASSERT((sk == NULL && nk == NULL), ("%s: nr %p sk %p, nk %p", __func__, nr, sk, nk)); - sk = pf_state_key_setup(pd, pd->src, pd->dst, sport, dport); + sk = pf_state_key_setup(pd, m, off, pd->src, pd->dst, sport, dport); if (sk == NULL) goto csfailed; nk = sk; @@ -6655,9 +6719,9 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, - u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, - int inner) + struct pf_kstate **state, struct mbuf *m, int off, int direction, + struct pfi_kkif *kif, u_int16_t icmpid, u_int16_t type, int icmp_dir, + int *iidx, int multi, int inner) { key->af = pd->af; key->proto = pd->proto; @@ -6670,25 +6734,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + if (pf_state_key_addr_setup(pd, m, off, key, pd->sidx, pd->src, + pd->didx, pd->dst, multi)) + return (PF_DROP); STATE_LOOKUP(kif, key, *state, pd); @@ -6751,7 +6799,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { @@ -6759,7 +6807,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, state, m, + ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); if (ret >= 0) @@ -7167,7 +7215,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) @@ -7222,7 +7270,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pf_icmp_mapping(&pd2, iih->icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { @@ -7231,7 +7279,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (*state != NULL) PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, - state, m, pd->dir, kif, + state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); if (ret >= 0) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 68fc76233dab..6b0b95e9ce01 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -637,7 +637,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, return (PFRES_MAX); } - *skp = pf_state_key_setup(pd, saddr, daddr, sport, dport); + *skp = pf_state_key_setup(pd, m, off, saddr, daddr, sport, dport); if (*skp == NULL) return (PFRES_MEMORY); *nkp = pf_state_key_clone(*skp); From nobody Sun Sep 1 15:06:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxZw16DD2z5VLJv; Sun, 01 Sep 2024 15:06: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 4WxZw14lgmz4YQ9; Sun, 1 Sep 2024 15:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9xH8rGydmHQJxiQd4lcHzsRmer0n9qQEIp40Alp38Y=; b=jY3+uPVqNu7YNElcoGxtN4HR0JQsCkmhGe+K8GEgrK0P1c9/nhyt4cBdw6BBDHv4uzOK3M 8CXs0dERtAsxQ2Rw7zgduOD8A9gDWZelEsPuuD2twRyFUHMIP94+IR/Y86ORpYhjP8kRP1 e988kAw+u+Wu7+KGWug86FZvK94qIqwc/IxwH9PkP6+086mfoApzN1nh08v5zxJpHv1nXQ BmPgE9rc6oKkC4fYDHa+NzdsgXIevgeT9PxkERQPrh3vgNE9jqlyXZPNT3C2NTIUIqzd1t sAfsh/O0a5z88+KpSaq2xrxbIb3/umH9iDVQdt8TvvaMKtAsYDLzqr3E2mxZeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725203169; a=rsa-sha256; cv=none; b=k/+2M7Cjr7f2zZ18bacSjoEn49+hSsJrlTsYAyU2wuiibbYa5iP4+/d0MkBu0h6yW5/Ms2 5F8Q54Tnki5mG0KjPY8habM+1dzzOoRGXhjLS0j5Jr34AK5A+IHlKFygGjyJvb9xXafPu4 SvjzLjbqjvweQ/Qela2mOK5ogl9PfXXdRWfjBN0IiJwDG/D7QzPGyu3NYhCtj5F9OTaNSc 28mjlrMUyll+lINf4tA7YHSZQ2mXVAy1yu1W8BAtFtSlw/kYve1aWeJCi2xpNW9c3Yn1q9 z5cYysQIeSjh8u/UIqRUKcJ7Lnl/iNojakUWKeu0cUMPRFNieWewA/2QrUVCiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9xH8rGydmHQJxiQd4lcHzsRmer0n9qQEIp40Alp38Y=; b=fcMGvs5Ztv3CCTmZlMZ4Wk1sCXomrGrieZ2Ffd+hOv6o5TGM2GXRhEbA/vT12UrkrMV4Ig CaFpVqaNzQp7zpJkcINrXYQPgWCijro9wjuexBC6RT8cDcpLwoTW45xuvkhUC1GycnLlIH 6vMiwpkvsQ2fPVNBTZlyiHhpQHkCwwczvuuwzv8Y7+hJoxkP0VmHk+I7G/Hk+e9k3SE0to APvsD3HG+mXK+uSua8cKSX0ahnM1kNeNR59bGlj1jnwbcqe51gb3U5ZOSiyQskDFeLKAk5 aHVDko89fjMsJPo8wadpUd864kjjLZWFMPKjeE4O6r9v8Ew/W+0v3WYp7LMrFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxZw13pKDzZ61; Sun, 1 Sep 2024 15:06: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 481F69tG002532; Sun, 1 Sep 2024 15:06:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481F693e002529; Sun, 1 Sep 2024 15:06:09 GMT (envelope-from git) Date: Sun, 1 Sep 2024 15:06:09 GMT Message-Id: <202409011506.481F693e002529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d154dc21130b - main - pf tests: ensure that neighbour discovery works as expected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d154dc21130b607d7903f276dd6d463b990f33f7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d154dc21130b607d7903f276dd6d463b990f33f7 commit d154dc21130b607d7903f276dd6d463b990f33f7 Author: Kristof Provost AuthorDate: 2024-08-26 13:02:22 +0000 Commit: Kristof Provost CommitDate: 2024-09-01 15:05:28 +0000 pf tests: ensure that neighbour discovery works as expected Also check repeated calls. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/icmp6.sh | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh index b9b60a484afc..eb286e23ef4c 100644 --- a/tests/sys/netpfil/pf/icmp6.sh +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -149,8 +149,56 @@ ttl_exceeded_cleanup() pft_cleanup } +atf_test_case "repeat" "cleanup" +repeat_head() +{ + atf_set descr 'Ensure that repeated NDs work' + atf_set require.user root + atf_set require.progs ndisc6 +} + +repeat_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block all" \ + "pass quick inet6 proto ipv6-icmp all icmp6-type neighbrsol keep state (if-bound) ridentifier 1000000107" + + jexec alcatraz pfctl -x loud + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv + atf_check -s exit:0 -o ignore \ + ndisc6 -m -n -r 1 2001:db8::1 ${epair}a + jexec alcatraz pfctl -ss -vv +} + +repeat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "zero_id" atf_add_test_case "ttl_exceeded" + atf_add_test_case "repeat" } From nobody Sun Sep 1 15:06:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxZw26T3Kz5VLJB; Sun, 01 Sep 2024 15:06: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 4WxZw25Pnyz4YXn; Sun, 1 Sep 2024 15:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=78FXSSu7+Xz/y7x5f2PIKBAAsPt3kpC9UVdUPQGx4wY=; b=eS+KEOkWPcflpOws5GKStAAAg5UdY40LtpbftBwNc7HlxKqc/RSJly7a1Lb9NfnjwAsa54 wrFKBYBFgcO5lEzy+TlN1UAumUqwSL+Lja0rpWTxTTjVXLnSiKvh5rd3sOHsgXl08oI2+h hqEUSzOk0MHcFXnNnxpJCmGH5j8GwWdsYQhbOjZ+HqMwNXpu2qes3ViYXOYZxnx6NIrKju ZiNgQkT8JhJzZZgBE835ofXuJClYLVNawdyljbhSeuWDro8g6HtCp/ChV6xo+UZsmUVrVw vCSN/8p2s3zZ4z44lZkOon2XyMfJL/H/99CGOwitKutPPK0ZIAkdkGfWB0eRLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725203170; a=rsa-sha256; cv=none; b=tOFU4Xj6Z29Sry4ZCM2Iu9Eqzm+WMkLe5Oz1LHdcoeBURAABhMO1PDIKKN1gcJ2IAC8BW4 v/wwiE2ckurLPDyIZhPvwuTja5wmYsR25BDyWWGoTsED8IZWM5JUpTxXAQEvNcMp5eKzxm 3oJU2EEADZUcNHtDKQw+qIfidYeIq3KI0umW4yc7O4WvXmjwyqJx2Gl0vsrAXTN+8Fz3+N d8BQ7yS1BaDy4R/Y+I0BJebNpW/aSjPpdt/W1f5mn7AzLzeIvyzVsol3Bkv6sH2Jc3mo6e u9liWbPfdckjg8g3ElzZCos1w2hkJsk6O3HjQL3oTUT2Icwq016g6BsW0BeV/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=78FXSSu7+Xz/y7x5f2PIKBAAsPt3kpC9UVdUPQGx4wY=; b=fFOW8nvwEd+HmKrHOKad0ZQbtTyySAJSCQ5+KkF3oi7HN/3yTe0lxIunr+KRC3FK5aRpIm MoU6ztze/ee6h+von7ktdcC/TYem2xACjGUBC1QSiL8knDhkdnp3R5D6P7G0XdEYM/FlYB KQBuAdolitg97a4jjBptSsOES4tzBxXdVo4H38AAqLW+Mef6KPCMGGzXgArc80rwoG1Ell snoGmD9pwGqhGQJBcXZRTJL+y1qu5LYMMvzQowpqi79ZeugPqYJzB72TtoJVjGWBlyWNnt 1q2gknLATR7/bsuXAkTRJwAkf7jsD0bBCX6lYmhcAn9KDx0YBt3z5uaN18H2Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxZw24d7fzYLK; Sun, 1 Sep 2024 15:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 481F6A6l002598; Sun, 1 Sep 2024 15:06:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481F6AeA002595; Sun, 1 Sep 2024 15:06:10 GMT (envelope-from git) Date: Sun, 1 Sep 2024 15:06:10 GMT Message-Id: <202409011506.481F6AeA002595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b8cd169efa6a - main - pf: try to lookup the icmp state based on a correct packet descriptor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8cd169efa6ac0899b4998898129765ae5c685a6 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b8cd169efa6ac0899b4998898129765ae5c685a6 commit b8cd169efa6ac0899b4998898129765ae5c685a6 Author: Kristof Provost AuthorDate: 2024-08-26 14:42:05 +0000 Commit: Kristof Provost CommitDate: 2024-09-01 15:05:28 +0000 pf: try to lookup the icmp state based on a correct packet descriptor MFC after: 1 week Obtained from: OpenBSD, mikeb , e467ea25dcd3 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index b4f8bdeeff24..94c333e67c57 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7274,11 +7274,11 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && + if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { if (*state != NULL) PF_STATE_UNLOCK((*state)); - ret = pf_icmp_state_lookup(&key, pd, + ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); From nobody Sun Sep 1 15:06:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxZw41YhZz5MQsg; Sun, 01 Sep 2024 15:06: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 4WxZw36nkPz4YBg; Sun, 1 Sep 2024 15:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEu8PHdAMyK8l0DZKnSZhg4V0S80m0OuUXmXvdlENyI=; b=Qlj1tdlZNFJgRMyoEy9sZVQx0MGaF9ysXzwGyaKxffBLM/7pOQczT1PJ3yI+xzAq9MWg0k oT7hjjNzoFGF/exEauK7AJEkjT/+m20kaUoJyqq+kREZFCUO7m2vPqFo02i9mtp28De8Nv PH1OYWBPKlSpVW1HRSxVQQ2xgtBweIluYUgvwO1rq8VsdEuML9lzwRr/58nXD8IZp7/f7Z QhowY49xc+Xa8j4P+a7QVgxBAWibuWNRnKWBHi5gx+jw9HcxmHcmaZl1DHZ+eNOQrHj5qA UJfYhXLi6eg9zBWYW0+iSqlqEdIS/rB1wmt34vSQNyIaaarxYJLC3fm3O5oMqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725203171; a=rsa-sha256; cv=none; b=vJMt0jCxyM+XvjVd792bxdxNzYqUQkTCjTSql7/YxXBZ41spjV24PKbUSKq4ue44Ik7yDa /yxHq4O68pFt8BUUgpzPG+fTwIua9ASf2aMEIBJaTXvLWWATU7YVcwsKp7UfmLD7OU0bfX va8abHxRktaksu8YrhtE6KfbD8CGynbfkOzBIdjHC9ewo6K0mDfBrxry3JvM9j1MtIW4BB 2ZeQP40eUTA2lX/UwvTJFpGQUGy6tLyNIk1xRIdxpkcVpDIkYxgKV1ECk9WaTVYZC1U7DF SOESxri/tSj09J1Ex28bfaLk8c1bSybGLk5U4pdn8x1uvRXQ5zKWURdO/hDBEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEu8PHdAMyK8l0DZKnSZhg4V0S80m0OuUXmXvdlENyI=; b=niX+6EL4yN3a/+YPWiuxgFkvjI1V/y9MboGlsDbHXE+SYp9NwfhQ08iZdMzHbp0yPnkUrk ZzCLMtRjUdZAeXVOlb4c6Qq1bFcClzqlcpF12jZOJsuVKtf9d49lcJVZv2CreA4pSOM+zC 2mvMX7dtoEVaM0CfJzVnBFJW6pDSYSlOp+eVCIvoFQ+eojuj5sm5/9NON5D1Mut2ipHzD7 4lyDGaMO/gC4APjxqntCX243iFpELklZXcKU96hPqOPRzfihjKzaPS0q5AHNlzSlk8M7if 33h813jMiHIrQL98xW6zqfTOXCUlOMSDQnjD1InwVZZ8zYU/vMeBcnAl0MBl3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxZw36MHqzZ59; Sun, 1 Sep 2024 15:06: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 481F6BCR002661; Sun, 1 Sep 2024 15:06:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481F6BGK002658; Sun, 1 Sep 2024 15:06:11 GMT (envelope-from git) Date: Sun, 1 Sep 2024 15:06:11 GMT Message-Id: <202409011506.481F6BGK002658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3da3eb6081a2 - main - pf: be less strict about icmp state checking for sloppy state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5 commit 3da3eb6081a2e2f6ea2fed1728d5dd7f9e8786e5 Author: Kristof Provost AuthorDate: 2024-08-26 14:44:20 +0000 Commit: Kristof Provost CommitDate: 2024-09-01 15:05:29 +0000 pf: be less strict about icmp state checking for sloppy state tracking Sloppy state tracking renders ICMP direction check useless and harmful as we might see only half of the connection in the asymmetric setups but ignore the state match. The bug was reported and fix was verified by Insan Praja . Thanks! OK mcbride, henning MFC after: 1 week Obtained from: OpenBSD, mikeb , 538596657140 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 94c333e67c57..e28bad8750f9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6740,6 +6740,9 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, STATE_LOOKUP(kif, key, *state, pd); + if ((*state)->state_flags & PFSTATE_SLOPPY) + return (-1); + /* Is this ICMP message flowing in right direction? */ if ((*state)->rule.ptr->type && (((!inner && (*state)->direction == direction) || From nobody Sun Sep 1 15:06:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WxZw5575tz5VLK1; Sun, 01 Sep 2024 15:06: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 4WxZw50SJgz4YTD; Sun, 1 Sep 2024 15:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8PUBRWtgknrqsMnuifK7zKFm5+DPWkr0Fx9Vqf5JIw=; b=wF+Sjgfy7xbNHjluTBtALJVwzM6zTv7Onlri8uYsWtpXUAqpaMKDuiApLGG4QR+DJkdCZX mapl3zE+hNUUNegSPSEP0P3l5nHge3QD95tMsLZYqbY6Pxtd7hggVF4xdlWgjoH0gfhxjf pWbIqLW1AJZdfVY+3lSQB+B9N/KsLI6O3FBz7nobdzAvGBR/GxuSJfbia1ROdedIadZy2p He4JPaMaSmge7WtZ6gYSmP0IwjFpXTtjWegUl+qsQ6bVYqqUjCHu6Kjf5Ujw20yIVoF2lf JqU03iorCZZtVFbSmmYImvDr77tr4xkklsjxD/3g0ggZQtdSlpMzT0KlPai2EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725203173; a=rsa-sha256; cv=none; b=c16q95Z6LrA1asek4FmavNiTe5m5o5yPJzr+3Pd/rEPuL1AjEBzT0Py0H1GG+jP01qBRmI kyGC5j+uG+WEm/patRP4UFTLiceXI6H1ub6yUPoxl2ZeZG7QruBGvACf1Ra9+u/ty9XD9y 4zL3aqzBYlwFYfaUqlh7RCPd2asSqRbdqnEl6Yhwyut0IqUXwYXlfZCWZZRXlu4zMtqdJo E6eD/4QjmMXJoUWJR2ogY8uuGYiz+GSoOy3gTxVDm1ssrwvlrf/lA/XI7DfA2E3jv/eGeM nLzy2Hc+TAj7Wc7/Gsr+sB+jc0g3vA7qYvkCekDnNb+8ypls5esN7EUe3iGerw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725203173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8PUBRWtgknrqsMnuifK7zKFm5+DPWkr0Fx9Vqf5JIw=; b=u5SlJUcLNDWhi57zGBMqINWnEZiPkZ5+mBYdVWo9kgfK8AggnnlWZxPETbZLfwGUtboFWb 3vhisu9QUSEVvfmAdOqkT3fH4Ao04PeUvZhgwZNzAKVTdVrglsifJ1Xy3JuXxHIp4tKwdm ocKblHyoCvRPtKrUNL5v1aTX9giVC9gm0bDxuK+j0DGEwCD0W45pVC88kA3FCep5LhOKWP cWGjTt6oJf5yki3YCs8fYROv/3+yx5GGZIKstFM80rtuUkCX8CAF2T0I7hDfl9Zr2s5jQ1 Xakx7VSixwQ/ZYAOIglAoU8Nt7rsLbW/mUjcA1qyXVvtlvzgcBKIB5FFCdOswQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WxZw501QBzZ5B; Sun, 1 Sep 2024 15:06: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 481F6CC5002710; Sun, 1 Sep 2024 15:06:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481F6CtG002707; Sun, 1 Sep 2024 15:06:12 GMT (envelope-from git) Date: Sun, 1 Sep 2024 15:06:12 GMT Message-Id: <202409011506.481F6CtG002707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0578fe492284 - main - pf: rework pf_icmp_state_lookup() failure mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0578fe492284ded4745167060be794032e6e22f0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0578fe492284ded4745167060be794032e6e22f0 commit 0578fe492284ded4745167060be794032e6e22f0 Author: Kristof Provost AuthorDate: 2024-08-30 11:36:39 +0000 Commit: Kristof Provost CommitDate: 2024-09-01 15:05:29 +0000 pf: rework pf_icmp_state_lookup() failure mode If pf_icmp_state_lookup() finds a state but rejects it for not matching the expected direction we should unlock the state (and NULL out *state). This simplifies life for callers, and also ensures there's no confusion about what a non-NULL returned state means. Previously it could have been left in there by the caller, resulting in callers unlocking the same state twice. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 43d4b908a407..7b3c1c49696a 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -374,8 +374,8 @@ struct pfi_dynaddr { mtx_unlock(_s->lock); \ } while (0) #else -#define PF_STATE_LOCK(s) mtx_lock(s->lock) -#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#define PF_STATE_LOCK(s) mtx_lock((s)->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock((s)->lock) #endif #ifdef INVARIANTS diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e28bad8750f9..f7fe75184efd 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6754,6 +6754,8 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, pf_print_state(*state); printf("\n"); } + PF_STATE_UNLOCK(*state); + *state = NULL; return (PF_DROP); } return (-1); @@ -6806,15 +6808,16 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 0); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 0); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } @@ -7221,8 +7224,10 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd2.dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -7277,16 +7282,17 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); if (ret >= 0) { + MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { - if (*state != NULL) - PF_STATE_UNLOCK((*state)); ret = pf_icmp_state_lookup(&key, &pd2, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, multi, 1); - if (ret >= 0) + if (ret >= 0) { + MPASS(*state == NULL); return (ret); + } } else return (ret); } From nobody Sun Sep 1 17:55:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxfgn3cQjz5MhKJ; Sun, 01 Sep 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wxfgn34tZz4rnH; Sun, 1 Sep 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6l1wwf0bI6bHxH7gs+Zwm/KO8QpUk/wJ1f/hNX+AmA=; b=hvqVzM1BC9xkn1U7tIkRbWsmUOdN4sRV9o09Zrz+VHCmfdHOLbgJKtMC4SGmPM0vxm9ll+ DMlfFUakm+OkaahIbvvd6e/LNlmkjqtJKsqRRX0SHvUhxxgP1dzUDnuUsj3EZtIjCP0uMx kL9QJ9bAXOaCcjb7AbtOBwe+Tdnk/l1WoAV1MlM3MqHZdPzGdgwjvVyxDl63jSCp0ADcne BMxkKOuGNCf/621/Gt3oygsuOku2OBygZrj3qCBTAOlrkpM+Lw6rtjIcS5/J4aqbWnw/Pe 5Aw3IYcLJu1AslgwVyEBd3QBSZKd4oh3zhx1PlIrgtahkHcjBLEh0Q4VB6M7nQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725213349; a=rsa-sha256; cv=none; b=SZfa55J3s0acJDsqp9DJ6b+Vt6FvgLY9rqkWGUjfZQ5FD/zeW91clZWFEZ+8vAZsMvJKSB VCvejKVRuC9jnvkkTkv3RX+AUTP2RENREbV6S0Xt9Du7sbQ+GE5KRpxsnS9HVCCCBhb6Ya ViU/R+kZIXbxEXN1SHUwXuFq4Pz9xzN+KPRBiccMUN5g7uNu63v9Mx5WdwGeenQI+OGnF0 FLb/pxsZXE/l9vq1+3wsrWYZVN7CUk1fw+hk1ASZdi2/sxuudlHQMF1ijVC+gUSM7s8BhU 6EOC1leiTs6Wyt5zXbxQv9DIxf4IA7yDDmdz+Nvipkn4yVDjxyvL2iK0u1vi9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6l1wwf0bI6bHxH7gs+Zwm/KO8QpUk/wJ1f/hNX+AmA=; b=L3kbkkLpYJJhIgXyPX80QIi/0uryJshV5D2C1sCgfScL8rIPoyvsm84/6nDjJ0uzzcsEOa sCETPcM2ghY1m02kEzD1uAAC7c0B+j8z+66z5eH1zM/Rr4A+Ywa1NeARxHUs3P794/xvBv Hz1N8HXhOhz2kZNfQUtl3Bc2Ojif1tI2rEsjhhms2OXGc/zpf2jjzeEkSDbo/y28aBzkbG IxiG/jQswViypfAedQCmuLS8BLTU9AFMRDBamfYGsIusRC8pdpfFBefgcc2KdPYCLgabNM fhv3kRLXj8hol1cY9Sd2dLaI/FqZPf8ygcCkcDu82kIaFq7GXi3lh/aY4Nocuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wxfgn2hFWzdh7; Sun, 1 Sep 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 481Htn3E091423; Sun, 1 Sep 2024 17:55:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481Htn7k091420; Sun, 1 Sep 2024 17:55:49 GMT (envelope-from git) Date: Sun, 1 Sep 2024 17:55:49 GMT Message-Id: <202409011755.481Htn7k091420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 574f00950dd0 - stable/13 - libnetmap: remove interface name validation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 574f00950dd00137f4218d01ed9a2d7d4b733772 Auto-Submitted: auto-generated The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=574f00950dd00137f4218d01ed9a2d7d4b733772 commit 574f00950dd00137f4218d01ed9a2d7d4b733772 Author: Vincenzo Maffione AuthorDate: 2023-12-21 14:43:57 +0000 Commit: Vincenzo Maffione CommitDate: 2024-09-01 17:54:48 +0000 libnetmap: remove interface name validation When trying to use a VLAN device (e.g. "em0.123") with a dot the library fails to parse the interface correctly. The former pattern is much too restrictive given that almost all characters can be coerced into a device name via ifconfig. Remove the particularly restrictive validation. Some characters still cannot be used as an interface name as they are used as delimiters in the syntax, but this allows to be able to use most of them without an issue. Submitted by: franco@opnsense.org Differential Revision: https://reviews.freebsd.org/D42485 Reviewed by: vmaffione (cherry picked from commit ad874544d9f018bf8eef4053b5ca7b856c4674cb) --- lib/libnetmap/nmreq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/libnetmap/nmreq.c b/lib/libnetmap/nmreq.c index fd6a9d47039a..56fbe3ad40b2 100644 --- a/lib/libnetmap/nmreq.c +++ b/lib/libnetmap/nmreq.c @@ -156,11 +156,6 @@ nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx * for (pipesep = vpname; pipesep != scan && !index("{}", *pipesep); pipesep++) ; - if (!nm_is_identifier(vpname, pipesep)) { - nmctx_ferror(ctx, "%s: invalid port name '%.*s'", *pifname, - pipesep - vpname, vpname); - goto fail; - } if (pipesep != scan) { pipesep++; if (*pipesep == '\0') { From nobody Sun Sep 1 17:57:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wxfjb1sB1z5MhQY; Sun, 01 Sep 2024 17:57: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 4Wxfjb1LQWz4sW8; Sun, 1 Sep 2024 17:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=39hwvT0ozqiva19QKxOcY784Fjfh4CtOfmD9U9OlRlQ=; b=DD9b4yH2DOtmrjlXE0KdICLyMPvoMmb+bZUunY4+OSb/2aLPLcsqqc7ME/A5bi3wbvEKKt hJafj+P0+L8mRNpXCvSC/s+VKnYqp+r3V7kK7aY3KRi5DM7yW5zAKpDIFCsRtBvj9Flkdk 1HHM16veLfaDPYz2zu+j9O72BiUKXAE61/f13mfMijp9MnMxIa15kiDXCSJsD8tSC5+oTl qxLADjuuHc0NInQGGmoJqMzwUtXuoPvbKDdfwEIsw7TM5XG7/Ogoj1CsNBTsKEEYANlyf0 D5YFVkw3l0UEqoXYBX027GoWuxnQiZzkyWC3CX/BNI8RJmdzsOdFDpggwqncmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725213443; a=rsa-sha256; cv=none; b=iDG2klyz7jY43lfA0kDhhofC6EQ6k+eqDP16u+XwL3X1zhpxrt5htvRUk8MYxgxshxmTm7 HmCwbmt4bcJY5dx4MEztLOjHVia1kPygyVGimsCqJ82rMJaXW+AssrKmQTI8cVOEwdYnvT k1Hmf3KdUyDHIKNRHxrCsHmsFpjIfBPslv+Xihz8h+iLtOpElOAoy0n9ChON8bvXl1LsR5 bfZ/N5WPz8VET/CZCtiZzgQ1Zq43/pf50ZKJPjCnSPa5u8jfQgWkND3GWb8qtFd1nRn/Ck dVDDDboeCu2DsDoMxNuKE3MmDZv+aJ5WQCxvxwKb1jDKj6t8bk/giVn7kxqG2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725213443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=39hwvT0ozqiva19QKxOcY784Fjfh4CtOfmD9U9OlRlQ=; b=HQ72ngUMSRVxcCyPK1lg24hnz9xWxZCUn/KQ0GIeTUSiJuwqb61B/WLTpI/85L5Ux/odmT t/I5RX+ZHigmyC0YvAiuRxYIvOGV01a1wyckXQ2cKCAKB1fkvPR46zK6ZkLdgNmRXVR9QW 7Q9lPTHlRufJWT2k1E/RZlFm5SOL+T3ItZ3DUgJx2rZnzYP3HD1ylV224Q76svjpspEm0l nitTQIPD7p2NzOucyjZx3pd84hK4TFg7Upk3Yj68TJueIaW4LNW0/SV6eCju0Hgh2KDZwS klZabhseN+bGA0gviVPlGYvAgwb75mDsqheOrBVbXSC3i5C2zwpOHwP2sEfzRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wxfjb0x1vzdh8; Sun, 1 Sep 2024 17:57: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 481HvNCL091786; Sun, 1 Sep 2024 17:57:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481HvNRB091783; Sun, 1 Sep 2024 17:57:23 GMT (envelope-from git) Date: Sun, 1 Sep 2024 17:57:23 GMT Message-Id: <202409011757.481HvNRB091783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 20a2a59f3990 - stable/14 - libnetmap: remove interface name validation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 20a2a59f3990778a82bccf0e69ce8f9d7f6a904a Auto-Submitted: auto-generated The branch stable/14 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=20a2a59f3990778a82bccf0e69ce8f9d7f6a904a commit 20a2a59f3990778a82bccf0e69ce8f9d7f6a904a Author: Vincenzo Maffione AuthorDate: 2023-12-21 14:43:57 +0000 Commit: Vincenzo Maffione CommitDate: 2024-09-01 17:56:17 +0000 libnetmap: remove interface name validation When trying to use a VLAN device (e.g. "em0.123") with a dot the library fails to parse the interface correctly. The former pattern is much too restrictive given that almost all characters can be coerced into a device name via ifconfig. Remove the particularly restrictive validation. Some characters still cannot be used as an interface name as they are used as delimiters in the syntax, but this allows to be able to use most of them without an issue. Submitted by: franco@opnsense.org Differential Revision: https://reviews.freebsd.org/D42485 Reviewed by: vmaffione --- lib/libnetmap/nmreq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/libnetmap/nmreq.c b/lib/libnetmap/nmreq.c index 645f01abc130..2477337d8791 100644 --- a/lib/libnetmap/nmreq.c +++ b/lib/libnetmap/nmreq.c @@ -156,11 +156,6 @@ nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx * for (pipesep = vpname; pipesep != scan && !index("{}", *pipesep); pipesep++) ; - if (!nm_is_identifier(vpname, pipesep)) { - nmctx_ferror(ctx, "%s: invalid port name '%.*s'", *pifname, - pipesep - vpname, vpname); - goto fail; - } if (pipesep != scan) { pipesep++; if (*pipesep == '\0') {